diff --git a/README.md b/README.md index 76c4d65..bf23378 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ Inspired by [Leandro Ferreira’s Apex Charts plugin](https://filamentphp.com/pl - [Live updating (polling)](#live-updating-polling) - [Defer loading](#defer-loading) - [Loading indicator](#loading-indicator) + - [Chart overlay](#chart-overlay) + - [Post-init JS hook](#post-init-js-hook) + - [Dark / light theme sync](#dark--light-theme-sync) + - [Plotly event listeners](#plotly-event-listeners) + - [Streaming support](#streaming-support) + - [Streaming layout patch](#streaming-layout-patch) - [Changelog](#changelog) - [Contributing](#contributing) - [Credits](#credits) @@ -475,10 +481,419 @@ protected function getLoadingIndicator(): null|string|View ``` -## Dark mode +## Chart overlay + +Use `getChartOverlay()` to render HTML **inside** the chart container — directly on top of the Plotly canvas. This is the right place for progress bars, custom annotation panels, and loader overlays, because the content sits naturally inside the chart div without requiring `document.getElementById` or absolute-positioning tricks. + +```php +use Illuminate\Contracts\Support\Htmlable; +use Illuminate\Contracts\View\View; + +protected function getChartOverlay(): null|string|Htmlable|View +{ + return view('charts.my-overlay'); +} +``` + +```html +{{-- resources/views/charts/my-overlay.blade.php --}} + +``` + +> The overlay is rendered inside a `wire:ignore` container, so it is set once on mount and then controlled by JavaScript. It will not be re-rendered by Livewire on subsequent updates. + +## Post-init JS hook + +Override `getOnChartReadyScript()` to run plain JavaScript the moment the Plotly chart is fully initialised. Inside the script, `el` refers to the chart DOM element. + +```php +protected function getOnChartReadyScript(): ?string +{ + return <<<'JS' + // `el` is the Plotly chart DOM element + el.on('plotly_afterplot', () => { + document.getElementById('stream-progress').style.display = 'none'; + }); + JS; +} +``` + +## Dark / light theme sync + +Use the `HasChartTheme` concern to keep Plotly's visual theme in sync with Filament's dark/light mode automatically. The Alpine component watches the `dark` class on `` via a `MutationObserver` and calls `Plotly.relayout()` whenever the mode changes — no `getFooter()` workaround needed. + +```php +use Asharif88\FilamentPlotly\Concerns\HasChartTheme; +use Asharif88\FilamentPlotly\Widgets\PlotlyWidget; + +class RevenueChart extends PlotlyWidget +{ + use HasChartTheme; + + protected function getDarkThemeLayout(): array + { + return [ + 'paper_bgcolor' => '#1e293b', + 'plot_bgcolor' => '#1e293b', + 'font' => ['color' => '#f1f5f9'], + ]; + } + + protected function getLightThemeLayout(): array + { + return [ + 'paper_bgcolor' => '#ffffff', + 'plot_bgcolor' => '#ffffff', + 'font' => ['color' => '#0f172a'], + ]; + } +} +``` + +The layout properties returned by each method are merged into the live chart layout via `Plotly.relayout()`. Return any valid [Plotly layout](https://plotly.com/javascript/reference/layout/) keys. + +## Plotly event listeners + +Override `getPlotlyEventListeners()` to map Plotly JS events to public methods on your widget. When a mapped event fires, two things happen: + +1. The mapped method is called on this widget with a serialised payload. +2. A window-level Alpine event `plotly:{event}` is dispatched so that **sibling Livewire components** (a table, a slide-over) can also react without coupling to the chart widget. + +```php +protected function getPlotlyEventListeners(): array +{ + return [ + 'plotly_click' => 'onChartClick', + 'plotly_selected' => 'onChartSelected', + ]; +} + +public function onChartClick(array $data): void +{ + $recordId = $data['points'][0]['customdata'] ?? null; + + $this->dispatch('open-record', id: $recordId); +} + +public function onChartSelected(array $data): void +{ + $ids = collect($data['points'])->pluck('customdata')->filter()->all(); + + $this->dispatch('filter-table', ids: $ids); +} +``` + +Store the record's primary key in `customdata` when building trace data — that's the standard Plotly mechanism for carrying arbitrary metadata per point: + +```php +protected function getChartData(): array +{ + $rows = Order::query()->get(); + + return [[ + 'x' => $rows->pluck('created_at'), + 'y' => $rows->pluck('total'), + 'customdata' => $rows->pluck('id'), // ← record IDs travel with each point + 'type' => 'scatter', + 'mode' => 'markers', + ]]; +} +``` + +To react from a **separate** Livewire component (e.g. a `ListOrders` resource page), listen for the broadcasted window event: + +```php +use Livewire\Attributes\On; + +#[On('plotly:plotly_click')] +public function handleChartClick(array $data): void +{ + $this->tableFilters['id'] = $data['points'][0]['customdata']; + $this->resetTable(); +} +``` + +### Supported events and payload shapes + +| Event | Payload fields | +|---|---| +| `plotly_click`, `plotly_hover`, `plotly_unhover`, `plotly_doubleclick` | `points[]` → `{curveNumber, pointIndex, x, y, z, text, customdata, traceName}` | +| `plotly_selected`, `plotly_deselect` | `points[]` + `range`, `lassoPoints` | +| `plotly_legendclick`, `plotly_legenddoubleclick` | `{curveNumber, traceName}` | +| `plotly_relayout`, `plotly_restyle`, `plotly_autosize` | raw layout/style change object | + +DOM nodes, full trace objects, and axis definitions are stripped before serialisation — only safe, JSON-friendly values reach Livewire. + +## Streaming support + +The `HasStreamingSupport` concern replaces the traditional `getFooter()` SSE boilerplate with a small set of override methods. The library owns the `EventSource` lifecycle, the progress overlay, and component cleanup — your widget only declares what is domain-specific. + +### SSE message protocol + +Your server-side stream must emit JSON messages in this format: + +| Message | Meaning | +|---|---| +| `{"init": true, "total": N}` | Stream is starting; `N` is the total number of data messages expected (used for the progress bar). | +| `{"done": true}` | Stream finished. The library closes the `EventSource` and removes the progress overlay. | +| `{ ...data }` | A data point. Forwarded to `getOnStreamMessageScript()`. | + +### Basic example + +```php +use Asharif88\FilamentPlotly\Concerns\HasStreamingSupport; +use Asharif88\FilamentPlotly\Widgets\PlotlyWidget; + +class LiveSensorChart extends PlotlyWidget +{ + use HasStreamingSupport; + + public int $sensorId = 1; + + // Return null to disable streaming (e.g. before required state is set) + protected function getStreamUrl(): ?string + { + return url('/stream/sensor'); + } + + // Query-string params appended to the URL on both initial load and every restart + protected function getStreamParams(): array + { + return ['sensor_id' => $this->sensorId]; + } + + // JS body called for each data message. `d` = parsed JSON, `el` = chart DOM element. + // Return null to use the built-in default: Plotly.extendTraces(el, {x:[[d.x]], y:[[d.y]]}, [0]) + protected function getOnStreamMessageScript(): ?string + { + return <<<'JS' + Plotly.extendTraces(el, { x: [[d.ts]], y: [[d.value]] }, [0]); + JS; + } + + // JS body called once when {done: true} arrives, after the overlay is removed. + // `el` is the chart DOM element. Return null if no post-stream work is needed. + protected function getOnStreamDoneScript(): ?string + { + return null; + } + + protected function getChartData(): array + { + return [['x' => [], 'y' => [], 'type' => 'scatter', 'mode' => 'lines']]; + } +} +``` + +### Restarting the stream on filter changes + +Call `$this->dispatchStreamRestart()` from any `#[On(...)]` handler that changes widget state. The library closes the current `EventSource` and opens a new one using the return value of `getStreamParams()` at that moment. + +```php +use Livewire\Attributes\On; + +public ?int $sensorId = null; +public ?string $dateFrom = null; +public ?string $dateTo = null; + +#[On('sensorSelected')] +public function onSensorSelected(int $sensorId): void +{ + $this->sensorId = $sensorId; + $this->dispatchStreamRestart(); +} + +#[On('dateRangeChanged')] +public function onDateRangeChanged(?string $from, ?string $to): void +{ + $this->dateFrom = $from; + $this->dateTo = $to; + $this->dispatchStreamRestart(); +} + +protected function getStreamUrl(): ?string +{ + return $this->sensorId ? url('/stream/sensor') : null; +} + +protected function getStreamParams(): array +{ + return [ + 'sensor_id' => $this->sensorId, + 'date_from' => $this->dateFrom ?? '', + 'date_to' => $this->dateTo ?? '', + ]; +} +``` + +> Returning `null` from `getStreamUrl()` disables streaming entirely — useful when required state (e.g. a selected sensor) has not been set yet. + +### Full example with theme and click events + +The following shows `HasStreamingSupport`, `HasChartTheme`, and `getPlotlyEventListeners()` working together, which is the recommended pattern for a production streaming widget: + +```php +use Asharif88\FilamentPlotly\Concerns\HasChartTheme; +use Asharif88\FilamentPlotly\Concerns\HasStreamingSupport; +use Asharif88\FilamentPlotly\Widgets\PlotlyWidget; +use Livewire\Attributes\On; + +class PeakToPeakChart extends PlotlyWidget +{ + use HasStreamingSupport; + use HasChartTheme; + + protected ?string $pollingInterval = null; + protected static ?string $chartId = 'peakToPeakChart'; + protected static int $contentHeight = 660; + + public ?int $sensorId = null; + public ?string $axis = 'x'; + public ?string $dateFrom = null; + public ?string $dateTo = null; + + // --- Filter handlers ----------------------------------------------------- + + #[On('sensorSelected')] + public function onSensorSelected(int $sensorId, string $axis = 'x'): void + { + $this->sensorId = $sensorId; + $this->axis = $axis; + $this->dispatchStreamRestart(); + } + + #[On('dateRangeChanged')] + public function onDateRangeChanged(?string $from, ?string $to): void + { + $this->dateFrom = $from; + $this->dateTo = $to; + $this->dispatchStreamRestart(); + } + + // --- Chart data ---------------------------------------------------------- + + // Starts empty — data is streamed in via extendTraces + protected function getChartData(): array + { + return [[ + 'x' => [], + 'y' => [], + 'customdata' => [], + 'mode' => 'lines+markers', + 'line' => ['width' => 2, 'color' => 'orange'], + 'marker' => ['size' => 6, 'color' => 'orange'], + 'showlegend' => false, + ]]; + } + + protected function getChartLayout(): array + { + return [ + 'title' => ['text' => 'Peak-to-Peak per day'], + 'yaxis' => ['type' => 'category', 'autorange' => 'reversed'], + 'autosize' => true, + 'showlegend' => false, + ]; + } + + protected function getChartConfig(): array + { + return ['responsive' => true, 'displaylogo' => false]; + } + + // --- HasStreamingSupport ------------------------------------------------- + + protected function getStreamUrl(): ?string + { + return $this->sensorId ? url('/stream/p2p') : null; + } + + protected function getStreamParams(): array + { + return [ + 'sensor_id' => $this->sensorId, + 'axis' => $this->axis, + 'date_from' => $this->dateFrom ?? '', + 'date_to' => $this->dateTo ?? '', + ]; + } -The dark mode is supported and enabled by default. + // Expected message shape: { x: , y: , captureId: } + protected function getOnStreamMessageScript(): ?string + { + return <<<'JS' + Plotly.extendTraces(el, { + x: [[d.x]], + y: [[d.y]], + customdata: [[d.captureId]], + }, [0]); + JS; + } + + // --- HasChartTheme — automatic dark/light sync --------------------------- + + protected function getDarkThemeLayout(): array + { + return [ + 'paper_bgcolor' => '#1e293b', + 'plot_bgcolor' => '#1e293b', + 'font' => ['color' => '#f1f5f9'], + ]; + } + + protected function getLightThemeLayout(): array + { + return [ + 'paper_bgcolor' => '#ffffff', + 'plot_bgcolor' => '#ffffff', + 'font' => ['color' => '#0f172a'], + ]; + } + + // --- Plotly event listeners ---------------------------------------------- + + protected function getPlotlyEventListeners(): array + { + return ['plotly_click' => 'onChartClick']; + } + + public function onChartClick(array $data): void + { + $captureId = $data['points'][0]['customdata'] ?? null; + + if ($captureId !== null) { + $this->dispatch('captureSelected', captureId: (int) $captureId); + } + } +} +``` + +## Streaming layout patch + +Override `getStreamingLayoutPatch()` to declare layout properties that must be force-merged into the layout on every stream reset, regardless of what `el.layout` currently holds. + +```php +protected function getStreamingLayoutPatch(): array +{ + return [ + 'template' => [ + 'layout' => [ + 'paper_bgcolor' => '#1e293b', + 'plot_bgcolor' => '#1e293b', + ], + ], + ]; +} +``` + +> **When to use this vs `HasChartTheme`:** If you use `HasChartTheme`, theme properties are tracked in `el.layout` and are automatically preserved across stream resets — you do not need `getStreamingLayoutPatch()` for theme sync. Use `getStreamingLayoutPatch()` when you need to inject layout properties that are not managed by `HasChartTheme`, or when you cannot use that trait. + +## Dark mode +The dark mode is supported and enabled by default for the container. ## Publishing views diff --git a/package-lock.json b/package-lock.json index 0589c0b..fd6e3fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,9 +4,9 @@ "requires": true, "packages": { "": { + "name": "filament-plotly", "dependencies": { - "lodash.merge": "^4.6.2", - "plotly.js-dist": "^3.3.0" + "plotly.js-dist": "^3.5.0" }, "devDependencies": { "@awcodes/filament-plugin-purge": "^1.1.1", @@ -575,14 +575,14 @@ } }, "node_modules/axios": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", - "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz", + "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^2.1.0" } }, "node_modules/balanced-match": { @@ -632,9 +632,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", @@ -1940,11 +1940,6 @@ "node": ">=4" } }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, "node_modules/log-symbols": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", @@ -2016,9 +2011,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -2273,9 +2268,9 @@ } }, "node_modules/plotly.js-dist": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/plotly.js-dist/-/plotly.js-dist-3.3.1.tgz", - "integrity": "sha512-FTesxTvlwujX38AG4OqB/aqRRyc3lhrU7Rx5+p26Xinx6LBZn0W10C98IeKlg8lN8eHGiqFNoMe+oAYW69z7dQ==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/plotly.js-dist/-/plotly.js-dist-3.5.0.tgz", + "integrity": "sha512-syvVpwKdofB5VTQ+faAVt7GOnrG/xPUMnBZyGWwjaDxYVbonsUZbmqKrvfnF21497SlTuBi45xYxVXkc88WjAA==" }, "node_modules/possible-typed-array-names": { "version": "1.1.0", @@ -2337,10 +2332,13 @@ } }, "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "dev": true, + "engines": { + "node": ">=10" + } }, "node_modules/read-pkg": { "version": "3.0.0", diff --git a/package.json b/package.json index 23e6c3e..d1703a7 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,6 @@ "prettier": "^2.7.1" }, "dependencies": { - "plotly.js-dist": "^3.3.1" + "plotly.js-dist": "^3.5.0" } } diff --git a/resources/dist/filament-plotly.js b/resources/dist/filament-plotly.js index e056f87..e8a03ba 100644 --- a/resources/dist/filament-plotly.js +++ b/resources/dist/filament-plotly.js @@ -1,89 +1,306 @@ -var WD=Object.create;var G5=Object.defineProperty;var XD=Object.getOwnPropertyDescriptor;var ZD=Object.getOwnPropertyNames;var YD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var JD=(pf,mf)=>()=>(mf||pf((mf={exports:{}}).exports,mf),mf.exports);var $D=(pf,mf,Ph,dp)=>{if(mf&&typeof mf=="object"||typeof mf=="function")for(let Zc of ZD(mf))!KD.call(pf,Zc)&&Zc!==Ph&&G5(pf,Zc,{get:()=>mf[Zc],enumerable:!(dp=XD(mf,Zc))||dp.enumerable});return pf};var QD=(pf,mf,Ph)=>(Ph=pf!=null?WD(YD(pf)):{},$D(mf||!pf||!pf.__esModule?G5(Ph,"default",{value:pf,enumerable:!0}):Ph,pf));var X5=JD((W5,ky)=>{(function(pf,mf){typeof ky=="object"&&ky.exports?ky.exports=mf():pf.moduleName=mf()})(typeof self<"u"?self:W5,()=>{"use strict";var pf=(()=>{var mf=Object.create,Ph=Object.defineProperty,dp=Object.defineProperties,Zc=Object.getOwnPropertyDescriptor,pp=Object.getOwnPropertyDescriptors,iv=Object.getOwnPropertyNames,zh=Object.getOwnPropertySymbols,Cy=Object.getPrototypeOf,Ly=Object.prototype.hasOwnProperty,qx=Object.prototype.propertyIsEnumerable,Gx=(Z,V,d)=>V in Z?Ph(Z,V,{enumerable:!0,configurable:!0,writable:!0,value:d}):Z[V]=d,_d=(Z,V)=>{for(var d in V||(V={}))Ly.call(V,d)&&Gx(Z,d,V[d]);if(zh)for(var d of zh(V))qx.call(V,d)&&Gx(Z,d,V[d]);return Z},x0=(Z,V)=>dp(Z,pp(V)),Z5=(Z,V)=>{var d={};for(var x in Z)Ly.call(Z,x)&&V.indexOf(x)<0&&(d[x]=Z[x]);if(Z!=null&&zh)for(var x of zh(Z))V.indexOf(x)<0&&qx.call(Z,x)&&(d[x]=Z[x]);return d},Bl=(Z,V)=>function(){return Z&&(V=(0,Z[iv(Z)[0]])(Z=0)),V},We=(Z,V)=>function(){return V||(0,Z[iv(Z)[0]])((V={exports:{}}).exports,V),V.exports},Hx=(Z,V)=>{for(var d in V)Ph(Z,d,{get:V[d],enumerable:!0})},Wx=(Z,V,d,x)=>{if(V&&typeof V=="object"||typeof V=="function")for(let A of iv(V))!Ly.call(Z,A)&&A!==d&&Ph(Z,A,{get:()=>V[A],enumerable:!(x=Zc(V,A))||x.enumerable});return Z},Y5=(Z,V,d)=>(d=Z!=null?mf(Cy(Z)):{},Wx(V||!Z||!Z.__esModule?Ph(d,"default",{value:Z,enumerable:!0}):d,Z)),xd=Z=>Wx(Ph({},"__esModule",{value:!0}),Z),Py=We({"src/version.js"(Z){"use strict";Z.version="3.3.1"}}),K5=We({"node_modules/native-promise-only/lib/npo.src.js"(Z,V){(function(x,A,E){A[x]=A[x]||E(),typeof V<"u"&&V.exports&&(V.exports=A[x])})("Promise",typeof window<"u"?window:Z,function(){"use strict";var x,A,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(_){return setImmediate(_)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(_,w,S,M){return Object.defineProperty(_,w,{value:S,writable:!0,configurable:M!==!1})}}catch{x=function(w,S,M){return w[S]=M,w}}E=(function(){var _,w,S;function M(y,b){this.fn=y,this.self=b,this.next=void 0}return{add:function(b,v){S=new M(b,v),w?w.next=S:_=S,w=S,S=void 0},drain:function(){var b=_;for(_=w=A=void 0;b;)b.fn.call(b.self),b=b.next}}})();function r(l,_){E.add(l,_),A||(A=t(E.drain))}function o(l){var _,w=typeof l;return l!=null&&(w=="object"||w=="function")&&(_=l.then),typeof _=="function"?_:!1}function a(){for(var l=0;l0&&r(a,w))}catch(S){s.call(new c(w),S)}}}function s(l){var _=this;_.triggered||(_.triggered=!0,_.def&&(_=_.def),_.msg=l,_.state=2,_.chain.length>0&&r(a,_))}function h(l,_,w,S){for(var M=0;M<_.length;M++)(function(b){l.resolve(_[b]).then(function(u){w(b,u)},S)})(M)}function c(l){this.def=l,this.triggered=!1}function m(l){this.promise=l,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function p(l){if(typeof l!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new m(this);this.then=function(S,M){var y={success:typeof S=="function"?S:!0,failure:typeof M=="function"?M:!1};return y.promise=new this.constructor(function(v,u){if(typeof v!="function"||typeof u!="function")throw TypeError("Not a function");y.resolve=v,y.reject=u}),_.chain.push(y),_.state!==0&&r(a,_),y.promise},this.catch=function(S){return this.then(void 0,S)};try{l.call(void 0,function(S){n.call(_,S)},function(S){s.call(_,S)})}catch(w){s.call(_,w)}}var T=x({},"constructor",p,!1);return p.prototype=T,x(T,"__NPO__",0,!1),x(p,"resolve",function(_){var w=this;return _&&typeof _=="object"&&_.__NPO__===1?_:new w(function(M,y){if(typeof M!="function"||typeof y!="function")throw TypeError("Not a function");M(_)})}),x(p,"reject",function(_){return new this(function(S,M){if(typeof S!="function"||typeof M!="function")throw TypeError("Not a function");M(_)})}),x(p,"all",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):_.length===0?w.resolve([]):new w(function(M,y){if(typeof M!="function"||typeof y!="function")throw TypeError("Not a function");var b=_.length,v=Array(b),u=0;h(w,_,function(f,P){v[f]=P,++u===b&&M(v)},y)})}),x(p,"race",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):new w(function(M,y){if(typeof M!="function"||typeof y!="function")throw TypeError("Not a function");h(w,_,function(v,u){M(u)},y)})}),p})}}),Hi=We({"node_modules/@plotly/d3/d3.js"(Z,V){(function(){var d={version:"3.8.2"},x=[].slice,A=function(ve){return x.call(ve)},E=self.document;function e(ve){return ve&&(ve.ownerDocument||ve.document||ve).documentElement}function t(ve){return ve&&(ve.ownerDocument&&ve.ownerDocument.defaultView||ve.document&&ve||ve.defaultView)}if(E)try{A(E.documentElement.childNodes)[0].nodeType}catch{A=function(Re){for(var Je=Re.length,ht=new Array(Je);Je--;)ht[Je]=Re[Je];return ht}}if(Date.now||(Date.now=function(){return+new Date}),E)try{E.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,o=r.setAttribute,a=r.setAttributeNS,i=this.CSSStyleDeclaration.prototype,n=i.setProperty;r.setAttribute=function(Re,Je){o.call(this,Re,Je+"")},r.setAttributeNS=function(Re,Je,ht){a.call(this,Re,Je,ht+"")},i.setProperty=function(Re,Je,ht){n.call(this,Re,Je+"",ht)}}d.ascending=s;function s(ve,Re){return veRe?1:ve>=Re?0:NaN}d.descending=function(ve,Re){return Reve?1:Re>=ve?0:NaN},d.min=function(ve,Re){var Je=-1,ht=ve.length,mt,wt;if(arguments.length===1){for(;++Je=wt){mt=wt;break}for(;++Jewt&&(mt=wt)}else{for(;++Je=wt){mt=wt;break}for(;++Jewt&&(mt=wt)}return mt},d.max=function(ve,Re){var Je=-1,ht=ve.length,mt,wt;if(arguments.length===1){for(;++Je=wt){mt=wt;break}for(;++Jemt&&(mt=wt)}else{for(;++Je=wt){mt=wt;break}for(;++Jemt&&(mt=wt)}return mt},d.extent=function(ve,Re){var Je=-1,ht=ve.length,mt,wt,$t;if(arguments.length===1){for(;++Je=wt){mt=$t=wt;break}for(;++Jewt&&(mt=wt),$t=wt){mt=$t=wt;break}for(;++Jewt&&(mt=wt),$t1)return $t/(hr-1)},d.deviation=function(){var ve=d.variance.apply(this,arguments);return ve&&Math.sqrt(ve)};function m(ve){return{left:function(Re,Je,ht,mt){for(arguments.length<3&&(ht=0),arguments.length<4&&(mt=Re.length);ht>>1;ve(Re[wt],Je)<0?ht=wt+1:mt=wt}return ht},right:function(Re,Je,ht,mt){for(arguments.length<3&&(ht=0),arguments.length<4&&(mt=Re.length);ht>>1;ve(Re[wt],Je)>0?mt=wt:ht=wt+1}return ht}}}var p=m(s);d.bisectLeft=p.left,d.bisect=d.bisectRight=p.right,d.bisector=function(ve){return m(ve.length===1?function(Re,Je){return s(ve(Re),Je)}:ve)},d.shuffle=function(ve,Re,Je){(ht=arguments.length)<3&&(Je=ve.length,ht<2&&(Re=0));for(var ht=Je-Re,mt,wt;ht;)wt=Math.random()*ht--|0,mt=ve[ht+Re],ve[ht+Re]=ve[wt+Re],ve[wt+Re]=mt;return ve},d.permute=function(ve,Re){for(var Je=Re.length,ht=new Array(Je);Je--;)ht[Je]=ve[Re[Je]];return ht},d.pairs=function(ve){for(var Re=0,Je=ve.length-1,ht,mt=ve[0],wt=new Array(Je<0?0:Je);Re=0;)for($t=ve[Re],Je=$t.length;--Je>=0;)wt[--mt]=$t[Je];return wt};var l=Math.abs;d.range=function(ve,Re,Je){if(arguments.length<3&&(Je=1,arguments.length<2&&(Re=ve,ve=0)),(Re-ve)/Je===1/0)throw new Error("infinite range");var ht=[],mt=_(l(Je)),wt=-1,$t;if(ve*=mt,Re*=mt,Je*=mt,Je<0)for(;($t=ve+Je*++wt)>Re;)ht.push($t/mt);else for(;($t=ve+Je*++wt)=Re.length)return mt?mt.call(ve,hr):ht?hr.sort(ht):hr;for(var jr=-1,va=hr.length,ua=Re[Br++],Ha,Za,ya,Ca=new S,Ua;++jr=Re.length)return Rt;var Br=[],jr=Je[hr++];return Rt.forEach(function(va,ua){Br.push({key:va,values:$t(ua,hr)})}),jr?Br.sort(function(va,ua){return jr(va.key,ua.key)}):Br}return ve.map=function(Rt,hr){return wt(hr,Rt,0)},ve.entries=function(Rt){return $t(wt(d.map,Rt,0),0)},ve.key=function(Rt){return Re.push(Rt),ve},ve.sortKeys=function(Rt){return Je[Re.length-1]=Rt,ve},ve.sortValues=function(Rt){return ht=Rt,ve},ve.rollup=function(Rt){return mt=Rt,ve},ve},d.set=function(ve){var Re=new z;if(ve)for(var Je=0,ht=ve.length;Je=0&&(ht=ve.slice(Je+1),ve=ve.slice(0,Je)),ve)return arguments.length<2?this[ve].on(ht):this[ve].on(ht,Re);if(arguments.length===2){if(Re==null)for(ve in this)this.hasOwnProperty(ve)&&this[ve].on(ht,null);return this}};function W(ve){var Re=[],Je=new S;function ht(){for(var mt=Re,wt=-1,$t=mt.length,Rt;++wt<$t;)(Rt=mt[wt].on)&&Rt.apply(this,arguments);return ve}return ht.on=function(mt,wt){var $t=Je.get(mt),Rt;return arguments.length<2?$t&&$t.on:($t&&($t.on=null,Re=Re.slice(0,Rt=Re.indexOf($t)).concat(Re.slice(Rt+1)),Je.remove(mt)),wt&&Re.push(Je.set(mt,{on:wt})),ve)},ht}d.event=null;function Q(){d.event.preventDefault()}function le(){for(var ve=d.event,Re;Re=ve.sourceEvent;)ve=Re;return ve}function se(ve){for(var Re=new U,Je=0,ht=arguments.length;++Je=0&&(Je=ve.slice(0,Re))!=="xmlns"&&(ve=ve.slice(Re+1)),ue.hasOwnProperty(Je)?{space:ue[Je],local:ve}:ve}},ne.attr=function(ve,Re){if(arguments.length<2){if(typeof ve=="string"){var Je=this.node();return ve=d.ns.qualify(ve),ve.local?Je.getAttributeNS(ve.space,ve.local):Je.getAttribute(ve)}for(Re in ve)this.each(_e(Re,ve[Re]));return this}return this.each(_e(ve,Re))};function _e(ve,Re){ve=d.ns.qualify(ve);function Je(){this.removeAttribute(ve)}function ht(){this.removeAttributeNS(ve.space,ve.local)}function mt(){this.setAttribute(ve,Re)}function wt(){this.setAttributeNS(ve.space,ve.local,Re)}function $t(){var hr=Re.apply(this,arguments);hr==null?this.removeAttribute(ve):this.setAttribute(ve,hr)}function Rt(){var hr=Re.apply(this,arguments);hr==null?this.removeAttributeNS(ve.space,ve.local):this.setAttributeNS(ve.space,ve.local,hr)}return Re==null?ve.local?ht:Je:typeof Re=="function"?ve.local?Rt:$t:ve.local?wt:mt}function Te(ve){return ve.trim().replace(/\s+/g," ")}ne.classed=function(ve,Re){if(arguments.length<2){if(typeof ve=="string"){var Je=this.node(),ht=(ve=De(ve)).length,mt=-1;if(Re=Je.classList){for(;++mt=0;)(wt=Je[ht])&&(mt&&mt!==wt.nextSibling&&mt.parentNode.insertBefore(wt,mt),mt=wt);return this},ne.sort=function(ve){ve=ze.apply(this,arguments);for(var Re=-1,Je=this.length;++Re=Re&&(Re=mt+1);!(hr=$t[Re])&&++Re0&&(ve=ve.slice(0,mt));var $t=Bt.get(ve);$t&&(ve=$t,wt=_r);function Rt(){var jr=this[ht];jr&&(this.removeEventListener(ve,jr,jr.$),delete this[ht])}function hr(){var jr=wt(Re,A(arguments));Rt.call(this),this.addEventListener(ve,this[ht]=jr,jr.$=Je),jr._=Re}function Br(){var jr=new RegExp("^__on([^.]+)"+d.requote(ve)+"$"),va;for(var ua in this)if(va=ua.match(jr)){var Ha=this[ua];this.removeEventListener(va[1],Ha,Ha.$),delete this[ua]}}return mt?Re?hr:Rt:Re?N:Br}var Bt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&Bt.forEach(function(ve){"on"+ve in E&&Bt.remove(ve)});function jt(ve,Re){return function(Je){var ht=d.event;d.event=Je,Re[0]=this.__data__;try{ve.apply(this,Re)}finally{d.event=ht}}}function _r(ve,Re){var Je=jt(ve,Re);return function(ht){var mt=this,wt=ht.relatedTarget;(!wt||wt!==mt&&!(wt.compareDocumentPosition(mt)&8))&&Je.call(mt,ht)}}var pr,Or=0;function mr(ve){var Re=".dragsuppress-"+ ++Or,Je="click"+Re,ht=d.select(t(ve)).on("touchmove"+Re,Q).on("dragstart"+Re,Q).on("selectstart"+Re,Q);if(pr==null&&(pr="onselectstart"in ve?!1:O(ve.style,"userSelect")),pr){var mt=e(ve).style,wt=mt[pr];mt[pr]="none"}return function($t){if(ht.on(Re,null),pr&&(mt[pr]=wt),$t){var Rt=function(){ht.on(Je,null)};ht.on(Je,function(){Q(),Rt()},!0),setTimeout(Rt,0)}}}d.mouse=function(ve){return yt(ve,le())};var Er=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function yt(ve,Re){Re.changedTouches&&(Re=Re.changedTouches[0]);var Je=ve.ownerSVGElement||ve;if(Je.createSVGPoint){var ht=Je.createSVGPoint();if(Er<0){var mt=t(ve);if(mt.scrollX||mt.scrollY){Je=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var wt=Je[0][0].getScreenCTM();Er=!(wt.f||wt.e),Je.remove()}}return Er?(ht.x=Re.pageX,ht.y=Re.pageY):(ht.x=Re.clientX,ht.y=Re.clientY),ht=ht.matrixTransform(ve.getScreenCTM().inverse()),[ht.x,ht.y]}var $t=ve.getBoundingClientRect();return[Re.clientX-$t.left-ve.clientLeft,Re.clientY-$t.top-ve.clientTop]}d.touch=function(ve,Re,Je){if(arguments.length<3&&(Je=Re,Re=le().changedTouches),Re){for(var ht=0,mt=Re.length,wt;ht0?1:ve<0?-1:0}function gt(ve,Re,Je){return(Re[0]-ve[0])*(Je[1]-ve[1])-(Re[1]-ve[1])*(Je[0]-ve[0])}function Ct(ve){return ve>1?0:ve<-1?Ce:Math.acos(ve)}function or(ve){return ve>1?Se:ve<-1?-Se:Math.asin(ve)}function Qt(ve){return((ve=Math.exp(ve))-1/ve)/2}function Jt(ve){return((ve=Math.exp(ve))+1/ve)/2}function Sr(ve){return((ve=Math.exp(2*ve))-1)/(ve+1)}function oa(ve){return(ve=Math.sin(ve/2))*ve}var Ea=Math.SQRT2,Sa=2,za=4;d.interpolateZoom=function(ve,Re){var Je=ve[0],ht=ve[1],mt=ve[2],wt=Re[0],$t=Re[1],Rt=Re[2],hr=wt-Je,Br=$t-ht,jr=hr*hr+Br*Br,va,ua;if(jr0&&(si=si.transition().duration($t)),si.call(Ja.event)}function zi(){Ca&&Ca.domain(ya.range().map(function(si){return(si-ve.x)/ve.k}).map(ya.invert)),rn&&rn.domain(Ua.range().map(function(si){return(si-ve.y)/ve.k}).map(Ua.invert))}function ji(si){Rt++||si({type:"zoomstart"})}function Po(si){zi(),si({type:"zoom",scale:ve.k,translate:[ve.x,ve.y]})}function qi(si){--Rt||(si({type:"zoomend"}),Je=null)}function Co(){var si=this,$i=Za.of(si,arguments),Wo=0,Yo=d.select(t(si)).on(Br,Wl).on(jr,ol),$s=Aa(d.mouse(si)),ml=mr(si);Ai.call(si),ji($i);function Wl(){Wo=1,ii(d.mouse(si),$s),Po($i)}function ol(){Yo.on(Br,null).on(jr,null),ml(Wo),qi($i)}}function Bs(){var si=this,$i=Za.of(si,arguments),Wo={},Yo=0,$s,ml=".zoom-"+d.event.changedTouches[0].identifier,Wl="touchmove"+ml,ol="touchend"+ml,Bu=[],tt=d.select(si),qt=mr(si);ra(),ji($i),tt.on(hr,null).on(ua,ra);function sr(){var ha=d.touches(si);return $s=ve.k,ha.forEach(function(Va){Va.identifier in Wo&&(Wo[Va.identifier]=Aa(Va))}),ha}function ra(){var ha=d.event.target;d.select(ha).on(Wl,da).on(ol,ca),Bu.push(ha);for(var Va=d.event.changedTouches,dn=0,fn=Va.length;dn1){var Mn=$a[0],_n=$a[1],Ia=Mn[0]-_n[0],Zr=Mn[1]-_n[1];Yo=Ia*Ia+Zr*Zr}}function da(){var ha=d.touches(si),Va,dn,fn,$a;Ai.call(si);for(var ui=0,Mn=ha.length;ui1?1:Re,Je=Je<0?0:Je>1?1:Je,mt=Je<=.5?Je*(1+Re):Je+Re-Je*Re,ht=2*Je-mt;function wt(Rt){return Rt>360?Rt-=360:Rt<0&&(Rt+=360),Rt<60?ht+(mt-ht)*Rt/60:Rt<180?mt:Rt<240?ht+(mt-ht)*(240-Rt)/60:ht}function $t(Rt){return Math.round(wt(Rt)*255)}return new lt($t(ve+120),$t(ve),$t(ve-120))}d.hcl=Xt;function Xt(ve,Re,Je){return this instanceof Xt?(this.h=+ve,this.c=+Re,void(this.l=+Je)):arguments.length<2?ve instanceof Xt?new Xt(ve.h,ve.c,ve.l):ve instanceof Jr?Ma(ve.l,ve.a,ve.b):Ma((ve=Nr((ve=d.rgb(ve)).r,ve.g,ve.b)).l,ve.a,ve.b):new Xt(ve,Re,Je)}var Rr=Xt.prototype=new gn;Rr.brighter=function(ve){return new Xt(this.h,this.c,Math.min(100,this.l+ia*(arguments.length?ve:1)))},Rr.darker=function(ve){return new Xt(this.h,this.c,Math.max(0,this.l-ia*(arguments.length?ve:1)))},Rr.rgb=function(){return Yr(this.h,this.c,this.l).rgb()};function Yr(ve,Re,Je){return isNaN(ve)&&(ve=0),isNaN(Re)&&(Re=0),new Jr(Je,Math.cos(ve*=Le)*Re,Math.sin(ve)*Re)}d.lab=Jr;function Jr(ve,Re,Je){return this instanceof Jr?(this.l=+ve,this.a=+Re,void(this.b=+Je)):arguments.length<2?ve instanceof Jr?new Jr(ve.l,ve.a,ve.b):ve instanceof Xt?Yr(ve.h,ve.c,ve.l):Nr((ve=lt(ve)).r,ve.g,ve.b):new Jr(ve,Re,Je)}var ia=18,Pa=.95047,Ga=1,ja=1.08883,Xa=Jr.prototype=new gn;Xa.brighter=function(ve){return new Jr(Math.min(100,this.l+ia*(arguments.length?ve:1)),this.a,this.b)},Xa.darker=function(ve){return new Jr(Math.max(0,this.l-ia*(arguments.length?ve:1)),this.a,this.b)},Xa.rgb=function(){return sn(this.l,this.a,this.b)};function sn(ve,Re,Je){var ht=(ve+16)/116,mt=ht+Re/500,wt=ht-Je/200;return mt=Xn(mt)*Pa,ht=Xn(ht)*Ga,wt=Xn(wt)*ja,new lt(St(3.2404542*mt-1.5371385*ht-.4985314*wt),St(-.969266*mt+1.8760108*ht+.041556*wt),St(.0556434*mt-.2040259*ht+1.0572252*wt))}function Ma(ve,Re,Je){return ve>0?new Xt(Math.atan2(Je,Re)*at,Math.sqrt(Re*Re+Je*Je),ve):new Xt(NaN,NaN,ve)}function Xn(ve){return ve>.206893034?ve*ve*ve:(ve-4/29)/7.787037}function Kn(ve){return ve>.008856?Math.pow(ve,1/3):7.787037*ve+4/29}function St(ve){return Math.round(255*(ve<=.00304?12.92*ve:1.055*Math.pow(ve,1/2.4)-.055))}d.rgb=lt;function lt(ve,Re,Je){return this instanceof lt?(this.r=~~ve,this.g=~~Re,void(this.b=~~Je)):arguments.length<2?ve instanceof lt?new lt(ve.r,ve.g,ve.b):Cr(""+ve,lt,Gt):new lt(ve,Re,Je)}function br(ve){return new lt(ve>>16,ve>>8&255,ve&255)}function kr(ve){return br(ve)+""}var Lr=lt.prototype=new gn;Lr.brighter=function(ve){ve=Math.pow(.7,arguments.length?ve:1);var Re=this.r,Je=this.g,ht=this.b,mt=30;return!Re&&!Je&&!ht?new lt(mt,mt,mt):(Re&&Re>4,ht=ht>>4|ht,mt=hr&240,mt=mt>>4|mt,wt=hr&15,wt=wt<<4|wt):ve.length===7&&(ht=(hr&16711680)>>16,mt=(hr&65280)>>8,wt=hr&255)),Re(ht,mt,wt))}function Kr(ve,Re,Je){var ht=Math.min(ve/=255,Re/=255,Je/=255),mt=Math.max(ve,Re,Je),wt=mt-ht,$t,Rt,hr=(mt+ht)/2;return wt?(Rt=hr<.5?wt/(mt+ht):wt/(2-mt-ht),ve==mt?$t=(Re-Je)/wt+(Re0&&hr<1?0:$t),new Ht($t,Rt,hr)}function Nr(ve,Re,Je){ve=_t(ve),Re=_t(Re),Je=_t(Je);var ht=Kn((.4124564*ve+.3575761*Re+.1804375*Je)/Pa),mt=Kn((.2126729*ve+.7151522*Re+.072175*Je)/Ga),wt=Kn((.0193339*ve+.119192*Re+.9503041*Je)/ja);return Jr(116*mt-16,500*(ht-mt),200*(mt-wt))}function _t(ve){return(ve/=255)<=.04045?ve/12.92:Math.pow((ve+.055)/1.055,2.4)}function Wt(ve){var Re=parseFloat(ve);return ve.charAt(ve.length-1)==="%"?Math.round(Re*2.55):Re}var Ar=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ar.forEach(function(ve,Re){Ar.set(ve,br(Re))});function Vr(ve){return typeof ve=="function"?ve:function(){return ve}}d.functor=Vr,d.xhr=ma(F);function ma(ve){return function(Re,Je,ht){return arguments.length===2&&typeof Je=="function"&&(ht=Je,Je=null),ba(Re,Je,ve,ht)}}function ba(ve,Re,Je,ht){var mt={},wt=d.dispatch("beforesend","progress","load","error"),$t={},Rt=new XMLHttpRequest,hr=null;self.XDomainRequest&&!("withCredentials"in Rt)&&/^(http(s)?:)?\/\//.test(ve)&&(Rt=new XDomainRequest),"onload"in Rt?Rt.onload=Rt.onerror=Br:Rt.onreadystatechange=function(){Rt.readyState>3&&Br()};function Br(){var jr=Rt.status,va;if(!jr&&$r(Rt)||jr>=200&&jr<300||jr===304){try{va=Je.call(mt,Rt)}catch(ua){wt.error.call(mt,ua);return}wt.load.call(mt,va)}else wt.error.call(mt,Rt)}return Rt.onprogress=function(jr){var va=d.event;d.event=jr;try{wt.progress.call(mt,Rt)}finally{d.event=va}},mt.header=function(jr,va){return jr=(jr+"").toLowerCase(),arguments.length<2?$t[jr]:(va==null?delete $t[jr]:$t[jr]=va+"",mt)},mt.mimeType=function(jr){return arguments.length?(Re=jr==null?null:jr+"",mt):Re},mt.responseType=function(jr){return arguments.length?(hr=jr,mt):hr},mt.response=function(jr){return Je=jr,mt},["get","post"].forEach(function(jr){mt[jr]=function(){return mt.send.apply(mt,[jr].concat(A(arguments)))}}),mt.send=function(jr,va,ua){if(arguments.length===2&&typeof va=="function"&&(ua=va,va=null),Rt.open(jr,ve,!0),Re!=null&&!("accept"in $t)&&($t.accept=Re+",*/*"),Rt.setRequestHeader)for(var Ha in $t)Rt.setRequestHeader(Ha,$t[Ha]);return Re!=null&&Rt.overrideMimeType&&Rt.overrideMimeType(Re),hr!=null&&(Rt.responseType=hr),ua!=null&&mt.on("error",ua).on("load",function(Za){ua(null,Za)}),wt.beforesend.call(mt,Rt),Rt.send(va??null),mt},mt.abort=function(){return Rt.abort(),mt},d.rebind(mt,wt,"on"),ht==null?mt:mt.get(wa(ht))}function wa(ve){return ve.length===1?function(Re,Je){ve(Re==null?Je:null)}:ve}function $r(ve){var Re=ve.responseType;return Re&&Re!=="text"?ve.response:ve.responseText}d.dsv=function(ve,Re){var Je=new RegExp('["'+ve+` -]`),ht=ve.charCodeAt(0);function mt(Br,jr,va){arguments.length<3&&(va=jr,jr=null);var ua=ba(Br,Re,jr==null?wt:$t(jr),va);return ua.row=function(Ha){return arguments.length?ua.response((jr=Ha)==null?wt:$t(Ha)):jr},ua}function wt(Br){return mt.parse(Br.responseText)}function $t(Br){return function(jr){return mt.parse(jr.responseText,Br)}}mt.parse=function(Br,jr){var va;return mt.parseRows(Br,function(ua,Ha){if(va)return va(ua,Ha-1);var Za=function(ya){for(var Ca={},Ua=ua.length,rn=0;rn=Za)return ua;if(rn)return rn=!1,va;var Jn=ya;if(Br.charCodeAt(Jn)===34){for(var Wn=Jn;Wn++24?(isFinite(Re)&&(clearTimeout(ei),ei=setTimeout(xi,Re)),an=0):(an=1,li(xi))}d.timer.flush=function(){Pi(),Li()};function Pi(){for(var ve=Date.now(),Re=ga;Re;)ve>=Re.t&&Re.c(ve-Re.t)&&(Re.c=null),Re=Re.n;return ve}function Li(){for(var ve,Re=ga,Je=1/0;Re;)Re.c?(Re.t=0;--Rt)ya.push(mt[Br[va[Rt]][2]]);for(Rt=+Ha;Rt1&>(ve[Je[ht-2]],ve[Je[ht-1]],ve[mt])<=0;)--ht;Je[ht++]=mt}return Je.slice(0,ht)}function uo(ve,Re){return ve[0]-Re[0]||ve[1]-Re[1]}d.geom.polygon=function(ve){return q(ve,ao),ve};var ao=d.geom.polygon.prototype=[];ao.area=function(){for(var ve=-1,Re=this.length,Je,ht=this[Re-1],mt=0;++veXe)Rt=Rt.L;else if($t=Re-Zi(Rt,Je),$t>Xe){if(!Rt.R){ht=Rt;break}Rt=Rt.R}else{wt>-Xe?(ht=Rt.P,mt=Rt):$t>-Xe?(ht=Rt,mt=Rt.N):ht=mt=Rt;break}var hr=ko(ve);if(eo.insert(ht,hr),!(!ht&&!mt)){if(ht===mt){oo(ht),mt=ko(ht.site),eo.insert(hr,mt),hr.edge=mt.edge=Ns(ht.site,hr.site),ci(ht),ci(mt);return}if(!mt){hr.edge=Ns(ht.site,hr.site);return}oo(ht),oo(mt);var Br=ht.site,jr=Br.x,va=Br.y,ua=ve.x-jr,Ha=ve.y-va,Za=mt.site,ya=Za.x-jr,Ca=Za.y-va,Ua=2*(ua*Ca-Ha*ya),rn=ua*ua+Ha*Ha,Ja=ya*ya+Ca*Ca,Aa={x:(Ca*rn-Ha*Ja)/Ua+jr,y:(ua*Ja-ya*rn)/Ua+va};jo(mt.edge,Br,Za,Aa),hr.edge=Ns(Br,ve,null,Aa),mt.edge=Ns(ve,Za,null,Aa),ci(ht),ci(mt)}}function Io(ve,Re){var Je=ve.site,ht=Je.x,mt=Je.y,wt=mt-Re;if(!wt)return ht;var $t=ve.P;if(!$t)return-1/0;Je=$t.site;var Rt=Je.x,hr=Je.y,Br=hr-Re;if(!Br)return Rt;var jr=Rt-ht,va=1/wt-1/Br,ua=jr/Br;return va?(-ua+Math.sqrt(ua*ua-2*va*(jr*jr/(-2*Br)-hr+Br/2+mt-wt/2)))/va+ht:(ht+Rt)/2}function Zi(ve,Re){var Je=ve.N;if(Je)return Io(Je,Re);var ht=ve.site;return ht.y===Re?ht.x:1/0}function ys(ve){this.site=ve,this.edges=[]}ys.prototype.prepare=function(){for(var ve=this.edges,Re=ve.length,Je;Re--;)Je=ve[Re].edge,(!Je.b||!Je.a)&&ve.splice(Re,1);return ve.sort(fs),ve.length};function rs(ve){for(var Re=ve[0][0],Je=ve[1][0],ht=ve[0][1],mt=ve[1][1],wt,$t,Rt,hr,Br=Qi,jr=Br.length,va,ua,Ha,Za,ya,Ca;jr--;)if(va=Br[jr],!(!va||!va.prepare()))for(Ha=va.edges,Za=Ha.length,ua=0;uaXe||l(hr-$t)>Xe)&&(Ha.splice(ua,0,new hs(Ks(va.site,Ca,l(Rt-Re)Xe?{x:Re,y:l(wt-Re)Xe?{x:l($t-mt)Xe?{x:Je,y:l(wt-Je)Xe?{x:l($t-ht)=-be)){var ua=hr*hr+Br*Br,Ha=jr*jr+Ca*Ca,Za=(Ca*ua-Br*Ha)/va,ya=(hr*Ha-jr*ua)/va,Ca=ya+Rt,Ua=ms.pop()||new el;Ua.arc=ve,Ua.site=mt,Ua.x=Za+$t,Ua.y=Ca+Math.sqrt(Za*Za+ya*ya),Ua.cy=Ca,ve.circle=Ua;for(var rn=null,Ja=Jo._;Ja;)if(Ua.y0)){if(ya/=Ha,Ha<0){if(ya0){if(ya>ua)return;ya>va&&(va=ya)}if(ya=Je-Rt,!(!Ha&&ya<0)){if(ya/=Ha,Ha<0){if(ya>ua)return;ya>va&&(va=ya)}else if(Ha>0){if(ya0)){if(ya/=Za,Za<0){if(ya0){if(ya>ua)return;ya>va&&(va=ya)}if(ya=ht-hr,!(!Za&&ya<0)){if(ya/=Za,Za<0){if(ya>ua)return;ya>va&&(va=ya)}else if(Za>0){if(ya0&&(mt.a={x:Rt+va*Ha,y:hr+va*Za}),ua<1&&(mt.b={x:Rt+ua*Ha,y:hr+ua*Za}),mt}}}}}}function js(ve){for(var Re=Ko,Je=so(ve[0][0],ve[0][1],ve[1][0],ve[1][1]),ht=Re.length,mt;ht--;)mt=Re[ht],(!Es(mt,ve)||!Je(mt)||l(mt.a.x-mt.b.x)=wt)return;if(jr>ua){if(!ht)ht={x:Za,y:$t};else if(ht.y>=Rt)return;Je={x:Za,y:Rt}}else{if(!ht)ht={x:Za,y:Rt};else if(ht.y<$t)return;Je={x:Za,y:$t}}}else if(Ca=(jr-ua)/(Ha-va),Ua=ya-Ca*Za,Ca<-1||Ca>1)if(jr>ua){if(!ht)ht={x:($t-Ua)/Ca,y:$t};else if(ht.y>=Rt)return;Je={x:(Rt-Ua)/Ca,y:Rt}}else{if(!ht)ht={x:(Rt-Ua)/Ca,y:Rt};else if(ht.y<$t)return;Je={x:($t-Ua)/Ca,y:$t}}else if(va=wt)return;Je={x:wt,y:Ca*wt+Ua}}else{if(!ht)ht={x:wt,y:Ca*wt+Ua};else if(ht.x=jr&&Ua.x<=ua&&Ua.y>=va&&Ua.y<=Ha?[[jr,Ha],[ua,Ha],[ua,va],[jr,va]]:[];rn.point=hr[ya]}),Br}function Rt(hr){return hr.map(function(Br,jr){return{x:Math.round(ht(Br,jr)/Xe)*Xe,y:Math.round(mt(Br,jr)/Xe)*Xe,i:jr}})}return $t.links=function(hr){return Yl(Rt(hr)).edges.filter(function(Br){return Br.l&&Br.r}).map(function(Br){return{source:hr[Br.l.i],target:hr[Br.r.i]}})},$t.triangles=function(hr){var Br=[];return Yl(Rt(hr)).cells.forEach(function(jr,va){for(var ua=jr.site,Ha=jr.edges.sort(fs),Za=-1,ya=Ha.length,Ca,Ua,rn=Ha[ya-1].edge,Ja=rn.l===ua?rn.r:rn.l;++ZaJa&&(Ja=jr.x),jr.y>Aa&&(Aa=jr.y),Ha.push(jr.x),Za.push(jr.y);else for(ya=0;yaJa&&(Ja=Jn),Wn>Aa&&(Aa=Wn),Ha.push(Jn),Za.push(Wn)}var ii=Ja-Ua,yi=Aa-rn;ii>yi?Aa=rn+ii:Ja=Ua+yi;function zi(qi,Co,Bs,Is,Xs,si,$i,Wo){if(!(isNaN(Bs)||isNaN(Is)))if(qi.leaf){var Yo=qi.x,$s=qi.y;if(Yo!=null)if(l(Yo-Bs)+l($s-Is)<.01)ji(qi,Co,Bs,Is,Xs,si,$i,Wo);else{var ml=qi.point;qi.x=qi.y=qi.point=null,ji(qi,ml,Yo,$s,Xs,si,$i,Wo),ji(qi,Co,Bs,Is,Xs,si,$i,Wo)}else qi.x=Bs,qi.y=Is,qi.point=Co}else ji(qi,Co,Bs,Is,Xs,si,$i,Wo)}function ji(qi,Co,Bs,Is,Xs,si,$i,Wo){var Yo=(Xs+$i)*.5,$s=(si+Wo)*.5,ml=Bs>=Yo,Wl=Is>=$s,ol=Wl<<1|ml;qi.leaf=!1,qi=qi.nodes[ol]||(qi.nodes[ol]=Ll()),ml?Xs=Yo:$i=Yo,Wl?si=$s:Wo=$s,zi(qi,Co,Bs,Is,Xs,si,$i,Wo)}var Po=Ll();if(Po.add=function(qi){zi(Po,qi,+va(qi,++ya),+ua(qi,ya),Ua,rn,Ja,Aa)},Po.visit=function(qi){nl(qi,Po,Ua,rn,Ja,Aa)},Po.find=function(qi){return Tu(Po,qi[0],qi[1],Ua,rn,Ja,Aa)},ya=-1,Re==null){for(;++yawt||ua>$t||Ha=Jn,yi=Je>=Wn,zi=yi<<1|ii,ji=zi+4;ziJe&&(wt=Re.slice(Je,wt),Rt[$t]?Rt[$t]+=wt:Rt[++$t]=wt),(ht=ht[0])===(mt=mt[0])?Rt[$t]?Rt[$t]+=mt:Rt[++$t]=mt:(Rt[++$t]=null,hr.push({i:$t,x:Gs(ht,mt)})),Je=Au.lastIndex;return Je=0&&!(ht=d.interpolators[Je](ve,Re)););return ht}d.interpolators=[function(ve,Re){var Je=typeof Re;return(Je==="string"?Ar.has(Re.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Re)?nu:Qo:Re instanceof gn?nu:Array.isArray(Re)?lu:Je==="object"&&isNaN(Re)?Rs:Gs)(ve,Re)}],d.interpolateArray=lu;function lu(ve,Re){var Je=[],ht=[],mt=ve.length,wt=Re.length,$t=Math.min(ve.length,Re.length),Rt;for(Rt=0;Rt<$t;++Rt)Je.push(fl(ve[Rt],Re[Rt]));for(;Rt=0?ve.slice(0,Re):ve,ht=Re>=0?ve.slice(Re+1):"in";return Je=_f.get(Je)||Us,ht=qo.get(ht)||F,xf(ht(Je.apply(null,x.call(arguments,1))))};function xf(ve){return function(Re){return Re<=0?0:Re>=1?1:ve(Re)}}function is(ve){return function(Re){return 1-ve(1-Re)}}function Ui(ve){return function(Re){return .5*(Re<.5?ve(2*Re):2-ve(2-2*Re))}}function ac(ve){return ve*ve}function uu(ve){return ve*ve*ve}function hl(ve){if(ve<=0)return 0;if(ve>=1)return 1;var Re=ve*ve,Je=Re*ve;return 4*(ve<.5?Je:3*(ve-Re)+Je-.75)}function Lc(ve){return function(Re){return Math.pow(Re,ve)}}function ju(ve){return 1-Math.cos(ve*Se)}function dc(ve){return Math.pow(2,10*(ve-1))}function Tl(ve){return 1-Math.sqrt(1-ve*ve)}function Kc(ve,Re){var Je;return arguments.length<2&&(Re=.45),arguments.length?Je=Re/Ne*Math.asin(1/ve):(ve=1,Je=Re/4),function(ht){return 1+ve*Math.pow(2,-10*ht)*Math.sin((ht-Je)*Ne/Re)}}function Fc(ve){return ve||(ve=1.70158),function(Re){return Re*Re*((ve+1)*Re-ve)}}function pc(ve){return ve<1/2.75?7.5625*ve*ve:ve<2/2.75?7.5625*(ve-=1.5/2.75)*ve+.75:ve<2.5/2.75?7.5625*(ve-=2.25/2.75)*ve+.9375:7.5625*(ve-=2.625/2.75)*ve+.984375}d.interpolateHcl=tc;function tc(ve,Re){ve=d.hcl(ve),Re=d.hcl(Re);var Je=ve.h,ht=ve.c,mt=ve.l,wt=Re.h-Je,$t=Re.c-ht,Rt=Re.l-mt;return isNaN($t)&&($t=0,ht=isNaN(ht)?Re.c:ht),isNaN(wt)?(wt=0,Je=isNaN(Je)?Re.h:Je):wt>180?wt-=360:wt<-180&&(wt+=360),function(hr){return Yr(Je+wt*hr,ht+$t*hr,mt+Rt*hr)+""}}d.interpolateHsl=Oc;function Oc(ve,Re){ve=d.hsl(ve),Re=d.hsl(Re);var Je=ve.h,ht=ve.s,mt=ve.l,wt=Re.h-Je,$t=Re.s-ht,Rt=Re.l-mt;return isNaN($t)&&($t=0,ht=isNaN(ht)?Re.s:ht),isNaN(wt)?(wt=0,Je=isNaN(Je)?Re.h:Je):wt>180?wt-=360:wt<-180&&(wt+=360),function(hr){return Gt(Je+wt*hr,ht+$t*hr,mt+Rt*hr)+""}}d.interpolateLab=Bc;function Bc(ve,Re){ve=d.lab(ve),Re=d.lab(Re);var Je=ve.l,ht=ve.a,mt=ve.b,wt=Re.l-Je,$t=Re.a-ht,Rt=Re.b-mt;return function(hr){return sn(Je+wt*hr,ht+$t*hr,mt+Rt*hr)+""}}d.interpolateRound=cu;function cu(ve,Re){return Re-=ve,function(Je){return Math.round(ve+Re*Je)}}d.transform=function(ve){var Re=E.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(Je){if(Je!=null){Re.setAttribute("transform",Je);var ht=Re.transform.baseVal.consolidate()}return new Pc(ht?ht.matrix:rc)})(ve)};function Pc(ve){var Re=[ve.a,ve.b],Je=[ve.c,ve.d],ht=nc(Re),mt=Su(Re,Je),wt=nc(Al(Je,Re,-mt))||0;Re[0]*Je[1]180?Re+=360:Re-ve>180&&(ve+=360),ht.push({i:Je.push(Vu(Je)+"rotate(",null,")")-2,x:Gs(ve,Re)})):Re&&Je.push(Vu(Je)+"rotate("+Re+")")}function sf(ve,Re,Je,ht){ve!==Re?ht.push({i:Je.push(Vu(Je)+"skewX(",null,")")-2,x:Gs(ve,Re)}):Re&&Je.push(Vu(Je)+"skewX("+Re+")")}function Nc(ve,Re,Je,ht){if(ve[0]!==Re[0]||ve[1]!==Re[1]){var mt=Je.push(Vu(Je)+"scale(",null,",",null,")");ht.push({i:mt-4,x:Gs(ve[0],Re[0])},{i:mt-2,x:Gs(ve[1],Re[1])})}else(Re[0]!==1||Re[1]!==1)&&Je.push(Vu(Je)+"scale("+Re+")")}function ic(ve,Re){var Je=[],ht=[];return ve=d.transform(ve),Re=d.transform(Re),Ts(ve.translate,Re.translate,Je,ht),Ic(ve.rotate,Re.rotate,Je,ht),sf(ve.skew,Re.skew,Je,ht),Nc(ve.scale,Re.scale,Je,ht),ve=Re=null,function(mt){for(var wt=-1,$t=ht.length,Rt;++wt<$t;)Je[(Rt=ht[wt]).i]=Rt.x(mt);return Je.join("")}}function Jc(ve,Re){return Re=(Re-=ve=+ve)||1/Re,function(Je){return(Je-ve)/Re}}function Kl(ve,Re){return Re=(Re-=ve=+ve)||1/Re,function(Je){return Math.max(0,Math.min(1,(Je-ve)/Re))}}d.layout={},d.layout.bundle=function(){return function(ve){for(var Re=[],Je=-1,ht=ve.length;++Je0?wt=Aa:(Je.c=null,Je.t=NaN,Je=null,Re.end({type:"end",alpha:wt=0})):Aa>0&&(Re.start({type:"start",alpha:wt=Aa}),Je=_i(ve.tick)),ve):wt},ve.start=function(){var Aa,Jn=Ha.length,Wn=Za.length,ii=ht[0],yi=ht[1],zi,ji;for(Aa=0;Aa=0;)wt.push(jr=Br[hr]),jr.parent=Rt,jr.depth=Rt.depth+1;Je&&(Rt.value=0),Rt.children=Br}else Je&&(Rt.value=+Je.call(ht,Rt,Rt.depth)||0),delete Rt.children;return zu(mt,function(va){var ua,Ha;ve&&(ua=va.children)&&ua.sort(ve),Je&&(Ha=va.parent)&&(Ha.value+=va.value)}),$t}return ht.sort=function(mt){return arguments.length?(ve=mt,ht):ve},ht.children=function(mt){return arguments.length?(Re=mt,ht):Re},ht.value=function(mt){return arguments.length?(Je=mt,ht):Je},ht.revalue=function(mt){return Je&&(Gu(mt,function(wt){wt.children&&(wt.value=0)}),zu(mt,function(wt){var $t;wt.children||(wt.value=+Je.call(ht,wt,wt.depth)||0),($t=wt.parent)&&($t.value+=wt.value)})),mt},ht};function iu(ve,Re){return d.rebind(ve,Re,"sort","children","value"),ve.nodes=ve,ve.links=ou,ve}function Gu(ve,Re){for(var Je=[ve];(ve=Je.pop())!=null;)if(Re(ve),(mt=ve.children)&&(ht=mt.length))for(var ht,mt;--ht>=0;)Je.push(mt[ht])}function zu(ve,Re){for(var Je=[ve],ht=[];(ve=Je.pop())!=null;)if(ht.push(ve),($t=ve.children)&&(wt=$t.length))for(var mt=-1,wt,$t;++mtmt&&(mt=Rt),ht.push(Rt)}for($t=0;$tht&&(Je=Re,ht=mt);return Je}function Vs(ve){return ve.reduce(yc,0)}function yc(ve,Re){return ve+Re[1]}d.layout.histogram=function(){var ve=!0,Re=Number,Je=Ac,ht=Hu;function mt(wt,ua){for(var Rt=[],hr=wt.map(Re,this),Br=Je.call(this,hr,ua),jr=ht.call(this,Br,hr,ua),va,ua=-1,Ha=hr.length,Za=jr.length-1,ya=ve?1:1/Ha,Ca;++ua0)for(ua=-1;++ua=Br[0]&&Ca<=Br[1]&&(va=Rt[d.bisect(jr,Ca,1,Za)-1],va.y+=ya,va.push(wt[ua]));return Rt}return mt.value=function(wt){return arguments.length?(Re=wt,mt):Re},mt.range=function(wt){return arguments.length?(Je=Vr(wt),mt):Je},mt.bins=function(wt){return arguments.length?(ht=typeof wt=="number"?function($t){return fu($t,wt)}:Vr(wt),mt):ht},mt.frequency=function(wt){return arguments.length?(ve=!!wt,mt):ve},mt};function Hu(ve,Re){return fu(ve,Math.ceil(Math.log(Re.length)/Math.LN2+1))}function fu(ve,Re){for(var Je=-1,ht=+ve[0],mt=(ve[1]-ht)/Re,wt=[];++Je<=Re;)wt[Je]=mt*Je+ht;return wt}function Ac(ve){return[d.min(ve),d.max(ve)]}d.layout.pack=function(){var ve=d.layout.hierarchy().sort(hu),Re=0,Je=[1,1],ht;function mt(wt,$t){var Rt=ve.call(this,wt,$t),hr=Rt[0],Br=Je[0],jr=Je[1],va=ht==null?Math.sqrt:typeof ht=="function"?ht:function(){return ht};if(hr.x=hr.y=0,zu(hr,function(Ha){Ha.r=+va(Ha.value)}),zu(hr,Vc),Re){var ua=Re*(ht?1:Math.max(2*hr.r/Br,2*hr.r/jr))/2;zu(hr,function(Ha){Ha.r+=ua}),zu(hr,Vc),zu(hr,function(Ha){Ha.r-=ua})}return Fu(hr,Br/2,jr/2,ht?1:1/Math.max(2*hr.r/Br,2*hr.r/jr)),Rt}return mt.size=function(wt){return arguments.length?(Je=wt,mt):Je},mt.radius=function(wt){return arguments.length?(ht=wt==null||typeof wt=="function"?wt:+wt,mt):ht},mt.padding=function(wt){return arguments.length?(Re=+wt,mt):Re},iu(mt,ve)};function hu(ve,Re){return ve.value-Re.value}function sc(ve,Re){var Je=ve._pack_next;ve._pack_next=Re,Re._pack_prev=ve,Re._pack_next=Je,Je._pack_prev=Re}function Dc(ve,Re){ve._pack_next=Re,Re._pack_prev=ve}function Cl(ve,Re){var Je=Re.x-ve.x,ht=Re.y-ve.y,mt=ve.r+Re.r;return .999*mt*mt>Je*Je+ht*ht}function Vc(ve){if(!(Re=ve.children)||!(ua=Re.length))return;var Re,Je=1/0,ht=-1/0,mt=1/0,wt=-1/0,$t,Rt,hr,Br,jr,va,ua;function Ha(Aa){Je=Math.min(Aa.x-Aa.r,Je),ht=Math.max(Aa.x+Aa.r,ht),mt=Math.min(Aa.y-Aa.r,mt),wt=Math.max(Aa.y+Aa.r,wt)}if(Re.forEach(vu),$t=Re[0],$t.x=-$t.r,$t.y=0,Ha($t),ua>1&&(Rt=Re[1],Rt.x=Rt.r,Rt.y=0,Ha(Rt),ua>2))for(hr=Re[2],vl($t,Rt,hr),Ha(hr),sc($t,hr),$t._pack_prev=hr,sc(hr,Rt),Rt=$t._pack_next,Br=3;BrCa.x&&(Ca=Jn),Jn.depth>Ua.depth&&(Ua=Jn)});var rn=Re(ya,Ca)/2-ya.x,Ja=Je[0]/(Ca.x+Re(Ca,ya)/2+rn),Aa=Je[1]/(Ua.depth||1);Gu(Ha,function(Jn){Jn.x=(Jn.x+rn)*Ja,Jn.y=Jn.depth*Aa})}return ua}function wt(jr){for(var va={A:null,children:[jr]},ua=[va],Ha;(Ha=ua.pop())!=null;)for(var Za=Ha.children,ya,Ca=0,Ua=Za.length;Ca0&&(Mu(Yt(ya,jr,ua),jr,Jn),Ua+=Jn,rn+=Jn),Ja+=ya.m,Ua+=Ha.m,Aa+=Ca.m,rn+=Za.m;ya&&!lc(Za)&&(Za.t=ya,Za.m+=Ja-rn),Ha&&!Xu(Ca)&&(Ca.t=Ha,Ca.m+=Ua-Aa,ua=jr)}return ua}function Br(jr){jr.x*=Je[0],jr.y=jr.depth*Je[1]}return mt.separation=function(jr){return arguments.length?(Re=jr,mt):Re},mt.size=function(jr){return arguments.length?(ht=(Je=jr)==null?Br:null,mt):ht?null:Je},mt.nodeSize=function(jr){return arguments.length?(ht=(Je=jr)==null?null:Br,mt):ht?Je:null},iu(mt,ve)};function jl(ve,Re){return ve.parent==Re.parent?1:2}function Xu(ve){var Re=ve.children;return Re.length?Re[0]:ve.t}function lc(ve){var Re=ve.children,Je;return(Je=Re.length)?Re[Je-1]:ve.t}function Mu(ve,Re,Je){var ht=Je/(Re.i-ve.i);Re.c-=ht,Re.s+=Je,ve.c+=ht,Re.z+=Je,Re.m+=Je}function Zu(ve){for(var Re=0,Je=0,ht=ve.children,mt=ht.length,wt;--mt>=0;)wt=ht[mt],wt.z+=Re,wt.m+=Re,Re+=wt.s+(Je+=wt.c)}function Yt(ve,Re,Je){return ve.a.parent===Re.parent?ve.a:Je}d.layout.cluster=function(){var ve=d.layout.hierarchy().sort(null).value(null),Re=jl,Je=[1,1],ht=!1;function mt(wt,$t){var Rt=ve.call(this,wt,$t),hr=Rt[0],Br,jr=0;zu(hr,function(ya){var Ca=ya.children;Ca&&Ca.length?(ya.x=Qr(Ca),ya.y=vr(Ca)):(ya.x=Br?jr+=Re(ya,Br):0,ya.y=0,Br=ya)});var va=Wr(hr),ua=xa(hr),Ha=va.x-Re(va,ua)/2,Za=ua.x+Re(ua,va)/2;return zu(hr,ht?function(ya){ya.x=(ya.x-hr.x)*Je[0],ya.y=(hr.y-ya.y)*Je[1]}:function(ya){ya.x=(ya.x-Ha)/(Za-Ha)*Je[0],ya.y=(1-(hr.y?ya.y/hr.y:1))*Je[1]}),Rt}return mt.separation=function(wt){return arguments.length?(Re=wt,mt):Re},mt.size=function(wt){return arguments.length?(ht=(Je=wt)==null,mt):ht?null:Je},mt.nodeSize=function(wt){return arguments.length?(ht=(Je=wt)!=null,mt):ht?Je:null},iu(mt,ve)};function vr(ve){return 1+d.max(ve,function(Re){return Re.y})}function Qr(ve){return ve.reduce(function(Re,Je){return Re+Je.x},0)/ve.length}function Wr(ve){var Re=ve.children;return Re&&Re.length?Wr(Re[0]):ve}function xa(ve){var Re=ve.children,Je;return Re&&(Je=Re.length)?xa(Re[Je-1]):ve}d.layout.treemap=function(){var ve=d.layout.hierarchy(),Re=Math.round,Je=[1,1],ht=null,mt=Qa,wt=!1,$t,Rt="squarify",hr=.5*(1+Math.sqrt(5));function Br(ya,Ca){for(var Ua=-1,rn=ya.length,Ja,Aa;++Ua0;)rn.push(Aa=Ja[yi-1]),rn.area+=Aa.area,Rt!=="squarify"||(Wn=ua(rn,ii))<=Jn?(Ja.pop(),Jn=Wn):(rn.area-=rn.pop().area,Ha(rn,ii,Ua,!1),ii=Math.min(Ua.dx,Ua.dy),rn.length=rn.area=0,Jn=1/0);rn.length&&(Ha(rn,ii,Ua,!0),rn.length=rn.area=0),Ca.forEach(jr)}}function va(ya){var Ca=ya.children;if(Ca&&Ca.length){var Ua=mt(ya),rn=Ca.slice(),Ja,Aa=[];for(Br(rn,Ua.dx*Ua.dy/ya.value),Aa.area=0;Ja=rn.pop();)Aa.push(Ja),Aa.area+=Ja.area,Ja.z!=null&&(Ha(Aa,Ja.z?Ua.dx:Ua.dy,Ua,!rn.length),Aa.length=Aa.area=0);Ca.forEach(va)}}function ua(ya,Ca){for(var Ua=ya.area,rn,Ja=0,Aa=1/0,Jn=-1,Wn=ya.length;++JnJa&&(Ja=rn));return Ua*=Ua,Ca*=Ca,Ua?Math.max(Ca*Ja*hr/Ua,Ua/(Ca*Aa*hr)):1/0}function Ha(ya,Ca,Ua,rn){var Ja=-1,Aa=ya.length,Jn=Ua.x,Wn=Ua.y,ii=Ca?Re(ya.area/Ca):0,yi;if(Ca==Ua.dx){for((rn||ii>Ua.dy)&&(ii=Ua.dy);++JaUa.dx)&&(ii=Ua.dx);++Ja1);return ve+Re*ht*Math.sqrt(-2*Math.log(wt)/wt)}},logNormal:function(){var ve=d.random.normal.apply(d,arguments);return function(){return Math.exp(ve())}},bates:function(ve){var Re=d.random.irwinHall(ve);return function(){return Re()/ve}},irwinHall:function(ve){return function(){for(var Re=0,Je=0;Je2?un:ni,Br=ht?Kl:Jc;return mt=hr(ve,Re,Br,Je),wt=hr(Re,ve,Br,fl),Rt}function Rt(hr){return mt(hr)}return Rt.invert=function(hr){return wt(hr)},Rt.domain=function(hr){return arguments.length?(ve=hr.map(Number),$t()):ve},Rt.range=function(hr){return arguments.length?(Re=hr,$t()):Re},Rt.rangeRound=function(hr){return Rt.range(hr).interpolate(cu)},Rt.clamp=function(hr){return arguments.length?(ht=hr,$t()):ht},Rt.interpolate=function(hr){return arguments.length?(Je=hr,$t()):Je},Rt.ticks=function(hr){return Yi(ve,hr)},Rt.tickFormat=function(hr,Br){return d3_scale_linearTickFormat(ve,hr,Br)},Rt.nice=function(hr){return Vi(ve,hr),$t()},Rt.copy=function(){return mi(ve,Re,Je,ht)},$t()}function Oi(ve,Re){return d.rebind(ve,Re,"range","rangeRound","interpolate","clamp")}function Vi(ve,Re){return wn(ve,Sn(Bi(ve,Re)[2])),wn(ve,Sn(Bi(ve,Re)[2])),ve}function Bi(ve,Re){Re==null&&(Re=10);var Je=zn(ve),ht=Je[1]-Je[0],mt=Math.pow(10,Math.floor(Math.log(ht/Re)/Math.LN10)),wt=Re/ht*mt;return wt<=.15?mt*=10:wt<=.35?mt*=5:wt<=.75&&(mt*=2),Je[0]=Math.ceil(Je[0]/mt)*mt,Je[1]=Math.floor(Je[1]/mt)*mt+mt*.5,Je[2]=mt,Je}function Yi(ve,Re){return d.range.apply(d,Bi(ve,Re))}var vi={s:1,g:1,p:1,r:1,e:1};function Qn(ve){return-Math.floor(Math.log(ve)/Math.LN10+.01)}function no(ve,Re){var Je=Qn(Re[2]);return ve in vi?Math.abs(Je-Qn(Math.max(l(Re[0]),l(Re[1]))))+ +(ve!=="e"):Je-(ve==="%")*2}d.scale.log=function(){return Ro(d.scale.linear().domain([0,1]),10,!0,[1,10])};function Ro(ve,Re,Je,ht){function mt(Rt){return(Je?Math.log(Rt<0?0:Rt):-Math.log(Rt>0?0:-Rt))/Math.log(Re)}function wt(Rt){return Je?Math.pow(Re,Rt):-Math.pow(Re,-Rt)}function $t(Rt){return ve(mt(Rt))}return $t.invert=function(Rt){return wt(ve.invert(Rt))},$t.domain=function(Rt){return arguments.length?(Je=Rt[0]>=0,ve.domain((ht=Rt.map(Number)).map(mt)),$t):ht},$t.base=function(Rt){return arguments.length?(Re=+Rt,ve.domain(ht.map(mt)),$t):Re},$t.nice=function(){var Rt=wn(ht.map(mt),Je?Math:as);return ve.domain(Rt),ht=Rt.map(wt),$t},$t.ticks=function(){var Rt=zn(ht),hr=[],Br=Rt[0],jr=Rt[1],va=Math.floor(mt(Br)),ua=Math.ceil(mt(jr)),Ha=Re%1?2:Re;if(isFinite(ua-va)){if(Je){for(;va0;Za--)hr.push(wt(va)*Za);for(va=0;hr[va]jr;ua--);hr=hr.slice(va,ua)}return hr},$t.copy=function(){return Ro(ve.copy(),Re,Je,ht)},Oi($t,ve)}var as={floor:function(ve){return-Math.ceil(-ve)},ceil:function(ve){return-Math.floor(-ve)}};d.scale.pow=function(){return Ps(d.scale.linear(),1,[0,1])};function Ps(ve,Re,Je){var ht=ds(Re),mt=ds(1/Re);function wt($t){return ve(ht($t))}return wt.invert=function($t){return mt(ve.invert($t))},wt.domain=function($t){return arguments.length?(ve.domain((Je=$t.map(Number)).map(ht)),wt):Je},wt.ticks=function($t){return Yi(Je,$t)},wt.tickFormat=function($t,Rt){return d3_scale_linearTickFormat(Je,$t,Rt)},wt.nice=function($t){return wt.domain(Vi(Je,$t))},wt.exponent=function($t){return arguments.length?(ht=ds(Re=$t),mt=ds(1/Re),ve.domain(Je.map(ht)),wt):Re},wt.copy=function(){return Ps(ve.copy(),Re,Je)},Oi(wt,ve)}function ds(ve){return function(Re){return Re<0?-Math.pow(-Re,ve):Math.pow(Re,ve)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return Cs([],{t:"range",a:[[]]})};function Cs(ve,Re){var Je,ht,mt;function wt(Rt){return ht[((Je.get(Rt)||(Re.t==="range"?Je.set(Rt,ve.push(Rt)):NaN))-1)%ht.length]}function $t(Rt,hr){return d.range(ve.length).map(function(Br){return Rt+hr*Br})}return wt.domain=function(Rt){if(!arguments.length)return ve;ve=[],Je=new S;for(var hr=-1,Br=Rt.length,jr;++hr0?Je[wt-1]:ve[0],wtua?0:1;if(jr=Ee)return hr(jr,Za)+(Br?hr(Br,1-Za):"")+"Z";var ya,Ca,Ua,rn,Ja=0,Aa=0,Jn,Wn,ii,yi,zi,ji,Po,qi,Co=[];if((rn=(+$t.apply(this,arguments)||0)/2)&&(Ua=ht===Ql?Math.sqrt(Br*Br+jr*jr):+ht.apply(this,arguments),Za||(Aa*=-1),jr&&(Aa=or(Ua/jr*Math.sin(rn))),Br&&(Ja=or(Ua/Br*Math.sin(rn)))),jr){Jn=jr*Math.cos(va+Aa),Wn=jr*Math.sin(va+Aa),ii=jr*Math.cos(ua-Aa),yi=jr*Math.sin(ua-Aa);var Bs=Math.abs(ua-va-2*Aa)<=Ce?0:1;if(Aa&&Ou(Jn,Wn,ii,yi)===Za^Bs){var Is=(va+ua)/2;Jn=jr*Math.cos(Is),Wn=jr*Math.sin(Is),ii=yi=null}}else Jn=Wn=0;if(Br){zi=Br*Math.cos(ua-Ja),ji=Br*Math.sin(ua-Ja),Po=Br*Math.cos(va+Ja),qi=Br*Math.sin(va+Ja);var Xs=Math.abs(va-ua+2*Ja)<=Ce?0:1;if(Ja&&Ou(zi,ji,Po,qi)===1-Za^Xs){var si=(va+ua)/2;zi=Br*Math.cos(si),ji=Br*Math.sin(si),Po=qi=null}}else zi=ji=0;if(Ha>Xe&&(ya=Math.min(Math.abs(jr-Br)/2,+Je.apply(this,arguments)))>.001){Ca=Br0?0:1}function Ki(ve,Re,Je,ht,mt){var wt=ve[0]-Re[0],$t=ve[1]-Re[1],Rt=(mt?ht:-ht)/Math.sqrt(wt*wt+$t*$t),hr=Rt*$t,Br=-Rt*wt,jr=ve[0]+hr,va=ve[1]+Br,ua=Re[0]+hr,Ha=Re[1]+Br,Za=(jr+ua)/2,ya=(va+Ha)/2,Ca=ua-jr,Ua=Ha-va,rn=Ca*Ca+Ua*Ua,Ja=Je-ht,Aa=jr*Ha-ua*va,Jn=(Ua<0?-1:1)*Math.sqrt(Math.max(0,Ja*Ja*rn-Aa*Aa)),Wn=(Aa*Ua-Ca*Jn)/rn,ii=(-Aa*Ca-Ua*Jn)/rn,yi=(Aa*Ua+Ca*Jn)/rn,zi=(-Aa*Ca+Ua*Jn)/rn,ji=Wn-Za,Po=ii-ya,qi=yi-Za,Co=zi-ya;return ji*ji+Po*Po>qi*qi+Co*Co&&(Wn=yi,ii=zi),[[Wn-hr,ii-Br],[Wn*Je/Ja,ii*Je/Ja]]}function xo(){return!0}function Ju(ve){var Re=ri,Je=vo,ht=xo,mt=pu,wt=mt.key,$t=.7;function Rt(hr){var Br=[],jr=[],va=-1,ua=hr.length,Ha,Za=Vr(Re),ya=Vr(Je);function Ca(){Br.push("M",mt(ve(jr),$t))}for(;++va1?ve.join("L"):ve+"Z"}function Be(ve){return ve.join("L")+"Z"}function R(ve){for(var Re=0,Je=ve.length,ht=ve[0],mt=[ht[0],",",ht[1]];++Re1&&mt.push("H",ht[0]),mt.join("")}function ae(ve){for(var Re=0,Je=ve.length,ht=ve[0],mt=[ht[0],",",ht[1]];++Re1){Rt=Re[1],wt=ve[hr],hr++,ht+="C"+(mt[0]+$t[0])+","+(mt[1]+$t[1])+","+(wt[0]-Rt[0])+","+(wt[1]-Rt[1])+","+wt[0]+","+wt[1];for(var Br=2;Br9&&(wt=Je*3/Math.sqrt(wt),$t[Rt]=wt*ht,$t[Rt+1]=wt*mt));for(Rt=-1;++Rt<=hr;)wt=(ve[Math.min(hr,Rt+1)][0]-ve[Math.max(0,Rt-1)][0])/(6*(1+$t[Rt]*$t[Rt])),Re.push([wt||0,$t[Rt]*wt||0]);return Re}function ir(ve){return ve.length<3?pu(ve):ve[0]+bt(ve,Pt(ve))}d.svg.line.radial=function(){var ve=Ju(fr);return ve.radius=ve.x,delete ve.x,ve.angle=ve.y,delete ve.y,ve};function fr(ve){for(var Re,Je=-1,ht=ve.length,mt,wt;++JeCe)+",1 "+va}function Br(jr,va,ua,Ha){return"Q 0,0 "+Ha}return wt.radius=function(jr){return arguments.length?(Je=Vr(jr),wt):Je},wt.source=function(jr){return arguments.length?(ve=Vr(jr),wt):ve},wt.target=function(jr){return arguments.length?(Re=Vr(jr),wt):Re},wt.startAngle=function(jr){return arguments.length?(ht=Vr(jr),wt):ht},wt.endAngle=function(jr){return arguments.length?(mt=Vr(jr),wt):mt},wt};function la(ve){return ve.radius}d.svg.diagonal=function(){var ve=zr,Re=Xr,Je=pa;function ht(mt,wt){var $t=ve.call(this,mt,wt),Rt=Re.call(this,mt,wt),hr=($t.y+Rt.y)/2,Br=[$t,{x:$t.x,y:hr},{x:Rt.x,y:hr},Rt];return Br=Br.map(Je),"M"+Br[0]+"C"+Br[1]+" "+Br[2]+" "+Br[3]}return ht.source=function(mt){return arguments.length?(ve=Vr(mt),ht):ve},ht.target=function(mt){return arguments.length?(Re=Vr(mt),ht):Re},ht.projection=function(mt){return arguments.length?(Je=mt,ht):Je},ht};function pa(ve){return[ve.x,ve.y]}d.svg.diagonal.radial=function(){var ve=d.svg.diagonal(),Re=pa,Je=ve.projection;return ve.projection=function(ht){return arguments.length?Je(ka(Re=ht)):Re},ve};function ka(ve){return function(){var Re=ve.apply(this,arguments),Je=Re[0],ht=Re[1]-Se;return[Je*Math.cos(ht),Je*Math.sin(ht)]}}d.svg.symbol=function(){var ve=Dn,Re=tn;function Je(ht,mt){return(Yn.get(ve.call(this,ht,mt))||In)(Re.call(this,ht,mt))}return Je.type=function(ht){return arguments.length?(ve=Vr(ht),Je):ve},Je.size=function(ht){return arguments.length?(Re=Vr(ht),Je):Re},Je};function tn(){return 64}function Dn(){return"circle"}function In(ve){var Re=Math.sqrt(ve/Ce);return"M0,"+Re+"A"+Re+","+Re+" 0 1,1 0,"+-Re+"A"+Re+","+Re+" 0 1,1 0,"+Re+"Z"}var Yn=d.map({circle:In,cross:function(ve){var Re=Math.sqrt(ve/5)/2;return"M"+-3*Re+","+-Re+"H"+-Re+"V"+-3*Re+"H"+Re+"V"+-Re+"H"+3*Re+"V"+Re+"H"+Re+"V"+3*Re+"H"+-Re+"V"+Re+"H"+-3*Re+"Z"},diamond:function(ve){var Re=Math.sqrt(ve/(2*Di)),Je=Re*Di;return"M0,"+-Re+"L"+Je+",0 0,"+Re+" "+-Je+",0Z"},square:function(ve){var Re=Math.sqrt(ve)/2;return"M"+-Re+","+-Re+"L"+Re+","+-Re+" "+Re+","+Re+" "+-Re+","+Re+"Z"},"triangle-down":function(ve){var Re=Math.sqrt(ve/di),Je=Re*di/2;return"M0,"+Je+"L"+Re+","+-Je+" "+-Re+","+-Je+"Z"},"triangle-up":function(ve){var Re=Math.sqrt(ve/di),Je=Re*di/2;return"M0,"+-Je+"L"+Re+","+Je+" "+-Re+","+Je+"Z"}});d.svg.symbolTypes=Yn.keys();var di=Math.sqrt(3),Di=Math.tan(30*Le);ne.transition=function(ve){for(var Re=Zo||++Lo,Je=zo(ve),ht=[],mt,wt,$t=Os||{time:Date.now(),ease:hl,delay:0,duration:250},Rt=-1,hr=this.length;++Rt0;)va[--rn].call(ve,Ua);if(Ca>=1)return $t.event&&$t.event.end.call(ve,ve.__data__,Re),--wt.count?delete wt[ht]:delete ve[Je],1}$t||(Rt=mt.time,hr=_i(ua,0,Rt),$t=wt[ht]={tween:new S,time:Rt,timer:hr,delay:mt.delay,duration:mt.duration,ease:mt.ease,index:Re},mt=null,++wt.count)}d.svg.axis=function(){var ve=d.scale.linear(),Re=Sl,Je=6,ht=6,mt=3,wt=[10],$t=null,Rt;function hr(Br){Br.each(function(){var jr=d.select(this),va=this.__chart__||ve,ua=this.__chart__=ve.copy(),Ha=$t??(ua.ticks?ua.ticks.apply(ua,wt):ua.domain()),Za=Rt??(ua.tickFormat?ua.tickFormat.apply(ua,wt):F),ya=jr.selectAll(".tick").data(Ha,ua),Ca=ya.enter().insert("g",".domain").attr("class","tick").style("opacity",Xe),Ua=d.transition(ya.exit()).style("opacity",Xe).remove(),rn=d.transition(ya.order()).style("opacity",1),Ja=Math.max(Je,0)+mt,Aa,Jn=Gn(ua),Wn=jr.selectAll(".domain").data([0]),ii=(Wn.enter().append("path").attr("class","domain"),d.transition(Wn));Ca.append("line"),Ca.append("text");var yi=Ca.select("line"),zi=rn.select("line"),ji=ya.select("text").text(Za),Po=Ca.select("text"),qi=rn.select("text"),Co=Re==="top"||Re==="left"?-1:1,Bs,Is,Xs,si;if(Re==="bottom"||Re==="top"?(Aa=Fl,Bs="x",Xs="y",Is="x2",si="y2",ji.attr("dy",Co<0?"0em":".71em").style("text-anchor","middle"),ii.attr("d","M"+Jn[0]+","+Co*ht+"V0H"+Jn[1]+"V"+Co*ht)):(Aa=Js,Bs="y",Xs="x",Is="y2",si="x2",ji.attr("dy",".32em").style("text-anchor",Co<0?"end":"start"),ii.attr("d","M"+Co*ht+","+Jn[0]+"H0V"+Jn[1]+"H"+Co*ht)),yi.attr(si,Co*Je),Po.attr(Xs,Co*Ja),zi.attr(Is,0).attr(si,Co*Je),qi.attr(Bs,0).attr(Xs,Co*Ja),ua.rangeBand){var $i=ua,Wo=$i.rangeBand()/2;va=ua=function(Yo){return $i(Yo)+Wo}}else va.rangeBand?va=ua:Ua.call(Aa,ua,va);Ca.call(Aa,va,ua),rn.call(Aa,ua,ua)})}return hr.scale=function(Br){return arguments.length?(ve=Br,hr):ve},hr.orient=function(Br){return arguments.length?(Re=Br in eu?Br+"":Sl,hr):Re},hr.ticks=function(){return arguments.length?(wt=A(arguments),hr):wt},hr.tickValues=function(Br){return arguments.length?($t=Br,hr):$t},hr.tickFormat=function(Br){return arguments.length?(Rt=Br,hr):Rt},hr.tickSize=function(Br){var jr=arguments.length;return jr?(Je=+Br,ht=+arguments[jr-1],hr):Je},hr.innerTickSize=function(Br){return arguments.length?(Je=+Br,hr):Je},hr.outerTickSize=function(Br){return arguments.length?(ht=+Br,hr):ht},hr.tickPadding=function(Br){return arguments.length?(mt=+Br,hr):mt},hr.tickSubdivide=function(){return arguments.length&&hr},hr};var Sl="bottom",eu={top:1,right:1,bottom:1,left:1};function Fl(ve,Re,Je){ve.attr("transform",function(ht){var mt=Re(ht);return"translate("+(isFinite(mt)?mt:Je(ht))+",0)"})}function Js(ve,Re,Je){ve.attr("transform",function(ht){var mt=Re(ht);return"translate(0,"+(isFinite(mt)?mt:Je(ht))+")"})}d.svg.brush=function(){var ve=se(jr,"brushstart","brush","brushend"),Re=null,Je=null,ht=[0,0],mt=[0,0],wt,$t,Rt=!0,hr=!0,Br=ku[0];function jr(ya){ya.each(function(){var Ca=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Za).on("touchstart.brush",Za),Ua=Ca.selectAll(".background").data([0]);Ua.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Ca.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var rn=Ca.selectAll(".resize").data(Br,F);rn.exit().remove(),rn.enter().append("g").attr("class",function(Wn){return"resize "+Wn}).style("cursor",function(Wn){return Il[Wn]}).append("rect").attr("x",function(Wn){return/[ew]$/.test(Wn)?-3:null}).attr("y",function(Wn){return/^[ns]/.test(Wn)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),rn.style("display",jr.empty()?"none":null);var Ja=d.transition(Ca),Aa=d.transition(Ua),Jn;Re&&(Jn=Gn(Re),Aa.attr("x",Jn[0]).attr("width",Jn[1]-Jn[0]),ua(Ja)),Je&&(Jn=Gn(Je),Aa.attr("y",Jn[0]).attr("height",Jn[1]-Jn[0]),Ha(Ja)),va(Ja)})}jr.event=function(ya){ya.each(function(){var Ca=ve.of(this,arguments),Ua={x:ht,y:mt,i:wt,j:$t},rn=this.__chart__||Ua;this.__chart__=Ua,Zo?d.select(this).transition().each("start.brush",function(){wt=rn.i,$t=rn.j,ht=rn.x,mt=rn.y,Ca({type:"brushstart"})}).tween("brush:brush",function(){var Ja=lu(ht,Ua.x),Aa=lu(mt,Ua.y);return wt=$t=null,function(Jn){ht=Ua.x=Ja(Jn),mt=Ua.y=Aa(Jn),Ca({type:"brush",mode:"resize"})}}).each("end.brush",function(){wt=Ua.i,$t=Ua.j,Ca({type:"brush",mode:"resize"}),Ca({type:"brushend"})}):(Ca({type:"brushstart"}),Ca({type:"brush",mode:"resize"}),Ca({type:"brushend"}))})};function va(ya){ya.selectAll(".resize").attr("transform",function(Ca){return"translate("+ht[+/e$/.test(Ca)]+","+mt[+/^s/.test(Ca)]+")"})}function ua(ya){ya.select(".extent").attr("x",ht[0]),ya.selectAll(".extent,.n>rect,.s>rect").attr("width",ht[1]-ht[0])}function Ha(ya){ya.select(".extent").attr("y",mt[0]),ya.selectAll(".extent,.e>rect,.w>rect").attr("height",mt[1]-mt[0])}function Za(){var ya=this,Ca=d.select(d.event.target),Ua=ve.of(ya,arguments),rn=d.select(ya),Ja=Ca.datum(),Aa=!/^(n|s)$/.test(Ja)&&Re,Jn=!/^(e|w)$/.test(Ja)&&Je,Wn=Ca.classed("extent"),ii=mr(ya),yi,zi=d.mouse(ya),ji,Po=d.select(t(ya)).on("keydown.brush",Bs).on("keyup.brush",Is);if(d.event.changedTouches?Po.on("touchmove.brush",Xs).on("touchend.brush",$i):Po.on("mousemove.brush",Xs).on("mouseup.brush",$i),rn.interrupt().selectAll("*").interrupt(),Wn)zi[0]=ht[0]-zi[0],zi[1]=mt[0]-zi[1];else if(Ja){var qi=+/w$/.test(Ja),Co=+/^n/.test(Ja);ji=[ht[1-qi]-zi[0],mt[1-Co]-zi[1]],zi[0]=ht[qi],zi[1]=mt[Co]}else d.event.altKey&&(yi=zi.slice());rn.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Ca.style("cursor")),Ua({type:"brushstart"}),Xs();function Bs(){d.event.keyCode==32&&(Wn||(yi=null,zi[0]-=ht[1],zi[1]-=mt[1],Wn=2),Q())}function Is(){d.event.keyCode==32&&Wn==2&&(zi[0]+=ht[1],zi[1]+=mt[1],Wn=0,Q())}function Xs(){var Wo=d.mouse(ya),Yo=!1;ji&&(Wo[0]+=ji[0],Wo[1]+=ji[1]),Wn||(d.event.altKey?(yi||(yi=[(ht[0]+ht[1])/2,(mt[0]+mt[1])/2]),zi[0]=ht[+(Wo[0]0))return jt;do jt.push(_r=new Date(+kt)),ze(kt,Bt),ce(kt);while(_r=Et)for(;ce(Et),!kt(Et);)Et.setTime(Et-1)},function(Et,Bt){if(Et>=Et)if(Bt<0)for(;++Bt<=0;)for(;ze(Et,-1),!kt(Et););else for(;--Bt>=0;)for(;ze(Et,1),!kt(Et););})},Qe&&(Ke.count=function(kt,Et){return x.setTime(+kt),A.setTime(+Et),ce(x),ce(A),Math.floor(Qe(x,A))},Ke.every=function(kt){return kt=Math.floor(kt),!isFinite(kt)||!(kt>0)?null:kt>1?Ke.filter(nt?function(Et){return nt(Et)%kt===0}:function(Et){return Ke.count(0,Et)%kt===0}):Ke}),Ke}var e=E(function(){},function(ce,ze){ce.setTime(+ce+ze)},function(ce,ze){return ze-ce});e.every=function(ce){return ce=Math.floor(ce),!isFinite(ce)||!(ce>0)?null:ce>1?E(function(ze){ze.setTime(Math.floor(ze/ce)*ce)},function(ze,Qe){ze.setTime(+ze+Qe*ce)},function(ze,Qe){return(Qe-ze)/ce}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=E(function(ce){ce.setTime(ce-ce.getMilliseconds())},function(ce,ze){ce.setTime(+ce+ze*r)},function(ce,ze){return(ze-ce)/r},function(ce){return ce.getUTCSeconds()}),h=s.range,c=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r)},function(ce,ze){ce.setTime(+ce+ze*o)},function(ce,ze){return(ze-ce)/o},function(ce){return ce.getMinutes()}),m=c.range,p=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r-ce.getMinutes()*o)},function(ce,ze){ce.setTime(+ce+ze*a)},function(ce,ze){return(ze-ce)/a},function(ce){return ce.getHours()}),T=p.range,l=E(function(ce){ce.setHours(0,0,0,0)},function(ce,ze){ce.setDate(ce.getDate()+ze)},function(ce,ze){return(ze-ce-(ze.getTimezoneOffset()-ce.getTimezoneOffset())*o)/i},function(ce){return ce.getDate()-1}),_=l.range;function w(ce){return E(function(ze){ze.setDate(ze.getDate()-(ze.getDay()+7-ce)%7),ze.setHours(0,0,0,0)},function(ze,Qe){ze.setDate(ze.getDate()+Qe*7)},function(ze,Qe){return(Qe-ze-(Qe.getTimezoneOffset()-ze.getTimezoneOffset())*o)/n})}var S=w(0),M=w(1),y=w(2),b=w(3),v=w(4),u=w(5),g=w(6),f=S.range,P=M.range,L=y.range,z=b.range,F=v.range,B=u.range,O=g.range,I=E(function(ce){ce.setDate(1),ce.setHours(0,0,0,0)},function(ce,ze){ce.setMonth(ce.getMonth()+ze)},function(ce,ze){return ze.getMonth()-ce.getMonth()+(ze.getFullYear()-ce.getFullYear())*12},function(ce){return ce.getMonth()}),N=I.range,U=E(function(ce){ce.setMonth(0,1),ce.setHours(0,0,0,0)},function(ce,ze){ce.setFullYear(ce.getFullYear()+ze)},function(ce,ze){return ze.getFullYear()-ce.getFullYear()},function(ce){return ce.getFullYear()});U.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(ze){ze.setFullYear(Math.floor(ze.getFullYear()/ce)*ce),ze.setMonth(0,1),ze.setHours(0,0,0,0)},function(ze,Qe){ze.setFullYear(ze.getFullYear()+Qe*ce)})};var W=U.range,Q=E(function(ce){ce.setUTCSeconds(0,0)},function(ce,ze){ce.setTime(+ce+ze*o)},function(ce,ze){return(ze-ce)/o},function(ce){return ce.getUTCMinutes()}),le=Q.range,se=E(function(ce){ce.setUTCMinutes(0,0,0)},function(ce,ze){ce.setTime(+ce+ze*a)},function(ce,ze){return(ze-ce)/a},function(ce){return ce.getUTCHours()}),he=se.range,q=E(function(ce){ce.setUTCHours(0,0,0,0)},function(ce,ze){ce.setUTCDate(ce.getUTCDate()+ze)},function(ce,ze){return(ze-ce)/i},function(ce){return ce.getUTCDate()-1}),$=q.range;function J(ce){return E(function(ze){ze.setUTCDate(ze.getUTCDate()-(ze.getUTCDay()+7-ce)%7),ze.setUTCHours(0,0,0,0)},function(ze,Qe){ze.setUTCDate(ze.getUTCDate()+Qe*7)},function(ze,Qe){return(Qe-ze)/n})}var X=J(0),oe=J(1),ne=J(2),j=J(3),ee=J(4),re=J(5),ue=J(6),_e=X.range,Te=oe.range,Ie=ne.range,De=j.range,He=ee.range,et=re.range,rt=ue.range,$e=E(function(ce){ce.setUTCDate(1),ce.setUTCHours(0,0,0,0)},function(ce,ze){ce.setUTCMonth(ce.getUTCMonth()+ze)},function(ce,ze){return ze.getUTCMonth()-ce.getUTCMonth()+(ze.getUTCFullYear()-ce.getUTCFullYear())*12},function(ce){return ce.getUTCMonth()}),ot=$e.range,Ae=E(function(ce){ce.setUTCMonth(0,1),ce.setUTCHours(0,0,0,0)},function(ce,ze){ce.setUTCFullYear(ce.getUTCFullYear()+ze)},function(ce,ze){return ze.getUTCFullYear()-ce.getUTCFullYear()},function(ce){return ce.getUTCFullYear()});Ae.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(ze){ze.setUTCFullYear(Math.floor(ze.getUTCFullYear()/ce)*ce),ze.setUTCMonth(0,1),ze.setUTCHours(0,0,0,0)},function(ze,Qe){ze.setUTCFullYear(ze.getUTCFullYear()+Qe*ce)})};var ge=Ae.range;d.timeDay=l,d.timeDays=_,d.timeFriday=u,d.timeFridays=B,d.timeHour=p,d.timeHours=T,d.timeInterval=E,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=c,d.timeMinutes=m,d.timeMonday=M,d.timeMondays=P,d.timeMonth=I,d.timeMonths=N,d.timeSaturday=g,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=h,d.timeSunday=S,d.timeSundays=f,d.timeThursday=v,d.timeThursdays=F,d.timeTuesday=y,d.timeTuesdays=L,d.timeWednesday=b,d.timeWednesdays=z,d.timeWeek=S,d.timeWeeks=f,d.timeYear=U,d.timeYears=W,d.utcDay=q,d.utcDays=$,d.utcFriday=re,d.utcFridays=et,d.utcHour=se,d.utcHours=he,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=Q,d.utcMinutes=le,d.utcMonday=oe,d.utcMondays=Te,d.utcMonth=$e,d.utcMonths=ot,d.utcSaturday=ue,d.utcSaturdays=rt,d.utcSecond=s,d.utcSeconds=h,d.utcSunday=X,d.utcSundays=_e,d.utcThursday=ee,d.utcThursdays=He,d.utcTuesday=ne,d.utcTuesdays=Ie,d.utcWednesday=j,d.utcWednesdays=De,d.utcWeek=X,d.utcWeeks=_e,d.utcYear=Ae,d.utcYears=ge,Object.defineProperty(d,"__esModule",{value:!0})})}}),b0=We({"node_modules/d3-time-format/dist/d3-time-format.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z,Xx()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function A(Oe){if(0<=Oe.y&&Oe.y<100){var Xe=new Date(-1,Oe.m,Oe.d,Oe.H,Oe.M,Oe.S,Oe.L);return Xe.setFullYear(Oe.y),Xe}return new Date(Oe.y,Oe.m,Oe.d,Oe.H,Oe.M,Oe.S,Oe.L)}function E(Oe){if(0<=Oe.y&&Oe.y<100){var Xe=new Date(Date.UTC(-1,Oe.m,Oe.d,Oe.H,Oe.M,Oe.S,Oe.L));return Xe.setUTCFullYear(Oe.y),Xe}return new Date(Date.UTC(Oe.y,Oe.m,Oe.d,Oe.H,Oe.M,Oe.S,Oe.L))}function e(Oe,Xe,be){return{y:Oe,m:Xe,d:be,H:0,M:0,S:0,L:0}}function t(Oe){var Xe=Oe.dateTime,be=Oe.date,Ce=Oe.time,Ne=Oe.periods,Ee=Oe.days,Se=Oe.shortDays,Le=Oe.months,at=Oe.shortMonths,dt=h(Ne),gt=c(Ne),Ct=h(Ee),or=c(Ee),Qt=h(Se),Jt=c(Se),Sr=h(Le),oa=c(Le),Ea=h(at),Sa=c(at),za={a:Ga,A:ja,b:Xa,B:sn,c:null,d:I,e:I,f:le,H:N,I:U,j:W,L:Q,m:se,M:he,p:Ma,q:Xn,Q:Et,s:Bt,S:q,u:$,U:J,V:X,w:oe,W:ne,x:null,X:null,y:j,Y:ee,Z:re,"%":kt},Na={a:Kn,A:St,b:lt,B:br,c:null,d:ue,e:ue,f:He,H:_e,I:Te,j:Ie,L:De,m:et,M:rt,p:kr,q:Lr,Q:Et,s:Bt,S:$e,u:ot,U:Ae,V:ge,w:ce,W:ze,x:null,X:null,y:Qe,Y:nt,Z:Ke,"%":kt},Ta={a:Gt,A:Xt,b:Rr,B:Yr,c:Jr,d:v,e:v,f:z,H:g,I:g,j:u,L,m:b,M:f,p:It,q:y,Q:B,s:O,S:P,u:p,U:T,V:l,w:m,W:_,x:ia,X:Pa,y:S,Y:w,Z:M,"%":F};za.x=nn(be,za),za.X=nn(Ce,za),za.c=nn(Xe,za),Na.x=nn(be,Na),Na.X=nn(Ce,Na),Na.c=nn(Xe,Na);function nn(Tr,Cr){return function(Kr){var Nr=[],_t=-1,Wt=0,Ar=Tr.length,Vr,ma,ba;for(Kr instanceof Date||(Kr=new Date(+Kr));++_t53)return null;"w"in Nr||(Nr.w=1),"Z"in Nr?(Wt=E(e(Nr.y,0,1)),Ar=Wt.getUTCDay(),Wt=Ar>4||Ar===0?x.utcMonday.ceil(Wt):x.utcMonday(Wt),Wt=x.utcDay.offset(Wt,(Nr.V-1)*7),Nr.y=Wt.getUTCFullYear(),Nr.m=Wt.getUTCMonth(),Nr.d=Wt.getUTCDate()+(Nr.w+6)%7):(Wt=A(e(Nr.y,0,1)),Ar=Wt.getDay(),Wt=Ar>4||Ar===0?x.timeMonday.ceil(Wt):x.timeMonday(Wt),Wt=x.timeDay.offset(Wt,(Nr.V-1)*7),Nr.y=Wt.getFullYear(),Nr.m=Wt.getMonth(),Nr.d=Wt.getDate()+(Nr.w+6)%7)}else("W"in Nr||"U"in Nr)&&("w"in Nr||(Nr.w="u"in Nr?Nr.u%7:"W"in Nr?1:0),Ar="Z"in Nr?E(e(Nr.y,0,1)).getUTCDay():A(e(Nr.y,0,1)).getDay(),Nr.m=0,Nr.d="W"in Nr?(Nr.w+6)%7+Nr.W*7-(Ar+5)%7:Nr.w+Nr.U*7-(Ar+6)%7);return"Z"in Nr?(Nr.H+=Nr.Z/100|0,Nr.M+=Nr.Z%100,E(Nr)):A(Nr)}}function Ht(Tr,Cr,Kr,Nr){for(var _t=0,Wt=Cr.length,Ar=Kr.length,Vr,ma;_t=Ar)return-1;if(Vr=Cr.charCodeAt(_t++),Vr===37){if(Vr=Cr.charAt(_t++),ma=Ta[Vr in r?Cr.charAt(_t++):Vr],!ma||(Nr=ma(Tr,Kr,Nr))<0)return-1}else if(Vr!=Kr.charCodeAt(Nr++))return-1}return Nr}function It(Tr,Cr,Kr){var Nr=dt.exec(Cr.slice(Kr));return Nr?(Tr.p=gt[Nr[0].toLowerCase()],Kr+Nr[0].length):-1}function Gt(Tr,Cr,Kr){var Nr=Qt.exec(Cr.slice(Kr));return Nr?(Tr.w=Jt[Nr[0].toLowerCase()],Kr+Nr[0].length):-1}function Xt(Tr,Cr,Kr){var Nr=Ct.exec(Cr.slice(Kr));return Nr?(Tr.w=or[Nr[0].toLowerCase()],Kr+Nr[0].length):-1}function Rr(Tr,Cr,Kr){var Nr=Ea.exec(Cr.slice(Kr));return Nr?(Tr.m=Sa[Nr[0].toLowerCase()],Kr+Nr[0].length):-1}function Yr(Tr,Cr,Kr){var Nr=Sr.exec(Cr.slice(Kr));return Nr?(Tr.m=oa[Nr[0].toLowerCase()],Kr+Nr[0].length):-1}function Jr(Tr,Cr,Kr){return Ht(Tr,Xe,Cr,Kr)}function ia(Tr,Cr,Kr){return Ht(Tr,be,Cr,Kr)}function Pa(Tr,Cr,Kr){return Ht(Tr,Ce,Cr,Kr)}function Ga(Tr){return Se[Tr.getDay()]}function ja(Tr){return Ee[Tr.getDay()]}function Xa(Tr){return at[Tr.getMonth()]}function sn(Tr){return Le[Tr.getMonth()]}function Ma(Tr){return Ne[+(Tr.getHours()>=12)]}function Xn(Tr){return 1+~~(Tr.getMonth()/3)}function Kn(Tr){return Se[Tr.getUTCDay()]}function St(Tr){return Ee[Tr.getUTCDay()]}function lt(Tr){return at[Tr.getUTCMonth()]}function br(Tr){return Le[Tr.getUTCMonth()]}function kr(Tr){return Ne[+(Tr.getUTCHours()>=12)]}function Lr(Tr){return 1+~~(Tr.getUTCMonth()/3)}return{format:function(Tr){var Cr=nn(Tr+="",za);return Cr.toString=function(){return Tr},Cr},parse:function(Tr){var Cr=gn(Tr+="",!1);return Cr.toString=function(){return Tr},Cr},utcFormat:function(Tr){var Cr=nn(Tr+="",Na);return Cr.toString=function(){return Tr},Cr},utcParse:function(Tr){var Cr=gn(Tr+="",!0);return Cr.toString=function(){return Tr},Cr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(Oe,Xe,be){var Ce=Oe<0?"-":"",Ne=(Ce?-Oe:Oe)+"",Ee=Ne.length;return Ce+(Ee68?1900:2e3),be+Ce[0].length):-1}function M(Oe,Xe,be){var Ce=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Xe.slice(be,be+6));return Ce?(Oe.Z=Ce[1]?0:-(Ce[2]+(Ce[3]||"00")),be+Ce[0].length):-1}function y(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+1));return Ce?(Oe.q=Ce[0]*3-3,be+Ce[0].length):-1}function b(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+2));return Ce?(Oe.m=Ce[0]-1,be+Ce[0].length):-1}function v(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+2));return Ce?(Oe.d=+Ce[0],be+Ce[0].length):-1}function u(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+3));return Ce?(Oe.m=0,Oe.d=+Ce[0],be+Ce[0].length):-1}function g(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+2));return Ce?(Oe.H=+Ce[0],be+Ce[0].length):-1}function f(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+2));return Ce?(Oe.M=+Ce[0],be+Ce[0].length):-1}function P(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+2));return Ce?(Oe.S=+Ce[0],be+Ce[0].length):-1}function L(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+3));return Ce?(Oe.L=+Ce[0],be+Ce[0].length):-1}function z(Oe,Xe,be){var Ce=o.exec(Xe.slice(be,be+6));return Ce?(Oe.L=Math.floor(Ce[0]/1e3),be+Ce[0].length):-1}function F(Oe,Xe,be){var Ce=a.exec(Xe.slice(be,be+1));return Ce?be+Ce[0].length:-1}function B(Oe,Xe,be){var Ce=o.exec(Xe.slice(be));return Ce?(Oe.Q=+Ce[0],be+Ce[0].length):-1}function O(Oe,Xe,be){var Ce=o.exec(Xe.slice(be));return Ce?(Oe.s=+Ce[0],be+Ce[0].length):-1}function I(Oe,Xe){return n(Oe.getDate(),Xe,2)}function N(Oe,Xe){return n(Oe.getHours(),Xe,2)}function U(Oe,Xe){return n(Oe.getHours()%12||12,Xe,2)}function W(Oe,Xe){return n(1+x.timeDay.count(x.timeYear(Oe),Oe),Xe,3)}function Q(Oe,Xe){return n(Oe.getMilliseconds(),Xe,3)}function le(Oe,Xe){return Q(Oe,Xe)+"000"}function se(Oe,Xe){return n(Oe.getMonth()+1,Xe,2)}function he(Oe,Xe){return n(Oe.getMinutes(),Xe,2)}function q(Oe,Xe){return n(Oe.getSeconds(),Xe,2)}function $(Oe){var Xe=Oe.getDay();return Xe===0?7:Xe}function J(Oe,Xe){return n(x.timeSunday.count(x.timeYear(Oe)-1,Oe),Xe,2)}function X(Oe,Xe){var be=Oe.getDay();return Oe=be>=4||be===0?x.timeThursday(Oe):x.timeThursday.ceil(Oe),n(x.timeThursday.count(x.timeYear(Oe),Oe)+(x.timeYear(Oe).getDay()===4),Xe,2)}function oe(Oe){return Oe.getDay()}function ne(Oe,Xe){return n(x.timeMonday.count(x.timeYear(Oe)-1,Oe),Xe,2)}function j(Oe,Xe){return n(Oe.getFullYear()%100,Xe,2)}function ee(Oe,Xe){return n(Oe.getFullYear()%1e4,Xe,4)}function re(Oe){var Xe=Oe.getTimezoneOffset();return(Xe>0?"-":(Xe*=-1,"+"))+n(Xe/60|0,"0",2)+n(Xe%60,"0",2)}function ue(Oe,Xe){return n(Oe.getUTCDate(),Xe,2)}function _e(Oe,Xe){return n(Oe.getUTCHours(),Xe,2)}function Te(Oe,Xe){return n(Oe.getUTCHours()%12||12,Xe,2)}function Ie(Oe,Xe){return n(1+x.utcDay.count(x.utcYear(Oe),Oe),Xe,3)}function De(Oe,Xe){return n(Oe.getUTCMilliseconds(),Xe,3)}function He(Oe,Xe){return De(Oe,Xe)+"000"}function et(Oe,Xe){return n(Oe.getUTCMonth()+1,Xe,2)}function rt(Oe,Xe){return n(Oe.getUTCMinutes(),Xe,2)}function $e(Oe,Xe){return n(Oe.getUTCSeconds(),Xe,2)}function ot(Oe){var Xe=Oe.getUTCDay();return Xe===0?7:Xe}function Ae(Oe,Xe){return n(x.utcSunday.count(x.utcYear(Oe)-1,Oe),Xe,2)}function ge(Oe,Xe){var be=Oe.getUTCDay();return Oe=be>=4||be===0?x.utcThursday(Oe):x.utcThursday.ceil(Oe),n(x.utcThursday.count(x.utcYear(Oe),Oe)+(x.utcYear(Oe).getUTCDay()===4),Xe,2)}function ce(Oe){return Oe.getUTCDay()}function ze(Oe,Xe){return n(x.utcMonday.count(x.utcYear(Oe)-1,Oe),Xe,2)}function Qe(Oe,Xe){return n(Oe.getUTCFullYear()%100,Xe,2)}function nt(Oe,Xe){return n(Oe.getUTCFullYear()%1e4,Xe,4)}function Ke(){return"+0000"}function kt(){return"%"}function Et(Oe){return+Oe}function Bt(Oe){return Math.floor(+Oe/1e3)}var jt;_r({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _r(Oe){return jt=t(Oe),d.timeFormat=jt.format,d.timeParse=jt.parse,d.utcFormat=jt.utcFormat,d.utcParse=jt.utcParse,jt}var pr="%Y-%m-%dT%H:%M:%S.%LZ";function Or(Oe){return Oe.toISOString()}var mr=Date.prototype.toISOString?Or:d.utcFormat(pr);function Er(Oe){var Xe=new Date(Oe);return isNaN(Xe)?null:Xe}var yt=+new Date("2000-01-01T00:00:00.000Z")?Er:d.utcParse(pr);d.isoFormat=mr,d.isoParse=yt,d.timeFormatDefaultLocale=_r,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),Zx=We({"node_modules/d3-format/dist/d3-format.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){return Math.abs(b=Math.round(b))>=1e21?b.toLocaleString("en").replace(/,/g,""):b.toString(10)}function A(b,v){if((u=(b=v?b.toExponential(v-1):b.toExponential()).indexOf("e"))<0)return null;var u,g=b.slice(0,u);return[g.length>1?g[0]+g.slice(2):g,+b.slice(u+1)]}function E(b){return b=A(Math.abs(b)),b?b[1]:NaN}function e(b,v){return function(u,g){for(var f=u.length,P=[],L=0,z=b[0],F=0;f>0&&z>0&&(F+z+1>g&&(z=Math.max(1,g-F)),P.push(u.substring(f-=z,f+z)),!((F+=z+1)>g));)z=b[L=(L+1)%b.length];return P.reverse().join(v)}}function t(b){return function(v){return v.replace(/[0-9]/g,function(u){return b[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(b){if(!(v=r.exec(b)))throw new Error("invalid format: "+b);var v;return new a({fill:v[1],align:v[2],sign:v[3],symbol:v[4],zero:v[5],width:v[6],comma:v[7],precision:v[8]&&v[8].slice(1),trim:v[9],type:v[10]})}o.prototype=a.prototype;function a(b){this.fill=b.fill===void 0?" ":b.fill+"",this.align=b.align===void 0?">":b.align+"",this.sign=b.sign===void 0?"-":b.sign+"",this.symbol=b.symbol===void 0?"":b.symbol+"",this.zero=!!b.zero,this.width=b.width===void 0?void 0:+b.width,this.comma=!!b.comma,this.precision=b.precision===void 0?void 0:+b.precision,this.trim=!!b.trim,this.type=b.type===void 0?"":b.type+""}a.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 i(b){e:for(var v=b.length,u=1,g=-1,f;u0&&(g=0);break}return g>0?b.slice(0,g)+b.slice(f+1):b}var n;function s(b,v){var u=A(b,v);if(!u)return b+"";var g=u[0],f=u[1],P=f-(n=Math.max(-8,Math.min(8,Math.floor(f/3)))*3)+1,L=g.length;return P===L?g:P>L?g+new Array(P-L+1).join("0"):P>0?g.slice(0,P)+"."+g.slice(P):"0."+new Array(1-P).join("0")+A(b,Math.max(0,v+P-1))[0]}function h(b,v){var u=A(b,v);if(!u)return b+"";var g=u[0],f=u[1];return f<0?"0."+new Array(-f).join("0")+g:g.length>f+1?g.slice(0,f+1)+"."+g.slice(f+1):g+new Array(f-g.length+2).join("0")}var c={"%":function(b,v){return(b*100).toFixed(v)},b:function(b){return Math.round(b).toString(2)},c:function(b){return b+""},d:x,e:function(b,v){return b.toExponential(v)},f:function(b,v){return b.toFixed(v)},g:function(b,v){return b.toPrecision(v)},o:function(b){return Math.round(b).toString(8)},p:function(b,v){return h(b*100,v)},r:h,s,X:function(b){return Math.round(b).toString(16).toUpperCase()},x:function(b){return Math.round(b).toString(16)}};function m(b){return b}var p=Array.prototype.map,T=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function l(b){var v=b.grouping===void 0||b.thousands===void 0?m:e(p.call(b.grouping,Number),b.thousands+""),u=b.currency===void 0?"":b.currency[0]+"",g=b.currency===void 0?"":b.currency[1]+"",f=b.decimal===void 0?".":b.decimal+"",P=b.numerals===void 0?m:t(p.call(b.numerals,String)),L=b.percent===void 0?"%":b.percent+"",z=b.minus===void 0?"-":b.minus+"",F=b.nan===void 0?"NaN":b.nan+"";function B(I){I=o(I);var N=I.fill,U=I.align,W=I.sign,Q=I.symbol,le=I.zero,se=I.width,he=I.comma,q=I.precision,$=I.trim,J=I.type;J==="n"?(he=!0,J="g"):c[J]||(q===void 0&&(q=12),$=!0,J="g"),(le||N==="0"&&U==="=")&&(le=!0,N="0",U="=");var X=Q==="$"?u:Q==="#"&&/[boxX]/.test(J)?"0"+J.toLowerCase():"",oe=Q==="$"?g:/[%p]/.test(J)?L:"",ne=c[J],j=/[defgprs%]/.test(J);q=q===void 0?6:/[gprs]/.test(J)?Math.max(1,Math.min(21,q)):Math.max(0,Math.min(20,q));function ee(re){var ue=X,_e=oe,Te,Ie,De;if(J==="c")_e=ne(re)+_e,re="";else{re=+re;var He=re<0||1/re<0;if(re=isNaN(re)?F:ne(Math.abs(re),q),$&&(re=i(re)),He&&+re==0&&W!=="+"&&(He=!1),ue=(He?W==="("?W:z:W==="-"||W==="("?"":W)+ue,_e=(J==="s"?T[8+n/3]:"")+_e+(He&&W==="("?")":""),j){for(Te=-1,Ie=re.length;++TeDe||De>57){_e=(De===46?f+re.slice(Te+1):re.slice(Te))+_e,re=re.slice(0,Te);break}}}he&&!le&&(re=v(re,1/0));var et=ue.length+re.length+_e.length,rt=et>1)+ue+re+_e+rt.slice(et);break;default:re=rt+ue+re+_e;break}return P(re)}return ee.toString=function(){return I+""},ee}function O(I,N){var U=B((I=o(I),I.type="f",I)),W=Math.max(-8,Math.min(8,Math.floor(E(N)/3)))*3,Q=Math.pow(10,-W),le=T[8+W/3];return function(se){return U(Q*se)+le}}return{format:B,formatPrefix:O}}var _;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(b){return _=l(b),d.format=_.format,d.formatPrefix=_.formatPrefix,_}function S(b){return Math.max(0,-E(Math.abs(b)))}function M(b,v){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(v)/3)))*3-E(Math.abs(b)))}function y(b,v){return b=Math.abs(b),v=Math.abs(v)-b,Math.max(0,E(v)-E(b))+1}d.FormatSpecifier=a,d.formatDefaultLocale=w,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=S,d.precisionPrefix=M,d.precisionRound=y,Object.defineProperty(d,"__esModule",{value:!0})})}}),J5=We({"node_modules/is-string-blank/index.js"(Z,V){"use strict";V.exports=function(d){for(var x=d.length,A,E=0;E13)&&A!==32&&A!==133&&A!==160&&A!==5760&&A!==6158&&(A<8192||A>8205)&&A!==8232&&A!==8233&&A!==8239&&A!==8287&&A!==8288&&A!==12288&&A!==65279)return!1;return!0}}}),Uo=We({"node_modules/fast-isnumeric/index.js"(Z,V){"use strict";var d=J5();V.exports=function(x){var A=typeof x;if(A==="string"){var E=x;if(x=+x,x===0&&d(E))return!1}else if(A!=="number")return!1;return x-x<1}}}),bs=We({"src/constants/numerical.js"(Z,V){"use strict";V.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),Yx=We({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Z,function(d){"use strict";for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,h,c,m;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var p=new ArrayBuffer(o),T=new Uint8Array(p);for(i=0;i>4,T[n++]=(h&15)<<4|c>>2,T[n++]=(c&3)<<6|m&63;return p};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),Hv=We({"src/lib/is_plain_object.js"(Z,V){"use strict";V.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),rh=We({"src/lib/array.js"(Z){"use strict";var V=Yx().decode,d=Hv(),x=Array.isArray,A=ArrayBuffer,E=DataView;function e(s){return A.isView(s)&&!(s instanceof E)}Z.isTypedArray=e;function t(s){return x(s)||e(s)}Z.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Z.isArray1D=r,Z.ensureArray=function(s,h){return x(s)||(s=[]),s.length=h,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Z.isArrayBuffer=a,Z.decodeTypedArraySpec=function(s){var h=[],c=i(s),m=c.dtype,p=o[m];if(!p)throw new Error('Error in dtype: "'+m+'"');var T=p.BYTES_PER_ELEMENT,l=c.bdata;a(l)||(l=V(l));var _=c.shape===void 0?[l.byteLength/T]:(""+c.shape).split(",");_.reverse();var w=_.length,S,M,y=+_[0],b=T*y,v=0;if(w===1)h=new p(l);else if(w===2)for(S=+_[1],M=0;M2)return p[S]=p[S]|e,_.set(w,null);if(l){for(h=S;h0)return Math.log(A)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),eA=We({"src/lib/relink_private.js"(Z,V){"use strict";var d=rh().isArrayOrTypedArray,x=Hv();V.exports=function A(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iE/2?A-Math.round(A/E)*E:A}V.exports={mod:d,modHalf:x}}}),Af=We({"node_modules/tinycolor2/tinycolor.js"(Z,V){(function(d){var x=/^\s+/,A=/\s+$/,E=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(j,ee){if(j=j||"",ee=ee||{},j instanceof a)return j;if(!(this instanceof a))return new a(j,ee);var re=i(j);this._originalInput=j,this._r=re.r,this._g=re.g,this._b=re.b,this._a=re.a,this._roundA=e(100*this._a)/100,this._format=ee.format||re.format,this._gradientType=ee.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=re.ok,this._tc_id=E++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var j=this.toRgb();return(j.r*299+j.g*587+j.b*114)/1e3},getLuminance:function(){var j=this.toRgb(),ee,re,ue,_e,Te,Ie;return ee=j.r/255,re=j.g/255,ue=j.b/255,ee<=.03928?_e=ee/12.92:_e=d.pow((ee+.055)/1.055,2.4),re<=.03928?Te=re/12.92:Te=d.pow((re+.055)/1.055,2.4),ue<=.03928?Ie=ue/12.92:Ie=d.pow((ue+.055)/1.055,2.4),.2126*_e+.7152*Te+.0722*Ie},setAlpha:function(j){return this._a=I(j),this._roundA=e(100*this._a)/100,this},toHsv:function(){var j=c(this._r,this._g,this._b);return{h:j.h*360,s:j.s,v:j.v,a:this._a}},toHsvString:function(){var j=c(this._r,this._g,this._b),ee=e(j.h*360),re=e(j.s*100),ue=e(j.v*100);return this._a==1?"hsv("+ee+", "+re+"%, "+ue+"%)":"hsva("+ee+", "+re+"%, "+ue+"%, "+this._roundA+")"},toHsl:function(){var j=s(this._r,this._g,this._b);return{h:j.h*360,s:j.s,l:j.l,a:this._a}},toHslString:function(){var j=s(this._r,this._g,this._b),ee=e(j.h*360),re=e(j.s*100),ue=e(j.l*100);return this._a==1?"hsl("+ee+", "+re+"%, "+ue+"%)":"hsla("+ee+", "+re+"%, "+ue+"%, "+this._roundA+")"},toHex:function(j){return p(this._r,this._g,this._b,j)},toHexString:function(j){return"#"+this.toHex(j)},toHex8:function(j){return T(this._r,this._g,this._b,this._a,j)},toHex8String:function(j){return"#"+this.toHex8(j)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(N(this._r,255)*100)+"%",g:e(N(this._g,255)*100)+"%",b:e(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%)":"rgba("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[p(this._r,this._g,this._b,!0)]||!1},toFilter:function(j){var ee="#"+l(this._r,this._g,this._b,this._a),re=ee,ue=this._gradientType?"GradientType = 1, ":"";if(j){var _e=a(j);re="#"+l(_e._r,_e._g,_e._b,_e._a)}return"progid:DXImageTransform.Microsoft.gradient("+ue+"startColorstr="+ee+",endColorstr="+re+")"},toString:function(j){var ee=!!j;j=j||this._format;var re=!1,ue=this._a<1&&this._a>=0,_e=!ee&&ue&&(j==="hex"||j==="hex6"||j==="hex3"||j==="hex4"||j==="hex8"||j==="name");return _e?j==="name"&&this._a===0?this.toName():this.toRgbString():(j==="rgb"&&(re=this.toRgbString()),j==="prgb"&&(re=this.toPercentageRgbString()),(j==="hex"||j==="hex6")&&(re=this.toHexString()),j==="hex3"&&(re=this.toHexString(!0)),j==="hex4"&&(re=this.toHex8String(!0)),j==="hex8"&&(re=this.toHex8String()),j==="name"&&(re=this.toName()),j==="hsl"&&(re=this.toHslString()),j==="hsv"&&(re=this.toHsvString()),re||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(j,ee){var re=j.apply(null,[this].concat([].slice.call(ee)));return this._r=re._r,this._g=re._g,this._b=re._b,this.setAlpha(re._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(j,ee){return j.apply(null,[this].concat([].slice.call(ee)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},a.fromRatio=function(j,ee){if(typeof j=="object"){var re={};for(var ue in j)j.hasOwnProperty(ue)&&(ue==="a"?re[ue]=j[ue]:re[ue]=he(j[ue]));j=re}return a(j,ee)};function i(j){var ee={r:0,g:0,b:0},re=1,ue=null,_e=null,Te=null,Ie=!1,De=!1;return typeof j=="string"&&(j=oe(j)),typeof j=="object"&&(X(j.r)&&X(j.g)&&X(j.b)?(ee=n(j.r,j.g,j.b),Ie=!0,De=String(j.r).substr(-1)==="%"?"prgb":"rgb"):X(j.h)&&X(j.s)&&X(j.v)?(ue=he(j.s),_e=he(j.v),ee=m(j.h,ue,_e),Ie=!0,De="hsv"):X(j.h)&&X(j.s)&&X(j.l)&&(ue=he(j.s),Te=he(j.l),ee=h(j.h,ue,Te),Ie=!0,De="hsl"),j.hasOwnProperty("a")&&(re=j.a)),re=I(re),{ok:Ie,format:j.format||De,r:t(255,r(ee.r,0)),g:t(255,r(ee.g,0)),b:t(255,r(ee.b,0)),a:re}}function n(j,ee,re){return{r:N(j,255)*255,g:N(ee,255)*255,b:N(re,255)*255}}function s(j,ee,re){j=N(j,255),ee=N(ee,255),re=N(re,255);var ue=r(j,ee,re),_e=t(j,ee,re),Te,Ie,De=(ue+_e)/2;if(ue==_e)Te=Ie=0;else{var He=ue-_e;switch(Ie=De>.5?He/(2-ue-_e):He/(ue+_e),ue){case j:Te=(ee-re)/He+(ee1&&($e-=1),$e<1/6?et+(rt-et)*6*$e:$e<1/2?rt:$e<2/3?et+(rt-et)*(2/3-$e)*6:et}if(ee===0)ue=_e=Te=re;else{var De=re<.5?re*(1+ee):re+ee-re*ee,He=2*re-De;ue=Ie(He,De,j+1/3),_e=Ie(He,De,j),Te=Ie(He,De,j-1/3)}return{r:ue*255,g:_e*255,b:Te*255}}function c(j,ee,re){j=N(j,255),ee=N(ee,255),re=N(re,255);var ue=r(j,ee,re),_e=t(j,ee,re),Te,Ie,De=ue,He=ue-_e;if(Ie=ue===0?0:He/ue,ue==_e)Te=0;else{switch(ue){case j:Te=(ee-re)/He+(ee>1)+720)%360;--ee;)ue.h=(ue.h+_e)%360,Te.push(a(ue));return Te}function z(j,ee){ee=ee||6;for(var re=a(j).toHsv(),ue=re.h,_e=re.s,Te=re.v,Ie=[],De=1/ee;ee--;)Ie.push(a({h:ue,s:_e,v:Te})),Te=(Te+De)%1;return Ie}a.mix=function(j,ee,re){re=re===0?0:re||50;var ue=a(j).toRgb(),_e=a(ee).toRgb(),Te=re/100,Ie={r:(_e.r-ue.r)*Te+ue.r,g:(_e.g-ue.g)*Te+ue.g,b:(_e.b-ue.b)*Te+ue.b,a:(_e.a-ue.a)*Te+ue.a};return a(Ie)},a.readability=function(j,ee){var re=a(j),ue=a(ee);return(d.max(re.getLuminance(),ue.getLuminance())+.05)/(d.min(re.getLuminance(),ue.getLuminance())+.05)},a.isReadable=function(j,ee,re){var ue=a.readability(j,ee),_e,Te;switch(Te=!1,_e=ne(re),_e.level+_e.size){case"AAsmall":case"AAAlarge":Te=ue>=4.5;break;case"AAlarge":Te=ue>=3;break;case"AAAsmall":Te=ue>=7;break}return Te},a.mostReadable=function(j,ee,re){var ue=null,_e=0,Te,Ie,De,He;re=re||{},Ie=re.includeFallbackColors,De=re.level,He=re.size;for(var et=0;et_e&&(_e=Te,ue=a(ee[et]));return a.isReadable(j,ue,{level:De,size:He})||!Ie?ue:(re.includeFallbackColors=!1,a.mostReadable(j,["#fff","#000"],re))};var F=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},B=a.hexNames=O(F);function O(j){var ee={};for(var re in j)j.hasOwnProperty(re)&&(ee[j[re]]=re);return ee}function I(j){return j=parseFloat(j),(isNaN(j)||j<0||j>1)&&(j=1),j}function N(j,ee){Q(j)&&(j="100%");var re=le(j);return j=t(ee,r(0,parseFloat(j))),re&&(j=parseInt(j*ee,10)/100),d.abs(j-ee)<1e-6?1:j%ee/parseFloat(ee)}function U(j){return t(1,r(0,j))}function W(j){return parseInt(j,16)}function Q(j){return typeof j=="string"&&j.indexOf(".")!=-1&&parseFloat(j)===1}function le(j){return typeof j=="string"&&j.indexOf("%")!=-1}function se(j){return j.length==1?"0"+j:""+j}function he(j){return j<=1&&(j=j*100+"%"),j}function q(j){return d.round(parseFloat(j)*255).toString(16)}function $(j){return W(j)/255}var J=(function(){var j="[-\\+]?\\d+%?",ee="[-\\+]?\\d*\\.\\d+%?",re="(?:"+ee+")|(?:"+j+")",ue="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",_e="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?";return{CSS_UNIT:new RegExp(re),rgb:new RegExp("rgb"+ue),rgba:new RegExp("rgba"+_e),hsl:new RegExp("hsl"+ue),hsla:new RegExp("hsla"+_e),hsv:new RegExp("hsv"+ue),hsva:new RegExp("hsva"+_e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function X(j){return!!J.CSS_UNIT.exec(j)}function oe(j){j=j.replace(x,"").replace(A,"").toLowerCase();var ee=!1;if(F[j])j=F[j],ee=!0;else if(j=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var re;return(re=J.rgb.exec(j))?{r:re[1],g:re[2],b:re[3]}:(re=J.rgba.exec(j))?{r:re[1],g:re[2],b:re[3],a:re[4]}:(re=J.hsl.exec(j))?{h:re[1],s:re[2],l:re[3]}:(re=J.hsla.exec(j))?{h:re[1],s:re[2],l:re[3],a:re[4]}:(re=J.hsv.exec(j))?{h:re[1],s:re[2],v:re[3]}:(re=J.hsva.exec(j))?{h:re[1],s:re[2],v:re[3],a:re[4]}:(re=J.hex8.exec(j))?{r:W(re[1]),g:W(re[2]),b:W(re[3]),a:$(re[4]),format:ee?"name":"hex8"}:(re=J.hex6.exec(j))?{r:W(re[1]),g:W(re[2]),b:W(re[3]),format:ee?"name":"hex"}:(re=J.hex4.exec(j))?{r:W(re[1]+""+re[1]),g:W(re[2]+""+re[2]),b:W(re[3]+""+re[3]),a:$(re[4]+""+re[4]),format:ee?"name":"hex8"}:(re=J.hex3.exec(j))?{r:W(re[1]+""+re[1]),g:W(re[2]+""+re[2]),b:W(re[3]+""+re[3]),format:ee?"name":"hex"}:!1}function ne(j){var ee,re;return j=j||{level:"AA",size:"small"},ee=(j.level||"AA").toUpperCase(),re=(j.size||"small").toLowerCase(),ee!=="AA"&&ee!=="AAA"&&(ee="AA"),re!=="small"&&re!=="large"&&(re="small"),{level:ee,size:re}}typeof V<"u"&&V.exports?V.exports=a:window.tinycolor=a})(Math)}}),Fo=We({"src/lib/extend.js"(Z){"use strict";var V=Hv(),d=Array.isArray;function x(E,e){var t,r;for(t=0;t=0)))return a;if(c===3)s[c]>1&&(s[c]=1);else if(s[c]>=1)return a}var m=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return h?"rgba("+m+", "+s[3]+")":"rgb("+m+")"}}}),wd=We({"src/constants/interactions.js"(Z,V){"use strict";V.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),A0=We({"src/lib/regex.js"(Z){"use strict";Z.counter=function(V,d,x,A){var E=(d||"")+(x?"":"$"),e=A===!1?"":"^";return V==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+V+"([2-9]|[1-9][0-9]+)?"+E)}}}),tA=We({"src/lib/coerce.js"(Z){"use strict";var V=Uo(),d=Af(),x=Fo().extendFlat,A=El(),E=mp(),e=Fi(),t=wd().DESELECTDIM,r=Lm(),o=A0().counter,a=w0().modHalf,i=rh().isArrayOrTypedArray,n=rh().isTypedArraySpec,s=rh().decodeTypedArraySpec;Z.valObjectMeta={data_array:{coerceFunction:function(c,m,p){m.set(i(c)?c:n(c)?s(c):p)}},enumerated:{coerceFunction:function(c,m,p,T){T.coerceNumber&&(c=+c),T.values.indexOf(c)===-1?m.set(p):m.set(c)},validateFunction:function(c,m){m.coerceNumber&&(c=+c);for(var p=m.values,T=0;T_===!0||_===!1;l(c)||T.arrayOk&&Array.isArray(c)&&c.length>0&&c.every(l)?m.set(c):m.set(p)}},number:{coerceFunction:function(c,m,p,T){n(c)&&(c=s(c)),!V(c)||T.min!==void 0&&cT.max?m.set(p):m.set(+c)}},integer:{coerceFunction:function(c,m,p,T){if((T.extras||[]).indexOf(c)!==-1){m.set(c);return}n(c)&&(c=s(c)),c%1||!V(c)||T.min!==void 0&&cT.max?m.set(p):m.set(+c)}},string:{coerceFunction:function(c,m,p,T){if(typeof c!="string"){var l=typeof c=="number";T.strict===!0||!l?m.set(p):m.set(String(c))}else T.noBlank&&!c?m.set(p):m.set(c)}},color:{coerceFunction:function(c,m,p){n(c)&&(c=s(c)),d(c).isValid()?m.set(c):m.set(p)}},colorlist:{coerceFunction:function(c,m,p){function T(l){return d(l).isValid()}!Array.isArray(c)||!c.length?m.set(p):c.every(T)?m.set(c):m.set(p)}},colorscale:{coerceFunction:function(c,m,p){m.set(E.get(c,p))}},angle:{coerceFunction:function(c,m,p){n(c)&&(c=s(c)),c==="auto"?m.set("auto"):V(c)?m.set(a(+c,360)):m.set(p)}},subplotid:{coerceFunction:function(c,m,p,T){var l=T.regex||o(p);let _=w=>typeof w=="string"&&l.test(w);_(c)||T.arrayOk&&i(c)&&c.length>0&&c.every(_)?m.set(c):m.set(p)},validateFunction:function(c,m){var p=m.dflt;return c===p?!0:typeof c!="string"?!1:!!o(p).test(c)}},flaglist:{coerceFunction:function(c,m,p,T){if((T.extras||[]).indexOf(c)!==-1){m.set(c);return}if(typeof c!="string"){m.set(p);return}for(var l=c.split("+"),_=0;_/g),c=0;c1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},A.warn=function(){var E;if(d.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},A.error=function(){var E;if(d.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Ry=We({"src/lib/noop.js"(Z,V){"use strict";V.exports=function(){}}}),Jx=We({"src/lib/push_unique.js"(Z,V){"use strict";V.exports=function(x,A){if(A instanceof RegExp){for(var E=A.toString(),e=0;e_d({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),Z.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>_d({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),Z.shapeTexttemplateAttrs=({editType:E="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:E}),Z.templatefallbackAttrs=({editType:E="none"}={})=>({valType:"any",dflt:"-",editType:E})}}),zy=We({"src/components/shapes/label_texttemplate.js"(Z,V){"use strict";function d(_,w){return w?w.d2l(_):_}function x(_,w){return w?w.l2d(_):_}function A(_){return _.x0}function E(_){return _.x1}function e(_){return _.y0}function t(_){return _.y1}function r(_){return _.x0shift||0}function o(_){return _.x1shift||0}function a(_){return _.y0shift||0}function i(_){return _.y1shift||0}function n(_,w){return d(_.x1,w)+o(_)-d(_.x0,w)-r(_)}function s(_,w,S){return d(_.y1,S)+i(_)-d(_.y0,S)-a(_)}function h(_,w){return Math.abs(n(_,w))}function c(_,w,S){return Math.abs(s(_,w,S))}function m(_,w,S){return _.type!=="line"?void 0:Math.sqrt(Math.pow(n(_,w),2)+Math.pow(s(_,w,S),2))}function p(_,w){return x((d(_.x1,w)+o(_)+d(_.x0,w)+r(_))/2,w)}function T(_,w,S){return x((d(_.y1,S)+i(_)+d(_.y0,S)+a(_))/2,S)}function l(_,w,S){return _.type!=="line"?void 0:s(_,w,S)/n(_,w)}V.exports={x0:A,x1:E,y0:e,y1:t,slope:l,dx:n,dy:s,width:h,height:c,length:m,xcenter:p,ycenter:T}}}),LA=We({"src/components/shapes/draw_newshape/attributes.js"(Z,V){"use strict";var d=Iu().overrideAll,x=El(),A=_u(),E=zf().dash,e=Fo().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=wl(),o=zy();V.exports=d({newshape:{visible:e({},x.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},x.legend,{}),legendgroup:e({},x.legendgroup,{}),legendgrouptitle:{text:e({},x.legendgrouptitle.text,{}),font:A({})},legendrank:e({},x.legendrank,{}),legendwidth:e({},x.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},E,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},x.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(o)}),texttemplatefallback:r({editType:"arraydraw"}),font:A({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),PA=We({"src/components/selections/draw_newselection/attributes.js"(Z,V){"use strict";var d=zf().dash,x=Fo().extendFlat;V.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:x({},d,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),Fy=We({"src/plots/pad_attributes.js"(Z,V){"use strict";V.exports=function(d){var x=d.editType;return{t:{valType:"number",dflt:0,editType:x},r:{valType:"number",dflt:0,editType:x},b:{valType:"number",dflt:0,editType:x},l:{valType:"number",dflt:0,editType:x},editType:x}}}}),S0=We({"src/plots/layout_attributes.js"(Z,V){"use strict";var d=_u(),x=Rm(),A=nf(),E=LA(),e=PA(),t=Fy(),r=Fo().extendFlat,o=d({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=A.defaultLine,V.exports={font:o,title:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(t({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:A.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:A.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:A.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:E.newshape,activeshape:E.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},x.transition,{editType:"none"})}}}),IA=We({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var Z=document.createElement("style");Z.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",Z.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(Z)}})()}}),Wi=We({"src/registry.js"(Z){"use strict";var V=Td(),d=Ry(),x=Jx(),A=Hv(),E=Im().addStyleRule,e=Fo(),t=El(),r=S0(),o=e.extendFlat,a=e.extendDeepAll;Z.modules={},Z.allCategories={},Z.allTypes=[],Z.subplotsRegistry={},Z.componentsRegistry={},Z.layoutArrayContainers=[],Z.layoutArrayRegexes=[],Z.traceLayoutAttributes={},Z.localeRegistry={},Z.apiMethodRegistry={},Z.collectableSubplotTypes=null,Z.register=function(w){if(Z.collectableSubplotTypes=null,w)w&&!Array.isArray(w)&&(w=[w]);else throw new Error("No argument passed to Plotly.register.");for(var S=0;S=l&&F<=_?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=p(B),W=F.charAt(0);U&&(W==="G"||W==="g")&&(F=F.slice(1),B="");var Q=U&&B.slice(0,7)==="chinese",le=F.match(Q?c:h);if(!le)return e;var se=le[1],he=le[3]||"1",q=Number(le[5]||1),$=Number(le[7]||0),J=Number(le[9]||0),X=Number(le[11]||0);if(U){if(se.length===2)return e;se=Number(se);var oe;try{var ne=n.getComponentMethod("calendars","getCal")(B);if(Q){var j=he.charAt(he.length-1)==="i";he=parseInt(he,10),oe=ne.newDate(se,ne.toMonthIndex(se,he,j),q)}else oe=ne.newDate(se,Number(he),q)}catch{return e}return oe?(oe.toJD()-i)*t+$*r+J*o+X*a:e}se.length===2?se=(Number(se)+2e3-m)%100+m:se=Number(se),he-=1;var ee=new Date(Date.UTC(2e3,he,q,$,J));return ee.setUTCFullYear(se),ee.getUTCMonth()!==he||ee.getUTCDate()!==q?e:ee.getTime()+X*a},l=Z.MIN_MS=Z.dateTime2ms("-9999"),_=Z.MAX_MS=Z.dateTime2ms("9999-12-31 23:59:59.9999"),Z.isDateTime=function(F,B){return Z.dateTime2ms(F,B)!==e};function w(F,B){return String(F+Math.pow(10,B)).slice(1)}var S=90*t,M=3*r,y=5*o;Z.ms2DateTime=function(F,B,O){if(typeof F!="number"||!(F>=l&&F<=_))return e;B||(B=0);var I=Math.floor(A(F+.05,1)*10),N=Math.round(F-I/10),U,W,Q,le,se,he;if(p(O)){var q=Math.floor(N/t)+i,$=Math.floor(A(F,t));try{U=n.getComponentMethod("calendars","getCal")(O).fromJD(q).formatDate("yyyy-mm-dd")}catch{U=s("G%Y-%m-%d")(new Date(N))}if(U.charAt(0)==="-")for(;U.length<11;)U="-0"+U.slice(1);else for(;U.length<10;)U="0"+U;W=B=l+t&&F<=_-t))return e;var B=Math.floor(A(F+.05,1)*10),O=new Date(Math.round(F-B/10)),I=V("%Y-%m-%d")(O),N=O.getHours(),U=O.getMinutes(),W=O.getSeconds(),Q=O.getUTCMilliseconds()*10+B;return b(I,N,U,W,Q)};function b(F,B,O,I,N){if((B||O||I||N)&&(F+=" "+w(B,2)+":"+w(O,2),(I||N)&&(F+=":"+w(I,2),N))){for(var U=4;N%10===0;)U-=1,N/=10;F+="."+w(N,U)}return F}Z.cleanDate=function(F,B,O){if(F===e)return B;if(Z.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(p(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),B;if(F=Z.ms2DateTimeLocal(+F),!F&&B!==void 0)return B}else if(!Z.isDateTime(F,O))return x.error("unrecognized date",F),B;return F};var v=/%\d?f/g,u=/%h/g,g={1:"1",2:"1",3:"2",4:"2"};function f(F,B,O,I){F=F.replace(v,function(U){var W=Math.min(+U.charAt(1)||6,6),Q=(B/1e3%1+2).toFixed(W).slice(2).replace(/0+$/,"")||"0";return Q});var N=new Date(Math.floor(B+.05));if(F=F.replace(u,function(){return g[O("%q")(N)]}),p(I))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,B,I)}catch{return"Invalid"}return O(F)(N)}var P=[59,59.9,59.99,59.999,59.9999];function L(F,B){var O=A(F+.05,t),I=w(Math.floor(O/r),2)+":"+w(A(Math.floor(O/o),60),2);if(B!=="M"){d(B)||(B=0);var N=Math.min(A(F/a,60),P[B]),U=(100+N).toFixed(B).slice(1);B>0&&(U=U.replace(/0+$/,"").replace(/[\.]$/,"")),I+=":"+U}return I}Z.formatDate=function(F,B,O,I,N,U){if(N=p(N)&&N,!B)if(O==="y")B=U.year;else if(O==="m")B=U.month;else if(O==="d")B=U.dayMonth+` -`+U.year;else return L(F,O)+` -`+f(U.dayMonthYear,F,I,N);return f(B,F,I,N)};var z=3*t;Z.incrementMonth=function(F,B,O){O=p(O)&&O;var I=A(F,t);if(F=Math.round(F-I),O)try{var N=Math.round(F/t)+i,U=n.getComponentMethod("calendars","getCal")(O),W=U.fromJD(N);return B%12?U.add(W,B,"m"):U.add(W,B/12,"y"),(W.toJD()-i)*t+I}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+I-z},Z.findExactDates=function(F,B){for(var O=0,I=0,N=0,U=0,W,Q,le=p(B)&&n.getComponentMethod("calendars","getCal")(B),se=0;se1?(i[h-1]-i[0])/(h-1):1,p,T;for(m>=0?T=n?e:t:T=n?o:r,a+=m*E*(n?-1:1)*(m>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Z.sorterAsc=function(a,i){return a-i},Z.sorterDes=function(a,i){return i-a},Z.distinctVals=function(a){var i=a.slice();i.sort(Z.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===A;n--);for(var s=i[n]-i[0]||1,h=s/(n||1)/1e4,c=[],m,p=0;p<=n;p++){var T=i[p],l=T-m;m===void 0?(c.push(T),m=T):l>h&&(s=Math.min(s,l),c.push(T),m=T)}return{vals:c,minDiff:s}},Z.roundUp=function(a,i,n){for(var s=0,h=i.length-1,c,m=0,p=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Z.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,h=0;hE.length)&&(e=E.length),V(A)||(A=!1),d(E[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var E=A%1;return E*x[Math.ceil(A)]+(1-E)*x[Math.floor(A)]}}}),zA=We({"src/lib/angles.js"(Z,V){"use strict";var d=w0(),x=d.mod,A=d.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var _,w;l[0]w&&(w+=e);var S=x(T,e),M=S+e;return S>=_&&S<=w||M>=_&&M<=w}function s(T,l,_,w){if(!n(l,w))return!1;var S,M;return _[0]<_[1]?(S=_[0],M=_[1]):(S=_[1],M=_[0]),T>=S&&T<=M}function h(T,l,_,w,S,M,y){S=S||0,M=M||0;var b=o([_,w]),v,u,g,f,P;b?(v=0,u=E,g=e):_1/3&&d.x<2/3},Z.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Z.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Z.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Z.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),OA=We({"src/lib/geometry2d.js"(Z){"use strict";var V=w0().mod;Z.segmentsIntersect=d;function d(t,r,o,a,i,n,s,h){var c=o-t,m=i-t,p=s-i,T=a-r,l=n-r,_=h-n,w=c*_-p*T;if(w===0)return null;var S=(m*_-p*l)/w,M=(m*T-c*l)/w;return M<0||M>1||S<0||S>1?null:{x:t+c*S,y:r+T*S}}Z.segmentDistance=function(r,o,a,i,n,s,h,c){if(d(r,o,a,i,n,s,h,c))return 0;var m=a-r,p=i-o,T=h-n,l=c-s,_=m*m+p*p,w=T*T+l*l,S=Math.min(x(m,p,_,n-r,s-o),x(m,p,_,h-r,c-o),x(T,l,w,r-n,o-s),x(T,l,w,a-n,i-s));return Math.sqrt(S)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,h=i-r;return s*s+h*h}else{var c=a*r-i*t;return c*c/o}}var A,E,e;Z.getTextLocation=function(r,o,a,i){if((r!==E||i!==e)&&(A={},E=r,e=i),A[a])return A[a];var n=r.getPointAtLength(V(a-i/2,o)),s=r.getPointAtLength(V(a+i/2,o)),h=Math.atan((s.y-n.y)/(s.x-n.x)),c=r.getPointAtLength(V(a,o)),m=(c.x*4+n.x+s.x)/6,p=(c.y*4+n.y+s.y)/6,T={x:m,y:p,theta:h};return A[a]=T,T},Z.clearLocationCache=function(){E=null},Z.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,h=o.bottom,c=0,m=r.getTotalLength(),p=m,T,l;function _(S){var M=r.getPointAtLength(S);S===0?T=M:S===m&&(l=M);var y=M.xn?M.x-n:0,b=M.yh?M.y-h:0;return Math.sqrt(y*y+b*b)}for(var w=_(c);w;){if(c+=w+a,c>p)return;w=_(c)}for(w=_(p);w;){if(p-=w+a,c>p)return;w=_(p)}return{min:c,max:p,len:p-c,total:m,isClosed:c===0&&p===m&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Z.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,h=i.iterationLimit||30,c=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,m=0,p=0,T=n,l,_,w;m0?T=l:p=l,m++}return _}}}),By=We({"src/lib/throttle.js"(Z){"use strict";var V={};Z.throttle=function(A,E,e){var t=V[A],r=Date.now();if(!t){for(var o in V)V[o].tst.ts+E){a();return}t.timer=setTimeout(function(){a(),t.timer=null},E)},Z.done=function(x){var A=V[x];return!A||!A.timer?Promise.resolve():new Promise(function(E){var e=A.onDone;A.onDone=function(){e&&e(),E(),A.onDone=null}})},Z.clear=function(x){if(x)d(V[x]),delete V[x];else for(var A in V)Z.clear(A)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),BA=We({"src/lib/clear_responsive.js"(Z,V){"use strict";V.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),NA=We({"node_modules/is-mobile/index.js"(Z,V){"use strict";V.exports=E,V.exports.isMobile=E,V.exports.default=E;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,A=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&A.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),UA=We({"src/lib/preserve_drawing_buffer.js"(Z,V){"use strict";var d=Uo(),x=NA();V.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=A(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.slice(0,8)==="Version/"){var h=s.slice(8).split(".")[0];if(d(h)&&(h=+h),h>=13)return!0}}}return r};function A(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),jA=We({"src/lib/make_trace_groups.js"(Z,V){"use strict";var d=Hi();V.exports=function(A,E,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=A.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),VA=We({"src/lib/localize.js"(Z,V){"use strict";var d=Wi();V.exports=function(A,E){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[E];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return E}}}),tb=We({"src/lib/filter_unique.js"(Z,V){"use strict";V.exports=function(x){for(var A={},E=[],e=0,t=0;t1?(E*x+E*A)/E:x+A,t=String(e).length;if(t>16){var r=String(A).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),HA=We({"src/lib/clean_number.js"(Z,V){"use strict";var d=Uo(),x=bs().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;V.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),d(e)?Number(e):x}}}),aa=We({"src/lib/index.js"(Z,V){"use strict";var d=Hi(),x=b0().utcFormat,A=Zx().format,E=Uo(),e=bs(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=V.exports={};a.adjustFormat=function(j){return!j||/^\d[.]\df/.test(j)||/[.]\d%/.test(j)?j:j==="0.f"?"~f":/^\d%/.test(j)?"~%":/^\ds/.test(j)?"~s":!/^[~,.0$]/.test(j)&&/[&fps]/.test(j)?"~"+j:j};var i={};a.warnBadFormat=function(ne){var j=String(ne);i[j]||(i[j]=1,a.warn('encountered bad format: "'+j+'"'))},a.noFormat=function(ne){return String(ne)},a.numberFormat=function(ne){var j;try{j=A(a.adjustFormat(ne))}catch{return a.warnBadFormat(ne),a.noFormat}return j},a.nestedProperty=Lm(),a.keyedContainer=$5(),a.relativeAttr=Q5(),a.isPlainObject=Hv(),a.toLogRange=Iy(),a.relinkPrivateKeys=eA();var n=rh();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=w0();a.mod=s.mod,a.modHalf=s.modHalf;var h=tA();a.valObjectMeta=h.valObjectMeta,a.coerce=h.coerce,a.coerce2=h.coerce2,a.coerceFont=h.coerceFont,a.coercePattern=h.coercePattern,a.coerceHoverinfo=h.coerceHoverinfo,a.coerceSelectionMarkerOpacity=h.coerceSelectionMarkerOpacity,a.validate=h.validate;var c=RA();a.dateTime2ms=c.dateTime2ms,a.isDateTime=c.isDateTime,a.ms2DateTime=c.ms2DateTime,a.ms2DateTimeLocal=c.ms2DateTimeLocal,a.cleanDate=c.cleanDate,a.isJSDate=c.isJSDate,a.formatDate=c.formatDate,a.incrementMonth=c.incrementMonth,a.dateTick0=c.dateTick0,a.dfltRange=c.dfltRange,a.findExactDates=c.findExactDates,a.MIN_MS=c.MIN_MS,a.MAX_MS=c.MAX_MS;var m=Oy();a.findBin=m.findBin,a.sorterAsc=m.sorterAsc,a.sorterDes=m.sorterDes,a.distinctVals=m.distinctVals,a.roundUp=m.roundUp,a.sort=m.sort,a.findIndexOfMin=m.findIndexOfMin,a.sortObjectKeys=Ad();var p=DA();a.aggNums=p.aggNums,a.len=p.len,a.mean=p.mean,a.geometricMean=p.geometricMean,a.median=p.median,a.midRange=p.midRange,a.variance=p.variance,a.stdev=p.stdev,a.interp=p.interp;var T=Dy();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=zA();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var _=FA();a.isLeftAnchor=_.isLeftAnchor,a.isCenterAnchor=_.isCenterAnchor,a.isRightAnchor=_.isRightAnchor,a.isTopAnchor=_.isTopAnchor,a.isMiddleAnchor=_.isMiddleAnchor,a.isBottomAnchor=_.isBottomAnchor;var w=OA();a.segmentsIntersect=w.segmentsIntersect,a.segmentDistance=w.segmentDistance,a.getTextLocation=w.getTextLocation,a.clearLocationCache=w.clearLocationCache,a.getVisibleSegment=w.getVisibleSegment,a.findPointOnPath=w.findPointOnPath;var S=Fo();a.extendFlat=S.extendFlat,a.extendDeep=S.extendDeep,a.extendDeepAll=S.extendDeepAll,a.extendDeepNoArrays=S.extendDeepNoArrays;var M=Td();a.log=M.log,a.warn=M.warn,a.error=M.error;var y=A0();a.counterRegex=y.counter;var b=By();a.throttle=b.throttle,a.throttleDone=b.done,a.clearThrottle=b.clear;var v=Im();a.getGraphDiv=v.getGraphDiv,a.isPlotDiv=v.isPlotDiv,a.removeElement=v.removeElement,a.addStyleRule=v.addStyleRule,a.addRelatedStyleRule=v.addRelatedStyleRule,a.deleteRelatedStyleRule=v.deleteRelatedStyleRule,a.setStyleOnHover=v.setStyleOnHover,a.getFullTransformMatrix=v.getFullTransformMatrix,a.getElementTransformMatrix=v.getElementTransformMatrix,a.getElementAndAncestors=v.getElementAndAncestors,a.equalDomRects=v.equalDomRects,a.clearResponsive=BA(),a.preserveDrawingBuffer=UA(),a.makeTraceGroups=jA(),a._=VA(),a.notifier=Kx(),a.filterUnique=tb(),a.filterVisible=qA(),a.pushUnique=Jx(),a.increment=GA(),a.cleanNumber=HA(),a.ensureNumber=function(j){return E(j)?(j=Number(j),j>t||j=j?!1:E(ne)&&ne>=0&&ne%1===0},a.noop=Ry(),a.identity=Dm(),a.repeat=function(ne,j){for(var ee=new Array(j),re=0;reee?Math.max(ee,Math.min(j,ne)):Math.max(j,Math.min(ee,ne))},a.bBoxIntersect=function(ne,j,ee){return ee=ee||0,ne.left<=j.right+ee&&j.left<=ne.right+ee&&ne.top<=j.bottom+ee&&j.top<=ne.bottom+ee},a.simpleMap=function(ne,j,ee,re,ue){for(var _e=ne.length,Te=new Array(_e),Ie=0;Ie<_e;Ie++)Te[Ie]=j(ne[Ie],ee,re,ue);return Te},a.randstr=function ne(j,ee,re,ue){if(re||(re=16),ee===void 0&&(ee=24),ee<=0)return"0";var _e=Math.log(Math.pow(2,ee))/Math.log(re),Te="",Ie,De,He;for(Ie=2;_e===1/0;Ie*=2)_e=Math.log(Math.pow(2,ee/Ie))/Math.log(re)*Ie;var et=_e-Math.floor(_e);for(Ie=0;Ie=Math.pow(2,ee)?ue>10?(a.warn("randstr failed uniqueness"),Te):ne(j,ee,re,(ue||0)+1):Te},a.OptionControl=function(ne,j){ne||(ne={}),j||(j="opt");var ee={};return ee.optionList=[],ee._newoption=function(re){re[j]=ne,ee[re.name]=re,ee.optionList.push(re)},ee["_"+j]=ne,ee},a.smooth=function(ne,j){if(j=Math.round(j)||0,j<2)return ne;var ee=ne.length,re=2*ee,ue=2*j-1,_e=new Array(ue),Te=new Array(ee),Ie,De,He,et;for(Ie=0;Ie=re&&(He-=re*Math.floor(He/re)),He<0?He=-1-He:He>=ee&&(He=re-1-He),et+=ne[He]*_e[De];Te[Ie]=et}return Te},a.syncOrAsync=function(ne,j,ee){var re,ue;function _e(){return a.syncOrAsync(ne,j,ee)}for(;ne.length;)if(ue=ne.splice(0,1)[0],re=ue(j),re&&re.then)return re.then(_e);return ee&&ee(j)},a.stripTrailingSlash=function(ne){return ne.slice(-1)==="/"?ne.slice(0,-1):ne},a.noneOrAll=function(ne,j,ee){if(ne){var re=!1,ue=!0,_e,Te;for(_e=0;_e0?ue:0})},a.fillArray=function(ne,j,ee,re){if(re=re||a.identity,a.isArrayOrTypedArray(ne))for(var ue=0;ueL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;a.getFirefoxVersion=function(){var ne=z.exec(window.navigator.userAgent);if(ne&&ne.length===2){var j=parseInt(ne[1]);if(!isNaN(j))return j}return null},a.isD3Selection=function(ne){return ne instanceof d.selection},a.ensureSingle=function(ne,j,ee,re){var ue=ne.select(j+(ee?"."+ee:""));if(ue.size())return ue;var _e=ne.append(j);return ee&&_e.classed(ee,!0),re&&_e.call(re),_e},a.ensureSingleById=function(ne,j,ee,re){var ue=ne.select(j+"#"+ee);if(ue.size())return ue;var _e=ne.append(j).attr("id",ee);return re&&_e.call(re),_e},a.objectFromPath=function(ne,j){for(var ee=ne.split("."),re,ue=re={},_e=0;_e1?ue+Te[1]:"";if(_e&&(Te.length>1||Ie.length>4||ee))for(;re.test(Ie);)Ie=Ie.replace(re,"$1"+_e+"$2");return Ie+De},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;a.templateString=function(ne,j){var ee={};return ne.replace(a.TEMPLATE_STRING_REGEX,function(re,ue){var _e;return I.test(ue)?_e=j[ue]:(ee[ue]=ee[ue]||a.nestedProperty(j,ue).get,_e=ee[ue](!0)),_e!==void 0?_e:""})};var N={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=ne=>he(x0(_d({},ne),{opts:N}));var U={max:10,count:0,name:"texttemplate"};a.texttemplateString=ne=>he(x0(_d({},ne),{opts:U}));var W=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function Q(ne){var j=ne.match(W);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:ne,op:null,number:null}}var le={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=ne=>he(x0(_d({},ne),{opts:le}));var se=/^[:|\|]/;function he({data:ne=[],locale:j,fallback:ee,labels:re={},opts:ue,template:_e}){return _e.replace(a.TEMPLATE_STRING_REGEX,(Te,Ie,De)=>{let He=["xother","yother"].includes(Ie),et=["_xother","_yother"].includes(Ie),rt=["_xother_","_yother_"].includes(Ie),$e=["xother_","yother_"].includes(Ie),ot=He||et||$e||rt;(et||rt)&&(Ie=Ie.substring(1)),($e||rt)&&(Ie=Ie.substring(0,Ie.length-1));let Ae=null,ge=null;if(ue.parseMultDiv){var ce=Q(Ie);Ie=ce.key,Ae=ce.op,ge=ce.number}let ze;if(ot){if(re[Ie]===void 0)return"";ze=re[Ie]}else for(let kt of ne)if(kt){if(kt.hasOwnProperty(Ie)){ze=kt[Ie];break}if(I.test(Ie)||(ze=a.nestedProperty(kt,Ie).get(!0)),ze!==void 0)break}if(ze===void 0){let{count:kt,max:Et,name:Bt}=ue,jt=ee===!1?Te:ee;return kt=q&&Te<=$,He=Ie>=q&&Ie<=$;if(De&&(re=10*re+Te-q),He&&(ue=10*ue+Ie-q),!De||!He){if(re!==ue)return re-ue;if(Te!==Ie)return Te-Ie}}return ue-re};var J=2e9;a.seedPseudoRandom=function(){J=2e9},a.pseudoRandom=function(){var ne=J;return J=(69069*J+1)%4294967296,Math.abs(J-ne)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(ne,j,ee){var re=Array.isArray(ee)?function(Te){ee.push(Te)}:function(Te){ee.text=Te},ue=a.extractOption(ne,j,"htx","hovertext");if(a.isValidTextValue(ue))return re(ue);var _e=a.extractOption(ne,j,"tx","text");if(a.isValidTextValue(_e))return re(_e)},a.isValidTextValue=function(ne){return ne||ne===0},a.formatPercent=function(ne,j){j=j||0;for(var ee=(Math.round(100*ne*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",re=0;re1&&(He=1):He=0,a.strTranslate(ue-He*(ee+Te),_e-He*(re+Ie))+a.strScale(He)+(De?"rotate("+De+(j?"":" "+ee+" "+re)+")":"")},a.setTransormAndDisplay=function(ne,j){ne.attr("transform",a.getTextTransform(j)),ne.style("display",j.scale?null:"none")},a.ensureUniformFontSize=function(ne,j){var ee=a.extendFlat({},j);return ee.size=Math.max(j.size,ne._fullLayout.uniformtext.minsize||0),ee},a.join2=function(ne,j,ee){var re=ne.length;return re>1?ne.slice(0,-1).join(j)+ee+ne[re-1]:ne.join(j)},a.bigFont=function(ne){return Math.round(1.2*ne)};var X=a.getFirefoxVersion(),oe=X!==null&&X<86;a.getPositionFromD3Event=function(){return oe?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),WA=We({"build/plotcss.js"(){"use strict";var Z=aa(),V={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in V)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Z.addStyleRule(d,V[x]);var d,x}}),rb=We({"node_modules/is-browser/client.js"(Z,V){V.exports=!0}}),ab=We({"node_modules/has-hover/index.js"(Z,V){"use strict";var d=rb(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,V.exports=x}}),yp=We({"node_modules/events/events.js"(Z,V){"use strict";var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(M,y,b){return Function.prototype.apply.call(M,y,b)},A;d&&typeof d.ownKeys=="function"?A=d.ownKeys:Object.getOwnPropertySymbols?A=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:A=function(M){return Object.getOwnPropertyNames(M)};function E(S){console&&console.warn&&console.warn(S)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}V.exports=t,V.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||e(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(M){for(var y=[],b=1;b0&&(g=y[0]),g instanceof Error)throw g;var f=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw f.context=g,f}var P=u[M];if(P===void 0)return!1;if(typeof P=="function")x(P,this,y);else for(var L=P.length,z=m(P,L),b=0;b0&&g.length>v&&!g.warned){g.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=S,f.type=M,f.count=g.length,E(f)}return S}t.prototype.addListener=function(M,y){return i(this,M,y,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,y){return i(this,M,y,!0)};function n(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(S,M,y){var b={fired:!1,wrapFn:void 0,target:S,type:M,listener:y},v=n.bind(b);return v.listener=y,b.wrapFn=v,v}t.prototype.once=function(M,y){return o(y),this.on(M,s(this,M,y)),this},t.prototype.prependOnceListener=function(M,y){return o(y),this.prependListener(M,s(this,M,y)),this},t.prototype.removeListener=function(M,y){var b,v,u,g,f;if(o(y),v=this._events,v===void 0)return this;if(b=v[M],b===void 0)return this;if(b===y||b.listener===y)--this._eventsCount===0?this._events=Object.create(null):(delete v[M],v.removeListener&&this.emit("removeListener",M,b.listener||y));else if(typeof b!="function"){for(u=-1,g=b.length-1;g>=0;g--)if(b[g]===y||b[g].listener===y){f=b[g].listener,u=g;break}if(u<0)return this;u===0?b.shift():p(b,u),b.length===1&&(v[M]=b[0]),v.removeListener!==void 0&&this.emit("removeListener",M,f||y)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var y,b,v;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[M]),this;if(arguments.length===0){var u=Object.keys(b),g;for(v=0;v=0;v--)this.removeListener(M,y[v]);return this};function h(S,M,y){var b=S._events;if(b===void 0)return[];var v=b[M];return v===void 0?[]:typeof v=="function"?y?[v.listener||v]:[v]:y?T(v):m(v,v.length)}t.prototype.listeners=function(M){return h(this,M,!0)},t.prototype.rawListeners=function(M){return h(this,M,!1)},t.listenerCount=function(S,M){return typeof S.listenerCount=="function"?S.listenerCount(M):c.call(S,M)},t.prototype.listenerCount=c;function c(S){var M=this._events;if(M!==void 0){var y=M[S];if(typeof y=="function")return 1;if(y!==void 0)return y.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function m(S,M){for(var y=new Array(M),b=0;b{},{passive:!0}),A},triggerHandler:function(A,E,e){var t,r=A._ev;if(!r)return;var o=r._events[E];if(!o)return;function a(n){if(n.listener){if(r.removeListener(E,n.listener),!n.fired)return n.fired=!0,n.listener.apply(r,[e])}else return n.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ix.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=I.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var N=z[F];if(!w(N))return!1;L=I[O][N]}else L=I[O]}else L=I}}return L}function w(L){return L===Math.round(L)&&L>=0}function S(L){var z,F;z=V.modules[L]._module,F=z.basePlotModule;var B={};B.type=null;var O=o({},x),I=o({},z.attributes);Z.crawl(I,function(W,Q,le,se,he){n(O,he).set(void 0),W===void 0&&n(I,he).set(void 0)}),o(B,O),V.traceIs(L,"noOpacity")&&delete B.opacity,V.traceIs(L,"showLegend")||(delete B.showlegend,delete B.legendgroup),V.traceIs(L,"noHover")&&(delete B.hoverinfo,delete B.hoverlabel),z.selectPoints||delete B.selectedpoints,o(B,I),F.attributes&&o(B,F.attributes),B.type=L;var N={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:b(B)};if(z.layoutAttributes){var U={};o(U,z.layoutAttributes),N.layoutAttributes=b(U)}return z.animatable||Z.crawl(N,function(W){Z.isValObject(W)&&"anim"in W&&delete W.anim}),N}function M(){var L={},z,F;o(L,A);for(z in V.subplotsRegistry)if(F=V.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var B=0;B=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",h;function c(){h={},n&&(h[s]={},h[s][x]=n)}c();function m(_,w){h[_]=w}function p(_,w){n?V.nestedProperty(h[s],_).set(w):h[s+"."+_]=w}function T(){var _=h;return c(),_}function l(_,w){_&&p(_,w);var S=T();for(var M in S)V.nestedProperty(t,M).set(S[M])}return{modifyBase:m,modifyItem:p,getUpdateObj:T,applyUpdate:l}}}}),Sf=We({"src/plots/cartesian/constants.js"(Z,V){"use strict";var d=A0().counter;V.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),cc=We({"src/plots/cartesian/axis_ids.js"(Z){"use strict";var V=Wi(),d=Sf();Z.id2name=function(E){if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))){var e=E.split(" ")[0].slice(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},Z.name2id=function(E){if(E.match(d.AX_NAME_PATTERN)){var e=E.slice(5);return e==="1"&&(e=""),E.charAt(0)+e}},Z.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},Z.list=function(A,E,e){var t=A._fullLayout;if(!t)return[];var r=Z.listIds(A,E),o=new Array(r.length),a;for(a=0;at?1:-1:+(A.slice(1)||1)-+(E.slice(1)||1)},Z.ref2id=function(A){return/^[xyz]/.test(A)?A.split(" ")[0]:!1};function x(A,E){if(E&&E.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,h,i+1):o(h,n,s)}})}}}),Nu=We({"src/plots/plots.js"(Z,V){"use strict";var d=Hi(),x=b0().timeFormatLocale,A=Zx().formatLocale,E=Uo(),e=Yx(),t=Wi(),r=E0(),o=sl(),a=aa(),i=Fi(),n=bs().BADNUM,s=cc(),h=Sd().clearOutline,c=Ny(),m=Rm(),p=nb(),T=Ff().getModuleCalcData,l=a.relinkPrivateKeys,_=a._,w=V.exports={};a.extendFlat(w,t),w.attributes=El(),w.attributes.type.values=w.allTypes,w.fontAttrs=_u(),w.layoutAttributes=S0();var S=ZA();w.executeAPICommand=S.executeAPICommand,w.computeAPICommandBindings=S.computeAPICommandBindings,w.manageCommandObserver=S.manageCommandObserver,w.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,w.redrawText=function(q){return q=a.getGraphDiv(q),new Promise(function($){setTimeout(function(){q._fullLayout&&(t.getComponentMethod("annotations","draw")(q),t.getComponentMethod("legend","draw")(q),t.getComponentMethod("colorbar","draw")(q),$(w.previousPromises(q)))},300)})},w.resize=function(q){q=a.getGraphDiv(q);var $,J=new Promise(function(X,oe){(!q||a.isHidden(q))&&oe(new Error("Resize must be passed a displayed plot div element.")),q._redrawTimer&&clearTimeout(q._redrawTimer),q._resolveResize&&($=q._resolveResize),q._resolveResize=X,q._redrawTimer=setTimeout(function(){if(!q.layout||q.layout.width&&q.layout.height||a.isHidden(q)){X(q);return}delete q.layout.width,delete q.layout.height;var ne=q.changed;q.autoplay=!0,t.call("relayout",q,{autosize:!0}).then(function(){q.changed=ne,q._resolveResize===X&&(delete q._resolveResize,X(q))})},100)});return $&&$(J),J},w.previousPromises=function(q){if((q._promises||[]).length)return Promise.all(q._promises).then(function(){q._promises=[]})},w.addLinks=function(q){if(!(!q._context.showLink&&!q._context.showSources)){var $=q._fullLayout,J=a.ensureSingle($._paper,"text","js-plot-link-container",function(re){re.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var ue=d.select(this);ue.append("tspan").classed("js-link-to-tool",!0),ue.append("tspan").classed("js-link-spacer",!0),ue.append("tspan").classed("js-sourcelinks",!0)})}),X=J.node(),oe={y:$._paper.attr("height")-9};document.body.contains(X)&&X.getComputedTextLength()>=$.width-20?(oe["text-anchor"]="start",oe.x=5):(oe["text-anchor"]="end",oe.x=$._paper.attr("width")-7),J.attr(oe);var ne=J.select(".js-link-to-tool"),j=J.select(".js-link-spacer"),ee=J.select(".js-sourcelinks");q._context.showSources&&q._context.showSources(q),q._context.showLink&&M(q,ne),j.text(ne.text()&&ee.text()?" - ":"")}};function M(q,$){$.text("");var J=$.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(q._context.linkText+" \xBB");if(q._context.sendData)J.on("click",function(){w.sendDataToCloud(q)});else{var X=window.location.pathname.split("/"),oe=window.location.search;J.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+X[2].split(".")[0]+"/"+X[1]+oe})}}w.sendDataToCloud=function(q){var $=(window.PLOTLYENV||{}).BASE_URL||q._context.plotlyServerURL;if($){q.emit("plotly_beforeexport");var J=d.select(q).append("div").attr("id","hiddenform").style("display","none"),X=J.append("form").attr({action:$+"/external",method:"post",target:"_blank"}),oe=X.append("input").attr({type:"text",name:"data"});return oe.node().value=w.graphJson(q,!1,"keepdata"),X.node().submit(),J.remove(),q.emit("plotly_afterexport"),!1}};var y=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(q,$){var J=$&&$.skipUpdateCalc,X=q._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var oe=q._fullLayout={},ne=q.layout||{},j=q._fullData||[],ee=q._fullData=[],re=q.data||[],ue=q.calcdata||[],_e=q._context||{},Te;q._transitionData||w.createTransitionData(q),oe._dfltTitle={plot:_(q,"Click to enter Plot title"),subtitle:_(q,"Click to enter Plot subtitle"),x:_(q,"Click to enter X axis title"),y:_(q,"Click to enter Y axis title"),colorbar:_(q,"Click to enter Colorscale title"),annotation:_(q,"new text")},oe._traceWord=_(q,"trace");var Ie=g(q,y);if(oe._mapboxAccessToken=_e.mapboxAccessToken,X._initialAutoSizeIsDone){var De=X.width,He=X.height;w.supplyLayoutGlobalDefaults(ne,oe,Ie),ne.width||(oe.width=De),ne.height||(oe.height=He),w.sanitizeMargins(oe)}else{w.supplyLayoutGlobalDefaults(ne,oe,Ie);var et=!ne.width||!ne.height,rt=oe.autosize,$e=_e.autosizable,ot=et&&(rt||$e);ot?w.plotAutoSize(q,ne,oe):et&&w.sanitizeMargins(oe),!rt&&et&&(ne.width=oe.width,ne.height=oe.height)}oe._d3locale=f(Ie,oe.separators),oe._extraFormat=g(q,b),oe._initialAutoSizeIsDone=!0,oe._dataLength=re.length,oe._modules=[],oe._visibleModules=[],oe._basePlotModules=[];var Ae=oe._subplots=u(),ge=oe._splomAxes={x:{},y:{}},ce=oe._splomSubplots={};oe._splomGridDflt={},oe._scatterStackOpts={},oe._firstScatter={},oe._alignmentOpts={},oe._colorAxes={},oe._requestRangeslider={},oe._traceUids=v(j,re),w.supplyDataDefaults(re,ee,ne,oe);var ze=Object.keys(ge.x),Qe=Object.keys(ge.y);if(ze.length>1&&Qe.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ne,oe),Te=0;Te15&&Qe.length>15&&oe.shapes.length===0&&oe.images.length===0,w.linkSubplots(ee,oe,j,X),w.cleanPlot(ee,oe,j,X);var Bt=!!(X._has&&X._has("cartesian")),jt=!!(oe._has&&oe._has("cartesian")),_r=Bt,pr=jt;_r&&!pr?X._bgLayer.remove():pr&&!_r&&(oe._shouldCreateBgLayer=!0),X._zoomlayer&&!q._dragging&&h({_fullLayout:X}),P(ee,oe),l(oe,X),t.getComponentMethod("colorscale","crossTraceDefaults")(ee,oe),oe._preGUI||(oe._preGUI={}),oe._tracePreGUI||(oe._tracePreGUI={});var Or=oe._tracePreGUI,mr={},Er;for(Er in Or)mr[Er]="old";for(Te=0;Te0){var _e=1-2*ne;j=Math.round(_e*j),ee=Math.round(_e*ee)}}var Te=w.layoutAttributes.width.min,Ie=w.layoutAttributes.height.min;j1,He=!J.height&&Math.abs(X.height-ee)>1;(He||De)&&(De&&(X.width=j),He&&(X.height=ee)),$._initialAutoSize||($._initialAutoSize={width:j,height:ee}),w.sanitizeMargins(X)},w.supplyLayoutModuleDefaults=function(q,$,J,X){var oe=t.componentsRegistry,ne=$._basePlotModules,j,ee,re,ue=t.subplotsRegistry.cartesian;for(j in oe)re=oe[j],re.includeBasePlot&&re.includeBasePlot(q,$);ne.length||ne.push(ue),$._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(q,$),ue.finalizeSubplots(q,$));for(var _e in $._subplots)$._subplots[_e].sort(a.subplotSort);for(ee=0;ee1&&(J.l/=rt,J.r/=rt)}if(Ie){var $e=(J.t+J.b)/Ie;$e>1&&(J.t/=$e,J.b/=$e)}var ot=J.xl!==void 0?J.xl:J.x,Ae=J.xr!==void 0?J.xr:J.x,ge=J.yt!==void 0?J.yt:J.y,ce=J.yb!==void 0?J.yb:J.y;De[$]={l:{val:ot,size:J.l+et},r:{val:Ae,size:J.r+et},b:{val:ce,size:J.b+et},t:{val:ge,size:J.t+et}},He[$]=1}if(!X._replotting)return w.doAutoMargin(q)}};function I(q){if("_redrawFromAutoMarginCount"in q._fullLayout)return!1;var $=s.list(q,"",!0);for(var J in $)if($[J].autoshift||$[J].shift)return!0;return!1}w.doAutoMargin=function(q){var $=q._fullLayout,J=$.width,X=$.height;$._size||($._size={}),F($);var oe=$._size,ne=$.margin,j={t:0,b:0,l:0,r:0},ee=a.extendFlat({},oe),re=ne.l,ue=ne.r,_e=ne.t,Te=ne.b,Ie=$._pushmargin,De=$._pushmarginIds,He=$.minreducedwidth,et=$.minreducedheight;if(ne.autoexpand!==!1){for(var rt in Ie)De[rt]||delete Ie[rt];var $e=q._fullLayout._reservedMargin;for(var ot in $e)for(var Ae in $e[ot]){var ge=$e[ot][Ae];j[Ae]=Math.max(j[Ae],ge)}Ie.base={l:{val:0,size:re},r:{val:1,size:ue},t:{val:1,size:_e},b:{val:0,size:Te}};for(var ce in j){var ze=0;for(var Qe in Ie)Qe!=="base"&&E(Ie[Qe][ce].size)&&(ze=Ie[Qe][ce].size>ze?Ie[Qe][ce].size:ze);var nt=Math.max(0,ne[ce]-ze);j[ce]=Math.max(0,j[ce]-nt)}for(var Ke in Ie){var kt=Ie[Ke].l||{},Et=Ie[Ke].b||{},Bt=kt.val,jt=kt.size,_r=Et.val,pr=Et.size,Or=J-j.r-j.l,mr=X-j.t-j.b;for(var Er in Ie){if(E(jt)&&Ie[Er].r){var yt=Ie[Er].r.val,Oe=Ie[Er].r.size;if(yt>Bt){var Xe=(jt*yt+(Oe-Or)*Bt)/(yt-Bt),be=(Oe*(1-Bt)+(jt-Or)*(1-yt))/(yt-Bt);Xe+be>re+ue&&(re=Xe,ue=be)}}if(E(pr)&&Ie[Er].t){var Ce=Ie[Er].t.val,Ne=Ie[Er].t.size;if(Ce>_r){var Ee=(pr*Ce+(Ne-mr)*_r)/(Ce-_r),Se=(Ne*(1-_r)+(pr-mr)*(1-Ce))/(Ce-_r);Ee+Se>Te+_e&&(Te=Ee,_e=Se)}}}}}var Le=a.constrain(J-ne.l-ne.r,B,He),at=a.constrain(X-ne.t-ne.b,O,et),dt=Math.max(0,J-Le),gt=Math.max(0,X-at);if(dt){var Ct=(re+ue)/dt;Ct>1&&(re/=Ct,ue/=Ct)}if(gt){var or=(Te+_e)/gt;or>1&&(Te/=or,_e/=or)}if(oe.l=Math.round(re)+j.l,oe.r=Math.round(ue)+j.r,oe.t=Math.round(_e)+j.t,oe.b=Math.round(Te)+j.b,oe.p=Math.round(ne.pad),oe.w=Math.round(J)-oe.l-oe.r,oe.h=Math.round(X)-oe.t-oe.b,!$._replotting&&(w.didMarginChange(ee,oe)||I(q))){"_redrawFromAutoMarginCount"in $?$._redrawFromAutoMarginCount++:$._redrawFromAutoMarginCount=1;var Qt=3*(1+Object.keys(De).length);if($._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(q,$,J,X,oe,ne){(oe&&$&&!q._fullData||oe&&!$&&!q._fullLayout)&&w.supplyDefaults(q);var j=oe?q._fullData:q.data,ee=oe?q._fullLayout:q.layout,re=(q._transitionData||{})._frames;function ue(Ie,De){if(typeof Ie=="function")return De?"_function_":null;if(a.isPlainObject(Ie)){var He={},et;return Object.keys(Ie).sort().forEach(function(Ae){if(["_","["].indexOf(Ae.charAt(0))===-1){if(typeof Ie[Ae]=="function"){De&&(He[Ae]="_function");return}if(J==="keepdata"){if(Ae.slice(-3)==="src")return}else if(J==="keepstream"){if(et=Ie[Ae+"src"],typeof et=="string"&&et.indexOf(":")>0&&!a.isPlainObject(Ie.stream))return}else if(J!=="keepall"&&(et=Ie[Ae+"src"],typeof et=="string"&&et.indexOf(":")>0))return;He[Ae]=ue(Ie[Ae],De)}}),He}var rt=Array.isArray(Ie),$e=a.isTypedArray(Ie);if((rt||$e)&&Ie.dtype&&Ie.shape){var ot=Ie.bdata;return ue({dtype:Ie.dtype,shape:Ie.shape,bdata:a.isArrayBuffer(ot)?e.encode(ot):ot},De)}return rt?Ie.map(function(Ae){return ue(Ae,De)}):$e?a.simpleMap(Ie,a.identity):a.isJSDate(Ie)?a.ms2DateTimeLocal(+Ie):Ie}var _e={data:(j||[]).map(function(Ie){var De=ue(Ie);return $&&delete De.fit,De})};if(!$&&(_e.layout=ue(ee),oe)){var Te=ee._size;_e.layout.computed={margin:{b:Te.b,l:Te.l,r:Te.r,t:Te.t}}}return re&&(_e.frames=ue(re)),ne&&(_e.config=ue(q._context,!0)),X==="object"?_e:JSON.stringify(_e)},w.modifyFrames=function(q,$){var J,X,oe,ne=q._transitionData._frames,j=q._transitionData._frameHash;for(J=0;J<$.length;J++)switch(X=$[J],X.type){case"replace":oe=X.value;var ee=(ne[X.index]||{}).name,re=oe.name;ne[X.index]=j[re]=oe,re!==ee&&(delete j[ee],j[re]=oe);break;case"insert":oe=X.value,j[oe.name]=oe,ne.splice(X.index,0,oe);break;case"delete":oe=ne[X.index],delete j[oe.name],ne.splice(X.index,1);break}return Promise.resolve()},w.computeFrame=function(q,$){var J=q._transitionData._frameHash,X,oe,ne,j;if(!$)throw new Error("computeFrame must be given a string frame name");var ee=J[$.toString()];if(!ee)return!1;for(var re=[ee],ue=[ee.name];ee.baseframe&&(ee=J[ee.baseframe.toString()])&&ue.indexOf(ee.name)===-1;)re.push(ee),ue.push(ee.name);for(var _e={};ee=re.pop();)if(ee.layout&&(_e.layout=w.extendLayout(_e.layout,ee.layout)),ee.data){if(_e.data||(_e.data=[]),oe=ee.traces,!oe)for(oe=[],X=0;X0&&(q._transitioningWithDuration=!0),q._transitionData._interruptCallbacks.push(function(){X=!0}),J.redraw&&q._transitionData._interruptCallbacks.push(function(){return t.call("redraw",q)}),q._transitionData._interruptCallbacks.push(function(){q.emit("plotly_transitioninterrupted",[])});var Ie=0,De=0;function He(){return Ie++,function(){De++,!X&&De===Ie&&ee(Te)}}J.runFn(He),setTimeout(He())})}function ee(Te){if(q._transitionData)return ne(q._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(J.redraw)return t.call("redraw",q)}).then(function(){q._transitioning=!1,q._transitioningWithDuration=!1,q.emit("plotly_transitioned",[])}).then(Te)}function re(){if(q._transitionData)return q._transitioning=!1,oe(q._transitionData._interruptCallbacks)}var ue=[w.previousPromises,re,J.prepareFn,w.rehover,w.reselect,j],_e=a.syncOrAsync(ue,q);return(!_e||!_e.then)&&(_e=Promise.resolve()),_e.then(function(){return q})}w.doCalcdata=function(q,$){var J=s.list(q),X=q._fullData,oe=q._fullLayout,ne,j,ee,re,ue=new Array(X.length),_e=(q.calcdata||[]).slice();for(q.calcdata=ue,oe._numBoxes=0,oe._numViolins=0,oe._violinScaleGroupStats={},q._hmpixcount=0,q._hmlumcount=0,oe._piecolormap={},oe._sunburstcolormap={},oe._treemapcolormap={},oe._iciclecolormap={},oe._funnelareacolormap={},ee=0;ee=0;re--)if(ce[re].enabled){ne._indexToPoints=ce[re]._indexToPoints;break}j&&j.calc&&(ge=j.calc(q,ne))}(!Array.isArray(ge)||!ge[0])&&(ge=[{x:n,y:n}]),ge[0].t||(ge[0].t={}),ge[0].trace=ne,ue[ot]=ge}}for(se(J,X,oe),ee=0;eeee||De>re)&&(ne.style("overflow","hidden"),Te=ne.node().getBoundingClientRect(),Ie=Te.width,De=Te.height);var He=+O.attr("x"),et=+O.attr("y"),rt=q||O.node().getBoundingClientRect().height,$e=-rt/4;if(le[0]==="y")j.attr({transform:"rotate("+[-90,He,et]+")"+x(-Ie/2,$e-De/2)});else if(le[0]==="l")et=$e-De/2;else if(le[0]==="a"&&le.indexOf("atitle")!==0)He=0,et=$e;else{var ot=O.attr("text-anchor");He=He-Ie*(ot==="middle"?.5:ot==="end"?1:0),et=et+$e-De/2}ne.attr({x:He,y:et}),N&&N.call(O,j),he(j)})})):se(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,I,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){d.warn("No MathJax version:",MathJax.version);return}var W,Q,le,se,he=function(){return Q=d.extendDeepAll({},MathJax.Hub.config),le=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},q=function(){Q=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},$=function(){if(W=MathJax.Hub.config.menuSettings.renderer,W!=="SVG")return MathJax.Hub.setRenderer("SVG")},J=function(){W=MathJax.config.startup.output,W!=="svg"&&(MathJax.config.startup.output="svg")},X=function(){var ue="math-output-"+d.randstr({},64);se=V.select("body").append("div").attr({id:ue}).style({visibility:"hidden",position:"absolute","font-size":I.fontSize+"px"}).text(o(O));var _e=se.node();return U===2?MathJax.Hub.Typeset(_e):MathJax.typeset([_e])},oe=function(){var ue=se.select(U===2?".MathJax_SVG":".MathJax"),_e=!ue.empty()&&se.select("svg").node();if(!_e)d.log("There was an error in the tex syntax.",O),N();else{var Te=_e.getBoundingClientRect(),Ie;U===2?Ie=V.select("body").select("#MathJax_SVG_glyphs"):Ie=ue.select("defs"),N(ue,Ie,Te)}se.remove()},ne=function(){if(W!=="SVG")return MathJax.Hub.setRenderer(W)},j=function(){W!=="svg"&&(MathJax.config.startup.output=W)},ee=function(){return le!==void 0&&(MathJax.Hub.processSectionDelay=le),MathJax.Hub.Config(Q)},re=function(){MathJax.config=Q};U===2?MathJax.Hub.Queue(he,$,X,oe,ne,ee):U===3&&(q(),J(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),oe(),j(),re()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},c="\u200B",m=["http:","https:","mailto:","",void 0,":"],p=Z.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;Z.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,y=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function b(O,I){if(!O)return null;var N=O.match(I),U=N&&(N[3]||N[4]);return U&&f(U)}var v=/(^|;)\s*color:/;Z.plainText=function(O,I){I=I||{};for(var N=I.len!==void 0&&I.len!==-1?I.len:1/0,U=I.allowedTags!==void 0?I.allowedTags:["br"],W="...",Q=W.length,le=O.split(T),se=[],he="",q=0,$=0;$Q?se.push(J.slice(0,Math.max(0,j-Q))+W):se.push(J.slice(0,j));break}he=""}}return se.join("")};var u={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},g=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function f(O){return O.replace(g,function(I,N){var U;return N.charAt(0)==="#"?U=P(N.charAt(1)==="x"?parseInt(N.slice(2),16):parseInt(N.slice(1),10)):U=u[N],U||I})}Z.convertEntities=f;function P(O){if(!(O>1114111)){var I=String.fromCodePoint;if(I)return I(O);var N=String.fromCharCode;return O<=65535?N(O):N((O>>10)+55232,O%1024+56320)}}function L(O,I){I=I.replace(p," ");var N=!1,U=[],W,Q=-1;function le(){Q++;var De=document.createElementNS(A.svg,"tspan");V.select(De).attr({class:"line",dy:Q*E+"em"}),O.appendChild(De),W=De;var He=U;if(U=[{node:De}],He.length>1)for(var et=1;et.",I);return}var He=U.pop();De!==He.type&&d.log("Start tag <"+He.type+"> doesnt match end tag <"+De+">. Pretending it did match.",I),W=U[U.length-1].node}var $=_.test(I);$?le():(W=O,U=[{node:O}]);for(var J=I.split(T),X=0;X=0;_--,w++){var S=p[_];l[w]=[1-S[0],S[1]]}return l}function h(p,T){T=T||{};for(var l=p.domain,_=p.range,w=_.length,S=new Array(w),M=0;Mp-c?c=p-(m-p):m-p=0?_=o.colorscale.sequential:_=o.colorscale.sequentialminus,s._sync("colorscale",_)}}}}),xu=We({"src/components/colorscale/index.js"(Z,V){"use strict";var d=mp(),x=ah();V.exports={moduleType:"component",name:"colorscale",attributes:Zl(),layoutAttributes:ib(),supplyLayoutDefaults:YA(),handleDefaults:yf(),crossTraceDefaults:KA(),calc:nh(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),au=We({"src/traces/scatter/subtypes.js"(Z,V){"use strict";var d=aa(),x=rh().isTypedArraySpec;V.exports={hasLines:function(A){return A.visible&&A.mode&&A.mode.indexOf("lines")!==-1},hasMarkers:function(A){return A.visible&&(A.mode&&A.mode.indexOf("markers")!==-1||A.type==="splom")},hasText:function(A){return A.visible&&A.mode&&A.mode.indexOf("text")!==-1},isBubble:function(A){var E=A.marker;return d.isPlainObject(E)&&(d.isArrayOrTypedArray(E.size)||x(E.size))}}}}),C0=We({"src/traces/scatter/make_bubble_size_func.js"(Z,V){"use strict";var d=Uo();V.exports=function(A,E){E||(E=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/E);return d(i)&&i>0?Math.max(i,r):0}}}}),Th=We({"src/components/fx/helpers.js"(Z){"use strict";var V=aa();Z.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Z.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(ge=100,Ae=Ae.replace("-open","")),Ae.indexOf("-dot")>0&&(ge+=200,Ae=Ae.replace("-dot","")),Ae=l.symbolNames.indexOf(Ae),Ae>=0&&(Ae+=ge)}return Ae%100>=v||Ae>=400?0:Math.floor(Math.max(Ae,0))};function g(Ae,ge,ce,ze){var Qe=Ae%100;return l.symbolFuncs[Qe](ge,ce,ze)+(Ae>=200?u:"")}var f=A("~f"),P={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Ae,ge,ce,ze,Qe,nt){var Ke=P[ze];return L(Ae,ge,ce,Ke.type,Qe,nt,Ke.start,Ke.stop,!1,Ke.reversed)};function L(Ae,ge,ce,ze,Qe,nt,Ke,kt,Et,Bt){var jt=Qe.length,_r;ze==="linear"?_r={node:"linearGradient",attrs:{x1:Ke.x,y1:Ke.y,x2:kt.x,y2:kt.y,gradientUnits:Et?"userSpaceOnUse":"objectBoundingBox"},reversed:Bt}:ze==="radial"&&(_r={node:"radialGradient",reversed:Bt});for(var pr=new Array(jt),Or=0;Or=0&&Ae.i===void 0&&(Ae.i=nt.i),ge.style("opacity",ze.selectedOpacityFn?ze.selectedOpacityFn(Ae):Ae.mo===void 0?Ke.opacity:Ae.mo),ze.ms2mrc){var Et;Ae.ms==="various"||Ke.size==="various"?Et=3:Et=ze.ms2mrc(Ae.ms),Ae.mrc=Et,ze.selectedSizeFn&&(Et=Ae.mrc=ze.selectedSizeFn(Ae));var Bt=l.symbolNumber(Ae.mx||Ke.symbol)||0;Ae.om=Bt%200>=100;var jt=ot(Ae,ce),_r=ee(Ae,ce);ge.attr("d",g(Bt,Et,jt,_r))}var pr=!1,Or,mr,Er;if(Ae.so)Er=kt.outlierwidth,mr=kt.outliercolor,Or=Ke.outliercolor;else{var yt=(kt||{}).width;Er=(Ae.mlw+1||yt+1||(Ae.trace?(Ae.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Ae?mr=Ae.mlcc=ze.lineScale(Ae.mlc):x.isArrayOrTypedArray(kt.color)?mr=r.defaultLine:mr=kt.color,x.isArrayOrTypedArray(Ke.color)&&(Or=r.defaultLine,pr=!0),"mc"in Ae?Or=Ae.mcc=ze.markerScale(Ae.mc):Or=Ke.color||Ke.colors||"rgba(0,0,0,0)",ze.selectedColorFn&&(Or=ze.selectedColorFn(Ae))}if(Ae.om)ge.call(r.stroke,Or).style({"stroke-width":(Er||1)+"px",fill:"none"});else{ge.style("stroke-width",(Ae.isBlank?0:Er)+"px");var Oe=Ke.gradient,Xe=Ae.mgt;Xe?pr=!0:Xe=Oe&&Oe.type,x.isArrayOrTypedArray(Xe)&&(Xe=Xe[0],P[Xe]||(Xe=0));var be=Ke.pattern,Ce=l.getPatternAttr,Ne=be&&(Ce(be.shape,Ae.i,"")||Ce(be.path,Ae.i,""));if(Xe&&Xe!=="none"){var Ee=Ae.mgc;Ee?pr=!0:Ee=Oe.color;var Se=ce.uid;pr&&(Se+="-"+Ae.i),l.gradient(ge,Qe,Se,Xe,[[0,Ee],[1,Or]],"fill")}else if(Ne){var Le=!1,at=be.fgcolor;!at&&nt&&nt.color&&(at=nt.color,Le=!0);var dt=Ce(at,Ae.i,nt&&nt.color||null),gt=Ce(be.bgcolor,Ae.i,null),Ct=be.fgopacity,or=Ce(be.size,Ae.i,8),Qt=Ce(be.solidity,Ae.i,.3);Le=Le||Ae.mcc||x.isArrayOrTypedArray(be.shape)||x.isArrayOrTypedArray(be.path)||x.isArrayOrTypedArray(be.bgcolor)||x.isArrayOrTypedArray(be.fgcolor)||x.isArrayOrTypedArray(be.size)||x.isArrayOrTypedArray(be.solidity);var Jt=ce.uid;Le&&(Jt+="-"+Ae.i),l.pattern(ge,"point",Qe,Jt,Ne,or,Qt,Ae.mcc,be.fillmode,gt,dt,Ct)}else x.isArrayOrTypedArray(Or)?r.fill(ge,Or[Ae.i]):r.fill(ge,Or);Er&&r.stroke(ge,mr)}},l.makePointStyleFns=function(Ae){var ge={},ce=Ae.marker;return ge.markerScale=l.tryColorscale(ce,""),ge.lineScale=l.tryColorscale(ce,"line"),t.traceIs(Ae,"symbols")&&(ge.ms2mrc=m.isBubble(Ae)?p(Ae):function(){return(ce.size||6)/2}),Ae.selectedpoints&&x.extendFlat(ge,l.makeSelectedPointStyleFns(Ae)),ge},l.makeSelectedPointStyleFns=function(Ae){var ge={},ce=Ae.selected||{},ze=Ae.unselected||{},Qe=Ae.marker||{},nt=ce.marker||{},Ke=ze.marker||{},kt=Qe.opacity,Et=nt.opacity,Bt=Ke.opacity,jt=Et!==void 0,_r=Bt!==void 0;(x.isArrayOrTypedArray(kt)||jt||_r)&&(ge.selectedOpacityFn=function(Ce){var Ne=Ce.mo===void 0?Qe.opacity:Ce.mo;return Ce.selected?jt?Et:Ne:_r?Bt:c*Ne});var pr=Qe.color,Or=nt.color,mr=Ke.color;(Or||mr)&&(ge.selectedColorFn=function(Ce){var Ne=Ce.mcc||pr;return Ce.selected?Or||Ne:mr||Ne});var Er=Qe.size,yt=nt.size,Oe=Ke.size,Xe=yt!==void 0,be=Oe!==void 0;return t.traceIs(Ae,"symbols")&&(Xe||be)&&(ge.selectedSizeFn=function(Ce){var Ne=Ce.mrc||Er/2;return Ce.selected?Xe?yt/2:Ne:be?Oe/2:Ne}),ge},l.makeSelectedTextStyleFns=function(Ae){var ge={},ce=Ae.selected||{},ze=Ae.unselected||{},Qe=Ae.textfont||{},nt=ce.textfont||{},Ke=ze.textfont||{},kt=Qe.color,Et=nt.color,Bt=Ke.color;return ge.selectedTextColorFn=function(jt){var _r=jt.tc||kt;return jt.selected?Et||_r:Bt||(Et?_r:r.addOpacity(_r,c))},ge},l.selectedPointStyle=function(Ae,ge){if(!(!Ae.size()||!ge.selectedpoints)){var ce=l.makeSelectedPointStyleFns(ge),ze=ge.marker||{},Qe=[];ce.selectedOpacityFn&&Qe.push(function(nt,Ke){nt.style("opacity",ce.selectedOpacityFn(Ke))}),ce.selectedColorFn&&Qe.push(function(nt,Ke){r.fill(nt,ce.selectedColorFn(Ke))}),ce.selectedSizeFn&&Qe.push(function(nt,Ke){var kt=Ke.mx||ze.symbol||0,Et=ce.selectedSizeFn(Ke);nt.attr("d",g(l.symbolNumber(kt),Et,ot(Ke,ge),ee(Ke,ge))),Ke.mrc2=Et}),Qe.length&&Ae.each(function(nt){for(var Ke=d.select(this),kt=0;kt0?ce:0}l.textPointStyle=function(Ae,ge,ce){if(Ae.size()){var ze;if(ge.selectedpoints){var Qe=l.makeSelectedTextStyleFns(ge);ze=Qe.selectedTextColorFn}var nt=ge.texttemplate,Ke=ce._fullLayout;Ae.each(function(kt){var Et=d.select(this),Bt=nt?x.extractOption(kt,ge,"txt","texttemplate"):x.extractOption(kt,ge,"tx","text");if(!Bt&&Bt!==0){Et.remove();return}if(nt){var jt=ge._module.formatLabels,_r=jt?jt(kt,ge,Ke):{},pr={};T(pr,ge,kt.i),Bt=x.texttemplateString({data:[pr,kt,ge._meta],fallback:ge.texttemplatefallback,labels:_r,locale:Ke._d3locale,template:Bt})}var Or=kt.tp||ge.textposition,mr=B(kt,ge),Er=ze?ze(kt):kt.tc||ge.textfont.color;Et.call(l.font,{family:kt.tf||ge.textfont.family,weight:kt.tw||ge.textfont.weight,style:kt.ty||ge.textfont.style,variant:kt.tv||ge.textfont.variant,textcase:kt.tC||ge.textfont.textcase,lineposition:kt.tE||ge.textfont.lineposition,shadow:kt.tS||ge.textfont.shadow,size:mr,color:Er}).text(Bt).call(i.convertToTspans,ce).call(F,Or,mr,kt.mrc)})}},l.selectedTextStyle=function(Ae,ge){if(!(!Ae.size()||!ge.selectedpoints)){var ce=l.makeSelectedTextStyleFns(ge);Ae.each(function(ze){var Qe=d.select(this),nt=ce.selectedTextColorFn(ze),Ke=ze.tp||ge.textposition,kt=B(ze,ge);r.fill(Qe,nt);var Et=t.traceIs(ge,"bar-like");F(Qe,Ke,kt,ze.mrc2||ze.mrc,Et)})}};var O=.5;l.smoothopen=function(Ae,ge){if(Ae.length<3)return"M"+Ae.join("L");var ce="M"+Ae[0],ze=[],Qe;for(Qe=1;Qe=Et||Ce>=jt&&Ce<=Et)&&(Ne<=_r&&Ne>=Bt||Ne>=_r&&Ne<=Bt)&&(Ae=[Ce,Ne])}return Ae}l.applyBackoff=q,l.makeTester=function(){var Ae=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(ce){ce.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ge=x.ensureSingle(Ae,"path","js-reference-point",function(ce){ce.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Ae,l.testref=ge},l.savedBBoxes={};var $=0,J=1e4;l.bBox=function(Ae,ge,ce){ce||(ce=X(Ae));var ze;if(ce){if(ze=l.savedBBoxes[ce],ze)return x.extendFlat({},ze)}else if(Ae.childNodes.length===1){var Qe=Ae.childNodes[0];if(ce=X(Qe),ce){var nt=+Qe.getAttribute("x")||0,Ke=+Qe.getAttribute("y")||0,kt=Qe.getAttribute("transform");if(!kt){var Et=l.bBox(Qe,!1,ce);return nt&&(Et.left+=nt,Et.right+=nt),Ke&&(Et.top+=Ke,Et.bottom+=Ke),Et}if(ce+="~"+nt+"~"+Ke+"~"+kt,ze=l.savedBBoxes[ce],ze)return x.extendFlat({},ze)}}var Bt,jt;ge?Bt=Ae:(jt=l.tester.node(),Bt=Ae.cloneNode(!0),jt.appendChild(Bt)),d.select(Bt).attr("transform",null).call(i.positionText,0,0);var _r=Bt.getBoundingClientRect(),pr=l.testref.node().getBoundingClientRect();ge||jt.removeChild(Bt);var Or={height:_r.height,width:_r.width,left:_r.left-pr.left,top:_r.top-pr.top,right:_r.right-pr.left,bottom:_r.bottom-pr.top};return $>=J&&(l.savedBBoxes={},$=0),ce&&(l.savedBBoxes[ce]=Or),$++,x.extendFlat({},Or)};function X(Ae){var ge=Ae.getAttribute("data-unformatted");if(ge!==null)return ge+Ae.getAttribute("data-math")+Ae.getAttribute("text-anchor")+Ae.getAttribute("style")}l.setClipUrl=function(Ae,ge,ce){Ae.attr("clip-path",oe(ge,ce))};function oe(Ae,ge){if(!Ae)return null;var ce=ge._context,ze=ce._exportedPlot?"":ce._baseUrl||"";return ze?"url('"+ze+"#"+Ae+"')":"url(#"+Ae+")"}l.getTranslate=function(Ae){var ge=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ce=Ae.attr?"attr":"getAttribute",ze=Ae[ce]("transform")||"",Qe=ze.replace(ge,function(nt,Ke,kt){return[Ke,kt].join(" ")}).split(" ");return{x:+Qe[0]||0,y:+Qe[1]||0}},l.setTranslate=function(Ae,ge,ce){var ze=/(\btranslate\(.*?\);?)/,Qe=Ae.attr?"attr":"getAttribute",nt=Ae.attr?"attr":"setAttribute",Ke=Ae[Qe]("transform")||"";return ge=ge||0,ce=ce||0,Ke=Ke.replace(ze,"").trim(),Ke+=a(ge,ce),Ke=Ke.trim(),Ae[nt]("transform",Ke),Ke},l.getScale=function(Ae){var ge=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ce=Ae.attr?"attr":"getAttribute",ze=Ae[ce]("transform")||"",Qe=ze.replace(ge,function(nt,Ke,kt){return[Ke,kt].join(" ")}).split(" ");return{x:+Qe[0]||1,y:+Qe[1]||1}},l.setScale=function(Ae,ge,ce){var ze=/(\bscale\(.*?\);?)/,Qe=Ae.attr?"attr":"getAttribute",nt=Ae.attr?"attr":"setAttribute",Ke=Ae[Qe]("transform")||"";return ge=ge||1,ce=ce||1,Ke=Ke.replace(ze,"").trim(),Ke+="scale("+ge+","+ce+")",Ke=Ke.trim(),Ae[nt]("transform",Ke),Ke};var ne=/\s*sc.*/;l.setPointGroupScale=function(Ae,ge,ce){if(ge=ge||1,ce=ce||1,!!Ae){var ze=ge===1&&ce===1?"":"scale("+ge+","+ce+")";Ae.each(function(){var Qe=(this.getAttribute("transform")||"").replace(ne,"");Qe+=ze,Qe=Qe.trim(),this.setAttribute("transform",Qe)})}};var j=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Ae,ge,ce){Ae&&Ae.each(function(){var ze,Qe=d.select(this),nt=Qe.select("text");if(nt.node()){var Ke=parseFloat(nt.attr("x")||0),kt=parseFloat(nt.attr("y")||0),Et=(Qe.attr("transform")||"").match(j);ge===1&&ce===1?ze=[]:ze=[a(Ke,kt),"scale("+ge+","+ce+")",a(-Ke,-kt)],Et&&ze.push(Et),Qe.attr("transform",ze.join(""))}})};function ee(Ae,ge){var ce;return Ae&&(ce=Ae.mf),ce===void 0&&(ce=ge.marker&&ge.marker.standoff||0),!ge._geo&&!ge._xA?-ce:ce}l.getMarkerStandoff=ee;var re=Math.atan2,ue=Math.cos,_e=Math.sin;function Te(Ae,ge){var ce=ge[0],ze=ge[1];return[ce*ue(Ae)-ze*_e(Ae),ce*_e(Ae)+ze*ue(Ae)]}var Ie,De,He,et,rt,$e;function ot(Ae,ge){var ce=Ae.ma;ce===void 0&&(ce=ge.marker.angle,(!ce||x.isArrayOrTypedArray(ce))&&(ce=0));var ze,Qe,nt=ge.marker.angleref;if(nt==="previous"||nt==="north"){if(ge._geo){var Ke=ge._geo.project(Ae.lonlat);ze=Ke[0],Qe=Ke[1]}else{var kt=ge._xA,Et=ge._yA;if(kt&&Et)ze=kt.c2p(Ae.x),Qe=Et.c2p(Ae.y);else return 90}if(ge._geo){var Bt=Ae.lonlat[0],jt=Ae.lonlat[1],_r=ge._geo.project([Bt,jt+1e-5]),pr=ge._geo.project([Bt+1e-5,jt]),Or=re(pr[1]-Qe,pr[0]-ze),mr=re(_r[1]-Qe,_r[0]-ze),Er;if(nt==="north")Er=ce/180*Math.PI;else if(nt==="previous"){var yt=Bt/180*Math.PI,Oe=jt/180*Math.PI,Xe=Ie/180*Math.PI,be=De/180*Math.PI,Ce=Xe-yt,Ne=ue(be)*_e(Ce),Ee=_e(be)*ue(Oe)-ue(be)*_e(Oe)*ue(Ce);Er=-re(Ne,Ee)-Math.PI,Ie=Bt,De=jt}var Se=Te(Or,[ue(Er),0]),Le=Te(mr,[_e(Er),0]);ce=re(Se[1]+Le[1],Se[0]+Le[0])/Math.PI*180,nt==="previous"&&!($e===ge.uid&&Ae.i===rt+1)&&(ce=null)}if(nt==="previous"&&!ge._geo)if($e===ge.uid&&Ae.i===rt+1&&E(ze)&&E(Qe)){var at=ze-He,dt=Qe-et,gt=ge.line&&ge.line.shape||"",Ct=gt.slice(gt.length-1);Ct==="h"&&(dt=0),Ct==="v"&&(at=0),ce+=re(dt,at)/Math.PI*180+90}else ce=null}return He=ze,et=Qe,rt=Ae.i,$e=ge.uid,ce}l.getMarkerAngle=ot}}),xp=We({"src/components/titles/index.js"(Z,V){"use strict";var d=Hi(),x=Uo(),A=Nu(),E=Wi(),e=aa(),t=e.strTranslate,r=Oo(),o=Fi(),a=zl(),i=wd(),n=gf().OPPOSITE_SIDE,s=/ [XY][0-9]* /,h=1.6,c=1.6;function m(p,T,l){var _=p._fullLayout,w=l.propContainer,S=l.propName,M=l.placeholder,y=l.traceIndex,b=l.avoid||{},v=l.attributes,u=l.transform,g=l.containerGroup,f=1,P=w.title,L=(P&&P.text?P.text:"").trim(),z=!1,F=P&&P.font?P.font:{},B=F.family,O=F.size,I=F.color,N=F.weight,U=F.style,W=F.variant,Q=F.textcase,le=F.lineposition,se=F.shadow,he=l.subtitlePropName,q=!!he,$=l.subtitlePlaceholder,J=(w.title||{}).subtitle||{text:"",font:{}},X=(J.text||"").trim(),oe=!1,ne=1,j=J.font,ee=j.family,re=j.size,ue=j.color,_e=j.weight,Te=j.style,Ie=j.variant,De=j.textcase,He=j.lineposition,et=j.shadow,rt;S==="title.text"?rt="titleText":S.indexOf("axis")!==-1?rt="axisTitleText":S.indexOf("colorbar")!==-1&&(rt="colorbarTitleText");var $e=p._context.edits[rt];function ot(pr,Or){return pr===void 0||Or===void 0?!1:pr.replace(s," % ")===Or.replace(s," % ")}L===""?f=0:ot(L,M)&&($e||(L=""),f=.2,z=!0),q&&(X===""?ne=0:ot(X,$)&&($e||(X=""),ne=.2,oe=!0)),l._meta?L=e.templateString(L,l._meta):_._meta&&(L=e.templateString(L,_._meta));var Ae=L||X||$e,ge;g||(g=e.ensureSingle(_._infolayer,"g","g-"+T),ge=_._hColorbarMoveTitle);var ce=g.selectAll("text."+T).data(Ae?[0]:[]);ce.enter().append("text"),ce.text(L).attr("class",T),ce.exit().remove();var ze=null,Qe=T+"-subtitle",nt=X||$e;if(q&&(ze=g.selectAll("text."+Qe).data(nt?[0]:[]),ze.enter().append("text"),ze.text(X).attr("class",Qe),ze.exit().remove()),!Ae)return g;function Ke(pr,Or){e.syncOrAsync([kt,Et],{title:pr,subtitle:Or})}function kt(pr){var Or=pr.title,mr=pr.subtitle,Er;!u&&ge&&(u={}),u?(Er="",u.rotate&&(Er+="rotate("+[u.rotate,v.x,v.y]+")"),(u.offset||ge)&&(Er+=t(0,(u.offset||0)-(ge||0)))):Er=null,Or.attr("transform",Er);function yt(Ee){if(Ee){var Se=d.select(Ee.node().parentNode).select("."+Qe);if(!Se.empty()){var Le=Ee.node().getBBox();if(Le.height){var at=Le.y+Le.height+h*re;Se.attr("y",at)}}}}if(Or.style("opacity",f*o.opacity(I)).call(r.font,{color:o.rgb(I),size:d.round(O,2),family:B,weight:N,style:U,variant:W,textcase:Q,shadow:se,lineposition:le}).attr(v).call(a.convertToTspans,p,yt),mr&&!mr.empty()){var Oe=g.select("."+T+"-math-group"),Xe=Or.node().getBBox(),be=Oe.node()?Oe.node().getBBox():void 0,Ce=be?be.y+be.height+h*re:Xe.y+Xe.height+c*re,Ne=e.extendFlat({},v,{y:Ce});mr.attr("transform",Er),mr.style("opacity",ne*o.opacity(ue)).call(r.font,{color:o.rgb(ue),size:d.round(re,2),family:ee,weight:_e,style:Te,variant:Ie,textcase:De,shadow:et,lineposition:He}).attr(Ne).call(a.convertToTspans,p)}return A.previousPromises(p)}function Et(pr){var Or=pr.title,mr=d.select(Or.node().parentNode);if(b&&b.selection&&b.side&&L){mr.attr("transform",null);var Er=n[b.side],yt=b.side==="left"||b.side==="top"?-1:1,Oe=x(b.pad)?b.pad:2,Xe=r.bBox(mr.node()),be={t:0,b:0,l:0,r:0},Ce=p._fullLayout._reservedMargin;for(var Ne in Ce)for(var Ee in Ce[Ne]){var Se=Ce[Ne][Ee];be[Ee]=Math.max(be[Ee],Se)}var Le={left:be.l,top:be.t,right:_.width-be.r,bottom:_.height-be.b},at=b.maxShift||yt*(Le[b.side]-Xe[b.side]),dt=0;if(at<0)dt=at;else{var gt=b.offsetLeft||0,Ct=b.offsetTop||0;Xe.left-=gt,Xe.right-=gt,Xe.top-=Ct,Xe.bottom-=Ct,b.selection.each(function(){var Qt=r.bBox(this);e.bBoxIntersect(Xe,Qt,Oe)&&(dt=Math.max(dt,yt*(Qt[b.side]-Xe[Er])+Oe))}),dt=Math.min(at,dt),w._titleScoot=Math.abs(dt)}if(dt>0||at<0){var or={left:[-dt,0],right:[dt,0],top:[0,-dt],bottom:[0,dt]}[b.side];mr.attr("transform",t(or[0],or[1]))}}}ce.call(Ke,ze);function Bt(pr,Or){pr.text(Or).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if($e&&(L?ce.on(".opacity",null):(Bt(ce,M),z=!0),ce.call(a.makeEditable,{gd:p}).on("edit",function(pr){y!==void 0?E.call("_guiRestyle",p,S,pr,y):E.call("_guiRelayout",p,S,pr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Ke)}).on("input",function(pr){this.text(pr||" ").call(a.positionText,v.x,v.y)}),q)){if(q&&!L){var jt=ce.node().getBBox(),_r=jt.y+jt.height+c*re;ze.attr("y",_r)}X?ze.on(".opacity",null):(Bt(ze,$),oe=!0),ze.call(a.makeEditable,{gd:p}).on("edit",function(pr){E.call("_guiRelayout",p,"title.subtitle.text",pr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Ke)}).on("input",function(pr){this.text(pr||" ").call(a.positionText,ze.attr("x"),ze.attr("y"))})}return ce.classed("js-placeholder",z),ze&&!ze.empty()&&ze.classed("js-placeholder",oe),g}V.exports={draw:m,SUBTITLE_PADDING_EM:c,SUBTITLE_PADDING_MATHJAX_EM:h}}}),Mv=We({"src/plots/cartesian/set_convert.js"(Z,V){"use strict";var d=Hi(),x=b0().utcFormat,A=aa(),E=A.numberFormat,e=Uo(),t=A.cleanNumber,r=A.ms2DateTime,o=A.dateTime2ms,a=A.ensureNumber,i=A.isArrayOrTypedArray,n=bs(),s=n.FP_SAFE,h=n.BADNUM,c=n.LOG_CLIP,m=n.ONEWEEK,p=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,_=n.ONESEC,w=cc(),S=Sf(),M=S.HOUR_PATTERN,y=S.WEEKDAY_PATTERN;function b(u){return Math.pow(10,u)}function v(u){return u!=null}V.exports=function(g,f){f=f||{};var P=g._id||"x",L=P.charAt(0);function z(X,oe){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&oe&&g.range&&g.range.length===2){var ne=g.range[0],j=g.range[1];return .5*(ne+j-2*c*Math.abs(ne-j))}else return h}function F(X,oe,ne,j){if((j||{}).msUTC&&e(X))return+X;var ee=o(X,ne||g.calendar);if(ee===h)if(e(X)){X=+X;var re=Math.floor(A.mod(X+.05,1)*10),ue=Math.round(X-re/10);ee=o(new Date(ue))+re/10}else return h;return ee}function B(X,oe,ne){return r(X,oe,ne||g.calendar)}function O(X){return g._categories[Math.round(X)]}function I(X){if(v(X)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[X]!==void 0)return g._categoriesMap[X];g._categories.push(typeof X=="number"?String(X):X);var oe=g._categories.length-1;return g._categoriesMap[X]=oe,oe}return h}function N(X,oe){for(var ne=new Array(oe),j=0;jg.range[1]&&(ne=!ne);for(var j=ne?-1:1,ee=j*X,re=0,ue=0;ueTe)re=ue+1;else{re=ee<(_e+Te)/2?ue:ue+1;break}}var Ie=g._B[re]||0;return isFinite(Ie)?le(X,g._m2,Ie):0},q=function(X){var oe=g._rangebreaks.length;if(!oe)return se(X,g._m,g._b);for(var ne=0,j=0;jg._rangebreaks[j].pmax&&(ne=j+1);return se(X,g._m2,g._B[ne])}}g.c2l=g.type==="log"?z:a,g.l2c=g.type==="log"?b:a,g.l2p=he,g.p2l=q,g.c2p=g.type==="log"?function(X,oe){return he(z(X,oe))}:he,g.p2c=g.type==="log"?function(X){return b(q(X))}:q,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=t,g.c2d=g.c2r=g.l2d=g.l2r=a,g.d2p=g.r2p=function(X){return g.l2p(t(X))},g.p2d=g.p2r=q,g.cleanPos=a):g.type==="log"?(g.d2r=g.d2l=function(X,oe){return z(t(X),oe)},g.r2d=g.r2c=function(X){return b(t(X))},g.d2c=g.r2l=t,g.c2d=g.l2r=a,g.c2r=z,g.l2d=b,g.d2p=function(X,oe){return g.l2p(g.d2r(X,oe))},g.p2d=function(X){return b(q(X))},g.r2p=function(X){return g.l2p(t(X))},g.p2r=q,g.cleanPos=a):g.type==="date"?(g.d2r=g.r2d=A.identity,g.d2c=g.r2c=g.d2l=g.r2l=F,g.c2d=g.c2r=g.l2d=g.l2r=B,g.d2p=g.r2p=function(X,oe,ne){return g.l2p(F(X,0,ne))},g.p2d=g.p2r=function(X,oe,ne){return B(q(X),oe,ne)},g.cleanPos=function(X){return A.cleanDate(X,h,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=I,g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=W,g.r2c=function(X){var oe=Q(X);return oe!==void 0?oe:g.fraction2r(.5)},g.l2r=g.c2r=a,g.r2l=Q,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(q(X))},g.r2p=g.d2p,g.p2r=q,g.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=W,g.r2c=function(X){var oe=W(X);return oe!==void 0?oe:g.fraction2r(.5)},g.r2c_just_indices=U,g.l2r=g.c2r=a,g.r2l=W,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(q(X))},g.r2p=g.d2p,g.p2r=q,g.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},g.setupMultiCategory=function(X){var oe=g._traceIndices,ne,j,ee=g._matchGroup;if(ee&&g._categories.length===0){for(var re in ee)if(re!==P){var ue=f[w.id2name(re)];oe=oe.concat(ue._traceIndices)}}var _e=[[0,{}],[0,{}]],Te=[];for(ne=0;neue[1]&&(j[re?0:1]=ne),j[0]===j[1]){var _e=g.l2r(oe),Te=g.l2r(ne);if(oe!==void 0){var Ie=_e+1;ne!==void 0&&(Ie=Math.min(Ie,Te)),j[re?1:0]=Ie}if(ne!==void 0){var De=Te+1;oe!==void 0&&(De=Math.max(De,_e)),j[re?0:1]=De}}}},g.cleanRange=function(X,oe){g._cleanRange(X,oe),g.limitRange(X)},g._cleanRange=function(X,oe){oe||(oe={}),X||(X="range");var ne=A.nestedProperty(g,X).get(),j,ee;if(g.type==="date"?ee=A.dfltRange(g.calendar):L==="y"?ee=S.DFLTRANGEY:g._name==="realaxis"?ee=[0,1]:ee=oe.dfltRange||S.DFLTRANGEX,ee=ee.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(ee[0]=0),!ne||ne.length!==2){A.nestedProperty(g,X).set(ee);return}var re=ne[0]===null,ue=ne[1]===null;for(g.type==="date"&&!g.autorange&&(ne[0]=A.cleanDate(ne[0],h,g.calendar),ne[1]=A.cleanDate(ne[1],h,g.calendar)),j=0;j<2;j++)if(g.type==="date"){if(!A.isDateTime(ne[j],g.calendar)){g[X]=ee;break}if(g.r2l(ne[0])===g.r2l(ne[1])){var _e=A.constrain(g.r2l(ne[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ne[0]=g.l2r(_e-1e3),ne[1]=g.l2r(_e+1e3);break}}else{if(!e(ne[j]))if(!(re||ue)&&e(ne[1-j]))ne[j]=ne[1-j]*(j?10:.1);else{g[X]=ee;break}if(ne[j]<-s?ne[j]=-s:ne[j]>s&&(ne[j]=s),ne[0]===ne[1]){var Te=Math.max(1,Math.abs(ne[0]*1e-6));ne[0]-=Te,ne[1]+=Te}}},g.setScale=function(X){var oe=f._size;if(g.overlaying){var ne=w.getFromId({_fullLayout:f},g.overlaying);g.domain=ne.domain}var j=X&&g._r?"_r":"range",ee=g.calendar;g.cleanRange(j);var re=g.r2l(g[j][0],ee),ue=g.r2l(g[j][1],ee),_e=L==="y";if(_e?(g._offset=oe.t+(1-g.domain[1])*oe.h,g._length=oe.h*(g.domain[1]-g.domain[0]),g._m=g._length/(re-ue),g._b=-g._m*ue):(g._offset=oe.l+g.domain[0]*oe.w,g._length=oe.w*(g.domain[1]-g.domain[0]),g._m=g._length/(ue-re),g._b=-g._m*re),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Te,Ie;if(g._rangebreaks=g.locateBreaks(Math.min(re,ue),Math.max(re,ue)),g._rangebreaks.length){for(Te=0;Teue&&(De=!De),De&&g._rangebreaks.reverse();var He=De?-1:1;for(g._m2=He*g._length/(Math.abs(ue-re)-g._lBreaks),g._B.push(-g._m2*(_e?ue:re)),Te=0;Teee&&(ee+=7,reee&&(ee+=24,re=j&&re=j&&X=Ke.min&&(ceKe.max&&(Ke.max=ze),Qe=!1)}Qe&&ue.push({min:ce,max:ze})}};for(ne=0;ne<_e.length;ne++){var Ie=_e[ne];if(Ie.enabled)if(Ie.bounds){var De=X,He=oe;Ie.pattern&&(De=Math.floor(De)),j=A.simpleMap(Ie.bounds,Ie.pattern?t:g.r2l),ee=j[0],re=j[1];var et=new Date(De),rt,$e;switch(Ie.pattern){case y:$e=m,rt=((re_*2}function n(c){return Math.max(1,(c-1)/1e3)}function s(c,m){for(var p=c.length,T=n(p),l=0,_=0,w={},S=0;Sl*2}function h(c){return E(c[0])&&E(c[1])}}}),ov=We({"src/plots/cartesian/autorange.js"(Z,V){"use strict";var d=Hi(),x=Uo(),A=aa(),E=bs().FP_SAFE,e=Wi(),t=Oo(),r=cc(),o=r.getFromId,a=r.isLinked;V.exports={applyAutorangeOptions:g,getAutoRange:i,makePadFn:s,doAutoRange:p,findExtremes:T,concatExtremes:m};function i(f,P){var L,z,F=[],B=f._fullLayout,O=s(B,P,0),I=s(B,P,1),N=m(f,P),U=N.min,W=N.max;if(U.length===0||W.length===0)return A.simpleMap(P.range,P.r2l);var Q=U[0].val,le=W[0].val;for(L=1;L0&&(Te=oe-O(ee)-I(re),Te>ne?Ie/Te>j&&(ue=ee,_e=re,j=Ie/Te):Ie/oe>j&&(ue={val:ee.val,nopad:1},_e={val:re.val,nopad:1},j=Ie/oe));function De(ot,Ae){return Math.max(ot,I(Ae))}if(Q===le){var He=Q-1,et=Q+1;if(J)if(Q===0)F=[0,1];else{var rt=(Q>0?W:U).reduce(De,0),$e=Q/(1-Math.min(.5,rt/oe));F=Q>0?[0,$e]:[$e,0]}else X?F=[Math.max(0,He),Math.max(1,et)]:F=[He,et]}else J?(ue.val>=0&&(ue={val:0,nopad:1}),_e.val<=0&&(_e={val:0,nopad:1})):X&&(ue.val-j*O(ue)<0&&(ue={val:0,nopad:1}),_e.val<=0&&(_e={val:1,nopad:1})),j=(_e.val-ue.val-n(P,ee.val,re.val))/(oe-O(ue)-I(_e)),F=[ue.val-j*O(ue),_e.val+j*I(_e)];return F=g(F,P),P.limitRange&&P.limitRange(),he&&F.reverse(),A.simpleMap(F,P.l2r||Number)}function n(f,P,L){var z=0;if(f.rangebreaks)for(var F=f.locateBreaks(P,L),B=0;B0?L.ppadplus:L.ppadminus)||L.ppad||0),ee=ne((f._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),re=ne(L.vpadplus||L.vpad),ue=ne(L.vpadminus||L.vpad);if(!U){if(X=1/0,oe=-1/0,N)for(Q=0;Q0&&(X=le),le>oe&&le-E&&(X=le),le>oe&&le=Ie;Q--)Te(Q);return{min:z,max:F,opts:L}}function l(f,P,L,z){w(f,P,L,z,M)}function _(f,P,L,z){w(f,P,L,z,y)}function w(f,P,L,z,F){for(var B=z.tozero,O=z.extrapad,I=!0,N=0;N=L&&(U.extrapad||!O)){I=!1;break}else F(P,U.val)&&U.pad<=L&&(O||!U.extrapad)&&(f.splice(N,1),N--)}if(I){var W=B&&P===0;f.push({val:P,pad:W?0:L,extrapad:W?!1:O})}}function S(f){return x(f)&&Math.abs(f)=P}function b(f,P){var L=P.autorangeoptions;return L&&L.minallowed!==void 0&&u(P,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(P,L.clipmin,L.clipmax)?Math.max(f,P.d2l(L.clipmin)):f}function v(f,P){var L=P.autorangeoptions;return L&&L.maxallowed!==void 0&&u(P,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(P,L.clipmin,L.clipmax)?Math.min(f,P.d2l(L.clipmax)):f}function u(f,P,L){return P!==void 0&&L!==void 0?(P=f.d2l(P),L=f.d2l(L),P=N&&(B=N,L=N),O<=N&&(O=N,z=N)}}return L=b(L,P),z=v(z,P),[L,z]}}}),Mo=We({"src/plots/cartesian/axes.js"(Z,V){"use strict";var d=Hi(),x=Uo(),A=Nu(),E=Wi(),e=aa(),t=e.strTranslate,r=zl(),o=xp(),a=Fi(),i=Oo(),n=Of(),s=sb(),h=bs(),c=h.ONEMAXYEAR,m=h.ONEAVGYEAR,p=h.ONEMINYEAR,T=h.ONEMAXQUARTER,l=h.ONEAVGQUARTER,_=h.ONEMINQUARTER,w=h.ONEMAXMONTH,S=h.ONEAVGMONTH,M=h.ONEMINMONTH,y=h.ONEWEEK,b=h.ONEDAY,v=b/2,u=h.ONEHOUR,g=h.ONEMIN,f=h.ONESEC,P=h.ONEMILLI,L=h.ONEMICROSEC,z=h.MINUS_SIGN,F=h.BADNUM,B={K:"zeroline"},O={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},W={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},Q=gf(),le=Q.MID_SHIFT,se=Q.CAP_SHIFT,he=Q.LINE_SPACING,q=Q.OPPOSITE_SIDE,$=3,J=V.exports={};J.setConvert=Mv();var X=L0(),oe=cc(),ne=oe.idSort,j=oe.isLinked;J.id2name=oe.id2name,J.name2id=oe.name2id,J.cleanId=oe.cleanId,J.list=oe.list,J.listIds=oe.listIds,J.getFromId=oe.getFromId,J.getFromTrace=oe.getFromTrace;var ee=ov();J.getAutoRange=ee.getAutoRange,J.findExtremes=ee.findExtremes;var re=1e-4;function ue(St){var lt=(St[1]-St[0])*re;return[St[0]-lt,St[1]+lt]}J.coerceRef=function(St,lt,br,kr,Lr,Tr){var Cr=kr.charAt(kr.length-1),Kr=br._fullLayout._subplots[Cr+"axis"],Nr=kr+"ref",_t={};return Lr||(Lr=Kr[0]||(typeof Tr=="string"?Tr:Tr[0])),Tr||(Tr=Lr),Kr=Kr.concat(Kr.map(function(Wt){return Wt+" domain"})),_t[Nr]={valType:"enumerated",values:Kr.concat(Tr?typeof Tr=="string"?[Tr]:Tr:[]),dflt:Lr},e.coerce(St,lt,_t,Nr)},J.getRefType=function(St){return St===void 0?St:St==="paper"?"paper":St==="pixel"?"pixel":/( domain)$/.test(St)?"domain":"range"},J.coercePosition=function(St,lt,br,kr,Lr,Tr){var Cr,Kr,Nr=J.getRefType(kr);if(Nr!=="range")Cr=e.ensureNumber,Kr=br(Lr,Tr);else{var _t=J.getFromId(lt,kr);Tr=_t.fraction2r(Tr),Kr=br(Lr,Tr),Cr=_t.cleanPos}St[Lr]=Cr(Kr)},J.cleanPosition=function(St,lt,br){var kr=br==="paper"||br==="pixel"?e.ensureNumber:J.getFromId(lt,br).cleanPos;return kr(St)},J.redrawComponents=function(St,lt){lt=lt||J.listIds(St);var br=St._fullLayout;function kr(Lr,Tr,Cr,Kr){for(var Nr=E.getComponentMethod(Lr,Tr),_t={},Wt=0;Wt2e-6||((br-St._forceTick0)/St._minDtick%1+1.000001)%1>2e-6)&&(St._minDtick=0))},J.saveRangeInitial=function(St,lt){for(var br=J.list(St,"",!0),kr=!1,Lr=0;LrAr*.3||_t(kr)||_t(Lr))){var Vr=br.dtick/2;St+=St+VrCr){var Kr=Number(br.slice(1));Tr.exactYears>Cr&&Kr%12===0?St=J.tickIncrement(St,"M6","reverse")+b*1.5:Tr.exactMonths>Cr?St=J.tickIncrement(St,"M1","reverse")+b*15.5:St-=v;var Nr=J.tickIncrement(St,br);if(Nr<=kr)return Nr}return St}J.prepMinorTicks=function(St,lt,br){if(!lt.minor.dtick){delete St.dtick;var kr=lt.dtick&&x(lt._tmin),Lr;if(kr){var Tr=J.tickIncrement(lt._tmin,lt.dtick,!0);Lr=[lt._tmin,Tr*.99+lt._tmin*.01]}else{var Cr=e.simpleMap(lt.range,lt.r2l);Lr=[Cr[0],.8*Cr[0]+.2*Cr[1]]}if(St.range=e.simpleMap(Lr,lt.l2r),St._isMinor=!0,J.prepTicks(St,br),kr){var Kr=x(lt.dtick),Nr=x(St.dtick),_t=Kr?lt.dtick:+lt.dtick.substring(1),Wt=Nr?St.dtick:+St.dtick.substring(1);Kr&&Nr?et(_t,Wt)?_t===2*y&&Wt===2*b&&(St.dtick=y):_t===2*y&&Wt===3*b?St.dtick=y:_t===y&&!(lt._input.minor||{}).nticks?St.dtick=b:rt(_t/Wt,2.5)?St.dtick=_t/2:St.dtick=_t:String(lt.dtick).charAt(0)==="M"?Nr?St.dtick="M1":et(_t,Wt)?_t>=12&&Wt===2&&(St.dtick="M3"):St.dtick=lt.dtick:String(St.dtick).charAt(0)==="L"?String(lt.dtick).charAt(0)==="L"?et(_t,Wt)||(St.dtick=rt(_t/Wt,2.5)?lt.dtick/2:lt.dtick):St.dtick="D1":St.dtick==="D2"&&+lt.dtick>1&&(St.dtick=1)}St.range=lt.range}lt.minor._tick0Init===void 0&&(St.tick0=lt.tick0)};function et(St,lt){return Math.abs((St/lt+.5)%1-.5)<.001}function rt(St,lt){return Math.abs(St/lt-1)<.001}J.prepTicks=function(St,lt){var br=e.simpleMap(St.range,St.r2l,void 0,void 0,lt);if(St.tickmode==="auto"||!St.dtick){var kr=St.nticks,Lr;kr||(St.type==="category"||St.type==="multicategory"?(Lr=St.tickfont?e.bigFont(St.tickfont.size||12):15,kr=St._length/Lr):(Lr=St._id.charAt(0)==="y"?40:80,kr=e.constrain(St._length/Lr,4,9)+1),St._name==="radialaxis"&&(kr*=2)),St.minor&&St.minor.tickmode!=="array"||St.tickmode==="array"&&(kr*=100),St._roughDTick=Math.abs(br[1]-br[0])/kr,J.autoTicks(St,St._roughDTick),St._minDtick>0&&St.dtick0?(Tr=kr-1,Cr=kr):(Tr=kr,Cr=kr);var Kr=St[Tr].value,Nr=St[Cr].value,_t=Math.abs(Nr-Kr),Wt=br||_t,Ar=0;Wt>=p?_t>=p&&_t<=c?Ar=_t:Ar=m:br===l&&Wt>=_?_t>=_&&_t<=T?Ar=_t:Ar=l:Wt>=M?_t>=M&&_t<=w?Ar=_t:Ar=S:br===y&&Wt>=y?Ar=y:Wt>=b?Ar=b:br===v&&Wt>=v?Ar=v:br===u&&Wt>=u&&(Ar=u);var Vr;Ar>=_t&&(Ar=_t,Vr=!0);var ma=Lr+Ar;if(lt.rangebreaks&&Ar>0){for(var ba=84,wa=0,$r=0;$ry&&(Ar=_t)}(Ar>0||kr===0)&&(St[kr].periodX=Lr+Ar/2)}}J.calcTicks=function(lt,br){for(var kr=lt.type,Lr=lt.calendar,Tr=lt.ticklabelstep,Cr=lt.ticklabelmode==="period",Kr=lt.range[0]>lt.range[1],Nr=!lt.ticklabelindex||e.isArrayOrTypedArray(lt.ticklabelindex)?lt.ticklabelindex:[lt.ticklabelindex],_t=e.simpleMap(lt.range,lt.r2l,void 0,void 0,br),Wt=_t[1]<_t[0],Ar=Math.min(_t[0],_t[1]),Vr=Math.max(_t[0],_t[1]),ma=Math.max(1e3,lt._length||0),ba=[],wa=[],$r=[],ga=[],jn=[],an=lt.minor&&(lt.minor.ticks||lt.minor.showgrid),ei=1;ei>=(an?0:1);ei--){var li=!ei;ei?(lt._dtickInit=lt.dtick,lt._tick0Init=lt.tick0):(lt.minor._dtickInit=lt.minor.dtick,lt.minor._tick0Init=lt.minor.tick0);var _i=ei?lt:e.extendFlat({},lt,lt.minor);if(li?J.prepMinorTicks(_i,lt,br):J.prepTicks(_i,br),_i.tickmode==="array"){ei?($r=[],ba=ze(lt,!li)):(ga=[],wa=ze(lt,!li));continue}if(_i.tickmode==="sync"){$r=[],ba=ce(lt);continue}var xi=ue(_t),Pi=xi[0],Li=xi[1],ri=x(_i.dtick),vo=kr==="log"&&!(ri||_i.dtick.charAt(0)==="L"),Eo=J.tickFirst(_i,br);if(ei){if(lt._tmin=Eo,Eo=Li:ao<=Li;ao=J.tickIncrement(ao,Go,Wt,Lr)){if(ei&&mo++,_i.rangebreaks&&!Wt){if(ao=Vr)break}if($r.length>ma||ao===uo)break;uo=ao;var Ko={value:ao};ei?(vo&&ao!==(ao|0)&&(Ko.simpleLabel=!0),Tr>1&&mo%Tr&&(Ko.skipLabel=!0),$r.push(Ko)):(Ko.minor=!0,ga.push(Ko))}}if(!ga||ga.length<2)Nr=!1;else{var Qi=(ga[1].value-ga[0].value)*(Kr?-1:1);Kn(Qi,lt.tickformat)||(Nr=!1)}if(!Nr)jn=$r;else{var eo=$r.concat(ga);Cr&&$r.length&&(eo=eo.slice(1)),eo=eo.sort(function(Ni,Ns){return Ni.value-Ns.value}).filter(function(Ni,Ns,Ks){return Ns===0||Ni.value!==Ks[Ns-1].value});var Ei=eo.map(function(Ni,Ns){return Ni.minor===void 0&&!Ni.skipLabel?Ns:null}).filter(function(Ni){return Ni!==null});Ei.forEach(function(Ni){Nr.map(function(Ns){var Ks=Ni+Ns;Ks>=0&&Ks-1;Io--){if($r[Io].drop){$r.splice(Io,1);continue}$r[Io].value=ja($r[Io].value,lt);var fs=lt.c2p($r[Io].value);(Zi?rs>fs-ys:rsVr||joVr&&(Ks.periodX=Vr),joLr&&Vrm)lt/=m,kr=Lr(10),St.dtick="M"+12*_r(lt,kr,Qe);else if(Tr>S)lt/=S,St.dtick="M"+_r(lt,1,nt);else if(Tr>b){if(St.dtick=_r(lt,b,St._hasDayOfWeekBreaks?[1,2,7,14]:kt),!br){var Cr=J.getTickFormat(St),Kr=St.ticklabelmode==="period";Kr&&(St._rawTick0=St.tick0),/%[uVW]/.test(Cr)?St.tick0=e.dateTick0(St.calendar,2):St.tick0=e.dateTick0(St.calendar,1),Kr&&(St._dowTick0=St.tick0)}}else Tr>u?St.dtick=_r(lt,u,nt):Tr>g?St.dtick=_r(lt,g,Ke):Tr>f?St.dtick=_r(lt,f,Ke):(kr=Lr(10),St.dtick=_r(lt,kr,Qe))}else if(St.type==="log"){St.tick0=0;var Nr=e.simpleMap(St.range,St.r2l);if(St._isMinor&&(lt*=1.5),lt>.7)St.dtick=Math.ceil(lt);else if(Math.abs(Nr[1]-Nr[0])<1){var _t=1.5*Math.abs((Nr[1]-Nr[0])/lt);lt=Math.abs(Math.pow(10,Nr[1])-Math.pow(10,Nr[0]))/_t,kr=Lr(10),St.dtick="L"+_r(lt,kr,Qe)}else St.dtick=lt>.3?"D2":"D1"}else St.type==="category"||St.type==="multicategory"?(St.tick0=0,St.dtick=Math.ceil(Math.max(lt,1))):Ga(St)?(St.tick0=0,kr=1,St.dtick=_r(lt,kr,jt)):(St.tick0=0,kr=Lr(10),St.dtick=_r(lt,kr,Qe));if(St.dtick===0&&(St.dtick=1),!x(St.dtick)&&typeof St.dtick!="string"){var Wt=St.dtick;throw St.dtick=1,"ax.dtick error: "+String(Wt)}};function pr(St){var lt=St.dtick;if(St._tickexponent=0,!x(lt)&&typeof lt!="string"&&(lt=1),(St.type==="category"||St.type==="multicategory")&&(St._tickround=null),St.type==="date"){var br=St.r2l(St.tick0),kr=St.l2r(br).replace(/(^-|i)/g,""),Lr=kr.length;if(String(lt).charAt(0)==="M")Lr>10||kr.slice(5)!=="01-01"?St._tickround="d":St._tickround=+lt.slice(1)%12===0?"y":"m";else if(lt>=b&&Lr<=10||lt>=b*15)St._tickround="d";else if(lt>=g&&Lr<=16||lt>=u)St._tickround="M";else if(lt>=f&&Lr<=19||lt>=g)St._tickround="S";else{var Tr=St.l2r(br+lt).replace(/^-/,"").length;St._tickround=Math.max(Lr,Tr)-20,St._tickround<0&&(St._tickround=4)}}else if(x(lt)||lt.charAt(0)==="L"){var Cr=St.range.map(St.r2d||Number);x(lt)||(lt=Number(lt.slice(1))),St._tickround=2-Math.floor(Math.log(lt)/Math.LN10+.01);var Kr=Math.max(Math.abs(Cr[0]),Math.abs(Cr[1])),Nr=Math.floor(Math.log(Kr)/Math.LN10+.01),_t=St.minexponent===void 0?3:St.minexponent;Math.abs(Nr)>_t&&(Se(St.exponentformat)&&St.exponentformat!=="SI extended"&&!Le(Nr)||Se(St.exponentformat)&&St.exponentformat==="SI extended"&&!at(Nr)?St._tickexponent=3*Math.round((Nr-1)/3):St._tickexponent=Nr)}else St._tickround=null}J.tickIncrement=function(St,lt,br,kr){var Lr=br?-1:1;if(x(lt))return e.increment(St,Lr*lt);var Tr=lt.charAt(0),Cr=Lr*Number(lt.slice(1));if(Tr==="M")return e.incrementMonth(St,Cr,kr);if(Tr==="L")return Math.log(Math.pow(10,St)+Cr)/Math.LN10;if(Tr==="D"){var Kr=lt==="D2"?Bt:Et,Nr=St+Lr*.01,_t=e.roundUp(e.mod(Nr,1),Kr,br);return Math.floor(Nr)+Math.log(d.round(Math.pow(10,_t),1))/Math.LN10}throw"unrecognized dtick "+String(lt)},J.tickFirst=function(St,lt){var br=St.r2l||Number,kr=e.simpleMap(St.range,br,void 0,void 0,lt),Lr=kr[1]=0&&ga<=St._length?$r:null};if(Tr&&e.isArrayOrTypedArray(St.ticktext)){var Ar=e.simpleMap(St.range,St.r2l),Vr=(Math.abs(Ar[1]-Ar[0])-(St._lBreaks||0))/1e4;for(_t=0;_t"+Kr;else{var _t=Xa(St),Wt=St._trueSide||St.side;(!_t&&Wt==="top"||_t&&Wt==="bottom")&&(Cr+="
")}lt.text=Cr}function Er(St,lt,br,kr,Lr){var Tr=St.dtick,Cr=lt.x,Kr=St.tickformat,Nr=typeof Tr=="string"&&Tr.charAt(0);if(Lr==="never"&&(Lr=""),kr&&Nr!=="L"&&(Tr="L3",Nr="L"),Kr||Nr==="L")lt.text=gt(Math.pow(10,Cr),St,Lr,kr);else if(x(Tr)||Nr==="D"&&(St.minorloglabels==="complete"||e.mod(Cr+.01,1)<.1)){var _t;St.minorloglabels==="complete"&&!(e.mod(Cr+.01,1)<.1)&&(_t=!0,lt.fontSize*=.75);var Wt=Math.pow(10,Cr).toExponential(0),Ar=Wt.split("e"),Vr=+Ar[1],ma=Math.abs(Vr),ba=St.exponentformat;ba==="power"||Se(ba)&&ba!=="SI extended"&&Le(Vr)||Se(ba)&&ba==="SI extended"&&at(Vr)?(lt.text=Ar[0],ma>0&&(lt.text+="x10"),lt.text==="1x10"&&(lt.text="10"),Vr!==0&&Vr!==1&&(lt.text+=""+(Vr>0?"":z)+ma+""),lt.fontSize*=1.25):(ba==="e"||ba==="E")&&ma>2?lt.text=Ar[0]+ba+(Vr>0?"+":z)+ma:(lt.text=gt(Math.pow(10,Cr),St,"","fakehover"),Tr==="D1"&&St._id.charAt(0)==="y"&&(lt.dy-=lt.fontSize/6))}else if(Nr==="D")lt.text=St.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Cr,1)))),lt.fontSize*=.75;else throw"unrecognized dtick "+String(Tr);if(St.dtick==="D1"){var wa=String(lt.text).charAt(0);(wa==="0"||wa==="1")&&(St._id.charAt(0)==="y"?lt.dx-=lt.fontSize/4:(lt.dy+=lt.fontSize/2,lt.dx+=(St.range[1]>St.range[0]?1:-1)*lt.fontSize*(Cr<0?.5:.25)))}}function yt(St,lt){var br=St._categories[Math.round(lt.x)];br===void 0&&(br=""),lt.text=String(br)}function Oe(St,lt,br){var kr=Math.round(lt.x),Lr=St._categories[kr]||[],Tr=Lr[1]===void 0?"":String(Lr[1]),Cr=Lr[0]===void 0?"":String(Lr[0]);br?lt.text=Cr+" - "+Tr:(lt.text=Tr,lt.text2=Cr)}function Xe(St,lt,br,kr,Lr){Lr==="never"?Lr="":St.showexponent==="all"&&Math.abs(lt.x/St.dtick)<1e-6&&(Lr="hide"),lt.text=gt(lt.x,St,Lr,kr)}function be(St,lt,br,kr,Lr){if(St.thetaunit==="radians"&&!br){var Tr=lt.x/180;if(Tr===0)lt.text="0";else{var Cr=Ce(Tr);if(Cr[1]>=100)lt.text=gt(e.deg2rad(lt.x),St,Lr,kr);else{var Kr=lt.x<0;Cr[1]===1?Cr[0]===1?lt.text="\u03C0":lt.text=Cr[0]+"\u03C0":lt.text=["",Cr[0],"","\u2044","",Cr[1],"","\u03C0"].join(""),Kr&&(lt.text=z+lt.text)}}}else lt.text=gt(lt.x,St,Lr,kr)}function Ce(St){function lt(Kr,Nr){return Math.abs(Kr-Nr)<=1e-6}function br(Kr,Nr){return lt(Nr,0)?Kr:br(Nr,Kr%Nr)}function kr(Kr){for(var Nr=1;!lt(Math.round(Kr*Nr)/Nr,Kr);)Nr*=10;return Nr}var Lr=kr(St),Tr=St*Lr,Cr=Math.abs(br(Tr,Lr));return[Math.round(Tr/Cr),Math.round(Lr/Cr)]}var Ne=["f","p","n","\u03BC","m","","k","M","G","T"],Ee=["q","r","y","z","a",...Ne,"P","E","Z","Y","R","Q"],Se=St=>["SI","SI extended","B"].includes(St);function Le(St){return St>14||St<-15}function at(St){return St>32||St<-30}function dt(St,lt){return Se(lt)?!!(lt==="SI extended"&&at(St)||lt!=="SI extended"&&Le(St)):!1}function gt(St,lt,br,kr){var Lr=St<0,Tr=lt._tickround,Cr=br||lt.exponentformat||"B",Kr=lt._tickexponent,Nr=J.getTickFormat(lt),_t=lt.separatethousands;if(kr){var Wt={exponentformat:Cr,minexponent:lt.minexponent,dtick:lt.showexponent==="none"?lt.dtick:x(St)&&Math.abs(St)||1,range:lt.showexponent==="none"?lt.range.map(lt.r2d):[0,St||1]};pr(Wt),Tr=(Number(Wt._tickround)||0)+4,Kr=Wt._tickexponent,lt.hoverformat&&(Nr=lt.hoverformat)}if(Nr)return lt._numFormat(Nr)(St).replace(/-/g,z);var Ar=Math.pow(10,-Tr)/2;if(Cr==="none"&&(Kr=0),St=Math.abs(St),St"+ba+"":Cr==="B"&&Kr===9?St+="B":Se(Cr)&&(St+=Cr==="SI extended"?Ee[Kr/3+10]:Ne[Kr/3+5])}return Lr?z+St:St}J.getTickFormat=function(St){var lt;function br(Nr){return typeof Nr!="string"?Nr:Number(Nr.replace("M",""))*S}function kr(Nr,_t){var Wt=["L","D"];if(typeof Nr==typeof _t){if(typeof Nr=="number")return Nr-_t;var Ar=Wt.indexOf(Nr.charAt(0)),Vr=Wt.indexOf(_t.charAt(0));return Ar===Vr?Number(Nr.replace(/(L|D)/g,""))-Number(_t.replace(/(L|D)/g,"")):Ar-Vr}else return typeof Nr=="number"?1:-1}function Lr(Nr,_t,Wt){var Ar=Wt||function(ba){return ba},Vr=_t[0],ma=_t[1];return(!Vr&&typeof Vr!="number"||Ar(Vr)<=Ar(Nr))&&(!ma&&typeof ma!="number"||Ar(ma)>=Ar(Nr))}function Tr(Nr,_t){var Wt=_t[0]===null,Ar=_t[1]===null,Vr=kr(Nr,_t[0])>=0,ma=kr(Nr,_t[1])<=0;return(Wt||Vr)&&(Ar||ma)}var Cr,Kr;if(St.tickformatstops&&St.tickformatstops.length>0)switch(St.type){case"date":case"linear":{for(lt=0;lt=0&&Lr.unshift(Lr.splice(Wt,1).shift())}});var Kr={false:{left:0,right:0}};return e.syncOrAsync(Lr.map(function(Nr){return function(){if(Nr){var _t=J.getFromId(St,Nr);br||(br={}),br.axShifts=Kr,br.overlayingShiftedAx=Cr;var Wt=J.drawOne(St,_t,br);return _t._shiftPusher&&Ma(_t,_t._fullDepth||0,Kr,!0),_t._r=_t.range.slice(),_t._rl=e.simpleMap(_t._r,_t.r2l),Wt}}}))},J.drawOne=function(St,lt,br){br=br||{};var kr=br.axShifts||{},Lr=br.overlayingShiftedAx||[],Tr,Cr,Kr;lt.setScale();var Nr=St._fullLayout,_t=lt._id,Wt=_t.charAt(0),Ar=J.counterLetter(_t),Vr=Nr._plots[lt._mainSubplot],ma=lt.zerolinelayer==="above traces";if(!Vr)return;if(lt._shiftPusher=lt.autoshift||Lr.indexOf(lt._id)!==-1||Lr.indexOf(lt.overlaying)!==-1,lt._shiftPusher<.anchor==="free"){var ba=lt.linewidth/2||0;lt.ticks==="inside"&&(ba+=lt.ticklen),Ma(lt,ba,kr,!0),Ma(lt,lt.shift||0,kr,!1)}(br.skipTitle!==!0||lt._shift===void 0)&&(lt._shift=Xn(lt,kr));var wa=Vr[Wt+"axislayer"],$r=lt._mainLinePosition,ga=$r+=lt._shift,jn=lt._mainMirrorPosition,an=lt._vals=J.calcTicks(lt),ei=[lt.mirror,ga,jn].join("_");for(Tr=0;Tr0?jo.bottom-Ns:0,Ks))));var ll=0,ql=0;if(lt._shiftPusher&&(ll=Math.max(Ks,jo.height>0?Es==="l"?Ns-jo.left:jo.right-Ns:0),lt.title.text!==Nr._dfltTitle[Wt]&&(ql=(lt._titleStandoff||0)+(lt._titleScoot||0),Es==="l"&&(ql+=Na(lt))),lt._fullDepth=Math.max(ll,ql)),lt.automargin){hs={x:0,y:0,r:0,l:0,t:0,b:0};var wu=[0,1],Yl=typeof lt._shift=="number"?lt._shift:0;if(Wt==="x"){if(Es==="b"?hs[Es]=lt._depth:(hs[Es]=lt._depth=Math.max(jo.width>0?Ns-jo.top:0,Ks),wu.reverse()),jo.width>0){var kc=jo.right-(lt._offset+lt._length);kc>0&&(hs.xr=1,hs.r=kc);var ec=lt._offset-jo.left;ec>0&&(hs.xl=0,hs.l=ec)}}else if(Es==="l"?(lt._depth=Math.max(jo.height>0?Ns-jo.left:0,Ks),hs[Es]=lt._depth-Yl):(lt._depth=Math.max(jo.height>0?jo.right-Ns:0,Ks),hs[Es]=lt._depth+Yl,wu.reverse()),jo.height>0){var vs=jo.bottom-(lt._offset+lt._length);vs>0&&(hs.yb=0,hs.b=vs);var Ru=lt._offset-jo.top;Ru>0&&(hs.yt=1,hs.t=Ru)}hs[Ar]=lt.anchor==="free"?lt.position:lt._anchorAxis.domain[wu[0]],lt.title.text!==Nr._dfltTitle[Wt]&&(hs[Es]+=Na(lt)+(lt.title.standoff||0)),lt.mirror&<.anchor!=="free"&&(ks={x:0,y:0,r:0,l:0,t:0,b:0},ks[Ni]=lt.linewidth,lt.mirror&<.mirror!==!0&&(ks[Ni]+=Ks),lt.mirror===!0||lt.mirror==="ticks"?ks[Ar]=lt._anchorAxis.domain[wu[1]]:(lt.mirror==="all"||lt.mirror==="allticks")&&(ks[Ar]=[lt._counterDomainMin,lt._counterDomainMax][wu[1]]))}js&&(xs=E.getComponentMethod("rangeslider","autoMarginOpts")(St,lt)),typeof lt.automargin=="string"&&(Ct(hs,lt.automargin),Ct(ks,lt.automargin)),A.autoMargin(St,Gt(lt),hs),A.autoMargin(St,Xt(lt),ks),A.autoMargin(St,Rr(lt),xs)}),e.syncOrAsync(oo)}};function Ct(St,lt){if(St){var br=Object.keys(W).reduce(function(kr,Lr){return lt.indexOf(Lr)!==-1&&W[Lr].forEach(function(Tr){kr[Tr]=1}),kr},{});Object.keys(St).forEach(function(kr){br[kr]||(kr.length===1?St[kr]=0:delete St[kr])})}}function or(St,lt){var br=[],kr,Lr=function(Tr,Cr){var Kr=Tr.xbnd[Cr];Kr!==null&&br.push(e.extendFlat({},Tr,{x:Kr}))};if(lt.length){for(kr=0;krSt.range[1],Kr=St.ticklabelposition&&St.ticklabelposition.indexOf("inside")!==-1,Nr=!Kr;if(br){var _t=Cr?-1:1;br=br*_t}if(kr){var Wt=St.side,Ar=Kr&&(Wt==="top"||Wt==="left")||Nr&&(Wt==="bottom"||Wt==="right")?1:-1;kr=kr*Ar}return St._id.charAt(0)==="x"?function(Vr){return t(Lr+St._offset+St.l2p(oa(Vr))+br,Tr+kr)}:function(Vr){return t(Tr+kr,Lr+St._offset+St.l2p(oa(Vr))+br)}};function oa(St){return St.periodX!==void 0?St.periodX:St.x}function Ea(St){var lt=St.ticklabelposition||"",br=St.tickson||"",kr=function(ba){return lt.indexOf(ba)!==-1},Lr=kr("top"),Tr=kr("left"),Cr=kr("right"),Kr=kr("bottom"),Nr=kr("inside"),_t=br!=="boundaries"&&(Kr||Tr||Lr||Cr);if(!_t&&!Nr)return[0,0];var Wt=St.side,Ar=_t?(St.tickwidth||0)/2:0,Vr=$,ma=St.tickfont?St.tickfont.size:12;return(Kr||Lr)&&(Ar+=ma*se,Vr+=(St.linewidth||0)/2),(Tr||Cr)&&(Ar+=(St.linewidth||0)/2,Vr+=$),Nr&&Wt==="top"&&(Vr-=ma*(1-se)),(Tr||Lr)&&(Ar=-Ar),(Wt==="bottom"||Wt==="right")&&(Vr=-Vr),[_t?Ar:0,Nr?Vr:0]}J.makeTickPath=function(St,lt,br,kr){kr||(kr={});var Lr=kr.minor;if(Lr&&!St.minor)return"";var Tr=kr.len!==void 0?kr.len:Lr?St.minor.ticklen:St.ticklen,Cr=St._id.charAt(0),Kr=(St.linewidth||1)/2;return Cr==="x"?"M0,"+(lt+Kr*br)+"v"+Tr*br:"M"+(lt+Kr*br)+",0h"+Tr*br},J.makeLabelFns=function(St,lt,br){var kr=St.ticklabelposition||"",Lr=St.tickson||"",Tr=function(uo){return kr.indexOf(uo)!==-1},Cr=Tr("top"),Kr=Tr("left"),Nr=Tr("right"),_t=Tr("bottom"),Wt=Lr!=="boundaries"&&(_t||Kr||Cr||Nr),Ar=Tr("inside"),Vr=kr==="inside"&&St.ticks==="inside"||!Ar&&St.ticks==="outside"&&Lr!=="boundaries",ma=0,ba=0,wa=Vr?St.ticklen:0;if(Ar?wa*=-1:Wt&&(wa=0),Vr&&(ma+=wa,br)){var $r=e.deg2rad(br);ma=wa*Math.cos($r)+1,ba=wa*Math.sin($r)}St.showticklabels&&(Vr||St.showline)&&(ma+=.2*St.tickfont.size),ma+=(St.linewidth||1)/2*(Ar?-1:1);var ga={labelStandoff:ma,labelShift:ba},jn,an,ei,li,_i=0,xi=St.side,Pi=St._id.charAt(0),Li=St.tickangle,ri;if(Pi==="x")ri=!Ar&&xi==="bottom"||Ar&&xi==="top",li=ri?1:-1,Ar&&(li*=-1),jn=ba*li,an=lt+ma*li,ei=ri?1:-.2,Math.abs(Li)===90&&(Ar?ei+=le:Li===-90&&xi==="bottom"?ei=se:Li===90&&xi==="top"?ei=le:ei=.5,_i=le/2*(Li/90)),ga.xFn=function(uo){return uo.dx+jn+_i*uo.fontSize},ga.yFn=function(uo){return uo.dy+an+uo.fontSize*ei},ga.anchorFn=function(uo,ao){if(Wt){if(Kr)return"end";if(Nr)return"start"}return!x(ao)||ao===0||ao===180?"middle":ao*li<0!==Ar?"end":"start"},ga.heightFn=function(uo,ao,mo){return ao<-60||ao>60?-.5*mo:St.side==="top"!==Ar?-mo:0};else if(Pi==="y"){if(ri=!Ar&&xi==="left"||Ar&&xi==="right",li=ri?1:-1,Ar&&(li*=-1),jn=ma,an=ba*li,ei=0,!Ar&&Math.abs(Li)===90&&(Li===-90&&xi==="left"||Li===90&&xi==="right"?ei=se:ei=.5),Ar){var vo=x(Li)?+Li:0;if(vo!==0){var Eo=e.deg2rad(vo);_i=Math.abs(Math.sin(Eo))*se*li,ei=0}}ga.xFn=function(uo){return uo.dx+lt-(jn+uo.fontSize*ei)*li+_i*uo.fontSize},ga.yFn=function(uo){return uo.dy+an+uo.fontSize*le},ga.anchorFn=function(uo,ao){return x(ao)&&Math.abs(ao)===90?"middle":ri?"end":"start"},ga.heightFn=function(uo,ao,mo){return St.side==="right"&&(ao*=-1),ao<-30?-mo:ao<30?-.5*mo:0}}return ga};function Sa(St){return[St.text,St.x,St.axInfo,St.font,St.fontSize,St.fontColor].join("_")}J.drawTicks=function(St,lt,br){br=br||{};var kr=lt._id+"tick",Lr=[].concat(lt.minor&<.minor.ticks?br.vals.filter(function(Cr){return Cr.minor&&!Cr.noTick}):[]).concat(lt.ticks?br.vals.filter(function(Cr){return!Cr.minor&&!Cr.noTick}):[]),Tr=br.layer.selectAll("path."+kr).data(Lr,Sa);Tr.exit().remove(),Tr.enter().append("path").classed(kr,1).classed("ticks",1).classed("crisp",br.crisp!==!1).each(function(Cr){return a.stroke(d.select(this),Cr.minor?lt.minor.tickcolor:lt.tickcolor)}).style("stroke-width",function(Cr){return i.crispRound(St,Cr.minor?lt.minor.tickwidth:lt.tickwidth,1)+"px"}).attr("d",br.path).style("display",null),sn(lt,[N]),Tr.attr("transform",br.transFn)},J.drawGrid=function(St,lt,br){if(br=br||{},lt.tickmode!=="sync"){var kr=lt._id+"grid",Lr=lt.minor&<.minor.showgrid,Tr=Lr?br.vals.filter(function(ga){return ga.minor}):[],Cr=lt.showgrid?br.vals.filter(function(ga){return!ga.minor}):[],Kr=br.counterAxis;if(Kr&&J.shouldShowZeroLine(St,lt,Kr))for(var Nr=lt.tickmode==="array",_t=0;_t=0;ba--){var wa=ba?Vr:ma;if(wa){var $r=wa.selectAll("path."+kr).data(ba?Cr:Tr,Sa);$r.exit().remove(),$r.enter().append("path").classed(kr,1).classed("crisp",br.crisp!==!1),$r.attr("transform",br.transFn).attr("d",br.path).each(function(ga){return a.stroke(d.select(this),ga.minor?lt.minor.gridcolor:lt.gridcolor||"#ddd")}).style("stroke-dasharray",function(ga){return i.dashStyle(ga.minor?lt.minor.griddash:lt.griddash,ga.minor?lt.minor.gridwidth:lt.gridwidth)}).style("stroke-width",function(ga){return(ga.minor?Ar:lt._gw)+"px"}).style("display",null),typeof br.path=="function"&&$r.attr("d",br.path)}}sn(lt,[O,I])}},J.drawZeroLine=function(St,lt,br){br=br||br;var kr=lt._id+"zl",Lr=J.shouldShowZeroLine(St,lt,br.counterAxis),Tr=br.layer.selectAll("path."+kr).data(Lr?[{x:0,id:lt._id}]:[]);Tr.exit().remove(),Tr.enter().append("path").classed(kr,1).classed("zl",1).classed("crisp",br.crisp!==!1).each(function(){br.layer.selectAll("path").sort(function(Cr,Kr){return ne(Cr.id,Kr.id)})}),Tr.attr("transform",br.transFn).attr("d",br.path).call(a.stroke,lt.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(St,lt.zerolinewidth,lt._gw||1)+"px").style("display",null),sn(lt,[B])},J.drawLabels=function(St,lt,br){br=br||{};var kr=St._fullLayout,Lr=lt._id,Tr=lt.zerolinelayer==="above traces",Cr=br.cls||Lr+"tick",Kr=br.vals.filter(function(Qi){return Qi.text}),Nr=br.labelFns,_t=br.secondary?0:lt.tickangle,Wt=(lt._prevTickAngles||{})[Cr],Ar=br.layer.selectAll("g."+Cr).data(lt.showticklabels?Kr:[],Sa),Vr=[];Ar.enter().append("g").classed(Cr,1).append("text").attr("text-anchor","middle").each(function(Qi){var eo=d.select(this),Ei=St._promises.length;eo.call(r.positionText,Nr.xFn(Qi),Nr.yFn(Qi)).call(i.font,{family:Qi.font,size:Qi.fontSize,color:Qi.fontColor,weight:Qi.fontWeight,style:Qi.fontStyle,variant:Qi.fontVariant,textcase:Qi.fontTextcase,lineposition:Qi.fontLineposition,shadow:Qi.fontShadow}).text(Qi.text).call(r.convertToTspans,St),St._promises[Ei]?Vr.push(St._promises.pop().then(function(){ma(eo,_t)})):ma(eo,_t)}),sn(lt,[U]),Ar.exit().remove(),br.repositionOnUpdate&&Ar.each(function(Qi){d.select(this).select("text").call(r.positionText,Nr.xFn(Qi),Nr.yFn(Qi))});function ma(Qi,eo){Qi.each(function(Ei){var Xi=d.select(this),Jo=Xi.select(".text-math-group"),ms=Nr.anchorFn(Ei,eo),_s=br.transFn.call(Xi.node(),Ei)+(x(eo)&&+eo!=0?" rotate("+eo+","+Nr.xFn(Ei)+","+(Nr.yFn(Ei)-Ei.fontSize/2)+")":""),ko=r.lineCount(Xi),Nn=he*Ei.fontSize,pi=Nr.heightFn(Ei,x(eo)?+eo:0,(ko-1)*Nn);if(pi&&(_s+=t(0,pi)),Jo.empty()){var gs=Xi.select("text");gs.attr({transform:_s,"text-anchor":ms}),gs.style("display",null),lt._adjustTickLabelsOverflow&<._adjustTickLabelsOverflow()}else{var Io=i.bBox(Jo.node()).width,Zi=Io*{end:-.5,start:.5}[ms];Jo.attr("transform",_s+t(Zi,0))}})}lt._adjustTickLabelsOverflow=function(){var Qi=lt.ticklabeloverflow;if(!(!Qi||Qi==="allow")){var eo=Qi.indexOf("hide")!==-1,Ei=lt._id.charAt(0)==="x",Xi=0,Jo=Ei?St._fullLayout.width:St._fullLayout.height;if(Qi.indexOf("domain")!==-1){var ms=e.simpleMap(lt.range,lt.r2l);Xi=lt.l2p(ms[0])+lt._offset,Jo=lt.l2p(ms[1])+lt._offset}var _s=Math.min(Xi,Jo),ko=Math.max(Xi,Jo),Nn=lt.side,pi=1/0,gs=-1/0;Ar.each(function(rs){var fs=d.select(this),el=fs.select(".text-math-group");if(el.empty()){var ci=i.bBox(fs.node()),oo=0;Ei?(ci.right>ko||ci.left<_s)&&(oo=1):(ci.bottom>ko||ci.top+(lt.tickangle?0:rs.fontSize/4)<_s)&&(oo=1);var so=fs.select("text");oo?eo&&so.style("display","none"):so.node().style.display!=="none"&&(so.style("display",null),Nn==="bottom"||Nn==="right"?pi=Math.min(pi,Ei?ci.top:ci.left):pi=-1/0,Nn==="top"||Nn==="left"?gs=Math.max(gs,Ei?ci.bottom:ci.right):gs=1/0)}});for(var Io in kr._plots){var Zi=kr._plots[Io];if(!(lt._id!==Zi.xaxis._id&<._id!==Zi.yaxis._id)){var ys=Ei?Zi.yaxis:Zi.xaxis;ys&&(ys["_visibleLabelMin_"+lt._id]=pi,ys["_visibleLabelMax_"+lt._id]=gs)}}}},lt._hideCounterAxisInsideTickLabels=function(Qi){var eo=lt._id.charAt(0)==="x",Ei=[];for(var Xi in kr._plots){var Jo=kr._plots[Xi];lt._id!==Jo.xaxis._id&<._id!==Jo.yaxis._id||Ei.push(eo?Jo.yaxis:Jo.xaxis)}Ei.forEach(function(ms,_s){ms&&Xa(ms)&&(Qi||[B,I,O,N,U]).forEach(function(ko){var Nn=ko.K==="tick"&&ko.L==="text"&<.ticklabelmode==="period",pi=kr._plots[lt._mainSubplot],gs;if(ko.K===B.K){var Io=Tr?pi.zerolinelayerAbove:pi.zerolinelayer;gs=Io.selectAll("."+lt._id+"zl")}else ko.K===I.K?gs=pi.minorGridlayer.selectAll("."+lt._id):ko.K===O.K?gs=pi.gridlayer.selectAll("."+lt._id):gs=pi[lt._id.charAt(0)+"axislayer"];gs.each(function(){var Zi=d.select(this);ko.L&&(Zi=Zi.selectAll(ko.L)),Zi.each(function(ys){var rs=lt.l2p(Nn?oa(ys):ys.x)+lt._offset,fs=d.select(this);rslt["_visibleLabelMin_"+ms._id]?fs.style("display","none"):ko.K==="tick"&&!_s&&fs.node().style.display!=="none"&&fs.style("display",null)})})})})},ma(Ar,Wt+1?Wt:_t);function ba(){return Vr.length&&Promise.all(Vr)}var wa=null;function $r(){if(ma(Ar,_t),Kr.length&<.autotickangles&&(lt.type!=="log"||String(lt.dtick).charAt(0)!=="D")){wa=lt.autotickangles[0];var Qi=0,eo=[],Ei,Xi=1;Ar.each(function(hs){Qi=Math.max(Qi,hs.fontSize);var ks=lt.l2p(hs.x),xs=It(this),ll=i.bBox(xs.node());Xi=Math.max(Xi,r.lineCount(xs)),eo.push({top:0,bottom:10,height:10,left:ks-ll.width/2,right:ks+ll.width/2+2,width:ll.width+2})});var Jo=(lt.tickson==="boundaries"||lt.showdividers)&&!br.secondary,ms=Kr.length,_s=Math.abs((Kr[ms-1].x-Kr[0].x)*lt._m)/(ms-1),ko=Jo?_s/2:_s,Nn=Jo?lt.ticklen:Qi*1.25*Xi,pi=Math.sqrt(Math.pow(ko,2)+Math.pow(Nn,2)),gs=ko/pi,Io=lt.autotickangles.map(function(hs){return hs*Math.PI/180}),Zi=Io.find(function(hs){return Math.abs(Math.cos(hs))<=gs});Zi===void 0&&(Zi=Io.reduce(function(hs,ks){return Math.abs(Math.cos(hs))Bo*mo&&(Eo=mo,Li[Pi]=ri[Pi]=uo[Pi])}var Go=Math.abs(Eo-vo);Go-li>0?(Go-=li,li*=1+li/Go):li=0,lt._id.charAt(0)!=="y"&&(li=-li),Li[xi]=an.p2r(an.r2p(ri[xi])+_i*li),an.autorange==="min"||an.autorange==="max reversed"?(Li[0]=null,an._rangeInitial0=void 0,an._rangeInitial1=void 0):(an.autorange==="max"||an.autorange==="min reversed")&&(Li[1]=null,an._rangeInitial0=void 0,an._rangeInitial1=void 0),kr._insideTickLabelsUpdaterange[an._name+".range"]=Li}var Ko=e.syncOrAsync(ga);return Ko&&Ko.then&&St._promises.push(Ko),Ko};function za(St,lt,br){var kr=lt._id+"divider",Lr=br.vals,Tr=br.layer.selectAll("path."+kr).data(Lr,Sa);Tr.exit().remove(),Tr.enter().insert("path",":first-child").classed(kr,1).classed("crisp",1).call(a.stroke,lt.dividercolor).style("stroke-width",i.crispRound(St,lt.dividerwidth,1)+"px"),Tr.attr("transform",br.transFn).attr("d",br.path)}J.getPxPosition=function(St,lt){var br=St._fullLayout._size,kr=lt._id.charAt(0),Lr=lt.side,Tr;if(lt.anchor!=="free"?Tr=lt._anchorAxis:kr==="x"?Tr={_offset:br.t+(1-(lt.position||0))*br.h,_length:0}:kr==="y"&&(Tr={_offset:br.l+(lt.position||0)*br.w+lt._shift,_length:0}),Lr==="top"||Lr==="left")return Tr._offset;if(Lr==="bottom"||Lr==="right")return Tr._offset+Tr._length};function Na(St){var lt=St.title.font.size,br=(St.title.text.match(r.BR_TAG_ALL)||[]).length;return St.title.hasOwnProperty("standoff")?lt*(se+br*he):br?lt*(br+1)*he:lt}function Ta(St,lt){var br=St._fullLayout,kr=lt._id,Lr=kr.charAt(0),Tr=lt.title.font.size,Cr,Kr=(lt.title.text.match(r.BR_TAG_ALL)||[]).length;if(lt.title.hasOwnProperty("standoff"))lt.side==="bottom"||lt.side==="right"?Cr=lt._depth+lt.title.standoff+Tr*se:(lt.side==="top"||lt.side==="left")&&(Cr=lt._depth+lt.title.standoff+Tr*(le+Kr*he));else{var Nr=Xa(lt);if(lt.type==="multicategory")Cr=lt._depth;else{var _t=1.5*Tr;Nr&&(_t=.5*Tr,lt.ticks==="outside"&&(_t+=lt.ticklen)),Cr=10+_t+(lt.linewidth?lt.linewidth-1:0)}Nr||(Lr==="x"?Cr+=lt.side==="top"?Tr*(lt.showticklabels?1:0):Tr*(lt.showticklabels?1.5:.5):Cr+=lt.side==="right"?Tr*(lt.showticklabels?1:.5):Tr*(lt.showticklabels?.5:0))}var Wt=J.getPxPosition(St,lt),Ar,Vr,ma;Lr==="x"?(Vr=lt._offset+lt._length/2,ma=lt.side==="top"?Wt-Cr:Wt+Cr):(ma=lt._offset+lt._length/2,Vr=lt.side==="right"?Wt+Cr:Wt-Cr,Ar={rotate:"-90",offset:0});var ba;if(lt.type!=="multicategory"){var wa=lt._selections[lt._id+"tick"];if(ba={selection:wa,side:lt.side},wa&&wa.node()&&wa.node().parentNode){var $r=i.getTranslate(wa.node().parentNode);ba.offsetLeft=$r.x,ba.offsetTop=$r.y}lt.title.hasOwnProperty("standoff")&&(ba.pad=0)}return lt._titleStandoff=Cr,o.draw(St,kr+"title",{propContainer:lt,propName:lt._name+".title.text",placeholder:br._dfltTitle[Lr],avoid:ba,transform:Ar,attributes:{x:Vr,y:ma,"text-anchor":"middle"}})}J.shouldShowZeroLine=function(St,lt,br){var kr=e.simpleMap(lt.range,lt.r2l);return kr[0]*kr[1]<=0&<.zeroline&&(lt.type==="linear"||lt.type==="-")&&!(lt.rangebreaks&<.maskBreaks(0)===F)&&(nn(lt,0)||!gn(St,lt,br,kr)||Ht(St,lt))},J.clipEnds=function(St,lt){return lt.filter(function(br){return nn(St,br.x)})};function nn(St,lt){var br=St.l2p(lt);return br>1&&br1)for(Lr=1;Lr=Lr.min&&St=L:/%L/.test(lt)?St>=P:/%[SX]/.test(lt)?St>=f:/%M/.test(lt)?St>=g:/%[HI]/.test(lt)?St>=u:/%p/.test(lt)?St>=v:/%[Aadejuwx]/.test(lt)?St>=b:/%[UVW]/.test(lt)?St>=y:/%[Bbm]/.test(lt)?St>=M:/%[q]/.test(lt)?St>=_:/%[Yy]/.test(lt)?St>=p:!0}}}),cb=We({"src/plots/cartesian/autorange_options_defaults.js"(Z,V){"use strict";V.exports=function(x,A,E){var e,t;if(E){var r=A==="reversed"||A==="min reversed"||A==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),fb=We({"src/plots/cartesian/range_defaults.js"(Z,V){"use strict";var d=cb();V.exports=function(A,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=E.getAutorangeDflt(a,t),s=e("autorange",n),h;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete E.range,E.autorange=!0,h=!0),h||(n=E.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),$A=We({"node_modules/mouse-event-offset/index.js"(Z,V){var d={left:0,top:0};V.exports=x;function x(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=o-a.top,t}function A(E){return E===window||E===document||E===document.body?d:E.getBoundingClientRect()}}}),jy=We({"node_modules/has-passive-events/index.js"(Z,V){"use strict";var d=rb();function x(){var A=!1;try{var E=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{A=!1}return A}V.exports=d&&x()}}),QA=We({"src/components/dragelement/align.js"(Z,V){"use strict";V.exports=function(x,A,E,e,t){var r=(x-E)/(e-E),o=r+A/(e-E),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),eS=We({"src/components/dragelement/cursor.js"(Z,V){"use strict";var d=aa(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];V.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=d.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][E]}}}),tS=We({"src/components/dragelement/unhover.js"(Z,V){"use strict";var d=M0(),x=By(),A=Im().getGraphDiv,E=Pm(),e=V.exports={};e.wrapped=function(t,r,o){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),ih=We({"src/components/dragelement/index.js"(Z,V){"use strict";var d=$A(),x=ab(),A=jy(),E=aa().removeElement,e=Sf(),t=V.exports={};t.align=QA(),t.getCursor=eS();var r=tS();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,h=1,c=s._context.doubleClickDelay,m=n.element,p,T,l,_,w,S,M,y;s._mouseDownTime||(s._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=u,A?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=u,m.addEventListener("touchstart",u,{passive:!1})):m.ontouchstart=u;function b(P,L,z){return Math.abs(P)"u"&&typeof P.clientY>"u"&&(P.clientX=p,P.clientY=T),l=new Date().getTime(),l-s._mouseDownTimec&&(h=Math.max(h-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var L;S.target===M?L=S:(L={target:M,srcElement:M,toElement:M},Object.keys(S).concat(Object.keys(S.__proto__)).forEach(z=>{var F=S[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),n.clickFn&&n.clickFn(h,L),y||M.dispatchEvent(new MouseEvent("click",P))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),sv=We({"src/lib/setcursor.js"(Z,V){"use strict";V.exports=function(x,A){(x.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&x.classed(E,!1)}),A&&x.classed("cursor-"+A,!0)}}}),rS=We({"src/lib/override_cursor.js"(Z,V){"use strict";var d=sv(),x="data-savedcursor",A="!!";V.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;aq.legend.length)for(var X=q.legend.length;X(a==="legend"?1:0));if(L===!1&&(n[a]=void 0),!(L===!1&&!h.uirevision)&&(m("uirevision",n.uirevision),L!==!1)){m("borderwidth");var z=m("orientation"),F=m("yref"),B=m("xref"),O=z==="h",I=F==="paper",N=B==="paper",U,W,Q,le="left";O?(U=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?I?(W=1.1,Q="bottom"):(W=1,Q="top"):I?(W=-.1,Q="top"):(W=0,Q="bottom")):(W=1,Q="auto",N?U=1.02:(U=1,le="right")),x.coerce(h,c,{x:{valType:"number",editType:"legend",min:N?-2:0,max:N?3:1,dflt:U}},"x"),x.coerce(h,c,{y:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:W}},"y"),m("traceorder",b),r.isGrouped(n[a])&&m("tracegroupgap"),m("entrywidth"),m("entrywidthmode"),m("indentation"),m("itemsizing"),m("itemwidth"),m("itemclick"),m("itemdoubleclick"),m("groupclick"),m("xanchor",le),m("yanchor",Q),m("maxheight"),m("valign"),x.noneOrAll(h,c,["x","y"]);var se=m("title.text");if(se){m("title.side",O?"left":"top");var he=x.extendFlat({},p,{size:x.bigFont(p.size)});x.coerceFont(m,"title.font",he)}}}V.exports=function(i,n,s){var h,c=s.slice(),m=n.shapes;if(m)for(h=0;hz&&(L=z)}f[p][0]._groupMinRank=L,f[p][0]._preGroupSort=p}var F=function(W,Q){return W[0]._groupMinRank-Q[0]._groupMinRank||W[0]._preGroupSort-Q[0]._preGroupSort},B=function(W,Q){return W.trace.legendrank-Q.trace.legendrank||W._preSort-Q._preSort};for(f.forEach(function(W,Q){W[0]._preGroupSort=Q}),f.sort(F),p=0;p0)oe=$.width;else return 0;return v?X:Math.min(oe,J)};S.each(function(q){var $=d.select(this),J=A.ensureSingle($,"g","layers");J.style("opacity",q[0].trace.opacity);var X=y.indentation,oe=y.valign,ne=q[0].lineHeight,j=q[0].height;if(oe==="middle"&&X===0||!ne||!j)J.attr("transform",null);else{var ee={top:1,bottom:-1}[oe],re=ee*(.5*(ne-j+3))||0,ue=y.indentation;J.attr("transform",E(ue,re))}var _e=J.selectAll("g.legendfill").data([q]);_e.enter().append("g").classed("legendfill",!0);var Te=J.selectAll("g.legendlines").data([q]);Te.enter().append("g").classed("legendlines",!0);var Ie=J.selectAll("g.legendsymbols").data([q]);Ie.enter().append("g").classed("legendsymbols",!0),Ie.selectAll("g.legendpoints").data([q]).enter().append("g").classed("legendpoints",!0)}).each(he).each(F).each(O).each(B).each(N).each(le).each(Q).each(L).each(z).each(U).each(W);function L(q){var $=l(q),J=$.showFill,X=$.showLine,oe=$.showGradientLine,ne=$.showGradientFill,j=$.anyFill,ee=$.anyLine,re=q[0],ue=re.trace,_e,Te,Ie=r(ue),De=Ie.colorscale,He=Ie.reversescale,et=function(ze){if(ze.size())if(J)e.fillGroupStyle(ze,M,!0);else{var Qe="legendfill-"+ue.uid;e.gradient(ze,M,Qe,T(He),De,"fill")}},rt=function(ze){if(ze.size()){var Qe="legendline-"+ue.uid;e.lineGroupStyle(ze),e.gradient(ze,M,Qe,T(He),De,"stroke")}},$e=o.hasMarkers(ue)||!j?"M5,0":ee?"M5,-2":"M5,-3",ot=d.select(this),Ae=ot.select(".legendfill").selectAll("path").data(J||ne?[q]:[]);if(Ae.enter().append("path").classed("js-fill",!0),Ae.exit().remove(),Ae.attr("d",$e+"h"+u+"v6h-"+u+"z").call(et),X||oe){var ge=P(void 0,ue.line,m,h);Te=A.minExtend(ue,{line:{width:ge}}),_e=[A.minExtend(re,{trace:Te})]}var ce=ot.select(".legendlines").selectAll("path").data(X||oe?[_e]:[]);ce.enter().append("path").classed("js-line",!0),ce.exit().remove(),ce.attr("d",$e+(oe?"l"+u+",0.0001":"h"+u)).call(X?e.lineGroupStyle:rt)}function z(q){var $=l(q),J=$.anyFill,X=$.anyLine,oe=$.showLine,ne=$.showMarker,j=q[0],ee=j.trace,re=!ne&&!X&&!J&&o.hasText(ee),ue,_e;function Te(Ae,ge,ce,ze){var Qe=A.nestedProperty(ee,Ae).get(),nt=A.isArrayOrTypedArray(Qe)&&ge?ge(Qe):Qe;if(v&&nt&&ze!==void 0&&(nt=ze),ce){if(ntce[1])return ce[1]}return nt}function Ie(Ae){return j._distinct&&j.index&&Ae[j.index]?Ae[j.index]:Ae[0]}if(ne||re||oe){var De={},He={};if(ne){De.mc=Te("marker.color",Ie),De.mx=Te("marker.symbol",Ie),De.mo=Te("marker.opacity",A.mean,[.2,1]),De.mlc=Te("marker.line.color",Ie),De.mlw=Te("marker.line.width",A.mean,[0,5],c),He.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var et=Te("marker.size",A.mean,[2,16],s);De.ms=et,He.marker.size=et}oe&&(He.line={width:Te("line.width",Ie,[0,10],h)}),re&&(De.tx="Aa",De.tp=Te("textposition",Ie),De.ts=10,De.tc=Te("textfont.color",Ie),De.tf=Te("textfont.family",Ie),De.tw=Te("textfont.weight",Ie),De.ty=Te("textfont.style",Ie),De.tv=Te("textfont.variant",Ie),De.tC=Te("textfont.textcase",Ie),De.tE=Te("textfont.lineposition",Ie),De.tS=Te("textfont.shadow",Ie)),ue=[A.minExtend(j,De)],_e=A.minExtend(ee,He),_e.selectedpoints=null,_e.texttemplate=null}var rt=d.select(this).select("g.legendpoints"),$e=rt.selectAll("path.scatterpts").data(ne?ue:[]);$e.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",f),$e.exit().remove(),$e.call(e.pointStyle,_e,M),ne&&(ue[0].mrc=3);var ot=rt.selectAll("g.pointtext").data(re?ue:[]);ot.enter().append("g").classed("pointtext",!0).append("text").attr("transform",f),ot.exit().remove(),ot.selectAll("text").call(e.textPointStyle,_e,M)}function F(q){var $=q[0].trace,J=$.type==="waterfall";if(q[0]._distinct&&J){var X=q[0].trace[q[0].dir].marker;return q[0].mc=X.color,q[0].mlw=X.line.width,q[0].mlc=X.line.color,I(q,this,"waterfall")}var oe=[];$.visible&&J&&(oe=q[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var ne=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(oe);ne.enter().append("path").classed("legendwaterfall",!0).attr("transform",f).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(j){var ee=d.select(this),re=$[j[0]].marker,ue=P(void 0,re.line,p,c);ee.attr("d",j[1]).style("stroke-width",ue+"px").call(t.fill,re.color),ue&&ee.call(t.stroke,re.line.color)})}function B(q){I(q,this)}function O(q){I(q,this,"funnel")}function I(q,$,J){var X=q[0].trace,oe=X.marker||{},ne=oe.line||{},j=oe.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ee=J?X.visible&&X.type===J:x.traceIs(X,"bar"),re=d.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ee?[q]:[]);re.enter().append("path").classed("legend"+J,!0).attr("d",j).attr("transform",f),re.exit().remove(),re.each(function(ue){var _e=d.select(this),Te=ue[0],Ie=P(Te.mlw,oe.line,p,c);_e.style("stroke-width",Ie+"px");var De=Te.mcc;if(!y._inHover&&"mc"in Te){var He=r(oe),et=He.mid;et===void 0&&(et=(He.max+He.min)/2),De=e.tryColorscale(oe,"")(et)}var rt=De||Te.mc||oe.color,$e=oe.pattern,ot=e.getPatternAttr,Ae=$e&&(ot($e.shape,0,"")||ot($e.path,0,""));if(Ae){var ge=ot($e.bgcolor,0,null),ce=ot($e.fgcolor,0,null),ze=$e.fgopacity,Qe=_($e.size,8,10),nt=_($e.solidity,.5,1),Ke="legend-"+X.uid;_e.call(e.pattern,"legend",M,Ke,Ae,Qe,nt,De,$e.fillmode,ge,ce,ze)}else _e.call(t.fill,rt);Ie&&t.stroke(_e,Te.mlc||ne.color)})}function N(q){var $=q[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data($.visible&&x.traceIs($,"box-violin")?[q]:[]);J.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",f),J.exit().remove(),J.each(function(){var X=d.select(this);if(($.boxpoints==="all"||$.points==="all")&&t.opacity($.fillcolor)===0&&t.opacity(($.line||{}).color)===0){var oe=A.minExtend($,{marker:{size:v?s:A.constrain($.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});J.call(e.pointStyle,oe,M)}else{var ne=P(void 0,$.line,p,c);X.style("stroke-width",ne+"px").call(t.fill,$.fillcolor),ne&&t.stroke(X,$.line.color)}})}function U(q){var $=q[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data($.visible&&$.type==="candlestick"?[q,q]:[]);J.enter().append("path").classed("legendcandle",!0).attr("d",function(X,oe){return oe?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",f).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ne=d.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,p,c);ne.style("stroke-width",ee+"px").call(t.fill,j.fillcolor),ee&&t.stroke(ne,j.line.color)})}function W(q){var $=q[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data($.visible&&$.type==="ohlc"?[q,q]:[]);J.enter().append("path").classed("legendohlc",!0).attr("d",function(X,oe){return oe?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",f).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ne=d.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,p,c);ne.style("fill","none").call(e.dashLine,j.line.dash,ee),ee&&t.stroke(ne,j.line.color)})}function Q(q){se(q,this,"pie")}function le(q){se(q,this,"funnelarea")}function se(q,$,J){var X=q[0],oe=X.trace,ne=J?oe.visible&&oe.type===J:x.traceIs(oe,J),j=d.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ne?[q]:[]);if(j.enter().append("path").classed("legend"+J,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",f),j.exit().remove(),j.size()){var ee=oe.marker||{},re=P(i(ee.line.width,X.pts),ee.line,p,c),ue="pieLike",_e=A.minExtend(oe,{marker:{line:{width:re}}},ue),Te=A.minExtend(X,{trace:_e},ue);a(j,Te,_e,M)}}function he(q){var $=q[0].trace,J,X=[];if($.visible)switch($.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],J=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],J=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],J="radial";break;case"cone":X=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],J=!1;break;case"streamtube":X=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],J=!1;break;case"surface":X=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],J=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],J=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],J=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],J=!1;break}var oe=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);oe.enter().append("path").classed("legend3dandfriends",!0).attr("transform",f).style("stroke-miterlimit",1),oe.exit().remove(),oe.each(function(ne,j){var ee=d.select(this),re=r($),ue=re.colorscale,_e=re.reversescale,Te=function(et){if(et.size()){var rt="legendfill-"+$.uid;e.gradient(et,M,rt,T(_e,J==="radial"),ue,"fill")}},Ie;if(ue){if(!J){var He=ue.length;Ie=j===0?ue[_e?He-1:0][1]:j===1?ue[_e?0:He-1][1]:ue[Math.floor((He-1)/2)][1]}}else{var De=$.vertexcolor||$.facecolor||$.color;Ie=A.isArrayOrTypedArray(De)?De[j]||De[0]:De}ee.attr("d",ne[0]),Ie?ee.call(t.fill,Ie):ee.call(Te)})}};function T(w,S){var M=S?"radial":"horizontal";return M+(w?"":"reversed")}function l(w){var S=w[0].trace,M=S.contours,y=o.hasLines(S),b=o.hasMarkers(S),v=S.visible&&S.fill&&S.fill!=="none",u=!1,g=!1;if(M){var f=M.coloring;f==="lines"?u=!0:y=f==="none"||f==="heatmap"||M.showlines,M.type==="constraint"?v=M._operation!=="=":(f==="fill"||f==="heatmap")&&(g=!0)}return{showMarker:b,showLine:y,showFill:v,showGradientLine:u,showGradientFill:g,anyLine:y||u,anyFill:v||g}}function _(w,S,M){return w&&A.isArrayOrTypedArray(w)?S:w>M?M:w}}}),mb=We({"src/components/legend/draw.js"(Z,V){"use strict";var d=Hi(),x=aa(),A=Nu(),E=Wi(),e=M0(),t=ih(),r=Oo(),o=Fi(),a=zl(),i=aS(),n=db(),s=gf(),h=s.LINE_SPACING,c=s.FROM_TL,m=s.FROM_BR,p=nS(),T=pb(),l=Vy(),_=1,w=/^legend[0-9]*$/;V.exports=function(U,W){if(W)M(U,W);else{var Q=U._fullLayout,le=Q._legends,se=Q._infolayer.selectAll('[class^="legend"]');se.each(function(){var J=d.select(this),X=J.attr("class"),oe=X.split(" ")[0];oe.match(w)&&le.indexOf(oe)===-1&&J.remove()});for(var he=0;he1)}var ee=Q.hiddenlabels||[];if(!q&&(!Q.showlegend||!$.length))return he.selectAll("."+le).remove(),Q._topdefs.select("#"+se).remove(),A.autoMargin(N,le);var re=x.ensureSingle(he,"g",le,function($e){q||$e.attr("pointer-events","all")}),ue=x.ensureSingleById(Q._topdefs,"clipPath",se,function($e){$e.append("rect")}),_e=x.ensureSingle(re,"rect","bg",function($e){$e.attr("shape-rendering","crispEdges")});_e.call(o.stroke,W.bordercolor).call(o.fill,W.bgcolor).style("stroke-width",W.borderwidth+"px");var Te=x.ensureSingle(re,"g","scrollbox"),Ie=W.title;W._titleWidth=0,W._titleHeight=0;var De;Ie.text?(De=x.ensureSingle(Te,"text",le+"titletext"),De.attr("text-anchor","start").call(r.font,Ie.font).text(Ie.text),f(De,Te,N,W,_)):Te.selectAll("."+le+"titletext").remove();var He=x.ensureSingle(re,"rect","scrollbar",function($e){$e.attr(n.scrollBarEnterAttrs).call(o.fill,n.scrollBarColor)}),et=Te.selectAll("g.groups").data($);et.enter().append("g").attr("class","groups"),et.exit().remove();var rt=et.selectAll("g.traces").data(x.identity);rt.enter().append("g").attr("class","traces"),rt.exit().remove(),rt.style("opacity",function($e){var ot=$e[0].trace;return E.traceIs(ot,"pie-like")?ee.indexOf($e[0].label)!==-1?.5:1:ot.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(v,N,W)}).call(T,N,W).each(function(){q||d.select(this).call(g,N,le)}),x.syncOrAsync([A.previousPromises,function(){return z(N,et,rt,W)},function(){var $e=Q._size,ot=W.borderwidth,Ae=W.xref==="paper",ge=W.yref==="paper";if(Ie.text&&S(De,W,ot),!q){var ce,ze;Ae?ce=$e.l+$e.w*W.x-c[B(W)]*W._width:ce=Q.width*W.x-c[B(W)]*W._width,ge?ze=$e.t+$e.h*(1-W.y)-c[O(W)]*W._effHeight:ze=Q.height*(1-W.y)-c[O(W)]*W._effHeight;var Qe=F(N,le,ce,ze);if(Qe)return;if(Q.margin.autoexpand){var nt=ce,Ke=ze;ce=Ae?x.constrain(ce,0,Q.width-W._width):nt,ze=ge?x.constrain(ze,0,Q.height-W._effHeight):Ke,ce!==nt&&x.log("Constrain "+le+".x to make legend fit inside graph"),ze!==Ke&&x.log("Constrain "+le+".y to make legend fit inside graph")}r.setTranslate(re,ce,ze)}if(He.on(".drag",null),re.on("wheel",null),q||W._height<=W._maxHeight||N._context.staticPlot){var kt=W._effHeight;q&&(kt=W._height),_e.attr({width:W._width-ot,height:kt-ot,x:ot/2,y:ot/2}),r.setTranslate(Te,0,0),ue.select("rect").attr({width:W._width-2*ot,height:kt-2*ot,x:ot,y:ot}),r.setClipUrl(Te,se,N),r.setRect(He,0,0,0,0),delete W._scrollY}else{var Et=Math.max(n.scrollBarMinHeight,W._effHeight*W._effHeight/W._height),Bt=W._effHeight-Et-2*n.scrollBarMargin,jt=W._height-W._effHeight,_r=Bt/jt,pr=Math.min(W._scrollY||0,jt);_e.attr({width:W._width-2*ot+n.scrollBarWidth+n.scrollBarMargin,height:W._effHeight-ot,x:ot/2,y:ot/2}),ue.select("rect").attr({width:W._width-2*ot+n.scrollBarWidth+n.scrollBarMargin,height:W._effHeight-2*ot,x:ot,y:ot+pr}),r.setClipUrl(Te,se,N),Ce(pr,Et,_r),re.on("wheel",function(){pr=x.constrain(W._scrollY+d.event.deltaY/jt*Bt,0,jt),Ce(pr,Et,_r),pr!==0&&pr!==jt&&d.event.preventDefault()});var Or,mr,Er,yt=function(at,dt,gt){var Ct=(gt-dt)/_r+at;return x.constrain(Ct,0,jt)},Oe=function(at,dt,gt){var Ct=(dt-gt)/_r+at;return x.constrain(Ct,0,jt)},Xe=d.behavior.drag().on("dragstart",function(){var at=d.event.sourceEvent;at.type==="touchstart"?Or=at.changedTouches[0].clientY:Or=at.clientY,Er=pr}).on("drag",function(){var at=d.event.sourceEvent;at.buttons===2||at.ctrlKey||(at.type==="touchmove"?mr=at.changedTouches[0].clientY:mr=at.clientY,pr=yt(Er,Or,mr),Ce(pr,Et,_r))});He.call(Xe);var be=d.behavior.drag().on("dragstart",function(){var at=d.event.sourceEvent;at.type==="touchstart"&&(Or=at.changedTouches[0].clientY,Er=pr)}).on("drag",function(){var at=d.event.sourceEvent;at.type==="touchmove"&&(mr=at.changedTouches[0].clientY,pr=Oe(Er,Or,mr),Ce(pr,Et,_r))});Te.call(be)}function Ce(at,dt,gt){W._scrollY=N._fullLayout[le]._scrollY=at,r.setTranslate(Te,0,-at),r.setRect(He,W._width,n.scrollBarMargin+at*gt,n.scrollBarWidth,dt),ue.select("rect").attr("y",ot+at)}if(N._context.edits.legendPosition){var Ne,Ee,Se,Le;re.classed("cursor-move",!0),t.init({element:re.node(),gd:N,prepFn:function(at){if(at.target!==He.node()){var dt=r.getTranslate(re);Se=dt.x,Le=dt.y}},moveFn:function(at,dt){if(Se!==void 0&&Le!==void 0){var gt=Se+at,Ct=Le+dt;r.setTranslate(re,gt,Ct),Ne=t.align(gt,W._width,$e.l,$e.l+$e.w,W.xanchor),Ee=t.align(Ct+W._height,-W._height,$e.t+$e.h,$e.t,W.yanchor)}},doneFn:function(){if(Ne!==void 0&&Ee!==void 0){var at={};at[le+".x"]=Ne,at[le+".y"]=Ee,E.call("_guiRelayout",N,at)}},clickFn:function(at,dt){var gt=he.selectAll("g.traces").filter(function(){var Ct=this.getBoundingClientRect();return dt.clientX>=Ct.left&&dt.clientX<=Ct.right&&dt.clientY>=Ct.top&&dt.clientY<=Ct.bottom});gt.size()>0&&b(N,re,gt,at,dt)}})}}],N)}}function y(N,U,W){var Q=N[0],le=Q.width,se=U.entrywidthmode,he=Q.trace.legendwidth||U.entrywidth;return se==="fraction"?U._maxWidth*he:W+(he||le)}function b(N,U,W,Q,le){var se=W.data()[0][0].trace,he={event:le,node:W.node(),curveNumber:se.index,expandedIndex:se.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};se._group&&(he.group=se._group),E.traceIs(se,"pie-like")&&(he.label=W.datum()[0].label);var q=e.triggerHandler(N,"plotly_legendclick",he);if(Q===1){if(q===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&i(W,N,Q)},N._context.doubleClickDelay)}else if(Q===2){U._clickTimeout&&clearTimeout(U._clickTimeout),N._legendMouseDownTime=0;var $=e.triggerHandler(N,"plotly_legenddoubleclick",he);$!==!1&&q!==!1&&i(W,N,Q)}}function v(N,U,W){var Q=I(W),le=N.data()[0][0],se=le.trace,he=E.traceIs(se,"pie-like"),q=!W._inHover&&U._context.edits.legendText&&!he,$=W._maxNameLength,J,X;le.groupTitle?(J=le.groupTitle.text,X=le.groupTitle.font):(X=W.font,W.entries?J=le.text:(J=he?le.label:se.name,se._meta&&(J=x.templateString(J,se._meta))));var oe=x.ensureSingle(N,"text",Q+"text");oe.attr("text-anchor","start").call(r.font,X).text(q?u(J,$):J);var ne=W.indentation+W.itemwidth+n.itemGap*2;a.positionText(oe,ne,0),q?oe.call(a.makeEditable,{gd:U,text:J}).call(f,N,U,W).on("edit",function(j){this.text(u(j,$)).call(f,N,U,W);var ee=le.trace._fullInput||{},re={};return re.name=j,ee._isShape?E.call("_guiRelayout",U,"shapes["+se.index+"].name",re.name):E.call("_guiRestyle",U,re,se.index)}):f(oe,N,U,W)}function u(N,U){var W=Math.max(4,U);if(N&&N.trim().length>=W/2)return N;N=N||"";for(var Q=W-N.length;Q>0;Q--)N+=" ";return N}function g(N,U,W){var Q=U._context.doubleClickDelay,le,se=1,he=x.ensureSingle(N,"rect",W+"toggle",function(q){U._context.staticPlot||q.style("cursor","pointer").attr("pointer-events","all"),q.call(o.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(he.on("mousedown",function(){le=new Date().getTime(),le-U._legendMouseDownTimeQ&&(se=Math.max(se-1,1)),b(U,q,N,se,d.event)}}))}function f(N,U,W,Q,le){Q._inHover&&N.attr("data-notex",!0),a.convertToTspans(N,W,function(){P(U,W,Q,le)})}function P(N,U,W,Q){var le=N.data()[0][0],se=le&&le.trace.showlegend;if(Array.isArray(se)&&(se=se[le.i]!==!1),!W._inHover&&le&&!se){N.remove();return}var he=N.select("g[class*=math-group]"),q=he.node(),$=I(W);W||(W=U._fullLayout[$]);var J=W.borderwidth,X;Q===_?X=W.title.font:le.groupTitle?X=le.groupTitle.font:X=W.font;var oe=X.size*h,ne,j;if(q){var ee=r.bBox(q);ne=ee.height,j=ee.width,Q===_?r.setTranslate(he,J,J+ne*.75):r.setTranslate(he,0,ne*.25)}else{var re="."+$+(Q===_?"title":"")+"text",ue=N.select(re),_e=a.lineCount(ue),Te=ue.node();if(ne=oe*_e,j=Te?r.bBox(Te).width:0,Q===_)W.title.side==="left"&&(j+=n.itemGap*2),a.positionText(ue,J+n.titlePad,J+oe);else{var Ie=n.itemGap*2+W.indentation+W.itemwidth;le.groupTitle&&(Ie=n.itemGap,j-=W.indentation+W.itemwidth),a.positionText(ue,Ie,-oe*((_e-1)/2-.3))}}Q===_?(W._titleWidth=j,W._titleHeight=ne):(le.lineHeight=oe,le.height=Math.max(ne,16)+3,le.width=j)}function L(N){var U=0,W=0,Q=N.title.side;return Q&&(Q.indexOf("left")!==-1&&(U=N._titleWidth),Q.indexOf("top")!==-1&&(W=N._titleHeight)),[U,W]}function z(N,U,W,Q){var le=N._fullLayout,se=I(Q);Q||(Q=le[se]);var he=le._size,q=l.isVertical(Q),$=l.isGrouped(Q),J=Q.entrywidthmode==="fraction",X=Q.borderwidth,oe=2*X,ne=n.itemGap,j=Q.indentation+Q.itemwidth+ne*2,ee=2*(X+ne),re=O(Q),ue=Q.y<0||Q.y===0&&re==="top",_e=Q.y>1||Q.y===1&&re==="bottom",Te=Q.tracegroupgap,Ie={};let{orientation:De,yref:He}=Q,{maxheight:et}=Q,rt=ue||_e||De!=="v"||He!=="paper";et||(et=rt?.5:1);let $e=rt?le.height:he.h;Q._maxHeight=Math.max(et>1?et:et*$e,30);var ot=0;Q._width=0,Q._height=0;var Ae=L(Q);if(q)W.each(function(Ce){var Ne=Ce[0].height;r.setTranslate(this,X+Ae[0],X+Ae[1]+Q._height+Ne/2+ne),Q._height+=Ne,Q._width=Math.max(Q._width,Ce[0].width)}),ot=j+Q._width,Q._width+=ne+j+oe,Q._height+=ee,$&&(U.each(function(Ce,Ne){r.setTranslate(this,0,Ne*Q.tracegroupgap)}),Q._height+=(Q._lgroupsLength-1)*Q.tracegroupgap);else{var ge=B(Q),ce=Q.x<0||Q.x===0&&ge==="right",ze=Q.x>1||Q.x===1&&ge==="left",Qe=_e||ue,nt=le.width/2;Q._maxWidth=Math.max(ce?Qe&&ge==="left"?he.l+he.w:nt:ze?Qe&&ge==="right"?he.r+he.w:nt:he.w,2*j);var Ke=0,kt=0;W.each(function(Ce){var Ne=y(Ce,Q,j);Ke=Math.max(Ke,Ne),kt+=Ne}),ot=null;var Et=0;if($){var Bt=0,jt=0,_r=0;U.each(function(){var Ce=0,Ne=0;d.select(this).selectAll("g.traces").each(function(Se){var Le=y(Se,Q,j),at=Se[0].height;r.setTranslate(this,Ae[0],Ae[1]+X+ne+at/2+Ne),Ne+=at,Ce=Math.max(Ce,Le),Ie[Se[0].trace.legendgroup]=Ce});var Ee=Ce+ne;jt>0&&Ee+X+jt>Q._maxWidth?(Et=Math.max(Et,jt),jt=0,_r+=Bt+Te,Bt=Ne):Bt=Math.max(Bt,Ne),r.setTranslate(this,jt,_r),jt+=Ee}),Q._width=Math.max(Et,jt)+X,Q._height=_r+Bt+ee}else{var pr=W.size(),Or=kt+oe+(pr-1)*ne=Q._maxWidth&&(Et=Math.max(Et,Oe),Er=0,yt+=mr,Q._height+=mr,mr=0),r.setTranslate(this,Ae[0]+X+Er,Ae[1]+X+yt+Ne/2+ne),Oe=Er+Ee+ne,Er+=Se,mr=Math.max(mr,Ne)}),Or?(Q._width=Er+oe,Q._height=mr+ee):(Q._width=Math.max(Et,Oe)+oe,Q._height+=mr+ee)}}Q._width=Math.ceil(Math.max(Q._width+Ae[0],Q._titleWidth+2*(X+n.titlePad))),Q._height=Math.ceil(Math.max(Q._height+Ae[1],Q._titleHeight+2*(X+n.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Xe=N._context.edits,be=Xe.legendText||Xe.legendPosition;W.each(function(Ce){var Ne=d.select(this).select("."+se+"toggle"),Ee=Ce[0].height,Se=Ce[0].trace.legendgroup,Le=y(Ce,Q,j);$&&Se!==""&&(Le=Ie[Se]);var at=be?j:ot||Le;!q&&!J&&(at+=ne/2),r.setRect(Ne,0,-Ee/2,at,Ee)})}function F(N,U,W,Q){var le=N._fullLayout,se=le[U],he=B(se),q=O(se),$=se.xref==="paper",J=se.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=se.y<.5?"b":"t",oe=se.x<.5?"l":"r",ne={r:le.width-W,l:W+se._width,b:le.height-Q,t:Q+se._effHeight};if($&&J)return A.autoMargin(N,U,{x:se.x,y:se.y,l:se._width*c[he],r:se._width*m[he],b:se._effHeight*m[q],t:se._effHeight*c[q]});$?N._fullLayout._reservedMargin[U][X]=ne[X]:J||se.orientation==="v"?N._fullLayout._reservedMargin[U][oe]=ne[oe]:N._fullLayout._reservedMargin[U][X]=ne[X]}function B(N){return x.isRightAnchor(N)?"right":x.isCenterAnchor(N)?"center":"left"}function O(N){return x.isBottomAnchor(N)?"bottom":x.isMiddleAnchor(N)?"middle":"top"}function I(N){return N._id||"legend"}}}),gb=We({"src/components/fx/hover.js"(Z){"use strict";var V=Hi(),d=Uo(),x=Af(),A=aa(),E=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=M0(),o=zl(),a=rS(),i=Oo(),n=Fi(),s=ih(),h=Mo(),c=Sf().zindexSeparator,m=Wi(),p=Th(),T=Pm(),l=vb(),_=mb(),w=T.YANGLE,S=Math.PI*w/180,M=1/Math.sin(S),y=Math.cos(S),b=Math.sin(S),v=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,g={box:!0,ohlc:!0,violin:!0,candlestick:!0},f={scatter:!0,scattergl:!0,splom:!0};function P(j,ee){return j.distance-ee.distance}Z.hover=function(ee,re,ue,_e){ee=A.getGraphDiv(ee);var Te=re.target;A.throttle(ee._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(ee,re,ue,_e,Te)})},Z.loneHover=function(ee,re){var ue=!0;Array.isArray(ee)||(ue=!1,ee=[ee]);var _e=re.gd,Te=X(_e),Ie=oe(_e),De=ee.map(function(ze){var Qe=ze._x0||ze.x0||ze.x||0,nt=ze._x1||ze.x1||ze.x||0,Ke=ze._y0||ze.y0||ze.y||0,kt=ze._y1||ze.y1||ze.y||0,Et=ze.eventData;if(Et){var Bt=Math.min(Qe,nt),jt=Math.max(Qe,nt),_r=Math.min(Ke,kt),pr=Math.max(Ke,kt),Or=ze.trace;if(m.traceIs(Or,"gl3d")){var mr=_e._fullLayout[Or.scene]._scene.container,Er=mr.offsetLeft,yt=mr.offsetTop;Bt+=Er,jt+=Er,_r+=yt,pr+=yt}Et.bbox={x0:Bt+Ie,x1:jt+Ie,y0:_r+Te,y1:pr+Te},re.inOut_bbox&&re.inOut_bbox.push(Et.bbox)}else Et=!1;return{color:ze.color||n.defaultLine,x0:ze.x0||ze.x||0,x1:ze.x1||ze.x||0,y0:ze.y0||ze.y||0,y1:ze.y1||ze.y||0,xLabel:ze.xLabel,yLabel:ze.yLabel,zLabel:ze.zLabel,text:ze.text,name:ze.name,idealAlign:ze.idealAlign,borderColor:ze.borderColor,fontFamily:ze.fontFamily,fontSize:ze.fontSize,fontColor:ze.fontColor,fontWeight:ze.fontWeight,fontStyle:ze.fontStyle,fontVariant:ze.fontVariant,nameLength:ze.nameLength,textAlign:ze.textAlign,trace:ze.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:ze.hovertemplate||!1,hovertemplateLabels:ze.hovertemplateLabels||!1,eventData:Et}}),He=!1,et=B(De,{gd:_e,hovermode:"closest",rotateLabels:He,bgColor:re.bgColor||n.background,container:V.select(re.container),outerContainer:re.outerContainer||re.container}),rt=et.hoverLabels,$e=5,ot=0,Ae=0;rt.sort(function(ze,Qe){return ze.y0-Qe.y0}).each(function(ze,Qe){var nt=ze.y0-ze.by/2;nt-$ejt[0]._length||Na<0||Na>_r[0]._length)return s.unhoverRaw(j,ee)}if(ee.pointerX=za+jt[0]._offset,ee.pointerY=Na+_r[0]._offset,"xval"in ee?be=p.flat(Te,ee.xval):be=p.p2c(jt,za),"yval"in ee?Ce=p.flat(Te,ee.yval):Ce=p.p2c(_r,Na),!d(be[0])||!d(Ce[0]))return A.warn("Fx.hover failed",ee,j),s.unhoverRaw(j,ee)}var gn=1/0;function Ht(ri,vo){for(Ee=0;EeJt&&(Oe.splice(0,Jt),gn=Oe[0].distance),$e&&yt!==0&&Oe.length===0){Qt.distance=yt,Qt.index=!1;var Bo=Le._module.hoverPoints(Qt,Ct,or,"closest",{hoverLayer:De._hoverlayer});if(Bo&&(Bo=Bo.filter(function(Xi){return Xi.spikeDistance<=yt})),Bo&&Bo.length){var Go,Ko=Bo.filter(function(Xi){return Xi.xa.showspikes&&Xi.xa.spikesnap!=="hovered data"});if(Ko.length){var Qi=Ko[0];d(Qi.x0)&&d(Qi.y0)&&(Go=Gt(Qi),(!Sr.vLinePoint||Sr.vLinePoint.spikeDistance>Go.spikeDistance)&&(Sr.vLinePoint=Go))}var eo=Bo.filter(function(Xi){return Xi.ya.showspikes&&Xi.ya.spikesnap!=="hovered data"});if(eo.length){var Ei=eo[0];d(Ei.x0)&&d(Ei.y0)&&(Go=Gt(Ei),(!Sr.hLinePoint||Sr.hLinePoint.spikeDistance>Go.spikeDistance)&&(Sr.hLinePoint=Go))}}}}}Ht();function It(ri,vo,Eo){for(var uo=null,ao=1/0,mo,Bo=0;Bori.trace.index===Xn.trace.index):Oe=[Xn];var Kn=Oe.length,St=J("x",Xn,De),lt=J("y",Xn,De);Ht(St,lt);var br=[],kr={},Lr=0,Tr=function(ri){var vo=g[ri.trace.type]?z(ri):ri.trace.index;if(!kr[vo])Lr++,kr[vo]=Lr,br.push(ri);else{var Eo=kr[vo]-1,uo=br[Eo];Eo>0&&Math.abs(ri.distance)Kn-1;Cr--)Tr(Oe[Cr]);Oe=br,Jr()}var Kr=j._hoverdata,Nr=[],_t=X(j),Wt=oe(j);for(let ri of Oe){var Ar=p.makeEventData(ri,ri.trace,ri.cd);if(ri.hovertemplate!==!1){var Vr=!1;ri.cd[ri.index]&&ri.cd[ri.index].ht&&(Vr=ri.cd[ri.index].ht),ri.hovertemplate=Vr||ri.trace.hovertemplate||!1}if(ri.xa&&ri.ya){var ma=ri.x0+ri.xa._offset,ba=ri.x1+ri.xa._offset,wa=ri.y0+ri.ya._offset,$r=ri.y1+ri.ya._offset,ga=Math.min(ma,ba),jn=Math.max(ma,ba),an=Math.min(wa,$r),ei=Math.max(wa,$r);Ar.bbox={x0:ga+Wt,x1:jn+Wt,y0:an+_t,y1:ei+_t}}ri.eventData=[Ar],Nr.push(Ar)}j._hoverdata=Nr;var li=ot==="y"&&(Xe.length>1||Oe.length>1)||ot==="closest"&&oa&&Oe.length>1,_i=n.combine(De.plot_bgcolor||n.background,De.paper_bgcolor),xi=B(Oe,{gd:j,hovermode:ot,rotateLabels:li,bgColor:_i,container:De._hoverlayer,outerContainer:De._paper.node(),commonLabelOpts:De.hoverlabel,hoverdistance:De.hoverdistance}),Pi=xi.hoverLabels;if(p.isUnifiedHover(ot)||(I(Pi,li,De,xi.commonLabelBoundingBox),W(Pi,li,De._invScaleX,De._invScaleY)),_e&&_e.tagName){var Li=m.getComponentMethod("annotations","hasClickToShow")(j,Nr);a(V.select(_e),Li?"pointer":"")}!_e||ue||!se(j,ee,Kr)||(Kr&&j.emit("plotly_unhover",{event:ee,points:Kr}),j.emit("plotly_hover",{event:ee,points:j._hoverdata,xaxes:jt,yaxes:_r,xvals:be,yvals:Ce}))}function z(j){return[j.trace.index,j.index,j.x0,j.y0,j.name,j.attr,j.xa?j.xa._id:"",j.ya?j.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function B(j,ee){var re=ee.gd,ue=re._fullLayout,_e=ee.hovermode,Te=ee.rotateLabels,Ie=ee.bgColor,De=ee.container,He=ee.outerContainer,et=ee.commonLabelOpts||{};if(j.length===0)return[[]];var rt=ee.fontFamily||T.HOVERFONT,$e=ee.fontSize||T.HOVERFONTSIZE,ot=ee.fontWeight||ue.font.weight,Ae=ee.fontStyle||ue.font.style,ge=ee.fontVariant||ue.font.variant,ce=ee.fontTextcase||ue.font.textcase,ze=ee.fontLineposition||ue.font.lineposition,Qe=ee.fontShadow||ue.font.shadow,nt=j[0],Ke=nt.xa,kt=nt.ya,Et=_e.charAt(0),Bt=Et+"Label",jt=nt[Bt];if(jt===void 0&&Ke.type==="multicategory")for(var _r=0;_rue.width-_t&&(Wt=ue.width-_t),Xn.attr("d","M"+(Cr-Wt)+",0L"+(Cr-Wt+v)+","+Nr+v+"H"+_t+"v"+Nr+(u*2+Tr.height)+"H"+-_t+"V"+Nr+v+"H"+(Cr-Wt-v)+"Z"),Cr=Wt,Ee.minX=Cr-_t,Ee.maxX=Cr+_t,Ke.side==="top"?(Ee.minY=Kr-(u*2+Tr.height),Ee.maxY=Kr-u):(Ee.minY=Kr+u,Ee.maxY=Kr+(u*2+Tr.height))}else{var Ar,Vr,ma;kt.side==="right"?(Ar="start",Vr=1,ma="",Cr=Ke._offset+Ke._length):(Ar="end",Vr=-1,ma="-",Cr=Ke._offset),Kr=kt._offset+(nt.y0+nt.y1)/2,Kn.attr("text-anchor",Ar),Xn.attr("d","M0,0L"+ma+v+","+v+"V"+(u+Tr.height/2)+"h"+ma+(u*2+Tr.width)+"V-"+(u+Tr.height/2)+"H"+ma+v+"V-"+v+"Z"),Ee.minY=Kr-(u+Tr.height/2),Ee.maxY=Kr+(u+Tr.height/2),kt.side==="right"?(Ee.minX=Cr+v,Ee.maxX=Cr+v+(u*2+Tr.width)):(Ee.minX=Cr-v-(u*2+Tr.width),Ee.maxX=Cr-v);var ba=Tr.height/2,wa=Or-Tr.top-ba,$r="clip"+ue._uid+"commonlabel"+kt._id,ga;if(CrXn.hoverinfo!=="none");if(Ma.length===0)return[];var Se=ue.hoverlabel,Le=Se.font,at=Ma[0],dt=((_e==="x unified"?at.xa:at.ya).unifiedhovertitle||{}).text,gt=dt?A.hovertemplateString({data:_e==="x unified"?[{xa:at.xa,x:at.xVal}]:[{ya:at.ya,y:at.yVal}],fallback:at.trace.hovertemplatefallback,locale:ue._d3locale,template:dt}):jt,Ct={showlegend:!0,legend:{title:{text:gt,font:Le},font:Le,bgcolor:Se.bgcolor,bordercolor:Se.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:ue.legend?ue.legend.traceorder:void 0,orientation:"v"}},or={font:Le};l(Ct,or,re._fullData);var Qt=or.legend;Qt.entries=[];for(var Jt=0;Jt=0?ja=Jr:ia+nn=0?ja=ia:Pa+nn=0?Xa=Rr:Yr+gn=0?Xa=Yr:Ga+gn=0,(Ma.idealAlign==="top"||!ei)&&li?(ma-=wa/2,Ma.anchor="end"):ei?(ma+=wa/2,Ma.anchor="start"):Ma.anchor="middle",Ma.crossPos=ma;else{if(Ma.pos=ma,ei=Vr+ba/2+an<=mr,li=Vr-ba/2-an>=0,(Ma.idealAlign==="left"||!ei)&&li)Vr-=ba/2,Ma.anchor="end";else if(ei)Vr+=ba/2,Ma.anchor="start";else{Ma.anchor="middle";var _i=an/2,xi=Vr+_i-mr,Pi=Vr-_i;xi>0&&(Vr-=xi),Pi<0&&(Vr+=-Pi)}Ma.crossPos=Vr}Kr.attr("text-anchor",Ma.anchor),_t&&Nr.attr("text-anchor",Ma.anchor),Xn.attr("transform",e(Vr,ma)+(Te?t(w):""))}),{hoverLabels:sn,commonLabelBoundingBox:Ee}}function O(j,ee,re,ue,_e,Te){var Ie,De,He="",et="";j.nameOverride!==void 0&&(j.name=j.nameOverride),j.name&&(j.trace._meta&&(j.name=A.templateString(j.name,j.trace._meta)),He=q(j.name,j.nameLength));var rt=re.charAt(0),$e=rt==="x"?"y":"x";j.zLabel!==void 0?(j.xLabel!==void 0&&(et+="x: "+j.xLabel+"
"),j.yLabel!==void 0&&(et+="y: "+j.yLabel+"
"),j.trace.type!=="choropleth"&&j.trace.type!=="choroplethmapbox"&&j.trace.type!=="choroplethmap"&&(et+=(et?"z: ":"")+j.zLabel)):ee&&j[rt+"Label"]===_e?et=j[$e+"Label"]||"":j.xLabel===void 0?j.yLabel!==void 0&&j.trace.type!=="scattercarpet"&&(et=j.yLabel):j.yLabel===void 0?et=j.xLabel:et="("+j.xLabel+", "+j.yLabel+")",(j.text||j.text===0)&&!Array.isArray(j.text)&&(et+=(et?"
":"")+j.text),j.extraText!==void 0&&(et+=(et?"
":"")+j.extraText),Te&&et===""&&!j.hovertemplate&&(He===""&&Te.remove(),et=He),(De=(Ie=j.trace)==null?void 0:Ie.hoverlabel)!=null&&De.split&&(j.hovertemplate="");let{hovertemplate:ot=!1}=j;if(ot){let Ae=j.hovertemplateLabels||j;j[rt+"Label"]!==_e&&(Ae[rt+"other"]=Ae[rt+"Val"],Ae[rt+"otherLabel"]=Ae[rt+"Label"]),et=A.hovertemplateString({data:[j.eventData[0]||{},j.trace._meta],fallback:j.trace.hovertemplatefallback,labels:Ae,locale:ue._d3locale,template:ot}),et=et.replace(F,(ge,ce)=>(He=q(ce,j.nameLength),""))}return[et,He]}function I(j,ee,re,ue){var _e=ee?"xa":"ya",Te=ee?"ya":"xa",Ie=0,De=1,He=j.size(),et=new Array(He),rt=0,$e=ue.minX,ot=ue.maxX,Ae=ue.minY,ge=ue.maxY,ce=function(be){return be*re._invScaleX},ze=function(be){return be*re._invScaleY};j.each(function(be){var Ce=be[_e],Ne=be[Te],Ee=Ce._id.charAt(0)==="x",Se=Ce.range;rt===0&&Se&&Se[0]>Se[1]!==Ee&&(De=-1);var Le=0,at=Ee?re.width:re.height;if(re.hovermode==="x"||re.hovermode==="y"){var dt=N(be,ee),gt=be.anchor,Ct=gt==="end"?-1:1,or,Qt;if(gt==="middle")or=be.crossPos+(Ee?ze(dt.y-be.by/2):ce(be.bx/2+be.tx2width/2)),Qt=or+(Ee?ze(be.by):ce(be.bx));else if(Ee)or=be.crossPos+ze(v+dt.y)-ze(be.by/2-v),Qt=or+ze(be.by);else{var Jt=ce(Ct*v+dt.x),Sr=Jt+ce(Ct*be.bx);or=be.crossPos+Math.min(Jt,Sr),Qt=be.crossPos+Math.max(Jt,Sr)}Ee?Ae!==void 0&&ge!==void 0&&Math.min(Qt,ge)-Math.max(or,Ae)>1&&(Ne.side==="left"?(Le=Ne._mainLinePosition,at=re.width):at=Ne._mainLinePosition):$e!==void 0&&ot!==void 0&&Math.min(Qt,ot)-Math.max(or,$e)>1&&(Ne.side==="top"?(Le=Ne._mainLinePosition,at=re.height):at=Ne._mainLinePosition)}et[rt++]=[{datum:be,traceIndex:be.trace.index,dp:0,pos:be.pos,posref:be.posref,size:be.by*(Ee?M:1)/2,pmin:Le,pmax:at}]}),et.sort(function(be,Ce){return be[0].posref-Ce[0].posref||De*(Ce[0].traceIndex-be[0].traceIndex)});var Qe,nt,Ke,kt,Et,Bt,jt;function _r(be){var Ce=be[0],Ne=be[be.length-1];if(nt=Ce.pmin-Ce.pos-Ce.dp+Ce.size,Ke=Ne.pos+Ne.dp+Ne.size-Ce.pmax,nt>.01){for(Et=be.length-1;Et>=0;Et--)be[Et].dp+=nt;Qe=!1}if(!(Ke<.01)){if(nt<-.01){for(Et=be.length-1;Et>=0;Et--)be[Et].dp-=Ke;Qe=!1}if(Qe){var Ee=0;for(kt=0;ktCe.pmax&&Ee++;for(kt=be.length-1;kt>=0&&!(Ee<=0);kt--)Bt=be[kt],Bt.pos>Ce.pmax-1&&(Bt.del=!0,Ee--);for(kt=0;kt=0;Et--)be[Et].dp-=Ke;for(kt=be.length-1;kt>=0&&!(Ee<=0);kt--)Bt=be[kt],Bt.pos+Bt.dp+Bt.size>Ce.pmax&&(Bt.del=!0,Ee--)}}}for(;!Qe&&Ie<=He;){for(Ie++,Qe=!0,kt=0;kt.01){for(Et=Or.length-1;Et>=0;Et--)Or[Et].dp+=nt;for(pr.push.apply(pr,Or),et.splice(kt+1,1),jt=0,Et=pr.length-1;Et>=0;Et--)jt+=pr[Et].dp;for(Ke=jt/pr.length,Et=pr.length-1;Et>=0;Et--)pr[Et].dp-=Ke;Qe=!1}else kt++}et.forEach(_r)}for(kt=et.length-1;kt>=0;kt--){var yt=et[kt];for(Et=yt.length-1;Et>=0;Et--){var Oe=yt[Et],Xe=Oe.datum;Xe.offset=Oe.dp,Xe.del=Oe.del}}}function N(j,ee){var re=0,ue=j.offset;return ee&&(ue*=-b,re=j.offset*y),{x:re,y:ue}}function U(j){var ee={start:1,end:-1,middle:0}[j.anchor],re=ee*(v+u),ue=re+ee*(j.txwidth+u),_e=j.anchor==="middle";return _e&&(re-=j.tx2width/2,ue+=j.txwidth/2+u),{alignShift:ee,textShiftX:re,text2ShiftX:ue}}function W(j,ee,re,ue){var _e=function(Ie){return Ie*re},Te=function(Ie){return Ie*ue};j.each(function(Ie){var De=V.select(this);if(Ie.del)return De.remove();var He=De.select("text.nums"),et=Ie.anchor,rt=et==="end"?-1:1,$e=U(Ie),ot=N(Ie,ee),Ae=ot.x,ge=ot.y,ce=et==="middle",ze="hoverlabel"in Ie.trace?Ie.trace.hoverlabel.showarrow:!0,Qe;ce?Qe="M-"+_e(Ie.bx/2+Ie.tx2width/2)+","+Te(ge-Ie.by/2)+"h"+_e(Ie.bx)+"v"+Te(Ie.by)+"h-"+_e(Ie.bx)+"Z":ze?Qe="M0,0L"+_e(rt*v+Ae)+","+Te(v+ge)+"v"+Te(Ie.by/2-v)+"h"+_e(rt*Ie.bx)+"v-"+Te(Ie.by)+"H"+_e(rt*v+Ae)+"V"+Te(ge-v)+"Z":Qe="M"+_e(rt*v+Ae)+","+Te(ge-Ie.by/2)+"h"+_e(rt*Ie.bx)+"v"+Te(Ie.by)+"h"+_e(-rt*Ie.bx)+"Z",De.select("path").attr("d",Qe);var nt=Ae+$e.textShiftX,Ke=ge+Ie.ty0-Ie.by/2+u,kt=Ie.textAlign||"auto";kt!=="auto"&&(kt==="left"&&et!=="start"?(He.attr("text-anchor","start"),nt=ce?-Ie.bx/2-Ie.tx2width/2+u:-Ie.bx-u):kt==="right"&&et!=="end"&&(He.attr("text-anchor","end"),nt=ce?Ie.bx/2-Ie.tx2width/2-u:Ie.bx+u)),He.call(o.positionText,_e(nt),Te(Ke)),Ie.tx2width&&(De.select("text.name").call(o.positionText,_e($e.text2ShiftX+$e.alignShift*u+Ae),Te(ge+Ie.ty0-Ie.by/2+u)),De.select("rect").call(i.setRect,_e($e.text2ShiftX+($e.alignShift-1)*Ie.tx2width/2+Ae),Te(ge-Ie.by/2-1),_e(Ie.tx2width),Te(Ie.by+2)))})}function Q(j,ee){var re=j.index,ue=j.trace||{},_e=j.cd[0],Te=j.cd[re]||{};function Ie(ot){return ot||d(ot)&&ot===0}var De=Array.isArray(re)?function(ot,Ae){var ge=A.castOption(_e,re,ot);return Ie(ge)?ge:A.extractOption({},ue,"",Ae)}:function(ot,Ae){return A.extractOption(Te,ue,ot,Ae)};function He(ot,Ae,ge){var ce=De(Ae,ge);Ie(ce)&&(j[ot]=ce)}if(He("hoverinfo","hi","hoverinfo"),He("bgcolor","hbg","hoverlabel.bgcolor"),He("borderColor","hbc","hoverlabel.bordercolor"),He("fontFamily","htf","hoverlabel.font.family"),He("fontSize","hts","hoverlabel.font.size"),He("fontColor","htc","hoverlabel.font.color"),He("fontWeight","htw","hoverlabel.font.weight"),He("fontStyle","hty","hoverlabel.font.style"),He("fontVariant","htv","hoverlabel.font.variant"),He("nameLength","hnl","hoverlabel.namelength"),He("textAlign","hta","hoverlabel.align"),j.posref=ee==="y"||ee==="closest"&&ue.orientation==="h"?j.xa._offset+(j.x0+j.x1)/2:j.ya._offset+(j.y0+j.y1)/2,j.x0=A.constrain(j.x0,0,j.xa._length),j.x1=A.constrain(j.x1,0,j.xa._length),j.y0=A.constrain(j.y0,0,j.ya._length),j.y1=A.constrain(j.y1,0,j.ya._length),j.xLabelVal!==void 0&&(j.xLabel="xLabel"in j?j.xLabel:h.hoverLabelText(j.xa,j.xLabelVal,ue.xhoverformat),j.xVal=j.xa.c2d(j.xLabelVal)),j.yLabelVal!==void 0&&(j.yLabel="yLabel"in j?j.yLabel:h.hoverLabelText(j.ya,j.yLabelVal,ue.yhoverformat),j.yVal=j.ya.c2d(j.yLabelVal)),j.zLabelVal!==void 0&&j.zLabel===void 0&&(j.zLabel=String(j.zLabelVal)),!isNaN(j.xerr)&&!(j.xa.type==="log"&&j.xerr<=0)){var et=h.tickText(j.xa,j.xa.c2l(j.xerr),"hover").text;j.xerrneg!==void 0?j.xLabel+=" +"+et+" / -"+h.tickText(j.xa,j.xa.c2l(j.xerrneg),"hover").text:j.xLabel+=" \xB1 "+et,ee==="x"&&(j.distance+=1)}if(!isNaN(j.yerr)&&!(j.ya.type==="log"&&j.yerr<=0)){var rt=h.tickText(j.ya,j.ya.c2l(j.yerr),"hover").text;j.yerrneg!==void 0?j.yLabel+=" +"+rt+" / -"+h.tickText(j.ya,j.ya.c2l(j.yerrneg),"hover").text:j.yLabel+=" \xB1 "+rt,ee==="y"&&(j.distance+=1)}var $e=j.hoverinfo||j.trace.hoverinfo;return $e&&$e!=="all"&&($e=Array.isArray($e)?$e:$e.split("+"),$e.indexOf("x")===-1&&(j.xLabel=void 0),$e.indexOf("y")===-1&&(j.yLabel=void 0),$e.indexOf("z")===-1&&(j.zLabel=void 0),$e.indexOf("text")===-1&&(j.text=void 0),$e.indexOf("name")===-1&&(j.name=void 0)),j}function le(j,ee,re){var ue=re.container,_e=re.fullLayout,Te=_e._size,Ie=re.event,De=!!ee.hLinePoint,He=!!ee.vLinePoint,et,rt;if(ue.selectAll(".spikeline").remove(),!!(He||De)){var $e=n.combine(_e.plot_bgcolor,_e.paper_bgcolor);if(De){var ot=ee.hLinePoint,Ae,ge;et=ot&&ot.xa,rt=ot&&ot.ya;var ce=rt.spikesnap;ce==="cursor"?(Ae=Ie.pointerX,ge=Ie.pointerY):(Ae=et._offset+ot.x,ge=rt._offset+ot.y);var ze=x.readability(ot.color,$e)<1.5?n.contrast($e):ot.color,Qe=rt.spikemode,nt=rt.spikethickness,Ke=rt.spikecolor||ze,kt=h.getPxPosition(j,rt),Et,Bt;if(Qe.indexOf("toaxis")!==-1||Qe.indexOf("across")!==-1){if(Qe.indexOf("toaxis")!==-1&&(Et=kt,Bt=Ae),Qe.indexOf("across")!==-1){var jt=rt._counterDomainMin,_r=rt._counterDomainMax;rt.anchor==="free"&&(jt=Math.min(jt,rt.position),_r=Math.max(_r,rt.position)),Et=Te.l+jt*Te.w,Bt=Te.l+_r*Te.w}ue.insert("line",":first-child").attr({x1:Et,x2:Bt,y1:ge,y2:ge,"stroke-width":nt,stroke:Ke,"stroke-dasharray":i.dashStyle(rt.spikedash,nt)}).classed("spikeline",!0).classed("crisp",!0),ue.insert("line",":first-child").attr({x1:Et,x2:Bt,y1:ge,y2:ge,"stroke-width":nt+2,stroke:$e}).classed("spikeline",!0).classed("crisp",!0)}Qe.indexOf("marker")!==-1&&ue.insert("circle",":first-child").attr({cx:kt+(rt.side!=="right"?nt:-nt),cy:ge,r:nt,fill:Ke}).classed("spikeline",!0)}if(He){var pr=ee.vLinePoint,Or,mr;et=pr&&pr.xa,rt=pr&&pr.ya;var Er=et.spikesnap;Er==="cursor"?(Or=Ie.pointerX,mr=Ie.pointerY):(Or=et._offset+pr.x,mr=rt._offset+pr.y);var yt=x.readability(pr.color,$e)<1.5?n.contrast($e):pr.color,Oe=et.spikemode,Xe=et.spikethickness,be=et.spikecolor||yt,Ce=h.getPxPosition(j,et),Ne,Ee;if(Oe.indexOf("toaxis")!==-1||Oe.indexOf("across")!==-1){if(Oe.indexOf("toaxis")!==-1&&(Ne=Ce,Ee=mr),Oe.indexOf("across")!==-1){var Se=et._counterDomainMin,Le=et._counterDomainMax;et.anchor==="free"&&(Se=Math.min(Se,et.position),Le=Math.max(Le,et.position)),Ne=Te.t+(1-Le)*Te.h,Ee=Te.t+(1-Se)*Te.h}ue.insert("line",":first-child").attr({x1:Or,x2:Or,y1:Ne,y2:Ee,"stroke-width":Xe,stroke:be,"stroke-dasharray":i.dashStyle(et.spikedash,Xe)}).classed("spikeline",!0).classed("crisp",!0),ue.insert("line",":first-child").attr({x1:Or,x2:Or,y1:Ne,y2:Ee,"stroke-width":Xe+2,stroke:$e}).classed("spikeline",!0).classed("crisp",!0)}Oe.indexOf("marker")!==-1&&ue.insert("circle",":first-child").attr({cx:Or,cy:Ce-(et.side!=="top"?Xe:-Xe),r:Xe,fill:be}).classed("spikeline",!0)}}}function se(j,ee,re){if(!re||re.length!==j._hoverdata.length)return!0;for(var ue=re.length-1;ue>=0;ue--){var _e=re[ue],Te=j._hoverdata[ue];if(_e.curveNumber!==Te.curveNumber||String(_e.pointNumber)!==String(Te.pointNumber)||String(_e.pointNumbers)!==String(Te.pointNumbers)||_e.binNumber!==Te.binNumber)return!0}return!1}function he(j,ee){return!ee||ee.vLinePoint!==j._spikepoints.vLinePoint||ee.hLinePoint!==j._spikepoints.hLinePoint}function q(j,ee){return o.plainText(j||"",{len:ee,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function $(j,ee){for(var re=ee.charAt(0),ue=[],_e=[],Te=[],Ie=0;Iej.offsetTop+j.clientTop,oe=j=>j.offsetLeft+j.clientLeft;function ne(j,ee){var re=j._fullLayout,ue=ee.getBoundingClientRect(),_e=ue.left,Te=ue.top,Ie=_e+ue.width,De=Te+ue.height,He=A.apply3DTransform(re._invTransform)(_e,Te),et=A.apply3DTransform(re._invTransform)(Ie,De),rt=He[0],$e=He[1],ot=et[0],Ae=et[1];return{x:rt,y:$e,width:ot-rt,height:Ae-$e,top:Math.min($e,Ae),left:Math.min(rt,ot),right:Math.max(rt,ot),bottom:Math.max($e,Ae)}}}}),Fm=We({"src/components/fx/hoverlabel_defaults.js"(Z,V){"use strict";var d=aa(),x=Fi(),A=Th().isUnifiedHover;V.exports=function(e,t,r,o){o=o||{};var a=t.legend;function i(n){o.font[n]||(o.font[n]=a?t.legend.font[n]:t.font[n])}t&&A(t.hovermode)&&(o.font||(o.font={}),i("size"),i("family"),i("color"),i("weight"),i("style"),i("variant"),a?(o.bgcolor||(o.bgcolor=x.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),r("hoverlabel.showarrow",o.showarrow),d.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}}}),oS=We({"src/components/fx/layout_global_defaults.js"(Z,V){"use strict";var d=aa(),x=Fm(),A=bd();V.exports=function(e,t){function r(o,a){return d.coerce(e,t,A,o,a)}x(e,t,r)}}}),sS=We({"src/components/fx/defaults.js"(Z,V){"use strict";var d=aa(),x=T0(),A=Fm();V.exports=function(e,t,r,o){function a(n,s){return d.coerce(e,t,x,n,s)}var i=d.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),A(e,t,a,i)}}}),yb=We({"src/components/fx/hovermode_defaults.js"(Z,V){"use strict";var d=aa(),x=bd();V.exports=function(E,e){function t(r,o){return e[r]!==void 0?e[r]:d.coerce(E,e,x,r,o)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),lS=We({"src/components/fx/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=bd(),A=yb(),E=Fm();V.exports=function(t,r){function o(m,p){return d.coerce(t,r,x,m,p)}var a=A(t,r);a&&(o("hoverdistance"),o("spikedistance"));var i=o("dragmode");i==="select"&&o("selectdirection");var n=r._has("mapbox"),s=r._has("map"),h=r._has("geo"),c=r._basePlotModules.length;r.dragmode==="zoom"&&((n||s||h)&&c===1||(n||s)&&h&&c===2)&&(r.dragmode="pan"),E(t,r,o),d.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),uS=We({"src/components/fx/calc.js"(Z,V){"use strict";var d=aa(),x=Wi();V.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(h){return function(c){return d.coerceHoverinfo({hoverinfo:c},{_module:h._module},r)}}for(var a=0;a"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Gy=We({"src/components/shapes/draw_newshape/constants.js"(Z,V){"use strict";var d=32;V.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Hy=We({"src/components/selections/helpers.js"(Z,V){"use strict";var d=aa().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function A(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}V.exports={p2r:x,r2p:A,axValue:E,getTransform:e}}}),Cd=We({"src/components/shapes/draw_newshape/helpers.js"(Z){"use strict";var V=zm(),d=Gy(),x=d.CIRCLE_SIDES,A=d.SQRT2,E=Hy(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Z.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var h="",c=0;c0&&_l&&(w="X"),w});return c>l&&(_=_.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+h)),m+_})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),xb=We({"src/components/shapes/display_labels.js"(Z,V){"use strict";var d=aa(),x=Mo(),A=zl(),E=Oo(),e=Cd().readPaths,t=Ld(),r=t.getPathString,o=zy(),a=gf().FROM_TL;V.exports=function(h,c,m,p){if(p.selectAll(".shape-label").remove(),!!(m.label.text||m.label.texttemplate)){var T;if(m.label.texttemplate){var l={};if(m.type!=="path"){var _=x.getFromId(h,m.xref),w=x.getFromId(h,m.yref);for(var S in o){var M=o[S](m,_,w);M!==void 0&&(l[S]=M)}}T=d.texttemplateStringForShapes({data:[l],fallback:m.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:m.label.texttemplate})}else T=m.label.text;var y={"data-index":c},b=m.label.font,v={"data-notex":1},u=p.append("g").attr(y).classed("shape-label",!0),g=u.append("text").attr(v).classed("shape-label-text",!0).text(T),f,P,L,z;if(m.path){var F=r(h,m),B=e(F,h);f=1/0,L=1/0,P=-1/0,z=-1/0;for(var O=0;O=s?p=h-m:p=m-h,-180/Math.PI*Math.atan2(p,T)}function n(s,h,c,m,p,T,l){var _=p.label.textposition,w=p.label.textangle,S=p.label.padding,M=p.type,y=Math.PI/180*T,b=Math.sin(y),v=Math.cos(y),u=p.label.xanchor,g=p.label.yanchor,f,P,L,z;if(M==="line"){_==="start"?(f=s,P=h):_==="end"?(f=c,P=m):(f=(s+c)/2,P=(h+m)/2),u==="auto"&&(_==="start"?w==="auto"?c>s?u="left":cs?u="right":cs?u="right":cs?u="left":c1&&!($e.length===2&&$e[1][0]==="Z")&&(q===0&&($e[0][0]="M"),f[he]=$e,B(),O())}}function ue($e,ot){if($e===2){he=+ot.srcElement.getAttribute("data-i"),q=+ot.srcElement.getAttribute("data-j");var Ae=f[he];!T(Ae)&&!l(Ae)&&re()}}function _e($e){le=[];for(var ot=0;otB&&Se>O&&!Ce.shiftKey?s.getCursor(Le/Ee,1-at/Se):"move";h(f,dt),Et=dt.split("-")[0]}}function pr(Ce){l(g)||(I&&($=ce(P.xanchor)),N&&(J=ze(P.yanchor)),P.type==="path"?Te=P.path:(le=I?P.x0:ce(P.x0),se=N?P.y0:ze(P.y0),he=I?P.x1:ce(P.x1),q=N?P.y1:ze(P.y1)),leq?(X=se,ee="y0",oe=q,re="y1"):(X=q,ee="y1",oe=se,re="y0"),_r(Ce),Oe(z,P),be(f,P,g),kt.moveFn=Et==="move"?Er:yt,kt.altKey=Ce.altKey)}function Or(){l(g)||(h(f),Xe(z),S(f,g,P),x.call("_guiRelayout",g,F.getUpdateObj()))}function mr(){l(g)||Xe(z)}function Er(Ce,Ne){if(P.type==="path"){var Ee=function(at){return at},Se=Ee,Le=Ee;I?Q("xanchor",P.xanchor=Qe($+Ce)):(Se=function(dt){return Qe(ce(dt)+Ce)},De&&De.type==="date"&&(Se=m.encodeDate(Se))),N?Q("yanchor",P.yanchor=nt(J+Ne)):(Le=function(dt){return nt(ze(dt)+Ne)},et&&et.type==="date"&&(Le=m.encodeDate(Le))),Q("path",P.path=y(Te,Se,Le))}else I?Q("xanchor",P.xanchor=Qe($+Ce)):(Q("x0",P.x0=Qe(le+Ce)),Q("x1",P.x1=Qe(he+Ce))),N?Q("yanchor",P.yanchor=nt(J+Ne)):(Q("y0",P.y0=nt(se+Ne)),Q("y1",P.y1=nt(q+Ne)));f.attr("d",p(g,P)),Oe(z,P),r(g,L,P,Ie)}function yt(Ce,Ne){if(W){var Ee=function(Ta){return Ta},Se=Ee,Le=Ee;I?Q("xanchor",P.xanchor=Qe($+Ce)):(Se=function(nn){return Qe(ce(nn)+Ce)},De&&De.type==="date"&&(Se=m.encodeDate(Se))),N?Q("yanchor",P.yanchor=nt(J+Ne)):(Le=function(nn){return nt(ze(nn)+Ne)},et&&et.type==="date"&&(Le=m.encodeDate(Le))),Q("path",P.path=y(Te,Se,Le))}else if(U){if(Et==="resize-over-start-point"){var at=le+Ce,dt=N?se-Ne:se+Ne;Q("x0",P.x0=I?at:Qe(at)),Q("y0",P.y0=N?dt:nt(dt))}else if(Et==="resize-over-end-point"){var gt=he+Ce,Ct=N?q-Ne:q+Ne;Q("x1",P.x1=I?gt:Qe(gt)),Q("y1",P.y1=N?Ct:nt(Ct))}}else{var or=function(Ta){return Et.indexOf(Ta)!==-1},Qt=or("n"),Jt=or("s"),Sr=or("w"),oa=or("e"),Ea=Qt?X+Ne:X,Sa=Jt?oe+Ne:oe,za=Sr?ne+Ce:ne,Na=oa?j+Ce:j;N&&(Qt&&(Ea=X-Ne),Jt&&(Sa=oe-Ne)),(!N&&Sa-Ea>O||N&&Ea-Sa>O)&&(Q(ee,P[ee]=N?Ea:nt(Ea)),Q(re,P[re]=N?Sa:nt(Sa))),Na-za>B&&(Q(ue,P[ue]=I?za:Qe(za)),Q(_e,P[_e]=I?Na:Qe(Na)))}f.attr("d",p(g,P)),Oe(z,P),r(g,L,P,Ie)}function Oe(Ce,Ne){(I||N)&&Ee();function Ee(){var Se=Ne.type!=="path",Le=Ce.selectAll(".visual-cue").data([0]),at=1;Le.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":at}).classed("visual-cue",!0);var dt=ce(I?Ne.xanchor:A.midRange(Se?[Ne.x0,Ne.x1]:m.extractPathCoords(Ne.path,c.paramIsX))),gt=ze(N?Ne.yanchor:A.midRange(Se?[Ne.y0,Ne.y1]:m.extractPathCoords(Ne.path,c.paramIsY)));if(dt=m.roundPositionForSharpStrokeRendering(dt,at),gt=m.roundPositionForSharpStrokeRendering(gt,at),I&&N){var Ct="M"+(dt-1-at)+","+(gt-1-at)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Le.attr("d",Ct)}else if(I){var or="M"+(dt-1-at)+","+(gt-9-at)+"v18 h2 v-18 Z";Le.attr("d",or)}else{var Qt="M"+(dt-9-at)+","+(gt-1-at)+"h18 v2 h-18 Z";Le.attr("d",Qt)}}}function Xe(Ce){Ce.selectAll(".visual-cue").remove()}function be(Ce,Ne,Ee){var Se=Ne.xref,Le=Ne.yref,at=E.getFromId(Ee,Se),dt=E.getFromId(Ee,Le),gt="";Se!=="paper"&&!at.autorange&&(gt+=Se),Le!=="paper"&&!dt.autorange&&(gt+=Le),i.setClipUrl(Ce,gt?"clip"+Ee._fullLayout._uid+gt:null,Ee)}}function y(g,f,P){return g.replace(c.segmentRE,function(L){var z=0,F=L.charAt(0),B=c.paramIsX[F],O=c.paramIsY[F],I=c.numParams[F],N=L.slice(1).replace(c.paramRE,function(U){return z>=I||(B[z]?U=f(U):O[z]&&(U=P(U)),z++),U});return F+N})}function b(g,f){if(_(g)){var P=f.node(),L=+P.getAttribute("data-index");if(L>=0){if(L===g._fullLayout._activeShapeIndex){v(g);return}g._fullLayout._activeShapeIndex=L,g._fullLayout._deactivateShape=v,T(g)}}}function v(g){if(_(g)){var f=g._fullLayout._activeShapeIndex;f>=0&&(o(g),delete g._fullLayout._activeShapeIndex,T(g))}}function u(g){if(_(g)){o(g);var f=g._fullLayout._activeShapeIndex,P=(g.layout||{}).shapes||[];if(f1?(se=["toggleHover"],he=["resetViews"]):u?(le=["zoomInGeo","zoomOutGeo"],se=["hoverClosestGeo"],he=["resetGeo"]):v?(se=["hoverClosest3d"],he=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(le=["zoomInMapbox","zoomOutMapbox"],se=["toggleHover"],he=["resetViewMapbox"]):z?(le=["zoomInMap","zoomOutMap"],se=["toggleHover"],he=["resetViewMap"]):g?se=["hoverClosestPie"]:O?(se=["hoverClosestCartesian","hoverCompareCartesian"],he=["resetViewSankey"]):se=["toggleHover"],b&&se.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(se=[]),b&&!I&&(le=["zoomIn2d","zoomOut2d","autoScale2d"],he[0]!=="resetViews"&&(he=["resetScale2d"])),v?q=["zoom3d","pan3d","orbitRotation","tableRotation"]:b&&!I||P?q=["zoom2d","pan2d"]:L||z||u?q=["pan2d"]:F&&(q=["zoom2d"]),n(T)&&q.push("select2d","lasso2d");var $=[],J=function(j){$.indexOf(j)===-1&&se.indexOf(j)!==-1&&$.push(j)};if(Array.isArray(M)){for(var X=[],oe=0;oew?T.slice(w):l.slice(_))+S}function h(m,p){for(var T=p._size,l=T.h/T.w,_={},w=Object.keys(m),S=0;St*P&&!B)){for(w=0;wq&&rese&&(se=re);var _e=(se-le)/(2*he);u/=_e,le=y.l2r(le),se=y.l2r(se),y.range=y._input.range=U=O[1]||W[1]<=O[0])&&Q[0]I[0])return!0}return!1}function S(O){var I=O._fullLayout,N=I._size,U=N.p,W=i.list(O,"",!0),Q,le,se,he,q,$;if(I._paperdiv.style({width:O._context.responsive&&I.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":I.width+"px",height:O._context.responsive&&I.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":I.height+"px"}).selectAll(".main-svg").call(r.setSize,I.width,I.height),O._context.setBackground(O,I.paper_bgcolor),Z.drawMainTitle(O),a.manage(O),!I._has("cartesian"))return x.previousPromises(O);function J(be,Ce,Ne){var Ee=be._lw/2;if(be._id.charAt(0)==="x"){if(Ce){if(Ne==="top")return Ce._offset-U-Ee}else return N.t+N.h*(1-(be.position||0))+Ee%1;return Ce._offset+Ce._length+U+Ee}if(Ce){if(Ne==="right")return Ce._offset+Ce._length+U+Ee}else return N.l+N.w*(be.position||0)+Ee%1;return Ce._offset-U-Ee}for(Q=0;Q0){f(O,Q,q,he),se.attr({x:le,y:Q,"text-anchor":U,dy:z(I.yanchor)}).call(E.positionText,le,Q);var $=(I.text.match(E.BR_TAG_ALL)||[]).length;if($){var J=n.LINE_SPACING*$+n.MID_SHIFT;I.y===0&&(J=-J),se.selectAll(".line").each(function(){var ee=+this.getAttribute("dy").slice(0,-2)-J+"em";this.setAttribute("dy",ee)})}var X=V.select(O).selectAll(".gtitle-subtitle");if(X.node()){var oe=se.node().getBBox(),ne=oe.y+oe.height,j=ne+o.SUBTITLE_PADDING_EM*I.subtitle.font.size;X.attr({x:le,y:j,"text-anchor":U,dy:z(I.yanchor)}).call(E.positionText,le,j)}}}};function v(O,I,N,U,W){var Q=I.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,le=A.isTopAnchor(I)?U:U-W,se=N==="b"?Q-le:le;return A.isTopAnchor(I)&&N==="t"||A.isBottomAnchor(I)&&N==="b"?!1:se.5?"t":"b",le=O._fullLayout.margin[Q],se=0;return I.yref==="paper"?se=N+I.pad.t+I.pad.b:I.yref==="container"&&(se=u(Q,U,W,O._fullLayout.height,N)+I.pad.t+I.pad.b),se>le?se:0}function f(O,I,N,U){var W="title.automargin",Q=O._fullLayout.title,le=Q.y>.5?"t":"b",se={x:Q.x,y:Q.y,t:0,b:0},he={};Q.yref==="paper"&&v(O,Q,le,I,U)?se[le]=N:Q.yref==="container"&&(he[le]=N,O._fullLayout._reservedMargin[W]=he),x.allowAutoMargin(O,W),x.autoMargin(O,W,se)}function P(O,I){var N=O.title,U=O._size,W=0;return I===p?W=N.pad.l:I===l&&(W=-N.pad.r),N.xref==="paper"?U.l+U.w*N.x+W:O.width*N.x+W}function L(O,I){var N=O.title,U=O._size,W=0;return I==="0em"||!I?W=-N.pad.b:I===n.CAP_SHIFT+"em"&&(W=N.pad.t),N.y==="auto"?U.t/2:N.yref==="paper"?U.t+U.h-U.h*N.y+W:O.height-O.height*N.y+W}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var I=O.title,N=T;return A.isRightAnchor(I)?N=l:A.isLeftAnchor(I)&&(N=p),N}function B(O){var I=O.title,N="0em";return A.isTopAnchor(I)?N=n.CAP_SHIFT+"em":A.isMiddleAnchor(I)&&(N=n.MID_SHIFT+"em"),N}Z.doTraceStyle=function(O){var I=O.calcdata,N=[],U;for(U=0;U=0;F--){var B=M.append("path").attr(b).style("opacity",F?.1:v).call(E.stroke,g).call(E.fill,u).call(e.dashLine,F?"solid":P,F?4+f:f);if(s(B,p,_),L){var O=t(p.layout,"selections",_);B.style({cursor:"move"});var I={element:B.node(),plotinfo:w,gd:p,editHelpers:O,isActiveSelection:!0},N=d(y,p);x(N,B,I)}else B.style("pointer-events",F?"all":"none");z[F]=B}var U=z[0],W=z[1];W.node().addEventListener("click",function(){return h(p,U)})}}function s(p,T,l){var _=l.xref+l.yref;e.setClipUrl(p,"clip"+T._fullLayout._uid+_,T)}function h(p,T){if(i(p)){var l=T.node(),_=+l.getAttribute("data-index");if(_>=0){if(_===p._fullLayout._activeSelectionIndex){m(p);return}p._fullLayout._activeSelectionIndex=_,p._fullLayout._deactivateSelection=m,a(p)}}}function c(p){if(i(p)){var T=p._fullLayout.selections.length-1;p._fullLayout._activeSelectionIndex=T,p._fullLayout._deactivateSelection=m,a(p)}}function m(p){if(i(p)){var T=p._fullLayout._activeSelectionIndex;T>=0&&(A(p),delete p._fullLayout._activeSelectionIndex,a(p))}}}}),dS=We({"node_modules/polybooljs/lib/build-log.js"(Z,V){function d(){var x,A=0,E=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return A++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?x:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}V.exports=d}}),pS=We({"node_modules/polybooljs/lib/epsilon.js"(Z,V){function d(x){typeof x!="number"&&(x=1e-10);var A={epsilon:function(E){return typeof E=="number"&&(x=E),x},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=E[0],s=E[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],a=E[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])x!=a-r>x&&(o-s)*(r-h)/(a-h)+s-t>x&&(i=!i),o=s,a=h}return i}};return A}V.exports=d}}),mS=We({"node_modules/polybooljs/lib/linked-list.js"(Z,V){var d={create:function(){var x={root:{root:!0,next:null},exists:function(A){return!(A===null||A===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(A,E){for(var e=x.root,t=x.root.next;t!==null;){if(E(t)){A.prev=t.prev,A.next=t,t.prev.next=A,t.prev=A;return}e=t,t=t.next}e.next=A,A.prev=e,A.next=null},findTransition:function(A){for(var E=x.root,e=x.root.next;e!==null&&!A(e);)E=e,e=e.next;return{before:E===x.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};V.exports=d}}),gS=We({"node_modules/polybooljs/lib/intersecter.js"(Z,V){var d=mS();function x(A,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,_){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:_.myFill.above,below:_.myFill.below},otherFill:null}}var o=d.create();function a(T,l,_,w,S,M){var y=E.pointsCompare(l,S);return y!==0?y:E.pointsSame(_,M)?0:T!==w?T?1:-1:E.pointAboveOrOnLine(_,w?S:M,w?M:S)?1:-1}function i(T,l){o.insertBefore(T,function(_){var w=a(T.isStart,T.pt,l,_.isStart,_.pt,_.other.pt);return w<0})}function n(T,l){var _=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(_,T.end),_}function s(T,l,_){var w=d.node({isStart:!1,pt:l.end,seg:l,primary:_,other:T,status:null});T.other=w,i(w,T.pt)}function h(T,l){var _=n(T,l);return s(_,T,l),_}function c(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function m(T,l){var _=r(l,T.seg.end,T.seg);return c(T,l),h(_,T.primary)}function p(T,l){var _=d.create();function w(O,I){var N=O.seg.start,U=O.seg.end,W=I.seg.start,Q=I.seg.end;return E.pointsCollinear(N,W,Q)?E.pointsCollinear(U,W,Q)||E.pointAboveOrOnLine(U,W,Q)?1:-1:E.pointAboveOrOnLine(N,W,Q)?1:-1}function S(O){return _.findTransition(function(I){var N=w(O,I.ev);return N>0})}function M(O,I){var N=O.seg,U=I.seg,W=N.start,Q=N.end,le=U.start,se=U.end;e&&e.checkIntersection(N,U);var he=E.linesIntersect(W,Q,le,se);if(he===!1){if(!E.pointsCollinear(W,Q,le)||E.pointsSame(W,se)||E.pointsSame(Q,le))return!1;var q=E.pointsSame(W,le),$=E.pointsSame(Q,se);if(q&&$)return I;var J=!q&&E.pointBetween(W,le,se),X=!$&&E.pointBetween(Q,le,se);if(q)return X?m(I,Q):m(O,se),I;J&&($||(X?m(I,Q):m(O,se)),m(I,W))}else he.alongA===0&&(he.alongB===-1?m(O,le):he.alongB===0?m(O,he.pt):he.alongB===1&&m(O,se)),he.alongB===0&&(he.alongA===-1?m(I,W):he.alongA===0?m(I,he.pt):he.alongA===1&&m(I,Q));return!1}for(var y=[];!o.isEmpty();){var b=o.getHead();if(e&&e.vert(b.pt[0]),b.isStart){let O=function(){if(g){var I=M(b,g);if(I)return I}return f?M(b,f):!1};var v=O;e&&e.segmentNew(b.seg,b.primary);var u=S(b),g=u.before?u.before.ev:null,f=u.after?u.after.ev:null;e&&e.tempStatus(b.seg,g?g.seg:!1,f?f.seg:!1);var P=O();if(P){if(A){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,L&&(P.seg.myFill.above=!P.seg.myFill.above)}else P.seg.otherFill=b.seg.myFill;e&&e.segmentUpdate(P.seg),b.other.remove(),b.remove()}if(o.getHead()!==b){e&&e.rewind(b.seg);continue}if(A){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,f?b.seg.myFill.below=f.seg.myFill.above:b.seg.myFill.below=T,L?b.seg.myFill.above=!b.seg.myFill.below:b.seg.myFill.above=b.seg.myFill.below}else if(b.seg.otherFill===null){var z;f?b.primary===f.primary?z=f.seg.otherFill.above:z=f.seg.myFill.above:z=b.primary?l:T,b.seg.otherFill={above:z,below:z}}e&&e.status(b.seg,g?g.seg:!1,f?f.seg:!1),b.other.status=u.insert(d.node({ev:b}))}else{var F=b.status;if(F===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(_.exists(F.prev)&&_.exists(F.next)&&M(F.prev.ev,F.next.ev),e&&e.statusRemove(F.ev.seg),F.remove(),!b.primary){var B=b.seg.myFill;b.seg.myFill=b.seg.otherFill,b.seg.otherFill=B}y.push(b.seg)}o.getHead().remove()}return e&&e.done(),y}return A?{addRegion:function(T){for(var l,_=T[T.length-1],w=0;wr!=m>r&&t<(c-s)*(r-h)/(m-h)+s;p&&(o=!o)}return o}}}),Um=We({"src/lib/polygon.js"(Z,V){"use strict";var d=Dy().dot,x=bs().BADNUM,A=V.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||S===x||Si||_&&h(l))}function m(l,_){var w=l[0],S=l[1];if(w===x||wo||S===x||Si)return!1;var M=t.length,y=t[0][0],b=t[0][1],v=0,u,g,f,P,L;for(u=1;uMath.max(g,y)||S>Math.max(f,b)))if(Sn||Math.abs(d(m,h))>o)return!0;return!1},A.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var h=r.length,c=o;r.splice(a+1);for(var m=c+1;m1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),TS=We({"src/components/selections/constants.js"(Z,V){"use strict";V.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),AS=We({"src/components/selections/select.js"(Z,V){"use strict";var d=bS(),x=wS(),A=Wi(),E=Oo().dashStyle,e=Fi(),t=hc(),r=Th().makeEventData,o=lv(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,h=o.selectMode,c=Ld(),m=Bm(),p=Xy(),T=Sd().clearOutline,l=Cd(),_=l.handleEllipse,w=l.readPaths,S=Wy().newShapes,M=_b(),y=Mb().activateLastSelection,b=aa(),v=b.sorterAsc,u=Um(),g=By(),f=cc().getFromId,P=Om(),L=Nm().redrawReglTraces,z=TS(),F=z.MINSELECT,B=u.filter,O=u.tester,I=Hy(),N=I.p2r,U=I.axValue,W=I.getTransform;function Q(Oe){return Oe.subplot!==void 0}function le(Oe,Xe,be,Ce,Ne){var Ee=!Q(Ce),Se=a(Ne),Le=i(Ne),at=s(Ne),dt=n(Ne),gt=h(Ne),Ct=Ne==="drawline",or=Ne==="drawcircle",Qt=Ct||or,Jt=Ce.gd,Sr=Jt._fullLayout,oa=gt&&Sr.newselection.mode==="immediate"&&Ee,Ea=Sr._zoomlayer,Sa=Ce.element.getBoundingClientRect(),za=Ce.plotinfo,Na=W(za),Ta=Xe-Sa.left,nn=be-Sa.top;Sr._calcInverseTransform(Jt);var gn=b.apply3DTransform(Sr._invTransform)(Ta,nn);Ta=gn[0],nn=gn[1];var Ht=Sr._invScaleX,It=Sr._invScaleY,Gt=Ta,Xt=nn,Rr="M"+Ta+","+nn,Yr=Ce.xaxes[0],Jr=Ce.yaxes[0],ia=Yr._length,Pa=Jr._length,Ga=Oe.altKey&&!(n(Ne)&&at),ja,Xa,sn,Ma,Xn,Kn,St;X(Oe,Jt,Ce),Se&&(ja=B([[Ta,nn]],z.BENDPX));var lt=Ea.selectAll("path.select-outline-"+za.id).data([1]),br=dt?Sr.newshape:Sr.newselection;dt&&(Ce.hasText=br.label.text||br.label.texttemplate);var kr=dt&&!at?br.fillcolor:"rgba(0,0,0,0)",Lr=br.line.color||(Ee?e.contrast(Jt._fullLayout.plot_bgcolor):"#7f7f7f");lt.enter().append("path").attr("class","select-outline select-outline-"+za.id).style({opacity:dt?br.opacity/2:1,"stroke-dasharray":E(br.line.dash,br.line.width),"stroke-width":br.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,Lr).call(e.fill,kr).attr("fill-rule","evenodd").classed("cursor-move",!!dt).attr("transform",Na).attr("d",Rr+"Z");var Tr=Ea.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",Na).attr("d","M0,0Z");if(dt&&Ce.hasText){var Cr=Ea.select(".label-temp");Cr.empty()&&(Cr=Ea.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Kr=Sr._uid+z.SELECTID,Nr=[],_t=re(Jt,Ce.xaxes,Ce.yaxes,Ce.subplot);oa&&!Oe.shiftKey&&(Ce._clearSubplotSelections=function(){if(Ee){var Ar=Yr._id,Vr=Jr._id;nt(Jt,Ar,Vr,_t);for(var ma=(Jt.layout||{}).selections||[],ba=[],wa=!1,$r=0;$r=0){Jt._fullLayout._deactivateShape(Jt);return}if(!dt){var ma=Sr.clickmode;g.done(Kr).then(function(){if(g.clear(Kr),Ar===2){for(lt.remove(),Xn=0;Xn<_t.length;Xn++)Kn=_t[Xn],Kn._module.selectPoints(Kn,!1);if(et(Jt,_t),j(Ce),yt(Jt),_t.length){var ba=_t[0].xaxis,wa=_t[0].yaxis;if(ba&&wa){for(var $r=[],ga=Jt._fullLayout.selections,jn=0;jn-1&&se(Vr,Jt,Ce.xaxes,Ce.yaxes,Ce.subplot,Ce,lt),ma==="event"&&Er(Jt,void 0);t.click(Jt,Vr,za.id)}).catch(b.error)}},Ce.doneFn=function(){Tr.remove(),g.done(Kr).then(function(){g.clear(Kr),!oa&&Ma&&Ce.selectionDefs&&(Ma.subtract=Ga,Ce.selectionDefs.push(Ma),Ce.mergedPolygons.length=0,[].push.apply(Ce.mergedPolygons,sn)),(oa||dt)&&j(Ce,oa),Ce.doneFnCompleted&&Ce.doneFnCompleted(Nr),gt&&Er(Jt,St)}).catch(b.error)}}function se(Oe,Xe,be,Ce,Ne,Ee,Se){var Le=Xe._hoverdata,at=Xe._fullLayout,dt=at.clickmode,gt=dt.indexOf("event")>-1,Ct=[],or,Qt,Jt,Sr,oa,Ea,Sa,za,Na,Ta;if(_e(Le)){X(Oe,Xe,Ee),or=re(Xe,be,Ce,Ne);var nn=Te(Le,or),gn=nn.pointNumbers.length>0;if(gn?De(or,nn):He(or)&&(Sa=Ie(nn))){for(Se&&Se.remove(),Ta=0;Ta=0}function ne(Oe){return Oe._fullLayout._activeSelectionIndex>=0}function j(Oe,Xe){var be=Oe.dragmode,Ce=Oe.plotinfo,Ne=Oe.gd;oe(Ne)&&Ne._fullLayout._deactivateShape(Ne),ne(Ne)&&Ne._fullLayout._deactivateSelection(Ne);var Ee=Ne._fullLayout,Se=Ee._zoomlayer,Le=n(be),at=h(be);if(Le||at){var dt=Se.selectAll(".select-outline-"+Ce.id);if(dt&&Ne._fullLayout._outlining){var gt;Le&&(gt=S(dt,Oe)),gt&&A.call("_guiRelayout",Ne,{shapes:gt});var Ct;at&&!Q(Oe)&&(Ct=M(dt,Oe)),Ct&&(Ne._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",Ne,{selections:Ct}).then(function(){Xe&&y(Ne)})),Ne._fullLayout._outlining=!1}}Ce.selection={},Ce.selection.selectionDefs=Oe.selectionDefs=[],Ce.selection.mergedPolygons=Oe.mergedPolygons=[]}function ee(Oe){return Oe._id}function re(Oe,Xe,be,Ce){if(!Oe.calcdata)return[];var Ne=[],Ee=Xe.map(ee),Se=be.map(ee),Le,at,dt;for(dt=0;dt0,Ee=Ne?Ce[0]:be;return Xe.selectedpoints?Xe.selectedpoints.indexOf(Ee)>-1:!1}function De(Oe,Xe){var be=[],Ce,Ne,Ee,Se;for(Se=0;Se0&&be.push(Ce);if(be.length===1&&(Ee=be[0]===Xe.searchInfo,Ee&&(Ne=Xe.searchInfo.cd[0].trace,Ne.selectedpoints.length===Xe.pointNumbers.length))){for(Se=0;Se1||(Xe+=Ce.selectedpoints.length,Xe>1)))return!1;return Xe===1}function et(Oe,Xe,be){var Ce;for(Ce=0;Ce-1&&Xe;if(!Se&&Xe){var Ar=kt(Oe,!0);if(Ar.length){var Vr=Ar[0].xref,ma=Ar[0].yref;if(Vr&&ma){var ba=jt(Ar),wa=pr([f(Oe,Vr,"x"),f(Oe,ma,"y")]);wa(Nr,ba)}}Oe._fullLayout._noEmitSelectedAtStart?Oe._fullLayout._noEmitSelectedAtStart=!1:Wt&&Er(Oe,Nr),or._reselect=!1}if(!Se&&or._deselect){var $r=or._deselect;Le=$r.xref,at=$r.yref,Qe(Le,at,gt)||nt(Oe,Le,at,Ce),Wt&&(Nr.points.length?Er(Oe,Nr):yt(Oe)),or._deselect=!1}return{eventData:Nr,selectionTesters:be}}function ze(Oe){var Xe=Oe.calcdata;if(Xe)for(var be=0;be=0){kr._fullLayout._deactivateShape(kr);return}var Lr=kr._fullLayout.clickmode;if($(kr),lt===2&&!Ae&&Xa(),ot)Lr.indexOf("select")>-1&&v(br,kr,nt,Ke,_e.id,gt),Lr.indexOf("event")>-1&&n.click(kr,br,_e.id);else if(lt===1&&Ae){var Tr=et?ce:ge,Cr=et==="s"||rt==="w"?0:1,Kr=Tr._name+".range["+Cr+"]",Nr=I(Tr,Cr),_t="left",Wt="middle";if(Tr.fixedrange)return;et?(Wt=et==="n"?"top":"bottom",Tr.side==="right"&&(_t="right")):rt==="e"&&(_t="right"),kr._context.showAxisRangeEntryBoxes&&d.select(dt).call(o.makeEditable,{gd:kr,immediate:!0,background:kr._fullLayout.paper_bgcolor,text:String(Nr),fill:Tr.tickfont?Tr.tickfont.color:"#444",horizontalAlign:_t,verticalAlign:Wt}).on("edit",function(Ar){var Vr=Tr.d2r(Ar);Vr!==void 0&&t.call("_guiRelayout",kr,Kr,Vr)})}}c.init(gt);var Qt,Jt,Sr,oa,Ea,Sa,za,Na,Ta,nn;function gn(lt,br,kr){var Lr=dt.getBoundingClientRect();Qt=br-Lr.left,Jt=kr-Lr.top,ue._fullLayout._calcInverseTransform(ue);var Tr=x.apply3DTransform(ue._fullLayout._invTransform)(Qt,Jt);Qt=Tr[0],Jt=Tr[1],Sr={l:Qt,r:Qt,w:0,t:Jt,b:Jt,h:0},oa=ue._hmpixcount?ue._hmlumcount/ue._hmpixcount:E(ue._fullLayout.plot_bgcolor).getLuminance(),Ea="M0,0H"+Bt+"V"+jt+"H0V0",Sa=!1,za="xy",nn=!1,Na=le($e,oa,kt,Et,Ea),Ta=se($e,kt,Et)}function Ht(lt,br){if(ue._transitioningWithDuration)return!1;var kr=Math.max(0,Math.min(Bt,Ee*lt+Qt)),Lr=Math.max(0,Math.min(jt,Se*br+Jt)),Tr=Math.abs(kr-Qt),Cr=Math.abs(Lr-Jt);Sr.l=Math.min(Qt,kr),Sr.r=Math.max(Qt,kr),Sr.t=Math.min(Jt,Lr),Sr.b=Math.max(Jt,Lr);function Kr(){za="",Sr.r=Sr.l,Sr.t=Sr.b,Ta.attr("d","M0,0Z")}if(_r.isSubplotConstrained)Tr>P||Cr>P?(za="xy",Tr/Bt>Cr/jt?(Cr=Tr*jt/Bt,Jt>Lr?Sr.t=Jt-Cr:Sr.b=Jt+Cr):(Tr=Cr*Bt/jt,Qt>kr?Sr.l=Qt-Tr:Sr.r=Qt+Tr),Ta.attr("d",ne(Sr))):Kr();else if(pr.isSubplotConstrained)if(Tr>P||Cr>P){za="xy";var Nr=Math.min(Sr.l/Bt,(jt-Sr.b)/jt),_t=Math.max(Sr.r/Bt,(jt-Sr.t)/jt);Sr.l=Nr*Bt,Sr.r=_t*Bt,Sr.b=(1-Nr)*jt,Sr.t=(1-_t)*jt,Ta.attr("d",ne(Sr))}else Kr();else!mr||Cr0){var Ar;if(pr.isSubplotConstrained||!Or&&mr.length===1){for(Ar=0;Ar1&&(Kr.maxallowed!==void 0&&yt===(Kr.range[0]1&&(Nr.maxallowed!==void 0&&Oe===(Nr.range[0]=0?Math.min(ue,.9):1/(1/Math.max(ue,-.3)+3.222))}function Q(ue,_e,Te){return ue?ue==="nsew"?Te?"":_e==="pan"?"move":"crosshair":ue.toLowerCase()+"-resize":"pointer"}function le(ue,_e,Te,Ie,De){return ue.append("path").attr("class","zoombox").style({fill:_e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Te,Ie)).attr("d",De+"Z")}function se(ue,_e,Te){return ue.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(_e,Te)).attr("d","M0,0Z")}function he(ue,_e,Te,Ie,De,He){ue.attr("d",Ie+"M"+Te.l+","+Te.t+"v"+Te.h+"h"+Te.w+"v-"+Te.h+"h-"+Te.w+"Z"),q(ue,_e,De,He)}function q(ue,_e,Te,Ie){Te||(ue.transition().style("fill",Ie>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_e.transition().style("opacity",1).duration(200))}function $(ue){d.select(ue).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function J(ue){L&&ue.data&&ue._context.showTips&&(x.notifier(x._(ue,"Double-click to zoom back out"),"long"),L=!1)}function X(ue,_e){return"M"+(ue.l-.5)+","+(_e-P-.5)+"h-3v"+(2*P+1)+"h3ZM"+(ue.r+.5)+","+(_e-P-.5)+"h3v"+(2*P+1)+"h-3Z"}function oe(ue,_e){return"M"+(_e-P-.5)+","+(ue.t-.5)+"v-3h"+(2*P+1)+"v3ZM"+(_e-P-.5)+","+(ue.b+.5)+"v3h"+(2*P+1)+"v-3Z"}function ne(ue){var _e=Math.floor(Math.min(ue.b-ue.t,ue.r-ue.l,P)/2);return"M"+(ue.l-3.5)+","+(ue.t-.5+_e)+"h3v"+-_e+"h"+_e+"v-3h-"+(_e+3)+"ZM"+(ue.r+3.5)+","+(ue.t-.5+_e)+"h-3v"+-_e+"h"+-_e+"v-3h"+(_e+3)+"ZM"+(ue.r+3.5)+","+(ue.b+.5-_e)+"h-3v"+_e+"h"+-_e+"v3h"+(_e+3)+"ZM"+(ue.l-3.5)+","+(ue.b+.5-_e)+"h3v"+_e+"h"+_e+"v3h-"+(_e+3)+"Z"}function j(ue,_e,Te,Ie,De){for(var He=!1,et={},rt={},$e,ot,Ae,ge,ce=(De||{}).xaHash,ze=(De||{}).yaHash,Qe=0;Qe<_e.length;Qe++){var nt=_e[Qe];for($e in Te)if(nt[$e]){for(Ae in nt)!(De&&(ce[Ae]||ze[Ae]))&&!(Ae.charAt(0)==="x"?Te:Ie)[Ae]&&(et[Ae]=$e);for(ot in Ie)!(De&&(ce[ot]||ze[ot]))&&nt[ot]&&(He=!0)}for(ot in Ie)if(nt[ot])for(ge in nt)!(De&&(ce[ge]||ze[ge]))&&!(ge.charAt(0)==="x"?Te:Ie)[ge]&&(rt[ge]=ot)}He&&(x.extendFlat(et,rt),rt={});var Ke={},kt=[];for(Ae in et){var Et=M(ue,Ae);kt.push(Et),Ke[Et._id]=Et}var Bt={},jt=[];for(ge in rt){var _r=M(ue,ge);jt.push(_r),Bt[_r._id]=_r}return{xaHash:Ke,yaHash:Bt,xaxes:kt,yaxes:jt,xLinks:et,yLinks:rt,isSubplotConstrained:He}}function ee(ue,_e){if(!e)ue.onwheel!==void 0?ue.onwheel=_e:ue.onmousewheel!==void 0?ue.onmousewheel=_e:ue.isAddedWheelEvent||(ue.isAddedWheelEvent=!0,ue.addEventListener("wheel",_e,{passive:!1}));else{var Te=ue.onwheel!==void 0?"wheel":"mousewheel";ue._onwheel&&ue.removeEventListener(Te,ue._onwheel),ue._onwheel=_e,ue.addEventListener(Te,_e,{passive:!1})}}function re(ue){var _e=[];for(var Te in ue)_e.push(ue[Te]);return _e}V.exports={makeDragBox:z,makeDragger:F,makeRectDragger:B,makeZoombox:le,makeCorners:se,updateZoombox:he,xyCorners:ne,transitionZoombox:q,removeZoombox:$,showDoubleClickNotifier:J,attachWheelEventHandler:ee}}}),Lb=We({"src/plots/cartesian/graph_interact.js"(Z){"use strict";var V=Hi(),d=hc(),x=ih(),A=sv(),E=Cb().makeDragBox,e=Sf().DRAGGERSIZE;Z.initInteractions=function(r){var o=r._fullLayout;if(r._context.staticPlot){V.select(r).selectAll(".drag").remove();return}if(!(!o._has("cartesian")&&!o._has("splom"))){var a=Object.keys(o._plots||{}).sort(function(n,s){if((o._plots[n].mainplot&&!0)===(o._plots[s].mainplot&&!0)){var h=n.split("y"),c=s.split("y");return h[0]===c[0]?Number(h[1]||1)-Number(c[1]||1):Number(h[0]||1)-Number(c[0]||1)}return o._plots[n].mainplot?1:-1});a.forEach(function(n){var s=o._plots[n],h=s.xaxis,c=s.yaxis;if(!s.mainplot){var m=E(r,s,h._offset,c._offset,h._length,c._length,"ns","ew");m.onmousemove=function(l){r._fullLayout._rehover=function(){r._fullLayout._hoversubplot===n&&r._fullLayout._plots[n]&&d.hover(r,l,n)},d.hover(r,l,n),r._fullLayout._lasthover=m,r._fullLayout._hoversubplot=n},m.onmouseout=function(l){r._dragging||(r._fullLayout._hoversubplot=null,x.unhover(r,l))},r._context.showAxisDragHandles&&(E(r,s,h._offset-e,c._offset-e,e,e,"n","w"),E(r,s,h._offset+h._length,c._offset-e,e,e,"n","e"),E(r,s,h._offset-e,c._offset+c._length,e,e,"s","w"),E(r,s,h._offset+h._length,c._offset+c._length,e,e,"s","e"))}if(r._context.showAxisDragHandles){if(n===h._mainSubplot){var p=h._mainLinePosition;h.side==="top"&&(p-=e),E(r,s,h._offset+h._length*.1,p,h._length*.8,e,"","ew"),E(r,s,h._offset,p,h._length*.1,e,"","w"),E(r,s,h._offset+h._length*.9,p,h._length*.1,e,"","e")}if(n===c._mainSubplot){var T=c._mainLinePosition;c.side!=="right"&&(T-=e),E(r,s,T,c._offset+c._length*.1,e,c._length*.8,"ns",""),E(r,s,T,c._offset+c._length*.9,e,c._length*.1,"s",""),E(r,s,T,c._offset,e,c._length*.1,"n","")}}});var i=o._hoverlayer.node();i.onmousemove=function(n){n.target=r._fullLayout._lasthover,d.hover(r,n,o._hoversubplot)},i.onclick=function(n){n.target=r._fullLayout._lasthover,d.click(r,n)},i.onmousedown=function(n){r._fullLayout._lasthover.onmousedown(n)},Z.updateFx(r)}},Z.updateFx=function(t){var r=t._fullLayout,o=r.dragmode==="pan"?"move":"crosshair";A(r._draggers,o)}}}),ES=We({"src/plot_api/container_array_match.js"(Z,V){"use strict";var d=Wi();V.exports=function(A){for(var E=d.layoutArrayContainers,e=d.layoutArrayRegexes,t=A.split("[")[0],r,o,a=0;a1&&x.warn("Full array edits are incompatible with other edits",h);var w=i[""][""];if(t(w))a.set(null);else if(Array.isArray(w))a.set(w);else return x.warn("Unrecognized full array edit value",h,w),!0;return T?!1:(c(l,_),m(o),!0)}var S=Object.keys(i).map(Number).sort(A),M=a.get(),y=M||[],b=s(_,h).get(),v=[],u=-1,g=y.length,f,P,L,z,F,B,O,I;for(f=0;fy.length-(O?0:1)){x.warn("index out of range",h,L);continue}if(B!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",h,L),t(B)?v.push(L):O?(B==="add"&&(B={}),y.splice(L,0,B),b&&b.splice(L,0,{})):x.warn("Unrecognized full object edit value",h,L,B),u===-1&&(u=L);else for(P=0;P=0;f--)y.splice(v[f],1),b&&b.splice(v[f],1);if(y.length?M||a.set(y):a.set(null),T)return!1;if(c(l,_),p!==d){var N;if(u===-1)N=S;else{for(g=Math.max(y.length,g),N=[],f=0;f=u));f++)N.push(L);for(f=u;f0&&x.log("Clearing previous rejected promises from queue."),l._promises=[]},Z.cleanLayout=function(l){var _,w;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var S=(A.subplotsRegistry.cartesian||{}).attrRegex,M=(A.subplotsRegistry.polar||{}).attrRegex,y=(A.subplotsRegistry.ternary||{}).attrRegex,b=(A.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(l);for(_=0;_3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),e.clean(l),l.template&&l.template.layout&&Z.cleanLayout(l.template.layout),l};function i(l,_){var w=l[_],S=_.charAt(0);w&&w!=="paper"&&(l[_]=t(w,S,!0))}Z.cleanData=function(l){for(var _=0;_0)return l.slice(0,_)}Z.hasParent=function(l,_){for(var w=p(_);w;){if(w in l)return!0;w=p(w)}return!1},Z.clearAxisTypes=function(l,_,w){for(var S=0;S<_.length;S++)for(var M=l._fullData[S],y=0;y<3;y++){var b=r(l,M,a[y]);if(b&&b.type!=="log"){var v=b._name,u=b._id.slice(1);if(u.slice(0,5)==="scene"){if(w[u]!==void 0)continue;v=u+"."+v}var g=v+".type";w[v]===void 0&&w[g]===void 0&&x.nestedProperty(l.layout,g).set(null)}}};var T=(l,_)=>{let w=(...S)=>S.every(M=>x.isPlainObject(M))||S.every(M=>Array.isArray(M));if([l,_].every(S=>Array.isArray(S))){if(l.length!==_.length)return!1;for(let S=0;Sx.isPlainObject(S))){if(Object.keys(l).length!==Object.keys(_).length)return!1;for(let S in l){if(S.startsWith("_"))continue;let M=l[S],y=_[S];if(M!==y&&!(w(M,y)?T(M,y):!1))return!1}return!0}return!1};Z.collectionsAreEqual=T}}),Yy=We({"src/plot_api/plot_api.js"(Z){"use strict";var V=Hi(),d=Uo(),x=ab(),A=aa(),E=A.nestedProperty,e=M0(),t=XA(),r=Wi(),o=E0(),a=Nu(),i=Mo(),n=fb(),s=Of(),h=Oo(),c=Fi(),m=Lb().initInteractions,p=Fh(),T=Ec().clearOutline,l=gp().dfltConfig,_=kS(),w=CS(),S=Nm(),M=Iu(),y=Sf().AX_NAME_PATTERN,b=0,v=5;function u(be,Ce,Ne,Ee){var Se;if(be=A.getGraphDiv(be),e.init(be),A.isPlainObject(Ce)){var Le=Ce;Ce=Le.data,Ne=Le.layout,Ee=Le.config,Se=Le.frames}var at=e.triggerHandler(be,"plotly_beforeplot",[Ce,Ne,Ee]);if(at===!1)return Promise.reject();!Ce&&!Ne&&!A.isPlotDiv(be)&&A.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",be);function dt(){if(Se)return Z.addFrames(be,Se)}z(be,Ee),Ne||(Ne={}),V.select(be).classed("js-plotly-plot",!0),h.makeTester(),Array.isArray(be._promises)||(be._promises=[]);var gt=(be.data||[]).length===0&&Array.isArray(Ce);Array.isArray(Ce)&&(w.cleanData(Ce),gt?be.data=Ce:be.data.push.apply(be.data,Ce),be.empty=!1),(!be.layout||gt)&&(be.layout=w.cleanLayout(Ne)),a.supplyDefaults(be);var Ct=be._fullLayout,or=Ct._has("cartesian");Ct._replotting=!0,(gt||Ct._shouldCreateBgLayer)&&(Xe(be),Ct._shouldCreateBgLayer&&delete Ct._shouldCreateBgLayer),h.initGradients(be),h.initPatterns(be),gt&&i.saveShowSpikeInitial(be);var Qt=!be.calcdata||be.calcdata.length!==(be._fullData||[]).length;Qt&&a.doCalcdata(be);for(var Jt=0;Jt=be.data.length||Se<-be.data.length)throw new Error(Ne+" must be valid indices for gd.data.");if(Ce.indexOf(Se,Ee+1)>-1||Se>=0&&Ce.indexOf(-be.data.length+Se)>-1||Se<0&&Ce.indexOf(be.data.length+Se)>-1)throw new Error("each index in "+Ne+" must be unique.")}}function N(be,Ce,Ne){if(!Array.isArray(be.data))throw new Error("gd.data must be an array.");if(typeof Ce>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(Ce)||(Ce=[Ce]),I(be,Ce,"currentIndices"),typeof Ne<"u"&&!Array.isArray(Ne)&&(Ne=[Ne]),typeof Ne<"u"&&I(be,Ne,"newIndices"),typeof Ne<"u"&&Ce.length!==Ne.length)throw new Error("current and new indices must be of equal length.")}function U(be,Ce,Ne){var Ee,Se;if(!Array.isArray(be.data))throw new Error("gd.data must be an array.");if(typeof Ce>"u")throw new Error("traces must be defined.");for(Array.isArray(Ce)||(Ce=[Ce]),Ee=0;Ee"u")throw new Error("indices must be an integer or array of integers");I(be,Ne,"indices");for(var Le in Ce){if(!Array.isArray(Ce[Le])||Ce[Le].length!==Ne.length)throw new Error("attribute "+Le+" must be an array of length equal to indices array length");if(Se&&(!(Le in Ee)||!Array.isArray(Ee[Le])||Ee[Le].length!==Ce[Le].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function Q(be,Ce,Ne,Ee){var Se=A.isPlainObject(Ee),Le=[],at,dt,gt,Ct,or;Array.isArray(Ne)||(Ne=[Ne]),Ne=O(Ne,be.data.length-1);for(var Qt in Ce)for(var Jt=0;Jt=0&&or=0&&or"u")return Ct=Z.redraw(be),t.add(be,Se,at,Le,dt),Ct;Array.isArray(Ne)||(Ne=[Ne]);try{N(be,Ee,Ne)}catch(or){throw be.data.splice(be.data.length-Ce.length,Ce.length),or}return t.startSequence(be),t.add(be,Se,at,Le,dt),Ct=Z.moveTraces(be,Ee,Ne),t.stopSequence(be),Ct}function J(be,Ce){be=A.getGraphDiv(be);var Ne=[],Ee=Z.addTraces,Se=J,Le=[be,Ne,Ce],at=[be,Ce],dt,gt;if(typeof Ce>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(Ce)||(Ce=[Ce]),I(be,Ce,"indices"),Ce=O(Ce,be.data.length-1),Ce.sort(A.sorterDes),dt=0;dt"u")for(Ne=[],Ct=0;Ct0&&typeof Gt.parts[Yr]!="string";)Yr--;var Jr=Gt.parts[Yr],ia=Gt.parts[Yr-1]+"."+Jr,Pa=Gt.parts.slice(0,Yr).join("."),Ga=E(be.layout,Pa).get(),ja=E(Ee,Pa).get(),Xa=Gt.get();if(Xt!==void 0){za[It]=Xt,Na[It]=Jr==="reverse"?Xt:ne(Xa);var sn=o.getLayoutValObject(Ee,Gt.parts);if(sn&&sn.impliedEdits&&Xt!==null)for(var Ma in sn.impliedEdits)Ta(A.relativeAttr(It,Ma),sn.impliedEdits[Ma]);if(["width","height"].indexOf(It)!==-1)if(Xt){Ta("autosize",null);var Xn=It==="height"?"width":"height";Ta(Xn,Ee[Xn])}else Ee[It]=be._initialAutoSize[It];else if(It==="autosize")Ta("width",Xt?null:Ee.width),Ta("height",Xt?null:Ee.height);else if(ia.match(De))Ht(ia),E(Ee,Pa+"._inputRange").set(null);else if(ia.match(He)){Ht(ia),E(Ee,Pa+"._inputRange").set(null);var Kn=E(Ee,Pa).get();Kn._inputDomain&&(Kn._input.domain=Kn._inputDomain.slice())}else ia.match(et)&&E(Ee,Pa+"._inputDomain").set(null);if(Jr==="type"){gn=Ga;var St=ja.type==="linear"&&Xt==="log",lt=ja.type==="log"&&Xt==="linear";if(St||lt){if(!gn||!gn.range)Ta(Pa+".autorange",!0);else if(ja.autorange)St&&(gn.range=gn.range[1]>gn.range[0]?[1,2]:[2,1]);else{var br=gn.range[0],kr=gn.range[1];St?(br<=0&&kr<=0&&Ta(Pa+".autorange",!0),br<=0?br=kr/1e6:kr<=0&&(kr=br/1e6),Ta(Pa+".range[0]",Math.log(br)/Math.LN10),Ta(Pa+".range[1]",Math.log(kr)/Math.LN10)):(Ta(Pa+".range[0]",Math.pow(10,br)),Ta(Pa+".range[1]",Math.pow(10,kr)))}Array.isArray(Ee._subplots.polar)&&Ee._subplots.polar.length&&Ee[Gt.parts[0]]&&Gt.parts[1]==="radialaxis"&&delete Ee[Gt.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(be,ja,Xt,Ta),r.getComponentMethod("images","convertCoords")(be,ja,Xt,Ta)}else Ta(Pa+".autorange",!0),Ta(Pa+".range",null);E(Ee,Pa+"._inputRange").set(null)}else if(Jr.match(y)){var Lr=E(Ee,It).get(),Tr=(Xt||{}).type;(!Tr||Tr==="-")&&(Tr="linear"),r.getComponentMethod("annotations","convertCoords")(be,Lr,Tr,Ta),r.getComponentMethod("images","convertCoords")(be,Lr,Tr,Ta)}var Cr=_.containerArrayMatch(It);if(Cr){or=Cr.array,Qt=Cr.index;var Kr=Cr.property,Nr=sn||{editType:"calc"};Qt!==""&&Kr===""&&(_.isAddVal(Xt)?Na[It]=null:_.isRemoveVal(Xt)?Na[It]=(E(Ne,or).get()||[])[Qt]:A.warn("unrecognized full object value",Ce)),M.update(Sa,Nr),Ct[or]||(Ct[or]={});var _t=Ct[or][Qt];_t||(_t=Ct[or][Qt]={}),_t[Kr]=Xt,delete Ce[It]}else Jr==="reverse"?(Ga.range?Ga.range.reverse():(Ta(Pa+".autorange",!0),Ga.range=[1,0]),ja.autorange?Sa.calc=!0:Sa.plot=!0):(It==="dragmode"&&(Xt===!1&&Xa!==!1||Xt!==!1&&Xa===!1)||Ee._has("scatter-like")&&Ee._has("regl")&&It==="dragmode"&&(Xt==="lasso"||Xt==="select")&&!(Xa==="lasso"||Xa==="select")?Sa.plot=!0:sn?M.update(Sa,sn):Sa.calc=!0,Gt.set(Xt))}}for(or in Ct){var Wt=_.applyContainerArrayChanges(be,Le(Ne,or),Ct[or],Sa,Le);Wt||(Sa.plot=!0)}for(var Ar in nn){gn=i.getFromId(be,Ar);var Vr=gn&&gn._constraintGroup;if(Vr){Sa.calc=!0;for(var ma in Vr)nn[ma]||(i.getFromId(be,ma)._constraintShrinkable=!0)}}($e(be)||Ce.height||Ce.width)&&(Sa.plot=!0);var ba=Ee.shapes;for(Qt=0;Qt1;)if(Ee.pop(),Ne=E(Ce,Ee.join(".")+".uirevision").get(),Ne!==void 0)return Ne;return Ce.uirevision}function nt(be,Ce){for(var Ne=0;Ne[Pa,be._ev.listeners(Pa)]);Le=Z.newPlot(be,Ce,Ne,Ee).then(()=>{for(let[Pa,Ga]of ia)Ga.forEach(ja=>be.on(Pa,ja));return Z.react(be,Ce,Ne,Ee)})}else{be.data=Ce||[],w.cleanData(be.data),be.layout=Ne||{},w.cleanLayout(be.layout),Et(be.data,be.layout,dt,gt),a.supplyDefaults(be,{skipUpdateCalc:!0});var Qt=be._fullData,Jt=be._fullLayout,Sr=Jt.datarevision===void 0,oa=Jt.transition,Ea=_r(be,gt,Jt,Sr,oa),Sa=Ea.newDataRevision,za=jt(be,dt,Qt,Sr,oa,Sa);if($e(be)&&(Ea.layoutReplot=!0),za.calc||Ea.calc){be.calcdata=void 0;for(var Na=Object.getOwnPropertyNames(Jt),Ta=0;Ta(or||be.emit("plotly_react",{config:Ee,data:Ce,layout:Ne}),be))}function jt(be,Ce,Ne,Ee,Se,Le){var at=Ce.length===Ne.length;if(!Se&&!at)return{fullReplot:!0,calc:!0};var dt=M.traceFlags();dt.arrays={},dt.nChanges=0,dt.nChangesAnim=0;var gt,Ct;function or(Sr){var oa=o.getTraceValObject(Ct,Sr);return!Ct._module.animatable&&oa.anim&&(oa.anim=!1),oa}var Qt={getValObject:or,flags:dt,immutable:Ee,transition:Se,newDataRevision:Le,gd:be},Jt={};for(gt=0;gt=Se.length?Se[0]:Se[Ct]:Se}function dt(Ct){return Array.isArray(Le)?Ct>=Le.length?Le[0]:Le[Ct]:Le}function gt(Ct,or){var Qt=0;return function(){if(Ct&&++Qt===or)return Ct()}}return new Promise(function(Ct,or){function Qt(){if(Ee._frameQueue.length!==0){for(;Ee._frameQueue.length;){var Jr=Ee._frameQueue.pop();Jr.onInterrupt&&Jr.onInterrupt()}be.emit("plotly_animationinterrupted",[])}}function Jt(Jr){if(Jr.length!==0){for(var ia=0;iaEe._timeToNext&&oa()};Jr()}var Sa=0;function za(Jr){return Array.isArray(Se)?Sa>=Se.length?Jr.transitionOpts=Se[Sa]:Jr.transitionOpts=Se[0]:Jr.transitionOpts=Se,Sa++,Jr}var Na,Ta,nn=[],gn=Ce==null,Ht=Array.isArray(Ce),It=!gn&&!Ht&&A.isPlainObject(Ce);if(It)nn.push({type:"object",data:za(A.extendFlat({},Ce))});else if(gn||["string","number"].indexOf(typeof Ce)!==-1)for(Na=0;Na0&&RrRr)&&Yr.push(Ta);nn=Yr}}nn.length>0?Jt(nn):(be.emit("plotly_animated"),Ct())})}function mr(be,Ce,Ne){if(be=A.getGraphDiv(be),Ce==null)return Promise.resolve();if(!A.isPlotDiv(be))throw new Error("This element is not a Plotly plot: "+be+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Ee,Se,Le,at,dt=be._transitionData._frames,gt=be._transitionData._frameHash;if(!Array.isArray(Ce))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+Ce);var Ct=dt.length+Ce.length*2,or=[],Qt={};for(Ee=Ce.length-1;Ee>=0;Ee--)if(A.isPlainObject(Ce[Ee])){var Jt=Ce[Ee].name,Sr=(gt[Jt]||Qt[Jt]||{}).name,oa=Ce[Ee].name,Ea=gt[Sr]||Qt[Sr];Sr&&oa&&typeof oa=="number"&&Ea&&bGt.index?-1:It.index=0;Ee--){if(Se=or[Ee].frame,typeof Se.name=="number"&&A.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Se.name)for(;gt[Se.name="frame "+be._transitionData._counter++];);if(gt[Se.name]){for(Le=0;Le=0;Ne--)Ee=Ce[Ne],Le.push({type:"delete",index:Ee}),at.unshift({type:"insert",index:Ee,value:Se[Ee]});var dt=a.modifyFrames,gt=a.modifyFrames,Ct=[be,at],or=[be,Le];return t&&t.add(be,dt,Ct,gt,or),a.modifyFrames(be,Le)}function yt(be){be=A.getGraphDiv(be);var Ce=be._fullLayout||{},Ne=be._fullData||[];return a.cleanPlot([],{},Ne,Ce),a.purge(be),e.purge(be),Ce._container&&Ce._container.remove(),delete be._context,be}function Oe(be){var Ce=be._fullLayout,Ne=be.getBoundingClientRect();if(!A.equalDomRects(Ne,Ce._lastBBox)){var Ee=Ce._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(be));Ce._invScaleX=Math.sqrt(Ee[0][0]*Ee[0][0]+Ee[0][1]*Ee[0][1]+Ee[0][2]*Ee[0][2]),Ce._invScaleY=Math.sqrt(Ee[1][0]*Ee[1][0]+Ee[1][1]*Ee[1][1]+Ee[1][2]*Ee[1][2]),Ce._lastBBox=Ne}}function Xe(be){var Ce=V.select(be),Ne=be._fullLayout;if(Ne._calcInverseTransform=Oe,Ne._calcInverseTransform(be),Ne._container=Ce.selectAll(".plot-container").data([0]),Ne._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Ne._paperdiv=Ne._container.selectAll(".svg-container").data([0]),Ne._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Ne._glcontainer=Ne._paperdiv.selectAll(".gl-container").data([{}]),Ne._glcontainer.enter().append("div").classed("gl-container",!0),Ne._paperdiv.selectAll(".main-svg").remove(),Ne._paperdiv.select(".modebar-container").remove(),Ne._paper=Ne._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Ne._toppaper=Ne._paperdiv.append("svg").classed("main-svg",!0),Ne._modebardiv=Ne._paperdiv.append("div"),delete Ne._modeBar,Ne._hoverpaper=Ne._paperdiv.append("svg").classed("main-svg",!0),!Ne._uid){var Ee={};V.selectAll("defs").each(function(){this.id&&(Ee[this.id.split("-")[1]]=1)}),Ne._uid=A.randstr(Ee)}Ne._paperdiv.selectAll(".main-svg").attr(p.svgAttrs),Ne._defs=Ne._paper.append("defs").attr("id","defs-"+Ne._uid),Ne._clips=Ne._defs.append("g").classed("clips",!0),Ne._topdefs=Ne._toppaper.append("defs").attr("id","topdefs-"+Ne._uid),Ne._topclips=Ne._topdefs.append("g").classed("clips",!0),Ne._bgLayer=Ne._paper.append("g").classed("bglayer",!0),Ne._draggers=Ne._paper.append("g").classed("draglayer",!0);var Se=Ne._paper.append("g").classed("layer-below",!0);Ne._imageLowerLayer=Se.append("g").classed("imagelayer",!0),Ne._shapeLowerLayer=Se.append("g").classed("shapelayer",!0),Ne._cartesianlayer=Ne._paper.append("g").classed("cartesianlayer",!0),Ne._polarlayer=Ne._paper.append("g").classed("polarlayer",!0),Ne._smithlayer=Ne._paper.append("g").classed("smithlayer",!0),Ne._ternarylayer=Ne._paper.append("g").classed("ternarylayer",!0),Ne._geolayer=Ne._paper.append("g").classed("geolayer",!0),Ne._funnelarealayer=Ne._paper.append("g").classed("funnelarealayer",!0),Ne._pielayer=Ne._paper.append("g").classed("pielayer",!0),Ne._iciclelayer=Ne._paper.append("g").classed("iciclelayer",!0),Ne._treemaplayer=Ne._paper.append("g").classed("treemaplayer",!0),Ne._sunburstlayer=Ne._paper.append("g").classed("sunburstlayer",!0),Ne._indicatorlayer=Ne._toppaper.append("g").classed("indicatorlayer",!0),Ne._glimages=Ne._paper.append("g").classed("glimages",!0);var Le=Ne._toppaper.append("g").classed("layer-above",!0);Ne._imageUpperLayer=Le.append("g").classed("imagelayer",!0),Ne._shapeUpperLayer=Le.append("g").classed("shapelayer",!0),Ne._selectionLayer=Ne._toppaper.append("g").classed("selectionlayer",!0),Ne._infolayer=Ne._toppaper.append("g").classed("infolayer",!0),Ne._menulayer=Ne._toppaper.append("g").classed("menulayer",!0),Ne._zoomlayer=Ne._toppaper.append("g").classed("zoomlayer",!0),Ne._hoverlayer=Ne._hoverpaper.append("g").classed("hoverlayer",!0),Ne._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),be.emit("plotly_framework")}Z.animate=Or,Z.addFrames=mr,Z.deleteFrames=Er,Z.addTraces=$,Z.deleteTraces=J,Z.extendTraces=he,Z.moveTraces=X,Z.prependTraces=q,Z.newPlot=B,Z._doPlot=u,Z.purge=yt,Z.react=Bt,Z.redraw=F,Z.relayout=_e,Z.restyle=oe,Z.setPlotConfig=f,Z.update=ot,Z._guiRelayout=Ae(_e),Z._guiRestyle=Ae(oe),Z._guiUpdate=Ae(ot),Z._storeDirectGUIEdit=re}}),Wv=We({"src/snapshot/helpers.js"(Z){"use strict";var V=Wi();Z.getDelay=function(A){return A._has&&(A._has("gl3d")||A._has("mapbox")||A._has("map"))?500:0},Z.getRedrawFunc=function(A){return function(){V.getComponentMethod("colorbar","draw")(A)}},Z.encodeSVG=function(A){return"data:image/svg+xml,"+encodeURIComponent(A)},Z.encodeJSON=function(A){return"data:application/json,"+encodeURIComponent(A)};var d=window.URL||window.webkitURL;Z.createObjectURL=function(A){return d.createObjectURL(A)},Z.revokeObjectURL=function(A){return d.revokeObjectURL(A)},Z.createBlob=function(A,E){if(E==="svg")return new window.Blob([A],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([A],{type:"application/json;charset=utf-8"});var e=x(window.atob(A));return new window.Blob([e],{type:"image/"+E})},Z.octetStream=function(A){document.location.href="data:application/octet-stream"+A};function x(A){for(var E=A.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":s.html(c).text()});return s.remove(),h}function i(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}V.exports=function(s,h,c){var m=s._fullLayout,p=m._paper,T=m._toppaper,l=m.width,_=m.height,w;p.insert("rect",":first-child").call(A.setRect,0,0,l,_).call(E.fill,m.paper_bgcolor);var S=m._basePlotModules||[];for(w=0;w1&&M.push(s("object","layout"))),x.supplyDefaults(y);for(var u=y._fullData,g=b.length,f=0;fP.length&&S.push(s("unused",M,g.concat(P.length)));var I=P.length,N=Array.isArray(O);N&&(I=Math.min(I,O.length));var U,W,Q,le,se;if(L.dimensions===2)for(W=0;WP[W].length&&S.push(s("unused",M,g.concat(W,P[W].length)));var he=P[W].length;for(U=0;U<(N?Math.min(he,O[W].length):he);U++)Q=N?O[W][U]:O,le=f[W][U],se=P[W][U],d.validate(le,Q)?se!==le&&se!==+le&&S.push(s("dynamic",M,g.concat(W,U),le,se)):S.push(s("value",M,g.concat(W,U),le))}else S.push(s("array",M,g.concat(W),f[W]));else for(W=0;WF?S.push({code:"unused",traceType:f,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:f,templateCount:z,dataCount:F})}}function B(O,I){for(var N in O)if(N.charAt(0)!=="_"){var U=O[N],W=s(O,N,I);d(U)?(Array.isArray(O)&&U._template===!1&&U.templateitemname&&S.push({code:"missing",path:W,templateitemname:U.templateitemname}),B(U,W)):Array.isArray(U)&&h(U)&&B(U,W)}}if(B({data:y,layout:M},""),S.length)return S.map(c)};function h(m){for(var p=0;p=0;c--){var m=e[c];if(m.type==="scatter"&&m.xaxis===s.xaxis&&m.yaxis===s.yaxis){m.opacity=void 0;break}}}}}}}),FS=We({"src/traces/scatter/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=Ny();V.exports=function(A,E){function e(r,o){return d.coerce(A,E,x,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),hv=We({"src/plots/cartesian/align_period.js"(Z,V){"use strict";var d=Uo(),x=aa(),A=x.dateTime2ms,E=x.incrementMonth,e=bs(),t=e.ONEAVGMONTH;V.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var h=o[i+"period"],c;if(d(h)){if(h=+h,h<=0)return{vals:n}}else if(typeof h=="string"&&h.charAt(0)==="M"){var m=+h.substring(1);if(m>0&&Math.round(m)===m)c=m;else return{vals:n}}for(var p=a.calendar,T=s==="start",l=s==="end",_=o[i+"period0"],w=A(_,p)||0,S=[],M=[],y=[],b=n.length,v=0;vu;)P=E(P,-c,p);for(;P<=u;)P=E(P,c,p);f=E(P,-c,p)}else{for(g=Math.round((u-w)/h),P=w+g*h;P>u;)P-=h;for(;P<=u;)P+=h;f=P-h}S[v]=T?f:l?P:(f+P)/2,M[v]=f,y[v]=P}return{vals:S,starts:M,ends:y}}}}),Wh=We({"src/traces/scatter/colorscale_calc.js"(Z,V){"use strict";var d=ah().hasColorscale,x=nh(),A=au();V.exports=function(e,t){A.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),kv=We({"src/traces/scatter/arrays_to_calcdata.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){for(var e=0;eB&&f[I].gap;)I--;for(U=f[I].s,O=f.length-1;O>I;O--)f[O].s=U;for(;BN+O||!d(I))}for(var W=0;Wz[p]&&p0?e:t)/(p._m*_*(p._m>0?e:t)))),Ct*=1e3}if(or===A){if(l&&(or=p.c2p(gt.y,!0)),or===A)return!1;or*=1e3}return[Ct,or]}function ee(dt,gt,Ct,or){var Qt=Ct-dt,Jt=or-gt,Sr=.5-dt,oa=.5-gt,Ea=Qt*Qt+Jt*Jt,Sa=Qt*Sr+Jt*oa;if(Sa>0&&Sa1||Math.abs(Sr.y-Ct[0][1])>1)&&(Sr=[Sr.x,Sr.y],or&&Te(Sr,dt)He||dt[1]rt)return[a(dt[0],De,He),a(dt[1],et,rt)]}function kt(dt,gt){if(dt[0]===gt[0]&&(dt[0]===De||dt[0]===He)||dt[1]===gt[1]&&(dt[1]===et||dt[1]===rt))return!0}function Et(dt,gt){var Ct=[],or=Ke(dt),Qt=Ke(gt);return or&&Qt&&kt(or,Qt)||(or&&Ct.push(or),Qt&&Ct.push(Qt)),Ct}function Bt(dt,gt,Ct){return function(or,Qt){var Jt=Ke(or),Sr=Ke(Qt),oa=[];if(Jt&&Sr&&kt(Jt,Sr))return oa;Jt&&oa.push(Jt),Sr&&oa.push(Sr);var Ea=2*r.constrain((or[dt]+Qt[dt])/2,gt,Ct)-((Jt||or)[dt]+(Sr||Qt)[dt]);if(Ea){var Sa;Jt&&Sr?Sa=Ea>0==Jt[dt]>Sr[dt]?Jt:Sr:Sa=Jt||Sr,Sa[dt]+=Ea}return oa}}var jt;v==="linear"||v==="spline"?jt=nt:v==="hv"||v==="vh"?jt=Et:v==="hvh"?jt=Bt(0,De,He):v==="vhv"&&(jt=Bt(1,et,rt));function _r(dt,gt){var Ct=gt[0]-dt[0],or=(gt[1]-dt[1])/Ct,Qt=(dt[1]*gt[0]-gt[1]*dt[0])/Ct;return Qt>0?[or>0?De:He,rt]:[or>0?He:De,et]}function pr(dt){var gt=dt[0],Ct=dt[1],or=gt===z[F-1][0],Qt=Ct===z[F-1][1];if(!(or&&Qt))if(F>1){var Jt=gt===z[F-2][0],Sr=Ct===z[F-2][1];or&&(gt===De||gt===He)&&Jt?Sr?F--:z[F-1]=dt:Qt&&(Ct===et||Ct===rt)&&Sr?Jt?F--:z[F-1]=dt:z[F++]=dt}else z[F++]=dt}function Or(dt){z[F-1][0]!==dt[0]&&z[F-1][1]!==dt[1]&&pr([ge,ce]),pr(dt),ze=null,ge=ce=0}var mr=r.isArrayOrTypedArray(M);function Er(dt){if(dt&&S&&(dt.i=B,dt.d=s,dt.trace=c,dt.marker=mr?M[dt.i]:M,dt.backoff=S),re=dt[0]/_,ue=dt[1]/w,ot=dt[0]He?He:0,Ae=dt[1]rt?rt:0,ot||Ae){if(!F)z[F++]=[ot||dt[0],Ae||dt[1]];else if(ze){var gt=jt(ze,dt);gt.length>1&&(Or(gt[0]),z[F++]=gt[1])}else Qe=jt(z[F-1],dt)[0],z[F++]=Qe;var Ct=z[F-1];ot&&Ae&&(Ct[0]!==ot||Ct[1]!==Ae)?(ze&&(ge!==ot&&ce!==Ae?pr(ge&&ce?_r(ze,dt):[ge||ot,ce||Ae]):ge&&ce&&pr([ge,ce])),pr([ot,Ae])):ge-ot&&ce-Ae&&pr([ot||ge,Ae||ce]),ze=dt,ge=ot,ce=Ae}else ze&&Or(jt(ze,dt)[0]),z[F++]=dt}for(B=0;B_e(W,yt))break;I=W,J=se[0]*le[0]+se[1]*le[1],J>q?(q=J,N=W,Q=!1):J<$&&($=J,U=W,Q=!0)}if(Q?(Er(N),I!==U&&Er(U)):(U!==O&&Er(U),I!==N&&Er(N)),Er(I),B>=s.length||!W)break;Er(W),O=W}}ze&&pr([ge||ze[0],ce||ze[1]]),f.push(z.slice(0,F))}var Oe=v.slice(v.length-1);if(S&&Oe!=="h"&&Oe!=="v"){for(var Xe=!1,be=-1,Ce=[],Ne=0;Ne=0?i=m:(i=m=c,c++),i0,v=a(m,p,T);if(S=l.selectAll("g.trace").data(v,function(g){return g[0].trace.uid}),S.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),S.order(),n(m,S,p),b){w&&(M=w());var u=d.transition().duration(_.duration).ease(_.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(g,f){s(m,f,p,g,v,this,_)})})}else S.each(function(g,f){s(m,f,p,g,v,this,_)});y&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function n(c,m,p){m.each(function(T){var l=E(d.select(this),"g","fills");t.setClipUrl(l,p.layerClipId,c);var _=T[0].trace,w=[];_._ownfill&&w.push("_ownFill"),_._nexttrace&&w.push("_nextFill");var S=l.selectAll("g").data(w,e);S.enter().append("g"),S.exit().each(function(M){_[M]=null}).remove(),S.order().each(function(M){_[M]=E(d.select(this),"path","js-fill")})})}function s(c,m,p,T,l,_,w){var S=c._context.staticPlot,M;h(c,m,p,T,l);var y=!!w&&w.duration>0;function b(pr){return y?pr.transition():pr}var v=p.xaxis,u=p.yaxis,g=T[0].trace,f=g.line,P=d.select(_),L=E(P,"g","errorbars"),z=E(P,"g","lines"),F=E(P,"g","points"),B=E(P,"g","text");if(x.getComponentMethod("errorbars","plot")(c,L,p,w),g.visible!==!0)return;b(P).style("opacity",g.opacity);var O,I,N=g.fill.charAt(g.fill.length-1);N!=="x"&&N!=="y"&&(N="");var U,W;N==="y"?(U=1,W=u.c2p(0,!0)):N==="x"&&(U=0,W=v.c2p(0,!0)),T[0][p.isRangePlot?"nodeRangePlot3":"node3"]=P;var Q="",le=[],se=g._prevtrace,he=null,q=null;se&&(Q=se._prevRevpath||"",I=se._nextFill,le=se._ownPolygons,he=se._fillsegments,q=se._fillElement);var $,J,X="",oe="",ne,j,ee,re,ue,_e,Te=[];g._polygons=[];var Ie=[],De=[],He=A.noop;if(O=g._ownFill,r.hasLines(g)||g.fill!=="none"){I&&I.datum(T),["hv","vh","hvh","vhv"].indexOf(f.shape)!==-1?(ne=t.steps(f.shape),j=t.steps(f.shape.split("").reverse().join(""))):f.shape==="spline"?ne=j=function(pr){var Or=pr[pr.length-1];return pr.length>1&&pr[0][0]===Or[0]&&pr[0][1]===Or[1]?t.smoothclosed(pr.slice(1),f.smoothing):t.smoothopen(pr,f.smoothing)}:ne=j=function(pr){return"M"+pr.join("L")},ee=function(pr){return j(pr.reverse())},De=o(T,{xaxis:v,yaxis:u,trace:g,connectGaps:g.connectgaps,baseTolerance:Math.max(f.width||1,3)/4,shape:f.shape,backoff:f.backoff,simplify:f.simplify,fill:g.fill}),Ie=new Array(De.length);var et=0;for(M=0;M=S[0]&&P.x<=S[1]&&P.y>=M[0]&&P.y<=M[1]}),u=Math.ceil(v.length/b),g=0;l.forEach(function(P,L){var z=P[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(se,he)&&p<=Math.max(se,he)?0:1/0}var q=Math.max(3,le.mrc||0),$=1-1/q,J=Math.abs(c.c2p(le.x)-p);return J=Math.min(se,he)&&T<=Math.max(se,he)?0:1/0}var q=Math.max(3,le.mrc||0),$=1-1/q,J=Math.abs(m.c2p(le.y)-T);return Joe!=Ie>=oe&&(ue=ee[j-1][0],_e=ee[j][0],Ie-Te&&(re=ue+(_e-ue)*(oe-Te)/(Ie-Te),q=Math.min(q,re),$=Math.max($,re)));return q=Math.max(q,0),$=Math.min($,c._length),{x0:q,x1:$,y0:oe,y1:oe}}if(_.indexOf("fills")!==-1&&h._fillElement){var U=I(h._fillElement)&&!I(h._fillExclusionElement);if(U){var W=N(h._polygons);W===null&&(W={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var Q=e.defaultLine;return e.opacity(h.fillcolor)?Q=h.fillcolor:e.opacity((h.line||{}).color)&&(Q=h.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:W.x0,x1:W.x1,y0:W.y0,y1:W.y1,color:Q,hovertemplate:!1}),delete o.index,h.text&&!d.isArrayOrTypedArray(h.text)?o.text=String(h.text):o.text=h.name,[o]}}}}}),O0=We({"src/traces/scatter/select.js"(Z,V){"use strict";var d=au();V.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=[],a=e[0].trace,i,n,s,h,c=!d.hasMarkers(a)&&!d.hasText(a);if(c)return[];if(E===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),Qy=We({"src/plots/cartesian/category_order_defaults.js"(Z,V){"use strict";var d=rh().isTypedArraySpec;function x(A,E){var e=E.dataAttr||A._id.charAt(0),t={},r,o,a;if(E.axData)r=E.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),qm=We({"src/plots/cartesian/line_grid_defaults.js"(Z,V){"use strict";var d=Af().mix,x=nf(),A=aa();V.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(f,P){return A.coerce2(e,t,o.attributes,f,P)}var n=i("linecolor",a),s=i("linewidth"),h=r("showline",o.showLine||!!n||!!s);h||(delete t.linecolor,delete t.linewidth);var c=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),m=i("gridcolor",c),p=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!m||!!p||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var _=d(t.gridcolor,o.bgColor,67).toRgbString(),w=i("minor.gridcolor",_),S=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),y=r("minor.showgrid",!!w||!!S||!!M);y||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var b=i("zerolinelayer"),v=i("zerolinecolor",a),u=i("zerolinewidth"),g=r("zeroline",o.showGrid||!!v||!!u);g||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Gm=We({"src/plots/cartesian/axis_defaults.js"(Z,V){"use strict";var d=Uo(),x=Wi(),A=aa(),E=sl(),e=Zf(),t=Of(),r=_p(),o=k0(),a=Md(),i=Ed(),n=Qy(),s=qm(),h=fb(),c=Mv(),m=Sf().WEEKDAY_PATTERN,p=Sf().HOUR_PATTERN;V.exports=function(S,M,y,b,v){var u=b.letter,g=b.font||{},f=b.splomStash||{},P=y("visible",!b.visibleDflt),L=M._template||{},z=M.type||L.type||"-",F;if(z==="date"){var B=x.getComponentMethod("calendars","handleDefaults");B(S,M,"calendar",b.calendar),b.noTicklabelmode||(F=y("ticklabelmode"))}!b.noTicklabelindex&&(z==="date"||z==="linear")&&y("ticklabelindex");var O="";(!b.noTicklabelposition||z==="multicategory")&&(O=A.coerce(S,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),b.noTicklabeloverflow||y("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),c(M,v),h(S,M,y,b),n(S,M,y,b),b.noHover||(z!=="category"&&y("hoverformat"),b.noUnifiedhovertitle||y("unifiedhovertitle.text"));var I=y("color"),N=I!==t.color.dflt?I:g.color,U=f.label||v._dfltTitle[u];if(i(S,M,y,z,b),!P)return M;y("title.text",U),A.coerceFont(y,"title.font",g,{overrideDflt:{size:A.bigFont(g.size),color:N}}),r(S,M,y,z);var W=b.hasMinor;if(W&&(E.newContainer(M,"minor"),r(S,M,y,z,{isMinor:!0})),a(S,M,y,z,b),o(S,M,y,b),W){var Q=b.isMinor;b.isMinor=!0,o(S,M,y,b),b.isMinor=Q}s(S,M,y,{dfltColor:I,bgColor:b.bgColor,showGrid:b.showGrid,hasMinor:W,attributes:t}),W&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&y("mirror");var le=z==="multicategory";if(!b.noTickson&&(z==="category"||le)&&(M.ticks||M.showgrid)&&(le?(y("tickson","boundaries"),delete M.ticklabelposition):y("tickson")),le){var se=y("showdividers");se&&(y("dividercolor"),y("dividerwidth"))}if(z==="date")if(e(S,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var he=0;he=2){var u="",g,f;if(v.length===2){for(g=0;g<2;g++)if(f=_(v[g]),f){u=m;break}}var P=y("pattern",u);if(P===m)for(g=0;g<2;g++)f=_(v[g]),f&&(S.bounds[g]=v[g]=f-1);if(P)for(g=0;g<2;g++)switch(f=v[g],P){case m:if(!d(f)){S.enabled=!1;return}if(f=+f,f!==Math.floor(f)||f<0||f>=7){S.enabled=!1;return}S.bounds[g]=v[g]=f;break;case p:if(!d(f)){S.enabled=!1;return}if(f=+f,f<0||f>24){S.enabled=!1;return}S.bounds[g]=v[g]=f;break}if(M.autorange===!1){var L=M.range;if(L[0]L[1]){S.enabled=!1;return}}else if(v[0]>L[0]&&v[1]y[1]-1/4096&&(e.domain=c),x.noneOrAll(E.domain,e.domain,c),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),US=We({"src/plots/cartesian/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=Fi(),A=Th().isUnifiedHover,E=yb(),e=sl(),t=S0(),r=Of(),o=Fb(),a=Gm(),i=bp(),n=e1(),s=cc(),h=s.id2name,c=s.name2id,m=Sf().AX_ID_PATTERN,p=Wi(),T=p.traceIs,l=p.getComponentMethod;function _(w,S,M){Array.isArray(w[S])?w[S].push(M):w[S]=[M]}V.exports=function(S,M,y){var b=M.autotypenumbers,v={},u={},g={},f={},P={},L={},z={},F={},B={},O={},I,N;for(I=0;I rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,y._offset,b._offset).call(E.setScale,1,1);var v=M.plot.selectAll(".scatterlayer .trace");v.selectAll(".point").call(E.setPointGroupScale,1,1),v.selectAll(".textpoint").call(E.setTextPointsScale,1,1),v.call(E.hideOutsideRangePoints,M)}function h(M,y){var b=M.plotinfo,v=b.xaxis,u=b.yaxis,g=v._length,f=u._length,P=!!M.xr1,L=!!M.yr1,z=[];if(P){var F=A.simpleMap(M.xr0,v.r2l),B=A.simpleMap(M.xr1,v.r2l),O=F[1]-F[0],I=B[1]-B[0];z[0]=(F[0]*(1-y)+y*B[0]-F[0])/(F[1]-F[0])*g,z[2]=g*(1-y+y*I/O),v.range[0]=v.l2r(F[0]*(1-y)+y*B[0]),v.range[1]=v.l2r(F[1]*(1-y)+y*B[1])}else z[0]=0,z[2]=g;if(L){var N=A.simpleMap(M.yr0,u.r2l),U=A.simpleMap(M.yr1,u.r2l),W=N[1]-N[0],Q=U[1]-U[0];z[1]=(N[1]*(1-y)+y*U[1]-N[1])/(N[0]-N[1])*f,z[3]=f*(1-y+y*Q/W),u.range[0]=v.l2r(N[0]*(1-y)+y*U[0]),u.range[1]=u.l2r(N[1]*(1-y)+y*U[1])}else z[1]=0,z[3]=f;e.drawOne(r,v,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[v._id,u._id]);var le=P?g/z[2]:1,se=L?f/z[3]:1,he=P?z[0]:0,q=L?z[1]:0,$=P?z[0]/z[2]*g:0,J=L?z[1]/z[3]*f:0,X=v._offset-$,oe=u._offset-J;b.clipRect.call(E.setTranslate,he,q).call(E.setScale,1/le,1/se),b.plot.call(E.setTranslate,X,oe).call(E.setScale,le,se),E.setPointGroupScale(b.zoomScalePts,1/le,1/se),E.setTextPointsScale(b.zoomScaleTxt,1/le,1/se)}var c;i&&(c=i());function m(){for(var M={},y=0;ya.duration?(m(),_=window.cancelAnimationFrame(S)):_=window.requestAnimationFrame(S)}return T=Date.now(),_=window.requestAnimationFrame(S),Promise.resolve()}}}),Yc=We({"src/plots/cartesian/index.js"(Z){"use strict";var V=Hi(),d=Wi(),x=aa(),A=Nu(),E=Oo(),e=Ff().getModuleCalcData,t=cc(),r=Sf(),o=Fh(),a=x.ensureSingle;function i(T,l,_){return x.ensureSingle(T,l,_,function(w){w.datum(_)})}var n=r.zindexSeparator;Z.name="cartesian",Z.attr=["xaxis","yaxis"],Z.idRoot=["x","y"],Z.idRegex=r.idRegex,Z.attrRegex=r.attrRegex,Z.attributes=NS(),Z.layoutAttributes=Of(),Z.supplyLayoutDefaults=US(),Z.transitionAxes=jS(),Z.finalizeSubplots=function(T,l){var _=l._subplots,w=_.xaxis,S=_.yaxis,M=_.cartesian,y=M,b={},v={},u,g,f;for(u=0;u0){var L=P.id;if(L.indexOf(n)!==-1)continue;L+=n+(u+1),P=x.extendFlat({},P,{id:L,plot:S._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,B=0;B1&&(W+=n+U),N.push(b+W),y=0;y1,f=l.mainplotinfo;if(!l.mainplot||g)if(u)l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.xaxislayer=a(w,"g","xaxislayer-above"),l.yaxislayer=a(w,"g","yaxislayer-above");else{if(!y){var P=a(w,"g","layer-subplot");l.shapelayer=a(P,"g","shapelayer"),l.imagelayer=a(P,"g","imagelayer"),f&&g?(l.minorGridlayer=f.minorGridlayer,l.gridlayer=f.gridlayer,l.zerolinelayer=f.zerolinelayer):(l.minorGridlayer=a(w,"g","minor-gridlayer"),l.gridlayer=a(w,"g","gridlayer"),l.zerolinelayer=a(w,"g","zerolinelayer"));var L=a(w,"g","layer-between");l.shapelayerBetween=a(L,"g","shapelayer"),l.imagelayerBetween=a(L,"g","imagelayer"),a(w,"path","xlines-below"),a(w,"path","ylines-below"),l.overlinesBelow=a(w,"g","overlines-below"),a(w,"g","xaxislayer-below"),a(w,"g","yaxislayer-below"),l.overaxesBelow=a(w,"g","overaxes-below")}l.overplot=a(w,"g","overplot"),l.plot=a(l.overplot,"g",S),f&&g?l.zerolinelayerAbove=f.zerolinelayerAbove:l.zerolinelayerAbove=a(w,"g","zerolinelayer-above"),y||(l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.overlinesAbove=a(w,"g","overlines-above"),a(w,"g","xaxislayer-above"),a(w,"g","yaxislayer-above"),l.overaxesAbove=a(w,"g","overaxes-above"),l.xlines=w.select(".xlines-"+b),l.ylines=w.select(".ylines-"+v),l.xaxislayer=w.select(".xaxislayer-"+b),l.yaxislayer=w.select(".yaxislayer-"+v))}else{var z=f.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=f.minorGridlayer,l.gridlayer=f.gridlayer,l.zerolinelayer=f.zerolinelayer,l.zerolinelayerAbove=f.zerolinelayerAbove,a(f.overlinesBelow,"path",F),a(f.overlinesBelow,"path",B),a(f.overaxesBelow,"g",F),a(f.overaxesBelow,"g",B),l.plot=a(f.overplot,"g",S),a(f.overlinesAbove,"path",F),a(f.overlinesAbove,"path",B),a(f.overaxesAbove,"g",F),a(f.overaxesAbove,"g",B),l.xlines=z.select(".overlines-"+b).select("."+F),l.ylines=z.select(".overlines-"+v).select("."+B),l.xaxislayer=z.select(".overaxes-"+b).select("."+F),l.yaxislayer=z.select(".overaxes-"+v).select("."+B)}y||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function m(T,l){if(T){var _={};T.each(function(v){var u=v[0],g=V.select(this);g.remove(),p(u,l),_[u]=!0});for(var w in l._plots)for(var S=l._plots[w],M=S.overlays||[],y=0;y=0,l=i.indexOf("end")>=0,_=h.backoff*m+n.standoff,w=c.backoff*p+n.startstandoff,S,M,y,b;if(s.nodeName==="line"){S={x:+a.attr("x1"),y:+a.attr("y1")},M={x:+a.attr("x2"),y:+a.attr("y2")};var v=S.x-M.x,u=S.y-M.y;if(y=Math.atan2(u,v),b=y+Math.PI,_&&w&&_+w>Math.sqrt(v*v+u*u)){W();return}if(_){if(_*_>v*v+u*u){W();return}var g=_*Math.cos(y),f=_*Math.sin(y);M.x+=g,M.y+=f,a.attr({x2:M.x,y2:M.y})}if(w){if(w*w>v*v+u*u){W();return}var P=w*Math.cos(y),L=w*Math.sin(y);S.x-=P,S.y-=L,a.attr({x1:S.x,y1:S.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z<_+w){W();return}var B=s.getPointAtLength(0),O=s.getPointAtLength(.1);y=Math.atan2(B.y-O.y,B.x-O.x),S=s.getPointAtLength(Math.min(w,z)),F="0px,"+w+"px,";var I=s.getPointAtLength(z),N=s.getPointAtLength(z-.1);b=Math.atan2(I.y-N.y,I.x-N.x),M=s.getPointAtLength(Math.max(0,z-_));var U=F?w+_:_;F+=z-U+"px,"+z+"px",a.style("stroke-dasharray",F)}function W(){a.style("stroke-dasharray","0px,100px")}function Q(le,se,he,q){le.path&&(le.noRotate&&(he=0),d.select(s.parentNode).append("path").attr({class:a.attr("class"),d:le.path,transform:r(se.x,se.y)+t(he*180/Math.PI)+e(q)}).style({fill:x.rgb(n.arrowcolor),"stroke-width":0}))}T&&Q(c,S,y,p),l&&Q(h,M,b,m)}}}),t1=We({"src/components/annotations/draw.js"(Z,V){"use strict";var d=Hi(),x=Wi(),A=Nu(),E=aa(),e=E.strTranslate,t=Mo(),r=Fi(),o=Oo(),a=hc(),i=zl(),n=sv(),s=ih(),h=sl().arrayEditor,c=qS();V.exports={draw:m,drawOne:p,drawRaw:l};function m(_){var w=_._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var S=0;S2/3?Ta="right":Ta="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Ta]}for(var Qe=!1,nt=["x","y"],Ke=0;Ke1)&&(Bt===Et?(Le=jt.r2fraction(w["a"+kt]),(Le<0||Le>1)&&(Qe=!0)):Qe=!0),Xe=jt._offset+jt.r2p(w[kt]),Ne=.5}else{var at=Se==="domain";kt==="x"?(Ce=w[kt],Xe=at?jt._offset+jt._length*Ce:Xe=u.l+u.w*Ce):(Ce=1-w[kt],Xe=at?jt._offset+jt._length*Ce:Xe=u.t+u.h*Ce),Ne=w.showarrow?.5:Ce}if(w.showarrow){Oe.head=Xe;var dt=w["a"+kt];if(Ee=pr*ze(.5,w.xanchor)-Or*ze(.5,w.yanchor),Bt===Et){var gt=t.getRefType(Bt);gt==="domain"?(kt==="y"&&(dt=1-dt),Oe.tail=jt._offset+jt._length*dt):gt==="paper"?kt==="y"?(dt=1-dt,Oe.tail=u.t+u.h*dt):Oe.tail=u.l+u.w*dt:Oe.tail=jt._offset+jt.r2p(dt),be=Ee}else Oe.tail=Xe+dt,be=Ee+dt;Oe.text=Oe.tail+Ee;var Ct=v[kt==="x"?"width":"height"];if(Et==="paper"&&(Oe.head=E.constrain(Oe.head,1,Ct-1)),Bt==="pixel"){var or=-Math.max(Oe.tail-3,Oe.text),Qt=Math.min(Oe.tail+3,Oe.text)-Ct;or>0?(Oe.tail+=or,Oe.text+=or):Qt>0&&(Oe.tail-=Qt,Oe.text-=Qt)}Oe.tail+=yt,Oe.head+=yt}else Ee=mr*ze(Ne,Er),be=Ee,Oe.text=Xe+Ee;Oe.text+=yt,Ee+=yt,be+=yt,w["_"+kt+"padplus"]=mr/2+be,w["_"+kt+"padminus"]=mr/2-be,w["_"+kt+"size"]=mr,w["_"+kt+"shift"]=Ee}if(Qe){he.remove();return}var Jt=0,Sr=0;if(w.align!=="left"&&(Jt=(ot-rt)*(w.align==="center"?.5:1)),w.valign!=="top"&&(Sr=(Ae-$e)*(w.valign==="middle"?.5:1)),He)De.select("svg").attr({x:J+Jt-1,y:J+Sr}).call(o.setClipUrl,oe?O:null,_);else{var oa=J+Sr-et.top,Ea=J+Jt-et.left;re.call(i.positionText,Ea,oa).call(o.setClipUrl,oe?O:null,_)}ne.select("rect").call(o.setRect,J,J,ot,Ae),X.call(o.setRect,q/2,q/2,ge-q,ce-q),he.call(o.setTranslate,Math.round(I.x.text-ge/2),Math.round(I.y.text-ce/2)),W.attr({transform:"rotate("+N+","+I.x.text+","+I.y.text+")"});var Sa=function(Na,Ta){U.selectAll(".annotation-arrow-g").remove();var nn=I.x.head,gn=I.y.head,Ht=I.x.tail+Na,It=I.y.tail+Ta,Gt=I.x.text+Na,Xt=I.y.text+Ta,Rr=E.rotationXYMatrix(N,Gt,Xt),Yr=E.apply2DTransform(Rr),Jr=E.apply2DTransform2(Rr),ia=+X.attr("width"),Pa=+X.attr("height"),Ga=Gt-.5*ia,ja=Ga+ia,Xa=Xt-.5*Pa,sn=Xa+Pa,Ma=[[Ga,Xa,Ga,sn],[Ga,sn,ja,sn],[ja,sn,ja,Xa],[ja,Xa,Ga,Xa]].map(Jr);if(!Ma.reduce(function(_t,Wt){return _t^!!E.segmentsIntersect(nn,gn,nn+1e6,gn+1e6,Wt[0],Wt[1],Wt[2],Wt[3])},!1)){Ma.forEach(function(_t){var Wt=E.segmentsIntersect(Ht,It,nn,gn,_t[0],_t[1],_t[2],_t[3]);Wt&&(Ht=Wt.x,It=Wt.y)});var Xn=w.arrowwidth,Kn=w.arrowcolor,St=w.arrowside,lt=U.append("g").style({opacity:r.opacity(Kn)}).classed("annotation-arrow-g",!0),br=lt.append("path").attr("d","M"+Ht+","+It+"L"+nn+","+gn).style("stroke-width",Xn+"px").call(r.stroke,r.rgb(Kn));if(c(br,St,w),g.annotationPosition&&br.node().parentNode&&!M){var kr=nn,Lr=gn;if(w.standoff){var Tr=Math.sqrt(Math.pow(nn-Ht,2)+Math.pow(gn-It,2));kr+=w.standoff*(Ht-nn)/Tr,Lr+=w.standoff*(It-gn)/Tr}var Cr=lt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Ht-kr)+","+(It-Lr),transform:e(kr,Lr)}).style("stroke-width",Xn+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Kr,Nr;s.init({element:Cr.node(),gd:_,prepFn:function(){var _t=o.getTranslate(he);Kr=_t.x,Nr=_t.y,y&&y.autorange&&z(y._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0)},moveFn:function(_t,Wt){var Ar=Yr(Kr,Nr),Vr=Ar[0]+_t,ma=Ar[1]+Wt;he.call(o.setTranslate,Vr,ma),F("x",T(y,_t,"x",u,w)),F("y",T(b,Wt,"y",u,w)),w.axref===w.xref&&F("ax",T(y,_t,"ax",u,w)),w.ayref===w.yref&&F("ay",T(b,Wt,"ay",u,w)),lt.attr("transform",e(_t,Wt)),W.attr({transform:"rotate("+N+","+Vr+","+ma+")"})},doneFn:function(){x.call("_guiRelayout",_,B());var _t=document.querySelector(".js-notes-box-panel");_t&&_t.redraw(_t.selectedObj)}})}}};if(w.showarrow&&Sa(0,0),Q){var za;s.init({element:he.node(),gd:_,prepFn:function(){za=W.attr("transform")},moveFn:function(Na,Ta){var nn="pointer";if(w.showarrow)w.axref===w.xref?F("ax",T(y,Na,"ax",u,w)):F("ax",w.ax+Na),w.ayref===w.yref?F("ay",T(b,Ta,"ay",u.w,w)):F("ay",w.ay+Ta),Sa(Na,Ta);else{if(M)return;var gn,Ht;if(y)gn=T(y,Na,"x",u,w);else{var It=w._xsize/u.w,Gt=w.x+(w._xshift-w.xshift)/u.w-It/2;gn=s.align(Gt+Na/u.w,It,0,1,w.xanchor)}if(b)Ht=T(b,Ta,"y",u,w);else{var Xt=w._ysize/u.h,Rr=w.y-(w._yshift+w.yshift)/u.h-Xt/2;Ht=s.align(Rr-Ta/u.h,Xt,0,1,w.yanchor)}F("x",gn),F("y",Ht),(!y||!b)&&(nn=s.getCursor(y?.5:gn,b?.5:Ht,w.xanchor,w.yanchor))}W.attr({transform:e(Na,Ta)+za}),n(he,nn)},clickFn:function(Na,Ta){w.captureevents&&_.emit("plotly_clickannotation",se(Ta))},doneFn:function(){n(he),x.call("_guiRelayout",_,B());var Na=document.querySelector(".js-notes-box-panel");Na&&Na.redraw(Na.selectedObj)}})}}g.annotationText?re.call(i.makeEditable,{delegate:he,gd:_}).call(ue).on("edit",function(Te){w.text=Te,this.call(ue),F("text",Te),y&&y.autorange&&z(y._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0),x.call("_guiRelayout",_,B())}):re.call(ue)}}}),GS=We({"src/components/annotations/click.js"(Z,V){"use strict";var d=aa(),x=Wi(),A=sl().arrayEditor;V.exports={hasClickToShow:E,onClick:e};function E(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),h={},c=o._fullLayout.annotations,m,p;if(n.length||s.length){for(m=0;m1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),$S=We({"src/components/annotations3d/index.js"(Z,V){"use strict";var d=Wi(),x=aa();V.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:r1()}}},layoutAttributes:r1(),handleDefaults:YS(),includeBasePlot:A,convert:KS(),draw:JS()};function A(E,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),a=0;a0?l+m:m;return{ppad:m,ppadplus:p?w:S,ppadminus:p?S:w}}else return{ppad:m}}function o(a,i,n){var s=a._id.charAt(0)==="x"?"x":"y",h=a.type==="category"||a.type==="multicategory",c,m,p=0,T=0,l=h?a.r2c:a.d2c,_=i[s+"sizemode"]==="scaled";if(_?(c=i[s+"0"],m=i[s+"1"],h&&(p=i[s+"0shift"],T=i[s+"1shift"])):(c=i[s+"anchor"],m=i[s+"anchor"]),c!==void 0)return[l(c)+p,l(m)+T];if(i.path){var w=1/0,S=-1/0,M=i.path.match(A.segmentRE),y,b,v,u,g;for(a.type==="date"&&(l=E.decodeDate(l)),y=0;yS&&(S=g)));if(S>=w)return[w,S]}}}}),rM=We({"src/components/shapes/index.js"(Z,V){"use strict";var d=Zy();V.exports={moduleType:"component",name:"shapes",layoutAttributes:Nb(),supplyLayoutDefaults:QS(),supplyDrawNewShapeDefaults:eM(),includeBasePlot:Vm()("shapes"),calcAutorange:tM(),draw:d.draw,drawOne:d.drawOne}}}),Ub=We({"src/components/images/attributes.js"(Z,V){"use strict";var d=Sf(),x=sl().templatedArray,A=jm();V.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),aM=We({"src/components/images/defaults.js"(Z,V){"use strict";var d=aa(),x=Mo(),A=Zf(),E=Ub(),e="images";V.exports=function(o,a){var i={name:e,handleItemDefaults:t};A(o,a,i)};function t(r,o,a){function i(_,w){return d.coerce(r,o,E,_,w)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var h={_fullLayout:a},c=["x","y"],m=0;m<2;m++){var p=c[m],T=x.coerceRef(r,o,h,p,"paper",void 0);if(T!=="paper"){var l=x.getFromId(h,T);l._imgIndices.push(o._index)}x.coercePosition(o,h,i,T,p,0)}return o}}}),nM=We({"src/components/images/draw.js"(Z,V){"use strict";var d=Hi(),x=Oo(),A=Mo(),E=cc(),e=Fh();V.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,h;for(h=0;h0);c&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(h,c){return d.coerce(a,i,t,h,c)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),lM=We({"src/components/updatemenus/scrollbox.js"(Z,V){"use strict";V.exports=e;var d=Hi(),x=Fi(),A=Oo(),E=aa();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var h=this.position.l,c=this.position.w,m=this.position.t,p=this.position.h,T=this.position.direction,l=T==="down",_=T==="left",w=T==="right",S=T==="up",M=c,y=p,b,v,u,g;!l&&!_&&!w&&!S&&(this.position.direction="down",l=!0);var f=l||S;f?(b=h,v=b+M,l?(u=m,g=Math.min(u+y,s),y=g-u):(g=m+y,u=Math.max(g-y,0),y=g-u)):(u=m,g=u+y,_?(v=h+M,b=Math.max(v-M,0),M=v-b):(b=h,v=Math.min(b+M,n),M=v-b)),this._box={l:b,t:u,w:M,h:y};var P=c>M,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=h,B=m+p;B+z>s&&(B=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(P?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),P?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:B,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=M-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=p>y,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,W=h+c,Q=m;W+N>n&&(W=n-N);var le=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);le.exit().on(".drag",null).remove(),le.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),I?(this.vbar=le.attr({rx:e.barRadius,ry:e.barRadius,x:W,y:Q,width:N,height:U}),this._vbarYMin=Q+U/2,this._vbarTranslateMax=y-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var se=this.id,he=b-.5,q=I?v+N+.5:v+.5,$=u-.5,J=P?g+z+.5:g+.5,X=i._topdefs.selectAll("#"+se).data(P||I?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",se).append("rect"),P||I?(this._clipRect=X.select("rect").attr({x:Math.floor(he),y:Math.floor($),width:Math.ceil(q)-Math.floor(he),height:Math.ceil(J)-Math.floor($)}),this.container.call(A.setClipUrl,se,this.gd),this.bg.attr({x:h,y:m,width:c,height:p})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),P||I){var oe=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(oe);var ne=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));P&&this.hbar.on(".drag",null).call(ne),I&&this.vbar.on(".drag",null).call(ne)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=E.constrain(d.event.x,a,i),s=(n-a)/(i-a),h=this.position.w-this._box.w;r=s*h}if(this.vbar){var c=o+this._vbarYMin,m=c+this._vbarTranslateMax,p=E.constrain(d.event.y,c,m),T=(p-c)/(m-c),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,a),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(A.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(A.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),uM=We({"src/components/updatemenus/draw.js"(Z,V){"use strict";var d=Hi(),x=Nu(),A=Fi(),E=Oo(),e=aa(),t=zl(),r=sl().arrayEditor,o=gf().LINE_SPACING,a=a1(),i=lM();V.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[a.name]);function B(se){x.autoMargin(L,u(se))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var I=O.selectAll("g."+a.headerGroupClassName).data(F,n);I.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(se){se.style("pointer-events","all")}),U=0;U0?[0]:[]);W.enter().append("g").classed(a.containerClassName,!0).style("cursor",I?null:"ew-resize");function Q(q){q._commandObserver&&(q._commandObserver.remove(),delete q._commandObserver),x.autoMargin(O,c(q))}if(W.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var le=W.selectAll("g."+a.groupClassName).data(U,p);le.enter().append("g").classed(a.groupClassName,!0),le.exit().each(Q).remove();for(var se=0;se0&&(le=le.transition().duration(O.transition.duration).ease(O.transition.easing)),le.attr("transform",t(Q-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function P(B,O){var I=B._dims;return I.inputAreaStart+a.stepInset+(I.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function L(B,O){var I=B._dims;return Math.min(1,Math.max(0,(O-a.stepInset-I.inputAreaStart)/(I.inputAreaLength-2*a.stepInset-2*I.inputAreaStart)))}function z(B,O,I){var N=I._dims,U=e.ensureSingle(B,"rect",a.railTouchRectClass,function(W){W.call(v,O,B,I).style("pointer-events","all")});U.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,a.tickOffset+I.ticklen+N.labelHeight)}).call(A.fill,I.bgcolor).attr("opacity",0),E.setTranslate(U,0,N.currentValueTotalHeight)}function F(B,O){var I=O._dims,N=I.inputAreaLength-a.railInset*2,U=e.ensureSingle(B,"rect",a.railRectClass);U.attr({width:N,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,O.bordercolor).call(A.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),E.setTranslate(U,a.railInset,(I.inputAreaWidth-a.railWidth)*.5+I.currentValueTotalHeight)}}}),vM=We({"src/components/sliders/index.js"(Z,V){"use strict";var d=Hm();V.exports={moduleType:"component",name:d.name,layoutAttributes:Vb(),supplyLayoutDefaults:fM(),draw:hM()}}}),n1=We({"src/components/rangeslider/attributes.js"(Z,V){"use strict";var d=nf();V.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),qb=We({"src/components/rangeslider/oppaxis_attributes.js"(Z,V){"use strict";V.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),i1=We({"src/components/rangeslider/constants.js"(Z,V){"use strict";V.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),dM=We({"src/components/rangeslider/helpers.js"(Z){"use strict";var V=cc(),d=zl(),x=i1(),A=gf().LINE_SPACING,E=x.name;function e(t){var r=t&&t[E];return r&&r.visible}Z.isVisible=e,Z.makeData=function(t){for(var r=V.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=rt.max)He=ue[et+1];else if(De=rt.pmax)He=ue[et+1];else if(De0?v.touches[0].clientX:0}function m(v,u,g,f){if(u._context.staticPlot)return;var P=v.select("rect."+h.slideBoxClassName).node(),L=v.select("rect."+h.grabAreaMinClassName).node(),z=v.select("rect."+h.grabAreaMaxClassName).node();function F(){var B=d.event,O=B.target,I=c(B),N=I-v.node().getBoundingClientRect().left,U=f.d2p(g._rl[0]),W=f.d2p(g._rl[1]),Q=n.coverSlip();this.addEventListener("touchmove",le),this.addEventListener("touchend",se),Q.addEventListener("mousemove",le),Q.addEventListener("mouseup",se);function le(he){var q=c(he),$=+q-I,J,X,oe;switch(O){case P:if(oe="ew-resize",U+$>g._length||W+$<0)return;J=U+$,X=W+$;break;case L:if(oe="col-resize",U+$>g._length)return;J=U+$,X=W;break;case z:if(oe="col-resize",W+$<0)return;J=U,X=W+$;break;default:oe="ew-resize",J=N,X=N+$;break}if(X0);if(_){var w=o(n,s,h);T("x",w[0]),T("y",w[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var S=T("bgcolor");T("activecolor",x.contrast(S,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var h=s.calendar;function c(T,l){return d.coerce(a,i,e.buttons,T,l)}var m=c("visible");if(m){var p=c("step");p!=="all"&&(h&&h!=="gregorian"&&(p==="month"||p==="year")?i.stepmode="backward":c("stepmode"),c("count")),c("label")}}function o(a,i,n){for(var s=n.filter(function(p){return i[p].anchor===a._id}),h=0,c=0;c1)){delete h.grid;return}if(!T&&!l&&!_){var g=b("pattern")==="independent";g&&(T=!0)}y._hasSubplotGrid=T;var f=b("roworder"),P=f==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,B;w&&h._splomGridDflt&&(F=h._splomGridDflt.xside,B=h._splomGridDflt.yside),y._domains={x:a("x",b,L,F,u),y:a("y",b,z,B,v,P)}}function a(s,h,c,m,p,T){var l=h(s+"gap",c),_=h("domain."+s);h(s+"side",m);for(var w=new Array(p),S=_[0],M=(_[1]-S)/(p-l),y=M*(1-l),b=0;b0,m=r._context.staticPlot;o.each(function(p){var T=p[0].trace,l=T.error_x||{},_=T.error_y||{},w;T.ids&&(w=function(b){return b.id});var S=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!_.visible&&!l.visible&&(p=[]);var M=d.select(this).selectAll("g.errorbar").data(p,w);if(M.exit().remove(),!!p.length){l.visible||M.selectAll("path.xerror").remove(),_.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var y=M.enter().append("g").classed("errorbar",!0);c&&y.style("opacity",0).transition().duration(i.duration).style("opacity",1),A.setClipUrl(M,a.layerClipId,r),M.each(function(b){var v=d.select(this),u=e(b,s,h);if(!(S&&!b.vis)){var g,f=v.select("path.yerror");if(_.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var P=_.width;g="M"+(u.x-P)+","+u.yh+"h"+2*P+"m-"+P+",0V"+u.ys,u.noYS||(g+="m-"+P+",0h"+2*P),n=!f.size(),n?f=v.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(i.duration).ease(i.easing)),f.attr("d",g)}else f.remove();var L=v.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?_:l).width;g="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(g+="m0,-"+z+"v"+2*z),n=!L.size(),n?L=v.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("xerror",!0):c&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",g)}else L.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),MM=We({"src/components/errorbars/style.js"(Z,V){"use strict";var d=Hi(),x=Fi();V.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),EM=We({"src/components/errorbars/index.js"(Z,V){"use strict";var d=aa(),x=Iu().overrideAll,A=Wb(),E={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A),error_z:d.extendFlat({},A)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,V.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:x(e,"calc","nested"),scattergl:x(E,"calc","nested")}},supplyDefaults:TM(),calc:AM(),makeComputeError:Xb(),plot:SM(),style:MM(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),kM=We({"src/components/colorbar/constants.js"(Z,V){"use strict";V.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),CM=We({"src/components/colorbar/draw.js"(Z,V){"use strict";var d=Hi(),x=Af(),A=Nu(),E=Wi(),e=Mo(),t=ih(),r=aa(),o=r.strTranslate,a=Fo().extendFlat,i=sv(),n=Oo(),s=Fi(),h=xp(),c=zl(),m=ah().flipScale,p=Gm(),T=e1(),l=Of(),_=gf(),w=_.LINE_SPACING,S=_.FROM_TL,M=_.FROM_BR,y=kM().cn;function b(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+y.colorbar).data(v(L),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(y.colorbar,!0),F.each(function(B){var O=d.select(this);r.ensureSingle(O,"rect",y.cbbg),r.ensureSingle(O,"g",y.cbfills),r.ensureSingle(O,"g",y.cblines),r.ensureSingle(O,"g",y.cbaxis,function(N){N.classed(y.crisp,!0)}),r.ensureSingle(O,"g",y.cbtitleunshift,function(N){N.append("g").classed(y.cbtitle,!0)}),r.ensureSingle(O,"rect",y.cboutline);var I=u(O,B,L);I&&I.then&&(L._promises||[]).push(I),L._context.edits.colorbarPosition&&g(O,B,L)}),F.exit().each(function(B){A.autoMargin(L,B._id)}).remove(),F.order()}function v(L){var z=L._fullLayout,F=L.calcdata,B=[],O,I,N,U;function W(j){return a(j,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function Q(){typeof U.calc=="function"?U.calc(L,N,O):(O._fillgradient=I.reversescale?m(I.colorscale):I.colorscale,O._zrange=[I[U.min],I[U.max]])}for(var le=0;le1){var Oe=Math.pow(10,Math.floor(Math.log(yt)/Math.LN10));mr*=Oe*r.roundUp(yt/Oe,[2,5,10]),(Math.abs(et.start)/et.size+1e-6)%1<2e-6&&(pr.tick0=0)}pr.dtick=mr}pr.domain=B?[jt+$/ee.h,jt+ze-$/ee.h]:[jt+q/ee.w,jt+ze-q/ee.w],pr.setScale(),L.attr("transform",o(Math.round(ee.l),Math.round(ee.t)));var Xe=L.select("."+y.cbtitleunshift).attr("transform",o(-Math.round(ee.l),-Math.round(ee.t))),be=pr.ticklabelposition,Ce=pr.title.font.size,Ne=L.select("."+y.cbaxis),Ee,Se=0,Le=0;function at(Qt,Jt){var Sr={propContainer:pr,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:j._dfltTitle.colorbar,containerGroup:L.select("."+y.cbtitle)},oa=Qt.charAt(0)==="h"?Qt.slice(1):"h"+Qt;L.selectAll("."+oa+",."+oa+"-math-group").remove(),h.draw(F,Qt,a(Sr,Jt||{}))}function dt(){if(B&&Or||!B&&!Or){var Qt,Jt;Te==="top"&&(Qt=q+ee.l+Qe*J,Jt=$+ee.t+nt*(1-jt-ze)+3+Ce*.75),Te==="bottom"&&(Qt=q+ee.l+Qe*J,Jt=$+ee.t+nt*(1-jt)-3-Ce*.25),Te==="right"&&(Jt=$+ee.t+nt*X+3+Ce*.75,Qt=q+ee.l+Qe*jt),at(pr._id+"title",{attributes:{x:Qt,y:Jt,"text-anchor":B?"start":"middle"}})}}function gt(){if(B&&!Or||!B&&Or){var Qt=pr.position||0,Jt=pr._offset+pr._length/2,Sr,oa;if(Te==="right")oa=Jt,Sr=ee.l+Qe*Qt+10+Ce*(pr.showticklabels?1:.5);else if(Sr=Jt,Te==="bottom"&&(oa=ee.t+nt*Qt+10+(be.indexOf("inside")===-1?pr.tickfont.size:0)+(pr.ticks!=="inside"&&z.ticklen||0)),Te==="top"){var Ea=_e.text.split("
").length;oa=ee.t+nt*Qt+10-Ae-w*Ce*Ea}at((B?"h":"v")+pr._id+"title",{avoid:{selection:d.select(F).selectAll("g."+pr._id+"tick"),side:Te,offsetTop:B?0:ee.t,offsetLeft:B?ee.l:0,maxShift:B?j.width:j.height},attributes:{x:Sr,y:oa,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}}function Ct(){if(!B&&!Or||B&&Or){var Qt=L.select("."+y.cbtitle),Jt=Qt.select("text"),Sr=[-W/2,W/2],oa=Qt.select(".h"+pr._id+"title-math-group").node(),Ea=15.6;Jt.node()&&(Ea=parseInt(Jt.node().style.fontSize,10)*w);var Sa;if(oa?(Sa=n.bBox(oa),Le=Sa.width,Se=Sa.height,Se>Ea&&(Sr[1]-=(Se-Ea)/2)):Jt.node()&&!Jt.classed(y.jsPlaceholder)&&(Sa=n.bBox(Jt.node()),Le=Sa.width,Se=Sa.height),B){if(Se){if(Se+=5,Te==="top")pr.domain[1]-=Se/ee.h,Sr[1]*=-1;else{pr.domain[0]+=Se/ee.h;var za=c.lineCount(Jt);Sr[1]+=(1-za)*Ea}Qt.attr("transform",o(Sr[0],Sr[1])),pr.setScale()}}else Le&&(Te==="right"&&(pr.domain[0]+=(Le+Ce/2)/ee.w),Qt.attr("transform",o(Sr[0],Sr[1])),pr.setScale())}L.selectAll("."+y.cbfills+",."+y.cblines).attr("transform",B?o(0,Math.round(ee.h*(1-pr.domain[1]))):o(Math.round(ee.w*pr.domain[0]),0)),Ne.attr("transform",B?o(0,Math.round(-ee.t)):o(Math.round(-ee.l),0));var Na=L.select("."+y.cbfills).selectAll("rect."+y.cbfill).attr("style","").data($e);Na.enter().append("rect").classed(y.cbfill,!0).attr("style",""),Na.exit().remove();var Ta=Ie.map(pr.c2p).map(Math.round).sort(function(Gt,Xt){return Gt-Xt});Na.each(function(Gt,Xt){var Rr=[Xt===0?Ie[0]:($e[Xt]+$e[Xt-1])/2,Xt===$e.length-1?Ie[1]:($e[Xt]+$e[Xt+1])/2].map(pr.c2p).map(Math.round);B&&(Rr[1]=r.constrain(Rr[1]+(Rr[1]>Rr[0])?1:-1,Ta[0],Ta[1]));var Yr=d.select(this).attr(B?"x":"y",Ke).attr(B?"y":"x",d.min(Rr)).attr(B?"width":"height",Math.max(Ae,2)).attr(B?"height":"width",Math.max(d.max(Rr)-d.min(Rr),2));if(z._fillgradient)n.gradient(Yr,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var Jr=He(Gt).replace("e-","");Yr.attr("fill",x(Jr).toHexString())}});var nn=L.select("."+y.cblines).selectAll("path."+y.cbline).data(ue.color&&ue.width?ot:[]);nn.enter().append("path").classed(y.cbline,!0),nn.exit().remove(),nn.each(function(Gt){var Xt=Ke,Rr=Math.round(pr.c2p(Gt))+ue.width/2%1;d.select(this).attr("d","M"+(B?Xt+","+Rr:Rr+","+Xt)+(B?"h":"v")+Ae).call(n.lineGroupStyle,ue.width,De(Gt),ue.dash)}),Ne.selectAll("g."+pr._id+"tick,path").remove();var gn=Ke+Ae+(W||0)/2-(z.ticks==="outside"?1:0),Ht=e.calcTicks(pr),It=e.getTickSigns(pr)[2];return e.drawTicks(F,pr,{vals:pr.ticks==="inside"?e.clipEnds(pr,Ht):Ht,layer:Ne,path:e.makeTickPath(pr,gn,It),transFn:e.makeTransTickFn(pr)}),e.drawLabels(F,pr,{vals:Ht,layer:Ne,transFn:e.makeTransTickLabelFn(pr),labelFns:e.makeLabelFns(pr,gn)})}function or(){var Qt,Jt=Ae+W/2;be.indexOf("inside")===-1&&(Qt=n.bBox(Ne.node()),Jt+=B?Qt.width:Qt.height),Ee=Xe.select("text");var Sr=0,oa=B&&Te==="top",Ea=!B&&Te==="right",Sa=0;if(Ee.node()&&!Ee.classed(y.jsPlaceholder)){var za,Na=Xe.select(".h"+pr._id+"title-math-group").node();Na&&(B&&Or||!B&&!Or)?(Qt=n.bBox(Na),Sr=Qt.width,za=Qt.height):(Qt=n.bBox(Xe.node()),Sr=Qt.right-ee.l-(B?Ke:_r),za=Qt.bottom-ee.t-(B?_r:Ke),!B&&Te==="top"&&(Jt+=Qt.height,Sa=Qt.height)),Ea&&(Ee.attr("transform",o(Sr/2+Ce/2,0)),Sr*=2),Jt=Math.max(Jt,B?Sr:za)}var Ta=(B?q:$)*2+Jt+Q+W/2,nn=0;!B&&_e.text&&he==="bottom"&&X<=0&&(nn=Ta/2,Ta+=nn,Sa+=nn),j._hColorbarMoveTitle=nn,j._hColorbarMoveCBTitle=Sa;var gn=Q+W,Ht=(B?Ke:_r)-gn/2-(B?q:0),It=(B?_r:Ke)-(B?ce:$+Sa-nn);L.select("."+y.cbbg).attr("x",Ht).attr("y",It).attr(B?"width":"height",Math.max(Ta-nn,2)).attr(B?"height":"width",Math.max(ce+gn,2)).call(s.fill,le).call(s.stroke,z.bordercolor).style("stroke-width",Q);var Gt=Ea?Math.max(Sr-10,0):0;L.selectAll("."+y.cboutline).attr("x",(B?Ke:_r+q)+Gt).attr("y",(B?_r+$-ce:Ke)+(oa?Se:0)).attr(B?"width":"height",Math.max(Ae,2)).attr(B?"height":"width",Math.max(ce-(B?2*$+Se:2*q+Gt),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":W});var Xt=B?kt*Ta:0,Rr=B?0:(1-Et)*Ta-Sa;if(Xt=ne?ee.l-Xt:-Xt,Rr=oe?ee.t-Rr:-Rr,L.attr("transform",o(Xt,Rr)),!B&&(Q||x(le).getAlpha()&&!x.equals(j.paper_bgcolor,le))){var Yr=Ne.selectAll("text"),Jr=Yr[0].length,ia=L.select("."+y.cbbg).node(),Pa=n.bBox(ia),Ga=n.getTranslate(L),ja=2;Yr.each(function(Lr,Tr){var Cr=0,Kr=Jr-1;if(Tr===Cr||Tr===Kr){var Nr=n.bBox(this),_t=n.getTranslate(this),Wt;if(Tr===Kr){var Ar=Nr.right+_t.x,Vr=Pa.right+Ga.x+_r-Q-ja+J;Wt=Vr-Ar,Wt>0&&(Wt=0)}else if(Tr===Cr){var ma=Nr.left+_t.x,ba=Pa.left+Ga.x+_r+Q+ja;Wt=ba-ma,Wt<0&&(Wt=0)}Wt&&(Jr<3?this.setAttribute("transform","translate("+Wt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Xa={},sn=S[se],Ma=M[se],Xn=S[he],Kn=M[he],St=Ta-Ae;B?(I==="pixels"?(Xa.y=X,Xa.t=ce*Xn,Xa.b=ce*Kn):(Xa.t=Xa.b=0,Xa.yt=X+O*Xn,Xa.yb=X-O*Kn),U==="pixels"?(Xa.x=J,Xa.l=Ta*sn,Xa.r=Ta*Ma):(Xa.l=St*sn,Xa.r=St*Ma,Xa.xl=J-N*sn,Xa.xr=J+N*Ma)):(I==="pixels"?(Xa.x=J,Xa.l=ce*sn,Xa.r=ce*Ma):(Xa.l=Xa.r=0,Xa.xl=J+O*sn,Xa.xr=J-O*Ma),U==="pixels"?(Xa.y=1-X,Xa.t=Ta*Xn,Xa.b=Ta*Kn):(Xa.t=St*Xn,Xa.b=St*Kn,Xa.yt=X-N*Xn,Xa.yb=X+N*Kn));var lt=z.y<.5?"b":"t",br=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var kr={r:j.width-Ht-Xt,l:Ht+Xa.r,b:j.height-It-Rr,t:It+Xa.b};ne&&oe?A.autoMargin(F,z._id,Xa):ne?F._fullLayout._reservedMargin[z._id][lt]=kr[lt]:oe||B?F._fullLayout._reservedMargin[z._id][br]=kr[br]:F._fullLayout._reservedMargin[z._id][lt]=kr[lt]}return r.syncOrAsync([A.previousPromises,dt,Ct,gt,A.previousPromises,or],F)}function g(L,z,F){var B=z.orientation==="v",O=F._fullLayout,I=O._size,N,U,W;t.init({element:L.node(),gd:F,prepFn:function(){N=L.attr("transform"),i(L)},moveFn:function(Q,le){L.attr("transform",N+o(Q,le)),U=t.align((B?z._uFrac:z._vFrac)+Q/I.w,B?z._thickFrac:z._lenFrac,0,1,z.xanchor),W=t.align((B?z._vFrac:1-z._uFrac)-le/I.h,B?z._lenFrac:z._thickFrac,0,1,z.yanchor);var se=t.getCursor(U,W,z.xanchor,z.yanchor);i(L,se)},doneFn:function(){if(i(L),U!==void 0&&W!==void 0){var Q={};Q[z._propPrefix+"x"]=U,Q[z._propPrefix+"y"]=W,z._traceIndex!==void 0?E.call("_guiRestyle",F,Q,z._traceIndex):E.call("_guiRelayout",F,Q)}}})}function f(L,z,F){var B=z._levels,O=[],I=[],N,U,W=B.end+B.size/100,Q=B.size,le=1.001*F[0]-.001*F[1],se=1.001*F[1]-.001*F[0];for(U=0;U<1e5&&(N=B.start+U*Q,!(Q>0?N>=W:N<=W));U++)N>le&&N0?N>=W:N<=W));U++)N>F[0]&&N-1}V.exports=function(o,a){var i,n=o.data,s=o.layout,h=E([],n),c=E({},s,e(a.tileClass)),m=o._context||{};if(a.width&&(c.width=a.width),a.height&&(c.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){c.annotations=[];var p=Object.keys(c);for(i=0;i=0)return m}else if(typeof m=="string"&&(m=m.trim(),m.slice(-1)==="%"&&d(m.slice(0,-1))&&(m=+m.slice(0,-1),m>=0)))return m+"%"}function c(m,p,T,l,_,w){w=w||{};var S=w.moduleHasSelected!==!1,M=w.moduleHasUnselected!==!1,y=w.moduleHasConstrain!==!1,b=w.moduleHasCliponaxis!==!1,v=w.moduleHasTextangle!==!1,u=w.moduleHasInsideanchor!==!1,g=!!w.hasPathbar,f=Array.isArray(_)||_==="auto",P=f||_==="inside",L=f||_==="outside";if(P||L){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),B=m.textfont&&m.textfont.color,O=!B;if(O&&delete F.color,i(l,"insidetextfont",F),g){var I=x.extendFlat({},z);O&&delete I.color,i(l,"pathbar.textfont",I)}L&&i(l,"outsidetextfont",z),S&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),y&&l("constraintext"),b&&l("cliponaxis"),v&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}P&&u&&l("insidetextanchor")}V.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:c,validateCornerradius:h}}}),Yb=We({"src/traces/bar/layout_defaults.js"(Z,V){"use strict";var d=Wi(),x=Mo(),A=aa(),E=s1(),e=Bh().validateCornerradius;V.exports=function(t,r,o){function a(S,M){return A.coerce(t,r,E,S,M)}for(var i=!1,n=!1,s=!1,h={},c=a("barmode"),m=c==="group",p=0;p0&&!h[l]&&(s=!0),h[l]=!0),T.visible&&T.type==="histogram"){var _=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);_.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}c!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var w=a("barcornerradius");r.barcornerradius=e(w)}}}),Wm=We({"src/traces/bar/arrays_to_calcdata.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:A.dflt},Z.coerceColor=function(A,E,e){return d(E).isValid()?E:e!==void 0?e:A.dflt},Z.coerceEnumerated=function(A,E,e){return A.coerceNumber&&(E=+E),A.values.indexOf(E)!==-1?E:e!==void 0?e:A.dflt},Z.getValue=function(A,E){var e;return x(A)?E1||g.bargap===0&&g.bargroupgap===0&&!f[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),v.selectAll("g.points").each(function(f){var P=d.select(this),L=f[0].trace;h(P,L,b)}),e.getComponentMethod("errorbars","style")(v)}function h(b,v,u){A.pointStyle(b.selectAll("path"),v,u),c(b,v,u)}function c(b,v,u){b.selectAll("text").each(function(g){var f=d.select(this),P=E.ensureUniformFontSize(u,l(f,g,v,u));A.font(f,P)})}function m(b,v,u){var g=v[0].trace;g.selectedpoints?p(u,g,b):(h(u,g,b),e.getComponentMethod("errorbars","style")(u))}function p(b,v,u){A.selectedPointStyle(b.selectAll("path"),v),T(b.selectAll("text"),v,u)}function T(b,v,u){b.each(function(g){var f=d.select(this),P;if(g.selected){P=E.ensureUniformFontSize(u,l(f,g,v,u));var L=v.selected.textfont&&v.selected.textfont.color;L&&(P.color=L),A.font(f,P)}else A.selectedTextStyle(f,v)})}function l(b,v,u,g){var f=g._fullLayout.font,P=u.textfont;if(b.classed("bartext-inside")){var L=y(v,u);P=w(u,v.i,f,L)}else b.classed("bartext-outside")&&(P=S(u,v.i,f));return P}function _(b,v,u){return M(o,b.textfont,v,u)}function w(b,v,u,g){var f=_(b,v,u),P=b._input.textfont===void 0||b._input.textfont.color===void 0||Array.isArray(b.textfont.color)&&b.textfont.color[v]===void 0;return P&&(f={color:x.contrast(g),family:f.family,size:f.size,weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow}),M(a,b.insidetextfont,v,f)}function S(b,v,u){var g=_(b,v,u);return M(i,b.outsidetextfont,v,g)}function M(b,v,u,g){v=v||{};var f=n.getValue(v.family,u),P=n.getValue(v.size,u),L=n.getValue(v.color,u),z=n.getValue(v.weight,u),F=n.getValue(v.style,u),B=n.getValue(v.variant,u),O=n.getValue(v.textcase,u),I=n.getValue(v.lineposition,u),N=n.getValue(v.shadow,u);return{family:n.coerceString(b.family,f,g.family),size:n.coerceNumber(b.size,P,g.size),color:n.coerceColor(b.color,L,g.color),weight:n.coerceString(b.weight,z,g.weight),style:n.coerceString(b.style,F,g.style),variant:n.coerceString(b.variant,B,g.variant),textcase:n.coerceString(b.variant,O,g.textcase),lineposition:n.coerceString(b.variant,I,g.lineposition),shadow:n.coerceString(b.variant,N,g.shadow)}}function y(b,v){return v.type==="waterfall"?v[b.dir].marker.color:b.mcc||b.mc||v.marker.color}V.exports={style:s,styleTextPoints:c,styleOnSelect:m,getInsideTextFont:w,getOutsideTextFont:S,getBarColor:y,resizeText:t}}}),Mp=We({"src/traces/bar/plot.js"(Z,V){"use strict";var d=Hi(),x=Uo(),A=aa(),E=zl(),e=Fi(),t=Oo(),r=Wi(),o=Mo().tickText,a=oh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Yh(),h=u1(),c=Sp(),m=Cv(),p=m.text,T=m.textposition,l=Th().appendArrayPointValue,_=c.TEXTPAD;function w(Q){return Q.id}function S(Q){if(Q.ids)return w}function M(Q){return(Q>0)-(Q<0)}function y(Q,le){return Q0}function g(Q,le,se,he,q,$){var J=le.xaxis,X=le.yaxis,oe=Q._fullLayout,ne=Q._context.staticPlot;q||(q={mode:oe.barmode,norm:oe.barmode,gap:oe.bargap,groupgap:oe.bargroupgap},n("bar",oe));var j=A.makeTraceGroups(he,se,"trace bars").each(function(ee){var re=d.select(this),ue=ee[0].trace,_e=ee[0].t,Te=ue.type==="waterfall",Ie=ue.type==="funnel",De=ue.type==="histogram",He=ue.type==="bar",et=He||Ie,rt=0;Te&&ue.connector.visible&&ue.connector.mode==="between"&&(rt=ue.connector.line.width/2);var $e=ue.orientation==="h",ot=u(q),Ae=A.ensureSingle(re,"g","points"),ge=S(ue),ce=Ae.selectAll("g.point").data(A.identity,ge);ce.enter().append("g").classed("point",!0),ce.exit().remove(),ce.each(function(Qe,nt){var Ke=d.select(this),kt=b(Qe,J,X,$e),Et=kt[0][0],Bt=kt[0][1],jt=kt[1][0],_r=kt[1][1],pr=($e?Bt-Et:_r-jt)===0;pr&&et&&h.getLineWidth(ue,Qe)&&(pr=!1),pr||(pr=!x(Et)||!x(Bt)||!x(jt)||!x(_r)),Qe.isBlank=pr,pr&&($e?Bt=Et:_r=jt),rt&&!pr&&($e?(Et-=y(Et,Bt)*rt,Bt+=y(Et,Bt)*rt):(jt-=y(jt,_r)*rt,_r+=y(jt,_r)*rt));var Or,mr;if(ue.type==="waterfall"){if(!pr){var Er=ue[Qe.dir].marker;Or=Er.line.width,mr=Er.color}}else Or=h.getLineWidth(ue,Qe),mr=Qe.mc||ue.marker.color;function yt(gn){var Ht=d.round(Or/2%1,2);return q.gap===0&&q.groupgap===0?d.round(Math.round(gn)-Ht,2):gn}function Oe(gn,Ht,It){return It&&gn===Ht?gn:Math.abs(gn-Ht)>=2?yt(gn):gn>Ht?Math.ceil(gn):Math.floor(gn)}var Xe=e.opacity(mr),be=Xe<1||Or>.01?yt:Oe;Q._context.staticPlot||(Et=be(Et,Bt,$e),Bt=be(Bt,Et,$e),jt=be(jt,_r,!$e),_r=be(_r,jt,!$e));var Ce=$e?J.c2p:X.c2p,Ne;Qe.s0>0?Ne=Qe._sMax:Qe.s0<0?Ne=Qe._sMin:Ne=Qe.s1>0?Qe._sMax:Qe._sMin;function Ee(gn,Ht){if(!gn)return 0;var It=Math.abs($e?_r-jt:Bt-Et),Gt=Math.abs($e?Bt-Et:_r-jt),Xt=be(Math.abs(Ce(Ne,!0)-Ce(0,!0))),Rr=Qe.hasB?Math.min(It/2,Gt/2):Math.min(It/2,Xt),Yr;if(Ht==="%"){var Jr=Math.min(50,gn);Yr=It*(Jr/100)}else Yr=gn;return be(Math.max(Math.min(Yr,Rr),0))}var Se=He||De?Ee(_e.cornerradiusvalue,_e.cornerradiusform):0,Le,at,dt="M"+Et+","+jt+"V"+_r+"H"+Bt+"V"+jt+"Z",gt=0;if(Se&&Qe.s){var Ct=M(Qe.s0)===0||M(Qe.s)===M(Qe.s0)?Qe.s1:Qe.s0;if(gt=be(Qe.hasB?0:Math.abs(Ce(Ne,!0)-Ce(Ct,!0))),gt0?Math.sqrt(gt*(2*Se-gt)):0,Ea=or>0?Math.max:Math.min;Le="M"+Et+","+jt+"V"+(_r-Sr*Qt)+"H"+Ea(Bt-(Se-gt)*or,Et)+"A "+Se+","+Se+" 0 0 "+Jt+" "+Bt+","+(_r-Se*Qt-oa)+"V"+(jt+Se*Qt+oa)+"A "+Se+","+Se+" 0 0 "+Jt+" "+Ea(Bt-(Se-gt)*or,Et)+","+(jt+Sr*Qt)+"Z"}else if(Qe.hasB)Le="M"+(Et+Se*or)+","+jt+"A "+Se+","+Se+" 0 0 "+Jt+" "+Et+","+(jt+Se*Qt)+"V"+(_r-Se*Qt)+"A "+Se+","+Se+" 0 0 "+Jt+" "+(Et+Se*or)+","+_r+"H"+(Bt-Se*or)+"A "+Se+","+Se+" 0 0 "+Jt+" "+Bt+","+(_r-Se*Qt)+"V"+(jt+Se*Qt)+"A "+Se+","+Se+" 0 0 "+Jt+" "+(Bt-Se*or)+","+jt+"Z";else{at=Math.abs(_r-jt)+gt;var Sa=at0?Math.sqrt(gt*(2*Se-gt)):0,Na=Qt>0?Math.max:Math.min;Le="M"+(Et+Sa*or)+","+jt+"V"+Na(_r-(Se-gt)*Qt,jt)+"A "+Se+","+Se+" 0 0 "+Jt+" "+(Et+Se*or-za)+","+_r+"H"+(Bt-Se*or+za)+"A "+Se+","+Se+" 0 0 "+Jt+" "+(Bt-Sa*or)+","+Na(_r-(Se-gt)*Qt,jt)+"V"+jt+"Z"}}else Le=dt}else Le=dt;var Ta=v(A.ensureSingle(Ke,"path"),oe,q,$);if(Ta.style("vector-effect",ne?"none":"non-scaling-stroke").attr("d",isNaN((Bt-Et)*(_r-jt))||pr&&Q._context.staticPlot?"M0,0Z":Le).call(t.setClipUrl,le.layerClipId,Q),!oe.uniformtext.mode&&ot){var nn=t.makePointStyleFns(ue);t.singlePointStyle(Qe,Ta,ue,nn,Q)}f(Q,le,Ke,ee,nt,Et,Bt,jt,_r,Se,gt,q,$),le.layerClipId&&t.hideOutsideRangePoint(Qe,Ke.select("text"),J,X,ue.xcalendar,ue.ycalendar)});var ze=ue.cliponaxis===!1;t.setClipUrl(re,ze?null:le.layerClipId,Q)});r.getComponentMethod("errorbars","plot")(Q,j,le,q)}function f(Q,le,se,he,q,$,J,X,oe,ne,j,ee,re){var ue=le.xaxis,_e=le.yaxis,Te=Q._fullLayout,Ie;function De(at,dt,gt){var Ct=A.ensureSingle(at,"text").text(dt).attr({class:"bartext bartext-"+Ie,"text-anchor":"middle","data-notex":1}).call(t.font,gt).call(E.convertToTspans,Q);return Ct}var He=he[0].trace,et=He.orientation==="h",rt=I(Te,he,q,ue,_e);Ie=N(He,q);var $e=ee.mode==="stack"||ee.mode==="relative",ot=he[q],Ae=!$e||ot._outmost,ge=ot.hasB,ce=ne&&ne-j>_;if(!rt||Ie==="none"||(ot.isBlank||$===J||X===oe)&&(Ie==="auto"||Ie==="inside")){se.select("text").remove();return}var ze=Te.font,Qe=s.getBarColor(he[q],He),nt=s.getInsideTextFont(He,q,ze,Qe),Ke=s.getOutsideTextFont(He,q,ze),kt=He.insidetextanchor||"end",Et=se.datum();et?ue.type==="log"&&Et.s0<=0&&(ue.range[0]0&&yt>0,be;ce?ge?be=P(_r-2*ne,pr,Er,yt,et)||P(_r,pr-2*ne,Er,yt,et):et?be=P(_r-(ne-j),pr,Er,yt,et)||P(_r,pr-2*(ne-j),Er,yt,et):be=P(_r,pr-(ne-j),Er,yt,et)||P(_r-2*(ne-j),pr,Er,yt,et):be=P(_r,pr,Er,yt,et),Xe&&be?Ie="inside":(Ie="outside",Or.remove(),Or=null)}else Ie="inside";if(!Or){Oe=A.ensureUniformFontSize(Q,Ie==="outside"?Ke:nt),Or=De(se,rt,Oe);var Ce=Or.attr("transform");if(Or.attr("transform",""),mr=t.bBox(Or.node()),Er=mr.width,yt=mr.height,Or.attr("transform",Ce),Er<=0||yt<=0){Or.remove();return}}var Ne=He.textangle,Ee,Se;Ie==="outside"?(Se=He.constraintext==="both"||He.constraintext==="outside",Ee=O($,J,X,oe,mr,{isHorizontal:et,constrained:Se,angle:Ne})):(Se=He.constraintext==="both"||He.constraintext==="inside",Ee=F($,J,X,oe,mr,{isHorizontal:et,constrained:Se,angle:Ne,anchor:kt,hasB:ge,r:ne,overhead:j})),Ee.fontSize=Oe.size,i(He.type==="histogram"?"bar":He.type,Ee,Te),ot.transform=Ee;var Le=v(Or,Te,ee,re);A.setTransormAndDisplay(Le,Ee)}function P(Q,le,se,he,q){if(Q<0||le<0)return!1;var $=se<=Q&&he<=le,J=se<=le&&he<=Q,X=q?Q>=se*(le/he):le>=he*(Q/se);return $||J||X}function L(Q){return Q==="auto"?0:Q}function z(Q,le){var se=Math.PI/180*le,he=Math.abs(Math.sin(se)),q=Math.abs(Math.cos(se));return{x:Q.width*q+Q.height*he,y:Q.width*he+Q.height*q}}function F(Q,le,se,he,q,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ne=$.anchor,j=ne==="end",ee=ne==="start",re=$.leftToRight||0,ue=(re+1)/2,_e=1-ue,Te=$.hasB,Ie=$.r,De=$.overhead,He=q.width,et=q.height,rt=Math.abs(le-Q),$e=Math.abs(he-se),ot=rt>2*_&&$e>2*_?_:0;rt-=2*ot,$e-=2*ot;var Ae=L(oe);oe==="auto"&&!(He<=rt&&et<=$e)&&(He>rt||et>$e)&&(!(He>$e||et>rt)||He_){var Qe=B(Q,le,se,he,ge,Ie,De,J,Te);ce=Qe.scale,ze=Qe.pad}else ce=1,X&&(ce=Math.min(1,rt/ge.x,$e/ge.y)),ze=0;var nt=q.left*_e+q.right*ue,Ke=(q.top+q.bottom)/2,kt=(Q+_)*_e+(le-_)*ue,Et=(se+he)/2,Bt=0,jt=0;if(ee||j){var _r=(J?ge.x:ge.y)/2;Ie&&(j||Te)&&(ot+=ze);var pr=J?y(Q,le):y(se,he);J?ee?(kt=Q+pr*ot,Bt=-pr*_r):(kt=le-pr*ot,Bt=pr*_r):ee?(Et=se+pr*ot,jt=-pr*_r):(Et=he-pr*ot,jt=pr*_r)}return{textX:nt,textY:Ke,targetX:kt,targetY:Et,anchorX:Bt,anchorY:jt,scale:ce,rotate:Ae}}function B(Q,le,se,he,q,$,J,X,oe){var ne=Math.max(0,Math.abs(le-Q)-2*_),j=Math.max(0,Math.abs(he-se)-2*_),ee=$-_,re=J?ee-Math.sqrt(ee*ee-(ee-J)*(ee-J)):ee,ue=oe?ee*2:X?ee-J:2*re,_e=oe?ee*2:X?2*re:ee-J,Te,Ie,De,He,et;return q.y/q.x>=j/(ne-ue)?He=j/q.y:q.y/q.x<=(j-_e)/ne?He=ne/q.x:!oe&&X?(Te=q.x*q.x+q.y*q.y/4,Ie=-2*q.x*(ne-ee)-q.y*(j/2-ee),De=(ne-ee)*(ne-ee)+(j/2-ee)*(j/2-ee)-ee*ee,He=(-Ie+Math.sqrt(Ie*Ie-4*Te*De))/(2*Te)):oe?(Te=(q.x*q.x+q.y*q.y)/4,Ie=-q.x*(ne/2-ee)-q.y*(j/2-ee),De=(ne/2-ee)*(ne/2-ee)+(j/2-ee)*(j/2-ee)-ee*ee,He=(-Ie+Math.sqrt(Ie*Ie-4*Te*De))/(2*Te)):(Te=q.x*q.x/4+q.y*q.y,Ie=-q.x*(ne/2-ee)-2*q.y*(j-ee),De=(ne/2-ee)*(ne/2-ee)+(j-ee)*(j-ee)-ee*ee,He=(-Ie+Math.sqrt(Ie*Ie-4*Te*De))/(2*Te)),He=Math.min(1,He),X?et=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(j-q.y*He)/2)*(ee-(j-q.y*He)/2)))-J):et=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(ne-q.x*He)/2)*(ee-(ne-q.x*He)/2)))-J),{scale:He,pad:et}}function O(Q,le,se,he,q,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ne=q.width,j=q.height,ee=Math.abs(le-Q),re=Math.abs(he-se),ue;J?ue=re>2*_?_:0:ue=ee>2*_?_:0;var _e=1;X&&(_e=J?Math.min(1,re/j):Math.min(1,ee/ne));var Te=L(oe),Ie=z(q,Te),De=(J?Ie.x:Ie.y)/2,He=(q.left+q.right)/2,et=(q.top+q.bottom)/2,rt=(Q+le)/2,$e=(se+he)/2,ot=0,Ae=0,ge=J?y(le,Q):y(se,he);return J?(rt=le-ge*ue,ot=ge*De):($e=he+ge*ue,Ae=-ge*De),{textX:He,textY:et,targetX:rt,targetY:$e,anchorX:ot,anchorY:Ae,scale:_e,rotate:Te}}function I(Q,le,se,he,q){var $=le[0].trace,J=$.texttemplate,X;return J?X=U(Q,le,se,he,q):$.textinfo?X=W(le,se,he,q):X=h.getValue($.text,se),h.coerceString(p,X)}function N(Q,le){var se=h.getValue(Q.textposition,le);return h.coerceEnumerated(T,se)}function U(Q,le,se,he,q){var $=le[0].trace,J=A.castOption($,se,"texttemplate");if(!J)return"";var X=$.type==="histogram",oe=$.type==="waterfall",ne=$.type==="funnel",j=$.orientation==="h",ee,re,ue,_e;j?(ee="y",re=q,ue="x",_e=he):(ee="x",re=he,ue="y",_e=q);function Te(ot){return o(re,re.c2l(ot),!0).text}function Ie(ot){return o(_e,_e.c2l(ot),!0).text}var De=le[se],He={};He.label=De.p,He.labelLabel=He[ee+"Label"]=Te(De.p);var et=A.castOption($,De.i,"text");(et===0||et)&&(He.text=et),He.value=De.s,He.valueLabel=He[ue+"Label"]=Ie(De.s);var rt={};l(rt,$,De.i),(X||rt.x===void 0)&&(rt.x=j?He.value:He.label),(X||rt.y===void 0)&&(rt.y=j?He.label:He.value),(X||rt.xLabel===void 0)&&(rt.xLabel=j?He.valueLabel:He.labelLabel),(X||rt.yLabel===void 0)&&(rt.yLabel=j?He.labelLabel:He.valueLabel),oe&&(He.delta=+De.rawS||De.s,He.deltaLabel=Ie(He.delta),He.final=De.v,He.finalLabel=Ie(He.final),He.initial=He.final-He.delta,He.initialLabel=Ie(He.initial)),ne&&(He.value=De.s,He.valueLabel=Ie(He.value),He.percentInitial=De.begR,He.percentInitialLabel=A.formatPercent(De.begR),He.percentPrevious=De.difR,He.percentPreviousLabel=A.formatPercent(De.difR),He.percentTotal=De.sumR,He.percenTotalLabel=A.formatPercent(De.sumR));var $e=A.castOption($,De.i,"customdata");return $e&&(He.customdata=$e),A.texttemplateString({data:[rt,He,$._meta],fallback:$.texttemplatefallback,labels:He,locale:Q._d3locale,template:J})}function W(Q,le,se,he){var q=Q[0].trace,$=q.orientation==="h",J=q.type==="waterfall",X=q.type==="funnel";function oe($e){var ot=$?he:se;return o(ot,$e,!0).text}function ne($e){var ot=$?se:he;return o(ot,+$e,!0).text}var j=q.textinfo,ee=Q[le],re=j.split("+"),ue=[],_e,Te=function($e){return re.indexOf($e)!==-1};if(Te("label")&&ue.push(oe(Q[le].p)),Te("text")&&(_e=A.castOption(q,ee.i,"text"),(_e===0||_e)&&ue.push(_e)),J){var Ie=+ee.rawS||ee.s,De=ee.v,He=De-Ie;Te("initial")&&ue.push(ne(He)),Te("delta")&&ue.push(ne(Ie)),Te("final")&&ue.push(ne(De))}if(X){Te("value")&&ue.push(ne(ee.s));var et=0;Te("percent initial")&&et++,Te("percent previous")&&et++,Te("percent total")&&et++;var rt=et>1;Te("percent initial")&&(_e=A.formatPercent(ee.begR),rt&&(_e+=" of initial"),ue.push(_e)),Te("percent previous")&&(_e=A.formatPercent(ee.difR),rt&&(_e+=" of previous"),ue.push(_e)),Te("percent total")&&(_e=A.formatPercent(ee.sumR),rt&&(_e+=" of total"),ue.push(_e))}return ue.join("
")}V.exports={plot:g,toMoveInsideBar:F}}}),B0=We({"src/traces/bar/hover.js"(Z,V){"use strict";var d=hc(),x=Wi(),A=Fi(),E=aa().fillText,e=u1().getLineWidth,t=Mo().hoverLabelText,r=bs().BADNUM;function o(n,s,h,c,m){var p=a(n,s,h,c,m);if(p){var T=p.cd,l=T[0].trace,_=T[p.index];return p.color=i(l,_),x.getComponentMethod("errorbars","hoverInfo")(_,l,p),[p]}}function a(n,s,h,c,m){var p=n.cd,T=p[0].trace,l=p[0].t,_=c==="closest",w=T.type==="waterfall",S=n.maxHoverDistance,M=n.maxSpikeDistance,y,b,v,u,g,f,P;T.orientation==="h"?(y=h,b=s,v="y",u="x",g=he,f=Q):(y=s,b=h,v="x",u="y",f=he,g=Q);var L=T[v+"period"],z=_||L;function F(_e){return O(_e,-1)}function B(_e){return O(_e,1)}function O(_e,Te){var Ie=_e.w;return _e[v]+Te*Ie/2}function I(_e){return _e[v+"End"]-_e[v+"Start"]}var N=_?F:L?function(_e){return _e.p-I(_e)/2}:function(_e){return Math.min(F(_e),_e.p-l.bardelta/2)},U=_?B:L?function(_e){return _e.p+I(_e)/2}:function(_e){return Math.max(B(_e),_e.p+l.bardelta/2)};function W(_e,Te,Ie){return m.finiteRange&&(Ie=0),d.inbox(_e-y,Te-y,Ie+Math.min(1,Math.abs(Te-_e)/P)-1)}function Q(_e){return W(N(_e),U(_e),S)}function le(_e){return W(F(_e),B(_e),M)}function se(_e){var Te=_e[u];if(w){var Ie=Math.abs(_e.rawS)||0;b>0?Te+=Ie:b<0&&(Te-=Ie)}return Te}function he(_e){var Te=b,Ie=_e.b,De=se(_e);return d.inbox(Ie-Te,De-Te,S+(De-Te)/(De-Ie)-1)}function q(_e){var Te=b,Ie=_e.b,De=se(_e);return d.inbox(Ie-Te,De-Te,M+(De-Te)/(De-Ie)-1)}var $=n[v+"a"],J=n[u+"a"];P=Math.abs($.r2c($.range[1])-$.r2c($.range[0]));function X(_e){return(g(_e)+f(_e))/2}var oe=d.getDistanceFunction(c,g,f,X);if(d.getClosest(p,oe,n),n.index!==!1&&p[n.index].p!==r){z||(N=function(_e){return Math.min(F(_e),_e.p-l.bargroupwidth/2)},U=function(_e){return Math.max(B(_e),_e.p+l.bargroupwidth/2)});var ne=n.index,j=p[ne],ee=T.base?j.b+j.s:j.s;n[u+"0"]=n[u+"1"]=J.c2p(j[u],!0),n[u+"LabelVal"]=ee;var re=l.extents[l.extents.round(j.p)];n[v+"0"]=$.c2p(_?N(j):re[0],!0),n[v+"1"]=$.c2p(_?U(j):re[1],!0);var ue=j.orig_p!==void 0;return n[v+"LabelVal"]=ue?j.orig_p:j.p,n.labelLabel=t($,n[v+"LabelVal"],T[v+"hoverformat"]),n.valueLabel=t(J,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t(J,j.b,T[u+"hoverformat"]),n.spikeDistance=(q(j)+le(j))/2,n[v+"Spike"]=$.c2p(j.p,!0),E(j,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var h=s.mcc||n.marker.color,c=s.mlcc||n.marker.line.color,m=e(n,s);if(A.opacity(h))return h;if(A.opacity(c)&&m)return c}V.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),NM=We({"src/traces/bar/event_data.js"(Z,V){"use strict";V.exports=function(x,A,E){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),E.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),N0=We({"src/traces/bar/select.js"(Z,V){"use strict";V.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(E===!1)for(s=0;s0?(L="v",v>0?z=Math.min(g,u):z=Math.min(u)):v>0?(L="h",z=Math.min(g)):z=0;if(!z){h.visible=!1;return}h._length=z;var N=c("orientation",L);h._hasPreCompStats?N==="v"&&v===0?(c("x0",0),c("dx",1)):N==="h"&&b===0&&(c("y0",0),c("dy",1)):N==="v"&&v===0?c("x0"):N==="h"&&b===0&&c("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,h,["x","y"],m)}function i(s,h,c,m){var p=m.prefix,T=d.coerce2(s,h,r,"marker.outliercolor"),l=c("marker.line.outliercolor"),_="outliers";h._hasPreCompStats?_="all":(T||l)&&(_="suspectedoutliers");var w=c(p+"points",_);w?(c("jitter",w==="all"?.3:0),c("pointpos",w==="all"?-1.5:0),c("marker.symbol"),c("marker.opacity"),c("marker.size"),c("marker.angle"),c("marker.color",h.line.color),c("marker.line.color"),c("marker.line.width"),w==="suspectedoutliers"&&(c("marker.line.outliercolor",h.marker.color),c("marker.line.outlierwidth")),c("selected.marker.color"),c("unselected.marker.color"),c("selected.marker.size"),c("unselected.marker.size"),c("text"),c("hovertext")):delete h.marker;var S=c("hoveron");(S==="all"||S.indexOf("points")!==-1)&&(c("hovertemplate"),c("hovertemplatefallback")),d.coerceSelectionMarkerOpacity(h,c)}function n(s,h){var c,m;function p(w){return d.coerce(m._input,m,r,w)}for(var T=0;Tse.uf};if(M._hasPreCompStats){var ne=M[z],j=function(pr){return L.d2c((M[pr]||[])[f])},ee=1/0,re=-1/0;for(f=0;f=se.q1&&se.q3>=se.med){var _e=j("lowerfence");se.lf=_e!==e&&_e<=se.q1?_e:m(se,q,$);var Te=j("upperfence");se.uf=Te!==e&&Te>=se.q3?Te:p(se,q,$);var Ie=j("mean");se.mean=Ie!==e?Ie:$?E.mean(q,$):(se.q1+se.q3)/2;var De=j("sd");se.sd=Ie!==e&&De>=0?De:$?E.stdev(q,$,se.mean):se.q3-se.q1,se.lo=T(se),se.uo=l(se);var He=j("notchspan");He=He!==e&&He>0?He:_(se,$),se.ln=se.med-He,se.un=se.med+He;var et=se.lf,rt=se.uf;M.boxpoints&&q.length&&(et=Math.min(et,q[0]),rt=Math.max(rt,q[$-1])),M.notched&&(et=Math.min(et,se.ln),rt=Math.max(rt,se.un)),se.min=et,se.max=rt}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+se.q1,"median = "+se.med,"q3 = "+se.q3].join(` -`));var $e;se.med!==e?$e=se.med:se.q1!==e?se.q3!==e?$e=(se.q1+se.q3)/2:$e=se.q1:se.q3!==e?$e=se.q3:$e=0,se.med=$e,se.q1=se.q3=$e,se.lf=se.uf=$e,se.mean=se.sd=$e,se.ln=se.un=$e,se.min=se.max=$e}ee=Math.min(ee,se.min),re=Math.max(re,se.max),se.pts2=he.filter(oe),u.push(se)}}M._extremes[L._id]=x.findExtremes(L,[ee,re],{padded:!0})}else{var ot=L.makeCalcdata(M,z),Ae=o(Q,le),ge=Q.length,ce=a(ge);for(f=0;f=0&&ze0){if(se={},se.pos=se[B]=Q[f],he=se.pts=ce[f].sort(h),q=se[z]=he.map(c),$=q.length,se.min=q[0],se.max=q[$-1],se.mean=E.mean(q,$),se.sd=E.stdev(q,$,se.mean)*M.sdmultiple,se.med=E.interp(q,.5),$%2&&(kt||Et)){var Bt,jt;kt?(Bt=q.slice(0,$/2),jt=q.slice($/2+1)):Et&&(Bt=q.slice(0,$/2+1),jt=q.slice($/2)),se.q1=E.interp(Bt,.5),se.q3=E.interp(jt,.5)}else se.q1=E.interp(q,.25),se.q3=E.interp(q,.75);se.lf=m(se,q,$),se.uf=p(se,q,$),se.lo=T(se),se.uo=l(se);var _r=_(se,$);se.ln=se.med-_r,se.un=se.med+_r,Qe=Math.min(Qe,se.ln),nt=Math.max(nt,se.un),se.pts2=he.filter(oe),u.push(se)}M.notched&&E.isTypedArray(ot)&&(ot=Array.from(ot)),M._extremes[L._id]=x.findExtremes(L,M.notched?ot.concat([Qe,nt]):ot,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:y[g],dPos:le,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(S,"mean \xB1 \u03C3:").replace("\u03C3",M.sdmultiple===1?"\u03C3":M.sdmultiple+"\u03C3"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},y[g]++,u):[{t:{empty:!0}}]};function r(w,S,M,y){var b=S in w,v=S+"0"in w,u="d"+S in w;if(b||v&&u){var g=M.makeCalcdata(w,S),f=A(w,M,S,g).vals;return[f,g]}var P;v?P=w[S+"0"]:"name"in w&&(M.type==="category"||d(w.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(w.name)&&M.type==="date")?P=w.name:P=y;for(var L=M.type==="multicategory"?M.r2c_just_indices(P):M.d2c(P,0,w[S+"calendar"]),z=w._length,F=new Array(z),B=0;B1,v=1-s[r+"gap"],u=1-s[r+"groupgap"];for(m=0;m0;if(L==="positive"?(se=z*(P?1:.5),$=q,he=$=B):L==="negative"?(se=$=B,he=z*(P?1:.5),J=q):(se=he=z,$=J=q),re){var ue=g.pointpos,_e=g.jitter,Te=g.marker.size/2,Ie=0;ue+_e>=0&&(Ie=q*(ue+_e),Ie>se?(ee=!0,ne=Te,X=Ie):Ie>$&&(ne=Te,X=se)),Ie<=se&&(X=se);var De=0;ue-_e<=0&&(De=-q*(ue-_e),De>he?(ee=!0,j=Te,oe=De):De>J&&(j=Te,oe=he)),De<=he&&(oe=he)}else X=se,oe=he;var He=new Array(T.length);for(p=0;pM.lo&&(N.so=!0)}return b});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,c,m)}function a(i,n,s,h){var c=n.val,m=n.pos,p=!!m.rangebreaks,T=h.bPos,l=h.bPosPxOffset||0,_=s.boxmean||(s.meanline||{}).visible,w,S;Array.isArray(h.bdPos)?(w=h.bdPos[0],S=h.bdPos[1]):(w=h.bdPos,S=h.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(y){var b=m.c2l(y.pos+T,!0),v=m.l2p(b-w)+l,u=m.l2p(b+S)+l,g=p?(v+u)/2:m.l2p(b)+l,f=c.c2p(y.mean,!0),P=c.c2p(y.mean-y.sd,!0),L=c.c2p(y.mean+y.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+f+","+v+"V"+u+(_==="sd"?"m0,0L"+P+","+g+"L"+f+","+v+"L"+L+","+g+"Z":"")):d.select(this).attr("d","M"+v+","+f+"H"+u+(_==="sd"?"m0,0L"+g+","+P+"L"+v+","+f+"L"+g+","+L+"Z":""))})}V.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),v1=We({"src/traces/box/style.js"(Z,V){"use strict";var d=Hi(),x=Fi(),A=Oo();function E(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,h=s.line.width;function c(T,l,_,w){T.style("stroke-width",l+"px").call(x.stroke,_).call(x.fill,w)}var m=n.selectAll("path.box");if(s.type==="candlestick")m.each(function(T){if(!T.empty){var l=d.select(this),_=s[T.dir];c(l,_.line.width,_.line.color,_.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{c(m,h,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":h,"stroke-dasharray":2*h+"px,"+h+"px"}).call(x.stroke,s.line.color);var p=n.selectAll("path.point");A.pointStyle(p,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(i,a):A.pointStyle(i,a,t)}V.exports={style:E,styleOnSelect:e}}}),Jb=We({"src/traces/box/hover.js"(Z,V){"use strict";var d=Mo(),x=aa(),A=hc(),E=Fi(),e=x.fillText;function t(a,i,n,s){var h=a.cd,c=h[0].trace,m=c.hoveron,p=[],T;return m.indexOf("boxes")!==-1&&(p=p.concat(r(a,i,n,s))),m.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:p:(T&&p.push(T),p)}function r(a,i,n,s){var h=a.cd,c=a.xa,m=a.ya,p=h[0].trace,T=h[0].t,l=p.type==="violin",_,w,S,M,y,b,v,u,g,f,P,L=T.bdPos,z,F,B=T.wHover,O=function(De){return S.c2l(De.pos)+T.bPos-S.c2l(b)};l&&p.side!=="both"?(p.side==="positive"&&(g=function(De){var He=O(De);return A.inbox(He,He+B,f)},z=L,F=0),p.side==="negative"&&(g=function(De){var He=O(De);return A.inbox(He-B,He,f)},z=0,F=L)):(g=function(De){var He=O(De);return A.inbox(He-B,He+B,f)},z=F=L);var I;l?I=function(De){return A.inbox(De.span[0]-y,De.span[1]-y,f)}:I=function(De){return A.inbox(De.min-y,De.max-y,f)},p.orientation==="h"?(y=i,b=n,v=I,u=g,_="y",S=m,w="x",M=c):(y=n,b=i,v=g,u=I,_="x",S=c,w="y",M=m);var N=Math.min(1,L/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));f=a.maxHoverDistance-N,P=a.maxSpikeDistance-N;function U(De){return(v(De)+u(De))/2}var W=A.getDistanceFunction(s,v,u,U);if(A.getClosest(h,W,a),a.index===!1)return[];var Q=h[a.index],le=p.line.color,se=(p.marker||{}).color;E.opacity(le)&&p.line.width?a.color=le:E.opacity(se)&&p.boxpoints?a.color=se:a.color=p.fillcolor,a[_+"0"]=S.c2p(Q.pos+T.bPos-F,!0),a[_+"1"]=S.c2p(Q.pos+T.bPos+z,!0),a[_+"LabelVal"]=Q.orig_p!==void 0?Q.orig_p:Q.pos;var he=_+"Spike";a.spikeDistance=U(Q)*P/f,a[he]=S.c2p(Q.pos,!0);var q=p.boxmean||p.sizemode==="sd"||(p.meanline||{}).visible,$=p.boxpoints||p.points,J=$&&q?["max","uf","q3","med","mean","q1","lf","min"]:$&&!q?["max","uf","q3","med","q1","lf","min"]:!$&&q?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[x];return E[x]=t,r}}else return E[x]=t,t;return 0},max:function(x,A,E,e){var t=e[A];if(d(t))if(t=Number(t),d(E[x])){if(E[x]v&&vE){var f=u===x?1:6,P=u===x?"M12":"M1";return function(L,z){var F=T.c2d(L,x,l),B=F.indexOf("-",f);B>0&&(F=F.slice(0,B));var O=T.d2c(F,0,l);if(Or?h>E?h>x*1.1?x:h>A*1.1?A:E:h>e?e:h>t?t:r:Math.pow(10,Math.floor(Math.log(h)/Math.LN10))}function n(h,c,m,p,T,l){if(p&&h>E){var _=s(c,T,l),w=s(m,T,l),S=h===x?0:1;return _[S]!==w[S]}return Math.floor(m/h)-Math.floor(c/h)>.1}function s(h,c,m){var p=c.c2d(h,x,m).split("-");return p[0]===""&&(p.unshift(),p[0]="-"+p[0]),p}}}),nw=We({"src/traces/histogram/calc.js"(Z,V){"use strict";var d=Uo(),x=aa(),A=Wi(),E=Mo(),{hasColorscale:e}=ah(),t=nh(),r=Wm(),o=ew(),a=tw(),i=rw(),n=aw();function s(T,l){var _=[],w=[],S=l.orientation==="h",M=E.getFromId(T,S?l.yaxis:l.xaxis),y=S?"y":"x",b={x:"y",y:"x"}[y],v=l[y+"calendar"],u=l.cumulative,g,f=h(T,l,M,y),P=f[0],L=f[1],z=typeof P.size=="string",F=[],B=z?F:P,O=[],I=[],N=[],U=0,W=l.histnorm,Q=l.histfunc,le=W.indexOf("density")!==-1,se,he,q;u.enabled&&le&&(W=W.replace(/ ?density$/,""),le=!1);var $=Q==="max"||Q==="min",J=$?null:0,X=o.count,oe=a[W],ne=!1,j=function(ze){return M.r2c(ze,0,v)},ee;for(x.isArrayOrTypedArray(l[b])&&Q!=="count"&&(ee=l[b],ne=Q==="avg",X=o[Q]),g=j(P.start),he=j(P.end)+(g-E.tickIncrement(g,P.size,!1,v))/1e6;g=0&&q<_e&&(U+=X(q,g,w,ee,I),Te&&N[q].length&&et!==L[N[q][0]]&&(Te=!1),N[q].push(g),He[g]=q,Ie=Math.min(Ie,et-F[q]),De=Math.min(De,F[q+1]-et))}ue.leftGap=Ie,ue.rightGap=De;var rt;Te||(rt=function(ze,Qe){return function(){var nt=T._fullLayout._roundFnOpts[re];return n(nt.leftGap,nt.rightGap,F,M,v)(ze,Qe)}}),ne&&(U=i(w,I)),oe&&oe(w,U,O),u.enabled&&p(w,u.direction,u.currentbin);var $e=Math.min(_.length,w.length),ot=[],Ae=0,ge=$e-1;for(g=0;g<$e;g++)if(w[g]){Ae=g;break}for(g=$e-1;g>=Ae;g--)if(w[g]){ge=g;break}for(g=Ae;g<=ge;g++)if(d(_[g])&&d(w[g])){var ce={p:_[g],s:w[g],b:0};u.enabled||(ce.pts=N[g],Te?ce.ph0=ce.ph1=N[g].length?L[N[g][0]]:_[g]:(l._computePh=!0,ce.ph0=rt(F[g]),ce.ph1=rt(F[g+1],!0))),ot.push(ce)}return ot.length===1&&(ot[0].width1=E.tickIncrement(ot[0].p,P.size,!1,v)-ot[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(ot,l),x.isArrayOrTypedArray(l.selectedpoints)&&x.tagSelected(ot,l,He),ot}function h(T,l,_,w,S){var M=w+"bins",y=T._fullLayout,b=l["_"+w+"bingroup"],v=y._histogramBinOpts[b],u=y.barmode==="overlay",g,f,P,L,z,F,B,O=function(et){return _.r2c(et,0,L)},I=function(et){return _.c2r(et,0,L)},N=_.type==="date"?function(et){return et||et===0?x.cleanDate(et,null,L):null}:function(et){return d(et)?Number(et):null};function U(et,rt,$e){rt[et+"Found"]?(rt[et]=N(rt[et]),rt[et]===null&&(rt[et]=$e[et])):(F[et]=rt[et]=$e[et],x.nestedProperty(f[0],M+"."+et).set($e[et]))}if(l["_"+w+"autoBinFinished"])delete l["_"+w+"autoBinFinished"];else{f=v.traces;var W=[],Q=!0,le=!1,se=!1;for(g=0;g"u"){if(S)return[q,z,!0];q=c(T,l,_,w,M)}B=P.cumulative||{},B.enabled&&B.currentbin!=="include"&&(B.direction==="decreasing"?q.start=I(E.tickIncrement(O(q.start),q.size,!0,L)):q.end=I(E.tickIncrement(O(q.end),q.size,!1,L))),v.size=q.size,v.sizeFound||(F.size=q.size,x.nestedProperty(f[0],M+".size").set(q.size)),U("start",v,q),U("end",v,q)}z=l["_"+w+"pos0"],delete l["_"+w+"pos0"];var J=l._input[M]||{},X=x.extendFlat({},v),oe=v.start,ne=_.r2l(J.start),j=ne!==void 0;if((v.startFound||j)&&ne!==_.r2l(oe)){var ee=j?ne:x.aggNums(Math.min,null,z),re={type:_.type==="category"||_.type==="multicategory"?"linear":_.type,r2l:_.r2l,dtick:v.size,tick0:oe,calendar:L,range:[ee,E.tickIncrement(ee,v.size,!1,L)].map(_.l2r)},ue=E.tickFirst(re);ue>_.r2l(ee)&&(ue=E.tickIncrement(ue,v.size,!0,L)),X.start=_.l2r(ue),j||x.nestedProperty(l,M+".start").set(X.start)}var _e=v.end,Te=_.r2l(J.end),Ie=Te!==void 0;if((v.endFound||Ie)&&Te!==_.r2l(_e)){var De=Ie?Te:x.aggNums(Math.max,null,z);X.end=_.l2r(De),Ie||x.nestedProperty(l,M+".start").set(X.end)}var He="autobin"+w;return l._input[He]===!1&&(l._input[M]=x.extendFlat({},l[M]||{}),delete l._input[He],delete l[He]),[X,z]}function c(T,l,_,w,S){var M=T._fullLayout,y=m(T,l),b=!1,v=1/0,u=[l],g,f,P;for(g=0;g=0;w--)b(w);else if(l==="increasing"){for(w=1;w=0;w--)T[w]+=T[w+1];_==="exclude"&&(T.push(0),T.shift())}}V.exports={calc:s,calcAllAutoBins:h}}}),WM=We({"src/traces/histogram2d/calc.js"(Z,V){"use strict";var d=aa(),x=Mo(),A=ew(),E=tw(),e=rw(),t=aw(),r=nw().calcAllAutoBins;V.exports=function(s,h){var c=x.getFromId(s,h.xaxis),m=x.getFromId(s,h.yaxis),p=h.xcalendar,T=h.ycalendar,l=function(Oe){return c.r2c(Oe,0,p)},_=function(Oe){return m.r2c(Oe,0,T)},w=function(Oe){return c.c2r(Oe,0,p)},S=function(Oe){return m.c2r(Oe,0,T)},M,y,b,v,u=r(s,h,c,"x"),g=u[0],f=u[1],P=r(s,h,m,"y"),L=P[0],z=P[1],F=h._length;f.length>F&&f.splice(F,f.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],I=[],N=typeof g.size=="string",U=typeof L.size=="string",W=[],Q=[],le=N?W:g,se=U?Q:L,he=0,q=[],$=[],J=h.histnorm,X=h.histfunc,oe=J.indexOf("density")!==-1,ne=X==="max"||X==="min",j=ne?null:0,ee=A.count,re=E[J],ue=!1,_e=[],Te=[],Ie="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Ie&&X!=="count"&&(ue=X==="avg",ee=A[X]);var De=g.size,He=l(g.start),et=l(g.end)+(He-x.tickIncrement(He,De,!1,p))/1e6;for(M=He;M=0&&b=0&&vx;i++)a=e(r,o,E(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,h,c,m,p,T,l,_,w,S,M;for(h=0;hS&&(a=Math.max(a,Math.abs(t[n][s]-w)/(M-S))))}return a}}}),y1=We({"src/traces/heatmap/find_empties.js"(Z,V){"use strict";var d=aa().maxRowLength;V.exports=function(A){var E=[],e={},t=[],r=A[0],o=[],a=[0,0,0],i=d(A),n,s,h,c,m,p,T,l;for(s=0;s=0;m--)c=t[m],s=c[0],h=c[1],p=((e[[s-1,h]]||a)[2]+(e[[s+1,h]]||a)[2]+(e[[s,h-1]]||a)[2]+(e[[s,h+1]]||a)[2])/20,p&&(T[c]=[s,h,p],t.splice(m,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(c in T)e[c]=T[c],E.push(T[c])}return E.sort(function(_,w){return w[2]-_[2]})}}}),iw=We({"src/traces/heatmap/make_bound_array.js"(Z,V){"use strict";var d=Wi(),x=aa().isArrayOrTypedArray;V.exports=function(E,e,t,r,o,a){var i=[],n=d.traceIs(E,"contour"),s=d.traceIs(E,"histogram"),h,c,m,p=x(e)&&e.length>1;if(p&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],m=1;m1){var J=($[$.length-1]-$[0])/($.length-1),X=Math.abs(J/100);for(F=0;F<$.length-1;F++)if(Math.abs($[F+1]-$[F]-J)>X)return!1}return!0}T._islinear=!1,l.type==="log"||_.type==="log"?M==="fast"&&I("log axis found"):N(y)?N(g)?T._islinear=!0:M==="fast"&&I("y scale is not linear"):M==="fast"&&I("x scale is not linear");var U=x.maxRowLength(z),W=T.xtype==="scaled"?"":y,Q=n(T,W,b,v,U,l),le=T.ytype==="scaled"?"":g,se=n(T,le,f,P,z.length,_);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[_._id]=A.findExtremes(_,se);var he={x:Q,y:se,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(he.orig_x=u),T.yperiodalignment&&L&&(he.orig_y=L),W&&W.length===Q.length-1&&(he.xCenter=W),le&&le.length===se.length-1&&(he.yCenter=le),S&&(he.xRanges=B.xRanges,he.yRanges=B.yRanges,he.pts=B.pts),w||t(p,T,{vals:z,cLetter:"z"}),w&&T.contours&&T.contours.coloring==="heatmap"){var q={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};he.xfill=n(q,W,b,v,U,l),he.yfill=n(q,le,f,P,z.length,_)}return[he]};function h(m){for(var p=[],T=m.length,l=0;l0;)oe=g.c2p(N[re]),re--;for(oe0;)ee=f.c2p(U[re]),re--;ee=g._length||oe<=0||j>=f._length||ee<=0;if(et){var rt=L.selectAll("image").data([]);rt.exit().remove(),_(L);return}var $e,ot;Te==="fast"?($e=q,ot=he):($e=De,ot=He);var Ae=document.createElement("canvas");Ae.width=$e,Ae.height=ot;var ge=Ae.getContext("2d",{willReadFrequently:!0}),ce=n(F,{noNumericCheck:!0,returnArray:!0}),ze,Qe;Te==="fast"?(ze=$?function(ga){return q-1-ga}:t.identity,Qe=J?function(ga){return he-1-ga}:t.identity):(ze=function(ga){return t.constrain(Math.round(g.c2p(N[ga])-X),0,De)},Qe=function(ga){return t.constrain(Math.round(f.c2p(U[ga])-j),0,He)});var nt=Qe(0),Ke=[nt,nt],kt=$?0:1,Et=J?0:1,Bt=0,jt=0,_r=0,pr=0,Or,mr,Er,yt,Oe;function Xe(ga,jn){if(ga!==void 0){var an=ce(ga);return an[0]=Math.round(an[0]),an[1]=Math.round(an[1]),an[2]=Math.round(an[2]),Bt+=jn,jt+=an[0]*jn,_r+=an[1]*jn,pr+=an[2]*jn,an}return[0,0,0,0]}function be(ga,jn,an,ei){var li=ga[an.bin0];if(li===void 0)return Xe(void 0,1);var _i=ga[an.bin1],xi=jn[an.bin0],Pi=jn[an.bin1],Li=_i-li||0,ri=xi-li||0,vo;return _i===void 0?Pi===void 0?vo=0:xi===void 0?vo=2*(Pi-li):vo=(2*Pi-xi-li)*2/3:Pi===void 0?xi===void 0?vo=0:vo=(2*li-_i-xi)*2/3:xi===void 0?vo=(2*Pi-_i-li)*2/3:vo=Pi+li-_i-xi,Xe(li+an.frac*Li+ei.frac*(ri+an.frac*vo))}if(Te!=="default"){var Ce=0,Ne;try{Ne=new Uint8Array($e*ot*4)}catch{Ne=new Array($e*ot*4)}if(Te==="smooth"){var Ee=W||N,Se=Q||U,Le=new Array(Ee.length),at=new Array(Se.length),dt=new Array(De),gt=W?S:w,Ct=Q?S:w,or,Qt,Jt;for(re=0;reGa||Ga>f._length))for(ue=Yr;ueXa||Xa>g._length)){var sn=o({x:ja,y:Pa},F,y._fullLayout);sn.x=ja,sn.y=Pa;var Ma=z.z[re][ue];Ma===void 0?(sn.z="",sn.zLabel=""):(sn.z=Ma,sn.zLabel=e.tickText(Ht,Ma,"hover").text);var Xn=z.text&&z.text[re]&&z.text[re][ue];(Xn===void 0||Xn===!1)&&(Xn=""),sn.text=Xn;var Kn=t.texttemplateString({data:[sn,F._meta],fallback:F.texttemplatefallback,labels:sn,locale:y._fullLayout._d3locale,template:nn});if(Kn){var St=Kn.split("
"),lt=St.length,br=0;for(_e=0;_e=_[0].length||P<0||P>_.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var L;for(b=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),Jm=We({"src/traces/contour/attributes.js"(Z,V){"use strict";var d=U0(),x=vc(),A=fc(),E=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=Zl(),r=zf().dash,o=_u(),a=Fo().extendFlat,i=E1(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,h=x.line;V.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:a({},d.texttemplate,{}),texttemplatefallback:d.texttemplatefallback,textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},h.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},h.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),cw=We({"src/traces/histogram2dcontour/attributes.js"(Z,V){"use strict";var d=M1(),x=Jm(),A=Zl(),E=fc().axisHoverFormat,e=Fo().extendFlat;V.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:x.texttemplate,texttemplatefallback:x.texttemplatefallback,textfont:x.textfont},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),k1=We({"src/traces/contour/contours_defaults.js"(Z,V){"use strict";V.exports=function(x,A,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=E("contours.size"),i;o?i=A.autocontour=!0:i=E("autocontour",!1),(i||!a)&&E("ncontours")}}}),fw=We({"src/traces/contour/label_defaults.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E,e,t){t||(t={});var r=A("contours.showlabels");if(r){var o=E.font;d.coerceFont(A,"contours.labelfont",o,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),C1=We({"src/traces/contour/style_defaults.js"(Z,V){"use strict";var d=yf(),x=fw();V.exports=function(E,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),nE=We({"src/traces/histogram2dcontour/defaults.js"(Z,V){"use strict";var d=aa(),x=uw(),A=k1(),E=C1(),e=Km(),t=cw();V.exports=function(o,a,i,n){function s(c,m){return d.coerce(o,a,t,c,m)}function h(c){return d.coerce2(o,a,t,c)}x(o,a,s,n),a.visible!==!1&&(A(o,a,s,h),E(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),hw=We({"src/traces/contour/set_contours.js"(Z,V){"use strict";var d=Mo(),x=aa();V.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=A(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,h=e._input.contours;if(n>s&&(r.start=h.start=s,s=r.end=h.end=n,n=r.start),!(r.size>0)){var c;n===s?c=1:c=A(n,s,e.ncontours).dtick,h.size=r.size=c}}};function A(E,e,t){var r={type:"linear",range:[E,e]};return d.autoTicks(r,(e-E)/(t||15)),r}}}),$m=We({"src/traces/contour/end_plus.js"(Z,V){"use strict";V.exports=function(x){return x.end+x.size/1e6}}}),vw=We({"src/traces/contour/calc.js"(Z,V){"use strict";var d=xu(),x=_1(),A=hw(),E=$m();V.exports=function(t,r){var o=x(t,r),a=o[0].z;A(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var h=i.start,c=E(i),m=i.size||1,p=Math.floor((c-h)/m)+1;isFinite(m)||(m=1,p=1);var T=h-m/2,l=T+p*m;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),Qm=We({"src/traces/contour/constants.js"(Z,V){"use strict";V.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),dw=We({"src/traces/contour/make_crossings.js"(Z,V){"use strict";var d=Qm();V.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,h,c,m,p,T;for(i=0;iA?0:1)+(E[0][1]>A?0:2)+(E[1][1]>A?0:4)+(E[1][0]>A?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return A>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),pw=We({"src/traces/contour/find_all_paths.js"(Z,V){"use strict";var d=aa(),x=Qm();V.exports=function(a,i,n){var s,h,c,m,p;for(i=i||.01,n=n||.01,c=0;c20?(c=x.CHOOSESADDLE[c][(m[0]||m[1])<0?0:1],o.crossings[h]=x.SADDLEREMAINDER[c]):delete o.crossings[h],m=x.NEWDELTA[c],!m){d.log("Found bad marching index:",c,a,o.level);break}p.push(r(o,a,m)),a[0]+=m[0],a[1]+=m[1],h=a.join(","),A(p[p.length-1],p[p.length-2],n,s)&&p.pop();var M=m[0]&&(a[0]<0||a[0]>l-2)||m[1]&&(a[1]<0||a[1]>T-2),y=a[0]===_[0]&&a[1]===_[1]&&m[0]===w[0]&&m[1]===w[1];if(y||i&&M)break;c=o.crossings[h]}S===1e4&&d.log("Infinite loop in contour?");var b=A(p[0],p[p.length-1],n,s),v=0,u=.2*o.smoothing,g=[],f=0,P,L,z,F,B,O,I,N,U,W,Q;for(S=1;S=f;S--)if(P=g[S],P=f&&P+g[L]N&&U--,o.edgepaths[U]=Q.concat(p,W));break}q||(o.edgepaths[N]=p.concat(W))}for(N=0;N20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),h=o.z[s][n],c=o.xaxis,m=o.yaxis;if(i[1]){var p=(o.level-h)/(o.z[s][n+1]-h),T=(p!==1?(1-p)*c.c2l(o.x[n]):0)+(p!==0?p*c.c2l(o.x[n+1]):0);return[c.c2p(c.l2c(T),!0),m.c2p(o.y[s],!0),n+p,s]}else{var l=(o.level-h)/(o.z[s+1][n]-h),_=(l!==1?(1-l)*m.c2l(o.y[s]):0)+(l!==0?l*m.c2l(o.y[s+1]):0);return[c.c2p(o.x[n],!0),m.c2p(m.l2c(_),!0),n,s+l]}}}}),iE=We({"src/traces/contour/constraint_mapping.js"(Z,V){"use strict";var d=E1(),x=Uo();V.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function E(t){return function(r){r=A(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),mw=We({"src/traces/contour/empty_pathinfo.js"(Z,V){"use strict";var d=aa(),x=iE(),A=$m();V.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=A(o),s=r.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},c=o.start;c1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),gw=We({"src/traces/contour/convert_to_constraints.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(E){case"=":case"<":return A;case">":for(A.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=A[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(A.prefixBoundary=!1,A.edgepaths.length)return;var o=A.x.length,a=A.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(A.prefixBoundary=!0);break;case"<":(si||A.starts.length&&c===n)&&(A.prefixBoundary=!0);break;case"][":h=Math.min(s[0],s[1]),c=Math.max(s[0],s[1]),hi&&(A.prefixBoundary=!0);break}break}}}}),L1=We({"src/traces/contour/plot.js"(Z){"use strict";var V=Hi(),d=aa(),x=Oo(),A=xu(),E=zl(),e=Mo(),t=Mv(),r=b1(),o=dw(),a=pw(),i=mw(),n=gw(),s=yw(),h=Qm(),c=h.LABELOPTIMIZER;Z.plot=function(y,b,v,u){var g=b.xaxis,f=b.yaxis;d.makeTraceGroups(u,v,"contour").each(function(P){var L=V.select(this),z=P[0],F=z.trace,B=z.x,O=z.y,I=F.contours,N=i(I,b,z),U=d.ensureSingle(L,"g","heatmapcoloring"),W=[];I.coloring==="heatmap"&&(W=[P]),r(y,b,W,U),o(N),a(N);var Q=g.c2p(B[0],!0),le=g.c2p(B[B.length-1],!0),se=f.c2p(O[0],!0),he=f.c2p(O[O.length-1],!0),q=[[Q,he],[le,he],[le,se],[Q,se]],$=N;I.type==="constraint"&&($=n(N,I._operation)),m(L,q,I),p(L,$,q,I),l(L,N,y,z,I),w(L,b,y,z,q)})};function m(M,y,b){var v=d.ensureSingle(M,"g","contourbg"),u=v.selectAll("path").data(b.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+y.join("L")+"Z").style("stroke","none")}function p(M,y,b,v){var u=v.coloring==="fill"||v.type==="constraint"&&v._operation!=="=",g="M"+b.join("L")+"Z";u&&s(y,v);var f=d.ensureSingle(M,"g","contourfill"),P=f.selectAll("path").data(u?y:[]);P.enter().append("path"),P.exit().remove(),P.each(function(L){var z=(L.prefixBoundary?g:"")+T(L,b);z?V.select(this).attr("d",z).style("stroke","none"):V.select(this).remove()})}function T(M,y){var b="",v=0,u=M.edgepaths.map(function(Q,le){return le}),g=!0,f,P,L,z,F,B;function O(Q){return Math.abs(Q[1]-y[0][1])<.01}function I(Q){return Math.abs(Q[1]-y[2][1])<.01}function N(Q){return Math.abs(Q[0]-y[0][0])<.01}function U(Q){return Math.abs(Q[0]-y[2][0])<.01}for(;u.length;){for(B=x.smoothopen(M.edgepaths[v],M.smoothing),b+=g?B:B.replace(/^M/,"L"),u.splice(u.indexOf(v),1),f=M.edgepaths[v][M.edgepaths[v].length-1],z=-1,L=0;L<4;L++){if(!f){d.log("Missing end?",v,M);break}for(O(f)&&!U(f)?P=y[1]:N(f)?P=y[0]:I(f)?P=y[3]:U(f)&&(P=y[2]),F=0;F=0&&(P=W,z=F):Math.abs(f[1]-P[1])<.01?Math.abs(f[1]-W[1])<.01&&(W[0]-f[0])*(P[0]-W[0])>=0&&(P=W,z=F):d.log("endpt to newendpt is not vert. or horz.",f,P,W)}if(f=P,z>=0)break;b+="L"+P}if(z===M.edgepaths.length){d.log("unclosed perimeter path");break}v=z,g=u.indexOf(v)===-1,g&&(v=u[0],b+="Z")}for(v=0;vc.MAXCOST*2)break;O&&(P/=2),f=z-P/2,L=f+P*1.5}if(B<=c.MAXCOST)return F};function _(M,y,b,v){var u=y.width/2,g=y.height/2,f=M.x,P=M.y,L=M.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,B=(f>v.center?v.right-f:f-v.left)/(z+Math.abs(Math.sin(L)*g)),O=(P>v.middle?v.bottom-P:P-v.top)/(Math.abs(F)+Math.cos(L)*g);if(B<1||O<1)return 1/0;var I=c.EDGECOST*(1/(B-1)+1/(O-1));I+=c.ANGLECOST*L*L;for(var N=f-z,U=P-F,W=f+z,Q=P+F,le=0;le=w)&&(r<=_&&(r=_),o>=w&&(o=w),i=Math.floor((o-r)/a)+1,n=0),l=0;l_&&(m.unshift(_),p.unshift(p[0])),m[m.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(h=parseFloat(s.value[0]),s.value=[h,h+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(h=parseFloat(s.value),s.value=[h,h+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),lE=We({"src/traces/contour/defaults.js"(Z,V){"use strict";var d=aa(),x=d1(),A=cv(),E=bw(),e=k1(),t=C1(),r=Km(),o=Jm();V.exports=function(i,n,s,h){function c(l,_){return d.coerce(i,n,o,l,_)}function m(l){return d.coerce2(i,n,o,l)}var p=x(i,n,c,h);if(!p){n.visible=!1;return}A(i,n,h,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate"),c("hovertemplatefallback");var T=c("contours.type")==="constraint";c("connectgaps",d.isArray1D(n.z)),T?E(i,n,c,h,s):(e(i,n,c,m),t(i,n,c,h)),n.contours&&n.contours.coloring==="heatmap"&&r(c,h),c("zorder")}}}),uE=We({"src/traces/contour/index.js"(Z,V){"use strict";V.exports={attributes:Jm(),supplyDefaults:lE(),calc:vw(),plot:L1().plot,style:P1(),colorbar:I1(),hoverPoints:xw(),moduleType:"trace",name:"contour",basePlotModule:Yc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),cE=We({"lib/contour.js"(Z,V){"use strict";V.exports=uE()}}),ww=We({"src/traces/scatterternary/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:A}=wl(),E=uv(),e=vc(),t=El(),r=Zl(),o=zf().dash,a=Fo().extendFlat,i=e.marker,n=e.line,s=i.line;V.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:A({editType:"plot"}),hovertext:a({},e.hovertext,{}),line:{color:n.color,width:n.width,dash:o,backoff:n.backoff,shape:a({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:e.connectgaps,cliponaxis:e.cliponaxis,fill:a({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:a({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:i.angleref,standoff:i.standoff,maxdisplayed:i.maxdisplayed,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:a({width:s.width,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:e.textfont,textposition:e.textposition,selected:e.selected,unselected:e.unselected,hoverinfo:a({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:e.hoveron,hovertemplate:d(),hovertemplatefallback:A()}}}),fE=We({"src/traces/scatterternary/defaults.js"(Z,V){"use strict";var d=aa(),x=Ev(),A=au(),E=Oh(),e=Gh(),t=R0(),r=Hh(),o=fv(),a=ww();V.exports=function(n,s,h,c){function m(M,y){return d.coerce(n,s,a,M,y)}var p=m("a"),T=m("b"),l=m("c"),_;if(p?(_=p.length,T?(_=Math.min(_,T.length),l&&(_=Math.min(_,l.length))):l?_=Math.min(_,l.length):_=0):T&&l&&(_=Math.min(T.length,l.length)),!_){s.visible=!1;return}s._length=_,m("sum"),m("text"),m("hovertext"),s.hoveron!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback"));var w=_"),o.hovertemplate=c.hovertemplate,r}}}),mE=We({"src/traces/scatterternary/event_data.js"(Z,V){"use strict";V.exports=function(x,A,E,e,t){if(A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=A.a,x.b=A.b,x.c=A.c;return x}}}),gE=We({"src/plots/ternary/ternary.js"(Z,V){"use strict";var d=Hi(),x=Af(),A=Wi(),E=aa(),e=E.strTranslate,t=E._,r=Fi(),o=Oo(),a=Mv(),i=Fo().extendFlat,n=Nu(),s=Mo(),h=ih(),c=hc(),m=lv(),p=m.freeMode,T=m.rectMode,l=xp(),_=Ec().prepSelect,w=Ec().selectOnClick,S=Ec().clearOutline,M=Ec().clearSelectionsCache,y=Sf();function b(I,N){this.id=I.id,this.graphDiv=I.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}V.exports=b;var v=b.prototype;v.init=function(I){this.container=I._ternarylayer,this.defs=I._defs,this.layoutId=I._uid,this.traceHash={},this.layers={}},v.plot=function(I,N){var U=this,W=N[U.id],Q=N._size;U._hasClipOnAxisFalse=!1;for(var le=0;leu*$?(ue=$,re=ue*u):(re=q,ue=re/u),_e=se*re/q,Te=he*ue/$,j=N.l+N.w*Q-re/2,ee=N.t+N.h*(1-le)-ue/2,U.x0=j,U.y0=ee,U.w=re,U.h=ue,U.sum=J,U.xaxis={type:"linear",range:[X+2*ne-J,J-X-2*oe],domain:[Q-_e/2,Q+_e/2],_id:"x"},a(U.xaxis,U.graphDiv._fullLayout),U.xaxis.setScale(),U.xaxis.isPtWithinRange=function(ze){return ze.a>=U.aaxis.range[0]&&ze.a<=U.aaxis.range[1]&&ze.b>=U.baxis.range[1]&&ze.b<=U.baxis.range[0]&&ze.c>=U.caxis.range[1]&&ze.c<=U.caxis.range[0]},U.yaxis={type:"linear",range:[X,J-oe-ne],domain:[le-Te/2,le+Te/2],_id:"y"},a(U.yaxis,U.graphDiv._fullLayout),U.yaxis.setScale(),U.yaxis.isPtWithinRange=function(){return!0};var Ie=U.yaxis.domain[0],De=U.aaxis=i({},I.aaxis,{range:[X,J-oe-ne],side:"left",tickangle:(+I.aaxis.tickangle||0)-30,domain:[Ie,Ie+Te*u],anchor:"free",position:0,_id:"y",_length:re});a(De,U.graphDiv._fullLayout),De.setScale();var He=U.baxis=i({},I.baxis,{range:[J-X-ne,oe],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:re});a(He,U.graphDiv._fullLayout),He.setScale();var et=U.caxis=i({},I.caxis,{range:[J-X-oe,ne],side:"right",tickangle:(+I.caxis.tickangle||0)+30,domain:[Ie,Ie+Te*u],anchor:"free",position:0,_id:"y",_length:re});a(et,U.graphDiv._fullLayout),et.setScale();var rt="M"+j+","+(ee+ue)+"h"+re+"l-"+re/2+",-"+ue+"Z";U.clipDef.select("path").attr("d",rt),U.layers.plotbg.select("path").attr("d",rt);var $e="M0,"+ue+"h"+re+"l-"+re/2+",-"+ue+"Z";U.clipDefRelative.select("path").attr("d",$e);var ot=e(j,ee);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ot),U.clipDefRelative.select("path").attr("transform",null);var Ae=e(j-He._offset,ee+ue);U.layers.baxis.attr("transform",Ae),U.layers.bgrid.attr("transform",Ae);var ge=e(j+re/2,ee)+"rotate(30)"+e(0,-De._offset);U.layers.aaxis.attr("transform",ge),U.layers.agrid.attr("transform",ge);var ce=e(j+re/2,ee)+"rotate(-30)"+e(0,-et._offset);U.layers.caxis.attr("transform",ce),U.layers.cgrid.attr("transform",ce),U.drawAxes(!0),U.layers.aline.select("path").attr("d",De.showline?"M"+j+","+(ee+ue)+"l"+re/2+",-"+ue:"M0,0").call(r.stroke,De.linecolor||"#000").style("stroke-width",(De.linewidth||0)+"px"),U.layers.bline.select("path").attr("d",He.showline?"M"+j+","+(ee+ue)+"h"+re:"M0,0").call(r.stroke,He.linecolor||"#000").style("stroke-width",(He.linewidth||0)+"px"),U.layers.cline.select("path").attr("d",et.showline?"M"+(j+re/2)+","+ee+"l"+re/2+","+ue:"M0,0").call(r.stroke,et.linecolor||"#000").style("stroke-width",(et.linewidth||0)+"px"),U.graphDiv._context.staticPlot||U.initInteractions(),o.setClipUrl(U.layers.frontplot,U._hasClipOnAxisFalse?null:U.clipId,U.graphDiv)},v.drawAxes=function(I){var N=this,U=N.graphDiv,W=N.id.slice(7)+"title",Q=N.layers,le=N.aaxis,se=N.baxis,he=N.caxis;if(N.drawAx(le),N.drawAx(se),N.drawAx(he),I){var q=Math.max(le.showticklabels?le.tickfont.size/2:0,(he.showticklabels?he.tickfont.size*.75:0)+(he.ticks==="outside"?he.ticklen*.87:0)),$=(se.showticklabels?se.tickfont.size:0)+(se.ticks==="outside"?se.ticklen:0)+3;Q["a-title"]=l.draw(U,"a"+W,{propContainer:le,propName:N.id+".aaxis.title.text",placeholder:t(U,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-le.title.font.size/3-q,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+W,{propContainer:se,propName:N.id+".baxis.title.text",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-$,y:N.y0+N.h+se.title.font.size*.83+$,"text-anchor":"middle"}}),Q["c-title"]=l.draw(U,"c"+W,{propContainer:he,propName:N.id+".caxis.title.text",placeholder:t(U,"Click to enter Component C title"),attributes:{x:N.x0+N.w+$,y:N.y0+N.h+he.title.font.size*.83+$,"text-anchor":"middle"}})}},v.drawAx=function(I){var N=this,U=N.graphDiv,W=I._name,Q=W.charAt(0),le=I._id,se=N.layers[W],he=30,q=Q+"tickLayout",$=g(I);N[q]!==$&&(se.selectAll("."+le+"tick").remove(),N[q]=$),I.setScale();var J=s.calcTicks(I),X=s.clipEnds(I,J),oe=s.makeTransTickFn(I),ne=s.getTickSigns(I)[2],j=E.deg2rad(he),ee=ne*(I.linewidth||1)/2,re=ne*I.ticklen,ue=N.w,_e=N.h,Te=Q==="b"?"M0,"+ee+"l"+Math.sin(j)*re+","+Math.cos(j)*re:"M"+ee+",0l"+Math.cos(j)*re+","+-Math.sin(j)*re,Ie={a:"M0,0l"+_e+",-"+ue/2,b:"M0,0l-"+ue/2+",-"+_e,c:"M0,0l-"+_e+","+ue/2}[Q];s.drawTicks(U,I,{vals:I.ticks==="inside"?X:J,layer:se,path:Te,transFn:oe,crisp:!1}),s.drawGrid(U,I,{vals:X,layer:N.layers[Q+"grid"],path:Ie,transFn:oe,crisp:!1}),s.drawLabels(U,I,{vals:J,layer:se,transFn:oe,labelFns:s.makeLabelFns(I,0,he)})};function g(I){return I.ticks+String(I.ticklen)+String(I.showticklabels)}var f=y.MINZOOM/2+.87,P="m-0.87,.5h"+f+"v3h-"+(f+5.2)+"l"+(f/2+2.6)+",-"+(f*.87+4.5)+"l2.6,1.5l-"+f/2+","+f*.87+"Z",L="m0.87,.5h-"+f+"v3h"+(f+5.2)+"l-"+(f/2+2.6)+",-"+(f*.87+4.5)+"l-2.6,1.5l"+f/2+","+f*.87+"Z",z="m0,1l"+f/2+","+f*.87+"l2.6,-1.5l-"+(f/2+2.6)+",-"+(f*.87+4.5)+"l-"+(f/2+2.6)+","+(f*.87+4.5)+"l2.6,1.5l"+f/2+",-"+f*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",B=!0;v.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},v.initInteractions=function(){var I=this,N=I.layers.plotbg.select("path").node(),U=I.graphDiv,W=U._fullLayout._zoomlayer,Q,le;this.dragOptions={element:N,gd:U,plotinfo:{id:I.id,domain:U._fullLayout[I.id].domain,xaxis:I.xaxis,yaxis:I.yaxis},subplot:I.id,prepFn:function(Ae,ge,ce){I.dragOptions.xaxes=[I.xaxis],I.dragOptions.yaxes=[I.yaxis],Q=U._fullLayout._invScaleX,le=U._fullLayout._invScaleY;var ze=I.dragOptions.dragmode=U._fullLayout.dragmode;p(ze)?I.dragOptions.minDrag=1:I.dragOptions.minDrag=void 0,ze==="zoom"?(I.dragOptions.moveFn=He,I.dragOptions.clickFn=ue,I.dragOptions.doneFn=et,_e(Ae,ge,ce)):ze==="pan"?(I.dragOptions.moveFn=$e,I.dragOptions.clickFn=ue,I.dragOptions.doneFn=ot,rt(),I.clearOutline(U)):(T(ze)||p(ze))&&_(Ae,ge,ce,I.dragOptions,ze)}};var se,he,q,$,J,X,oe,ne,j,ee;function re(Ae){var ge={};return ge[I.id+".aaxis.min"]=Ae.a,ge[I.id+".baxis.min"]=Ae.b,ge[I.id+".caxis.min"]=Ae.c,ge}function ue(Ae,ge){var ce=U._fullLayout.clickmode;O(U),Ae===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,re({a:0,b:0,c:0}))),ce.indexOf("select")>-1&&Ae===1&&w(ge,U,[I.xaxis],[I.yaxis],I.id,I.dragOptions),ce.indexOf("event")>-1&&c.click(U,ge,I.id)}function _e(Ae,ge,ce){var ze=N.getBoundingClientRect();se=ge-ze.left,he=ce-ze.top,U._fullLayout._calcInverseTransform(U);var Qe=U._fullLayout._invTransform,nt=E.apply3DTransform(Qe)(se,he);se=nt[0],he=nt[1],q={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=q,$=I.aaxis.range[1]-q.a,X=x(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),oe="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",ne=!1,j=W.append("path").attr("class","zoombox").attr("transform",e(I.x0,I.y0)).style({fill:X>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",oe),ee=W.append("path").attr("class","zoombox-corners").attr("transform",e(I.x0,I.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),I.clearOutline(U)}function Te(Ae,ge){return 1-ge/I.h}function Ie(Ae,ge){return 1-(Ae+(I.h-ge)/Math.sqrt(3))/I.w}function De(Ae,ge){return(Ae-(I.h-ge)/Math.sqrt(3))/I.w}function He(Ae,ge){var ce=se+Ae*Q,ze=he+ge*le,Qe=Math.max(0,Math.min(1,Te(se,he),Te(ce,ze))),nt=Math.max(0,Math.min(1,Ie(se,he),Ie(ce,ze))),Ke=Math.max(0,Math.min(1,De(se,he),De(ce,ze))),kt=(Qe/2+Ke)*I.w,Et=(1-Qe/2-nt)*I.w,Bt=(kt+Et)/2,jt=Et-kt,_r=(1-Qe)*I.h,pr=_r-jt/u;jt.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ee.transition().style("opacity",1).duration(200),ne=!0),U.emit("plotly_relayouting",re(J))}function et(){O(U),J!==q&&(A.call("_guiRelayout",U,re(J)),B&&U.data&&U._context.showTips&&(E.notifier(t(U,"Double-click to zoom back out"),"long"),B=!1))}function rt(){q={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=q}function $e(Ae,ge){var ce=Ae/I.xaxis._m,ze=ge/I.yaxis._m;J={a:q.a-ze,b:q.b+(ce+ze)/2,c:q.c-(ce-ze)/2};var Qe=[J.a,J.b,J.c].sort(E.sorterAsc),nt={a:Qe.indexOf(J.a),b:Qe.indexOf(J.b),c:Qe.indexOf(J.c)};Qe[0]<0&&(Qe[1]+Qe[0]/2<0?(Qe[2]+=Qe[0]+Qe[1],Qe[0]=Qe[1]=0):(Qe[2]+=Qe[0]/2,Qe[1]+=Qe[0]/2,Qe[0]=0),J={a:Qe[nt.a],b:Qe[nt.b],c:Qe[nt.c]},ge=(q.a-J.a)*I.yaxis._m,Ae=(q.c-J.c-q.b+J.b)*I.xaxis._m);var Ke=e(I.x0+Ae,I.y0+ge);I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Ke);var kt=e(-Ae,-ge);I.clipDefRelative.select("path").attr("transform",kt),I.aaxis.range=[J.a,I.sum-J.b-J.c],I.baxis.range=[I.sum-J.a-J.c,J.b],I.caxis.range=[I.sum-J.a-J.b,J.c],I.drawAxes(!1),I._hasClipOnAxisFalse&&I.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,I),U.emit("plotly_relayouting",re(J))}function ot(){A.call("_guiRelayout",U,re(J))}N.onmousemove=function(Ae){c.hover(U,Ae,I.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=I.id},N.onmouseout=function(Ae){U._dragging||h.unhover(U,Ae)},h.init(this.dragOptions)};function O(I){d.select(I).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Tw=We({"src/plots/ternary/layout_attributes.js"(Z,V){"use strict";var d=nf(),x=Uu().attributes,A=Of(),E=Iu().overrideAll,e=Fo().extendFlat,t={title:{text:A.title.text,font:A.title.font},color:A.color,tickmode:A.minor.tickmode,nticks:e({},A.nticks,{dflt:6,min:1}),tick0:A.tick0,dtick:A.dtick,tickvals:A.tickvals,ticktext:A.ticktext,ticks:A.ticks,ticklen:A.ticklen,tickwidth:A.tickwidth,tickcolor:A.tickcolor,ticklabelstep:A.ticklabelstep,showticklabels:A.showticklabels,labelalias:A.labelalias,showtickprefix:A.showtickprefix,tickprefix:A.tickprefix,showticksuffix:A.showticksuffix,ticksuffix:A.ticksuffix,showexponent:A.showexponent,exponentformat:A.exponentformat,minexponent:A.minexponent,separatethousands:A.separatethousands,tickfont:A.tickfont,tickangle:A.tickangle,tickformat:A.tickformat,tickformatstops:A.tickformatstops,hoverformat:A.hoverformat,showline:e({},A.showline,{dflt:!0}),linecolor:A.linecolor,linewidth:A.linewidth,showgrid:e({},A.showgrid,{dflt:!0}),gridcolor:A.gridcolor,gridwidth:A.gridwidth,griddash:A.griddash,layer:A.layer,min:{valType:"number",dflt:0,min:0}},r=V.exports=E({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),Id=We({"src/plots/subplot_defaults.js"(Z,V){"use strict";var d=aa(),x=sl(),A=Uu().defaults;V.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",h=t._subplots[a],c=h.length,m=c&&h[0].replace(/\d+$/,""),p,T;function l(M,y){return d.coerce(p,T,i,M,y)}for(var _=0;_=_&&(b.min=0,v.min=0,u.min=0,c.aaxis&&delete c.aaxis.min,c.baxis&&delete c.baxis.min,c.caxis&&delete c.caxis.min)}function h(c,m,p,T){var l=i[m._name];function _(g,f){return A.coerce(c,m,l,g,f)}_("uirevision",T.uirevision),m.type="linear";var w=_("color"),S=w!==l.color.dflt?w:p.font.color,M=m._name,y=M.charAt(0).toUpperCase(),b="Component "+y,v=_("title.text",b);m._hovertitle=v===b?v:y,A.coerceFont(_,"title.font",p.font,{overrideDflt:{size:A.bigFont(p.font.size),color:S}}),_("min"),o(c,m,_,"linear"),t(c,m,_,"linear"),e(c,m,_,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(c,m,_,{outerTicks:!0});var u=_("showticklabels");u&&(A.coerceFont(_,"tickfont",p.font,{overrideDflt:{color:S}}),_("tickangle"),_("tickformat")),a(c,m,_,{dfltColor:w,bgColor:p.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),_("hoverformat"),_("layer")}}}),_E=We({"src/plots/ternary/index.js"(Z){"use strict";var V=gE(),d=Ff().getSubplotCalcData,x=aa().counterRegex,A="ternary";Z.name=A;var E=Z.attr="subplot";Z.idRoot=A,Z.idRegex=Z.attrRegex=x(A);var e=Z.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},Z.layoutAttributes=Tw(),Z.supplyLayoutDefaults=yE(),Z.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[A],n=0;n0){var M=r.xa,y=r.ya,b,v,u,g,f;c.orientation==="h"?(f=o,b="y",u=y,v="x",g=M):(f=a,b="x",u=M,v="y",g=y);var P=h[r.index];if(f>=P.span[0]&&f<=P.span[1]){var L=x.extendFlat({},r),z=g.c2p(f,!0),F=e.getKdeValue(P,c,f),B=e.getPositionOnKdePath(P,c,z),O=u._offset,I=u._length;L[b+"0"]=B[0],L[b+"1"]=B[1],L[v+"0"]=L[v+"1"]=z,L[v+"Label"]=v+": "+A.hoverLabelText(g,f,c[v+"hoverformat"])+", "+h[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(p){if(!p.isBlank){var T=m.marker;d.select(this).call(A.fill,p.mc||T.color).call(A.stroke,p.mlc||T.line.color).call(x.dashLine,T.line.dash,p.mlw||T.line.width).style("opacity",m.selectedpoints&&!p.selected?E:1)}}),r(c,m,a),c.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(A.fill,m.connector.fillcolor)}),c.selectAll(".lines").each(function(){var p=m.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),p.width,p.color,p.dash)})})}V.exports={style:o}}}),BE=We({"src/traces/funnel/hover.js"(Z,V){"use strict";var d=Fi().opacity,x=B0().hoverOnBars,A=aa().formatPercent;V.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,h=s[0].trace,c=h.orientation==="h",m=n.index,p=s[m],T=c?"x":"y";n[T+"LabelVal"]=p.s,n.percentInitial=p.begR,n.percentInitialLabel=A(p.begR,1),n.percentPrevious=p.difR,n.percentPreviousLabel=A(p.difR,1),n.percentTotal=p.sumR,n.percentTotalLabel=A(p.sumR,1);var l=p.hi||h.hoverinfo,_=[];if(l&&l!=="none"&&l!=="skip"){var w=l==="all",S=l.split("+"),M=function(y){return w||S.indexOf(y)!==-1};M("percent initial")&&_.push(n.percentInitialLabel+" of initial"),M("percent previous")&&_.push(n.percentPreviousLabel+" of previous"),M("percent total")&&_.push(n.percentTotalLabel+" of total")}return n.extraText=_.join("
"),n.color=E(h,p),[n]}};function E(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),NE=We({"src/traces/funnel/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"percentInitial"in A&&(x.percentInitial=A.percentInitial),"percentPrevious"in A&&(x.percentPrevious=A.percentPrevious),"percentTotal"in A&&(x.percentTotal=A.percentTotal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),UE=We({"src/traces/funnel/index.js"(Z,V){"use strict";V.exports={attributes:Mw(),layoutAttributes:Ew(),supplyDefaults:kw().supplyDefaults,crossTraceDefaults:kw().crossTraceDefaults,supplyLayoutDefaults:IE(),calc:DE(),crossTraceCalc:zE(),plot:FE(),style:OE().style,hoverPoints:BE(),eventData:NE(),selectPoints:N0(),moduleType:"trace",name:"funnel",basePlotModule:Yc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),jE=We({"lib/funnel.js"(Z,V){"use strict";V.exports=UE()}}),VE=We({"src/traces/waterfall/constants.js"(Z,V){"use strict";V.exports={eventDataKeys:["initial","delta","final"]}}}),Cw=We({"src/traces/waterfall/attributes.js"(Z,V){"use strict";var d=Cv(),x=vc().line,A=El(),E=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=wl(),o=VE(),a=Fo().extendFlat,i=Fi();function n(s){return{marker:{color:a({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:a({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:a({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}V.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:o.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:a({},A.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:o.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:n("increasing"),decreasing:n("decreasing"),totals:n("intermediate sums and total"),connector:{line:{color:a({},x.color,{dflt:i.defaultLine}),width:a({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),Lw=We({"src/traces/waterfall/layout_attributes.js"(Z,V){"use strict";V.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),j0=We({"src/constants/delta.js"(Z,V){"use strict";V.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}}}),Pw=We({"src/traces/waterfall/defaults.js"(Z,V){"use strict";var d=aa(),x=Tp(),A=Bh().handleText,E=I0(),e=cv(),t=Cw(),r=Fi(),o=j0(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(m,p,T){m(p+".marker.color",T),m(p+".marker.line.color",r.defaultLine),m(p+".marker.line.width")}function h(m,p,T,l){function _(b,v){return d.coerce(m,p,t,b,v)}var w=E(m,p,l,_);if(!w){p.visible=!1;return}e(m,p,l,_),_("xhoverformat"),_("yhoverformat"),_("measure"),_("orientation",p.x&&!p.y?"h":"v"),_("base"),_("offset"),_("width"),_("text"),_("hovertext"),_("hovertemplate"),_("hovertemplatefallback");var S=_("textposition");A(m,p,l,_,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),p.textposition!=="none"&&(_("texttemplate"),_("texttemplatefallback"),p.texttemplate||_("textinfo")),s(_,"increasing",a),s(_,"decreasing",i),s(_,"totals",n);var M=_("connector.visible");if(M){_("connector.mode");var y=_("connector.line.width");y&&(_("connector.line.color"),_("connector.line.dash"))}_("zorder")}function c(m,p){var T,l;function _(S){return d.coerce(l._input,l,t,S)}if(p.waterfallmode==="group")for(var w=0;w0&&(_?f+="M"+u[0]+","+g[1]+"V"+g[0]:f+="M"+u[1]+","+g[0]+"H"+u[0]),w!=="between"&&(y.isSum||b path").each(function(p){if(!p.isBlank){var T=m[p.dir].marker;d.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",m.selectedpoints&&!p.selected?E:1)}}),r(c,m,a),c.selectAll(".lines").each(function(){var p=m.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),p.width,p.color,p.dash)})})}V.exports={style:o}}}),ZE=We({"src/traces/waterfall/hover.js"(Z,V){"use strict";var d=Mo().hoverLabelText,x=Fi().opacity,A=B0().hoverOnBars,E=j0(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};V.exports=function(o,a,i,n,s){var h=A(o,a,i,n,s);if(!h)return;var c=h.cd,m=c[0].trace,p=m.orientation==="h",T=p?"x":"y",l=p?o.xa:o.ya;function _(P){return d(l,P,m[T+"hoverformat"])}var w=h.index,S=c[w],M=S.isSum?S.b+S.s:S.rawS;h.initial=S.b+S.s-M,h.delta=M,h.final=h.initial+h.delta;var y=_(Math.abs(h.delta));h.deltaLabel=M<0?"("+y+")":y,h.finalLabel=_(h.final),h.initialLabel=_(h.initial);var b=S.hi||m.hoverinfo,v=[];if(b&&b!=="none"&&b!=="skip"){var u=b==="all",g=b.split("+"),f=function(P){return u||g.indexOf(P)!==-1};S.isSum||(f("final")&&(p?!f("x"):!f("y"))&&v.push(h.finalLabel),f("delta")&&(M<0?v.push(h.deltaLabel+" "+e.decreasing):v.push(h.deltaLabel+" "+e.increasing)),f("initial")&&v.push("Initial: "+h.initialLabel))}return v.length&&(h.extraText=v.join("
")),h.color=t(m,S),[h]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),YE=We({"src/traces/waterfall/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"initial"in A&&(x.initial=A.initial),"delta"in A&&(x.delta=A.delta),"final"in A&&(x.final=A.final),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),KE=We({"src/traces/waterfall/index.js"(Z,V){"use strict";V.exports={attributes:Cw(),layoutAttributes:Lw(),supplyDefaults:Pw().supplyDefaults,crossTraceDefaults:Pw().crossTraceDefaults,supplyLayoutDefaults:qE(),calc:GE(),crossTraceCalc:HE(),plot:WE(),style:XE().style,hoverPoints:ZE(),eventData:YE(),selectPoints:N0(),moduleType:"trace",name:"waterfall",basePlotModule:Yc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),JE=We({"lib/waterfall.js"(Z,V){"use strict";V.exports=KE()}}),V0=We({"src/traces/image/constants.js"(Z,V){"use strict";V.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%",""]}}}}}),Iw=We({"src/traces/image/attributes.js"(Z,V){"use strict";var d=El(),x=vc().zorder,{hovertemplateAttrs:A,templatefallbackAttrs:E}=wl(),e=Fo().extendFlat,t=V0().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],o=[],a=[];for(n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");m===-1&&(m=c);var p=m===c?0:4-m%4;return[m,p]}function r(h){var c=t(h),m=c[0],p=c[1];return(m+p)*3/4-p}function o(h,c,m){return(c+m)*3/4-m}function a(h){var c,m=t(h),p=m[0],T=m[1],l=new x(o(h,p,T)),_=0,w=T>0?p-4:p,S;for(S=0;S>16&255,l[_++]=c>>8&255,l[_++]=c&255;return T===2&&(c=d[h.charCodeAt(S)]<<2|d[h.charCodeAt(S+1)]>>4,l[_++]=c&255),T===1&&(c=d[h.charCodeAt(S)]<<10|d[h.charCodeAt(S+1)]<<4|d[h.charCodeAt(S+2)]>>2,l[_++]=c>>8&255,l[_++]=c&255),l}function i(h){return V[h>>18&63]+V[h>>12&63]+V[h>>6&63]+V[h&63]}function n(h,c,m){for(var p,T=[],l=c;lw?w:_+l));return p===1?(c=h[m-1],T.push(V[c>>2]+V[c<<4&63]+"==")):p===2&&(c=(h[m-2]<<8)+h[m-1],T.push(V[c>>10]+V[c>>4&63]+V[c<<2&63]+"=")),T.join("")}}}),e6=We({"node_modules/ieee754/index.js"(Z){Z.read=function(V,d,x,A,E){var e,t,r=E*8-A-1,o=(1<>1,i=-7,n=x?E-1:0,s=x?-1:1,h=V[d+n];for(n+=s,e=h&(1<<-i)-1,h>>=-i,i+=r;i>0;e=e*256+V[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=A;i>0;t=t*256+V[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(h?-1:1)*(1/0);t=t+Math.pow(2,A),e=e-a}return(h?-1:1)*t*Math.pow(2,e-A)},Z.write=function(V,d,x,A,E,e){var t,r,o,a=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=A?0:e-1,c=A?1:-1,m=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,E),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,E),t=0));E>=8;V[x+h]=r&255,h+=c,r/=256,E-=8);for(t=t<0;V[x+h]=t&255,h+=c,t/=256,a-=8);V[x+h-c]|=m*128}}}),Ep=We({"node_modules/buffer/index.js"(Z){"use strict";var V=QE(),d=e6(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Z.Buffer=t,Z.SlowBuffer=T,Z.INSPECT_MAX_BYTES=50;var A=2147483647;Z.kMaxLength=A,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{let Ae=new Uint8Array(1),ge={foo:function(){return 42}};return Object.setPrototypeOf(ge,Uint8Array.prototype),Object.setPrototypeOf(Ae,ge),Ae.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Ae){if(Ae>A)throw new RangeError('The value "'+Ae+'" is invalid for option "size"');let ge=new Uint8Array(Ae);return Object.setPrototypeOf(ge,t.prototype),ge}function t(Ae,ge,ce){if(typeof Ae=="number"){if(typeof ge=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Ae)}return r(Ae,ge,ce)}t.poolSize=8192;function r(Ae,ge,ce){if(typeof Ae=="string")return n(Ae,ge);if(ArrayBuffer.isView(Ae))return h(Ae);if(Ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae);if(He(Ae,ArrayBuffer)||Ae&&He(Ae.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(He(Ae,SharedArrayBuffer)||Ae&&He(Ae.buffer,SharedArrayBuffer)))return c(Ae,ge,ce);if(typeof Ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ze=Ae.valueOf&&Ae.valueOf();if(ze!=null&&ze!==Ae)return t.from(ze,ge,ce);let Qe=m(Ae);if(Qe)return Qe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ae[Symbol.toPrimitive]=="function")return t.from(Ae[Symbol.toPrimitive]("string"),ge,ce);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}t.from=function(Ae,ge,ce){return r(Ae,ge,ce)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Ae){if(typeof Ae!="number")throw new TypeError('"size" argument must be of type number');if(Ae<0)throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}function a(Ae,ge,ce){return o(Ae),Ae<=0?e(Ae):ge!==void 0?typeof ce=="string"?e(Ae).fill(ge,ce):e(Ae).fill(ge):e(Ae)}t.alloc=function(Ae,ge,ce){return a(Ae,ge,ce)};function i(Ae){return o(Ae),e(Ae<0?0:p(Ae)|0)}t.allocUnsafe=function(Ae){return i(Ae)},t.allocUnsafeSlow=function(Ae){return i(Ae)};function n(Ae,ge){if((typeof ge!="string"||ge==="")&&(ge="utf8"),!t.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);let ce=l(Ae,ge)|0,ze=e(ce),Qe=ze.write(Ae,ge);return Qe!==ce&&(ze=ze.slice(0,Qe)),ze}function s(Ae){let ge=Ae.length<0?0:p(Ae.length)|0,ce=e(ge);for(let ze=0;ze=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Ae|0}function T(Ae){return+Ae!=Ae&&(Ae=0),t.alloc(+Ae)}t.isBuffer=function(ge){return ge!=null&&ge._isBuffer===!0&&ge!==t.prototype},t.compare=function(ge,ce){if(He(ge,Uint8Array)&&(ge=t.from(ge,ge.offset,ge.byteLength)),He(ce,Uint8Array)&&(ce=t.from(ce,ce.offset,ce.byteLength)),!t.isBuffer(ge)||!t.isBuffer(ce))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ge===ce)return 0;let ze=ge.length,Qe=ce.length;for(let nt=0,Ke=Math.min(ze,Qe);ntQe.length?(t.isBuffer(Ke)||(Ke=t.from(Ke)),Ke.copy(Qe,nt)):Uint8Array.prototype.set.call(Qe,Ke,nt);else if(t.isBuffer(Ke))Ke.copy(Qe,nt);else throw new TypeError('"list" argument must be an Array of Buffers');nt+=Ke.length}return Qe};function l(Ae,ge){if(t.isBuffer(Ae))return Ae.length;if(ArrayBuffer.isView(Ae)||He(Ae,ArrayBuffer))return Ae.byteLength;if(typeof Ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ae);let ce=Ae.length,ze=arguments.length>2&&arguments[2]===!0;if(!ze&&ce===0)return 0;let Qe=!1;for(;;)switch(ge){case"ascii":case"latin1":case"binary":return ce;case"utf8":case"utf-8":return ue(Ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce*2;case"hex":return ce>>>1;case"base64":return Ie(Ae).length;default:if(Qe)return ze?-1:ue(Ae).length;ge=(""+ge).toLowerCase(),Qe=!0}}t.byteLength=l;function _(Ae,ge,ce){let ze=!1;if((ge===void 0||ge<0)&&(ge=0),ge>this.length||((ce===void 0||ce>this.length)&&(ce=this.length),ce<=0)||(ce>>>=0,ge>>>=0,ce<=ge))return"";for(Ae||(Ae="utf8");;)switch(Ae){case"hex":return O(this,ge,ce);case"utf8":case"utf-8":return P(this,ge,ce);case"ascii":return F(this,ge,ce);case"latin1":case"binary":return B(this,ge,ce);case"base64":return f(this,ge,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,ge,ce);default:if(ze)throw new TypeError("Unknown encoding: "+Ae);Ae=(Ae+"").toLowerCase(),ze=!0}}t.prototype._isBuffer=!0;function w(Ae,ge,ce){let ze=Ae[ge];Ae[ge]=Ae[ce],Ae[ce]=ze}t.prototype.swap16=function(){let ge=this.length;if(ge%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ce=0;cece&&(ge+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(ge,ce,ze,Qe,nt){if(He(ge,Uint8Array)&&(ge=t.from(ge,ge.offset,ge.byteLength)),!t.isBuffer(ge))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ge);if(ce===void 0&&(ce=0),ze===void 0&&(ze=ge?ge.length:0),Qe===void 0&&(Qe=0),nt===void 0&&(nt=this.length),ce<0||ze>ge.length||Qe<0||nt>this.length)throw new RangeError("out of range index");if(Qe>=nt&&ce>=ze)return 0;if(Qe>=nt)return-1;if(ce>=ze)return 1;if(ce>>>=0,ze>>>=0,Qe>>>=0,nt>>>=0,this===ge)return 0;let Ke=nt-Qe,kt=ze-ce,Et=Math.min(Ke,kt),Bt=this.slice(Qe,nt),jt=ge.slice(ce,ze);for(let _r=0;_r2147483647?ce=2147483647:ce<-2147483648&&(ce=-2147483648),ce=+ce,et(ce)&&(ce=Qe?0:Ae.length-1),ce<0&&(ce=Ae.length+ce),ce>=Ae.length){if(Qe)return-1;ce=Ae.length-1}else if(ce<0)if(Qe)ce=0;else return-1;if(typeof ge=="string"&&(ge=t.from(ge,ze)),t.isBuffer(ge))return ge.length===0?-1:M(Ae,ge,ce,ze,Qe);if(typeof ge=="number")return ge=ge&255,typeof Uint8Array.prototype.indexOf=="function"?Qe?Uint8Array.prototype.indexOf.call(Ae,ge,ce):Uint8Array.prototype.lastIndexOf.call(Ae,ge,ce):M(Ae,[ge],ce,ze,Qe);throw new TypeError("val must be string, number or Buffer")}function M(Ae,ge,ce,ze,Qe){let nt=1,Ke=Ae.length,kt=ge.length;if(ze!==void 0&&(ze=String(ze).toLowerCase(),ze==="ucs2"||ze==="ucs-2"||ze==="utf16le"||ze==="utf-16le")){if(Ae.length<2||ge.length<2)return-1;nt=2,Ke/=2,kt/=2,ce/=2}function Et(jt,_r){return nt===1?jt[_r]:jt.readUInt16BE(_r*nt)}let Bt;if(Qe){let jt=-1;for(Bt=ce;BtKe&&(ce=Ke-kt),Bt=ce;Bt>=0;Bt--){let jt=!0;for(let _r=0;_rQe&&(ze=Qe)):ze=Qe;let nt=ge.length;ze>nt/2&&(ze=nt/2);let Ke;for(Ke=0;Ke>>0,isFinite(ze)?(ze=ze>>>0,Qe===void 0&&(Qe="utf8")):(Qe=ze,ze=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let nt=this.length-ce;if((ze===void 0||ze>nt)&&(ze=nt),ge.length>0&&(ze<0||ce<0)||ce>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");let Ke=!1;for(;;)switch(Qe){case"hex":return y(this,ge,ce,ze);case"utf8":case"utf-8":return b(this,ge,ce,ze);case"ascii":case"latin1":case"binary":return v(this,ge,ce,ze);case"base64":return u(this,ge,ce,ze);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,ge,ce,ze);default:if(Ke)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Ke=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(Ae,ge,ce){return ge===0&&ce===Ae.length?V.fromByteArray(Ae):V.fromByteArray(Ae.slice(ge,ce))}function P(Ae,ge,ce){ce=Math.min(Ae.length,ce);let ze=[],Qe=ge;for(;Qe239?4:nt>223?3:nt>191?2:1;if(Qe+kt<=ce){let Et,Bt,jt,_r;switch(kt){case 1:nt<128&&(Ke=nt);break;case 2:Et=Ae[Qe+1],(Et&192)===128&&(_r=(nt&31)<<6|Et&63,_r>127&&(Ke=_r));break;case 3:Et=Ae[Qe+1],Bt=Ae[Qe+2],(Et&192)===128&&(Bt&192)===128&&(_r=(nt&15)<<12|(Et&63)<<6|Bt&63,_r>2047&&(_r<55296||_r>57343)&&(Ke=_r));break;case 4:Et=Ae[Qe+1],Bt=Ae[Qe+2],jt=Ae[Qe+3],(Et&192)===128&&(Bt&192)===128&&(jt&192)===128&&(_r=(nt&15)<<18|(Et&63)<<12|(Bt&63)<<6|jt&63,_r>65535&&_r<1114112&&(Ke=_r))}}Ke===null?(Ke=65533,kt=1):Ke>65535&&(Ke-=65536,ze.push(Ke>>>10&1023|55296),Ke=56320|Ke&1023),ze.push(Ke),Qe+=kt}return z(ze)}var L=4096;function z(Ae){let ge=Ae.length;if(ge<=L)return String.fromCharCode.apply(String,Ae);let ce="",ze=0;for(;zeze)&&(ce=ze);let Qe="";for(let nt=ge;ntze&&(ge=ze),ce<0?(ce+=ze,ce<0&&(ce=0)):ce>ze&&(ce=ze),cece)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(ge,ce,ze){ge=ge>>>0,ce=ce>>>0,ze||N(ge,ce,this.length);let Qe=this[ge],nt=1,Ke=0;for(;++Ke>>0,ce=ce>>>0,ze||N(ge,ce,this.length);let Qe=this[ge+--ce],nt=1;for(;ce>0&&(nt*=256);)Qe+=this[ge+--ce]*nt;return Qe},t.prototype.readUint8=t.prototype.readUInt8=function(ge,ce){return ge=ge>>>0,ce||N(ge,1,this.length),this[ge]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(ge,ce){return ge=ge>>>0,ce||N(ge,2,this.length),this[ge]|this[ge+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(ge,ce){return ge=ge>>>0,ce||N(ge,2,this.length),this[ge]<<8|this[ge+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(ge,ce){return ge=ge>>>0,ce||N(ge,4,this.length),(this[ge]|this[ge+1]<<8|this[ge+2]<<16)+this[ge+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(ge,ce){return ge=ge>>>0,ce||N(ge,4,this.length),this[ge]*16777216+(this[ge+1]<<16|this[ge+2]<<8|this[ge+3])},t.prototype.readBigUInt64LE=$e(function(ge){ge=ge>>>0,ne(ge,"offset");let ce=this[ge],ze=this[ge+7];(ce===void 0||ze===void 0)&&j(ge,this.length-8);let Qe=ce+this[++ge]*2**8+this[++ge]*2**16+this[++ge]*2**24,nt=this[++ge]+this[++ge]*2**8+this[++ge]*2**16+ze*2**24;return BigInt(Qe)+(BigInt(nt)<>>0,ne(ge,"offset");let ce=this[ge],ze=this[ge+7];(ce===void 0||ze===void 0)&&j(ge,this.length-8);let Qe=ce*2**24+this[++ge]*2**16+this[++ge]*2**8+this[++ge],nt=this[++ge]*2**24+this[++ge]*2**16+this[++ge]*2**8+ze;return(BigInt(Qe)<>>0,ce=ce>>>0,ze||N(ge,ce,this.length);let Qe=this[ge],nt=1,Ke=0;for(;++Ke=nt&&(Qe-=Math.pow(2,8*ce)),Qe},t.prototype.readIntBE=function(ge,ce,ze){ge=ge>>>0,ce=ce>>>0,ze||N(ge,ce,this.length);let Qe=ce,nt=1,Ke=this[ge+--Qe];for(;Qe>0&&(nt*=256);)Ke+=this[ge+--Qe]*nt;return nt*=128,Ke>=nt&&(Ke-=Math.pow(2,8*ce)),Ke},t.prototype.readInt8=function(ge,ce){return ge=ge>>>0,ce||N(ge,1,this.length),this[ge]&128?(255-this[ge]+1)*-1:this[ge]},t.prototype.readInt16LE=function(ge,ce){ge=ge>>>0,ce||N(ge,2,this.length);let ze=this[ge]|this[ge+1]<<8;return ze&32768?ze|4294901760:ze},t.prototype.readInt16BE=function(ge,ce){ge=ge>>>0,ce||N(ge,2,this.length);let ze=this[ge+1]|this[ge]<<8;return ze&32768?ze|4294901760:ze},t.prototype.readInt32LE=function(ge,ce){return ge=ge>>>0,ce||N(ge,4,this.length),this[ge]|this[ge+1]<<8|this[ge+2]<<16|this[ge+3]<<24},t.prototype.readInt32BE=function(ge,ce){return ge=ge>>>0,ce||N(ge,4,this.length),this[ge]<<24|this[ge+1]<<16|this[ge+2]<<8|this[ge+3]},t.prototype.readBigInt64LE=$e(function(ge){ge=ge>>>0,ne(ge,"offset");let ce=this[ge],ze=this[ge+7];(ce===void 0||ze===void 0)&&j(ge,this.length-8);let Qe=this[ge+4]+this[ge+5]*2**8+this[ge+6]*2**16+(ze<<24);return(BigInt(Qe)<>>0,ne(ge,"offset");let ce=this[ge],ze=this[ge+7];(ce===void 0||ze===void 0)&&j(ge,this.length-8);let Qe=(ce<<24)+this[++ge]*2**16+this[++ge]*2**8+this[++ge];return(BigInt(Qe)<>>0,ce||N(ge,4,this.length),d.read(this,ge,!0,23,4)},t.prototype.readFloatBE=function(ge,ce){return ge=ge>>>0,ce||N(ge,4,this.length),d.read(this,ge,!1,23,4)},t.prototype.readDoubleLE=function(ge,ce){return ge=ge>>>0,ce||N(ge,8,this.length),d.read(this,ge,!0,52,8)},t.prototype.readDoubleBE=function(ge,ce){return ge=ge>>>0,ce||N(ge,8,this.length),d.read(this,ge,!1,52,8)};function U(Ae,ge,ce,ze,Qe,nt){if(!t.isBuffer(Ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(ge>Qe||geAe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(ge,ce,ze,Qe){if(ge=+ge,ce=ce>>>0,ze=ze>>>0,!Qe){let kt=Math.pow(2,8*ze)-1;U(this,ge,ce,ze,kt,0)}let nt=1,Ke=0;for(this[ce]=ge&255;++Ke>>0,ze=ze>>>0,!Qe){let kt=Math.pow(2,8*ze)-1;U(this,ge,ce,ze,kt,0)}let nt=ze-1,Ke=1;for(this[ce+nt]=ge&255;--nt>=0&&(Ke*=256);)this[ce+nt]=ge/Ke&255;return ce+ze},t.prototype.writeUint8=t.prototype.writeUInt8=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,1,255,0),this[ce]=ge&255,ce+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,2,65535,0),this[ce]=ge&255,this[ce+1]=ge>>>8,ce+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,2,65535,0),this[ce]=ge>>>8,this[ce+1]=ge&255,ce+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,4,4294967295,0),this[ce+3]=ge>>>24,this[ce+2]=ge>>>16,this[ce+1]=ge>>>8,this[ce]=ge&255,ce+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,4,4294967295,0),this[ce]=ge>>>24,this[ce+1]=ge>>>16,this[ce+2]=ge>>>8,this[ce+3]=ge&255,ce+4};function W(Ae,ge,ce,ze,Qe){oe(ge,ze,Qe,Ae,ce,7);let nt=Number(ge&BigInt(4294967295));Ae[ce++]=nt,nt=nt>>8,Ae[ce++]=nt,nt=nt>>8,Ae[ce++]=nt,nt=nt>>8,Ae[ce++]=nt;let Ke=Number(ge>>BigInt(32)&BigInt(4294967295));return Ae[ce++]=Ke,Ke=Ke>>8,Ae[ce++]=Ke,Ke=Ke>>8,Ae[ce++]=Ke,Ke=Ke>>8,Ae[ce++]=Ke,ce}function Q(Ae,ge,ce,ze,Qe){oe(ge,ze,Qe,Ae,ce,7);let nt=Number(ge&BigInt(4294967295));Ae[ce+7]=nt,nt=nt>>8,Ae[ce+6]=nt,nt=nt>>8,Ae[ce+5]=nt,nt=nt>>8,Ae[ce+4]=nt;let Ke=Number(ge>>BigInt(32)&BigInt(4294967295));return Ae[ce+3]=Ke,Ke=Ke>>8,Ae[ce+2]=Ke,Ke=Ke>>8,Ae[ce+1]=Ke,Ke=Ke>>8,Ae[ce]=Ke,ce+8}t.prototype.writeBigUInt64LE=$e(function(ge,ce=0){return W(this,ge,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=$e(function(ge,ce=0){return Q(this,ge,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(ge,ce,ze,Qe){if(ge=+ge,ce=ce>>>0,!Qe){let Et=Math.pow(2,8*ze-1);U(this,ge,ce,ze,Et-1,-Et)}let nt=0,Ke=1,kt=0;for(this[ce]=ge&255;++nt>0)-kt&255;return ce+ze},t.prototype.writeIntBE=function(ge,ce,ze,Qe){if(ge=+ge,ce=ce>>>0,!Qe){let Et=Math.pow(2,8*ze-1);U(this,ge,ce,ze,Et-1,-Et)}let nt=ze-1,Ke=1,kt=0;for(this[ce+nt]=ge&255;--nt>=0&&(Ke*=256);)ge<0&&kt===0&&this[ce+nt+1]!==0&&(kt=1),this[ce+nt]=(ge/Ke>>0)-kt&255;return ce+ze},t.prototype.writeInt8=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,1,127,-128),ge<0&&(ge=255+ge+1),this[ce]=ge&255,ce+1},t.prototype.writeInt16LE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,2,32767,-32768),this[ce]=ge&255,this[ce+1]=ge>>>8,ce+2},t.prototype.writeInt16BE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,2,32767,-32768),this[ce]=ge>>>8,this[ce+1]=ge&255,ce+2},t.prototype.writeInt32LE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,4,2147483647,-2147483648),this[ce]=ge&255,this[ce+1]=ge>>>8,this[ce+2]=ge>>>16,this[ce+3]=ge>>>24,ce+4},t.prototype.writeInt32BE=function(ge,ce,ze){return ge=+ge,ce=ce>>>0,ze||U(this,ge,ce,4,2147483647,-2147483648),ge<0&&(ge=4294967295+ge+1),this[ce]=ge>>>24,this[ce+1]=ge>>>16,this[ce+2]=ge>>>8,this[ce+3]=ge&255,ce+4},t.prototype.writeBigInt64LE=$e(function(ge,ce=0){return W(this,ge,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=$e(function(ge,ce=0){return Q(this,ge,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function le(Ae,ge,ce,ze,Qe,nt){if(ce+ze>Ae.length)throw new RangeError("Index out of range");if(ce<0)throw new RangeError("Index out of range")}function se(Ae,ge,ce,ze,Qe){return ge=+ge,ce=ce>>>0,Qe||le(Ae,ge,ce,4,34028234663852886e22,-34028234663852886e22),d.write(Ae,ge,ce,ze,23,4),ce+4}t.prototype.writeFloatLE=function(ge,ce,ze){return se(this,ge,ce,!0,ze)},t.prototype.writeFloatBE=function(ge,ce,ze){return se(this,ge,ce,!1,ze)};function he(Ae,ge,ce,ze,Qe){return ge=+ge,ce=ce>>>0,Qe||le(Ae,ge,ce,8,17976931348623157e292,-17976931348623157e292),d.write(Ae,ge,ce,ze,52,8),ce+8}t.prototype.writeDoubleLE=function(ge,ce,ze){return he(this,ge,ce,!0,ze)},t.prototype.writeDoubleBE=function(ge,ce,ze){return he(this,ge,ce,!1,ze)},t.prototype.copy=function(ge,ce,ze,Qe){if(!t.isBuffer(ge))throw new TypeError("argument should be a Buffer");if(ze||(ze=0),!Qe&&Qe!==0&&(Qe=this.length),ce>=ge.length&&(ce=ge.length),ce||(ce=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),ge.length-ce>>0,ze=ze===void 0?this.length:ze>>>0,ge||(ge=0);let nt;if(typeof ge=="number")for(nt=ce;nt2**32?Qe=J(String(ce)):typeof ce=="bigint"&&(Qe=String(ce),(ce>BigInt(2)**BigInt(32)||ce<-(BigInt(2)**BigInt(32)))&&(Qe=J(Qe)),Qe+="n"),ze+=` It must be ${ge}. Received ${Qe}`,ze},RangeError);function J(Ae){let ge="",ce=Ae.length,ze=Ae[0]==="-"?1:0;for(;ce>=ze+4;ce-=3)ge=`_${Ae.slice(ce-3,ce)}${ge}`;return`${Ae.slice(0,ce)}${ge}`}function X(Ae,ge,ce){ne(ge,"offset"),(Ae[ge]===void 0||Ae[ge+ce]===void 0)&&j(ge,Ae.length-(ce+1))}function oe(Ae,ge,ce,ze,Qe,nt){if(Ae>ce||Ae3?ge===0||ge===BigInt(0)?kt=`>= 0${Ke} and < 2${Ke} ** ${(nt+1)*8}${Ke}`:kt=`>= -(2${Ke} ** ${(nt+1)*8-1}${Ke}) and < 2 ** ${(nt+1)*8-1}${Ke}`:kt=`>= ${ge}${Ke} and <= ${ce}${Ke}`,new q.ERR_OUT_OF_RANGE("value",kt,Ae)}X(ze,Qe,nt)}function ne(Ae,ge){if(typeof Ae!="number")throw new q.ERR_INVALID_ARG_TYPE(ge,"number",Ae)}function j(Ae,ge,ce){throw Math.floor(Ae)!==Ae?(ne(Ae,ce),new q.ERR_OUT_OF_RANGE(ce||"offset","an integer",Ae)):ge<0?new q.ERR_BUFFER_OUT_OF_BOUNDS:new q.ERR_OUT_OF_RANGE(ce||"offset",`>= ${ce?1:0} and <= ${ge}`,Ae)}var ee=/[^+/0-9A-Za-z-_]/g;function re(Ae){if(Ae=Ae.split("=")[0],Ae=Ae.trim().replace(ee,""),Ae.length<2)return"";for(;Ae.length%4!==0;)Ae=Ae+"=";return Ae}function ue(Ae,ge){ge=ge||1/0;let ce,ze=Ae.length,Qe=null,nt=[];for(let Ke=0;Ke55295&&ce<57344){if(!Qe){if(ce>56319){(ge-=3)>-1&&nt.push(239,191,189);continue}else if(Ke+1===ze){(ge-=3)>-1&&nt.push(239,191,189);continue}Qe=ce;continue}if(ce<56320){(ge-=3)>-1&&nt.push(239,191,189),Qe=ce;continue}ce=(Qe-55296<<10|ce-56320)+65536}else Qe&&(ge-=3)>-1&&nt.push(239,191,189);if(Qe=null,ce<128){if((ge-=1)<0)break;nt.push(ce)}else if(ce<2048){if((ge-=2)<0)break;nt.push(ce>>6|192,ce&63|128)}else if(ce<65536){if((ge-=3)<0)break;nt.push(ce>>12|224,ce>>6&63|128,ce&63|128)}else if(ce<1114112){if((ge-=4)<0)break;nt.push(ce>>18|240,ce>>12&63|128,ce>>6&63|128,ce&63|128)}else throw new Error("Invalid code point")}return nt}function _e(Ae){let ge=[];for(let ce=0;ce>8,Qe=ce%256,nt.push(Qe),nt.push(ze);return nt}function Ie(Ae){return V.toByteArray(re(Ae))}function De(Ae,ge,ce,ze){let Qe;for(Qe=0;Qe=ge.length||Qe>=Ae.length);++Qe)ge[Qe+ce]=Ae[Qe];return Qe}function He(Ae,ge){return Ae instanceof ge||Ae!=null&&Ae.constructor!=null&&Ae.constructor.name!=null&&Ae.constructor.name===ge.name}function et(Ae){return Ae!==Ae}var rt=(function(){let Ae="0123456789abcdef",ge=new Array(256);for(let ce=0;ce<16;++ce){let ze=ce*16;for(let Qe=0;Qe<16;++Qe)ge[ze+Qe]=Ae[ce]+Ae[Qe]}return ge})();function $e(Ae){return typeof BigInt>"u"?ot:Ae}function ot(){throw new Error("BigInt not supported")}}}),D1=We({"node_modules/has-symbols/shams.js"(Z,V){"use strict";V.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},A=Symbol("test"),E=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;x[A]=e;for(var t in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var r=Object.getOwnPropertySymbols(x);if(r.length!==1||r[0]!==A||!Object.prototype.propertyIsEnumerable.call(x,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(x,A);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),eg=We({"node_modules/has-tostringtag/shams.js"(Z,V){"use strict";var d=D1();V.exports=function(){return d()&&!!Symbol.toStringTag}}}),Dw=We({"node_modules/es-object-atoms/index.js"(Z,V){"use strict";V.exports=Object}}),t6=We({"node_modules/es-errors/index.js"(Z,V){"use strict";V.exports=Error}}),r6=We({"node_modules/es-errors/eval.js"(Z,V){"use strict";V.exports=EvalError}}),a6=We({"node_modules/es-errors/range.js"(Z,V){"use strict";V.exports=RangeError}}),n6=We({"node_modules/es-errors/ref.js"(Z,V){"use strict";V.exports=ReferenceError}}),zw=We({"node_modules/es-errors/syntax.js"(Z,V){"use strict";V.exports=SyntaxError}}),q0=We({"node_modules/es-errors/type.js"(Z,V){"use strict";V.exports=TypeError}}),i6=We({"node_modules/es-errors/uri.js"(Z,V){"use strict";V.exports=URIError}}),o6=We({"node_modules/math-intrinsics/abs.js"(Z,V){"use strict";V.exports=Math.abs}}),s6=We({"node_modules/math-intrinsics/floor.js"(Z,V){"use strict";V.exports=Math.floor}}),l6=We({"node_modules/math-intrinsics/max.js"(Z,V){"use strict";V.exports=Math.max}}),u6=We({"node_modules/math-intrinsics/min.js"(Z,V){"use strict";V.exports=Math.min}}),c6=We({"node_modules/math-intrinsics/pow.js"(Z,V){"use strict";V.exports=Math.pow}}),f6=We({"node_modules/math-intrinsics/round.js"(Z,V){"use strict";V.exports=Math.round}}),h6=We({"node_modules/math-intrinsics/isNaN.js"(Z,V){"use strict";V.exports=Number.isNaN||function(x){return x!==x}}}),v6=We({"node_modules/math-intrinsics/sign.js"(Z,V){"use strict";var d=h6();V.exports=function(A){return d(A)||A===0?A:A<0?-1:1}}}),d6=We({"node_modules/gopd/gOPD.js"(Z,V){"use strict";V.exports=Object.getOwnPropertyDescriptor}}),kp=We({"node_modules/gopd/index.js"(Z,V){"use strict";var d=d6();if(d)try{d([],"length")}catch{d=null}V.exports=d}}),tg=We({"node_modules/es-define-property/index.js"(Z,V){"use strict";var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}V.exports=d}}),p6=We({"node_modules/has-symbols/index.js"(Z,V){"use strict";var d=typeof Symbol<"u"&&Symbol,x=D1();V.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),Fw=We({"node_modules/get-proto/Reflect.getPrototypeOf.js"(Z,V){"use strict";V.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),Ow=We({"node_modules/get-proto/Object.getPrototypeOf.js"(Z,V){"use strict";var d=Dw();V.exports=d.getPrototypeOf||null}}),m6=We({"node_modules/function-bind/implementation.js"(Z,V){"use strict";var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,E="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!b?d:b(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":y&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":A,"%eval%":eval,"%EvalError%":E,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&b?b(""[Symbol.iterator]()):d,"%Symbol%":y?Symbol:d,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":f,"%Function.prototype.apply%":g,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":v,"%Math.abs%":i,"%Math.floor%":n,"%Math.max%":s,"%Math.min%":h,"%Math.pow%":c,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":u};if(b)try{null.error}catch(X){F=b(b(X)),z["%Error.prototype%"]=F}var F,B=function X(oe){var ne;if(oe==="%AsyncFunction%")ne=l("async function () {}");else if(oe==="%GeneratorFunction%")ne=l("function* () {}");else if(oe==="%AsyncGeneratorFunction%")ne=l("async function* () {}");else if(oe==="%AsyncGenerator%"){var j=X("%AsyncGeneratorFunction%");j&&(ne=j.prototype)}else if(oe==="%AsyncIteratorPrototype%"){var ee=X("%AsyncGenerator%");ee&&b&&(ne=b(ee.prototype))}return z[oe]=ne,ne},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},I=G0(),N=w6(),U=I.call(f,Array.prototype.concat),W=I.call(g,Array.prototype.splice),Q=I.call(f,String.prototype.replace),le=I.call(f,String.prototype.slice),se=I.call(f,RegExp.prototype.exec),he=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,$=function(oe){var ne=le(oe,0,1),j=le(oe,-1);if(ne==="%"&&j!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&ne!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var ee=[];return Q(oe,he,function(re,ue,_e,Te){ee[ee.length]=_e?Q(Te,q,"$1"):ue||re}),ee},J=function(oe,ne){var j=oe,ee;if(N(O,j)&&(ee=O[j],j="%"+ee[0]+"%"),N(z,j)){var re=z[j];if(re===P&&(re=B(j)),typeof re>"u"&&!ne)throw new o("intrinsic "+oe+" exists, but is not available. Please file an issue!");return{alias:ee,name:j,value:re}}throw new r("intrinsic "+oe+" does not exist!")};V.exports=function(oe,ne){if(typeof oe!="string"||oe.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ne!="boolean")throw new o('"allowMissing" argument must be a boolean');if(se(/^%?[^%]*%?$/,oe)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=$(oe),ee=j.length>0?j[0]:"",re=J("%"+ee+"%",ne),ue=re.name,_e=re.value,Te=!1,Ie=re.alias;Ie&&(ee=Ie[0],W(j,U([0,1],Ie)));for(var De=1,He=!0;De=j.length){var ot=_(_e,et);He=!!ot,He&&"get"in ot&&!("originalValue"in ot.get)?_e=ot.get:_e=_e[et]}else He=N(_e,et),_e=_e[et];He&&!Te&&(z[ue]=_e)}}return _e}}}),T6=We({"node_modules/define-data-property/index.js"(Z,V){"use strict";var d=tg(),x=zw(),A=q0(),E=kp();V.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new A("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new A("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new A("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new A("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new A("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new A("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!E&&E(t,r);if(d)d(t,r,{configurable:n===null&&h?h.configurable:!n,enumerable:a===null&&h?h.enumerable:!a,value:o,writable:i===null&&h?h.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),Nw=We({"node_modules/has-property-descriptors/index.js"(Z,V){"use strict";var d=tg(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},V.exports=x}}),A6=We({"node_modules/set-function-length/index.js"(Z,V){"use strict";var d=F1(),x=T6(),A=Nw()(),E=kp(),e=q0(),t=d("%Math.floor%");V.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&E){var h=E(o,"length");h&&!h.configurable&&(n=!1),h&&!h.writable&&(s=!1)}return(n||s||!i)&&(A?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),rg=We({"node_modules/call-bind/index.js"(Z,V){"use strict";var d=G0(),x=F1(),A=A6(),E=q0(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=tg(),a=x("%Math.max%");V.exports=function(s){if(typeof s!="function")throw new E("a function is required");var h=r(d,t,arguments);return A(h,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(V.exports,"apply",{value:i}):V.exports.apply=i}}),H0=We({"node_modules/call-bind/callBound.js"(Z,V){"use strict";var d=F1(),x=rg(),A=x(d("String.prototype.indexOf"));V.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),S6=We({"node_modules/is-arguments/index.js"(Z,V){"use strict";var d=eg()(),x=H0(),A=x("Object.prototype.toString"),E=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:A(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&A(o)!=="[object Array]"&&A(o.callee)==="[object Function]"},t=(function(){return E(arguments)})();E.isLegacyArguments=e,V.exports=t?E:e}}),M6=We({"node_modules/is-generator-function/index.js"(Z,V){"use strict";var d=Object.prototype.toString,x=Function.prototype.toString,A=/^\s*(?:function)?\*/,E=eg()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;V.exports=function(a){if(typeof a!="function")return!1;if(A.test(x.call(a)))return!0;if(!E){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),E6=We({"node_modules/is-callable/index.js"(Z,V){"use strict";var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,A,E;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{A=Object.defineProperty({},"length",{get:function(){throw E}}),E={},x(function(){throw 42},null,A)}catch(_){_!==E&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(w){try{var S=d.call(w);return e.test(S)}catch{return!1}},r=function(w){try{return t(w)?!1:(d.call(w),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",h="[object HTML document.all class]",c="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,p=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(w){if((p||!w)&&(typeof w>"u"||typeof w=="object"))try{var S=o.call(w);return(S===s||S===h||S===c||S===a)&&w("")==null}catch{}return!1}));var l;V.exports=x?function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{x(w,null,A)}catch(S){if(S!==E)return!1}return!t(w)&&r(w)}:function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(m)return r(w);if(t(w))return!1;var S=o.call(w);return S!==i&&S!==n&&!/^\[object HTML/.test(S)?!1:r(w)}}}),Uw=We({"node_modules/for-each/index.js"(Z,V){"use strict";var d=E6(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,E=function(a,i,n){for(var s=0,h=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?E(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};V.exports=r}}),jw=We({"node_modules/available-typed-arrays/index.js"(Z,V){"use strict";var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;V.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,a=x(),i=E("String.prototype.slice"),n=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var _=0;_-1?l:l!=="Object"?!1:m(T)}return e?c(T):null}}}),C6=We({"node_modules/is-typed-array/index.js"(Z,V){"use strict";var d=Uw(),x=jw(),A=H0(),E=A("Object.prototype.toString"),e=eg()(),t=kp(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=A("Array.prototype.indexOf",!0)||function(m,p){for(var T=0;T-1}return t?h(m):!1}}}),Vw=We({"node_modules/util/support/types.js"(Z){"use strict";var V=S6(),d=M6(),x=k6(),A=C6();function E(Te){return Te.call.bind(Te)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),a=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(n=E(BigInt.prototype.valueOf));var n;t&&(s=E(Symbol.prototype.valueOf));var s;function h(Te,Ie){if(typeof Te!="object")return!1;try{return Ie(Te),!0}catch{return!1}}Z.isArgumentsObject=V,Z.isGeneratorFunction=d,Z.isTypedArray=A;function c(Te){return typeof Promise<"u"&&Te instanceof Promise||Te!==null&&typeof Te=="object"&&typeof Te.then=="function"&&typeof Te.catch=="function"}Z.isPromise=c;function m(Te){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Te):A(Te)||W(Te)}Z.isArrayBufferView=m;function p(Te){return x(Te)==="Uint8Array"}Z.isUint8Array=p;function T(Te){return x(Te)==="Uint8ClampedArray"}Z.isUint8ClampedArray=T;function l(Te){return x(Te)==="Uint16Array"}Z.isUint16Array=l;function _(Te){return x(Te)==="Uint32Array"}Z.isUint32Array=_;function w(Te){return x(Te)==="Int8Array"}Z.isInt8Array=w;function S(Te){return x(Te)==="Int16Array"}Z.isInt16Array=S;function M(Te){return x(Te)==="Int32Array"}Z.isInt32Array=M;function y(Te){return x(Te)==="Float32Array"}Z.isFloat32Array=y;function b(Te){return x(Te)==="Float64Array"}Z.isFloat64Array=b;function v(Te){return x(Te)==="BigInt64Array"}Z.isBigInt64Array=v;function u(Te){return x(Te)==="BigUint64Array"}Z.isBigUint64Array=u;function g(Te){return r(Te)==="[object Map]"}g.working=typeof Map<"u"&&g(new Map);function f(Te){return typeof Map>"u"?!1:g.working?g(Te):Te instanceof Map}Z.isMap=f;function P(Te){return r(Te)==="[object Set]"}P.working=typeof Set<"u"&&P(new Set);function L(Te){return typeof Set>"u"?!1:P.working?P(Te):Te instanceof Set}Z.isSet=L;function z(Te){return r(Te)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Te){return typeof WeakMap>"u"?!1:z.working?z(Te):Te instanceof WeakMap}Z.isWeakMap=F;function B(Te){return r(Te)==="[object WeakSet]"}B.working=typeof WeakSet<"u"&&B(new WeakSet);function O(Te){return B(Te)}Z.isWeakSet=O;function I(Te){return r(Te)==="[object ArrayBuffer]"}I.working=typeof ArrayBuffer<"u"&&I(new ArrayBuffer);function N(Te){return typeof ArrayBuffer>"u"?!1:I.working?I(Te):Te instanceof ArrayBuffer}Z.isArrayBuffer=N;function U(Te){return r(Te)==="[object DataView]"}U.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&U(new DataView(new ArrayBuffer(1),0,1));function W(Te){return typeof DataView>"u"?!1:U.working?U(Te):Te instanceof DataView}Z.isDataView=W;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function le(Te){return r(Te)==="[object SharedArrayBuffer]"}function se(Te){return typeof Q>"u"?!1:(typeof le.working>"u"&&(le.working=le(new Q)),le.working?le(Te):Te instanceof Q)}Z.isSharedArrayBuffer=se;function he(Te){return r(Te)==="[object AsyncFunction]"}Z.isAsyncFunction=he;function q(Te){return r(Te)==="[object Map Iterator]"}Z.isMapIterator=q;function $(Te){return r(Te)==="[object Set Iterator]"}Z.isSetIterator=$;function J(Te){return r(Te)==="[object Generator]"}Z.isGeneratorObject=J;function X(Te){return r(Te)==="[object WebAssembly.Module]"}Z.isWebAssemblyCompiledModule=X;function oe(Te){return h(Te,o)}Z.isNumberObject=oe;function ne(Te){return h(Te,a)}Z.isStringObject=ne;function j(Te){return h(Te,i)}Z.isBooleanObject=j;function ee(Te){return e&&h(Te,n)}Z.isBigIntObject=ee;function re(Te){return t&&h(Te,s)}Z.isSymbolObject=re;function ue(Te){return oe(Te)||ne(Te)||j(Te)||ee(Te)||re(Te)}Z.isBoxedPrimitive=ue;function _e(Te){return typeof Uint8Array<"u"&&(N(Te)||se(Te))}Z.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Te){Object.defineProperty(Z,Te,{enumerable:!1,value:function(){throw new Error(Te+" is not supported in userland")}})})}}),qw=We({"node_modules/util/support/isBufferBrowser.js"(Z,V){V.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),Gw=We({"(disabled):node_modules/util/util.js"(Z){var V=Object.getOwnPropertyDescriptors||function(W){for(var Q=Object.keys(W),le={},se=0;se=se)return $;switch($){case"%s":return String(le[Q++]);case"%d":return Number(le[Q++]);case"%j":try{return JSON.stringify(le[Q++])}catch{return"[Circular]"}default:return $}}),q=le[Q];Q"u")return function(){return Z.deprecate(U,W).apply(this,arguments)};var Q=!1;function le(){if(!Q){if(process.throwDeprecation)throw new Error(W);process.traceDeprecation?console.trace(W):console.error(W),Q=!0}return U.apply(this,arguments)}return le};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Z.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var W=process.pid;x[U]=function(){var Q=Z.format.apply(Z,arguments);console.error("%s %d: %s",U,W,Q)}}else x[U]=function(){};return x[U]};function e(U,W){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),p(W)?Q.showHidden=W:W&&Z._extend(Q,W),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,W){var Q=e.styles[W];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,W){return U}function o(U){var W={};return U.forEach(function(Q,le){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&g(W.inspect)&&W.inspect!==Z.inspect&&!(W.constructor&&W.constructor.prototype===W)){var le=W.inspect(Q,U);return w(le)||(le=a(U,le,Q)),le}var se=i(U,W);if(se)return se;var he=Object.keys(W),q=o(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return n(W);if(he.length===0){if(g(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(y(W))return U.stylize(RegExp.prototype.toString.call(W),"regexp");if(v(W))return U.stylize(Date.prototype.toString.call(W),"date");if(u(W))return n(W)}var J="",X=!1,oe=["{","}"];if(m(W)&&(X=!0,oe=["[","]"]),g(W)){var ne=W.name?": "+W.name:"";J=" [Function"+ne+"]"}if(y(W)&&(J=" "+RegExp.prototype.toString.call(W)),v(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+n(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return y(W)?U.stylize(RegExp.prototype.toString.call(W),"regexp"):U.stylize("[Object]","special");U.seen.push(W);var j;return X?j=s(U,W,Q,q,he):j=he.map(function(ee){return h(U,W,Q,q,ee,X)}),U.seen.pop(),c(j,J,oe)}function i(U,W){if(M(W))return U.stylize("undefined","undefined");if(w(W)){var Q="'"+JSON.stringify(W).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(_(W))return U.stylize(""+W,"number");if(p(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,le,se){for(var he=[],q=0,$=W.length;q<$;++q)B(W,String(q))?he.push(h(U,W,Q,le,String(q),!0)):he.push("");return se.forEach(function(J){J.match(/^\d+$/)||he.push(h(U,W,Q,le,J,!0))}),he}function h(U,W,Q,le,se,he){var q,$,J;if(J=Object.getOwnPropertyDescriptor(W,se)||{value:W[se]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(le,se)||(q="["+se+"]"),$||(U.seen.indexOf(J.value)<0?(T(Q)?$=a(U,J.value,null):$=a(U,J.value,Q-1),$.indexOf(` -`)>-1&&(he?$=$.split(` -`).map(function(X){return" "+X}).join(` -`).slice(2):$=` -`+$.split(` -`).map(function(X){return" "+X}).join(` -`))):$=U.stylize("[Circular]","special")),M(q)){if(he&&se.match(/^\d+$/))return $;q=JSON.stringify(""+se),q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(q=q.slice(1,-1),q=U.stylize(q,"name")):(q=q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),q=U.stylize(q,"string"))}return q+": "+$}function c(U,W,Q){var le=0,se=U.reduce(function(he,q){return le++,q.indexOf(` -`)>=0&&le++,he+q.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+` - `)+" "+U.join(`, - `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=Vw();function m(U){return Array.isArray(U)}Z.isArray=m;function p(U){return typeof U=="boolean"}Z.isBoolean=p;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function M(U){return U===void 0}Z.isUndefined=M;function y(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=y,Z.types.isRegExp=y;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function v(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=v,Z.types.isDate=v;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function g(U){return typeof U=="function"}Z.isFunction=g;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=qw();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Xv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),le=Q.length;le--;)U[Q[le]]=W[Q[le]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var le,se,he=new Promise(function(J,X){le=J,se=X}),q=[],$=0;$0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(m){var p={data:m,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var p=this.head,T=""+p.data;p=p.next;)T+=m+p.data;return T}},{key:"concat",value:function(m){if(this.length===0)return o.alloc(0);for(var p=o.allocUnsafe(m>>>0),T=this.head,l=0;T;)s(T.data,p,l),l+=T.data.length,T=T.next;return p}},{key:"consume",value:function(m,p){var T;return m_.length?_.length:m;if(w===_.length?l+=_:l+=_.slice(0,m),m-=w,m===0){w===_.length?(++T,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=_.slice(w));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(m){var p=o.allocUnsafe(m),T=this.head,l=1;for(T.data.copy(p),m-=T.data.length;T=T.next;){var _=T.data,w=m>_.length?_.length:m;if(_.copy(p,p.length-m,0,w),m-=w,m===0){w===_.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=_.slice(w));break}++l}return this.length-=l,p}},{key:n,value:function(m,p){return i(this,x({},p,{depth:0,customInspect:!1}))}}]),h})()}}),Hw=We({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Z,V){"use strict";function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(A,a),o(s)):process.nextTick(A,a)}),this)}function x(r,o){e(r,o),A(r)}function A(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}V.exports={destroy:d,undestroy:E,errorOrDestroy:t}}}),Cp=We({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Z,V){"use strict";function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function A(o,a,i){i||(i=Error);function n(h,c,m){return typeof a=="string"?a:a(h,c,m)}var s=(function(h){d(c,h);function c(m,p,T){return h.call(this,n(m,p,T))||this}return c})(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function E(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(!i||i<0?0:+i,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}A("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(E(a,"type"));else{var h=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(h," ").concat(n," ").concat(E(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),A("ERR_STREAM_WRITE_AFTER_END","write after end"),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),V.exports.codes=x}}),Ww=We({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Z,V){"use strict";var d=Cp().codes.ERR_INVALID_OPT_VALUE;function x(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function A(E,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return E.objectMode?16:16*1024}V.exports={getHighWaterMark:A}}}),P6=We({"node_modules/util-deprecate/browser.js"(Z,V){V.exports=d;function d(A,E){if(x("noDeprecation"))return A;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(E);x("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return A.apply(this,arguments)}return t}function x(A){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[A];return E==null?!1:String(E).toLowerCase()==="true"}}}),Xw=We({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Z,V){"use strict";V.exports=v;function d(q){var $=this;this.next=null,this.entry=null,this.finish=function(){he($,q)}}var x;v.WritableState=y;var A={deprecate:P6()},E=Rw(),e=Ep().Buffer,t=window.Uint8Array||function(){};function r(q){return e.from(q)}function o(q){return e.isBuffer(q)||q instanceof t}var a=Hw(),i=Ww(),n=i.getHighWaterMark,s=Cp().codes,h=s.ERR_INVALID_ARG_TYPE,c=s.ERR_METHOD_NOT_IMPLEMENTED,m=s.ERR_MULTIPLE_CALLBACK,p=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,_=s.ERR_STREAM_WRITE_AFTER_END,w=s.ERR_UNKNOWN_ENCODING,S=a.errorOrDestroy;Xv()(v,E);function M(){}function y(q,$,J){x=x||Lp(),q=q||{},typeof J!="boolean"&&(J=$ instanceof x),this.objectMode=!!q.objectMode,J&&(this.objectMode=this.objectMode||!!q.writableObjectMode),this.highWaterMark=n(this,q,"writableHighWaterMark",J),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=q.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){B($,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=q.emitClose!==!1,this.autoDestroy=!!q.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}y.prototype.getBuffer=function(){for(var $=this.bufferedRequest,J=[];$;)J.push($),$=$.next;return J},(function(){try{Object.defineProperty(y.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var b;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function($){return b.call(this,$)?!0:this!==v?!1:$&&$._writableState instanceof y}})):b=function($){return $ instanceof this};function v(q){x=x||Lp();var $=this instanceof x;if(!$&&!b.call(v,this))return new v(q);this._writableState=new y(q,this,$),this.writable=!0,q&&(typeof q.write=="function"&&(this._write=q.write),typeof q.writev=="function"&&(this._writev=q.writev),typeof q.destroy=="function"&&(this._destroy=q.destroy),typeof q.final=="function"&&(this._final=q.final)),E.call(this)}v.prototype.pipe=function(){S(this,new p)};function u(q,$){var J=new _;S(q,J),process.nextTick($,J)}function g(q,$,J,X){var oe;return J===null?oe=new l:typeof J!="string"&&!$.objectMode&&(oe=new h("chunk",["string","Buffer"],J)),oe?(S(q,oe),process.nextTick(X,oe),!1):!0}v.prototype.write=function(q,$,J){var X=this._writableState,oe=!1,ne=!X.objectMode&&o(q);return ne&&!e.isBuffer(q)&&(q=r(q)),typeof $=="function"&&(J=$,$=null),ne?$="buffer":$||($=X.defaultEncoding),typeof J!="function"&&(J=M),X.ending?u(this,J):(ne||g(this,X,q,J))&&(X.pendingcb++,oe=P(this,X,ne,q,$,J)),oe},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var q=this._writableState;q.corked&&(q.corked--,!q.writing&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&N(this,q))},v.prototype.setDefaultEncoding=function($){if(typeof $=="string"&&($=$.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new w($);return this._writableState.defaultEncoding=$,this},Object.defineProperty(v.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function f(q,$,J){return!q.objectMode&&q.decodeStrings!==!1&&typeof $=="string"&&($=e.from($,J)),$}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function P(q,$,J,X,oe,ne){if(!J){var j=f($,X,oe);X!==j&&(J=!0,oe="buffer",X=j)}var ee=$.objectMode?1:X.length;$.length+=ee;var re=$.length<$.highWaterMark;if(re||($.needDrain=!0),$.writing||$.corked){var ue=$.lastBufferedRequest;$.lastBufferedRequest={chunk:X,encoding:oe,isBuf:J,callback:ne,next:null},ue?ue.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else L(q,$,!1,ee,X,oe,ne);return re}function L(q,$,J,X,oe,ne,j){$.writelen=X,$.writecb=j,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new T("write")):J?q._writev(oe,$.onwrite):q._write(oe,ne,$.onwrite),$.sync=!1}function z(q,$,J,X,oe){--$.pendingcb,J?(process.nextTick(oe,X),process.nextTick(le,q,$),q._writableState.errorEmitted=!0,S(q,X)):(oe(X),q._writableState.errorEmitted=!0,S(q,X),le(q,$))}function F(q){q.writing=!1,q.writecb=null,q.length-=q.writelen,q.writelen=0}function B(q,$){var J=q._writableState,X=J.sync,oe=J.writecb;if(typeof oe!="function")throw new m;if(F(J),$)z(q,J,X,$,oe);else{var ne=U(J)||q.destroyed;!ne&&!J.corked&&!J.bufferProcessing&&J.bufferedRequest&&N(q,J),X?process.nextTick(O,q,J,ne,oe):O(q,J,ne,oe)}}function O(q,$,J,X){J||I(q,$),$.pendingcb--,X(),le(q,$)}function I(q,$){$.length===0&&$.needDrain&&($.needDrain=!1,q.emit("drain"))}function N(q,$){$.bufferProcessing=!0;var J=$.bufferedRequest;if(q._writev&&J&&J.next){var X=$.bufferedRequestCount,oe=new Array(X),ne=$.corkedRequestsFree;ne.entry=J;for(var j=0,ee=!0;J;)oe[j]=J,J.isBuf||(ee=!1),J=J.next,j+=1;oe.allBuffers=ee,L(q,$,!0,$.length,oe,"",ne.finish),$.pendingcb++,$.lastBufferedRequest=null,ne.next?($.corkedRequestsFree=ne.next,ne.next=null):$.corkedRequestsFree=new d($),$.bufferedRequestCount=0}else{for(;J;){var re=J.chunk,ue=J.encoding,_e=J.callback,Te=$.objectMode?1:re.length;if(L(q,$,!1,Te,re,ue,_e),J=J.next,$.bufferedRequestCount--,$.writing)break}J===null&&($.lastBufferedRequest=null)}$.bufferedRequest=J,$.bufferProcessing=!1}v.prototype._write=function(q,$,J){J(new c("_write()"))},v.prototype._writev=null,v.prototype.end=function(q,$,J){var X=this._writableState;return typeof q=="function"?(J=q,q=null,$=null):typeof $=="function"&&(J=$,$=null),q!=null&&this.write(q,$),X.corked&&(X.corked=1,this.uncork()),X.ending||se(this,X,J),this},Object.defineProperty(v.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U(q){return q.ending&&q.length===0&&q.bufferedRequest===null&&!q.finished&&!q.writing}function W(q,$){q._final(function(J){$.pendingcb--,J&&S(q,J),$.prefinished=!0,q.emit("prefinish"),le(q,$)})}function Q(q,$){!$.prefinished&&!$.finalCalled&&(typeof q._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,process.nextTick(W,q,$)):($.prefinished=!0,q.emit("prefinish")))}function le(q,$){var J=U($);if(J&&(Q(q,$),$.pendingcb===0&&($.finished=!0,q.emit("finish"),$.autoDestroy))){var X=q._readableState;(!X||X.autoDestroy&&X.endEmitted)&&q.destroy()}return J}function se(q,$,J){$.ending=!0,le(q,$),J&&($.finished?process.nextTick(J):q.once("finish",J)),$.ended=!0,q.writable=!1}function he(q,$,J){var X=q.entry;for(q.entry=null;X;){var oe=X.callback;$.pendingcb--,oe(J),X=X.next}$.corkedRequestsFree.next=q}Object.defineProperty(v.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function($){this._writableState&&(this._writableState.destroyed=$)}}),v.prototype.destroy=a.destroy,v.prototype._undestroy=a.undestroy,v.prototype._destroy=function(q,$){$(q)}}}),Lp=We({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(Z,V){"use strict";var d=Object.keys||function(i){var n=[];for(var s in i)n.push(s);return n};V.exports=r;var x=Yw(),A=Xw();for(Xv()(r,x),E=d(A.prototype),t=0;t>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,_){var w=l.length-1;if(w<_)return 0;var S=e(l[w]);return S>=0?(S>0&&(T.lastNeed=S-1),S):--w<_||S===-2?0:(S=e(l[w]),S>=0?(S>0&&(T.lastNeed=S-2),S):--w<_||S===-2?0:(S=e(l[w]),S>=0?(S>0&&(S===2?S=0:T.lastNeed=S-3),S):0))}function r(T,l,_){if((l[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function o(T){var l=this.lastTotal-this.lastNeed,_=r(this,T,l);if(_!==void 0)return _;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var _=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=_;var w=T.length-(_-this.lastNeed);return T.copy(this.lastChar,0,w),T.toString("utf8",l,w)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"\uFFFD":l}function n(T,l){if((T.length-l)%2===0){var _=T.toString("utf16le",l);if(_){var w=_.charCodeAt(_.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,_)}return l}function h(T,l){var _=(T.length-l)%3;return _===0?T.toString("base64",l):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-_))}function c(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function m(T){return T.toString(this.encoding)}function p(T){return T&&T.length?this.write(T):""}}}),O1=We({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Z,V){"use strict";var d=Cp().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof ee!="string"&&!Te.objectMode&&Object.getPrototypeOf(ee)!==e.prototype&&(ee=r(ee)),ue)Te.endEmitted?y(j,new _):P(j,Te,ee,!0);else if(Te.ended)y(j,new T);else{if(Te.destroyed)return!1;Te.reading=!1,Te.decoder&&!re?(ee=Te.decoder.write(ee),Te.objectMode||ee.length!==0?P(j,Te,ee,!1):U(j,Te)):P(j,Te,ee,!1)}else ue||(Te.reading=!1,U(j,Te))}return!Te.ended&&(Te.length=z?j=z:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function B(j,ee){return j<=0||ee.length===0&&ee.ended?0:ee.objectMode?1:j!==j?ee.flowing&&ee.length?ee.buffer.head.data.length:ee.length:(j>ee.highWaterMark&&(ee.highWaterMark=F(j)),j<=ee.length?j:ee.ended?ee.length:(ee.needReadable=!0,0))}g.prototype.read=function(j){i("read",j),j=parseInt(j,10);var ee=this._readableState,re=j;if(j!==0&&(ee.emittedReadable=!1),j===0&&ee.needReadable&&((ee.highWaterMark!==0?ee.length>=ee.highWaterMark:ee.length>0)||ee.ended))return i("read: emitReadable",ee.length,ee.ended),ee.length===0&&ee.ended?X(this):I(this),null;if(j=B(j,ee),j===0&&ee.ended)return ee.length===0&&X(this),null;var ue=ee.needReadable;i("need readable",ue),(ee.length===0||ee.length-j0?_e=J(j,ee):_e=null,_e===null?(ee.needReadable=ee.length<=ee.highWaterMark,j=0):(ee.length-=j,ee.awaitDrain=0),ee.length===0&&(ee.ended||(ee.needReadable=!0),re!==j&&ee.ended&&X(this)),_e!==null&&this.emit("data",_e),_e};function O(j,ee){if(i("onEofChunk"),!ee.ended){if(ee.decoder){var re=ee.decoder.end();re&&re.length&&(ee.buffer.push(re),ee.length+=ee.objectMode?1:re.length)}ee.ended=!0,ee.sync?I(j):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,N(j)))}}function I(j){var ee=j._readableState;i("emitReadable",ee.needReadable,ee.emittedReadable),ee.needReadable=!1,ee.emittedReadable||(i("emitReadable",ee.flowing),ee.emittedReadable=!0,process.nextTick(N,j))}function N(j){var ee=j._readableState;i("emitReadable_",ee.destroyed,ee.length,ee.ended),!ee.destroyed&&(ee.length||ee.ended)&&(j.emit("readable"),ee.emittedReadable=!1),ee.needReadable=!ee.flowing&&!ee.ended&&ee.length<=ee.highWaterMark,$(j)}function U(j,ee){ee.readingMore||(ee.readingMore=!0,process.nextTick(W,j,ee))}function W(j,ee){for(;!ee.reading&&!ee.ended&&(ee.length1&&ne(ue.pipes,j)!==-1)&&!et&&(i("false write response, pause",ue.awaitDrain),ue.awaitDrain++),re.pause())}function ot(ze){i("onerror",ze),ce(),j.removeListener("error",ot),A(j,"error")===0&&y(j,ze)}v(j,"error",ot);function Ae(){j.removeListener("finish",ge),ce()}j.once("close",Ae);function ge(){i("onfinish"),j.removeListener("close",Ae),ce()}j.once("finish",ge);function ce(){i("unpipe"),re.unpipe(j)}return j.emit("pipe",re),ue.flowing||(i("pipe resume"),re.resume()),j};function Q(j){return function(){var re=j._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,re.awaitDrain===0&&A(j,"data")&&(re.flowing=!0,$(j))}}g.prototype.unpipe=function(j){var ee=this._readableState,re={hasUnpiped:!1};if(ee.pipesCount===0)return this;if(ee.pipesCount===1)return j&&j!==ee.pipes?this:(j||(j=ee.pipes),ee.pipes=null,ee.pipesCount=0,ee.flowing=!1,j&&j.emit("unpipe",this,re),this);if(!j){var ue=ee.pipes,_e=ee.pipesCount;ee.pipes=null,ee.pipesCount=0,ee.flowing=!1;for(var Te=0;Te<_e;Te++)ue[Te].emit("unpipe",this,{hasUnpiped:!1});return this}var Ie=ne(ee.pipes,j);return Ie===-1?this:(ee.pipes.splice(Ie,1),ee.pipesCount-=1,ee.pipesCount===1&&(ee.pipes=ee.pipes[0]),j.emit("unpipe",this,re),this)},g.prototype.on=function(j,ee){var re=E.prototype.on.call(this,j,ee),ue=this._readableState;return j==="data"?(ue.readableListening=this.listenerCount("readable")>0,ue.flowing!==!1&&this.resume()):j==="readable"&&!ue.endEmitted&&!ue.readableListening&&(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,i("on readable",ue.length,ue.reading),ue.length?I(this):ue.reading||process.nextTick(se,this)),re},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(j,ee){var re=E.prototype.removeListener.call(this,j,ee);return j==="readable"&&process.nextTick(le,this),re},g.prototype.removeAllListeners=function(j){var ee=E.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&process.nextTick(le,this),ee};function le(j){var ee=j._readableState;ee.readableListening=j.listenerCount("readable")>0,ee.resumeScheduled&&!ee.paused?ee.flowing=!0:j.listenerCount("data")>0&&j.resume()}function se(j){i("readable nexttick read 0"),j.read(0)}g.prototype.resume=function(){var j=this._readableState;return j.flowing||(i("resume"),j.flowing=!j.readableListening,he(this,j)),j.paused=!1,this};function he(j,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,process.nextTick(q,j,ee))}function q(j,ee){i("resume",ee.reading),ee.reading||j.read(0),ee.resumeScheduled=!1,j.emit("resume"),$(j),ee.flowing&&!ee.reading&&j.read(0)}g.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function $(j){var ee=j._readableState;for(i("flow",ee.flowing);ee.flowing&&j.read()!==null;);}g.prototype.wrap=function(j){var ee=this,re=this._readableState,ue=!1;j.on("end",function(){if(i("wrapped end"),re.decoder&&!re.ended){var Ie=re.decoder.end();Ie&&Ie.length&&ee.push(Ie)}ee.push(null)}),j.on("data",function(Ie){if(i("wrapped data"),re.decoder&&(Ie=re.decoder.write(Ie)),!(re.objectMode&&Ie==null)&&!(!re.objectMode&&(!Ie||!Ie.length))){var De=ee.push(Ie);De||(ue=!0,j.pause())}});for(var _e in j)this[_e]===void 0&&typeof j[_e]=="function"&&(this[_e]=(function(De){return function(){return j[De].apply(j,arguments)}})(_e));for(var Te=0;Te=ee.length?(ee.decoder?re=ee.buffer.join(""):ee.buffer.length===1?re=ee.buffer.first():re=ee.buffer.concat(ee.length),ee.buffer.clear()):re=ee.buffer.consume(j,ee.decoder),re}function X(j){var ee=j._readableState;i("endReadable",ee.endEmitted),ee.endEmitted||(ee.ended=!0,process.nextTick(oe,ee,j))}function oe(j,ee){if(i("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,ee.readable=!1,ee.emit("end"),j.autoDestroy)){var re=ee._writableState;(!re||re.autoDestroy&&re.finished)&&ee.destroy()}}typeof Symbol=="function"&&(g.from=function(j,ee){return M===void 0&&(M=D6()),M(g,j,ee)});function ne(j,ee){for(var re=0,ue=j.length;re0;return o(_,S,M,function(y){T||(T=y),y&&l.forEach(a),!S&&(l.forEach(a),p(T))})});return c.reduce(i)}V.exports=s}}),O6=We({"node_modules/stream-browserify/index.js"(Z,V){V.exports=A;var d=yp().EventEmitter,x=Xv();x(A,d),A.Readable=Yw(),A.Writable=Xw(),A.Duplex=Lp(),A.Transform=Kw(),A.PassThrough=z6(),A.finished=O1(),A.pipeline=F6(),A.Stream=A;function A(){d.call(this)}A.prototype.pipe=function(E,e){var t=this;function r(c){E.writable&&E.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,E.end())}function n(){a||(a=!0,typeof E.destroy=="function"&&E.destroy())}function s(c){if(h(),d.listenerCount(this,"error")===0)throw c}t.on("error",s),E.on("error",s);function h(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",h),t.removeListener("close",h),E.removeListener("close",h)}return t.on("end",h),t.on("close",h),E.on("close",h),E.emit("pipe",t),E}}}),W0=We({"node_modules/util/util.js"(Z){var V=Object.getOwnPropertyDescriptors||function(W){for(var Q=Object.keys(W),le={},se=0;se=se)return $;switch($){case"%s":return String(le[Q++]);case"%d":return Number(le[Q++]);case"%j":try{return JSON.stringify(le[Q++])}catch{return"[Circular]"}default:return $}}),q=le[Q];Q"u")return function(){return Z.deprecate(U,W).apply(this,arguments)};var Q=!1;function le(){if(!Q){if(process.throwDeprecation)throw new Error(W);process.traceDeprecation?console.trace(W):console.error(W),Q=!0}return U.apply(this,arguments)}return le};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Z.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var W=process.pid;x[U]=function(){var Q=Z.format.apply(Z,arguments);console.error("%s %d: %s",U,W,Q)}}else x[U]=function(){};return x[U]};function e(U,W){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),p(W)?Q.showHidden=W:W&&Z._extend(Q,W),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,W){var Q=e.styles[W];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,W){return U}function o(U){var W={};return U.forEach(function(Q,le){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&g(W.inspect)&&W.inspect!==Z.inspect&&!(W.constructor&&W.constructor.prototype===W)){var le=W.inspect(Q,U);return w(le)||(le=a(U,le,Q)),le}var se=i(U,W);if(se)return se;var he=Object.keys(W),q=o(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return n(W);if(he.length===0){if(g(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(y(W))return U.stylize(RegExp.prototype.toString.call(W),"regexp");if(v(W))return U.stylize(Date.prototype.toString.call(W),"date");if(u(W))return n(W)}var J="",X=!1,oe=["{","}"];if(m(W)&&(X=!0,oe=["[","]"]),g(W)){var ne=W.name?": "+W.name:"";J=" [Function"+ne+"]"}if(y(W)&&(J=" "+RegExp.prototype.toString.call(W)),v(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+n(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return y(W)?U.stylize(RegExp.prototype.toString.call(W),"regexp"):U.stylize("[Object]","special");U.seen.push(W);var j;return X?j=s(U,W,Q,q,he):j=he.map(function(ee){return h(U,W,Q,q,ee,X)}),U.seen.pop(),c(j,J,oe)}function i(U,W){if(M(W))return U.stylize("undefined","undefined");if(w(W)){var Q="'"+JSON.stringify(W).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(_(W))return U.stylize(""+W,"number");if(p(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,le,se){for(var he=[],q=0,$=W.length;q<$;++q)B(W,String(q))?he.push(h(U,W,Q,le,String(q),!0)):he.push("");return se.forEach(function(J){J.match(/^\d+$/)||he.push(h(U,W,Q,le,J,!0))}),he}function h(U,W,Q,le,se,he){var q,$,J;if(J=Object.getOwnPropertyDescriptor(W,se)||{value:W[se]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(le,se)||(q="["+se+"]"),$||(U.seen.indexOf(J.value)<0?(T(Q)?$=a(U,J.value,null):$=a(U,J.value,Q-1),$.indexOf(` -`)>-1&&(he?$=$.split(` -`).map(function(X){return" "+X}).join(` -`).slice(2):$=` -`+$.split(` -`).map(function(X){return" "+X}).join(` -`))):$=U.stylize("[Circular]","special")),M(q)){if(he&&se.match(/^\d+$/))return $;q=JSON.stringify(""+se),q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(q=q.slice(1,-1),q=U.stylize(q,"name")):(q=q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),q=U.stylize(q,"string"))}return q+": "+$}function c(U,W,Q){var le=0,se=U.reduce(function(he,q){return le++,q.indexOf(` -`)>=0&&le++,he+q.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+` - `)+" "+U.join(`, - `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=Vw();function m(U){return Array.isArray(U)}Z.isArray=m;function p(U){return typeof U=="boolean"}Z.isBoolean=p;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function M(U){return U===void 0}Z.isUndefined=M;function y(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=y,Z.types.isRegExp=y;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function v(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=v,Z.types.isDate=v;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function g(U){return typeof U=="function"}Z.isFunction=g;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=qw();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Xv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),le=Q.length;le--;)U[Q[le]]=W[Q[le]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var le,se,he=new Promise(function(J,X){le=J,se=X}),q=[],$=0;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(M){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},h(M)}var c={},m,p;function T(M,y,b){b||(b=Error);function v(g,f,P){return typeof y=="string"?y:y(g,f,P)}var u=(function(g){r(P,g);var f=a(P);function P(L,z,F){var B;return t(this,P),B=f.call(this,v(L,z,F)),B.code=M,B}return A(P)})(b);c[M]=u}function l(M,y){if(Array.isArray(M)){var b=M.length;return M=M.map(function(v){return String(v)}),b>2?"one of ".concat(y," ").concat(M.slice(0,b-1).join(", "),", or ")+M[b-1]:b===2?"one of ".concat(y," ").concat(M[0]," or ").concat(M[1]):"of ".concat(y," ").concat(M[0])}else return"of ".concat(y," ").concat(String(M))}function _(M,y,b){return M.substr(!b||b<0?0:+b,y.length)===y}function w(M,y,b){return(b===void 0||b>M.length)&&(b=M.length),M.substring(b-y.length,b)===y}function S(M,y,b){return typeof b!="number"&&(b=0),b+y.length>M.length?!1:M.indexOf(y,b)!==-1}T("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),T("ERR_INVALID_ARG_TYPE",function(M,y,b){m===void 0&&(m=ng()),m(typeof M=="string","'name' must be a string");var v;typeof y=="string"&&_(y,"not ")?(v="must not be",y=y.replace(/^not /,"")):v="must be";var u;if(w(M," argument"))u="The ".concat(M," ").concat(v," ").concat(l(y,"type"));else{var g=S(M,".")?"property":"argument";u='The "'.concat(M,'" ').concat(g," ").concat(v," ").concat(l(y,"type"))}return u+=". Received type ".concat(d(b)),u},TypeError),T("ERR_INVALID_ARG_VALUE",function(M,y){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=W0());var v=p.inspect(y);return v.length>128&&(v="".concat(v.slice(0,128),"...")),"The argument '".concat(M,"' ").concat(b,". Received ").concat(v)},TypeError,RangeError),T("ERR_INVALID_RETURN_VALUE",function(M,y,b){var v;return b&&b.constructor&&b.constructor.name?v="instance of ".concat(b.constructor.name):v="type ".concat(d(b)),"Expected ".concat(M,' to be returned from the "').concat(y,'"')+" function but got ".concat(v,".")},TypeError),T("ERR_MISSING_ARGS",function(){for(var M=arguments.length,y=new Array(M),b=0;b0,"At least one arg needs to be specified");var v="The ",u=y.length;switch(y=y.map(function(g){return'"'.concat(g,'"')}),u){case 1:v+="".concat(y[0]," argument");break;case 2:v+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:v+=y.slice(0,u-1).join(", "),v+=", and ".concat(y[u-1]," arguments");break}return"".concat(v," must be specified")},TypeError),V.exports.codes=c}}),B6=We({"node_modules/assert/build/internal/assert/assertion_error.js"(Z,V){"use strict";function d(N,U){var W=Object.keys(N);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(N);U&&(Q=Q.filter(function(le){return Object.getOwnPropertyDescriptor(N,le).enumerable})),W.push.apply(W,Q)}return W}function x(N){for(var U=1;U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function T(N,U){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,le){return Q.__proto__=le,Q},T(N,U)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(W){return W.__proto__||Object.getPrototypeOf(W)},l(N)}function _(N){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},_(N)}var w=W0(),S=w.inspect,M=Jw(),y=M.codes.ERR_INVALID_ARG_TYPE;function b(N,U,W){return(W===void 0||W>N.length)&&(W=N.length),N.substring(W-U.length,W)===U}function v(N,U){if(U=Math.floor(U),N.length==0||U==0)return"";var W=N.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)N+=N,U--;return N+=N.substring(0,W-N.length),N}var u="",g="",f="",P="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(N){var U=Object.keys(N),W=Object.create(Object.getPrototypeOf(N));return U.forEach(function(Q){W[Q]=N[Q]}),Object.defineProperty(W,"message",{value:N.message}),W}function B(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(N,U,W){var Q="",le="",se=0,he="",q=!1,$=B(N),J=$.split(` -`),X=B(U).split(` -`),oe=0,ne="";if(W==="strictEqual"&&_(N)==="object"&&_(U)==="object"&&N!==null&&U!==null&&(W="strictEqualObject"),J.length===1&&X.length===1&&J[0]!==X[0]){var j=J[0].length+X[0].length;if(j<=z){if((_(N)!=="object"||N===null)&&(_(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(L[W],` - -`)+"".concat(J[0]," !== ").concat(X[0],` -`)}else if(W!=="strictEqualObject"){var ee=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(j2&&(ne=` - `.concat(v(" ",oe),"^"),oe=0)}}}for(var re=J[J.length-1],ue=X[X.length-1];re===ue&&(oe++<2?he=` - `.concat(re).concat(he):Q=re,J.pop(),X.pop(),!(J.length===0||X.length===0));)re=J[J.length-1],ue=X[X.length-1];var _e=Math.max(J.length,X.length);if(_e===0){var Te=$.split(` -`);if(Te.length>30)for(Te[26]="".concat(u,"...").concat(P);Te.length>27;)Te.pop();return"".concat(L.notIdentical,` +var XD=Object.create;var Z5=Object.defineProperty;var ZD=Object.getOwnPropertyDescriptor;var YD=Object.getOwnPropertyNames;var KD=Object.getPrototypeOf,JD=Object.prototype.hasOwnProperty;var $D=(_f,xf)=>()=>(xf||_f((xf={exports:{}}).exports,xf),xf.exports);var QD=(_f,xf,Rh,xp)=>{if(xf&&typeof xf=="object"||typeof xf=="function")for(let Cv of YD(xf))!JD.call(_f,Cv)&&Cv!==Rh&&Z5(_f,Cv,{get:()=>xf[Cv],enumerable:!(xp=ZD(xf,Cv))||xp.enumerable});return _f};var e7=(_f,xf,Rh)=>(Rh=_f!=null?XD(KD(_f)):{},QD(xf||!_f||!_f.__esModule?Z5(Rh,"default",{value:_f,enumerable:!0}):Rh,_f));var J5=$D((K5,Oy)=>{(function(_f,xf){typeof Oy=="object"&&Oy.exports?Oy.exports=xf():_f.moduleName=xf()})(typeof self<"u"?self:K5,()=>{"use strict";var _f=(()=>{var xf=Object.create,Rh=Object.defineProperty,xp=Object.defineProperties,Cv=Object.getOwnPropertyDescriptor,By=Object.getOwnPropertyDescriptors,S0=Object.getOwnPropertyNames,bp=Object.getOwnPropertySymbols,Ny=Object.getPrototypeOf,M0=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Om=(Z,q,d)=>q in Z?Rh(Z,q,{enumerable:!0,configurable:!0,writable:!0,value:d}):Z[q]=d,Vs=(Z,q)=>{for(var d in q||(q={}))M0.call(q,d)&&Om(Z,d,q[d]);if(bp)for(var d of bp(q))Fm.call(q,d)&&Om(Z,d,q[d]);return Z},kl=(Z,q)=>xp(Z,By(q)),ic=(Z,q)=>{var d={};for(var x in Z)M0.call(Z,x)&&q.indexOf(x)<0&&(d[x]=Z[x]);if(Z!=null&&bp)for(var x of bp(Z))q.indexOf(x)<0&&Fm.call(Z,x)&&(d[x]=Z[x]);return d},hs=(Z,q)=>function(){return Z&&(q=(0,Z[S0(Z)[0]])(Z=0)),q},Ge=(Z,q)=>function(){return q||(0,Z[S0(Z)[0]])((q={exports:{}}).exports,q),q.exports},Jv=(Z,q)=>{for(var d in q)Rh(Z,d,{get:q[d],enumerable:!0})},Lv=(Z,q,d,x)=>{if(q&&typeof q=="object"||typeof q=="function")for(let S of S0(q))!M0.call(Z,S)&&S!==d&&Rh(Z,S,{get:()=>q[S],enumerable:!(x=Cv(q,S))||x.enumerable});return Z},Oh=(Z,q,d)=>(d=Z!=null?xf(Ny(Z)):{},Lv(q||!Z||!Z.__esModule?Rh(d,"default",{value:Z,enumerable:!0}):d,Z)),Pv=Z=>Lv(Rh({},"__esModule",{value:!0}),Z),Wh=Ge({"src/version.js"(Z){"use strict";Z.version="3.5.0"}}),Uy=Ge({"node_modules/native-promise-only/lib/npo.src.js"(Z,q){(function(x,S,E){S[x]=S[x]||E(),typeof q<"u"&&q.exports&&(q.exports=S[x])})("Promise",typeof window<"u"?window:Z,function(){"use strict";var x,S,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(_){return setImmediate(_)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(_,w,A,M){return Object.defineProperty(_,w,{value:A,writable:!0,configurable:M!==!1})}}catch{x=function(w,A,M){return w[A]=M,w}}E=(function(){var _,w,A;function M(g,b){this.fn=g,this.self=b,this.next=void 0}return{add:function(b,v){A=new M(b,v),w?w.next=A:_=A,w=A,A=void 0},drain:function(){var b=_;for(_=w=S=void 0;b;)b.fn.call(b.self),b=b.next}}})();function r(l,_){E.add(l,_),S||(S=t(E.drain))}function o(l){var _,w=typeof l;return l!=null&&(w=="object"||w=="function")&&(_=l.then),typeof _=="function"?_:!1}function a(){for(var l=0;l0&&r(a,w))}catch(A){s.call(new f(w),A)}}}function s(l){var _=this;_.triggered||(_.triggered=!0,_.def&&(_=_.def),_.msg=l,_.state=2,_.chain.length>0&&r(a,_))}function h(l,_,w,A){for(var M=0;M<_.length;M++)(function(b){l.resolve(_[b]).then(function(u){w(b,u)},A)})(M)}function f(l){this.def=l,this.triggered=!1}function p(l){this.promise=l,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function c(l){if(typeof l!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new p(this);this.then=function(A,M){var g={success:typeof A=="function"?A:!0,failure:typeof M=="function"?M:!1};return g.promise=new this.constructor(function(v,u){if(typeof v!="function"||typeof u!="function")throw TypeError("Not a function");g.resolve=v,g.reject=u}),_.chain.push(g),_.state!==0&&r(a,_),g.promise},this.catch=function(A){return this.then(void 0,A)};try{l.call(void 0,function(A){n.call(_,A)},function(A){s.call(_,A)})}catch(w){s.call(_,w)}}var T=x({},"constructor",c,!1);return c.prototype=T,x(T,"__NPO__",0,!1),x(c,"resolve",function(_){var w=this;return _&&typeof _=="object"&&_.__NPO__===1?_:new w(function(M,g){if(typeof M!="function"||typeof g!="function")throw TypeError("Not a function");M(_)})}),x(c,"reject",function(_){return new this(function(A,M){if(typeof A!="function"||typeof M!="function")throw TypeError("Not a function");M(_)})}),x(c,"all",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):_.length===0?w.resolve([]):new w(function(M,g){if(typeof M!="function"||typeof g!="function")throw TypeError("Not a function");var b=_.length,v=Array(b),u=0;h(w,_,function(m,R){v[m]=R,++u===b&&M(v)},g)})}),x(c,"race",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):new w(function(M,g){if(typeof M!="function"||typeof g!="function")throw TypeError("Not a function");h(w,_,function(v,u){M(u)},g)})}),c})}}),Oi=Ge({"node_modules/@plotly/d3/d3.js"(Z,q){(function(){var d={version:"3.8.2"},x=[].slice,S=function(pe){return x.call(pe)},E=self.document;function e(pe){return pe&&(pe.ownerDocument||pe.document||pe).documentElement}function t(pe){return pe&&(pe.ownerDocument&&pe.ownerDocument.defaultView||pe.document&&pe||pe.defaultView)}if(E)try{S(E.documentElement.childNodes)[0].nodeType}catch{S=function(Ie){for(var Je=Ie.length,ft=new Array(Je);Je--;)ft[Je]=Ie[Je];return ft}}if(Date.now||(Date.now=function(){return+new Date}),E)try{E.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,o=r.setAttribute,a=r.setAttributeNS,i=this.CSSStyleDeclaration.prototype,n=i.setProperty;r.setAttribute=function(Ie,Je){o.call(this,Ie,Je+"")},r.setAttributeNS=function(Ie,Je,ft){a.call(this,Ie,Je,ft+"")},i.setProperty=function(Ie,Je,ft){n.call(this,Ie,Je+"",ft)}}d.ascending=s;function s(pe,Ie){return peIe?1:pe>=Ie?0:NaN}d.descending=function(pe,Ie){return Iepe?1:Ie>=pe?0:NaN},d.min=function(pe,Ie){var Je=-1,ft=pe.length,pt,xt;if(arguments.length===1){for(;++Je=xt){pt=xt;break}for(;++Jext&&(pt=xt)}else{for(;++Je=xt){pt=xt;break}for(;++Jext&&(pt=xt)}return pt},d.max=function(pe,Ie){var Je=-1,ft=pe.length,pt,xt;if(arguments.length===1){for(;++Je=xt){pt=xt;break}for(;++Jept&&(pt=xt)}else{for(;++Je=xt){pt=xt;break}for(;++Jept&&(pt=xt)}return pt},d.extent=function(pe,Ie){var Je=-1,ft=pe.length,pt,xt,Jt;if(arguments.length===1){for(;++Je=xt){pt=Jt=xt;break}for(;++Jext&&(pt=xt),Jt=xt){pt=Jt=xt;break}for(;++Jext&&(pt=xt),Jt1)return Jt/(dr-1)},d.deviation=function(){var pe=d.variance.apply(this,arguments);return pe&&Math.sqrt(pe)};function p(pe){return{left:function(Ie,Je,ft,pt){for(arguments.length<3&&(ft=0),arguments.length<4&&(pt=Ie.length);ft>>1;pe(Ie[xt],Je)<0?ft=xt+1:pt=xt}return ft},right:function(Ie,Je,ft,pt){for(arguments.length<3&&(ft=0),arguments.length<4&&(pt=Ie.length);ft>>1;pe(Ie[xt],Je)>0?pt=xt:ft=xt+1}return ft}}}var c=p(s);d.bisectLeft=c.left,d.bisect=d.bisectRight=c.right,d.bisector=function(pe){return p(pe.length===1?function(Ie,Je){return s(pe(Ie),Je)}:pe)},d.shuffle=function(pe,Ie,Je){(ft=arguments.length)<3&&(Je=pe.length,ft<2&&(Ie=0));for(var ft=Je-Ie,pt,xt;ft;)xt=Math.random()*ft--|0,pt=pe[ft+Ie],pe[ft+Ie]=pe[xt+Ie],pe[xt+Ie]=pt;return pe},d.permute=function(pe,Ie){for(var Je=Ie.length,ft=new Array(Je);Je--;)ft[Je]=pe[Ie[Je]];return ft},d.pairs=function(pe){for(var Ie=0,Je=pe.length-1,ft,pt=pe[0],xt=new Array(Je<0?0:Je);Ie=0;)for(Jt=pe[Ie],Je=Jt.length;--Je>=0;)xt[--pt]=Jt[Je];return xt};var l=Math.abs;d.range=function(pe,Ie,Je){if(arguments.length<3&&(Je=1,arguments.length<2&&(Ie=pe,pe=0)),(Ie-pe)/Je===1/0)throw new Error("infinite range");var ft=[],pt=_(l(Je)),xt=-1,Jt;if(pe*=pt,Ie*=pt,Je*=pt,Je<0)for(;(Jt=pe+Je*++xt)>Ie;)ft.push(Jt/pt);else for(;(Jt=pe+Je*++xt)=Ie.length)return pt?pt.call(pe,dr):ft?dr.sort(ft):dr;for(var Vr=-1,va=dr.length,sa=Ie[Nr++],qa,Wa,ya,Ea=new A,Na;++Vr=Ie.length)return Pt;var Nr=[],Vr=Je[dr++];return Pt.forEach(function(va,sa){Nr.push({key:va,values:Jt(sa,dr)})}),Vr?Nr.sort(function(va,sa){return Vr(va.key,sa.key)}):Nr}return pe.map=function(Pt,dr){return xt(dr,Pt,0)},pe.entries=function(Pt){return Jt(xt(d.map,Pt,0),0)},pe.key=function(Pt){return Ie.push(Pt),pe},pe.sortKeys=function(Pt){return Je[Ie.length-1]=Pt,pe},pe.sortValues=function(Pt){return ft=Pt,pe},pe.rollup=function(Pt){return pt=Pt,pe},pe},d.set=function(pe){var Ie=new z;if(pe)for(var Je=0,ft=pe.length;Je=0&&(ft=pe.slice(Je+1),pe=pe.slice(0,Je)),pe)return arguments.length<2?this[pe].on(ft):this[pe].on(ft,Ie);if(arguments.length===2){if(Ie==null)for(pe in this)this.hasOwnProperty(pe)&&this[pe].on(ft,null);return this}};function X(pe){var Ie=[],Je=new A;function ft(){for(var pt=Ie,xt=-1,Jt=pt.length,Pt;++xt=0&&(Je=pe.slice(0,Ie))!=="xmlns"&&(pe=pe.slice(Ie+1)),he.hasOwnProperty(Je)?{space:he[Je],local:pe}:pe}},ae.attr=function(pe,Ie){if(arguments.length<2){if(typeof pe=="string"){var Je=this.node();return pe=d.ns.qualify(pe),pe.local?Je.getAttributeNS(pe.space,pe.local):Je.getAttribute(pe)}for(Ie in pe)this.each(xe(Ie,pe[Ie]));return this}return this.each(xe(pe,Ie))};function xe(pe,Ie){pe=d.ns.qualify(pe);function Je(){this.removeAttribute(pe)}function ft(){this.removeAttributeNS(pe.space,pe.local)}function pt(){this.setAttribute(pe,Ie)}function xt(){this.setAttributeNS(pe.space,pe.local,Ie)}function Jt(){var dr=Ie.apply(this,arguments);dr==null?this.removeAttribute(pe):this.setAttribute(pe,dr)}function Pt(){var dr=Ie.apply(this,arguments);dr==null?this.removeAttributeNS(pe.space,pe.local):this.setAttributeNS(pe.space,pe.local,dr)}return Ie==null?pe.local?ft:Je:typeof Ie=="function"?pe.local?Pt:Jt:pe.local?xt:pt}function Te(pe){return pe.trim().replace(/\s+/g," ")}ae.classed=function(pe,Ie){if(arguments.length<2){if(typeof pe=="string"){var Je=this.node(),ft=(pe=Pe(pe)).length,pt=-1;if(Ie=Je.classList){for(;++pt=0;)(xt=Je[ft])&&(pt&&pt!==xt.nextSibling&&pt.parentNode.insertBefore(xt,pt),pt=xt);return this},ae.sort=function(pe){pe=Ee.apply(this,arguments);for(var Ie=-1,Je=this.length;++Ie=Ie&&(Ie=pt+1);!(dr=Jt[Ie])&&++Ie0&&(pe=pe.slice(0,pt));var Jt=zt.get(pe);Jt&&(pe=Jt,xt=br);function Pt(){var Vr=this[ft];Vr&&(this.removeEventListener(pe,Vr,Vr.$),delete this[ft])}function dr(){var Vr=xt(Ie,S(arguments));Pt.call(this),this.addEventListener(pe,this[ft]=Vr,Vr.$=Je),Vr._=Ie}function Nr(){var Vr=new RegExp("^__on([^.]+)"+d.requote(pe)+"$"),va;for(var sa in this)if(va=sa.match(Vr)){var qa=this[sa];this.removeEventListener(va[1],qa,qa.$),delete this[sa]}}return pt?Ie?dr:Pt:Ie?U:Nr}var zt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&zt.forEach(function(pe){"on"+pe in E&&zt.remove(pe)});function Ut(pe,Ie){return function(Je){var ft=d.event;d.event=Je,Ie[0]=this.__data__;try{pe.apply(this,Ie)}finally{d.event=ft}}}function br(pe,Ie){var Je=Ut(pe,Ie);return function(ft){var pt=this,xt=ft.relatedTarget;(!xt||xt!==pt&&!(xt.compareDocumentPosition(pt)&8))&&Je.call(pt,ft)}}var hr,Or=0;function wr(pe){var Ie=".dragsuppress-"+ ++Or,Je="click"+Ie,ft=d.select(t(pe)).on("touchmove"+Ie,$).on("dragstart"+Ie,$).on("selectstart"+Ie,$);if(hr==null&&(hr="onselectstart"in pe?!1:O(pe.style,"userSelect")),hr){var pt=e(pe).style,xt=pt[hr];pt[hr]="none"}return function(Jt){if(ft.on(Ie,null),hr&&(pt[hr]=xt),Jt){var Pt=function(){ft.on(Je,null)};ft.on(Je,function(){$(),Pt()},!0),setTimeout(Pt,0)}}}d.mouse=function(pe){return mt(pe,le())};var Er=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function mt(pe,Ie){Ie.changedTouches&&(Ie=Ie.changedTouches[0]);var Je=pe.ownerSVGElement||pe;if(Je.createSVGPoint){var ft=Je.createSVGPoint();if(Er<0){var pt=t(pe);if(pt.scrollX||pt.scrollY){Je=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var xt=Je[0][0].getScreenCTM();Er=!(xt.f||xt.e),Je.remove()}}return Er?(ft.x=Ie.pageX,ft.y=Ie.pageY):(ft.x=Ie.clientX,ft.y=Ie.clientY),ft=ft.matrixTransform(pe.getScreenCTM().inverse()),[ft.x,ft.y]}var Jt=pe.getBoundingClientRect();return[Ie.clientX-Jt.left-pe.clientLeft,Ie.clientY-Jt.top-pe.clientTop]}d.touch=function(pe,Ie,Je){if(arguments.length<3&&(Je=Ie,Ie=le().changedTouches),Ie){for(var ft=0,pt=Ie.length,xt;ft0?1:pe<0?-1:0}function Et(pe,Ie,Je){return(Ie[0]-pe[0])*(Je[1]-pe[1])-(Ie[1]-pe[1])*(Je[0]-pe[0])}function Ot(pe){return pe>1?0:pe<-1?ke:Math.acos(pe)}function sr(pe){return pe>1?nt:pe<-1?-nt:Math.asin(pe)}function ir(pe){return((pe=Math.exp(pe))-1/pe)/2}function ar(pe){return((pe=Math.exp(pe))+1/pe)/2}function Mr(pe){return((pe=Math.exp(2*pe))-1)/(pe+1)}function ma(pe){return(pe=Math.sin(pe/2))*pe}var Ca=Math.SQRT2,Aa=2,Da=4;d.interpolateZoom=function(pe,Ie){var Je=pe[0],ft=pe[1],pt=pe[2],xt=Ie[0],Jt=Ie[1],Pt=Ie[2],dr=xt-Je,Nr=Jt-ft,Vr=dr*dr+Nr*Nr,va,sa;if(Vr0&&(oi=oi.transition().duration(Jt)),oi.call(Ka.event)}function Fi(){Ea&&Ea.domain(ya.range().map(function(oi){return(oi-pe.x)/pe.k}).map(ya.invert)),tn&&tn.domain(Na.range().map(function(oi){return(oi-pe.y)/pe.k}).map(Na.invert))}function qi(oi){Pt++||oi({type:"zoomstart"})}function Lo(oi){Fi(),oi({type:"zoom",scale:pe.k,translate:[pe.x,pe.y]})}function Xi(oi){--Pt||(oi({type:"zoomend"}),Je=null)}function Eo(){var oi=this,eo=Wa.of(oi,arguments),Ho=0,Yo=d.select(t(oi)).on(Nr,Yl).on(Vr,sl),el=wa(d.mouse(oi)),yl=wr(oi);Mi.call(oi),qi(eo);function Yl(){Ho=1,ni(d.mouse(oi),el),Lo(eo)}function sl(){Yo.on(Nr,null).on(Vr,null),yl(Ho),Xi(eo)}}function js(){var oi=this,eo=Wa.of(oi,arguments),Ho={},Yo=0,el,yl=".zoom-"+d.event.changedTouches[0].identifier,Yl="touchmove"+yl,sl="touchend"+yl,Nu=[],tt=d.select(oi),Gt=wr(oi);ea(),qi(eo),tt.on(dr,null).on(sa,ea);function or(){var fa=d.touches(oi);return el=pe.k,fa.forEach(function(ja){ja.identifier in Ho&&(Ho[ja.identifier]=wa(ja))}),fa}function ea(){var fa=d.event.target;d.select(fa).on(Yl,pa).on(sl,la),Nu.push(fa);for(var ja=d.event.changedTouches,hn=0,un=ja.length;hn1){var Mn=Ja[0],yn=Ja[1],Pa=Mn[0]-yn[0],Zr=Mn[1]-yn[1];Yo=Pa*Pa+Zr*Zr}}function pa(){var fa=d.touches(oi),ja,hn,un,Ja;Mi.call(oi);for(var si=0,Mn=fa.length;si1?1:Ie,Je=Je<0?0:Je>1?1:Je,pt=Je<=.5?Je*(1+Ie):Je+Ie-Je*Ie,ft=2*Je-pt;function xt(Pt){return Pt>360?Pt-=360:Pt<0&&(Pt+=360),Pt<60?ft+(pt-ft)*Pt/60:Pt<180?pt:Pt<240?ft+(pt-ft)*(240-Pt)/60:ft}function Jt(Pt){return Math.round(xt(Pt)*255)}return new gt(Jt(pe+120),Jt(pe),Jt(pe-120))}d.hcl=Xt;function Xt(pe,Ie,Je){return this instanceof Xt?(this.h=+pe,this.c=+Ie,void(this.l=+Je)):arguments.length<2?pe instanceof Xt?new Xt(pe.h,pe.c,pe.l):pe instanceof Kr?Sa(pe.l,pe.a,pe.b):Sa((pe=Ur((pe=d.rgb(pe)).r,pe.g,pe.b)).l,pe.a,pe.b):new Xt(pe,Ie,Je)}var Pr=Xt.prototype=new vn;Pr.brighter=function(pe){return new Xt(this.h,this.c,Math.min(100,this.l+na*(arguments.length?pe:1)))},Pr.darker=function(pe){return new Xt(this.h,this.c,Math.max(0,this.l-na*(arguments.length?pe:1)))},Pr.rgb=function(){return Yr(this.h,this.c,this.l).rgb()};function Yr(pe,Ie,Je){return isNaN(pe)&&(pe=0),isNaN(Ie)&&(Ie=0),new Kr(Je,Math.cos(pe*=ot)*Ie,Math.sin(pe)*Ie)}d.lab=Kr;function Kr(pe,Ie,Je){return this instanceof Kr?(this.l=+pe,this.a=+Ie,void(this.b=+Je)):arguments.length<2?pe instanceof Kr?new Kr(pe.l,pe.a,pe.b):pe instanceof Xt?Yr(pe.h,pe.c,pe.l):Ur((pe=gt(pe)).r,pe.g,pe.b):new Kr(pe,Ie,Je)}var na=18,La=.95047,Ga=1,Ua=1.08883,Xa=Kr.prototype=new vn;Xa.brighter=function(pe){return new Kr(Math.min(100,this.l+na*(arguments.length?pe:1)),this.a,this.b)},Xa.darker=function(pe){return new Kr(Math.max(0,this.l-na*(arguments.length?pe:1)),this.a,this.b)},Xa.rgb=function(){return an(this.l,this.a,this.b)};function an(pe,Ie,Je){var ft=(pe+16)/116,pt=ft+Ie/500,xt=ft-Je/200;return pt=Zn(pt)*La,ft=Zn(ft)*Ga,xt=Zn(xt)*Ua,new gt(ti(3.2404542*pt-1.5371385*ft-.4985314*xt),ti(-.969266*pt+1.8760108*ft+.041556*xt),ti(.0556434*pt-.2040259*ft+1.0572252*xt))}function Sa(pe,Ie,Je){return pe>0?new Xt(Math.atan2(Je,Ie)*Ft,Math.sqrt(Ie*Ie+Je*Je),pe):new Xt(NaN,NaN,pe)}function Zn(pe){return pe>.206893034?pe*pe*pe:(pe-4/29)/7.787037}function Wn(pe){return pe>.008856?Math.pow(pe,1/3):7.787037*pe+4/29}function ti(pe){return Math.round(255*(pe<=.00304?12.92*pe:1.055*Math.pow(pe,1/2.4)-.055))}d.rgb=gt;function gt(pe,Ie,Je){return this instanceof gt?(this.r=~~pe,this.g=~~Ie,void(this.b=~~Je)):arguments.length<2?pe instanceof gt?new gt(pe.r,pe.g,pe.b):kr(""+pe,gt,Ht):new gt(pe,Ie,Je)}function it(pe){return new gt(pe>>16,pe>>8&255,pe&255)}function Rr(pe){return it(pe)+""}var Ar=gt.prototype=new vn;Ar.brighter=function(pe){pe=Math.pow(.7,arguments.length?pe:1);var Ie=this.r,Je=this.g,ft=this.b,pt=30;return!Ie&&!Je&&!ft?new gt(pt,pt,pt):(Ie&&Ie>4,ft=ft>>4|ft,pt=dr&240,pt=pt>>4|pt,xt=dr&15,xt=xt<<4|xt):pe.length===7&&(ft=(dr&16711680)>>16,pt=(dr&65280)>>8,xt=dr&255)),Ie(ft,pt,xt))}function zr(pe,Ie,Je){var ft=Math.min(pe/=255,Ie/=255,Je/=255),pt=Math.max(pe,Ie,Je),xt=pt-ft,Jt,Pt,dr=(pt+ft)/2;return xt?(Pt=dr<.5?xt/(pt+ft):xt/(2-pt-ft),pe==pt?Jt=(Ie-Je)/xt+(Ie0&&dr<1?0:Jt),new Wt(Jt,Pt,dr)}function Ur(pe,Ie,Je){pe=dt(pe),Ie=dt(Ie),Je=dt(Je);var ft=Wn((.4124564*pe+.3575761*Ie+.1804375*Je)/La),pt=Wn((.2126729*pe+.7151522*Ie+.072175*Je)/Ga),xt=Wn((.0193339*pe+.119192*Ie+.9503041*Je)/Ua);return Kr(116*pt-16,500*(ft-pt),200*(pt-xt))}function dt(pe){return(pe/=255)<=.04045?pe/12.92:Math.pow((pe+.055)/1.055,2.4)}function qt(pe){var Ie=parseFloat(pe);return pe.charAt(pe.length-1)==="%"?Math.round(Ie*2.55):Ie}var fr=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});fr.forEach(function(pe,Ie){fr.set(pe,it(Ie))});function Ir(pe){return typeof pe=="function"?pe:function(){return pe}}d.functor=Ir,d.xhr=da(F);function da(pe){return function(Ie,Je,ft){return arguments.length===2&&typeof Je=="function"&&(ft=Je,Je=null),Ta(Ie,Je,pe,ft)}}function Ta(pe,Ie,Je,ft){var pt={},xt=d.dispatch("beforesend","progress","load","error"),Jt={},Pt=new XMLHttpRequest,dr=null;self.XDomainRequest&&!("withCredentials"in Pt)&&/^(http(s)?:)?\/\//.test(pe)&&(Pt=new XDomainRequest),"onload"in Pt?Pt.onload=Pt.onerror=Nr:Pt.onreadystatechange=function(){Pt.readyState>3&&Nr()};function Nr(){var Vr=Pt.status,va;if(!Vr&&ra(Pt)||Vr>=200&&Vr<300||Vr===304){try{va=Je.call(pt,Pt)}catch(sa){xt.error.call(pt,sa);return}xt.load.call(pt,va)}else xt.error.call(pt,Pt)}return Pt.onprogress=function(Vr){var va=d.event;d.event=Vr;try{xt.progress.call(pt,Pt)}finally{d.event=va}},pt.header=function(Vr,va){return Vr=(Vr+"").toLowerCase(),arguments.length<2?Jt[Vr]:(va==null?delete Jt[Vr]:Jt[Vr]=va+"",pt)},pt.mimeType=function(Vr){return arguments.length?(Ie=Vr==null?null:Vr+"",pt):Ie},pt.responseType=function(Vr){return arguments.length?(dr=Vr,pt):dr},pt.response=function(Vr){return Je=Vr,pt},["get","post"].forEach(function(Vr){pt[Vr]=function(){return pt.send.apply(pt,[Vr].concat(S(arguments)))}}),pt.send=function(Vr,va,sa){if(arguments.length===2&&typeof va=="function"&&(sa=va,va=null),Pt.open(Vr,pe,!0),Ie!=null&&!("accept"in Jt)&&(Jt.accept=Ie+",*/*"),Pt.setRequestHeader)for(var qa in Jt)Pt.setRequestHeader(qa,Jt[qa]);return Ie!=null&&Pt.overrideMimeType&&Pt.overrideMimeType(Ie),dr!=null&&(Pt.responseType=dr),sa!=null&&pt.on("error",sa).on("load",function(Wa){sa(null,Wa)}),xt.beforesend.call(pt,Pt),Pt.send(va??null),pt},pt.abort=function(){return Pt.abort(),pt},d.rebind(pt,xt,"on"),ft==null?pt:pt.get(ua(ft))}function ua(pe){return pe.length===1?function(Ie,Je){pe(Ie==null?Je:null)}:pe}function ra(pe){var Ie=pe.responseType;return Ie&&Ie!=="text"?pe.response:pe.responseText}d.dsv=function(pe,Ie){var Je=new RegExp('["'+pe+` +]`),ft=pe.charCodeAt(0);function pt(Nr,Vr,va){arguments.length<3&&(va=Vr,Vr=null);var sa=Ta(Nr,Ie,Vr==null?xt:Jt(Vr),va);return sa.row=function(qa){return arguments.length?sa.response((Vr=qa)==null?xt:Jt(qa)):Vr},sa}function xt(Nr){return pt.parse(Nr.responseText)}function Jt(Nr){return function(Vr){return pt.parse(Vr.responseText,Nr)}}pt.parse=function(Nr,Vr){var va;return pt.parseRows(Nr,function(sa,qa){if(va)return va(sa,qa-1);var Wa=function(ya){for(var Ea={},Na=sa.length,tn=0;tn=Wa)return sa;if(tn)return tn=!1,va;var Jn=ya;if(Nr.charCodeAt(Jn)===34){for(var Xn=Jn;Xn++24?(isFinite(Ie)&&(clearTimeout(jn),jn=setTimeout(gi,Ie)),_n=0):(_n=1,li(gi))}d.timer.flush=function(){Si(),Gi()};function Si(){for(var pe=Date.now(),Ie=ha;Ie;)pe>=Ie.t&&Ie.c(pe-Ie.t)&&(Ie.c=null),Ie=Ie.n;return pe}function Gi(){for(var pe,Ie=ha,Je=1/0;Ie;)Ie.c?(Ie.t=0;--Pt)ya.push(pt[Nr[va[Pt]][2]]);for(Pt=+qa;Pt1&&Et(pe[Je[ft-2]],pe[Je[ft-1]],pe[pt])<=0;)--ft;Je[ft++]=pt}return Je.slice(0,ft)}function pi(pe,Ie){return pe[0]-Ie[0]||pe[1]-Ie[1]}d.geom.polygon=function(pe){return G(pe,lo),pe};var lo=d.geom.polygon.prototype=[];lo.area=function(){for(var pe=-1,Ie=this.length,Je,ft=this[Ie-1],pt=0;++peZe)Pt=Pt.L;else if(Jt=Ie-Ii(Pt,Je),Jt>Ze){if(!Pt.R){ft=Pt;break}Pt=Pt.R}else{xt>-Ze?(ft=Pt.P,pt=Pt):Jt>-Ze?(ft=Pt,pt=Pt.N):ft=pt=Pt;break}var dr=ko(pe);if(Hi.insert(ft,dr),!(!ft&&!pt)){if(ft===pt){po(ft),pt=ko(ft.site),Hi.insert(dr,pt),dr.edge=pt.edge=Ts(ft.site,dr.site),ui(ft),ui(pt);return}if(!pt){dr.edge=Ts(ft.site,dr.site);return}po(ft),po(pt);var Nr=ft.site,Vr=Nr.x,va=Nr.y,sa=pe.x-Vr,qa=pe.y-va,Wa=pt.site,ya=Wa.x-Vr,Ea=Wa.y-va,Na=2*(sa*Ea-qa*ya),tn=sa*sa+qa*qa,Ka=ya*ya+Ea*Ea,wa={x:(Ea*tn-qa*Ka)/Na+Vr,y:(sa*Ka-ya*tn)/Na+va};as(pt.edge,Nr,Wa,wa),dr.edge=Ts(Nr,pe,null,wa),pt.edge=Ts(pe,Wa,null,wa),ui(ft),ui(pt)}}function Qo(pe,Ie){var Je=pe.site,ft=Je.x,pt=Je.y,xt=pt-Ie;if(!xt)return ft;var Jt=pe.P;if(!Jt)return-1/0;Je=Jt.site;var Pt=Je.x,dr=Je.y,Nr=dr-Ie;if(!Nr)return Pt;var Vr=Pt-ft,va=1/xt-1/Nr,sa=Vr/Nr;return va?(-sa+Math.sqrt(sa*sa-2*va*(Vr*Vr/(-2*Nr)-dr+Nr/2+pt-xt/2)))/va+ft:(ft+Pt)/2}function Ii(pe,Ie){var Je=pe.N;if(Je)return Qo(Je,Ie);var ft=pe.site;return ft.y===Ie?ft.x:1/0}function gs(pe){this.site=pe,this.edges=[]}gs.prototype.prepare=function(){for(var pe=this.edges,Ie=pe.length,Je;Ie--;)Je=pe[Ie].edge,(!Je.b||!Je.a)&&pe.splice(Ie,1);return pe.sort(Ss),pe.length};function Zo(pe){for(var Ie=pe[0][0],Je=pe[1][0],ft=pe[0][1],pt=pe[1][1],xt,Jt,Pt,dr,Nr=bo,Vr=Nr.length,va,sa,qa,Wa,ya,Ea;Vr--;)if(va=Nr[Vr],!(!va||!va.prepare()))for(qa=va.edges,Wa=qa.length,sa=0;saZe||l(dr-Jt)>Ze)&&(qa.splice(sa,0,new bs(Ws(va.site,Ea,l(Pt-Ie)Ze?{x:Ie,y:l(xt-Ie)Ze?{x:l(Jt-pt)Ze?{x:Je,y:l(xt-Je)Ze?{x:l(Jt-ft)=-we)){var sa=dr*dr+Nr*Nr,qa=Vr*Vr+Ea*Ea,Wa=(Ea*sa-Nr*qa)/va,ya=(dr*qa-Vr*sa)/va,Ea=ya+Pt,Na=Ko.pop()||new zs;Na.arc=pe,Na.site=pt,Na.x=Wa+Jt,Na.y=Ea+Math.sqrt(Wa*Wa+ya*ya),Na.cy=Ea,pe.circle=Na;for(var tn=null,Ka=Uo._;Ka;)if(Na.y0)){if(ya/=qa,qa<0){if(ya0){if(ya>sa)return;ya>va&&(va=ya)}if(ya=Je-Pt,!(!qa&&ya<0)){if(ya/=qa,qa<0){if(ya>sa)return;ya>va&&(va=ya)}else if(qa>0){if(ya0)){if(ya/=Wa,Wa<0){if(ya0){if(ya>sa)return;ya>va&&(va=ya)}if(ya=ft-dr,!(!Wa&&ya<0)){if(ya/=Wa,Wa<0){if(ya>sa)return;ya>va&&(va=ya)}else if(Wa>0){if(ya0&&(pt.a={x:Pt+va*qa,y:dr+va*Wa}),sa<1&&(pt.b={x:Pt+sa*qa,y:dr+sa*Wa}),pt}}}}}}function vs(pe){for(var Ie=$o,Je=oo(pe[0][0],pe[0][1],pe[1][0],pe[1][1]),ft=Ie.length,pt;ft--;)pt=Ie[ft],(!Nl(pt,pe)||!Je(pt)||l(pt.a.x-pt.b.x)=xt)return;if(Vr>sa){if(!ft)ft={x:Wa,y:Jt};else if(ft.y>=Pt)return;Je={x:Wa,y:Pt}}else{if(!ft)ft={x:Wa,y:Pt};else if(ft.y1)if(Vr>sa){if(!ft)ft={x:(Jt-Na)/Ea,y:Jt};else if(ft.y>=Pt)return;Je={x:(Pt-Na)/Ea,y:Pt}}else{if(!ft)ft={x:(Pt-Na)/Ea,y:Pt};else if(ft.y=xt)return;Je={x:xt,y:Ea*xt+Na}}else{if(!ft)ft={x:xt,y:Ea*xt+Na};else if(ft.x=Vr&&Na.x<=sa&&Na.y>=va&&Na.y<=qa?[[Vr,qa],[sa,qa],[sa,va],[Vr,va]]:[];tn.point=dr[ya]}),Nr}function Pt(dr){return dr.map(function(Nr,Vr){return{x:Math.round(ft(Nr,Vr)/Ze)*Ze,y:Math.round(pt(Nr,Vr)/Ze)*Ze,i:Vr}})}return Jt.links=function(dr){return Ul(Pt(dr)).edges.filter(function(Nr){return Nr.l&&Nr.r}).map(function(Nr){return{source:dr[Nr.l.i],target:dr[Nr.r.i]}})},Jt.triangles=function(dr){var Nr=[];return Ul(Pt(dr)).cells.forEach(function(Vr,va){for(var sa=Vr.site,qa=Vr.edges.sort(Ss),Wa=-1,ya=qa.length,Ea,Na,tn=qa[ya-1].edge,Ka=tn.l===sa?tn.r:tn.l;++WaKa&&(Ka=Vr.x),Vr.y>wa&&(wa=Vr.y),qa.push(Vr.x),Wa.push(Vr.y);else for(ya=0;yaKa&&(Ka=Jn),Xn>wa&&(wa=Xn),qa.push(Jn),Wa.push(Xn)}var ni=Ka-Na,xi=wa-tn;ni>xi?wa=tn+ni:Ka=Na+xi;function Fi(Xi,Eo,js,Ds,Ks,oi,eo,Ho){if(!(isNaN(js)||isNaN(Ds)))if(Xi.leaf){var Yo=Xi.x,el=Xi.y;if(Yo!=null)if(l(Yo-js)+l(el-Ds)<.01)qi(Xi,Eo,js,Ds,Ks,oi,eo,Ho);else{var yl=Xi.point;Xi.x=Xi.y=Xi.point=null,qi(Xi,yl,Yo,el,Ks,oi,eo,Ho),qi(Xi,Eo,js,Ds,Ks,oi,eo,Ho)}else Xi.x=js,Xi.y=Ds,Xi.point=Eo}else qi(Xi,Eo,js,Ds,Ks,oi,eo,Ho)}function qi(Xi,Eo,js,Ds,Ks,oi,eo,Ho){var Yo=(Ks+eo)*.5,el=(oi+Ho)*.5,yl=js>=Yo,Yl=Ds>=el,sl=Yl<<1|yl;Xi.leaf=!1,Xi=Xi.nodes[sl]||(Xi.nodes[sl]=Dl()),yl?Ks=Yo:eo=Yo,Yl?oi=el:Ho=el,Fi(Xi,Eo,js,Ds,Ks,oi,eo,Ho)}var Lo=Dl();if(Lo.add=function(Xi){Fi(Lo,Xi,+va(Xi,++ya),+sa(Xi,ya),Na,tn,Ka,wa)},Lo.visit=function(Xi){il(Xi,Lo,Na,tn,Ka,wa)},Lo.find=function(Xi){return Au(Lo,Xi[0],Xi[1],Na,tn,Ka,wa)},ya=-1,Ie==null){for(;++yaxt||sa>Jt||qa=Jn,xi=Je>=Xn,Fi=xi<<1|ni,qi=Fi+4;FiJe&&(xt=Ie.slice(Je,xt),Pt[Jt]?Pt[Jt]+=xt:Pt[++Jt]=xt),(ft=ft[0])===(pt=pt[0])?Pt[Jt]?Pt[Jt]+=pt:Pt[++Jt]=pt:(Pt[++Jt]=null,dr.push({i:Jt,x:Xs(ft,pt)})),Je=Su.lastIndex;return Je=0&&!(ft=d.interpolators[Je](pe,Ie)););return ft}d.interpolators=[function(pe,Ie){var Je=typeof Ie;return(Je==="string"?fr.has(Ie.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Ie)?ou:es:Ie instanceof vn?ou:Array.isArray(Ie)?cu:Je==="object"&&isNaN(Ie)?Fs:Xs)(pe,Ie)}],d.interpolateArray=cu;function cu(pe,Ie){var Je=[],ft=[],pt=pe.length,xt=Ie.length,Jt=Math.min(pe.length,Ie.length),Pt;for(Pt=0;Pt=0?pe.slice(0,Ie):pe,ft=Ie>=0?pe.slice(Ie+1):"in";return Je=wf.get(Je)||qs,ft=Vo.get(ft)||F,Tf(ft(Je.apply(null,x.call(arguments,1))))};function Tf(pe){return function(Ie){return Ie<=0?0:Ie>=1?1:pe(Ie)}}function ss(pe){return function(Ie){return 1-pe(1-Ie)}}function Vi(pe){return function(Ie){return .5*(Ie<.5?pe(2*Ie):2-pe(2-2*Ie))}}function sc(pe){return pe*pe}function fu(pe){return pe*pe*pe}function vl(pe){if(pe<=0)return 0;if(pe>=1)return 1;var Ie=pe*pe,Je=Ie*pe;return 4*(pe<.5?Je:3*(pe-Ie)+Je-.75)}function Rc(pe){return function(Ie){return Math.pow(Ie,pe)}}function qu(pe){return 1-Math.cos(pe*nt)}function yc(pe){return Math.pow(2,10*(pe-1))}function Al(pe){return 1-Math.sqrt(1-pe*pe)}function $c(pe,Ie){var Je;return arguments.length<2&&(Ie=.45),arguments.length?Je=Ie/Be*Math.asin(1/pe):(pe=1,Je=Ie/4),function(ft){return 1+pe*Math.pow(2,-10*ft)*Math.sin((ft-Je)*Be/Ie)}}function Nc(pe){return pe||(pe=1.70158),function(Ie){return Ie*Ie*((pe+1)*Ie-pe)}}function _c(pe){return pe<1/2.75?7.5625*pe*pe:pe<2/2.75?7.5625*(pe-=1.5/2.75)*pe+.75:pe<2.5/2.75?7.5625*(pe-=2.25/2.75)*pe+.9375:7.5625*(pe-=2.625/2.75)*pe+.984375}d.interpolateHcl=ac;function ac(pe,Ie){pe=d.hcl(pe),Ie=d.hcl(Ie);var Je=pe.h,ft=pe.c,pt=pe.l,xt=Ie.h-Je,Jt=Ie.c-ft,Pt=Ie.l-pt;return isNaN(Jt)&&(Jt=0,ft=isNaN(ft)?Ie.c:ft),isNaN(xt)?(xt=0,Je=isNaN(Je)?Ie.h:Je):xt>180?xt-=360:xt<-180&&(xt+=360),function(dr){return Yr(Je+xt*dr,ft+Jt*dr,pt+Pt*dr)+""}}d.interpolateHsl=Uc;function Uc(pe,Ie){pe=d.hsl(pe),Ie=d.hsl(Ie);var Je=pe.h,ft=pe.s,pt=pe.l,xt=Ie.h-Je,Jt=Ie.s-ft,Pt=Ie.l-pt;return isNaN(Jt)&&(Jt=0,ft=isNaN(ft)?Ie.s:ft),isNaN(xt)?(xt=0,Je=isNaN(Je)?Ie.h:Je):xt>180?xt-=360:xt<-180&&(xt+=360),function(dr){return Ht(Je+xt*dr,ft+Jt*dr,pt+Pt*dr)+""}}d.interpolateLab=jc;function jc(pe,Ie){pe=d.lab(pe),Ie=d.lab(Ie);var Je=pe.l,ft=pe.a,pt=pe.b,xt=Ie.l-Je,Jt=Ie.a-ft,Pt=Ie.b-pt;return function(dr){return an(Je+xt*dr,ft+Jt*dr,pt+Pt*dr)+""}}d.interpolateRound=hu;function hu(pe,Ie){return Ie-=pe,function(Je){return Math.round(pe+Ie*Je)}}d.transform=function(pe){var Ie=E.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(Je){if(Je!=null){Ie.setAttribute("transform",Je);var ft=Ie.transform.baseVal.consolidate()}return new Dc(ft?ft.matrix:nc)})(pe)};function Dc(pe){var Ie=[pe.a,pe.b],Je=[pe.c,pe.d],ft=lc(Ie),pt=Mu(Ie,Je),xt=lc(Sl(Je,Ie,-pt))||0;Ie[0]*Je[1]180?Ie+=360:Ie-pe>180&&(pe+=360),ft.push({i:Je.push(Gu(Je)+"rotate(",null,")")-2,x:Xs(pe,Ie)})):Ie&&Je.push(Gu(Je)+"rotate("+Ie+")")}function ff(pe,Ie,Je,ft){pe!==Ie?ft.push({i:Je.push(Gu(Je)+"skewX(",null,")")-2,x:Xs(pe,Ie)}):Ie&&Je.push(Gu(Je)+"skewX("+Ie+")")}function Vc(pe,Ie,Je,ft){if(pe[0]!==Ie[0]||pe[1]!==Ie[1]){var pt=Je.push(Gu(Je)+"scale(",null,",",null,")");ft.push({i:pt-4,x:Xs(pe[0],Ie[0])},{i:pt-2,x:Xs(pe[1],Ie[1])})}else(Ie[0]!==1||Ie[1]!==1)&&Je.push(Gu(Je)+"scale("+Ie+")")}function uc(pe,Ie){var Je=[],ft=[];return pe=d.transform(pe),Ie=d.transform(Ie),Es(pe.translate,Ie.translate,Je,ft),zc(pe.rotate,Ie.rotate,Je,ft),ff(pe.skew,Ie.skew,Je,ft),Vc(pe.scale,Ie.scale,Je,ft),pe=Ie=null,function(pt){for(var xt=-1,Jt=ft.length,Pt;++xt0?xt=wa:(Je.c=null,Je.t=NaN,Je=null,Ie.end({type:"end",alpha:xt=0})):wa>0&&(Ie.start({type:"start",alpha:xt=wa}),Je=yi(pe.tick)),pe):xt},pe.start=function(){var wa,Jn=qa.length,Xn=Wa.length,ni=ft[0],xi=ft[1],Fi,qi;for(wa=0;wa=0;)xt.push(Vr=Nr[dr]),Vr.parent=Pt,Vr.depth=Pt.depth+1;Je&&(Pt.value=0),Pt.children=Nr}else Je&&(Pt.value=+Je.call(ft,Pt,Pt.depth)||0),delete Pt.children;return Fu(pt,function(va){var sa,qa;pe&&(sa=va.children)&&sa.sort(pe),Je&&(qa=va.parent)&&(qa.value+=va.value)}),Jt}return ft.sort=function(pt){return arguments.length?(pe=pt,ft):pe},ft.children=function(pt){return arguments.length?(Ie=pt,ft):Ie},ft.value=function(pt){return arguments.length?(Je=pt,ft):Je},ft.revalue=function(pt){return Je&&(Wu(pt,function(xt){xt.children&&(xt.value=0)}),Fu(pt,function(xt){var Jt;xt.children||(xt.value=+Je.call(ft,xt,xt.depth)||0),(Jt=xt.parent)&&(Jt.value+=xt.value)})),pt},ft};function su(pe,Ie){return d.rebind(pe,Ie,"sort","children","value"),pe.nodes=pe,pe.links=lu,pe}function Wu(pe,Ie){for(var Je=[pe];(pe=Je.pop())!=null;)if(Ie(pe),(pt=pe.children)&&(ft=pt.length))for(var ft,pt;--ft>=0;)Je.push(pt[ft])}function Fu(pe,Ie){for(var Je=[pe],ft=[];(pe=Je.pop())!=null;)if(ft.push(pe),(Jt=pe.children)&&(xt=Jt.length))for(var pt=-1,xt,Jt;++ptpt&&(pt=Pt),ft.push(Pt)}for(Jt=0;Jtft&&(Je=Ie,ft=pt);return Je}function Gs(pe){return pe.reduce(wc,0)}function wc(pe,Ie){return pe+Ie[1]}d.layout.histogram=function(){var pe=!0,Ie=Number,Je=kc,ft=Xu;function pt(xt,sa){for(var Pt=[],dr=xt.map(Ie,this),Nr=Je.call(this,dr,sa),Vr=ft.call(this,Nr,dr,sa),va,sa=-1,qa=dr.length,Wa=Vr.length-1,ya=pe?1:1/qa,Ea;++sa0)for(sa=-1;++sa=Nr[0]&&Ea<=Nr[1]&&(va=Pt[d.bisect(Vr,Ea,1,Wa)-1],va.y+=ya,va.push(xt[sa]));return Pt}return pt.value=function(xt){return arguments.length?(Ie=xt,pt):Ie},pt.range=function(xt){return arguments.length?(Je=Ir(xt),pt):Je},pt.bins=function(xt){return arguments.length?(ft=typeof xt=="number"?function(Jt){return vu(Jt,xt)}:Ir(xt),pt):ft},pt.frequency=function(xt){return arguments.length?(pe=!!xt,pt):pe},pt};function Xu(pe,Ie){return vu(pe,Math.ceil(Math.log(Ie.length)/Math.LN2+1))}function vu(pe,Ie){for(var Je=-1,ft=+pe[0],pt=(pe[1]-ft)/Ie,xt=[];++Je<=Ie;)xt[Je]=pt*Je+ft;return xt}function kc(pe){return[d.min(pe),d.max(pe)]}d.layout.pack=function(){var pe=d.layout.hierarchy().sort(du),Ie=0,Je=[1,1],ft;function pt(xt,Jt){var Pt=pe.call(this,xt,Jt),dr=Pt[0],Nr=Je[0],Vr=Je[1],va=ft==null?Math.sqrt:typeof ft=="function"?ft:function(){return ft};if(dr.x=dr.y=0,Fu(dr,function(qa){qa.r=+va(qa.value)}),Fu(dr,Hc),Ie){var sa=Ie*(ft?1:Math.max(2*dr.r/Nr,2*dr.r/Vr))/2;Fu(dr,function(qa){qa.r+=sa}),Fu(dr,Hc),Fu(dr,function(qa){qa.r-=sa})}return Ou(dr,Nr/2,Vr/2,ft?1:1/Math.max(2*dr.r/Nr,2*dr.r/Vr)),Pt}return pt.size=function(xt){return arguments.length?(Je=xt,pt):Je},pt.radius=function(xt){return arguments.length?(ft=xt==null||typeof xt=="function"?xt:+xt,pt):ft},pt.padding=function(xt){return arguments.length?(Ie=+xt,pt):Ie},su(pt,pe)};function du(pe,Ie){return pe.value-Ie.value}function fc(pe,Ie){var Je=pe._pack_next;pe._pack_next=Ie,Ie._pack_prev=pe,Ie._pack_next=Je,Je._pack_prev=Ie}function Oc(pe,Ie){pe._pack_next=Ie,Ie._pack_prev=pe}function Pl(pe,Ie){var Je=Ie.x-pe.x,ft=Ie.y-pe.y,pt=pe.r+Ie.r;return .999*pt*pt>Je*Je+ft*ft}function Hc(pe){if(!(Ie=pe.children)||!(sa=Ie.length))return;var Ie,Je=1/0,ft=-1/0,pt=1/0,xt=-1/0,Jt,Pt,dr,Nr,Vr,va,sa;function qa(wa){Je=Math.min(wa.x-wa.r,Je),ft=Math.max(wa.x+wa.r,ft),pt=Math.min(wa.y-wa.r,pt),xt=Math.max(wa.y+wa.r,xt)}if(Ie.forEach(pu),Jt=Ie[0],Jt.x=-Jt.r,Jt.y=0,qa(Jt),sa>1&&(Pt=Ie[1],Pt.x=Pt.r,Pt.y=0,qa(Pt),sa>2))for(dr=Ie[2],dl(Jt,Pt,dr),qa(dr),fc(Jt,dr),Jt._pack_prev=dr,fc(dr,Pt),Pt=Jt._pack_next,Nr=3;NrEa.x&&(Ea=Jn),Jn.depth>Na.depth&&(Na=Jn)});var tn=Ie(ya,Ea)/2-ya.x,Ka=Je[0]/(Ea.x+Ie(Ea,ya)/2+tn),wa=Je[1]/(Na.depth||1);Wu(qa,function(Jn){Jn.x=(Jn.x+tn)*Ka,Jn.y=Jn.depth*wa})}return sa}function xt(Vr){for(var va={A:null,children:[Vr]},sa=[va],qa;(qa=sa.pop())!=null;)for(var Wa=qa.children,ya,Ea=0,Na=Wa.length;Ea0&&(Eu(Yt(ya,Vr,sa),Vr,Jn),Na+=Jn,tn+=Jn),Ka+=ya.m,Na+=qa.m,wa+=Ea.m,tn+=Wa.m;ya&&!hc(Wa)&&(Wa.t=ya,Wa.m+=Ka-tn),qa&&!Yu(Ea)&&(Ea.t=qa,Ea.m+=Na-wa,sa=Vr)}return sa}function Nr(Vr){Vr.x*=Je[0],Vr.y=Vr.depth*Je[1]}return pt.separation=function(Vr){return arguments.length?(Ie=Vr,pt):Ie},pt.size=function(Vr){return arguments.length?(ft=(Je=Vr)==null?Nr:null,pt):ft?null:Je},pt.nodeSize=function(Vr){return arguments.length?(ft=(Je=Vr)==null?null:Nr,pt):ft?Je:null},su(pt,pe)};function Hl(pe,Ie){return pe.parent==Ie.parent?1:2}function Yu(pe){var Ie=pe.children;return Ie.length?Ie[0]:pe.t}function hc(pe){var Ie=pe.children,Je;return(Je=Ie.length)?Ie[Je-1]:pe.t}function Eu(pe,Ie,Je){var ft=Je/(Ie.i-pe.i);Ie.c-=ft,Ie.s+=Je,pe.c+=ft,Ie.z+=Je,Ie.m+=Je}function Ku(pe){for(var Ie=0,Je=0,ft=pe.children,pt=ft.length,xt;--pt>=0;)xt=ft[pt],xt.z+=Ie,xt.m+=Ie,Ie+=xt.s+(Je+=xt.c)}function Yt(pe,Ie,Je){return pe.a.parent===Ie.parent?pe.a:Je}d.layout.cluster=function(){var pe=d.layout.hierarchy().sort(null).value(null),Ie=Hl,Je=[1,1],ft=!1;function pt(xt,Jt){var Pt=pe.call(this,xt,Jt),dr=Pt[0],Nr,Vr=0;Fu(dr,function(ya){var Ea=ya.children;Ea&&Ea.length?(ya.x=Jr(Ea),ya.y=mr(Ea)):(ya.x=Nr?Vr+=Ie(ya,Nr):0,ya.y=0,Nr=ya)});var va=Wr(dr),sa=xa(dr),qa=va.x-Ie(va,sa)/2,Wa=sa.x+Ie(sa,va)/2;return Fu(dr,ft?function(ya){ya.x=(ya.x-dr.x)*Je[0],ya.y=(dr.y-ya.y)*Je[1]}:function(ya){ya.x=(ya.x-qa)/(Wa-qa)*Je[0],ya.y=(1-(dr.y?ya.y/dr.y:1))*Je[1]}),Pt}return pt.separation=function(xt){return arguments.length?(Ie=xt,pt):Ie},pt.size=function(xt){return arguments.length?(ft=(Je=xt)==null,pt):ft?null:Je},pt.nodeSize=function(xt){return arguments.length?(ft=(Je=xt)!=null,pt):ft?Je:null},su(pt,pe)};function mr(pe){return 1+d.max(pe,function(Ie){return Ie.y})}function Jr(pe){return pe.reduce(function(Ie,Je){return Ie+Je.x},0)/pe.length}function Wr(pe){var Ie=pe.children;return Ie&&Ie.length?Wr(Ie[0]):pe}function xa(pe){var Ie=pe.children,Je;return Ie&&(Je=Ie.length)?xa(Ie[Je-1]):pe}d.layout.treemap=function(){var pe=d.layout.hierarchy(),Ie=Math.round,Je=[1,1],ft=null,pt=$a,xt=!1,Jt,Pt="squarify",dr=.5*(1+Math.sqrt(5));function Nr(ya,Ea){for(var Na=-1,tn=ya.length,Ka,wa;++Na0;)tn.push(wa=Ka[xi-1]),tn.area+=wa.area,Pt!=="squarify"||(Xn=sa(tn,ni))<=Jn?(Ka.pop(),Jn=Xn):(tn.area-=tn.pop().area,qa(tn,ni,Na,!1),ni=Math.min(Na.dx,Na.dy),tn.length=tn.area=0,Jn=1/0);tn.length&&(qa(tn,ni,Na,!0),tn.length=tn.area=0),Ea.forEach(Vr)}}function va(ya){var Ea=ya.children;if(Ea&&Ea.length){var Na=pt(ya),tn=Ea.slice(),Ka,wa=[];for(Nr(tn,Na.dx*Na.dy/ya.value),wa.area=0;Ka=tn.pop();)wa.push(Ka),wa.area+=Ka.area,Ka.z!=null&&(qa(wa,Ka.z?Na.dx:Na.dy,Na,!tn.length),wa.length=wa.area=0);Ea.forEach(va)}}function sa(ya,Ea){for(var Na=ya.area,tn,Ka=0,wa=1/0,Jn=-1,Xn=ya.length;++JnKa&&(Ka=tn));return Na*=Na,Ea*=Ea,Na?Math.max(Ea*Ka*dr/Na,Na/(Ea*wa*dr)):1/0}function qa(ya,Ea,Na,tn){var Ka=-1,wa=ya.length,Jn=Na.x,Xn=Na.y,ni=Ea?Ie(ya.area/Ea):0,xi;if(Ea==Na.dx){for((tn||ni>Na.dy)&&(ni=Na.dy);++KaNa.dx)&&(ni=Na.dx);++Ka1);return pe+Ie*ft*Math.sqrt(-2*Math.log(xt)/xt)}},logNormal:function(){var pe=d.random.normal.apply(d,arguments);return function(){return Math.exp(pe())}},bates:function(pe){var Ie=d.random.irwinHall(pe);return function(){return Ie()/pe}},irwinHall:function(pe){return function(){for(var Ie=0,Je=0;Je2?sn:ai,Nr=ft?$l:Qc;return pt=dr(pe,Ie,Nr,Je),xt=dr(Ie,pe,Nr,hl),Pt}function Pt(dr){return pt(dr)}return Pt.invert=function(dr){return xt(dr)},Pt.domain=function(dr){return arguments.length?(pe=dr.map(Number),Jt()):pe},Pt.range=function(dr){return arguments.length?(Ie=dr,Jt()):Ie},Pt.rangeRound=function(dr){return Pt.range(dr).interpolate(hu)},Pt.clamp=function(dr){return arguments.length?(ft=dr,Jt()):ft},Pt.interpolate=function(dr){return arguments.length?(Je=dr,Jt()):Je},Pt.ticks=function(dr){return Ji(pe,dr)},Pt.tickFormat=function(dr,Nr){return d3_scale_linearTickFormat(pe,dr,Nr)},Pt.nice=function(dr){return Wi(pe,dr),Jt()},Pt.copy=function(){return di(pe,Ie,Je,ft)},Jt()}function Ni(pe,Ie){return d.rebind(pe,Ie,"range","rangeRound","interpolate","clamp")}function Wi(pe,Ie){return wn(pe,Sn(Ui(pe,Ie)[2])),wn(pe,Sn(Ui(pe,Ie)[2])),pe}function Ui(pe,Ie){Ie==null&&(Ie=10);var Je=Fn(pe),ft=Je[1]-Je[0],pt=Math.pow(10,Math.floor(Math.log(ft/Ie)/Math.LN10)),xt=Ie/ft*pt;return xt<=.15?pt*=10:xt<=.35?pt*=5:xt<=.75&&(pt*=2),Je[0]=Math.ceil(Je[0]/pt)*pt,Je[1]=Math.floor(Je[1]/pt)*pt+pt*.5,Je[2]=pt,Je}function Ji(pe,Ie){return d.range.apply(d,Ui(pe,Ie))}var hi={s:1,g:1,p:1,r:1,e:1};function Qn(pe){return-Math.floor(Math.log(pe)/Math.LN10+.01)}function ao(pe,Ie){var Je=Qn(Ie[2]);return pe in hi?Math.abs(Je-Qn(Math.max(l(Ie[0]),l(Ie[1]))))+ +(pe!=="e"):Je-(pe==="%")*2}d.scale.log=function(){return Po(d.scale.linear().domain([0,1]),10,!0,[1,10])};function Po(pe,Ie,Je,ft){function pt(Pt){return(Je?Math.log(Pt<0?0:Pt):-Math.log(Pt>0?0:-Pt))/Math.log(Ie)}function xt(Pt){return Je?Math.pow(Ie,Pt):-Math.pow(Ie,-Pt)}function Jt(Pt){return pe(pt(Pt))}return Jt.invert=function(Pt){return xt(pe.invert(Pt))},Jt.domain=function(Pt){return arguments.length?(Je=Pt[0]>=0,pe.domain((ft=Pt.map(Number)).map(pt)),Jt):ft},Jt.base=function(Pt){return arguments.length?(Ie=+Pt,pe.domain(ft.map(pt)),Jt):Ie},Jt.nice=function(){var Pt=wn(ft.map(pt),Je?Math:is);return pe.domain(Pt),ft=Pt.map(xt),Jt},Jt.ticks=function(){var Pt=Fn(ft),dr=[],Nr=Pt[0],Vr=Pt[1],va=Math.floor(pt(Nr)),sa=Math.ceil(pt(Vr)),qa=Ie%1?2:Ie;if(isFinite(sa-va)){if(Je){for(;va0;Wa--)dr.push(xt(va)*Wa);for(va=0;dr[va]Vr;sa--);dr=dr.slice(va,sa)}return dr},Jt.copy=function(){return Po(pe.copy(),Ie,Je,ft)},Ni(Jt,pe)}var is={floor:function(pe){return-Math.ceil(-pe)},ceil:function(pe){return-Math.floor(-pe)}};d.scale.pow=function(){return Rs(d.scale.linear(),1,[0,1])};function Rs(pe,Ie,Je){var ft=_s(Ie),pt=_s(1/Ie);function xt(Jt){return pe(ft(Jt))}return xt.invert=function(Jt){return pt(pe.invert(Jt))},xt.domain=function(Jt){return arguments.length?(pe.domain((Je=Jt.map(Number)).map(ft)),xt):Je},xt.ticks=function(Jt){return Ji(Je,Jt)},xt.tickFormat=function(Jt,Pt){return d3_scale_linearTickFormat(Je,Jt,Pt)},xt.nice=function(Jt){return xt.domain(Wi(Je,Jt))},xt.exponent=function(Jt){return arguments.length?(ft=_s(Ie=Jt),pt=_s(1/Ie),pe.domain(Je.map(ft)),xt):Ie},xt.copy=function(){return Rs(pe.copy(),Ie,Je)},Ni(xt,pe)}function _s(pe){return function(Ie){return Ie<0?-Math.pow(-Ie,pe):Math.pow(Ie,pe)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return Ps([],{t:"range",a:[[]]})};function Ps(pe,Ie){var Je,ft,pt;function xt(Pt){return ft[((Je.get(Pt)||(Ie.t==="range"?Je.set(Pt,pe.push(Pt)):NaN))-1)%ft.length]}function Jt(Pt,dr){return d.range(pe.length).map(function(Nr){return Pt+dr*Nr})}return xt.domain=function(Pt){if(!arguments.length)return pe;pe=[],Je=new A;for(var dr=-1,Nr=Pt.length,Vr;++dr0?Je[xt-1]:pe[0],xtsa?0:1;if(Vr=He)return dr(Vr,Wa)+(Nr?dr(Nr,1-Wa):"")+"Z";var ya,Ea,Na,tn,Ka=0,wa=0,Jn,Xn,ni,xi,Fi,qi,Lo,Xi,Eo=[];if((tn=(+Jt.apply(this,arguments)||0)/2)&&(Na=ft===tu?Math.sqrt(Nr*Nr+Vr*Vr):+ft.apply(this,arguments),Wa||(wa*=-1),Vr&&(wa=sr(Na/Vr*Math.sin(tn))),Nr&&(Ka=sr(Na/Nr*Math.sin(tn)))),Vr){Jn=Vr*Math.cos(va+wa),Xn=Vr*Math.sin(va+wa),ni=Vr*Math.cos(sa-wa),xi=Vr*Math.sin(sa-wa);var js=Math.abs(sa-va-2*wa)<=ke?0:1;if(wa&&Bu(Jn,Xn,ni,xi)===Wa^js){var Ds=(va+sa)/2;Jn=Vr*Math.cos(Ds),Xn=Vr*Math.sin(Ds),ni=xi=null}}else Jn=Xn=0;if(Nr){Fi=Nr*Math.cos(sa-Ka),qi=Nr*Math.sin(sa-Ka),Lo=Nr*Math.cos(va+Ka),Xi=Nr*Math.sin(va+Ka);var Ks=Math.abs(va-sa+2*Ka)<=ke?0:1;if(Ka&&Bu(Fi,qi,Lo,Xi)===1-Wa^Ks){var oi=(va+sa)/2;Fi=Nr*Math.cos(oi),qi=Nr*Math.sin(oi),Lo=Xi=null}}else Fi=qi=0;if(qa>Ze&&(ya=Math.min(Math.abs(Vr-Nr)/2,+Je.apply(this,arguments)))>.001){Ea=Nr0?0:1}function $i(pe,Ie,Je,ft,pt){var xt=pe[0]-Ie[0],Jt=pe[1]-Ie[1],Pt=(pt?ft:-ft)/Math.sqrt(xt*xt+Jt*Jt),dr=Pt*Jt,Nr=-Pt*xt,Vr=pe[0]+dr,va=pe[1]+Nr,sa=Ie[0]+dr,qa=Ie[1]+Nr,Wa=(Vr+sa)/2,ya=(va+qa)/2,Ea=sa-Vr,Na=qa-va,tn=Ea*Ea+Na*Na,Ka=Je-ft,wa=Vr*qa-sa*va,Jn=(Na<0?-1:1)*Math.sqrt(Math.max(0,Ka*Ka*tn-wa*wa)),Xn=(wa*Na-Ea*Jn)/tn,ni=(-wa*Ea-Na*Jn)/tn,xi=(wa*Na+Ea*Jn)/tn,Fi=(-wa*Ea+Na*Jn)/tn,qi=Xn-Wa,Lo=ni-ya,Xi=xi-Wa,Eo=Fi-ya;return qi*qi+Lo*Lo>Xi*Xi+Eo*Eo&&(Xn=xi,ni=Fi),[[Xn-dr,ni-Nr],[Xn*Je/Ka,ni*Je/Ka]]}function _o(){return!0}function Qu(pe){var Ie=io,Je=vo,ft=_o,pt=gu,xt=pt.key,Jt=.7;function Pt(dr){var Nr=[],Vr=[],va=-1,sa=dr.length,qa,Wa=Ir(Ie),ya=Ir(Je);function Ea(){Nr.push("M",pt(pe(Vr),Jt))}for(;++va1?pe.join("L"):pe+"Z"}function De(pe){return pe.join("L")+"Z"}function I(pe){for(var Ie=0,Je=pe.length,ft=pe[0],pt=[ft[0],",",ft[1]];++Ie1&&pt.push("H",ft[0]),pt.join("")}function ne(pe){for(var Ie=0,Je=pe.length,ft=pe[0],pt=[ft[0],",",ft[1]];++Ie1){Pt=Ie[1],xt=pe[dr],dr++,ft+="C"+(pt[0]+Jt[0])+","+(pt[1]+Jt[1])+","+(xt[0]-Pt[0])+","+(xt[1]-Pt[1])+","+xt[0]+","+xt[1];for(var Nr=2;Nr9&&(xt=Je*3/Math.sqrt(xt),Jt[Pt]=xt*ft,Jt[Pt+1]=xt*pt));for(Pt=-1;++Pt<=dr;)xt=(pe[Math.min(dr,Pt+1)][0]-pe[Math.max(0,Pt-1)][0])/(6*(1+Jt[Pt]*Jt[Pt])),Ie.push([xt||0,Jt[Pt]*xt||0]);return Ie}function nr(pe){return pe.length<3?gu(pe):pe[0]+_t(pe,Ct(pe))}d.svg.line.radial=function(){var pe=Qu(vr);return pe.radius=pe.x,delete pe.x,pe.angle=pe.y,delete pe.y,pe};function vr(pe){for(var Ie,Je=-1,ft=pe.length,pt,xt;++Jeke)+",1 "+va}function Nr(Vr,va,sa,qa){return"Q 0,0 "+qa}return xt.radius=function(Vr){return arguments.length?(Je=Ir(Vr),xt):Je},xt.source=function(Vr){return arguments.length?(pe=Ir(Vr),xt):pe},xt.target=function(Vr){return arguments.length?(Ie=Ir(Vr),xt):Ie},xt.startAngle=function(Vr){return arguments.length?(ft=Ir(Vr),xt):ft},xt.endAngle=function(Vr){return arguments.length?(pt=Ir(Vr),xt):pt},xt};function oa(pe){return pe.radius}d.svg.diagonal=function(){var pe=Fr,Ie=Xr,Je=ga;function ft(pt,xt){var Jt=pe.call(this,pt,xt),Pt=Ie.call(this,pt,xt),dr=(Jt.y+Pt.y)/2,Nr=[Jt,{x:Jt.x,y:dr},{x:Pt.x,y:dr},Pt];return Nr=Nr.map(Je),"M"+Nr[0]+"C"+Nr[1]+" "+Nr[2]+" "+Nr[3]}return ft.source=function(pt){return arguments.length?(pe=Ir(pt),ft):pe},ft.target=function(pt){return arguments.length?(Ie=Ir(pt),ft):Ie},ft.projection=function(pt){return arguments.length?(Je=pt,ft):Je},ft};function ga(pe){return[pe.x,pe.y]}d.svg.diagonal.radial=function(){var pe=d.svg.diagonal(),Ie=ga,Je=pe.projection;return pe.projection=function(ft){return arguments.length?Je(Ma(Ie=ft)):Ie},pe};function Ma(pe){return function(){var Ie=pe.apply(this,arguments),Je=Ie[0],ft=Ie[1]-nt;return[Je*Math.cos(ft),Je*Math.sin(ft)]}}d.svg.symbol=function(){var pe=Dn,Ie=en;function Je(ft,pt){return(Kn.get(pe.call(this,ft,pt))||In)(Ie.call(this,ft,pt))}return Je.type=function(ft){return arguments.length?(pe=Ir(ft),Je):pe},Je.size=function(ft){return arguments.length?(Ie=Ir(ft),Je):Ie},Je};function en(){return 64}function Dn(){return"circle"}function In(pe){var Ie=Math.sqrt(pe/ke);return"M0,"+Ie+"A"+Ie+","+Ie+" 0 1,1 0,"+-Ie+"A"+Ie+","+Ie+" 0 1,1 0,"+Ie+"Z"}var Kn=d.map({circle:In,cross:function(pe){var Ie=Math.sqrt(pe/5)/2;return"M"+-3*Ie+","+-Ie+"H"+-Ie+"V"+-3*Ie+"H"+Ie+"V"+-Ie+"H"+3*Ie+"V"+Ie+"H"+Ie+"V"+3*Ie+"H"+-Ie+"V"+Ie+"H"+-3*Ie+"Z"},diamond:function(pe){var Ie=Math.sqrt(pe/(2*zi)),Je=Ie*zi;return"M0,"+-Ie+"L"+Je+",0 0,"+Ie+" "+-Je+",0Z"},square:function(pe){var Ie=Math.sqrt(pe)/2;return"M"+-Ie+","+-Ie+"L"+Ie+","+-Ie+" "+Ie+","+Ie+" "+-Ie+","+Ie+"Z"},"triangle-down":function(pe){var Ie=Math.sqrt(pe/vi),Je=Ie*vi/2;return"M0,"+Je+"L"+Ie+","+-Je+" "+-Ie+","+-Je+"Z"},"triangle-up":function(pe){var Ie=Math.sqrt(pe/vi),Je=Ie*vi/2;return"M0,"+-Je+"L"+Ie+","+Je+" "+-Ie+","+Je+"Z"}});d.svg.symbolTypes=Kn.keys();var vi=Math.sqrt(3),zi=Math.tan(30*ot);ae.transition=function(pe){for(var Ie=Xo||++Co,Je=Ro(pe),ft=[],pt,xt,Jt=Us||{time:Date.now(),ease:vl,delay:0,duration:250},Pt=-1,dr=this.length;++Pt0;)va[--tn].call(pe,Na);if(Ea>=1)return Jt.event&&Jt.event.end.call(pe,pe.__data__,Ie),--xt.count?delete xt[ft]:delete pe[Je],1}Jt||(Pt=pt.time,dr=yi(sa,0,Pt),Jt=xt[ft]={tween:new A,time:Pt,timer:dr,delay:pt.delay,duration:pt.duration,ease:pt.ease,index:Ie},pt=null,++xt.count)}d.svg.axis=function(){var pe=d.scale.linear(),Ie=Ml,Je=6,ft=6,pt=3,xt=[10],Jt=null,Pt;function dr(Nr){Nr.each(function(){var Vr=d.select(this),va=this.__chart__||pe,sa=this.__chart__=pe.copy(),qa=Jt??(sa.ticks?sa.ticks.apply(sa,xt):sa.domain()),Wa=Pt??(sa.tickFormat?sa.tickFormat.apply(sa,xt):F),ya=Vr.selectAll(".tick").data(qa,sa),Ea=ya.enter().insert("g",".domain").attr("class","tick").style("opacity",Ze),Na=d.transition(ya.exit()).style("opacity",Ze).remove(),tn=d.transition(ya.order()).style("opacity",1),Ka=Math.max(Je,0)+pt,wa,Jn=Gn(sa),Xn=Vr.selectAll(".domain").data([0]),ni=(Xn.enter().append("path").attr("class","domain"),d.transition(Xn));Ea.append("line"),Ea.append("text");var xi=Ea.select("line"),Fi=tn.select("line"),qi=ya.select("text").text(Wa),Lo=Ea.select("text"),Xi=tn.select("text"),Eo=Ie==="top"||Ie==="left"?-1:1,js,Ds,Ks,oi;if(Ie==="bottom"||Ie==="top"?(wa=jl,js="x",Ks="y",Ds="x2",oi="y2",qi.attr("dy",Eo<0?"0em":".71em").style("text-anchor","middle"),ni.attr("d","M"+Jn[0]+","+Eo*ft+"V0H"+Jn[1]+"V"+Eo*ft)):(wa=Qs,js="y",Ks="x",Ds="y2",oi="x2",qi.attr("dy",".32em").style("text-anchor",Eo<0?"end":"start"),ni.attr("d","M"+Eo*ft+","+Jn[0]+"H0V"+Jn[1]+"H"+Eo*ft)),xi.attr(oi,Eo*Je),Lo.attr(Ks,Eo*Ka),Fi.attr(Ds,0).attr(oi,Eo*Je),Xi.attr(js,0).attr(Ks,Eo*Ka),sa.rangeBand){var eo=sa,Ho=eo.rangeBand()/2;va=sa=function(Yo){return eo(Yo)+Ho}}else va.rangeBand?va=sa:Na.call(wa,sa,va);Ea.call(wa,va,sa),tn.call(wa,sa,sa)})}return dr.scale=function(Nr){return arguments.length?(pe=Nr,dr):pe},dr.orient=function(Nr){return arguments.length?(Ie=Nr in ru?Nr+"":Ml,dr):Ie},dr.ticks=function(){return arguments.length?(xt=S(arguments),dr):xt},dr.tickValues=function(Nr){return arguments.length?(Jt=Nr,dr):Jt},dr.tickFormat=function(Nr){return arguments.length?(Pt=Nr,dr):Pt},dr.tickSize=function(Nr){var Vr=arguments.length;return Vr?(Je=+Nr,ft=+arguments[Vr-1],dr):Je},dr.innerTickSize=function(Nr){return arguments.length?(Je=+Nr,dr):Je},dr.outerTickSize=function(Nr){return arguments.length?(ft=+Nr,dr):ft},dr.tickPadding=function(Nr){return arguments.length?(pt=+Nr,dr):pt},dr.tickSubdivide=function(){return arguments.length&&dr},dr};var Ml="bottom",ru={top:1,right:1,bottom:1,left:1};function jl(pe,Ie,Je){pe.attr("transform",function(ft){var pt=Ie(ft);return"translate("+(isFinite(pt)?pt:Je(ft))+",0)"})}function Qs(pe,Ie,Je){pe.attr("transform",function(ft){var pt=Ie(ft);return"translate(0,"+(isFinite(pt)?pt:Je(ft))+")"})}d.svg.brush=function(){var pe=ce(Vr,"brushstart","brush","brushend"),Ie=null,Je=null,ft=[0,0],pt=[0,0],xt,Jt,Pt=!0,dr=!0,Nr=Cu[0];function Vr(ya){ya.each(function(){var Ea=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Wa).on("touchstart.brush",Wa),Na=Ea.selectAll(".background").data([0]);Na.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Ea.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var tn=Ea.selectAll(".resize").data(Nr,F);tn.exit().remove(),tn.enter().append("g").attr("class",function(Xn){return"resize "+Xn}).style("cursor",function(Xn){return Fl[Xn]}).append("rect").attr("x",function(Xn){return/[ew]$/.test(Xn)?-3:null}).attr("y",function(Xn){return/^[ns]/.test(Xn)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),tn.style("display",Vr.empty()?"none":null);var Ka=d.transition(Ea),wa=d.transition(Na),Jn;Ie&&(Jn=Gn(Ie),wa.attr("x",Jn[0]).attr("width",Jn[1]-Jn[0]),sa(Ka)),Je&&(Jn=Gn(Je),wa.attr("y",Jn[0]).attr("height",Jn[1]-Jn[0]),qa(Ka)),va(Ka)})}Vr.event=function(ya){ya.each(function(){var Ea=pe.of(this,arguments),Na={x:ft,y:pt,i:xt,j:Jt},tn=this.__chart__||Na;this.__chart__=Na,Xo?d.select(this).transition().each("start.brush",function(){xt=tn.i,Jt=tn.j,ft=tn.x,pt=tn.y,Ea({type:"brushstart"})}).tween("brush:brush",function(){var Ka=cu(ft,Na.x),wa=cu(pt,Na.y);return xt=Jt=null,function(Jn){ft=Na.x=Ka(Jn),pt=Na.y=wa(Jn),Ea({type:"brush",mode:"resize"})}}).each("end.brush",function(){xt=Na.i,Jt=Na.j,Ea({type:"brush",mode:"resize"}),Ea({type:"brushend"})}):(Ea({type:"brushstart"}),Ea({type:"brush",mode:"resize"}),Ea({type:"brushend"}))})};function va(ya){ya.selectAll(".resize").attr("transform",function(Ea){return"translate("+ft[+/e$/.test(Ea)]+","+pt[+/^s/.test(Ea)]+")"})}function sa(ya){ya.select(".extent").attr("x",ft[0]),ya.selectAll(".extent,.n>rect,.s>rect").attr("width",ft[1]-ft[0])}function qa(ya){ya.select(".extent").attr("y",pt[0]),ya.selectAll(".extent,.e>rect,.w>rect").attr("height",pt[1]-pt[0])}function Wa(){var ya=this,Ea=d.select(d.event.target),Na=pe.of(ya,arguments),tn=d.select(ya),Ka=Ea.datum(),wa=!/^(n|s)$/.test(Ka)&&Ie,Jn=!/^(e|w)$/.test(Ka)&&Je,Xn=Ea.classed("extent"),ni=wr(ya),xi,Fi=d.mouse(ya),qi,Lo=d.select(t(ya)).on("keydown.brush",js).on("keyup.brush",Ds);if(d.event.changedTouches?Lo.on("touchmove.brush",Ks).on("touchend.brush",eo):Lo.on("mousemove.brush",Ks).on("mouseup.brush",eo),tn.interrupt().selectAll("*").interrupt(),Xn)Fi[0]=ft[0]-Fi[0],Fi[1]=pt[0]-Fi[1];else if(Ka){var Xi=+/w$/.test(Ka),Eo=+/^n/.test(Ka);qi=[ft[1-Xi]-Fi[0],pt[1-Eo]-Fi[1]],Fi[0]=ft[Xi],Fi[1]=pt[Eo]}else d.event.altKey&&(xi=Fi.slice());tn.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Ea.style("cursor")),Na({type:"brushstart"}),Ks();function js(){d.event.keyCode==32&&(Xn||(xi=null,Fi[0]-=ft[1],Fi[1]-=pt[1],Xn=2),$())}function Ds(){d.event.keyCode==32&&Xn==2&&(Fi[0]+=ft[1],Fi[1]+=pt[1],Xn=0,$())}function Ks(){var Ho=d.mouse(ya),Yo=!1;qi&&(Ho[0]+=qi[0],Ho[1]+=qi[1]),Xn||(d.event.altKey?(xi||(xi=[(ft[0]+ft[1])/2,(pt[0]+pt[1])/2]),Fi[0]=ft[+(Ho[0]0))return Ut;do Ut.push(br=new Date(+Tt)),Ee(Tt,zt),ie(Tt);while(br=St)for(;ie(St),!Tt(St);)St.setTime(St-1)},function(St,zt){if(St>=St)if(zt<0)for(;++zt<=0;)for(;Ee(St,-1),!Tt(St););else for(;--zt>=0;)for(;Ee(St,1),!Tt(St););})},We&&(Xe.count=function(Tt,St){return x.setTime(+Tt),S.setTime(+St),ie(x),ie(S),Math.floor(We(x,S))},Xe.every=function(Tt){return Tt=Math.floor(Tt),!isFinite(Tt)||!(Tt>0)?null:Tt>1?Xe.filter(Qe?function(St){return Qe(St)%Tt===0}:function(St){return Xe.count(0,St)%Tt===0}):Xe}),Xe}var e=E(function(){},function(ie,Ee){ie.setTime(+ie+Ee)},function(ie,Ee){return Ee-ie});e.every=function(ie){return ie=Math.floor(ie),!isFinite(ie)||!(ie>0)?null:ie>1?E(function(Ee){Ee.setTime(Math.floor(Ee/ie)*ie)},function(Ee,We){Ee.setTime(+Ee+We*ie)},function(Ee,We){return(We-Ee)/ie}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=E(function(ie){ie.setTime(ie-ie.getMilliseconds())},function(ie,Ee){ie.setTime(+ie+Ee*r)},function(ie,Ee){return(Ee-ie)/r},function(ie){return ie.getUTCSeconds()}),h=s.range,f=E(function(ie){ie.setTime(ie-ie.getMilliseconds()-ie.getSeconds()*r)},function(ie,Ee){ie.setTime(+ie+Ee*o)},function(ie,Ee){return(Ee-ie)/o},function(ie){return ie.getMinutes()}),p=f.range,c=E(function(ie){ie.setTime(ie-ie.getMilliseconds()-ie.getSeconds()*r-ie.getMinutes()*o)},function(ie,Ee){ie.setTime(+ie+Ee*a)},function(ie,Ee){return(Ee-ie)/a},function(ie){return ie.getHours()}),T=c.range,l=E(function(ie){ie.setHours(0,0,0,0)},function(ie,Ee){ie.setDate(ie.getDate()+Ee)},function(ie,Ee){return(Ee-ie-(Ee.getTimezoneOffset()-ie.getTimezoneOffset())*o)/i},function(ie){return ie.getDate()-1}),_=l.range;function w(ie){return E(function(Ee){Ee.setDate(Ee.getDate()-(Ee.getDay()+7-ie)%7),Ee.setHours(0,0,0,0)},function(Ee,We){Ee.setDate(Ee.getDate()+We*7)},function(Ee,We){return(We-Ee-(We.getTimezoneOffset()-Ee.getTimezoneOffset())*o)/n})}var A=w(0),M=w(1),g=w(2),b=w(3),v=w(4),u=w(5),y=w(6),m=A.range,R=M.range,L=g.range,z=b.range,F=v.range,N=u.range,O=y.range,P=E(function(ie){ie.setDate(1),ie.setHours(0,0,0,0)},function(ie,Ee){ie.setMonth(ie.getMonth()+Ee)},function(ie,Ee){return Ee.getMonth()-ie.getMonth()+(Ee.getFullYear()-ie.getFullYear())*12},function(ie){return ie.getMonth()}),U=P.range,B=E(function(ie){ie.setMonth(0,1),ie.setHours(0,0,0,0)},function(ie,Ee){ie.setFullYear(ie.getFullYear()+Ee)},function(ie,Ee){return Ee.getFullYear()-ie.getFullYear()},function(ie){return ie.getFullYear()});B.every=function(ie){return!isFinite(ie=Math.floor(ie))||!(ie>0)?null:E(function(Ee){Ee.setFullYear(Math.floor(Ee.getFullYear()/ie)*ie),Ee.setMonth(0,1),Ee.setHours(0,0,0,0)},function(Ee,We){Ee.setFullYear(Ee.getFullYear()+We*ie)})};var X=B.range,$=E(function(ie){ie.setUTCSeconds(0,0)},function(ie,Ee){ie.setTime(+ie+Ee*o)},function(ie,Ee){return(Ee-ie)/o},function(ie){return ie.getUTCMinutes()}),le=$.range,ce=E(function(ie){ie.setUTCMinutes(0,0,0)},function(ie,Ee){ie.setTime(+ie+Ee*a)},function(ie,Ee){return(Ee-ie)/a},function(ie){return ie.getUTCHours()}),ve=ce.range,G=E(function(ie){ie.setUTCHours(0,0,0,0)},function(ie,Ee){ie.setUTCDate(ie.getUTCDate()+Ee)},function(ie,Ee){return(Ee-ie)/i},function(ie){return ie.getUTCDate()-1}),Y=G.range;function ee(ie){return E(function(Ee){Ee.setUTCDate(Ee.getUTCDate()-(Ee.getUTCDay()+7-ie)%7),Ee.setUTCHours(0,0,0,0)},function(Ee,We){Ee.setUTCDate(Ee.getUTCDate()+We*7)},function(Ee,We){return(We-Ee)/n})}var V=ee(0),se=ee(1),ae=ee(2),j=ee(3),Q=ee(4),re=ee(5),he=ee(6),xe=V.range,Te=se.range,Le=ae.range,Pe=j.range,qe=Q.range,et=re.range,rt=he.range,$e=E(function(ie){ie.setUTCDate(1),ie.setUTCHours(0,0,0,0)},function(ie,Ee){ie.setUTCMonth(ie.getUTCMonth()+Ee)},function(ie,Ee){return Ee.getUTCMonth()-ie.getUTCMonth()+(Ee.getUTCFullYear()-ie.getUTCFullYear())*12},function(ie){return ie.getUTCMonth()}),Ue=$e.range,fe=E(function(ie){ie.setUTCMonth(0,1),ie.setUTCHours(0,0,0,0)},function(ie,Ee){ie.setUTCFullYear(ie.getUTCFullYear()+Ee)},function(ie,Ee){return Ee.getUTCFullYear()-ie.getUTCFullYear()},function(ie){return ie.getUTCFullYear()});fe.every=function(ie){return!isFinite(ie=Math.floor(ie))||!(ie>0)?null:E(function(Ee){Ee.setUTCFullYear(Math.floor(Ee.getUTCFullYear()/ie)*ie),Ee.setUTCMonth(0,1),Ee.setUTCHours(0,0,0,0)},function(Ee,We){Ee.setUTCFullYear(Ee.getUTCFullYear()+We*ie)})};var ue=fe.range;d.timeDay=l,d.timeDays=_,d.timeFriday=u,d.timeFridays=N,d.timeHour=c,d.timeHours=T,d.timeInterval=E,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=f,d.timeMinutes=p,d.timeMonday=M,d.timeMondays=R,d.timeMonth=P,d.timeMonths=U,d.timeSaturday=y,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=h,d.timeSunday=A,d.timeSundays=m,d.timeThursday=v,d.timeThursdays=F,d.timeTuesday=g,d.timeTuesdays=L,d.timeWednesday=b,d.timeWednesdays=z,d.timeWeek=A,d.timeWeeks=m,d.timeYear=B,d.timeYears=X,d.utcDay=G,d.utcDays=Y,d.utcFriday=re,d.utcFridays=et,d.utcHour=ce,d.utcHours=ve,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=$,d.utcMinutes=le,d.utcMonday=se,d.utcMondays=Te,d.utcMonth=$e,d.utcMonths=Ue,d.utcSaturday=he,d.utcSaturdays=rt,d.utcSecond=s,d.utcSeconds=h,d.utcSunday=V,d.utcSundays=xe,d.utcThursday=Q,d.utcThursdays=qe,d.utcTuesday=ae,d.utcTuesdays=Le,d.utcWednesday=j,d.utcWednesdays=Pe,d.utcWeek=V,d.utcWeeks=xe,d.utcYear=fe,d.utcYears=ue,Object.defineProperty(d,"__esModule",{value:!0})})}}),E0=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,wp()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function S(ze){if(0<=ze.y&&ze.y<100){var Ze=new Date(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L);return Ze.setFullYear(ze.y),Ze}return new Date(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L)}function E(ze){if(0<=ze.y&&ze.y<100){var Ze=new Date(Date.UTC(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L));return Ze.setUTCFullYear(ze.y),Ze}return new Date(Date.UTC(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L))}function e(ze,Ze,we){return{y:ze,m:Ze,d:we,H:0,M:0,S:0,L:0}}function t(ze){var Ze=ze.dateTime,we=ze.date,ke=ze.time,Be=ze.periods,He=ze.days,nt=ze.shortDays,ot=ze.months,Ft=ze.shortMonths,Mt=h(Be),Et=f(Be),Ot=h(He),sr=f(He),ir=h(nt),ar=f(nt),Mr=h(ot),ma=f(ot),Ca=h(Ft),Aa=f(Ft),Da={a:Ga,A:Ua,b:Xa,B:an,c:null,d:P,e:P,f:le,H:U,I:B,j:X,L:$,m:ce,M:ve,p:Sa,q:Zn,Q:St,s:zt,S:G,u:Y,U:ee,V,w:se,W:ae,x:null,X:null,y:j,Y:Q,Z:re,"%":Tt},Ba={a:Wn,A:ti,b:gt,B:it,c:null,d:he,e:he,f:qe,H:xe,I:Te,j:Le,L:Pe,m:et,M:rt,p:Rr,q:Ar,Q:St,s:zt,S:$e,u:Ue,U:fe,V:ue,w:ie,W:Ee,x:null,X:null,y:We,Y:Qe,Z:Xe,"%":Tt},ba={a:Ht,A:Xt,b:Pr,B:Yr,c:Kr,d:v,e:v,f:z,H:y,I:y,j:u,L,m:b,M:m,p:Lt,q:g,Q:N,s:O,S:R,u:c,U:T,V:l,w:p,W:_,x:na,X:La,y:A,Y:w,Z:M,"%":F};Da.x=rn(we,Da),Da.X=rn(ke,Da),Da.c=rn(Ze,Da),Ba.x=rn(we,Ba),Ba.X=rn(ke,Ba),Ba.c=rn(Ze,Ba);function rn(pr,kr){return function(zr){var Ur=[],dt=-1,qt=0,fr=pr.length,Ir,da,Ta;for(zr instanceof Date||(zr=new Date(+zr));++dt53)return null;"w"in Ur||(Ur.w=1),"Z"in Ur?(qt=E(e(Ur.y,0,1)),fr=qt.getUTCDay(),qt=fr>4||fr===0?x.utcMonday.ceil(qt):x.utcMonday(qt),qt=x.utcDay.offset(qt,(Ur.V-1)*7),Ur.y=qt.getUTCFullYear(),Ur.m=qt.getUTCMonth(),Ur.d=qt.getUTCDate()+(Ur.w+6)%7):(qt=S(e(Ur.y,0,1)),fr=qt.getDay(),qt=fr>4||fr===0?x.timeMonday.ceil(qt):x.timeMonday(qt),qt=x.timeDay.offset(qt,(Ur.V-1)*7),Ur.y=qt.getFullYear(),Ur.m=qt.getMonth(),Ur.d=qt.getDate()+(Ur.w+6)%7)}else("W"in Ur||"U"in Ur)&&("w"in Ur||(Ur.w="u"in Ur?Ur.u%7:"W"in Ur?1:0),fr="Z"in Ur?E(e(Ur.y,0,1)).getUTCDay():S(e(Ur.y,0,1)).getDay(),Ur.m=0,Ur.d="W"in Ur?(Ur.w+6)%7+Ur.W*7-(fr+5)%7:Ur.w+Ur.U*7-(fr+6)%7);return"Z"in Ur?(Ur.H+=Ur.Z/100|0,Ur.M+=Ur.Z%100,E(Ur)):S(Ur)}}function Wt(pr,kr,zr,Ur){for(var dt=0,qt=kr.length,fr=zr.length,Ir,da;dt=fr)return-1;if(Ir=kr.charCodeAt(dt++),Ir===37){if(Ir=kr.charAt(dt++),da=ba[Ir in r?kr.charAt(dt++):Ir],!da||(Ur=da(pr,zr,Ur))<0)return-1}else if(Ir!=zr.charCodeAt(Ur++))return-1}return Ur}function Lt(pr,kr,zr){var Ur=Mt.exec(kr.slice(zr));return Ur?(pr.p=Et[Ur[0].toLowerCase()],zr+Ur[0].length):-1}function Ht(pr,kr,zr){var Ur=ir.exec(kr.slice(zr));return Ur?(pr.w=ar[Ur[0].toLowerCase()],zr+Ur[0].length):-1}function Xt(pr,kr,zr){var Ur=Ot.exec(kr.slice(zr));return Ur?(pr.w=sr[Ur[0].toLowerCase()],zr+Ur[0].length):-1}function Pr(pr,kr,zr){var Ur=Ca.exec(kr.slice(zr));return Ur?(pr.m=Aa[Ur[0].toLowerCase()],zr+Ur[0].length):-1}function Yr(pr,kr,zr){var Ur=Mr.exec(kr.slice(zr));return Ur?(pr.m=ma[Ur[0].toLowerCase()],zr+Ur[0].length):-1}function Kr(pr,kr,zr){return Wt(pr,Ze,kr,zr)}function na(pr,kr,zr){return Wt(pr,we,kr,zr)}function La(pr,kr,zr){return Wt(pr,ke,kr,zr)}function Ga(pr){return nt[pr.getDay()]}function Ua(pr){return He[pr.getDay()]}function Xa(pr){return Ft[pr.getMonth()]}function an(pr){return ot[pr.getMonth()]}function Sa(pr){return Be[+(pr.getHours()>=12)]}function Zn(pr){return 1+~~(pr.getMonth()/3)}function Wn(pr){return nt[pr.getUTCDay()]}function ti(pr){return He[pr.getUTCDay()]}function gt(pr){return Ft[pr.getUTCMonth()]}function it(pr){return ot[pr.getUTCMonth()]}function Rr(pr){return Be[+(pr.getUTCHours()>=12)]}function Ar(pr){return 1+~~(pr.getUTCMonth()/3)}return{format:function(pr){var kr=rn(pr+="",Da);return kr.toString=function(){return pr},kr},parse:function(pr){var kr=vn(pr+="",!1);return kr.toString=function(){return pr},kr},utcFormat:function(pr){var kr=rn(pr+="",Ba);return kr.toString=function(){return pr},kr},utcParse:function(pr){var kr=vn(pr+="",!0);return kr.toString=function(){return pr},kr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(ze,Ze,we){var ke=ze<0?"-":"",Be=(ke?-ze:ze)+"",He=Be.length;return ke+(He68?1900:2e3),we+ke[0].length):-1}function M(ze,Ze,we){var ke=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ze.slice(we,we+6));return ke?(ze.Z=ke[1]?0:-(ke[2]+(ke[3]||"00")),we+ke[0].length):-1}function g(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+1));return ke?(ze.q=ke[0]*3-3,we+ke[0].length):-1}function b(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+2));return ke?(ze.m=ke[0]-1,we+ke[0].length):-1}function v(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+2));return ke?(ze.d=+ke[0],we+ke[0].length):-1}function u(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+3));return ke?(ze.m=0,ze.d=+ke[0],we+ke[0].length):-1}function y(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+2));return ke?(ze.H=+ke[0],we+ke[0].length):-1}function m(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+2));return ke?(ze.M=+ke[0],we+ke[0].length):-1}function R(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+2));return ke?(ze.S=+ke[0],we+ke[0].length):-1}function L(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+3));return ke?(ze.L=+ke[0],we+ke[0].length):-1}function z(ze,Ze,we){var ke=o.exec(Ze.slice(we,we+6));return ke?(ze.L=Math.floor(ke[0]/1e3),we+ke[0].length):-1}function F(ze,Ze,we){var ke=a.exec(Ze.slice(we,we+1));return ke?we+ke[0].length:-1}function N(ze,Ze,we){var ke=o.exec(Ze.slice(we));return ke?(ze.Q=+ke[0],we+ke[0].length):-1}function O(ze,Ze,we){var ke=o.exec(Ze.slice(we));return ke?(ze.s=+ke[0],we+ke[0].length):-1}function P(ze,Ze){return n(ze.getDate(),Ze,2)}function U(ze,Ze){return n(ze.getHours(),Ze,2)}function B(ze,Ze){return n(ze.getHours()%12||12,Ze,2)}function X(ze,Ze){return n(1+x.timeDay.count(x.timeYear(ze),ze),Ze,3)}function $(ze,Ze){return n(ze.getMilliseconds(),Ze,3)}function le(ze,Ze){return $(ze,Ze)+"000"}function ce(ze,Ze){return n(ze.getMonth()+1,Ze,2)}function ve(ze,Ze){return n(ze.getMinutes(),Ze,2)}function G(ze,Ze){return n(ze.getSeconds(),Ze,2)}function Y(ze){var Ze=ze.getDay();return Ze===0?7:Ze}function ee(ze,Ze){return n(x.timeSunday.count(x.timeYear(ze)-1,ze),Ze,2)}function V(ze,Ze){var we=ze.getDay();return ze=we>=4||we===0?x.timeThursday(ze):x.timeThursday.ceil(ze),n(x.timeThursday.count(x.timeYear(ze),ze)+(x.timeYear(ze).getDay()===4),Ze,2)}function se(ze){return ze.getDay()}function ae(ze,Ze){return n(x.timeMonday.count(x.timeYear(ze)-1,ze),Ze,2)}function j(ze,Ze){return n(ze.getFullYear()%100,Ze,2)}function Q(ze,Ze){return n(ze.getFullYear()%1e4,Ze,4)}function re(ze){var Ze=ze.getTimezoneOffset();return(Ze>0?"-":(Ze*=-1,"+"))+n(Ze/60|0,"0",2)+n(Ze%60,"0",2)}function he(ze,Ze){return n(ze.getUTCDate(),Ze,2)}function xe(ze,Ze){return n(ze.getUTCHours(),Ze,2)}function Te(ze,Ze){return n(ze.getUTCHours()%12||12,Ze,2)}function Le(ze,Ze){return n(1+x.utcDay.count(x.utcYear(ze),ze),Ze,3)}function Pe(ze,Ze){return n(ze.getUTCMilliseconds(),Ze,3)}function qe(ze,Ze){return Pe(ze,Ze)+"000"}function et(ze,Ze){return n(ze.getUTCMonth()+1,Ze,2)}function rt(ze,Ze){return n(ze.getUTCMinutes(),Ze,2)}function $e(ze,Ze){return n(ze.getUTCSeconds(),Ze,2)}function Ue(ze){var Ze=ze.getUTCDay();return Ze===0?7:Ze}function fe(ze,Ze){return n(x.utcSunday.count(x.utcYear(ze)-1,ze),Ze,2)}function ue(ze,Ze){var we=ze.getUTCDay();return ze=we>=4||we===0?x.utcThursday(ze):x.utcThursday.ceil(ze),n(x.utcThursday.count(x.utcYear(ze),ze)+(x.utcYear(ze).getUTCDay()===4),Ze,2)}function ie(ze){return ze.getUTCDay()}function Ee(ze,Ze){return n(x.utcMonday.count(x.utcYear(ze)-1,ze),Ze,2)}function We(ze,Ze){return n(ze.getUTCFullYear()%100,Ze,2)}function Qe(ze,Ze){return n(ze.getUTCFullYear()%1e4,Ze,4)}function Xe(){return"+0000"}function Tt(){return"%"}function St(ze){return+ze}function zt(ze){return Math.floor(+ze/1e3)}var Ut;br({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function br(ze){return Ut=t(ze),d.timeFormat=Ut.format,d.timeParse=Ut.parse,d.utcFormat=Ut.utcFormat,d.utcParse=Ut.utcParse,Ut}var hr="%Y-%m-%dT%H:%M:%S.%LZ";function Or(ze){return ze.toISOString()}var wr=Date.prototype.toISOString?Or:d.utcFormat(hr);function Er(ze){var Ze=new Date(ze);return isNaN(Ze)?null:Ze}var mt=+new Date("2000-01-01T00:00:00.000Z")?Er:d.utcParse(hr);d.isoFormat=wr,d.isoParse=mt,d.timeFormatDefaultLocale=br,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),Jx=Ge({"node_modules/d3-format/dist/d3-format.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){return Math.abs(b=Math.round(b))>=1e21?b.toLocaleString("en").replace(/,/g,""):b.toString(10)}function S(b,v){if((u=(b=v?b.toExponential(v-1):b.toExponential()).indexOf("e"))<0)return null;var u,y=b.slice(0,u);return[y.length>1?y[0]+y.slice(2):y,+b.slice(u+1)]}function E(b){return b=S(Math.abs(b)),b?b[1]:NaN}function e(b,v){return function(u,y){for(var m=u.length,R=[],L=0,z=b[0],F=0;m>0&&z>0&&(F+z+1>y&&(z=Math.max(1,y-F)),R.push(u.substring(m-=z,m+z)),!((F+=z+1)>y));)z=b[L=(L+1)%b.length];return R.reverse().join(v)}}function t(b){return function(v){return v.replace(/[0-9]/g,function(u){return b[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(b){if(!(v=r.exec(b)))throw new Error("invalid format: "+b);var v;return new a({fill:v[1],align:v[2],sign:v[3],symbol:v[4],zero:v[5],width:v[6],comma:v[7],precision:v[8]&&v[8].slice(1),trim:v[9],type:v[10]})}o.prototype=a.prototype;function a(b){this.fill=b.fill===void 0?" ":b.fill+"",this.align=b.align===void 0?">":b.align+"",this.sign=b.sign===void 0?"-":b.sign+"",this.symbol=b.symbol===void 0?"":b.symbol+"",this.zero=!!b.zero,this.width=b.width===void 0?void 0:+b.width,this.comma=!!b.comma,this.precision=b.precision===void 0?void 0:+b.precision,this.trim=!!b.trim,this.type=b.type===void 0?"":b.type+""}a.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 i(b){e:for(var v=b.length,u=1,y=-1,m;u0&&(y=0);break}return y>0?b.slice(0,y)+b.slice(m+1):b}var n;function s(b,v){var u=S(b,v);if(!u)return b+"";var y=u[0],m=u[1],R=m-(n=Math.max(-8,Math.min(8,Math.floor(m/3)))*3)+1,L=y.length;return R===L?y:R>L?y+new Array(R-L+1).join("0"):R>0?y.slice(0,R)+"."+y.slice(R):"0."+new Array(1-R).join("0")+S(b,Math.max(0,v+R-1))[0]}function h(b,v){var u=S(b,v);if(!u)return b+"";var y=u[0],m=u[1];return m<0?"0."+new Array(-m).join("0")+y:y.length>m+1?y.slice(0,m+1)+"."+y.slice(m+1):y+new Array(m-y.length+2).join("0")}var f={"%":function(b,v){return(b*100).toFixed(v)},b:function(b){return Math.round(b).toString(2)},c:function(b){return b+""},d:x,e:function(b,v){return b.toExponential(v)},f:function(b,v){return b.toFixed(v)},g:function(b,v){return b.toPrecision(v)},o:function(b){return Math.round(b).toString(8)},p:function(b,v){return h(b*100,v)},r:h,s,X:function(b){return Math.round(b).toString(16).toUpperCase()},x:function(b){return Math.round(b).toString(16)}};function p(b){return b}var c=Array.prototype.map,T=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function l(b){var v=b.grouping===void 0||b.thousands===void 0?p:e(c.call(b.grouping,Number),b.thousands+""),u=b.currency===void 0?"":b.currency[0]+"",y=b.currency===void 0?"":b.currency[1]+"",m=b.decimal===void 0?".":b.decimal+"",R=b.numerals===void 0?p:t(c.call(b.numerals,String)),L=b.percent===void 0?"%":b.percent+"",z=b.minus===void 0?"-":b.minus+"",F=b.nan===void 0?"NaN":b.nan+"";function N(P){P=o(P);var U=P.fill,B=P.align,X=P.sign,$=P.symbol,le=P.zero,ce=P.width,ve=P.comma,G=P.precision,Y=P.trim,ee=P.type;ee==="n"?(ve=!0,ee="g"):f[ee]||(G===void 0&&(G=12),Y=!0,ee="g"),(le||U==="0"&&B==="=")&&(le=!0,U="0",B="=");var V=$==="$"?u:$==="#"&&/[boxX]/.test(ee)?"0"+ee.toLowerCase():"",se=$==="$"?y:/[%p]/.test(ee)?L:"",ae=f[ee],j=/[defgprs%]/.test(ee);G=G===void 0?6:/[gprs]/.test(ee)?Math.max(1,Math.min(21,G)):Math.max(0,Math.min(20,G));function Q(re){var he=V,xe=se,Te,Le,Pe;if(ee==="c")xe=ae(re)+xe,re="";else{re=+re;var qe=re<0||1/re<0;if(re=isNaN(re)?F:ae(Math.abs(re),G),Y&&(re=i(re)),qe&&+re==0&&X!=="+"&&(qe=!1),he=(qe?X==="("?X:z:X==="-"||X==="("?"":X)+he,xe=(ee==="s"?T[8+n/3]:"")+xe+(qe&&X==="("?")":""),j){for(Te=-1,Le=re.length;++TePe||Pe>57){xe=(Pe===46?m+re.slice(Te+1):re.slice(Te))+xe,re=re.slice(0,Te);break}}}ve&&!le&&(re=v(re,1/0));var et=he.length+re.length+xe.length,rt=et>1)+he+re+xe+rt.slice(et);break;default:re=rt+he+re+xe;break}return R(re)}return Q.toString=function(){return P+""},Q}function O(P,U){var B=N((P=o(P),P.type="f",P)),X=Math.max(-8,Math.min(8,Math.floor(E(U)/3)))*3,$=Math.pow(10,-X),le=T[8+X/3];return function(ce){return B($*ce)+le}}return{format:N,formatPrefix:O}}var _;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(b){return _=l(b),d.format=_.format,d.formatPrefix=_.formatPrefix,_}function A(b){return Math.max(0,-E(Math.abs(b)))}function M(b,v){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(v)/3)))*3-E(Math.abs(b)))}function g(b,v){return b=Math.abs(b),v=Math.abs(v)-b,Math.max(0,E(v)-E(b))+1}d.FormatSpecifier=a,d.formatDefaultLocale=w,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=A,d.precisionPrefix=M,d.precisionRound=g,Object.defineProperty(d,"__esModule",{value:!0})})}}),$5=Ge({"node_modules/is-string-blank/index.js"(Z,q){"use strict";q.exports=function(d){for(var x=d.length,S,E=0;E13)&&S!==32&&S!==133&&S!==160&&S!==5760&&S!==6158&&(S<8192||S>8205)&&S!==8232&&S!==8233&&S!==8239&&S!==8287&&S!==8288&&S!==12288&&S!==65279)return!1;return!0}}}),Bo=Ge({"node_modules/fast-isnumeric/index.js"(Z,q){"use strict";var d=$5();q.exports=function(x){var S=typeof x;if(S==="string"){var E=x;if(x=+x,x===0&&d(E))return!1}else if(S!=="number")return!1;return x-x<1}}}),As=Ge({"src/constants/numerical.js"(Z,q){"use strict";q.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),$x=Ge({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Z,function(d){"use strict";for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,h,f,p;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var c=new ArrayBuffer(o),T=new Uint8Array(c);for(i=0;i>4,T[n++]=(h&15)<<4|f>>2,T[n++]=(f&3)<<6|p&63;return c};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),$v=Ge({"src/lib/is_plain_object.js"(Z,q){"use strict";q.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),nh=Ge({"src/lib/array.js"(Z){"use strict";var q=$x().decode,d=$v(),x=Array.isArray,S=ArrayBuffer,E=DataView;function e(s){return S.isView(s)&&!(s instanceof E)}Z.isTypedArray=e;function t(s){return x(s)||e(s)}Z.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Z.isArray1D=r,Z.ensureArray=function(s,h){return x(s)||(s=[]),s.length=h,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Z.isArrayBuffer=a,Z.decodeTypedArraySpec=function(s){var h=[],f=i(s),p=f.dtype,c=o[p];if(!c)throw new Error('Error in dtype: "'+p+'"');var T=c.BYTES_PER_ELEMENT,l=f.bdata;a(l)||(l=q(l));var _=f.shape===void 0?[l.byteLength/T]:(""+f.shape).split(",");_.reverse();var w=_.length,A,M,g=+_[0],b=T*g,v=0;if(w===1)h=new c(l);else if(w===2)for(A=+_[1],M=0;M2)return c[A]=c[A]|e,_.set(w,null);if(l){for(h=A;h0)return Math.log(S)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),tA=Ge({"src/lib/relink_private.js"(Z,q){"use strict";var d=nh().isArrayOrTypedArray,x=$v();q.exports=function S(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iE/2?S-Math.round(S/E)*E:S}q.exports={mod:d,modHalf:x}}}),Ef=Ge({"node_modules/tinycolor2/tinycolor.js"(Z,q){(function(d){var x=/^\s+/,S=/\s+$/,E=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(j,Q){if(j=j||"",Q=Q||{},j instanceof a)return j;if(!(this instanceof a))return new a(j,Q);var re=i(j);this._originalInput=j,this._r=re.r,this._g=re.g,this._b=re.b,this._a=re.a,this._roundA=e(100*this._a)/100,this._format=Q.format||re.format,this._gradientType=Q.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=re.ok,this._tc_id=E++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var j=this.toRgb();return(j.r*299+j.g*587+j.b*114)/1e3},getLuminance:function(){var j=this.toRgb(),Q,re,he,xe,Te,Le;return Q=j.r/255,re=j.g/255,he=j.b/255,Q<=.03928?xe=Q/12.92:xe=d.pow((Q+.055)/1.055,2.4),re<=.03928?Te=re/12.92:Te=d.pow((re+.055)/1.055,2.4),he<=.03928?Le=he/12.92:Le=d.pow((he+.055)/1.055,2.4),.2126*xe+.7152*Te+.0722*Le},setAlpha:function(j){return this._a=P(j),this._roundA=e(100*this._a)/100,this},toHsv:function(){var j=f(this._r,this._g,this._b);return{h:j.h*360,s:j.s,v:j.v,a:this._a}},toHsvString:function(){var j=f(this._r,this._g,this._b),Q=e(j.h*360),re=e(j.s*100),he=e(j.v*100);return this._a==1?"hsv("+Q+", "+re+"%, "+he+"%)":"hsva("+Q+", "+re+"%, "+he+"%, "+this._roundA+")"},toHsl:function(){var j=s(this._r,this._g,this._b);return{h:j.h*360,s:j.s,l:j.l,a:this._a}},toHslString:function(){var j=s(this._r,this._g,this._b),Q=e(j.h*360),re=e(j.s*100),he=e(j.l*100);return this._a==1?"hsl("+Q+", "+re+"%, "+he+"%)":"hsla("+Q+", "+re+"%, "+he+"%, "+this._roundA+")"},toHex:function(j){return c(this._r,this._g,this._b,j)},toHexString:function(j){return"#"+this.toHex(j)},toHex8:function(j){return T(this._r,this._g,this._b,this._a,j)},toHex8String:function(j){return"#"+this.toHex8(j)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(U(this._r,255)*100)+"%",g:e(U(this._g,255)*100)+"%",b:e(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%)":"rgba("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(j){var Q="#"+l(this._r,this._g,this._b,this._a),re=Q,he=this._gradientType?"GradientType = 1, ":"";if(j){var xe=a(j);re="#"+l(xe._r,xe._g,xe._b,xe._a)}return"progid:DXImageTransform.Microsoft.gradient("+he+"startColorstr="+Q+",endColorstr="+re+")"},toString:function(j){var Q=!!j;j=j||this._format;var re=!1,he=this._a<1&&this._a>=0,xe=!Q&&he&&(j==="hex"||j==="hex6"||j==="hex3"||j==="hex4"||j==="hex8"||j==="name");return xe?j==="name"&&this._a===0?this.toName():this.toRgbString():(j==="rgb"&&(re=this.toRgbString()),j==="prgb"&&(re=this.toPercentageRgbString()),(j==="hex"||j==="hex6")&&(re=this.toHexString()),j==="hex3"&&(re=this.toHexString(!0)),j==="hex4"&&(re=this.toHex8String(!0)),j==="hex8"&&(re=this.toHex8String()),j==="name"&&(re=this.toName()),j==="hsl"&&(re=this.toHslString()),j==="hsv"&&(re=this.toHsvString()),re||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(j,Q){var re=j.apply(null,[this].concat([].slice.call(Q)));return this._r=re._r,this._g=re._g,this._b=re._b,this.setAlpha(re._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(j,Q){return j.apply(null,[this].concat([].slice.call(Q)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(y,arguments)},tetrad:function(){return this._applyCombination(m,arguments)}},a.fromRatio=function(j,Q){if(typeof j=="object"){var re={};for(var he in j)j.hasOwnProperty(he)&&(he==="a"?re[he]=j[he]:re[he]=ve(j[he]));j=re}return a(j,Q)};function i(j){var Q={r:0,g:0,b:0},re=1,he=null,xe=null,Te=null,Le=!1,Pe=!1;return typeof j=="string"&&(j=se(j)),typeof j=="object"&&(V(j.r)&&V(j.g)&&V(j.b)?(Q=n(j.r,j.g,j.b),Le=!0,Pe=String(j.r).substr(-1)==="%"?"prgb":"rgb"):V(j.h)&&V(j.s)&&V(j.v)?(he=ve(j.s),xe=ve(j.v),Q=p(j.h,he,xe),Le=!0,Pe="hsv"):V(j.h)&&V(j.s)&&V(j.l)&&(he=ve(j.s),Te=ve(j.l),Q=h(j.h,he,Te),Le=!0,Pe="hsl"),j.hasOwnProperty("a")&&(re=j.a)),re=P(re),{ok:Le,format:j.format||Pe,r:t(255,r(Q.r,0)),g:t(255,r(Q.g,0)),b:t(255,r(Q.b,0)),a:re}}function n(j,Q,re){return{r:U(j,255)*255,g:U(Q,255)*255,b:U(re,255)*255}}function s(j,Q,re){j=U(j,255),Q=U(Q,255),re=U(re,255);var he=r(j,Q,re),xe=t(j,Q,re),Te,Le,Pe=(he+xe)/2;if(he==xe)Te=Le=0;else{var qe=he-xe;switch(Le=Pe>.5?qe/(2-he-xe):qe/(he+xe),he){case j:Te=(Q-re)/qe+(Q1&&($e-=1),$e<1/6?et+(rt-et)*6*$e:$e<1/2?rt:$e<2/3?et+(rt-et)*(2/3-$e)*6:et}if(Q===0)he=xe=Te=re;else{var Pe=re<.5?re*(1+Q):re+Q-re*Q,qe=2*re-Pe;he=Le(qe,Pe,j+1/3),xe=Le(qe,Pe,j),Te=Le(qe,Pe,j-1/3)}return{r:he*255,g:xe*255,b:Te*255}}function f(j,Q,re){j=U(j,255),Q=U(Q,255),re=U(re,255);var he=r(j,Q,re),xe=t(j,Q,re),Te,Le,Pe=he,qe=he-xe;if(Le=he===0?0:qe/he,he==xe)Te=0;else{switch(he){case j:Te=(Q-re)/qe+(Q>1)+720)%360;--Q;)he.h=(he.h+xe)%360,Te.push(a(he));return Te}function z(j,Q){Q=Q||6;for(var re=a(j).toHsv(),he=re.h,xe=re.s,Te=re.v,Le=[],Pe=1/Q;Q--;)Le.push(a({h:he,s:xe,v:Te})),Te=(Te+Pe)%1;return Le}a.mix=function(j,Q,re){re=re===0?0:re||50;var he=a(j).toRgb(),xe=a(Q).toRgb(),Te=re/100,Le={r:(xe.r-he.r)*Te+he.r,g:(xe.g-he.g)*Te+he.g,b:(xe.b-he.b)*Te+he.b,a:(xe.a-he.a)*Te+he.a};return a(Le)},a.readability=function(j,Q){var re=a(j),he=a(Q);return(d.max(re.getLuminance(),he.getLuminance())+.05)/(d.min(re.getLuminance(),he.getLuminance())+.05)},a.isReadable=function(j,Q,re){var he=a.readability(j,Q),xe,Te;switch(Te=!1,xe=ae(re),xe.level+xe.size){case"AAsmall":case"AAAlarge":Te=he>=4.5;break;case"AAlarge":Te=he>=3;break;case"AAAsmall":Te=he>=7;break}return Te},a.mostReadable=function(j,Q,re){var he=null,xe=0,Te,Le,Pe,qe;re=re||{},Le=re.includeFallbackColors,Pe=re.level,qe=re.size;for(var et=0;etxe&&(xe=Te,he=a(Q[et]));return a.isReadable(j,he,{level:Pe,size:qe})||!Le?he:(re.includeFallbackColors=!1,a.mostReadable(j,["#fff","#000"],re))};var F=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=a.hexNames=O(F);function O(j){var Q={};for(var re in j)j.hasOwnProperty(re)&&(Q[j[re]]=re);return Q}function P(j){return j=parseFloat(j),(isNaN(j)||j<0||j>1)&&(j=1),j}function U(j,Q){$(j)&&(j="100%");var re=le(j);return j=t(Q,r(0,parseFloat(j))),re&&(j=parseInt(j*Q,10)/100),d.abs(j-Q)<1e-6?1:j%Q/parseFloat(Q)}function B(j){return t(1,r(0,j))}function X(j){return parseInt(j,16)}function $(j){return typeof j=="string"&&j.indexOf(".")!=-1&&parseFloat(j)===1}function le(j){return typeof j=="string"&&j.indexOf("%")!=-1}function ce(j){return j.length==1?"0"+j:""+j}function ve(j){return j<=1&&(j=j*100+"%"),j}function G(j){return d.round(parseFloat(j)*255).toString(16)}function Y(j){return X(j)/255}var ee=(function(){var j="[-\\+]?\\d+%?",Q="[-\\+]?\\d*\\.\\d+%?",re="(?:"+Q+")|(?:"+j+")",he="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",xe="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?";return{CSS_UNIT:new RegExp(re),rgb:new RegExp("rgb"+he),rgba:new RegExp("rgba"+xe),hsl:new RegExp("hsl"+he),hsla:new RegExp("hsla"+xe),hsv:new RegExp("hsv"+he),hsva:new RegExp("hsva"+xe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function V(j){return!!ee.CSS_UNIT.exec(j)}function se(j){j=j.replace(x,"").replace(S,"").toLowerCase();var Q=!1;if(F[j])j=F[j],Q=!0;else if(j=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var re;return(re=ee.rgb.exec(j))?{r:re[1],g:re[2],b:re[3]}:(re=ee.rgba.exec(j))?{r:re[1],g:re[2],b:re[3],a:re[4]}:(re=ee.hsl.exec(j))?{h:re[1],s:re[2],l:re[3]}:(re=ee.hsla.exec(j))?{h:re[1],s:re[2],l:re[3],a:re[4]}:(re=ee.hsv.exec(j))?{h:re[1],s:re[2],v:re[3]}:(re=ee.hsva.exec(j))?{h:re[1],s:re[2],v:re[3],a:re[4]}:(re=ee.hex8.exec(j))?{r:X(re[1]),g:X(re[2]),b:X(re[3]),a:Y(re[4]),format:Q?"name":"hex8"}:(re=ee.hex6.exec(j))?{r:X(re[1]),g:X(re[2]),b:X(re[3]),format:Q?"name":"hex"}:(re=ee.hex4.exec(j))?{r:X(re[1]+""+re[1]),g:X(re[2]+""+re[2]),b:X(re[3]+""+re[3]),a:Y(re[4]+""+re[4]),format:Q?"name":"hex8"}:(re=ee.hex3.exec(j))?{r:X(re[1]+""+re[1]),g:X(re[2]+""+re[2]),b:X(re[3]+""+re[3]),format:Q?"name":"hex"}:!1}function ae(j){var Q,re;return j=j||{level:"AA",size:"small"},Q=(j.level||"AA").toUpperCase(),re=(j.size||"small").toLowerCase(),Q!=="AA"&&Q!=="AAA"&&(Q="AA"),re!=="small"&&re!=="large"&&(re="small"),{level:Q,size:re}}typeof q<"u"&&q.exports?q.exports=a:window.tinycolor=a})(Math)}}),Do=Ge({"src/lib/extend.js"(Z){"use strict";var q=$v(),d=Array.isArray;function x(E,e){var t,r;for(t=0;t=0)))return a;if(f===3)s[f]>1&&(s[f]=1);else if(s[f]>=1)return a}var p=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return h?"rgba("+p+", "+s[3]+")":"rgb("+p+")"}}}),Ed=Ge({"src/constants/interactions.js"(Z,q){"use strict";q.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),L0=Ge({"src/lib/regex.js"(Z){"use strict";Z.counter=function(q,d,x,S){var E=(d||"")+(x?"":"$"),e=S===!1?"":"^";return q==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+q+"([2-9]|[1-9][0-9]+)?"+E)}}}),rA=Ge({"src/lib/coerce.js"(Z){"use strict";var q=Bo(),d=Ef(),x=Do().extendFlat,S=Cl(),E=Tp(),e=Bi(),t=Ed().DESELECTDIM,r=Bm(),o=L0().counter,a=k0().modHalf,i=nh().isArrayOrTypedArray,n=nh().isTypedArraySpec,s=nh().decodeTypedArraySpec;Z.valObjectMeta={data_array:{coerceFunction:function(f,p,c){p.set(i(f)?f:n(f)?s(f):c)}},enumerated:{coerceFunction:function(f,p,c,T){T.coerceNumber&&(f=+f),T.values.indexOf(f)===-1?p.set(c):p.set(f)},validateFunction:function(f,p){p.coerceNumber&&(f=+f);for(var c=p.values,T=0;T_===!0||_===!1;l(f)||T.arrayOk&&Array.isArray(f)&&f.length>0&&f.every(l)?p.set(f):p.set(c)}},number:{coerceFunction:function(f,p,c,T){n(f)&&(f=s(f)),!q(f)||T.min!==void 0&&fT.max?p.set(c):p.set(+f)}},integer:{coerceFunction:function(f,p,c,T){if((T.extras||[]).indexOf(f)!==-1){p.set(f);return}n(f)&&(f=s(f)),f%1||!q(f)||T.min!==void 0&&fT.max?p.set(c):p.set(+f)}},string:{coerceFunction:function(f,p,c,T){if(typeof f!="string"){var l=typeof f=="number";T.strict===!0||!l?p.set(c):p.set(String(f))}else T.noBlank&&!f?p.set(c):p.set(f)}},color:{coerceFunction:function(f,p,c){n(f)&&(f=s(f)),d(f).isValid()?p.set(f):p.set(c)}},colorlist:{coerceFunction:function(f,p,c){function T(l){return d(l).isValid()}!Array.isArray(f)||!f.length?p.set(c):f.every(T)?p.set(f):p.set(c)}},colorscale:{coerceFunction:function(f,p,c){p.set(E.get(f,c))}},angle:{coerceFunction:function(f,p,c){n(f)&&(f=s(f)),f==="auto"?p.set("auto"):q(f)?p.set(a(+f,360)):p.set(c)}},subplotid:{coerceFunction:function(f,p,c,T){var l=T.regex||o(c);let _=w=>typeof w=="string"&&l.test(w);_(f)||T.arrayOk&&i(f)&&f.length>0&&f.every(_)?p.set(f):p.set(c)},validateFunction:function(f,p){var c=p.dflt;return f===c?!0:typeof f!="string"?!1:!!o(c).test(f)}},flaglist:{coerceFunction:function(f,p,c,T){if((T.extras||[]).indexOf(f)!==-1){p.set(f);return}if(typeof f!="string"){p.set(c);return}for(var l=f.split("+"),_=0;_/g),c=0;c1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},S.warn=function(){var E;if(d.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},S.error=function(){var E;if(d.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Vy=Ge({"src/lib/noop.js"(Z,q){"use strict";q.exports=function(){}}}),eb=Ge({"src/lib/push_unique.js"(Z,q){"use strict";q.exports=function(x,S){if(S instanceof RegExp){for(var E=S.toString(),e=0;eVs({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),Z.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>Vs({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),Z.shapeTexttemplateAttrs=({editType:E="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:E}),Z.templatefallbackAttrs=({editType:E="none"}={})=>({valType:"any",dflt:"-",editType:E})}}),Gy=Ge({"src/components/shapes/label_texttemplate.js"(Z,q){"use strict";function d(A,M){return M?M.d2l(A):A}function x(A,M){return M?M.l2d(A):A}function S(A){return A.x0}function E(A){return A.x1}function e(A){return A.y0}function t(A){return A.y1}function r(A){return A.x0shift||0}function o(A){return A.x1shift||0}function a(A){return A.y0shift||0}function i(A){return A.y1shift||0}function n(A,M){return d(A.x1,M)+o(A)-d(A.x0,M)-r(A)}function s(A,M,g){return d(A.y1,g)+i(A)-d(A.y0,g)-a(A)}function h(A,M){return Math.abs(n(A,M))}function f(A,M,g){return Math.abs(s(A,M,g))}function p(A,M,g){return A.type!=="line"?void 0:Math.sqrt(Math.pow(n(A,M),2)+Math.pow(s(A,M,g),2))}function c(A,M){return x((d(A.x1,M)+o(A)+d(A.x0,M)+r(A))/2,M)}function T(A,M,g){return x((d(A.y1,g)+i(A)+d(A.y0,g)+a(A))/2,g)}function l(A,M,g){return A.type!=="line"?void 0:s(A,M,g)/n(A,M)}var _=["x0","x1","y0","y1","dy","height","ycenter"],w=["x0","x1","y0","y1","dx","width","xcenter"];q.exports={x0:S,x1:E,y0:e,y1:t,slope:l,dx:n,dy:s,width:h,height:f,length:p,xcenter:c,ycenter:T,simpleXVariables:_,simpleYVariables:w}}}),PA=Ge({"src/components/shapes/draw_newshape/attributes.js"(Z,q){"use strict";var d=Ru().overrideAll,x=Cl(),S=bu(),E=Of().dash,e=Do().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Tl(),o=Gy();q.exports=d({newshape:{visible:e({},x.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},x.legend,{}),legendgroup:e({},x.legendgroup,{}),legendgrouptitle:{text:e({},x.legendgrouptitle.text,{}),font:S({})},legendrank:e({},x.legendrank,{}),legendwidth:e({},x.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},E,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},x.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(o)}),texttemplatefallback:r({editType:"arraydraw"}),font:S({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),IA=Ge({"src/components/selections/draw_newselection/attributes.js"(Z,q){"use strict";var d=Of().dash,x=Do().extendFlat;q.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:x({},d,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),Hy=Ge({"src/plots/pad_attributes.js"(Z,q){"use strict";q.exports=function(d){var x=d.editType;return{t:{valType:"number",dflt:0,editType:x},r:{valType:"number",dflt:0,editType:x},b:{valType:"number",dflt:0,editType:x},l:{valType:"number",dflt:0,editType:x},editType:x}}}}),P0=Ge({"src/plots/layout_attributes.js"(Z,q){"use strict";var d=bu(),x=jm(),S=sf(),E=PA(),e=IA(),t=Hy(),r=Do().extendFlat,o=d({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=S.defaultLine,q.exports={font:o,title:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(t({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:S.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:S.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:S.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:E.newshape,activeshape:E.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},x.transition,{editType:"none"})}}}),RA=Ge({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var Z=document.createElement("style");Z.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",Z.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(Z)}})()}}),Yi=Ge({"src/registry.js"(Z){"use strict";var q=kd(),d=Vy(),x=eb(),S=$v(),E=Um().addStyleRule,e=Do(),t=Cl(),r=P0(),o=e.extendFlat,a=e.extendDeepAll;Z.modules={},Z.allCategories={},Z.allTypes=[],Z.subplotsRegistry={},Z.componentsRegistry={},Z.layoutArrayContainers=[],Z.layoutArrayRegexes=[],Z.traceLayoutAttributes={},Z.localeRegistry={},Z.apiMethodRegistry={},Z.collectableSubplotTypes=null,Z.register=function(w){if(Z.collectableSubplotTypes=null,w)w&&!Array.isArray(w)&&(w=[w]);else throw new Error("No argument passed to Plotly.register.");for(var A=0;A=l&&F<=_?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var B=c(N),X=F.charAt(0);B&&(X==="G"||X==="g")&&(F=F.slice(1),N="");var $=B&&N.slice(0,7)==="chinese",le=F.match($?f:h);if(!le)return e;var ce=le[1],ve=le[3]||"1",G=Number(le[5]||1),Y=Number(le[7]||0),ee=Number(le[9]||0),V=Number(le[11]||0);if(B){if(ce.length===2)return e;ce=Number(ce);var se;try{var ae=n.getComponentMethod("calendars","getCal")(N);if($){var j=ve.charAt(ve.length-1)==="i";ve=parseInt(ve,10),se=ae.newDate(ce,ae.toMonthIndex(ce,ve,j),G)}else se=ae.newDate(ce,Number(ve),G)}catch{return e}return se?(se.toJD()-i)*t+Y*r+ee*o+V*a:e}ce.length===2?ce=(Number(ce)+2e3-p)%100+p:ce=Number(ce),ve-=1;var Q=new Date(Date.UTC(2e3,ve,G,Y,ee));return Q.setUTCFullYear(ce),Q.getUTCMonth()!==ve||Q.getUTCDate()!==G?e:Q.getTime()+V*a},l=Z.MIN_MS=Z.dateTime2ms("-9999"),_=Z.MAX_MS=Z.dateTime2ms("9999-12-31 23:59:59.9999"),Z.isDateTime=function(F,N){return Z.dateTime2ms(F,N)!==e};function w(F,N){return String(F+Math.pow(10,N)).slice(1)}var A=90*t,M=3*r,g=5*o;Z.ms2DateTime=function(F,N,O){if(typeof F!="number"||!(F>=l&&F<=_))return e;N||(N=0);var P=Math.floor(S(F+.05,1)*10),U=Math.round(F-P/10),B,X,$,le,ce,ve;if(c(O)){var G=Math.floor(U/t)+i,Y=Math.floor(S(F,t));try{B=n.getComponentMethod("calendars","getCal")(O).fromJD(G).formatDate("yyyy-mm-dd")}catch{B=s("G%Y-%m-%d")(new Date(U))}if(B.charAt(0)==="-")for(;B.length<11;)B="-0"+B.slice(1);else for(;B.length<10;)B="0"+B;X=N=l+t&&F<=_-t))return e;var N=Math.floor(S(F+.05,1)*10),O=new Date(Math.round(F-N/10)),P=q("%Y-%m-%d")(O),U=O.getHours(),B=O.getMinutes(),X=O.getSeconds(),$=O.getUTCMilliseconds()*10+N;return b(P,U,B,X,$)};function b(F,N,O,P,U){if((N||O||P||U)&&(F+=" "+w(N,2)+":"+w(O,2),(P||U)&&(F+=":"+w(P,2),U))){for(var B=4;U%10===0;)B-=1,U/=10;F+="."+w(U,B)}return F}Z.cleanDate=function(F,N,O){if(F===e)return N;if(Z.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(c(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),N;if(F=Z.ms2DateTimeLocal(+F),!F&&N!==void 0)return N}else if(!Z.isDateTime(F,O))return x.error("unrecognized date",F),N;return F};var v=/%\d?f/g,u=/%h/g,y={1:"1",2:"1",3:"2",4:"2"};function m(F,N,O,P){F=F.replace(v,function(B){var X=Math.min(+B.charAt(1)||6,6),$=(N/1e3%1+2).toFixed(X).slice(2).replace(/0+$/,"")||"0";return $});var U=new Date(Math.floor(N+.05));if(F=F.replace(u,function(){return y[O("%q")(U)]}),c(P))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,N,P)}catch{return"Invalid"}return O(F)(U)}var R=[59,59.9,59.99,59.999,59.9999];function L(F,N){var O=S(F+.05,t),P=w(Math.floor(O/r),2)+":"+w(S(Math.floor(O/o),60),2);if(N!=="M"){d(N)||(N=0);var U=Math.min(S(F/a,60),R[N]),B=(100+U).toFixed(N).slice(1);N>0&&(B=B.replace(/0+$/,"").replace(/[\.]$/,"")),P+=":"+B}return P}Z.formatDate=function(F,N,O,P,U,B){if(U=c(U)&&U,!N)if(O==="y")N=B.year;else if(O==="m")N=B.month;else if(O==="d")N=B.dayMonth+` +`+B.year;else return L(F,O)+` +`+m(B.dayMonthYear,F,P,U);return m(N,F,P,U)};var z=3*t;Z.incrementMonth=function(F,N,O){O=c(O)&&O;var P=S(F,t);if(F=Math.round(F-P),O)try{var U=Math.round(F/t)+i,B=n.getComponentMethod("calendars","getCal")(O),X=B.fromJD(U);return N%12?B.add(X,N,"m"):B.add(X,N/12,"y"),(X.toJD()-i)*t+P}catch{x.error("invalid ms "+F+" in calendar "+O)}var $=new Date(F+z);return $.setUTCMonth($.getUTCMonth()+N)+P-z},Z.findExactDates=function(F,N){for(var O=0,P=0,U=0,B=0,X,$,le=c(N)&&n.getComponentMethod("calendars","getCal")(N),ce=0;ce1?(i[h-1]-i[0])/(h-1):1,c,T;for(p>=0?T=n?e:t:T=n?o:r,a+=p*E*(n?-1:1)*(p>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Z.sorterAsc=function(a,i){return a-i},Z.sorterDes=function(a,i){return i-a},Z.distinctVals=function(a){var i=a.slice();i.sort(Z.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===S;n--);for(var s=i[n]-i[0]||1,h=s/(n||1)/1e4,f=[],p,c=0;c<=n;c++){var T=i[c],l=T-p;p===void 0?(f.push(T),p=T):l>h&&(s=Math.min(s,l),f.push(T),p=T)}return{vals:f,minDiff:s}},Z.roundUp=function(a,i,n){for(var s=0,h=i.length-1,f,p=0,c=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Z.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,h=0;hE.length)&&(e=E.length),q(S)||(S=!1),d(E[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var E=S%1;return E*x[Math.ceil(S)]+(1-E)*x[Math.floor(S)]}}}),FA=Ge({"src/lib/angles.js"(Z,q){"use strict";var d=k0(),x=d.mod,S=d.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return S(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var _,w;l[0]w&&(w+=e);var A=x(T,e),M=A+e;return A>=_&&A<=w||M>=_&&M<=w}function s(T,l,_,w){if(!n(l,w))return!1;var A,M;return _[0]<_[1]?(A=_[0],M=_[1]):(A=_[1],M=_[0]),T>=A&&T<=M}function h(T,l,_,w,A,M,g){A=A||0,M=M||0;var b=o([_,w]),v,u,y,m,R;b?(v=0,u=E,y=e):_1/3&&d.x<2/3},Z.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Z.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Z.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Z.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),BA=Ge({"src/lib/geometry2d.js"(Z){"use strict";var q=k0().mod;Z.segmentsIntersect=d;function d(t,r,o,a,i,n,s,h){var f=o-t,p=i-t,c=s-i,T=a-r,l=n-r,_=h-n,w=f*_-c*T;if(w===0)return null;var A=(p*_-c*l)/w,M=(p*T-f*l)/w;return M<0||M>1||A<0||A>1?null:{x:t+f*A,y:r+T*A}}Z.segmentDistance=function(r,o,a,i,n,s,h,f){if(d(r,o,a,i,n,s,h,f))return 0;var p=a-r,c=i-o,T=h-n,l=f-s,_=p*p+c*c,w=T*T+l*l,A=Math.min(x(p,c,_,n-r,s-o),x(p,c,_,h-r,f-o),x(T,l,w,r-n,o-s),x(T,l,w,a-n,i-s));return Math.sqrt(A)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,h=i-r;return s*s+h*h}else{var f=a*r-i*t;return f*f/o}}var S,E,e;Z.getTextLocation=function(r,o,a,i){if((r!==E||i!==e)&&(S={},E=r,e=i),S[a])return S[a];var n=r.getPointAtLength(q(a-i/2,o)),s=r.getPointAtLength(q(a+i/2,o)),h=Math.atan((s.y-n.y)/(s.x-n.x)),f=r.getPointAtLength(q(a,o)),p=(f.x*4+n.x+s.x)/6,c=(f.y*4+n.y+s.y)/6,T={x:p,y:c,theta:h};return S[a]=T,T},Z.clearLocationCache=function(){E=null},Z.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,h=o.bottom,f=0,p=r.getTotalLength(),c=p,T,l;function _(A){var M=r.getPointAtLength(A);A===0?T=M:A===p&&(l=M);var g=M.xn?M.x-n:0,b=M.yh?M.y-h:0;return Math.sqrt(g*g+b*b)}for(var w=_(f);w;){if(f+=w+a,f>c)return;w=_(f)}for(w=_(c);w;){if(c-=w+a,f>c)return;w=_(c)}return{min:f,max:c,len:c-f,total:p,isClosed:f===0&&c===p&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Z.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,h=i.iterationLimit||30,f=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,p=0,c=0,T=n,l,_,w;p0?T=l:c=l,p++}return _}}}),Xy=Ge({"src/lib/throttle.js"(Z){"use strict";var q={};Z.throttle=function(S,E,e){var t=q[S],r=Date.now();if(!t){for(var o in q)q[o].tst.ts+E){a();return}t.timer=setTimeout(function(){a(),t.timer=null},E)},Z.done=function(x){var S=q[x];return!S||!S.timer?Promise.resolve():new Promise(function(E){var e=S.onDone;S.onDone=function(){e&&e(),E(),S.onDone=null}})},Z.clear=function(x){if(x)d(q[x]),delete q[x];else for(var S in q)Z.clear(S)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),NA=Ge({"src/lib/clear_responsive.js"(Z,q){"use strict";q.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),UA=Ge({"node_modules/is-mobile/index.js"(Z,q){"use strict";q.exports=E,q.exports.isMobile=E,q.exports.default=E;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,S=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&S.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),jA=Ge({"src/lib/preserve_drawing_buffer.js"(Z,q){"use strict";var d=Bo(),x=UA();q.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=S(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.slice(0,8)==="Version/"){var h=s.slice(8).split(".")[0];if(d(h)&&(h=+h),h>=13)return!0}}}return r};function S(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),VA=Ge({"src/lib/make_trace_groups.js"(Z,q){"use strict";var d=Oi();q.exports=function(S,E,e){var t=S.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=S.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),qA=Ge({"src/lib/localize.js"(Z,q){"use strict";var d=Yi();q.exports=function(S,E){for(var e=S._context.locale,t=0;t<2;t++){for(var r=S._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[E];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return E}}}),nb=Ge({"src/lib/filter_unique.js"(Z,q){"use strict";q.exports=function(x){for(var S={},E=[],e=0,t=0;t1?(E*x+E*S)/E:x+S,t=String(e).length;if(t>16){var r=String(S).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),WA=Ge({"src/lib/clean_number.js"(Z,q){"use strict";var d=Bo(),x=As().BADNUM,S=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;q.exports=function(e){return typeof e=="string"&&(e=e.replace(S,"")),d(e)?Number(e):x}}}),ta=Ge({"src/lib/index.js"(Z,q){"use strict";var d=Oi(),x=E0().utcFormat,S=Jx().format,E=Bo(),e=As(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=q.exports={};a.adjustFormat=function(j){return!j||/^\d[.]\df/.test(j)||/[.]\d%/.test(j)?j:j==="0.f"?"~f":/^\d%/.test(j)?"~%":/^\ds/.test(j)?"~s":!/^[~,.0$]/.test(j)&&/[&fps]/.test(j)?"~"+j:j};var i={};a.warnBadFormat=function(ae){var j=String(ae);i[j]||(i[j]=1,a.warn('encountered bad format: "'+j+'"'))},a.noFormat=function(ae){return String(ae)},a.numberFormat=function(ae){var j;try{j=S(a.adjustFormat(ae))}catch{return a.warnBadFormat(ae),a.noFormat}return j},a.nestedProperty=Bm(),a.keyedContainer=Q5(),a.relativeAttr=eA(),a.isPlainObject=$v(),a.toLogRange=jy(),a.relinkPrivateKeys=tA();var n=nh();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=k0();a.mod=s.mod,a.modHalf=s.modHalf;var h=rA();a.valObjectMeta=h.valObjectMeta,a.coerce=h.coerce,a.coerce2=h.coerce2,a.coerceFont=h.coerceFont,a.coercePattern=h.coercePattern,a.coerceHoverinfo=h.coerceHoverinfo,a.coerceSelectionMarkerOpacity=h.coerceSelectionMarkerOpacity,a.validate=h.validate;var f=DA();a.dateTime2ms=f.dateTime2ms,a.isDateTime=f.isDateTime,a.ms2DateTime=f.ms2DateTime,a.ms2DateTimeLocal=f.ms2DateTimeLocal,a.cleanDate=f.cleanDate,a.isJSDate=f.isJSDate,a.formatDate=f.formatDate,a.incrementMonth=f.incrementMonth,a.dateTick0=f.dateTick0,a.dfltRange=f.dfltRange,a.findExactDates=f.findExactDates,a.MIN_MS=f.MIN_MS,a.MAX_MS=f.MAX_MS;var p=Wy();a.findBin=p.findBin,a.sorterAsc=p.sorterAsc,a.sorterDes=p.sorterDes,a.distinctVals=p.distinctVals,a.roundUp=p.roundUp,a.sort=p.sort,a.findIndexOfMin=p.findIndexOfMin,a.sortObjectKeys=Cd();var c=zA();a.aggNums=c.aggNums,a.len=c.len,a.mean=c.mean,a.geometricMean=c.geometricMean,a.median=c.median,a.midRange=c.midRange,a.variance=c.variance,a.stdev=c.stdev,a.interp=c.interp;var T=qy();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=FA();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var _=OA();a.isLeftAnchor=_.isLeftAnchor,a.isCenterAnchor=_.isCenterAnchor,a.isRightAnchor=_.isRightAnchor,a.isTopAnchor=_.isTopAnchor,a.isMiddleAnchor=_.isMiddleAnchor,a.isBottomAnchor=_.isBottomAnchor;var w=BA();a.segmentsIntersect=w.segmentsIntersect,a.segmentDistance=w.segmentDistance,a.getTextLocation=w.getTextLocation,a.clearLocationCache=w.clearLocationCache,a.getVisibleSegment=w.getVisibleSegment,a.findPointOnPath=w.findPointOnPath;var A=Do();a.extendFlat=A.extendFlat,a.extendDeep=A.extendDeep,a.extendDeepAll=A.extendDeepAll,a.extendDeepNoArrays=A.extendDeepNoArrays;var M=kd();a.log=M.log,a.warn=M.warn,a.error=M.error;var g=L0();a.counterRegex=g.counter;var b=Xy();a.throttle=b.throttle,a.throttleDone=b.done,a.clearThrottle=b.clear;var v=Um();a.getGraphDiv=v.getGraphDiv,a.isPlotDiv=v.isPlotDiv,a.removeElement=v.removeElement,a.addStyleRule=v.addStyleRule,a.addRelatedStyleRule=v.addRelatedStyleRule,a.deleteRelatedStyleRule=v.deleteRelatedStyleRule,a.setStyleOnHover=v.setStyleOnHover,a.getFullTransformMatrix=v.getFullTransformMatrix,a.getElementTransformMatrix=v.getElementTransformMatrix,a.getElementAndAncestors=v.getElementAndAncestors,a.equalDomRects=v.equalDomRects,a.clearResponsive=NA(),a.preserveDrawingBuffer=jA(),a.makeTraceGroups=VA(),a._=qA(),a.notifier=Qx(),a.filterUnique=nb(),a.filterVisible=GA(),a.pushUnique=eb(),a.increment=HA(),a.cleanNumber=WA(),a.ensureNumber=function(j){return E(j)?(j=Number(j),j>t||j=j?!1:E(ae)&&ae>=0&&ae%1===0},a.noop=Vy(),a.identity=Vm(),a.repeat=function(ae,j){for(var Q=new Array(j),re=0;reQ?Math.max(Q,Math.min(j,ae)):Math.max(j,Math.min(Q,ae))},a.bBoxIntersect=function(ae,j,Q){return Q=Q||0,ae.left<=j.right+Q&&j.left<=ae.right+Q&&ae.top<=j.bottom+Q&&j.top<=ae.bottom+Q},a.simpleMap=function(ae,j,Q,re,he){for(var xe=ae.length,Te=new Array(xe),Le=0;Le=Math.pow(2,Q)?he>10?(a.warn("randstr failed uniqueness"),Te):ae(j,Q,re,(he||0)+1):Te},a.OptionControl=function(ae,j){ae||(ae={}),j||(j="opt");var Q={};return Q.optionList=[],Q._newoption=function(re){re[j]=ae,Q[re.name]=re,Q.optionList.push(re)},Q["_"+j]=ae,Q},a.smooth=function(ae,j){if(j=Math.round(j)||0,j<2)return ae;var Q=ae.length,re=2*Q,he=2*j-1,xe=new Array(he),Te=new Array(Q),Le,Pe,qe,et;for(Le=0;Le=re&&(qe-=re*Math.floor(qe/re)),qe<0?qe=-1-qe:qe>=Q&&(qe=re-1-qe),et+=ae[qe]*xe[Pe];Te[Le]=et}return Te},a.syncOrAsync=function(ae,j,Q){var re,he;function xe(){return a.syncOrAsync(ae,j,Q)}for(;ae.length;)if(he=ae.splice(0,1)[0],re=he(j),re&&re.then)return re.then(xe);return Q&&Q(j)},a.stripTrailingSlash=function(ae){return ae.slice(-1)==="/"?ae.slice(0,-1):ae},a.noneOrAll=function(ae,j,Q){if(ae){var re=!1,he=!0,xe,Te;for(xe=0;xe0?he:0})},a.fillArray=function(ae,j,Q,re){if(re=re||a.identity,a.isArrayOrTypedArray(ae))for(var he=0;heL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;a.getFirefoxVersion=function(){var ae=z.exec(window.navigator.userAgent);if(ae&&ae.length===2){var j=parseInt(ae[1]);if(!isNaN(j))return j}return null},a.isD3Selection=function(ae){return ae instanceof d.selection},a.ensureSingle=function(ae,j,Q,re){var he=ae.select(j+(Q?"."+Q:""));if(he.size())return he;var xe=ae.append(j);return Q&&xe.classed(Q,!0),re&&xe.call(re),xe},a.ensureSingleById=function(ae,j,Q,re){var he=ae.select(j+"#"+Q);if(he.size())return he;var xe=ae.append(j).attr("id",Q);return re&&xe.call(re),xe},a.objectFromPath=function(ae,j){for(var Q=ae.split("."),re,he=re={},xe=0;xe1?he+Te[1]:"";if(xe&&(Te.length>1||Le.length>4||Q))for(;re.test(Le);)Le=Le.replace(re,"$1"+xe+"$2");return Le+Pe},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;a.templateString=function(ae,j){var Q={};return ae.replace(a.TEMPLATE_STRING_REGEX,function(re,he){var xe;return P.test(he)?xe=j[he]:(Q[he]=Q[he]||a.nestedProperty(j,he).get,xe=Q[he](!0)),xe!==void 0?xe:""})};var U={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=ae=>ve(kl(Vs({},ae),{opts:U}));var B={max:10,count:0,name:"texttemplate"};a.texttemplateString=ae=>ve(kl(Vs({},ae),{opts:B}));var X=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function $(ae){var j=ae.match(X);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:ae,op:null,number:null}}var le={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=ae=>ve(kl(Vs({},ae),{opts:le}));var ce=/^[:|\|]/;function ve({data:ae=[],locale:j,fallback:Q,labels:re={},opts:he,template:xe}){return xe.replace(a.TEMPLATE_STRING_REGEX,(Te,Le,Pe)=>{let qe=["xother","yother"].includes(Le),et=["_xother","_yother"].includes(Le),rt=["_xother_","_yother_"].includes(Le),$e=["xother_","yother_"].includes(Le),Ue=qe||et||$e||rt;(et||rt)&&(Le=Le.substring(1)),($e||rt)&&(Le=Le.substring(0,Le.length-1));let fe=null,ue=null;if(he.parseMultDiv){var ie=$(Le);Le=ie.key,fe=ie.op,ue=ie.number}let Ee;if(Ue){if(re[Le]===void 0)return"";Ee=re[Le]}else for(let Tt of ae)if(Tt){if(Tt.hasOwnProperty(Le)){Ee=Tt[Le];break}if(P.test(Le)||(Ee=a.nestedProperty(Tt,Le).get(!0)),Ee!==void 0)break}if(Ee===void 0){let{count:Tt,max:St,name:zt}=he,Ut=Q===!1?Te:Q;return Tt=G&&Te<=Y,qe=Le>=G&&Le<=Y;if(Pe&&(re=10*re+Te-G),qe&&(he=10*he+Le-G),!Pe||!qe){if(re!==he)return re-he;if(Te!==Le)return Te-Le}}return he-re};var ee=2e9;a.seedPseudoRandom=function(){ee=2e9},a.pseudoRandom=function(){var ae=ee;return ee=(69069*ee+1)%4294967296,Math.abs(ee-ae)<429496729?a.pseudoRandom():ee/4294967296},a.fillText=function(ae,j,Q){var re=Array.isArray(Q)?function(Te){Q.push(Te)}:function(Te){Q.text=Te},he=a.extractOption(ae,j,"htx","hovertext");if(a.isValidTextValue(he))return re(he);var xe=a.extractOption(ae,j,"tx","text");if(a.isValidTextValue(xe))return re(xe)},a.isValidTextValue=function(ae){return ae||ae===0},a.formatPercent=function(ae,j){j=j||0;for(var Q=(Math.round(100*ae*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",re=0;re1&&(qe=1):qe=0,a.strTranslate(he-qe*(Q+Te),xe-qe*(re+Le))+a.strScale(qe)+(Pe?"rotate("+Pe+(j?"":" "+Q+" "+re)+")":"")},a.setTransormAndDisplay=function(ae,j){ae.attr("transform",a.getTextTransform(j)),ae.style("display",j.scale?null:"none")},a.ensureUniformFontSize=function(ae,j){var Q=a.extendFlat({},j);return Q.size=Math.max(j.size,ae._fullLayout.uniformtext.minsize||0),Q},a.join2=function(ae,j,Q){var re=ae.length;return re>1?ae.slice(0,-1).join(j)+Q+ae[re-1]:ae.join(j)},a.bigFont=function(ae){return Math.round(1.2*ae)};var V=a.getFirefoxVersion(),se=V!==null&&V<86;a.getPositionFromD3Event=function(){return se?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),XA=Ge({"build/plotcss.js"(){"use strict";var Z=ta(),q={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in q)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Z.addStyleRule(d,q[x]);var d,x}}),ib=Ge({"node_modules/is-browser/client.js"(Z,q){q.exports=!0}}),ob=Ge({"node_modules/has-hover/index.js"(Z,q){"use strict";var d=ib(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,q.exports=x}}),Sp=Ge({"node_modules/events/events.js"(Z,q){"use strict";var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(M,g,b){return Function.prototype.apply.call(M,g,b)},S;d&&typeof d.ownKeys=="function"?S=d.ownKeys:Object.getOwnPropertySymbols?S=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:S=function(M){return Object.getOwnPropertyNames(M)};function E(A){console&&console.warn&&console.warn(A)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}q.exports=t,q.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if(typeof A!="number"||A<0||e(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(A){return A._maxListeners===void 0?t.defaultMaxListeners:A._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(M){for(var g=[],b=1;b0&&(y=g[0]),y instanceof Error)throw y;var m=new Error("Unhandled error."+(y?" ("+y.message+")":""));throw m.context=y,m}var R=u[M];if(R===void 0)return!1;if(typeof R=="function")x(R,this,g);else for(var L=R.length,z=p(R,L),b=0;b0&&y.length>v&&!y.warned){y.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+y.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=A,m.type=M,m.count=y.length,E(m)}return A}t.prototype.addListener=function(M,g){return i(this,M,g,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,g){return i(this,M,g,!0)};function n(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(A,M,g){var b={fired:!1,wrapFn:void 0,target:A,type:M,listener:g},v=n.bind(b);return v.listener=g,b.wrapFn=v,v}t.prototype.once=function(M,g){return o(g),this.on(M,s(this,M,g)),this},t.prototype.prependOnceListener=function(M,g){return o(g),this.prependListener(M,s(this,M,g)),this},t.prototype.removeListener=function(M,g){var b,v,u,y,m;if(o(g),v=this._events,v===void 0)return this;if(b=v[M],b===void 0)return this;if(b===g||b.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete v[M],v.removeListener&&this.emit("removeListener",M,b.listener||g));else if(typeof b!="function"){for(u=-1,y=b.length-1;y>=0;y--)if(b[y]===g||b[y].listener===g){m=b[y].listener,u=y;break}if(u<0)return this;u===0?b.shift():c(b,u),b.length===1&&(v[M]=b[0]),v.removeListener!==void 0&&this.emit("removeListener",M,m||g)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var g,b,v;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[M]),this;if(arguments.length===0){var u=Object.keys(b),y;for(v=0;v=0;v--)this.removeListener(M,g[v]);return this};function h(A,M,g){var b=A._events;if(b===void 0)return[];var v=b[M];return v===void 0?[]:typeof v=="function"?g?[v.listener||v]:[v]:g?T(v):p(v,v.length)}t.prototype.listeners=function(M){return h(this,M,!0)},t.prototype.rawListeners=function(M){return h(this,M,!1)},t.listenerCount=function(A,M){return typeof A.listenerCount=="function"?A.listenerCount(M):f.call(A,M)},t.prototype.listenerCount=f;function f(A){var M=this._events;if(M!==void 0){var g=M[A];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?S(this._events):[]};function p(A,M){for(var g=new Array(M),b=0;b{},{passive:!0}),S},triggerHandler:function(S,E,e){var t,r=S._ev;if(!r)return;var o=r._events[E];if(!o)return;function a(n){if(n.listener){if(r.removeListener(E,n.listener),!n.fired)return n.fired=!0,n.listener.apply(r,[e])}else return n.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ix.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=P.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var U=z[F];if(!w(U))return!1;L=P[O][U]}else L=P[O]}else L=P}}return L}function w(L){return L===Math.round(L)&&L>=0}function A(L){var z,F;z=q.modules[L]._module,F=z.basePlotModule;var N={};N.type=null;var O=o({},x),P=o({},z.attributes);Z.crawl(P,function(X,$,le,ce,ve){n(O,ve).set(void 0),X===void 0&&n(P,ve).set(void 0)}),o(N,O),q.traceIs(L,"noOpacity")&&delete N.opacity,q.traceIs(L,"showLegend")||(delete N.showlegend,delete N.legendgroup),q.traceIs(L,"noHover")&&(delete N.hoverinfo,delete N.hoverlabel),z.selectPoints||delete N.selectedpoints,o(N,P),F.attributes&&o(N,F.attributes),N.type=L;var U={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:b(N)};if(z.layoutAttributes){var B={};o(B,z.layoutAttributes),U.layoutAttributes=b(B)}return z.animatable||Z.crawl(U,function(X){Z.isValObject(X)&&"anim"in X&&delete X.anim}),U}function M(){var L={},z,F;o(L,S);for(z in q.subplotsRegistry)if(F=q.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var N=0;N=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",h;function f(){h={},n&&(h[s]={},h[s][x]=n)}f();function p(_,w){h[_]=w}function c(_,w){n?q.nestedProperty(h[s],_).set(w):h[s+"."+_]=w}function T(){var _=h;return f(),_}function l(_,w){_&&c(_,w);var A=T();for(var M in A)q.nestedProperty(t,M).set(A[M])}return{modifyBase:p,modifyItem:c,getUpdateObj:T,applyUpdate:l}}}}),lf=Ge({"src/plots/cartesian/constants.js"(Z,q){"use strict";var d=L0().counter;q.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),dc=Ge({"src/plots/cartesian/axis_ids.js"(Z){"use strict";var q=Yi(),d=lf();Z.id2name=function(E){if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))){var e=E.split(" ")[0].slice(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},Z.name2id=function(E){if(E.match(d.AX_NAME_PATTERN)){var e=E.slice(5);return e==="1"&&(e=""),E.charAt(0)+e}},Z.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},Z.list=function(S,E,e){var t=S._fullLayout;if(!t)return[];var r=Z.listIds(S,E),o=new Array(r.length),a;for(a=0;at?1:-1:+(S.slice(1)||1)-+(E.slice(1)||1)},Z.ref2id=function(S){return/^[xyz]/.test(S)?S.split(" ")[0]:!1};function x(S,E){if(E&&E.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,h,i+1):o(h,n,s)}})}}}),Uu=Ge({"src/plots/plots.js"(Z,q){"use strict";var d=Oi(),x=E0().timeFormatLocale,S=Jx().formatLocale,E=Bo(),e=$x(),t=Yi(),r=R0(),o=ll(),a=ta(),i=Bi(),n=As().BADNUM,s=dc(),h=Ld().clearOutline,f=Zy(),p=jm(),c=sb(),T=Bf().getModuleCalcData,l=a.relinkPrivateKeys,_=a._,w=q.exports={};a.extendFlat(w,t),w.attributes=Cl(),w.attributes.type.values=w.allTypes,w.fontAttrs=bu(),w.layoutAttributes=P0();var A=YA();w.executeAPICommand=A.executeAPICommand,w.computeAPICommandBindings=A.computeAPICommandBindings,w.manageCommandObserver=A.manageCommandObserver,w.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,w.redrawText=function(G){return G=a.getGraphDiv(G),new Promise(function(Y){setTimeout(function(){G._fullLayout&&(t.getComponentMethod("annotations","draw")(G),t.getComponentMethod("legend","draw")(G),t.getComponentMethod("colorbar","draw")(G),Y(w.previousPromises(G)))},300)})},w.resize=function(G){G=a.getGraphDiv(G);var Y,ee=new Promise(function(V,se){(!G||a.isHidden(G))&&se(new Error("Resize must be passed a displayed plot div element.")),G._redrawTimer&&clearTimeout(G._redrawTimer),G._resolveResize&&(Y=G._resolveResize),G._resolveResize=V,G._redrawTimer=setTimeout(function(){if(!G.layout||G.layout.width&&G.layout.height||a.isHidden(G)){V(G);return}delete G.layout.width,delete G.layout.height;var ae=G.changed;G.autoplay=!0,t.call("relayout",G,{autosize:!0}).then(function(){G.changed=ae,G._resolveResize===V&&(delete G._resolveResize,V(G))})},100)});return Y&&Y(ee),ee},w.previousPromises=function(G){if((G._promises||[]).length)return Promise.all(G._promises).then(function(){G._promises=[]})},w.addLinks=function(G){if(!(!G._context.showLink&&!G._context.showSources)){var Y=G._fullLayout,ee=a.ensureSingle(Y._paper,"text","js-plot-link-container",function(re){re.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var he=d.select(this);he.append("tspan").classed("js-link-to-tool",!0),he.append("tspan").classed("js-link-spacer",!0),he.append("tspan").classed("js-sourcelinks",!0)})}),V=ee.node(),se={y:Y._paper.attr("height")-9};document.body.contains(V)&&V.getComputedTextLength()>=Y.width-20?(se["text-anchor"]="start",se.x=5):(se["text-anchor"]="end",se.x=Y._paper.attr("width")-7),ee.attr(se);var ae=ee.select(".js-link-to-tool"),j=ee.select(".js-link-spacer"),Q=ee.select(".js-sourcelinks");G._context.showSources&&G._context.showSources(G),G._context.showLink&&M(G,ae),j.text(ae.text()&&Q.text()?" - ":"")}};function M(G,Y){Y.text("");var ee=Y.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(G._context.linkText+" \xBB");if(G._context.sendData)ee.on("click",function(){w.sendDataToCloud(G)});else{var V=window.location.pathname.split("/"),se=window.location.search;ee.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+V[2].split(".")[0]+"/"+V[1]+se})}}w.sendDataToCloud=function(G){var Y=(window.PLOTLYENV||{}).BASE_URL||G._context.plotlyServerURL;if(Y){G.emit("plotly_beforeexport");var ee=d.select(G).append("div").attr("id","hiddenform").style("display","none"),V=ee.append("form").attr({action:Y+"/external",method:"post",target:"_blank"}),se=V.append("input").attr({type:"text",name:"data"});return se.node().value=w.graphJson(G,!1,"keepdata"),V.node().submit(),ee.remove(),G.emit("plotly_afterexport"),!1}};var g=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(G,Y){var ee=Y&&Y.skipUpdateCalc,V=G._fullLayout||{};if(V._skipDefaults){delete V._skipDefaults;return}var se=G._fullLayout={},ae=G.layout||{},j=G._fullData||[],Q=G._fullData=[],re=G.data||[],he=G.calcdata||[],xe=G._context||{},Te;G._transitionData||w.createTransitionData(G),se._dfltTitle={plot:_(G,"Click to enter Plot title"),subtitle:_(G,"Click to enter Plot subtitle"),x:_(G,"Click to enter X axis title"),y:_(G,"Click to enter Y axis title"),colorbar:_(G,"Click to enter Colorscale title"),annotation:_(G,"new text")},se._traceWord=_(G,"trace");var Le=y(G,g);if(se._mapboxAccessToken=xe.mapboxAccessToken,V._initialAutoSizeIsDone){var Pe=V.width,qe=V.height;w.supplyLayoutGlobalDefaults(ae,se,Le),ae.width||(se.width=Pe),ae.height||(se.height=qe),w.sanitizeMargins(se)}else{w.supplyLayoutGlobalDefaults(ae,se,Le);var et=!ae.width||!ae.height,rt=se.autosize,$e=xe.autosizable,Ue=et&&(rt||$e);Ue?w.plotAutoSize(G,ae,se):et&&w.sanitizeMargins(se),!rt&&et&&(ae.width=se.width,ae.height=se.height)}se._d3locale=m(Le,se.separators),se._extraFormat=y(G,b),se._initialAutoSizeIsDone=!0,se._dataLength=re.length,se._modules=[],se._visibleModules=[],se._basePlotModules=[];var fe=se._subplots=u(),ue=se._splomAxes={x:{},y:{}},ie=se._splomSubplots={};se._splomGridDflt={},se._scatterStackOpts={},se._firstScatter={},se._alignmentOpts={},se._colorAxes={},se._requestRangeslider={},se._traceUids=v(j,re),w.supplyDataDefaults(re,Q,ae,se);var Ee=Object.keys(ue.x),We=Object.keys(ue.y);if(Ee.length>1&&We.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ae,se),Te=0;Te15&&We.length>15&&se.shapes.length===0&&se.images.length===0,w.linkSubplots(Q,se,j,V),w.cleanPlot(Q,se,j,V);var zt=!!(V._has&&V._has("cartesian")),Ut=!!(se._has&&se._has("cartesian")),br=zt,hr=Ut;br&&!hr?V._bgLayer.remove():hr&&!br&&(se._shouldCreateBgLayer=!0),V._zoomlayer&&!G._dragging&&h({_fullLayout:V}),R(Q,se),l(se,V),t.getComponentMethod("colorscale","crossTraceDefaults")(Q,se),se._preGUI||(se._preGUI={}),se._tracePreGUI||(se._tracePreGUI={});var Or=se._tracePreGUI,wr={},Er;for(Er in Or)wr[Er]="old";for(Te=0;Te0){var xe=1-2*ae;j=Math.round(xe*j),Q=Math.round(xe*Q)}}var Te=w.layoutAttributes.width.min,Le=w.layoutAttributes.height.min;j1,qe=!ee.height&&Math.abs(V.height-Q)>1;(qe||Pe)&&(Pe&&(V.width=j),qe&&(V.height=Q)),Y._initialAutoSize||(Y._initialAutoSize={width:j,height:Q}),w.sanitizeMargins(V)},w.supplyLayoutModuleDefaults=function(G,Y,ee,V){var se=t.componentsRegistry,ae=Y._basePlotModules,j,Q,re,he=t.subplotsRegistry.cartesian;for(j in se)re=se[j],re.includeBasePlot&&re.includeBasePlot(G,Y);ae.length||ae.push(he),Y._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(G,Y),he.finalizeSubplots(G,Y));for(var xe in Y._subplots)Y._subplots[xe].sort(a.subplotSort);for(Q=0;Q1&&(ee.l/=rt,ee.r/=rt)}if(Le){var $e=(ee.t+ee.b)/Le;$e>1&&(ee.t/=$e,ee.b/=$e)}var Ue=ee.xl!==void 0?ee.xl:ee.x,fe=ee.xr!==void 0?ee.xr:ee.x,ue=ee.yt!==void 0?ee.yt:ee.y,ie=ee.yb!==void 0?ee.yb:ee.y;Pe[Y]={l:{val:Ue,size:ee.l+et},r:{val:fe,size:ee.r+et},b:{val:ie,size:ee.b+et},t:{val:ue,size:ee.t+et}},qe[Y]=1}if(!V._replotting)return w.doAutoMargin(G)}};function P(G){if("_redrawFromAutoMarginCount"in G._fullLayout)return!1;var Y=s.list(G,"",!0);for(var ee in Y)if(Y[ee].autoshift||Y[ee].shift)return!0;return!1}w.doAutoMargin=function(G){var Y=G._fullLayout,ee=Y.width,V=Y.height;Y._size||(Y._size={}),F(Y);var se=Y._size,ae=Y.margin,j={t:0,b:0,l:0,r:0},Q=a.extendFlat({},se),re=ae.l,he=ae.r,xe=ae.t,Te=ae.b,Le=Y._pushmargin,Pe=Y._pushmarginIds,qe=Y.minreducedwidth,et=Y.minreducedheight;if(ae.autoexpand!==!1){for(var rt in Le)Pe[rt]||delete Le[rt];var $e=G._fullLayout._reservedMargin;for(var Ue in $e)for(var fe in $e[Ue]){var ue=$e[Ue][fe];j[fe]=Math.max(j[fe],ue)}Le.base={l:{val:0,size:re},r:{val:1,size:he},t:{val:1,size:xe},b:{val:0,size:Te}};for(var ie in j){var Ee=0;for(var We in Le)We!=="base"&&E(Le[We][ie].size)&&(Ee=Le[We][ie].size>Ee?Le[We][ie].size:Ee);var Qe=Math.max(0,ae[ie]-Ee);j[ie]=Math.max(0,j[ie]-Qe)}for(var Xe in Le){var Tt=Le[Xe].l||{},St=Le[Xe].b||{},zt=Tt.val,Ut=Tt.size,br=St.val,hr=St.size,Or=ee-j.r-j.l,wr=V-j.t-j.b;for(var Er in Le){if(E(Ut)&&Le[Er].r){var mt=Le[Er].r.val,ze=Le[Er].r.size;if(mt>zt){var Ze=(Ut*mt+(ze-Or)*zt)/(mt-zt),we=(ze*(1-zt)+(Ut-Or)*(1-mt))/(mt-zt);Ze+we>re+he&&(re=Ze,he=we)}}if(E(hr)&&Le[Er].t){var ke=Le[Er].t.val,Be=Le[Er].t.size;if(ke>br){var He=(hr*ke+(Be-wr)*br)/(ke-br),nt=(Be*(1-br)+(hr-wr)*(1-ke))/(ke-br);He+nt>Te+xe&&(Te=He,xe=nt)}}}}}var ot=a.constrain(ee-ae.l-ae.r,N,qe),Ft=a.constrain(V-ae.t-ae.b,O,et),Mt=Math.max(0,ee-ot),Et=Math.max(0,V-Ft);if(Mt){var Ot=(re+he)/Mt;Ot>1&&(re/=Ot,he/=Ot)}if(Et){var sr=(Te+xe)/Et;sr>1&&(Te/=sr,xe/=sr)}if(se.l=Math.round(re)+j.l,se.r=Math.round(he)+j.r,se.t=Math.round(xe)+j.t,se.b=Math.round(Te)+j.b,se.p=Math.round(ae.pad),se.w=Math.round(ee)-se.l-se.r,se.h=Math.round(V)-se.t-se.b,!Y._replotting&&(w.didMarginChange(Q,se)||P(G))){"_redrawFromAutoMarginCount"in Y?Y._redrawFromAutoMarginCount++:Y._redrawFromAutoMarginCount=1;var ir=3*(1+Object.keys(Pe).length);if(Y._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(G,Y,ee,V,se,ae){(se&&Y&&!G._fullData||se&&!Y&&!G._fullLayout)&&w.supplyDefaults(G);var j=se?G._fullData:G.data,Q=se?G._fullLayout:G.layout,re=(G._transitionData||{})._frames;function he(Le,Pe){if(typeof Le=="function")return Pe?"_function_":null;if(a.isPlainObject(Le)){var qe={},et;return Object.keys(Le).sort().forEach(function(fe){if(["_","["].indexOf(fe.charAt(0))===-1){if(typeof Le[fe]=="function"){Pe&&(qe[fe]="_function");return}if(ee==="keepdata"){if(fe.slice(-3)==="src")return}else if(ee==="keepstream"){if(et=Le[fe+"src"],typeof et=="string"&&et.indexOf(":")>0&&!a.isPlainObject(Le.stream))return}else if(ee!=="keepall"&&(et=Le[fe+"src"],typeof et=="string"&&et.indexOf(":")>0))return;qe[fe]=he(Le[fe],Pe)}}),qe}var rt=Array.isArray(Le),$e=a.isTypedArray(Le);if((rt||$e)&&Le.dtype&&Le.shape){var Ue=Le.bdata;return he({dtype:Le.dtype,shape:Le.shape,bdata:a.isArrayBuffer(Ue)?e.encode(Ue):Ue},Pe)}return rt?Le.map(function(fe){return he(fe,Pe)}):$e?a.simpleMap(Le,a.identity):a.isJSDate(Le)?a.ms2DateTimeLocal(+Le):Le}var xe={data:(j||[]).map(function(Le){var Pe=he(Le);return Y&&delete Pe.fit,Pe})};if(!Y&&(xe.layout=he(Q),se)){var Te=Q._size;xe.layout.computed={margin:{b:Te.b,l:Te.l,r:Te.r,t:Te.t}}}return re&&(xe.frames=he(re)),ae&&(xe.config=he(G._context,!0)),V==="object"?xe:JSON.stringify(xe)},w.modifyFrames=function(G,Y){var ee,V,se,ae=G._transitionData._frames,j=G._transitionData._frameHash;for(ee=0;ee0&&(G._transitioningWithDuration=!0),G._transitionData._interruptCallbacks.push(function(){V=!0}),ee.redraw&&G._transitionData._interruptCallbacks.push(function(){return t.call("redraw",G)}),G._transitionData._interruptCallbacks.push(function(){G.emit("plotly_transitioninterrupted",[])});var Le=0,Pe=0;function qe(){return Le++,function(){Pe++,!V&&Pe===Le&&Q(Te)}}ee.runFn(qe),setTimeout(qe())})}function Q(Te){if(G._transitionData)return ae(G._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ee.redraw)return t.call("redraw",G)}).then(function(){G._transitioning=!1,G._transitioningWithDuration=!1,G.emit("plotly_transitioned",[])}).then(Te)}function re(){if(G._transitionData)return G._transitioning=!1,se(G._transitionData._interruptCallbacks)}var he=[w.previousPromises,re,ee.prepareFn,w.rehover,w.reselect,j],xe=a.syncOrAsync(he,G);return(!xe||!xe.then)&&(xe=Promise.resolve()),xe.then(function(){return G})}w.doCalcdata=function(G,Y){var ee=s.list(G),V=G._fullData,se=G._fullLayout,ae,j,Q,re,he=new Array(V.length),xe=(G.calcdata||[]).slice();for(G.calcdata=he,se._numBoxes=0,se._numViolins=0,se._violinScaleGroupStats={},G._hmpixcount=0,G._hmlumcount=0,se._piecolormap={},se._sunburstcolormap={},se._treemapcolormap={},se._iciclecolormap={},se._funnelareacolormap={},Q=0;Q=0;re--)if(ie[re].enabled){ae._indexToPoints=ie[re]._indexToPoints;break}j&&j.calc&&(ue=j.calc(G,ae))}(!Array.isArray(ue)||!ue[0])&&(ue=[{x:n,y:n}]),ue[0].t||(ue[0].t={}),ue[0].trace=ae,he[Ue]=ue}}for(ce(ee,V,se),Q=0;QQ||Pe>re)&&(ae.style("overflow","hidden"),Te=ae.node().getBoundingClientRect(),Le=Te.width,Pe=Te.height);var qe=+O.attr("x"),et=+O.attr("y"),rt=G||O.node().getBoundingClientRect().height,$e=-rt/4;if(le[0]==="y")j.attr({transform:"rotate("+[-90,qe,et]+")"+x(-Le/2,$e-Pe/2)});else if(le[0]==="l")et=$e-Pe/2;else if(le[0]==="a"&&le.indexOf("atitle")!==0)qe=0,et=$e;else{var Ue=O.attr("text-anchor");qe=qe-Le*(Ue==="middle"?.5:Ue==="end"?1:0),et=et+$e-Pe/2}ae.attr({x:qe,y:et}),U&&U.call(O,j),ve(j)})})):ce(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,P,U){var B=parseInt((MathJax.version||"").split(".")[0]);if(B!==2&&B!==3){d.warn("No MathJax version:",MathJax.version);return}var X,$,le,ce,ve=function(){return $=d.extendDeepAll({},MathJax.Hub.config),le=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},G=function(){$=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},Y=function(){if(X=MathJax.Hub.config.menuSettings.renderer,X!=="SVG")return MathJax.Hub.setRenderer("SVG")},ee=function(){X=MathJax.config.startup.output,X!=="svg"&&(MathJax.config.startup.output="svg")},V=function(){var he="math-output-"+d.randstr({},64);ce=q.select("body").append("div").attr({id:he}).style({visibility:"hidden",position:"absolute","font-size":P.fontSize+"px"}).text(o(O));var xe=ce.node();return B===2?MathJax.Hub.Typeset(xe):MathJax.typeset([xe])},se=function(){var he=ce.select(B===2?".MathJax_SVG":".MathJax"),xe=!he.empty()&&ce.select("svg").node();if(!xe)d.log("There was an error in the tex syntax.",O),U();else{var Te=xe.getBoundingClientRect(),Le;B===2?Le=q.select("body").select("#MathJax_SVG_glyphs"):Le=he.select("defs"),U(he,Le,Te)}ce.remove()},ae=function(){if(X!=="SVG")return MathJax.Hub.setRenderer(X)},j=function(){X!=="svg"&&(MathJax.config.startup.output=X)},Q=function(){return le!==void 0&&(MathJax.Hub.processSectionDelay=le),MathJax.Hub.Config($)},re=function(){MathJax.config=$};B===2?MathJax.Hub.Queue(ve,Y,V,se,ae,Q):B===3&&(G(),ee(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){V(),se(),j(),re()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},f="\u200B",p=["http:","https:","mailto:","",void 0,":"],c=Z.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;Z.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,g=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function b(O,P){if(!O)return null;var U=O.match(P),B=U&&(U[3]||U[4]);return B&&m(B)}var v=/(^|;)\s*color:/;Z.plainText=function(O,P){P=P||{};for(var U=P.len!==void 0&&P.len!==-1?P.len:1/0,B=P.allowedTags!==void 0?P.allowedTags:["br"],X="...",$=X.length,le=O.split(T),ce=[],ve="",G=0,Y=0;Y$?ce.push(ee.slice(0,Math.max(0,j-$))+X):ce.push(ee.slice(0,j));break}ve=""}}return ce.join("")};var u={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},y=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function m(O){return O.replace(y,function(P,U){var B;return U.charAt(0)==="#"?B=R(U.charAt(1)==="x"?parseInt(U.slice(2),16):parseInt(U.slice(1),10)):B=u[U],B||P})}Z.convertEntities=m;function R(O){if(!(O>1114111)){var P=String.fromCodePoint;if(P)return P(O);var U=String.fromCharCode;return O<=65535?U(O):U((O>>10)+55232,O%1024+56320)}}function L(O,P){P=P.replace(c," ");var U=!1,B=[],X,$=-1;function le(){$++;var Pe=document.createElementNS(S.svg,"tspan");q.select(Pe).attr({class:"line",dy:$*E+"em"}),O.appendChild(Pe),X=Pe;var qe=B;if(B=[{node:Pe}],qe.length>1)for(var et=1;et.",P);return}var qe=B.pop();Pe!==qe.type&&d.log("Start tag <"+qe.type+"> doesnt match end tag <"+Pe+">. Pretending it did match.",P),X=B[B.length-1].node}var Y=_.test(P);Y?le():(X=O,B=[{node:O}]);for(var ee=P.split(T),V=0;V=0;_--,w++){var A=c[_];l[w]=[1-A[0],A[1]]}return l}function h(c,T){T=T||{};for(var l=c.domain,_=c.range,w=_.length,A=new Array(w),M=0;Mc-f?f=c-(p-c):p-c=0?_=o.colorscale.sequential:_=o.colorscale.sequentialminus,s._sync("colorscale",_)}}}}),wu=Ge({"src/components/colorscale/index.js"(Z,q){"use strict";var d=Tp(),x=ih();q.exports={moduleType:"component",name:"colorscale",attributes:Jl(),layoutAttributes:lb(),supplyLayoutDefaults:KA(),handleDefaults:bf(),crossTraceDefaults:JA(),calc:oh(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),iu=Ge({"src/traces/scatter/subtypes.js"(Z,q){"use strict";var d=ta(),x=nh().isTypedArraySpec;q.exports={hasLines:function(S){return S.visible&&S.mode&&S.mode.indexOf("lines")!==-1},hasMarkers:function(S){return S.visible&&(S.mode&&S.mode.indexOf("markers")!==-1||S.type==="splom")},hasText:function(S){return S.visible&&S.mode&&S.mode.indexOf("text")!==-1},isBubble:function(S){var E=S.marker;return d.isPlainObject(E)&&(d.isArrayOrTypedArray(E.size)||x(E.size))}}}}),z0=Ge({"src/traces/scatter/make_bubble_size_func.js"(Z,q){"use strict";var d=Bo();q.exports=function(S,E){E||(E=2);var e=S.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/E);return d(i)&&i>0?Math.max(i,r):0}}}}),Sh=Ge({"src/components/fx/helpers.js"(Z){"use strict";var q=ta();Z.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Z.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(ue=100,fe=fe.replace("-open","")),fe.indexOf("-dot")>0&&(ue+=200,fe=fe.replace("-dot","")),fe=l.symbolNames.indexOf(fe),fe>=0&&(fe+=ue)}return fe%100>=v||fe>=400?0:Math.floor(Math.max(fe,0))};function y(fe,ue,ie,Ee){var We=fe%100;return l.symbolFuncs[We](ue,ie,Ee)+(fe>=200?u:"")}var m=S("~f"),R={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(fe,ue,ie,Ee,We,Qe){var Xe=R[Ee];return L(fe,ue,ie,Xe.type,We,Qe,Xe.start,Xe.stop,!1,Xe.reversed)};function L(fe,ue,ie,Ee,We,Qe,Xe,Tt,St,zt){var Ut=We.length,br;Ee==="linear"?br={node:"linearGradient",attrs:{x1:Xe.x,y1:Xe.y,x2:Tt.x,y2:Tt.y,gradientUnits:St?"userSpaceOnUse":"objectBoundingBox"},reversed:zt}:Ee==="radial"&&(br={node:"radialGradient",reversed:zt});for(var hr=new Array(Ut),Or=0;Or=0&&fe.i===void 0&&(fe.i=Qe.i),ue.style("opacity",Ee.selectedOpacityFn?Ee.selectedOpacityFn(fe):fe.mo===void 0?Xe.opacity:fe.mo),Ee.ms2mrc){var St;fe.ms==="various"||Xe.size==="various"?St=3:St=Ee.ms2mrc(fe.ms),fe.mrc=St,Ee.selectedSizeFn&&(St=fe.mrc=Ee.selectedSizeFn(fe));var zt=l.symbolNumber(fe.mx||Xe.symbol)||0;fe.om=zt%200>=100;var Ut=Ue(fe,ie),br=Q(fe,ie);ue.attr("d",y(zt,St,Ut,br))}var hr=!1,Or,wr,Er;if(fe.so)Er=Tt.outlierwidth,wr=Tt.outliercolor,Or=Xe.outliercolor;else{var mt=(Tt||{}).width;Er=(fe.mlw+1||mt+1||(fe.trace?(fe.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in fe?wr=fe.mlcc=Ee.lineScale(fe.mlc):x.isArrayOrTypedArray(Tt.color)?wr=r.defaultLine:wr=Tt.color,x.isArrayOrTypedArray(Xe.color)&&(Or=r.defaultLine,hr=!0),"mc"in fe?Or=fe.mcc=Ee.markerScale(fe.mc):Or=Xe.color||Xe.colors||"rgba(0,0,0,0)",Ee.selectedColorFn&&(Or=Ee.selectedColorFn(fe))}let ze=fe.mld||(Tt||{}).dash;if(ze&&l.dashLine(ue,ze,Er),fe.om)ue.call(r.stroke,Or).style({"stroke-width":(Er||1)+"px",fill:"none"});else{ue.style("stroke-width",(fe.isBlank?0:Er)+"px");var Ze=Xe.gradient,we=fe.mgt;we?hr=!0:we=Ze&&Ze.type,x.isArrayOrTypedArray(we)&&(we=we[0],R[we]||(we=0));var ke=Xe.pattern,Be=l.getPatternAttr,He=ke&&(Be(ke.shape,fe.i,"")||Be(ke.path,fe.i,""));if(we&&we!=="none"){var nt=fe.mgc;nt?hr=!0:nt=Ze.color;var ot=ie.uid;hr&&(ot+="-"+fe.i),l.gradient(ue,We,ot,we,[[0,nt],[1,Or]],"fill")}else if(He){var Ft=!1,Mt=ke.fgcolor;!Mt&&Qe&&Qe.color&&(Mt=Qe.color,Ft=!0);var Et=Be(Mt,fe.i,Qe&&Qe.color||null),Ot=Be(ke.bgcolor,fe.i,null),sr=ke.fgopacity,ir=Be(ke.size,fe.i,8),ar=Be(ke.solidity,fe.i,.3);Ft=Ft||fe.mcc||x.isArrayOrTypedArray(ke.shape)||x.isArrayOrTypedArray(ke.path)||x.isArrayOrTypedArray(ke.bgcolor)||x.isArrayOrTypedArray(ke.fgcolor)||x.isArrayOrTypedArray(ke.size)||x.isArrayOrTypedArray(ke.solidity);var Mr=ie.uid;Ft&&(Mr+="-"+fe.i),l.pattern(ue,"point",We,Mr,He,ir,ar,fe.mcc,ke.fillmode,Ot,Et,sr)}else x.isArrayOrTypedArray(Or)?r.fill(ue,Or[fe.i]):r.fill(ue,Or);Er&&r.stroke(ue,wr)}},l.makePointStyleFns=function(fe){var ue={},ie=fe.marker;return ue.markerScale=l.tryColorscale(ie,""),ue.lineScale=l.tryColorscale(ie,"line"),t.traceIs(fe,"symbols")&&(ue.ms2mrc=p.isBubble(fe)?c(fe):function(){return(ie.size||6)/2}),fe.selectedpoints&&x.extendFlat(ue,l.makeSelectedPointStyleFns(fe)),ue},l.makeSelectedPointStyleFns=function(fe){var ue={},ie=fe.selected||{},Ee=fe.unselected||{},We=fe.marker||{},Qe=ie.marker||{},Xe=Ee.marker||{},Tt=We.opacity,St=Qe.opacity,zt=Xe.opacity,Ut=St!==void 0,br=zt!==void 0;(x.isArrayOrTypedArray(Tt)||Ut||br)&&(ue.selectedOpacityFn=function(ke){var Be=ke.mo===void 0?We.opacity:ke.mo;return ke.selected?Ut?St:Be:br?zt:f*Be});var hr=We.color,Or=Qe.color,wr=Xe.color;(Or||wr)&&(ue.selectedColorFn=function(ke){var Be=ke.mcc||hr;return ke.selected?Or||Be:wr||Be});var Er=We.size,mt=Qe.size,ze=Xe.size,Ze=mt!==void 0,we=ze!==void 0;return t.traceIs(fe,"symbols")&&(Ze||we)&&(ue.selectedSizeFn=function(ke){var Be=ke.mrc||Er/2;return ke.selected?Ze?mt/2:Be:we?ze/2:Be}),ue},l.makeSelectedTextStyleFns=function(fe){var ue={},ie=fe.selected||{},Ee=fe.unselected||{},We=fe.textfont||{},Qe=ie.textfont||{},Xe=Ee.textfont||{},Tt=We.color,St=Qe.color,zt=Xe.color;return ue.selectedTextColorFn=function(Ut){var br=Ut.tc||Tt;return Ut.selected?St||br:zt||(St?br:r.addOpacity(br,f))},ue},l.selectedPointStyle=function(fe,ue){if(!(!fe.size()||!ue.selectedpoints)){var ie=l.makeSelectedPointStyleFns(ue),Ee=ue.marker||{},We=[];ie.selectedOpacityFn&&We.push(function(Qe,Xe){Qe.style("opacity",ie.selectedOpacityFn(Xe))}),ie.selectedColorFn&&We.push(function(Qe,Xe){r.fill(Qe,ie.selectedColorFn(Xe))}),ie.selectedSizeFn&&We.push(function(Qe,Xe){var Tt=Xe.mx||Ee.symbol||0,St=ie.selectedSizeFn(Xe);Qe.attr("d",y(l.symbolNumber(Tt),St,Ue(Xe,ue),Q(Xe,ue))),Xe.mrc2=St}),We.length&&fe.each(function(Qe){for(var Xe=d.select(this),Tt=0;Tt0?ie:0}l.textPointStyle=function(fe,ue,ie){if(fe.size()){var Ee;if(ue.selectedpoints){var We=l.makeSelectedTextStyleFns(ue);Ee=We.selectedTextColorFn}var Qe=ue.texttemplate,Xe=ie._fullLayout;fe.each(function(Tt){var St=d.select(this),zt=Qe?x.extractOption(Tt,ue,"txt","texttemplate"):x.extractOption(Tt,ue,"tx","text");if(!zt&&zt!==0){St.remove();return}if(Qe){var Ut=ue._module.formatLabels,br=Ut?Ut(Tt,ue,Xe):{},hr={};T(hr,ue,Tt.i),zt=x.texttemplateString({data:[hr,Tt,ue._meta],fallback:ue.texttemplatefallback,labels:br,locale:Xe._d3locale,template:zt})}var Or=Tt.tp||ue.textposition,wr=N(Tt,ue),Er=Ee?Ee(Tt):Tt.tc||ue.textfont.color;St.call(l.font,{family:Tt.tf||ue.textfont.family,weight:Tt.tw||ue.textfont.weight,style:Tt.ty||ue.textfont.style,variant:Tt.tv||ue.textfont.variant,textcase:Tt.tC||ue.textfont.textcase,lineposition:Tt.tE||ue.textfont.lineposition,shadow:Tt.tS||ue.textfont.shadow,size:wr,color:Er}).text(zt).call(i.convertToTspans,ie).call(F,Or,wr,Tt.mrc)})}},l.selectedTextStyle=function(fe,ue){if(!(!fe.size()||!ue.selectedpoints)){var ie=l.makeSelectedTextStyleFns(ue);fe.each(function(Ee){var We=d.select(this),Qe=ie.selectedTextColorFn(Ee),Xe=Ee.tp||ue.textposition,Tt=N(Ee,ue);r.fill(We,Qe);var St=t.traceIs(ue,"bar-like");F(We,Xe,Tt,Ee.mrc2||Ee.mrc,St)})}};var O=.5;l.smoothopen=function(fe,ue){if(fe.length<3)return"M"+fe.join("L");var ie="M"+fe[0],Ee=[],We;for(We=1;We=St||ke>=Ut&&ke<=St)&&(Be<=br&&Be>=zt||Be>=br&&Be<=zt)&&(fe=[ke,Be])}return fe}l.applyBackoff=G,l.makeTester=function(){var fe=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(ie){ie.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ue=x.ensureSingle(fe,"path","js-reference-point",function(ie){ie.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=fe,l.testref=ue},l.savedBBoxes={};var Y=0,ee=1e4;l.bBox=function(fe,ue,ie){ie||(ie=V(fe));var Ee;if(ie){if(Ee=l.savedBBoxes[ie],Ee)return x.extendFlat({},Ee)}else if(fe.childNodes.length===1){var We=fe.childNodes[0];if(ie=V(We),ie){var Qe=+We.getAttribute("x")||0,Xe=+We.getAttribute("y")||0,Tt=We.getAttribute("transform");if(!Tt){var St=l.bBox(We,!1,ie);return Qe&&(St.left+=Qe,St.right+=Qe),Xe&&(St.top+=Xe,St.bottom+=Xe),St}if(ie+="~"+Qe+"~"+Xe+"~"+Tt,Ee=l.savedBBoxes[ie],Ee)return x.extendFlat({},Ee)}}var zt,Ut;ue?zt=fe:(Ut=l.tester.node(),zt=fe.cloneNode(!0),Ut.appendChild(zt)),d.select(zt).attr("transform",null).call(i.positionText,0,0);var br=zt.getBoundingClientRect(),hr=l.testref.node().getBoundingClientRect();ue||Ut.removeChild(zt);var Or={height:br.height,width:br.width,left:br.left-hr.left,top:br.top-hr.top,right:br.right-hr.left,bottom:br.bottom-hr.top};return Y>=ee&&(l.savedBBoxes={},Y=0),ie&&(l.savedBBoxes[ie]=Or),Y++,x.extendFlat({},Or)};function V(fe){var ue=fe.getAttribute("data-unformatted");if(ue!==null)return ue+fe.getAttribute("data-math")+fe.getAttribute("text-anchor")+fe.getAttribute("style")}l.setClipUrl=function(fe,ue,ie){fe.attr("clip-path",se(ue,ie))};function se(fe,ue){if(!fe)return null;var ie=ue._context,Ee=ie._exportedPlot?"":ie._baseUrl||"";return Ee?"url('"+Ee+"#"+fe+"')":"url(#"+fe+")"}l.getTranslate=function(fe){var ue=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ie=fe.attr?"attr":"getAttribute",Ee=fe[ie]("transform")||"",We=Ee.replace(ue,function(Qe,Xe,Tt){return[Xe,Tt].join(" ")}).split(" ");return{x:+We[0]||0,y:+We[1]||0}},l.setTranslate=function(fe,ue,ie){var Ee=/(\btranslate\(.*?\);?)/,We=fe.attr?"attr":"getAttribute",Qe=fe.attr?"attr":"setAttribute",Xe=fe[We]("transform")||"";return ue=ue||0,ie=ie||0,Xe=Xe.replace(Ee,"").trim(),Xe+=a(ue,ie),Xe=Xe.trim(),fe[Qe]("transform",Xe),Xe},l.getScale=function(fe){var ue=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ie=fe.attr?"attr":"getAttribute",Ee=fe[ie]("transform")||"",We=Ee.replace(ue,function(Qe,Xe,Tt){return[Xe,Tt].join(" ")}).split(" ");return{x:+We[0]||1,y:+We[1]||1}},l.setScale=function(fe,ue,ie){var Ee=/(\bscale\(.*?\);?)/,We=fe.attr?"attr":"getAttribute",Qe=fe.attr?"attr":"setAttribute",Xe=fe[We]("transform")||"";return ue=ue||1,ie=ie||1,Xe=Xe.replace(Ee,"").trim(),Xe+="scale("+ue+","+ie+")",Xe=Xe.trim(),fe[Qe]("transform",Xe),Xe};var ae=/\s*sc.*/;l.setPointGroupScale=function(fe,ue,ie){if(ue=ue||1,ie=ie||1,!!fe){var Ee=ue===1&&ie===1?"":"scale("+ue+","+ie+")";fe.each(function(){var We=(this.getAttribute("transform")||"").replace(ae,"");We+=Ee,We=We.trim(),this.setAttribute("transform",We)})}};var j=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(fe,ue,ie){fe&&fe.each(function(){var Ee,We=d.select(this),Qe=We.select("text");if(Qe.node()){var Xe=parseFloat(Qe.attr("x")||0),Tt=parseFloat(Qe.attr("y")||0),St=(We.attr("transform")||"").match(j);ue===1&&ie===1?Ee=[]:Ee=[a(Xe,Tt),"scale("+ue+","+ie+")",a(-Xe,-Tt)],St&&Ee.push(St),We.attr("transform",Ee.join(""))}})};function Q(fe,ue){var ie;return fe&&(ie=fe.mf),ie===void 0&&(ie=ue.marker&&ue.marker.standoff||0),!ue._geo&&!ue._xA?-ie:ie}l.getMarkerStandoff=Q;var re=Math.atan2,he=Math.cos,xe=Math.sin;function Te(fe,ue){var ie=ue[0],Ee=ue[1];return[ie*he(fe)-Ee*xe(fe),ie*xe(fe)+Ee*he(fe)]}var Le,Pe,qe,et,rt,$e;function Ue(fe,ue){var ie=fe.ma;ie===void 0&&(ie=ue.marker.angle,(!ie||x.isArrayOrTypedArray(ie))&&(ie=0));var Ee,We,Qe=ue.marker.angleref;if(Qe==="previous"||Qe==="north"){if(ue._geo){var Xe=ue._geo.project(fe.lonlat);Ee=Xe[0],We=Xe[1]}else{var Tt=ue._xA,St=ue._yA;if(Tt&&St)Ee=Tt.c2p(fe.x),We=St.c2p(fe.y);else return 90}if(ue._geo){var zt=fe.lonlat[0],Ut=fe.lonlat[1],br=ue._geo.project([zt,Ut+1e-5]),hr=ue._geo.project([zt+1e-5,Ut]),Or=re(hr[1]-We,hr[0]-Ee),wr=re(br[1]-We,br[0]-Ee),Er;if(Qe==="north")Er=ie/180*Math.PI;else if(Qe==="previous"){var mt=zt/180*Math.PI,ze=Ut/180*Math.PI,Ze=Le/180*Math.PI,we=Pe/180*Math.PI,ke=Ze-mt,Be=he(we)*xe(ke),He=xe(we)*he(ze)-he(we)*xe(ze)*he(ke);Er=-re(Be,He)-Math.PI,Le=zt,Pe=Ut}var nt=Te(Or,[he(Er),0]),ot=Te(wr,[xe(Er),0]);ie=re(nt[1]+ot[1],nt[0]+ot[0])/Math.PI*180,Qe==="previous"&&!($e===ue.uid&&fe.i===rt+1)&&(ie=null)}if(Qe==="previous"&&!ue._geo)if($e===ue.uid&&fe.i===rt+1&&E(Ee)&&E(We)){var Ft=Ee-qe,Mt=We-et,Et=ue.line&&ue.line.shape||"",Ot=Et.slice(Et.length-1);Ot==="h"&&(Mt=0),Ot==="v"&&(Ft=0),ie+=re(Mt,Ft)/Math.PI*180+90}else ie=null}return qe=Ee,et=We,rt=fe.i,$e=ue.uid,ie}l.getMarkerAngle=Ue}}),Ep=Ge({"src/components/titles/index.js"(Z,q){"use strict";var d=Oi(),x=Bo(),S=Uu(),E=Yi(),e=ta(),t=e.strTranslate,r=zo(),o=Bi(),a=Il(),i=Ed(),n=uf().OPPOSITE_SIDE,s=/ [XY][0-9]* /,h=1.6,f=1.6;function p(c,T,l){var _=c._fullLayout,w=l.propContainer,A=l.propName,M=l.placeholder,g=l.traceIndex,b=l.avoid||{},v=l.attributes,u=l.transform,y=l.containerGroup,m=1,R=w.title,L=(R&&R.text?R.text:"").trim(),z=!1,F=R&&R.font?R.font:{},N=F.family,O=F.size,P=F.color,U=F.weight,B=F.style,X=F.variant,$=F.textcase,le=F.lineposition,ce=F.shadow,ve=l.subtitlePropName,G=!!ve,Y=l.subtitlePlaceholder,ee=(w.title||{}).subtitle||{text:"",font:{}},V=(ee.text||"").trim(),se=!1,ae=1,j=ee.font,Q=j.family,re=j.size,he=j.color,xe=j.weight,Te=j.style,Le=j.variant,Pe=j.textcase,qe=j.lineposition,et=j.shadow,rt;A==="title.text"?rt="titleText":A.indexOf("axis")!==-1?rt="axisTitleText":A.indexOf("colorbar")!==-1&&(rt="colorbarTitleText");var $e=c._context.edits[rt];function Ue(hr,Or){return hr===void 0||Or===void 0?!1:hr.replace(s," % ")===Or.replace(s," % ")}L===""?m=0:Ue(L,M)&&($e||(L=""),m=.2,z=!0),G&&(V===""?ae=0:Ue(V,Y)&&($e||(V=""),ae=.2,se=!0)),l._meta?L=e.templateString(L,l._meta):_._meta&&(L=e.templateString(L,_._meta));var fe=L||V||$e,ue;y||(y=e.ensureSingle(_._infolayer,"g","g-"+T),ue=_._hColorbarMoveTitle);var ie=y.selectAll("text."+T).data(fe?[0]:[]);ie.enter().append("text"),ie.text(L).attr("class",T),ie.exit().remove();var Ee=null,We=T+"-subtitle",Qe=V||$e;if(G&&(Ee=y.selectAll("text."+We).data(Qe?[0]:[]),Ee.enter().append("text"),Ee.text(V).attr("class",We),Ee.exit().remove()),!fe)return y;function Xe(hr,Or){e.syncOrAsync([Tt,St],{title:hr,subtitle:Or})}function Tt(hr){var Or=hr.title,wr=hr.subtitle,Er;!u&&ue&&(u={}),u?(Er="",u.rotate&&(Er+="rotate("+[u.rotate,v.x,v.y]+")"),(u.offset||ue)&&(Er+=t(0,(u.offset||0)-(ue||0)))):Er=null,Or.attr("transform",Er);function mt(He){if(He){var nt=d.select(He.node().parentNode).select("."+We);if(!nt.empty()){var ot=He.node().getBBox();if(ot.height){var Ft=ot.y+ot.height+h*re;nt.attr("y",Ft)}}}}if(Or.style("opacity",m*o.opacity(P)).call(r.font,{color:o.rgb(P),size:d.round(O,2),family:N,weight:U,style:B,variant:X,textcase:$,shadow:ce,lineposition:le}).attr(v).call(a.convertToTspans,c,mt),wr&&!wr.empty()){var ze=y.select("."+T+"-math-group"),Ze=Or.node().getBBox(),we=ze.node()?ze.node().getBBox():void 0,ke=we?we.y+we.height+h*re:Ze.y+Ze.height+f*re,Be=e.extendFlat({},v,{y:ke});wr.attr("transform",Er),wr.style("opacity",ae*o.opacity(he)).call(r.font,{color:o.rgb(he),size:d.round(re,2),family:Q,weight:xe,style:Te,variant:Le,textcase:Pe,shadow:et,lineposition:qe}).attr(Be).call(a.convertToTspans,c)}return S.previousPromises(c)}function St(hr){var Or=hr.title,wr=d.select(Or.node().parentNode);if(b&&b.selection&&b.side&&L){wr.attr("transform",null);var Er=n[b.side],mt=b.side==="left"||b.side==="top"?-1:1,ze=x(b.pad)?b.pad:2,Ze=r.bBox(wr.node()),we={t:0,b:0,l:0,r:0},ke=c._fullLayout._reservedMargin;for(var Be in ke)for(var He in ke[Be]){var nt=ke[Be][He];we[He]=Math.max(we[He],nt)}var ot={left:we.l,top:we.t,right:_.width-we.r,bottom:_.height-we.b},Ft=b.maxShift||mt*(ot[b.side]-Ze[b.side]),Mt=0;if(Ft<0)Mt=Ft;else{var Et=b.offsetLeft||0,Ot=b.offsetTop||0;Ze.left-=Et,Ze.right-=Et,Ze.top-=Ot,Ze.bottom-=Ot,b.selection.each(function(){var ir=r.bBox(this);e.bBoxIntersect(Ze,ir,ze)&&(Mt=Math.max(Mt,mt*(ir[b.side]-Ze[Er])+ze))}),Mt=Math.min(Ft,Mt),w._titleScoot=Math.abs(Mt)}if(Mt>0||Ft<0){var sr={left:[-Mt,0],right:[Mt,0],top:[0,-Mt],bottom:[0,Mt]}[b.side];wr.attr("transform",t(sr[0],sr[1]))}}}ie.call(Xe,Ee);function zt(hr,Or){hr.text(Or).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if($e&&(L?ie.on(".opacity",null):(zt(ie,M),z=!0),ie.call(a.makeEditable,{gd:c}).on("edit",function(hr){g!==void 0?E.call("_guiRestyle",c,A,hr,g):E.call("_guiRelayout",c,A,hr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Xe)}).on("input",function(hr){this.text(hr||" ").call(a.positionText,v.x,v.y)}),G)){if(G&&!L){var Ut=ie.node().getBBox(),br=Ut.y+Ut.height+f*re;Ee.attr("y",br)}V?Ee.on(".opacity",null):(zt(Ee,Y),se=!0),Ee.call(a.makeEditable,{gd:c}).on("edit",function(hr){E.call("_guiRelayout",c,"title.subtitle.text",hr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Xe)}).on("input",function(hr){this.text(hr||" ").call(a.positionText,Ee.attr("x"),Ee.attr("y"))})}return ie.classed("js-placeholder",z),Ee&&!Ee.empty()&&Ee.classed("js-placeholder",se),y}q.exports={draw:p,SUBTITLE_PADDING_EM:f,SUBTITLE_PADDING_MATHJAX_EM:h}}}),Iv=Ge({"src/plots/cartesian/set_convert.js"(Z,q){"use strict";var d=Oi(),x=E0().utcFormat,S=ta(),E=S.numberFormat,e=Bo(),t=S.cleanNumber,r=S.ms2DateTime,o=S.dateTime2ms,a=S.ensureNumber,i=S.isArrayOrTypedArray,n=As(),s=n.FP_SAFE,h=n.BADNUM,f=n.LOG_CLIP,p=n.ONEWEEK,c=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,_=n.ONESEC,w=dc(),A=lf(),M=A.HOUR_PATTERN,g=A.WEEKDAY_PATTERN;function b(u){return Math.pow(10,u)}function v(u){return u!=null}q.exports=function(y,m){m=m||{};var R=y._id||"x",L=R.charAt(0);function z(V,se){if(V>0)return Math.log(V)/Math.LN10;if(V<=0&&se&&y.range&&y.range.length===2){var ae=y.range[0],j=y.range[1];return .5*(ae+j-2*f*Math.abs(ae-j))}else return h}function F(V,se,ae,j){if((j||{}).msUTC&&e(V))return+V;var Q=o(V,ae||y.calendar);if(Q===h)if(e(V)){V=+V;var re=Math.floor(S.mod(V+.05,1)*10),he=Math.round(V-re/10);Q=o(new Date(he))+re/10}else return h;return Q}function N(V,se,ae){return r(V,se,ae||y.calendar)}function O(V){return y._categories[Math.round(V)]}function P(V){if(v(V)){if(y._categoriesMap===void 0&&(y._categoriesMap={}),y._categoriesMap[V]!==void 0)return y._categoriesMap[V];y._categories.push(typeof V=="number"?String(V):V);var se=y._categories.length-1;return y._categoriesMap[V]=se,se}return h}function U(V,se){for(var ae=new Array(se),j=0;jy.range[1]&&(ae=!ae);for(var j=ae?-1:1,Q=j*V,re=0,he=0;heTe)re=he+1;else{re=Q<(xe+Te)/2?he:he+1;break}}var Le=y._B[re]||0;return isFinite(Le)?le(V,y._m2,Le):0},G=function(V){var se=y._rangebreaks.length;if(!se)return ce(V,y._m,y._b);for(var ae=0,j=0;jy._rangebreaks[j].pmax&&(ae=j+1);return ce(V,y._m2,y._B[ae])}}y.c2l=y.type==="log"?z:a,y.l2c=y.type==="log"?b:a,y.l2p=ve,y.p2l=G,y.c2p=y.type==="log"?function(V,se){return ve(z(V,se))}:ve,y.p2c=y.type==="log"?function(V){return b(G(V))}:G,["linear","-"].indexOf(y.type)!==-1?(y.d2r=y.r2d=y.d2c=y.r2c=y.d2l=y.r2l=t,y.c2d=y.c2r=y.l2d=y.l2r=a,y.d2p=y.r2p=function(V){return y.l2p(t(V))},y.p2d=y.p2r=G,y.cleanPos=a):y.type==="log"?(y.d2r=y.d2l=function(V,se){return z(t(V),se)},y.r2d=y.r2c=function(V){return b(t(V))},y.d2c=y.r2l=t,y.c2d=y.l2r=a,y.c2r=z,y.l2d=b,y.d2p=function(V,se){return y.l2p(y.d2r(V,se))},y.p2d=function(V){return b(G(V))},y.r2p=function(V){return y.l2p(t(V))},y.p2r=G,y.cleanPos=a):y.type==="date"?(y.d2r=y.r2d=S.identity,y.d2c=y.r2c=y.d2l=y.r2l=F,y.c2d=y.c2r=y.l2d=y.l2r=N,y.d2p=y.r2p=function(V,se,ae){return y.l2p(F(V,0,ae))},y.p2d=y.p2r=function(V,se,ae){return N(G(V),se,ae)},y.cleanPos=function(V){return S.cleanDate(V,h,y.calendar)}):y.type==="category"?(y.d2c=y.d2l=P,y.r2d=y.c2d=y.l2d=O,y.d2r=y.d2l_noadd=X,y.r2c=function(V){var se=$(V);return se!==void 0?se:y.fraction2r(.5)},y.l2r=y.c2r=a,y.r2l=$,y.d2p=function(V){return y.l2p(y.r2c(V))},y.p2d=function(V){return O(G(V))},y.r2p=y.d2p,y.p2r=G,y.cleanPos=function(V){return typeof V=="string"&&V!==""?V:a(V)}):y.type==="multicategory"&&(y.r2d=y.c2d=y.l2d=O,y.d2r=y.d2l_noadd=X,y.r2c=function(V){var se=X(V);return se!==void 0?se:y.fraction2r(.5)},y.r2c_just_indices=B,y.l2r=y.c2r=a,y.r2l=X,y.d2p=function(V){return y.l2p(y.r2c(V))},y.p2d=function(V){return O(G(V))},y.r2p=y.d2p,y.p2r=G,y.cleanPos=function(V){return Array.isArray(V)||typeof V=="string"&&V!==""?V:a(V)},y.setupMultiCategory=function(V){var se=y._traceIndices,ae,j,Q=y._matchGroup;if(Q&&y._categories.length===0){for(var re in Q)if(re!==R){var he=m[w.id2name(re)];se=se.concat(he._traceIndices)}}var xe=[[0,{}],[0,{}]],Te=[];for(ae=0;aehe[1]&&(j[re?0:1]=ae),j[0]===j[1]){var xe=y.l2r(se),Te=y.l2r(ae);if(se!==void 0){var Le=xe+1;ae!==void 0&&(Le=Math.min(Le,Te)),j[re?1:0]=Le}if(ae!==void 0){var Pe=Te+1;se!==void 0&&(Pe=Math.max(Pe,xe)),j[re?0:1]=Pe}}}},y.cleanRange=function(V,se){y._cleanRange(V,se),y.limitRange(V)},y._cleanRange=function(V,se){se||(se={}),V||(V="range");var ae=S.nestedProperty(y,V).get(),j,Q;if(y.type==="date"?Q=S.dfltRange(y.calendar):L==="y"?Q=A.DFLTRANGEY:y._name==="realaxis"?Q=[0,1]:Q=se.dfltRange||A.DFLTRANGEX,Q=Q.slice(),(y.rangemode==="tozero"||y.rangemode==="nonnegative")&&(Q[0]=0),!ae||ae.length!==2){S.nestedProperty(y,V).set(Q);return}var re=ae[0]===null,he=ae[1]===null;for(y.type==="date"&&!y.autorange&&(ae[0]=S.cleanDate(ae[0],h,y.calendar),ae[1]=S.cleanDate(ae[1],h,y.calendar)),j=0;j<2;j++)if(y.type==="date"){if(!S.isDateTime(ae[j],y.calendar)){y[V]=Q;break}if(y.r2l(ae[0])===y.r2l(ae[1])){var xe=S.constrain(y.r2l(ae[0]),S.MIN_MS+1e3,S.MAX_MS-1e3);ae[0]=y.l2r(xe-1e3),ae[1]=y.l2r(xe+1e3);break}}else{if(!e(ae[j]))if(!(re||he)&&e(ae[1-j]))ae[j]=ae[1-j]*(j?10:.1);else{y[V]=Q;break}if(ae[j]<-s?ae[j]=-s:ae[j]>s&&(ae[j]=s),ae[0]===ae[1]){var Te=Math.max(1,Math.abs(ae[0]*1e-6));ae[0]-=Te,ae[1]+=Te}}},y.setScale=function(V){var se=m._size;if(y.overlaying){var ae=w.getFromId({_fullLayout:m},y.overlaying);y.domain=ae.domain}var j=V&&y._r?"_r":"range",Q=y.calendar;y.cleanRange(j);var re=y.r2l(y[j][0],Q),he=y.r2l(y[j][1],Q),xe=L==="y";if(xe?(y._offset=se.t+(1-y.domain[1])*se.h,y._length=se.h*(y.domain[1]-y.domain[0]),y._m=y._length/(re-he),y._b=-y._m*he):(y._offset=se.l+y.domain[0]*se.w,y._length=se.w*(y.domain[1]-y.domain[0]),y._m=y._length/(he-re),y._b=-y._m*re),y._rangebreaks=[],y._lBreaks=0,y._m2=0,y._B=[],y.rangebreaks){var Te,Le;if(y._rangebreaks=y.locateBreaks(Math.min(re,he),Math.max(re,he)),y._rangebreaks.length){for(Te=0;Tehe&&(Pe=!Pe),Pe&&y._rangebreaks.reverse();var qe=Pe?-1:1;for(y._m2=qe*y._length/(Math.abs(he-re)-y._lBreaks),y._B.push(-y._m2*(xe?he:re)),Te=0;TeQ&&(Q+=7,reQ&&(Q+=24,re=j&&re=j&&V=Xe.min&&(ieXe.max&&(Xe.max=Ee),We=!1)}We&&he.push({min:ie,max:Ee})}};for(ae=0;ae_*2}function n(f){return Math.max(1,(f-1)/1e3)}function s(f,p){for(var c=f.length,T=n(c),l=0,_=0,w={},A=0;Al*2}function h(f){return E(f[0])&&E(f[1])}}}),uv=Ge({"src/plots/cartesian/autorange.js"(Z,q){"use strict";var d=Oi(),x=Bo(),S=ta(),E=As().FP_SAFE,e=Yi(),t=zo(),r=dc(),o=r.getFromId,a=r.isLinked;q.exports={applyAutorangeOptions:y,getAutoRange:i,makePadFn:s,doAutoRange:c,findExtremes:T,concatExtremes:p};function i(m,R){var L,z,F=[],N=m._fullLayout,O=s(N,R,0),P=s(N,R,1),U=p(m,R),B=U.min,X=U.max;if(B.length===0||X.length===0)return S.simpleMap(R.range,R.r2l);var $=B[0].val,le=X[0].val;for(L=1;L0&&(Te=se-O(Q)-P(re),Te>ae?Le/Te>j&&(he=Q,xe=re,j=Le/Te):Le/se>j&&(he={val:Q.val,nopad:1},xe={val:re.val,nopad:1},j=Le/se));function Pe(Ue,fe){return Math.max(Ue,P(fe))}if($===le){var qe=$-1,et=$+1;if(ee)if($===0)F=[0,1];else{var rt=($>0?X:B).reduce(Pe,0),$e=$/(1-Math.min(.5,rt/se));F=$>0?[0,$e]:[$e,0]}else V?F=[Math.max(0,qe),Math.max(1,et)]:F=[qe,et]}else ee?(he.val>=0&&(he={val:0,nopad:1}),xe.val<=0&&(xe={val:0,nopad:1})):V&&(he.val-j*O(he)<0&&(he={val:0,nopad:1}),xe.val<=0&&(xe={val:1,nopad:1})),j=(xe.val-he.val-n(R,Q.val,re.val))/(se-O(he)-P(xe)),F=[he.val-j*O(he),xe.val+j*P(xe)];return F=y(F,R),R.limitRange&&R.limitRange(),ve&&F.reverse(),S.simpleMap(F,R.l2r||Number)}function n(m,R,L){var z=0;if(m.rangebreaks)for(var F=m.locateBreaks(R,L),N=0;N0?L.ppadplus:L.ppadminus)||L.ppad||0),Q=ae((m._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),re=ae(L.vpadplus||L.vpad),he=ae(L.vpadminus||L.vpad);if(!B){if(V=1/0,se=-1/0,U)for($=0;$0&&(V=le),le>se&&le-E&&(V=le),le>se&&le=Le;$--)Te($);return{min:z,max:F,opts:L}}function l(m,R,L,z){w(m,R,L,z,M)}function _(m,R,L,z){w(m,R,L,z,g)}function w(m,R,L,z,F){for(var N=z.tozero,O=z.extrapad,P=!0,U=0;U=L&&(B.extrapad||!O)){P=!1;break}else F(R,B.val)&&B.pad<=L&&(O||!B.extrapad)&&(m.splice(U,1),U--)}if(P){var X=N&&R===0;m.push({val:R,pad:X?0:L,extrapad:X?!1:O})}}function A(m){return x(m)&&Math.abs(m)=R}function b(m,R){var L=R.autorangeoptions;return L&&L.minallowed!==void 0&&u(R,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(R,L.clipmin,L.clipmax)?Math.max(m,R.d2l(L.clipmin)):m}function v(m,R){var L=R.autorangeoptions;return L&&L.maxallowed!==void 0&&u(R,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(R,L.clipmin,L.clipmax)?Math.min(m,R.d2l(L.clipmax)):m}function u(m,R,L){return R!==void 0&&L!==void 0?(R=m.d2l(R),L=m.d2l(L),R=U&&(N=U,L=U),O<=U&&(O=U,z=U)}}return L=b(L,R),z=v(z,R),[L,z]}}}),Mo=Ge({"src/plots/cartesian/axes.js"(Z,q){"use strict";var d=Oi(),x=Bo(),S=Uu(),E=Yi(),e=ta(),t=e.strTranslate,r=Il(),o=Ep(),a=Bi(),i=zo(),n=Nf(),s=cb(),h=lf(),f=As(),p=f.ONEMAXYEAR,c=f.ONEAVGYEAR,T=f.ONEMINYEAR,l=f.ONEMAXQUARTER,_=f.ONEAVGQUARTER,w=f.ONEMINQUARTER,A=f.ONEMAXMONTH,M=f.ONEAVGMONTH,g=f.ONEMINMONTH,b=f.ONEWEEK,v=f.ONEDAY,u=v/2,y=f.ONEHOUR,m=f.ONEMIN,R=f.ONESEC,L=f.ONEMILLI,z=f.ONEMICROSEC,F=f.MINUS_SIGN,N=f.BADNUM,O={K:"zeroline"},P={K:"gridline",L:"path"},U={K:"minor-gridline",L:"path"},B={K:"tick",L:"path"},X={K:"tick",L:"text"},$={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},le=uf(),ce=le.MID_SHIFT,ve=le.CAP_SHIFT,G=le.LINE_SPACING,Y=le.OPPOSITE_SIDE,ee=3,V=q.exports={};V.setConvert=Iv();var se=F0(),ae=dc(),j=ae.idSort,Q=ae.isLinked;V.id2name=ae.id2name,V.name2id=ae.name2id,V.cleanId=ae.cleanId,V.list=ae.list,V.listIds=ae.listIds,V.getFromId=ae.getFromId,V.getFromTrace=ae.getFromTrace;var re=uv();V.getAutoRange=re.getAutoRange,V.findExtremes=re.findExtremes;var he=1e-4;function xe(gt){var it=(gt[1]-gt[0])*he;return[gt[0]-it,gt[1]+it]}V.coerceRef=function(gt,it,Rr,Ar,pr,kr){var zr=Ar.charAt(Ar.length-1),Ur=Rr._fullLayout._subplots[zr+"axis"],dt=Ar+"ref",qt={};return pr||(pr=Ur[0]||(typeof kr=="string"?kr:kr[0])),kr||(kr=pr),Ur=Ur.concat(Ur.map(function(fr){return fr+" domain"})),qt[dt]={valType:"enumerated",values:Ur.concat(kr?typeof kr=="string"?[kr]:kr:[]),dflt:pr},e.coerce(gt,it,qt,dt)},V.coerceRefArray=function(gt,it,Rr,Ar,pr,kr,zr){let Ur=Ar.charAt(Ar.length-1);var dt=Rr._fullLayout._subplots[Ur+"axis"];let qt=Ar+"ref";var fr=gt[qt];pr||(pr=dt[0]||(typeof kr=="string"?kr:kr[0])),dt=dt.concat(dt.map(da=>da+" domain")),dt=dt.concat(kr||[]),fr.length>zr?(e.warn("Array attribute "+qt+" has more entries than expected, truncating to "+zr),fr=fr.slice(0,zr)):fr.length2e-6||((Rr-gt._forceTick0)/gt._minDtick%1+1.000001)%1>2e-6)&&(gt._minDtick=0))},V.saveRangeInitial=function(gt,it){for(var Rr=V.list(gt,"",!0),Ar=!1,pr=0;prIr*.3||qt(Ar)||qt(pr))){var da=Rr.dtick/2;gt+=gt+dazr){var Ur=Number(Rr.slice(1));kr.exactYears>zr&&Ur%12===0?gt=V.tickIncrement(gt,"M6","reverse")+v*1.5:kr.exactMonths>zr?gt=V.tickIncrement(gt,"M1","reverse")+v*15.5:gt-=u;var dt=V.tickIncrement(gt,Rr);if(dt<=Ar)return dt}return gt}V.prepMinorTicks=function(gt,it,Rr){if(!it.minor.dtick){delete gt.dtick;var Ar=it.dtick&&x(it._tmin),pr;if(Ar){var kr=V.tickIncrement(it._tmin,it.dtick,!0);pr=[it._tmin,kr*.99+it._tmin*.01]}else{var zr=e.simpleMap(it.range,it.r2l);pr=[zr[0],.8*zr[0]+.2*zr[1]]}if(gt.range=e.simpleMap(pr,it.l2r),gt._isMinor=!0,V.prepTicks(gt,Rr),Ar){var Ur=x(it.dtick),dt=x(gt.dtick),qt=Ur?it.dtick:+it.dtick.substring(1),fr=dt?gt.dtick:+gt.dtick.substring(1);Ur&&dt?rt(qt,fr)?qt===2*b&&fr===2*v&&(gt.dtick=b):qt===2*b&&fr===3*v?gt.dtick=b:qt===b&&!(it._input.minor||{}).nticks?gt.dtick=v:$e(qt/fr,2.5)?gt.dtick=qt/2:gt.dtick=qt:String(it.dtick).charAt(0)==="M"?dt?gt.dtick="M1":rt(qt,fr)?qt>=12&&fr===2&&(gt.dtick="M3"):gt.dtick=it.dtick:String(gt.dtick).charAt(0)==="L"?String(it.dtick).charAt(0)==="L"?rt(qt,fr)||(gt.dtick=$e(qt/fr,2.5)?it.dtick/2:it.dtick):gt.dtick="D1":gt.dtick==="D2"&&+it.dtick>1&&(gt.dtick=1)}gt.range=it.range}it.minor._tick0Init===void 0&&(gt.tick0=it.tick0)};function rt(gt,it){return Math.abs((gt/it+.5)%1-.5)<.001}function $e(gt,it){return Math.abs(gt/it-1)<.001}V.prepTicks=function(gt,it){var Rr=e.simpleMap(gt.range,gt.r2l,void 0,void 0,it);if(gt.tickmode==="auto"||!gt.dtick){var Ar=gt.nticks,pr;Ar||(gt.type==="category"||gt.type==="multicategory"?(pr=gt.tickfont?e.bigFont(gt.tickfont.size||12):15,Ar=gt._length/pr):(pr=gt._id.charAt(0)==="y"?40:80,Ar=e.constrain(gt._length/pr,4,9)+1),gt._name==="radialaxis"&&(Ar*=2)),gt.minor&>.minor.tickmode!=="array"||gt.tickmode==="array"&&(Ar*=100),gt._roughDTick=Math.abs(Rr[1]-Rr[0])/Ar,V.autoTicks(gt,gt._roughDTick),gt._minDtick>0&>.dtick0?(kr=Ar-1,zr=Ar):(kr=Ar,zr=Ar);var Ur=gt[kr].value,dt=gt[zr].value,qt=Math.abs(dt-Ur),fr=Rr||qt,Ir=0;fr>=T?qt>=T&&qt<=p?Ir=qt:Ir=c:Rr===_&&fr>=w?qt>=w&&qt<=l?Ir=qt:Ir=_:fr>=g?qt>=g&&qt<=A?Ir=qt:Ir=M:Rr===b&&fr>=b?Ir=b:fr>=v?Ir=v:Rr===u&&fr>=u?Ir=u:Rr===y&&fr>=y&&(Ir=y);var da;Ir>=qt&&(Ir=qt,da=!0);var Ta=pr+Ir;if(it.rangebreaks&&Ir>0){for(var ua=84,ra=0,ha=0;hab&&(Ir=qt)}(Ir>0||Ar===0)&&(gt[Ar].periodX=pr+Ir/2)}}V.calcTicks=function(it,Rr){for(var Ar=it.type,pr=it.calendar,kr=it.ticklabelstep,zr=it.ticklabelmode==="period",Ur=it.range[0]>it.range[1],dt=!it.ticklabelindex||e.isArrayOrTypedArray(it.ticklabelindex)?it.ticklabelindex:[it.ticklabelindex],qt=e.simpleMap(it.range,it.r2l,void 0,void 0,Rr),fr=qt[1]=(jn?0:1);li--){var yi=!li;li?(it._dtickInit=it.dtick,it._tick0Init=it.tick0):(it.minor._dtickInit=it.minor.dtick,it.minor._tick0Init=it.minor.tick0);var gi=li?it:e.extendFlat({},it,it.minor);if(yi?V.prepMinorTicks(gi,it,Rr):V.prepTicks(gi,Rr),gi.tickmode==="array"){li?(ha=[],ua=We(it,!yi)):(pn=[],ra=We(it,!yi));continue}if(gi.tickmode==="sync"){ha=[],ua=Ee(it);continue}var Si=xe(qt),Gi=Si[0],io=Si[1],vo=x(gi.dtick),ms=Ar==="log"&&!(vo||gi.dtick.charAt(0)==="L"),pi=V.tickFirst(gi,Rr);if(li){if(it._tmin=pi,pi=io:Ai<=io;Ai=V.tickIncrement(Ai,$o,fr,pr)){if(li&&Fo++,gi.rangebreaks&&!fr){if(Ai=da)break}if(ha.length>Ta||Ai===lo)break;lo=Ai;var bo={value:Ai};li?(ms&&Ai!==(Ai|0)&&(bo.simpleLabel=!0),kr>1&&Fo%kr&&(bo.skipLabel=!0),ha.push(bo)):(bo.minor=!0,pn.push(bo))}}if(!pn||pn.length<2)dt=!1;else{var Hi=(pn[1].value-pn[0].value)*(Ur?-1:1);ti(Hi,it.tickformat)||(dt=!1)}if(!dt)_n=ha;else{var Pi=ha.concat(pn);zr&&ha.length&&(Pi=Pi.slice(1)),Pi=Pi.sort(function(Ts,Ws){return Ts.value-Ws.value}).filter(function(Ts,Ws,as){return Ws===0||Ts.value!==as[Ws-1].value});var ji=Pi.map(function(Ts,Ws){return Ts.minor===void 0&&!Ts.skipLabel?Ws:null}).filter(function(Ts){return Ts!==null});ji.forEach(function(Ts){dt.map(function(Ws){var as=Ts+Ws;as>=0&&as-1;Ii--){if(ha[Ii].drop){ha.splice(Ii,1);continue}ha[Ii].value=Xa(ha[Ii].value,it);var zs=it.c2p(ha[Ii].value);(gs?Ss>zs-Zo:Ssda||bsda&&(as.periodX=da),bspr&&dac)it/=c,Ar=pr(10),gt.dtick="M"+12*hr(it,Ar,Qe);else if(kr>M)it/=M,gt.dtick="M"+hr(it,1,Xe);else if(kr>v){if(gt.dtick=hr(it,v,gt._hasDayOfWeekBreaks?[1,2,7,14]:St),!Rr){var zr=V.getTickFormat(gt),Ur=gt.ticklabelmode==="period";Ur&&(gt._rawTick0=gt.tick0),/%[uVW]/.test(zr)?gt.tick0=e.dateTick0(gt.calendar,2):gt.tick0=e.dateTick0(gt.calendar,1),Ur&&(gt._dowTick0=gt.tick0)}}else kr>y?gt.dtick=hr(it,y,Xe):kr>m?gt.dtick=hr(it,m,Tt):kr>R?gt.dtick=hr(it,R,Tt):(Ar=pr(10),gt.dtick=hr(it,Ar,Qe))}else if(gt.type==="log"){gt.tick0=0;var dt=e.simpleMap(gt.range,gt.r2l);if(gt._isMinor&&(it*=1.5),it>.7)gt.dtick=Math.ceil(it);else if(Math.abs(dt[1]-dt[0])<1){var qt=1.5*Math.abs((dt[1]-dt[0])/it);it=Math.abs(Math.pow(10,dt[1])-Math.pow(10,dt[0]))/qt,Ar=pr(10),gt.dtick="L"+hr(it,Ar,Qe)}else gt.dtick=it>.3?"D2":"D1"}else gt.type==="category"||gt.type==="multicategory"?(gt.tick0=0,gt.dtick=Math.ceil(Math.max(it,1))):Ua(gt)?(gt.tick0=0,Ar=1,gt.dtick=hr(it,Ar,br)):(gt.tick0=0,Ar=pr(10),gt.dtick=hr(it,Ar,Qe));if(gt.dtick===0&&(gt.dtick=1),!x(gt.dtick)&&typeof gt.dtick!="string"){var fr=gt.dtick;throw gt.dtick=1,"ax.dtick error: "+String(fr)}};function Or(gt){var it=gt.dtick;if(gt._tickexponent=0,!x(it)&&typeof it!="string"&&(it=1),(gt.type==="category"||gt.type==="multicategory")&&(gt._tickround=null),gt.type==="date"){var Rr=gt.r2l(gt.tick0),Ar=gt.l2r(Rr).replace(/(^-|i)/g,""),pr=Ar.length;if(String(it).charAt(0)==="M")pr>10||Ar.slice(5)!=="01-01"?gt._tickround="d":gt._tickround=+it.slice(1)%12===0?"y":"m";else if(it>=v&&pr<=10||it>=v*15)gt._tickround="d";else if(it>=m&&pr<=16||it>=y)gt._tickround="M";else if(it>=R&&pr<=19||it>=m)gt._tickround="S";else{var kr=gt.l2r(Rr+it).replace(/^-/,"").length;gt._tickround=Math.max(pr,kr)-20,gt._tickround<0&&(gt._tickround=4)}}else if(x(it)||it.charAt(0)==="L"){var zr=gt.range.map(gt.r2d||Number);x(it)||(it=Number(it.slice(1))),gt._tickround=2-Math.floor(Math.log(it)/Math.LN10+.01);var Ur=Math.max(Math.abs(zr[0]),Math.abs(zr[1])),dt=Math.floor(Math.log(Ur)/Math.LN10+.01),qt=gt.minexponent===void 0?3:gt.minexponent;Math.abs(dt)>qt&&(ot(gt.exponentformat)&>.exponentformat!=="SI extended"&&!Ft(dt)||ot(gt.exponentformat)&>.exponentformat==="SI extended"&&!Mt(dt)?gt._tickexponent=3*Math.round((dt-1)/3):gt._tickexponent=dt)}else gt._tickround=null}V.tickIncrement=function(gt,it,Rr,Ar){var pr=Rr?-1:1;if(x(it))return e.increment(gt,pr*it);var kr=it.charAt(0),zr=pr*Number(it.slice(1));if(kr==="M")return e.incrementMonth(gt,zr,Ar);if(kr==="L")return Math.log(Math.pow(10,gt)+zr)/Math.LN10;if(kr==="D"){var Ur=it==="D2"?Ut:zt,dt=gt+pr*.01,qt=e.roundUp(e.mod(dt,1),Ur,Rr);return Math.floor(dt)+Math.log(d.round(Math.pow(10,qt),1))/Math.LN10}throw"unrecognized dtick "+String(it)},V.tickFirst=function(gt,it){var Rr=gt.r2l||Number,Ar=e.simpleMap(gt.range,Rr,void 0,void 0,it),pr=Ar[1]=0&&pn<=gt._length?ha:null};if(kr&&e.isArrayOrTypedArray(gt.ticktext)){var Ir=e.simpleMap(gt.range,gt.r2l),da=(Math.abs(Ir[1]-Ir[0])-(gt._lBreaks||0))/1e4;for(qt=0;qt"+Ur;else{var qt=an(gt),fr=gt._trueSide||gt.side;(!qt&&fr==="top"||qt&&fr==="bottom")&&(zr+="
")}it.text=zr}function mt(gt,it,Rr,Ar,pr){var kr=gt.dtick,zr=it.x,Ur=gt.tickformat,dt=typeof kr=="string"&&kr.charAt(0);if(pr==="never"&&(pr=""),Ar&&dt!=="L"&&(kr="L3",dt="L"),Ur||dt==="L")it.text=Ot(Math.pow(10,zr),gt,pr,Ar);else if(x(kr)||dt==="D"&&(gt.minorloglabels==="complete"||e.mod(zr+.01,1)<.1)){var qt;gt.minorloglabels==="complete"&&!(e.mod(zr+.01,1)<.1)&&(qt=!0,it.fontSize*=.75);var fr=Math.pow(10,zr).toExponential(0),Ir=fr.split("e"),da=+Ir[1],Ta=Math.abs(da),ua=gt.exponentformat;ua==="power"||ot(ua)&&ua!=="SI extended"&&Ft(da)||ot(ua)&&ua==="SI extended"&&Mt(da)?(it.text=Ir[0],Ta>0&&(it.text+="x10"),it.text==="1x10"&&(it.text="10"),da!==0&&da!==1&&(it.text+=""+(da>0?"":F)+Ta+""),it.fontSize*=1.25):(ua==="e"||ua==="E")&&Ta>2?it.text=Ir[0]+ua+(da>0?"+":F)+Ta:(it.text=Ot(Math.pow(10,zr),gt,"","fakehover"),kr==="D1"&>._id.charAt(0)==="y"&&(it.dy-=it.fontSize/6))}else if(dt==="D")it.text=gt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(zr,1)))),it.fontSize*=.75;else throw"unrecognized dtick "+String(kr);if(gt.dtick==="D1"){var ra=String(it.text).charAt(0);(ra==="0"||ra==="1")&&(gt._id.charAt(0)==="y"?it.dx-=it.fontSize/4:(it.dy+=it.fontSize/2,it.dx+=(gt.range[1]>gt.range[0]?1:-1)*it.fontSize*(zr<0?.5:.25)))}}function ze(gt,it){var Rr=gt._categories[Math.round(it.x)];Rr===void 0&&(Rr=""),it.text=String(Rr)}function Ze(gt,it,Rr){var Ar=Math.round(it.x),pr=gt._categories[Ar]||[],kr=pr[1]===void 0?"":String(pr[1]),zr=pr[0]===void 0?"":String(pr[0]);Rr?it.text=zr+" - "+kr:(it.text=kr,it.text2=zr)}function we(gt,it,Rr,Ar,pr){pr==="never"?pr="":gt.showexponent==="all"&&Math.abs(it.x/gt.dtick)<1e-6&&(pr="hide"),it.text=Ot(it.x,gt,pr,Ar)}function ke(gt,it,Rr,Ar,pr){if(gt.thetaunit==="radians"&&!Rr){var kr=it.x/180;if(kr===0)it.text="0";else{var zr=Be(kr);if(zr[1]>=100)it.text=Ot(e.deg2rad(it.x),gt,pr,Ar);else{var Ur=it.x<0;zr[1]===1?zr[0]===1?it.text="\u03C0":it.text=zr[0]+"\u03C0":it.text=["",zr[0],"","\u2044","",zr[1],"","\u03C0"].join(""),Ur&&(it.text=F+it.text)}}}else it.text=Ot(it.x,gt,pr,Ar)}function Be(gt){function it(Ur,dt){return Math.abs(Ur-dt)<=1e-6}function Rr(Ur,dt){return it(dt,0)?Ur:Rr(dt,Ur%dt)}function Ar(Ur){for(var dt=1;!it(Math.round(Ur*dt)/dt,Ur);)dt*=10;return dt}var pr=Ar(gt),kr=gt*pr,zr=Math.abs(Rr(kr,pr));return[Math.round(kr/zr),Math.round(pr/zr)]}var He=["f","p","n","\u03BC","m","","k","M","G","T"],nt=["q","r","y","z","a",...He,"P","E","Z","Y","R","Q"],ot=gt=>["SI","SI extended","B"].includes(gt);function Ft(gt){return gt>14||gt<-15}function Mt(gt){return gt>32||gt<-30}function Et(gt,it){return ot(it)?!!(it==="SI extended"&&Mt(gt)||it!=="SI extended"&&Ft(gt)):!1}function Ot(gt,it,Rr,Ar){var pr=gt<0,kr=it._tickround,zr=Rr||it.exponentformat||"B",Ur=it._tickexponent,dt=V.getTickFormat(it),qt=it.separatethousands;if(Ar){var fr={exponentformat:zr,minexponent:it.minexponent,dtick:it.showexponent==="none"?it.dtick:x(gt)&&Math.abs(gt)||1,range:it.showexponent==="none"?it.range.map(it.r2d):[0,gt||1]};Or(fr),kr=(Number(fr._tickround)||0)+4,Ur=fr._tickexponent,it.hoverformat&&(dt=it.hoverformat)}if(dt)return it._numFormat(dt)(gt).replace(/-/g,F);var Ir=Math.pow(10,-kr)/2;if(zr==="none"&&(Ur=0),gt=Math.abs(gt),gt"+ua+"":zr==="B"&&Ur===9?gt+="B":ot(zr)&&(gt+=zr==="SI extended"?nt[Ur/3+10]:He[Ur/3+5])}return pr?F+gt:gt}V.getTickFormat=function(gt){var it;function Rr(dt){return typeof dt!="string"?dt:Number(dt.replace("M",""))*M}function Ar(dt,qt){var fr=["L","D"];if(typeof dt==typeof qt){if(typeof dt=="number")return dt-qt;var Ir=fr.indexOf(dt.charAt(0)),da=fr.indexOf(qt.charAt(0));return Ir===da?Number(dt.replace(/(L|D)/g,""))-Number(qt.replace(/(L|D)/g,"")):Ir-da}else return typeof dt=="number"?1:-1}function pr(dt,qt,fr){var Ir=fr||function(ua){return ua},da=qt[0],Ta=qt[1];return(!da&&typeof da!="number"||Ir(da)<=Ir(dt))&&(!Ta&&typeof Ta!="number"||Ir(Ta)>=Ir(dt))}function kr(dt,qt){var fr=qt[0]===null,Ir=qt[1]===null,da=Ar(dt,qt[0])>=0,Ta=Ar(dt,qt[1])<=0;return(fr||da)&&(Ir||Ta)}var zr,Ur;if(gt.tickformatstops&>.tickformatstops.length>0)switch(gt.type){case"date":case"linear":{for(it=0;it=0&&pr.unshift(pr.splice(fr,1).shift())}});var Ur={false:{left:0,right:0}};return e.syncOrAsync(pr.map(function(dt){return function(){if(dt){var qt=V.getFromId(gt,dt);Rr||(Rr={}),Rr.axShifts=Ur,Rr.overlayingShiftedAx=zr;var fr=V.drawOne(gt,qt,Rr);return qt._shiftPusher&&Zn(qt,qt._fullDepth||0,Ur,!0),qt._r=qt.range.slice(),qt._rl=e.simpleMap(qt._r,qt.r2l),fr}}}))},V.drawOne=function(gt,it,Rr){Rr=Rr||{};var Ar=Rr.axShifts||{},pr=Rr.overlayingShiftedAx||[],kr,zr,Ur;it.setScale();var dt=gt._fullLayout,qt=it._id,fr=qt.charAt(0),Ir=V.counterLetter(qt),da=dt._plots[it._mainSubplot],Ta=it.zerolinelayer==="above traces";if(!da)return;if(it._shiftPusher=it.autoshift||pr.indexOf(it._id)!==-1||pr.indexOf(it.overlaying)!==-1,it._shiftPusher&it.anchor==="free"){var ua=it.linewidth/2||0;it.ticks==="inside"&&(ua+=it.ticklen),Zn(it,ua,Ar,!0),Zn(it,it.shift||0,Ar,!1)}(Rr.skipTitle!==!0||it._shift===void 0)&&(it._shift=Wn(it,Ar));var ra=da[fr+"axislayer"],ha=it._mainLinePosition,pn=ha+=it._shift,_n=it._mainMirrorPosition,jn=it._vals=V.calcTicks(it),li=[it.mirror,pn,_n].join("_");for(kr=0;kr0?bs.bottom-Ws:0,as))));var Rl=0,Vu=0;if(it._shiftPusher&&(Rl=Math.max(as,bs.height>0?Ki==="l"?Ws-bs.left:bs.right-Ws:0),it.title.text!==dt._dfltTitle[fr]&&(Vu=(it._titleStandoff||0)+(it._titleScoot||0),Ki==="l"&&(Vu+=ba(it))),it._fullDepth=Math.max(Rl,Vu)),it.automargin){Go={x:0,y:0,r:0,l:0,t:0,b:0};var Ul=[0,1],Ic=typeof it._shift=="number"?it._shift:0;if(fr==="x"){if(Ki==="b"?Go[Ki]=it._depth:(Go[Ki]=it._depth=Math.max(bs.width>0?Ws-bs.top:0,as),Ul.reverse()),bs.width>0){var rc=bs.right-(it._offset+it._length);rc>0&&(Go.xr=1,Go.r=rc);var ys=it._offset-bs.left;ys>0&&(Go.xl=0,Go.l=ys)}}else if(Ki==="l"?(it._depth=Math.max(bs.height>0?Ws-bs.left:0,as),Go[Ki]=it._depth-Ic):(it._depth=Math.max(bs.height>0?bs.right-Ws:0,as),Go[Ki]=it._depth+Ic,Ul.reverse()),bs.height>0){var Du=bs.bottom-(it._offset+it._length);Du>0&&(Go.yb=0,Go.b=Du);var oc=it._offset-bs.top;oc>0&&(Go.yt=1,Go.t=oc)}Go[Ir]=it.anchor==="free"?it.position:it._anchorAxis.domain[Ul[0]],it.title.text!==dt._dfltTitle[fr]&&(Go[Ki]+=ba(it)+(it.title.standoff||0)),it.mirror&&it.anchor!=="free"&&(ns={x:0,y:0,r:0,l:0,t:0,b:0},ns[Ts]=it.linewidth,it.mirror&&it.mirror!==!0&&(ns[Ts]+=as),it.mirror===!0||it.mirror==="ticks"?ns[Ir]=it._anchorAxis.domain[Ul[1]]:(it.mirror==="all"||it.mirror==="allticks")&&(ns[Ir]=[it._counterDomainMin,it._counterDomainMax][Ul[1]]))}Nl&&(fl=E.getComponentMethod("rangeslider","autoMarginOpts")(gt,it)),typeof it.automargin=="string"&&(sr(Go,it.automargin),sr(ns,it.automargin)),S.autoMargin(gt,Xt(it),Go),S.autoMargin(gt,Pr(it),ns),S.autoMargin(gt,Yr(it),fl)}),e.syncOrAsync(oo)}};function sr(gt,it){if(gt){var Rr=Object.keys($).reduce(function(Ar,pr){return it.indexOf(pr)!==-1&&$[pr].forEach(function(kr){Ar[kr]=1}),Ar},{});Object.keys(gt).forEach(function(Ar){Rr[Ar]||(Ar.length===1?gt[Ar]=0:delete gt[Ar])})}}function ir(gt,it){var Rr=[],Ar,pr=function(kr,zr){var Ur=kr.xbnd[zr];Ur!==null&&Rr.push(e.extendFlat({},kr,{x:Ur}))};if(it.length){for(Ar=0;Argt.range[1],Ur=gt.ticklabelposition&>.ticklabelposition.indexOf("inside")!==-1,dt=!Ur;if(Rr){var qt=zr?-1:1;Rr=Rr*qt}if(Ar){var fr=gt.side,Ir=Ur&&(fr==="top"||fr==="left")||dt&&(fr==="bottom"||fr==="right")?1:-1;Ar=Ar*Ir}return gt._id.charAt(0)==="x"?function(da){return t(pr+gt._offset+gt.l2p(Ca(da))+Rr,kr+Ar)}:function(da){return t(kr+Ar,pr+gt._offset+gt.l2p(Ca(da))+Rr)}};function Ca(gt){return gt.periodX!==void 0?gt.periodX:gt.x}function Aa(gt){var it=gt.ticklabelposition||"",Rr=gt.tickson||"",Ar=function(ua){return it.indexOf(ua)!==-1},pr=Ar("top"),kr=Ar("left"),zr=Ar("right"),Ur=Ar("bottom"),dt=Ar("inside"),qt=Rr!=="boundaries"&&(Ur||kr||pr||zr);if(!qt&&!dt)return[0,0];var fr=gt.side,Ir=qt?(gt.tickwidth||0)/2:0,da=ee,Ta=gt.tickfont?gt.tickfont.size:12;return(Ur||pr)&&(Ir+=Ta*ve,da+=(gt.linewidth||0)/2),(kr||zr)&&(Ir+=(gt.linewidth||0)/2,da+=ee),dt&&fr==="top"&&(da-=Ta*(1-ve)),(kr||pr)&&(Ir=-Ir),(fr==="bottom"||fr==="right")&&(da=-da),[qt?Ir:0,dt?da:0]}V.makeTickPath=function(gt,it,Rr,Ar){Ar||(Ar={});var pr=Ar.minor;if(pr&&!gt.minor)return"";var kr=Ar.len!==void 0?Ar.len:pr?gt.minor.ticklen:gt.ticklen,zr=gt._id.charAt(0),Ur=(gt.linewidth||1)/2;return zr==="x"?"M0,"+(it+Ur*Rr)+"v"+kr*Rr:"M"+(it+Ur*Rr)+",0h"+kr*Rr},V.makeLabelFns=function(gt,it,Rr){var Ar=gt.ticklabelposition||"",pr=gt.tickson||"",kr=function(lo){return Ar.indexOf(lo)!==-1},zr=kr("top"),Ur=kr("left"),dt=kr("right"),qt=kr("bottom"),fr=pr!=="boundaries"&&(qt||Ur||zr||dt),Ir=kr("inside"),da=Ar==="inside"&>.ticks==="inside"||!Ir&>.ticks==="outside"&&pr!=="boundaries",Ta=0,ua=0,ra=da?gt.ticklen:0;if(Ir?ra*=-1:fr&&(ra=0),da&&(Ta+=ra,Rr)){var ha=e.deg2rad(Rr);Ta=ra*Math.cos(ha)+1,ua=ra*Math.sin(ha)}gt.showticklabels&&(da||gt.showline)&&(Ta+=.2*gt.tickfont.size),Ta+=(gt.linewidth||1)/2*(Ir?-1:1);var pn={labelStandoff:Ta,labelShift:ua},_n,jn,li,yi,gi=0,Si=gt.side,Gi=gt._id.charAt(0),io=gt.tickangle,vo;if(Gi==="x")vo=!Ir&&Si==="bottom"||Ir&&Si==="top",yi=vo?1:-1,Ir&&(yi*=-1),_n=ua*yi,jn=it+Ta*yi,li=vo?1:-.2,Math.abs(io)===90&&(Ir?li+=ce:io===-90&&Si==="bottom"?li=ve:io===90&&Si==="top"?li=ce:li=.5,gi=ce/2*(io/90)),pn.xFn=function(lo){return lo.dx+_n+gi*lo.fontSize},pn.yFn=function(lo){return lo.dy+jn+lo.fontSize*li},pn.anchorFn=function(lo,Ai){if(fr){if(Ur)return"end";if(dt)return"start"}return!x(Ai)||Ai===0||Ai===180?"middle":Ai*yi<0!==Ir?"end":"start"},pn.heightFn=function(lo,Ai,Fo){return Ai<-60||Ai>60?-.5*Fo:gt.side==="top"!==Ir?-Fo:0};else if(Gi==="y"){if(vo=!Ir&&Si==="left"||Ir&&Si==="right",yi=vo?1:-1,Ir&&(yi*=-1),_n=Ta,jn=ua*yi,li=0,!Ir&&Math.abs(io)===90&&(io===-90&&Si==="left"||io===90&&Si==="right"?li=ve:li=.5),Ir){var ms=x(io)?+io:0;if(ms!==0){var pi=e.deg2rad(ms);gi=Math.abs(Math.sin(pi))*ve*yi,li=0}}pn.xFn=function(lo){return lo.dx+it-(_n+lo.fontSize*li)*yi+gi*lo.fontSize},pn.yFn=function(lo){return lo.dy+jn+lo.fontSize*ce},pn.anchorFn=function(lo,Ai){return x(Ai)&&Math.abs(Ai)===90?"middle":vo?"end":"start"},pn.heightFn=function(lo,Ai,Fo){return gt.side==="right"&&(Ai*=-1),Ai<-30?-Fo:Ai<30?-.5*Fo:0}}return pn};function Da(gt){return[gt.text,gt.x,gt.axInfo,gt.font,gt.fontSize,gt.fontColor].join("_")}V.drawTicks=function(gt,it,Rr){Rr=Rr||{};var Ar=it._id+"tick",pr=[].concat(it.minor&&it.minor.ticks?Rr.vals.filter(function(zr){return zr.minor&&!zr.noTick}):[]).concat(it.ticks?Rr.vals.filter(function(zr){return!zr.minor&&!zr.noTick}):[]),kr=Rr.layer.selectAll("path."+Ar).data(pr,Da);kr.exit().remove(),kr.enter().append("path").classed(Ar,1).classed("ticks",1).classed("crisp",Rr.crisp!==!1).each(function(zr){return a.stroke(d.select(this),zr.minor?it.minor.tickcolor:it.tickcolor)}).style("stroke-width",function(zr){return i.crispRound(gt,zr.minor?it.minor.tickwidth:it.tickwidth,1)+"px"}).attr("d",Rr.path).style("display",null),Sa(it,[B]),kr.attr("transform",Rr.transFn)},V.drawGrid=function(gt,it,Rr){if(Rr=Rr||{},it.tickmode!=="sync"){var Ar=it._id+"grid",pr=it.minor&&it.minor.showgrid,kr=pr?Rr.vals.filter(function(pn){return pn.minor}):[],zr=it.showgrid?Rr.vals.filter(function(pn){return!pn.minor}):[],Ur=Rr.counterAxis;if(Ur&&V.shouldShowZeroLine(gt,it,Ur))for(var dt=it.tickmode==="array",qt=0;qt=0;ua--){var ra=ua?da:Ta;if(ra){var ha=ra.selectAll("path."+Ar).data(ua?zr:kr,Da);ha.exit().remove(),ha.enter().append("path").classed(Ar,1).classed("crisp",Rr.crisp!==!1),ha.attr("transform",Rr.transFn).attr("d",Rr.path).each(function(pn){return a.stroke(d.select(this),pn.minor?it.minor.gridcolor:it.gridcolor||"#ddd")}).style("stroke-dasharray",function(pn){return i.dashStyle(pn.minor?it.minor.griddash:it.griddash,pn.minor?it.minor.gridwidth:it.gridwidth)}).style("stroke-width",function(pn){return(pn.minor?Ir:it._gw)+"px"}).style("display",null),typeof Rr.path=="function"&&ha.attr("d",Rr.path)}}Sa(it,[P,U])}},V.drawZeroLine=function(gt,it,Rr){Rr=Rr||Rr;var Ar=it._id+"zl",pr=V.shouldShowZeroLine(gt,it,Rr.counterAxis),kr=Rr.layer.selectAll("path."+Ar).data(pr?[{x:0,id:it._id}]:[]);kr.exit().remove(),kr.enter().append("path").classed(Ar,1).classed("zl",1).classed("crisp",Rr.crisp!==!1).each(function(){Rr.layer.selectAll("path").sort(function(zr,Ur){return j(zr.id,Ur.id)})}),kr.attr("transform",Rr.transFn).attr("d",Rr.path).call(a.stroke,it.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(gt,it.zerolinewidth,it._gw||1)+"px").style("display",null),Sa(it,[O])},V.drawLabels=function(gt,it,Rr){Rr=Rr||{};var Ar=gt._fullLayout,pr=it._id,kr=it.zerolinelayer==="above traces",zr=Rr.cls||pr+"tick",Ur=Rr.vals.filter(function(Hi){return Hi.text}),dt=Rr.labelFns,qt=Rr.secondary?0:it.tickangle,fr=(it._prevTickAngles||{})[zr],Ir=Rr.layer.selectAll("g."+zr).data(it.showticklabels?Ur:[],Da),da=[];Ir.enter().append("g").classed(zr,1).append("text").attr("text-anchor","middle").each(function(Hi){var Pi=d.select(this),ji=gt._promises.length;Pi.call(r.positionText,dt.xFn(Hi),dt.yFn(Hi)).call(i.font,{family:Hi.font,size:Hi.fontSize,color:Hi.fontColor,weight:Hi.fontWeight,style:Hi.fontStyle,variant:Hi.fontVariant,textcase:Hi.fontTextcase,lineposition:Hi.fontLineposition,shadow:Hi.fontShadow}).text(Hi.text).call(r.convertToTspans,gt),gt._promises[ji]?da.push(gt._promises.pop().then(function(){Ta(Pi,qt)})):Ta(Pi,qt)}),Sa(it,[X]),Ir.exit().remove(),Rr.repositionOnUpdate&&Ir.each(function(Hi){d.select(this).select("text").call(r.positionText,dt.xFn(Hi),dt.yFn(Hi))});function Ta(Hi,Pi){Hi.each(function(ji){var Uo=d.select(this),Ko=Uo.select(".text-math-group"),us=dt.anchorFn(ji,Pi),ko=Rr.transFn.call(Uo.node(),ji)+(x(Pi)&&+Pi!=0?" rotate("+Pi+","+dt.xFn(ji)+","+(dt.yFn(ji)-ji.fontSize/2)+")":""),zn=r.lineCount(Uo),_i=G*ji.fontSize,xs=dt.heightFn(ji,x(Pi)?+Pi:0,(zn-1)*_i);if(xs&&(ko+=t(0,xs)),Ko.empty()){var Qo=Uo.select("text");Qo.attr({transform:ko,"text-anchor":us}),Qo.style("display",null),it._adjustTickLabelsOverflow&&it._adjustTickLabelsOverflow()}else{var Ii=i.bBox(Ko.node()).width,gs=Ii*{end:-.5,start:.5}[us];Ko.attr("transform",ko+t(gs,0))}})}it._adjustTickLabelsOverflow=function(){var Hi=it.ticklabeloverflow;if(!(!Hi||Hi==="allow")){var Pi=Hi.indexOf("hide")!==-1,ji=it._id.charAt(0)==="x",Uo=0,Ko=ji?gt._fullLayout.width:gt._fullLayout.height;if(Hi.indexOf("domain")!==-1){var us=e.simpleMap(it.range,it.r2l);Uo=it.l2p(us[0])+it._offset,Ko=it.l2p(us[1])+it._offset}var ko=Math.min(Uo,Ko),zn=Math.max(Uo,Ko),_i=it.side,xs=1/0,Qo=-1/0;Ir.each(function(Ss){var zs=d.select(this),ui=zs.select(".text-math-group");if(ui.empty()){var po=i.bBox(zs.node()),oo=0;ji?(po.right>zn||po.leftzn||po.top+(it.tickangle?0:Ss.fontSize/4)it["_visibleLabelMin_"+us._id]?zs.style("display","none"):zn.K==="tick"&&!ko&&zs.node().style.display!=="none"&&zs.style("display",null)})})})})},Ta(Ir,fr+1?fr:qt);function ua(){return da.length&&Promise.all(da)}var ra=null;function ha(){if(Ta(Ir,qt),Ur.length&&it.autotickangles&&(it.type!=="log"||String(it.dtick).charAt(0)!=="D")){ra=it.autotickangles[0];var Hi=0,Pi=[],ji,Uo=1;Ir.each(function(Go){Hi=Math.max(Hi,Go.fontSize);var ns=it.l2p(Go.x),fl=Ht(this),Rl=i.bBox(fl.node());Uo=Math.max(Uo,r.lineCount(fl)),Pi.push({top:0,bottom:10,height:10,left:ns-Rl.width/2,right:ns+Rl.width/2+2,width:Rl.width+2})});var Ko=(it.tickson==="boundaries"||it.showdividers)&&!Rr.secondary,us=Ur.length,ko=Math.abs((Ur[us-1].x-Ur[0].x)*it._m)/(us-1),zn=Ko?ko/2:ko,_i=Ko?it.ticklen:Hi*1.25*Uo,xs=Math.sqrt(Math.pow(zn,2)+Math.pow(_i,2)),Qo=zn/xs,Ii=it.autotickangles.map(function(Go){return Go*Math.PI/180}),gs=Ii.find(function(Go){return Math.abs(Math.cos(Go))<=Qo});gs===void 0&&(gs=Ii.reduce(function(Go,ns){return Math.abs(Math.cos(Go))No*Fo&&(pi=Fo,io[Gi]=vo[Gi]=lo[Gi])}var $o=Math.abs(pi-ms);$o-yi>0?($o-=yi,yi*=1+yi/$o):yi=0,it._id.charAt(0)!=="y"&&(yi=-yi),io[Si]=jn.p2r(jn.r2p(vo[Si])+gi*yi),jn.autorange==="min"||jn.autorange==="max reversed"?(io[0]=null,jn._rangeInitial0=void 0,jn._rangeInitial1=void 0):(jn.autorange==="max"||jn.autorange==="min reversed")&&(io[1]=null,jn._rangeInitial0=void 0,jn._rangeInitial1=void 0),Ar._insideTickLabelsUpdaterange[jn._name+".range"]=io}var bo=e.syncOrAsync(pn);return bo&&bo.then&>._promises.push(bo),bo};function Ba(gt,it,Rr){var Ar=it._id+"divider",pr=Rr.vals,kr=Rr.layer.selectAll("path."+Ar).data(pr,Da);kr.exit().remove(),kr.enter().insert("path",":first-child").classed(Ar,1).classed("crisp",1).call(a.stroke,it.dividercolor).style("stroke-width",i.crispRound(gt,it.dividerwidth,1)+"px"),kr.attr("transform",Rr.transFn).attr("d",Rr.path)}V.getPxPosition=function(gt,it){var Rr=gt._fullLayout._size,Ar=it._id.charAt(0),pr=it.side,kr;if(it.anchor!=="free"?kr=it._anchorAxis:Ar==="x"?kr={_offset:Rr.t+(1-(it.position||0))*Rr.h,_length:0}:Ar==="y"&&(kr={_offset:Rr.l+(it.position||0)*Rr.w+it._shift,_length:0}),pr==="top"||pr==="left")return kr._offset;if(pr==="bottom"||pr==="right")return kr._offset+kr._length};function ba(gt){var it=gt.title.font.size,Rr=(gt.title.text.match(r.BR_TAG_ALL)||[]).length;return gt.title.hasOwnProperty("standoff")?it*(ve+Rr*G):Rr?it*(Rr+1)*G:it}function rn(gt,it){var Rr=gt._fullLayout,Ar=it._id,pr=Ar.charAt(0),kr=it.title.font.size,zr,Ur=(it.title.text.match(r.BR_TAG_ALL)||[]).length;if(it.title.hasOwnProperty("standoff"))it.side==="bottom"||it.side==="right"?zr=it._depth+it.title.standoff+kr*ve:(it.side==="top"||it.side==="left")&&(zr=it._depth+it.title.standoff+kr*(ce+Ur*G));else{var dt=an(it);if(it.type==="multicategory")zr=it._depth;else{var qt=1.5*kr;dt&&(qt=.5*kr,it.ticks==="outside"&&(qt+=it.ticklen)),zr=10+qt+(it.linewidth?it.linewidth-1:0)}dt||(pr==="x"?zr+=it.side==="top"?kr*(it.showticklabels?1:0):kr*(it.showticklabels?1.5:.5):zr+=it.side==="right"?kr*(it.showticklabels?1:.5):kr*(it.showticklabels?.5:0))}var fr=V.getPxPosition(gt,it),Ir,da,Ta;pr==="x"?(da=it._offset+it._length/2,Ta=it.side==="top"?fr-zr:fr+zr):(Ta=it._offset+it._length/2,da=it.side==="right"?fr+zr:fr-zr,Ir={rotate:"-90",offset:0});var ua;if(it.type!=="multicategory"){var ra=it._selections[it._id+"tick"];if(ua={selection:ra,side:it.side},ra&&ra.node()&&ra.node().parentNode){var ha=i.getTranslate(ra.node().parentNode);ua.offsetLeft=ha.x,ua.offsetTop=ha.y}it.title.hasOwnProperty("standoff")&&(ua.pad=0)}return it._titleStandoff=zr,o.draw(gt,Ar+"title",{propContainer:it,propName:it._name+".title.text",placeholder:Rr._dfltTitle[pr],avoid:ua,transform:Ir,attributes:{x:da,y:Ta,"text-anchor":"middle"}})}V.shouldShowZeroLine=function(gt,it,Rr){var Ar=e.simpleMap(it.range,it.r2l);return Ar[0]*Ar[1]<=0&&it.zeroline&&(it.type==="linear"||it.type==="-")&&!(it.rangebreaks&&it.maskBreaks(0)===N)&&(vn(it,0)||!Wt(gt,it,Rr,Ar)||Lt(gt,it))},V.clipEnds=function(gt,it){return it.filter(function(Rr){return vn(gt,Rr.x)})};function vn(gt,it){var Rr=gt.l2p(it);return Rr>1&&Rr1)for(pr=1;pr=pr.min&>=z:/%L/.test(it)?gt>=L:/%[SX]/.test(it)?gt>=R:/%M/.test(it)?gt>=m:/%[HI]/.test(it)?gt>=y:/%p/.test(it)?gt>=u:/%[Aadejuwx]/.test(it)?gt>=v:/%[UVW]/.test(it)?gt>=b:/%[Bbm]/.test(it)?gt>=g:/%[q]/.test(it)?gt>=w:/%[Yy]/.test(it)?gt>=T:!0}}}),vb=Ge({"src/plots/cartesian/autorange_options_defaults.js"(Z,q){"use strict";q.exports=function(x,S,E){var e,t;if(E){var r=S==="reversed"||S==="min reversed"||S==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),db=Ge({"src/plots/cartesian/range_defaults.js"(Z,q){"use strict";var d=vb();q.exports=function(S,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=E.getAutorangeDflt(a,t),s=e("autorange",n),h;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete E.range,E.autorange=!0,h=!0),h||(n=E.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),QA=Ge({"node_modules/mouse-event-offset/index.js"(Z,q){var d={left:0,top:0};q.exports=x;function x(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,a=S(e);return t[0]=r-a.left,t[1]=o-a.top,t}function S(E){return E===window||E===document||E===document.body?d:E.getBoundingClientRect()}}}),Ky=Ge({"node_modules/has-passive-events/index.js"(Z,q){"use strict";var d=ib();function x(){var S=!1;try{var E=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{S=!1}return S}q.exports=d&&x()}}),eS=Ge({"src/components/dragelement/align.js"(Z,q){"use strict";q.exports=function(x,S,E,e,t){var r=(x-E)/(e-E),o=r+S/(e-E),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),tS=Ge({"src/components/dragelement/cursor.js"(Z,q){"use strict";var d=ta(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];q.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=d.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][E]}}}),rS=Ge({"src/components/dragelement/unhover.js"(Z,q){"use strict";var d=I0(),x=Xy(),S=Um().getGraphDiv,E=Nm(),e=q.exports={};e.wrapped=function(t,r,o){t=S(t),t._fullLayout&&x.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),sh=Ge({"src/components/dragelement/index.js"(Z,q){"use strict";var d=QA(),x=ob(),S=Ky(),E=ta().removeElement,e=lf(),t=q.exports={};t.align=eS(),t.getCursor=tS();var r=rS();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,h=1,f=s._context.doubleClickDelay,p=n.element,c,T,l,_,w,A,M,g;s._mouseDownTime||(s._mouseDownTime=0),p.style.pointerEvents="all",p.onmousedown=u,S?(p._ontouchstart&&p.removeEventListener("touchstart",p._ontouchstart),p._ontouchstart=u,p.addEventListener("touchstart",u,{passive:!1})):p.ontouchstart=u;function b(R,L,z){return Math.abs(R)"u"&&typeof R.clientY>"u"&&(R.clientX=c,R.clientY=T),l=new Date().getTime(),l-s._mouseDownTimef&&(h=Math.max(h-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var L;A.target===M?L=A:(L={target:M,srcElement:M,toElement:M},Object.keys(A).concat(Object.keys(A.__proto__)).forEach(z=>{var F=A[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),n.clickFn&&n.clickFn(h,L),g||M.dispatchEvent(new MouseEvent("click",R))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),cv=Ge({"src/lib/setcursor.js"(Z,q){"use strict";q.exports=function(x,S){(x.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&x.classed(E,!1)}),S&&x.classed("cursor-"+S,!0)}}}),aS=Ge({"src/lib/override_cursor.js"(Z,q){"use strict";var d=cv(),x="data-savedcursor",S="!!";q.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;aY.legend.length)for(var se=Y.legend.length;se(a==="legend"?1:0));if(z===!1&&(n[a]=void 0),!(z===!1&&!f.uirevision)&&(c("uirevision",n.uirevision),z!==!1)){c("borderwidth");var F=c("orientation"),N=c("yref"),O=c("xref"),P=F==="h",U=N==="paper",B=O==="paper",X,$,le,ce="left";P?(X=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?U?($=1.1,le="bottom"):($=1,le="top"):U?($=-.1,le="top"):($=0,le="bottom")):($=1,le="auto",B?X=1.02:(X=1,ce="right")),x.coerce(f,p,{x:{valType:"number",editType:"legend",min:B?-2:0,max:B?3:1,dflt:X}},"x"),x.coerce(f,p,{y:{valType:"number",editType:"legend",min:U?-2:0,max:U?3:1,dflt:$}},"y"),c("traceorder",v),r.isGrouped(n[a])&&c("tracegroupgap"),c("entrywidth"),c("entrywidthmode"),c("indentation"),c("itemsizing"),c("itemwidth"),c("itemclick"),c("itemdoubleclick"),c("groupclick"),c("xanchor",ce),c("yanchor",le),c("maxheight"),c("valign"),x.noneOrAll(f,p,["x","y"]);var ve=c("title.text");if(ve){c("title.side",P?"left":"top");var G=x.extendFlat({},T,{size:x.bigFont(T.size)});x.coerceFont(c,"title.font",G);let Y=h>1;c("titleclick",Y?"toggle":!1),c("titledoubleclick",Y?"toggleothers":!1)}}}q.exports=function(i,n,s){var h,f=s.slice(),p=n.shapes;if(p)for(h=0;hz&&(L=z)}m[c][0]._groupMinRank=L,m[c][0]._preGroupSort=c}var F=function(X,$){return X[0]._groupMinRank-$[0]._groupMinRank||X[0]._preGroupSort-$[0]._preGroupSort},N=function(X,$){return X.trace.legendrank-$.trace.legendrank||X._preSort-$._preSort};for(m.forEach(function(X,$){X[0]._preGroupSort=$}),m.sort(F),c=0;c0)se=Y.width;else return 0;return v?V:Math.min(se,ee)};A.each(function(G){var Y=d.select(this),ee=S.ensureSingle(Y,"g","layers");ee.style("opacity",G[0].trace.opacity);var V=g.indentation,se=g.valign,ae=G[0].lineHeight,j=G[0].height;if(se==="middle"&&V===0||!ae||!j)ee.attr("transform",null);else{var Q={top:1,bottom:-1}[se],re=Q*(.5*(ae-j+3))||0,he=g.indentation;ee.attr("transform",E(he,re))}var xe=ee.selectAll("g.legendfill").data([G]);xe.enter().append("g").classed("legendfill",!0);var Te=ee.selectAll("g.legendlines").data([G]);Te.enter().append("g").classed("legendlines",!0);var Le=ee.selectAll("g.legendsymbols").data([G]);Le.enter().append("g").classed("legendsymbols",!0),Le.selectAll("g.legendpoints").data([G]).enter().append("g").classed("legendpoints",!0)}).each(ve).each(F).each(O).each(N).each(U).each(le).each($).each(L).each(z).each(B).each(X);function L(G){var Y=l(G),ee=Y.showFill,V=Y.showLine,se=Y.showGradientLine,ae=Y.showGradientFill,j=Y.anyFill,Q=Y.anyLine,re=G[0],he=re.trace,xe,Te,Le=r(he),Pe=Le.colorscale,qe=Le.reversescale,et=function(Ee){if(Ee.size())if(ee)e.fillGroupStyle(Ee,M,!0);else{var We="legendfill-"+he.uid;e.gradient(Ee,M,We,T(qe),Pe,"fill")}},rt=function(Ee){if(Ee.size()){var We="legendline-"+he.uid;e.lineGroupStyle(Ee),e.gradient(Ee,M,We,T(qe),Pe,"stroke")}},$e=o.hasMarkers(he)||!j?"M5,0":Q?"M5,-2":"M5,-3",Ue=d.select(this),fe=Ue.select(".legendfill").selectAll("path").data(ee||ae?[G]:[]);if(fe.enter().append("path").classed("js-fill",!0),fe.exit().remove(),fe.attr("d",$e+"h"+u+"v6h-"+u+"z").call(et),V||se){var ue=R(void 0,he.line,p,h);Te=S.minExtend(he,{line:{width:ue}}),xe=[S.minExtend(re,{trace:Te})]}var ie=Ue.select(".legendlines").selectAll("path").data(V||se?[xe]:[]);ie.enter().append("path").classed("js-line",!0),ie.exit().remove(),ie.attr("d",$e+(se?"l"+u+",0.0001":"h"+u)).call(V?e.lineGroupStyle:rt)}function z(G){var Y=l(G),ee=Y.anyFill,V=Y.anyLine,se=Y.showLine,ae=Y.showMarker,j=G[0],Q=j.trace,re=!ae&&!V&&!ee&&o.hasText(Q),he,xe;function Te(fe,ue,ie,Ee){var We=S.nestedProperty(Q,fe).get(),Qe=S.isArrayOrTypedArray(We)&&ue?ue(We):We;if(v&&Qe&&Ee!==void 0&&(Qe=Ee),ie){if(Qeie[1])return ie[1]}return Qe}function Le(fe){return j._distinct&&j.index&&fe[j.index]?fe[j.index]:fe[0]}if(ae||re||se){var Pe={},qe={};if(ae){Pe.mc=Te("marker.color",Le),Pe.mx=Te("marker.symbol",Le),Pe.mo=Te("marker.opacity",S.mean,[.2,1]),Pe.mlc=Te("marker.line.color",Le),Pe.mlw=Te("marker.line.width",S.mean,[0,5],f),Pe.mld=Q._isShape?"solid":Te("marker.line.dash",Le),qe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var et=Te("marker.size",S.mean,[2,16],s);Pe.ms=et,qe.marker.size=et}se&&(qe.line={width:Te("line.width",Le,[0,10],h)}),re&&(Pe.tx="Aa",Pe.tp=Te("textposition",Le),Pe.ts=10,Pe.tc=Te("textfont.color",Le),Pe.tf=Te("textfont.family",Le),Pe.tw=Te("textfont.weight",Le),Pe.ty=Te("textfont.style",Le),Pe.tv=Te("textfont.variant",Le),Pe.tC=Te("textfont.textcase",Le),Pe.tE=Te("textfont.lineposition",Le),Pe.tS=Te("textfont.shadow",Le)),he=[S.minExtend(j,Pe)],xe=S.minExtend(Q,qe),xe.selectedpoints=null,xe.texttemplate=null}var rt=d.select(this).select("g.legendpoints"),$e=rt.selectAll("path.scatterpts").data(ae?he:[]);$e.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",m),$e.exit().remove(),$e.call(e.pointStyle,xe,M),ae&&(he[0].mrc=3);var Ue=rt.selectAll("g.pointtext").data(re?he:[]);Ue.enter().append("g").classed("pointtext",!0).append("text").attr("transform",m),Ue.exit().remove(),Ue.selectAll("text").call(e.textPointStyle,xe,M)}function F(G){var Y=G[0].trace,ee=Y.type==="waterfall";if(G[0]._distinct&&ee){var V=G[0].trace[G[0].dir].marker;return G[0].mc=V.color,G[0].mlw=V.line.width,G[0].mlc=V.line.color,P(G,this,"waterfall")}var se=[];Y.visible&&ee&&(se=G[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var ae=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(se);ae.enter().append("path").classed("legendwaterfall",!0).attr("transform",m).style("stroke-miterlimit",1),ae.exit().remove(),ae.each(function(j){var Q=d.select(this),re=Y[j[0]].marker,he=R(void 0,re.line,c,f);Q.attr("d",j[1]).style("stroke-width",he+"px").call(t.fill,re.color),he&&Q.call(t.stroke,re.line.color)})}function N(G){P(G,this)}function O(G){P(G,this,"funnel")}function P(G,Y,ee){var V=G[0].trace,se=V.marker||{},ae=se.line||{},j=se.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",Q=ee?V.visible&&V.type===ee:x.traceIs(V,"bar"),re=d.select(Y).select("g.legendpoints").selectAll("path.legend"+ee).data(Q?[G]:[]);re.enter().append("path").classed("legend"+ee,!0).attr("d",j).attr("transform",m),re.exit().remove(),re.each(function(he){var xe=d.select(this),Te=he[0],Le=R(Te.mlw,se.line,c,f);xe.style("stroke-width",Le+"px");var Pe=Te.mcc;if(!g._inHover&&"mc"in Te){var qe=r(se),et=qe.mid;et===void 0&&(et=(qe.max+qe.min)/2),Pe=e.tryColorscale(se,"")(et)}var rt=Pe||Te.mc||se.color,$e=se.pattern,Ue=e.getPatternAttr,fe=$e&&(Ue($e.shape,0,"")||Ue($e.path,0,""));if(fe){var ue=Ue($e.bgcolor,0,null),ie=Ue($e.fgcolor,0,null),Ee=$e.fgopacity,We=_($e.size,8,10),Qe=_($e.solidity,.5,1),Xe="legend-"+V.uid;xe.call(e.pattern,"legend",M,Xe,fe,We,Qe,Pe,$e.fillmode,ue,ie,Ee)}else xe.call(t.fill,rt);Le&&t.stroke(xe,Te.mlc||ae.color)})}function U(G){var Y=G[0].trace,ee=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(Y.visible&&x.traceIs(Y,"box-violin")?[G]:[]);ee.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),ee.exit().remove(),ee.each(function(){var V=d.select(this);if((Y.boxpoints==="all"||Y.points==="all")&&t.opacity(Y.fillcolor)===0&&t.opacity((Y.line||{}).color)===0){var se=S.minExtend(Y,{marker:{size:v?s:S.constrain(Y.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ee.call(e.pointStyle,se,M)}else{var ae=R(void 0,Y.line,c,f);V.style("stroke-width",ae+"px").call(t.fill,Y.fillcolor),ae&&t.stroke(V,Y.line.color)}})}function B(G){var Y=G[0].trace,ee=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(Y.visible&&Y.type==="candlestick"?[G,G]:[]);ee.enter().append("path").classed("legendcandle",!0).attr("d",function(V,se){return se?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",m).style("stroke-miterlimit",1),ee.exit().remove(),ee.each(function(V,se){var ae=d.select(this),j=Y[se?"increasing":"decreasing"],Q=R(void 0,j.line,c,f);ae.style("stroke-width",Q+"px").call(t.fill,j.fillcolor),Q&&t.stroke(ae,j.line.color)})}function X(G){var Y=G[0].trace,ee=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(Y.visible&&Y.type==="ohlc"?[G,G]:[]);ee.enter().append("path").classed("legendohlc",!0).attr("d",function(V,se){return se?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",m).style("stroke-miterlimit",1),ee.exit().remove(),ee.each(function(V,se){var ae=d.select(this),j=Y[se?"increasing":"decreasing"],Q=R(void 0,j.line,c,f);ae.style("fill","none").call(e.dashLine,j.line.dash,Q),Q&&t.stroke(ae,j.line.color)})}function $(G){ce(G,this,"pie")}function le(G){ce(G,this,"funnelarea")}function ce(G,Y,ee){var V=G[0],se=V.trace,ae=ee?se.visible&&se.type===ee:x.traceIs(se,ee),j=d.select(Y).select("g.legendpoints").selectAll("path.legend"+ee).data(ae?[G]:[]);if(j.enter().append("path").classed("legend"+ee,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),j.exit().remove(),j.size()){var Q=se.marker||{},re=R(i(Q.line.width,V.pts),Q.line,c,f),he="pieLike",xe=S.minExtend(se,{marker:{line:{width:re}}},he),Te=S.minExtend(V,{trace:xe},he);a(j,Te,xe,M)}}function ve(G){var Y=G[0].trace,ee,V=[];if(Y.visible)switch(Y.type){case"histogram2d":case"heatmap":V=[["M-15,-2V4H15V-2Z"]],ee=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":V=[["M-6,-6V6H6V-6Z"]],ee=!0;break;case"densitymapbox":case"densitymap":V=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ee="radial";break;case"cone":V=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ee=!1;break;case"streamtube":V=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ee=!1;break;case"surface":V=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ee=!0;break;case"mesh3d":V=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ee=!1;break;case"volume":V=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ee=!0;break;case"isosurface":V=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ee=!1;break}var se=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(V);se.enter().append("path").classed("legend3dandfriends",!0).attr("transform",m).style("stroke-miterlimit",1),se.exit().remove(),se.each(function(ae,j){var Q=d.select(this),re=r(Y),he=re.colorscale,xe=re.reversescale,Te=function(et){if(et.size()){var rt="legendfill-"+Y.uid;e.gradient(et,M,rt,T(xe,ee==="radial"),he,"fill")}},Le;if(he){if(!ee){var qe=he.length;Le=j===0?he[xe?qe-1:0][1]:j===1?he[xe?0:qe-1][1]:he[Math.floor((qe-1)/2)][1]}}else{var Pe=Y.vertexcolor||Y.facecolor||Y.color;Le=S.isArrayOrTypedArray(Pe)?Pe[j]||Pe[0]:Pe}Q.attr("d",ae[0]),Le?Q.call(t.fill,Le):Q.call(Te)})}};function T(w,A){var M=A?"radial":"horizontal";return M+(w?"":"reversed")}function l(w){var A=w[0].trace,M=A.contours,g=o.hasLines(A),b=o.hasMarkers(A),v=A.visible&&A.fill&&A.fill!=="none",u=!1,y=!1;if(M){var m=M.coloring;m==="lines"?u=!0:g=m==="none"||m==="heatmap"||M.showlines,M.type==="constraint"?v=M._operation!=="=":(m==="fill"||m==="heatmap")&&(y=!0)}return{showMarker:b,showLine:g,showFill:v,showGradientLine:u,showGradientFill:y,anyLine:g||u,anyFill:v||y}}function _(w,A,M){return w&&S.isArrayOrTypedArray(w)?A:w>M?M:w}}}),xb=Ge({"src/components/legend/draw.js"(Z,q){"use strict";var d=Oi(),x=ta(),S=Uu(),E=Yi(),e=I0(),t=sh(),r=zo(),o=Bi(),a=Il(),i=gb().handleItemClick,n=gb().handleTitleClick,s=yb(),h=uf(),f=h.LINE_SPACING,p=h.FROM_TL,c=h.FROM_BR,T=nS(),l=_b(),_=Gm(),w=1,A=/^legend[0-9]*$/;q.exports=function(X,$){if($)g(X,$);else{var le=X._fullLayout,ce=le._legends,ve=le._infolayer.selectAll('[class^="legend"]');ve.each(function(){var V=d.select(this),se=V.attr("class"),ae=se.split(" ")[0];ae.match(A)&&ce.indexOf(ae)===-1&&V.remove()});for(var G=0;G1)}var re=le.hiddenlabels||[];if(!Y&&(!le.showlegend||!ee.length))return G.selectAll("."+ce).remove(),le._topdefs.select("#"+ve).remove(),S.autoMargin(B,ce);var he=x.ensureSingle(G,"g",ce,function(Ue){Y||Ue.attr("pointer-events","all")}),xe=x.ensureSingleById(le._topdefs,"clipPath",ve,function(Ue){Ue.append("rect")}),Te=x.ensureSingle(he,"rect","bg",function(Ue){Ue.attr("shape-rendering","crispEdges")});Te.call(o.stroke,$.bordercolor).call(o.fill,$.bgcolor).style("stroke-width",$.borderwidth+"px");var Le=x.ensureSingle(he,"g","scrollbox"),Pe=$.title;$._titleWidth=0,$._titleHeight=0;var qe;Pe.text?(qe=x.ensureSingle(Le,"text",ce+"titletext"),qe.attr("text-anchor","start").call(r.font,Pe.font).text(Pe.text),L(qe,Le,B,$,w),!Y&&($.titleclick||$.titledoubleclick)&&R(Le,B,$,ce)):(Le.selectAll("."+ce+"titletext").remove(),Le.selectAll("."+ce+"titletoggle").remove());var et=x.ensureSingle(he,"rect","scrollbar",function(Ue){Ue.attr(s.scrollBarEnterAttrs).call(o.fill,s.scrollBarColor)}),rt=Le.selectAll("g.groups").data(ee);rt.enter().append("g").attr("class","groups"),rt.exit().remove();var $e=rt.selectAll("g.traces").data(x.identity);$e.enter().append("g").attr("class","traces"),$e.exit().remove(),$e.style("opacity",function(Ue){let fe=Ue[0],ue=fe.trace;if(fe.groupTitle){let ie=ue.legendgroup,Ee=(le.shapes||[]).filter(function(Qe){return Qe.showlegend});return B._fullData.concat(Ee).some(function(Qe){return Qe.legendgroup===ie&&(Qe.legend||"legend")===ce&&Qe.visible===!0})?1:.5}return E.traceIs(ue,"pie-like")?re.indexOf(Ue[0].label)!==-1?.5:1:ue.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(u,B,$)}).call(l,B,$).each(function(Ue){Y||Ue[0].groupTitle&&$.groupclick==="toggleitem"||d.select(this).call(m,B,ce)}),x.syncOrAsync([S.previousPromises,function(){return N(B,rt,$e,$,Le)},function(){var Ue=le._size,fe=$.borderwidth,ue=$.xref==="paper",ie=$.yref==="paper";if(Pe.text){let Mt=(le.shapes||[]).filter(function(Ot){return Ot.showlegend}),Et=B._fullData.concat(Mt).some(function(Ot){let sr=Ot.legend||"legend";var ir=Array.isArray(sr)?sr.includes(ce):sr===ce;return ir&&Ot.visible===!0});qe.style("opacity",Et?1:.5)}if(!Y){var Ee,We;ue?Ee=Ue.l+Ue.w*$.x-p[P($)]*$._width:Ee=le.width*$.x-p[P($)]*$._width,ie?We=Ue.t+Ue.h*(1-$.y)-p[U($)]*$._effHeight:We=le.height*(1-$.y)-p[U($)]*$._effHeight;var Qe=O(B,ce,Ee,We);if(Qe)return;if(le.margin.autoexpand){var Xe=Ee,Tt=We;Ee=ue?x.constrain(Ee,0,le.width-$._width):Xe,We=ie?x.constrain(We,0,le.height-$._effHeight):Tt,Ee!==Xe&&x.log("Constrain "+ce+".x to make legend fit inside graph"),We!==Tt&&x.log("Constrain "+ce+".y to make legend fit inside graph")}r.setTranslate(he,Ee,We)}if(et.on(".drag",null),he.on("wheel",null),Y||$._height<=$._maxHeight||B._context.staticPlot){var St=$._effHeight;Y&&(St=$._height),Te.attr({width:$._width-fe,height:St-fe,x:fe/2,y:fe/2}),r.setTranslate(Le,0,0),xe.select("rect").attr({width:$._width-2*fe,height:St-2*fe,x:fe,y:fe}),r.setClipUrl(Le,ve,B),r.setRect(et,0,0,0,0),delete $._scrollY}else{var zt=Math.max(s.scrollBarMinHeight,$._effHeight*$._effHeight/$._height),Ut=$._effHeight-zt-2*s.scrollBarMargin,br=$._height-$._effHeight,hr=Ut/br,Or=Math.min($._scrollY||0,br);Te.attr({width:$._width-2*fe+s.scrollBarWidth+s.scrollBarMargin,height:$._effHeight-fe,x:fe/2,y:fe/2}),xe.select("rect").attr({width:$._width-2*fe+s.scrollBarWidth+s.scrollBarMargin,height:$._effHeight-2*fe,x:fe,y:fe+Or}),r.setClipUrl(Le,ve,B),Be(Or,zt,hr),he.on("wheel",function(){Or=x.constrain($._scrollY+d.event.deltaY/br*Ut,0,br),Be(Or,zt,hr),Or!==0&&Or!==br&&d.event.preventDefault()});var wr,Er,mt,ze=function(Mt,Et,Ot){var sr=(Ot-Et)/hr+Mt;return x.constrain(sr,0,br)},Ze=function(Mt,Et,Ot){var sr=(Et-Ot)/hr+Mt;return x.constrain(sr,0,br)},we=d.behavior.drag().on("dragstart",function(){var Mt=d.event.sourceEvent;Mt.type==="touchstart"?wr=Mt.changedTouches[0].clientY:wr=Mt.clientY,mt=Or}).on("drag",function(){var Mt=d.event.sourceEvent;Mt.buttons===2||Mt.ctrlKey||(Mt.type==="touchmove"?Er=Mt.changedTouches[0].clientY:Er=Mt.clientY,Or=ze(mt,wr,Er),Be(Or,zt,hr))});et.call(we);var ke=d.behavior.drag().on("dragstart",function(){var Mt=d.event.sourceEvent;Mt.type==="touchstart"&&(wr=Mt.changedTouches[0].clientY,mt=Or)}).on("drag",function(){var Mt=d.event.sourceEvent;Mt.type==="touchmove"&&(Er=Mt.changedTouches[0].clientY,Or=Ze(mt,wr,Er),Be(Or,zt,hr))});Le.call(ke)}function Be(Mt,Et,Ot){$._scrollY=B._fullLayout[ce]._scrollY=Mt,r.setTranslate(Le,0,-Mt),r.setRect(et,$._width,s.scrollBarMargin+Mt*Ot,s.scrollBarWidth,Et),xe.select("rect").attr("y",fe+Mt)}if(B._context.edits.legendPosition){var He,nt,ot,Ft;he.classed("cursor-move",!0),t.init({element:he.node(),gd:B,prepFn:function(Mt){if(Mt.target!==et.node()){var Et=r.getTranslate(he);ot=Et.x,Ft=Et.y}},moveFn:function(Mt,Et){if(ot!==void 0&&Ft!==void 0){var Ot=ot+Mt,sr=Ft+Et;r.setTranslate(he,Ot,sr),He=t.align(Ot,$._width,Ue.l,Ue.l+Ue.w,$.xanchor),nt=t.align(sr+$._height,-$._height,Ue.t+Ue.h,Ue.t,$.yanchor)}},doneFn:function(){if(He!==void 0&&nt!==void 0){var Mt={};Mt[ce+".x"]=He,Mt[ce+".y"]=nt,E.call("_guiRelayout",B,Mt)}},clickFn:function(Mt,Et){var Ot=G.selectAll("g.traces").filter(function(){var sr=this.getBoundingClientRect();return Et.clientX>=sr.left&&Et.clientX<=sr.right&&Et.clientY>=sr.top&&Et.clientY<=sr.bottom});Ot.size()>0&&v(B,$,Ot,Mt,Et)}})}}],B)}}function b(B,X,$){var le=B[0],ce=le.width,ve=X.entrywidthmode,G=le.trace.legendwidth||X.entrywidth;return ve==="fraction"?X._maxWidth*G:$+(G||ce)}function v(B,X,$,le,ce){var ve=B._fullLayout,G=$.data()[0][0].trace,Y=X.itemclick,ee=X.itemdoubleclick,V={event:ce,node:$.node(),curveNumber:G.index,expandedIndex:G.index,data:B.data,layout:B.layout,frames:B._transitionData._frames,config:B._context,fullData:B._fullData,fullLayout:ve};G._group&&(V.group=G._group),E.traceIs(G,"pie-like")&&(V.label=$.datum()[0].label);var se=e.triggerHandler(B,"plotly_legendclick",V);if(le===1){if(se===!1)return;X._clickTimeout=setTimeout(function(){B._fullLayout&&Y&&i($,B,X,Y)},B._context.doubleClickDelay)}else if(le===2){X._clickTimeout&&clearTimeout(X._clickTimeout),B._legendMouseDownTime=0;var ae=e.triggerHandler(B,"plotly_legenddoubleclick",V);ae!==!1&&se!==!1&&ee&&i($,B,X,ee)}}function u(B,X,$){var le=_.getId($),ce=B.data()[0][0],ve=ce.trace,G=E.traceIs(ve,"pie-like"),Y=!$._inHover&&X._context.edits.legendText&&!G,ee=$._maxNameLength,V,se;ce.groupTitle?(V=ce.groupTitle.text,se=ce.groupTitle.font):(se=$.font,$.entries?V=ce.text:(V=G?ce.label:ve.name,ve._meta&&(V=x.templateString(V,ve._meta))));var ae=x.ensureSingle(B,"text",le+"text");ae.attr("text-anchor","start").call(r.font,se).text(Y?y(V,ee):V);var j=$.indentation+$.itemwidth+s.itemGap*2;a.positionText(ae,j,0),Y?ae.call(a.makeEditable,{gd:X,text:V}).call(L,B,X,$).on("edit",function(Q){this.text(y(Q,ee)).call(L,B,X,$);var re=ce.trace._fullInput||{},he={};return he.name=Q,re._isShape?E.call("_guiRelayout",X,"shapes["+ve.index+"].name",he.name):E.call("_guiRestyle",X,he,ve.index)}):L(ae,B,X,$)}function y(B,X){var $=Math.max(4,X);if(B&&B.trim().length>=$/2)return B;B=B||"";for(var le=$-B.length;le>0;le--)B+=" ";return B}function m(B,X,$){var le=X._context.doubleClickDelay,ce,ve=1,G=x.ensureSingle(B,"rect",$+"toggle",function(Y){X._context.staticPlot||Y.style("cursor","pointer").attr("pointer-events","all"),Y.call(o.fill,"rgba(0,0,0,0)")});X._context.staticPlot||(G.on("mousedown",function(){ce=new Date().getTime(),ce-X._legendMouseDownTimele&&(ve=Math.max(ve-1,1)),v(X,Y,B,ve,d.event)}}))}function R(B,X,$,le){if(X._fullData.some(function(V){let se=V.legend||"legend";return(Array.isArray(se)?se.includes(le):se===le)&&E.traceIs(V,"pie-like")}))return;let ve=X._context.doubleClickDelay;var G,Y=1;let ee=x.ensureSingle(B,"rect",le+"titletoggle",function(V){X._context.staticPlot||V.style("cursor","pointer").attr("pointer-events","all"),V.call(o.fill,"rgba(0,0,0,0)")});X._context.staticPlot||(ee.on("mousedown",function(){G=new Date().getTime(),G-X._legendMouseDownTimeve&&(Y=Math.max(Y-1,1));let V={event:d.event,legendId:le,data:X.data,layout:X.layout,fullData:X._fullData,fullLayout:X._fullLayout};if(Y===1&&$.titleclick){if(e.triggerHandler(X,"plotly_legendtitleclick",V)===!1)return;$._titleClickTimeout=setTimeout(function(){X._fullLayout&&n(X,$,$.titleclick)},ve)}else Y===2&&($._titleClickTimeout&&clearTimeout($._titleClickTimeout),X._legendMouseDownTime=0,e.triggerHandler(X,"plotly_legendtitledoubleclick",V)!==!1&&$.titledoubleclick&&n(X,$,$.titledoubleclick))}))}function L(B,X,$,le,ce){le._inHover&&B.attr("data-notex",!0),a.convertToTspans(B,$,function(){z(X,$,le,ce)})}function z(B,X,$,le){var ce=B.data()[0][0],ve=ce&&ce.trace.showlegend;if(Array.isArray(ve)&&(ve=ve[ce.i]!==!1),!$._inHover&&ce&&!ve){B.remove();return}var G=B.select("g[class*=math-group]"),Y=G.node(),ee=_.getId($);$||($=X._fullLayout[ee]);var V=$.borderwidth,se;le===w?se=$.title.font:ce.groupTitle?se=ce.groupTitle.font:se=$.font;var ae=se.size*f,j,Q;if(Y){var re=r.bBox(Y);j=re.height,Q=re.width,le===w?r.setTranslate(G,V,V+j*.75):r.setTranslate(G,0,j*.25)}else{var he="."+ee+(le===w?"title":"")+"text",xe=B.select(he),Te=a.lineCount(xe),Le=xe.node();if(j=ae*Te,Q=Le?r.bBox(Le).width:0,le===w)$.title.side==="left"&&(Q+=s.itemGap*2),a.positionText(xe,V+s.titlePad,V+ae);else{var Pe=s.itemGap*2+$.indentation+$.itemwidth;ce.groupTitle&&(Pe=s.itemGap,Q-=$.indentation+$.itemwidth),a.positionText(xe,Pe,-ae*((Te-1)/2-.3))}}le===w?($._titleWidth=Q,$._titleHeight=j):(ce.lineHeight=ae,ce.height=Math.max(j,16)+3,ce.width=Q)}function F(B){var X=0,$=0,le=B.title.side;return le&&(le.indexOf("left")!==-1&&(X=B._titleWidth),le.indexOf("top")!==-1&&($=B._titleHeight)),[X,$]}function N(B,X,$,le,ce){var ve=B._fullLayout,G=_.getId(le);le||(le=ve[G]);var Y=ve._size,ee=_.isVertical(le),V=_.isGrouped(le),se=le.entrywidthmode==="fraction",ae=le.borderwidth,j=2*ae,Q=s.itemGap,re=le.indentation+le.itemwidth+Q*2,he=2*(ae+Q),xe=U(le),Te=le.y<0||le.y===0&&xe==="top",Le=le.y>1||le.y===1&&xe==="bottom",Pe=le.tracegroupgap,qe={};let{orientation:et,yref:rt}=le,{maxheight:$e}=le,Ue=Te||Le||et!=="v"||rt!=="paper";$e||($e=Ue?.5:1);let fe=Ue?ve.height:Y.h;le._maxHeight=Math.max($e>1?$e:$e*fe,30);var ue=0;le._width=0,le._height=0;var ie=F(le);if(ee)$.each(function(Mt){var Et=Mt[0].height;r.setTranslate(this,ae+ie[0],ae+ie[1]+le._height+Et/2+Q),le._height+=Et,le._width=Math.max(le._width,Mt[0].width)}),ue=re+le._width,le._width+=Q+re+j,le._height+=he,V&&(X.each(function(Mt,Et){r.setTranslate(this,0,Et*le.tracegroupgap)}),le._height+=(le._lgroupsLength-1)*le.tracegroupgap);else{var Ee=P(le),We=le.x<0||le.x===0&&Ee==="right",Qe=le.x>1||le.x===1&&Ee==="left",Xe=Le||Te,Tt=ve.width/2;le._maxWidth=Math.max(We?Xe&&Ee==="left"?Y.l+Y.w:Tt:Qe?Xe&&Ee==="right"?Y.r+Y.w:Tt:Y.w,2*re);var St=0,zt=0;$.each(function(Mt){var Et=b(Mt,le,re);St=Math.max(St,Et),zt+=Et}),ue=null;var Ut=0;if(V){var br=0,hr=0,Or=0;X.each(function(){var Mt=0,Et=0;d.select(this).selectAll("g.traces").each(function(sr){var ir=b(sr,le,re),ar=sr[0].height;r.setTranslate(this,ie[0],ie[1]+ae+Q+ar/2+Et),Et+=ar,Mt=Math.max(Mt,ir),qe[sr[0].trace.legendgroup]=Mt});var Ot=Mt+Q;hr>0&&Ot+ae+hr>le._maxWidth?(Ut=Math.max(Ut,hr),hr=0,Or+=br+Pe,br=Et):br=Math.max(br,Et),r.setTranslate(this,hr,Or),hr+=Ot}),le._width=Math.max(Ut,hr)+ae,le._height=Or+br+he}else{var wr=$.size(),Er=zt+j+(wr-1)*Q=le._maxWidth&&(Ut=Math.max(Ut,we),ze=0,Ze+=mt,le._height+=mt,mt=0),r.setTranslate(this,ie[0]+ae+ze,ie[1]+ae+Ze+Et/2+Q),we=ze+Ot+Q,ze+=sr,mt=Math.max(mt,Et)}),Er?(le._width=ze+j,le._height=mt+he):(le._width=Math.max(Ut,we)+j,le._height+=mt+he)}}le._width=Math.ceil(Math.max(le._width+ie[0],le._titleWidth+2*(ae+s.titlePad))),le._height=Math.ceil(Math.max(le._height+ie[1],le._titleHeight+2*(ae+s.itemGap))),le._effHeight=Math.min(le._height,le._maxHeight);var ke=B._context.edits,Be=ke.legendText||ke.legendPosition;$.each(function(Mt){var Et=d.select(this).select("."+G+"toggle"),Ot=Mt[0].height,sr=Mt[0].trace.legendgroup,ir=b(Mt,le,re);V&&sr!==""&&(ir=qe[sr]);var ar=Be?re:ue||ir;!ee&&!se&&(ar+=Q/2),r.setRect(Et,0,-Ot/2,ar,Ot)});var He=ce.select("."+G+"titletext");He.node()&&M(He,le,ae);var nt=ce.select("."+G+"titletoggle");if(nt.size()&&He.node()){var ot=He.attr("x")||0,Ft=s.titlePad;r.setRect(nt,ot-Ft,ae,le._titleWidth+2*Ft,le._titleHeight+2*Ft)}}function O(B,X,$,le){var ce=B._fullLayout,ve=ce[X],G=P(ve),Y=U(ve),ee=ve.xref==="paper",V=ve.yref==="paper";B._fullLayout._reservedMargin[X]={};var se=ve.y<.5?"b":"t",ae=ve.x<.5?"l":"r",j={r:ce.width-$,l:$+ve._width,b:ce.height-le,t:le+ve._effHeight};if(ee&&V)return S.autoMargin(B,X,{x:ve.x,y:ve.y,l:ve._width*p[G],r:ve._width*c[G],b:ve._effHeight*c[Y],t:ve._effHeight*p[Y]});ee?B._fullLayout._reservedMargin[X][se]=j[se]:V||ve.orientation==="v"?B._fullLayout._reservedMargin[X][ae]=j[ae]:B._fullLayout._reservedMargin[X][se]=j[se]}function P(B){return x.isRightAnchor(B)?"right":x.isCenterAnchor(B)?"center":"left"}function U(B){return x.isBottomAnchor(B)?"bottom":x.isMiddleAnchor(B)?"middle":"top"}}}),bb=Ge({"src/components/fx/hover.js"(Z){"use strict";var q=Oi(),d=Bo(),x=Ef(),S=ta(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=I0(),o=Il(),a=aS(),i=zo(),n=Bi(),s=sh(),h=Mo(),f=lf().zindexSeparator,p=Yi(),c=Sh(),T=Nm(),l=mb(),_=xb(),w=T.YANGLE,A=Math.PI*w/180,M=1/Math.sin(A),g=Math.cos(A),b=Math.sin(A),v=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,y={box:!0,ohlc:!0,violin:!0,candlestick:!0},m={scatter:!0,scattergl:!0,splom:!0};function R(j,Q){return j.distance-Q.distance}Z.hover=function(Q,re,he,xe){Q=S.getGraphDiv(Q);var Te=re.target;S.throttle(Q._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(Q,re,he,xe,Te)})},Z.loneHover=function(Q,re){var he=!0;Array.isArray(Q)||(he=!1,Q=[Q]);var xe=re.gd,Te=V(xe),Le=se(xe),Pe=Q.map(function(Ee){var We=Ee._x0||Ee.x0||Ee.x||0,Qe=Ee._x1||Ee.x1||Ee.x||0,Xe=Ee._y0||Ee.y0||Ee.y||0,Tt=Ee._y1||Ee.y1||Ee.y||0,St=Ee.eventData;if(St){var zt=Math.min(We,Qe),Ut=Math.max(We,Qe),br=Math.min(Xe,Tt),hr=Math.max(Xe,Tt),Or=Ee.trace;if(p.traceIs(Or,"gl3d")){var wr=xe._fullLayout[Or.scene]._scene.container,Er=wr.offsetLeft,mt=wr.offsetTop;zt+=Er,Ut+=Er,br+=mt,hr+=mt}St.bbox={x0:zt+Le,x1:Ut+Le,y0:br+Te,y1:hr+Te},St.xPixel=(We+Qe)/2,St.yPixel=(Xe+Tt)/2,re.inOut_bbox&&re.inOut_bbox.push(St.bbox)}else St=!1;return{color:Ee.color||n.defaultLine,x0:Ee.x0||Ee.x||0,x1:Ee.x1||Ee.x||0,y0:Ee.y0||Ee.y||0,y1:Ee.y1||Ee.y||0,xLabel:Ee.xLabel,yLabel:Ee.yLabel,zLabel:Ee.zLabel,text:Ee.text,name:Ee.name,idealAlign:Ee.idealAlign,borderColor:Ee.borderColor,fontFamily:Ee.fontFamily,fontSize:Ee.fontSize,fontColor:Ee.fontColor,fontWeight:Ee.fontWeight,fontStyle:Ee.fontStyle,fontVariant:Ee.fontVariant,nameLength:Ee.nameLength,textAlign:Ee.textAlign,trace:Ee.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ee.hovertemplate||!1,hovertemplateLabels:Ee.hovertemplateLabels||!1,eventData:St}}),qe=!1,et=N(Pe,{gd:xe,hovermode:"closest",rotateLabels:qe,bgColor:re.bgColor||n.background,container:q.select(re.container),outerContainer:re.outerContainer||re.container}),rt=et.hoverLabels,$e=5,Ue=0,fe=0;rt.sort(function(Ee,We){return Ee.y0-We.y0}).each(function(Ee,We){var Qe=Ee.y0-Ee.by/2;Qe-$eUt[0]._length||Ba<0||Ba>br[0]._length)return s.unhoverRaw(j,Q)}if(Q.pointerX=Da+Ut[0]._offset,Q.pointerY=Ba+br[0]._offset,"xval"in Q?we=c.flat(Te,Q.xval):we=c.p2c(Ut,Da),"yval"in Q?ke=c.flat(Te,Q.yval):ke=c.p2c(br,Ba),!d(we[0])||!d(ke[0]))return S.warn("Fx.hover failed",Q,j),s.unhoverRaw(j,Q)}Pe.clickanywhere&&(j._hoverXVals=we,j._hoverYVals=ke,j._hoverXAxes=Ut,j._hoverYAxes=br);var vn=1/0;function Wt(pi,lo){for(He=0;Hear&&(ze.splice(0,ar),vn=ze[0].distance),$e&&mt!==0&&ze.length===0){ir.distance=mt,ir.index=!1;var bo=ot._module.hoverPoints(ir,Ot,sr,"closest",{hoverLayer:Pe._hoverlayer});if(bo&&(bo=bo.filter(function(us){return us.spikeDistance<=mt})),bo&&bo.length){var Hi,Pi=bo.filter(function(us){return us.xa.showspikes&&us.xa.spikesnap!=="hovered data"});if(Pi.length){var ji=Pi[0];d(ji.x0)&&d(ji.y0)&&(Hi=Ht(ji),(!Mr.vLinePoint||Mr.vLinePoint.spikeDistance>Hi.spikeDistance)&&(Mr.vLinePoint=Hi))}var Uo=bo.filter(function(us){return us.ya.showspikes&&us.ya.spikesnap!=="hovered data"});if(Uo.length){var Ko=Uo[0];d(Ko.x0)&&d(Ko.y0)&&(Hi=Ht(Ko),(!Mr.hLinePoint||Mr.hLinePoint.spikeDistance>Hi.spikeDistance)&&(Mr.hLinePoint=Hi))}}}}}Wt();function Lt(pi,lo,Ai){for(var Fo=null,No=1/0,$o,bo=0;bopi.trace.index===Wn.trace.index):ze=[Wn];var ti=ze.length,gt=ee("x",Wn,Pe),it=ee("y",Wn,Pe);Wt(gt,it);var Rr=[],Ar={},pr=0,kr=function(pi){var lo=y[pi.trace.type]?z(pi):pi.trace.index;if(!Ar[lo])pr++,Ar[lo]=pr,Rr.push(pi);else{var Ai=Ar[lo]-1,Fo=Rr[Ai];Ai>0&&Math.abs(pi.distance)ti-1;zr--)kr(ze[zr]);ze=Rr,Kr()}var Ur=j._hoverdata,dt=[],qt=V(j),fr=se(j);for(let pi of ze){var Ir=c.makeEventData(pi,pi.trace,pi.cd);if(pi.hovertemplate!==!1){var da=!1;pi.cd[pi.index]&&pi.cd[pi.index].ht&&(da=pi.cd[pi.index].ht),pi.hovertemplate=da||pi.trace.hovertemplate||!1}if(pi.xa&&pi.ya){var Ta=pi.x0+pi.xa._offset,ua=pi.x1+pi.xa._offset,ra=pi.y0+pi.ya._offset,ha=pi.y1+pi.ya._offset,pn=Math.min(Ta,ua),_n=Math.max(Ta,ua),jn=Math.min(ra,ha),li=Math.max(ra,ha);Ir.bbox={x0:pn+fr,x1:_n+fr,y0:jn+qt,y1:li+qt},Ir.xPixel=(Ta+ua)/2,Ir.yPixel=(ra+ha)/2}pi.eventData=[Ir],dt.push(Ir)}j._hoverdata=dt;var yi=Ue==="y"&&(Ze.length>1||ze.length>1)||Ue==="closest"&&ma&&ze.length>1,gi=n.combine(Pe.plot_bgcolor||n.background,Pe.paper_bgcolor),Si=N(ze,{gd:j,hovermode:Ue,rotateLabels:yi,bgColor:gi,container:Pe._hoverlayer,outerContainer:Pe._paper.node(),commonLabelOpts:Pe.hoverlabel,hoverdistance:Pe.hoverdistance}),Gi=Si.hoverLabels;if(c.isUnifiedHover(Ue)||(P(Gi,yi,Pe,Si.commonLabelBoundingBox),X(Gi,yi,Pe._invScaleX,Pe._invScaleY)),xe&&xe.tagName){var io=p.getComponentMethod("annotations","hasClickToShow")(j,dt);a(q.select(xe),io?"pointer":"")}var vo=ce(j,Q,Ur);if(!xe||he||!vo&&!Pe.hoveranywhere)return;Ur&&vo&&j.emit("plotly_unhover",{event:Q,points:Ur}),ms(j._hoverdata);function ms(pi){j.emit("plotly_hover",{event:Q,points:pi,xaxes:Ut,yaxes:br,xvals:we,yvals:ke})}}function z(j){return[j.trace.index,j.index,j.x0,j.y0,j.name,j.attr,j.xa?j.xa._id:"",j.ya?j.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function N(j,Q){var re=Q.gd,he=re._fullLayout,xe=Q.hovermode,Te=Q.rotateLabels,Le=Q.bgColor,Pe=Q.container,qe=Q.outerContainer,et=Q.commonLabelOpts||{};if(j.length===0)return[[]];var rt=Q.fontFamily||T.HOVERFONT,$e=Q.fontSize||T.HOVERFONTSIZE,Ue=Q.fontWeight||he.font.weight,fe=Q.fontStyle||he.font.style,ue=Q.fontVariant||he.font.variant,ie=Q.fontTextcase||he.font.textcase,Ee=Q.fontLineposition||he.font.lineposition,We=Q.fontShadow||he.font.shadow,Qe=j[0],Xe=Qe.xa,Tt=Qe.ya,St=xe.charAt(0),zt=St+"Label",Ut=Qe[zt];if(Ut===void 0&&Xe.type==="multicategory")for(var br=0;brhe.width-dt&&(qt=he.width-dt),Zn.attr("d","M"+(kr-qt)+",0L"+(kr-qt+v)+","+Ur+v+"H"+dt+"v"+Ur+(u*2+pr.height)+"H"+-dt+"V"+Ur+v+"H"+(kr-qt-v)+"Z"),kr=qt,He.minX=kr-dt,He.maxX=kr+dt,Xe.side==="top"?(He.minY=zr-(u*2+pr.height),He.maxY=zr-u):(He.minY=zr+u,He.maxY=zr+(u*2+pr.height))}else{var fr,Ir,da;Tt.side==="right"?(fr="start",Ir=1,da="",kr=Xe._offset+Xe._length):(fr="end",Ir=-1,da="-",kr=Xe._offset),zr=Tt._offset+(Qe.y0+Qe.y1)/2,Wn.attr("text-anchor",fr),Zn.attr("d","M0,0L"+da+v+","+v+"V"+(u+pr.height/2)+"h"+da+(u*2+pr.width)+"V-"+(u+pr.height/2)+"H"+da+v+"V-"+v+"Z"),He.minY=zr-(u+pr.height/2),He.maxY=zr+(u+pr.height/2),Tt.side==="right"?(He.minX=kr+v,He.maxX=kr+v+(u*2+pr.width)):(He.minX=kr-v-(u*2+pr.width),He.maxX=kr-v);var Ta=pr.height/2,ua=Or-pr.top-Ta,ra="clip"+he._uid+"commonlabel"+Tt._id,ha;if(krZn.hoverinfo!=="none");if(Sa.length===0)return[];var nt=he.hoverlabel,ot=nt.font,Ft=Sa[0],Mt=((xe==="x unified"?Ft.xa:Ft.ya).unifiedhovertitle||{}).text,Et=Mt?S.hovertemplateString({data:xe==="x unified"?[{xa:Ft.xa,x:Ft.xVal}]:[{ya:Ft.ya,y:Ft.yVal}],fallback:Ft.trace.hovertemplatefallback,locale:he._d3locale,template:Mt}):Ut,Ot={showlegend:!0,legend:{title:{text:Et,font:ot},font:ot,bgcolor:nt.bgcolor,bordercolor:nt.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:he.legend?he.legend.traceorder:void 0,orientation:"v"}},sr={font:ot};l(Ot,sr,re._fullData);var ir=sr.legend;ir.entries=[];for(var ar=0;ar=0?Ua=Kr:na+rn=0?Ua=na:La+rn=0?Xa=Pr:Yr+vn=0?Xa=Yr:Ga+vn=0,(Sa.idealAlign==="top"||!jn)&&li?(da-=ua/2,Sa.anchor="end"):jn?(da+=ua/2,Sa.anchor="start"):Sa.anchor="middle",Sa.crossPos=da;else{if(Sa.pos=da,jn=Ir+Ta/2+_n<=wr,li=Ir-Ta/2-_n>=0,(Sa.idealAlign==="left"||!jn)&&li)Ir-=Ta/2,Sa.anchor="end";else if(jn)Ir+=Ta/2,Sa.anchor="start";else{Sa.anchor="middle";var yi=_n/2,gi=Ir+yi-wr,Si=Ir-yi;gi>0&&(Ir-=gi),Si<0&&(Ir+=-Si)}Sa.crossPos=Ir}zr.attr("text-anchor",Sa.anchor),dt&&Ur.attr("text-anchor",Sa.anchor),Zn.attr("transform",e(Ir,da)+(Te?t(w):""))}),{hoverLabels:an,commonLabelBoundingBox:He}}function O(j,Q,re,he,xe,Te){var Le,Pe,qe="",et="";j.nameOverride!==void 0&&(j.name=j.nameOverride),j.name&&(j.trace._meta&&(j.name=S.templateString(j.name,j.trace._meta)),qe=G(j.name,j.nameLength));var rt=re.charAt(0),$e=rt==="x"?"y":"x";j.zLabel!==void 0?(j.xLabel!==void 0&&(et+="x: "+j.xLabel+"
"),j.yLabel!==void 0&&(et+="y: "+j.yLabel+"
"),j.trace.type!=="choropleth"&&j.trace.type!=="choroplethmapbox"&&j.trace.type!=="choroplethmap"&&(et+=(et?"z: ":"")+j.zLabel)):Q&&j[rt+"Label"]===xe?et=j[$e+"Label"]||"":j.xLabel===void 0?j.yLabel!==void 0&&j.trace.type!=="scattercarpet"&&(et=j.yLabel):j.yLabel===void 0?et=j.xLabel:et="("+j.xLabel+", "+j.yLabel+")",(j.text||j.text===0)&&!Array.isArray(j.text)&&(et+=(et?"
":"")+j.text),j.extraText!==void 0&&(et+=(et?"
":"")+j.extraText),Te&&et===""&&!j.hovertemplate&&(qe===""&&Te.remove(),et=qe),(Pe=(Le=j.trace)==null?void 0:Le.hoverlabel)!=null&&Pe.split&&(j.hovertemplate="");let{hovertemplate:Ue=!1}=j;if(Ue){let fe=j.hovertemplateLabels||j;j[rt+"Label"]!==xe&&(fe[rt+"other"]=fe[rt+"Val"],fe[rt+"otherLabel"]=fe[rt+"Label"]),et=S.hovertemplateString({data:[j.eventData[0]||{},j.trace._meta],fallback:j.trace.hovertemplatefallback,labels:fe,locale:he._d3locale,template:Ue}),et=et.replace(F,(ue,ie)=>(qe=G(ie,j.nameLength),""))}return[et,qe]}function P(j,Q,re,he){var xe=Q?"xa":"ya",Te=Q?"ya":"xa",Le=0,Pe=1,qe=j.size(),et=new Array(qe),rt=0,$e=he.minX,Ue=he.maxX,fe=he.minY,ue=he.maxY,ie=function(we){return we*re._invScaleX},Ee=function(we){return we*re._invScaleY};j.each(function(we){var ke=we[xe],Be=we[Te],He=ke._id.charAt(0)==="x",nt=ke.range;rt===0&&nt&&nt[0]>nt[1]!==He&&(Pe=-1);var ot=0,Ft=He?re.width:re.height;if(re.hovermode==="x"||re.hovermode==="y"){var Mt=U(we,Q),Et=we.anchor,Ot=Et==="end"?-1:1,sr,ir;if(Et==="middle")sr=we.crossPos+(He?Ee(Mt.y-we.by/2):ie(we.bx/2+we.tx2width/2)),ir=sr+(He?Ee(we.by):ie(we.bx));else if(He)sr=we.crossPos+Ee(v+Mt.y)-Ee(we.by/2-v),ir=sr+Ee(we.by);else{var ar=ie(Ot*v+Mt.x),Mr=ar+ie(Ot*we.bx);sr=we.crossPos+Math.min(ar,Mr),ir=we.crossPos+Math.max(ar,Mr)}He?fe!==void 0&&ue!==void 0&&Math.min(ir,ue)-Math.max(sr,fe)>1&&(Be.side==="left"?(ot=Be._mainLinePosition,Ft=re.width):Ft=Be._mainLinePosition):$e!==void 0&&Ue!==void 0&&Math.min(ir,Ue)-Math.max(sr,$e)>1&&(Be.side==="top"?(ot=Be._mainLinePosition,Ft=re.height):Ft=Be._mainLinePosition)}et[rt++]=[{datum:we,traceIndex:we.trace.index,dp:0,pos:we.pos,posref:we.posref,size:we.by*(He?M:1)/2,pmin:ot,pmax:Ft}]}),et.sort(function(we,ke){return we[0].posref-ke[0].posref||Pe*(ke[0].traceIndex-we[0].traceIndex)});var We,Qe,Xe,Tt,St,zt,Ut;function br(we){var ke=we[0],Be=we[we.length-1];if(Qe=ke.pmin-ke.pos-ke.dp+ke.size,Xe=Be.pos+Be.dp+Be.size-ke.pmax,Qe>.01){for(St=we.length-1;St>=0;St--)we[St].dp+=Qe;We=!1}if(!(Xe<.01)){if(Qe<-.01){for(St=we.length-1;St>=0;St--)we[St].dp-=Xe;We=!1}if(We){var He=0;for(Tt=0;Ttke.pmax&&He++;for(Tt=we.length-1;Tt>=0&&!(He<=0);Tt--)zt=we[Tt],zt.pos>ke.pmax-1&&(zt.del=!0,He--);for(Tt=0;Tt=0;St--)we[St].dp-=Xe;for(Tt=we.length-1;Tt>=0&&!(He<=0);Tt--)zt=we[Tt],zt.pos+zt.dp+zt.size>ke.pmax&&(zt.del=!0,He--)}}}for(;!We&&Le<=qe;){for(Le++,We=!0,Tt=0;Tt.01){for(St=Or.length-1;St>=0;St--)Or[St].dp+=Qe;for(hr.push.apply(hr,Or),et.splice(Tt+1,1),Ut=0,St=hr.length-1;St>=0;St--)Ut+=hr[St].dp;for(Xe=Ut/hr.length,St=hr.length-1;St>=0;St--)hr[St].dp-=Xe;We=!1}else Tt++}et.forEach(br)}for(Tt=et.length-1;Tt>=0;Tt--){var mt=et[Tt];for(St=mt.length-1;St>=0;St--){var ze=mt[St],Ze=ze.datum;Ze.offset=ze.dp,Ze.del=ze.del}}}function U(j,Q){var re=0,he=j.offset;return Q&&(he*=-b,re=j.offset*g),{x:re,y:he}}function B(j){var Q={start:1,end:-1,middle:0}[j.anchor],re=Q*(v+u),he=re+Q*(j.txwidth+u),xe=j.anchor==="middle";return xe&&(re-=j.tx2width/2,he+=j.txwidth/2+u),{alignShift:Q,textShiftX:re,text2ShiftX:he}}function X(j,Q,re,he){var xe=function(Le){return Le*re},Te=function(Le){return Le*he};j.each(function(Le){var Pe=q.select(this);if(Le.del)return Pe.remove();var qe=Pe.select("text.nums"),et=Le.anchor,rt=et==="end"?-1:1,$e=B(Le),Ue=U(Le,Q),fe=Ue.x,ue=Ue.y,ie=et==="middle",Ee="hoverlabel"in Le.trace?Le.trace.hoverlabel.showarrow:!0,We;ie?We="M-"+xe(Le.bx/2+Le.tx2width/2)+","+Te(ue-Le.by/2)+"h"+xe(Le.bx)+"v"+Te(Le.by)+"h-"+xe(Le.bx)+"Z":Ee?We="M0,0L"+xe(rt*v+fe)+","+Te(v+ue)+"v"+Te(Le.by/2-v)+"h"+xe(rt*Le.bx)+"v-"+Te(Le.by)+"H"+xe(rt*v+fe)+"V"+Te(ue-v)+"Z":We="M"+xe(rt*v+fe)+","+Te(ue-Le.by/2)+"h"+xe(rt*Le.bx)+"v"+Te(Le.by)+"h"+xe(-rt*Le.bx)+"Z",Pe.select("path").attr("d",We);var Qe=fe+$e.textShiftX,Xe=ue+Le.ty0-Le.by/2+u,Tt=Le.textAlign||"auto";Tt!=="auto"&&(Tt==="left"&&et!=="start"?(qe.attr("text-anchor","start"),Qe=ie?-Le.bx/2-Le.tx2width/2+u:-Le.bx-u):Tt==="right"&&et!=="end"&&(qe.attr("text-anchor","end"),Qe=ie?Le.bx/2-Le.tx2width/2-u:Le.bx+u)),qe.call(o.positionText,xe(Qe),Te(Xe)),Le.tx2width&&(Pe.select("text.name").call(o.positionText,xe($e.text2ShiftX+$e.alignShift*u+fe),Te(ue+Le.ty0-Le.by/2+u)),Pe.select("rect").call(i.setRect,xe($e.text2ShiftX+($e.alignShift-1)*Le.tx2width/2+fe),Te(ue-Le.by/2-1),xe(Le.tx2width),Te(Le.by+2)))})}function $(j,Q){var re=j.index,he=j.trace||{},xe=j.cd[0],Te=j.cd[re]||{};function Le(Ue){return Ue||d(Ue)&&Ue===0}var Pe=Array.isArray(re)?function(Ue,fe){var ue=S.castOption(xe,re,Ue);return Le(ue)?ue:S.extractOption({},he,"",fe)}:function(Ue,fe){return S.extractOption(Te,he,Ue,fe)};function qe(Ue,fe,ue){var ie=Pe(fe,ue);Le(ie)&&(j[Ue]=ie)}if(qe("hoverinfo","hi","hoverinfo"),qe("bgcolor","hbg","hoverlabel.bgcolor"),qe("borderColor","hbc","hoverlabel.bordercolor"),qe("fontFamily","htf","hoverlabel.font.family"),qe("fontSize","hts","hoverlabel.font.size"),qe("fontColor","htc","hoverlabel.font.color"),qe("fontWeight","htw","hoverlabel.font.weight"),qe("fontStyle","hty","hoverlabel.font.style"),qe("fontVariant","htv","hoverlabel.font.variant"),qe("nameLength","hnl","hoverlabel.namelength"),qe("textAlign","hta","hoverlabel.align"),j.posref=Q==="y"||Q==="closest"&&he.orientation==="h"?j.xa._offset+(j.x0+j.x1)/2:j.ya._offset+(j.y0+j.y1)/2,j.x0=S.constrain(j.x0,0,j.xa._length),j.x1=S.constrain(j.x1,0,j.xa._length),j.y0=S.constrain(j.y0,0,j.ya._length),j.y1=S.constrain(j.y1,0,j.ya._length),j.xLabelVal!==void 0&&(j.xLabel="xLabel"in j?j.xLabel:h.hoverLabelText(j.xa,j.xLabelVal,he.xhoverformat),j.xVal=j.xa.c2d(j.xLabelVal)),j.yLabelVal!==void 0&&(j.yLabel="yLabel"in j?j.yLabel:h.hoverLabelText(j.ya,j.yLabelVal,he.yhoverformat),j.yVal=j.ya.c2d(j.yLabelVal)),j.zLabelVal!==void 0&&j.zLabel===void 0&&(j.zLabel=String(j.zLabelVal)),!isNaN(j.xerr)&&!(j.xa.type==="log"&&j.xerr<=0)){var et=h.tickText(j.xa,j.xa.c2l(j.xerr),"hover").text;j.xerrneg!==void 0?j.xLabel+=" +"+et+" / -"+h.tickText(j.xa,j.xa.c2l(j.xerrneg),"hover").text:j.xLabel+=" \xB1 "+et,Q==="x"&&(j.distance+=1)}if(!isNaN(j.yerr)&&!(j.ya.type==="log"&&j.yerr<=0)){var rt=h.tickText(j.ya,j.ya.c2l(j.yerr),"hover").text;j.yerrneg!==void 0?j.yLabel+=" +"+rt+" / -"+h.tickText(j.ya,j.ya.c2l(j.yerrneg),"hover").text:j.yLabel+=" \xB1 "+rt,Q==="y"&&(j.distance+=1)}var $e=j.hoverinfo||j.trace.hoverinfo;return $e&&$e!=="all"&&($e=Array.isArray($e)?$e:$e.split("+"),$e.indexOf("x")===-1&&(j.xLabel=void 0),$e.indexOf("y")===-1&&(j.yLabel=void 0),$e.indexOf("z")===-1&&(j.zLabel=void 0),$e.indexOf("text")===-1&&(j.text=void 0),$e.indexOf("name")===-1&&(j.name=void 0)),j}function le(j,Q,re){var he=re.container,xe=re.fullLayout,Te=xe._size,Le=re.event,Pe=!!Q.hLinePoint,qe=!!Q.vLinePoint,et,rt;if(he.selectAll(".spikeline").remove(),!!(qe||Pe)){var $e=n.combine(xe.plot_bgcolor,xe.paper_bgcolor);if(Pe){var Ue=Q.hLinePoint,fe,ue;et=Ue&&Ue.xa,rt=Ue&&Ue.ya;var ie=rt.spikesnap;ie==="cursor"?(fe=Le.pointerX,ue=Le.pointerY):(fe=et._offset+Ue.x,ue=rt._offset+Ue.y);var Ee=x.readability(Ue.color,$e)<1.5?n.contrast($e):Ue.color,We=rt.spikemode,Qe=rt.spikethickness,Xe=rt.spikecolor||Ee,Tt=h.getPxPosition(j,rt),St,zt;if(We.indexOf("toaxis")!==-1||We.indexOf("across")!==-1){if(We.indexOf("toaxis")!==-1&&(St=Tt,zt=fe),We.indexOf("across")!==-1){var Ut=rt._counterDomainMin,br=rt._counterDomainMax;rt.anchor==="free"&&(Ut=Math.min(Ut,rt.position),br=Math.max(br,rt.position)),St=Te.l+Ut*Te.w,zt=Te.l+br*Te.w}he.insert("line",":first-child").attr({x1:St,x2:zt,y1:ue,y2:ue,"stroke-width":Qe,stroke:Xe,"stroke-dasharray":i.dashStyle(rt.spikedash,Qe)}).classed("spikeline",!0).classed("crisp",!0),he.insert("line",":first-child").attr({x1:St,x2:zt,y1:ue,y2:ue,"stroke-width":Qe+2,stroke:$e}).classed("spikeline",!0).classed("crisp",!0)}We.indexOf("marker")!==-1&&he.insert("circle",":first-child").attr({cx:Tt+(rt.side!=="right"?Qe:-Qe),cy:ue,r:Qe,fill:Xe}).classed("spikeline",!0)}if(qe){var hr=Q.vLinePoint,Or,wr;et=hr&&hr.xa,rt=hr&&hr.ya;var Er=et.spikesnap;Er==="cursor"?(Or=Le.pointerX,wr=Le.pointerY):(Or=et._offset+hr.x,wr=rt._offset+hr.y);var mt=x.readability(hr.color,$e)<1.5?n.contrast($e):hr.color,ze=et.spikemode,Ze=et.spikethickness,we=et.spikecolor||mt,ke=h.getPxPosition(j,et),Be,He;if(ze.indexOf("toaxis")!==-1||ze.indexOf("across")!==-1){if(ze.indexOf("toaxis")!==-1&&(Be=ke,He=wr),ze.indexOf("across")!==-1){var nt=et._counterDomainMin,ot=et._counterDomainMax;et.anchor==="free"&&(nt=Math.min(nt,et.position),ot=Math.max(ot,et.position)),Be=Te.t+(1-ot)*Te.h,He=Te.t+(1-nt)*Te.h}he.insert("line",":first-child").attr({x1:Or,x2:Or,y1:Be,y2:He,"stroke-width":Ze,stroke:we,"stroke-dasharray":i.dashStyle(et.spikedash,Ze)}).classed("spikeline",!0).classed("crisp",!0),he.insert("line",":first-child").attr({x1:Or,x2:Or,y1:Be,y2:He,"stroke-width":Ze+2,stroke:$e}).classed("spikeline",!0).classed("crisp",!0)}ze.indexOf("marker")!==-1&&he.insert("circle",":first-child").attr({cx:Or,cy:ke-(et.side!=="top"?Ze:-Ze),r:Ze,fill:we}).classed("spikeline",!0)}}}function ce(j,Q,re){if(!re||re.length!==j._hoverdata.length)return!0;for(var he=re.length-1;he>=0;he--){var xe=re[he],Te=j._hoverdata[he];if(xe.curveNumber!==Te.curveNumber||String(xe.pointNumber)!==String(Te.pointNumber)||String(xe.pointNumbers)!==String(Te.pointNumbers)||xe.binNumber!==Te.binNumber)return!0}return!1}function ve(j,Q){return!Q||Q.vLinePoint!==j._spikepoints.vLinePoint||Q.hLinePoint!==j._spikepoints.hLinePoint}function G(j,Q){return o.plainText(j||"",{len:Q,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function Y(j,Q){for(var re=Q.charAt(0),he=[],xe=[],Te=[],Le=0;Lej.offsetTop+j.clientTop,se=j=>j.offsetLeft+j.clientLeft;function ae(j,Q){var re=j._fullLayout,he=Q.getBoundingClientRect(),xe=he.left,Te=he.top,Le=xe+he.width,Pe=Te+he.height,qe=S.apply3DTransform(re._invTransform)(xe,Te),et=S.apply3DTransform(re._invTransform)(Le,Pe),rt=qe[0],$e=qe[1],Ue=et[0],fe=et[1];return{x:rt,y:$e,width:Ue-rt,height:fe-$e,top:Math.min($e,fe),left:Math.min(rt,Ue),right:Math.max(rt,Ue),bottom:Math.max($e,fe)}}}}),Hm=Ge({"src/components/fx/hoverlabel_defaults.js"(Z,q){"use strict";var d=ta(),x=Bi(),S=Sh().isUnifiedHover;q.exports=function(e,t,r,o){o=o||{};var a=t.legend;function i(n){o.font[n]||(o.font[n]=a?t.legend.font[n]:t.font[n])}t&&S(t.hovermode)&&(o.font||(o.font={}),i("size"),i("family"),i("color"),i("weight"),i("style"),i("variant"),a?(o.bgcolor||(o.bgcolor=x.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),r("hoverlabel.showarrow",o.showarrow),d.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}}}),oS=Ge({"src/components/fx/layout_global_defaults.js"(Z,q){"use strict";var d=ta(),x=Hm(),S=Md();q.exports=function(e,t){function r(o,a){return d.coerce(e,t,S,o,a)}x(e,t,r)}}}),sS=Ge({"src/components/fx/defaults.js"(Z,q){"use strict";var d=ta(),x=C0(),S=Hm();q.exports=function(e,t,r,o){function a(n,s){return d.coerce(e,t,x,n,s)}var i=d.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),S(e,t,a,i)}}}),wb=Ge({"src/components/fx/hovermode_defaults.js"(Z,q){"use strict";var d=ta(),x=Md();q.exports=function(E,e){function t(r,o){return e[r]!==void 0?e[r]:d.coerce(E,e,x,r,o)}return t("clickmode"),t("hoversubplots"),t("hoveranywhere"),t("clickanywhere"),t("hovermode")}}}),lS=Ge({"src/components/fx/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Md(),S=wb(),E=Hm();q.exports=function(t,r){function o(p,c){return d.coerce(t,r,x,p,c)}var a=S(t,r);a&&(o("hoverdistance"),o("spikedistance"));var i=o("dragmode");i==="select"&&o("selectdirection");var n=r._has("mapbox"),s=r._has("map"),h=r._has("geo"),f=r._basePlotModules.length;r.dragmode==="zoom"&&((n||s||h)&&f===1||(n||s)&&h&&f===2)&&(r.dragmode="pan"),E(t,r,o),d.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),uS=Ge({"src/components/fx/calc.js"(Z,q){"use strict";var d=ta(),x=Yi();q.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(h){return function(f){return d.coerceHoverinfo({hoverinfo:f},{_module:h._module},r)}}for(var a=0;a"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),$y=Ge({"src/components/shapes/draw_newshape/constants.js"(Z,q){"use strict";var d=32;q.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Qy=Ge({"src/components/selections/helpers.js"(Z,q){"use strict";var d=ta().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function S(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}q.exports={p2r:x,r2p:S,axValue:E,getTransform:e}}}),Dd=Ge({"src/components/shapes/draw_newshape/helpers.js"(Z){"use strict";var q=qm(),d=$y(),x=d.CIRCLE_SIDES,S=d.SQRT2,E=Qy(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Z.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var h="",f=0;f0&&_{let s=n.charAt(0),h=a[s].drawn!==void 0;return i+(h?1:0)},0)},Z.getDataToPixel=function(e,t,r,o,a){var i=e._fullLayout._size,n;if(t)if(a==="domain")n=function(h){return t._length*(o?1-h:h)+t._offset};else{var s=Z.shapePositionToRange(t);n=function(h){var f=E(t,r);return t._offset+t.r2p(s(h,!0))+f},t.type==="date"&&(n=Z.decodeDate(n))}else o?n=function(h){return i.t+i.h*(1-h)}:n=function(h){return i.l+i.w*h};return n},Z.getPixelToData=function(e,t,r,o){var a=e._fullLayout._size,i;if(t)if(o==="domain")i=function(s){var h=(s-t._offset)/t._length;return r?1-h:h};else{var n=Z.rangeToShapePosition(t);i=function(s){return n(t.p2r(s-t._offset))}}else r?i=function(s){return 1-(s-a.t)/a.h}:i=function(s){return(s-a.l)/a.w};return i},Z.roundPositionForSharpStrokeRendering=function(e,t){var r=Math.round(t%2)===1,o=Math.round(e);return r?o+.5:o},Z.makeShapesOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},o=e._fullLayout._plots[r.xref+r.yref],a=!!o;return a?o._hadPlotinfo=!0:(o={},r.xref&&r.xref!=="paper"&&(o.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&r.yref!=="paper"&&(o.yaxis=e._fullLayout[r.yref+"axis"])),o.xsizemode=r.xsizemode,o.ysizemode=r.ysizemode,o.xanchor=r.xanchor,o.yanchor=r.yanchor,{options:r,plotinfo:o}},Z.makeSelectionsOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.selections[t]||{},o=e._fullLayout._plots[r.xref+r.yref],a=!!o;return a?o._hadPlotinfo=!0:(o={},r.xref&&(o.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&(o.yaxis=e._fullLayout[r.yref+"axis"])),{options:r,plotinfo:o}},Z.getPathString=function(e,t){let r=t.type,o=x.getRefType(t.xref),a=x.getRefType(t.yref),i=e._fullLayout._size;var n,s,h,f,p,c,T,l,_,w,A,M;function g(z,F,N,O){var P;if(z)if(F==="domain")O?P=function(U){return z._offset+z._length*(1-U)}:P=function(U){return z._offset+z._length*U};else{let U=Z.shapePositionToRange(z);P=function(B){return z._offset+z.r2p(U(B,!0))},N==="path"&&z.type==="date"&&(P=Z.decodeDate(P))}else O?P=function(U){return i.t+i.h*(1-U)}:P=function(U){return i.l+i.w*U};return P}if(o==="array"?(T=[],n=t.xref.map(function(z){return x.getFromId(e,z)}),T=t.xref.map(function(z,F){return g(n[F],x.getRefType(z),r,!1)})):(n=x.getFromId(e,t.xref),T=g(n,o,r,!1)),a==="array"?(l=[],s=t.yref.map(function(z){return x.getFromId(e,z)}),l=t.yref.map(function(z,F){return g(s[F],x.getRefType(z),r,!0)})):(s=x.getFromId(e,t.yref),l=g(s,a,r,!0)),r==="path")return S(t,T,l);if(o==="array")h=E(n[0],t.x0shift),f=E(n[1],t.x1shift),_=T[0](t.x0)+h,w=T[1](t.x1)+f;else if(h=E(n,t.x0shift),f=E(n,t.x1shift),t.xsizemode==="pixel"){let z=T(t.xanchor);_=z+t.x0+h,w=z+t.x1+f}else _=T(t.x0)+h,w=T(t.x1)+f;if(a==="array")p=E(s[0],t.y0shift),c=E(s[1],t.y1shift),A=l[0](t.y0)+p,M=l[1](t.y1)+c;else if(p=E(s,t.y0shift),c=E(s,t.y1shift),t.ysizemode==="pixel"){let z=l(t.yanchor);A=z-t.y0+p,M=z-t.y1+c}else A=l(t.y0)+p,M=l(t.y1)+c;if(r==="line")return"M"+_+","+A+"L"+w+","+M;if(r==="rect")return"M"+_+","+A+"H"+w+"V"+M+"H"+_+"Z";var b=(_+w)/2,v=(A+M)/2,u=Math.abs(b-_),y=Math.abs(v-A),m="A"+u+","+y,R=b+u+","+v,L=b+","+(v-y);return"M"+R+m+" 0 1,1 "+L+m+" 0 0,1 "+R+"Z"};function S(e,t,r){let o=e.path,a=e.xsizemode,i=e.ysizemode,n=e.xanchor,s=e.yanchor,h=Array.isArray(e.xref),f=Array.isArray(e.yref);var p=0,c=0;return o.replace(q.segmentRE,function(T){var l=0,_=T.charAt(0),w=q.paramIsX[_],A=q.paramIsY[_],M=q.numParams[_];let g=w.drawn!==void 0,b=A.drawn!==void 0,v=h?t[p]:t,u=f?r[c]:r;var y=T.slice(1).replace(q.paramRE,function(m){return w[l]?a==="pixel"?m=v(n)+Number(m):m=v(m):A[l]&&(i==="pixel"?m=u(s)-Number(m):m=u(m)),l++,l>M&&(m="X"),m});return l>M&&(y=y.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+T)),g&&p++,b&&c++,_+y})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),Ab=Ge({"src/components/shapes/display_labels.js"(Z,q){"use strict";var d=ta(),x=Mo(),S=Il(),E=zo(),e=Dd().readPaths,t=zd(),r=t.getPathString,o=Gy(),a=uf().FROM_TL;q.exports=function(h,f,p,c){if(c.selectAll(".shape-label").remove(),!!(p.label.text||p.label.texttemplate)){var T;if(p.label.texttemplate){var l={};if(p.type!=="path"){var _=x.getFromId(h,p.xref),w=x.getFromId(h,p.yref);let j=Array.isArray(p.xref),Q=Array.isArray(p.yref);for(var A in o){var M=typeof o[A]=="function",g=!j||o.simpleXVariables.includes(A),b=!Q||o.simpleYVariables.includes(A);if(M&&g&&b){var v=o[A](p,_,w);v!==void 0&&(l[A]=v)}}}T=d.texttemplateStringForShapes({data:[l],fallback:p.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:p.label.texttemplate})}else T=p.label.text;var u={"data-index":f},y=p.label.font,m={"data-notex":1},R=c.append("g").attr(u).classed("shape-label",!0),L=R.append("text").attr(m).classed("shape-label-text",!0).text(T),z,F,N,O;if(p.path){var P=r(h,p),U=e(P,h);z=1/0,N=1/0,F=-1/0,O=-1/0;for(var B=0;B=s?c=h-p:c=p-h,-180/Math.PI*Math.atan2(c,T)}function n(s,h,f,p,c,T,l){var _=c.label.textposition,w=c.label.textangle,A=c.label.padding,M=c.type,g=Math.PI/180*T,b=Math.sin(g),v=Math.cos(g),u=c.label.xanchor,y=c.label.yanchor,m,R,L,z;if(M==="line"){_==="start"?(m=s,R=h):_==="end"?(m=f,R=p):(m=(s+f)/2,R=(h+p)/2),u==="auto"&&(_==="start"?w==="auto"?f>s?u="left":fs?u="right":fs?u="right":fs?u="left":f1&&!($e.length===2&&$e[1][0]==="Z")&&(G===0&&($e[0][0]="M"),m[ve]=$e,N(),O())}}function he($e,Ue){if($e===2){ve=+Ue.srcElement.getAttribute("data-i"),G=+Ue.srcElement.getAttribute("data-j");var fe=m[ve];!T(fe)&&!l(fe)&&re()}}function xe($e){le=[];for(var Ue=0;UeE.getFromId(m,le)).filter(Boolean);if(!B.length)return U?[z.t,z.t+z.h]:[z.l,z.l+z.w];let X=B.map(function(le){return le._offset}),$=B.map(function(le){return le._offset+le._length});return[Math.min(...X),Math.max(...$)]}let N=F(R,!1),O=F(L,!0);return{x:N[0],y:O[0],width:N[1]-N[0],height:O[1]-O[0]}}function g(m,R,L,z,F,N){var O=10,P=10,U=L.xsizemode==="pixel",B=L.ysizemode==="pixel",X=L.type==="line",$=L.type==="path",le=N.modifyItem,ce,ve,G,Y,ee,V,se,ae,j,Q,re,he,xe,Te,Le,Pe=d.select(R.node().parentNode),qe=E.getFromId(m,L.xref),et=E.getRefType(L.xref),rt=E.getFromId(m,L.yref),$e=E.getRefType(L.yref),Ue=L.x0shift,fe=L.x1shift,ue=L.y0shift,ie=L.y1shift,Ee=function(Be,He){var nt=p.getDataToPixel(m,qe,He,!1,et);return nt(Be)},We=function(Be,He){var nt=p.getDataToPixel(m,rt,He,!0,$e);return nt(Be)},Qe=p.getPixelToData(m,qe,!1,et),Xe=p.getPixelToData(m,rt,!0,$e),Tt=Ut(),St={element:Tt.node(),gd:m,prepFn:Or,doneFn:wr,clickFn:Er},zt;s.init(St),Tt.node().onmousemove=hr;function Ut(){return X?br():R}function br(){var Be=10,He=Math.max(L.line.width,Be),nt=F.append("g").attr("data-index",z).attr("drag-helper",!0);nt.append("path").attr("d",R.attr("d")).style({cursor:"move","stroke-width":He,"stroke-opacity":"0"});var ot={"fill-opacity":"0"},Ft=Math.max(He/2,Be);return nt.append("circle").attr({"data-line-point":"start-point",cx:U?Ee(L.xanchor)+L.x0:Ee(L.x0,Ue),cy:B?We(L.yanchor)-L.y0:We(L.y0,ue),r:Ft}).style(ot).classed("cursor-grab",!0),nt.append("circle").attr({"data-line-point":"end-point",cx:U?Ee(L.xanchor)+L.x1:Ee(L.x1,fe),cy:B?We(L.yanchor)-L.y1:We(L.y1,ie),r:Ft}).style(ot).classed("cursor-grab",!0),nt}function hr(Be){if(l(m)){zt=null;return}if(X)Be.target.tagName==="path"?zt="move":zt=Be.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var He=St.element.getBoundingClientRect(),nt=He.right-He.left,ot=He.bottom-He.top,Ft=Be.clientX-He.left,Mt=Be.clientY-He.top,Et=!$&&nt>O&&ot>P&&!Be.shiftKey?s.getCursor(Ft/nt,1-Mt/ot):"move";h(R,Et),zt=Et.split("-")[0]}}function Or(Be){l(m)||(U&&(ee=Ee(L.xanchor)),B&&(V=We(L.yanchor)),L.type==="path"?Le=L.path:(ce=U?L.x0:Ee(L.x0),ve=B?L.y0:We(L.y0),G=U?L.x1:Ee(L.x1),Y=B?L.y1:We(L.y1)),ceY?(se=ve,re="y0",ae=Y,he="y1"):(se=Y,re="y1",ae=ve,he="y0"),hr(Be),Ze(F,L),ke(R,L,m),St.moveFn=zt==="move"?mt:ze,St.altKey=Be.altKey)}function wr(){l(m)||(h(R),we(F),A(R,m,L),x.call("_guiRelayout",m,N.getUpdateObj()))}function Er(){l(m)||we(F)}function mt(Be,He){if(L.type==="path"){var nt=function(Mt){return Mt},ot=nt,Ft=nt;U?le("xanchor",L.xanchor=Qe(ee+Be)):(ot=function(Et){return Qe(Ee(Et)+Be)},qe&&qe.type==="date"&&(ot=p.encodeDate(ot))),B?le("yanchor",L.yanchor=Xe(V+He)):(Ft=function(Et){return Xe(We(Et)+He)},rt&&rt.type==="date"&&(Ft=p.encodeDate(Ft))),le("path",L.path=b(Le,ot,Ft))}else U?le("xanchor",L.xanchor=Qe(ee+Be)):(le("x0",L.x0=Qe(ce+Be)),le("x1",L.x1=Qe(G+Be))),B?le("yanchor",L.yanchor=Xe(V+He)):(le("y0",L.y0=Xe(ve+He)),le("y1",L.y1=Xe(Y+He)));R.attr("d",c(m,L)),Ze(F,L),r(m,z,L,Pe)}function ze(Be,He){if($){var nt=function(rn){return rn},ot=nt,Ft=nt;U?le("xanchor",L.xanchor=Qe(ee+Be)):(ot=function(vn){return Qe(Ee(vn)+Be)},qe&&qe.type==="date"&&(ot=p.encodeDate(ot))),B?le("yanchor",L.yanchor=Xe(V+He)):(Ft=function(vn){return Xe(We(vn)+He)},rt&&rt.type==="date"&&(Ft=p.encodeDate(Ft))),le("path",L.path=b(Le,ot,Ft))}else if(X){if(zt==="resize-over-start-point"){var Mt=ce+Be,Et=B?ve-He:ve+He;le("x0",L.x0=U?Mt:Qe(Mt)),le("y0",L.y0=B?Et:Xe(Et))}else if(zt==="resize-over-end-point"){var Ot=G+Be,sr=B?Y-He:Y+He;le("x1",L.x1=U?Ot:Qe(Ot)),le("y1",L.y1=B?sr:Xe(sr))}}else{var ir=function(rn){return zt.indexOf(rn)!==-1},ar=ir("n"),Mr=ir("s"),ma=ir("w"),Ca=ir("e"),Aa=ar?se+He:se,Da=Mr?ae+He:ae,Ba=ma?j+Be:j,ba=Ca?Q+Be:Q;B&&(ar&&(Aa=se-He),Mr&&(Da=ae-He)),(!B&&Da-Aa>P||B&&Aa-Da>P)&&(le(re,L[re]=B?Aa:Xe(Aa)),le(he,L[he]=B?Da:Xe(Da))),ba-Ba>O&&(le(xe,L[xe]=U?Ba:Qe(Ba)),le(Te,L[Te]=U?ba:Qe(ba)))}R.attr("d",c(m,L)),Ze(F,L),r(m,z,L,Pe)}function Ze(Be,He){(U||B)&&nt();function nt(){var ot=He.type!=="path",Ft=Be.selectAll(".visual-cue").data([0]),Mt=1;Ft.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Mt}).classed("visual-cue",!0);var Et=Ee(U?He.xanchor:S.midRange(ot?[He.x0,He.x1]:p.extractPathCoords(He.path,f.paramIsX))),Ot=We(B?He.yanchor:S.midRange(ot?[He.y0,He.y1]:p.extractPathCoords(He.path,f.paramIsY)));if(Et=p.roundPositionForSharpStrokeRendering(Et,Mt),Ot=p.roundPositionForSharpStrokeRendering(Ot,Mt),U&&B){var sr="M"+(Et-1-Mt)+","+(Ot-1-Mt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Ft.attr("d",sr)}else if(U){var ir="M"+(Et-1-Mt)+","+(Ot-9-Mt)+"v18 h2 v-18 Z";Ft.attr("d",ir)}else{var ar="M"+(Et-9-Mt)+","+(Ot-1-Mt)+"h18 v2 h-18 Z";Ft.attr("d",ar)}}}function we(Be){Be.selectAll(".visual-cue").remove()}function ke(Be,He,nt){var ot=He.xref,Ft=He.yref,Mt=E.getFromId(nt,ot),Et=E.getFromId(nt,Ft),Ot="";ot!=="paper"&&!Mt.autorange&&(Ot+=ot),Ft!=="paper"&&!Et.autorange&&(Ot+=Ft),i.setClipUrl(Be,Ot?"clip"+nt._fullLayout._uid+Ot:null,nt)}}function b(m,R,L){return m.replace(f.segmentRE,function(z){var F=0,N=z.charAt(0),O=f.paramIsX[N],P=f.paramIsY[N],U=f.numParams[N],B=z.slice(1).replace(f.paramRE,function(X){return F>=U||(O[F]?X=R(X):P[F]&&(X=L(X)),F++),X});return N+B})}function v(m,R){if(_(m)){var L=R.node(),z=+L.getAttribute("data-index");if(z>=0){if(z===m._fullLayout._activeShapeIndex){u(m);return}m._fullLayout._activeShapeIndex=z,m._fullLayout._deactivateShape=u,T(m)}}}function u(m){if(_(m)){var R=m._fullLayout._activeShapeIndex;R>=0&&(o(m),delete m._fullLayout._activeShapeIndex,T(m))}}function y(m){if(_(m)){o(m);var R=m._fullLayout._activeShapeIndex,L=(m.layout||{}).shapes||[];if(R1?(ce=["toggleHover"],ve=["resetViews"]):u?(le=["zoomInGeo","zoomOutGeo"],ce=["hoverClosestGeo"],ve=["resetGeo"]):v?(ce=["hoverClosest3d"],ve=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(le=["zoomInMapbox","zoomOutMapbox"],ce=["toggleHover"],ve=["resetViewMapbox"]):z?(le=["zoomInMap","zoomOutMap"],ce=["toggleHover"],ve=["resetViewMap"]):y?ce=["hoverClosestPie"]:O?(ce=["hoverClosestCartesian","hoverCompareCartesian"],ve=["resetViewSankey"]):ce=["toggleHover"],b&&ce.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||U)&&(ce=[]),b&&!P&&(le=["zoomIn2d","zoomOut2d","autoScale2d"],ve[0]!=="resetViews"&&(ve=["resetScale2d"])),v?G=["zoom3d","pan3d","orbitRotation","tableRotation"]:b&&!P||R?G=["zoom2d","pan2d"]:L||z||u?G=["pan2d"]:F&&(G=["zoom2d"]),n(T)&&G.push("select2d","lasso2d");var Y=[],ee=function(j){Y.indexOf(j)===-1&&ce.indexOf(j)!==-1&&Y.push(j)};if(Array.isArray(M)){for(var V=[],se=0;sew?T.slice(w):l.slice(_))+A}function h(p,c){for(var T=c._size,l=T.h/T.w,_={},w=Object.keys(p),A=0;At*R&&!N)){for(w=0;wG&&rece&&(ce=re);var xe=(ce-le)/(2*ve);u/=xe,le=g.l2r(le),ce=g.l2r(ce),g.range=g._input.range=B=O[1]||X[1]<=O[0])&&$[0]P[0])return!0}return!1}function A(O){var P=O._fullLayout,U=P._size,B=U.p,X=i.list(O,"",!0),$,le,ce,ve,G,Y;if(P._paperdiv.style({width:O._context.responsive&&P.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":P.width+"px",height:O._context.responsive&&P.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":P.height+"px"}).selectAll(".main-svg").call(r.setSize,P.width,P.height),O._context.setBackground(O,P.paper_bgcolor),Z.drawMainTitle(O),a.manage(O),!P._has("cartesian"))return x.previousPromises(O);function ee(we,ke,Be){var He=we._lw/2;if(we._id.charAt(0)==="x"){if(ke){if(Be==="top")return ke._offset-B-He}else return U.t+U.h*(1-(we.position||0))+He%1;return ke._offset+ke._length+B+He}if(ke){if(Be==="right")return ke._offset+ke._length+B+He}else return U.l+U.w*(we.position||0)+He%1;return ke._offset-B-He}for($=0;$0){m(O,$,G,ve),ce.attr({x:le,y:$,"text-anchor":B,dy:z(P.yanchor)}).call(E.positionText,le,$);var Y=(P.text.match(E.BR_TAG_ALL)||[]).length;if(Y){var ee=n.LINE_SPACING*Y+n.MID_SHIFT;P.y===0&&(ee=-ee),ce.selectAll(".line").each(function(){var Q=+this.getAttribute("dy").slice(0,-2)-ee+"em";this.setAttribute("dy",Q)})}var V=q.select(O).selectAll(".gtitle-subtitle");if(V.node()){var se=ce.node().getBBox(),ae=se.y+se.height,j=ae+o.SUBTITLE_PADDING_EM*P.subtitle.font.size;V.attr({x:le,y:j,"text-anchor":B,dy:z(P.yanchor)}).call(E.positionText,le,j)}}}};function v(O,P,U,B,X){var $=P.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,le=S.isTopAnchor(P)?B:B-X,ce=U==="b"?$-le:le;return S.isTopAnchor(P)&&U==="t"||S.isBottomAnchor(P)&&U==="b"?!1:ce.5?"t":"b",le=O._fullLayout.margin[$],ce=0;return P.yref==="paper"?ce=U+P.pad.t+P.pad.b:P.yref==="container"&&(ce=u($,B,X,O._fullLayout.height,U)+P.pad.t+P.pad.b),ce>le?ce:0}function m(O,P,U,B){var X="title.automargin",$=O._fullLayout.title,le=$.y>.5?"t":"b",ce={x:$.x,y:$.y,t:0,b:0},ve={};$.yref==="paper"&&v(O,$,le,P,B)?ce[le]=U:$.yref==="container"&&(ve[le]=U,O._fullLayout._reservedMargin[X]=ve),x.allowAutoMargin(O,X),x.autoMargin(O,X,ce)}function R(O,P){var U=O.title,B=O._size,X=0;return P===c?X=U.pad.l:P===l&&(X=-U.pad.r),U.xref==="paper"?B.l+B.w*U.x+X:O.width*U.x+X}function L(O,P){var U=O.title,B=O._size,X=0;return P==="0em"||!P?X=-U.pad.b:P===n.CAP_SHIFT+"em"&&(X=U.pad.t),U.y==="auto"?B.t/2:U.yref==="paper"?B.t+B.h-B.h*U.y+X:O.height-O.height*U.y+X}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var P=O.title,U=T;return S.isRightAnchor(P)?U=l:S.isLeftAnchor(P)&&(U=c),U}function N(O){var P=O.title,U="0em";return S.isTopAnchor(P)?U=n.CAP_SHIFT+"em":S.isMiddleAnchor(P)&&(U=n.MID_SHIFT+"em"),U}Z.doTraceStyle=function(O){var P=O.calcdata,U=[],B;for(B=0;B=0;F--){var N=M.append("path").attr(b).style("opacity",F?.1:v).call(E.stroke,y).call(E.fill,u).call(e.dashLine,F?"solid":R,F?4+m:m);if(s(N,c,_),L){var O=t(c.layout,"selections",_);N.style({cursor:"move"});var P={element:N.node(),plotinfo:w,gd:c,editHelpers:O,isActiveSelection:!0},U=d(g,c);x(U,N,P)}else N.style("pointer-events",F?"all":"none");z[F]=N}var B=z[0],X=z[1];X.node().addEventListener("click",function(){return h(c,B)})}}function s(c,T,l){var _=l.xref+l.yref;e.setClipUrl(c,"clip"+T._fullLayout._uid+_,T)}function h(c,T){if(i(c)){var l=T.node(),_=+l.getAttribute("data-index");if(_>=0){if(_===c._fullLayout._activeSelectionIndex){p(c);return}c._fullLayout._activeSelectionIndex=_,c._fullLayout._deactivateSelection=p,a(c)}}}function f(c){if(i(c)){var T=c._fullLayout.selections.length-1;c._fullLayout._activeSelectionIndex=T,c._fullLayout._deactivateSelection=p,a(c)}}function p(c){if(i(c)){var T=c._fullLayout._activeSelectionIndex;T>=0&&(S(c),delete c._fullLayout._activeSelectionIndex,a(c))}}}}),dS=Ge({"node_modules/polybooljs/lib/build-log.js"(Z,q){function d(){var x,S=0,E=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return S++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?x:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}q.exports=d}}),pS=Ge({"node_modules/polybooljs/lib/epsilon.js"(Z,q){function d(x){typeof x!="number"&&(x=1e-10);var S={epsilon:function(E){return typeof E=="number"&&(x=E),x},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=E[0],s=E[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],a=E[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])x!=a-r>x&&(o-s)*(r-h)/(a-h)+s-t>x&&(i=!i),o=s,a=h}return i}};return S}q.exports=d}}),mS=Ge({"node_modules/polybooljs/lib/linked-list.js"(Z,q){var d={create:function(){var x={root:{root:!0,next:null},exists:function(S){return!(S===null||S===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(S,E){for(var e=x.root,t=x.root.next;t!==null;){if(E(t)){S.prev=t.prev,S.next=t,t.prev.next=S,t.prev=S;return}e=t,t=t.next}e.next=S,S.prev=e,S.next=null},findTransition:function(S){for(var E=x.root,e=x.root.next;e!==null&&!S(e);)E=e,e=e.next;return{before:E===x.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};q.exports=d}}),gS=Ge({"node_modules/polybooljs/lib/intersecter.js"(Z,q){var d=mS();function x(S,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,_){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:_.myFill.above,below:_.myFill.below},otherFill:null}}var o=d.create();function a(T,l,_,w,A,M){var g=E.pointsCompare(l,A);return g!==0?g:E.pointsSame(_,M)?0:T!==w?T?1:-1:E.pointAboveOrOnLine(_,w?A:M,w?M:A)?1:-1}function i(T,l){o.insertBefore(T,function(_){var w=a(T.isStart,T.pt,l,_.isStart,_.pt,_.other.pt);return w<0})}function n(T,l){var _=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(_,T.end),_}function s(T,l,_){var w=d.node({isStart:!1,pt:l.end,seg:l,primary:_,other:T,status:null});T.other=w,i(w,T.pt)}function h(T,l){var _=n(T,l);return s(_,T,l),_}function f(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function p(T,l){var _=r(l,T.seg.end,T.seg);return f(T,l),h(_,T.primary)}function c(T,l){var _=d.create();function w(O,P){var U=O.seg.start,B=O.seg.end,X=P.seg.start,$=P.seg.end;return E.pointsCollinear(U,X,$)?E.pointsCollinear(B,X,$)||E.pointAboveOrOnLine(B,X,$)?1:-1:E.pointAboveOrOnLine(U,X,$)?1:-1}function A(O){return _.findTransition(function(P){var U=w(O,P.ev);return U>0})}function M(O,P){var U=O.seg,B=P.seg,X=U.start,$=U.end,le=B.start,ce=B.end;e&&e.checkIntersection(U,B);var ve=E.linesIntersect(X,$,le,ce);if(ve===!1){if(!E.pointsCollinear(X,$,le)||E.pointsSame(X,ce)||E.pointsSame($,le))return!1;var G=E.pointsSame(X,le),Y=E.pointsSame($,ce);if(G&&Y)return P;var ee=!G&&E.pointBetween(X,le,ce),V=!Y&&E.pointBetween($,le,ce);if(G)return V?p(P,$):p(O,ce),P;ee&&(Y||(V?p(P,$):p(O,ce)),p(P,X))}else ve.alongA===0&&(ve.alongB===-1?p(O,le):ve.alongB===0?p(O,ve.pt):ve.alongB===1&&p(O,ce)),ve.alongB===0&&(ve.alongA===-1?p(P,X):ve.alongA===0?p(P,ve.pt):ve.alongA===1&&p(P,$));return!1}for(var g=[];!o.isEmpty();){var b=o.getHead();if(e&&e.vert(b.pt[0]),b.isStart){let O=function(){if(y){var P=M(b,y);if(P)return P}return m?M(b,m):!1};var v=O;e&&e.segmentNew(b.seg,b.primary);var u=A(b),y=u.before?u.before.ev:null,m=u.after?u.after.ev:null;e&&e.tempStatus(b.seg,y?y.seg:!1,m?m.seg:!1);var R=O();if(R){if(S){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,L&&(R.seg.myFill.above=!R.seg.myFill.above)}else R.seg.otherFill=b.seg.myFill;e&&e.segmentUpdate(R.seg),b.other.remove(),b.remove()}if(o.getHead()!==b){e&&e.rewind(b.seg);continue}if(S){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,m?b.seg.myFill.below=m.seg.myFill.above:b.seg.myFill.below=T,L?b.seg.myFill.above=!b.seg.myFill.below:b.seg.myFill.above=b.seg.myFill.below}else if(b.seg.otherFill===null){var z;m?b.primary===m.primary?z=m.seg.otherFill.above:z=m.seg.myFill.above:z=b.primary?l:T,b.seg.otherFill={above:z,below:z}}e&&e.status(b.seg,y?y.seg:!1,m?m.seg:!1),b.other.status=u.insert(d.node({ev:b}))}else{var F=b.status;if(F===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(_.exists(F.prev)&&_.exists(F.next)&&M(F.prev.ev,F.next.ev),e&&e.statusRemove(F.ev.seg),F.remove(),!b.primary){var N=b.seg.myFill;b.seg.myFill=b.seg.otherFill,b.seg.otherFill=N}g.push(b.seg)}o.getHead().remove()}return e&&e.done(),g}return S?{addRegion:function(T){for(var l,_=T[T.length-1],w=0;wr!=p>r&&t<(f-s)*(r-h)/(p-h)+s;c&&(o=!o)}return o}}}),Ym=Ge({"src/lib/polygon.js"(Z,q){"use strict";var d=qy().dot,x=As().BADNUM,S=q.exports={};S.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||A===x||Ai||_&&h(l))}function p(l,_){var w=l[0],A=l[1];if(w===x||wo||A===x||Ai)return!1;var M=t.length,g=t[0][0],b=t[0][1],v=0,u,y,m,R,L;for(u=1;uMath.max(y,g)||A>Math.max(m,b)))if(An||Math.abs(d(p,h))>o)return!0;return!1},S.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var h=r.length,f=o;r.splice(a+1);for(var p=f+1;p1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),TS=Ge({"src/components/selections/constants.js"(Z,q){"use strict";q.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),AS=Ge({"src/components/selections/select.js"(Z,q){"use strict";var d=bS(),x=wS(),S=Yi(),E=zo().dashStyle,e=Bi(),t=mc(),r=Sh().makeEventData,o=fv(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,h=o.selectMode,f=zd(),p=Xm(),c=t1(),T=Ld().clearOutline,l=Dd(),_=l.handleEllipse,w=l.readPaths,A=e1().newShapes,M=Tb(),g=Lb().activateLastSelection,b=ta(),v=b.sorterAsc,u=Ym(),y=Xy(),m=dc().getFromId,R=Wm(),L=Zm().redrawReglTraces,z=TS(),F=z.MINSELECT,N=u.filter,O=u.tester,P=Qy(),U=P.p2r,B=P.axValue,X=P.getTransform;function $(ze){return ze.subplot!==void 0}function le(ze,Ze,we,ke,Be){var He=!$(ke),nt=a(Be),ot=i(Be),Ft=s(Be),Mt=n(Be),Et=h(Be),Ot=Be==="drawline",sr=Be==="drawcircle",ir=Ot||sr,ar=ke.gd,Mr=ar._fullLayout,ma=Et&&Mr.newselection.mode==="immediate"&&He,Ca=Mr._zoomlayer,Aa=ke.element.getBoundingClientRect(),Da=ke.plotinfo,Ba=X(Da),ba=Ze-Aa.left,rn=we-Aa.top;Mr._calcInverseTransform(ar);var vn=b.apply3DTransform(Mr._invTransform)(ba,rn);ba=vn[0],rn=vn[1];var Wt=Mr._invScaleX,Lt=Mr._invScaleY,Ht=ba,Xt=rn,Pr="M"+ba+","+rn,Yr=ke.xaxes[0],Kr=ke.yaxes[0],na=Yr._length,La=Kr._length,Ga=ze.altKey&&!(n(Be)&&Ft),Ua,Xa,an,Sa,Zn,Wn,ti;V(ze,ar,ke),nt&&(Ua=N([[ba,rn]],z.BENDPX));var gt=Ca.selectAll("path.select-outline-"+Da.id).data([1]),it=Mt?Mr.newshape:Mr.newselection;Mt&&(ke.hasText=it.label.text||it.label.texttemplate);var Rr=Mt&&!Ft?it.fillcolor:"rgba(0,0,0,0)",Ar=it.line.color||(He?e.contrast(ar._fullLayout.plot_bgcolor):"#7f7f7f");gt.enter().append("path").attr("class","select-outline select-outline-"+Da.id).style({opacity:Mt?it.opacity/2:1,"stroke-dasharray":E(it.line.dash,it.line.width),"stroke-width":it.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,Ar).call(e.fill,Rr).attr("fill-rule","evenodd").classed("cursor-move",!!Mt).attr("transform",Ba).attr("d",Pr+"Z");var pr=Ca.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",Ba).attr("d","M0,0Z");if(Mt&&ke.hasText){var kr=Ca.select(".label-temp");kr.empty()&&(kr=Ca.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var zr=Mr._uid+z.SELECTID,Ur=[],dt=re(ar,ke.xaxes,ke.yaxes,ke.subplot);ma&&!ze.shiftKey&&(ke._clearSubplotSelections=function(){if(He){var fr=Yr._id,Ir=Kr._id;Qe(ar,fr,Ir,dt);for(var da=(ar.layout||{}).selections||[],Ta=[],ua=!1,ra=0;ra=0){ar._fullLayout._deactivateShape(ar);return}if(!Mt){var da=Mr.clickmode;y.done(zr).then(function(){if(y.clear(zr),fr===2){for(gt.remove(),Zn=0;Zn-1&&ce(Ir,ar,ke.xaxes,ke.yaxes,ke.subplot,ke,gt),da==="event"&&Er(ar,void 0);t.click(ar,Ir,Da.id)}).catch(b.error)}},ke.doneFn=function(){pr.remove(),y.done(zr).then(function(){y.clear(zr),!ma&&Sa&&ke.selectionDefs&&(Sa.subtract=Ga,ke.selectionDefs.push(Sa),ke.mergedPolygons.length=0,[].push.apply(ke.mergedPolygons,an)),(ma||Mt)&&j(ke,ma),ke.doneFnCompleted&&ke.doneFnCompleted(Ur),Et&&Er(ar,ti)}).catch(b.error)}}function ce(ze,Ze,we,ke,Be,He,nt){var ot=Ze._hoverdata,Ft=Ze._fullLayout,Mt=Ft.clickmode,Et=Mt.indexOf("event")>-1,Ot=[],sr,ir,ar,Mr,ma,Ca,Aa,Da,Ba,ba;if(xe(ot)){V(ze,Ze,He),sr=re(Ze,we,ke,Be);var rn=Te(ot,sr),vn=rn.pointNumbers.length>0;if(vn?Pe(sr,rn):qe(sr)&&(Aa=Le(rn))){for(nt&&nt.remove(),ba=0;ba=0}function ae(ze){return ze._fullLayout._activeSelectionIndex>=0}function j(ze,Ze){var we=ze.dragmode,ke=ze.plotinfo,Be=ze.gd;se(Be)&&Be._fullLayout._deactivateShape(Be),ae(Be)&&Be._fullLayout._deactivateSelection(Be);var He=Be._fullLayout,nt=He._zoomlayer,ot=n(we),Ft=h(we);if(ot||Ft){var Mt=nt.selectAll(".select-outline-"+ke.id);if(Mt&&Be._fullLayout._outlining){var Et;ot&&(Et=A(Mt,ze)),Et&&S.call("_guiRelayout",Be,{shapes:Et});var Ot;Ft&&!$(ze)&&(Ot=M(Mt,ze)),Ot&&(Be._fullLayout._noEmitSelectedAtStart=!0,S.call("_guiRelayout",Be,{selections:Ot}).then(function(){Ze&&g(Be)})),Be._fullLayout._outlining=!1}}ke.selection={},ke.selection.selectionDefs=ze.selectionDefs=[],ke.selection.mergedPolygons=ze.mergedPolygons=[]}function Q(ze){return ze._id}function re(ze,Ze,we,ke){if(!ze.calcdata)return[];var Be=[],He=Ze.map(Q),nt=we.map(Q),ot,Ft,Mt;for(Mt=0;Mt0,He=Be?ke[0]:we;return Ze.selectedpoints?Ze.selectedpoints.indexOf(He)>-1:!1}function Pe(ze,Ze){var we=[],ke,Be,He,nt;for(nt=0;nt0&&we.push(ke);if(we.length===1&&(He=we[0]===Ze.searchInfo,He&&(Be=Ze.searchInfo.cd[0].trace,Be.selectedpoints.length===Ze.pointNumbers.length))){for(nt=0;nt1||(Ze+=ke.selectedpoints.length,Ze>1)))return!1;return Ze===1}function et(ze,Ze,we){var ke;for(ke=0;ke-1&&Ze;if(!nt&&Ze){var fr=Tt(ze,!0);if(fr.length){var Ir=fr[0].xref,da=fr[0].yref;if(Ir&&da){var Ta=Ut(fr),ua=hr([m(ze,Ir,"x"),m(ze,da,"y")]);ua(Ur,Ta)}}ze._fullLayout._noEmitSelectedAtStart?ze._fullLayout._noEmitSelectedAtStart=!1:qt&&Er(ze,Ur),sr._reselect=!1}if(!nt&&sr._deselect){var ra=sr._deselect;ot=ra.xref,Ft=ra.yref,We(ot,Ft,Et)||Qe(ze,ot,Ft,ke),qt&&(Ur.points.length?Er(ze,Ur):mt(ze)),sr._deselect=!1}return{eventData:Ur,selectionTesters:we}}function Ee(ze){var Ze=ze.calcdata;if(Ze)for(var we=0;we=0){Rr._fullLayout._deactivateShape(Rr);return}var Ar=Rr._fullLayout.clickmode;if(Y(Rr),gt===2&&!fe&&Xa(),Ue)Ar.indexOf("select")>-1&&v(it,Rr,Qe,Xe,xe.id,Et),Ar.indexOf("event")>-1&&n.click(Rr,it,xe.id);else if(gt===1&&fe){var pr=et?ie:ue,kr=et==="s"||rt==="w"?0:1,zr=pr._name+".range["+kr+"]",Ur=P(pr,kr),dt="left",qt="middle";if(pr.fixedrange)return;et?(qt=et==="n"?"top":"bottom",pr.side==="right"&&(dt="right")):rt==="e"&&(dt="right"),Rr._context.showAxisRangeEntryBoxes&&d.select(Mt).call(o.makeEditable,{gd:Rr,immediate:!0,background:Rr._fullLayout.paper_bgcolor,text:String(Ur),fill:pr.tickfont?pr.tickfont.color:"#444",horizontalAlign:dt,verticalAlign:qt}).on("edit",function(fr){var Ir=pr.d2r(fr);Ir!==void 0&&t.call("_guiRelayout",Rr,zr,Ir)})}}f.init(Et);var ir,ar,Mr,ma,Ca,Aa,Da,Ba,ba,rn;function vn(gt,it,Rr){var Ar=Mt.getBoundingClientRect();ir=it-Ar.left,ar=Rr-Ar.top,he._fullLayout._calcInverseTransform(he);var pr=x.apply3DTransform(he._fullLayout._invTransform)(ir,ar);ir=pr[0],ar=pr[1],Mr={l:ir,r:ir,w:0,t:ar,b:ar,h:0},ma=he._hmpixcount?he._hmlumcount/he._hmpixcount:E(he._fullLayout.plot_bgcolor).getLuminance(),Ca="M0,0H"+zt+"V"+Ut+"H0V0",Aa=!1,Da="xy",rn=!1,Ba=le($e,ma,Tt,St,Ca),ba=ce($e,Tt,St)}function Wt(gt,it){if(he._transitioningWithDuration)return!1;var Rr=Math.max(0,Math.min(zt,He*gt+ir)),Ar=Math.max(0,Math.min(Ut,nt*it+ar)),pr=Math.abs(Rr-ir),kr=Math.abs(Ar-ar);Mr.l=Math.min(ir,Rr),Mr.r=Math.max(ir,Rr),Mr.t=Math.min(ar,Ar),Mr.b=Math.max(ar,Ar);function zr(){Da="",Mr.r=Mr.l,Mr.t=Mr.b,ba.attr("d","M0,0Z")}if(br.isSubplotConstrained)pr>R||kr>R?(Da="xy",pr/zt>kr/Ut?(kr=pr*Ut/zt,ar>Ar?Mr.t=ar-kr:Mr.b=ar+kr):(pr=kr*zt/Ut,ir>Rr?Mr.l=ir-pr:Mr.r=ir+pr),ba.attr("d",ae(Mr))):zr();else if(hr.isSubplotConstrained)if(pr>R||kr>R){Da="xy";var Ur=Math.min(Mr.l/zt,(Ut-Mr.b)/Ut),dt=Math.max(Mr.r/zt,(Ut-Mr.t)/Ut);Mr.l=Ur*zt,Mr.r=dt*zt,Mr.b=(1-Ur)*Ut,Mr.t=(1-dt)*Ut,ba.attr("d",ae(Mr))}else zr();else!wr||kr0){var fr;if(hr.isSubplotConstrained||!Or&&wr.length===1){for(fr=0;fr1&&(zr.maxallowed!==void 0&&mt===(zr.range[0]1&&(Ur.maxallowed!==void 0&&ze===(Ur.range[0]=0?Math.min(he,.9):1/(1/Math.max(he,-.3)+3.222))}function $(he,xe,Te){return he?he==="nsew"?Te?"":xe==="pan"?"move":"crosshair":he.toLowerCase()+"-resize":"pointer"}function le(he,xe,Te,Le,Pe){return he.append("path").attr("class","zoombox").style({fill:xe>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Te,Le)).attr("d",Pe+"Z")}function ce(he,xe,Te){return he.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(xe,Te)).attr("d","M0,0Z")}function ve(he,xe,Te,Le,Pe,qe){he.attr("d",Le+"M"+Te.l+","+Te.t+"v"+Te.h+"h"+Te.w+"v-"+Te.h+"h-"+Te.w+"Z"),G(he,xe,Pe,qe)}function G(he,xe,Te,Le){Te||(he.transition().style("fill",Le>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),xe.transition().style("opacity",1).duration(200))}function Y(he){d.select(he).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ee(he){L&&he.data&&he._context.showTips&&(x.notifier(x._(he,"Double-click to zoom back out"),"long",he),L=!1)}function V(he,xe){return"M"+(he.l-.5)+","+(xe-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(he.r+.5)+","+(xe-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function se(he,xe){return"M"+(xe-R-.5)+","+(he.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(xe-R-.5)+","+(he.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function ae(he){var xe=Math.floor(Math.min(he.b-he.t,he.r-he.l,R)/2);return"M"+(he.l-3.5)+","+(he.t-.5+xe)+"h3v"+-xe+"h"+xe+"v-3h-"+(xe+3)+"ZM"+(he.r+3.5)+","+(he.t-.5+xe)+"h-3v"+-xe+"h"+-xe+"v-3h"+(xe+3)+"ZM"+(he.r+3.5)+","+(he.b+.5-xe)+"h-3v"+xe+"h"+-xe+"v3h"+(xe+3)+"ZM"+(he.l-3.5)+","+(he.b+.5-xe)+"h3v"+xe+"h"+xe+"v3h-"+(xe+3)+"Z"}function j(he,xe,Te,Le,Pe){for(var qe=!1,et={},rt={},$e,Ue,fe,ue,ie=(Pe||{}).xaHash,Ee=(Pe||{}).yaHash,We=0;We1&&x.warn("Full array edits are incompatible with other edits",h);var w=i[""][""];if(t(w))a.set(null);else if(Array.isArray(w))a.set(w);else return x.warn("Unrecognized full array edit value",h,w),!0;return T?!1:(f(l,_),p(o),!0)}var A=Object.keys(i).map(Number).sort(S),M=a.get(),g=M||[],b=s(_,h).get(),v=[],u=-1,y=g.length,m,R,L,z,F,N,O,P;for(m=0;mg.length-(O?0:1)){x.warn("index out of range",h,L);continue}if(N!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",h,L),t(N)?v.push(L):O?(N==="add"&&(N={}),g.splice(L,0,N),b&&b.splice(L,0,{})):x.warn("Unrecognized full object edit value",h,L,N),u===-1&&(u=L);else for(R=0;R=0;m--)g.splice(v[m],1),b&&b.splice(v[m],1);if(g.length?M||a.set(g):a.set(null),T)return!1;if(f(l,_),c!==d){var U;if(u===-1)U=A;else{for(y=Math.max(g.length,y),U=[],m=0;m=u));m++)U.push(L);for(m=u;m0&&x.log("Clearing previous rejected promises from queue."),l._promises=[]},Z.cleanLayout=function(l){var _,w;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var A=(S.subplotsRegistry.cartesian||{}).attrRegex,M=(S.subplotsRegistry.polar||{}).attrRegex,g=(S.subplotsRegistry.ternary||{}).attrRegex,b=(S.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(l);for(_=0;_3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),e.clean(l),l.template&&l.template.layout&&Z.cleanLayout(l.template.layout),l};function i(l,_,w=!1){var A=l[_],M=_.charAt(0);w&&Array.isArray(A)||A&&A!=="paper"&&(l[_]=t(A,M,!0))}Z.cleanData=function(l){for(var _=0;_0)return l.slice(0,_)}Z.hasParent=function(l,_){for(var w=c(_);w;){if(w in l)return!0;w=c(w)}return!1},Z.clearAxisTypes=function(l,_,w){for(var A=0;A<_.length;A++)for(var M=l._fullData[A],g=0;g<3;g++){var b=r(l,M,a[g]);if(b&&b.type!=="log"){var v=b._name,u=b._id.slice(1);if(u.slice(0,5)==="scene"){if(w[u]!==void 0)continue;v=u+"."+v}var y=v+".type";w[v]===void 0&&w[y]===void 0&&x.nestedProperty(l.layout,y).set(null)}}};var T=(l,_)=>{let w=(...A)=>A.every(M=>x.isPlainObject(M))||A.every(M=>Array.isArray(M));if([l,_].every(A=>Array.isArray(A))){if(l.length!==_.length)return!1;for(let A=0;Ax.isPlainObject(A))){if(Object.keys(l).length!==Object.keys(_).length)return!1;for(let A in l){if(A.startsWith("_"))continue;let M=l[A],g=_[A];if(M!==g&&!(w(M,g)?T(M,g):!1))return!1}return!0}return!1};Z.collectionsAreEqual=T}}),a1=Ge({"src/plot_api/plot_api.js"(Z){"use strict";var q=Oi(),d=Bo(),x=ob(),S=ta(),E=S.nestedProperty,e=I0(),t=ZA(),r=Yi(),o=R0(),a=Uu(),i=Mo(),n=db(),s=Nf(),h=zo(),f=Bi(),p=Db().initInteractions,c=Bh(),T=Pc().clearOutline,l=Ap().dfltConfig,_=kS(),w=CS(),A=Zm(),M=Ru(),g=lf().AX_NAME_PATTERN,b=0,v=5;function u(we,ke,Be,He){var nt;if(we=S.getGraphDiv(we),e.init(we),S.isPlainObject(ke)){var ot=ke;ke=ot.data,Be=ot.layout,He=ot.config,nt=ot.frames}var Ft=e.triggerHandler(we,"plotly_beforeplot",[ke,Be,He]);if(Ft===!1)return Promise.reject();!ke&&!Be&&!S.isPlotDiv(we)&&S.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",we);function Mt(){if(nt)return Z.addFrames(we,nt)}z(we,He),Be||(Be={}),q.select(we).classed("js-plotly-plot",!0),h.makeTester(),Array.isArray(we._promises)||(we._promises=[]);var Et=(we.data||[]).length===0&&Array.isArray(ke);Array.isArray(ke)&&(w.cleanData(ke),Et?we.data=ke:we.data.push.apply(we.data,ke),we.empty=!1),(!we.layout||Et)&&(we.layout=w.cleanLayout(Be)),a.supplyDefaults(we);var Ot=we._fullLayout,sr=Ot._has("cartesian");Ot._replotting=!0,(Et||Ot._shouldCreateBgLayer)&&(Ze(we),Ot._shouldCreateBgLayer&&delete Ot._shouldCreateBgLayer),h.initGradients(we),h.initPatterns(we),Et&&i.saveShowSpikeInitial(we);var ir=!we.calcdata||we.calcdata.length!==(we._fullData||[]).length;ir&&a.doCalcdata(we);for(var ar=0;ar=we.data.length||nt<-we.data.length)throw new Error(Be+" must be valid indices for gd.data.");if(ke.indexOf(nt,He+1)>-1||nt>=0&&ke.indexOf(-we.data.length+nt)>-1||nt<0&&ke.indexOf(we.data.length+nt)>-1)throw new Error("each index in "+Be+" must be unique.")}}function U(we,ke,Be){if(!Array.isArray(we.data))throw new Error("gd.data must be an array.");if(typeof ke>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ke)||(ke=[ke]),P(we,ke,"currentIndices"),typeof Be<"u"&&!Array.isArray(Be)&&(Be=[Be]),typeof Be<"u"&&P(we,Be,"newIndices"),typeof Be<"u"&&ke.length!==Be.length)throw new Error("current and new indices must be of equal length.")}function B(we,ke,Be){var He,nt;if(!Array.isArray(we.data))throw new Error("gd.data must be an array.");if(typeof ke>"u")throw new Error("traces must be defined.");for(Array.isArray(ke)||(ke=[ke]),He=0;He"u")throw new Error("indices must be an integer or array of integers");P(we,Be,"indices");for(var ot in ke){if(!Array.isArray(ke[ot])||ke[ot].length!==Be.length)throw new Error("attribute "+ot+" must be an array of length equal to indices array length");if(nt&&(!(ot in He)||!Array.isArray(He[ot])||He[ot].length!==ke[ot].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function $(we,ke,Be,He){var nt=S.isPlainObject(He),ot=[],Ft,Mt,Et,Ot,sr;Array.isArray(Be)||(Be=[Be]),Be=O(Be,we.data.length-1);for(var ir in ke)for(var ar=0;ar=0&&sr=0&&sr"u")return Ot=Z.redraw(we),t.add(we,nt,Ft,ot,Mt),Ot;Array.isArray(Be)||(Be=[Be]);try{U(we,He,Be)}catch(sr){throw we.data.splice(we.data.length-ke.length,ke.length),sr}return t.startSequence(we),t.add(we,nt,Ft,ot,Mt),Ot=Z.moveTraces(we,He,Be),t.stopSequence(we),Ot}function ee(we,ke){we=S.getGraphDiv(we);var Be=[],He=Z.addTraces,nt=ee,ot=[we,Be,ke],Ft=[we,ke],Mt,Et;if(typeof ke>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ke)||(ke=[ke]),P(we,ke,"indices"),ke=O(ke,we.data.length-1),ke.sort(S.sorterDes),Mt=0;Mt"u")for(Be=[],Ot=0;Ot0&&typeof Ht.parts[Yr]!="string";)Yr--;var Kr=Ht.parts[Yr],na=Ht.parts[Yr-1]+"."+Kr,La=Ht.parts.slice(0,Yr).join("."),Ga=E(we.layout,La).get(),Ua=E(He,La).get(),Xa=Ht.get();if(Xt!==void 0){Da[Lt]=Xt,Ba[Lt]=Kr==="reverse"?Xt:ae(Xa);var an=o.getLayoutValObject(He,Ht.parts);if(an&&an.impliedEdits&&Xt!==null)for(var Sa in an.impliedEdits)ba(S.relativeAttr(Lt,Sa),an.impliedEdits[Sa]);if(["width","height"].indexOf(Lt)!==-1)if(Xt){ba("autosize",null);var Zn=Lt==="height"?"width":"height";ba(Zn,He[Zn])}else He[Lt]=we._initialAutoSize[Lt];else if(Lt==="autosize")ba("width",Xt?null:He.width),ba("height",Xt?null:He.height);else if(na.match(Pe))Wt(na),E(He,La+"._inputRange").set(null);else if(na.match(qe)){Wt(na),E(He,La+"._inputRange").set(null);var Wn=E(He,La).get();Wn._inputDomain&&(Wn._input.domain=Wn._inputDomain.slice())}else na.match(et)&&E(He,La+"._inputDomain").set(null);if(Kr==="type"){vn=Ga;var ti=Ua.type==="linear"&&Xt==="log",gt=Ua.type==="log"&&Xt==="linear";if(ti||gt){if(!vn||!vn.range)ba(La+".autorange",!0);else if(Ua.autorange)ti&&(vn.range=vn.range[1]>vn.range[0]?[1,2]:[2,1]);else{var it=vn.range[0],Rr=vn.range[1];ti?(it<=0&&Rr<=0&&ba(La+".autorange",!0),it<=0?it=Rr/1e6:Rr<=0&&(Rr=it/1e6),ba(La+".range[0]",Math.log(it)/Math.LN10),ba(La+".range[1]",Math.log(Rr)/Math.LN10)):(ba(La+".range[0]",Math.pow(10,it)),ba(La+".range[1]",Math.pow(10,Rr)))}Array.isArray(He._subplots.polar)&&He._subplots.polar.length&&He[Ht.parts[0]]&&Ht.parts[1]==="radialaxis"&&delete He[Ht.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(we,Ua,Xt,ba),r.getComponentMethod("images","convertCoords")(we,Ua,Xt,ba)}else ba(La+".autorange",!0),ba(La+".range",null);E(He,La+"._inputRange").set(null)}else if(Kr.match(g)){var Ar=E(He,Lt).get(),pr=(Xt||{}).type;(!pr||pr==="-")&&(pr="linear"),r.getComponentMethod("annotations","convertCoords")(we,Ar,pr,ba),r.getComponentMethod("images","convertCoords")(we,Ar,pr,ba)}var kr=_.containerArrayMatch(Lt);if(kr){sr=kr.array,ir=kr.index;var zr=kr.property,Ur=an||{editType:"calc"};ir!==""&&zr===""&&(_.isAddVal(Xt)?Ba[Lt]=null:_.isRemoveVal(Xt)?Ba[Lt]=(E(Be,sr).get()||[])[ir]:S.warn("unrecognized full object value",ke)),M.update(Aa,Ur),Ot[sr]||(Ot[sr]={});var dt=Ot[sr][ir];dt||(dt=Ot[sr][ir]={}),dt[zr]=Xt,delete ke[Lt]}else Kr==="reverse"?(Ga.range?Ga.range.reverse():(ba(La+".autorange",!0),Ga.range=[1,0]),Ua.autorange?Aa.calc=!0:Aa.plot=!0):(Lt==="dragmode"&&(Xt===!1&&Xa!==!1||Xt!==!1&&Xa===!1)||He._has("scatter-like")&&He._has("regl")&&Lt==="dragmode"&&(Xt==="lasso"||Xt==="select")&&!(Xa==="lasso"||Xa==="select")?Aa.plot=!0:an?M.update(Aa,an):Aa.calc=!0,Ht.set(Xt))}}for(sr in Ot){var qt=_.applyContainerArrayChanges(we,ot(Be,sr),Ot[sr],Aa,ot);qt||(Aa.plot=!0)}for(var fr in rn){vn=i.getFromId(we,fr);var Ir=vn&&vn._constraintGroup;if(Ir){Aa.calc=!0;for(var da in Ir)rn[da]||(i.getFromId(we,da)._constraintShrinkable=!0)}}($e(we)||ke.height||ke.width)&&(Aa.plot=!0);var Ta=He.shapes;for(ir=0;ir1;)if(He.pop(),Be=E(ke,He.join(".")+".uirevision").get(),Be!==void 0)return Be;return ke.uirevision}function Qe(we,ke){for(var Be=0;Be[La,we._ev.listeners(La)]);ot=Z.newPlot(we,ke,Be,He).then(()=>{for(let[La,Ga]of na)Ga.forEach(Ua=>we.on(La,Ua));return Z.react(we,ke,Be,He)})}else{we.data=ke||[],w.cleanData(we.data),we.layout=Be||{},w.cleanLayout(we.layout),St(we.data,we.layout,Mt,Et),a.supplyDefaults(we,{skipUpdateCalc:!0});var ir=we._fullData,ar=we._fullLayout,Mr=ar.datarevision===void 0,ma=ar.transition,Ca=br(we,Et,ar,Mr,ma),Aa=Ca.newDataRevision,Da=Ut(we,Mt,ir,Mr,ma,Aa);if($e(we)&&(Ca.layoutReplot=!0),Da.calc||Ca.calc){we.calcdata=void 0;for(var Ba=Object.getOwnPropertyNames(ar),ba=0;ba(sr||we.emit("plotly_react",{config:He,data:ke,layout:Be}),we))}function Ut(we,ke,Be,He,nt,ot){var Ft=ke.length===Be.length;if(!nt&&!Ft)return{fullReplot:!0,calc:!0};var Mt=M.traceFlags();Mt.arrays={},Mt.nChanges=0,Mt.nChangesAnim=0;var Et,Ot;function sr(Mr){var ma=o.getTraceValObject(Ot,Mr);return!Ot._module.animatable&&ma.anim&&(ma.anim=!1),ma}var ir={getValObject:sr,flags:Mt,immutable:He,transition:nt,newDataRevision:ot,gd:we},ar={};for(Et=0;Et=nt.length?nt[0]:nt[Ot]:nt}function Mt(Ot){return Array.isArray(ot)?Ot>=ot.length?ot[0]:ot[Ot]:ot}function Et(Ot,sr){var ir=0;return function(){if(Ot&&++ir===sr)return Ot()}}return new Promise(function(Ot,sr){function ir(){if(He._frameQueue.length!==0){for(;He._frameQueue.length;){var Kr=He._frameQueue.pop();Kr.onInterrupt&&Kr.onInterrupt()}we.emit("plotly_animationinterrupted",[])}}function ar(Kr){if(Kr.length!==0){for(var na=0;naHe._timeToNext&&ma()};Kr()}var Aa=0;function Da(Kr){return Array.isArray(nt)?Aa>=nt.length?Kr.transitionOpts=nt[Aa]:Kr.transitionOpts=nt[0]:Kr.transitionOpts=nt,Aa++,Kr}var Ba,ba,rn=[],vn=ke==null,Wt=Array.isArray(ke),Lt=!vn&&!Wt&&S.isPlainObject(ke);if(Lt)rn.push({type:"object",data:Da(S.extendFlat({},ke))});else if(vn||["string","number"].indexOf(typeof ke)!==-1)for(Ba=0;Ba0&&PrPr)&&Yr.push(ba);rn=Yr}}rn.length>0?ar(rn):(we.emit("plotly_animated"),Ot())})}function wr(we,ke,Be){if(we=S.getGraphDiv(we),ke==null)return Promise.resolve();if(!S.isPlotDiv(we))throw new Error("This element is not a Plotly plot: "+we+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var He,nt,ot,Ft,Mt=we._transitionData._frames,Et=we._transitionData._frameHash;if(!Array.isArray(ke))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ke);var Ot=Mt.length+ke.length*2,sr=[],ir={};for(He=ke.length-1;He>=0;He--)if(S.isPlainObject(ke[He])){var ar=ke[He].name,Mr=(Et[ar]||ir[ar]||{}).name,ma=ke[He].name,Ca=Et[Mr]||ir[Mr];Mr&&ma&&typeof ma=="number"&&Ca&&bHt.index?-1:Lt.index=0;He--){if(nt=sr[He].frame,typeof nt.name=="number"&&S.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!nt.name)for(;Et[nt.name="frame "+we._transitionData._counter++];);if(Et[nt.name]){for(ot=0;ot=0;Be--)He=ke[Be],ot.push({type:"delete",index:He}),Ft.unshift({type:"insert",index:He,value:nt[He]});var Mt=a.modifyFrames,Et=a.modifyFrames,Ot=[we,Ft],sr=[we,ot];return t&&t.add(we,Mt,Ot,Et,sr),a.modifyFrames(we,ot)}function mt(we){we=S.getGraphDiv(we);var ke=we._fullLayout||{},Be=we._fullData||[];return a.cleanPlot([],{},Be,ke),a.purge(we),e.purge(we),ke._container&&ke._container.remove(),delete we._context,we}function ze(we){var ke=we._fullLayout,Be=we.getBoundingClientRect();if(!S.equalDomRects(Be,ke._lastBBox)){var He=ke._invTransform=S.inverseTransformMatrix(S.getFullTransformMatrix(we));ke._invScaleX=Math.sqrt(He[0][0]*He[0][0]+He[0][1]*He[0][1]+He[0][2]*He[0][2]),ke._invScaleY=Math.sqrt(He[1][0]*He[1][0]+He[1][1]*He[1][1]+He[1][2]*He[1][2]),ke._lastBBox=Be}}function Ze(we){var ke=q.select(we),Be=we._fullLayout;if(Be._calcInverseTransform=ze,Be._calcInverseTransform(we),Be._container=ke.selectAll(".plot-container").data([0]),Be._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Be._paperdiv=Be._container.selectAll(".svg-container").data([0]),Be._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Be._glcontainer=Be._paperdiv.selectAll(".gl-container").data([{}]),Be._glcontainer.enter().append("div").classed("gl-container",!0),Be._paperdiv.selectAll(".main-svg").remove(),Be._paperdiv.select(".modebar-container").remove(),Be._paper=Be._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Be._toppaper=Be._paperdiv.append("svg").classed("main-svg",!0),Be._modebardiv=Be._paperdiv.append("div"),delete Be._modeBar,Be._hoverpaper=Be._paperdiv.append("svg").classed("main-svg",!0),!Be._uid){var He={};q.selectAll("defs").each(function(){this.id&&(He[this.id.split("-")[1]]=1)}),Be._uid=S.randstr(He)}Be._paperdiv.selectAll(".main-svg").attr(c.svgAttrs),Be._defs=Be._paper.append("defs").attr("id","defs-"+Be._uid),Be._clips=Be._defs.append("g").classed("clips",!0),Be._topdefs=Be._toppaper.append("defs").attr("id","topdefs-"+Be._uid),Be._topclips=Be._topdefs.append("g").classed("clips",!0),Be._bgLayer=Be._paper.append("g").classed("bglayer",!0),Be._draggers=Be._paper.append("g").classed("draglayer",!0);var nt=Be._paper.append("g").classed("layer-below",!0);Be._imageLowerLayer=nt.append("g").classed("imagelayer",!0),Be._shapeLowerLayer=nt.append("g").classed("shapelayer",!0),Be._cartesianlayer=Be._paper.append("g").classed("cartesianlayer",!0),Be._polarlayer=Be._paper.append("g").classed("polarlayer",!0),Be._smithlayer=Be._paper.append("g").classed("smithlayer",!0),Be._ternarylayer=Be._paper.append("g").classed("ternarylayer",!0),Be._geolayer=Be._paper.append("g").classed("geolayer",!0),Be._funnelarealayer=Be._paper.append("g").classed("funnelarealayer",!0),Be._pielayer=Be._paper.append("g").classed("pielayer",!0),Be._iciclelayer=Be._paper.append("g").classed("iciclelayer",!0),Be._treemaplayer=Be._paper.append("g").classed("treemaplayer",!0),Be._sunburstlayer=Be._paper.append("g").classed("sunburstlayer",!0),Be._indicatorlayer=Be._toppaper.append("g").classed("indicatorlayer",!0),Be._glimages=Be._paper.append("g").classed("glimages",!0);var ot=Be._toppaper.append("g").classed("layer-above",!0);Be._imageUpperLayer=ot.append("g").classed("imagelayer",!0),Be._shapeUpperLayer=ot.append("g").classed("shapelayer",!0),Be._selectionLayer=Be._toppaper.append("g").classed("selectionlayer",!0),Be._infolayer=Be._toppaper.append("g").classed("infolayer",!0),Be._menulayer=Be._toppaper.append("g").classed("menulayer",!0),Be._zoomlayer=Be._toppaper.append("g").classed("zoomlayer",!0),Be._hoverlayer=Be._hoverpaper.append("g").classed("hoverlayer",!0),Be._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),we.emit("plotly_framework")}Z.animate=Or,Z.addFrames=wr,Z.deleteFrames=Er,Z.addTraces=Y,Z.deleteTraces=ee,Z.extendTraces=ve,Z.moveTraces=V,Z.prependTraces=G,Z.newPlot=N,Z._doPlot=u,Z.purge=mt,Z.react=zt,Z.redraw=F,Z.relayout=xe,Z.restyle=se,Z.setPlotConfig=m,Z.update=Ue,Z._guiRelayout=fe(xe),Z._guiRestyle=fe(se),Z._guiUpdate=fe(Ue),Z._storeDirectGUIEdit=re}}),Qv=Ge({"src/snapshot/helpers.js"(Z){"use strict";var q=Yi();Z.getDelay=function(S){return S._has&&(S._has("gl3d")||S._has("mapbox")||S._has("map"))?500:0},Z.getRedrawFunc=function(S){return function(){q.getComponentMethod("colorbar","draw")(S)}},Z.encodeSVG=function(S){return"data:image/svg+xml,"+encodeURIComponent(S)},Z.encodeJSON=function(S){return"data:application/json,"+encodeURIComponent(S)};var d=window.URL||window.webkitURL;Z.createObjectURL=function(S){return d.createObjectURL(S)},Z.revokeObjectURL=function(S){return d.revokeObjectURL(S)},Z.createBlob=function(S,E){if(E==="svg")return new window.Blob([S],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([S],{type:"application/json;charset=utf-8"});var e=x(window.atob(S));return new window.Blob([e],{type:"image/"+E})},Z.octetStream=function(S){document.location.href="data:application/octet-stream"+S};function x(S){for(var E=S.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":s.html(f).text()});return s.remove(),h}function i(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}q.exports=function(s,h,f){var p=s._fullLayout,c=p._paper,T=p._toppaper,l=p.width,_=p.height,w;c.insert("rect",":first-child").call(S.setRect,0,0,l,_).call(E.fill,p.paper_bgcolor);var A=p._basePlotModules||[];for(w=0;w1&&M.push(s("object","layout"))),x.supplyDefaults(g);for(var u=g._fullData,y=b.length,m=0;mR.length&&A.push(s("unused",M,y.concat(R.length)));var P=R.length,U=Array.isArray(O);U&&(P=Math.min(P,O.length));var B,X,$,le,ce;if(L.dimensions===2)for(X=0;XR[X].length&&A.push(s("unused",M,y.concat(X,R[X].length)));var ve=R[X].length;for(B=0;B<(U?Math.min(ve,O[X].length):ve);B++)$=U?O[X][B]:O,le=m[X][B],ce=R[X][B],d.validate(le,$)?ce!==le&&ce!==+le&&A.push(s("dynamic",M,y.concat(X,B),le,ce)):A.push(s("value",M,y.concat(X,B),le))}else A.push(s("array",M,y.concat(X),m[X]));else for(X=0;XF?A.push({code:"unused",traceType:m,templateCount:z,dataCount:F}):F>z&&A.push({code:"reused",traceType:m,templateCount:z,dataCount:F})}}function N(O,P){for(var U in O)if(U.charAt(0)!=="_"){var B=O[U],X=s(O,U,P);d(B)?(Array.isArray(O)&&B._template===!1&&B.templateitemname&&A.push({code:"missing",path:X,templateitemname:B.templateitemname}),N(B,X)):Array.isArray(B)&&h(B)&&N(B,X)}}if(N({data:g,layout:M},""),A.length)return A.map(f)};function h(p){for(var c=0;c=0;f--){var p=e[f];if(p.type==="scatter"&&p.xaxis===s.xaxis&&p.yaxis===s.yaxis){p.opacity=void 0;break}}}}}}}),FS=Ge({"src/traces/scatter/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Zy();q.exports=function(S,E){function e(r,o){return d.coerce(S,E,x,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),pv=Ge({"src/plots/cartesian/align_period.js"(Z,q){"use strict";var d=Bo(),x=ta(),S=x.dateTime2ms,E=x.incrementMonth,e=As(),t=e.ONEAVGMONTH;q.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var h=o[i+"period"],f;if(d(h)){if(h=+h,h<=0)return{vals:n}}else if(typeof h=="string"&&h.charAt(0)==="M"){var p=+h.substring(1);if(p>0&&Math.round(p)===p)f=p;else return{vals:n}}for(var c=a.calendar,T=s==="start",l=s==="end",_=o[i+"period0"],w=S(_,c)||0,A=[],M=[],g=[],b=n.length,v=0;vu;)R=E(R,-f,c);for(;R<=u;)R=E(R,f,c);m=E(R,-f,c)}else{for(y=Math.round((u-w)/h),R=w+y*h;R>u;)R-=h;for(;R<=u;)R+=h;m=R-h}A[v]=T?m:l?R:(m+R)/2,M[v]=m,g[v]=R}return{vals:A,starts:M,ends:g}}}}),Yh=Ge({"src/traces/scatter/colorscale_calc.js"(Z,q){"use strict";var d=ih().hasColorscale,x=oh(),S=iu();q.exports=function(e,t){S.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),S.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Dv=Ge({"src/traces/scatter/arrays_to_calcdata.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){for(var e=0;eN&&m[P].gap;)P--;for(B=m[P].s,O=m.length-1;O>P;O--)m[O].s=B;for(;Nle+X||!d($))}for(var ve=0;veP(B))):P(F.text);let U=F.outsidetextfont.size*a*O+o;return{ppadplus:N.some(B=>B.s<0)?U:0,ppadminus:N.some(B=>B.s>=0)?U:0}}return{ppadplus:void 0,ppadminus:void 0}}function R(F,N,O,P){for(var U=z(P),B=0;Bz[c]&&c0?e:t)/(c._m*_*(c._m>0?e:t)))),Ot*=1e3}if(sr===S){if(l&&(sr=c.c2p(Et.y,!0)),sr===S)return!1;sr*=1e3}return[Ot,sr]}function Q(Mt,Et,Ot,sr){var ir=Ot-Mt,ar=sr-Et,Mr=.5-Mt,ma=.5-Et,Ca=ir*ir+ar*ar,Aa=ir*Mr+ar*ma;if(Aa>0&&Aa1||Math.abs(Mr.y-Ot[0][1])>1)&&(Mr=[Mr.x,Mr.y],sr&&Te(Mr,Mt)qe||Mt[1]rt)return[a(Mt[0],Pe,qe),a(Mt[1],et,rt)]}function Tt(Mt,Et){if(Mt[0]===Et[0]&&(Mt[0]===Pe||Mt[0]===qe)||Mt[1]===Et[1]&&(Mt[1]===et||Mt[1]===rt))return!0}function St(Mt,Et){var Ot=[],sr=Xe(Mt),ir=Xe(Et);return sr&&ir&&Tt(sr,ir)||(sr&&Ot.push(sr),ir&&Ot.push(ir)),Ot}function zt(Mt,Et,Ot){return function(sr,ir){var ar=Xe(sr),Mr=Xe(ir),ma=[];if(ar&&Mr&&Tt(ar,Mr))return ma;ar&&ma.push(ar),Mr&&ma.push(Mr);var Ca=2*r.constrain((sr[Mt]+ir[Mt])/2,Et,Ot)-((ar||sr)[Mt]+(Mr||ir)[Mt]);if(Ca){var Aa;ar&&Mr?Aa=Ca>0==ar[Mt]>Mr[Mt]?ar:Mr:Aa=ar||Mr,Aa[Mt]+=Ca}return ma}}var Ut;v==="linear"||v==="spline"?Ut=Qe:v==="hv"||v==="vh"?Ut=St:v==="hvh"?Ut=zt(0,Pe,qe):v==="vhv"&&(Ut=zt(1,et,rt));function br(Mt,Et){var Ot=Et[0]-Mt[0],sr=(Et[1]-Mt[1])/Ot,ir=(Mt[1]*Et[0]-Et[1]*Mt[0])/Ot;return ir>0?[sr>0?Pe:qe,rt]:[sr>0?qe:Pe,et]}function hr(Mt){var Et=Mt[0],Ot=Mt[1],sr=Et===z[F-1][0],ir=Ot===z[F-1][1];if(!(sr&&ir))if(F>1){var ar=Et===z[F-2][0],Mr=Ot===z[F-2][1];sr&&(Et===Pe||Et===qe)&&ar?Mr?F--:z[F-1]=Mt:ir&&(Ot===et||Ot===rt)&&Mr?ar?F--:z[F-1]=Mt:z[F++]=Mt}else z[F++]=Mt}function Or(Mt){z[F-1][0]!==Mt[0]&&z[F-1][1]!==Mt[1]&&hr([ue,ie]),hr(Mt),Ee=null,ue=ie=0}var wr=r.isArrayOrTypedArray(M);function Er(Mt){if(Mt&&A&&(Mt.i=N,Mt.d=s,Mt.trace=f,Mt.marker=wr?M[Mt.i]:M,Mt.backoff=A),re=Mt[0]/_,he=Mt[1]/w,Ue=Mt[0]qe?qe:0,fe=Mt[1]rt?rt:0,Ue||fe){if(!F)z[F++]=[Ue||Mt[0],fe||Mt[1]];else if(Ee){var Et=Ut(Ee,Mt);Et.length>1&&(Or(Et[0]),z[F++]=Et[1])}else We=Ut(z[F-1],Mt)[0],z[F++]=We;var Ot=z[F-1];Ue&&fe&&(Ot[0]!==Ue||Ot[1]!==fe)?(Ee&&(ue!==Ue&&ie!==fe?hr(ue&&ie?br(Ee,Mt):[ue||Ue,ie||fe]):ue&&ie&&hr([ue,ie])),hr([Ue,fe])):ue-Ue&&ie-fe&&hr([Ue||ue,fe||ie]),Ee=Mt,ue=Ue,ie=fe}else Ee&&Or(Ut(Ee,Mt)[0]),z[F++]=Mt}for(N=0;Nxe(X,mt))break;P=X,ee=ce[0]*le[0]+ce[1]*le[1],ee>G?(G=ee,U=X,$=!1):ee=s.length||!X)break;Er(X),O=X}}Ee&&hr([ue||Ee[0],ie||Ee[1]]),m.push(z.slice(0,F))}var ze=v.slice(v.length-1);if(A&&ze!=="h"&&ze!=="v"){for(var Ze=!1,we=-1,ke=[],Be=0;Be=0?i=p:(i=p=f,f++),i0,v=a(p,c,T);if(A=l.selectAll("g.trace").data(v,function(y){return y[0].trace.uid}),A.enter().append("g").attr("class",function(y){return"trace scatter trace"+y[0].trace.uid}).style("stroke-miterlimit",2),A.order(),n(p,A,c),b){w&&(M=w());var u=d.transition().duration(_.duration).ease(_.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(y,m){s(p,m,c,y,v,this,_)})})}else A.each(function(y,m){s(p,m,c,y,v,this,_)});g&&A.exit().remove(),l.selectAll("path:not([d])").remove()};function n(f,p,c){p.each(function(T){var l=E(d.select(this),"g","fills");t.setClipUrl(l,c.layerClipId,f);var _=T[0].trace;_._ownFill=null,_._nextFill=null;var w=[];_._ownfill&&w.push("_ownFill"),_._nexttrace&&w.push("_nextFill");var A=l.selectAll("g").data(w,e);A.enter().append("g"),A.exit().remove(),A.order().each(function(M){_[M]=E(d.select(this),"path","js-fill")})})}function s(f,p,c,T,l,_,w){var A=f._context.staticPlot,M;h(f,p,c,T,l);var g=!!w&&w.duration>0;function b(hr){return g?hr.transition():hr}var v=c.xaxis,u=c.yaxis,y=T[0].trace,m=y.line,R=d.select(_),L=E(R,"g","errorbars"),z=E(R,"g","lines"),F=E(R,"g","points"),N=E(R,"g","text");if(x.getComponentMethod("errorbars","plot")(f,L,c,w),y.visible!==!0)return;b(R).style("opacity",y.opacity);var O,P,U=y.fill.charAt(y.fill.length-1);U!=="x"&&U!=="y"&&(U="");var B,X;U==="y"?(B=1,X=u.c2p(0,!0)):U==="x"&&(B=0,X=v.c2p(0,!0)),T[0][c.isRangePlot?"nodeRangePlot3":"node3"]=R;var $="",le=[],ce=y._prevtrace,ve=null,G=null;ce&&($=ce._prevRevpath||"",P=ce._nextFill,le=ce._ownPolygons,ve=ce._fillsegments,G=ce._fillElement);var Y,ee,V="",se="",ae,j,Q,re,he,xe,Te=[];y._polygons=[];var Le=[],Pe=[],qe=S.noop;if(O=y._ownFill,r.hasLines(y)||y.fill!=="none"){P&&P.datum(T),["hv","vh","hvh","vhv"].indexOf(m.shape)!==-1?(ae=t.steps(m.shape),j=t.steps(m.shape.split("").reverse().join(""))):m.shape==="spline"?ae=j=function(hr){var Or=hr[hr.length-1];return hr.length>1&&hr[0][0]===Or[0]&&hr[0][1]===Or[1]?t.smoothclosed(hr.slice(1),m.smoothing):t.smoothopen(hr,m.smoothing)}:ae=j=function(hr){return"M"+hr.join("L")},Q=function(hr){return j(hr.reverse())},Pe=o(T,{xaxis:v,yaxis:u,trace:y,connectGaps:y.connectgaps,baseTolerance:Math.max(m.width||1,3)/4,shape:m.shape,backoff:m.backoff,simplify:m.simplify,fill:y.fill}),Le=new Array(Pe.length);var et=0;for(M=0;M=A[0]&&R.x<=A[1]&&R.y>=M[0]&&R.y<=M[1]}),u=Math.ceil(v.length/b),y=0;l.forEach(function(R,L){var z=R[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(ce,ve)&&c<=Math.max(ce,ve)?0:1/0}var G=Math.max(3,le.mrc||0),Y=1-1/G,ee=Math.abs(f.c2p(le.x)-c);return ee=Math.min(ce,ve)&&T<=Math.max(ce,ve)?0:1/0}var G=Math.max(3,le.mrc||0),Y=1-1/G,ee=Math.abs(p.c2p(le.y)-T);return eese!=Le>=se&&(he=Q[j-1][0],xe=Q[j][0],Le-Te&&(re=he+(xe-he)*(se-Te)/(Le-Te),G=Math.min(G,re),Y=Math.max(Y,re)));return G=Math.max(G,0),Y=Math.min(Y,f._length),{x0:G,x1:Y,y0:se,y1:se}}if(_.indexOf("fills")!==-1&&h._fillElement){var B=P(h._fillElement)&&!P(h._fillExclusionElement);if(B){var X=U(h._polygons);X===null&&(X={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var $=e.defaultLine;return e.opacity(h.fillcolor)?$=h.fillcolor:e.opacity((h.line||{}).color)&&($=h.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1,color:$,hovertemplate:!1}),delete o.index,h.text&&!d.isArrayOrTypedArray(h.text)?o.text=String(h.text):o.text=h.name,[o]}}}}}),q0=Ge({"src/traces/scatter/select.js"(Z,q){"use strict";var d=iu();q.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=[],a=e[0].trace,i,n,s,h,f=!d.hasMarkers(a)&&!d.hasText(a);if(f)return[];if(E===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),s1=Ge({"src/plots/cartesian/category_order_defaults.js"(Z,q){"use strict";var d=nh().isTypedArraySpec;function x(S,E){var e=E.dataAttr||S._id.charAt(0),t={},r,o,a;if(E.axData)r=E.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),$m=Ge({"src/plots/cartesian/line_grid_defaults.js"(Z,q){"use strict";var d=Ef().mix,x=sf(),S=ta();q.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(m,R){return S.coerce2(e,t,o.attributes,m,R)}var n=i("linecolor",a),s=i("linewidth"),h=r("showline",o.showLine||!!n||!!s);h||(delete t.linecolor,delete t.linewidth);var f=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),p=i("gridcolor",f),c=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!p||!!c||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var _=d(t.gridcolor,o.bgColor,67).toRgbString(),w=i("minor.gridcolor",_),A=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),g=r("minor.showgrid",!!w||!!A||!!M);g||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var b=i("zerolinelayer"),v=i("zerolinecolor",a),u=i("zerolinewidth"),y=r("zeroline",o.showGrid||!!v||!!u);y||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Qm=Ge({"src/plots/cartesian/axis_defaults.js"(Z,q){"use strict";var d=Bo(),x=Yi(),S=ta(),E=ll(),e=Kf(),t=Nf(),r=Mp(),o=D0(),a=Pd(),i=Id(),n=s1(),s=$m(),h=db(),f=Iv(),p=lf().WEEKDAY_PATTERN,c=lf().HOUR_PATTERN;q.exports=function(A,M,g,b,v){var u=b.letter,y=b.font||{},m=b.splomStash||{},R=g("visible",!b.visibleDflt),L=M._template||{},z=M.type||L.type||"-",F;if(z==="date"){var N=x.getComponentMethod("calendars","handleDefaults");N(A,M,"calendar",b.calendar),b.noTicklabelmode||(F=g("ticklabelmode"))}!b.noTicklabelindex&&(z==="date"||z==="linear")&&g("ticklabelindex");var O="";(!b.noTicklabelposition||z==="multicategory")&&(O=S.coerce(A,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),b.noTicklabeloverflow||g("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),f(M,v),h(A,M,g,b),n(A,M,g,b),b.noHover||(z!=="category"&&g("hoverformat"),b.noUnifiedhovertitle||g("unifiedhovertitle.text"));var P=g("color"),U=P!==t.color.dflt?P:y.color,B=m.label||v._dfltTitle[u];if(i(A,M,g,z,b),!R)return M;g("title.text",B),S.coerceFont(g,"title.font",y,{overrideDflt:{size:S.bigFont(y.size),color:U}}),r(A,M,g,z);var X=b.hasMinor;if(X&&(E.newContainer(M,"minor"),r(A,M,g,z,{isMinor:!0})),a(A,M,g,z,b),o(A,M,g,b),X){var $=b.isMinor;b.isMinor=!0,o(A,M,g,b),b.isMinor=$}s(A,M,g,{dfltColor:P,bgColor:b.bgColor,showGrid:b.showGrid,hasMinor:X,attributes:t}),X&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&g("mirror");var le=z==="multicategory";if(!b.noTickson&&(z==="category"||le)&&(M.ticks||M.showgrid)&&(le?(g("tickson","boundaries"),delete M.ticklabelposition):g("tickson")),le){var ce=g("showdividers");ce&&(g("dividercolor"),g("dividerwidth"))}if(z==="date")if(e(A,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var ve=0;ve=2){var u="",y,m;if(v.length===2){for(y=0;y<2;y++)if(m=_(v[y]),m){u=p;break}}var R=g("pattern",u);if(R===p)for(y=0;y<2;y++)m=_(v[y]),m&&(A.bounds[y]=v[y]=m-1);if(R)for(y=0;y<2;y++)switch(m=v[y],R){case p:if(!d(m)){A.enabled=!1;return}if(m=+m,m!==Math.floor(m)||m<0||m>=7){A.enabled=!1;return}A.bounds[y]=v[y]=m;break;case c:if(!d(m)){A.enabled=!1;return}if(m=+m,m<0||m>24){A.enabled=!1;return}A.bounds[y]=v[y]=m;break}if(M.autorange===!1){var L=M.range;if(L[0]L[1]){A.enabled=!1;return}}else if(v[0]>L[0]&&v[1]g[1]-1/4096&&(e.domain=f),x.noneOrAll(E.domain,e.domain,f),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),US=Ge({"src/plots/cartesian/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Bi(),S=Sh().isUnifiedHover,E=wb(),e=ll(),t=P0(),r=Nf(),o=Ub(),a=Qm(),i=kp(),n=l1(),s=dc(),h=s.id2name,f=s.name2id,p=lf().AX_ID_PATTERN,c=Yi(),T=c.traceIs,l=c.getComponentMethod;function _(w,A,M){Array.isArray(w[A])?w[A].push(M):w[A]=[M]}q.exports=function(A,M,g){var b=M.autotypenumbers,v={},u={},y={},m={},R={},L={},z={},F={},N={},O={},P,U;for(P=0;P rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,g._offset,b._offset).call(E.setScale,1,1);var v=M.plot.selectAll(".scatterlayer .trace");v.selectAll(".point").call(E.setPointGroupScale,1,1),v.selectAll(".textpoint").call(E.setTextPointsScale,1,1),v.call(E.hideOutsideRangePoints,M)}function h(M,g){var b=M.plotinfo,v=b.xaxis,u=b.yaxis,y=v._length,m=u._length,R=!!M.xr1,L=!!M.yr1,z=[];if(R){var F=S.simpleMap(M.xr0,v.r2l),N=S.simpleMap(M.xr1,v.r2l),O=F[1]-F[0],P=N[1]-N[0];z[0]=(F[0]*(1-g)+g*N[0]-F[0])/(F[1]-F[0])*y,z[2]=y*(1-g+g*P/O),v.range[0]=v.l2r(F[0]*(1-g)+g*N[0]),v.range[1]=v.l2r(F[1]*(1-g)+g*N[1])}else z[0]=0,z[2]=y;if(L){var U=S.simpleMap(M.yr0,u.r2l),B=S.simpleMap(M.yr1,u.r2l),X=U[1]-U[0],$=B[1]-B[0];z[1]=(U[1]*(1-g)+g*B[1]-U[1])/(U[0]-U[1])*m,z[3]=m*(1-g+g*$/X),u.range[0]=v.l2r(U[0]*(1-g)+g*B[0]),u.range[1]=u.l2r(U[1]*(1-g)+g*B[1])}else z[1]=0,z[3]=m;e.drawOne(r,v,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[v._id,u._id]);var le=R?y/z[2]:1,ce=L?m/z[3]:1,ve=R?z[0]:0,G=L?z[1]:0,Y=R?z[0]/z[2]*y:0,ee=L?z[1]/z[3]*m:0,V=v._offset-Y,se=u._offset-ee;b.clipRect.call(E.setTranslate,ve,G).call(E.setScale,1/le,1/ce),b.plot.call(E.setTranslate,V,se).call(E.setScale,le,ce),E.setPointGroupScale(b.zoomScalePts,1/le,1/ce),E.setTextPointsScale(b.zoomScaleTxt,1/le,1/ce)}var f;i&&(f=i());function p(){for(var M={},g=0;ga.duration?(p(),_=window.cancelAnimationFrame(A)):_=window.requestAnimationFrame(A)}return T=Date.now(),_=window.requestAnimationFrame(A),Promise.resolve()}}}),Jc=Ge({"src/plots/cartesian/index.js"(Z){"use strict";var q=Oi(),d=Yi(),x=ta(),S=Uu(),E=zo(),e=Bf().getModuleCalcData,t=dc(),r=lf(),o=Bh(),a=x.ensureSingle;function i(T,l,_){return x.ensureSingle(T,l,_,function(w){w.datum(_)})}var n=r.zindexSeparator;Z.name="cartesian",Z.attr=["xaxis","yaxis"],Z.idRoot=["x","y"],Z.idRegex=r.idRegex,Z.attrRegex=r.attrRegex,Z.attributes=NS(),Z.layoutAttributes=Nf(),Z.supplyLayoutDefaults=US(),Z.transitionAxes=jS(),Z.finalizeSubplots=function(T,l){var _=l._subplots,w=_.xaxis,A=_.yaxis,M=_.cartesian,g=M,b={},v={},u,y,m;for(u=0;u0){var L=R.id;if(L.indexOf(n)!==-1)continue;L+=n+(u+1),R=x.extendFlat({},R,{id:L,plot:A._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,N=0;N1&&(X+=n+B),U.push(b+X),g=0;g1,m=l.mainplotinfo;if(!l.mainplot||y)if(u)l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.xaxislayer=a(w,"g","xaxislayer-above"),l.yaxislayer=a(w,"g","yaxislayer-above");else{if(!g){var R=a(w,"g","layer-subplot");l.shapelayer=a(R,"g","shapelayer"),l.imagelayer=a(R,"g","imagelayer"),m&&y?(l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer):(l.minorGridlayer=a(w,"g","minor-gridlayer"),l.gridlayer=a(w,"g","gridlayer"),l.zerolinelayer=a(w,"g","zerolinelayer"));var L=a(w,"g","layer-between");l.shapelayerBetween=a(L,"g","shapelayer"),l.imagelayerBetween=a(L,"g","imagelayer"),a(w,"path","xlines-below"),a(w,"path","ylines-below"),l.overlinesBelow=a(w,"g","overlines-below"),a(w,"g","xaxislayer-below"),a(w,"g","yaxislayer-below"),l.overaxesBelow=a(w,"g","overaxes-below")}l.overplot=a(w,"g","overplot"),l.plot=a(l.overplot,"g",A),m&&y?l.zerolinelayerAbove=m.zerolinelayerAbove:l.zerolinelayerAbove=a(w,"g","zerolinelayer-above"),g||(l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.overlinesAbove=a(w,"g","overlines-above"),a(w,"g","xaxislayer-above"),a(w,"g","yaxislayer-above"),l.overaxesAbove=a(w,"g","overaxes-above"),l.xlines=w.select(".xlines-"+b),l.ylines=w.select(".ylines-"+v),l.xaxislayer=w.select(".xaxislayer-"+b),l.yaxislayer=w.select(".yaxislayer-"+v))}else{var z=m.plotgroup,F=A+"-x",N=A+"-y";l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer,l.zerolinelayerAbove=m.zerolinelayerAbove,a(m.overlinesBelow,"path",F),a(m.overlinesBelow,"path",N),a(m.overaxesBelow,"g",F),a(m.overaxesBelow,"g",N),l.plot=a(m.overplot,"g",A),a(m.overlinesAbove,"path",F),a(m.overlinesAbove,"path",N),a(m.overaxesAbove,"g",F),a(m.overaxesAbove,"g",N),l.xlines=z.select(".overlines-"+b).select("."+F),l.ylines=z.select(".overlines-"+v).select("."+N),l.xaxislayer=z.select(".overaxes-"+b).select("."+F),l.yaxislayer=z.select(".overaxes-"+v).select("."+N)}g||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function p(T,l){if(T){var _={};T.each(function(v){var u=v[0],y=q.select(this);y.remove(),c(u,l),_[u]=!0});for(var w in l._plots)for(var A=l._plots[w],M=A.overlays||[],g=0;g=0,l=i.indexOf("end")>=0,_=h.backoff*p+n.standoff,w=f.backoff*c+n.startstandoff,A,M,g,b;if(s.nodeName==="line"){A={x:+a.attr("x1"),y:+a.attr("y1")},M={x:+a.attr("x2"),y:+a.attr("y2")};var v=A.x-M.x,u=A.y-M.y;if(g=Math.atan2(u,v),b=g+Math.PI,_&&w&&_+w>Math.sqrt(v*v+u*u)){X();return}if(_){if(_*_>v*v+u*u){X();return}var y=_*Math.cos(g),m=_*Math.sin(g);M.x+=y,M.y+=m,a.attr({x2:M.x,y2:M.y})}if(w){if(w*w>v*v+u*u){X();return}var R=w*Math.cos(g),L=w*Math.sin(g);A.x-=R,A.y-=L,a.attr({x1:A.x,y1:A.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z<_+w){X();return}var N=s.getPointAtLength(0),O=s.getPointAtLength(.1);g=Math.atan2(N.y-O.y,N.x-O.x),A=s.getPointAtLength(Math.min(w,z)),F="0px,"+w+"px,";var P=s.getPointAtLength(z),U=s.getPointAtLength(z-.1);b=Math.atan2(P.y-U.y,P.x-U.x),M=s.getPointAtLength(Math.max(0,z-_));var B=F?w+_:_;F+=z-B+"px,"+z+"px",a.style("stroke-dasharray",F)}function X(){a.style("stroke-dasharray","0px,100px")}function $(le,ce,ve,G){le.path&&(le.noRotate&&(ve=0),d.select(s.parentNode).append("path").attr({class:a.attr("class"),d:le.path,transform:r(ce.x,ce.y)+t(ve*180/Math.PI)+e(G)}).style({fill:x.rgb(n.arrowcolor),"stroke-width":0}))}T&&$(f,A,g,c),l&&$(h,M,b,p)}}}),u1=Ge({"src/components/annotations/draw.js"(Z,q){"use strict";var d=Oi(),x=Yi(),S=Uu(),E=ta(),e=E.strTranslate,t=Mo(),r=Bi(),o=zo(),a=mc(),i=Il(),n=cv(),s=sh(),h=ll().arrayEditor,f=qS();q.exports={draw:p,drawOne:c,drawRaw:l};function p(_){var w=_._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var A=0;A2/3?ba="right":ba="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[ba]}for(var We=!1,Qe=["x","y"],Xe=0;Xe1)&&(zt===St?(ot=Ut.r2fraction(w["a"+Tt]),(ot<0||ot>1)&&(We=!0)):We=!0),Ze=Ut._offset+Ut.r2p(w[Tt]),Be=.5}else{var Ft=nt==="domain";Tt==="x"?(ke=w[Tt],Ze=Ft?Ut._offset+Ut._length*ke:Ze=u.l+u.w*ke):(ke=1-w[Tt],Ze=Ft?Ut._offset+Ut._length*ke:Ze=u.t+u.h*ke),Be=w.showarrow?.5:ke}if(w.showarrow){ze.head=Ze;var Mt=w["a"+Tt];if(He=hr*Ee(.5,w.xanchor)-Or*Ee(.5,w.yanchor),zt===St){var Et=t.getRefType(zt);Et==="domain"?(Tt==="y"&&(Mt=1-Mt),ze.tail=Ut._offset+Ut._length*Mt):Et==="paper"?Tt==="y"?(Mt=1-Mt,ze.tail=u.t+u.h*Mt):ze.tail=u.l+u.w*Mt:ze.tail=Ut._offset+Ut.r2p(Mt),we=He}else ze.tail=Ze+Mt,we=He+Mt;ze.text=ze.tail+He;var Ot=v[Tt==="x"?"width":"height"];if(St==="paper"&&(ze.head=E.constrain(ze.head,1,Ot-1)),zt==="pixel"){var sr=-Math.max(ze.tail-3,ze.text),ir=Math.min(ze.tail+3,ze.text)-Ot;sr>0?(ze.tail+=sr,ze.text+=sr):ir>0&&(ze.tail-=ir,ze.text-=ir)}ze.tail+=mt,ze.head+=mt}else He=wr*Ee(Be,Er),we=He,ze.text=Ze+He;ze.text+=mt,He+=mt,we+=mt,w["_"+Tt+"padplus"]=wr/2+we,w["_"+Tt+"padminus"]=wr/2-we,w["_"+Tt+"size"]=wr,w["_"+Tt+"shift"]=He}if(We){ve.remove();return}var ar=0,Mr=0;if(w.align!=="left"&&(ar=(Ue-rt)*(w.align==="center"?.5:1)),w.valign!=="top"&&(Mr=(fe-$e)*(w.valign==="middle"?.5:1)),qe)Pe.select("svg").attr({x:ee+ar-1,y:ee+Mr}).call(o.setClipUrl,se?O:null,_);else{var ma=ee+Mr-et.top,Ca=ee+ar-et.left;re.call(i.positionText,Ca,ma).call(o.setClipUrl,se?O:null,_)}ae.select("rect").call(o.setRect,ee,ee,Ue,fe),V.call(o.setRect,G/2,G/2,ue-G,ie-G),ve.call(o.setTranslate,Math.round(P.x.text-ue/2),Math.round(P.y.text-ie/2)),X.attr({transform:"rotate("+U+","+P.x.text+","+P.y.text+")"});var Aa=function(Ba,ba){B.selectAll(".annotation-arrow-g").remove();var rn=P.x.head,vn=P.y.head,Wt=P.x.tail+Ba,Lt=P.y.tail+ba,Ht=P.x.text+Ba,Xt=P.y.text+ba,Pr=E.rotationXYMatrix(U,Ht,Xt),Yr=E.apply2DTransform(Pr),Kr=E.apply2DTransform2(Pr),na=+V.attr("width"),La=+V.attr("height"),Ga=Ht-.5*na,Ua=Ga+na,Xa=Xt-.5*La,an=Xa+La,Sa=[[Ga,Xa,Ga,an],[Ga,an,Ua,an],[Ua,an,Ua,Xa],[Ua,Xa,Ga,Xa]].map(Kr);if(!Sa.reduce(function(dt,qt){return dt^!!E.segmentsIntersect(rn,vn,rn+1e6,vn+1e6,qt[0],qt[1],qt[2],qt[3])},!1)){Sa.forEach(function(dt){var qt=E.segmentsIntersect(Wt,Lt,rn,vn,dt[0],dt[1],dt[2],dt[3]);qt&&(Wt=qt.x,Lt=qt.y)});var Zn=w.arrowwidth,Wn=w.arrowcolor,ti=w.arrowside,gt=B.append("g").style({opacity:r.opacity(Wn)}).classed("annotation-arrow-g",!0),it=gt.append("path").attr("d","M"+Wt+","+Lt+"L"+rn+","+vn).style("stroke-width",Zn+"px").call(r.stroke,r.rgb(Wn));if(f(it,ti,w),y.annotationPosition&&it.node().parentNode&&!M){var Rr=rn,Ar=vn;if(w.standoff){var pr=Math.sqrt(Math.pow(rn-Wt,2)+Math.pow(vn-Lt,2));Rr+=w.standoff*(Wt-rn)/pr,Ar+=w.standoff*(Lt-vn)/pr}var kr=gt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Wt-Rr)+","+(Lt-Ar),transform:e(Rr,Ar)}).style("stroke-width",Zn+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),zr,Ur;s.init({element:kr.node(),gd:_,prepFn:function(){var dt=o.getTranslate(ve);zr=dt.x,Ur=dt.y,g&&g.autorange&&z(g._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0)},moveFn:function(dt,qt){var fr=Yr(zr,Ur),Ir=fr[0]+dt,da=fr[1]+qt;ve.call(o.setTranslate,Ir,da),F("x",T(g,dt,"x",u,w)),F("y",T(b,qt,"y",u,w)),w.axref===w.xref&&F("ax",T(g,dt,"ax",u,w)),w.ayref===w.yref&&F("ay",T(b,qt,"ay",u,w)),gt.attr("transform",e(dt,qt)),X.attr({transform:"rotate("+U+","+Ir+","+da+")"})},doneFn:function(){x.call("_guiRelayout",_,N());var dt=document.querySelector(".js-notes-box-panel");dt&&dt.redraw(dt.selectedObj)}})}}};if(w.showarrow&&Aa(0,0),$){var Da;s.init({element:ve.node(),gd:_,prepFn:function(){Da=X.attr("transform")},moveFn:function(Ba,ba){var rn="pointer";if(w.showarrow)w.axref===w.xref?F("ax",T(g,Ba,"ax",u,w)):F("ax",w.ax+Ba),w.ayref===w.yref?F("ay",T(b,ba,"ay",u.w,w)):F("ay",w.ay+ba),Aa(Ba,ba);else{if(M)return;var vn,Wt;if(g)vn=T(g,Ba,"x",u,w);else{var Lt=w._xsize/u.w,Ht=w.x+(w._xshift-w.xshift)/u.w-Lt/2;vn=s.align(Ht+Ba/u.w,Lt,0,1,w.xanchor)}if(b)Wt=T(b,ba,"y",u,w);else{var Xt=w._ysize/u.h,Pr=w.y-(w._yshift+w.yshift)/u.h-Xt/2;Wt=s.align(Pr-ba/u.h,Xt,0,1,w.yanchor)}F("x",vn),F("y",Wt),(!g||!b)&&(rn=s.getCursor(g?.5:vn,b?.5:Wt,w.xanchor,w.yanchor))}X.attr({transform:e(Ba,ba)+Da}),n(ve,rn)},clickFn:function(Ba,ba){w.captureevents&&_.emit("plotly_clickannotation",ce(ba))},doneFn:function(){n(ve),x.call("_guiRelayout",_,N());var Ba=document.querySelector(".js-notes-box-panel");Ba&&Ba.redraw(Ba.selectedObj)}})}}y.annotationText?re.call(i.makeEditable,{delegate:ve,gd:_}).call(he).on("edit",function(Te){w.text=Te,this.call(he),F("text",Te),g&&g.autorange&&z(g._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0),x.call("_guiRelayout",_,N())}):re.call(he)}}}),GS=Ge({"src/components/annotations/click.js"(Z,q){"use strict";var d=ta(),x=Yi(),S=ll().arrayEditor;q.exports={hasClickToShow:E,onClick:e};function E(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),h={},f=o._fullLayout.annotations,p,c;if(n.length||s.length){for(p=0;p1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),$S=Ge({"src/components/annotations3d/index.js"(Z,q){"use strict";var d=Yi(),x=ta();q.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:c1()}}},layoutAttributes:c1(),handleDefaults:YS(),includeBasePlot:S,convert:KS(),draw:JS()};function S(E,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),a=0;a{var m=y+"anchor",R=y==="x"?_:w,L={_fullLayout:i},z,F,N,O;let P=y+"ref",U=o[P];if(Array.isArray(U)&&U.length>0){let B=e.countDefiningCoords(c,f,y);O=x.coerceRefArray(o,a,L,y,void 0,"paper",B),a["_"+y+"refArray"]=!0}else O=x.coerceRef(o,a,L,y,void 0,"paper");if(Array.isArray(O))O.forEach(function(B){x.getRefType(B)==="range"&&(z=x.getFromId(L,B),z&&z._shapeIndices.indexOf(a._index)===-1&&z._shapeIndices.push(a._index))}),T&&[0,1].forEach(function(B){let X=O[B];x.getRefType(X)==="range"?(z=x.getFromId(L,X),F=e.shapePositionToRange(z),N=e.rangeToShapePosition(z),(z.type==="category"||z.type==="multicategory")&&n(y+B+"shift")):F=N=d.identity;let le=y+B,ce=o[le];if(o[le]=F(o[le],!0),R==="pixel"?n(le,M[B]):x.coercePosition(a,L,n,X,le,A[B]),a[le]=N(a[le]),o[le]=ce,B===0&&R==="pixel"){let ve=o[m];o[m]=F(o[m],!0),x.coercePosition(a,L,n,X,m,.25),a[m]=N(a[m]),o[m]=ve}});else{if(x.getRefType(O)==="range"?(z=x.getFromId(L,O),z._shapeIndices.push(a._index),N=e.rangeToShapePosition(z),F=e.shapePositionToRange(z),T&&(z.type==="category"||z.type==="multicategory")&&(n(y+"0shift"),n(y+"1shift"))):F=N=d.identity,T){let X=y+"0",$=y+"1",le=o[X],ce=o[$];o[X]=F(o[X],!0),o[$]=F(o[$],!0),R==="pixel"?(n(X,M[0]),n($,M[1])):(x.coercePosition(a,L,n,O,X,A[0]),x.coercePosition(a,L,n,O,$,A[1])),a[X]=N(a[X]),a[$]=N(a[$]),o[X]=le,o[$]=ce}if(R==="pixel"){let X=o[m];o[m]=F(o[m],!0),x.coercePosition(a,L,n,O,m,.25),a[m]=N(a[m]),o[m]=X}}}),T&&d.noneOrAll(o,a,["x0","x1","y0","y1"]);var g=c==="line",b,v;if(T&&(b=n("label.texttemplate"),n("label.texttemplatefallback")),b||(v=n("label.text")),v||b){n("label.textangle");var u=n("label.textposition",g?"middle":"middle center");n("label.xanchor"),n("label.yanchor",t(g,u)),n("label.padding"),d.coerceFont(n,"label.font",i.font)}}}}),eM=Ge({"src/components/shapes/draw_newshape/defaults.js"(Z,q){"use strict";var d=Bi(),x=ta();function S(E,e){return E?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}q.exports=function(e,t,r){r("newshape.visible"),r("newshape.name"),r("newshape.showlegend"),r("newshape.legend"),r("newshape.legendwidth"),r("newshape.legendgroup"),r("newshape.legendgrouptitle.text"),x.coerceFont(r,"newshape.legendgrouptitle.font"),r("newshape.legendrank"),r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity");var o=r("newshape.line.width");if(o){var a=(e||{}).plot_bgcolor||"#FFF";r("newshape.line.color",d.contrast(a)),r("newshape.line.dash")}var i=e.dragmode==="drawline",n=r("newshape.label.text"),s=r("newshape.label.texttemplate");if(r("newshape.label.texttemplatefallback"),n||s){r("newshape.label.textangle");var h=r("newshape.label.textposition",i?"middle":"middle center");r("newshape.label.xanchor"),r("newshape.label.yanchor",S(i,h)),r("newshape.label.padding"),x.coerceFont(r,"newshape.label.font",t.font)}r("activeshape.fillcolor"),r("activeshape.opacity")}}}),tM=Ge({"src/components/shapes/calc_autorange.js"(Z,q){"use strict";var d=ta(),x=Mo(),S=Xm(),E=zd();q.exports=function(n){var s=n._fullLayout,h=d.filterVisible(s.shapes);if(!(!h.length||!n._fullData.length))for(var f=0;f{c=x.getFromId(n,A),p._extremes[c._id]=x.findExtremes(c,M,t(p))})}else p.xref!=="paper"&&l!=="domain"&&(c=x.getFromId(n,p.xref),T=a(c,p,S.paramIsX),T&&(p._extremes[c._id]=x.findExtremes(c,T,t(p))));if(_==="array"){let w=e(n,p,"y");Object.entries(w).forEach(([A,M])=>{c=x.getFromId(n,A),p._extremes[c._id]=x.findExtremes(c,M,r(p))})}else p.yref!=="paper"&&_!=="domain"&&(c=x.getFromId(n,p.yref),T=a(c,p,S.paramIsY),T&&(p._extremes[c._id]=x.findExtremes(c,T,r(p))))}};function e(i,n,s){let h=n[s+"ref"],f=s==="x"?S.paramIsX:S.paramIsY;function p(A,M){A==="paper"||x.getRefType(A)==="domain"||(c[A]||(c[A]=[]),c[A].push(M))}let c={};if(n.type==="path"&&n.path){let A=n.path.match(S.segmentRE)||[];for(var T=0,l=0;lb&&(p(h[T],v[b]),T++)}}else p(h[0],n[s+"0"]),p(h[1],n[s+"1"]);let _={};for(let A in c){let M=x.getFromId(i,A);if(M){var w=M.type==="category"||M.type==="multicategory"?M.r2c:M.d2c;M.type==="date"&&(w=E.decodeDate(w)),_[M._id]=c[A].map(w)}}return _}function t(i){return o(i.line.width,i.xsizemode,i.x0,i.x1,i.path,!1)}function r(i){return o(i.line.width,i.ysizemode,i.y0,i.y1,i.path,!0)}function o(i,n,s,h,f,p){var c=i/2,T=p;if(n==="pixel"){var l=f?E.extractPathCoords(f,p?S.paramIsY:S.paramIsX):[s,h],_=d.aggNums(Math.max,null,l),w=d.aggNums(Math.min,null,l),A=w<0?Math.abs(w)+c:c,M=_>0?_+c:c;return{ppad:c,ppadplus:T?A:M,ppadminus:T?M:A}}else return{ppad:c}}function a(i,n,s){var h=i._id.charAt(0)==="x"?"x":"y",f=i.type==="category"||i.type==="multicategory",p,c,T=0,l=0,_=f?i.r2c:i.d2c,w=n[h+"sizemode"]==="scaled";if(w?(p=n[h+"0"],c=n[h+"1"],f&&(T=n[h+"0shift"],l=n[h+"1shift"])):(p=n[h+"anchor"],c=n[h+"anchor"]),p!==void 0)return[_(p)+T,_(c)+l];if(n.path){var A=1/0,M=-1/0,g=n.path.match(S.segmentRE),b,v,u,y,m;for(i.type==="date"&&(_=E.decodeDate(_)),b=0;bM&&(M=m)));if(M>=A)return[A,M]}}}}),rM=Ge({"src/components/shapes/index.js"(Z,q){"use strict";var d=r1();q.exports={moduleType:"component",name:"shapes",layoutAttributes:qb(),supplyLayoutDefaults:QS(),supplyDrawNewShapeDefaults:eM(),includeBasePlot:Jm()("shapes"),calcAutorange:tM(),draw:d.draw,drawOne:d.drawOne}}}),Gb=Ge({"src/components/images/attributes.js"(Z,q){"use strict";var d=lf(),x=ll().templatedArray,S=Km();q.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),aM=Ge({"src/components/images/defaults.js"(Z,q){"use strict";var d=ta(),x=Mo(),S=Kf(),E=Gb(),e="images";q.exports=function(o,a){var i={name:e,handleItemDefaults:t};S(o,a,i)};function t(r,o,a){function i(_,w){return d.coerce(r,o,E,_,w)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var h={_fullLayout:a},f=["x","y"],p=0;p<2;p++){var c=f[p],T=x.coerceRef(r,o,h,c,"paper",void 0);if(T!=="paper"){var l=x.getFromId(h,T);l._imgIndices.push(o._index)}x.coercePosition(o,h,i,T,c,0)}return o}}}),nM=Ge({"src/components/images/draw.js"(Z,q){"use strict";var d=Oi(),x=zo(),S=Mo(),E=dc(),e=Bh();q.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,h;for(h=0;h0);f&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(h,f){return d.coerce(a,i,t,h,f)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),lM=Ge({"src/components/updatemenus/scrollbox.js"(Z,q){"use strict";q.exports=e;var d=Oi(),x=Bi(),S=zo(),E=ta();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var h=this.position.l,f=this.position.w,p=this.position.t,c=this.position.h,T=this.position.direction,l=T==="down",_=T==="left",w=T==="right",A=T==="up",M=f,g=c,b,v,u,y;!l&&!_&&!w&&!A&&(this.position.direction="down",l=!0);var m=l||A;m?(b=h,v=b+M,l?(u=p,y=Math.min(u+g,s),g=y-u):(y=p+g,u=Math.max(y-g,0),g=y-u)):(u=p,y=u+g,_?(v=h+M,b=Math.max(v-M,0),M=v-b):(b=h,v=Math.min(b+M,n),M=v-b)),this._box={l:b,t:u,w:M,h:g};var R=f>M,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=h,N=p+c;N+z>s&&(N=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(R?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),R?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:N,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=M-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=c>g,U=e.barWidth+2*e.barPad,B=e.barLength+2*e.barPad,X=h+f,$=p;X+U>n&&(X=n-U);var le=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);le.exit().on(".drag",null).remove(),le.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),P?(this.vbar=le.attr({rx:e.barRadius,ry:e.barRadius,x:X,y:$,width:U,height:B}),this._vbarYMin=$+B/2,this._vbarTranslateMax=g-B):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var ce=this.id,ve=b-.5,G=P?v+U+.5:v+.5,Y=u-.5,ee=R?y+z+.5:y+.5,V=i._topdefs.selectAll("#"+ce).data(R||P?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",ce).append("rect"),R||P?(this._clipRect=V.select("rect").attr({x:Math.floor(ve),y:Math.floor(Y),width:Math.ceil(G)-Math.floor(ve),height:Math.ceil(ee)-Math.floor(Y)}),this.container.call(S.setClipUrl,ce,this.gd),this.bg.attr({x:h,y:p,width:f,height:c})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),R||P){var se=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(se);var ae=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));R&&this.hbar.on(".drag",null).call(ae),P&&this.vbar.on(".drag",null).call(ae)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=E.constrain(d.event.x,a,i),s=(n-a)/(i-a),h=this.position.w-this._box.w;r=s*h}if(this.vbar){var f=o+this._vbarYMin,p=f+this._vbarTranslateMax,c=E.constrain(d.event.y,f,p),T=(c-f)/(p-f),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,a),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(S.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(S.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(S.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),uM=Ge({"src/components/updatemenus/draw.js"(Z,q){"use strict";var d=Oi(),x=Uu(),S=Bi(),E=zo(),e=ta(),t=Il(),r=ll().arrayEditor,o=uf().LINE_SPACING,a=f1(),i=lM();q.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[a.name]);function N(ce){x.autoMargin(L,u(ce))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(N)}).remove(),F.length!==0){var P=O.selectAll("g."+a.headerGroupClassName).data(F,n);P.enter().append("g").classed(a.headerGroupClassName,!0);for(var U=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(ce){ce.style("pointer-events","all")}),B=0;B0?[0]:[]);X.enter().append("g").classed(a.containerClassName,!0).style("cursor",P?null:"ew-resize");function $(G){G._commandObserver&&(G._commandObserver.remove(),delete G._commandObserver),x.autoMargin(O,f(G))}if(X.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each($)}).remove(),B.length!==0){var le=X.selectAll("g."+a.groupClassName).data(B,c);le.enter().append("g").classed(a.groupClassName,!0),le.exit().each($).remove();for(var ce=0;ce0&&(le=le.transition().duration(O.transition.duration).ease(O.transition.easing)),le.attr("transform",t($-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function R(N,O){var P=N._dims;return P.inputAreaStart+a.stepInset+(P.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function L(N,O){var P=N._dims;return Math.min(1,Math.max(0,(O-a.stepInset-P.inputAreaStart)/(P.inputAreaLength-2*a.stepInset-2*P.inputAreaStart)))}function z(N,O,P){var U=P._dims,B=e.ensureSingle(N,"rect",a.railTouchRectClass,function(X){X.call(v,O,N,P).style("pointer-events","all")});B.attr({width:U.inputAreaLength,height:Math.max(U.inputAreaWidth,a.tickOffset+P.ticklen+U.labelHeight)}).call(S.fill,P.bgcolor).attr("opacity",0),E.setTranslate(B,0,U.currentValueTotalHeight)}function F(N,O){var P=O._dims,U=P.inputAreaLength-a.railInset*2,B=e.ensureSingle(N,"rect",a.railRectClass);B.attr({width:U,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(S.stroke,O.bordercolor).call(S.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),E.setTranslate(B,a.railInset,(P.inputAreaWidth-a.railWidth)*.5+P.currentValueTotalHeight)}}}),vM=Ge({"src/components/sliders/index.js"(Z,q){"use strict";var d=eg();q.exports={moduleType:"component",name:d.name,layoutAttributes:Wb(),supplyLayoutDefaults:fM(),draw:hM()}}}),h1=Ge({"src/components/rangeslider/attributes.js"(Z,q){"use strict";var d=sf();q.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),Xb=Ge({"src/components/rangeslider/oppaxis_attributes.js"(Z,q){"use strict";q.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),v1=Ge({"src/components/rangeslider/constants.js"(Z,q){"use strict";q.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),dM=Ge({"src/components/rangeslider/helpers.js"(Z){"use strict";var q=dc(),d=Il(),x=v1(),S=uf().LINE_SPACING,E=x.name;function e(t){var r=t&&t[E];return r&&r.visible}Z.isVisible=e,Z.makeData=function(t){for(var r=q.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=rt.max)qe=he[et+1];else if(Pe=rt.pmax)qe=he[et+1];else if(Pe0?v.touches[0].clientX:0}function p(v,u,y,m){if(u._context.staticPlot)return;var R=v.select("rect."+h.slideBoxClassName).node(),L=v.select("rect."+h.grabAreaMinClassName).node(),z=v.select("rect."+h.grabAreaMaxClassName).node();function F(){var N=d.event,O=N.target,P=f(N),U=P-v.node().getBoundingClientRect().left,B=m.d2p(y._rl[0]),X=m.d2p(y._rl[1]),$=n.coverSlip();this.addEventListener("touchmove",le),this.addEventListener("touchend",ce),$.addEventListener("mousemove",le),$.addEventListener("mouseup",ce);function le(ve){var G=f(ve),Y=+G-P,ee,V,se;switch(O){case R:if(se="ew-resize",B+Y>y._length||X+Y<0)return;ee=B+Y,V=X+Y;break;case L:if(se="col-resize",B+Y>y._length)return;ee=B+Y,V=X;break;case z:if(se="col-resize",X+Y<0)return;ee=B,V=X+Y;break;default:se="ew-resize",ee=U,V=U+Y;break}if(V0);if(_){var w=o(n,s,h);T("x",w[0]),T("y",w[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var A=T("bgcolor");T("activecolor",x.contrast(A,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var h=s.calendar;function f(T,l){return d.coerce(a,i,e.buttons,T,l)}var p=f("visible");if(p){var c=f("step");c!=="all"&&(h&&h!=="gregorian"&&(c==="month"||c==="year")?i.stepmode="backward":f("stepmode"),f("count")),f("label")}}function o(a,i,n){for(var s=n.filter(function(c){return i[c].anchor===a._id}),h=0,f=0;f1)){delete h.grid;return}if(!T&&!l&&!_){var y=b("pattern")==="independent";y&&(T=!0)}g._hasSubplotGrid=T;var m=b("roworder"),R=m==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,N;w&&h._splomGridDflt&&(F=h._splomGridDflt.xside,N=h._splomGridDflt.yside),g._domains={x:a("x",b,L,F,u),y:a("y",b,z,N,v,R)}}function a(s,h,f,p,c,T){var l=h(s+"gap",f),_=h("domain."+s);h(s+"side",p);for(var w=new Array(c),A=_[0],M=(_[1]-A)/(c-l),g=M*(1-l),b=0;b0,p=r._context.staticPlot;o.each(function(c){var T=c[0].trace,l=T.error_x||{},_=T.error_y||{},w;T.ids&&(w=function(b){return b.id});var A=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!_.visible&&!l.visible&&(c=[]);var M=d.select(this).selectAll("g.errorbar").data(c,w);if(M.exit().remove(),!!c.length){l.visible||M.selectAll("path.xerror").remove(),_.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var g=M.enter().append("g").classed("errorbar",!0);f&&g.style("opacity",0).transition().duration(i.duration).style("opacity",1),S.setClipUrl(M,a.layerClipId,r),M.each(function(b){var v=d.select(this),u=e(b,s,h);if(!(A&&!b.vis)){var y,m=v.select("path.yerror");if(_.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var R=_.width;y="M"+(u.x-R)+","+u.yh+"h"+2*R+"m-"+R+",0V"+u.ys,u.noYS||(y+="m-"+R+",0h"+2*R),n=!m.size(),n?m=v.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("yerror",!0):f&&(m=m.transition().duration(i.duration).ease(i.easing)),m.attr("d",y)}else m.remove();var L=v.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?_:l).width;y="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(y+="m0,-"+z+"v"+2*z),n=!L.size(),n?L=v.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("xerror",!0):f&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",y)}else L.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),MM=Ge({"src/components/errorbars/style.js"(Z,q){"use strict";var d=Oi(),x=Bi();q.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),EM=Ge({"src/components/errorbars/index.js"(Z,q){"use strict";var d=ta(),x=Ru().overrideAll,S=Kb(),E={error_x:d.extendFlat({},S),error_y:d.extendFlat({},S)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:d.extendFlat({},S),error_y:d.extendFlat({},S),error_z:d.extendFlat({},S)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,q.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:x(e,"calc","nested"),scattergl:x(E,"calc","nested")}},supplyDefaults:TM(),calc:AM(),makeComputeError:Jb(),plot:SM(),style:MM(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),kM=Ge({"src/components/colorbar/constants.js"(Z,q){"use strict";q.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),CM=Ge({"src/components/colorbar/draw.js"(Z,q){"use strict";var d=Oi(),x=Ef(),S=Uu(),E=Yi(),e=Mo(),t=sh(),r=ta(),o=r.strTranslate,a=Do().extendFlat,i=cv(),n=zo(),s=Bi(),h=Ep(),f=Il(),p=ih().flipScale,c=Qm(),T=l1(),l=Nf(),_=uf(),w=_.LINE_SPACING,A=_.FROM_TL,M=_.FROM_BR,g=kM().cn;function b(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+g.colorbar).data(v(L),function(N){return N._id});F.enter().append("g").attr("class",function(N){return N._id}).classed(g.colorbar,!0),F.each(function(N){var O=d.select(this);r.ensureSingle(O,"rect",g.cbbg),r.ensureSingle(O,"g",g.cbfills),r.ensureSingle(O,"g",g.cblines),r.ensureSingle(O,"g",g.cbaxis,function(U){U.classed(g.crisp,!0)}),r.ensureSingle(O,"g",g.cbtitleunshift,function(U){U.append("g").classed(g.cbtitle,!0)}),r.ensureSingle(O,"rect",g.cboutline);var P=u(O,N,L);P&&P.then&&(L._promises||[]).push(P),L._context.edits.colorbarPosition&&y(O,N,L)}),F.exit().each(function(N){S.autoMargin(L,N._id)}).remove(),F.order()}function v(L){var z=L._fullLayout,F=L.calcdata,N=[],O,P,U,B;function X(j){return a(j,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function $(){typeof B.calc=="function"?B.calc(L,U,O):(O._fillgradient=P.reversescale?p(P.colorscale):P.colorscale,O._zrange=[P[B.min],P[B.max]])}for(var le=0;le1){var ze=Math.pow(10,Math.floor(Math.log(mt)/Math.LN10));wr*=ze*r.roundUp(mt/ze,[2,5,10]),(Math.abs(et.start)/et.size+1e-6)%1<2e-6&&(hr.tick0=0)}hr.dtick=wr}hr.domain=N?[Ut+Y/Q.h,Ut+Ee-Y/Q.h]:[Ut+G/Q.w,Ut+Ee-G/Q.w],hr.setScale(),L.attr("transform",o(Math.round(Q.l),Math.round(Q.t)));var Ze=L.select("."+g.cbtitleunshift).attr("transform",o(-Math.round(Q.l),-Math.round(Q.t))),we=hr.ticklabelposition,ke=hr.title.font.size,Be=L.select("."+g.cbaxis),He,nt=0,ot=0;function Ft(ir,ar){var Mr={propContainer:hr,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:j._dfltTitle.colorbar,containerGroup:L.select("."+g.cbtitle)},ma=ir.charAt(0)==="h"?ir.slice(1):"h"+ir;L.selectAll("."+ma+",."+ma+"-math-group").remove(),h.draw(F,ir,a(Mr,ar||{}))}function Mt(){if(N&&Or||!N&&!Or){var ir,ar;Te==="top"&&(ir=G+Q.l+We*ee,ar=Y+Q.t+Qe*(1-Ut-Ee)+3+ke*.75),Te==="bottom"&&(ir=G+Q.l+We*ee,ar=Y+Q.t+Qe*(1-Ut)-3-ke*.25),Te==="right"&&(ar=Y+Q.t+Qe*V+3+ke*.75,ir=G+Q.l+We*Ut),Ft(hr._id+"title",{attributes:{x:ir,y:ar,"text-anchor":N?"start":"middle"}})}}function Et(){if(N&&!Or||!N&&Or){var ir=hr.position||0,ar=hr._offset+hr._length/2,Mr,ma;if(Te==="right")ma=ar,Mr=Q.l+We*ir+10+ke*(hr.showticklabels?1:.5);else if(Mr=ar,Te==="bottom"&&(ma=Q.t+Qe*ir+10+(we.indexOf("inside")===-1?hr.tickfont.size:0)+(hr.ticks!=="inside"&&z.ticklen||0)),Te==="top"){var Ca=xe.text.split("
").length;ma=Q.t+Qe*ir+10-fe-w*ke*Ca}Ft((N?"h":"v")+hr._id+"title",{avoid:{selection:d.select(F).selectAll("g."+hr._id+"tick"),side:Te,offsetTop:N?0:Q.t,offsetLeft:N?Q.l:0,maxShift:N?j.width:j.height},attributes:{x:Mr,y:ma,"text-anchor":"middle"},transform:{rotate:N?-90:0,offset:0}})}}function Ot(){if(!N&&!Or||N&&Or){var ir=L.select("."+g.cbtitle),ar=ir.select("text"),Mr=[-X/2,X/2],ma=ir.select(".h"+hr._id+"title-math-group").node(),Ca=15.6;ar.node()&&(Ca=parseInt(ar.node().style.fontSize,10)*w);var Aa;if(ma?(Aa=n.bBox(ma),ot=Aa.width,nt=Aa.height,nt>Ca&&(Mr[1]-=(nt-Ca)/2)):ar.node()&&!ar.classed(g.jsPlaceholder)&&(Aa=n.bBox(ar.node()),ot=Aa.width,nt=Aa.height),N){if(nt){if(nt+=5,Te==="top")hr.domain[1]-=nt/Q.h,Mr[1]*=-1;else{hr.domain[0]+=nt/Q.h;var Da=f.lineCount(ar);Mr[1]+=(1-Da)*Ca}ir.attr("transform",o(Mr[0],Mr[1])),hr.setScale()}}else ot&&(Te==="right"&&(hr.domain[0]+=(ot+ke/2)/Q.w),ir.attr("transform",o(Mr[0],Mr[1])),hr.setScale())}L.selectAll("."+g.cbfills+",."+g.cblines).attr("transform",N?o(0,Math.round(Q.h*(1-hr.domain[1]))):o(Math.round(Q.w*hr.domain[0]),0)),Be.attr("transform",N?o(0,Math.round(-Q.t)):o(Math.round(-Q.l),0));var Ba=L.select("."+g.cbfills).selectAll("rect."+g.cbfill).attr("style","").data($e);Ba.enter().append("rect").classed(g.cbfill,!0).attr("style",""),Ba.exit().remove();var ba=Le.map(hr.c2p).map(Math.round).sort(function(Ht,Xt){return Ht-Xt});Ba.each(function(Ht,Xt){var Pr=[Xt===0?Le[0]:($e[Xt]+$e[Xt-1])/2,Xt===$e.length-1?Le[1]:($e[Xt]+$e[Xt+1])/2].map(hr.c2p).map(Math.round);N&&(Pr[1]=r.constrain(Pr[1]+(Pr[1]>Pr[0])?1:-1,ba[0],ba[1]));var Yr=d.select(this).attr(N?"x":"y",Xe).attr(N?"y":"x",d.min(Pr)).attr(N?"width":"height",Math.max(fe,2)).attr(N?"height":"width",Math.max(d.max(Pr)-d.min(Pr),2));if(z._fillgradient)n.gradient(Yr,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var Kr=qe(Ht).replace("e-","");Yr.attr("fill",x(Kr).toHexString())}});var rn=L.select("."+g.cblines).selectAll("path."+g.cbline).data(he.color&&he.width?Ue:[]);rn.enter().append("path").classed(g.cbline,!0),rn.exit().remove(),rn.each(function(Ht){var Xt=Xe,Pr=Math.round(hr.c2p(Ht))+he.width/2%1;d.select(this).attr("d","M"+(N?Xt+","+Pr:Pr+","+Xt)+(N?"h":"v")+fe).call(n.lineGroupStyle,he.width,Pe(Ht),he.dash)}),Be.selectAll("g."+hr._id+"tick,path").remove();var vn=Xe+fe+(X||0)/2-(z.ticks==="outside"?1:0),Wt=e.calcTicks(hr),Lt=e.getTickSigns(hr)[2];return e.drawTicks(F,hr,{vals:hr.ticks==="inside"?e.clipEnds(hr,Wt):Wt,layer:Be,path:e.makeTickPath(hr,vn,Lt),transFn:e.makeTransTickFn(hr)}),e.drawLabels(F,hr,{vals:Wt,layer:Be,transFn:e.makeTransTickLabelFn(hr),labelFns:e.makeLabelFns(hr,vn)})}function sr(){var ir,ar=fe+X/2;we.indexOf("inside")===-1&&(ir=n.bBox(Be.node()),ar+=N?ir.width:ir.height),He=Ze.select("text");var Mr=0,ma=N&&Te==="top",Ca=!N&&Te==="right",Aa=0;if(He.node()&&!He.classed(g.jsPlaceholder)){var Da,Ba=Ze.select(".h"+hr._id+"title-math-group").node();Ba&&(N&&Or||!N&&!Or)?(ir=n.bBox(Ba),Mr=ir.width,Da=ir.height):(ir=n.bBox(Ze.node()),Mr=ir.right-Q.l-(N?Xe:br),Da=ir.bottom-Q.t-(N?br:Xe),!N&&Te==="top"&&(ar+=ir.height,Aa=ir.height)),Ca&&(He.attr("transform",o(Mr/2+ke/2,0)),Mr*=2),ar=Math.max(ar,N?Mr:Da)}var ba=(N?G:Y)*2+ar+$+X/2,rn=0;!N&&xe.text&&ve==="bottom"&&V<=0&&(rn=ba/2,ba+=rn,Aa+=rn),j._hColorbarMoveTitle=rn,j._hColorbarMoveCBTitle=Aa;var vn=$+X,Wt=(N?Xe:br)-vn/2-(N?G:0),Lt=(N?br:Xe)-(N?ie:Y+Aa-rn);L.select("."+g.cbbg).attr("x",Wt).attr("y",Lt).attr(N?"width":"height",Math.max(ba-rn,2)).attr(N?"height":"width",Math.max(ie+vn,2)).call(s.fill,le).call(s.stroke,z.bordercolor).style("stroke-width",$);var Ht=Ca?Math.max(Mr-10,0):0;L.selectAll("."+g.cboutline).attr("x",(N?Xe:br+G)+Ht).attr("y",(N?br+Y-ie:Xe)+(ma?nt:0)).attr(N?"width":"height",Math.max(fe,2)).attr(N?"height":"width",Math.max(ie-(N?2*Y+nt:2*G+Ht),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":X});var Xt=N?Tt*ba:0,Pr=N?0:(1-St)*ba-Aa;if(Xt=ae?Q.l-Xt:-Xt,Pr=se?Q.t-Pr:-Pr,L.attr("transform",o(Xt,Pr)),!N&&($||x(le).getAlpha()&&!x.equals(j.paper_bgcolor,le))){var Yr=Be.selectAll("text"),Kr=Yr[0].length,na=L.select("."+g.cbbg).node(),La=n.bBox(na),Ga=n.getTranslate(L),Ua=2;Yr.each(function(Ar,pr){var kr=0,zr=Kr-1;if(pr===kr||pr===zr){var Ur=n.bBox(this),dt=n.getTranslate(this),qt;if(pr===zr){var fr=Ur.right+dt.x,Ir=La.right+Ga.x+br-$-Ua+ee;qt=Ir-fr,qt>0&&(qt=0)}else if(pr===kr){var da=Ur.left+dt.x,Ta=La.left+Ga.x+br+$+Ua;qt=Ta-da,qt<0&&(qt=0)}qt&&(Kr<3?this.setAttribute("transform","translate("+qt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Xa={},an=A[ce],Sa=M[ce],Zn=A[ve],Wn=M[ve],ti=ba-fe;N?(P==="pixels"?(Xa.y=V,Xa.t=ie*Zn,Xa.b=ie*Wn):(Xa.t=Xa.b=0,Xa.yt=V+O*Zn,Xa.yb=V-O*Wn),B==="pixels"?(Xa.x=ee,Xa.l=ba*an,Xa.r=ba*Sa):(Xa.l=ti*an,Xa.r=ti*Sa,Xa.xl=ee-U*an,Xa.xr=ee+U*Sa)):(P==="pixels"?(Xa.x=ee,Xa.l=ie*an,Xa.r=ie*Sa):(Xa.l=Xa.r=0,Xa.xl=ee+O*an,Xa.xr=ee-O*Sa),B==="pixels"?(Xa.y=1-V,Xa.t=ba*Zn,Xa.b=ba*Wn):(Xa.t=ti*Zn,Xa.b=ti*Wn,Xa.yt=V-U*Zn,Xa.yb=V+U*Wn));var gt=z.y<.5?"b":"t",it=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var Rr={r:j.width-Wt-Xt,l:Wt+Xa.r,b:j.height-Lt-Pr,t:Lt+Xa.b};ae&&se?S.autoMargin(F,z._id,Xa):ae?F._fullLayout._reservedMargin[z._id][gt]=Rr[gt]:se||N?F._fullLayout._reservedMargin[z._id][it]=Rr[it]:F._fullLayout._reservedMargin[z._id][gt]=Rr[gt]}return r.syncOrAsync([S.previousPromises,Mt,Ot,Et,S.previousPromises,sr],F)}function y(L,z,F){var N=z.orientation==="v",O=F._fullLayout,P=O._size,U,B,X;t.init({element:L.node(),gd:F,prepFn:function(){U=L.attr("transform"),i(L)},moveFn:function($,le){L.attr("transform",U+o($,le)),B=t.align((N?z._uFrac:z._vFrac)+$/P.w,N?z._thickFrac:z._lenFrac,0,1,z.xanchor),X=t.align((N?z._vFrac:1-z._uFrac)-le/P.h,N?z._lenFrac:z._thickFrac,0,1,z.yanchor);var ce=t.getCursor(B,X,z.xanchor,z.yanchor);i(L,ce)},doneFn:function(){if(i(L),B!==void 0&&X!==void 0){var $={};$[z._propPrefix+"x"]=B,$[z._propPrefix+"y"]=X,z._traceIndex!==void 0?E.call("_guiRestyle",F,$,z._traceIndex):E.call("_guiRelayout",F,$)}}})}function m(L,z,F){var N=z._levels,O=[],P=[],U,B,X=N.end+N.size/100,$=N.size,le=1.001*F[0]-.001*F[1],ce=1.001*F[1]-.001*F[0];for(B=0;B<1e5&&(U=N.start+B*$,!($>0?U>=X:U<=X));B++)U>le&&U0?U>=X:U<=X));B++)U>F[0]&&U-1}q.exports=function(o,a){var i,n=o.data,s=o.layout,h=E([],n),f=E({},s,e(a.tileClass)),p=o._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var c=Object.keys(f);for(i=0;i=0)return p}else if(typeof p=="string"&&(p=p.trim(),p.slice(-1)==="%"&&d(p.slice(0,-1))&&(p=+p.slice(0,-1),p>=0)))return p+"%"}function f(p,c,T,l,_,w){w=w||{};var A=w.moduleHasSelected!==!1,M=w.moduleHasUnselected!==!1,g=w.moduleHasConstrain!==!1,b=w.moduleHasCliponaxis!==!1,v=w.moduleHasTextangle!==!1,u=w.moduleHasInsideanchor!==!1,y=!!w.hasPathbar,m=Array.isArray(_)||_==="auto",R=m||_==="inside",L=m||_==="outside";if(R||L){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),N=p.textfont&&p.textfont.color,O=!N;if(O&&delete F.color,i(l,"insidetextfont",F),y){var P=x.extendFlat({},z);O&&delete P.color,i(l,"pathbar.textfont",P)}L&&i(l,"outsidetextfont",z),A&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),g&&l("constraintext"),b&&l("cliponaxis"),v&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}R&&u&&l("insidetextanchor")}q.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:f,validateCornerradius:h}}}),Qb=Ge({"src/traces/bar/layout_defaults.js"(Z,q){"use strict";var d=Yi(),x=Mo(),S=ta(),E=p1(),e=Uh().validateCornerradius;q.exports=function(t,r,o){function a(A,M){return S.coerce(t,r,E,A,M)}for(var i=!1,n=!1,s=!1,h={},f=a("barmode"),p=f==="group",c=0;c0&&!h[l]&&(s=!0),h[l]=!0),T.visible&&T.type==="histogram"){var _=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);_.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}f!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var w=a("barcornerradius");r.barcornerradius=e(w)}}}),tg=Ge({"src/traces/bar/arrays_to_calcdata.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:S.dflt},Z.coerceColor=function(S,E,e){return d(E).isValid()?E:e!==void 0?e:S.dflt},Z.coerceEnumerated=function(S,E,e){return S.coerceNumber&&(E=+E),S.values.indexOf(E)!==-1?E:e!==void 0?e:S.dflt},Z.getValue=function(S,E){var e;return x(S)?E1||y.bargap===0&&y.bargroupgap===0&&!m[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),v.selectAll("g.points").each(function(m){var R=d.select(this),L=m[0].trace;h(R,L,b)}),e.getComponentMethod("errorbars","style")(v)}function h(b,v,u){S.pointStyle(b.selectAll("path"),v,u),f(b,v,u)}function f(b,v,u){b.selectAll("text").each(function(y){var m=d.select(this),R=E.ensureUniformFontSize(u,l(m,y,v,u));S.font(m,R)})}function p(b,v,u){var y=v[0].trace;y.selectedpoints?c(u,y,b):(h(u,y,b),e.getComponentMethod("errorbars","style")(u))}function c(b,v,u){S.selectedPointStyle(b.selectAll("path"),v),T(b.selectAll("text"),v,u)}function T(b,v,u){b.each(function(y){var m=d.select(this),R;if(y.selected){R=E.ensureUniformFontSize(u,l(m,y,v,u));var L=v.selected.textfont&&v.selected.textfont.color;L&&(R.color=L),S.font(m,R)}else S.selectedTextStyle(m,v)})}function l(b,v,u,y){var m=y._fullLayout.font,R=u.textfont;if(b.classed("bartext-inside")){var L=g(v,u);R=w(u,v.i,m,L)}else b.classed("bartext-outside")&&(R=A(u,v.i,m));return R}function _(b,v,u){return M(o,b.textfont,v,u)}function w(b,v,u,y){var m=_(b,v,u),R=b._input.textfont===void 0||b._input.textfont.color===void 0||Array.isArray(b.textfont.color)&&b.textfont.color[v]===void 0;return R&&(m={color:x.contrast(y),family:m.family,size:m.size,weight:m.weight,style:m.style,variant:m.variant,textcase:m.textcase,lineposition:m.lineposition,shadow:m.shadow}),M(a,b.insidetextfont,v,m)}function A(b,v,u){var y=_(b,v,u);return M(i,b.outsidetextfont,v,y)}function M(b,v,u,y){v=v||{};var m=n.getValue(v.family,u),R=n.getValue(v.size,u),L=n.getValue(v.color,u),z=n.getValue(v.weight,u),F=n.getValue(v.style,u),N=n.getValue(v.variant,u),O=n.getValue(v.textcase,u),P=n.getValue(v.lineposition,u),U=n.getValue(v.shadow,u);return{family:n.coerceString(b.family,m,y.family),size:n.coerceNumber(b.size,R,y.size),color:n.coerceColor(b.color,L,y.color),weight:n.coerceString(b.weight,z,y.weight),style:n.coerceString(b.style,F,y.style),variant:n.coerceString(b.variant,N,y.variant),textcase:n.coerceString(b.variant,O,y.textcase),lineposition:n.coerceString(b.variant,P,y.lineposition),shadow:n.coerceString(b.variant,U,y.shadow)}}function g(b,v){return v.type==="waterfall"?v[b.dir].marker.color:b.mcc||b.mc||v.marker.color}q.exports={style:s,styleTextPoints:f,styleOnSelect:p,getInsideTextFont:w,getOutsideTextFont:A,getBarColor:g,resizeText:t}}}),Ip=Ge({"src/traces/bar/plot.js"(Z,q){"use strict";var d=Oi(),x=Bo(),S=ta(),E=Il(),e=Bi(),t=zo(),r=Yi(),o=Mo().tickText,a=lh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=$h(),h=g1(),f=Fd(),p=zv(),c=p.text,T=p.textposition,l=Sh().appendArrayPointValue,_=f.TEXTPAD;function w($){return $.id}function A($){if($.ids)return w}function M($){return($>0)-($<0)}function g($,le){return $0}function y($,le,ce,ve,G,Y){var ee=le.xaxis,V=le.yaxis,se=$._fullLayout,ae=$._context.staticPlot;G||(G={mode:se.barmode,norm:se.barmode,gap:se.bargap,groupgap:se.bargroupgap},n("bar",se));var j=S.makeTraceGroups(ve,ce,"trace bars").each(function(Q){var re=d.select(this),he=Q[0].trace,xe=Q[0].t,Te=he.type==="waterfall",Le=he.type==="funnel",Pe=he.type==="histogram",qe=he.type==="bar",et=qe||Le,rt=0;Te&&he.connector.visible&&he.connector.mode==="between"&&(rt=he.connector.line.width/2);var $e=he.orientation==="h",Ue=u(G),fe=S.ensureSingle(re,"g","points"),ue=A(he),ie=fe.selectAll("g.point").data(S.identity,ue);ie.enter().append("g").classed("point",!0),ie.exit().remove(),ie.each(function(We,Qe){var Xe=d.select(this),Tt=b(We,ee,V,$e),St=Tt[0][0],zt=Tt[0][1],Ut=Tt[1][0],br=Tt[1][1],hr=($e?zt-St:br-Ut)===0;hr&&et&&h.getLineWidth(he,We)&&(hr=!1),hr||(hr=!x(St)||!x(zt)||!x(Ut)||!x(br)),We.isBlank=hr,hr&&($e?zt=St:br=Ut),rt&&!hr&&($e?(St-=g(St,zt)*rt,zt+=g(St,zt)*rt):(Ut-=g(Ut,br)*rt,br+=g(Ut,br)*rt));var Or,wr;if(he.type==="waterfall"){if(!hr){var Er=he[We.dir].marker;Or=Er.line.width,wr=Er.color}}else Or=h.getLineWidth(he,We),wr=We.mc||he.marker.color;function mt(vn){var Wt=d.round(Or/2%1,2);return G.gap===0&&G.groupgap===0?d.round(Math.round(vn)-Wt,2):vn}function ze(vn,Wt,Lt){return Lt&&vn===Wt?vn:Math.abs(vn-Wt)>=2?mt(vn):vn>Wt?Math.ceil(vn):Math.floor(vn)}var Ze=e.opacity(wr),we=Ze<1||Or>.01?mt:ze;$._context.staticPlot||(St=we(St,zt,$e),zt=we(zt,St,$e),Ut=we(Ut,br,!$e),br=we(br,Ut,!$e));var ke=$e?ee.c2p:V.c2p,Be;We.s0>0?Be=We._sMax:We.s0<0?Be=We._sMin:Be=We.s1>0?We._sMax:We._sMin;function He(vn,Wt){if(!vn)return 0;var Lt=Math.abs($e?br-Ut:zt-St),Ht=Math.abs($e?zt-St:br-Ut),Xt=we(Math.abs(ke(Be,!0)-ke(0,!0))),Pr=We.hasB?Math.min(Lt/2,Ht/2):Math.min(Lt/2,Xt),Yr;if(Wt==="%"){var Kr=Math.min(50,vn);Yr=Lt*(Kr/100)}else Yr=vn;return we(Math.max(Math.min(Yr,Pr),0))}var nt=qe||Pe?He(xe.cornerradiusvalue,xe.cornerradiusform):0,ot,Ft,Mt="M"+St+","+Ut+"V"+br+"H"+zt+"V"+Ut+"Z",Et=0;if(nt&&We.s){var Ot=M(We.s0)===0||M(We.s)===M(We.s0)?We.s1:We.s0;if(Et=we(We.hasB?0:Math.abs(ke(Be,!0)-ke(Ot,!0))),Et0?Math.sqrt(Et*(2*nt-Et)):0,Ca=sr>0?Math.max:Math.min;ot="M"+St+","+Ut+"V"+(br-Mr*ir)+"H"+Ca(zt-(nt-Et)*sr,St)+"A "+nt+","+nt+" 0 0 "+ar+" "+zt+","+(br-nt*ir-ma)+"V"+(Ut+nt*ir+ma)+"A "+nt+","+nt+" 0 0 "+ar+" "+Ca(zt-(nt-Et)*sr,St)+","+(Ut+Mr*ir)+"Z"}else if(We.hasB)ot="M"+(St+nt*sr)+","+Ut+"A "+nt+","+nt+" 0 0 "+ar+" "+St+","+(Ut+nt*ir)+"V"+(br-nt*ir)+"A "+nt+","+nt+" 0 0 "+ar+" "+(St+nt*sr)+","+br+"H"+(zt-nt*sr)+"A "+nt+","+nt+" 0 0 "+ar+" "+zt+","+(br-nt*ir)+"V"+(Ut+nt*ir)+"A "+nt+","+nt+" 0 0 "+ar+" "+(zt-nt*sr)+","+Ut+"Z";else{Ft=Math.abs(br-Ut)+Et;var Aa=Ft0?Math.sqrt(Et*(2*nt-Et)):0,Ba=ir>0?Math.max:Math.min;ot="M"+(St+Aa*sr)+","+Ut+"V"+Ba(br-(nt-Et)*ir,Ut)+"A "+nt+","+nt+" 0 0 "+ar+" "+(St+nt*sr-Da)+","+br+"H"+(zt-nt*sr+Da)+"A "+nt+","+nt+" 0 0 "+ar+" "+(zt-Aa*sr)+","+Ba(br-(nt-Et)*ir,Ut)+"V"+Ut+"Z"}}else ot=Mt}else ot=Mt;var ba=v(S.ensureSingle(Xe,"path"),se,G,Y);if(ba.style("vector-effect",ae?"none":"non-scaling-stroke").attr("d",isNaN((zt-St)*(br-Ut))||hr&&$._context.staticPlot?"M0,0Z":ot).call(t.setClipUrl,le.layerClipId,$),!se.uniformtext.mode&&Ue){var rn=t.makePointStyleFns(he);t.singlePointStyle(We,ba,he,rn,$)}m($,le,Xe,Q,Qe,St,zt,Ut,br,nt,Et,G,Y),le.layerClipId&&t.hideOutsideRangePoint(We,Xe.select("text"),ee,V,he.xcalendar,he.ycalendar)});var Ee=he.cliponaxis===!1;t.setClipUrl(re,Ee?null:le.layerClipId,$)});r.getComponentMethod("errorbars","plot")($,j,le,G)}function m($,le,ce,ve,G,Y,ee,V,se,ae,j,Q,re){var he=le.xaxis,xe=le.yaxis,Te=$._fullLayout,Le;function Pe(Ft,Mt,Et){var Ot=S.ensureSingle(Ft,"text").text(Mt).attr({class:"bartext bartext-"+Le,"text-anchor":"middle","data-notex":1}).call(t.font,Et).call(E.convertToTspans,$);return Ot}var qe=ve[0].trace,et=qe.orientation==="h",rt=P(Te,ve,G,he,xe);Le=U(qe,G);var $e=Q.mode==="stack"||Q.mode==="relative",Ue=ve[G],fe=!$e||Ue._outmost,ue=Ue.hasB,ie=ae&&ae-j>_;if(!rt||Le==="none"||(Ue.isBlank||Y===ee||V===se)&&(Le==="auto"||Le==="inside")){ce.select("text").remove();return}var Ee=Te.font,We=s.getBarColor(ve[G],qe),Qe=s.getInsideTextFont(qe,G,Ee,We),Xe=s.getOutsideTextFont(qe,G,Ee),Tt=qe.insidetextanchor||"end",St=ce.datum();et?he.type==="log"&&St.s0<=0&&(he.range[0]0&&mt>0,we;ie?ue?we=R(br-2*ae,hr,Er,mt,et)||R(br,hr-2*ae,Er,mt,et):et?we=R(br-(ae-j),hr,Er,mt,et)||R(br,hr-2*(ae-j),Er,mt,et):we=R(br,hr-(ae-j),Er,mt,et)||R(br-2*(ae-j),hr,Er,mt,et):we=R(br,hr,Er,mt,et),Ze&&we?Le="inside":(Le="outside",Or.remove(),Or=null)}else Le="inside";if(!Or){ze=S.ensureUniformFontSize($,Le==="outside"?Xe:Qe),Or=Pe(ce,rt,ze);var ke=Or.attr("transform");if(Or.attr("transform",""),wr=t.bBox(Or.node()),Er=wr.width,mt=wr.height,Or.attr("transform",ke),Er<=0||mt<=0){Or.remove();return}}var Be=qe.textangle,He,nt;Le==="outside"?(nt=qe.constraintext==="both"||qe.constraintext==="outside",He=O(Y,ee,V,se,wr,{isHorizontal:et,constrained:nt,angle:Be})):(nt=qe.constraintext==="both"||qe.constraintext==="inside",He=F(Y,ee,V,se,wr,{isHorizontal:et,constrained:nt,angle:Be,anchor:Tt,hasB:ue,r:ae,overhead:j})),He.fontSize=ze.size,i(qe.type==="histogram"?"bar":qe.type,He,Te),Ue.transform=He;var ot=v(Or,Te,Q,re);S.setTransormAndDisplay(ot,He)}function R($,le,ce,ve,G){if($<0||le<0)return!1;var Y=ce<=$&&ve<=le,ee=ce<=le&&ve<=$,V=G?$>=ce*(le/ve):le>=ve*($/ce);return Y||ee||V}function L($){return $==="auto"?0:$}function z($,le){var ce=Math.PI/180*le,ve=Math.abs(Math.sin(ce)),G=Math.abs(Math.cos(ce));return{x:$.width*G+$.height*ve,y:$.width*ve+$.height*G}}function F($,le,ce,ve,G,Y){var ee=!!Y.isHorizontal,V=!!Y.constrained,se=Y.angle||0,ae=Y.anchor,j=ae==="end",Q=ae==="start",re=Y.leftToRight||0,he=(re+1)/2,xe=1-he,Te=Y.hasB,Le=Y.r,Pe=Y.overhead,qe=G.width,et=G.height,rt=Math.abs(le-$),$e=Math.abs(ve-ce),Ue=rt>2*_&&$e>2*_?_:0;rt-=2*Ue,$e-=2*Ue;var fe=L(se);se==="auto"&&!(qe<=rt&&et<=$e)&&(qe>rt||et>$e)&&(!(qe>$e||et>rt)||qe_){var We=N($,le,ce,ve,ue,Le,Pe,ee,Te);ie=We.scale,Ee=We.pad}else ie=1,V&&(ie=Math.min(1,rt/ue.x,$e/ue.y)),Ee=0;var Qe=G.left*xe+G.right*he,Xe=(G.top+G.bottom)/2,Tt=($+_)*xe+(le-_)*he,St=(ce+ve)/2,zt=0,Ut=0;if(Q||j){var br=(ee?ue.x:ue.y)/2;Le&&(j||Te)&&(Ue+=Ee);var hr=ee?g($,le):g(ce,ve);ee?Q?(Tt=$+hr*Ue,zt=-hr*br):(Tt=le-hr*Ue,zt=hr*br):Q?(St=ce+hr*Ue,Ut=-hr*br):(St=ve-hr*Ue,Ut=hr*br)}return{textX:Qe,textY:Xe,targetX:Tt,targetY:St,anchorX:zt,anchorY:Ut,scale:ie,rotate:fe}}function N($,le,ce,ve,G,Y,ee,V,se){var ae=Math.max(0,Math.abs(le-$)-2*_),j=Math.max(0,Math.abs(ve-ce)-2*_),Q=Y-_,re=ee?Q-Math.sqrt(Q*Q-(Q-ee)*(Q-ee)):Q,he=se?Q*2:V?Q-ee:2*re,xe=se?Q*2:V?2*re:Q-ee,Te,Le,Pe,qe,et;return G.y/G.x>=j/(ae-he)?qe=j/G.y:G.y/G.x<=(j-xe)/ae?qe=ae/G.x:!se&&V?(Te=G.x*G.x+G.y*G.y/4,Le=-2*G.x*(ae-Q)-G.y*(j/2-Q),Pe=(ae-Q)*(ae-Q)+(j/2-Q)*(j/2-Q)-Q*Q,qe=(-Le+Math.sqrt(Le*Le-4*Te*Pe))/(2*Te)):se?(Te=(G.x*G.x+G.y*G.y)/4,Le=-G.x*(ae/2-Q)-G.y*(j/2-Q),Pe=(ae/2-Q)*(ae/2-Q)+(j/2-Q)*(j/2-Q)-Q*Q,qe=(-Le+Math.sqrt(Le*Le-4*Te*Pe))/(2*Te)):(Te=G.x*G.x/4+G.y*G.y,Le=-G.x*(ae/2-Q)-2*G.y*(j-Q),Pe=(ae/2-Q)*(ae/2-Q)+(j-Q)*(j-Q)-Q*Q,qe=(-Le+Math.sqrt(Le*Le-4*Te*Pe))/(2*Te)),qe=Math.min(1,qe),V?et=Math.max(0,Q-Math.sqrt(Math.max(0,Q*Q-(Q-(j-G.y*qe)/2)*(Q-(j-G.y*qe)/2)))-ee):et=Math.max(0,Q-Math.sqrt(Math.max(0,Q*Q-(Q-(ae-G.x*qe)/2)*(Q-(ae-G.x*qe)/2)))-ee),{scale:qe,pad:et}}function O($,le,ce,ve,G,Y){var ee=!!Y.isHorizontal,V=!!Y.constrained,se=Y.angle||0,ae=G.width,j=G.height,Q=Math.abs(le-$),re=Math.abs(ve-ce),he;ee?he=re>2*_?_:0:he=Q>2*_?_:0;var xe=1;V&&(xe=ee?Math.min(1,re/j):Math.min(1,Q/ae));var Te=L(se),Le=z(G,Te),Pe=(ee?Le.x:Le.y)/2,qe=(G.left+G.right)/2,et=(G.top+G.bottom)/2,rt=($+le)/2,$e=(ce+ve)/2,Ue=0,fe=0,ue=ee?g(le,$):g(ce,ve);return ee?(rt=le-ue*he,Ue=ue*Pe):($e=ve+ue*he,fe=-ue*Pe),{textX:qe,textY:et,targetX:rt,targetY:$e,anchorX:Ue,anchorY:fe,scale:xe,rotate:Te}}function P($,le,ce,ve,G){var Y=le[0].trace,ee=Y.texttemplate,V;return ee?V=B($,le,ce,ve,G):Y.textinfo?V=X(le,ce,ve,G):V=h.getValue(Y.text,ce),h.coerceString(c,V)}function U($,le){var ce=h.getValue($.textposition,le);return h.coerceEnumerated(T,ce)}function B($,le,ce,ve,G){var Y=le[0].trace,ee=S.castOption(Y,ce,"texttemplate");if(!ee)return"";var V=Y.type==="histogram",se=Y.type==="waterfall",ae=Y.type==="funnel",j=Y.orientation==="h",Q,re,he,xe;j?(Q="y",re=G,he="x",xe=ve):(Q="x",re=ve,he="y",xe=G);function Te(Ue){return o(re,re.c2l(Ue),!0).text}function Le(Ue){return o(xe,xe.c2l(Ue),!0).text}var Pe=le[ce],qe={};qe.label=Pe.p,qe.labelLabel=qe[Q+"Label"]=Te(Pe.p);var et=S.castOption(Y,Pe.i,"text");(et===0||et)&&(qe.text=et),qe.value=Pe.s,qe.valueLabel=qe[he+"Label"]=Le(Pe.s);var rt={};l(rt,Y,Pe.i),(V||rt.x===void 0)&&(rt.x=j?qe.value:qe.label),(V||rt.y===void 0)&&(rt.y=j?qe.label:qe.value),(V||rt.xLabel===void 0)&&(rt.xLabel=j?qe.valueLabel:qe.labelLabel),(V||rt.yLabel===void 0)&&(rt.yLabel=j?qe.labelLabel:qe.valueLabel),se&&(qe.delta=+Pe.rawS||Pe.s,qe.deltaLabel=Le(qe.delta),qe.final=Pe.v,qe.finalLabel=Le(qe.final),qe.initial=qe.final-qe.delta,qe.initialLabel=Le(qe.initial)),ae&&(qe.value=Pe.s,qe.valueLabel=Le(qe.value),qe.percentInitial=Pe.begR,qe.percentInitialLabel=S.formatPercent(Pe.begR),qe.percentPrevious=Pe.difR,qe.percentPreviousLabel=S.formatPercent(Pe.difR),qe.percentTotal=Pe.sumR,qe.percenTotalLabel=S.formatPercent(Pe.sumR));var $e=S.castOption(Y,Pe.i,"customdata");return $e&&(qe.customdata=$e),S.texttemplateString({data:[rt,qe,Y._meta],fallback:Y.texttemplatefallback,labels:qe,locale:$._d3locale,template:ee})}function X($,le,ce,ve){var G=$[0].trace,Y=G.orientation==="h",ee=G.type==="waterfall",V=G.type==="funnel";function se($e){var Ue=Y?ve:ce;return o(Ue,$e,!0).text}function ae($e){var Ue=Y?ce:ve;return o(Ue,+$e,!0).text}var j=G.textinfo,Q=$[le],re=j.split("+"),he=[],xe,Te=function($e){return re.indexOf($e)!==-1};if(Te("label")&&he.push(se($[le].p)),Te("text")&&(xe=S.castOption(G,Q.i,"text"),(xe===0||xe)&&he.push(xe)),ee){var Le=+Q.rawS||Q.s,Pe=Q.v,qe=Pe-Le;Te("initial")&&he.push(ae(qe)),Te("delta")&&he.push(ae(Le)),Te("final")&&he.push(ae(Pe))}if(V){Te("value")&&he.push(ae(Q.s));var et=0;Te("percent initial")&&et++,Te("percent previous")&&et++,Te("percent total")&&et++;var rt=et>1;Te("percent initial")&&(xe=S.formatPercent(Q.begR),rt&&(xe+=" of initial"),he.push(xe)),Te("percent previous")&&(xe=S.formatPercent(Q.difR),rt&&(xe+=" of previous"),he.push(xe)),Te("percent total")&&(xe=S.formatPercent(Q.sumR),rt&&(xe+=" of total"),he.push(xe))}return he.join("
")}q.exports={plot:y,toMoveInsideBar:F}}}),G0=Ge({"src/traces/bar/hover.js"(Z,q){"use strict";var d=mc(),x=Yi(),S=Bi(),E=ta().fillText,e=g1().getLineWidth,t=Mo().hoverLabelText,r=As().BADNUM;function o(n,s,h,f,p){var c=a(n,s,h,f,p);if(c){var T=c.cd,l=T[0].trace,_=T[c.index];return c.color=i(l,_),x.getComponentMethod("errorbars","hoverInfo")(_,l,c),[c]}}function a(n,s,h,f,p){var c=n.cd,T=c[0].trace,l=c[0].t,_=f==="closest",w=T.type==="waterfall",A=n.maxHoverDistance,M=n.maxSpikeDistance,g,b,v,u,y,m,R;T.orientation==="h"?(g=h,b=s,v="y",u="x",y=ve,m=$):(g=s,b=h,v="x",u="y",m=ve,y=$);var L=T[v+"period"],z=_||L;function F(xe){return O(xe,-1)}function N(xe){return O(xe,1)}function O(xe,Te){var Le=xe.w;return xe[v]+Te*Le/2}function P(xe){return xe[v+"End"]-xe[v+"Start"]}var U=_?F:L?function(xe){return xe.p-P(xe)/2}:function(xe){return Math.min(F(xe),xe.p-l.bardelta/2)},B=_?N:L?function(xe){return xe.p+P(xe)/2}:function(xe){return Math.max(N(xe),xe.p+l.bardelta/2)};function X(xe,Te,Le){return p.finiteRange&&(Le=0),d.inbox(xe-g,Te-g,Le+Math.min(1,Math.abs(Te-xe)/R)-1)}function $(xe){return X(U(xe),B(xe),A)}function le(xe){return X(F(xe),N(xe),M)}function ce(xe){var Te=xe[u];if(w){var Le=Math.abs(xe.rawS)||0;b>0?Te+=Le:b<0&&(Te-=Le)}return Te}function ve(xe){var Te=b,Le=xe.b,Pe=ce(xe);return d.inbox(Le-Te,Pe-Te,A+(Pe-Te)/(Pe-Le)-1)}function G(xe){var Te=b,Le=xe.b,Pe=ce(xe);return d.inbox(Le-Te,Pe-Te,M+(Pe-Te)/(Pe-Le)-1)}var Y=n[v+"a"],ee=n[u+"a"];R=Math.abs(Y.r2c(Y.range[1])-Y.r2c(Y.range[0]));function V(xe){return(y(xe)+m(xe))/2}var se=d.getDistanceFunction(f,y,m,V);if(d.getClosest(c,se,n),n.index!==!1&&c[n.index].p!==r){z||(U=function(xe){return Math.min(F(xe),xe.p-l.bargroupwidth/2)},B=function(xe){return Math.max(N(xe),xe.p+l.bargroupwidth/2)});var ae=n.index,j=c[ae],Q=T.base?j.b+j.s:j.s;n[u+"0"]=n[u+"1"]=ee.c2p(j[u],!0),n[u+"LabelVal"]=Q;var re=l.extents[l.extents.round(j.p)];n[v+"0"]=Y.c2p(_?U(j):re[0],!0),n[v+"1"]=Y.c2p(_?B(j):re[1],!0);var he=j.orig_p!==void 0;return n[v+"LabelVal"]=he?j.orig_p:j.p,n.labelLabel=t(Y,n[v+"LabelVal"],T[v+"hoverformat"]),n.valueLabel=t(ee,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t(ee,j.b,T[u+"hoverformat"]),n.spikeDistance=(G(j)+le(j))/2,n[v+"Spike"]=Y.c2p(j.p,!0),E(j,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var h=s.mcc||n.marker.color,f=s.mlcc||n.marker.line.color,p=e(n,s);if(S.opacity(h))return h;if(S.opacity(f)&&p)return f}q.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),NM=Ge({"src/traces/bar/event_data.js"(Z,q){"use strict";q.exports=function(x,S,E){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),E.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),H0=Ge({"src/traces/bar/select.js"(Z,q){"use strict";q.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(E===!1)for(s=0;s0?(L="v",v>0?z=Math.min(y,u):z=Math.min(u)):v>0?(L="h",z=Math.min(y)):z=0;if(!z){h.visible=!1;return}h._length=z;var U=f("orientation",L);h._hasPreCompStats?U==="v"&&v===0?(f("x0",0),f("dx",1)):U==="h"&&b===0&&(f("y0",0),f("dy",1)):U==="v"&&v===0?f("x0"):U==="h"&&b===0&&f("y0");var B=x.getComponentMethod("calendars","handleTraceDefaults");B(s,h,["x","y"],p)}function i(s,h,f,p){var c=p.prefix,T=d.coerce2(s,h,r,"marker.outliercolor"),l=f("marker.line.outliercolor"),_="outliers";h._hasPreCompStats?_="all":(T||l)&&(_="suspectedoutliers");var w=f(c+"points",_);w?(f("jitter",w==="all"?.3:0),f("pointpos",w==="all"?-1.5:0),f("marker.symbol"),f("marker.opacity"),f("marker.size"),f("marker.angle"),f("marker.color",h.line.color),f("marker.line.color"),f("marker.line.width"),w==="suspectedoutliers"&&(f("marker.line.outliercolor",h.marker.color),f("marker.line.outlierwidth")),f("selected.marker.color"),f("unselected.marker.color"),f("selected.marker.size"),f("unselected.marker.size"),f("text"),f("hovertext")):delete h.marker;var A=f("hoveron");(A==="all"||A.indexOf("points")!==-1)&&(f("hovertemplate"),f("hovertemplatefallback")),d.coerceSelectionMarkerOpacity(h,f)}function n(s,h){var f,p;function c(w){return d.coerce(p._input,p,r,w)}for(var T=0;Tce.uf};if(M._hasPreCompStats){var ae=M[z],j=function(hr){return L.d2c((M[hr]||[])[m])},Q=1/0,re=-1/0;for(m=0;m=ce.q1&&ce.q3>=ce.med){var xe=j("lowerfence");ce.lf=xe!==e&&xe<=ce.q1?xe:p(ce,G,Y);var Te=j("upperfence");ce.uf=Te!==e&&Te>=ce.q3?Te:c(ce,G,Y);var Le=j("mean");ce.mean=Le!==e?Le:Y?E.mean(G,Y):(ce.q1+ce.q3)/2;var Pe=j("sd");ce.sd=Le!==e&&Pe>=0?Pe:Y?E.stdev(G,Y,ce.mean):ce.q3-ce.q1,ce.lo=T(ce),ce.uo=l(ce);var qe=j("notchspan");qe=qe!==e&&qe>0?qe:_(ce,Y),ce.ln=ce.med-qe,ce.un=ce.med+qe;var et=ce.lf,rt=ce.uf;M.boxpoints&&G.length&&(et=Math.min(et,G[0]),rt=Math.max(rt,G[Y-1])),M.notched&&(et=Math.min(et,ce.ln),rt=Math.max(rt,ce.un)),ce.min=et,ce.max=rt}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+ce.q1,"median = "+ce.med,"q3 = "+ce.q3].join(` +`));var $e;ce.med!==e?$e=ce.med:ce.q1!==e?ce.q3!==e?$e=(ce.q1+ce.q3)/2:$e=ce.q1:ce.q3!==e?$e=ce.q3:$e=0,ce.med=$e,ce.q1=ce.q3=$e,ce.lf=ce.uf=$e,ce.mean=ce.sd=$e,ce.ln=ce.un=$e,ce.min=ce.max=$e}Q=Math.min(Q,ce.min),re=Math.max(re,ce.max),ce.pts2=ve.filter(se),u.push(ce)}}M._extremes[L._id]=x.findExtremes(L,[Q,re],{padded:!0})}else{var Ue=L.makeCalcdata(M,z),fe=o($,le),ue=$.length,ie=a(ue);for(m=0;m=0&&Ee0){if(ce={},ce.pos=ce[N]=$[m],ve=ce.pts=ie[m].sort(h),G=ce[z]=ve.map(f),Y=G.length,ce.min=G[0],ce.max=G[Y-1],ce.mean=E.mean(G,Y),ce.sd=E.stdev(G,Y,ce.mean)*M.sdmultiple,ce.med=E.interp(G,.5),Y%2&&(Tt||St)){var zt,Ut;Tt?(zt=G.slice(0,Y/2),Ut=G.slice(Y/2+1)):St&&(zt=G.slice(0,Y/2+1),Ut=G.slice(Y/2)),ce.q1=E.interp(zt,.5),ce.q3=E.interp(Ut,.5)}else ce.q1=E.interp(G,.25),ce.q3=E.interp(G,.75);ce.lf=p(ce,G,Y),ce.uf=c(ce,G,Y),ce.lo=T(ce),ce.uo=l(ce);var br=_(ce,Y);ce.ln=ce.med-br,ce.un=ce.med+br,We=Math.min(We,ce.ln),Qe=Math.max(Qe,ce.un),ce.pts2=ve.filter(se),u.push(ce)}M.notched&&E.isTypedArray(Ue)&&(Ue=Array.from(Ue)),M._extremes[L._id]=x.findExtremes(L,M.notched?Ue.concat([We,Qe]):Ue,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:g[y],dPos:le,posLetter:N,valLetter:z,labels:{med:t(A,"median:"),min:t(A,"min:"),q1:t(A,"q1:"),q3:t(A,"q3:"),max:t(A,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(A,"mean \xB1 \u03C3:").replace("\u03C3",M.sdmultiple===1?"\u03C3":M.sdmultiple+"\u03C3"):t(A,"mean:"),lf:t(A,"lower fence:"),uf:t(A,"upper fence:")}},g[y]++,u):[{t:{empty:!0}}]};function r(w,A,M,g){var b=A in w,v=A+"0"in w,u="d"+A in w;if(b||v&&u){var y=M.makeCalcdata(w,A),m=S(w,M,A,y).vals;return[m,y]}var R;v?R=w[A+"0"]:"name"in w&&(M.type==="category"||d(w.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(w.name)&&M.type==="date")?R=w.name:R=g;for(var L=M.type==="multicategory"?M.r2c_just_indices(R):M.d2c(R,0,w[A+"calendar"]),z=w._length,F=new Array(z),N=0;N1,v=1-s[r+"gap"],u=1-s[r+"groupgap"];for(p=0;p0;if(L==="positive"?(ce=z*(R?1:.5),Y=G,ve=Y=N):L==="negative"?(ce=Y=N,ve=z*(R?1:.5),ee=G):(ce=ve=z,Y=ee=G),re){var he=y.pointpos,xe=y.jitter,Te=y.marker.size/2,Le=0;he+xe>=0&&(Le=G*(he+xe),Le>ce?(Q=!0,ae=Te,V=Le):Le>Y&&(ae=Te,V=ce)),Le<=ce&&(V=ce);var Pe=0;he-xe<=0&&(Pe=-G*(he-xe),Pe>ve?(Q=!0,j=Te,se=Pe):Pe>ee&&(j=Te,se=ve)),Pe<=ve&&(se=ve)}else V=ce,se=ve;var qe=new Array(T.length);for(c=0;cM.lo&&(U.so=!0)}return b});A.enter().append("path").classed("point",!0),A.exit().remove(),A.call(S.translatePoints,f,p)}function a(i,n,s,h){var f=n.val,p=n.pos,c=!!p.rangebreaks,T=h.bPos,l=h.bPosPxOffset||0,_=s.boxmean||(s.meanline||{}).visible,w,A;Array.isArray(h.bdPos)?(w=h.bdPos[0],A=h.bdPos[1]):(w=h.bdPos,A=h.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(g){var b=p.c2l(g.pos+T,!0),v=p.l2p(b-w)+l,u=p.l2p(b+A)+l,y=c?(v+u)/2:p.l2p(b)+l,m=f.c2p(g.mean,!0),R=f.c2p(g.mean-g.sd,!0),L=f.c2p(g.mean+g.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+m+","+v+"V"+u+(_==="sd"?"m0,0L"+R+","+y+"L"+m+","+v+"L"+L+","+y+"Z":"")):d.select(this).attr("d","M"+v+","+m+"H"+u+(_==="sd"?"m0,0L"+y+","+R+"L"+v+","+m+"L"+y+","+L+"Z":""))})}q.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),b1=Ge({"src/traces/box/style.js"(Z,q){"use strict";var d=Oi(),x=Bi(),S=zo();function E(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,h=s.line.width;function f(T,l,_,w){T.style("stroke-width",l+"px").call(x.stroke,_).call(x.fill,w)}var p=n.selectAll("path.box");if(s.type==="candlestick")p.each(function(T){if(!T.empty){var l=d.select(this),_=s[T.dir];f(l,_.line.width,_.line.color,_.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{f(p,h,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":h,"stroke-dasharray":2*h+"px,"+h+"px"}).call(x.stroke,s.line.color);var c=n.selectAll("path.point");S.pointStyle(c,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?S.selectedPointStyle(i,a):S.pointStyle(i,a,t)}q.exports={style:E,styleOnSelect:e}}}),tw=Ge({"src/traces/box/hover.js"(Z,q){"use strict";var d=Mo(),x=ta(),S=mc(),E=Bi(),e=x.fillText;function t(a,i,n,s){var h=a.cd,f=h[0].trace,p=f.hoveron,c=[],T;return p.indexOf("boxes")!==-1&&(c=c.concat(r(a,i,n,s))),p.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:c:(T&&c.push(T),c)}function r(a,i,n,s){var h=a.cd,f=a.xa,p=a.ya,c=h[0].trace,T=h[0].t,l=c.type==="violin",_,w,A,M,g,b,v,u,y,m,R,L=T.bdPos,z,F,N=T.wHover,O=function(Pe){return A.c2l(Pe.pos)+T.bPos-A.c2l(b)};l&&c.side!=="both"?(c.side==="positive"&&(y=function(Pe){var qe=O(Pe);return S.inbox(qe,qe+N,m)},z=L,F=0),c.side==="negative"&&(y=function(Pe){var qe=O(Pe);return S.inbox(qe-N,qe,m)},z=0,F=L)):(y=function(Pe){var qe=O(Pe);return S.inbox(qe-N,qe+N,m)},z=F=L);var P;l?P=function(Pe){return S.inbox(Pe.span[0]-g,Pe.span[1]-g,m)}:P=function(Pe){return S.inbox(Pe.min-g,Pe.max-g,m)},c.orientation==="h"?(g=i,b=n,v=P,u=y,_="y",A=p,w="x",M=f):(g=n,b=i,v=y,u=P,_="x",A=f,w="y",M=p);var U=Math.min(1,L/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));m=a.maxHoverDistance-U,R=a.maxSpikeDistance-U;function B(Pe){return(v(Pe)+u(Pe))/2}var X=S.getDistanceFunction(s,v,u,B);if(S.getClosest(h,X,a),a.index===!1)return[];var $=h[a.index],le=c.line.color,ce=(c.marker||{}).color;E.opacity(le)&&c.line.width?a.color=le:E.opacity(ce)&&c.boxpoints?a.color=ce:a.color=c.fillcolor,a[_+"0"]=A.c2p($.pos+T.bPos-F,!0),a[_+"1"]=A.c2p($.pos+T.bPos+z,!0),a[_+"LabelVal"]=$.orig_p!==void 0?$.orig_p:$.pos;var ve=_+"Spike";a.spikeDistance=B($)*R/m,a[ve]=A.c2p($.pos,!0);var G=c.boxmean||c.sizemode==="sd"||(c.meanline||{}).visible,Y=c.boxpoints||c.points,ee=Y&&G?["max","uf","q3","med","mean","q1","lf","min"]:Y&&!G?["max","uf","q3","med","q1","lf","min"]:!Y&&G?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],V=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[x];return E[x]=t,r}}else return E[x]=t,t;return 0},max:function(x,S,E,e){var t=e[S];if(d(t))if(t=Number(t),d(E[x])){if(E[x]v&&vE){var m=u===x?1:6,R=u===x?"M12":"M1";return function(L,z){var F=T.c2d(L,x,l),N=F.indexOf("-",m);N>0&&(F=F.slice(0,N));var O=T.d2c(F,0,l);if(Or?h>E?h>x*1.1?x:h>S*1.1?S:E:h>e?e:h>t?t:r:Math.pow(10,Math.floor(Math.log(h)/Math.LN10))}function n(h,f,p,c,T,l){if(c&&h>E){var _=s(f,T,l),w=s(p,T,l),A=h===x?0:1;return _[A]!==w[A]}return Math.floor(p/h)-Math.floor(f/h)>.1}function s(h,f,p){var c=f.c2d(h,x,p).split("-");return c[0]===""&&(c.unshift(),c[0]="-"+c[0]),c}}}),lw=Ge({"src/traces/histogram/calc.js"(Z,q){"use strict";var d=Bo(),x=ta(),S=Yi(),E=Mo(),{hasColorscale:e}=ih(),t=oh(),r=tg(),o=nw(),a=iw(),i=ow(),n=sw();function s(T,l){var _=[],w=[],A=l.orientation==="h",M=E.getFromId(T,A?l.yaxis:l.xaxis),g=A?"y":"x",b={x:"y",y:"x"}[g],v=l[g+"calendar"],u=l.cumulative,y,m=h(T,l,M,g),R=m[0],L=m[1],z=typeof R.size=="string",F=[],N=z?F:R,O=[],P=[],U=[],B=0,X=l.histnorm,$=l.histfunc,le=X.indexOf("density")!==-1,ce,ve,G;u.enabled&&le&&(X=X.replace(/ ?density$/,""),le=!1);var Y=$==="max"||$==="min",ee=Y?null:0,V=o.count,se=a[X],ae=!1,j=function(Ee){return M.r2c(Ee,0,v)},Q;for(x.isArrayOrTypedArray(l[b])&&$!=="count"&&(Q=l[b],ae=$==="avg",V=o[$]),y=j(R.start),ve=j(R.end)+(y-E.tickIncrement(y,R.size,!1,v))/1e6;y=0&&G=fe;y--)if(w[y]){ue=y;break}for(y=fe;y<=ue;y++)if(d(_[y])&&d(w[y])){var ie={p:_[y],s:w[y],b:0};u.enabled||(ie.pts=U[y],Te?ie.ph0=ie.ph1=U[y].length?L[U[y][0]]:_[y]:(l._computePh=!0,ie.ph0=rt(F[y]),ie.ph1=rt(F[y+1],!0))),Ue.push(ie)}return Ue.length===1&&(Ue[0].width1=E.tickIncrement(Ue[0].p,R.size,!1,v)-Ue[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(Ue,l),x.isArrayOrTypedArray(l.selectedpoints)&&x.tagSelected(Ue,l,qe),Ue}function h(T,l,_,w,A){var M=w+"bins",g=T._fullLayout,b=l["_"+w+"bingroup"],v=g._histogramBinOpts[b],u=g.barmode==="overlay",y,m,R,L,z,F,N,O=function(et){return _.r2c(et,0,L)},P=function(et){return _.c2r(et,0,L)},U=_.type==="date"?function(et){return et||et===0?x.cleanDate(et,null,L):null}:function(et){return d(et)?Number(et):null};function B(et,rt,$e){rt[et+"Found"]?(rt[et]=U(rt[et]),rt[et]===null&&(rt[et]=$e[et])):(F[et]=rt[et]=$e[et],x.nestedProperty(m[0],M+"."+et).set($e[et]))}if(l["_"+w+"autoBinFinished"])delete l["_"+w+"autoBinFinished"];else{m=v.traces;var X=[],$=!0,le=!1,ce=!1;for(y=0;y"u"){if(A)return[G,z,!0];G=f(T,l,_,w,M)}N=R.cumulative||{},N.enabled&&N.currentbin!=="include"&&(N.direction==="decreasing"?G.start=P(E.tickIncrement(O(G.start),G.size,!0,L)):G.end=P(E.tickIncrement(O(G.end),G.size,!1,L))),v.size=G.size,v.sizeFound||(F.size=G.size,x.nestedProperty(m[0],M+".size").set(G.size)),B("start",v,G),B("end",v,G)}z=l["_"+w+"pos0"],delete l["_"+w+"pos0"];var ee=l._input[M]||{},V=x.extendFlat({},v),se=v.start,ae=_.r2l(ee.start),j=ae!==void 0;if((v.startFound||j)&&ae!==_.r2l(se)){var Q=j?ae:x.aggNums(Math.min,null,z),re={type:_.type==="category"||_.type==="multicategory"?"linear":_.type,r2l:_.r2l,dtick:v.size,tick0:se,calendar:L,range:[Q,E.tickIncrement(Q,v.size,!1,L)].map(_.l2r)},he=E.tickFirst(re);he>_.r2l(Q)&&(he=E.tickIncrement(he,v.size,!0,L)),V.start=_.l2r(he),j||x.nestedProperty(l,M+".start").set(V.start)}var xe=v.end,Te=_.r2l(ee.end),Le=Te!==void 0;if((v.endFound||Le)&&Te!==_.r2l(xe)){var Pe=Le?Te:x.aggNums(Math.max,null,z);V.end=_.l2r(Pe),Le||x.nestedProperty(l,M+".start").set(V.end)}var qe="autobin"+w;return l._input[qe]===!1&&(l._input[M]=x.extendFlat({},l[M]||{}),delete l._input[qe],delete l[qe]),[V,z]}function f(T,l,_,w,A){var M=T._fullLayout,g=p(T,l),b=!1,v=1/0,u=[l],y,m,R;for(y=0;y=0;w--)b(w);else if(l==="increasing"){for(w=1;w=0;w--)T[w]+=T[w+1];_==="exclude"&&(T.push(0),T.shift())}}q.exports={calc:s,calcAllAutoBins:h}}}),WM=Ge({"src/traces/histogram2d/calc.js"(Z,q){"use strict";var d=ta(),x=Mo(),S=nw(),E=iw(),e=ow(),t=sw(),r=lw().calcAllAutoBins;q.exports=function(s,h){var f=x.getFromId(s,h.xaxis),p=x.getFromId(s,h.yaxis),c=h.xcalendar,T=h.ycalendar,l=function(ze){return f.r2c(ze,0,c)},_=function(ze){return p.r2c(ze,0,T)},w=function(ze){return f.c2r(ze,0,c)},A=function(ze){return p.c2r(ze,0,T)},M,g,b,v,u=r(s,h,f,"x"),y=u[0],m=u[1],R=r(s,h,p,"y"),L=R[0],z=R[1],F=h._length;m.length>F&&m.splice(F,m.length-F),z.length>F&&z.splice(F,z.length-F);var N=[],O=[],P=[],U=typeof y.size=="string",B=typeof L.size=="string",X=[],$=[],le=U?X:y,ce=B?$:L,ve=0,G=[],Y=[],ee=h.histnorm,V=h.histfunc,se=ee.indexOf("density")!==-1,ae=V==="max"||V==="min",j=ae?null:0,Q=S.count,re=E[ee],he=!1,xe=[],Te=[],Le="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Le&&V!=="count"&&(he=V==="avg",Q=S[V]);var Pe=y.size,qe=l(y.start),et=l(y.end)+(qe-x.tickIncrement(qe,Pe,!1,c))/1e6;for(M=qe;M=0&&b=0&&vx;i++)a=e(r,o,E(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,h,f,p,c,T,l,_,w,A,M;for(h=0;hA&&(a=Math.max(a,Math.abs(t[n][s]-w)/(M-A))))}return a}}}),M1=Ge({"src/traces/heatmap/find_empties.js"(Z,q){"use strict";var d=ta().maxRowLength;q.exports=function(S){var E=[],e={},t=[],r=S[0],o=[],a=[0,0,0],i=d(S),n,s,h,f,p,c,T,l;for(s=0;s=0;p--)f=t[p],s=f[0],h=f[1],c=((e[[s-1,h]]||a)[2]+(e[[s+1,h]]||a)[2]+(e[[s,h-1]]||a)[2]+(e[[s,h+1]]||a)[2])/20,c&&(T[f]=[s,h,c],t.splice(p,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(f in T)e[f]=T[f],E.push(T[f])}return E.sort(function(_,w){return w[2]-_[2]})}}}),uw=Ge({"src/traces/heatmap/make_bound_array.js"(Z,q){"use strict";var d=Yi(),x=ta().isArrayOrTypedArray;q.exports=function(E,e,t,r,o,a){var i=[],n=d.traceIs(E,"contour"),s=d.traceIs(E,"histogram"),h,f,p,c=x(e)&&e.length>1;if(c&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],p=1;p1){var ee=(Y[Y.length-1]-Y[0])/(Y.length-1),V=Math.abs(ee/100);for(F=0;FV)return!1}return!0}T._islinear=!1,l.type==="log"||_.type==="log"?M==="fast"&&P("log axis found"):U(g)?U(y)?T._islinear=!0:M==="fast"&&P("y scale is not linear"):M==="fast"&&P("x scale is not linear");var B=x.maxRowLength(z),X=T.xtype==="scaled"?"":g,$=n(T,X,b,v,B,l),le=T.ytype==="scaled"?"":y,ce=n(T,le,m,R,z.length,_);T._extremes[l._id]=S.findExtremes(l,$),T._extremes[_._id]=S.findExtremes(_,ce);var ve={x:$,y:ce,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(ve.orig_x=u),T.yperiodalignment&&L&&(ve.orig_y=L),X&&X.length===$.length-1&&(ve.xCenter=X),le&&le.length===ce.length-1&&(ve.yCenter=le),A&&(ve.xRanges=N.xRanges,ve.yRanges=N.yRanges,ve.pts=N.pts),w||t(c,T,{vals:z,cLetter:"z"}),w&&T.contours&&T.contours.coloring==="heatmap"){var G={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};ve.xfill=n(G,X,b,v,B,l),ve.yfill=n(G,le,m,R,z.length,_)}return[ve]};function h(p){for(var c=[],T=p.length,l=0;l0;)se=y.c2p(U[re]),re--;for(se0;)Q=m.c2p(B[re]),re--;Q=y._length||se<=0||j>=m._length||Q<=0;if(et){var rt=L.selectAll("image").data([]);rt.exit().remove(),_(L);return}var $e,Ue;Te==="fast"?($e=G,Ue=ve):($e=Pe,Ue=qe);var fe=document.createElement("canvas");fe.width=$e,fe.height=Ue;var ue=fe.getContext("2d",{willReadFrequently:!0}),ie=n(F,{noNumericCheck:!0,returnArray:!0}),Ee,We;Te==="fast"?(Ee=Y?function(ha){return G-1-ha}:t.identity,We=ee?function(ha){return ve-1-ha}:t.identity):(Ee=function(ha){return t.constrain(Math.round(y.c2p(U[ha])-V),0,Pe)},We=function(ha){return t.constrain(Math.round(m.c2p(B[ha])-j),0,qe)});var Qe=We(0),Xe=[Qe,Qe],Tt=Y?0:1,St=ee?0:1,zt=0,Ut=0,br=0,hr=0,Or,wr,Er,mt,ze;function Ze(ha,pn){if(ha!==void 0){var _n=ie(ha);return _n[0]=Math.round(_n[0]),_n[1]=Math.round(_n[1]),_n[2]=Math.round(_n[2]),zt+=pn,Ut+=_n[0]*pn,br+=_n[1]*pn,hr+=_n[2]*pn,_n}return[0,0,0,0]}function we(ha,pn,_n,jn){var li=ha[_n.bin0];if(li===void 0)return Ze(void 0,1);var yi=ha[_n.bin1],gi=pn[_n.bin0],Si=pn[_n.bin1],Gi=yi-li||0,io=gi-li||0,vo;return yi===void 0?Si===void 0?vo=0:gi===void 0?vo=2*(Si-li):vo=(2*Si-gi-li)*2/3:Si===void 0?gi===void 0?vo=0:vo=(2*li-yi-gi)*2/3:gi===void 0?vo=(2*Si-yi-li)*2/3:vo=Si+li-yi-gi,Ze(li+_n.frac*Gi+jn.frac*(io+_n.frac*vo))}if(Te!=="default"){var ke=0,Be;try{Be=new Uint8Array($e*Ue*4)}catch{Be=new Array($e*Ue*4)}if(Te==="smooth"){var He=X||U,nt=$||B,ot=new Array(He.length),Ft=new Array(nt.length),Mt=new Array(Pe),Et=X?A:w,Ot=$?A:w,sr,ir,ar;for(re=0;reGa||Ga>m._length))for(he=Yr;heXa||Xa>y._length)){var an=o({x:Ua,y:La},F,g._fullLayout);an.x=Ua,an.y=La;var Sa=z.z[re][he];Sa===void 0?(an.z="",an.zLabel=""):(an.z=Sa,an.zLabel=e.tickText(Wt,Sa,"hover").text);var Zn=z.text&&z.text[re]&&z.text[re][he];(Zn===void 0||Zn===!1)&&(Zn=""),an.text=Zn;var Wn=t.texttemplateString({data:[an,F._meta],fallback:F.texttemplatefallback,labels:an,locale:g._fullLayout._d3locale,template:rn});if(Wn){var ti=Wn.split("
"),gt=ti.length,it=0;for(xe=0;xe=_[0].length||R<0||R>_.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var L;for(b=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),og=Ge({"src/traces/contour/attributes.js"(Z,q){"use strict";var d=W0(),x=gc(),S=pc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=Jl(),r=Of().dash,o=bu(),a=Do().extendFlat,i=z1(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,h=x.line;q.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:a({},d.texttemplate,{}),texttemplatefallback:d.texttemplatefallback,textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},h.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},h.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),dw=Ge({"src/traces/histogram2dcontour/attributes.js"(Z,q){"use strict";var d=D1(),x=og(),S=Jl(),E=pc().axisHoverFormat,e=Do().extendFlat;q.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:x.texttemplate,texttemplatefallback:x.texttemplatefallback,textfont:x.textfont},S("",{cLetter:"z",editTypeOverride:"calc"}))}}),F1=Ge({"src/traces/contour/contours_defaults.js"(Z,q){"use strict";q.exports=function(x,S,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=E("contours.size"),i;o?i=S.autocontour=!0:i=E("autocontour",!1),(i||!a)&&E("ncontours")}}}),pw=Ge({"src/traces/contour/label_defaults.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E,e,t){t||(t={});var r=S("contours.showlabels");if(r){var o=E.font;d.coerceFont(S,"contours.labelfont",o,{overrideDflt:{color:e}}),S("contours.labelformat")}t.hasHover!==!1&&S("zhoverformat")}}}),O1=Ge({"src/traces/contour/style_defaults.js"(Z,q){"use strict";var d=bf(),x=pw();q.exports=function(E,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),nE=Ge({"src/traces/histogram2dcontour/defaults.js"(Z,q){"use strict";var d=ta(),x=vw(),S=F1(),E=O1(),e=ig(),t=dw();q.exports=function(o,a,i,n){function s(f,p){return d.coerce(o,a,t,f,p)}function h(f){return d.coerce2(o,a,t,f)}x(o,a,s,n),a.visible!==!1&&(S(o,a,s,h),E(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),mw=Ge({"src/traces/contour/set_contours.js"(Z,q){"use strict";var d=Mo(),x=ta();q.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=S(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,h=e._input.contours;if(n>s&&(r.start=h.start=s,s=r.end=h.end=n,n=r.start),!(r.size>0)){var f;n===s?f=1:f=S(n,s,e.ncontours).dtick,h.size=r.size=f}}};function S(E,e,t){var r={type:"linear",range:[E,e]};return d.autoTicks(r,(e-E)/(t||15)),r}}}),sg=Ge({"src/traces/contour/end_plus.js"(Z,q){"use strict";q.exports=function(x){return x.end+x.size/1e6}}}),gw=Ge({"src/traces/contour/calc.js"(Z,q){"use strict";var d=wu(),x=E1(),S=mw(),E=sg();q.exports=function(t,r){var o=x(t,r),a=o[0].z;S(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var h=i.start,f=E(i),p=i.size||1,c=Math.floor((f-h)/p)+1;isFinite(p)||(p=1,c=1);var T=h-p/2,l=T+c*p;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),lg=Ge({"src/traces/contour/constants.js"(Z,q){"use strict";q.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),yw=Ge({"src/traces/contour/make_crossings.js"(Z,q){"use strict";var d=lg();q.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,h,f,p,c,T;for(i=0;iS?0:1)+(E[0][1]>S?0:2)+(E[1][1]>S?0:4)+(E[1][0]>S?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return S>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),_w=Ge({"src/traces/contour/find_all_paths.js"(Z,q){"use strict";var d=ta(),x=lg();q.exports=function(a,i,n){var s,h,f,p,c;for(i=i||.01,n=n||.01,f=0;f20?(f=x.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],o.crossings[h]=x.SADDLEREMAINDER[f]):delete o.crossings[h],p=x.NEWDELTA[f],!p){d.log("Found bad marching index:",f,a,o.level);break}c.push(r(o,a,p)),a[0]+=p[0],a[1]+=p[1],h=a.join(","),S(c[c.length-1],c[c.length-2],n,s)&&c.pop();var M=p[0]&&(a[0]<0||a[0]>l-2)||p[1]&&(a[1]<0||a[1]>T-2),g=a[0]===_[0]&&a[1]===_[1]&&p[0]===w[0]&&p[1]===w[1];if(g||i&&M)break;f=o.crossings[h]}A===1e4&&d.log("Infinite loop in contour?");var b=S(c[0],c[c.length-1],n,s),v=0,u=.2*o.smoothing,y=[],m=0,R,L,z,F,N,O,P,U,B,X,$;for(A=1;A=m;A--)if(R=y[A],R=m&&R+y[L]U&&B--,o.edgepaths[B]=$.concat(c,X));break}G||(o.edgepaths[U]=c.concat(X))}for(U=0;U20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),h=o.z[s][n],f=o.xaxis,p=o.yaxis;if(i[1]){var c=(o.level-h)/(o.z[s][n+1]-h),T=(c!==1?(1-c)*f.c2l(o.x[n]):0)+(c!==0?c*f.c2l(o.x[n+1]):0);return[f.c2p(f.l2c(T),!0),p.c2p(o.y[s],!0),n+c,s]}else{var l=(o.level-h)/(o.z[s+1][n]-h),_=(l!==1?(1-l)*p.c2l(o.y[s]):0)+(l!==0?l*p.c2l(o.y[s+1]):0);return[f.c2p(o.x[n],!0),p.c2p(p.l2c(_),!0),n,s+l]}}}}),iE=Ge({"src/traces/contour/constraint_mapping.js"(Z,q){"use strict";var d=z1(),x=Bo();q.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function S(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function E(t){return function(r){r=S(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=S(t,r),{start:r,end:1/0,size:1/0}}}}}),xw=Ge({"src/traces/contour/empty_pathinfo.js"(Z,q){"use strict";var d=ta(),x=iE(),S=sg();q.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=S(o),s=r.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},f=o.start;f1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),bw=Ge({"src/traces/contour/convert_to_constraints.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(E){case"=":case"<":return S;case">":for(S.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=S[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(S.prefixBoundary=!1,S.edgepaths.length)return;var o=S.x.length,a=S.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(S.prefixBoundary=!0);break;case"<":(si||S.starts.length&&f===n)&&(S.prefixBoundary=!0);break;case"][":h=Math.min(s[0],s[1]),f=Math.max(s[0],s[1]),hi&&(S.prefixBoundary=!0);break}break}}}}),B1=Ge({"src/traces/contour/plot.js"(Z){"use strict";var q=Oi(),d=ta(),x=zo(),S=wu(),E=Il(),e=Mo(),t=Iv(),r=C1(),o=yw(),a=_w(),i=xw(),n=bw(),s=ww(),h=lg(),f=h.LABELOPTIMIZER;Z.plot=function(g,b,v,u){var y=b.xaxis,m=b.yaxis;d.makeTraceGroups(u,v,"contour").each(function(R){var L=q.select(this),z=R[0],F=z.trace,N=z.x,O=z.y,P=F.contours,U=i(P,b,z),B=d.ensureSingle(L,"g","heatmapcoloring"),X=[];P.coloring==="heatmap"&&(X=[R]),r(g,b,X,B),o(U),a(U);var $=y.c2p(N[0],!0),le=y.c2p(N[N.length-1],!0),ce=m.c2p(O[0],!0),ve=m.c2p(O[O.length-1],!0),G=[[$,ve],[le,ve],[le,ce],[$,ce]],Y=U;P.type==="constraint"&&(Y=n(U,P._operation)),p(L,G,P),c(L,Y,G,P),l(L,U,g,z,P),w(L,b,g,z,G)})};function p(M,g,b){var v=d.ensureSingle(M,"g","contourbg"),u=v.selectAll("path").data(b.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+g.join("L")+"Z").style("stroke","none")}function c(M,g,b,v){var u=v.coloring==="fill"||v.type==="constraint"&&v._operation!=="=",y="M"+b.join("L")+"Z";u&&s(g,v);var m=d.ensureSingle(M,"g","contourfill"),R=m.selectAll("path").data(u?g:[]);R.enter().append("path"),R.exit().remove(),R.each(function(L){var z=(L.prefixBoundary?y:"")+T(L,b);z?q.select(this).attr("d",z).style("stroke","none"):q.select(this).remove()})}function T(M,g){var b="",v=0,u=M.edgepaths.map(function($,le){return le}),y=!0,m,R,L,z,F,N;function O($){return Math.abs($[1]-g[0][1])<.01}function P($){return Math.abs($[1]-g[2][1])<.01}function U($){return Math.abs($[0]-g[0][0])<.01}function B($){return Math.abs($[0]-g[2][0])<.01}for(;u.length;){for(N=x.smoothopen(M.edgepaths[v],M.smoothing),b+=y?N:N.replace(/^M/,"L"),u.splice(u.indexOf(v),1),m=M.edgepaths[v][M.edgepaths[v].length-1],z=-1,L=0;L<4;L++){if(!m){d.log("Missing end?",v,M);break}for(O(m)&&!B(m)?R=g[1]:U(m)?R=g[0]:P(m)?R=g[3]:B(m)&&(R=g[2]),F=0;F=0&&(R=X,z=F):Math.abs(m[1]-R[1])<.01?Math.abs(m[1]-X[1])<.01&&(X[0]-m[0])*(R[0]-X[0])>=0&&(R=X,z=F):d.log("endpt to newendpt is not vert. or horz.",m,R,X)}if(m=R,z>=0)break;b+="L"+R}if(z===M.edgepaths.length){d.log("unclosed perimeter path");break}v=z,y=u.indexOf(v)===-1,y&&(v=u[0],b+="Z")}for(v=0;vf.MAXCOST*2)break;O&&(R/=2),m=z-R/2,L=m+R*1.5}if(N<=f.MAXCOST)return F};function _(M,g,b,v){var u=g.width/2,y=g.height/2,m=M.x,R=M.y,L=M.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,N=(m>v.center?v.right-m:m-v.left)/(z+Math.abs(Math.sin(L)*y)),O=(R>v.middle?v.bottom-R:R-v.top)/(Math.abs(F)+Math.cos(L)*y);if(N<1||O<1)return 1/0;var P=f.EDGECOST*(1/(N-1)+1/(O-1));P+=f.ANGLECOST*L*L;for(var U=m-z,B=R-F,X=m+z,$=R+F,le=0;le=w)&&(r<=_&&(r=_),o>=w&&(o=w),i=Math.floor((o-r)/a)+1,n=0),l=0;l_&&(p.unshift(_),c.unshift(c[0])),p[p.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(h=parseFloat(s.value[0]),s.value=[h,h+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(h=parseFloat(s.value),s.value=[h,h+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),lE=Ge({"src/traces/contour/defaults.js"(Z,q){"use strict";var d=ta(),x=w1(),S=vv(),E=Sw(),e=F1(),t=O1(),r=ig(),o=og();q.exports=function(i,n,s,h){function f(l,_){return d.coerce(i,n,o,l,_)}function p(l){return d.coerce2(i,n,o,l)}var c=x(i,n,f,h);if(!c){n.visible=!1;return}S(i,n,h,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var T=f("contours.type")==="constraint";f("connectgaps",d.isArray1D(n.z)),T?E(i,n,f,h,s):(e(i,n,f,p),t(i,n,f,h)),n.contours&&n.contours.coloring==="heatmap"&&r(f,h),f("zorder")}}}),uE=Ge({"src/traces/contour/index.js"(Z,q){"use strict";q.exports={attributes:og(),supplyDefaults:lE(),calc:gw(),plot:B1().plot,style:N1(),colorbar:U1(),hoverPoints:Aw(),moduleType:"trace",name:"contour",basePlotModule:Jc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),cE=Ge({"lib/contour.js"(Z,q){"use strict";q.exports=uE()}}),Mw=Ge({"src/traces/scatterternary/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:S}=Tl(),E=hv(),e=gc(),t=Cl(),r=Jl(),o=Of().dash,a=Do().extendFlat,i=e.marker,n=e.line,s=i.line;q.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:a({},e.hovertext,{}),line:{color:n.color,width:n.width,dash:o,backoff:n.backoff,shape:a({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:e.connectgaps,cliponaxis:e.cliponaxis,fill:a({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:a({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:i.angleref,standoff:i.standoff,maxdisplayed:i.maxdisplayed,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:a({width:s.width,dash:s.dash,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:e.textfont,textposition:e.textposition,selected:e.selected,unselected:e.unselected,hoverinfo:a({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:e.hoveron,hovertemplate:d(),hovertemplatefallback:S()}}}),fE=Ge({"src/traces/scatterternary/defaults.js"(Z,q){"use strict";var d=ta(),x=Rv(),S=iu(),E=Nh(),e=Xh(),t=N0(),r=Zh(),o=dv(),a=Mw();q.exports=function(n,s,h,f){function p(M,g){return d.coerce(n,s,a,M,g)}var c=p("a"),T=p("b"),l=p("c"),_;if(c?(_=c.length,T?(_=Math.min(_,T.length),l&&(_=Math.min(_,l.length))):l?_=Math.min(_,l.length):_=0):T&&l&&(_=Math.min(T.length,l.length)),!_){s.visible=!1;return}s._length=_,p("sum"),p("text"),p("hovertext"),s.hoveron!=="fills"&&(p("hovertemplate"),p("hovertemplatefallback"));var w=_"),o.hovertemplate=f.hovertemplate,r}}}),mE=Ge({"src/traces/scatterternary/event_data.js"(Z,q){"use strict";q.exports=function(x,S,E,e,t){if(S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=S.a,x.b=S.b,x.c=S.c;return x}}}),gE=Ge({"src/plots/ternary/ternary.js"(Z,q){"use strict";var d=Oi(),x=Ef(),S=Yi(),E=ta(),e=E.strTranslate,t=E._,r=Bi(),o=zo(),a=Iv(),i=Do().extendFlat,n=Uu(),s=Mo(),h=sh(),f=mc(),p=fv(),c=p.freeMode,T=p.rectMode,l=Ep(),_=Pc().prepSelect,w=Pc().selectOnClick,A=Pc().clearOutline,M=Pc().clearSelectionsCache,g=lf();function b(P,U){this.id=P.id,this.graphDiv=P.graphDiv,this.init(U),this.makeFramework(U),this.updateFx(U),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}q.exports=b;var v=b.prototype;v.init=function(P){this.container=P._ternarylayer,this.defs=P._defs,this.layoutId=P._uid,this.traceHash={},this.layers={}},v.plot=function(P,U){var B=this,X=U[B.id],$=U._size;B._hasClipOnAxisFalse=!1;for(var le=0;leu*Y?(he=Y,re=he*u):(re=G,he=re/u),xe=ce*re/G,Te=ve*he/Y,j=U.l+U.w*$-re/2,Q=U.t+U.h*(1-le)-he/2,B.x0=j,B.y0=Q,B.w=re,B.h=he,B.sum=ee,B.xaxis={type:"linear",range:[V+2*ae-ee,ee-V-2*se],domain:[$-xe/2,$+xe/2],_id:"x"},a(B.xaxis,B.graphDiv._fullLayout),B.xaxis.setScale(),B.xaxis.isPtWithinRange=function(Ee){return Ee.a>=B.aaxis.range[0]&&Ee.a<=B.aaxis.range[1]&&Ee.b>=B.baxis.range[1]&&Ee.b<=B.baxis.range[0]&&Ee.c>=B.caxis.range[1]&&Ee.c<=B.caxis.range[0]},B.yaxis={type:"linear",range:[V,ee-se-ae],domain:[le-Te/2,le+Te/2],_id:"y"},a(B.yaxis,B.graphDiv._fullLayout),B.yaxis.setScale(),B.yaxis.isPtWithinRange=function(){return!0};var Le=B.yaxis.domain[0],Pe=B.aaxis=i({},P.aaxis,{range:[V,ee-se-ae],side:"left",tickangle:(+P.aaxis.tickangle||0)-30,domain:[Le,Le+Te*u],anchor:"free",position:0,_id:"y",_length:re});a(Pe,B.graphDiv._fullLayout),Pe.setScale();var qe=B.baxis=i({},P.baxis,{range:[ee-V-ae,se],side:"bottom",domain:B.xaxis.domain,anchor:"free",position:0,_id:"x",_length:re});a(qe,B.graphDiv._fullLayout),qe.setScale();var et=B.caxis=i({},P.caxis,{range:[ee-V-se,ae],side:"right",tickangle:(+P.caxis.tickangle||0)+30,domain:[Le,Le+Te*u],anchor:"free",position:0,_id:"y",_length:re});a(et,B.graphDiv._fullLayout),et.setScale();var rt="M"+j+","+(Q+he)+"h"+re+"l-"+re/2+",-"+he+"Z";B.clipDef.select("path").attr("d",rt),B.layers.plotbg.select("path").attr("d",rt);var $e="M0,"+he+"h"+re+"l-"+re/2+",-"+he+"Z";B.clipDefRelative.select("path").attr("d",$e);var Ue=e(j,Q);B.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Ue),B.clipDefRelative.select("path").attr("transform",null);var fe=e(j-qe._offset,Q+he);B.layers.baxis.attr("transform",fe),B.layers.bgrid.attr("transform",fe);var ue=e(j+re/2,Q)+"rotate(30)"+e(0,-Pe._offset);B.layers.aaxis.attr("transform",ue),B.layers.agrid.attr("transform",ue);var ie=e(j+re/2,Q)+"rotate(-30)"+e(0,-et._offset);B.layers.caxis.attr("transform",ie),B.layers.cgrid.attr("transform",ie),B.drawAxes(!0),B.layers.aline.select("path").attr("d",Pe.showline?"M"+j+","+(Q+he)+"l"+re/2+",-"+he:"M0,0").call(r.stroke,Pe.linecolor||"#000").style("stroke-width",(Pe.linewidth||0)+"px"),B.layers.bline.select("path").attr("d",qe.showline?"M"+j+","+(Q+he)+"h"+re:"M0,0").call(r.stroke,qe.linecolor||"#000").style("stroke-width",(qe.linewidth||0)+"px"),B.layers.cline.select("path").attr("d",et.showline?"M"+(j+re/2)+","+Q+"l"+re/2+","+he:"M0,0").call(r.stroke,et.linecolor||"#000").style("stroke-width",(et.linewidth||0)+"px"),B.graphDiv._context.staticPlot||B.initInteractions(),o.setClipUrl(B.layers.frontplot,B._hasClipOnAxisFalse?null:B.clipId,B.graphDiv)},v.drawAxes=function(P){var U=this,B=U.graphDiv,X=U.id.slice(7)+"title",$=U.layers,le=U.aaxis,ce=U.baxis,ve=U.caxis;if(U.drawAx(le),U.drawAx(ce),U.drawAx(ve),P){var G=Math.max(le.showticklabels?le.tickfont.size/2:0,(ve.showticklabels?ve.tickfont.size*.75:0)+(ve.ticks==="outside"?ve.ticklen*.87:0)),Y=(ce.showticklabels?ce.tickfont.size:0)+(ce.ticks==="outside"?ce.ticklen:0)+3;$["a-title"]=l.draw(B,"a"+X,{propContainer:le,propName:U.id+".aaxis.title.text",placeholder:t(B,"Click to enter Component A title"),attributes:{x:U.x0+U.w/2,y:U.y0-le.title.font.size/3-G,"text-anchor":"middle"}}),$["b-title"]=l.draw(B,"b"+X,{propContainer:ce,propName:U.id+".baxis.title.text",placeholder:t(B,"Click to enter Component B title"),attributes:{x:U.x0-Y,y:U.y0+U.h+ce.title.font.size*.83+Y,"text-anchor":"middle"}}),$["c-title"]=l.draw(B,"c"+X,{propContainer:ve,propName:U.id+".caxis.title.text",placeholder:t(B,"Click to enter Component C title"),attributes:{x:U.x0+U.w+Y,y:U.y0+U.h+ve.title.font.size*.83+Y,"text-anchor":"middle"}})}},v.drawAx=function(P){var U=this,B=U.graphDiv,X=P._name,$=X.charAt(0),le=P._id,ce=U.layers[X],ve=30,G=$+"tickLayout",Y=y(P);U[G]!==Y&&(ce.selectAll("."+le+"tick").remove(),U[G]=Y),P.setScale();var ee=s.calcTicks(P),V=s.clipEnds(P,ee),se=s.makeTransTickFn(P),ae=s.getTickSigns(P)[2],j=E.deg2rad(ve),Q=ae*(P.linewidth||1)/2,re=ae*P.ticklen,he=U.w,xe=U.h,Te=$==="b"?"M0,"+Q+"l"+Math.sin(j)*re+","+Math.cos(j)*re:"M"+Q+",0l"+Math.cos(j)*re+","+-Math.sin(j)*re,Le={a:"M0,0l"+xe+",-"+he/2,b:"M0,0l-"+he/2+",-"+xe,c:"M0,0l-"+xe+","+he/2}[$];s.drawTicks(B,P,{vals:P.ticks==="inside"?V:ee,layer:ce,path:Te,transFn:se,crisp:!1}),s.drawGrid(B,P,{vals:V,layer:U.layers[$+"grid"],path:Le,transFn:se,crisp:!1}),s.drawLabels(B,P,{vals:ee,layer:ce,transFn:se,labelFns:s.makeLabelFns(P,0,ve)})};function y(P){return P.ticks+String(P.ticklen)+String(P.showticklabels)}var m=g.MINZOOM/2+.87,R="m-0.87,.5h"+m+"v3h-"+(m+5.2)+"l"+(m/2+2.6)+",-"+(m*.87+4.5)+"l2.6,1.5l-"+m/2+","+m*.87+"Z",L="m0.87,.5h-"+m+"v3h"+(m+5.2)+"l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-2.6,1.5l"+m/2+","+m*.87+"Z",z="m0,1l"+m/2+","+m*.87+"l2.6,-1.5l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-"+(m/2+2.6)+","+(m*.87+4.5)+"l2.6,1.5l"+m/2+",-"+m*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",N=!0;v.clearOutline=function(){M(this.dragOptions),A(this.dragOptions.gd)},v.initInteractions=function(){var P=this,U=P.layers.plotbg.select("path").node(),B=P.graphDiv,X=B._fullLayout._zoomlayer,$,le;this.dragOptions={element:U,gd:B,plotinfo:{id:P.id,domain:B._fullLayout[P.id].domain,xaxis:P.xaxis,yaxis:P.yaxis},subplot:P.id,prepFn:function(fe,ue,ie){P.dragOptions.xaxes=[P.xaxis],P.dragOptions.yaxes=[P.yaxis],$=B._fullLayout._invScaleX,le=B._fullLayout._invScaleY;var Ee=P.dragOptions.dragmode=B._fullLayout.dragmode;c(Ee)?P.dragOptions.minDrag=1:P.dragOptions.minDrag=void 0,Ee==="zoom"?(P.dragOptions.moveFn=qe,P.dragOptions.clickFn=he,P.dragOptions.doneFn=et,xe(fe,ue,ie)):Ee==="pan"?(P.dragOptions.moveFn=$e,P.dragOptions.clickFn=he,P.dragOptions.doneFn=Ue,rt(),P.clearOutline(B)):(T(Ee)||c(Ee))&&_(fe,ue,ie,P.dragOptions,Ee)}};var ce,ve,G,Y,ee,V,se,ae,j,Q;function re(fe){var ue={};return ue[P.id+".aaxis.min"]=fe.a,ue[P.id+".baxis.min"]=fe.b,ue[P.id+".caxis.min"]=fe.c,ue}function he(fe,ue){var ie=B._fullLayout.clickmode;O(B),fe===2&&(B.emit("plotly_doubleclick",null),S.call("_guiRelayout",B,re({a:0,b:0,c:0}))),ie.indexOf("select")>-1&&fe===1&&w(ue,B,[P.xaxis],[P.yaxis],P.id,P.dragOptions),ie.indexOf("event")>-1&&f.click(B,ue,P.id)}function xe(fe,ue,ie){var Ee=U.getBoundingClientRect();ce=ue-Ee.left,ve=ie-Ee.top,B._fullLayout._calcInverseTransform(B);var We=B._fullLayout._invTransform,Qe=E.apply3DTransform(We)(ce,ve);ce=Qe[0],ve=Qe[1],G={a:P.aaxis.range[0],b:P.baxis.range[1],c:P.caxis.range[1]},ee=G,Y=P.aaxis.range[1]-G.a,V=x(P.graphDiv._fullLayout[P.id].bgcolor).getLuminance(),se="M0,"+P.h+"L"+P.w/2+", 0L"+P.w+","+P.h+"Z",ae=!1,j=X.append("path").attr("class","zoombox").attr("transform",e(P.x0,P.y0)).style({fill:V>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",se),Q=X.append("path").attr("class","zoombox-corners").attr("transform",e(P.x0,P.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),P.clearOutline(B)}function Te(fe,ue){return 1-ue/P.h}function Le(fe,ue){return 1-(fe+(P.h-ue)/Math.sqrt(3))/P.w}function Pe(fe,ue){return(fe-(P.h-ue)/Math.sqrt(3))/P.w}function qe(fe,ue){var ie=ce+fe*$,Ee=ve+ue*le,We=Math.max(0,Math.min(1,Te(ce,ve),Te(ie,Ee))),Qe=Math.max(0,Math.min(1,Le(ce,ve),Le(ie,Ee))),Xe=Math.max(0,Math.min(1,Pe(ce,ve),Pe(ie,Ee))),Tt=(We/2+Xe)*P.w,St=(1-We/2-Qe)*P.w,zt=(Tt+St)/2,Ut=St-Tt,br=(1-We)*P.h,hr=br-Ut/u;Ut.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Q.transition().style("opacity",1).duration(200),ae=!0),B.emit("plotly_relayouting",re(ee))}function et(){O(B),ee!==G&&(S.call("_guiRelayout",B,re(ee)),N&&B.data&&B._context.showTips&&(E.notifier(t(B,"Double-click to zoom back out"),"long",B),N=!1))}function rt(){G={a:P.aaxis.range[0],b:P.baxis.range[1],c:P.caxis.range[1]},ee=G}function $e(fe,ue){var ie=fe/P.xaxis._m,Ee=ue/P.yaxis._m;ee={a:G.a-Ee,b:G.b+(ie+Ee)/2,c:G.c-(ie-Ee)/2};var We=[ee.a,ee.b,ee.c].sort(E.sorterAsc),Qe={a:We.indexOf(ee.a),b:We.indexOf(ee.b),c:We.indexOf(ee.c)};We[0]<0&&(We[1]+We[0]/2<0?(We[2]+=We[0]+We[1],We[0]=We[1]=0):(We[2]+=We[0]/2,We[1]+=We[0]/2,We[0]=0),ee={a:We[Qe.a],b:We[Qe.b],c:We[Qe.c]},ue=(G.a-ee.a)*P.yaxis._m,fe=(G.c-ee.c-G.b+ee.b)*P.xaxis._m);var Xe=e(P.x0+fe,P.y0+ue);P.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Xe);var Tt=e(-fe,-ue);P.clipDefRelative.select("path").attr("transform",Tt),P.aaxis.range=[ee.a,P.sum-ee.b-ee.c],P.baxis.range=[P.sum-ee.a-ee.c,ee.b],P.caxis.range=[P.sum-ee.a-ee.b,ee.c],P.drawAxes(!1),P._hasClipOnAxisFalse&&P.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,P),B.emit("plotly_relayouting",re(ee))}function Ue(){S.call("_guiRelayout",B,re(ee))}U.onmousemove=function(fe){f.hover(B,fe,P.id),B._fullLayout._lasthover=U,B._fullLayout._hoversubplot=P.id},U.onmouseout=function(fe){B._dragging||h.unhover(B,fe)},h.init(this.dragOptions)};function O(P){d.select(P).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Ew=Ge({"src/plots/ternary/layout_attributes.js"(Z,q){"use strict";var d=sf(),x=ju().attributes,S=Nf(),E=Ru().overrideAll,e=Do().extendFlat,t={title:{text:S.title.text,font:S.title.font},color:S.color,tickmode:S.minor.tickmode,nticks:e({},S.nticks,{dflt:6,min:1}),tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,ticklabelstep:S.ticklabelstep,showticklabels:S.showticklabels,labelalias:S.labelalias,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickfont:S.tickfont,tickangle:S.tickangle,tickformat:S.tickformat,tickformatstops:S.tickformatstops,hoverformat:S.hoverformat,showline:e({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:e({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash,layer:S.layer,min:{valType:"number",dflt:0,min:0}},r=q.exports=E({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),Bd=Ge({"src/plots/subplot_defaults.js"(Z,q){"use strict";var d=ta(),x=ll(),S=ju().defaults;q.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",h=t._subplots[a],f=h.length,p=f&&h[0].replace(/\d+$/,""),c,T;function l(M,g){return d.coerce(c,T,i,M,g)}for(var _=0;_=_&&(b.min=0,v.min=0,u.min=0,f.aaxis&&delete f.aaxis.min,f.baxis&&delete f.baxis.min,f.caxis&&delete f.caxis.min)}function h(f,p,c,T){var l=i[p._name];function _(y,m){return S.coerce(f,p,l,y,m)}_("uirevision",T.uirevision),p.type="linear";var w=_("color"),A=w!==l.color.dflt?w:c.font.color,M=p._name,g=M.charAt(0).toUpperCase(),b="Component "+g,v=_("title.text",b);p._hovertitle=v===b?v:g,S.coerceFont(_,"title.font",c.font,{overrideDflt:{size:S.bigFont(c.font.size),color:A}}),_("min"),o(f,p,_,"linear"),t(f,p,_,"linear"),e(f,p,_,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(f,p,_,{outerTicks:!0});var u=_("showticklabels");u&&(S.coerceFont(_,"tickfont",c.font,{overrideDflt:{color:A}}),_("tickangle"),_("tickformat")),a(f,p,_,{dfltColor:w,bgColor:c.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),_("hoverformat"),_("layer")}}}),_E=Ge({"src/plots/ternary/index.js"(Z){"use strict";var q=gE(),d=Bf().getSubplotCalcData,x=ta().counterRegex,S="ternary";Z.name=S;var E=Z.attr="subplot";Z.idRoot=S,Z.idRegex=Z.attrRegex=x(S);var e=Z.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},Z.layoutAttributes=Ew(),Z.supplyLayoutDefaults=yE(),Z.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[S],n=0;n0){var M=r.xa,g=r.ya,b,v,u,y,m;f.orientation==="h"?(m=o,b="y",u=g,v="x",y=M):(m=a,b="x",u=M,v="y",y=g);var R=h[r.index];if(m>=R.span[0]&&m<=R.span[1]){var L=x.extendFlat({},r),z=y.c2p(m,!0),F=e.getKdeValue(R,f,m),N=e.getPositionOnKdePath(R,f,z),O=u._offset,P=u._length;L[b+"0"]=N[0],L[b+"1"]=N[1],L[v+"0"]=L[v+"1"]=z,L[v+"Label"]=v+": "+S.hoverLabelText(y,m,f[v+"hoverformat"])+", "+h[0].t.labels.kde+" "+F.toFixed(3);for(var U=0,B=0;B path").each(function(c){if(!c.isBlank){var T=p.marker;d.select(this).call(S.fill,c.mc||T.color).call(S.stroke,c.mlc||T.line.color).call(x.dashLine,T.line.dash,c.mlw||T.line.width).style("opacity",p.selectedpoints&&!c.selected?E:1)}}),r(f,p,a),f.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(S.fill,p.connector.fillcolor)}),f.selectAll(".lines").each(function(){var c=p.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),c.width,c.color,c.dash)})})}q.exports={style:o}}}),BE=Ge({"src/traces/funnel/hover.js"(Z,q){"use strict";var d=Bi().opacity,x=G0().hoverOnBars,S=ta().formatPercent;q.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,h=s[0].trace,f=h.orientation==="h",p=n.index,c=s[p],T=f?"x":"y";n[T+"LabelVal"]=c.s,n.percentInitial=c.begR,n.percentInitialLabel=S(c.begR,1),n.percentPrevious=c.difR,n.percentPreviousLabel=S(c.difR,1),n.percentTotal=c.sumR,n.percentTotalLabel=S(c.sumR,1);var l=c.hi||h.hoverinfo,_=[];if(l&&l!=="none"&&l!=="skip"){var w=l==="all",A=l.split("+"),M=function(g){return w||A.indexOf(g)!==-1};M("percent initial")&&_.push(n.percentInitialLabel+" of initial"),M("percent previous")&&_.push(n.percentPreviousLabel+" of previous"),M("percent total")&&_.push(n.percentTotalLabel+" of total")}return n.extraText=_.join("
"),n.color=E(h,c),[n]}};function E(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),NE=Ge({"src/traces/funnel/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,"percentInitial"in S&&(x.percentInitial=S.percentInitial),"percentPrevious"in S&&(x.percentPrevious=S.percentPrevious),"percentTotal"in S&&(x.percentTotal=S.percentTotal),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x}}}),UE=Ge({"src/traces/funnel/index.js"(Z,q){"use strict";q.exports={attributes:Lw(),layoutAttributes:Pw(),supplyDefaults:Iw().supplyDefaults,crossTraceDefaults:Iw().crossTraceDefaults,supplyLayoutDefaults:IE(),calc:DE(),crossTraceCalc:zE(),plot:FE(),style:OE().style,hoverPoints:BE(),eventData:NE(),selectPoints:H0(),moduleType:"trace",name:"funnel",basePlotModule:Jc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),jE=Ge({"lib/funnel.js"(Z,q){"use strict";q.exports=UE()}}),VE=Ge({"src/traces/waterfall/constants.js"(Z,q){"use strict";q.exports={eventDataKeys:["initial","delta","final"]}}}),Rw=Ge({"src/traces/waterfall/attributes.js"(Z,q){"use strict";var d=zv(),x=gc().line,S=Cl(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Tl(),o=VE(),a=Do().extendFlat,i=Bi();function n(s){return{marker:{color:a({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:a({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:a({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}q.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:o.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:a({},S.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:o.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:n("increasing"),decreasing:n("decreasing"),totals:n("intermediate sums and total"),connector:{line:{color:a({},x.color,{dflt:i.defaultLine}),width:a({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),Dw=Ge({"src/traces/waterfall/layout_attributes.js"(Z,q){"use strict";q.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),X0=Ge({"src/constants/delta.js"(Z,q){"use strict";q.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}}}),zw=Ge({"src/traces/waterfall/defaults.js"(Z,q){"use strict";var d=ta(),x=Lp(),S=Uh().handleText,E=B0(),e=vv(),t=Rw(),r=Bi(),o=X0(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(p,c,T){p(c+".marker.color",T),p(c+".marker.line.color",r.defaultLine),p(c+".marker.line.width")}function h(p,c,T,l){function _(b,v){return d.coerce(p,c,t,b,v)}var w=E(p,c,l,_);if(!w){c.visible=!1;return}e(p,c,l,_),_("xhoverformat"),_("yhoverformat"),_("measure"),_("orientation",c.x&&!c.y?"h":"v"),_("base"),_("offset"),_("width"),_("text"),_("hovertext"),_("hovertemplate"),_("hovertemplatefallback");var A=_("textposition");S(p,c,l,_,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),c.textposition!=="none"&&(_("texttemplate"),_("texttemplatefallback"),c.texttemplate||_("textinfo")),s(_,"increasing",a),s(_,"decreasing",i),s(_,"totals",n);var M=_("connector.visible");if(M){_("connector.mode");var g=_("connector.line.width");g&&(_("connector.line.color"),_("connector.line.dash"))}_("zorder")}function f(p,c){var T,l;function _(A){return d.coerce(l._input,l,t,A)}if(c.waterfallmode==="group")for(var w=0;w0&&(_?m+="M"+u[0]+","+y[1]+"V"+y[0]:m+="M"+u[1]+","+y[0]+"H"+u[0]),w!=="between"&&(g.isSum||b path").each(function(c){if(!c.isBlank){var T=p[c.dir].marker;d.select(this).call(S.fill,T.color).call(S.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",p.selectedpoints&&!c.selected?E:1)}}),r(f,p,a),f.selectAll(".lines").each(function(){var c=p.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),c.width,c.color,c.dash)})})}q.exports={style:o}}}),ZE=Ge({"src/traces/waterfall/hover.js"(Z,q){"use strict";var d=Mo().hoverLabelText,x=Bi().opacity,S=G0().hoverOnBars,E=X0(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};q.exports=function(o,a,i,n,s){var h=S(o,a,i,n,s);if(!h)return;var f=h.cd,p=f[0].trace,c=p.orientation==="h",T=c?"x":"y",l=c?o.xa:o.ya;function _(R){return d(l,R,p[T+"hoverformat"])}var w=h.index,A=f[w],M=A.isSum?A.b+A.s:A.rawS;h.initial=A.b+A.s-M,h.delta=M,h.final=h.initial+h.delta;var g=_(Math.abs(h.delta));h.deltaLabel=M<0?"("+g+")":g,h.finalLabel=_(h.final),h.initialLabel=_(h.initial);var b=A.hi||p.hoverinfo,v=[];if(b&&b!=="none"&&b!=="skip"){var u=b==="all",y=b.split("+"),m=function(R){return u||y.indexOf(R)!==-1};A.isSum||(m("final")&&(c?!m("x"):!m("y"))&&v.push(h.finalLabel),m("delta")&&(M<0?v.push(h.deltaLabel+" "+e.decreasing):v.push(h.deltaLabel+" "+e.increasing)),m("initial")&&v.push("Initial: "+h.initialLabel))}return v.length&&(h.extraText=v.join("
")),h.color=t(p,A),[h]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),YE=Ge({"src/traces/waterfall/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,"initial"in S&&(x.initial=S.initial),"delta"in S&&(x.delta=S.delta),"final"in S&&(x.final=S.final),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x}}}),KE=Ge({"src/traces/waterfall/index.js"(Z,q){"use strict";q.exports={attributes:Rw(),layoutAttributes:Dw(),supplyDefaults:zw().supplyDefaults,crossTraceDefaults:zw().crossTraceDefaults,supplyLayoutDefaults:qE(),calc:GE(),crossTraceCalc:HE(),plot:WE(),style:XE().style,hoverPoints:ZE(),eventData:YE(),selectPoints:H0(),moduleType:"trace",name:"waterfall",basePlotModule:Jc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),JE=Ge({"lib/waterfall.js"(Z,q){"use strict";q.exports=KE()}}),Z0=Ge({"src/traces/image/constants.js"(Z,q){"use strict";q.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%",""]}}}}}),Fw=Ge({"src/traces/image/attributes.js"(Z,q){"use strict";var d=Cl(),x=gc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Tl(),e=Do().extendFlat,t=Z0().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],o=[],a=[];for(n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var p=h.indexOf("=");p===-1&&(p=f);var c=p===f?0:4-p%4;return[p,c]}function r(h){var f=t(h),p=f[0],c=f[1];return(p+c)*3/4-c}function o(h,f,p){return(f+p)*3/4-p}function a(h){var f,p=t(h),c=p[0],T=p[1],l=new x(o(h,c,T)),_=0,w=T>0?c-4:c,A;for(A=0;A>16&255,l[_++]=f>>8&255,l[_++]=f&255;return T===2&&(f=d[h.charCodeAt(A)]<<2|d[h.charCodeAt(A+1)]>>4,l[_++]=f&255),T===1&&(f=d[h.charCodeAt(A)]<<10|d[h.charCodeAt(A+1)]<<4|d[h.charCodeAt(A+2)]>>2,l[_++]=f>>8&255,l[_++]=f&255),l}function i(h){return q[h>>18&63]+q[h>>12&63]+q[h>>6&63]+q[h&63]}function n(h,f,p){for(var c,T=[],l=f;lw?w:_+l));return c===1?(f=h[p-1],T.push(q[f>>2]+q[f<<4&63]+"==")):c===2&&(f=(h[p-2]<<8)+h[p-1],T.push(q[f>>10]+q[f>>4&63]+q[f<<2&63]+"=")),T.join("")}}}),e6=Ge({"node_modules/ieee754/index.js"(Z){Z.read=function(q,d,x,S,E){var e,t,r=E*8-S-1,o=(1<>1,i=-7,n=x?E-1:0,s=x?-1:1,h=q[d+n];for(n+=s,e=h&(1<<-i)-1,h>>=-i,i+=r;i>0;e=e*256+q[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=S;i>0;t=t*256+q[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(h?-1:1)*(1/0);t=t+Math.pow(2,S),e=e-a}return(h?-1:1)*t*Math.pow(2,e-S)},Z.write=function(q,d,x,S,E,e){var t,r,o,a=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=S?0:e-1,f=S?1:-1,p=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,E),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,E),t=0));E>=8;q[x+h]=r&255,h+=f,r/=256,E-=8);for(t=t<0;q[x+h]=t&255,h+=f,t/=256,a-=8);q[x+h-f]|=p*128}}}),Rp=Ge({"node_modules/buffer/index.js"(Z){"use strict";var q=QE(),d=e6(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Z.Buffer=t,Z.SlowBuffer=T,Z.INSPECT_MAX_BYTES=50;var S=2147483647;Z.kMaxLength=S,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{let fe=new Uint8Array(1),ue={foo:function(){return 42}};return Object.setPrototypeOf(ue,Uint8Array.prototype),Object.setPrototypeOf(fe,ue),fe.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(fe){if(fe>S)throw new RangeError('The value "'+fe+'" is invalid for option "size"');let ue=new Uint8Array(fe);return Object.setPrototypeOf(ue,t.prototype),ue}function t(fe,ue,ie){if(typeof fe=="number"){if(typeof ue=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(fe)}return r(fe,ue,ie)}t.poolSize=8192;function r(fe,ue,ie){if(typeof fe=="string")return n(fe,ue);if(ArrayBuffer.isView(fe))return h(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(qe(fe,ArrayBuffer)||fe&&qe(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(fe,SharedArrayBuffer)||fe&&qe(fe.buffer,SharedArrayBuffer)))return f(fe,ue,ie);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ee=fe.valueOf&&fe.valueOf();if(Ee!=null&&Ee!==fe)return t.from(Ee,ue,ie);let We=p(fe);if(We)return We;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return t.from(fe[Symbol.toPrimitive]("string"),ue,ie);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}t.from=function(fe,ue,ie){return r(fe,ue,ie)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function a(fe,ue,ie){return o(fe),fe<=0?e(fe):ue!==void 0?typeof ie=="string"?e(fe).fill(ue,ie):e(fe).fill(ue):e(fe)}t.alloc=function(fe,ue,ie){return a(fe,ue,ie)};function i(fe){return o(fe),e(fe<0?0:c(fe)|0)}t.allocUnsafe=function(fe){return i(fe)},t.allocUnsafeSlow=function(fe){return i(fe)};function n(fe,ue){if((typeof ue!="string"||ue==="")&&(ue="utf8"),!t.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);let ie=l(fe,ue)|0,Ee=e(ie),We=Ee.write(fe,ue);return We!==ie&&(Ee=Ee.slice(0,We)),Ee}function s(fe){let ue=fe.length<0?0:c(fe.length)|0,ie=e(ue);for(let Ee=0;Ee=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return fe|0}function T(fe){return+fe!=fe&&(fe=0),t.alloc(+fe)}t.isBuffer=function(ue){return ue!=null&&ue._isBuffer===!0&&ue!==t.prototype},t.compare=function(ue,ie){if(qe(ue,Uint8Array)&&(ue=t.from(ue,ue.offset,ue.byteLength)),qe(ie,Uint8Array)&&(ie=t.from(ie,ie.offset,ie.byteLength)),!t.isBuffer(ue)||!t.isBuffer(ie))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ue===ie)return 0;let Ee=ue.length,We=ie.length;for(let Qe=0,Xe=Math.min(Ee,We);QeWe.length?(t.isBuffer(Xe)||(Xe=t.from(Xe)),Xe.copy(We,Qe)):Uint8Array.prototype.set.call(We,Xe,Qe);else if(t.isBuffer(Xe))Xe.copy(We,Qe);else throw new TypeError('"list" argument must be an Array of Buffers');Qe+=Xe.length}return We};function l(fe,ue){if(t.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||qe(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);let ie=fe.length,Ee=arguments.length>2&&arguments[2]===!0;if(!Ee&&ie===0)return 0;let We=!1;for(;;)switch(ue){case"ascii":case"latin1":case"binary":return ie;case"utf8":case"utf-8":return he(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie*2;case"hex":return ie>>>1;case"base64":return Le(fe).length;default:if(We)return Ee?-1:he(fe).length;ue=(""+ue).toLowerCase(),We=!0}}t.byteLength=l;function _(fe,ue,ie){let Ee=!1;if((ue===void 0||ue<0)&&(ue=0),ue>this.length||((ie===void 0||ie>this.length)&&(ie=this.length),ie<=0)||(ie>>>=0,ue>>>=0,ie<=ue))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return O(this,ue,ie);case"utf8":case"utf-8":return R(this,ue,ie);case"ascii":return F(this,ue,ie);case"latin1":case"binary":return N(this,ue,ie);case"base64":return m(this,ue,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,ue,ie);default:if(Ee)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),Ee=!0}}t.prototype._isBuffer=!0;function w(fe,ue,ie){let Ee=fe[ue];fe[ue]=fe[ie],fe[ie]=Ee}t.prototype.swap16=function(){let ue=this.length;if(ue%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ie=0;ieie&&(ue+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(ue,ie,Ee,We,Qe){if(qe(ue,Uint8Array)&&(ue=t.from(ue,ue.offset,ue.byteLength)),!t.isBuffer(ue))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ue);if(ie===void 0&&(ie=0),Ee===void 0&&(Ee=ue?ue.length:0),We===void 0&&(We=0),Qe===void 0&&(Qe=this.length),ie<0||Ee>ue.length||We<0||Qe>this.length)throw new RangeError("out of range index");if(We>=Qe&&ie>=Ee)return 0;if(We>=Qe)return-1;if(ie>=Ee)return 1;if(ie>>>=0,Ee>>>=0,We>>>=0,Qe>>>=0,this===ue)return 0;let Xe=Qe-We,Tt=Ee-ie,St=Math.min(Xe,Tt),zt=this.slice(We,Qe),Ut=ue.slice(ie,Ee);for(let br=0;br2147483647?ie=2147483647:ie<-2147483648&&(ie=-2147483648),ie=+ie,et(ie)&&(ie=We?0:fe.length-1),ie<0&&(ie=fe.length+ie),ie>=fe.length){if(We)return-1;ie=fe.length-1}else if(ie<0)if(We)ie=0;else return-1;if(typeof ue=="string"&&(ue=t.from(ue,Ee)),t.isBuffer(ue))return ue.length===0?-1:M(fe,ue,ie,Ee,We);if(typeof ue=="number")return ue=ue&255,typeof Uint8Array.prototype.indexOf=="function"?We?Uint8Array.prototype.indexOf.call(fe,ue,ie):Uint8Array.prototype.lastIndexOf.call(fe,ue,ie):M(fe,[ue],ie,Ee,We);throw new TypeError("val must be string, number or Buffer")}function M(fe,ue,ie,Ee,We){let Qe=1,Xe=fe.length,Tt=ue.length;if(Ee!==void 0&&(Ee=String(Ee).toLowerCase(),Ee==="ucs2"||Ee==="ucs-2"||Ee==="utf16le"||Ee==="utf-16le")){if(fe.length<2||ue.length<2)return-1;Qe=2,Xe/=2,Tt/=2,ie/=2}function St(Ut,br){return Qe===1?Ut[br]:Ut.readUInt16BE(br*Qe)}let zt;if(We){let Ut=-1;for(zt=ie;ztXe&&(ie=Xe-Tt),zt=ie;zt>=0;zt--){let Ut=!0;for(let br=0;brWe&&(Ee=We)):Ee=We;let Qe=ue.length;Ee>Qe/2&&(Ee=Qe/2);let Xe;for(Xe=0;Xe>>0,isFinite(Ee)?(Ee=Ee>>>0,We===void 0&&(We="utf8")):(We=Ee,Ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Qe=this.length-ie;if((Ee===void 0||Ee>Qe)&&(Ee=Qe),ue.length>0&&(Ee<0||ie<0)||ie>this.length)throw new RangeError("Attempt to write outside buffer bounds");We||(We="utf8");let Xe=!1;for(;;)switch(We){case"hex":return g(this,ue,ie,Ee);case"utf8":case"utf-8":return b(this,ue,ie,Ee);case"ascii":case"latin1":case"binary":return v(this,ue,ie,Ee);case"base64":return u(this,ue,ie,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,ue,ie,Ee);default:if(Xe)throw new TypeError("Unknown encoding: "+We);We=(""+We).toLowerCase(),Xe=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(fe,ue,ie){return ue===0&&ie===fe.length?q.fromByteArray(fe):q.fromByteArray(fe.slice(ue,ie))}function R(fe,ue,ie){ie=Math.min(fe.length,ie);let Ee=[],We=ue;for(;We239?4:Qe>223?3:Qe>191?2:1;if(We+Tt<=ie){let St,zt,Ut,br;switch(Tt){case 1:Qe<128&&(Xe=Qe);break;case 2:St=fe[We+1],(St&192)===128&&(br=(Qe&31)<<6|St&63,br>127&&(Xe=br));break;case 3:St=fe[We+1],zt=fe[We+2],(St&192)===128&&(zt&192)===128&&(br=(Qe&15)<<12|(St&63)<<6|zt&63,br>2047&&(br<55296||br>57343)&&(Xe=br));break;case 4:St=fe[We+1],zt=fe[We+2],Ut=fe[We+3],(St&192)===128&&(zt&192)===128&&(Ut&192)===128&&(br=(Qe&15)<<18|(St&63)<<12|(zt&63)<<6|Ut&63,br>65535&&br<1114112&&(Xe=br))}}Xe===null?(Xe=65533,Tt=1):Xe>65535&&(Xe-=65536,Ee.push(Xe>>>10&1023|55296),Xe=56320|Xe&1023),Ee.push(Xe),We+=Tt}return z(Ee)}var L=4096;function z(fe){let ue=fe.length;if(ue<=L)return String.fromCharCode.apply(String,fe);let ie="",Ee=0;for(;EeEe)&&(ie=Ee);let We="";for(let Qe=ue;QeEe&&(ue=Ee),ie<0?(ie+=Ee,ie<0&&(ie=0)):ie>Ee&&(ie=Ee),ieie)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(ue,ie,Ee){ue=ue>>>0,ie=ie>>>0,Ee||U(ue,ie,this.length);let We=this[ue],Qe=1,Xe=0;for(;++Xe>>0,ie=ie>>>0,Ee||U(ue,ie,this.length);let We=this[ue+--ie],Qe=1;for(;ie>0&&(Qe*=256);)We+=this[ue+--ie]*Qe;return We},t.prototype.readUint8=t.prototype.readUInt8=function(ue,ie){return ue=ue>>>0,ie||U(ue,1,this.length),this[ue]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(ue,ie){return ue=ue>>>0,ie||U(ue,2,this.length),this[ue]|this[ue+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(ue,ie){return ue=ue>>>0,ie||U(ue,2,this.length),this[ue]<<8|this[ue+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(ue,ie){return ue=ue>>>0,ie||U(ue,4,this.length),(this[ue]|this[ue+1]<<8|this[ue+2]<<16)+this[ue+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(ue,ie){return ue=ue>>>0,ie||U(ue,4,this.length),this[ue]*16777216+(this[ue+1]<<16|this[ue+2]<<8|this[ue+3])},t.prototype.readBigUInt64LE=$e(function(ue){ue=ue>>>0,ae(ue,"offset");let ie=this[ue],Ee=this[ue+7];(ie===void 0||Ee===void 0)&&j(ue,this.length-8);let We=ie+this[++ue]*2**8+this[++ue]*2**16+this[++ue]*2**24,Qe=this[++ue]+this[++ue]*2**8+this[++ue]*2**16+Ee*2**24;return BigInt(We)+(BigInt(Qe)<>>0,ae(ue,"offset");let ie=this[ue],Ee=this[ue+7];(ie===void 0||Ee===void 0)&&j(ue,this.length-8);let We=ie*2**24+this[++ue]*2**16+this[++ue]*2**8+this[++ue],Qe=this[++ue]*2**24+this[++ue]*2**16+this[++ue]*2**8+Ee;return(BigInt(We)<>>0,ie=ie>>>0,Ee||U(ue,ie,this.length);let We=this[ue],Qe=1,Xe=0;for(;++Xe=Qe&&(We-=Math.pow(2,8*ie)),We},t.prototype.readIntBE=function(ue,ie,Ee){ue=ue>>>0,ie=ie>>>0,Ee||U(ue,ie,this.length);let We=ie,Qe=1,Xe=this[ue+--We];for(;We>0&&(Qe*=256);)Xe+=this[ue+--We]*Qe;return Qe*=128,Xe>=Qe&&(Xe-=Math.pow(2,8*ie)),Xe},t.prototype.readInt8=function(ue,ie){return ue=ue>>>0,ie||U(ue,1,this.length),this[ue]&128?(255-this[ue]+1)*-1:this[ue]},t.prototype.readInt16LE=function(ue,ie){ue=ue>>>0,ie||U(ue,2,this.length);let Ee=this[ue]|this[ue+1]<<8;return Ee&32768?Ee|4294901760:Ee},t.prototype.readInt16BE=function(ue,ie){ue=ue>>>0,ie||U(ue,2,this.length);let Ee=this[ue+1]|this[ue]<<8;return Ee&32768?Ee|4294901760:Ee},t.prototype.readInt32LE=function(ue,ie){return ue=ue>>>0,ie||U(ue,4,this.length),this[ue]|this[ue+1]<<8|this[ue+2]<<16|this[ue+3]<<24},t.prototype.readInt32BE=function(ue,ie){return ue=ue>>>0,ie||U(ue,4,this.length),this[ue]<<24|this[ue+1]<<16|this[ue+2]<<8|this[ue+3]},t.prototype.readBigInt64LE=$e(function(ue){ue=ue>>>0,ae(ue,"offset");let ie=this[ue],Ee=this[ue+7];(ie===void 0||Ee===void 0)&&j(ue,this.length-8);let We=this[ue+4]+this[ue+5]*2**8+this[ue+6]*2**16+(Ee<<24);return(BigInt(We)<>>0,ae(ue,"offset");let ie=this[ue],Ee=this[ue+7];(ie===void 0||Ee===void 0)&&j(ue,this.length-8);let We=(ie<<24)+this[++ue]*2**16+this[++ue]*2**8+this[++ue];return(BigInt(We)<>>0,ie||U(ue,4,this.length),d.read(this,ue,!0,23,4)},t.prototype.readFloatBE=function(ue,ie){return ue=ue>>>0,ie||U(ue,4,this.length),d.read(this,ue,!1,23,4)},t.prototype.readDoubleLE=function(ue,ie){return ue=ue>>>0,ie||U(ue,8,this.length),d.read(this,ue,!0,52,8)},t.prototype.readDoubleBE=function(ue,ie){return ue=ue>>>0,ie||U(ue,8,this.length),d.read(this,ue,!1,52,8)};function B(fe,ue,ie,Ee,We,Qe){if(!t.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ue>We||uefe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(ue,ie,Ee,We){if(ue=+ue,ie=ie>>>0,Ee=Ee>>>0,!We){let Tt=Math.pow(2,8*Ee)-1;B(this,ue,ie,Ee,Tt,0)}let Qe=1,Xe=0;for(this[ie]=ue&255;++Xe>>0,Ee=Ee>>>0,!We){let Tt=Math.pow(2,8*Ee)-1;B(this,ue,ie,Ee,Tt,0)}let Qe=Ee-1,Xe=1;for(this[ie+Qe]=ue&255;--Qe>=0&&(Xe*=256);)this[ie+Qe]=ue/Xe&255;return ie+Ee},t.prototype.writeUint8=t.prototype.writeUInt8=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,1,255,0),this[ie]=ue&255,ie+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,2,65535,0),this[ie]=ue&255,this[ie+1]=ue>>>8,ie+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,2,65535,0),this[ie]=ue>>>8,this[ie+1]=ue&255,ie+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,4,4294967295,0),this[ie+3]=ue>>>24,this[ie+2]=ue>>>16,this[ie+1]=ue>>>8,this[ie]=ue&255,ie+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,4,4294967295,0),this[ie]=ue>>>24,this[ie+1]=ue>>>16,this[ie+2]=ue>>>8,this[ie+3]=ue&255,ie+4};function X(fe,ue,ie,Ee,We){se(ue,Ee,We,fe,ie,7);let Qe=Number(ue&BigInt(4294967295));fe[ie++]=Qe,Qe=Qe>>8,fe[ie++]=Qe,Qe=Qe>>8,fe[ie++]=Qe,Qe=Qe>>8,fe[ie++]=Qe;let Xe=Number(ue>>BigInt(32)&BigInt(4294967295));return fe[ie++]=Xe,Xe=Xe>>8,fe[ie++]=Xe,Xe=Xe>>8,fe[ie++]=Xe,Xe=Xe>>8,fe[ie++]=Xe,ie}function $(fe,ue,ie,Ee,We){se(ue,Ee,We,fe,ie,7);let Qe=Number(ue&BigInt(4294967295));fe[ie+7]=Qe,Qe=Qe>>8,fe[ie+6]=Qe,Qe=Qe>>8,fe[ie+5]=Qe,Qe=Qe>>8,fe[ie+4]=Qe;let Xe=Number(ue>>BigInt(32)&BigInt(4294967295));return fe[ie+3]=Xe,Xe=Xe>>8,fe[ie+2]=Xe,Xe=Xe>>8,fe[ie+1]=Xe,Xe=Xe>>8,fe[ie]=Xe,ie+8}t.prototype.writeBigUInt64LE=$e(function(ue,ie=0){return X(this,ue,ie,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=$e(function(ue,ie=0){return $(this,ue,ie,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(ue,ie,Ee,We){if(ue=+ue,ie=ie>>>0,!We){let St=Math.pow(2,8*Ee-1);B(this,ue,ie,Ee,St-1,-St)}let Qe=0,Xe=1,Tt=0;for(this[ie]=ue&255;++Qe>0)-Tt&255;return ie+Ee},t.prototype.writeIntBE=function(ue,ie,Ee,We){if(ue=+ue,ie=ie>>>0,!We){let St=Math.pow(2,8*Ee-1);B(this,ue,ie,Ee,St-1,-St)}let Qe=Ee-1,Xe=1,Tt=0;for(this[ie+Qe]=ue&255;--Qe>=0&&(Xe*=256);)ue<0&&Tt===0&&this[ie+Qe+1]!==0&&(Tt=1),this[ie+Qe]=(ue/Xe>>0)-Tt&255;return ie+Ee},t.prototype.writeInt8=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,1,127,-128),ue<0&&(ue=255+ue+1),this[ie]=ue&255,ie+1},t.prototype.writeInt16LE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,2,32767,-32768),this[ie]=ue&255,this[ie+1]=ue>>>8,ie+2},t.prototype.writeInt16BE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,2,32767,-32768),this[ie]=ue>>>8,this[ie+1]=ue&255,ie+2},t.prototype.writeInt32LE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,4,2147483647,-2147483648),this[ie]=ue&255,this[ie+1]=ue>>>8,this[ie+2]=ue>>>16,this[ie+3]=ue>>>24,ie+4},t.prototype.writeInt32BE=function(ue,ie,Ee){return ue=+ue,ie=ie>>>0,Ee||B(this,ue,ie,4,2147483647,-2147483648),ue<0&&(ue=4294967295+ue+1),this[ie]=ue>>>24,this[ie+1]=ue>>>16,this[ie+2]=ue>>>8,this[ie+3]=ue&255,ie+4},t.prototype.writeBigInt64LE=$e(function(ue,ie=0){return X(this,ue,ie,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=$e(function(ue,ie=0){return $(this,ue,ie,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function le(fe,ue,ie,Ee,We,Qe){if(ie+Ee>fe.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("Index out of range")}function ce(fe,ue,ie,Ee,We){return ue=+ue,ie=ie>>>0,We||le(fe,ue,ie,4,34028234663852886e22,-34028234663852886e22),d.write(fe,ue,ie,Ee,23,4),ie+4}t.prototype.writeFloatLE=function(ue,ie,Ee){return ce(this,ue,ie,!0,Ee)},t.prototype.writeFloatBE=function(ue,ie,Ee){return ce(this,ue,ie,!1,Ee)};function ve(fe,ue,ie,Ee,We){return ue=+ue,ie=ie>>>0,We||le(fe,ue,ie,8,17976931348623157e292,-17976931348623157e292),d.write(fe,ue,ie,Ee,52,8),ie+8}t.prototype.writeDoubleLE=function(ue,ie,Ee){return ve(this,ue,ie,!0,Ee)},t.prototype.writeDoubleBE=function(ue,ie,Ee){return ve(this,ue,ie,!1,Ee)},t.prototype.copy=function(ue,ie,Ee,We){if(!t.isBuffer(ue))throw new TypeError("argument should be a Buffer");if(Ee||(Ee=0),!We&&We!==0&&(We=this.length),ie>=ue.length&&(ie=ue.length),ie||(ie=0),We>0&&We=this.length)throw new RangeError("Index out of range");if(We<0)throw new RangeError("sourceEnd out of bounds");We>this.length&&(We=this.length),ue.length-ie>>0,Ee=Ee===void 0?this.length:Ee>>>0,ue||(ue=0);let Qe;if(typeof ue=="number")for(Qe=ie;Qe2**32?We=ee(String(ie)):typeof ie=="bigint"&&(We=String(ie),(ie>BigInt(2)**BigInt(32)||ie<-(BigInt(2)**BigInt(32)))&&(We=ee(We)),We+="n"),Ee+=` It must be ${ue}. Received ${We}`,Ee},RangeError);function ee(fe){let ue="",ie=fe.length,Ee=fe[0]==="-"?1:0;for(;ie>=Ee+4;ie-=3)ue=`_${fe.slice(ie-3,ie)}${ue}`;return`${fe.slice(0,ie)}${ue}`}function V(fe,ue,ie){ae(ue,"offset"),(fe[ue]===void 0||fe[ue+ie]===void 0)&&j(ue,fe.length-(ie+1))}function se(fe,ue,ie,Ee,We,Qe){if(fe>ie||fe3?ue===0||ue===BigInt(0)?Tt=`>= 0${Xe} and < 2${Xe} ** ${(Qe+1)*8}${Xe}`:Tt=`>= -(2${Xe} ** ${(Qe+1)*8-1}${Xe}) and < 2 ** ${(Qe+1)*8-1}${Xe}`:Tt=`>= ${ue}${Xe} and <= ${ie}${Xe}`,new G.ERR_OUT_OF_RANGE("value",Tt,fe)}V(Ee,We,Qe)}function ae(fe,ue){if(typeof fe!="number")throw new G.ERR_INVALID_ARG_TYPE(ue,"number",fe)}function j(fe,ue,ie){throw Math.floor(fe)!==fe?(ae(fe,ie),new G.ERR_OUT_OF_RANGE(ie||"offset","an integer",fe)):ue<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(ie||"offset",`>= ${ie?1:0} and <= ${ue}`,fe)}var Q=/[^+/0-9A-Za-z-_]/g;function re(fe){if(fe=fe.split("=")[0],fe=fe.trim().replace(Q,""),fe.length<2)return"";for(;fe.length%4!==0;)fe=fe+"=";return fe}function he(fe,ue){ue=ue||1/0;let ie,Ee=fe.length,We=null,Qe=[];for(let Xe=0;Xe55295&&ie<57344){if(!We){if(ie>56319){(ue-=3)>-1&&Qe.push(239,191,189);continue}else if(Xe+1===Ee){(ue-=3)>-1&&Qe.push(239,191,189);continue}We=ie;continue}if(ie<56320){(ue-=3)>-1&&Qe.push(239,191,189),We=ie;continue}ie=(We-55296<<10|ie-56320)+65536}else We&&(ue-=3)>-1&&Qe.push(239,191,189);if(We=null,ie<128){if((ue-=1)<0)break;Qe.push(ie)}else if(ie<2048){if((ue-=2)<0)break;Qe.push(ie>>6|192,ie&63|128)}else if(ie<65536){if((ue-=3)<0)break;Qe.push(ie>>12|224,ie>>6&63|128,ie&63|128)}else if(ie<1114112){if((ue-=4)<0)break;Qe.push(ie>>18|240,ie>>12&63|128,ie>>6&63|128,ie&63|128)}else throw new Error("Invalid code point")}return Qe}function xe(fe){let ue=[];for(let ie=0;ie>8,We=ie%256,Qe.push(We),Qe.push(Ee);return Qe}function Le(fe){return q.toByteArray(re(fe))}function Pe(fe,ue,ie,Ee){let We;for(We=0;We=ue.length||We>=fe.length);++We)ue[We+ie]=fe[We];return We}function qe(fe,ue){return fe instanceof ue||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===ue.name}function et(fe){return fe!==fe}var rt=(function(){let fe="0123456789abcdef",ue=new Array(256);for(let ie=0;ie<16;++ie){let Ee=ie*16;for(let We=0;We<16;++We)ue[Ee+We]=fe[ie]+fe[We]}return ue})();function $e(fe){return typeof BigInt>"u"?Ue:fe}function Ue(){throw new Error("BigInt not supported")}}}),V1=Ge({"node_modules/has-symbols/shams.js"(Z,q){"use strict";q.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},S=Symbol("test"),E=Object(S);if(typeof S=="string"||Object.prototype.toString.call(S)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;x[S]=e;for(var t in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var r=Object.getOwnPropertySymbols(x);if(r.length!==1||r[0]!==S||!Object.prototype.propertyIsEnumerable.call(x,S))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(x,S);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),ug=Ge({"node_modules/has-tostringtag/shams.js"(Z,q){"use strict";var d=V1();q.exports=function(){return d()&&!!Symbol.toStringTag}}}),Bw=Ge({"node_modules/es-object-atoms/index.js"(Z,q){"use strict";q.exports=Object}}),t6=Ge({"node_modules/es-errors/index.js"(Z,q){"use strict";q.exports=Error}}),r6=Ge({"node_modules/es-errors/eval.js"(Z,q){"use strict";q.exports=EvalError}}),a6=Ge({"node_modules/es-errors/range.js"(Z,q){"use strict";q.exports=RangeError}}),n6=Ge({"node_modules/es-errors/ref.js"(Z,q){"use strict";q.exports=ReferenceError}}),Nw=Ge({"node_modules/es-errors/syntax.js"(Z,q){"use strict";q.exports=SyntaxError}}),Y0=Ge({"node_modules/es-errors/type.js"(Z,q){"use strict";q.exports=TypeError}}),i6=Ge({"node_modules/es-errors/uri.js"(Z,q){"use strict";q.exports=URIError}}),o6=Ge({"node_modules/math-intrinsics/abs.js"(Z,q){"use strict";q.exports=Math.abs}}),s6=Ge({"node_modules/math-intrinsics/floor.js"(Z,q){"use strict";q.exports=Math.floor}}),l6=Ge({"node_modules/math-intrinsics/max.js"(Z,q){"use strict";q.exports=Math.max}}),u6=Ge({"node_modules/math-intrinsics/min.js"(Z,q){"use strict";q.exports=Math.min}}),c6=Ge({"node_modules/math-intrinsics/pow.js"(Z,q){"use strict";q.exports=Math.pow}}),f6=Ge({"node_modules/math-intrinsics/round.js"(Z,q){"use strict";q.exports=Math.round}}),h6=Ge({"node_modules/math-intrinsics/isNaN.js"(Z,q){"use strict";q.exports=Number.isNaN||function(x){return x!==x}}}),v6=Ge({"node_modules/math-intrinsics/sign.js"(Z,q){"use strict";var d=h6();q.exports=function(S){return d(S)||S===0?S:S<0?-1:1}}}),d6=Ge({"node_modules/gopd/gOPD.js"(Z,q){"use strict";q.exports=Object.getOwnPropertyDescriptor}}),Dp=Ge({"node_modules/gopd/index.js"(Z,q){"use strict";var d=d6();if(d)try{d([],"length")}catch{d=null}q.exports=d}}),cg=Ge({"node_modules/es-define-property/index.js"(Z,q){"use strict";var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}q.exports=d}}),p6=Ge({"node_modules/has-symbols/index.js"(Z,q){"use strict";var d=typeof Symbol<"u"&&Symbol,x=V1();q.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),Uw=Ge({"node_modules/get-proto/Reflect.getPrototypeOf.js"(Z,q){"use strict";q.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),jw=Ge({"node_modules/get-proto/Object.getPrototypeOf.js"(Z,q){"use strict";var d=Bw();q.exports=d.getPrototypeOf||null}}),m6=Ge({"node_modules/function-bind/implementation.js"(Z,q){"use strict";var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,S=Math.max,E="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!b?d:b(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":E,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!g||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):d,"%Symbol%":g?Symbol:d,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":m,"%Function.prototype.apply%":y,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":v,"%Math.abs%":i,"%Math.floor%":n,"%Math.max%":s,"%Math.min%":h,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":c,"%Reflect.getPrototypeOf%":u};if(b)try{null.error}catch(V){F=b(b(V)),z["%Error.prototype%"]=F}var F,N=function V(se){var ae;if(se==="%AsyncFunction%")ae=l("async function () {}");else if(se==="%GeneratorFunction%")ae=l("function* () {}");else if(se==="%AsyncGeneratorFunction%")ae=l("async function* () {}");else if(se==="%AsyncGenerator%"){var j=V("%AsyncGeneratorFunction%");j&&(ae=j.prototype)}else if(se==="%AsyncIteratorPrototype%"){var Q=V("%AsyncGenerator%");Q&&b&&(ae=b(Q.prototype))}return z[se]=ae,ae},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=K0(),U=w6(),B=P.call(m,Array.prototype.concat),X=P.call(y,Array.prototype.splice),$=P.call(m,String.prototype.replace),le=P.call(m,String.prototype.slice),ce=P.call(m,RegExp.prototype.exec),ve=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,Y=function(se){var ae=le(se,0,1),j=le(se,-1);if(ae==="%"&&j!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&ae!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Q=[];return $(se,ve,function(re,he,xe,Te){Q[Q.length]=xe?$(Te,G,"$1"):he||re}),Q},ee=function(se,ae){var j=se,Q;if(U(O,j)&&(Q=O[j],j="%"+Q[0]+"%"),U(z,j)){var re=z[j];if(re===R&&(re=N(j)),typeof re>"u"&&!ae)throw new o("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:Q,name:j,value:re}}throw new r("intrinsic "+se+" does not exist!")};q.exports=function(se,ae){if(typeof se!="string"||se.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ae!="boolean")throw new o('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,se)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=Y(se),Q=j.length>0?j[0]:"",re=ee("%"+Q+"%",ae),he=re.name,xe=re.value,Te=!1,Le=re.alias;Le&&(Q=Le[0],X(j,B([0,1],Le)));for(var Pe=1,qe=!0;Pe=j.length){var Ue=_(xe,et);qe=!!Ue,qe&&"get"in Ue&&!("originalValue"in Ue.get)?xe=Ue.get:xe=xe[et]}else qe=U(xe,et),xe=xe[et];qe&&!Te&&(z[he]=xe)}}return xe}}}),T6=Ge({"node_modules/define-data-property/index.js"(Z,q){"use strict";var d=cg(),x=Nw(),S=Y0(),E=Dp();q.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new S("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new S("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!E&&E(t,r);if(d)d(t,r,{configurable:n===null&&h?h.configurable:!n,enumerable:a===null&&h?h.enumerable:!a,value:o,writable:i===null&&h?h.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),qw=Ge({"node_modules/has-property-descriptors/index.js"(Z,q){"use strict";var d=cg(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},q.exports=x}}),A6=Ge({"node_modules/set-function-length/index.js"(Z,q){"use strict";var d=G1(),x=T6(),S=qw()(),E=Dp(),e=Y0(),t=d("%Math.floor%");q.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&E){var h=E(o,"length");h&&!h.configurable&&(n=!1),h&&!h.writable&&(s=!1)}return(n||s||!i)&&(S?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),fg=Ge({"node_modules/call-bind/index.js"(Z,q){"use strict";var d=K0(),x=G1(),S=A6(),E=Y0(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=cg(),a=x("%Math.max%");q.exports=function(s){if(typeof s!="function")throw new E("a function is required");var h=r(d,t,arguments);return S(h,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(q.exports,"apply",{value:i}):q.exports.apply=i}}),J0=Ge({"node_modules/call-bind/callBound.js"(Z,q){"use strict";var d=G1(),x=fg(),S=x(d("String.prototype.indexOf"));q.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&S(e,".prototype.")>-1?x(r):r}}}),S6=Ge({"node_modules/is-arguments/index.js"(Z,q){"use strict";var d=ug()(),x=J0(),S=x("Object.prototype.toString"),E=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:S(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&S(o)!=="[object Array]"&&S(o.callee)==="[object Function]"},t=(function(){return E(arguments)})();E.isLegacyArguments=e,q.exports=t?E:e}}),M6=Ge({"node_modules/is-generator-function/index.js"(Z,q){"use strict";var d=Object.prototype.toString,x=Function.prototype.toString,S=/^\s*(?:function)?\*/,E=ug()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;q.exports=function(a){if(typeof a!="function")return!1;if(S.test(x.call(a)))return!0;if(!E){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),E6=Ge({"node_modules/is-callable/index.js"(Z,q){"use strict";var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S,E;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{S=Object.defineProperty({},"length",{get:function(){throw E}}),E={},x(function(){throw 42},null,S)}catch(_){_!==E&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(w){try{var A=d.call(w);return e.test(A)}catch{return!1}},r=function(w){try{return t(w)?!1:(d.call(w),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",h="[object HTML document.all class]",f="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,c=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(w){if((c||!w)&&(typeof w>"u"||typeof w=="object"))try{var A=o.call(w);return(A===s||A===h||A===f||A===a)&&w("")==null}catch{}return!1}));var l;q.exports=x?function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{x(w,null,S)}catch(A){if(A!==E)return!1}return!t(w)&&r(w)}:function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(p)return r(w);if(t(w))return!1;var A=o.call(w);return A!==i&&A!==n&&!/^\[object HTML/.test(A)?!1:r(w)}}}),Gw=Ge({"node_modules/for-each/index.js"(Z,q){"use strict";var d=E6(),x=Object.prototype.toString,S=Object.prototype.hasOwnProperty,E=function(a,i,n){for(var s=0,h=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?E(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};q.exports=r}}),Hw=Ge({"node_modules/available-typed-arrays/index.js"(Z,q){"use strict";var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;q.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,a=x(),i=E("String.prototype.slice"),n=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var _=0;_-1?l:l!=="Object"?!1:p(T)}return e?f(T):null}}}),C6=Ge({"node_modules/is-typed-array/index.js"(Z,q){"use strict";var d=Gw(),x=Hw(),S=J0(),E=S("Object.prototype.toString"),e=ug()(),t=Dp(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=S("Array.prototype.indexOf",!0)||function(p,c){for(var T=0;T-1}return t?h(p):!1}}}),Ww=Ge({"node_modules/util/support/types.js"(Z){"use strict";var q=S6(),d=M6(),x=k6(),S=C6();function E(Te){return Te.call.bind(Te)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),a=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(n=E(BigInt.prototype.valueOf));var n;t&&(s=E(Symbol.prototype.valueOf));var s;function h(Te,Le){if(typeof Te!="object")return!1;try{return Le(Te),!0}catch{return!1}}Z.isArgumentsObject=q,Z.isGeneratorFunction=d,Z.isTypedArray=S;function f(Te){return typeof Promise<"u"&&Te instanceof Promise||Te!==null&&typeof Te=="object"&&typeof Te.then=="function"&&typeof Te.catch=="function"}Z.isPromise=f;function p(Te){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Te):S(Te)||X(Te)}Z.isArrayBufferView=p;function c(Te){return x(Te)==="Uint8Array"}Z.isUint8Array=c;function T(Te){return x(Te)==="Uint8ClampedArray"}Z.isUint8ClampedArray=T;function l(Te){return x(Te)==="Uint16Array"}Z.isUint16Array=l;function _(Te){return x(Te)==="Uint32Array"}Z.isUint32Array=_;function w(Te){return x(Te)==="Int8Array"}Z.isInt8Array=w;function A(Te){return x(Te)==="Int16Array"}Z.isInt16Array=A;function M(Te){return x(Te)==="Int32Array"}Z.isInt32Array=M;function g(Te){return x(Te)==="Float32Array"}Z.isFloat32Array=g;function b(Te){return x(Te)==="Float64Array"}Z.isFloat64Array=b;function v(Te){return x(Te)==="BigInt64Array"}Z.isBigInt64Array=v;function u(Te){return x(Te)==="BigUint64Array"}Z.isBigUint64Array=u;function y(Te){return r(Te)==="[object Map]"}y.working=typeof Map<"u"&&y(new Map);function m(Te){return typeof Map>"u"?!1:y.working?y(Te):Te instanceof Map}Z.isMap=m;function R(Te){return r(Te)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function L(Te){return typeof Set>"u"?!1:R.working?R(Te):Te instanceof Set}Z.isSet=L;function z(Te){return r(Te)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Te){return typeof WeakMap>"u"?!1:z.working?z(Te):Te instanceof WeakMap}Z.isWeakMap=F;function N(Te){return r(Te)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function O(Te){return N(Te)}Z.isWeakSet=O;function P(Te){return r(Te)==="[object ArrayBuffer]"}P.working=typeof ArrayBuffer<"u"&&P(new ArrayBuffer);function U(Te){return typeof ArrayBuffer>"u"?!1:P.working?P(Te):Te instanceof ArrayBuffer}Z.isArrayBuffer=U;function B(Te){return r(Te)==="[object DataView]"}B.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&B(new DataView(new ArrayBuffer(1),0,1));function X(Te){return typeof DataView>"u"?!1:B.working?B(Te):Te instanceof DataView}Z.isDataView=X;var $=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function le(Te){return r(Te)==="[object SharedArrayBuffer]"}function ce(Te){return typeof $>"u"?!1:(typeof le.working>"u"&&(le.working=le(new $)),le.working?le(Te):Te instanceof $)}Z.isSharedArrayBuffer=ce;function ve(Te){return r(Te)==="[object AsyncFunction]"}Z.isAsyncFunction=ve;function G(Te){return r(Te)==="[object Map Iterator]"}Z.isMapIterator=G;function Y(Te){return r(Te)==="[object Set Iterator]"}Z.isSetIterator=Y;function ee(Te){return r(Te)==="[object Generator]"}Z.isGeneratorObject=ee;function V(Te){return r(Te)==="[object WebAssembly.Module]"}Z.isWebAssemblyCompiledModule=V;function se(Te){return h(Te,o)}Z.isNumberObject=se;function ae(Te){return h(Te,a)}Z.isStringObject=ae;function j(Te){return h(Te,i)}Z.isBooleanObject=j;function Q(Te){return e&&h(Te,n)}Z.isBigIntObject=Q;function re(Te){return t&&h(Te,s)}Z.isSymbolObject=re;function he(Te){return se(Te)||ae(Te)||j(Te)||Q(Te)||re(Te)}Z.isBoxedPrimitive=he;function xe(Te){return typeof Uint8Array<"u"&&(U(Te)||ce(Te))}Z.isAnyArrayBuffer=xe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Te){Object.defineProperty(Z,Te,{enumerable:!1,value:function(){throw new Error(Te+" is not supported in userland")}})})}}),Xw=Ge({"node_modules/util/support/isBufferBrowser.js"(Z,q){q.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),Zw=Ge({"(disabled):node_modules/util/util.js"(Z){var q=Object.getOwnPropertyDescriptors||function(X){for(var $=Object.keys(X),le={},ce=0;ce<$.length;ce++)le[$[ce]]=Object.getOwnPropertyDescriptor(X,$[ce]);return le},d=/%[sdj%]/g;Z.format=function(B){if(!w(B)){for(var X=[],$=0;$=ce)return Y;switch(Y){case"%s":return String(le[$++]);case"%d":return Number(le[$++]);case"%j":try{return JSON.stringify(le[$++])}catch{return"[Circular]"}default:return Y}}),G=le[$];$"u")return function(){return Z.deprecate(B,X).apply(this,arguments)};var $=!1;function le(){if(!$){if(process.throwDeprecation)throw new Error(X);process.traceDeprecation?console.trace(X):console.error(X),$=!0}return B.apply(this,arguments)}return le};var x={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;Z.debuglog=function(B){if(B=B.toUpperCase(),!x[B])if(S.test(B)){var X=process.pid;x[B]=function(){var $=Z.format.apply(Z,arguments);console.error("%s %d: %s",B,X,$)}}else x[B]=function(){};return x[B]};function e(B,X){var $={seen:[],stylize:r};return arguments.length>=3&&($.depth=arguments[2]),arguments.length>=4&&($.colors=arguments[3]),c(X)?$.showHidden=X:X&&Z._extend($,X),M($.showHidden)&&($.showHidden=!1),M($.depth)&&($.depth=2),M($.colors)&&($.colors=!1),M($.customInspect)&&($.customInspect=!0),$.colors&&($.stylize=t),a($,B,$.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(B,X){var $=e.styles[X];return $?"\x1B["+e.colors[$][0]+"m"+B+"\x1B["+e.colors[$][1]+"m":B}function r(B,X){return B}function o(B){var X={};return B.forEach(function($,le){X[$]=!0}),X}function a(B,X,$){if(B.customInspect&&X&&y(X.inspect)&&X.inspect!==Z.inspect&&!(X.constructor&&X.constructor.prototype===X)){var le=X.inspect($,B);return w(le)||(le=a(B,le,$)),le}var ce=i(B,X);if(ce)return ce;var ve=Object.keys(X),G=o(ve);if(B.showHidden&&(ve=Object.getOwnPropertyNames(X)),u(X)&&(ve.indexOf("message")>=0||ve.indexOf("description")>=0))return n(X);if(ve.length===0){if(y(X)){var Y=X.name?": "+X.name:"";return B.stylize("[Function"+Y+"]","special")}if(g(X))return B.stylize(RegExp.prototype.toString.call(X),"regexp");if(v(X))return B.stylize(Date.prototype.toString.call(X),"date");if(u(X))return n(X)}var ee="",V=!1,se=["{","}"];if(p(X)&&(V=!0,se=["[","]"]),y(X)){var ae=X.name?": "+X.name:"";ee=" [Function"+ae+"]"}if(g(X)&&(ee=" "+RegExp.prototype.toString.call(X)),v(X)&&(ee=" "+Date.prototype.toUTCString.call(X)),u(X)&&(ee=" "+n(X)),ve.length===0&&(!V||X.length==0))return se[0]+ee+se[1];if($<0)return g(X)?B.stylize(RegExp.prototype.toString.call(X),"regexp"):B.stylize("[Object]","special");B.seen.push(X);var j;return V?j=s(B,X,$,G,ve):j=ve.map(function(Q){return h(B,X,$,G,Q,V)}),B.seen.pop(),f(j,ee,se)}function i(B,X){if(M(X))return B.stylize("undefined","undefined");if(w(X)){var $="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize($,"string")}if(_(X))return B.stylize(""+X,"number");if(c(X))return B.stylize(""+X,"boolean");if(T(X))return B.stylize("null","null")}function n(B){return"["+Error.prototype.toString.call(B)+"]"}function s(B,X,$,le,ce){for(var ve=[],G=0,Y=X.length;G-1&&(ve?Y=Y.split(` +`).map(function(V){return" "+V}).join(` +`).slice(2):Y=` +`+Y.split(` +`).map(function(V){return" "+V}).join(` +`))):Y=B.stylize("[Circular]","special")),M(G)){if(ve&&ce.match(/^\d+$/))return Y;G=JSON.stringify(""+ce),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(G=G.slice(1,-1),G=B.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=B.stylize(G,"string"))}return G+": "+Y}function f(B,X,$){var le=0,ce=B.reduce(function(ve,G){return le++,G.indexOf(` +`)>=0&&le++,ve+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ce>60?$[0]+(X===""?"":X+` + `)+" "+B.join(`, + `)+" "+$[1]:$[0]+X+" "+B.join(", ")+" "+$[1]}Z.types=Ww();function p(B){return Array.isArray(B)}Z.isArray=p;function c(B){return typeof B=="boolean"}Z.isBoolean=c;function T(B){return B===null}Z.isNull=T;function l(B){return B==null}Z.isNullOrUndefined=l;function _(B){return typeof B=="number"}Z.isNumber=_;function w(B){return typeof B=="string"}Z.isString=w;function A(B){return typeof B=="symbol"}Z.isSymbol=A;function M(B){return B===void 0}Z.isUndefined=M;function g(B){return b(B)&&R(B)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;function b(B){return typeof B=="object"&&B!==null}Z.isObject=b;function v(B){return b(B)&&R(B)==="[object Date]"}Z.isDate=v,Z.types.isDate=v;function u(B){return b(B)&&(R(B)==="[object Error]"||B instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function y(B){return typeof B=="function"}Z.isFunction=y;function m(B){return B===null||typeof B=="boolean"||typeof B=="number"||typeof B=="string"||typeof B=="symbol"||typeof B>"u"}Z.isPrimitive=m,Z.isBuffer=Xw();function R(B){return Object.prototype.toString.call(B)}function L(B){return B<10?"0"+B.toString(10):B.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var B=new Date,X=[L(B.getHours()),L(B.getMinutes()),L(B.getSeconds())].join(":");return[B.getDate(),z[B.getMonth()],X].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=ed(),Z._extend=function(B,X){if(!X||!b(X))return B;for(var $=Object.keys(X),le=$.length;le--;)B[$[le]]=X[$[le]];return B};function N(B,X){return Object.prototype.hasOwnProperty.call(B,X)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(X){if(typeof X!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&X[O]){var $=X[O];if(typeof $!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty($,O,{value:$,enumerable:!1,writable:!1,configurable:!0}),$}function $(){for(var le,ce,ve=new Promise(function(ee,V){le=ee,ce=V}),G=[],Y=0;Y0?this.tail.next=c:this.head=c,this.tail=c,++this.length}},{key:"unshift",value:function(p){var c={data:p,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var c=this.head,T=""+c.data;c=c.next;)T+=p+c.data;return T}},{key:"concat",value:function(p){if(this.length===0)return o.alloc(0);for(var c=o.allocUnsafe(p>>>0),T=this.head,l=0;T;)s(T.data,c,l),l+=T.data.length,T=T.next;return c}},{key:"consume",value:function(p,c){var T;return p_.length?_.length:p;if(w===_.length?l+=_:l+=_.slice(0,p),p-=w,p===0){w===_.length?(++T,c.next?this.head=c.next:this.head=this.tail=null):(this.head=c,c.data=_.slice(w));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(p){var c=o.allocUnsafe(p),T=this.head,l=1;for(T.data.copy(c),p-=T.data.length;T=T.next;){var _=T.data,w=p>_.length?_.length:p;if(_.copy(c,c.length-p,0,w),p-=w,p===0){w===_.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=_.slice(w));break}++l}return this.length-=l,c}},{key:n,value:function(p,c){return i(this,x({},c,{depth:0,customInspect:!1}))}}]),h})()}}),Yw=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Z,q){"use strict";function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(S,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(S,a),o(s)):process.nextTick(S,a)}),this)}function x(r,o){e(r,o),S(r)}function S(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}q.exports={destroy:d,undestroy:E,errorOrDestroy:t}}}),zp=Ge({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Z,q){"use strict";function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function S(o,a,i){i||(i=Error);function n(h,f,p){return typeof a=="string"?a:a(h,f,p)}var s=(function(h){d(f,h);function f(p,c,T){return h.call(this,n(p,c,T))||this}return f})(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function E(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(!i||i<0?0:+i,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}S("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),S("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(E(a,"type"));else{var h=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(h," ").concat(n," ").concat(E(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),S("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),S("ERR_STREAM_PREMATURE_CLOSE","Premature close"),S("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),S("ERR_STREAM_WRITE_AFTER_END","write after end"),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),q.exports.codes=x}}),Kw=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Z,q){"use strict";var d=zp().codes.ERR_INVALID_OPT_VALUE;function x(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function S(E,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return E.objectMode?16:16*1024}q.exports={getHighWaterMark:S}}}),P6=Ge({"node_modules/util-deprecate/browser.js"(Z,q){q.exports=d;function d(S,E){if(x("noDeprecation"))return S;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(E);x("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return S.apply(this,arguments)}return t}function x(S){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[S];return E==null?!1:String(E).toLowerCase()==="true"}}}),Jw=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Z,q){"use strict";q.exports=v;function d(G){var Y=this;this.next=null,this.entry=null,this.finish=function(){ve(Y,G)}}var x;v.WritableState=g;var S={deprecate:P6()},E=Ow(),e=Rp().Buffer,t=window.Uint8Array||function(){};function r(G){return e.from(G)}function o(G){return e.isBuffer(G)||G instanceof t}var a=Yw(),i=Kw(),n=i.getHighWaterMark,s=zp().codes,h=s.ERR_INVALID_ARG_TYPE,f=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,c=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,_=s.ERR_STREAM_WRITE_AFTER_END,w=s.ERR_UNKNOWN_ENCODING,A=a.errorOrDestroy;ed()(v,E);function M(){}function g(G,Y,ee){x=x||Fp(),G=G||{},typeof ee!="boolean"&&(ee=Y instanceof x),this.objectMode=!!G.objectMode,ee&&(this.objectMode=this.objectMode||!!G.writableObjectMode),this.highWaterMark=n(this,G,"writableHighWaterMark",ee),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=G.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(se){N(Y,se)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}g.prototype.getBuffer=function(){for(var Y=this.bufferedRequest,ee=[];Y;)ee.push(Y),Y=Y.next;return ee},(function(){try{Object.defineProperty(g.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var b;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(Y){return b.call(this,Y)?!0:this!==v?!1:Y&&Y._writableState instanceof g}})):b=function(Y){return Y instanceof this};function v(G){x=x||Fp();var Y=this instanceof x;if(!Y&&!b.call(v,this))return new v(G);this._writableState=new g(G,this,Y),this.writable=!0,G&&(typeof G.write=="function"&&(this._write=G.write),typeof G.writev=="function"&&(this._writev=G.writev),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.final=="function"&&(this._final=G.final)),E.call(this)}v.prototype.pipe=function(){A(this,new c)};function u(G,Y){var ee=new _;A(G,ee),process.nextTick(Y,ee)}function y(G,Y,ee,V){var se;return ee===null?se=new l:typeof ee!="string"&&!Y.objectMode&&(se=new h("chunk",["string","Buffer"],ee)),se?(A(G,se),process.nextTick(V,se),!1):!0}v.prototype.write=function(G,Y,ee){var V=this._writableState,se=!1,ae=!V.objectMode&&o(G);return ae&&!e.isBuffer(G)&&(G=r(G)),typeof Y=="function"&&(ee=Y,Y=null),ae?Y="buffer":Y||(Y=V.defaultEncoding),typeof ee!="function"&&(ee=M),V.ending?u(this,ee):(ae||y(this,V,G,ee))&&(V.pendingcb++,se=R(this,V,ae,G,Y,ee)),se},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,!G.writing&&!G.corked&&!G.bufferProcessing&&G.bufferedRequest&&U(this,G))},v.prototype.setDefaultEncoding=function(Y){if(typeof Y=="string"&&(Y=Y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw new w(Y);return this._writableState.defaultEncoding=Y,this},Object.defineProperty(v.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m(G,Y,ee){return!G.objectMode&&G.decodeStrings!==!1&&typeof Y=="string"&&(Y=e.from(Y,ee)),Y}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(G,Y,ee,V,se,ae){if(!ee){var j=m(Y,V,se);V!==j&&(ee=!0,se="buffer",V=j)}var Q=Y.objectMode?1:V.length;Y.length+=Q;var re=Y.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,_){var w=l.length-1;if(w<_)return 0;var A=e(l[w]);return A>=0?(A>0&&(T.lastNeed=A-1),A):--w<_||A===-2?0:(A=e(l[w]),A>=0?(A>0&&(T.lastNeed=A-2),A):--w<_||A===-2?0:(A=e(l[w]),A>=0?(A>0&&(A===2?A=0:T.lastNeed=A-3),A):0))}function r(T,l,_){if((l[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function o(T){var l=this.lastTotal-this.lastNeed,_=r(this,T,l);if(_!==void 0)return _;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var _=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=_;var w=T.length-(_-this.lastNeed);return T.copy(this.lastChar,0,w),T.toString("utf8",l,w)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"\uFFFD":l}function n(T,l){if((T.length-l)%2===0){var _=T.toString("utf16le",l);if(_){var w=_.charCodeAt(_.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,_)}return l}function h(T,l){var _=(T.length-l)%3;return _===0?T.toString("base64",l):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-_))}function f(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function p(T){return T.toString(this.encoding)}function c(T){return T&&T.length?this.write(T):""}}}),H1=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Z,q){"use strict";var d=zp().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof Q!="string"&&!Te.objectMode&&Object.getPrototypeOf(Q)!==e.prototype&&(Q=r(Q)),he)Te.endEmitted?g(j,new _):R(j,Te,Q,!0);else if(Te.ended)g(j,new T);else{if(Te.destroyed)return!1;Te.reading=!1,Te.decoder&&!re?(Q=Te.decoder.write(Q),Te.objectMode||Q.length!==0?R(j,Te,Q,!1):B(j,Te)):R(j,Te,Q,!1)}else he||(Te.reading=!1,B(j,Te))}return!Te.ended&&(Te.length=z?j=z:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function N(j,Q){return j<=0||Q.length===0&&Q.ended?0:Q.objectMode?1:j!==j?Q.flowing&&Q.length?Q.buffer.head.data.length:Q.length:(j>Q.highWaterMark&&(Q.highWaterMark=F(j)),j<=Q.length?j:Q.ended?Q.length:(Q.needReadable=!0,0))}y.prototype.read=function(j){i("read",j),j=parseInt(j,10);var Q=this._readableState,re=j;if(j!==0&&(Q.emittedReadable=!1),j===0&&Q.needReadable&&((Q.highWaterMark!==0?Q.length>=Q.highWaterMark:Q.length>0)||Q.ended))return i("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended?V(this):P(this),null;if(j=N(j,Q),j===0&&Q.ended)return Q.length===0&&V(this),null;var he=Q.needReadable;i("need readable",he),(Q.length===0||Q.length-j0?xe=ee(j,Q):xe=null,xe===null?(Q.needReadable=Q.length<=Q.highWaterMark,j=0):(Q.length-=j,Q.awaitDrain=0),Q.length===0&&(Q.ended||(Q.needReadable=!0),re!==j&&Q.ended&&V(this)),xe!==null&&this.emit("data",xe),xe};function O(j,Q){if(i("onEofChunk"),!Q.ended){if(Q.decoder){var re=Q.decoder.end();re&&re.length&&(Q.buffer.push(re),Q.length+=Q.objectMode?1:re.length)}Q.ended=!0,Q.sync?P(j):(Q.needReadable=!1,Q.emittedReadable||(Q.emittedReadable=!0,U(j)))}}function P(j){var Q=j._readableState;i("emitReadable",Q.needReadable,Q.emittedReadable),Q.needReadable=!1,Q.emittedReadable||(i("emitReadable",Q.flowing),Q.emittedReadable=!0,process.nextTick(U,j))}function U(j){var Q=j._readableState;i("emitReadable_",Q.destroyed,Q.length,Q.ended),!Q.destroyed&&(Q.length||Q.ended)&&(j.emit("readable"),Q.emittedReadable=!1),Q.needReadable=!Q.flowing&&!Q.ended&&Q.length<=Q.highWaterMark,Y(j)}function B(j,Q){Q.readingMore||(Q.readingMore=!0,process.nextTick(X,j,Q))}function X(j,Q){for(;!Q.reading&&!Q.ended&&(Q.length1&&ae(he.pipes,j)!==-1)&&!et&&(i("false write response, pause",he.awaitDrain),he.awaitDrain++),re.pause())}function Ue(Ee){i("onerror",Ee),ie(),j.removeListener("error",Ue),S(j,"error")===0&&g(j,Ee)}v(j,"error",Ue);function fe(){j.removeListener("finish",ue),ie()}j.once("close",fe);function ue(){i("onfinish"),j.removeListener("close",fe),ie()}j.once("finish",ue);function ie(){i("unpipe"),re.unpipe(j)}return j.emit("pipe",re),he.flowing||(i("pipe resume"),re.resume()),j};function $(j){return function(){var re=j._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,re.awaitDrain===0&&S(j,"data")&&(re.flowing=!0,Y(j))}}y.prototype.unpipe=function(j){var Q=this._readableState,re={hasUnpiped:!1};if(Q.pipesCount===0)return this;if(Q.pipesCount===1)return j&&j!==Q.pipes?this:(j||(j=Q.pipes),Q.pipes=null,Q.pipesCount=0,Q.flowing=!1,j&&j.emit("unpipe",this,re),this);if(!j){var he=Q.pipes,xe=Q.pipesCount;Q.pipes=null,Q.pipesCount=0,Q.flowing=!1;for(var Te=0;Te0,he.flowing!==!1&&this.resume()):j==="readable"&&!he.endEmitted&&!he.readableListening&&(he.readableListening=he.needReadable=!0,he.flowing=!1,he.emittedReadable=!1,i("on readable",he.length,he.reading),he.length?P(this):he.reading||process.nextTick(ce,this)),re},y.prototype.addListener=y.prototype.on,y.prototype.removeListener=function(j,Q){var re=E.prototype.removeListener.call(this,j,Q);return j==="readable"&&process.nextTick(le,this),re},y.prototype.removeAllListeners=function(j){var Q=E.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&process.nextTick(le,this),Q};function le(j){var Q=j._readableState;Q.readableListening=j.listenerCount("readable")>0,Q.resumeScheduled&&!Q.paused?Q.flowing=!0:j.listenerCount("data")>0&&j.resume()}function ce(j){i("readable nexttick read 0"),j.read(0)}y.prototype.resume=function(){var j=this._readableState;return j.flowing||(i("resume"),j.flowing=!j.readableListening,ve(this,j)),j.paused=!1,this};function ve(j,Q){Q.resumeScheduled||(Q.resumeScheduled=!0,process.nextTick(G,j,Q))}function G(j,Q){i("resume",Q.reading),Q.reading||j.read(0),Q.resumeScheduled=!1,j.emit("resume"),Y(j),Q.flowing&&!Q.reading&&j.read(0)}y.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Y(j){var Q=j._readableState;for(i("flow",Q.flowing);Q.flowing&&j.read()!==null;);}y.prototype.wrap=function(j){var Q=this,re=this._readableState,he=!1;j.on("end",function(){if(i("wrapped end"),re.decoder&&!re.ended){var Le=re.decoder.end();Le&&Le.length&&Q.push(Le)}Q.push(null)}),j.on("data",function(Le){if(i("wrapped data"),re.decoder&&(Le=re.decoder.write(Le)),!(re.objectMode&&Le==null)&&!(!re.objectMode&&(!Le||!Le.length))){var Pe=Q.push(Le);Pe||(he=!0,j.pause())}});for(var xe in j)this[xe]===void 0&&typeof j[xe]=="function"&&(this[xe]=(function(Pe){return function(){return j[Pe].apply(j,arguments)}})(xe));for(var Te=0;Te=Q.length?(Q.decoder?re=Q.buffer.join(""):Q.buffer.length===1?re=Q.buffer.first():re=Q.buffer.concat(Q.length),Q.buffer.clear()):re=Q.buffer.consume(j,Q.decoder),re}function V(j){var Q=j._readableState;i("endReadable",Q.endEmitted),Q.endEmitted||(Q.ended=!0,process.nextTick(se,Q,j))}function se(j,Q){if(i("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,Q.readable=!1,Q.emit("end"),j.autoDestroy)){var re=Q._writableState;(!re||re.autoDestroy&&re.finished)&&Q.destroy()}}typeof Symbol=="function"&&(y.from=function(j,Q){return M===void 0&&(M=D6()),M(y,j,Q)});function ae(j,Q){for(var re=0,he=j.length;re0;return o(_,A,M,function(g){T||(T=g),g&&l.forEach(a),!A&&(l.forEach(a),c(T))})});return f.reduce(i)}q.exports=s}}),O6=Ge({"node_modules/stream-browserify/index.js"(Z,q){q.exports=S;var d=Sp().EventEmitter,x=ed();x(S,d),S.Readable=Qw(),S.Writable=Jw(),S.Duplex=Fp(),S.Transform=e2(),S.PassThrough=z6(),S.finished=H1(),S.pipeline=F6(),S.Stream=S;function S(){d.call(this)}S.prototype.pipe=function(E,e){var t=this;function r(f){E.writable&&E.write(f)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,E.end())}function n(){a||(a=!0,typeof E.destroy=="function"&&E.destroy())}function s(f){if(h(),d.listenerCount(this,"error")===0)throw f}t.on("error",s),E.on("error",s);function h(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",h),t.removeListener("close",h),E.removeListener("close",h)}return t.on("end",h),t.on("close",h),E.on("close",h),E.emit("pipe",t),E}}}),$0=Ge({"node_modules/util/util.js"(Z){var q=Object.getOwnPropertyDescriptors||function(X){for(var $=Object.keys(X),le={},ce=0;ce<$.length;ce++)le[$[ce]]=Object.getOwnPropertyDescriptor(X,$[ce]);return le},d=/%[sdj%]/g;Z.format=function(B){if(!w(B)){for(var X=[],$=0;$=ce)return Y;switch(Y){case"%s":return String(le[$++]);case"%d":return Number(le[$++]);case"%j":try{return JSON.stringify(le[$++])}catch{return"[Circular]"}default:return Y}}),G=le[$];$"u")return function(){return Z.deprecate(B,X).apply(this,arguments)};var $=!1;function le(){if(!$){if(process.throwDeprecation)throw new Error(X);process.traceDeprecation?console.trace(X):console.error(X),$=!0}return B.apply(this,arguments)}return le};var x={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;Z.debuglog=function(B){if(B=B.toUpperCase(),!x[B])if(S.test(B)){var X=process.pid;x[B]=function(){var $=Z.format.apply(Z,arguments);console.error("%s %d: %s",B,X,$)}}else x[B]=function(){};return x[B]};function e(B,X){var $={seen:[],stylize:r};return arguments.length>=3&&($.depth=arguments[2]),arguments.length>=4&&($.colors=arguments[3]),c(X)?$.showHidden=X:X&&Z._extend($,X),M($.showHidden)&&($.showHidden=!1),M($.depth)&&($.depth=2),M($.colors)&&($.colors=!1),M($.customInspect)&&($.customInspect=!0),$.colors&&($.stylize=t),a($,B,$.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(B,X){var $=e.styles[X];return $?"\x1B["+e.colors[$][0]+"m"+B+"\x1B["+e.colors[$][1]+"m":B}function r(B,X){return B}function o(B){var X={};return B.forEach(function($,le){X[$]=!0}),X}function a(B,X,$){if(B.customInspect&&X&&y(X.inspect)&&X.inspect!==Z.inspect&&!(X.constructor&&X.constructor.prototype===X)){var le=X.inspect($,B);return w(le)||(le=a(B,le,$)),le}var ce=i(B,X);if(ce)return ce;var ve=Object.keys(X),G=o(ve);if(B.showHidden&&(ve=Object.getOwnPropertyNames(X)),u(X)&&(ve.indexOf("message")>=0||ve.indexOf("description")>=0))return n(X);if(ve.length===0){if(y(X)){var Y=X.name?": "+X.name:"";return B.stylize("[Function"+Y+"]","special")}if(g(X))return B.stylize(RegExp.prototype.toString.call(X),"regexp");if(v(X))return B.stylize(Date.prototype.toString.call(X),"date");if(u(X))return n(X)}var ee="",V=!1,se=["{","}"];if(p(X)&&(V=!0,se=["[","]"]),y(X)){var ae=X.name?": "+X.name:"";ee=" [Function"+ae+"]"}if(g(X)&&(ee=" "+RegExp.prototype.toString.call(X)),v(X)&&(ee=" "+Date.prototype.toUTCString.call(X)),u(X)&&(ee=" "+n(X)),ve.length===0&&(!V||X.length==0))return se[0]+ee+se[1];if($<0)return g(X)?B.stylize(RegExp.prototype.toString.call(X),"regexp"):B.stylize("[Object]","special");B.seen.push(X);var j;return V?j=s(B,X,$,G,ve):j=ve.map(function(Q){return h(B,X,$,G,Q,V)}),B.seen.pop(),f(j,ee,se)}function i(B,X){if(M(X))return B.stylize("undefined","undefined");if(w(X)){var $="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize($,"string")}if(_(X))return B.stylize(""+X,"number");if(c(X))return B.stylize(""+X,"boolean");if(T(X))return B.stylize("null","null")}function n(B){return"["+Error.prototype.toString.call(B)+"]"}function s(B,X,$,le,ce){for(var ve=[],G=0,Y=X.length;G-1&&(ve?Y=Y.split(` +`).map(function(V){return" "+V}).join(` +`).slice(2):Y=` +`+Y.split(` +`).map(function(V){return" "+V}).join(` +`))):Y=B.stylize("[Circular]","special")),M(G)){if(ve&&ce.match(/^\d+$/))return Y;G=JSON.stringify(""+ce),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(G=G.slice(1,-1),G=B.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=B.stylize(G,"string"))}return G+": "+Y}function f(B,X,$){var le=0,ce=B.reduce(function(ve,G){return le++,G.indexOf(` +`)>=0&&le++,ve+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ce>60?$[0]+(X===""?"":X+` + `)+" "+B.join(`, + `)+" "+$[1]:$[0]+X+" "+B.join(", ")+" "+$[1]}Z.types=Ww();function p(B){return Array.isArray(B)}Z.isArray=p;function c(B){return typeof B=="boolean"}Z.isBoolean=c;function T(B){return B===null}Z.isNull=T;function l(B){return B==null}Z.isNullOrUndefined=l;function _(B){return typeof B=="number"}Z.isNumber=_;function w(B){return typeof B=="string"}Z.isString=w;function A(B){return typeof B=="symbol"}Z.isSymbol=A;function M(B){return B===void 0}Z.isUndefined=M;function g(B){return b(B)&&R(B)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;function b(B){return typeof B=="object"&&B!==null}Z.isObject=b;function v(B){return b(B)&&R(B)==="[object Date]"}Z.isDate=v,Z.types.isDate=v;function u(B){return b(B)&&(R(B)==="[object Error]"||B instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function y(B){return typeof B=="function"}Z.isFunction=y;function m(B){return B===null||typeof B=="boolean"||typeof B=="number"||typeof B=="string"||typeof B=="symbol"||typeof B>"u"}Z.isPrimitive=m,Z.isBuffer=Xw();function R(B){return Object.prototype.toString.call(B)}function L(B){return B<10?"0"+B.toString(10):B.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var B=new Date,X=[L(B.getHours()),L(B.getMinutes()),L(B.getSeconds())].join(":");return[B.getDate(),z[B.getMonth()],X].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=ed(),Z._extend=function(B,X){if(!X||!b(X))return B;for(var $=Object.keys(X),le=$.length;le--;)B[$[le]]=X[$[le]];return B};function N(B,X){return Object.prototype.hasOwnProperty.call(B,X)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(X){if(typeof X!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&X[O]){var $=X[O];if(typeof $!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty($,O,{value:$,enumerable:!1,writable:!1,configurable:!0}),$}function $(){for(var le,ce,ve=new Promise(function(ee,V){le=ee,ce=V}),G=[],Y=0;Y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(M){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},h(M)}var f={},p,c;function T(M,g,b){b||(b=Error);function v(y,m,R){return typeof g=="string"?g:g(y,m,R)}var u=(function(y){r(R,y);var m=a(R);function R(L,z,F){var N;return t(this,R),N=m.call(this,v(L,z,F)),N.code=M,N}return S(R)})(b);f[M]=u}function l(M,g){if(Array.isArray(M)){var b=M.length;return M=M.map(function(v){return String(v)}),b>2?"one of ".concat(g," ").concat(M.slice(0,b-1).join(", "),", or ")+M[b-1]:b===2?"one of ".concat(g," ").concat(M[0]," or ").concat(M[1]):"of ".concat(g," ").concat(M[0])}else return"of ".concat(g," ").concat(String(M))}function _(M,g,b){return M.substr(!b||b<0?0:+b,g.length)===g}function w(M,g,b){return(b===void 0||b>M.length)&&(b=M.length),M.substring(b-g.length,b)===g}function A(M,g,b){return typeof b!="number"&&(b=0),b+g.length>M.length?!1:M.indexOf(g,b)!==-1}T("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),T("ERR_INVALID_ARG_TYPE",function(M,g,b){p===void 0&&(p=vg()),p(typeof M=="string","'name' must be a string");var v;typeof g=="string"&&_(g,"not ")?(v="must not be",g=g.replace(/^not /,"")):v="must be";var u;if(w(M," argument"))u="The ".concat(M," ").concat(v," ").concat(l(g,"type"));else{var y=A(M,".")?"property":"argument";u='The "'.concat(M,'" ').concat(y," ").concat(v," ").concat(l(g,"type"))}return u+=". Received type ".concat(d(b)),u},TypeError),T("ERR_INVALID_ARG_VALUE",function(M,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=$0());var v=c.inspect(g);return v.length>128&&(v="".concat(v.slice(0,128),"...")),"The argument '".concat(M,"' ").concat(b,". Received ").concat(v)},TypeError,RangeError),T("ERR_INVALID_RETURN_VALUE",function(M,g,b){var v;return b&&b.constructor&&b.constructor.name?v="instance of ".concat(b.constructor.name):v="type ".concat(d(b)),"Expected ".concat(M,' to be returned from the "').concat(g,'"')+" function but got ".concat(v,".")},TypeError),T("ERR_MISSING_ARGS",function(){for(var M=arguments.length,g=new Array(M),b=0;b0,"At least one arg needs to be specified");var v="The ",u=g.length;switch(g=g.map(function(y){return'"'.concat(y,'"')}),u){case 1:v+="".concat(g[0]," argument");break;case 2:v+="".concat(g[0]," and ").concat(g[1]," arguments");break;default:v+=g.slice(0,u-1).join(", "),v+=", and ".concat(g[u-1]," arguments");break}return"".concat(v," must be specified")},TypeError),q.exports.codes=f}}),B6=Ge({"node_modules/assert/build/internal/assert/assertion_error.js"(Z,q){"use strict";function d(U,B){var X=Object.keys(U);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(U);B&&($=$.filter(function(le){return Object.getOwnPropertyDescriptor(U,le).enumerable})),X.push.apply(X,$)}return X}function x(U){for(var B=1;B"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c(U){return Function.toString.call(U).indexOf("[native code]")!==-1}function T(U,B){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,le){return $.__proto__=le,$},T(U,B)}function l(U){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},l(U)}function _(U){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},_(U)}var w=$0(),A=w.inspect,M=t2(),g=M.codes.ERR_INVALID_ARG_TYPE;function b(U,B,X){return(X===void 0||X>U.length)&&(X=U.length),U.substring(X-B.length,X)===B}function v(U,B){if(B=Math.floor(B),U.length==0||B==0)return"";var X=U.length*B;for(B=Math.floor(Math.log(B)/Math.log(2));B;)U+=U,B--;return U+=U.substring(0,X-U.length),U}var u="",y="",m="",R="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(U){var B=Object.keys(U),X=Object.create(Object.getPrototypeOf(U));return B.forEach(function($){X[$]=U[$]}),Object.defineProperty(X,"message",{value:U.message}),X}function N(U){return A(U,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(U,B,X){var $="",le="",ce=0,ve="",G=!1,Y=N(U),ee=Y.split(` +`),V=N(B).split(` +`),se=0,ae="";if(X==="strictEqual"&&_(U)==="object"&&_(B)==="object"&&U!==null&&B!==null&&(X="strictEqualObject"),ee.length===1&&V.length===1&&ee[0]!==V[0]){var j=ee[0].length+V[0].length;if(j<=z){if((_(U)!=="object"||U===null)&&(_(B)!=="object"||B===null)&&(U!==0||B!==0))return"".concat(L[X],` + +`)+"".concat(ee[0]," !== ").concat(V[0],` +`)}else if(X!=="strictEqualObject"){var Q=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(j2&&(ae=` + `.concat(v(" ",se),"^"),se=0)}}}for(var re=ee[ee.length-1],he=V[V.length-1];re===he&&(se++<2?ve=` + `.concat(re).concat(ve):$=re,ee.pop(),V.pop(),!(ee.length===0||V.length===0));)re=ee[ee.length-1],he=V[V.length-1];var xe=Math.max(ee.length,V.length);if(xe===0){var Te=Y.split(` +`);if(Te.length>30)for(Te[26]="".concat(u,"...").concat(R);Te.length>27;)Te.pop();return"".concat(L.notIdentical,` `).concat(Te.join(` `),` -`)}oe>3&&(he=` -`.concat(u,"...").concat(P).concat(he),q=!0),Q!==""&&(he=` - `.concat(Q).concat(he),Q="");var Ie=0,De=L[W]+` -`.concat(g,"+ actual").concat(P," ").concat(f,"- expected").concat(P),He=" ".concat(u,"...").concat(P," Lines skipped");for(oe=0;oe<_e;oe++){var et=oe-se;if(J.length1&&oe>2&&(et>4?(le+=` -`.concat(u,"...").concat(P),q=!0):et>3&&(le+=` - `.concat(X[oe-2]),Ie++),le+=` - `.concat(X[oe-1]),Ie++),se=oe,Q+=` -`.concat(f,"-").concat(P," ").concat(X[oe]),Ie++;else if(X.length1&&oe>2&&(et>4?(le+=` -`.concat(u,"...").concat(P),q=!0):et>3&&(le+=` - `.concat(J[oe-2]),Ie++),le+=` - `.concat(J[oe-1]),Ie++),se=oe,le+=` -`.concat(g,"+").concat(P," ").concat(J[oe]),Ie++;else{var rt=X[oe],$e=J[oe],ot=$e!==rt&&(!b($e,",")||$e.slice(0,-1)!==rt);ot&&b(rt,",")&&rt.slice(0,-1)===$e&&(ot=!1,$e+=","),ot?(et>1&&oe>2&&(et>4?(le+=` -`.concat(u,"...").concat(P),q=!0):et>3&&(le+=` - `.concat(J[oe-2]),Ie++),le+=` - `.concat(J[oe-1]),Ie++),se=oe,le+=` -`.concat(g,"+").concat(P," ").concat($e),Q+=` -`.concat(f,"-").concat(P," ").concat(rt),Ie+=2):(le+=Q,Q="",(et===1||oe===0)&&(le+=` - `.concat($e),Ie++))}if(Ie>20&&oe<_e-2)return"".concat(De).concat(He,` +`)}se>3&&(ve=` +`.concat(u,"...").concat(R).concat(ve),G=!0),$!==""&&(ve=` + `.concat($).concat(ve),$="");var Le=0,Pe=L[X]+` +`.concat(y,"+ actual").concat(R," ").concat(m,"- expected").concat(R),qe=" ".concat(u,"...").concat(R," Lines skipped");for(se=0;se1&&se>2&&(et>4?(le+=` +`.concat(u,"...").concat(R),G=!0):et>3&&(le+=` + `.concat(V[se-2]),Le++),le+=` + `.concat(V[se-1]),Le++),ce=se,$+=` +`.concat(m,"-").concat(R," ").concat(V[se]),Le++;else if(V.length1&&se>2&&(et>4?(le+=` +`.concat(u,"...").concat(R),G=!0):et>3&&(le+=` + `.concat(ee[se-2]),Le++),le+=` + `.concat(ee[se-1]),Le++),ce=se,le+=` +`.concat(y,"+").concat(R," ").concat(ee[se]),Le++;else{var rt=V[se],$e=ee[se],Ue=$e!==rt&&(!b($e,",")||$e.slice(0,-1)!==rt);Ue&&b(rt,",")&&rt.slice(0,-1)===$e&&(Ue=!1,$e+=","),Ue?(et>1&&se>2&&(et>4?(le+=` +`.concat(u,"...").concat(R),G=!0):et>3&&(le+=` + `.concat(ee[se-2]),Le++),le+=` + `.concat(ee[se-1]),Le++),ce=se,le+=` +`.concat(y,"+").concat(R," ").concat($e),$+=` +`.concat(m,"-").concat(R," ").concat(rt),Le+=2):(le+=$,$="",(et===1||se===0)&&(le+=` + `.concat($e),Le++))}if(Le>20&&se30)for(j[26]="".concat(u,"...").concat(P);j.length>27;)j.pop();j.length===1?se=W.call(this,"".concat(ne," ").concat(j[0])):se=W.call(this,"".concat(ne,` +`).concat(u,"...").concat(R).concat($,` +`)+"".concat(u,"...").concat(R)}return"".concat(Pe).concat(G?qe:"",` +`).concat(le).concat($).concat(ve).concat(ae)}var P=(function(U,B){a($,U);var X=i($);function $(le){var ce;if(E(this,$),_(le)!=="object"||le===null)throw new g("options","Object",le);var ve=le.message,G=le.operator,Y=le.stackStartFn,ee=le.actual,V=le.expected,se=Error.stackTraceLimit;if(Error.stackTraceLimit=0,ve!=null)ce=X.call(this,String(ve));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(u="\x1B[34m",y="\x1B[32m",R="\x1B[39m",m="\x1B[31m"):(u="",y="",R="",m="")),_(ee)==="object"&&ee!==null&&_(V)==="object"&&V!==null&&"stack"in ee&&ee instanceof Error&&"stack"in V&&V instanceof Error&&(ee=F(ee),V=F(V)),G==="deepStrictEqual"||G==="strictEqual")ce=X.call(this,O(ee,V,G));else if(G==="notDeepStrictEqual"||G==="notStrictEqual"){var ae=L[G],j=N(ee).split(` +`);if(G==="notStrictEqual"&&_(ee)==="object"&&ee!==null&&(ae=L.notStrictEqualObject),j.length>30)for(j[26]="".concat(u,"...").concat(R);j.length>27;)j.pop();j.length===1?ce=X.call(this,"".concat(ae," ").concat(j[0])):ce=X.call(this,"".concat(ae,` `).concat(j.join(` `),` -`))}else{var ee=B(J),re="",ue=L[q];q==="notDeepEqual"||q==="notEqual"?(ee="".concat(L[q],` +`))}else{var Q=N(ee),re="",he=L[G];G==="notDeepEqual"||G==="notEqual"?(Q="".concat(L[G],` -`).concat(ee),ee.length>1024&&(ee="".concat(ee.slice(0,1021),"..."))):(re="".concat(B(X)),ee.length>512&&(ee="".concat(ee.slice(0,509),"...")),re.length>512&&(re="".concat(re.slice(0,509),"...")),q==="deepEqual"||q==="equal"?ee="".concat(ue,` +`).concat(Q),Q.length>1024&&(Q="".concat(Q.slice(0,1021),"..."))):(re="".concat(N(V)),Q.length>512&&(Q="".concat(Q.slice(0,509),"...")),re.length>512&&(re="".concat(re.slice(0,509),"...")),G==="deepEqual"||G==="equal"?Q="".concat(he,` -`).concat(ee,` +`).concat(Q,` should equal -`):re=" ".concat(q," ").concat(re)),se=W.call(this,"".concat(ee).concat(re))}return Error.stackTraceLimit=oe,se.generatedMessage=!he,Object.defineProperty(s(se),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),se.code="ERR_ASSERTION",se.actual=J,se.expected=X,se.operator=q,Error.captureStackTrace&&Error.captureStackTrace(s(se),$),se.stack,se.name="AssertionError",n(se)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(se,he){return S(this,x(x({},he),{},{customInspect:!1,depth:0}))}}]),Q})(h(Error),S.custom);V.exports=I}}),$w=We({"node_modules/object-keys/isArguments.js"(Z,V){"use strict";var d=Object.prototype.toString;V.exports=function(A){var E=d.call(A),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&d.call(A.callee)==="[object Function]"),e}}}),N6=We({"node_modules/object-keys/implementation.js"(Z,V){"use strict";var d;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,E=$w(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(h){var c=h.constructor;return c&&c.prototype===h},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=(function(){if(typeof window>"u")return!1;for(var h in window)try{if(!i["$"+h]&&x.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{a(window[h])}catch{return!0}}catch{return!0}return!1})(),s=function(h){if(typeof window>"u"||!n)return a(h);try{return a(h)}catch{return!1}},d=function(c){var m=c!==null&&typeof c=="object",p=A.call(c)==="[object Function]",T=E(c),l=m&&A.call(c)==="[object String]",_=[];if(!m&&!p&&!T)throw new TypeError("Object.keys called on a non-object");var w=r&&p;if(l&&c.length>0&&!x.call(c,0))for(var S=0;S0)for(var M=0;M2?arguments[2]:{},c=d(s);x&&(c=E.call(c,Object.getOwnPropertySymbols(s)));for(var m=0;mAe.length)&&(ge=Ae.length);for(var ce=0,ze=new Array(ge);ce10)return!0;for(var ge=0;ge57)return!0}return Ae.length===10&&Ae>=Math.pow(2,32)}function I(Ae){return Object.keys(Ae).filter(O).concat(s(Ae).filter(Object.prototype.propertyIsEnumerable.bind(Ae)))}function N(Ae,ge){if(Ae===ge)return 0;for(var ce=Ae.length,ze=ge.length,Qe=0,nt=Math.min(ce,ze);Qe1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne=0&&d.call(S.callee)==="[object Function]"),e}}}),N6=Ge({"node_modules/object-keys/implementation.js"(Z,q){"use strict";var d;Object.keys||(x=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=r2(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(h){var f=h.constructor;return f&&f.prototype===h},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=(function(){if(typeof window>"u")return!1;for(var h in window)try{if(!i["$"+h]&&x.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{a(window[h])}catch{return!0}}catch{return!0}return!1})(),s=function(h){if(typeof window>"u"||!n)return a(h);try{return a(h)}catch{return!1}},d=function(f){var p=f!==null&&typeof f=="object",c=S.call(f)==="[object Function]",T=E(f),l=p&&S.call(f)==="[object String]",_=[];if(!p&&!c&&!T)throw new TypeError("Object.keys called on a non-object");var w=r&&c;if(l&&f.length>0&&!x.call(f,0))for(var A=0;A0)for(var M=0;M2?arguments[2]:{},f=d(s);x&&(f=E.call(f,Object.getOwnPropertySymbols(s)));for(var p=0;pfe.length)&&(ue=fe.length);for(var ie=0,Ee=new Array(ue);ie10)return!0;for(var ue=0;ue57)return!0}return fe.length===10&&fe>=Math.pow(2,32)}function P(fe){return Object.keys(fe).filter(O).concat(s(fe).filter(Object.prototype.propertyIsEnumerable.bind(fe)))}function U(fe,ue){if(fe===ue)return 0;for(var ie=fe.length,Ee=ue.length,We=0,Qe=Math.min(ie,Ee);We1?V-1:0),ae=1;ae1?V-1:0),ae=1;ae1?V-1:0),ae=1;ae1?V-1:0),ae=1;ae0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),h=(n[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=A?Math.round(i/A)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,E,"day")||a(i,A,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Z.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Z.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function A(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?Z.storage.removeItem("debug"):Z.storage.debug=r}catch{}}function e(){var r;try{r=Z.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}Z.enable(e());function t(){try{return window.localStorage}catch{}}}}),K6=We({"node_modules/stream-parser/index.js"(Z,V){var d=ng(),x=Y6()("stream-parser");V.exports=r;var A=-1,E=0,e=1,t=2;function r(l){var _=l&&typeof l._transform=="function",w=l&&typeof l._write=="function";if(!_&&!w)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,_&&(l._passthrough=n),_?l._transform=h:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=A,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=E}function i(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=e}function n(l,_){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=t}function s(l,_,w){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof _=="function"&&(w=_),p(this,l,null,w)}function h(l,_,w){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof _!="function"&&(_=this._parserOutput),p(this,l,_,w)}function c(l,_,w,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):_.length<=l._parserBytesLeft?function(){return m(l,_,w,S)}:function(){var M=_.slice(0,l._parserBytesLeft);return m(l,M,w,function(y){if(y)return S(y);if(_.length>M.length)return function(){return c(l,_.slice(M.length),w,S)}})}}function m(l,_,w,S){if(l._parserBytesLeft-=_.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(_),l._parserBuffered+=_.length):l._parserState===t&&w(_),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(_=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(_=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=A,l._parserBuffers.splice(0),M){var y=[];_&&y.push(_),w&&y.push(w);var b=M.length>y.length;b&&y.push(T(S));var v=M.apply(l,y);if(!b||S===v)return S}}else return S}var p=T(c);function T(l){return function(){for(var _=l.apply(this,arguments);typeof _=="function";)_=_();return _}}}}),bu=We({"node_modules/probe-image-size/lib/common.js"(Z){"use strict";var V=O6().Transform,d=K6();function x(){V.call(this,{readableObjectMode:!0})}x.prototype=Object.create(V.prototype),x.prototype.constructor=x,d(x.prototype),Z.ParserStream=x,Z.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,c=n[4]&15,m=n[5]>>4&15,p=d(n,6),T=8,l=0;lp.width||m.width===p.width&&m.height>p.height?m:p}),h=n.reduce(function(m,p){return m.height>p.height||m.height===p.height&&m.width>p.width?m:p}),c;return s.width>h.height||s.width===h.height&&s.height>h.width?c=s:c=h,c}V.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var h=i(s.sizes),c=1;s.transforms.forEach(function(p){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(p.type==="imir"&&(p.value===0?c=l[c]:(c=l[c],c=T[c],c=T[c])),p.type==="irot")for(var _=0;_0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},A.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},A.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},A.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},A.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},A.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},A.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var p=[],T=c,l=0;l0&&(this.ifds_to_read.push({id:a,offset:p[0]}),m=!0);var w={is_big_endian:this.big_endian,ifd:E,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:h,data_offset:c+this.start,value:p,is_subifd_link:m};if(t(w)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},V.exports.ExifParser=A,V.exports.get_orientation=function(E){var e=0;try{return new A(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),$6=We({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Z,V){"use strict";var d=bu().str2arr,x=bu().sliceEq,A=bu().readUInt32BE,E=J6(),e=N1(),t=d("ftyp");V.exports=function(r){if(x(r,4,t)){var o=E.unbox(r,0);if(o){var a=E.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=E.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var h=E.readSizeFromMeta(i);if(h){var c={width:h.width,height:h.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(c.variants=h.variants),h.orientation&&(c.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=r.length){var m=A(r,h.exif_location.offset),p=r.slice(h.exif_location.offset+m+4,h.exif_location.offset+h.exif_location.length),T=e.get_orientation(p);T>0&&(c.orientation=T)}return c}}}}}}}}),Q6=We({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Z,V){"use strict";var d=bu().str2arr,x=bu().sliceEq,A=bu().readUInt16LE,E=d("BM");V.exports=function(e){if(!(e.length<26)&&x(e,0,E))return{width:A(e,18),height:A(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),ek=We({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Z,V){"use strict";var d=bu().str2arr,x=bu().sliceEq,A=bu().readUInt16LE,E=d("GIF87a"),e=d("GIF89a");V.exports=function(t){if(!(t.length<10)&&!(!x(t,0,E)&&!x(t,0,e)))return{width:A(t,6),height:A(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),tk=We({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Z,V){"use strict";var d=bu().readUInt16LE,x=0,A=1,E=16;V.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==A||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||h>i.height)&&(i=c)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),rk=We({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Z,V){"use strict";var d=bu().readUInt16BE,x=bu().str2arr,A=bu().sliceEq,E=N1(),e=x("Exif\0\0");V.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&A(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),ak=We({"node_modules/probe-image-size/lib/parse_sync/png.js"(Z,V){"use strict";var d=bu().str2arr,x=bu().sliceEq,A=bu().readUInt32BE,E=d(`\x89PNG\r +`).concat(c(Y),` +`));var re=new f({actual:Y,expected:ee,message:V,operator:ae,stackStartFn:se});throw re.generatedMessage=Q,re}}y.match=function Y(ee,V,se){ve(ee,V,se,Y,"match")},y.doesNotMatch=function Y(ee,V,se){ve(ee,V,se,Y,"doesNotMatch")};function G(){for(var Y=arguments.length,ee=new Array(Y),V=0;V0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),h=(n[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*S;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=S?Math.round(i/S)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,E,"day")||a(i,S,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Z.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Z.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function S(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?Z.storage.removeItem("debug"):Z.storage.debug=r}catch{}}function e(){var r;try{r=Z.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}Z.enable(e());function t(){try{return window.localStorage}catch{}}}}),K6=Ge({"node_modules/stream-parser/index.js"(Z,q){var d=vg(),x=Y6()("stream-parser");q.exports=r;var S=-1,E=0,e=1,t=2;function r(l){var _=l&&typeof l._transform=="function",w=l&&typeof l._write=="function";if(!_&&!w)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,_&&(l._passthrough=n),_?l._transform=h:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=S,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=E}function i(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=e}function n(l,_){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=t}function s(l,_,w){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof _=="function"&&(w=_),c(this,l,null,w)}function h(l,_,w){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof _!="function"&&(_=this._parserOutput),c(this,l,_,w)}function f(l,_,w,A){return l._parserBytesLeft<=0?A(new Error("got data but not currently parsing anything")):_.length<=l._parserBytesLeft?function(){return p(l,_,w,A)}:function(){var M=_.slice(0,l._parserBytesLeft);return p(l,M,w,function(g){if(g)return A(g);if(_.length>M.length)return function(){return f(l,_.slice(M.length),w,A)}})}}function p(l,_,w,A){if(l._parserBytesLeft-=_.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(_),l._parserBuffered+=_.length):l._parserState===t&&w(_),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(_=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(_=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=S,l._parserBuffers.splice(0),M){var g=[];_&&g.push(_),w&&g.push(w);var b=M.length>g.length;b&&g.push(T(A));var v=M.apply(l,g);if(!b||A===v)return A}}else return A}var c=T(f);function T(l){return function(){for(var _=l.apply(this,arguments);typeof _=="function";)_=_();return _}}}}),Tu=Ge({"node_modules/probe-image-size/lib/common.js"(Z){"use strict";var q=O6().Transform,d=K6();function x(){q.call(this,{readableObjectMode:!0})}x.prototype=Object.create(q.prototype),x.prototype.constructor=x,d(x.prototype),Z.ParserStream=x,Z.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,f=n[4]&15,p=n[5]>>4&15,c=d(n,6),T=8,l=0;lc.width||p.width===c.width&&p.height>c.height?p:c}),h=n.reduce(function(p,c){return p.height>c.height||p.height===c.height&&p.width>c.width?p:c}),f;return s.width>h.height||s.width===h.height&&s.height>h.width?f=s:f=h,f}q.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var h=i(s.sizes),f=1;s.transforms.forEach(function(c){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(c.type==="imir"&&(c.value===0?f=l[f]:(f=l[f],f=T[f],f=T[f])),c.type==="irot")for(var _=0;_0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},S.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},S.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},S.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},S.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},S.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},S.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var c=[],T=f,l=0;l0&&(this.ifds_to_read.push({id:a,offset:c[0]}),p=!0);var w={is_big_endian:this.big_endian,ifd:E,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:h,data_offset:f+this.start,value:c,is_subifd_link:p};if(t(w)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},q.exports.ExifParser=S,q.exports.get_orientation=function(E){var e=0;try{return new S(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),$6=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Z,q){"use strict";var d=Tu().str2arr,x=Tu().sliceEq,S=Tu().readUInt32BE,E=J6(),e=X1(),t=d("ftyp");q.exports=function(r){if(x(r,4,t)){var o=E.unbox(r,0);if(o){var a=E.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=E.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var h=E.readSizeFromMeta(i);if(h){var f={width:h.width,height:h.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=r.length){var p=S(r,h.exif_location.offset),c=r.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),T=e.get_orientation(c);T>0&&(f.orientation=T)}return f}}}}}}}}),Q6=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Z,q){"use strict";var d=Tu().str2arr,x=Tu().sliceEq,S=Tu().readUInt16LE,E=d("BM");q.exports=function(e){if(!(e.length<26)&&x(e,0,E))return{width:S(e,18),height:S(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),ek=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Z,q){"use strict";var d=Tu().str2arr,x=Tu().sliceEq,S=Tu().readUInt16LE,E=d("GIF87a"),e=d("GIF89a");q.exports=function(t){if(!(t.length<10)&&!(!x(t,0,E)&&!x(t,0,e)))return{width:S(t,6),height:S(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),tk=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Z,q){"use strict";var d=Tu().readUInt16LE,x=0,S=1,E=16;q.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==S||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||h>i.height)&&(i=f)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),rk=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Z,q){"use strict";var d=Tu().readUInt16BE,x=Tu().str2arr,S=Tu().sliceEq,E=X1(),e=x("Exif\0\0");q.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&S(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),ak=Ge({"node_modules/probe-image-size/lib/parse_sync/png.js"(Z,q){"use strict";var d=Tu().str2arr,x=Tu().sliceEq,S=Tu().readUInt32BE,E=d(`\x89PNG\r  -`),e=d("IHDR");V.exports=function(t){if(!(t.length<24)&&x(t,0,E)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),nk=We({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Z,V){"use strict";var d=bu().str2arr,x=bu().sliceEq,A=bu().readUInt32BE,E=d("8BPS\0");V.exports=function(e){if(!(e.length<22)&&x(e,0,E))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),ik=We({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Z,V){"use strict";function d(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var h=0,c=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(h=3);h]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var h=s.match(t),c=s.match(r),m=s.match(o);return{width:h&&(h[1]||h[2]),height:c&&(c[1]||c[2]),viewbox:m&&(m[1]||m[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}V.exports=function(s){if(A(s)){for(var h="",c=0;c>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?h=h||o(n,s+8):p==="VP8L"&&T>=9?h=h||a(n,s+8):p==="VP8X"&&T>=10?h=h||i(n,s+8):p==="EXIF"&&(c=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(h)return c>0&&(h.orientation=c),h}}}}}),lk=We({"node_modules/probe-image-size/lib/parsers_sync.js"(Z,V){"use strict";V.exports={avif:$6(),bmp:Q6(),gif:ek(),ico:tk(),jpeg:rk(),png:ak(),psd:nk(),svg:ik(),tiff:ok(),webp:sk()}}}),uk=We({"node_modules/probe-image-size/sync.js"(Z,V){"use strict";var d=lk();function x(A){for(var E=Object.keys(d),e=0;e0;)P=h.c2p(M+B*u),B--;for(B=0;z===void 0&&B0;)F=c.c2p(y+B*g),B--;if(Pq[0];if($||J){var X=f+I/2,oe=z+N/2;se+="transform:"+A(X+"px",oe+"px")+"scale("+($?-1:1)+","+(J?-1:1)+")"+A(-X+"px",-oe+"px")+";"}}le.attr("style",se);var ne=new Promise(function(j){if(_._hasZ)j();else if(_._hasSource)if(_._canvas&&_._canvas.el.width===b&&_._canvas.el.height===v&&_._canvas.source===_.source)j();else{var ee=document.createElement("canvas");ee.width=b,ee.height=v;var re=ee.getContext("2d",{willReadFrequently:!0});_._image=_._image||new Image;var ue=_._image;ue.onload=function(){re.drawImage(ue,0,0),_._canvas={el:ee,source:_.source},j()},ue.setAttribute("src",_.source)}}).then(function(){var j,ee;if(_._hasZ)ee=Q(function(_e,Te){var Ie=S[Te][_e];return x.isTypedArray(Ie)&&(Ie=Array.from(Ie)),Ie}),j=ee.toDataURL("image/png");else if(_._hasSource)if(w)j=_.source;else{var re=_._canvas.el.getContext("2d",{willReadFrequently:!0}),ue=re.getImageData(0,0,b,v).data;ee=Q(function(_e,Te){var Ie=4*(Te*b+_e);return[ue[Ie],ue[Ie+1],ue[Ie+2],ue[Ie+3]]}),j=ee.toDataURL("image/png")}le.attr({"xlink:href":j,height:N,width:I,x:f,y:z})});a._promises.push(ne)})}}}),vk=We({"src/traces/image/style.js"(Z,V){"use strict";var d=Hi();V.exports=function(A){d.select(A).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),dk=We({"src/traces/image/hover.js"(Z,V){"use strict";var d=hc(),x=aa(),A=x.isArrayOrTypedArray,E=V0();V.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var h=Math.floor((r-a.x0)/i.dx),c=Math.floor(Math.abs(o-a.y0)/i.dy),m;if(i._hasZ?m=a.z[c][h]:i._hasSource&&(m=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,c,1,1).data),!!m){var p=a.hi||i.hoverinfo,T;if(p){var l=p.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var _=E.colormodel[i.colormodel],w=_.colormodel||i.colormodel,S=w.length,M=i._scaler(m),y=_.suffix,b=[];(i.hovertemplate||T)&&(b.push("["+[M[0]+y[0],M[1]+y[1],M[2]+y[2]].join(", ")),S===4&&b.push(", "+M[3]+y[3]),b.push("]"),b=b.join(""),t.extraText=w.toUpperCase()+": "+b);var v;A(i.hovertext)&&A(i.hovertext[c])?v=i.hovertext[c][h]:A(i.text)&&A(i.text[c])&&(v=i.text[c][h]);var u=s.c2p(a.y0+(c+.5)*i.dy),g=a.x0+(h+.5)*i.dx,f=a.y0+(c+.5)*i.dy,P="["+m.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[c,h],x0:n.c2p(a.x0+h*i.dx),x1:n.c2p(a.x0+(h+1)*i.dx),y0:u,y1:u,color:M,xVal:g,xLabelVal:g,yVal:f,yLabelVal:f,zLabelVal:P,text:v,hovertemplateLabels:{zLabel:P,colorLabel:b,"color[0]Label":M[0]+y[0],"color[1]Label":M[1]+y[1],"color[2]Label":M[2]+y[2],"color[3]Label":M[3]+y[3]}})]}}}}}),pk=We({"src/traces/image/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return"xVal"in A&&(x.x=A.xVal),"yVal"in A&&(x.y=A.yVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x.color=A.color,x.colormodel=A.trace.colormodel,x.z||(x.z=A.color),x}}}),mk=We({"src/traces/image/index.js"(Z,V){"use strict";V.exports={attributes:Iw(),supplyDefaults:$E(),calc:fk(),plot:hk(),style:vk(),hoverPoints:dk(),eventData:pk(),moduleType:"trace",name:"image",basePlotModule:Yc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),gk=We({"lib/image.js"(Z,V){"use strict";V.exports=mk()}}),Pp=We({"src/traces/pie/attributes.js"(Z,V){"use strict";var d=El(),x=Uu().attributes,A=_u(),E=nf(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=wl(),o=Fo().extendFlat,a=zf().pattern,i=A({editType:"plot",arrayOk:!0,colorEditType:"plot"});V.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:a,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:o({},i,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:o({},d.showlegend,{arrayOk:!0}),legend:o({},d.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:o({},i,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Ip=We({"src/traces/pie/defaults.js"(Z,V){"use strict";var d=Uo(),x=aa(),A=Pp(),E=Uu().defaults,e=Bh().handleText,t=aa().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),h=x.isArrayOrTypedArray(n),c=Math.min(s?i.length:1/0,h?n.length:1/0);if(isFinite(c)||(c=0),c&&h){for(var m,p=0;p0){m=!0;break}}m||(c=0)}return{hasLabels:s,hasValues:h,len:c}}function o(i,n,s,h,c){var m=h("marker.line.width");m&&h("marker.line.color",c?void 0:s.paper_bgcolor);var p=h("marker.colors");t(h,"marker.pattern",p),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,h){function c(f,P){return x.coerce(i,n,A,f,P)}var m=c("labels"),p=c("values"),T=r(m,p),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(c("label0"),c("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,h,c,!0),c("scalegroup");var _=c("text"),w=c("texttemplate");c("texttemplatefallback");var S;if(w||(S=c("textinfo",x.isArrayOrTypedArray(_)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),w||S&&S!=="none"){var M=c("textposition");e(i,n,h,c,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var y=Array.isArray(M)||M==="auto",b=y||M==="outside";b&&c("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&c("insidetextorientation")}else S==="none"&&c("textposition","none");E(n,h,c);var v=c("hole"),u=c("title.text");if(u){var g=c("title.position",v?"middle center":"top center");!v&&g==="middle center"&&(n.title.position="top center"),x.coerceFont(c,"title.font",h.font)}c("sort"),c("direction"),c("rotation"),c("pull")}V.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),U1=We({"src/traces/pie/layout_attributes.js"(Z,V){"use strict";V.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yk=We({"src/traces/pie/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=U1();V.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),X0=We({"src/traces/pie/calc.js"(Z,V){"use strict";var d=Uo(),x=Af(),A=Fi(),E={};function e(a,i){var n=[],s=a._fullLayout,h=s.hiddenlabels||[],c=i.labels,m=i.marker.colors||[],p=i.values,T=i._length,l=i._hasValues&&T,_,w;if(i.dlabel)for(c=new Array(T),_=0;_=0});var P=i.type==="funnelarea"?b:i.sort;return P&&n.sort(function(L,z){return z.v-L.v}),n[0]&&(n[0].vTotal=y),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=A.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,h=a.calcdata,c=s[n+"colorway"],m=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(c=o(c,E));for(var p=0,T=0;T0&&(Qe+=Et*ce.pxmid[0],nt+=Et*ce.pxmid[1])}ce.cxFinal=Qe,ce.cyFinal=nt;function Bt(yt,Oe,Xe,be){var Ce=be*(Oe[0]-yt[0]),Ne=be*(Oe[1]-yt[1]);return"a"+be*ue.r+","+be*ue.r+" 0 "+ce.largeArc+(Xe?" 1 ":" 0 ")+Ce+","+Ne}var jt=_e.hole;if(ce.v===ue.vTotal){var _r="M"+(Qe+ce.px0[0])+","+(nt+ce.px0[1])+Bt(ce.px0,ce.pxmid,!0,1)+Bt(ce.pxmid,ce.px0,!0,1)+"Z";jt?kt.attr("d","M"+(Qe+jt*ce.px0[0])+","+(nt+jt*ce.px0[1])+Bt(ce.px0,ce.pxmid,!1,jt)+Bt(ce.pxmid,ce.px0,!1,jt)+"Z"+_r):kt.attr("d",_r)}else{var pr=Bt(ce.px0,ce.px1,!0,1);if(jt){var Or=1-jt;kt.attr("d","M"+(Qe+jt*ce.px1[0])+","+(nt+jt*ce.px1[1])+Bt(ce.px1,ce.px0,!1,jt)+"l"+Or*ce.px0[0]+","+Or*ce.px0[1]+pr+"Z")}else kt.attr("d","M"+Qe+","+nt+"l"+ce.px0[0]+","+ce.px0[1]+pr+"Z")}he($,ce,ue);var mr=c.castOption(_e.textposition,ce.pts),Er=Ke.selectAll("g.slicetext").data(ce.text&&mr!=="none"?[0]:[]);Er.enter().append("g").classed("slicetext",!0),Er.exit().remove(),Er.each(function(){var yt=t.ensureSingle(d.select(this),"text","",function(Le){Le.attr("data-notex",1)}),Oe=t.ensureUniformFontSize($,mr==="outside"?w(_e,ce,oe.font):S(_e,ce,oe.font));yt.text(ce.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,Oe).call(a.convertToTspans,$);var Xe=e.bBox(yt.node()),be;if(mr==="outside")be=z(Xe,ce);else if(be=y(Xe,ce,ue),mr==="auto"&&be.scale<1){var Ce=t.ensureUniformFontSize($,_e.outsidetextfont);yt.call(e.font,Ce),Xe=e.bBox(yt.node()),be=z(Xe,ce)}var Ne=be.textPosAngle,Ee=Ne===void 0?ce.pxmid:se(ue.r,Ne);if(be.targetX=Qe+Ee[0]*be.rCenter+(be.x||0),be.targetY=nt+Ee[1]*be.rCenter+(be.y||0),q(be,Xe),be.outside){var Se=be.targetY;ce.yLabelMin=Se-Xe.height/2,ce.yLabelMid=Se,ce.yLabelMax=Se+Xe.height/2,ce.labelExtraX=0,ce.labelExtraY=0,De=!0}be.fontSize=Oe.size,n(_e.type,be,oe),ee[ze].transform=be,t.setTransormAndDisplay(yt,be)})});var He=d.select(this).selectAll("g.titletext").data(_e.title.text?[0]:[]);if(He.enter().append("g").classed("titletext",!0),He.exit().remove(),He.each(function(){var ce=t.ensureSingle(d.select(this),"text","",function(nt){nt.attr("data-notex",1)}),ze=_e.title.text;_e._meta&&(ze=t.templateString(ze,_e._meta)),ce.text(ze).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,_e.title.font).call(a.convertToTspans,$);var Qe;_e.title.position==="middle center"?Qe=F(ue):Qe=B(ue,ne),ce.attr("transform",o(Qe.x,Qe.y)+r(Math.min(1,Qe.scale))+o(Qe.tx,Qe.ty))}),De&&U(Ie,_e),l(Te,_e),De&&_e.automargin){var et=e.bBox(re.node()),rt=_e.domain,$e=ne.w*(rt.x[1]-rt.x[0]),ot=ne.h*(rt.y[1]-rt.y[0]),Ae=(.5*$e-ue.r)/ne.w,ge=(.5*ot-ue.r)/ne.h;x.autoMargin($,"pie."+_e.uid+".automargin",{xl:rt.x[0]-Ae,xr:rt.x[1]+Ae,yb:rt.y[0]-ge,yt:rt.y[1]+ge,l:Math.max(ue.cx-ue.r-et.left,0),r:Math.max(et.right-(ue.cx+ue.r),0),b:Math.max(et.bottom-(ue.cy+ue.r),0),t:Math.max(ue.cy-ue.r-et.top,0),pad:5})}})});setTimeout(function(){j.selectAll("tspan").each(function(){var ee=d.select(this);ee.attr("dy")&&ee.attr("dy",ee.attr("dy"))})},0)}function l($,J){$.each(function(X){var oe=d.select(this);if(!X.labelExtraX&&!X.labelExtraY){oe.select("path.textline").remove();return}var ne=oe.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ne,X.transform);var j=X.cxFinal+X.pxmid[0],ee=X.cyFinal+X.pxmid[1],re="M"+j+","+ee,ue=(X.yLabelMax-X.yLabelMin)*(X.pxmid[0]<0?-1:1)/4;if(X.labelExtraX){var _e=X.labelExtraX*X.pxmid[1]/X.pxmid[0],Te=X.yLabelMid+X.labelExtraY-(X.cyFinal+X.pxmid[1]);Math.abs(_e)>Math.abs(Te)?re+="l"+Te*X.pxmid[0]/X.pxmid[1]+","+Te+"H"+(j+X.labelExtraX+ue):re+="l"+X.labelExtraX+","+_e+"v"+(Te-_e)+"h"+ue}else re+="V"+(X.yLabelMid+X.labelExtraY)+"h"+ue;t.ensureSingle(oe,"path","textline").call(E.stroke,J.outsidetextfont.color).attr({"stroke-width":Math.min(2,J.outsidetextfont.size/8),d:re,fill:"none"})})}function _($,J,X){var oe=X[0],ne=oe.cx,j=oe.cy,ee=oe.trace,re=ee.type==="funnelarea";"_hasHoverLabel"in ee||(ee._hasHoverLabel=!1),"_hasHoverEvent"in ee||(ee._hasHoverEvent=!1),$.on("mouseover",function(ue){var _e=J._fullLayout,Te=J._fullData[ee.index];if(!(J._dragging||_e.hovermode===!1)){var Ie=Te.hoverinfo;if(Array.isArray(Ie)&&(Ie=A.castHoverinfo({hoverinfo:[c.castOption(Ie,ue.pts)],_module:ee._module},_e,0)),Ie==="all"&&(Ie="label+text+value+percent+name"),Te.hovertemplate||Ie!=="none"&&Ie!=="skip"&&Ie){var De=ue.rInscribed||0,He=ne+ue.pxmid[0]*(1-De),et=j+ue.pxmid[1]*(1-De),rt=_e.separators,$e=[];if(Ie&&Ie.indexOf("label")!==-1&&$e.push(ue.label),ue.text=c.castOption(Te.hovertext||Te.text,ue.pts),Ie&&Ie.indexOf("text")!==-1){var ot=ue.text;t.isValidTextValue(ot)&&$e.push(ot)}ue.value=ue.v,ue.valueLabel=c.formatPieValue(ue.v,rt),Ie&&Ie.indexOf("value")!==-1&&$e.push(ue.valueLabel),ue.percent=ue.v/oe.vTotal,ue.percentLabel=c.formatPiePercent(ue.percent,rt),Ie&&Ie.indexOf("percent")!==-1&&$e.push(ue.percentLabel);var Ae=Te.hoverlabel,ge=Ae.font,ce=[];A.loneHover({trace:ee,x0:He-De*oe.r,x1:He+De*oe.r,y:et,_x0:re?ne+ue.TL[0]:He-De*oe.r,_x1:re?ne+ue.TR[0]:He+De*oe.r,_y0:re?j+ue.TL[1]:et-De*oe.r,_y1:re?j+ue.BL[1]:et+De*oe.r,text:$e.join("
"),name:Te.hovertemplate||Ie.indexOf("name")!==-1?Te.name:void 0,idealAlign:ue.pxmid[0]<0?"left":"right",color:c.castOption(Ae.bgcolor,ue.pts)||ue.color,borderColor:c.castOption(Ae.bordercolor,ue.pts),fontFamily:c.castOption(ge.family,ue.pts),fontSize:c.castOption(ge.size,ue.pts),fontColor:c.castOption(ge.color,ue.pts),nameLength:c.castOption(Ae.namelength,ue.pts),textAlign:c.castOption(Ae.align,ue.pts),hovertemplate:c.castOption(Te.hovertemplate,ue.pts),hovertemplateLabels:ue,eventData:[m(ue,Te)]},{container:_e._hoverlayer.node(),outerContainer:_e._paper.node(),gd:J,inOut_bbox:ce}),ue.bbox=ce[0],ee._hasHoverLabel=!0}ee._hasHoverEvent=!0,J.emit("plotly_hover",{points:[m(ue,Te)],event:d.event})}}),$.on("mouseout",function(ue){var _e=J._fullLayout,Te=J._fullData[ee.index],Ie=d.select(this).datum();ee._hasHoverEvent&&(ue.originalEvent=d.event,J.emit("plotly_unhover",{points:[m(Ie,Te)],event:d.event}),ee._hasHoverEvent=!1),ee._hasHoverLabel&&(A.loneUnhover(_e._hoverlayer.node()),ee._hasHoverLabel=!1)}),$.on("click",function(ue){var _e=J._fullLayout,Te=J._fullData[ee.index];J._dragging||_e.hovermode===!1||(J._hoverdata=[m(ue,Te)],A.click(J,d.event))})}function w($,J,X){var oe=c.castOption($.outsidetextfont.color,J.pts)||c.castOption($.textfont.color,J.pts)||X.color,ne=c.castOption($.outsidetextfont.family,J.pts)||c.castOption($.textfont.family,J.pts)||X.family,j=c.castOption($.outsidetextfont.size,J.pts)||c.castOption($.textfont.size,J.pts)||X.size,ee=c.castOption($.outsidetextfont.weight,J.pts)||c.castOption($.textfont.weight,J.pts)||X.weight,re=c.castOption($.outsidetextfont.style,J.pts)||c.castOption($.textfont.style,J.pts)||X.style,ue=c.castOption($.outsidetextfont.variant,J.pts)||c.castOption($.textfont.variant,J.pts)||X.variant,_e=c.castOption($.outsidetextfont.textcase,J.pts)||c.castOption($.textfont.textcase,J.pts)||X.textcase,Te=c.castOption($.outsidetextfont.lineposition,J.pts)||c.castOption($.textfont.lineposition,J.pts)||X.lineposition,Ie=c.castOption($.outsidetextfont.shadow,J.pts)||c.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe,family:ne,size:j,weight:ee,style:re,variant:ue,textcase:_e,lineposition:Te,shadow:Ie}}function S($,J,X){var oe=c.castOption($.insidetextfont.color,J.pts);!oe&&$._input.textfont&&(oe=c.castOption($._input.textfont.color,J.pts));var ne=c.castOption($.insidetextfont.family,J.pts)||c.castOption($.textfont.family,J.pts)||X.family,j=c.castOption($.insidetextfont.size,J.pts)||c.castOption($.textfont.size,J.pts)||X.size,ee=c.castOption($.insidetextfont.weight,J.pts)||c.castOption($.textfont.weight,J.pts)||X.weight,re=c.castOption($.insidetextfont.style,J.pts)||c.castOption($.textfont.style,J.pts)||X.style,ue=c.castOption($.insidetextfont.variant,J.pts)||c.castOption($.textfont.variant,J.pts)||X.variant,_e=c.castOption($.insidetextfont.textcase,J.pts)||c.castOption($.textfont.textcase,J.pts)||X.textcase,Te=c.castOption($.insidetextfont.lineposition,J.pts)||c.castOption($.textfont.lineposition,J.pts)||X.lineposition,Ie=c.castOption($.insidetextfont.shadow,J.pts)||c.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe||E.contrast(J.color),family:ne,size:j,weight:ee,style:re,variant:ue,textcase:_e,lineposition:Te,shadow:Ie}}function M($,J){for(var X,oe,ne=0;ne<$.length;ne++)if(X=$[ne][0],oe=X.trace,oe.title.text){var j=oe.title.text;oe._meta&&(j=t.templateString(j,oe._meta));var ee=e.tester.append("text").attr("data-notex",1).text(j).call(e.font,oe.title.font).call(a.convertToTspans,J),re=e.bBox(ee.node(),!0);X.titleBox={width:re.width,height:re.height},ee.remove()}}function y($,J,X){var oe=X.r||J.rpx1,ne=J.rInscribed,j=J.startangle===J.stopangle;if(j)return{rCenter:1-ne,scale:0,rotate:0,textPosAngle:0};var ee=J.ring,re=ee===1&&Math.abs(J.startangle-J.stopangle)===Math.PI*2,ue=J.halfangle,_e=J.midangle,Te=X.trace.insidetextorientation,Ie=Te==="horizontal",De=Te==="tangential",He=Te==="radial",et=Te==="auto",rt=[],$e;if(!et){var ot=function(Ke,kt){if(b(J,Ke)){var Et=Math.abs(Ke-J.startangle),Bt=Math.abs(Ke-J.stopangle),jt=Et=-4;Ae-=2)ot(Math.PI*Ae,"tan");for(Ae=4;Ae>=-4;Ae-=2)ot(Math.PI*(Ae+1),"tan")}if(Ie||He){for(Ae=4;Ae>=-4;Ae-=2)ot(Math.PI*(Ae+1.5),"rad");for(Ae=4;Ae>=-4;Ae-=2)ot(Math.PI*(Ae+.5),"rad")}}if(re||et||Ie){var ge=Math.sqrt($.width*$.width+$.height*$.height);if($e={scale:ne*oe*2/ge,rCenter:1-ne,rotate:0},$e.textPosAngle=(J.startangle+J.stopangle)/2,$e.scale>=1)return $e;rt.push($e)}(et||He)&&($e=v($,oe,ee,ue,_e),$e.textPosAngle=(J.startangle+J.stopangle)/2,rt.push($e)),(et||De)&&($e=u($,oe,ee,ue,_e),$e.textPosAngle=(J.startangle+J.stopangle)/2,rt.push($e));for(var ce=0,ze=0,Qe=0;Qe=1)break}return rt[ce]}function b($,J){var X=$.startangle,oe=$.stopangle;return X>J&&J>oe||X0?1:-1)/2,y:j/(1+X*X/(oe*oe)),outside:!0}}function F($){var J=Math.sqrt($.titleBox.width*$.titleBox.width+$.titleBox.height*$.titleBox.height);return{x:$.cx,y:$.cy,scale:$.trace.hole*$.r*2/J,tx:0,ty:-$.titleBox.height/2+$.trace.title.font.size}}function B($,J){var X=1,oe=1,ne,j=$.trace,ee={x:$.cx,y:$.cy},re={tx:0,ty:0};re.ty+=j.title.font.size,ne=N(j),j.title.position.indexOf("top")!==-1?(ee.y-=(1+ne)*$.r,re.ty-=$.titleBox.height):j.title.position.indexOf("bottom")!==-1&&(ee.y+=(1+ne)*$.r);var ue=O($.r,$.trace.aspectratio),_e=J.w*(j.domain.x[1]-j.domain.x[0])/2;return j.title.position.indexOf("left")!==-1?(_e=_e+ue,ee.x-=(1+ne)*ue,re.tx+=$.titleBox.width/2):j.title.position.indexOf("center")!==-1?_e*=2:j.title.position.indexOf("right")!==-1&&(_e=_e+ue,ee.x+=(1+ne)*ue,re.tx-=$.titleBox.width/2),X=_e/$.titleBox.width,oe=I($,J)/$.titleBox.height,{x:ee.x,y:ee.y,scale:Math.min(X,oe),tx:re.tx,ty:re.ty}}function O($,J){return $/(J===void 0?1:J)}function I($,J){var X=$.trace,oe=J.h*(X.domain.y[1]-X.domain.y[0]);return Math.min($.titleBox.height,oe/2)}function N($){var J=$.pull;if(!J)return 0;var X;if(t.isArrayOrTypedArray(J))for(J=0,X=0;X<$.pull.length;X++)$.pull[X]>J&&(J=$.pull[X]);return J}function U($,J){var X,oe,ne,j,ee,re,ue,_e,Te,Ie,De,He,et;function rt(ge,ce){return ge.pxmid[1]-ce.pxmid[1]}function $e(ge,ce){return ce.pxmid[1]-ge.pxmid[1]}function ot(ge,ce){ce||(ce={});var ze=ce.labelExtraY+(oe?ce.yLabelMax:ce.yLabelMin),Qe=oe?ge.yLabelMin:ge.yLabelMax,nt=oe?ge.yLabelMax:ge.yLabelMin,Ke=ge.cyFinal+ee(ge.px0[1],ge.px1[1]),kt=ze-Qe,Et,Bt,jt,_r,pr,Or;if(kt*ue>0&&(ge.labelExtraY=kt),!!t.isArrayOrTypedArray(J.pull))for(Bt=0;Bt=(c.castOption(J.pull,jt.pts)||0))&&((ge.pxmid[1]-jt.pxmid[1])*ue>0?(_r=jt.cyFinal+ee(jt.px0[1],jt.px1[1]),kt=_r-Qe-ge.labelExtraY,kt*ue>0&&(ge.labelExtraY+=kt)):(nt+ge.labelExtraY-Ke)*ue>0&&(Et=3*re*Math.abs(Bt-Ie.indexOf(ge)),pr=jt.cxFinal+j(jt.px0[0],jt.px1[0]),Or=pr+Et-(ge.cxFinal+ge.pxmid[0])-ge.labelExtraX,Or*re>0&&(ge.labelExtraX+=Or)))}for(oe=0;oe<2;oe++)for(ne=oe?rt:$e,ee=oe?Math.max:Math.min,ue=oe?1:-1,X=0;X<2;X++){for(j=X?Math.max:Math.min,re=X?1:-1,_e=$[oe][X],_e.sort(ne),Te=$[1-oe][X],Ie=Te.concat(_e),He=[],De=0;De<_e.length;De++)_e[De].yLabelMid!==void 0&&He.push(_e[De]);for(et=!1,De=0;oe&&De1?(_e=X.r,Te=_e/ne.aspectratio):(Te=X.r,_e=Te*ne.aspectratio),_e*=(1+ne.baseratio)/2,ue=_e*Te}ee=Math.min(ee,ue/X.vTotal)}for(oe=0;oe<$.length;oe++)if(X=$[oe][0],ne=X.trace,ne.scalegroup===re){var Ie=ee*X.vTotal;ne.type==="funnelarea"&&(Ie/=(1+ne.baseratio)/2,Ie/=ne.aspectratio),X.r=Math.sqrt(Ie)}}}function le($){var J=$[0],X=J.r,oe=J.trace,ne=c.getRotationAngle(oe.rotation),j=2*Math.PI/J.vTotal,ee="px0",re="px1",ue,_e,Te;if(oe.direction==="counterclockwise"){for(ue=0;ue<$.length&&$[ue].hidden;ue++);if(ue===$.length)return;ne+=j*$[ue].v,j*=-1,ee="px1",re="px0"}for(Te=se(X,ne),ue=0;ue<$.length;ue++)_e=$[ue],!_e.hidden&&(_e[ee]=Te,_e.startangle=ne,ne+=j*_e.v/2,_e.pxmid=se(X,ne),_e.midangle=ne,ne+=j*_e.v/2,Te=se(X,ne),_e.stopangle=ne,_e[re]=Te,_e.largeArc=_e.v>J.vTotal/2?1:0,_e.halfangle=Math.PI*Math.min(_e.v/J.vTotal,.5),_e.ring=1-oe.hole,_e.rInscribed=L(_e,J))}function se($,J){return[$*Math.sin(J),-$*Math.cos(J)]}function he($,J,X){var oe=$._fullLayout,ne=X.trace,j=ne.texttemplate,ee=ne.textinfo;if(!j&&ee&&ee!=="none"){var re=ee.split("+"),ue=function(ce){return re.indexOf(ce)!==-1},_e=ue("label"),Te=ue("text"),Ie=ue("value"),De=ue("percent"),He=oe.separators,et;if(et=_e?[J.label]:[],Te){var rt=c.getFirstFilled(ne.text,J.pts);p(rt)&&et.push(rt)}Ie&&et.push(c.formatPieValue(J.v,He)),De&&et.push(c.formatPiePercent(J.v/X.vTotal,He)),J.text=et.join("
")}function $e(ce){return{label:ce.label,value:ce.v,valueLabel:c.formatPieValue(ce.v,oe.separators),percent:ce.v/X.vTotal,percentLabel:c.formatPiePercent(ce.v/X.vTotal,oe.separators),color:ce.color,text:ce.text,customdata:t.castOption(ne,ce.i,"customdata")}}if(j){var ot=t.castOption(ne,J.i,"texttemplate");if(!ot)J.text="";else{var Ae=$e(J),ge=c.getFirstFilled(ne.text,J.pts);(p(ge)||ge==="")&&(Ae.text=ge),J.text=t.texttemplateString({data:[Ae,ne._meta],fallback:ne.texttemplatefallback,labels:Ae,locale:$._fullLayout._d3locale,template:ot})}}}function q($,J){var X=$.rotate*Math.PI/180,oe=Math.cos(X),ne=Math.sin(X),j=(J.left+J.right)/2,ee=(J.top+J.bottom)/2;$.textX=j*oe-ee*ne,$.textY=j*ne+ee*oe,$.noCenter=!0}V.exports={plot:T,formatSliceLabel:he,transformInsideText:y,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:M,layoutAreas:W,attachFxHandlers:_,computeTransform:q}}}),xk=We({"src/traces/pie/style.js"(Z,V){"use strict";var d=Hi(),x=P0(),A=oh().resizeText;V.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),bk=We({"src/traces/pie/base_plot.js"(Z){"use strict";var V=Nu();Z.name="pie",Z.plot=function(d,x,A,E){V.plotBasePlot(Z.name,d,x,A,E)},Z.clean=function(d,x,A,E){V.cleanBasePlot(Z.name,d,x,A,E)}}}),wk=We({"src/traces/pie/index.js"(Z,V){"use strict";V.exports={attributes:Pp(),supplyDefaults:Ip().supplyDefaults,supplyLayoutDefaults:yk(),layoutAttributes:U1(),calc:X0().calc,crossTraceCalc:X0().crossTraceCalc,plot:j1().plot,style:xk(),styleOne:P0(),moduleType:"trace",name:"pie",basePlotModule:bk(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Tk=We({"lib/pie.js"(Z,V){"use strict";V.exports=wk()}}),Ak=We({"src/traces/sunburst/base_plot.js"(Z){"use strict";var V=Nu();Z.name="sunburst",Z.plot=function(d,x,A,E){V.plotBasePlot(Z.name,d,x,A,E)},Z.clean=function(d,x,A,E){V.cleanBasePlot(Z.name,d,x,A,E)}}}),a2=We({"src/traces/sunburst/constants.js"(Z,V){"use strict";V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),ig=We({"src/traces/sunburst/attributes.js"(Z,V){"use strict";var d=El(),{hovertemplateAttrs:x,texttemplateAttrs:A,templatefallbackAttrs:E}=wl(),e=Zl(),t=Uu().attributes,r=Pp(),o=a2(),a=Fo().extendFlat,i=zf().pattern;V.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:a({colors:{valType:"data_array",editType:"calc"},line:{color:a({},r.marker.line.color,{dflt:null}),width:a({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:i,editType:"calc"},e("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:A({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:r.hovertext,hoverinfo:a({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:o.eventDataKeys}),hovertemplatefallback:E(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:a({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}}),n2=We({"src/traces/sunburst/layout_attributes.js"(Z,V){"use strict";V.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Sk=We({"src/traces/sunburst/defaults.js"(Z,V){"use strict";var d=aa(),x=ig(),A=Uu().defaults,E=Bh().handleText,e=Ip().handleMarkerDefaults,t=xu(),r=t.hasColorscale,o=t.handleDefaults;V.exports=function(i,n,s,h){function c(S,M){return d.coerce(i,n,x,S,M)}var m=c("labels"),p=c("parents");if(!m||!m.length||!p||!p.length){n.visible=!1;return}var T=c("values");T&&T.length?c("branchvalues"):c("count"),c("level"),c("maxdepth"),e(i,n,h,c);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,h,c,{prefix:"marker.",cLetter:"c"}),c("leaf.opacity",l?1:.7);var _=c("text");c("texttemplate"),c("texttemplatefallback"),n.texttemplate||c("textinfo",d.isArrayOrTypedArray(_)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var w="auto";E(i,n,h,c,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("insidetextorientation"),c("sort"),c("rotation"),c("root.color"),A(n,h,c),n._length=null}}}),Mk=We({"src/traces/sunburst/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=n2();V.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),og=We({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(be,Ce){return be.parent===Ce.parent?1:2}function A(be){return be.reduce(E,0)/be.length}function E(be,Ce){return be+Ce.x}function e(be){return 1+be.reduce(t,0)}function t(be,Ce){return Math.max(be,Ce.y)}function r(be){for(var Ce;Ce=be.children;)be=Ce[0];return be}function o(be){for(var Ce;Ce=be.children;)be=Ce[Ce.length-1];return be}function a(){var be=x,Ce=1,Ne=1,Ee=!1;function Se(Le){var at,dt=0;Le.eachAfter(function(Jt){var Sr=Jt.children;Sr?(Jt.x=A(Sr),Jt.y=e(Sr)):(Jt.x=at?dt+=be(Jt,at):0,Jt.y=0,at=Jt)});var gt=r(Le),Ct=o(Le),or=gt.x-be(gt,Ct)/2,Qt=Ct.x+be(Ct,gt)/2;return Le.eachAfter(Ee?function(Jt){Jt.x=(Jt.x-Le.x)*Ce,Jt.y=(Le.y-Jt.y)*Ne}:function(Jt){Jt.x=(Jt.x-or)/(Qt-or)*Ce,Jt.y=(1-(Le.y?Jt.y/Le.y:1))*Ne})}return Se.separation=function(Le){return arguments.length?(be=Le,Se):be},Se.size=function(Le){return arguments.length?(Ee=!1,Ce=+Le[0],Ne=+Le[1],Se):Ee?null:[Ce,Ne]},Se.nodeSize=function(Le){return arguments.length?(Ee=!0,Ce=+Le[0],Ne=+Le[1],Se):Ee?[Ce,Ne]:null},Se}function i(be){var Ce=0,Ne=be.children,Ee=Ne&&Ne.length;if(!Ee)Ce=1;else for(;--Ee>=0;)Ce+=Ne[Ee].value;be.value=Ce}function n(){return this.eachAfter(i)}function s(be){var Ce=this,Ne,Ee=[Ce],Se,Le,at;do for(Ne=Ee.reverse(),Ee=[];Ce=Ne.pop();)if(be(Ce),Se=Ce.children,Se)for(Le=0,at=Se.length;Le=0;--Se)Ne.push(Ee[Se]);return this}function c(be){for(var Ce=this,Ne=[Ce],Ee=[],Se,Le,at;Ce=Ne.pop();)if(Ee.push(Ce),Se=Ce.children,Se)for(Le=0,at=Se.length;Le=0;)Ne+=Ee[Se].value;Ce.value=Ne})}function p(be){return this.eachBefore(function(Ce){Ce.children&&Ce.children.sort(be)})}function T(be){for(var Ce=this,Ne=l(Ce,be),Ee=[Ce];Ce!==Ne;)Ce=Ce.parent,Ee.push(Ce);for(var Se=Ee.length;be!==Ne;)Ee.splice(Se,0,be),be=be.parent;return Ee}function l(be,Ce){if(be===Ce)return be;var Ne=be.ancestors(),Ee=Ce.ancestors(),Se=null;for(be=Ne.pop(),Ce=Ee.pop();be===Ce;)Se=be,be=Ne.pop(),Ce=Ee.pop();return Se}function _(){for(var be=this,Ce=[be];be=be.parent;)Ce.push(be);return Ce}function w(){var be=[];return this.each(function(Ce){be.push(Ce)}),be}function S(){var be=[];return this.eachBefore(function(Ce){Ce.children||be.push(Ce)}),be}function M(){var be=this,Ce=[];return be.each(function(Ne){Ne!==be&&Ce.push({source:Ne.parent,target:Ne})}),Ce}function y(be,Ce){var Ne=new f(be),Ee=+be.value&&(Ne.value=be.value),Se,Le=[Ne],at,dt,gt,Ct;for(Ce==null&&(Ce=v);Se=Le.pop();)if(Ee&&(Se.value=+Se.data.value),(dt=Ce(Se.data))&&(Ct=dt.length))for(Se.children=new Array(Ct),gt=Ct-1;gt>=0;--gt)Le.push(at=Se.children[gt]=new f(dt[gt])),at.parent=Se,at.depth=Se.depth+1;return Ne.eachBefore(g)}function b(){return y(this).eachBefore(u)}function v(be){return be.children}function u(be){be.data=be.data.data}function g(be){var Ce=0;do be.height=Ce;while((be=be.parent)&&be.height<++Ce)}function f(be){this.data=be,this.depth=this.height=0,this.parent=null}f.prototype=y.prototype={constructor:f,count:n,each:s,eachAfter:c,eachBefore:h,sum:m,sort:p,path:T,ancestors:_,descendants:w,leaves:S,links:M,copy:b};var P=Array.prototype.slice;function L(be){for(var Ce=be.length,Ne,Ee;Ce;)Ee=Math.random()*Ce--|0,Ne=be[Ce],be[Ce]=be[Ee],be[Ee]=Ne;return be}function z(be){for(var Ce=0,Ne=(be=L(P.call(be))).length,Ee=[],Se,Le;Ce0&&Ne*Ne>Ee*Ee+Se*Se}function I(be,Ce){for(var Ne=0;Negt?(Se=(Ct+gt-Le)/(2*Ct),dt=Math.sqrt(Math.max(0,gt/Ct-Se*Se)),Ne.x=be.x-Se*Ee-dt*at,Ne.y=be.y-Se*at+dt*Ee):(Se=(Ct+Le-gt)/(2*Ct),dt=Math.sqrt(Math.max(0,Le/Ct-Se*Se)),Ne.x=Ce.x+Se*Ee-dt*at,Ne.y=Ce.y+Se*at+dt*Ee)):(Ne.x=Ce.x+Ne.r,Ne.y=Ce.y)}function se(be,Ce){var Ne=be.r+Ce.r-1e-6,Ee=Ce.x-be.x,Se=Ce.y-be.y;return Ne>0&&Ne*Ne>Ee*Ee+Se*Se}function he(be){var Ce=be._,Ne=be.next._,Ee=Ce.r+Ne.r,Se=(Ce.x*Ne.r+Ne.x*Ce.r)/Ee,Le=(Ce.y*Ne.r+Ne.y*Ce.r)/Ee;return Se*Se+Le*Le}function q(be){this._=be,this.next=null,this.previous=null}function $(be){if(!(Se=be.length))return 0;var Ce,Ne,Ee,Se,Le,at,dt,gt,Ct,or,Qt;if(Ce=be[0],Ce.x=0,Ce.y=0,!(Se>1))return Ce.r;if(Ne=be[1],Ce.x=-Ne.r,Ne.x=Ce.r,Ne.y=0,!(Se>2))return Ce.r+Ne.r;le(Ne,Ce,Ee=be[2]),Ce=new q(Ce),Ne=new q(Ne),Ee=new q(Ee),Ce.next=Ee.previous=Ne,Ne.next=Ce.previous=Ee,Ee.next=Ne.previous=Ce;e:for(dt=3;dt0)throw new Error("cycle");return dt}return Ne.id=function(Ee){return arguments.length?(be=oe(Ee),Ne):be},Ne.parentId=function(Ee){return arguments.length?(Ce=oe(Ee),Ne):Ce},Ne}function ce(be,Ce){return be.parent===Ce.parent?1:2}function ze(be){var Ce=be.children;return Ce?Ce[0]:be.t}function Qe(be){var Ce=be.children;return Ce?Ce[Ce.length-1]:be.t}function nt(be,Ce,Ne){var Ee=Ne/(Ce.i-be.i);Ce.c-=Ee,Ce.s+=Ne,be.c+=Ee,Ce.z+=Ne,Ce.m+=Ne}function Ke(be){for(var Ce=0,Ne=0,Ee=be.children,Se=Ee.length,Le;--Se>=0;)Le=Ee[Se],Le.z+=Ce,Le.m+=Ce,Ce+=Le.s+(Ne+=Le.c)}function kt(be,Ce,Ne){return be.a.parent===Ce.parent?be.a:Ne}function Et(be,Ce){this._=be,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=Ce}Et.prototype=Object.create(f.prototype);function Bt(be){for(var Ce=new Et(be,0),Ne,Ee=[Ce],Se,Le,at,dt;Ne=Ee.pop();)if(Le=Ne._.children)for(Ne.children=new Array(dt=Le.length),at=dt-1;at>=0;--at)Ee.push(Se=Ne.children[at]=new Et(Le[at],at)),Se.parent=Ne;return(Ce.parent=new Et(null,0)).children=[Ce],Ce}function jt(){var be=ce,Ce=1,Ne=1,Ee=null;function Se(Ct){var or=Bt(Ct);if(or.eachAfter(Le),or.parent.m=-or.z,or.eachBefore(at),Ee)Ct.eachBefore(gt);else{var Qt=Ct,Jt=Ct,Sr=Ct;Ct.eachBefore(function(Na){Na.xJt.x&&(Jt=Na),Na.depth>Sr.depth&&(Sr=Na)});var oa=Qt===Jt?1:be(Qt,Jt)/2,Ea=oa-Qt.x,Sa=Ce/(Jt.x+oa+Ea),za=Ne/(Sr.depth||1);Ct.eachBefore(function(Na){Na.x=(Na.x+Ea)*Sa,Na.y=Na.depth*za})}return Ct}function Le(Ct){var or=Ct.children,Qt=Ct.parent.children,Jt=Ct.i?Qt[Ct.i-1]:null;if(or){Ke(Ct);var Sr=(or[0].z+or[or.length-1].z)/2;Jt?(Ct.z=Jt.z+be(Ct._,Jt._),Ct.m=Ct.z-Sr):Ct.z=Sr}else Jt&&(Ct.z=Jt.z+be(Ct._,Jt._));Ct.parent.A=dt(Ct,Jt,Ct.parent.A||Qt[0])}function at(Ct){Ct._.x=Ct.z+Ct.parent.m,Ct.m+=Ct.parent.m}function dt(Ct,or,Qt){if(or){for(var Jt=Ct,Sr=Ct,oa=or,Ea=Jt.parent.children[0],Sa=Jt.m,za=Sr.m,Na=oa.m,Ta=Ea.m,nn;oa=Qe(oa),Jt=ze(Jt),oa&&Jt;)Ea=ze(Ea),Sr=Qe(Sr),Sr.a=Ct,nn=oa.z+Na-Jt.z-Sa+be(oa._,Jt._),nn>0&&(nt(kt(oa,Ct,Qt),Ct,nn),Sa+=nn,za+=nn),Na+=oa.m,Sa+=Jt.m,Ta+=Ea.m,za+=Sr.m;oa&&!Qe(Sr)&&(Sr.t=oa,Sr.m+=Na-za),Jt&&!ze(Ea)&&(Ea.t=Jt,Ea.m+=Sa-Ta,Qt=Ct)}return Qt}function gt(Ct){Ct.x*=Ce,Ct.y=Ct.depth*Ne}return Se.separation=function(Ct){return arguments.length?(be=Ct,Se):be},Se.size=function(Ct){return arguments.length?(Ee=!1,Ce=+Ct[0],Ne=+Ct[1],Se):Ee?null:[Ce,Ne]},Se.nodeSize=function(Ct){return arguments.length?(Ee=!0,Ce=+Ct[0],Ne=+Ct[1],Se):Ee?[Ce,Ne]:null},Se}function _r(be,Ce,Ne,Ee,Se){for(var Le=be.children,at,dt=-1,gt=Le.length,Ct=be.value&&(Se-Ne)/be.value;++dtNa&&(Na=Ct),Ht=Sa*Sa*gn,Ta=Math.max(Na/Ht,Ht/za),Ta>nn){Sa-=Ct;break}nn=Ta}at.push(gt={value:Sa,dice:Sr1?Ee:1)},Ne})(pr);function Er(){var be=mr,Ce=!1,Ne=1,Ee=1,Se=[0],Le=ne,at=ne,dt=ne,gt=ne,Ct=ne;function or(Jt){return Jt.x0=Jt.y0=0,Jt.x1=Ne,Jt.y1=Ee,Jt.eachBefore(Qt),Se=[0],Ce&&Jt.eachBefore(Ie),Jt}function Qt(Jt){var Sr=Se[Jt.depth],oa=Jt.x0+Sr,Ea=Jt.y0+Sr,Sa=Jt.x1-Sr,za=Jt.y1-Sr;Sa=Jt-1){var Na=Le[Qt];Na.x0=oa,Na.y0=Ea,Na.x1=Sa,Na.y1=za;return}for(var Ta=Ct[Qt],nn=Sr/2+Ta,gn=Qt+1,Ht=Jt-1;gn>>1;Ct[It]za-Ea){var Rr=(oa*Xt+Sa*Gt)/Sr;or(Qt,gn,Gt,oa,Ea,Rr,za),or(gn,Jt,Xt,Rr,Ea,Sa,za)}else{var Yr=(Ea*Xt+za*Gt)/Sr;or(Qt,gn,Gt,oa,Ea,Sa,Yr),or(gn,Jt,Xt,oa,Yr,Sa,za)}}}function Oe(be,Ce,Ne,Ee,Se){(be.depth&1?_r:De)(be,Ce,Ne,Ee,Se)}var Xe=(function be(Ce){function Ne(Ee,Se,Le,at,dt){if((gt=Ee._squarify)&>.ratio===Ce)for(var gt,Ct,or,Qt,Jt=-1,Sr,oa=gt.length,Ea=Ee.value;++Jt1?Ee:1)},Ne})(pr);d.cluster=a,d.hierarchy=y,d.pack=re,d.packEnclose=z,d.packSiblings=J,d.partition=He,d.stratify=ge,d.tree=jt,d.treemap=Er,d.treemapBinary=yt,d.treemapDice=De,d.treemapResquarify=Xe,d.treemapSlice=_r,d.treemapSliceDice=Oe,d.treemapSquarify=mr,Object.defineProperty(d,"__esModule",{value:!0})})}}),sg=We({"src/traces/sunburst/calc.js"(Z){"use strict";var V=og(),d=Uo(),x=aa(),A=xu().makeColorScaleFuncFromTrace,E=X0().makePullColorFn,e=X0().generateExtendedColors,t=xu().calc,r=bs().ALMOST_EQUAL,o={},a={},i={};Z.calc=function(s,h){var c=s._fullLayout,m=h.ids,p=x.isArrayOrTypedArray(m),T=h.labels,l=h.parents,_=h.values,w=x.isArrayOrTypedArray(_),S=[],M={},y={},b=function(J,X){M[J]?M[J].push(X):M[J]=[X],y[X]=1},v=function(J){return J||typeof J=="number"},u=function(J){return!w||d(_[J])&&_[J]>=0},g,f,P;p?(g=Math.min(m.length,l.length),f=function(J){return v(m[J])&&u(J)},P=function(J){return String(m[J])}):(g=Math.min(T.length,l.length),f=function(J){return v(T[J])&&u(J)},P=function(J){return String(T[J])}),w&&(g=Math.min(g,_.length));for(var L=0;L1){for(var N=x.randstr(),U=0;U>8&15|V>>4&240,V>>4&15|V&240,(V&15)<<4|V&15,1):d===8?lg(V>>24&255,V>>16&255,V>>8&255,(V&255)/255):d===4?lg(V>>12&15|V>>8&240,V>>8&15|V>>4&240,V>>4&15|V&240,((V&15)<<4|V&15)/255):null):(V=d2.exec(Z))?new Bf(V[1],V[2],V[3],1):(V=p2.exec(Z))?new Bf(V[1]*255/100,V[2]*255/100,V[3]*255/100,1):(V=m2.exec(Z))?lg(V[1],V[2],V[3],V[4]):(V=g2.exec(Z))?lg(V[1]*255/100,V[2]*255/100,V[3]*255/100,V[4]):(V=y2.exec(Z))?c2(V[1],V[2]/100,V[3]/100,1):(V=_2.exec(Z))?c2(V[1],V[2]/100,V[3]/100,V[4]):W1.hasOwnProperty(Z)?s2(W1[Z]):Z==="transparent"?new Bf(NaN,NaN,NaN,0):null}function s2(Z){return new Bf(Z>>16&255,Z>>8&255,Z&255,1)}function lg(Z,V,d,x){return x<=0&&(Z=V=d=NaN),new Bf(Z,V,d,x)}function q1(Z){return Z instanceof Zv||(Z=Y0(Z)),Z?(Z=Z.rgb(),new Bf(Z.r,Z.g,Z.b,Z.opacity)):new Bf}function ug(Z,V,d,x){return arguments.length===1?q1(Z):new Bf(Z,V,d,x??1)}function Bf(Z,V,d,x){this.r=+Z,this.g=+V,this.b=+d,this.opacity=+x}function l2(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}`}function Ck(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}${Dd((isNaN(this.opacity)?1:this.opacity)*255)}`}function u2(){let Z=cg(this.opacity);return`${Z===1?"rgb(":"rgba("}${Rd(this.r)}, ${Rd(this.g)}, ${Rd(this.b)}${Z===1?")":`, ${Z})`}`}function cg(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function Rd(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function Dd(Z){return Z=Rd(Z),(Z<16?"0":"")+Z.toString(16)}function c2(Z,V,d,x){return x<=0?Z=V=d=NaN:d<=0||d>=1?Z=V=NaN:V<=0&&(Z=NaN),new Kh(Z,V,d,x)}function f2(Z){if(Z instanceof Kh)return new Kh(Z.h,Z.s,Z.l,Z.opacity);if(Z instanceof Zv||(Z=Y0(Z)),!Z)return new Kh;if(Z instanceof Kh)return Z;Z=Z.rgb();var V=Z.r/255,d=Z.g/255,x=Z.b/255,A=Math.min(V,d,x),E=Math.max(V,d,x),e=NaN,t=E-A,r=(E+A)/2;return t?(V===E?e=(d-x)/t+(d0&&r<1?0:e,new Kh(e,t,r,Z.opacity)}function G1(Z,V,d,x){return arguments.length===1?f2(Z):new Kh(Z,V,d,x??1)}function Kh(Z,V,d,x){this.h=+Z,this.s=+V,this.l=+d,this.opacity=+x}function h2(Z){return Z=(Z||0)%360,Z<0?Z+360:Z}function fg(Z){return Math.max(0,Math.min(1,Z||0))}function H1(Z,V,d){return(Z<60?V+(d-V)*Z/60:Z<180?d:Z<240?V+(d-V)*(240-Z)/60:V)*255}var Yv,zd,Fd,Dp,Jh,v2,d2,p2,m2,g2,y2,_2,W1,X1=Bl({"node_modules/d3-color/src/color.js"(){V1(),Yv=.7,zd=1/Yv,Fd="\\s*([+-]?\\d+)\\s*",Dp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v2=/^#([0-9a-f]{3,8})$/,d2=new RegExp(`^rgb\\(${Fd},${Fd},${Fd}\\)$`),p2=new RegExp(`^rgb\\(${Jh},${Jh},${Jh}\\)$`),m2=new RegExp(`^rgba\\(${Fd},${Fd},${Fd},${Dp}\\)$`),g2=new RegExp(`^rgba\\(${Jh},${Jh},${Jh},${Dp}\\)$`),y2=new RegExp(`^hsl\\(${Dp},${Jh},${Jh}\\)$`),_2=new RegExp(`^hsla\\(${Dp},${Jh},${Jh},${Dp}\\)$`),W1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Rp(Zv,Y0,{copy(Z){return Object.assign(new this.constructor,this,Z)},displayable(){return this.rgb().displayable()},hex:i2,formatHex:i2,formatHex8:Ek,formatHsl:kk,formatRgb:o2,toString:o2}),Rp(Bf,ug,Z0(Zv,{brighter(Z){return Z=Z==null?zd:Math.pow(zd,Z),new Bf(this.r*Z,this.g*Z,this.b*Z,this.opacity)},darker(Z){return Z=Z==null?Yv:Math.pow(Yv,Z),new Bf(this.r*Z,this.g*Z,this.b*Z,this.opacity)},rgb(){return this},clamp(){return new Bf(Rd(this.r),Rd(this.g),Rd(this.b),cg(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:l2,formatHex:l2,formatHex8:Ck,formatRgb:u2,toString:u2})),Rp(Kh,G1,Z0(Zv,{brighter(Z){return Z=Z==null?zd:Math.pow(zd,Z),new Kh(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?Yv:Math.pow(Yv,Z),new Kh(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=this.h%360+(this.h<0)*360,V=isNaN(Z)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*V,A=2*d-x;return new Bf(H1(Z>=240?Z-240:Z+120,A,x),H1(Z,A,x),H1(Z<120?Z+240:Z-120,A,x),this.opacity)},clamp(){return new Kh(h2(this.h),fg(this.s),fg(this.l),cg(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 Z=cg(this.opacity);return`${Z===1?"hsl(":"hsla("}${h2(this.h)}, ${fg(this.s)*100}%, ${fg(this.l)*100}%${Z===1?")":`, ${Z})`}`}}))}}),Z1,Y1,x2=Bl({"node_modules/d3-color/src/math.js"(){Z1=Math.PI/180,Y1=180/Math.PI}});function b2(Z){if(Z instanceof vv)return new vv(Z.l,Z.a,Z.b,Z.opacity);if(Z instanceof Lv)return w2(Z);Z instanceof Bf||(Z=q1(Z));var V=e_(Z.r),d=e_(Z.g),x=e_(Z.b),A=J1((.2225045*V+.7168786*d+.0606169*x)/a_),E,e;return V===d&&d===x?E=e=A:(E=J1((.4360747*V+.3850649*d+.1430804*x)/r_),e=J1((.0139322*V+.0971045*d+.7141733*x)/n_)),new vv(116*A-16,500*(E-A),200*(A-e),Z.opacity)}function K1(Z,V,d,x){return arguments.length===1?b2(Z):new vv(Z,V,d,x??1)}function vv(Z,V,d,x){this.l=+Z,this.a=+V,this.b=+d,this.opacity=+x}function J1(Z){return Z>T2?Math.pow(Z,.3333333333333333):Z/o_+i_}function $1(Z){return Z>Od?Z*Z*Z:o_*(Z-i_)}function Q1(Z){return 255*(Z<=.0031308?12.92*Z:1.055*Math.pow(Z,.4166666666666667)-.055)}function e_(Z){return(Z/=255)<=.04045?Z/12.92:Math.pow((Z+.055)/1.055,2.4)}function Lk(Z){if(Z instanceof Lv)return new Lv(Z.h,Z.c,Z.l,Z.opacity);if(Z instanceof vv||(Z=b2(Z)),Z.a===0&&Z.b===0)return new Lv(NaN,0=1?(d=1,V-1):Math.floor(d*V),A=Z[x],E=Z[x+1],e=x>0?Z[x-1]:2*A-E,t=x()=>Z}});function C2(Z,V){return function(d){return Z+d*V}}function Dk(Z,V,d){return Z=Math.pow(Z,d),V=Math.pow(V,d)-Z,d=1/d,function(x){return Math.pow(Z+x*V,d)}}function dg(Z,V){var d=V-Z;return d?C2(Z,d>180||d<-180?d-360*Math.round(d/360):d):$0(isNaN(Z)?V:Z)}function zk(Z){return(Z=+Z)==1?Nf:function(V,d){return d-V?Dk(V,d,Z):$0(isNaN(V)?d:V)}}function Nf(Z,V){var d=V-Z;return d?C2(Z,d):$0(isNaN(Z)?V:Z)}var Op=Bl({"node_modules/d3-interpolate/src/color.js"(){k2()}});function L2(Z){return function(V){var d=V.length,x=new Array(d),A=new Array(d),E=new Array(d),e,t;for(e=0;ed&&(E=V.slice(d,E),t[e]?t[e]+=E:t[++e]=E),(x=x[0])===(A=A[0])?t[e]?t[e]+=A:t[++e]=A:(t[++e]=null,r.push({i:e,x:dv(x,A)})),d=yg.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(A(i)+"rotate(",null,x)-2,x:dv(o,a)})):a&&i.push(A(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(A(i)+"skewX(",null,x)-2,x:dv(o,a)}):a&&i.push(A(i)+"skewX("+a+x)}function r(o,a,i,n,s,h){if(o!==i||a!==n){var c=s.push(A(s)+"scale(",null,",",null,")");h.push({i:c-4,x:dv(o,i)},{i:c-2,x:dv(a,n)})}else(i!==1||n!==1)&&s.push(A(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Z(o),a=Z(a),E(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var h=-1,c=n.length,m;++h_g,interpolateArray:()=>Fk,interpolateBasis:()=>S2,interpolateBasisClosed:()=>M2,interpolateCubehelix:()=>a3,interpolateCubehelixLong:()=>n3,interpolateDate:()=>O2,interpolateDiscrete:()=>Nk,interpolateHcl:()=>e3,interpolateHclLong:()=>t3,interpolateHsl:()=>J2,interpolateHslLong:()=>$2,interpolateHue:()=>jk,interpolateLab:()=>eC,interpolateNumber:()=>dv,interpolateNumberArray:()=>v_,interpolateObject:()=>N2,interpolateRgb:()=>pg,interpolateRgbBasis:()=>P2,interpolateRgbBasisClosed:()=>I2,interpolateRound:()=>qk,interpolateString:()=>j2,interpolateTransformCss:()=>H2,interpolateTransformSvg:()=>W2,interpolateZoom:()=>Y2,piecewise:()=>nC,quantize:()=>oC});var Bp=Bl({"node_modules/d3-interpolate/src/index.js"(){xg(),F2(),h_(),E2(),B2(),Uk(),Vk(),mg(),d_(),U2(),Gk(),V2(),Yk(),$k(),R2(),Qk(),tC(),rC(),aC(),iC(),sC()}}),m_=We({"src/traces/sunburst/fill_one.js"(Z,V){"use strict";var d=Oo(),x=Fi();V.exports=function(E,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(E,t,r,e)}else x.fill(E,n)}}}),i3=We({"src/traces/sunburst/style.js"(Z,V){"use strict";var d=Hi(),x=Fi(),A=aa(),E=oh().resizeText,e=m_();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],h=s.trace;n.style("opacity",h.opacity),n.selectAll("path.surface").each(function(c){d.select(this).call(r,c,h,o)})})}function r(o,a,i,n){var s=a.data.data,h=!a.children,c=s.i,m=A.castOption(i,c,"marker.line.color")||x.defaultLine,p=A.castOption(i,c,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",p).call(x.stroke,m).style("opacity",h?i.leaf.opacity:null)}V.exports={style:t,styleOne:r}}}),Kv=We({"src/traces/sunburst/helpers.js"(Z){"use strict";var V=aa(),d=Fi(),x=sv(),A=kd();Z.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Z.getPtId(i)===o)return a=i.copy()}),a||r},Z.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Z.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Z.isHeader=function(r,o){return!(Z.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Z.getParent=function(r,o){return Z.findEntryWithLevel(r,t(o))},Z.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Z.listPath(a,o).concat(i)},Z.getPath=function(r){return Z.listPath(r,"label").join("/")+"/"},Z.formatValue=A.formatPieValue,Z.formatPercent=function(r,o){var a=V.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,o)),a}}}),Tg=We({"src/traces/sunburst/fx.js"(Z,V){"use strict";var d=Hi(),x=Wi(),A=Th().appendArrayPointValue,E=hc(),e=aa(),t=M0(),r=Kv(),o=kd(),a=o.formatPieValue;V.exports=function(s,h,c,m,p){var T=m[0],l=T.trace,_=T.hierarchy,w=l.type==="sunburst",S=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(v){var u=c._fullLayout;if(!(c._dragging||u.hovermode===!1)){var g=c._fullData[l.index],f=v.data.data,P=f.i,L=r.isHierarchyRoot(v),z=r.getParent(_,v),F=r.getValue(v),B=function(ee){return e.castOption(g,P,ee)},O=B("hovertemplate"),I=E.castHoverinfo(g,u,P),N=u.separators,U;if(O||I&&I!=="none"&&I!=="skip"){var W,Q;w&&(W=T.cx+v.pxmid[0]*(1-v.rInscribed),Q=T.cy+v.pxmid[1]*(1-v.rInscribed)),S&&(W=v._hoverX,Q=v._hoverY);var le={},se=[],he=[],q=function(ee){return se.indexOf(ee)!==-1};I&&(se=I==="all"?g._module.attributes.hoverinfo.flags:I.split("+")),le.label=f.label,q("label")&&le.label&&he.push(le.label),f.hasOwnProperty("v")&&(le.value=f.v,le.valueLabel=a(le.value,N),q("value")&&he.push(le.valueLabel)),le.currentPath=v.currentPath=r.getPath(v.data),q("current path")&&!L&&he.push(le.currentPath);var $,J=[],X=function(){J.indexOf($)===-1&&(he.push($),J.push($))};le.percentParent=v.percentParent=F/r.getValue(z),le.parent=v.parentString=r.getPtLabel(z),q("percent parent")&&($=r.formatPercent(le.percentParent,N)+" of "+le.parent,X()),le.percentEntry=v.percentEntry=F/r.getValue(h),le.entry=v.entry=r.getPtLabel(h),q("percent entry")&&!L&&!v.onPathbar&&($=r.formatPercent(le.percentEntry,N)+" of "+le.entry,X()),le.percentRoot=v.percentRoot=F/r.getValue(_),le.root=v.root=r.getPtLabel(_),q("percent root")&&!L&&($=r.formatPercent(le.percentRoot,N)+" of "+le.root,X()),le.text=B("hovertext")||B("text"),q("text")&&($=le.text,e.isValidTextValue($)&&he.push($)),U=[i(v,g,p.eventDataKeys)];var oe={trace:g,y:Q,_x0:v._x0,_x1:v._x1,_y0:v._y0,_y1:v._y1,text:he.join("
"),name:O||q("name")?g.name:void 0,color:B("hoverlabel.bgcolor")||f.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:le,eventData:U};w&&(oe.x0=W-v.rInscribed*v.rpx1,oe.x1=W+v.rInscribed*v.rpx1,oe.idealAlign=v.pxmid[0]<0?"left":"right"),S&&(oe.x=W,oe.idealAlign=W<0?"left":"right");var ne=[];E.loneHover(oe,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:c,inOut_bbox:ne}),U[0].bbox=ne[0],l._hasHoverLabel=!0}if(S){var j=s.select("path.surface");p.styleOne(j,v,g,c,{hovered:!0})}l._hasHoverEvent=!0,c.emit("plotly_hover",{points:U||[i(v,g,p.eventDataKeys)],event:d.event})}},y=function(v){var u=c._fullLayout,g=c._fullData[l.index],f=d.select(this).datum();if(l._hasHoverEvent&&(v.originalEvent=d.event,c.emit("plotly_unhover",{points:[i(f,g,p.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var P=s.select("path.surface");p.styleOne(P,f,g,c,{hovered:!1})}},b=function(v){var u=c._fullLayout,g=c._fullData[l.index],f=w&&(r.isHierarchyRoot(v)||r.isLeaf(v)),P=r.getPtId(v),L=r.isEntry(v)?r.findEntryWithChild(_,P):r.findEntryWithLevel(_,P),z=r.getPtId(L),F={points:[i(v,g,p.eventDataKeys)],event:d.event};f||(F.nextLevel=z);var B=t.triggerHandler(c,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(c._hoverdata=[i(v,g,p.eventDataKeys)],E.click(c,d.event)),!f&&B!==!1&&!c._dragging&&!c._transitioning){x.call("_storeDirectGUIEdit",g,u._tracePreGUI[g.uid],{level:g.level});var O={data:[{level:z}],traces:[l.index]},I={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),x.call("animate",c,O,I)}};s.on("mouseover",M),s.on("mouseout",y),s.on("click",b)};function i(n,s,h){for(var c=n.data.data,m={curveNumber:s.index,pointNumber:c.i,data:s._input,fullData:s},p=0;pnt.x1?2*Math.PI:0)+ee;Ke=ce.rpx1He?2*Math.PI:0)+ee;Qe={x0:Ke,x1:Ke}}else Qe={rpx0:se,rpx1:se},E.extendFlat(Qe,ge(ce));else Qe={rpx0:0,rpx1:0};else Qe={x0:ee,x1:ee};return x(Qe,nt)}function Ae(ce){var ze=J[T.getPtId(ce)],Qe,nt=ce.transform;if(ze)Qe=ze;else if(Qe={rpx1:ce.rpx1,transform:{textPosAngle:nt.textPosAngle,scale:0,rotate:nt.rotate,rCenter:nt.rCenter,x:nt.x,y:nt.y}},$)if(ce.parent)if(He){var Ke=ce.x1>He?2*Math.PI:0;Qe.x0=Qe.x1=Ke}else E.extendFlat(Qe,ge(ce));else Qe.x0=Qe.x1=ee;else Qe.x0=Qe.x1=ee;var kt=x(Qe.transform.textPosAngle,ce.transform.textPosAngle),Et=x(Qe.rpx1,ce.rpx1),Bt=x(Qe.x0,ce.x0),jt=x(Qe.x1,ce.x1),_r=x(Qe.transform.scale,nt.scale),pr=x(Qe.transform.rotate,nt.rotate),Or=nt.rCenter===0?3:Qe.transform.rCenter===0?1/3:1,mr=x(Qe.transform.rCenter,nt.rCenter),Er=function(yt){return mr(Math.pow(yt,Or))};return function(yt){var Oe=Et(yt),Xe=Bt(yt),be=jt(yt),Ce=Er(yt),Ne=_e(Oe,(Xe+be)/2),Ee=kt(yt),Se={pxmid:Ne,rpx1:Oe,transform:{textPosAngle:Ee,rCenter:Ce,x:nt.x,y:nt.y}};return r(B.type,nt,f),{transform:{targetX:Ie(Se),targetY:De(Se),scale:_r(yt),rotate:pr(yt),rCenter:Ce}}}}function ge(ce){var ze=ce.parent,Qe=J[T.getPtId(ze)],nt={};if(Qe){var Ke=ze.children,kt=Ke.indexOf(ce),Et=Ke.length,Bt=x(Qe.x0,Qe.x1);nt.x0=Bt(kt/Et),nt.x1=Bt(kt/Et)}else nt.x0=nt.x1=0;return nt}}function _(y){return d.partition().size([2*Math.PI,y.height+1])(y)}Z.formatSliceLabel=function(y,b,v,u,g){var f=v.texttemplate,P=v.textinfo;if(!f&&(!P||P==="none"))return"";var L=g.separators,z=u[0],F=y.data.data,B=z.hierarchy,O=T.isHierarchyRoot(y),I=T.getParent(B,y),N=T.getValue(y);if(!f){var U=P.split("+"),W=function(ne){return U.indexOf(ne)!==-1},Q=[],le;if(W("label")&&F.label&&Q.push(F.label),F.hasOwnProperty("v")&&W("value")&&Q.push(T.formatValue(F.v,L)),!O){W("current path")&&Q.push(T.getPath(y.data));var se=0;W("percent parent")&&se++,W("percent entry")&&se++,W("percent root")&&se++;var he=se>1;if(se){var q,$=function(ne){le=T.formatPercent(q,L),he&&(le+=" of "+ne),Q.push(le)};W("percent parent")&&!O&&(q=N/T.getValue(I),$("parent")),W("percent entry")&&(q=N/T.getValue(b),$("entry")),W("percent root")&&(q=N/T.getValue(B),$("root"))}}return W("text")&&(le=E.castOption(v,F.i,"text"),E.isValidTextValue(le)&&Q.push(le)),Q.join("
")}var J=E.castOption(v,F.i,"texttemplate");if(!J)return"";var X={};F.label&&(X.label=F.label),F.hasOwnProperty("v")&&(X.value=F.v,X.valueLabel=T.formatValue(F.v,L)),X.currentPath=T.getPath(y.data),O||(X.percentParent=N/T.getValue(I),X.percentParentLabel=T.formatPercent(X.percentParent,L),X.parent=T.getPtLabel(I)),X.percentEntry=N/T.getValue(b),X.percentEntryLabel=T.formatPercent(X.percentEntry,L),X.entry=T.getPtLabel(b),X.percentRoot=N/T.getValue(B),X.percentRootLabel=T.formatPercent(X.percentRoot,L),X.root=T.getPtLabel(B),F.hasOwnProperty("color")&&(X.color=F.color);var oe=E.castOption(v,F.i,"text");return(E.isValidTextValue(oe)||oe==="")&&(X.text=oe),X.customdata=E.castOption(v,F.i,"customdata"),E.texttemplateString({data:[X,v._meta],fallback:v.texttemplatefallback,labels:X,locale:g._d3locale,template:J})};function w(y){return y.rpx0===0&&E.isFullCircle([y.x0,y.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(y.halfangle)),y.ring/2))}function S(y){return M(y.rpx1,y.transform.textPosAngle)}function M(y,b){return[y*Math.sin(b),-y*Math.cos(b)]}}}),lC=We({"src/traces/sunburst/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"sunburst",basePlotModule:Ak(),categories:[],animatable:!0,attributes:ig(),layoutAttributes:n2(),supplyDefaults:Sk(),supplyLayoutDefaults:Mk(),calc:sg().calc,crossTraceCalc:sg().crossTraceCalc,plot:g_().plot,style:i3().style,colorbar:Yf(),meta:{}}}}),uC=We({"lib/sunburst.js"(Z,V){"use strict";V.exports=lC()}}),cC=We({"src/traces/treemap/base_plot.js"(Z){"use strict";var V=Nu();Z.name="treemap",Z.plot=function(d,x,A,E){V.plotBasePlot(Z.name,d,x,A,E)},Z.clean=function(d,x,A,E){V.cleanBasePlot(Z.name,d,x,A,E)}}}),Np=We({"src/traces/treemap/constants.js"(Z,V){"use strict";V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),y_=We({"src/traces/treemap/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:A}=wl(),E=Zl(),e=Uu().attributes,t=Pp(),r=ig(),o=Np(),a=Fo().extendFlat,i=zf().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:a({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:r.marker.colors,pattern:i,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:a({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:r.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:A({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),hovertemplatefallback:A(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:a({},t.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:t.sort,root:r.root,domain:e({name:"treemap",trace:!0,editType:"calc"})}}}),o3=We({"src/traces/treemap/layout_attributes.js"(Z,V){"use strict";V.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),fC=We({"src/traces/treemap/defaults.js"(Z,V){"use strict";var d=aa(),x=y_(),A=Fi(),E=Uu().defaults,e=Bh().handleText,t=Sp().TEXTPAD,r=Ip().handleMarkerDefaults,o=xu(),a=o.hasColorscale,i=o.handleDefaults;V.exports=function(s,h,c,m){function p(g,f){return d.coerce(s,h,x,g,f)}var T=p("labels"),l=p("parents");if(!T||!T.length||!l||!l.length){h.visible=!1;return}var _=p("values");_&&_.length?p("branchvalues"):p("count"),p("level"),p("maxdepth");var w=p("tiling.packing");w==="squarify"&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var S=p("text");p("texttemplate"),p("texttemplatefallback"),h.texttemplate||p("textinfo",d.isArrayOrTypedArray(S)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var M=p("pathbar.visible"),y="auto";e(s,h,m,p,y,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var b=h.textposition.indexOf("bottom")!==-1;r(s,h,m,p);var v=h._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;v?i(s,h,m,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(h.marker.colors||[]).length);var u=h.textfont.size*2;p("marker.pad.t",b?u/4:u),p("marker.pad.l",u/4),p("marker.pad.r",u/4),p("marker.pad.b",b?u:u/4),p("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:A.contrast(m.paper_bgcolor)}}},M&&(p("pathbar.thickness",h.pathbar.textfont.size+2*t),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),E(h,m,p),h._length=null}}}),hC=We({"src/traces/treemap/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=o3();V.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),s3=We({"src/traces/treemap/calc.js"(Z){"use strict";var V=sg();Z.calc=function(d,x){return V.calc(d,x)},Z.crossTraceCalc=function(d){return V._runCrossTraceCalc("treemap",d)}}}),l3=We({"src/traces/treemap/flip_tree.js"(Z,V){"use strict";V.exports=function d(x,A,E){var e;E.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),E.flipX&&(e=x.x0,x.x0=A[0]-x.x1,x.x1=A[0]-e),E.flipY&&(e=x.y0,x.y0=A[1]-x.y1,x.y1=A[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var he=x.ensureSingle(le,"g","slicetext"),q=x.ensureSingle(he,"text","",function(J){J.attr("data-notex",1)}),$=x.ensureUniformFontSize(s,o.determineTextFont(B,Q,z.font,{onPathbar:!0}));q.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,$).call(E.convertToTspans,s),Q.textBB=A.bBox(q.node()),Q.transform=y(Q,{fontSize:$.size,onPathbar:!0}),Q.transform.fontSize=$.size,v?q.transition().attrTween("transform",function(J){var X=f(J,i,P,[l,_]);return function(oe){return b(X(oe))}}):q.attr("transform",b(Q))})}}}),dC=We({"src/traces/treemap/plot_one.js"(Z,V){"use strict";var d=Hi(),x=(Bp(),xd(Nd)).interpolate,A=Kv(),E=aa(),e=Sp().TEXTPAD,t=Mp(),r=t.toMoveInsideBar,o=oh(),a=o.recordMinTextSize,i=Np(),n=vC();function s(h){return A.isHierarchyRoot(h)?"":A.getPtId(h)}V.exports=function(c,m,p,T,l){var _=c._fullLayout,w=m[0],S=w.trace,M=S.type,y=M==="icicle",b=w.hierarchy,v=A.findEntryWithLevel(b,S.level),u=d.select(p),g=u.selectAll("g.pathbar"),f=u.selectAll("g.slice");if(!v){g.remove(),f.remove();return}var P=A.isHierarchyRoot(v),L=!_.uniformtext.mode&&A.hasTransition(T),z=A.getMaxDepth(S),F=function(mr){return mr.data.depth-v.data.depth-1?N+Q:-(W+Q):0,se={x0:U,x1:U,y0:le,y1:le+W},he=function(mr,Er,yt){var Oe=S.tiling.pad,Xe=function(Ee){return Ee-Oe<=Er.x0},be=function(Ee){return Ee+Oe>=Er.x1},Ce=function(Ee){return Ee-Oe<=Er.y0},Ne=function(Ee){return Ee+Oe>=Er.y1};return mr.x0===Er.x0&&mr.x1===Er.x1&&mr.y0===Er.y0&&mr.y1===Er.y1?{x0:mr.x0,x1:mr.x1,y0:mr.y0,y1:mr.y1}:{x0:Xe(mr.x0-Oe)?0:be(mr.x0-Oe)?yt[0]:mr.x0,x1:Xe(mr.x1+Oe)?0:be(mr.x1+Oe)?yt[0]:mr.x1,y0:Ce(mr.y0-Oe)?0:Ne(mr.y0-Oe)?yt[1]:mr.y0,y1:Ce(mr.y1+Oe)?0:Ne(mr.y1+Oe)?yt[1]:mr.y1}},q=null,$={},J={},X=null,oe=function(mr,Er){return Er?$[s(mr)]:J[s(mr)]},ne=function(mr,Er,yt,Oe){if(Er)return $[s(b)]||se;var Xe=J[S.level]||yt;return F(mr)?he(mr,Xe,Oe):{}};w.hasMultipleRoots&&P&&z++,S._maxDepth=z,S._backgroundColor=_.paper_bgcolor,S._entryDepth=v.data.depth,S._atRootLevel=P;var j=-I/2+B.l+B.w*(O.x[1]+O.x[0])/2,ee=-N/2+B.t+B.h*(1-(O.y[1]+O.y[0])/2),re=function(mr){return j+mr},ue=function(mr){return ee+mr},_e=ue(0),Te=re(0),Ie=function(mr){return Te+mr},De=function(mr){return _e+mr};function He(mr,Er){return mr+","+Er}var et=Ie(0),rt=function(mr){mr.x=Math.max(et,mr.x)},$e=S.pathbar.edgeshape,ot=function(mr){var Er=Ie(Math.max(Math.min(mr.x0,mr.x0),0)),yt=Ie(Math.min(Math.max(mr.x1,mr.x1),U)),Oe=De(mr.y0),Xe=De(mr.y1),be=W/2,Ce={},Ne={};Ce.x=Er,Ne.x=yt,Ce.y=Ne.y=(Oe+Xe)/2;var Ee={x:Er,y:Oe},Se={x:yt,y:Oe},Le={x:yt,y:Xe},at={x:Er,y:Xe};return $e===">"?(Ee.x-=be,Se.x-=be,Le.x-=be,at.x-=be):$e==="/"?(Le.x-=be,at.x-=be,Ce.x-=be/2,Ne.x-=be/2):$e==="\\"?(Ee.x-=be,Se.x-=be,Ce.x-=be/2,Ne.x-=be/2):$e==="<"&&(Ce.x-=be,Ne.x-=be),rt(Ee),rt(at),rt(Ce),rt(Se),rt(Le),rt(Ne),"M"+He(Ee.x,Ee.y)+"L"+He(Se.x,Se.y)+"L"+He(Ne.x,Ne.y)+"L"+He(Le.x,Le.y)+"L"+He(at.x,at.y)+"L"+He(Ce.x,Ce.y)+"Z"},Ae=S[y?"tiling":"marker"].pad,ge=function(mr){return S.textposition.indexOf(mr)!==-1},ce=ge("top"),ze=ge("left"),Qe=ge("right"),nt=ge("bottom"),Ke=function(mr){var Er=re(mr.x0),yt=re(mr.x1),Oe=ue(mr.y0),Xe=ue(mr.y1),be=yt-Er,Ce=Xe-Oe;if(!be||!Ce)return"";var Ne=S.marker.cornerradius||0,Ee=Math.min(Ne,be/2,Ce/2);Ee&&mr.data&&mr.data.data&&mr.data.data.label&&(ce&&(Ee=Math.min(Ee,Ae.t)),ze&&(Ee=Math.min(Ee,Ae.l)),Qe&&(Ee=Math.min(Ee,Ae.r)),nt&&(Ee=Math.min(Ee,Ae.b)));var Se=function(Le,at){return Ee?"a"+He(Ee,Ee)+" 0 0 1 "+He(Le,at):""};return"M"+He(Er,Oe+Ee)+Se(Ee,-Ee)+"L"+He(yt-Ee,Oe)+Se(Ee,Ee)+"L"+He(yt,Xe-Ee)+Se(-Ee,Ee)+"L"+He(Er+Ee,Xe)+Se(-Ee,-Ee)+"Z"},kt=function(mr,Er){var yt=mr.x0,Oe=mr.x1,Xe=mr.y0,be=mr.y1,Ce=mr.textBB,Ne=ce||Er.isHeader&&!nt,Ee=Ne?"start":nt?"end":"middle",Se=ge("right"),Le=ge("left")||Er.onPathbar,at=Le?-1:Se?1:0;if(Er.isHeader){if(yt+=(y?Ae:Ae.l)-e,Oe-=(y?Ae:Ae.r)-e,yt>=Oe){var dt=(yt+Oe)/2;yt=dt,Oe=dt}var gt;nt?(gt=be-(y?Ae:Ae.b),Xe-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),le=Q.descendants(),se=1/0,he=-1/0;le.forEach(function(oe){var ne=oe.depth;ne>=O._maxDepth?(oe.x0=oe.x1=(oe.x0+oe.x1)/2,oe.y0=oe.y1=(oe.y0+oe.y1)/2):(se=Math.min(se,ne),he=Math.max(he,ne))}),p=p.data(le,o.getPtId),O._maxVisibleLayers=isFinite(he)?he-se+1:0,p.enter().append("g").classed("slice",!0),u(p,n,L,[l,_],M),p.order();var q=null;if(v&&P){var $=o.getPtId(P);p.each(function(oe){q===null&&o.getPtId(oe)===$&&(q={x0:oe.x0,x1:oe.x1,y0:oe.y0,y1:oe.y1})})}var J=function(){return q||{x0:0,x1:l,y0:0,y1:_}},X=p;return v&&(X=X.transition().each("end",function(){var oe=d.select(this);o.setSliceCursor(oe,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(oe){var ne=o.isHeader(oe,O);oe._x0=w(oe.x0),oe._x1=w(oe.x1),oe._y0=S(oe.y0),oe._y1=S(oe.y1),oe._hoverX=w(oe.x1-O.marker.pad.r),oe._hoverY=S(U?oe.y1-O.marker.pad.b/2:oe.y0+O.marker.pad.t/2);var j=d.select(this),ee=x.ensureSingle(j,"path","surface",function(De){De.style("pointer-events",z?"none":"all")});v?ee.transition().attrTween("d",function(De){var He=g(De,n,J(),[l,_]);return function(et){return M(He(et))}}):ee.attr("d",M),j.call(a,m,h,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,h,{isTransitioning:h._transitioning}),ee.call(t,oe,O,h,{hovered:!1}),oe.x0===oe.x1||oe.y0===oe.y1?oe._text="":ne?oe._text=W?"":o.getPtLabel(oe)||"":oe._text=i(oe,m,O,c,F)||"";var re=x.ensureSingle(j,"g","slicetext"),ue=x.ensureSingle(re,"text","",function(De){De.attr("data-notex",1)}),_e=x.ensureUniformFontSize(h,o.determineTextFont(O,oe,F.font)),Te=oe._text||" ",Ie=ne&&Te.indexOf("
")===-1;ue.text(Te).classed("slicetext",!0).attr("text-anchor",N?"end":I||Ie?"start":"middle").call(A.font,_e).call(E.convertToTspans,h),oe.textBB=A.bBox(ue.node()),oe.transform=y(oe,{fontSize:_e.size,isHeader:ne}),oe.transform.fontSize=_e.size,v?ue.transition().attrTween("transform",function(De){var He=f(De,n,J(),[l,_]);return function(et){return b(He(et))}}):ue.attr("transform",b(oe))}),q}}}),mC=We({"src/traces/treemap/plot.js"(Z,V){"use strict";var d=c3(),x=pC();V.exports=function(E,e,t,r){return d(E,e,t,r,{type:"treemap",drawDescendants:x})}}}),gC=We({"src/traces/treemap/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"treemap",basePlotModule:cC(),categories:[],animatable:!0,attributes:y_(),layoutAttributes:o3(),supplyDefaults:fC(),supplyLayoutDefaults:hC(),calc:s3().calc,crossTraceCalc:s3().crossTraceCalc,plot:mC(),style:__().style,colorbar:Yf(),meta:{}}}}),yC=We({"lib/treemap.js"(Z,V){"use strict";V.exports=gC()}}),_C=We({"src/traces/icicle/base_plot.js"(Z){"use strict";var V=Nu();Z.name="icicle",Z.plot=function(d,x,A,E){V.plotBasePlot(Z.name,d,x,A,E)},Z.clean=function(d,x,A,E){V.cleanBasePlot(Z.name,d,x,A,E)}}}),f3=We({"src/traces/icicle/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:A}=wl(),E=Zl(),e=Uu().attributes,t=Pp(),r=ig(),o=y_(),a=Np(),i=Fo().extendFlat,n=zf().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:o.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:i({colors:r.marker.colors,line:r.marker.line,pattern:n,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:x({editType:"plot"},{keys:a.eventDataKeys.concat(["label","value"])}),texttemplatefallback:A({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:d({},{keys:a.eventDataKeys}),hovertemplatefallback:A(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:o.outsidetextfont,textposition:o.textposition,sort:t.sort,root:r.root,domain:e({name:"icicle",trace:!0,editType:"calc"})}}}),h3=We({"src/traces/icicle/layout_attributes.js"(Z,V){"use strict";V.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),xC=We({"src/traces/icicle/defaults.js"(Z,V){"use strict";var d=aa(),x=f3(),A=Fi(),E=Uu().defaults,e=Bh().handleText,t=Sp().TEXTPAD,r=Ip().handleMarkerDefaults,o=xu(),a=o.hasColorscale,i=o.handleDefaults;V.exports=function(s,h,c,m){function p(b,v){return d.coerce(s,h,x,b,v)}var T=p("labels"),l=p("parents");if(!T||!T.length||!l||!l.length){h.visible=!1;return}var _=p("values");_&&_.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var w=p("text");p("texttemplate"),p("texttemplatefallback"),h.texttemplate||p("textinfo",d.isArrayOrTypedArray(w)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var S=p("pathbar.visible"),M="auto";e(s,h,m,p,M,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),r(s,h,m,p);var y=h._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;y&&i(s,h,m,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",y?1:.7),h._hovered={marker:{line:{width:2,color:A.contrast(m.paper_bgcolor)}}},S&&(p("pathbar.thickness",h.pathbar.textfont.size+2*t),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),E(h,m,p),h._length=null}}}),bC=We({"src/traces/icicle/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=h3();V.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),v3=We({"src/traces/icicle/calc.js"(Z){"use strict";var V=sg();Z.calc=function(d,x){return V.calc(d,x)},Z.crossTraceCalc=function(d){return V._runCrossTraceCalc("icicle",d)}}}),wC=We({"src/traces/icicle/partition.js"(Z,V){"use strict";var d=og(),x=l3();V.exports=function(E,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var h=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(E);return(a||r||o)&&x(h,e,{swapXY:a,flipX:r,flipY:o}),h}}}),d3=We({"src/traces/icicle/style.js"(Z,V){"use strict";var d=Hi(),x=Fi(),A=aa(),E=oh().resizeText,e=m_();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");E(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],h=s.trace;n.style("opacity",h.opacity),n.selectAll("path.surface").each(function(c){d.select(this).call(r,c,h,o)})})}function r(o,a,i,n){var s=a.data.data,h=!a.children,c=s.i,m=A.castOption(i,c,"marker.line.color")||x.defaultLine,p=A.castOption(i,c,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",p).call(x.stroke,m).style("opacity",h?i.leaf.opacity:null)}V.exports={style:t,styleOne:r}}}),TC=We({"src/traces/icicle/draw_descendants.js"(Z,V){"use strict";var d=Hi(),x=aa(),A=Oo(),E=zl(),e=wC(),t=d3().styleOne,r=Np(),o=Kv(),a=Tg(),i=g_().formatSliceLabel,n=!1;V.exports=function(h,c,m,p,T){var l=T.width,_=T.height,w=T.viewX,S=T.viewY,M=T.pathSlice,y=T.toMoveInsideSlice,b=T.strTransform,v=T.hasTransition,u=T.handleSlicesExit,g=T.makeUpdateSliceInterpolator,f=T.makeUpdateTextInterpolator,P=T.prevEntry,L={},z=h._context.staticPlot,F=h._fullLayout,B=c[0],O=B.trace,I=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,W=e(m,[l,_],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),Q=W.descendants(),le=1/0,se=-1/0;Q.forEach(function(X){var oe=X.depth;oe>=O._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(le=Math.min(le,oe),se=Math.max(se,oe))}),p=p.data(Q,o.getPtId),O._maxVisibleLayers=isFinite(se)?se-le+1:0,p.enter().append("g").classed("slice",!0),u(p,n,L,[l,_],M),p.order();var he=null;if(v&&P){var q=o.getPtId(P);p.each(function(X){he===null&&o.getPtId(X)===q&&(he={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var $=function(){return he||{x0:0,x1:l,y0:0,y1:_}},J=p;return v&&(J=J.transition().each("end",function(){var X=d.select(this);o.setSliceCursor(X,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),J.each(function(X){X._x0=w(X.x0),X._x1=w(X.x1),X._y0=S(X.y0),X._y1=S(X.y1),X._hoverX=w(X.x1-O.tiling.pad),X._hoverY=S(U?X.y1-O.tiling.pad/2:X.y0+O.tiling.pad/2);var oe=d.select(this),ne=x.ensureSingle(oe,"path","surface",function(ue){ue.style("pointer-events",z?"none":"all")});v?ne.transition().attrTween("d",function(ue){var _e=g(ue,n,$(),[l,_],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Te){return M(_e(Te))}}):ne.attr("d",M),oe.call(a,m,h,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,h,{isTransitioning:h._transitioning}),ne.call(t,X,O,h,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=i(X,m,O,c,F)||"";var j=x.ensureSingle(oe,"g","slicetext"),ee=x.ensureSingle(j,"text","",function(ue){ue.attr("data-notex",1)}),re=x.ensureUniformFontSize(h,o.determineTextFont(O,X,F.font));ee.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":I?"start":"middle").call(A.font,re).call(E.convertToTspans,h),X.textBB=A.bBox(ee.node()),X.transform=y(X,{fontSize:re.size}),X.transform.fontSize=re.size,v?ee.transition().attrTween("transform",function(ue){var _e=f(ue,n,$(),[l,_]);return function(Te){return b(_e(Te))}}):ee.attr("transform",b(X))}),he}}}),AC=We({"src/traces/icicle/plot.js"(Z,V){"use strict";var d=c3(),x=TC();V.exports=function(E,e,t,r){return d(E,e,t,r,{type:"icicle",drawDescendants:x})}}}),SC=We({"src/traces/icicle/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"icicle",basePlotModule:_C(),categories:[],animatable:!0,attributes:f3(),layoutAttributes:h3(),supplyDefaults:xC(),supplyLayoutDefaults:bC(),calc:v3().calc,crossTraceCalc:v3().crossTraceCalc,plot:AC(),style:d3().style,colorbar:Yf(),meta:{}}}}),MC=We({"lib/icicle.js"(Z,V){"use strict";V.exports=SC()}}),EC=We({"src/traces/funnelarea/base_plot.js"(Z){"use strict";var V=Nu();Z.name="funnelarea",Z.plot=function(d,x,A,E){V.plotBasePlot(Z.name,d,x,A,E)},Z.clean=function(d,x,A,E){V.cleanBasePlot(Z.name,d,x,A,E)}}}),p3=We({"src/traces/funnelarea/attributes.js"(Z,V){"use strict";var d=Pp(),x=El(),A=Uu().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=wl(),r=Fo().extendFlat;V.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:r({},d.marker.line.color,{dflt:null}),width:r({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:r({},d.scalegroup,{}),textinfo:r({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:t({editType:"plot"}),hoverinfo:r({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:t(),textposition:r({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:r({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),m3=We({"src/traces/funnelarea/layout_attributes.js"(Z,V){"use strict";var d=U1().hiddenlabels;V.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),kC=We({"src/traces/funnelarea/defaults.js"(Z,V){"use strict";var d=aa(),x=p3(),A=Uu().defaults,E=Bh().handleText,e=Ip().handleLabelsAndValues,t=Ip().handleMarkerDefaults;V.exports=function(o,a,i,n){function s(M,y){return d.coerce(o,a,x,M,y)}var h=s("labels"),c=s("values"),m=e(h,c),p=m.len;if(a._hasLabels=m.hasLabels,a._hasValues=m.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!p){a.visible=!1;return}a._length=p,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate");s("texttemplatefallback");var _;if(l||(_=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),l||_&&_!=="none"){var w=s("textposition");E(o,a,n,s,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else _==="none"&&s("textposition","none");A(a,n,s);var S=s("title.text");S&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),CC=We({"src/traces/funnelarea/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=m3();V.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),g3=We({"src/traces/funnelarea/calc.js"(Z,V){"use strict";var d=X0();function x(E,e){return d.calc(E,e)}function A(E){d.crossTraceCalc(E,{type:"funnelarea"})}V.exports={calc:x,crossTraceCalc:A}}}),LC=We({"src/traces/funnelarea/plot.js"(Z,V){"use strict";var d=Hi(),x=Oo(),A=aa(),E=A.strScale,e=A.strTranslate,t=zl(),r=Mp(),o=r.toMoveInsideBar,a=oh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=kd(),h=j1(),c=h.attachFxHandlers,m=h.determineInsideTextFont,p=h.layoutAreas,T=h.prerenderTitles,l=h.positionTitleOutside,_=h.formatSliceLabel;V.exports=function(b,v){var u=b._context.staticPlot,g=b._fullLayout;n("funnelarea",g),T(v,b),p(v,g._size),A.makeTraceGroups(g._funnelarealayer,v,"trace").each(function(f){var P=d.select(this),L=f[0],z=L.trace;M(f),P.each(function(){var F=d.select(this).selectAll("g.slice").data(f);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,I){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=L.cx,U=L.cy,W=d.select(this),Q=W.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),W.call(c,b,f);var le="M"+(N+O.TR[0])+","+(U+O.TR[1])+w(O.TR,O.BR)+w(O.BR,O.BL)+w(O.BL,O.TL)+"Z";Q.attr("d",le),_(b,O,L);var se=s.castOption(z.textposition,O.pts),he=W.selectAll("g.slicetext").data(O.text&&se!=="none"?[0]:[]);he.enter().append("g").classed("slicetext",!0),he.exit().remove(),he.each(function(){var q=A.ensureSingle(d.select(this),"text","",function(re){re.attr("data-notex",1)}),$=A.ensureUniformFontSize(b,m(z,O,g.font));q.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,$).call(t.convertToTspans,b);var J=x.bBox(q.node()),X,oe,ne,j=Math.min(O.BL[1],O.BR[1])+U,ee=Math.max(O.TL[1],O.TR[1])+U;oe=Math.max(O.TL[0],O.BL[0])+N,ne=Math.min(O.TR[0],O.BR[0])+N,X=o(oe,ne,j,ee,J,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=$.size,i(z.type,X,g),f[I].transform=X,A.setTransormAndDisplay(q,X)})});var B=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var O=A.ensureSingle(d.select(this),"text","",function(U){U.attr("data-notex",1)}),I=z.title.text;z._meta&&(I=A.templateString(I,z._meta)),O.text(I).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,b);var N=l(L,g._size);O.attr("transform",e(N.x,N.y)+E(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function w(y,b){var v=b[0]-y[0],u=b[1]-y[1];return"l"+v+","+u}function S(y,b){return[.5*(y[0]+b[0]),.5*(y[1]+b[1])]}function M(y){if(!y.length)return;var b=y[0],v=b.trace,u=v.aspectratio,g=v.baseratio;g>.999&&(g=.999);var f=Math.pow(g,2),P=b.vTotal,L=P*f/(1-f),z=P,F=L/P;function B(){var ue=Math.sqrt(F);return{x:ue,y:-ue}}function O(){var ue=B();return[ue.x,ue.y]}var I,N=[];N.push(O());var U,W;for(U=y.length-1;U>-1;U--)if(W=y[U],!W.hidden){var Q=W.v/z;F+=Q,N.push(O())}var le=1/0,se=-1/0;for(U=0;U-1;U--)if(W=y[U],!W.hidden){j+=1;var ee=N[j][0],re=N[j][1];W.TL=[-ee,re],W.TR=[ee,re],W.BL=oe,W.BR=ne,W.pxmid=S(W.TR,W.BR),oe=W.TL,ne=W.TR}}}}),PC=We({"src/traces/funnelarea/style.js"(Z,V){"use strict";var d=Hi(),x=P0(),A=oh().resizeText;V.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),IC=We({"src/traces/funnelarea/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"funnelarea",basePlotModule:EC(),categories:["pie-like","funnelarea","showLegend"],attributes:p3(),layoutAttributes:m3(),supplyDefaults:kC(),supplyLayoutDefaults:CC(),calc:g3().calc,crossTraceCalc:g3().crossTraceCalc,plot:LC(),style:PC(),styleOne:P0(),meta:{}}}}),RC=We({"lib/funnelarea.js"(Z,V){"use strict";V.exports=IC()}}),Uf=We({"stackgl_modules/index.js"(Z,V){(function(){var d={24:(function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,h=a.clientY||0,c=o(i);return n[0]=s-c.left,n[1]=h-c.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}}),109:(function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],h=o[0]-n,c=o[2]-s,m=Math.sin(i),p=Math.cos(i);return r[0]=n+c*m+h*p,r[1]=o[1],r[2]=s+c*p-h*m,r}}),160:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}}),216:(function(e){"use strict";e.exports=t;function t(r,o){for(var a={},i=0;i1){m[0]in h||(h[m[0]]=[]),h=h[m[0]];for(var p=1;p=0;--I){var $=B[I];N=$[0];var J=z[N],X=J[0],oe=J[1],ne=L[X],j=L[oe];if((ne[0]-j[0]||ne[1]-j[1])<0){var ee=X;X=oe,oe=ee}J[0]=X;var re=J[1]=$[1],ue;for(O&&(ue=J[2]);I>0&&B[I-1][0]===N;){var $=B[--I],_e=$[1];O?z.push([re,_e,ue]):z.push([re,_e]),re=_e}O?z.push([re,oe,ue]):z.push([re,oe])}return U}function y(L,z,F){for(var B=z.length,O=new o(B),I=[],N=0;Nz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var B=0;B0||N.length>0}function P(L,z,F){var B;if(F){B=z;for(var O=new Array(z.length),I=0;I0}function S(s){var h=0,f=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(h=3);h]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var h=s.match(t),f=s.match(r),p=s.match(o);return{width:h&&(h[1]||h[2]),height:f&&(f[1]||f[2]),viewbox:p&&(p[1]||p[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}q.exports=function(s){if(S(s)){for(var h="",f=0;f>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?h=h||o(n,s+8):c==="VP8L"&&T>=9?h=h||a(n,s+8):c==="VP8X"&&T>=10?h=h||i(n,s+8):c==="EXIF"&&(f=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(h)return f>0&&(h.orientation=f),h}}}}}),lk=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"(Z,q){"use strict";q.exports={avif:$6(),bmp:Q6(),gif:ek(),ico:tk(),jpeg:rk(),png:ak(),psd:nk(),svg:ik(),tiff:ok(),webp:sk()}}}),uk=Ge({"node_modules/probe-image-size/sync.js"(Z,q){"use strict";var d=lk();function x(S){for(var E=Object.keys(d),e=0;e0;)R=h.c2p(M+N*u),N--;for(N=0;z===void 0&&N0;)F=f.c2p(g+N*y),N--;if(RG[0];if(Y||ee){var V=m+P/2,se=z+U/2;ce+="transform:"+S(V+"px",se+"px")+"scale("+(Y?-1:1)+","+(ee?-1:1)+")"+S(-V+"px",-se+"px")+";"}}le.attr("style",ce);var ae=new Promise(function(j){if(_._hasZ)j();else if(_._hasSource)if(_._canvas&&_._canvas.el.width===b&&_._canvas.el.height===v&&_._canvas.source===_.source)j();else{var Q=document.createElement("canvas");Q.width=b,Q.height=v;var re=Q.getContext("2d",{willReadFrequently:!0});_._image=_._image||new Image;var he=_._image;he.onload=function(){re.drawImage(he,0,0),_._canvas={el:Q,source:_.source},j()},he.setAttribute("src",_.source)}}).then(function(){var j,Q;if(_._hasZ)Q=$(function(xe,Te){var Le=A[Te][xe];return x.isTypedArray(Le)&&(Le=Array.from(Le)),Le}),j=Q.toDataURL("image/png");else if(_._hasSource)if(w)j=_.source;else{var re=_._canvas.el.getContext("2d",{willReadFrequently:!0}),he=re.getImageData(0,0,b,v).data;Q=$(function(xe,Te){var Le=4*(Te*b+xe);return[he[Le],he[Le+1],he[Le+2],he[Le+3]]}),j=Q.toDataURL("image/png")}le.attr({"xlink:href":j,height:U,width:P,x:m,y:z})});a._promises.push(ae)})}}}),vk=Ge({"src/traces/image/style.js"(Z,q){"use strict";var d=Oi();q.exports=function(S){d.select(S).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),dk=Ge({"src/traces/image/hover.js"(Z,q){"use strict";var d=mc(),x=ta(),S=x.isArrayOrTypedArray,E=Z0();q.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var h=Math.floor((r-a.x0)/i.dx),f=Math.floor(Math.abs(o-a.y0)/i.dy),p;if(i._hasZ?p=a.z[f][h]:i._hasSource&&(p=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,f,1,1).data),!!p){var c=a.hi||i.hoverinfo,T;if(c){var l=c.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var _=E.colormodel[i.colormodel],w=_.colormodel||i.colormodel,A=w.length,M=i._scaler(p),g=_.suffix,b=[];(i.hovertemplate||T)&&(b.push("["+[M[0]+g[0],M[1]+g[1],M[2]+g[2]].join(", ")),A===4&&b.push(", "+M[3]+g[3]),b.push("]"),b=b.join(""),t.extraText=w.toUpperCase()+": "+b);var v;S(i.hovertext)&&S(i.hovertext[f])?v=i.hovertext[f][h]:S(i.text)&&S(i.text[f])&&(v=i.text[f][h]);var u=s.c2p(a.y0+(f+.5)*i.dy),y=a.x0+(h+.5)*i.dx,m=a.y0+(f+.5)*i.dy,R="["+p.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[f,h],x0:n.c2p(a.x0+h*i.dx),x1:n.c2p(a.x0+(h+1)*i.dx),y0:u,y1:u,color:M,xVal:y,xLabelVal:y,yVal:m,yLabelVal:m,zLabelVal:R,text:v,hovertemplateLabels:{zLabel:R,colorLabel:b,"color[0]Label":M[0]+g[0],"color[1]Label":M[1]+g[1],"color[2]Label":M[2]+g[2],"color[3]Label":M[3]+g[3]}})]}}}}}),pk=Ge({"src/traces/image/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return"xVal"in S&&(x.x=S.xVal),"yVal"in S&&(x.y=S.yVal),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x.color=S.color,x.colormodel=S.trace.colormodel,x.z||(x.z=S.color),x}}}),mk=Ge({"src/traces/image/index.js"(Z,q){"use strict";q.exports={attributes:Fw(),supplyDefaults:$E(),calc:fk(),plot:hk(),style:vk(),hoverPoints:dk(),eventData:pk(),moduleType:"trace",name:"image",basePlotModule:Jc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),gk=Ge({"lib/image.js"(Z,q){"use strict";q.exports=mk()}}),Op=Ge({"src/traces/pie/attributes.js"(Z,q){"use strict";var d=Cl(),x=ju().attributes,S=bu(),E=sf(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Tl(),o=Do().extendFlat,a=Of().pattern,i=S({editType:"plot",arrayOk:!0,colorEditType:"plot"});q.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:a,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:o({},i,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:o({},d.showlegend,{arrayOk:!0}),legend:o({},d.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:o({},i,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Bp=Ge({"src/traces/pie/defaults.js"(Z,q){"use strict";var d=Bo(),x=ta(),S=Op(),E=ju().defaults,e=Uh().handleText,t=ta().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),h=x.isArrayOrTypedArray(n),f=Math.min(s?i.length:1/0,h?n.length:1/0);if(isFinite(f)||(f=0),f&&h){for(var p,c=0;c0){p=!0;break}}p||(f=0)}return{hasLabels:s,hasValues:h,len:f}}function o(i,n,s,h,f){var p=h("marker.line.width");p&&h("marker.line.color",f?void 0:s.paper_bgcolor);var c=h("marker.colors");t(h,"marker.pattern",c),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,h){function f(m,R){return x.coerce(i,n,S,m,R)}var p=f("labels"),c=f("values"),T=r(p,c),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(f("label0"),f("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,h,f,!0),f("scalegroup");var _=f("text"),w=f("texttemplate");f("texttemplatefallback");var A;if(w||(A=f("textinfo",x.isArrayOrTypedArray(_)?"text+percent":"percent")),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),w||A&&A!=="none"){var M=f("textposition");e(i,n,h,f,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var g=Array.isArray(M)||M==="auto",b=g||M==="outside";b&&f("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&f("insidetextorientation")}else A==="none"&&f("textposition","none");E(n,h,f);var v=f("hole"),u=f("title.text");if(u){var y=f("title.position",v?"middle center":"top center");!v&&y==="middle center"&&(n.title.position="top center"),x.coerceFont(f,"title.font",h.font)}f("sort"),f("direction"),f("rotation"),f("pull")}q.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),Z1=Ge({"src/traces/pie/layout_attributes.js"(Z,q){"use strict";q.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yk=Ge({"src/traces/pie/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Z1();q.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),Q0=Ge({"src/traces/pie/calc.js"(Z,q){"use strict";var d=Bo(),x=Ef(),S=Bi(),E={};function e(a,i){var n=[],s=a._fullLayout,h=s.hiddenlabels||[],f=i.labels,p=i.marker.colors||[],c=i.values,T=i._length,l=i._hasValues&&T,_,w;if(i.dlabel)for(f=new Array(T),_=0;_=0});var R=i.type==="funnelarea"?b:i.sort;return R&&n.sort(function(L,z){return z.v-L.v}),n[0]&&(n[0].vTotal=g),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=S.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,h=a.calcdata,f=s[n+"colorway"],p=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(f=o(f,E));for(var c=0,T=0;T0&&(We+=St*ie.pxmid[0],Qe+=St*ie.pxmid[1])}ie.cxFinal=We,ie.cyFinal=Qe;function zt(mt,ze,Ze,we){var ke=we*(ze[0]-mt[0]),Be=we*(ze[1]-mt[1]);return"a"+we*he.r+","+we*he.r+" 0 "+ie.largeArc+(Ze?" 1 ":" 0 ")+ke+","+Be}var Ut=xe.hole;if(ie.v===he.vTotal){var br="M"+(We+ie.px0[0])+","+(Qe+ie.px0[1])+zt(ie.px0,ie.pxmid,!0,1)+zt(ie.pxmid,ie.px0,!0,1)+"Z";Ut?Tt.attr("d","M"+(We+Ut*ie.px0[0])+","+(Qe+Ut*ie.px0[1])+zt(ie.px0,ie.pxmid,!1,Ut)+zt(ie.pxmid,ie.px0,!1,Ut)+"Z"+br):Tt.attr("d",br)}else{var hr=zt(ie.px0,ie.px1,!0,1);if(Ut){var Or=1-Ut;Tt.attr("d","M"+(We+Ut*ie.px1[0])+","+(Qe+Ut*ie.px1[1])+zt(ie.px1,ie.px0,!1,Ut)+"l"+Or*ie.px0[0]+","+Or*ie.px0[1]+hr+"Z")}else Tt.attr("d","M"+We+","+Qe+"l"+ie.px0[0]+","+ie.px0[1]+hr+"Z")}ve(Y,ie,he);var wr=f.castOption(xe.textposition,ie.pts),Er=Xe.selectAll("g.slicetext").data(ie.text&&wr!=="none"?[0]:[]);Er.enter().append("g").classed("slicetext",!0),Er.exit().remove(),Er.each(function(){var mt=t.ensureSingle(d.select(this),"text","",function(ot){ot.attr("data-notex",1)}),ze=t.ensureUniformFontSize(Y,wr==="outside"?w(xe,ie,se.font):A(xe,ie,se.font));mt.text(ie.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,ze).call(a.convertToTspans,Y);var Ze=e.bBox(mt.node()),we;if(wr==="outside")we=z(Ze,ie);else if(we=g(Ze,ie,he),wr==="auto"&&we.scale<1){var ke=t.ensureUniformFontSize(Y,xe.outsidetextfont);mt.call(e.font,ke),Ze=e.bBox(mt.node()),we=z(Ze,ie)}var Be=we.textPosAngle,He=Be===void 0?ie.pxmid:ce(he.r,Be);if(we.targetX=We+He[0]*we.rCenter+(we.x||0),we.targetY=Qe+He[1]*we.rCenter+(we.y||0),G(we,Ze),we.outside){var nt=we.targetY;ie.yLabelMin=nt-Ze.height/2,ie.yLabelMid=nt,ie.yLabelMax=nt+Ze.height/2,ie.labelExtraX=0,ie.labelExtraY=0,Pe=!0}we.fontSize=ze.size,n(xe.type,we,se),Q[Ee].transform=we,t.setTransormAndDisplay(mt,we)})});var qe=d.select(this).selectAll("g.titletext").data(xe.title.text?[0]:[]);if(qe.enter().append("g").classed("titletext",!0),qe.exit().remove(),qe.each(function(){var ie=t.ensureSingle(d.select(this),"text","",function(Qe){Qe.attr("data-notex",1)}),Ee=xe.title.text;xe._meta&&(Ee=t.templateString(Ee,xe._meta)),ie.text(Ee).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,xe.title.font).call(a.convertToTspans,Y);var We;xe.title.position==="middle center"?We=F(he):We=N(he,ae),ie.attr("transform",o(We.x,We.y)+r(Math.min(1,We.scale))+o(We.tx,We.ty))}),Pe&&B(Le,xe),l(Te,xe),Pe&&xe.automargin){var et=e.bBox(re.node()),rt=xe.domain,$e=ae.w*(rt.x[1]-rt.x[0]),Ue=ae.h*(rt.y[1]-rt.y[0]),fe=(.5*$e-he.r)/ae.w,ue=(.5*Ue-he.r)/ae.h;x.autoMargin(Y,"pie."+xe.uid+".automargin",{xl:rt.x[0]-fe,xr:rt.x[1]+fe,yb:rt.y[0]-ue,yt:rt.y[1]+ue,l:Math.max(he.cx-he.r-et.left,0),r:Math.max(et.right-(he.cx+he.r),0),b:Math.max(et.bottom-(he.cy+he.r),0),t:Math.max(he.cy-he.r-et.top,0),pad:5})}})});setTimeout(function(){j.selectAll("tspan").each(function(){var Q=d.select(this);Q.attr("dy")&&Q.attr("dy",Q.attr("dy"))})},0)}function l(Y,ee){Y.each(function(V){var se=d.select(this);if(!V.labelExtraX&&!V.labelExtraY){se.select("path.textline").remove();return}var ae=se.select("g.slicetext text");V.transform.targetX+=V.labelExtraX,V.transform.targetY+=V.labelExtraY,t.setTransormAndDisplay(ae,V.transform);var j=V.cxFinal+V.pxmid[0],Q=V.cyFinal+V.pxmid[1],re="M"+j+","+Q,he=(V.yLabelMax-V.yLabelMin)*(V.pxmid[0]<0?-1:1)/4;if(V.labelExtraX){var xe=V.labelExtraX*V.pxmid[1]/V.pxmid[0],Te=V.yLabelMid+V.labelExtraY-(V.cyFinal+V.pxmid[1]);Math.abs(xe)>Math.abs(Te)?re+="l"+Te*V.pxmid[0]/V.pxmid[1]+","+Te+"H"+(j+V.labelExtraX+he):re+="l"+V.labelExtraX+","+xe+"v"+(Te-xe)+"h"+he}else re+="V"+(V.yLabelMid+V.labelExtraY)+"h"+he;t.ensureSingle(se,"path","textline").call(E.stroke,ee.outsidetextfont.color).attr({"stroke-width":Math.min(2,ee.outsidetextfont.size/8),d:re,fill:"none"})})}function _(Y,ee,V){var se=V[0],ae=se.cx,j=se.cy,Q=se.trace,re=Q.type==="funnelarea";"_hasHoverLabel"in Q||(Q._hasHoverLabel=!1),"_hasHoverEvent"in Q||(Q._hasHoverEvent=!1),Y.on("mouseover",function(he){var xe=ee._fullLayout,Te=ee._fullData[Q.index];if(!(ee._dragging||xe.hovermode===!1)){var Le=Te.hoverinfo;if(Array.isArray(Le)&&(Le=S.castHoverinfo({hoverinfo:[f.castOption(Le,he.pts)],_module:Q._module},xe,0)),Le==="all"&&(Le="label+text+value+percent+name"),Te.hovertemplate||Le!=="none"&&Le!=="skip"&&Le){var Pe=he.rInscribed||0,qe=ae+he.pxmid[0]*(1-Pe),et=j+he.pxmid[1]*(1-Pe),rt=xe.separators,$e=[];if(Le&&Le.indexOf("label")!==-1&&$e.push(he.label),he.text=f.castOption(Te.hovertext||Te.text,he.pts),Le&&Le.indexOf("text")!==-1){var Ue=he.text;t.isValidTextValue(Ue)&&$e.push(Ue)}he.value=he.v,he.valueLabel=f.formatPieValue(he.v,rt),Le&&Le.indexOf("value")!==-1&&$e.push(he.valueLabel),he.percent=he.v/se.vTotal,he.percentLabel=f.formatPiePercent(he.percent,rt),Le&&Le.indexOf("percent")!==-1&&$e.push(he.percentLabel);var fe=Te.hoverlabel,ue=fe.font,ie=[];S.loneHover({trace:Q,x0:qe-Pe*se.r,x1:qe+Pe*se.r,y:et,_x0:re?ae+he.TL[0]:qe-Pe*se.r,_x1:re?ae+he.TR[0]:qe+Pe*se.r,_y0:re?j+he.TL[1]:et-Pe*se.r,_y1:re?j+he.BL[1]:et+Pe*se.r,text:$e.join("
"),name:Te.hovertemplate||Le.indexOf("name")!==-1?Te.name:void 0,idealAlign:he.pxmid[0]<0?"left":"right",color:f.castOption(fe.bgcolor,he.pts)||he.color,borderColor:f.castOption(fe.bordercolor,he.pts),fontFamily:f.castOption(ue.family,he.pts),fontSize:f.castOption(ue.size,he.pts),fontColor:f.castOption(ue.color,he.pts),nameLength:f.castOption(fe.namelength,he.pts),textAlign:f.castOption(fe.align,he.pts),hovertemplate:f.castOption(Te.hovertemplate,he.pts),hovertemplateLabels:he,eventData:[p(he,Te)]},{container:xe._hoverlayer.node(),outerContainer:xe._paper.node(),gd:ee,inOut_bbox:ie}),he.bbox=ie[0],Q._hasHoverLabel=!0}Q._hasHoverEvent=!0,ee.emit("plotly_hover",{points:[p(he,Te)],event:d.event})}}),Y.on("mouseout",function(he){var xe=ee._fullLayout,Te=ee._fullData[Q.index],Le=d.select(this).datum();Q._hasHoverEvent&&(he.originalEvent=d.event,ee.emit("plotly_unhover",{points:[p(Le,Te)],event:d.event}),Q._hasHoverEvent=!1),Q._hasHoverLabel&&(S.loneUnhover(xe._hoverlayer.node()),Q._hasHoverLabel=!1)}),Y.on("click",function(he){var xe=ee._fullLayout,Te=ee._fullData[Q.index];ee._dragging||xe.hovermode===!1||(ee._hoverdata=[p(he,Te)],S.click(ee,d.event))})}function w(Y,ee,V){var se=f.castOption(Y.outsidetextfont.color,ee.pts)||f.castOption(Y.textfont.color,ee.pts)||V.color,ae=f.castOption(Y.outsidetextfont.family,ee.pts)||f.castOption(Y.textfont.family,ee.pts)||V.family,j=f.castOption(Y.outsidetextfont.size,ee.pts)||f.castOption(Y.textfont.size,ee.pts)||V.size,Q=f.castOption(Y.outsidetextfont.weight,ee.pts)||f.castOption(Y.textfont.weight,ee.pts)||V.weight,re=f.castOption(Y.outsidetextfont.style,ee.pts)||f.castOption(Y.textfont.style,ee.pts)||V.style,he=f.castOption(Y.outsidetextfont.variant,ee.pts)||f.castOption(Y.textfont.variant,ee.pts)||V.variant,xe=f.castOption(Y.outsidetextfont.textcase,ee.pts)||f.castOption(Y.textfont.textcase,ee.pts)||V.textcase,Te=f.castOption(Y.outsidetextfont.lineposition,ee.pts)||f.castOption(Y.textfont.lineposition,ee.pts)||V.lineposition,Le=f.castOption(Y.outsidetextfont.shadow,ee.pts)||f.castOption(Y.textfont.shadow,ee.pts)||V.shadow;return{color:se,family:ae,size:j,weight:Q,style:re,variant:he,textcase:xe,lineposition:Te,shadow:Le}}function A(Y,ee,V){var se=f.castOption(Y.insidetextfont.color,ee.pts);!se&&Y._input.textfont&&(se=f.castOption(Y._input.textfont.color,ee.pts));var ae=f.castOption(Y.insidetextfont.family,ee.pts)||f.castOption(Y.textfont.family,ee.pts)||V.family,j=f.castOption(Y.insidetextfont.size,ee.pts)||f.castOption(Y.textfont.size,ee.pts)||V.size,Q=f.castOption(Y.insidetextfont.weight,ee.pts)||f.castOption(Y.textfont.weight,ee.pts)||V.weight,re=f.castOption(Y.insidetextfont.style,ee.pts)||f.castOption(Y.textfont.style,ee.pts)||V.style,he=f.castOption(Y.insidetextfont.variant,ee.pts)||f.castOption(Y.textfont.variant,ee.pts)||V.variant,xe=f.castOption(Y.insidetextfont.textcase,ee.pts)||f.castOption(Y.textfont.textcase,ee.pts)||V.textcase,Te=f.castOption(Y.insidetextfont.lineposition,ee.pts)||f.castOption(Y.textfont.lineposition,ee.pts)||V.lineposition,Le=f.castOption(Y.insidetextfont.shadow,ee.pts)||f.castOption(Y.textfont.shadow,ee.pts)||V.shadow;return{color:se||E.contrast(ee.color),family:ae,size:j,weight:Q,style:re,variant:he,textcase:xe,lineposition:Te,shadow:Le}}function M(Y,ee){for(var V,se,ae=0;ae=-4;fe-=2)Ue(Math.PI*fe,"tan");for(fe=4;fe>=-4;fe-=2)Ue(Math.PI*(fe+1),"tan")}if(Le||qe){for(fe=4;fe>=-4;fe-=2)Ue(Math.PI*(fe+1.5),"rad");for(fe=4;fe>=-4;fe-=2)Ue(Math.PI*(fe+.5),"rad")}}if(re||et||Le){var ue=Math.sqrt(Y.width*Y.width+Y.height*Y.height);if($e={scale:ae*se*2/ue,rCenter:1-ae,rotate:0},$e.textPosAngle=(ee.startangle+ee.stopangle)/2,$e.scale>=1)return $e;rt.push($e)}(et||qe)&&($e=v(Y,se,Q,he,xe),$e.textPosAngle=(ee.startangle+ee.stopangle)/2,rt.push($e)),(et||Pe)&&($e=u(Y,se,Q,he,xe),$e.textPosAngle=(ee.startangle+ee.stopangle)/2,rt.push($e));for(var ie=0,Ee=0,We=0;We=1)break}return rt[ie]}function b(Y,ee){var V=Y.startangle,se=Y.stopangle;return V>ee&&ee>se||V0?1:-1)/2,y:j/(1+V*V/(se*se)),outside:!0}}function F(Y){var ee=Math.sqrt(Y.titleBox.width*Y.titleBox.width+Y.titleBox.height*Y.titleBox.height);return{x:Y.cx,y:Y.cy,scale:Y.trace.hole*Y.r*2/ee,tx:0,ty:-Y.titleBox.height/2+Y.trace.title.font.size}}function N(Y,ee){var V=1,se=1,ae,j=Y.trace,Q={x:Y.cx,y:Y.cy},re={tx:0,ty:0};re.ty+=j.title.font.size,ae=U(j),j.title.position.indexOf("top")!==-1?(Q.y-=(1+ae)*Y.r,re.ty-=Y.titleBox.height):j.title.position.indexOf("bottom")!==-1&&(Q.y+=(1+ae)*Y.r);var he=O(Y.r,Y.trace.aspectratio),xe=ee.w*(j.domain.x[1]-j.domain.x[0])/2;return j.title.position.indexOf("left")!==-1?(xe=xe+he,Q.x-=(1+ae)*he,re.tx+=Y.titleBox.width/2):j.title.position.indexOf("center")!==-1?xe*=2:j.title.position.indexOf("right")!==-1&&(xe=xe+he,Q.x+=(1+ae)*he,re.tx-=Y.titleBox.width/2),V=xe/Y.titleBox.width,se=P(Y,ee)/Y.titleBox.height,{x:Q.x,y:Q.y,scale:Math.min(V,se),tx:re.tx,ty:re.ty}}function O(Y,ee){return Y/(ee===void 0?1:ee)}function P(Y,ee){var V=Y.trace,se=ee.h*(V.domain.y[1]-V.domain.y[0]);return Math.min(Y.titleBox.height,se/2)}function U(Y){var ee=Y.pull;if(!ee)return 0;var V;if(t.isArrayOrTypedArray(ee))for(ee=0,V=0;Vee&&(ee=Y.pull[V]);return ee}function B(Y,ee){var V,se,ae,j,Q,re,he,xe,Te,Le,Pe,qe,et;function rt(ue,ie){return ue.pxmid[1]-ie.pxmid[1]}function $e(ue,ie){return ie.pxmid[1]-ue.pxmid[1]}function Ue(ue,ie){ie||(ie={});var Ee=ie.labelExtraY+(se?ie.yLabelMax:ie.yLabelMin),We=se?ue.yLabelMin:ue.yLabelMax,Qe=se?ue.yLabelMax:ue.yLabelMin,Xe=ue.cyFinal+Q(ue.px0[1],ue.px1[1]),Tt=Ee-We,St,zt,Ut,br,hr,Or;if(Tt*he>0&&(ue.labelExtraY=Tt),!!t.isArrayOrTypedArray(ee.pull))for(zt=0;zt=(f.castOption(ee.pull,Ut.pts)||0))&&((ue.pxmid[1]-Ut.pxmid[1])*he>0?(br=Ut.cyFinal+Q(Ut.px0[1],Ut.px1[1]),Tt=br-We-ue.labelExtraY,Tt*he>0&&(ue.labelExtraY+=Tt)):(Qe+ue.labelExtraY-Xe)*he>0&&(St=3*re*Math.abs(zt-Le.indexOf(ue)),hr=Ut.cxFinal+j(Ut.px0[0],Ut.px1[0]),Or=hr+St-(ue.cxFinal+ue.pxmid[0])-ue.labelExtraX,Or*re>0&&(ue.labelExtraX+=Or)))}for(se=0;se<2;se++)for(ae=se?rt:$e,Q=se?Math.max:Math.min,he=se?1:-1,V=0;V<2;V++){for(j=V?Math.max:Math.min,re=V?1:-1,xe=Y[se][V],xe.sort(ae),Te=Y[1-se][V],Le=Te.concat(xe),qe=[],Pe=0;Pe1?(xe=V.r,Te=xe/ae.aspectratio):(Te=V.r,xe=Te*ae.aspectratio),xe*=(1+ae.baseratio)/2,he=xe*Te}Q=Math.min(Q,he/V.vTotal)}for(se=0;seee.vTotal/2?1:0,xe.halfangle=Math.PI*Math.min(xe.v/ee.vTotal,.5),xe.ring=1-se.hole,xe.rInscribed=L(xe,ee))}function ce(Y,ee){return[Y*Math.sin(ee),-Y*Math.cos(ee)]}function ve(Y,ee,V){var se=Y._fullLayout,ae=V.trace,j=ae.texttemplate,Q=ae.textinfo;if(!j&&Q&&Q!=="none"){var re=Q.split("+"),he=function(ie){return re.indexOf(ie)!==-1},xe=he("label"),Te=he("text"),Le=he("value"),Pe=he("percent"),qe=se.separators,et;if(et=xe?[ee.label]:[],Te){var rt=f.getFirstFilled(ae.text,ee.pts);c(rt)&&et.push(rt)}Le&&et.push(f.formatPieValue(ee.v,qe)),Pe&&et.push(f.formatPiePercent(ee.v/V.vTotal,qe)),ee.text=et.join("
")}function $e(ie){return{label:ie.label,value:ie.v,valueLabel:f.formatPieValue(ie.v,se.separators),percent:ie.v/V.vTotal,percentLabel:f.formatPiePercent(ie.v/V.vTotal,se.separators),color:ie.color,text:ie.text,customdata:t.castOption(ae,ie.i,"customdata")}}if(j){var Ue=t.castOption(ae,ee.i,"texttemplate");if(!Ue)ee.text="";else{var fe=$e(ee),ue=f.getFirstFilled(ae.text,ee.pts);(c(ue)||ue==="")&&(fe.text=ue),ee.text=t.texttemplateString({data:[fe,ae._meta],fallback:ae.texttemplatefallback,labels:fe,locale:Y._fullLayout._d3locale,template:Ue})}}}function G(Y,ee){var V=Y.rotate*Math.PI/180,se=Math.cos(V),ae=Math.sin(V),j=(ee.left+ee.right)/2,Q=(ee.top+ee.bottom)/2;Y.textX=j*se-Q*ae,Y.textY=j*ae+Q*se,Y.noCenter=!0}q.exports={plot:T,formatSliceLabel:ve,transformInsideText:g,determineInsideTextFont:A,positionTitleOutside:N,prerenderTitles:M,layoutAreas:X,attachFxHandlers:_,computeTransform:G}}}),xk=Ge({"src/traces/pie/style.js"(Z,q){"use strict";var d=Oi(),x=O0(),S=lh().resizeText;q.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");S(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),bk=Ge({"src/traces/pie/base_plot.js"(Z){"use strict";var q=Uu();Z.name="pie",Z.plot=function(d,x,S,E){q.plotBasePlot(Z.name,d,x,S,E)},Z.clean=function(d,x,S,E){q.cleanBasePlot(Z.name,d,x,S,E)}}}),wk=Ge({"src/traces/pie/index.js"(Z,q){"use strict";q.exports={attributes:Op(),supplyDefaults:Bp().supplyDefaults,supplyLayoutDefaults:yk(),layoutAttributes:Z1(),calc:Q0().calc,crossTraceCalc:Q0().crossTraceCalc,plot:Y1().plot,style:xk(),styleOne:O0(),moduleType:"trace",name:"pie",basePlotModule:bk(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Tk=Ge({"lib/pie.js"(Z,q){"use strict";q.exports=wk()}}),Ak=Ge({"src/traces/sunburst/base_plot.js"(Z){"use strict";var q=Uu();Z.name="sunburst",Z.plot=function(d,x,S,E){q.plotBasePlot(Z.name,d,x,S,E)},Z.clean=function(d,x,S,E){q.cleanBasePlot(Z.name,d,x,S,E)}}}),s2=Ge({"src/traces/sunburst/constants.js"(Z,q){"use strict";q.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),dg=Ge({"src/traces/sunburst/attributes.js"(Z,q){"use strict";var d=Cl(),{hovertemplateAttrs:x,texttemplateAttrs:S,templatefallbackAttrs:E}=Tl(),e=Jl(),t=ju().attributes,r=Op(),o=s2(),a=Do().extendFlat,i=Of().pattern;q.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:a({colors:{valType:"data_array",editType:"calc"},line:{color:a({},r.marker.line.color,{dflt:null}),width:a({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:i,editType:"calc"},e("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:S({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:r.hovertext,hoverinfo:a({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:o.eventDataKeys}),hovertemplatefallback:E(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:a({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}}),l2=Ge({"src/traces/sunburst/layout_attributes.js"(Z,q){"use strict";q.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Sk=Ge({"src/traces/sunburst/defaults.js"(Z,q){"use strict";var d=ta(),x=dg(),S=ju().defaults,E=Uh().handleText,e=Bp().handleMarkerDefaults,t=wu(),r=t.hasColorscale,o=t.handleDefaults;q.exports=function(i,n,s,h){function f(A,M){return d.coerce(i,n,x,A,M)}var p=f("labels"),c=f("parents");if(!p||!p.length||!c||!c.length){n.visible=!1;return}var T=f("values");T&&T.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),e(i,n,h,f);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,h,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",l?1:.7);var _=f("text");f("texttemplate"),f("texttemplatefallback"),n.texttemplate||f("textinfo",d.isArrayOrTypedArray(_)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var w="auto";E(i,n,h,f,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),S(n,h,f),n._length=null}}}),Mk=Ge({"src/traces/sunburst/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=l2();q.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),pg=Ge({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(we,ke){return we.parent===ke.parent?1:2}function S(we){return we.reduce(E,0)/we.length}function E(we,ke){return we+ke.x}function e(we){return 1+we.reduce(t,0)}function t(we,ke){return Math.max(we,ke.y)}function r(we){for(var ke;ke=we.children;)we=ke[0];return we}function o(we){for(var ke;ke=we.children;)we=ke[ke.length-1];return we}function a(){var we=x,ke=1,Be=1,He=!1;function nt(ot){var Ft,Mt=0;ot.eachAfter(function(ar){var Mr=ar.children;Mr?(ar.x=S(Mr),ar.y=e(Mr)):(ar.x=Ft?Mt+=we(ar,Ft):0,ar.y=0,Ft=ar)});var Et=r(ot),Ot=o(ot),sr=Et.x-we(Et,Ot)/2,ir=Ot.x+we(Ot,Et)/2;return ot.eachAfter(He?function(ar){ar.x=(ar.x-ot.x)*ke,ar.y=(ot.y-ar.y)*Be}:function(ar){ar.x=(ar.x-sr)/(ir-sr)*ke,ar.y=(1-(ot.y?ar.y/ot.y:1))*Be})}return nt.separation=function(ot){return arguments.length?(we=ot,nt):we},nt.size=function(ot){return arguments.length?(He=!1,ke=+ot[0],Be=+ot[1],nt):He?null:[ke,Be]},nt.nodeSize=function(ot){return arguments.length?(He=!0,ke=+ot[0],Be=+ot[1],nt):He?[ke,Be]:null},nt}function i(we){var ke=0,Be=we.children,He=Be&&Be.length;if(!He)ke=1;else for(;--He>=0;)ke+=Be[He].value;we.value=ke}function n(){return this.eachAfter(i)}function s(we){var ke=this,Be,He=[ke],nt,ot,Ft;do for(Be=He.reverse(),He=[];ke=Be.pop();)if(we(ke),nt=ke.children,nt)for(ot=0,Ft=nt.length;ot=0;--nt)Be.push(He[nt]);return this}function f(we){for(var ke=this,Be=[ke],He=[],nt,ot,Ft;ke=Be.pop();)if(He.push(ke),nt=ke.children,nt)for(ot=0,Ft=nt.length;ot=0;)Be+=He[nt].value;ke.value=Be})}function c(we){return this.eachBefore(function(ke){ke.children&&ke.children.sort(we)})}function T(we){for(var ke=this,Be=l(ke,we),He=[ke];ke!==Be;)ke=ke.parent,He.push(ke);for(var nt=He.length;we!==Be;)He.splice(nt,0,we),we=we.parent;return He}function l(we,ke){if(we===ke)return we;var Be=we.ancestors(),He=ke.ancestors(),nt=null;for(we=Be.pop(),ke=He.pop();we===ke;)nt=we,we=Be.pop(),ke=He.pop();return nt}function _(){for(var we=this,ke=[we];we=we.parent;)ke.push(we);return ke}function w(){var we=[];return this.each(function(ke){we.push(ke)}),we}function A(){var we=[];return this.eachBefore(function(ke){ke.children||we.push(ke)}),we}function M(){var we=this,ke=[];return we.each(function(Be){Be!==we&&ke.push({source:Be.parent,target:Be})}),ke}function g(we,ke){var Be=new m(we),He=+we.value&&(Be.value=we.value),nt,ot=[Be],Ft,Mt,Et,Ot;for(ke==null&&(ke=v);nt=ot.pop();)if(He&&(nt.value=+nt.data.value),(Mt=ke(nt.data))&&(Ot=Mt.length))for(nt.children=new Array(Ot),Et=Ot-1;Et>=0;--Et)ot.push(Ft=nt.children[Et]=new m(Mt[Et])),Ft.parent=nt,Ft.depth=nt.depth+1;return Be.eachBefore(y)}function b(){return g(this).eachBefore(u)}function v(we){return we.children}function u(we){we.data=we.data.data}function y(we){var ke=0;do we.height=ke;while((we=we.parent)&&we.height<++ke)}function m(we){this.data=we,this.depth=this.height=0,this.parent=null}m.prototype=g.prototype={constructor:m,count:n,each:s,eachAfter:f,eachBefore:h,sum:p,sort:c,path:T,ancestors:_,descendants:w,leaves:A,links:M,copy:b};var R=Array.prototype.slice;function L(we){for(var ke=we.length,Be,He;ke;)He=Math.random()*ke--|0,Be=we[ke],we[ke]=we[He],we[He]=Be;return we}function z(we){for(var ke=0,Be=(we=L(R.call(we))).length,He=[],nt,ot;ke0&&Be*Be>He*He+nt*nt}function P(we,ke){for(var Be=0;BeEt?(nt=(Ot+Et-ot)/(2*Ot),Mt=Math.sqrt(Math.max(0,Et/Ot-nt*nt)),Be.x=we.x-nt*He-Mt*Ft,Be.y=we.y-nt*Ft+Mt*He):(nt=(Ot+ot-Et)/(2*Ot),Mt=Math.sqrt(Math.max(0,ot/Ot-nt*nt)),Be.x=ke.x+nt*He-Mt*Ft,Be.y=ke.y+nt*Ft+Mt*He)):(Be.x=ke.x+Be.r,Be.y=ke.y)}function ce(we,ke){var Be=we.r+ke.r-1e-6,He=ke.x-we.x,nt=ke.y-we.y;return Be>0&&Be*Be>He*He+nt*nt}function ve(we){var ke=we._,Be=we.next._,He=ke.r+Be.r,nt=(ke.x*Be.r+Be.x*ke.r)/He,ot=(ke.y*Be.r+Be.y*ke.r)/He;return nt*nt+ot*ot}function G(we){this._=we,this.next=null,this.previous=null}function Y(we){if(!(nt=we.length))return 0;var ke,Be,He,nt,ot,Ft,Mt,Et,Ot,sr,ir;if(ke=we[0],ke.x=0,ke.y=0,!(nt>1))return ke.r;if(Be=we[1],ke.x=-Be.r,Be.x=ke.r,Be.y=0,!(nt>2))return ke.r+Be.r;le(Be,ke,He=we[2]),ke=new G(ke),Be=new G(Be),He=new G(He),ke.next=He.previous=Be,Be.next=ke.previous=He,He.next=Be.previous=ke;e:for(Mt=3;Mt0)throw new Error("cycle");return Mt}return Be.id=function(He){return arguments.length?(we=se(He),Be):we},Be.parentId=function(He){return arguments.length?(ke=se(He),Be):ke},Be}function ie(we,ke){return we.parent===ke.parent?1:2}function Ee(we){var ke=we.children;return ke?ke[0]:we.t}function We(we){var ke=we.children;return ke?ke[ke.length-1]:we.t}function Qe(we,ke,Be){var He=Be/(ke.i-we.i);ke.c-=He,ke.s+=Be,we.c+=He,ke.z+=Be,ke.m+=Be}function Xe(we){for(var ke=0,Be=0,He=we.children,nt=He.length,ot;--nt>=0;)ot=He[nt],ot.z+=ke,ot.m+=ke,ke+=ot.s+(Be+=ot.c)}function Tt(we,ke,Be){return we.a.parent===ke.parent?we.a:Be}function St(we,ke){this._=we,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=ke}St.prototype=Object.create(m.prototype);function zt(we){for(var ke=new St(we,0),Be,He=[ke],nt,ot,Ft,Mt;Be=He.pop();)if(ot=Be._.children)for(Be.children=new Array(Mt=ot.length),Ft=Mt-1;Ft>=0;--Ft)He.push(nt=Be.children[Ft]=new St(ot[Ft],Ft)),nt.parent=Be;return(ke.parent=new St(null,0)).children=[ke],ke}function Ut(){var we=ie,ke=1,Be=1,He=null;function nt(Ot){var sr=zt(Ot);if(sr.eachAfter(ot),sr.parent.m=-sr.z,sr.eachBefore(Ft),He)Ot.eachBefore(Et);else{var ir=Ot,ar=Ot,Mr=Ot;Ot.eachBefore(function(Ba){Ba.xar.x&&(ar=Ba),Ba.depth>Mr.depth&&(Mr=Ba)});var ma=ir===ar?1:we(ir,ar)/2,Ca=ma-ir.x,Aa=ke/(ar.x+ma+Ca),Da=Be/(Mr.depth||1);Ot.eachBefore(function(Ba){Ba.x=(Ba.x+Ca)*Aa,Ba.y=Ba.depth*Da})}return Ot}function ot(Ot){var sr=Ot.children,ir=Ot.parent.children,ar=Ot.i?ir[Ot.i-1]:null;if(sr){Xe(Ot);var Mr=(sr[0].z+sr[sr.length-1].z)/2;ar?(Ot.z=ar.z+we(Ot._,ar._),Ot.m=Ot.z-Mr):Ot.z=Mr}else ar&&(Ot.z=ar.z+we(Ot._,ar._));Ot.parent.A=Mt(Ot,ar,Ot.parent.A||ir[0])}function Ft(Ot){Ot._.x=Ot.z+Ot.parent.m,Ot.m+=Ot.parent.m}function Mt(Ot,sr,ir){if(sr){for(var ar=Ot,Mr=Ot,ma=sr,Ca=ar.parent.children[0],Aa=ar.m,Da=Mr.m,Ba=ma.m,ba=Ca.m,rn;ma=We(ma),ar=Ee(ar),ma&&ar;)Ca=Ee(Ca),Mr=We(Mr),Mr.a=Ot,rn=ma.z+Ba-ar.z-Aa+we(ma._,ar._),rn>0&&(Qe(Tt(ma,Ot,ir),Ot,rn),Aa+=rn,Da+=rn),Ba+=ma.m,Aa+=ar.m,ba+=Ca.m,Da+=Mr.m;ma&&!We(Mr)&&(Mr.t=ma,Mr.m+=Ba-Da),ar&&!Ee(Ca)&&(Ca.t=ar,Ca.m+=Aa-ba,ir=Ot)}return ir}function Et(Ot){Ot.x*=ke,Ot.y=Ot.depth*Be}return nt.separation=function(Ot){return arguments.length?(we=Ot,nt):we},nt.size=function(Ot){return arguments.length?(He=!1,ke=+Ot[0],Be=+Ot[1],nt):He?null:[ke,Be]},nt.nodeSize=function(Ot){return arguments.length?(He=!0,ke=+Ot[0],Be=+Ot[1],nt):He?[ke,Be]:null},nt}function br(we,ke,Be,He,nt){for(var ot=we.children,Ft,Mt=-1,Et=ot.length,Ot=we.value&&(nt-Be)/we.value;++MtBa&&(Ba=Ot),Wt=Aa*Aa*vn,ba=Math.max(Ba/Wt,Wt/Da),ba>rn){Aa-=Ot;break}rn=ba}Ft.push(Et={value:Aa,dice:Mr1?He:1)},Be})(hr);function Er(){var we=wr,ke=!1,Be=1,He=1,nt=[0],ot=ae,Ft=ae,Mt=ae,Et=ae,Ot=ae;function sr(ar){return ar.x0=ar.y0=0,ar.x1=Be,ar.y1=He,ar.eachBefore(ir),nt=[0],ke&&ar.eachBefore(Le),ar}function ir(ar){var Mr=nt[ar.depth],ma=ar.x0+Mr,Ca=ar.y0+Mr,Aa=ar.x1-Mr,Da=ar.y1-Mr;Aa=ar-1){var Ba=ot[ir];Ba.x0=ma,Ba.y0=Ca,Ba.x1=Aa,Ba.y1=Da;return}for(var ba=Ot[ir],rn=Mr/2+ba,vn=ir+1,Wt=ar-1;vn>>1;Ot[Lt]Da-Ca){var Pr=(ma*Xt+Aa*Ht)/Mr;sr(ir,vn,Ht,ma,Ca,Pr,Da),sr(vn,ar,Xt,Pr,Ca,Aa,Da)}else{var Yr=(Ca*Xt+Da*Ht)/Mr;sr(ir,vn,Ht,ma,Ca,Aa,Yr),sr(vn,ar,Xt,ma,Yr,Aa,Da)}}}function ze(we,ke,Be,He,nt){(we.depth&1?br:Pe)(we,ke,Be,He,nt)}var Ze=(function we(ke){function Be(He,nt,ot,Ft,Mt){if((Et=He._squarify)&&Et.ratio===ke)for(var Et,Ot,sr,ir,ar=-1,Mr,ma=Et.length,Ca=He.value;++ar1?He:1)},Be})(hr);d.cluster=a,d.hierarchy=g,d.pack=re,d.packEnclose=z,d.packSiblings=ee,d.partition=qe,d.stratify=ue,d.tree=Ut,d.treemap=Er,d.treemapBinary=mt,d.treemapDice=Pe,d.treemapResquarify=Ze,d.treemapSlice=br,d.treemapSliceDice=ze,d.treemapSquarify=wr,Object.defineProperty(d,"__esModule",{value:!0})})}}),mg=Ge({"src/traces/sunburst/calc.js"(Z){"use strict";var q=pg(),d=Bo(),x=ta(),S=wu().makeColorScaleFuncFromTrace,E=Q0().makePullColorFn,e=Q0().generateExtendedColors,t=wu().calc,r=As().ALMOST_EQUAL,o={},a={},i={};Z.calc=function(s,h){var f=s._fullLayout,p=h.ids,c=x.isArrayOrTypedArray(p),T=h.labels,l=h.parents,_=h.values,w=x.isArrayOrTypedArray(_),A=[],M={},g={},b=function(ee,V){M[ee]?M[ee].push(V):M[ee]=[V],g[V]=1},v=function(ee){return ee||typeof ee=="number"},u=function(ee){return!w||d(_[ee])&&_[ee]>=0},y,m,R;c?(y=Math.min(p.length,l.length),m=function(ee){return v(p[ee])&&u(ee)},R=function(ee){return String(p[ee])}):(y=Math.min(T.length,l.length),m=function(ee){return v(T[ee])&&u(ee)},R=function(ee){return String(T[ee])}),w&&(y=Math.min(y,_.length));for(var L=0;L1){for(var U=x.randstr(),B=0;B>8&15|q>>4&240,q>>4&15|q&240,(q&15)<<4|q&15,1):d===8?gg(q>>24&255,q>>16&255,q>>8&255,(q&255)/255):d===4?gg(q>>12&15|q>>8&240,q>>8&15|q>>4&240,q>>4&15|q&240,((q&15)<<4|q&15)/255):null):(q=y2.exec(Z))?new Uf(q[1],q[2],q[3],1):(q=_2.exec(Z))?new Uf(q[1]*255/100,q[2]*255/100,q[3]*255/100,1):(q=x2.exec(Z))?gg(q[1],q[2],q[3],q[4]):(q=b2.exec(Z))?gg(q[1]*255/100,q[2]*255/100,q[3]*255/100,q[4]):(q=w2.exec(Z))?d2(q[1],q[2]/100,q[3]/100,1):(q=T2.exec(Z))?d2(q[1],q[2]/100,q[3]/100,q[4]):e_.hasOwnProperty(Z)?f2(e_[Z]):Z==="transparent"?new Uf(NaN,NaN,NaN,0):null}function f2(Z){return new Uf(Z>>16&255,Z>>8&255,Z&255,1)}function gg(Z,q,d,x){return x<=0&&(Z=q=d=NaN),new Uf(Z,q,d,x)}function J1(Z){return Z instanceof td||(Z=tm(Z)),Z?(Z=Z.rgb(),new Uf(Z.r,Z.g,Z.b,Z.opacity)):new Uf}function yg(Z,q,d,x){return arguments.length===1?J1(Z):new Uf(Z,q,d,x??1)}function Uf(Z,q,d,x){this.r=+Z,this.g=+q,this.b=+d,this.opacity=+x}function h2(){return`#${Ud(this.r)}${Ud(this.g)}${Ud(this.b)}`}function Ck(){return`#${Ud(this.r)}${Ud(this.g)}${Ud(this.b)}${Ud((isNaN(this.opacity)?1:this.opacity)*255)}`}function v2(){let Z=_g(this.opacity);return`${Z===1?"rgb(":"rgba("}${Nd(this.r)}, ${Nd(this.g)}, ${Nd(this.b)}${Z===1?")":`, ${Z})`}`}function _g(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function Nd(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function Ud(Z){return Z=Nd(Z),(Z<16?"0":"")+Z.toString(16)}function d2(Z,q,d,x){return x<=0?Z=q=d=NaN:d<=0||d>=1?Z=q=NaN:q<=0&&(Z=NaN),new Qh(Z,q,d,x)}function p2(Z){if(Z instanceof Qh)return new Qh(Z.h,Z.s,Z.l,Z.opacity);if(Z instanceof td||(Z=tm(Z)),!Z)return new Qh;if(Z instanceof Qh)return Z;Z=Z.rgb();var q=Z.r/255,d=Z.g/255,x=Z.b/255,S=Math.min(q,d,x),E=Math.max(q,d,x),e=NaN,t=E-S,r=(E+S)/2;return t?(q===E?e=(d-x)/t+(d0&&r<1?0:e,new Qh(e,t,r,Z.opacity)}function $1(Z,q,d,x){return arguments.length===1?p2(Z):new Qh(Z,q,d,x??1)}function Qh(Z,q,d,x){this.h=+Z,this.s=+q,this.l=+d,this.opacity=+x}function m2(Z){return Z=(Z||0)%360,Z<0?Z+360:Z}function xg(Z){return Math.max(0,Math.min(1,Z||0))}function Q1(Z,q,d){return(Z<60?q+(d-q)*Z/60:Z<180?d:Z<240?q+(d-q)*(240-Z)/60:q)*255}var rd,jd,Vd,Up,ev,g2,y2,_2,x2,b2,w2,T2,e_,t_=hs({"node_modules/d3-color/src/color.js"(){K1(),rd=.7,jd=1/rd,Vd="\\s*([+-]?\\d+)\\s*",Up="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ev="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",g2=/^#([0-9a-f]{3,8})$/,y2=new RegExp(`^rgb\\(${Vd},${Vd},${Vd}\\)$`),_2=new RegExp(`^rgb\\(${ev},${ev},${ev}\\)$`),x2=new RegExp(`^rgba\\(${Vd},${Vd},${Vd},${Up}\\)$`),b2=new RegExp(`^rgba\\(${ev},${ev},${ev},${Up}\\)$`),w2=new RegExp(`^hsl\\(${Up},${ev},${ev}\\)$`),T2=new RegExp(`^hsla\\(${Up},${ev},${ev},${Up}\\)$`),e_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Np(td,tm,{copy(Z){return Object.assign(new this.constructor,this,Z)},displayable(){return this.rgb().displayable()},hex:u2,formatHex:u2,formatHex8:Ek,formatHsl:kk,formatRgb:c2,toString:c2}),Np(Uf,yg,em(td,{brighter(Z){return Z=Z==null?jd:Math.pow(jd,Z),new Uf(this.r*Z,this.g*Z,this.b*Z,this.opacity)},darker(Z){return Z=Z==null?rd:Math.pow(rd,Z),new Uf(this.r*Z,this.g*Z,this.b*Z,this.opacity)},rgb(){return this},clamp(){return new Uf(Nd(this.r),Nd(this.g),Nd(this.b),_g(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:h2,formatHex:h2,formatHex8:Ck,formatRgb:v2,toString:v2})),Np(Qh,$1,em(td,{brighter(Z){return Z=Z==null?jd:Math.pow(jd,Z),new Qh(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?rd:Math.pow(rd,Z),new Qh(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=this.h%360+(this.h<0)*360,q=isNaN(Z)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*q,S=2*d-x;return new Uf(Q1(Z>=240?Z-240:Z+120,S,x),Q1(Z,S,x),Q1(Z<120?Z+240:Z-120,S,x),this.opacity)},clamp(){return new Qh(m2(this.h),xg(this.s),xg(this.l),_g(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 Z=_g(this.opacity);return`${Z===1?"hsl(":"hsla("}${m2(this.h)}, ${xg(this.s)*100}%, ${xg(this.l)*100}%${Z===1?")":`, ${Z})`}`}}))}}),r_,a_,A2=hs({"node_modules/d3-color/src/math.js"(){r_=Math.PI/180,a_=180/Math.PI}});function S2(Z){if(Z instanceof mv)return new mv(Z.l,Z.a,Z.b,Z.opacity);if(Z instanceof Fv)return M2(Z);Z instanceof Uf||(Z=J1(Z));var q=l_(Z.r),d=l_(Z.g),x=l_(Z.b),S=i_((.2225045*q+.7168786*d+.0606169*x)/f_),E,e;return q===d&&d===x?E=e=S:(E=i_((.4360747*q+.3850649*d+.1430804*x)/c_),e=i_((.0139322*q+.0971045*d+.7141733*x)/h_)),new mv(116*S-16,500*(E-S),200*(S-e),Z.opacity)}function n_(Z,q,d,x){return arguments.length===1?S2(Z):new mv(Z,q,d,x??1)}function mv(Z,q,d,x){this.l=+Z,this.a=+q,this.b=+d,this.opacity=+x}function i_(Z){return Z>E2?Math.pow(Z,.3333333333333333):Z/d_+v_}function o_(Z){return Z>qd?Z*Z*Z:d_*(Z-v_)}function s_(Z){return 255*(Z<=.0031308?12.92*Z:1.055*Math.pow(Z,.4166666666666667)-.055)}function l_(Z){return(Z/=255)<=.04045?Z/12.92:Math.pow((Z+.055)/1.055,2.4)}function Lk(Z){if(Z instanceof Fv)return new Fv(Z.h,Z.c,Z.l,Z.opacity);if(Z instanceof mv||(Z=S2(Z)),Z.a===0&&Z.b===0)return new Fv(NaN,0=1?(d=1,q-1):Math.floor(d*q),S=Z[x],E=Z[x+1],e=x>0?Z[x-1]:2*S-E,t=x()=>Z}});function R2(Z,q){return function(d){return Z+d*q}}function Dk(Z,q,d){return Z=Math.pow(Z,d),q=Math.pow(q,d)-Z,d=1/d,function(x){return Math.pow(Z+x*q,d)}}function Tg(Z,q){var d=q-Z;return d?R2(Z,d>180||d<-180?d-360*Math.round(d/360):d):nm(isNaN(Z)?q:Z)}function zk(Z){return(Z=+Z)==1?jf:function(q,d){return d-q?Dk(q,d,Z):nm(isNaN(q)?d:q)}}function jf(Z,q){var d=q-Z;return d?R2(Z,d):nm(isNaN(Z)?q:Z)}var qp=hs({"node_modules/d3-interpolate/src/color.js"(){I2()}});function D2(Z){return function(q){var d=q.length,x=new Array(d),S=new Array(d),E=new Array(d),e,t;for(e=0;ed&&(E=q.slice(d,E),t[e]?t[e]+=E:t[++e]=E),(x=x[0])===(S=S[0])?t[e]?t[e]+=S:t[++e]=S:(t[++e]=null,r.push({i:e,x:gv(x,S)})),d=Eg.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(S(i)+"rotate(",null,x)-2,x:gv(o,a)})):a&&i.push(S(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(S(i)+"skewX(",null,x)-2,x:gv(o,a)}):a&&i.push(S(i)+"skewX("+a+x)}function r(o,a,i,n,s,h){if(o!==i||a!==n){var f=s.push(S(s)+"scale(",null,",",null,")");h.push({i:f-4,x:gv(o,i)},{i:f-2,x:gv(a,n)})}else(i!==1||n!==1)&&s.push(S(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Z(o),a=Z(a),E(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var h=-1,f=n.length,p;++hkg,interpolateArray:()=>Fk,interpolateBasis:()=>C2,interpolateBasisClosed:()=>L2,interpolateCubehelix:()=>s3,interpolateCubehelixLong:()=>l3,interpolateDate:()=>j2,interpolateDiscrete:()=>Nk,interpolateHcl:()=>n3,interpolateHclLong:()=>i3,interpolateHsl:()=>t3,interpolateHslLong:()=>r3,interpolateHue:()=>jk,interpolateLab:()=>eC,interpolateNumber:()=>gv,interpolateNumberArray:()=>b_,interpolateObject:()=>q2,interpolateRgb:()=>Ag,interpolateRgbBasis:()=>z2,interpolateRgbBasisClosed:()=>F2,interpolateRound:()=>qk,interpolateString:()=>H2,interpolateTransformCss:()=>Y2,interpolateTransformSvg:()=>K2,interpolateZoom:()=>Q2,piecewise:()=>nC,quantize:()=>oC});var Gp=hs({"node_modules/d3-interpolate/src/index.js"(){Cg(),U2(),x_(),P2(),V2(),Uk(),Vk(),Sg(),w_(),G2(),Gk(),W2(),Yk(),$k(),O2(),Qk(),tC(),rC(),aC(),iC(),sC()}}),A_=Ge({"src/traces/sunburst/fill_one.js"(Z,q){"use strict";var d=zo(),x=Bi();q.exports=function(E,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(E,t,r,e)}else x.fill(E,n)}}}),u3=Ge({"src/traces/sunburst/style.js"(Z,q){"use strict";var d=Oi(),x=Bi(),S=ta(),E=lh().resizeText,e=A_();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],h=s.trace;n.style("opacity",h.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,h,o)})})}function r(o,a,i,n){var s=a.data.data,h=!a.children,f=s.i,p=S.castOption(i,f,"marker.line.color")||x.defaultLine,c=S.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",c).call(x.stroke,p).style("opacity",h?i.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),ad=Ge({"src/traces/sunburst/helpers.js"(Z){"use strict";var q=ta(),d=Bi(),x=cv(),S=Rd();Z.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Z.getPtId(i)===o)return a=i.copy()}),a||r},Z.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Z.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Z.isHeader=function(r,o){return!(Z.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Z.getParent=function(r,o){return Z.findEntryWithLevel(r,t(o))},Z.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Z.listPath(a,o).concat(i)},Z.getPath=function(r){return Z.listPath(r,"label").join("/")+"/"},Z.formatValue=S.formatPieValue,Z.formatPercent=function(r,o){var a=q.formatPercent(r,0);return a==="0%"&&(a=S.formatPiePercent(r,o)),a}}}),Ig=Ge({"src/traces/sunburst/fx.js"(Z,q){"use strict";var d=Oi(),x=Yi(),S=Sh().appendArrayPointValue,E=mc(),e=ta(),t=I0(),r=ad(),o=Rd(),a=o.formatPieValue;q.exports=function(s,h,f,p,c){var T=p[0],l=T.trace,_=T.hierarchy,w=l.type==="sunburst",A=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(v){var u=f._fullLayout;if(!(f._dragging||u.hovermode===!1)){var y=f._fullData[l.index],m=v.data.data,R=m.i,L=r.isHierarchyRoot(v),z=r.getParent(_,v),F=r.getValue(v),N=function(Q){return e.castOption(y,R,Q)},O=N("hovertemplate"),P=E.castHoverinfo(y,u,R),U=u.separators,B;if(O||P&&P!=="none"&&P!=="skip"){var X,$;w&&(X=T.cx+v.pxmid[0]*(1-v.rInscribed),$=T.cy+v.pxmid[1]*(1-v.rInscribed)),A&&(X=v._hoverX,$=v._hoverY);var le={},ce=[],ve=[],G=function(Q){return ce.indexOf(Q)!==-1};P&&(ce=P==="all"?y._module.attributes.hoverinfo.flags:P.split("+")),le.label=m.label,G("label")&&le.label&&ve.push(le.label),m.hasOwnProperty("v")&&(le.value=m.v,le.valueLabel=a(le.value,U),G("value")&&ve.push(le.valueLabel)),le.currentPath=v.currentPath=r.getPath(v.data),G("current path")&&!L&&ve.push(le.currentPath);var Y,ee=[],V=function(){ee.indexOf(Y)===-1&&(ve.push(Y),ee.push(Y))};le.percentParent=v.percentParent=F/r.getValue(z),le.parent=v.parentString=r.getPtLabel(z),G("percent parent")&&(Y=r.formatPercent(le.percentParent,U)+" of "+le.parent,V()),le.percentEntry=v.percentEntry=F/r.getValue(h),le.entry=v.entry=r.getPtLabel(h),G("percent entry")&&!L&&!v.onPathbar&&(Y=r.formatPercent(le.percentEntry,U)+" of "+le.entry,V()),le.percentRoot=v.percentRoot=F/r.getValue(_),le.root=v.root=r.getPtLabel(_),G("percent root")&&!L&&(Y=r.formatPercent(le.percentRoot,U)+" of "+le.root,V()),le.text=N("hovertext")||N("text"),G("text")&&(Y=le.text,e.isValidTextValue(Y)&&ve.push(Y)),B=[i(v,y,c.eventDataKeys)];var se={trace:y,y:$,_x0:v._x0,_x1:v._x1,_y0:v._y0,_y1:v._y1,text:ve.join("
"),name:O||G("name")?y.name:void 0,color:N("hoverlabel.bgcolor")||m.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:le,eventData:B};w&&(se.x0=X-v.rInscribed*v.rpx1,se.x1=X+v.rInscribed*v.rpx1,se.idealAlign=v.pxmid[0]<0?"left":"right"),A&&(se.x=X,se.idealAlign=X<0?"left":"right");var ae=[];E.loneHover(se,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:f,inOut_bbox:ae}),B[0].bbox=ae[0],l._hasHoverLabel=!0}if(A){var j=s.select("path.surface");c.styleOne(j,v,y,f,{hovered:!0})}l._hasHoverEvent=!0,f.emit("plotly_hover",{points:B||[i(v,y,c.eventDataKeys)],event:d.event})}},g=function(v){var u=f._fullLayout,y=f._fullData[l.index],m=d.select(this).datum();if(l._hasHoverEvent&&(v.originalEvent=d.event,f.emit("plotly_unhover",{points:[i(m,y,c.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),A){var R=s.select("path.surface");c.styleOne(R,m,y,f,{hovered:!1})}},b=function(v){var u=f._fullLayout,y=f._fullData[l.index],m=w&&(r.isHierarchyRoot(v)||r.isLeaf(v)),R=r.getPtId(v),L=r.isEntry(v)?r.findEntryWithChild(_,R):r.findEntryWithLevel(_,R),z=r.getPtId(L),F={points:[i(v,y,c.eventDataKeys)],event:d.event};m||(F.nextLevel=z);var N=t.triggerHandler(f,"plotly_"+l.type+"click",F);if(N!==!1&&u.hovermode&&(f._hoverdata=[i(v,y,c.eventDataKeys)],E.click(f,d.event)),!m&&N!==!1&&!f._dragging&&!f._transitioning){x.call("_storeDirectGUIEdit",y,u._tracePreGUI[y.uid],{level:y.level});var O={data:[{level:z}],traces:[l.index]},P={frame:{redraw:!1,duration:c.transitionTime},transition:{duration:c.transitionTime,easing:c.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),x.call("animate",f,O,P)}};s.on("mouseover",M),s.on("mouseout",g),s.on("click",b)};function i(n,s,h){for(var f=n.data.data,p={curveNumber:s.index,pointNumber:f.i,data:s._input,fullData:s},c=0;cQe.x1?2*Math.PI:0)+Q;Xe=ie.rpx1qe?2*Math.PI:0)+Q;We={x0:Xe,x1:Xe}}else We={rpx0:ce,rpx1:ce},E.extendFlat(We,ue(ie));else We={rpx0:0,rpx1:0};else We={x0:Q,x1:Q};return x(We,Qe)}function fe(ie){var Ee=ee[T.getPtId(ie)],We,Qe=ie.transform;if(Ee)We=Ee;else if(We={rpx1:ie.rpx1,transform:{textPosAngle:Qe.textPosAngle,scale:0,rotate:Qe.rotate,rCenter:Qe.rCenter,x:Qe.x,y:Qe.y}},Y)if(ie.parent)if(qe){var Xe=ie.x1>qe?2*Math.PI:0;We.x0=We.x1=Xe}else E.extendFlat(We,ue(ie));else We.x0=We.x1=Q;else We.x0=We.x1=Q;var Tt=x(We.transform.textPosAngle,ie.transform.textPosAngle),St=x(We.rpx1,ie.rpx1),zt=x(We.x0,ie.x0),Ut=x(We.x1,ie.x1),br=x(We.transform.scale,Qe.scale),hr=x(We.transform.rotate,Qe.rotate),Or=Qe.rCenter===0?3:We.transform.rCenter===0?1/3:1,wr=x(We.transform.rCenter,Qe.rCenter),Er=function(mt){return wr(Math.pow(mt,Or))};return function(mt){var ze=St(mt),Ze=zt(mt),we=Ut(mt),ke=Er(mt),Be=xe(ze,(Ze+we)/2),He=Tt(mt),nt={pxmid:Be,rpx1:ze,transform:{textPosAngle:He,rCenter:ke,x:Qe.x,y:Qe.y}};return r(N.type,Qe,m),{transform:{targetX:Le(nt),targetY:Pe(nt),scale:br(mt),rotate:hr(mt),rCenter:ke}}}}function ue(ie){var Ee=ie.parent,We=ee[T.getPtId(Ee)],Qe={};if(We){var Xe=Ee.children,Tt=Xe.indexOf(ie),St=Xe.length,zt=x(We.x0,We.x1);Qe.x0=zt(Tt/St),Qe.x1=zt(Tt/St)}else Qe.x0=Qe.x1=0;return Qe}}function _(g){return d.partition().size([2*Math.PI,g.height+1])(g)}Z.formatSliceLabel=function(g,b,v,u,y){var m=v.texttemplate,R=v.textinfo;if(!m&&(!R||R==="none"))return"";var L=y.separators,z=u[0],F=g.data.data,N=z.hierarchy,O=T.isHierarchyRoot(g),P=T.getParent(N,g),U=T.getValue(g);if(!m){var B=R.split("+"),X=function(ae){return B.indexOf(ae)!==-1},$=[],le;if(X("label")&&F.label&&$.push(F.label),F.hasOwnProperty("v")&&X("value")&&$.push(T.formatValue(F.v,L)),!O){X("current path")&&$.push(T.getPath(g.data));var ce=0;X("percent parent")&&ce++,X("percent entry")&&ce++,X("percent root")&&ce++;var ve=ce>1;if(ce){var G,Y=function(ae){le=T.formatPercent(G,L),ve&&(le+=" of "+ae),$.push(le)};X("percent parent")&&!O&&(G=U/T.getValue(P),Y("parent")),X("percent entry")&&(G=U/T.getValue(b),Y("entry")),X("percent root")&&(G=U/T.getValue(N),Y("root"))}}return X("text")&&(le=E.castOption(v,F.i,"text"),E.isValidTextValue(le)&&$.push(le)),$.join("
")}var ee=E.castOption(v,F.i,"texttemplate");if(!ee)return"";var V={};F.label&&(V.label=F.label),F.hasOwnProperty("v")&&(V.value=F.v,V.valueLabel=T.formatValue(F.v,L)),V.currentPath=T.getPath(g.data),O||(V.percentParent=U/T.getValue(P),V.percentParentLabel=T.formatPercent(V.percentParent,L),V.parent=T.getPtLabel(P)),V.percentEntry=U/T.getValue(b),V.percentEntryLabel=T.formatPercent(V.percentEntry,L),V.entry=T.getPtLabel(b),V.percentRoot=U/T.getValue(N),V.percentRootLabel=T.formatPercent(V.percentRoot,L),V.root=T.getPtLabel(N),F.hasOwnProperty("color")&&(V.color=F.color);var se=E.castOption(v,F.i,"text");return(E.isValidTextValue(se)||se==="")&&(V.text=se),V.customdata=E.castOption(v,F.i,"customdata"),E.texttemplateString({data:[V,v._meta],fallback:v.texttemplatefallback,labels:V,locale:y._d3locale,template:ee})};function w(g){return g.rpx0===0&&E.isFullCircle([g.x0,g.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(g.halfangle)),g.ring/2))}function A(g){return M(g.rpx1,g.transform.textPosAngle)}function M(g,b){return[g*Math.sin(b),-g*Math.cos(b)]}}}),lC=Ge({"src/traces/sunburst/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"sunburst",basePlotModule:Ak(),categories:[],animatable:!0,attributes:dg(),layoutAttributes:l2(),supplyDefaults:Sk(),supplyLayoutDefaults:Mk(),calc:mg().calc,crossTraceCalc:mg().crossTraceCalc,plot:S_().plot,style:u3().style,colorbar:Jf(),meta:{}}}}),uC=Ge({"lib/sunburst.js"(Z,q){"use strict";q.exports=lC()}}),cC=Ge({"src/traces/treemap/base_plot.js"(Z){"use strict";var q=Uu();Z.name="treemap",Z.plot=function(d,x,S,E){q.plotBasePlot(Z.name,d,x,S,E)},Z.clean=function(d,x,S,E){q.cleanBasePlot(Z.name,d,x,S,E)}}}),Hp=Ge({"src/traces/treemap/constants.js"(Z,q){"use strict";q.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),M_=Ge({"src/traces/treemap/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:S}=Tl(),E=Jl(),e=ju().attributes,t=Op(),r=dg(),o=Hp(),a=Do().extendFlat,i=Of().pattern;q.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:a({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:r.marker.colors,pattern:i,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:a({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:r.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:a({},t.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:t.sort,root:r.root,domain:e({name:"treemap",trace:!0,editType:"calc"})}}}),c3=Ge({"src/traces/treemap/layout_attributes.js"(Z,q){"use strict";q.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),fC=Ge({"src/traces/treemap/defaults.js"(Z,q){"use strict";var d=ta(),x=M_(),S=Bi(),E=ju().defaults,e=Uh().handleText,t=Fd().TEXTPAD,r=Bp().handleMarkerDefaults,o=wu(),a=o.hasColorscale,i=o.handleDefaults;q.exports=function(s,h,f,p){function c(y,m){return d.coerce(s,h,x,y,m)}var T=c("labels"),l=c("parents");if(!T||!T.length||!l||!l.length){h.visible=!1;return}var _=c("values");_&&_.length?c("branchvalues"):c("count"),c("level"),c("maxdepth");var w=c("tiling.packing");w==="squarify"&&c("tiling.squarifyratio"),c("tiling.flip"),c("tiling.pad");var A=c("text");c("texttemplate"),c("texttemplatefallback"),h.texttemplate||c("textinfo",d.isArrayOrTypedArray(A)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var M=c("pathbar.visible"),g="auto";e(s,h,p,c,g,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("textposition");var b=h.textposition.indexOf("bottom")!==-1;r(s,h,p,c);var v=h._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;v?i(s,h,p,c,{prefix:"marker.",cLetter:"c"}):c("marker.depthfade",!(h.marker.colors||[]).length);var u=h.textfont.size*2;c("marker.pad.t",b?u/4:u),c("marker.pad.l",u/4),c("marker.pad.r",u/4),c("marker.pad.b",b?u:u/4),c("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},M&&(c("pathbar.thickness",h.pathbar.textfont.size+2*t),c("pathbar.side"),c("pathbar.edgeshape")),c("sort"),c("root.color"),E(h,p,c),h._length=null}}}),hC=Ge({"src/traces/treemap/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=c3();q.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),f3=Ge({"src/traces/treemap/calc.js"(Z){"use strict";var q=mg();Z.calc=function(d,x){return q.calc(d,x)},Z.crossTraceCalc=function(d){return q._runCrossTraceCalc("treemap",d)}}}),h3=Ge({"src/traces/treemap/flip_tree.js"(Z,q){"use strict";q.exports=function d(x,S,E){var e;E.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),E.flipX&&(e=x.x0,x.x0=S[0]-x.x1,x.x1=S[0]-e),E.flipY&&(e=x.y0,x.y0=S[1]-x.y1,x.y1=S[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var ve=x.ensureSingle(le,"g","slicetext"),G=x.ensureSingle(ve,"text","",function(ee){ee.attr("data-notex",1)}),Y=x.ensureUniformFontSize(s,o.determineTextFont(N,$,z.font,{onPathbar:!0}));G.text($._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(S.font,Y).call(E.convertToTspans,s),$.textBB=S.bBox(G.node()),$.transform=g($,{fontSize:Y.size,onPathbar:!0}),$.transform.fontSize=Y.size,v?G.transition().attrTween("transform",function(ee){var V=m(ee,i,R,[l,_]);return function(se){return b(V(se))}}):G.attr("transform",b($))})}}}),dC=Ge({"src/traces/treemap/plot_one.js"(Z,q){"use strict";var d=Oi(),x=(Gp(),Pv(Hd)).interpolate,S=ad(),E=ta(),e=Fd().TEXTPAD,t=Ip(),r=t.toMoveInsideBar,o=lh(),a=o.recordMinTextSize,i=Hp(),n=vC();function s(h){return S.isHierarchyRoot(h)?"":S.getPtId(h)}q.exports=function(f,p,c,T,l){var _=f._fullLayout,w=p[0],A=w.trace,M=A.type,g=M==="icicle",b=w.hierarchy,v=S.findEntryWithLevel(b,A.level),u=d.select(c),y=u.selectAll("g.pathbar"),m=u.selectAll("g.slice");if(!v){y.remove(),m.remove();return}var R=S.isHierarchyRoot(v),L=!_.uniformtext.mode&&S.hasTransition(T),z=S.getMaxDepth(A),F=function(wr){return wr.data.depth-v.data.depth-1?U+$:-(X+$):0,ce={x0:B,x1:B,y0:le,y1:le+X},ve=function(wr,Er,mt){var ze=A.tiling.pad,Ze=function(He){return He-ze<=Er.x0},we=function(He){return He+ze>=Er.x1},ke=function(He){return He-ze<=Er.y0},Be=function(He){return He+ze>=Er.y1};return wr.x0===Er.x0&&wr.x1===Er.x1&&wr.y0===Er.y0&&wr.y1===Er.y1?{x0:wr.x0,x1:wr.x1,y0:wr.y0,y1:wr.y1}:{x0:Ze(wr.x0-ze)?0:we(wr.x0-ze)?mt[0]:wr.x0,x1:Ze(wr.x1+ze)?0:we(wr.x1+ze)?mt[0]:wr.x1,y0:ke(wr.y0-ze)?0:Be(wr.y0-ze)?mt[1]:wr.y0,y1:ke(wr.y1+ze)?0:Be(wr.y1+ze)?mt[1]:wr.y1}},G=null,Y={},ee={},V=null,se=function(wr,Er){return Er?Y[s(wr)]:ee[s(wr)]},ae=function(wr,Er,mt,ze){if(Er)return Y[s(b)]||ce;var Ze=ee[A.level]||mt;return F(wr)?ve(wr,Ze,ze):{}};w.hasMultipleRoots&&R&&z++,A._maxDepth=z,A._backgroundColor=_.paper_bgcolor,A._entryDepth=v.data.depth,A._atRootLevel=R;var j=-P/2+N.l+N.w*(O.x[1]+O.x[0])/2,Q=-U/2+N.t+N.h*(1-(O.y[1]+O.y[0])/2),re=function(wr){return j+wr},he=function(wr){return Q+wr},xe=he(0),Te=re(0),Le=function(wr){return Te+wr},Pe=function(wr){return xe+wr};function qe(wr,Er){return wr+","+Er}var et=Le(0),rt=function(wr){wr.x=Math.max(et,wr.x)},$e=A.pathbar.edgeshape,Ue=function(wr){var Er=Le(Math.max(Math.min(wr.x0,wr.x0),0)),mt=Le(Math.min(Math.max(wr.x1,wr.x1),B)),ze=Pe(wr.y0),Ze=Pe(wr.y1),we=X/2,ke={},Be={};ke.x=Er,Be.x=mt,ke.y=Be.y=(ze+Ze)/2;var He={x:Er,y:ze},nt={x:mt,y:ze},ot={x:mt,y:Ze},Ft={x:Er,y:Ze};return $e===">"?(He.x-=we,nt.x-=we,ot.x-=we,Ft.x-=we):$e==="/"?(ot.x-=we,Ft.x-=we,ke.x-=we/2,Be.x-=we/2):$e==="\\"?(He.x-=we,nt.x-=we,ke.x-=we/2,Be.x-=we/2):$e==="<"&&(ke.x-=we,Be.x-=we),rt(He),rt(Ft),rt(ke),rt(nt),rt(ot),rt(Be),"M"+qe(He.x,He.y)+"L"+qe(nt.x,nt.y)+"L"+qe(Be.x,Be.y)+"L"+qe(ot.x,ot.y)+"L"+qe(Ft.x,Ft.y)+"L"+qe(ke.x,ke.y)+"Z"},fe=A[g?"tiling":"marker"].pad,ue=function(wr){return A.textposition.indexOf(wr)!==-1},ie=ue("top"),Ee=ue("left"),We=ue("right"),Qe=ue("bottom"),Xe=function(wr){var Er=re(wr.x0),mt=re(wr.x1),ze=he(wr.y0),Ze=he(wr.y1),we=mt-Er,ke=Ze-ze;if(!we||!ke)return"";var Be=A.marker.cornerradius||0,He=Math.min(Be,we/2,ke/2);He&&wr.data&&wr.data.data&&wr.data.data.label&&(ie&&(He=Math.min(He,fe.t)),Ee&&(He=Math.min(He,fe.l)),We&&(He=Math.min(He,fe.r)),Qe&&(He=Math.min(He,fe.b)));var nt=function(ot,Ft){return He?"a"+qe(He,He)+" 0 0 1 "+qe(ot,Ft):""};return"M"+qe(Er,ze+He)+nt(He,-He)+"L"+qe(mt-He,ze)+nt(He,He)+"L"+qe(mt,Ze-He)+nt(-He,He)+"L"+qe(Er+He,Ze)+nt(-He,-He)+"Z"},Tt=function(wr,Er){var mt=wr.x0,ze=wr.x1,Ze=wr.y0,we=wr.y1,ke=wr.textBB,Be=ie||Er.isHeader&&!Qe,He=Be?"start":Qe?"end":"middle",nt=ue("right"),ot=ue("left")||Er.onPathbar,Ft=ot?-1:nt?1:0;if(Er.isHeader){if(mt+=(g?fe:fe.l)-e,ze-=(g?fe:fe.r)-e,mt>=ze){var Mt=(mt+ze)/2;mt=Mt,ze=Mt}var Et;Qe?(Et=we-(g?fe:fe.b),Ze-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),le=$.descendants(),ce=1/0,ve=-1/0;le.forEach(function(se){var ae=se.depth;ae>=O._maxDepth?(se.x0=se.x1=(se.x0+se.x1)/2,se.y0=se.y1=(se.y0+se.y1)/2):(ce=Math.min(ce,ae),ve=Math.max(ve,ae))}),c=c.data(le,o.getPtId),O._maxVisibleLayers=isFinite(ve)?ve-ce+1:0,c.enter().append("g").classed("slice",!0),u(c,n,L,[l,_],M),c.order();var G=null;if(v&&R){var Y=o.getPtId(R);c.each(function(se){G===null&&o.getPtId(se)===Y&&(G={x0:se.x0,x1:se.x1,y0:se.y0,y1:se.y1})})}var ee=function(){return G||{x0:0,x1:l,y0:0,y1:_}},V=c;return v&&(V=V.transition().each("end",function(){var se=d.select(this);o.setSliceCursor(se,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),V.each(function(se){var ae=o.isHeader(se,O);se._x0=w(se.x0),se._x1=w(se.x1),se._y0=A(se.y0),se._y1=A(se.y1),se._hoverX=w(se.x1-O.marker.pad.r),se._hoverY=A(B?se.y1-O.marker.pad.b/2:se.y0+O.marker.pad.t/2);var j=d.select(this),Q=x.ensureSingle(j,"path","surface",function(Pe){Pe.style("pointer-events",z?"none":"all")});v?Q.transition().attrTween("d",function(Pe){var qe=y(Pe,n,ee(),[l,_]);return function(et){return M(qe(et))}}):Q.attr("d",M),j.call(a,p,h,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,h,{isTransitioning:h._transitioning}),Q.call(t,se,O,h,{hovered:!1}),se.x0===se.x1||se.y0===se.y1?se._text="":ae?se._text=X?"":o.getPtLabel(se)||"":se._text=i(se,p,O,f,F)||"";var re=x.ensureSingle(j,"g","slicetext"),he=x.ensureSingle(re,"text","",function(Pe){Pe.attr("data-notex",1)}),xe=x.ensureUniformFontSize(h,o.determineTextFont(O,se,F.font)),Te=se._text||" ",Le=ae&&Te.indexOf("
")===-1;he.text(Te).classed("slicetext",!0).attr("text-anchor",U?"end":P||Le?"start":"middle").call(S.font,xe).call(E.convertToTspans,h),se.textBB=S.bBox(he.node()),se.transform=g(se,{fontSize:xe.size,isHeader:ae}),se.transform.fontSize=xe.size,v?he.transition().attrTween("transform",function(Pe){var qe=m(Pe,n,ee(),[l,_]);return function(et){return b(qe(et))}}):he.attr("transform",b(se))}),G}}}),mC=Ge({"src/traces/treemap/plot.js"(Z,q){"use strict";var d=d3(),x=pC();q.exports=function(E,e,t,r){return d(E,e,t,r,{type:"treemap",drawDescendants:x})}}}),gC=Ge({"src/traces/treemap/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"treemap",basePlotModule:cC(),categories:[],animatable:!0,attributes:M_(),layoutAttributes:c3(),supplyDefaults:fC(),supplyLayoutDefaults:hC(),calc:f3().calc,crossTraceCalc:f3().crossTraceCalc,plot:mC(),style:E_().style,colorbar:Jf(),meta:{}}}}),yC=Ge({"lib/treemap.js"(Z,q){"use strict";q.exports=gC()}}),_C=Ge({"src/traces/icicle/base_plot.js"(Z){"use strict";var q=Uu();Z.name="icicle",Z.plot=function(d,x,S,E){q.plotBasePlot(Z.name,d,x,S,E)},Z.clean=function(d,x,S,E){q.cleanBasePlot(Z.name,d,x,S,E)}}}),p3=Ge({"src/traces/icicle/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:S}=Tl(),E=Jl(),e=ju().attributes,t=Op(),r=dg(),o=M_(),a=Hp(),i=Do().extendFlat,n=Of().pattern;q.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:o.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:i({colors:r.marker.colors,line:r.marker.line,pattern:n,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:x({editType:"plot"},{keys:a.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:d({},{keys:a.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:o.outsidetextfont,textposition:o.textposition,sort:t.sort,root:r.root,domain:e({name:"icicle",trace:!0,editType:"calc"})}}}),m3=Ge({"src/traces/icicle/layout_attributes.js"(Z,q){"use strict";q.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),xC=Ge({"src/traces/icicle/defaults.js"(Z,q){"use strict";var d=ta(),x=p3(),S=Bi(),E=ju().defaults,e=Uh().handleText,t=Fd().TEXTPAD,r=Bp().handleMarkerDefaults,o=wu(),a=o.hasColorscale,i=o.handleDefaults;q.exports=function(s,h,f,p){function c(b,v){return d.coerce(s,h,x,b,v)}var T=c("labels"),l=c("parents");if(!T||!T.length||!l||!l.length){h.visible=!1;return}var _=c("values");_&&_.length?c("branchvalues"):c("count"),c("level"),c("maxdepth"),c("tiling.orientation"),c("tiling.flip"),c("tiling.pad");var w=c("text");c("texttemplate"),c("texttemplatefallback"),h.texttemplate||c("textinfo",d.isArrayOrTypedArray(w)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var A=c("pathbar.visible"),M="auto";e(s,h,p,c,M,{hasPathbar:A,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("textposition"),r(s,h,p,c);var g=h._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;g&&i(s,h,p,c,{prefix:"marker.",cLetter:"c"}),c("leaf.opacity",g?1:.7),h._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},A&&(c("pathbar.thickness",h.pathbar.textfont.size+2*t),c("pathbar.side"),c("pathbar.edgeshape")),c("sort"),c("root.color"),E(h,p,c),h._length=null}}}),bC=Ge({"src/traces/icicle/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=m3();q.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),g3=Ge({"src/traces/icicle/calc.js"(Z){"use strict";var q=mg();Z.calc=function(d,x){return q.calc(d,x)},Z.crossTraceCalc=function(d){return q._runCrossTraceCalc("icicle",d)}}}),wC=Ge({"src/traces/icicle/partition.js"(Z,q){"use strict";var d=pg(),x=h3();q.exports=function(E,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var h=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(E);return(a||r||o)&&x(h,e,{swapXY:a,flipX:r,flipY:o}),h}}}),y3=Ge({"src/traces/icicle/style.js"(Z,q){"use strict";var d=Oi(),x=Bi(),S=ta(),E=lh().resizeText,e=A_();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");E(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],h=s.trace;n.style("opacity",h.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,h,o)})})}function r(o,a,i,n){var s=a.data.data,h=!a.children,f=s.i,p=S.castOption(i,f,"marker.line.color")||x.defaultLine,c=S.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",c).call(x.stroke,p).style("opacity",h?i.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),TC=Ge({"src/traces/icicle/draw_descendants.js"(Z,q){"use strict";var d=Oi(),x=ta(),S=zo(),E=Il(),e=wC(),t=y3().styleOne,r=Hp(),o=ad(),a=Ig(),i=S_().formatSliceLabel,n=!1;q.exports=function(h,f,p,c,T){var l=T.width,_=T.height,w=T.viewX,A=T.viewY,M=T.pathSlice,g=T.toMoveInsideSlice,b=T.strTransform,v=T.hasTransition,u=T.handleSlicesExit,y=T.makeUpdateSliceInterpolator,m=T.makeUpdateTextInterpolator,R=T.prevEntry,L={},z=h._context.staticPlot,F=h._fullLayout,N=f[0],O=N.trace,P=O.textposition.indexOf("left")!==-1,U=O.textposition.indexOf("right")!==-1,B=O.textposition.indexOf("bottom")!==-1,X=e(p,[l,_],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),$=X.descendants(),le=1/0,ce=-1/0;$.forEach(function(V){var se=V.depth;se>=O._maxDepth?(V.x0=V.x1=(V.x0+V.x1)/2,V.y0=V.y1=(V.y0+V.y1)/2):(le=Math.min(le,se),ce=Math.max(ce,se))}),c=c.data($,o.getPtId),O._maxVisibleLayers=isFinite(ce)?ce-le+1:0,c.enter().append("g").classed("slice",!0),u(c,n,L,[l,_],M),c.order();var ve=null;if(v&&R){var G=o.getPtId(R);c.each(function(V){ve===null&&o.getPtId(V)===G&&(ve={x0:V.x0,x1:V.x1,y0:V.y0,y1:V.y1})})}var Y=function(){return ve||{x0:0,x1:l,y0:0,y1:_}},ee=c;return v&&(ee=ee.transition().each("end",function(){var V=d.select(this);o.setSliceCursor(V,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ee.each(function(V){V._x0=w(V.x0),V._x1=w(V.x1),V._y0=A(V.y0),V._y1=A(V.y1),V._hoverX=w(V.x1-O.tiling.pad),V._hoverY=A(B?V.y1-O.tiling.pad/2:V.y0+O.tiling.pad/2);var se=d.select(this),ae=x.ensureSingle(se,"path","surface",function(he){he.style("pointer-events",z?"none":"all")});v?ae.transition().attrTween("d",function(he){var xe=y(he,n,Y(),[l,_],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Te){return M(xe(Te))}}):ae.attr("d",M),se.call(a,p,h,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,h,{isTransitioning:h._transitioning}),ae.call(t,V,O,h,{hovered:!1}),V.x0===V.x1||V.y0===V.y1?V._text="":V._text=i(V,p,O,f,F)||"";var j=x.ensureSingle(se,"g","slicetext"),Q=x.ensureSingle(j,"text","",function(he){he.attr("data-notex",1)}),re=x.ensureUniformFontSize(h,o.determineTextFont(O,V,F.font));Q.text(V._text||" ").classed("slicetext",!0).attr("text-anchor",U?"end":P?"start":"middle").call(S.font,re).call(E.convertToTspans,h),V.textBB=S.bBox(Q.node()),V.transform=g(V,{fontSize:re.size}),V.transform.fontSize=re.size,v?Q.transition().attrTween("transform",function(he){var xe=m(he,n,Y(),[l,_]);return function(Te){return b(xe(Te))}}):Q.attr("transform",b(V))}),ve}}}),AC=Ge({"src/traces/icicle/plot.js"(Z,q){"use strict";var d=d3(),x=TC();q.exports=function(E,e,t,r){return d(E,e,t,r,{type:"icicle",drawDescendants:x})}}}),SC=Ge({"src/traces/icicle/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"icicle",basePlotModule:_C(),categories:[],animatable:!0,attributes:p3(),layoutAttributes:m3(),supplyDefaults:xC(),supplyLayoutDefaults:bC(),calc:g3().calc,crossTraceCalc:g3().crossTraceCalc,plot:AC(),style:y3().style,colorbar:Jf(),meta:{}}}}),MC=Ge({"lib/icicle.js"(Z,q){"use strict";q.exports=SC()}}),EC=Ge({"src/traces/funnelarea/base_plot.js"(Z){"use strict";var q=Uu();Z.name="funnelarea",Z.plot=function(d,x,S,E){q.plotBasePlot(Z.name,d,x,S,E)},Z.clean=function(d,x,S,E){q.cleanBasePlot(Z.name,d,x,S,E)}}}),_3=Ge({"src/traces/funnelarea/attributes.js"(Z,q){"use strict";var d=Op(),x=Cl(),S=ju().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Tl(),r=Do().extendFlat;q.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:r({},d.marker.line.color,{dflt:null}),width:r({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:r({},d.scalegroup,{}),textinfo:r({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:t({editType:"plot"}),hoverinfo:r({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:t(),textposition:r({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:r({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:S({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),x3=Ge({"src/traces/funnelarea/layout_attributes.js"(Z,q){"use strict";var d=Z1().hiddenlabels;q.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),kC=Ge({"src/traces/funnelarea/defaults.js"(Z,q){"use strict";var d=ta(),x=_3(),S=ju().defaults,E=Uh().handleText,e=Bp().handleLabelsAndValues,t=Bp().handleMarkerDefaults;q.exports=function(o,a,i,n){function s(M,g){return d.coerce(o,a,x,M,g)}var h=s("labels"),f=s("values"),p=e(h,f),c=p.len;if(a._hasLabels=p.hasLabels,a._hasValues=p.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!c){a.visible=!1;return}a._length=c,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate");s("texttemplatefallback");var _;if(l||(_=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),l||_&&_!=="none"){var w=s("textposition");E(o,a,n,s,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else _==="none"&&s("textposition","none");S(a,n,s);var A=s("title.text");A&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),CC=Ge({"src/traces/funnelarea/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=x3();q.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),b3=Ge({"src/traces/funnelarea/calc.js"(Z,q){"use strict";var d=Q0();function x(E,e){return d.calc(E,e)}function S(E){d.crossTraceCalc(E,{type:"funnelarea"})}q.exports={calc:x,crossTraceCalc:S}}}),LC=Ge({"src/traces/funnelarea/plot.js"(Z,q){"use strict";var d=Oi(),x=zo(),S=ta(),E=S.strScale,e=S.strTranslate,t=Il(),r=Ip(),o=r.toMoveInsideBar,a=lh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Rd(),h=Y1(),f=h.attachFxHandlers,p=h.determineInsideTextFont,c=h.layoutAreas,T=h.prerenderTitles,l=h.positionTitleOutside,_=h.formatSliceLabel;q.exports=function(b,v){var u=b._context.staticPlot,y=b._fullLayout;n("funnelarea",y),T(v,b),c(v,y._size),S.makeTraceGroups(y._funnelarealayer,v,"trace").each(function(m){var R=d.select(this),L=m[0],z=L.trace;M(m),R.each(function(){var F=d.select(this).selectAll("g.slice").data(m);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,P){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var U=L.cx,B=L.cy,X=d.select(this),$=X.selectAll("path.surface").data([O]);$.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),X.call(f,b,m);var le="M"+(U+O.TR[0])+","+(B+O.TR[1])+w(O.TR,O.BR)+w(O.BR,O.BL)+w(O.BL,O.TL)+"Z";$.attr("d",le),_(b,O,L);var ce=s.castOption(z.textposition,O.pts),ve=X.selectAll("g.slicetext").data(O.text&&ce!=="none"?[0]:[]);ve.enter().append("g").classed("slicetext",!0),ve.exit().remove(),ve.each(function(){var G=S.ensureSingle(d.select(this),"text","",function(re){re.attr("data-notex",1)}),Y=S.ensureUniformFontSize(b,p(z,O,y.font));G.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,Y).call(t.convertToTspans,b);var ee=x.bBox(G.node()),V,se,ae,j=Math.min(O.BL[1],O.BR[1])+B,Q=Math.max(O.TL[1],O.TR[1])+B;se=Math.max(O.TL[0],O.BL[0])+U,ae=Math.min(O.TR[0],O.BR[0])+U,V=o(se,ae,j,Q,ee,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),V.fontSize=Y.size,i(z.type,V,y),m[P].transform=V,S.setTransormAndDisplay(G,V)})});var N=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var O=S.ensureSingle(d.select(this),"text","",function(B){B.attr("data-notex",1)}),P=z.title.text;z._meta&&(P=S.templateString(P,z._meta)),O.text(P).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,b);var U=l(L,y._size);O.attr("transform",e(U.x,U.y)+E(Math.min(1,U.scale))+e(U.tx,U.ty))})})})};function w(g,b){var v=b[0]-g[0],u=b[1]-g[1];return"l"+v+","+u}function A(g,b){return[.5*(g[0]+b[0]),.5*(g[1]+b[1])]}function M(g){if(!g.length)return;var b=g[0],v=b.trace,u=v.aspectratio,y=v.baseratio;y>.999&&(y=.999);var m=Math.pow(y,2),R=b.vTotal,L=R*m/(1-m),z=R,F=L/R;function N(){var he=Math.sqrt(F);return{x:he,y:-he}}function O(){var he=N();return[he.x,he.y]}var P,U=[];U.push(O());var B,X;for(B=g.length-1;B>-1;B--)if(X=g[B],!X.hidden){var $=X.v/z;F+=$,U.push(O())}var le=1/0,ce=-1/0;for(B=0;B-1;B--)if(X=g[B],!X.hidden){j+=1;var Q=U[j][0],re=U[j][1];X.TL=[-Q,re],X.TR=[Q,re],X.BL=se,X.BR=ae,X.pxmid=A(X.TR,X.BR),se=X.TL,ae=X.TR}}}}),PC=Ge({"src/traces/funnelarea/style.js"(Z,q){"use strict";var d=Oi(),x=O0(),S=lh().resizeText;q.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");S(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),IC=Ge({"src/traces/funnelarea/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"funnelarea",basePlotModule:EC(),categories:["pie-like","funnelarea","showLegend"],attributes:_3(),layoutAttributes:x3(),supplyDefaults:kC(),supplyLayoutDefaults:CC(),calc:b3().calc,crossTraceCalc:b3().crossTraceCalc,plot:LC(),style:PC(),styleOne:O0(),meta:{}}}}),RC=Ge({"lib/funnelarea.js"(Z,q){"use strict";q.exports=IC()}}),Vf=Ge({"stackgl_modules/index.js"(Z,q){(function(){var d={1964:(function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}}),4793:(function(e,t,r){"use strict";var o;function a(Ue){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(fe){return typeof fe}:function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},a(Ue)}var i=r(7507),n=r(3778),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,o=y,t.IS=50;var h=2147483647;o=h,c.TYPED_ARRAY_SUPPORT=f(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{var Ue=new Uint8Array(1),fe={foo:function(){return 42}};return Object.setPrototypeOf(fe,Uint8Array.prototype),Object.setPrototypeOf(Ue,fe),Ue.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function p(Ue){if(Ue>h)throw new RangeError('The value "'+Ue+'" is invalid for option "size"');var fe=new Uint8Array(Ue);return Object.setPrototypeOf(fe,c.prototype),fe}function c(Ue,fe,ue){if(typeof Ue=="number"){if(typeof fe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(Ue)}return T(Ue,fe,ue)}c.poolSize=8192;function T(Ue,fe,ue){if(typeof Ue=="string")return A(Ue,fe);if(ArrayBuffer.isView(Ue))return g(Ue);if(Ue==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+a(Ue));if(et(Ue,ArrayBuffer)||Ue&&et(Ue.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(Ue,SharedArrayBuffer)||Ue&&et(Ue.buffer,SharedArrayBuffer)))return b(Ue,fe,ue);if(typeof Ue=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ie=Ue.valueOf&&Ue.valueOf();if(ie!=null&&ie!==Ue)return c.from(ie,fe,ue);var Ee=v(Ue);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ue[Symbol.toPrimitive]=="function")return c.from(Ue[Symbol.toPrimitive]("string"),fe,ue);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+a(Ue))}c.from=function(Ue,fe,ue){return T(Ue,fe,ue)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function l(Ue){if(typeof Ue!="number")throw new TypeError('"size" argument must be of type number');if(Ue<0)throw new RangeError('The value "'+Ue+'" is invalid for option "size"')}function _(Ue,fe,ue){return l(Ue),Ue<=0?p(Ue):fe!==void 0?typeof ue=="string"?p(Ue).fill(fe,ue):p(Ue).fill(fe):p(Ue)}c.alloc=function(Ue,fe,ue){return _(Ue,fe,ue)};function w(Ue){return l(Ue),p(Ue<0?0:u(Ue)|0)}c.allocUnsafe=function(Ue){return w(Ue)},c.allocUnsafeSlow=function(Ue){return w(Ue)};function A(Ue,fe){if((typeof fe!="string"||fe==="")&&(fe="utf8"),!c.isEncoding(fe))throw new TypeError("Unknown encoding: "+fe);var ue=m(Ue,fe)|0,ie=p(ue),Ee=ie.write(Ue,fe);return Ee!==ue&&(ie=ie.slice(0,Ee)),ie}function M(Ue){for(var fe=Ue.length<0?0:u(Ue.length)|0,ue=p(fe),ie=0;ie=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return Ue|0}function y(Ue){return+Ue!=Ue&&(Ue=0),c.alloc(+Ue)}c.isBuffer=function(fe){return fe!=null&&fe._isBuffer===!0&&fe!==c.prototype},c.compare=function(fe,ue){if(et(fe,Uint8Array)&&(fe=c.from(fe,fe.offset,fe.byteLength)),et(ue,Uint8Array)&&(ue=c.from(ue,ue.offset,ue.byteLength)),!c.isBuffer(fe)||!c.isBuffer(ue))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(fe===ue)return 0;for(var ie=fe.length,Ee=ue.length,We=0,Qe=Math.min(ie,Ee);WeEe.length?c.from(Qe).copy(Ee,We):Uint8Array.prototype.set.call(Ee,Qe,We);else if(c.isBuffer(Qe))Qe.copy(Ee,We);else throw new TypeError('"list" argument must be an Array of Buffers');We+=Qe.length}return Ee};function m(Ue,fe){if(c.isBuffer(Ue))return Ue.length;if(ArrayBuffer.isView(Ue)||et(Ue,ArrayBuffer))return Ue.byteLength;if(typeof Ue!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+a(Ue));var ue=Ue.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&ue===0)return 0;for(var Ee=!1;;)switch(fe){case"ascii":case"latin1":case"binary":return ue;case"utf8":case"utf-8":return xe(Ue).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue*2;case"hex":return ue>>>1;case"base64":return Pe(Ue).length;default:if(Ee)return ie?-1:xe(Ue).length;fe=(""+fe).toLowerCase(),Ee=!0}}c.byteLength=m;function R(Ue,fe,ue){var ie=!1;if((fe===void 0||fe<0)&&(fe=0),fe>this.length||((ue===void 0||ue>this.length)&&(ue=this.length),ue<=0)||(ue>>>=0,fe>>>=0,ue<=fe))return"";for(Ue||(Ue="utf8");;)switch(Ue){case"hex":return Y(this,fe,ue);case"utf8":case"utf-8":return $(this,fe,ue);case"ascii":return ve(this,fe,ue);case"latin1":case"binary":return G(this,fe,ue);case"base64":return X(this,fe,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,fe,ue);default:if(ie)throw new TypeError("Unknown encoding: "+Ue);Ue=(Ue+"").toLowerCase(),ie=!0}}c.prototype._isBuffer=!0;function L(Ue,fe,ue){var ie=Ue[fe];Ue[fe]=Ue[ue],Ue[ue]=ie}c.prototype.swap16=function(){var fe=this.length;if(fe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ue=0;ueue&&(fe+=" ... "),""},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(fe,ue,ie,Ee,We){if(et(fe,Uint8Array)&&(fe=c.from(fe,fe.offset,fe.byteLength)),!c.isBuffer(fe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+a(fe));if(ue===void 0&&(ue=0),ie===void 0&&(ie=fe?fe.length:0),Ee===void 0&&(Ee=0),We===void 0&&(We=this.length),ue<0||ie>fe.length||Ee<0||We>this.length)throw new RangeError("out of range index");if(Ee>=We&&ue>=ie)return 0;if(Ee>=We)return-1;if(ue>=ie)return 1;if(ue>>>=0,ie>>>=0,Ee>>>=0,We>>>=0,this===fe)return 0;for(var Qe=We-Ee,Xe=ie-ue,Tt=Math.min(Qe,Xe),St=this.slice(Ee,We),zt=fe.slice(ue,ie),Ut=0;Ut2147483647?ue=2147483647:ue<-2147483648&&(ue=-2147483648),ue=+ue,rt(ue)&&(ue=Ee?0:Ue.length-1),ue<0&&(ue=Ue.length+ue),ue>=Ue.length){if(Ee)return-1;ue=Ue.length-1}else if(ue<0)if(Ee)ue=0;else return-1;if(typeof fe=="string"&&(fe=c.from(fe,ie)),c.isBuffer(fe))return fe.length===0?-1:F(Ue,fe,ue,ie,Ee);if(typeof fe=="number")return fe=fe&255,typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(Ue,fe,ue):Uint8Array.prototype.lastIndexOf.call(Ue,fe,ue):F(Ue,[fe],ue,ie,Ee);throw new TypeError("val must be string, number or Buffer")}function F(Ue,fe,ue,ie,Ee){var We=1,Qe=Ue.length,Xe=fe.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(Ue.length<2||fe.length<2)return-1;We=2,Qe/=2,Xe/=2,ue/=2}function Tt(hr,Or){return We===1?hr[Or]:hr.readUInt16BE(Or*We)}var St;if(Ee){var zt=-1;for(St=ue;StQe&&(ue=Qe-Xe),St=ue;St>=0;St--){for(var Ut=!0,br=0;brEe&&(ie=Ee)):ie=Ee;var We=fe.length;ie>We/2&&(ie=We/2);for(var Qe=0;Qe>>0,isFinite(ie)?(ie=ie>>>0,Ee===void 0&&(Ee="utf8")):(Ee=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var We=this.length-ue;if((ie===void 0||ie>We)&&(ie=We),fe.length>0&&(ie<0||ue<0)||ue>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");for(var Qe=!1;;)switch(Ee){case"hex":return N(this,fe,ue,ie);case"utf8":case"utf-8":return O(this,fe,ue,ie);case"ascii":case"latin1":case"binary":return P(this,fe,ue,ie);case"base64":return U(this,fe,ue,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,fe,ue,ie);default:if(Qe)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),Qe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(Ue,fe,ue){return fe===0&&ue===Ue.length?i.fromByteArray(Ue):i.fromByteArray(Ue.slice(fe,ue))}function $(Ue,fe,ue){ue=Math.min(Ue.length,ue);for(var ie=[],Ee=fe;Ee239?4:We>223?3:We>191?2:1;if(Ee+Xe<=ue){var Tt,St,zt,Ut;switch(Xe){case 1:We<128&&(Qe=We);break;case 2:Tt=Ue[Ee+1],(Tt&192)===128&&(Ut=(We&31)<<6|Tt&63,Ut>127&&(Qe=Ut));break;case 3:Tt=Ue[Ee+1],St=Ue[Ee+2],(Tt&192)===128&&(St&192)===128&&(Ut=(We&15)<<12|(Tt&63)<<6|St&63,Ut>2047&&(Ut<55296||Ut>57343)&&(Qe=Ut));break;case 4:Tt=Ue[Ee+1],St=Ue[Ee+2],zt=Ue[Ee+3],(Tt&192)===128&&(St&192)===128&&(zt&192)===128&&(Ut=(We&15)<<18|(Tt&63)<<12|(St&63)<<6|zt&63,Ut>65535&&Ut<1114112&&(Qe=Ut))}}Qe===null?(Qe=65533,Xe=1):Qe>65535&&(Qe-=65536,ie.push(Qe>>>10&1023|55296),Qe=56320|Qe&1023),ie.push(Qe),Ee+=Xe}return ce(ie)}var le=4096;function ce(Ue){var fe=Ue.length;if(fe<=le)return String.fromCharCode.apply(String,Ue);for(var ue="",ie=0;ieie)&&(ue=ie);for(var Ee="",We=fe;Weie&&(fe=ie),ue<0?(ue+=ie,ue<0&&(ue=0)):ue>ie&&(ue=ie),ueue)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(fe,ue,ie){fe=fe>>>0,ue=ue>>>0,ie||V(fe,ue,this.length);for(var Ee=this[fe],We=1,Qe=0;++Qe>>0,ue=ue>>>0,ie||V(fe,ue,this.length);for(var Ee=this[fe+--ue],We=1;ue>0&&(We*=256);)Ee+=this[fe+--ue]*We;return Ee},c.prototype.readUint8=c.prototype.readUInt8=function(fe,ue){return fe=fe>>>0,ue||V(fe,1,this.length),this[fe]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(fe,ue){return fe=fe>>>0,ue||V(fe,2,this.length),this[fe]|this[fe+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(fe,ue){return fe=fe>>>0,ue||V(fe,2,this.length),this[fe]<<8|this[fe+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),(this[fe]|this[fe+1]<<8|this[fe+2]<<16)+this[fe+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),this[fe]*16777216+(this[fe+1]<<16|this[fe+2]<<8|this[fe+3])},c.prototype.readIntLE=function(fe,ue,ie){fe=fe>>>0,ue=ue>>>0,ie||V(fe,ue,this.length);for(var Ee=this[fe],We=1,Qe=0;++Qe=We&&(Ee-=Math.pow(2,8*ue)),Ee},c.prototype.readIntBE=function(fe,ue,ie){fe=fe>>>0,ue=ue>>>0,ie||V(fe,ue,this.length);for(var Ee=ue,We=1,Qe=this[fe+--Ee];Ee>0&&(We*=256);)Qe+=this[fe+--Ee]*We;return We*=128,Qe>=We&&(Qe-=Math.pow(2,8*ue)),Qe},c.prototype.readInt8=function(fe,ue){return fe=fe>>>0,ue||V(fe,1,this.length),this[fe]&128?(255-this[fe]+1)*-1:this[fe]},c.prototype.readInt16LE=function(fe,ue){fe=fe>>>0,ue||V(fe,2,this.length);var ie=this[fe]|this[fe+1]<<8;return ie&32768?ie|4294901760:ie},c.prototype.readInt16BE=function(fe,ue){fe=fe>>>0,ue||V(fe,2,this.length);var ie=this[fe+1]|this[fe]<<8;return ie&32768?ie|4294901760:ie},c.prototype.readInt32LE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),this[fe]|this[fe+1]<<8|this[fe+2]<<16|this[fe+3]<<24},c.prototype.readInt32BE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),this[fe]<<24|this[fe+1]<<16|this[fe+2]<<8|this[fe+3]},c.prototype.readFloatLE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),n.read(this,fe,!0,23,4)},c.prototype.readFloatBE=function(fe,ue){return fe=fe>>>0,ue||V(fe,4,this.length),n.read(this,fe,!1,23,4)},c.prototype.readDoubleLE=function(fe,ue){return fe=fe>>>0,ue||V(fe,8,this.length),n.read(this,fe,!0,52,8)},c.prototype.readDoubleBE=function(fe,ue){return fe=fe>>>0,ue||V(fe,8,this.length),n.read(this,fe,!1,52,8)};function se(Ue,fe,ue,ie,Ee,We){if(!c.isBuffer(Ue))throw new TypeError('"buffer" argument must be a Buffer instance');if(fe>Ee||feUe.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(fe,ue,ie,Ee){if(fe=+fe,ue=ue>>>0,ie=ie>>>0,!Ee){var We=Math.pow(2,8*ie)-1;se(this,fe,ue,ie,We,0)}var Qe=1,Xe=0;for(this[ue]=fe&255;++Xe>>0,ie=ie>>>0,!Ee){var We=Math.pow(2,8*ie)-1;se(this,fe,ue,ie,We,0)}var Qe=ie-1,Xe=1;for(this[ue+Qe]=fe&255;--Qe>=0&&(Xe*=256);)this[ue+Qe]=fe/Xe&255;return ue+ie},c.prototype.writeUint8=c.prototype.writeUInt8=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,1,255,0),this[ue]=fe&255,ue+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,2,65535,0),this[ue]=fe&255,this[ue+1]=fe>>>8,ue+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,2,65535,0),this[ue]=fe>>>8,this[ue+1]=fe&255,ue+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,4,4294967295,0),this[ue+3]=fe>>>24,this[ue+2]=fe>>>16,this[ue+1]=fe>>>8,this[ue]=fe&255,ue+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,4,4294967295,0),this[ue]=fe>>>24,this[ue+1]=fe>>>16,this[ue+2]=fe>>>8,this[ue+3]=fe&255,ue+4},c.prototype.writeIntLE=function(fe,ue,ie,Ee){if(fe=+fe,ue=ue>>>0,!Ee){var We=Math.pow(2,8*ie-1);se(this,fe,ue,ie,We-1,-We)}var Qe=0,Xe=1,Tt=0;for(this[ue]=fe&255;++Qe>0)-Tt&255;return ue+ie},c.prototype.writeIntBE=function(fe,ue,ie,Ee){if(fe=+fe,ue=ue>>>0,!Ee){var We=Math.pow(2,8*ie-1);se(this,fe,ue,ie,We-1,-We)}var Qe=ie-1,Xe=1,Tt=0;for(this[ue+Qe]=fe&255;--Qe>=0&&(Xe*=256);)fe<0&&Tt===0&&this[ue+Qe+1]!==0&&(Tt=1),this[ue+Qe]=(fe/Xe>>0)-Tt&255;return ue+ie},c.prototype.writeInt8=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,1,127,-128),fe<0&&(fe=255+fe+1),this[ue]=fe&255,ue+1},c.prototype.writeInt16LE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,2,32767,-32768),this[ue]=fe&255,this[ue+1]=fe>>>8,ue+2},c.prototype.writeInt16BE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,2,32767,-32768),this[ue]=fe>>>8,this[ue+1]=fe&255,ue+2},c.prototype.writeInt32LE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,4,2147483647,-2147483648),this[ue]=fe&255,this[ue+1]=fe>>>8,this[ue+2]=fe>>>16,this[ue+3]=fe>>>24,ue+4},c.prototype.writeInt32BE=function(fe,ue,ie){return fe=+fe,ue=ue>>>0,ie||se(this,fe,ue,4,2147483647,-2147483648),fe<0&&(fe=4294967295+fe+1),this[ue]=fe>>>24,this[ue+1]=fe>>>16,this[ue+2]=fe>>>8,this[ue+3]=fe&255,ue+4};function ae(Ue,fe,ue,ie,Ee,We){if(ue+ie>Ue.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("Index out of range")}function j(Ue,fe,ue,ie,Ee){return fe=+fe,ue=ue>>>0,Ee||ae(Ue,fe,ue,4,34028234663852886e22,-34028234663852886e22),n.write(Ue,fe,ue,ie,23,4),ue+4}c.prototype.writeFloatLE=function(fe,ue,ie){return j(this,fe,ue,!0,ie)},c.prototype.writeFloatBE=function(fe,ue,ie){return j(this,fe,ue,!1,ie)};function Q(Ue,fe,ue,ie,Ee){return fe=+fe,ue=ue>>>0,Ee||ae(Ue,fe,ue,8,17976931348623157e292,-17976931348623157e292),n.write(Ue,fe,ue,ie,52,8),ue+8}c.prototype.writeDoubleLE=function(fe,ue,ie){return Q(this,fe,ue,!0,ie)},c.prototype.writeDoubleBE=function(fe,ue,ie){return Q(this,fe,ue,!1,ie)},c.prototype.copy=function(fe,ue,ie,Ee){if(!c.isBuffer(fe))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!Ee&&Ee!==0&&(Ee=this.length),ue>=fe.length&&(ue=fe.length),ue||(ue=0),Ee>0&&Ee=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),fe.length-ue>>0,ie=ie===void 0?this.length:ie>>>0,fe||(fe=0);var Qe;if(typeof fe=="number")for(Qe=ue;Qe55295&&ue<57344){if(!Ee){if(ue>56319){(fe-=3)>-1&&We.push(239,191,189);continue}else if(Qe+1===ie){(fe-=3)>-1&&We.push(239,191,189);continue}Ee=ue;continue}if(ue<56320){(fe-=3)>-1&&We.push(239,191,189),Ee=ue;continue}ue=(Ee-55296<<10|ue-56320)+65536}else Ee&&(fe-=3)>-1&&We.push(239,191,189);if(Ee=null,ue<128){if((fe-=1)<0)break;We.push(ue)}else if(ue<2048){if((fe-=2)<0)break;We.push(ue>>6|192,ue&63|128)}else if(ue<65536){if((fe-=3)<0)break;We.push(ue>>12|224,ue>>6&63|128,ue&63|128)}else if(ue<1114112){if((fe-=4)<0)break;We.push(ue>>18|240,ue>>12&63|128,ue>>6&63|128,ue&63|128)}else throw new Error("Invalid code point")}return We}function Te(Ue){for(var fe=[],ue=0;ue>8,Ee=ue%256,We.push(Ee),We.push(ie);return We}function Pe(Ue){return i.toByteArray(he(Ue))}function qe(Ue,fe,ue,ie){for(var Ee=0;Ee=fe.length||Ee>=Ue.length);++Ee)fe[Ee+ue]=Ue[Ee];return Ee}function et(Ue,fe){return Ue instanceof fe||Ue!=null&&Ue.constructor!=null&&Ue.constructor.name!=null&&Ue.constructor.name===fe.name}function rt(Ue){return Ue!==Ue}var $e=(function(){for(var Ue="0123456789abcdef",fe=new Array(256),ue=0;ue<16;++ue)for(var ie=ue*16,Ee=0;Ee<16;++Ee)fe[ie+Ee]=Ue[ue]+Ue[Ee];return fe})()}),9216:(function(e){"use strict";e.exports=a,e.exports.isMobile=a,e.exports.default=a;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,o=/android|ipad|playbook|silk/i;function a(i){i||(i={});var n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;var s=t.test(n)&&!r.test(n)||!!i.tablet&&o.test(n);return!s&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}}),6296:(function(e,t,r){"use strict";e.exports=h;var o=r(7261),a=r(9977),i=r(1811);function n(f,p){this._controllerNames=Object.keys(f),this._controllerList=this._controllerNames.map(function(c){return f[c]}),this._mode=p,this._active=f[p],this._active||(this._mode="turntable",this._active=f.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=n.prototype;s.flush=function(f){for(var p=this._controllerList,c=0;c"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(h){var f=n.get(h),p=f&&(f._triangleBuffer.handle||f._triangleBuffer.buffer);if(!p||!h.isBuffer(p)){var c=a(h,new Float32Array([-1,-1,-1,4,4,-1]));f=i(h,[{buffer:c,type:h.FLOAT,size:2}]),f._triangleBuffer=c,n.set(h,f)}f.bind(),h.drawArrays(h.TRIANGLES,0,3),f.unbind()}e.exports=s}),1085:(function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var h=i.split(/\r?\n/),f=String(h.length+n-1).length;return h.map(function(p,c){var T=c+n,l=String(T).length,_=o(T,f-l);return _+s+p}).join(` +`)}}),3952:(function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){for(var h=new Array(s+1),f=0;f0)throw new Error("Invalid string. Length must be a multiple of 4");var M=w.indexOf("=");M===-1&&(M=A);var g=M===A?0:4-M%4;return[M,g]}function f(w){var A=h(w),M=A[0],g=A[1];return(M+g)*3/4-g}function p(w,A,M){return(A+M)*3/4-M}function c(w){var A,M=h(w),g=M[0],b=M[1],v=new a(p(w,g,b)),u=0,y=b>0?g-4:g,m;for(m=0;m>16&255,v[u++]=A>>8&255,v[u++]=A&255;return b===2&&(A=o[w.charCodeAt(m)]<<2|o[w.charCodeAt(m+1)]>>4,v[u++]=A&255),b===1&&(A=o[w.charCodeAt(m)]<<10|o[w.charCodeAt(m+1)]<<4|o[w.charCodeAt(m+2)]>>2,v[u++]=A>>8&255,v[u++]=A&255),v}function T(w){return r[w>>18&63]+r[w>>12&63]+r[w>>6&63]+r[w&63]}function l(w,A,M){for(var g,b=[],v=A;vy?y:u+v));return g===1?(A=w[M-1],b.push(r[A>>2]+r[A<<4&63]+"==")):g===2&&(A=(w[M-2]<<8)+w[M-1],b.push(r[A>>10]+r[A>>4&63]+r[A<<2&63]+"=")),b.join("")}}),3865:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}}),1318:(function(e){"use strict";e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}}),8697:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}}),7842:(function(e,t,r){"use strict";var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),h=r(8697);e.exports=f;function f(p,c){if(o(p))return c?h(p,f(c)):[p[0].clone(),p[1].clone()];var T=0,l,_;if(a(p))l=p.clone();else if(typeof p=="string")l=n(p);else{if(p===0)return[i(0),i(1)];if(p===Math.floor(p))l=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T-=256;l=i(p)}}if(o(c))l.mul(c[1]),_=c[0].clone();else if(a(c))_=c.clone();else if(typeof c=="string")_=n(c);else if(!c)_=i(1);else if(c===Math.floor(c))_=i(c);else{for(;c!==Math.floor(c);)c=c*Math.pow(2,256),T+=256;_=i(c)}return T>0?l=l.ushln(T):T<0&&(_=_.ushln(-T)),s(l,_)}}),6330:(function(e,t,r){"use strict";var o=r(1533);e.exports=a;function a(i){return Array.isArray(i)&&i.length===2&&o(i[0])&&o(i[1])}}),5716:(function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return i.cmp(new o(0))}}),1369:(function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,h=0;if(n===1)h=s[0];else if(n===2)h=s[0]+s[1]*67108864;else for(var f=0;f20?52:h+32}}),1533:(function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return i&&typeof i=="object"&&!!i.words}}),2651:(function(e,t,r){"use strict";var o=r(6859),a=r(2361);e.exports=i;function i(n){var s=a.exponent(n);return s<52?new o(n):new o(n*Math.pow(2,52-s)).ushln(s-52)}}),869:(function(e,t,r){"use strict";var o=r(2651),a=r(5716);e.exports=i;function i(n,s){var h=a(n),f=a(s);if(h===0)return[o(0),o(1)];if(f===0)return[o(0),o(0)];f<0&&(n=n.neg(),s=s.neg());var p=n.gcd(s);return p.cmpn(1)?[n.div(p),s.div(p)]:[n,s]}}),6768:(function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return new o(i)}}),6504:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[0]),i[1].mul(n[1]))}}),7721:(function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}}),5572:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).sub(i[1].mul(n[0])),i[1].mul(n[1]))}}),946:(function(e,t,r){"use strict";var o=r(1369),a=r(4025);e.exports=i;function i(n){var s=n[0],h=n[1];if(s.cmpn(0)===0)return 0;var f=s.abs().divmod(h.abs()),p=f.div,c=o(p),T=f.mod,l=s.negative!==h.negative?-1:1;if(T.cmpn(0)===0)return l*c;if(c){var _=a(c)+4,w=o(T.ushln(_).divRound(h));return l*(c+w*Math.pow(2,-_))}else{var A=h.bitLength()-T.bitLength()+53,w=o(T.ushln(A).divRound(h));return A<1023?l*w*Math.pow(2,-A):(w*=Math.pow(2,-1023),l*w*Math.pow(2,1023-A))}}}),2478:(function(e){"use strict";function t(s,h,f,p,c){for(var T=c+1;p<=c;){var l=p+c>>>1,_=s[l],w=f!==void 0?f(_,h):_-h;w>=0?(T=l,c=l-1):p=l+1}return T}function r(s,h,f,p,c){for(var T=c+1;p<=c;){var l=p+c>>>1,_=s[l],w=f!==void 0?f(_,h):_-h;w>0?(T=l,c=l-1):p=l+1}return T}function o(s,h,f,p,c){for(var T=p-1;p<=c;){var l=p+c>>>1,_=s[l],w=f!==void 0?f(_,h):_-h;w<0?(T=l,p=l+1):c=l-1}return T}function a(s,h,f,p,c){for(var T=p-1;p<=c;){var l=p+c>>>1,_=s[l],w=f!==void 0?f(_,h):_-h;w<=0?(T=l,p=l+1):c=l-1}return T}function i(s,h,f,p,c){for(;p<=c;){var T=p+c>>>1,l=s[T],_=f!==void 0?f(l,h):l-h;if(_===0)return T;_<=0?p=T+1:c=T-1}return-1}function n(s,h,f,p,c,T){return typeof f=="function"?T(s,h,f,p===void 0?0:p|0,c===void 0?s.length-1:c|0):T(s,h,void 0,f===void 0?0:f|0,p===void 0?s.length-1:p|0)}e.exports={ge:function(s,h,f,p,c){return n(s,h,f,p,c,t)},gt:function(s,h,f,p,c){return n(s,h,f,p,c,r)},lt:function(s,h,f,p,c){return n(s,h,f,p,c,o)},le:function(s,h,f,p,c){return n(s,h,f,p,c,a)},eq:function(s,h,f,p,c){return n(s,h,f,p,c,i)}}}),8828:(function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,h=n,f=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--f;i[n]=h<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}}),6859:(function(e,t,r){e=r.nmd(e),(function(o,a){"use strict";function i(O,P){if(!O)throw new Error(P||"Assertion failed")}function n(O,P){O.super_=P;var U=function(){};U.prototype=P.prototype,O.prototype=new U,O.prototype.constructor=O}function s(O,P,U){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((P==="le"||P==="be")&&(U=P,P=10),this._init(O||0,P||10,U||"be"))}typeof o=="object"?o.exports=s:a.BN=s,s.BN=s,s.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=r(7790).Buffer}catch{}s.isBN=function(P){return P instanceof s?!0:P!==null&&typeof P=="object"&&P.constructor.wordSize===s.wordSize&&Array.isArray(P.words)},s.max=function(P,U){return P.cmp(U)>0?P:U},s.min=function(P,U){return P.cmp(U)<0?P:U},s.prototype._init=function(P,U,B){if(typeof P=="number")return this._initNumber(P,U,B);if(typeof P=="object")return this._initArray(P,U,B);U==="hex"&&(U=16),i(U===(U|0)&&U>=2&&U<=36),P=P.toString().replace(/\s+/g,"");var X=0;P[0]==="-"&&(X++,this.negative=1),X=0;X-=3)le=P[X]|P[X-1]<<8|P[X-2]<<16,this.words[$]|=le<>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,$++);else if(B==="le")for(X=0,$=0;X>>26-ce&67108863,ce+=24,ce>=26&&(ce-=26,$++);return this.strip()};function f(O,P){var U=O.charCodeAt(P);return U>=65&&U<=70?U-55:U>=97&&U<=102?U-87:U-48&15}function p(O,P,U){var B=f(O,U);return U-1>=P&&(B|=f(O,U-1)<<4),B}s.prototype._parseHex=function(P,U,B){this.length=Math.ceil((P.length-U)/6),this.words=new Array(this.length);for(var X=0;X=U;X-=2)ce=p(P,U,X)<<$,this.words[le]|=ce&67108863,$>=18?($-=18,le+=1,this.words[le]|=ce>>>26):$+=8;else{var ve=P.length-U;for(X=ve%2===0?U+1:U;X=18?($-=18,le+=1,this.words[le]|=ce>>>26):$+=8}this.strip()};function c(O,P,U,B){for(var X=0,$=Math.min(O.length,U),le=P;le<$;le++){var ce=O.charCodeAt(le)-48;X*=B,ce>=49?X+=ce-49+10:ce>=17?X+=ce-17+10:X+=ce}return X}s.prototype._parseBase=function(P,U,B){this.words=[0],this.length=1;for(var X=0,$=1;$<=67108863;$*=U)X++;X--,$=$/U|0;for(var le=P.length-B,ce=le%X,ve=Math.min(le,le-ce)+B,G=0,Y=B;Y1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(P,U){P=P||10,U=U|0||1;var B;if(P===16||P==="hex"){B="";for(var X=0,$=0,le=0;le>>24-X&16777215,X+=2,X>=26&&(X-=26,le--),$!==0||le!==this.length-1?B=T[6-ve.length]+ve+B:B=ve+B}for($!==0&&(B=$.toString(16)+B);B.length%U!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}if(P===(P|0)&&P>=2&&P<=36){var G=l[P],Y=_[P];B="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var V=ee.modn(Y).toString(P);ee=ee.idivn(Y),ee.isZero()?B=V+B:B=T[G-V.length]+V+B}for(this.isZero()&&(B="0"+B);B.length%U!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var P=this.words[0];return this.length===2?P+=this.words[1]*67108864:this.length===3&&this.words[2]===1?P+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-P:P},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(P,U){return i(typeof h<"u"),this.toArrayLike(h,P,U)},s.prototype.toArray=function(P,U){return this.toArrayLike(Array,P,U)},s.prototype.toArrayLike=function(P,U,B){var X=this.byteLength(),$=B||Math.max(1,X);i(X<=$,"byte array longer than desired length"),i($>0,"Requested array length <= 0"),this.strip();var le=U==="le",ce=new P($),ve,G,Y=this.clone();if(le){for(G=0;!Y.isZero();G++)ve=Y.andln(255),Y.iushrn(8),ce[G]=ve;for(;G<$;G++)ce[G]=0}else{for(G=0;G<$-X;G++)ce[G]=0;for(G=0;!Y.isZero();G++)ve=Y.andln(255),Y.iushrn(8),ce[$-G-1]=ve}return ce},Math.clz32?s.prototype._countBits=function(P){return 32-Math.clz32(P)}:s.prototype._countBits=function(P){var U=P,B=0;return U>=4096&&(B+=13,U>>>=13),U>=64&&(B+=7,U>>>=7),U>=8&&(B+=4,U>>>=4),U>=2&&(B+=2,U>>>=2),B+U},s.prototype._zeroBits=function(P){if(P===0)return 26;var U=P,B=0;return(U&8191)===0&&(B+=13,U>>>=13),(U&127)===0&&(B+=7,U>>>=7),(U&15)===0&&(B+=4,U>>>=4),(U&3)===0&&(B+=2,U>>>=2),(U&1)===0&&B++,B},s.prototype.bitLength=function(){var P=this.words[this.length-1],U=this._countBits(P);return(this.length-1)*26+U};function w(O){for(var P=new Array(O.bitLength()),U=0;U>>X}return P}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var P=0,U=0;UP.length?this.clone().ior(P):P.clone().ior(this)},s.prototype.uor=function(P){return this.length>P.length?this.clone().iuor(P):P.clone().iuor(this)},s.prototype.iuand=function(P){var U;this.length>P.length?U=P:U=this;for(var B=0;BP.length?this.clone().iand(P):P.clone().iand(this)},s.prototype.uand=function(P){return this.length>P.length?this.clone().iuand(P):P.clone().iuand(this)},s.prototype.iuxor=function(P){var U,B;this.length>P.length?(U=this,B=P):(U=P,B=this);for(var X=0;XP.length?this.clone().ixor(P):P.clone().ixor(this)},s.prototype.uxor=function(P){return this.length>P.length?this.clone().iuxor(P):P.clone().iuxor(this)},s.prototype.inotn=function(P){i(typeof P=="number"&&P>=0);var U=Math.ceil(P/26)|0,B=P%26;this._expand(U),B>0&&U--;for(var X=0;X0&&(this.words[X]=~this.words[X]&67108863>>26-B),this.strip()},s.prototype.notn=function(P){return this.clone().inotn(P)},s.prototype.setn=function(P,U){i(typeof P=="number"&&P>=0);var B=P/26|0,X=P%26;return this._expand(B+1),U?this.words[B]=this.words[B]|1<P.length?(B=this,X=P):(B=P,X=this);for(var $=0,le=0;le>>26;for(;$!==0&&le>>26;if(this.length=B.length,$!==0)this.words[this.length]=$,this.length++;else if(B!==this)for(;leP.length?this.clone().iadd(P):P.clone().iadd(this)},s.prototype.isub=function(P){if(P.negative!==0){P.negative=0;var U=this.iadd(P);return P.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(P),this.negative=1,this._normSign();var B=this.cmp(P);if(B===0)return this.negative=0,this.length=1,this.words[0]=0,this;var X,$;B>0?(X=this,$=P):(X=P,$=this);for(var le=0,ce=0;ce<$.length;ce++)U=(X.words[ce]|0)-($.words[ce]|0)+le,le=U>>26,this.words[ce]=U&67108863;for(;le!==0&&ce>26,this.words[ce]=U&67108863;if(le===0&&ce>>26,ee=ve&67108863,V=Math.min(G,P.length-1),se=Math.max(0,G-O.length+1);se<=V;se++){var ae=G-se|0;X=O.words[ae]|0,$=P.words[se]|0,le=X*$+ee,Y+=le/67108864|0,ee=le&67108863}U.words[G]=ee|0,ve=Y|0}return ve!==0?U.words[G]=ve|0:U.length--,U.strip()}var M=function(P,U,B){var X=P.words,$=U.words,le=B.words,ce=0,ve,G,Y,ee=X[0]|0,V=ee&8191,se=ee>>>13,ae=X[1]|0,j=ae&8191,Q=ae>>>13,re=X[2]|0,he=re&8191,xe=re>>>13,Te=X[3]|0,Le=Te&8191,Pe=Te>>>13,qe=X[4]|0,et=qe&8191,rt=qe>>>13,$e=X[5]|0,Ue=$e&8191,fe=$e>>>13,ue=X[6]|0,ie=ue&8191,Ee=ue>>>13,We=X[7]|0,Qe=We&8191,Xe=We>>>13,Tt=X[8]|0,St=Tt&8191,zt=Tt>>>13,Ut=X[9]|0,br=Ut&8191,hr=Ut>>>13,Or=$[0]|0,wr=Or&8191,Er=Or>>>13,mt=$[1]|0,ze=mt&8191,Ze=mt>>>13,we=$[2]|0,ke=we&8191,Be=we>>>13,He=$[3]|0,nt=He&8191,ot=He>>>13,Ft=$[4]|0,Mt=Ft&8191,Et=Ft>>>13,Ot=$[5]|0,sr=Ot&8191,ir=Ot>>>13,ar=$[6]|0,Mr=ar&8191,ma=ar>>>13,Ca=$[7]|0,Aa=Ca&8191,Da=Ca>>>13,Ba=$[8]|0,ba=Ba&8191,rn=Ba>>>13,vn=$[9]|0,Wt=vn&8191,Lt=vn>>>13;B.negative=P.negative^U.negative,B.length=19,ve=Math.imul(V,wr),G=Math.imul(V,Er),G=G+Math.imul(se,wr)|0,Y=Math.imul(se,Er);var Ht=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,ve=Math.imul(j,wr),G=Math.imul(j,Er),G=G+Math.imul(Q,wr)|0,Y=Math.imul(Q,Er),ve=ve+Math.imul(V,ze)|0,G=G+Math.imul(V,Ze)|0,G=G+Math.imul(se,ze)|0,Y=Y+Math.imul(se,Ze)|0;var Xt=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,ve=Math.imul(he,wr),G=Math.imul(he,Er),G=G+Math.imul(xe,wr)|0,Y=Math.imul(xe,Er),ve=ve+Math.imul(j,ze)|0,G=G+Math.imul(j,Ze)|0,G=G+Math.imul(Q,ze)|0,Y=Y+Math.imul(Q,Ze)|0,ve=ve+Math.imul(V,ke)|0,G=G+Math.imul(V,Be)|0,G=G+Math.imul(se,ke)|0,Y=Y+Math.imul(se,Be)|0;var Pr=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,ve=Math.imul(Le,wr),G=Math.imul(Le,Er),G=G+Math.imul(Pe,wr)|0,Y=Math.imul(Pe,Er),ve=ve+Math.imul(he,ze)|0,G=G+Math.imul(he,Ze)|0,G=G+Math.imul(xe,ze)|0,Y=Y+Math.imul(xe,Ze)|0,ve=ve+Math.imul(j,ke)|0,G=G+Math.imul(j,Be)|0,G=G+Math.imul(Q,ke)|0,Y=Y+Math.imul(Q,Be)|0,ve=ve+Math.imul(V,nt)|0,G=G+Math.imul(V,ot)|0,G=G+Math.imul(se,nt)|0,Y=Y+Math.imul(se,ot)|0;var Yr=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,ve=Math.imul(et,wr),G=Math.imul(et,Er),G=G+Math.imul(rt,wr)|0,Y=Math.imul(rt,Er),ve=ve+Math.imul(Le,ze)|0,G=G+Math.imul(Le,Ze)|0,G=G+Math.imul(Pe,ze)|0,Y=Y+Math.imul(Pe,Ze)|0,ve=ve+Math.imul(he,ke)|0,G=G+Math.imul(he,Be)|0,G=G+Math.imul(xe,ke)|0,Y=Y+Math.imul(xe,Be)|0,ve=ve+Math.imul(j,nt)|0,G=G+Math.imul(j,ot)|0,G=G+Math.imul(Q,nt)|0,Y=Y+Math.imul(Q,ot)|0,ve=ve+Math.imul(V,Mt)|0,G=G+Math.imul(V,Et)|0,G=G+Math.imul(se,Mt)|0,Y=Y+Math.imul(se,Et)|0;var Kr=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,ve=Math.imul(Ue,wr),G=Math.imul(Ue,Er),G=G+Math.imul(fe,wr)|0,Y=Math.imul(fe,Er),ve=ve+Math.imul(et,ze)|0,G=G+Math.imul(et,Ze)|0,G=G+Math.imul(rt,ze)|0,Y=Y+Math.imul(rt,Ze)|0,ve=ve+Math.imul(Le,ke)|0,G=G+Math.imul(Le,Be)|0,G=G+Math.imul(Pe,ke)|0,Y=Y+Math.imul(Pe,Be)|0,ve=ve+Math.imul(he,nt)|0,G=G+Math.imul(he,ot)|0,G=G+Math.imul(xe,nt)|0,Y=Y+Math.imul(xe,ot)|0,ve=ve+Math.imul(j,Mt)|0,G=G+Math.imul(j,Et)|0,G=G+Math.imul(Q,Mt)|0,Y=Y+Math.imul(Q,Et)|0,ve=ve+Math.imul(V,sr)|0,G=G+Math.imul(V,ir)|0,G=G+Math.imul(se,sr)|0,Y=Y+Math.imul(se,ir)|0;var na=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(na>>>26)|0,na&=67108863,ve=Math.imul(ie,wr),G=Math.imul(ie,Er),G=G+Math.imul(Ee,wr)|0,Y=Math.imul(Ee,Er),ve=ve+Math.imul(Ue,ze)|0,G=G+Math.imul(Ue,Ze)|0,G=G+Math.imul(fe,ze)|0,Y=Y+Math.imul(fe,Ze)|0,ve=ve+Math.imul(et,ke)|0,G=G+Math.imul(et,Be)|0,G=G+Math.imul(rt,ke)|0,Y=Y+Math.imul(rt,Be)|0,ve=ve+Math.imul(Le,nt)|0,G=G+Math.imul(Le,ot)|0,G=G+Math.imul(Pe,nt)|0,Y=Y+Math.imul(Pe,ot)|0,ve=ve+Math.imul(he,Mt)|0,G=G+Math.imul(he,Et)|0,G=G+Math.imul(xe,Mt)|0,Y=Y+Math.imul(xe,Et)|0,ve=ve+Math.imul(j,sr)|0,G=G+Math.imul(j,ir)|0,G=G+Math.imul(Q,sr)|0,Y=Y+Math.imul(Q,ir)|0,ve=ve+Math.imul(V,Mr)|0,G=G+Math.imul(V,ma)|0,G=G+Math.imul(se,Mr)|0,Y=Y+Math.imul(se,ma)|0;var La=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(La>>>26)|0,La&=67108863,ve=Math.imul(Qe,wr),G=Math.imul(Qe,Er),G=G+Math.imul(Xe,wr)|0,Y=Math.imul(Xe,Er),ve=ve+Math.imul(ie,ze)|0,G=G+Math.imul(ie,Ze)|0,G=G+Math.imul(Ee,ze)|0,Y=Y+Math.imul(Ee,Ze)|0,ve=ve+Math.imul(Ue,ke)|0,G=G+Math.imul(Ue,Be)|0,G=G+Math.imul(fe,ke)|0,Y=Y+Math.imul(fe,Be)|0,ve=ve+Math.imul(et,nt)|0,G=G+Math.imul(et,ot)|0,G=G+Math.imul(rt,nt)|0,Y=Y+Math.imul(rt,ot)|0,ve=ve+Math.imul(Le,Mt)|0,G=G+Math.imul(Le,Et)|0,G=G+Math.imul(Pe,Mt)|0,Y=Y+Math.imul(Pe,Et)|0,ve=ve+Math.imul(he,sr)|0,G=G+Math.imul(he,ir)|0,G=G+Math.imul(xe,sr)|0,Y=Y+Math.imul(xe,ir)|0,ve=ve+Math.imul(j,Mr)|0,G=G+Math.imul(j,ma)|0,G=G+Math.imul(Q,Mr)|0,Y=Y+Math.imul(Q,ma)|0,ve=ve+Math.imul(V,Aa)|0,G=G+Math.imul(V,Da)|0,G=G+Math.imul(se,Aa)|0,Y=Y+Math.imul(se,Da)|0;var Ga=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,ve=Math.imul(St,wr),G=Math.imul(St,Er),G=G+Math.imul(zt,wr)|0,Y=Math.imul(zt,Er),ve=ve+Math.imul(Qe,ze)|0,G=G+Math.imul(Qe,Ze)|0,G=G+Math.imul(Xe,ze)|0,Y=Y+Math.imul(Xe,Ze)|0,ve=ve+Math.imul(ie,ke)|0,G=G+Math.imul(ie,Be)|0,G=G+Math.imul(Ee,ke)|0,Y=Y+Math.imul(Ee,Be)|0,ve=ve+Math.imul(Ue,nt)|0,G=G+Math.imul(Ue,ot)|0,G=G+Math.imul(fe,nt)|0,Y=Y+Math.imul(fe,ot)|0,ve=ve+Math.imul(et,Mt)|0,G=G+Math.imul(et,Et)|0,G=G+Math.imul(rt,Mt)|0,Y=Y+Math.imul(rt,Et)|0,ve=ve+Math.imul(Le,sr)|0,G=G+Math.imul(Le,ir)|0,G=G+Math.imul(Pe,sr)|0,Y=Y+Math.imul(Pe,ir)|0,ve=ve+Math.imul(he,Mr)|0,G=G+Math.imul(he,ma)|0,G=G+Math.imul(xe,Mr)|0,Y=Y+Math.imul(xe,ma)|0,ve=ve+Math.imul(j,Aa)|0,G=G+Math.imul(j,Da)|0,G=G+Math.imul(Q,Aa)|0,Y=Y+Math.imul(Q,Da)|0,ve=ve+Math.imul(V,ba)|0,G=G+Math.imul(V,rn)|0,G=G+Math.imul(se,ba)|0,Y=Y+Math.imul(se,rn)|0;var Ua=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,ve=Math.imul(br,wr),G=Math.imul(br,Er),G=G+Math.imul(hr,wr)|0,Y=Math.imul(hr,Er),ve=ve+Math.imul(St,ze)|0,G=G+Math.imul(St,Ze)|0,G=G+Math.imul(zt,ze)|0,Y=Y+Math.imul(zt,Ze)|0,ve=ve+Math.imul(Qe,ke)|0,G=G+Math.imul(Qe,Be)|0,G=G+Math.imul(Xe,ke)|0,Y=Y+Math.imul(Xe,Be)|0,ve=ve+Math.imul(ie,nt)|0,G=G+Math.imul(ie,ot)|0,G=G+Math.imul(Ee,nt)|0,Y=Y+Math.imul(Ee,ot)|0,ve=ve+Math.imul(Ue,Mt)|0,G=G+Math.imul(Ue,Et)|0,G=G+Math.imul(fe,Mt)|0,Y=Y+Math.imul(fe,Et)|0,ve=ve+Math.imul(et,sr)|0,G=G+Math.imul(et,ir)|0,G=G+Math.imul(rt,sr)|0,Y=Y+Math.imul(rt,ir)|0,ve=ve+Math.imul(Le,Mr)|0,G=G+Math.imul(Le,ma)|0,G=G+Math.imul(Pe,Mr)|0,Y=Y+Math.imul(Pe,ma)|0,ve=ve+Math.imul(he,Aa)|0,G=G+Math.imul(he,Da)|0,G=G+Math.imul(xe,Aa)|0,Y=Y+Math.imul(xe,Da)|0,ve=ve+Math.imul(j,ba)|0,G=G+Math.imul(j,rn)|0,G=G+Math.imul(Q,ba)|0,Y=Y+Math.imul(Q,rn)|0,ve=ve+Math.imul(V,Wt)|0,G=G+Math.imul(V,Lt)|0,G=G+Math.imul(se,Wt)|0,Y=Y+Math.imul(se,Lt)|0;var Xa=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Xa>>>26)|0,Xa&=67108863,ve=Math.imul(br,ze),G=Math.imul(br,Ze),G=G+Math.imul(hr,ze)|0,Y=Math.imul(hr,Ze),ve=ve+Math.imul(St,ke)|0,G=G+Math.imul(St,Be)|0,G=G+Math.imul(zt,ke)|0,Y=Y+Math.imul(zt,Be)|0,ve=ve+Math.imul(Qe,nt)|0,G=G+Math.imul(Qe,ot)|0,G=G+Math.imul(Xe,nt)|0,Y=Y+Math.imul(Xe,ot)|0,ve=ve+Math.imul(ie,Mt)|0,G=G+Math.imul(ie,Et)|0,G=G+Math.imul(Ee,Mt)|0,Y=Y+Math.imul(Ee,Et)|0,ve=ve+Math.imul(Ue,sr)|0,G=G+Math.imul(Ue,ir)|0,G=G+Math.imul(fe,sr)|0,Y=Y+Math.imul(fe,ir)|0,ve=ve+Math.imul(et,Mr)|0,G=G+Math.imul(et,ma)|0,G=G+Math.imul(rt,Mr)|0,Y=Y+Math.imul(rt,ma)|0,ve=ve+Math.imul(Le,Aa)|0,G=G+Math.imul(Le,Da)|0,G=G+Math.imul(Pe,Aa)|0,Y=Y+Math.imul(Pe,Da)|0,ve=ve+Math.imul(he,ba)|0,G=G+Math.imul(he,rn)|0,G=G+Math.imul(xe,ba)|0,Y=Y+Math.imul(xe,rn)|0,ve=ve+Math.imul(j,Wt)|0,G=G+Math.imul(j,Lt)|0,G=G+Math.imul(Q,Wt)|0,Y=Y+Math.imul(Q,Lt)|0;var an=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(an>>>26)|0,an&=67108863,ve=Math.imul(br,ke),G=Math.imul(br,Be),G=G+Math.imul(hr,ke)|0,Y=Math.imul(hr,Be),ve=ve+Math.imul(St,nt)|0,G=G+Math.imul(St,ot)|0,G=G+Math.imul(zt,nt)|0,Y=Y+Math.imul(zt,ot)|0,ve=ve+Math.imul(Qe,Mt)|0,G=G+Math.imul(Qe,Et)|0,G=G+Math.imul(Xe,Mt)|0,Y=Y+Math.imul(Xe,Et)|0,ve=ve+Math.imul(ie,sr)|0,G=G+Math.imul(ie,ir)|0,G=G+Math.imul(Ee,sr)|0,Y=Y+Math.imul(Ee,ir)|0,ve=ve+Math.imul(Ue,Mr)|0,G=G+Math.imul(Ue,ma)|0,G=G+Math.imul(fe,Mr)|0,Y=Y+Math.imul(fe,ma)|0,ve=ve+Math.imul(et,Aa)|0,G=G+Math.imul(et,Da)|0,G=G+Math.imul(rt,Aa)|0,Y=Y+Math.imul(rt,Da)|0,ve=ve+Math.imul(Le,ba)|0,G=G+Math.imul(Le,rn)|0,G=G+Math.imul(Pe,ba)|0,Y=Y+Math.imul(Pe,rn)|0,ve=ve+Math.imul(he,Wt)|0,G=G+Math.imul(he,Lt)|0,G=G+Math.imul(xe,Wt)|0,Y=Y+Math.imul(xe,Lt)|0;var Sa=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,ve=Math.imul(br,nt),G=Math.imul(br,ot),G=G+Math.imul(hr,nt)|0,Y=Math.imul(hr,ot),ve=ve+Math.imul(St,Mt)|0,G=G+Math.imul(St,Et)|0,G=G+Math.imul(zt,Mt)|0,Y=Y+Math.imul(zt,Et)|0,ve=ve+Math.imul(Qe,sr)|0,G=G+Math.imul(Qe,ir)|0,G=G+Math.imul(Xe,sr)|0,Y=Y+Math.imul(Xe,ir)|0,ve=ve+Math.imul(ie,Mr)|0,G=G+Math.imul(ie,ma)|0,G=G+Math.imul(Ee,Mr)|0,Y=Y+Math.imul(Ee,ma)|0,ve=ve+Math.imul(Ue,Aa)|0,G=G+Math.imul(Ue,Da)|0,G=G+Math.imul(fe,Aa)|0,Y=Y+Math.imul(fe,Da)|0,ve=ve+Math.imul(et,ba)|0,G=G+Math.imul(et,rn)|0,G=G+Math.imul(rt,ba)|0,Y=Y+Math.imul(rt,rn)|0,ve=ve+Math.imul(Le,Wt)|0,G=G+Math.imul(Le,Lt)|0,G=G+Math.imul(Pe,Wt)|0,Y=Y+Math.imul(Pe,Lt)|0;var Zn=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,ve=Math.imul(br,Mt),G=Math.imul(br,Et),G=G+Math.imul(hr,Mt)|0,Y=Math.imul(hr,Et),ve=ve+Math.imul(St,sr)|0,G=G+Math.imul(St,ir)|0,G=G+Math.imul(zt,sr)|0,Y=Y+Math.imul(zt,ir)|0,ve=ve+Math.imul(Qe,Mr)|0,G=G+Math.imul(Qe,ma)|0,G=G+Math.imul(Xe,Mr)|0,Y=Y+Math.imul(Xe,ma)|0,ve=ve+Math.imul(ie,Aa)|0,G=G+Math.imul(ie,Da)|0,G=G+Math.imul(Ee,Aa)|0,Y=Y+Math.imul(Ee,Da)|0,ve=ve+Math.imul(Ue,ba)|0,G=G+Math.imul(Ue,rn)|0,G=G+Math.imul(fe,ba)|0,Y=Y+Math.imul(fe,rn)|0,ve=ve+Math.imul(et,Wt)|0,G=G+Math.imul(et,Lt)|0,G=G+Math.imul(rt,Wt)|0,Y=Y+Math.imul(rt,Lt)|0;var Wn=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,ve=Math.imul(br,sr),G=Math.imul(br,ir),G=G+Math.imul(hr,sr)|0,Y=Math.imul(hr,ir),ve=ve+Math.imul(St,Mr)|0,G=G+Math.imul(St,ma)|0,G=G+Math.imul(zt,Mr)|0,Y=Y+Math.imul(zt,ma)|0,ve=ve+Math.imul(Qe,Aa)|0,G=G+Math.imul(Qe,Da)|0,G=G+Math.imul(Xe,Aa)|0,Y=Y+Math.imul(Xe,Da)|0,ve=ve+Math.imul(ie,ba)|0,G=G+Math.imul(ie,rn)|0,G=G+Math.imul(Ee,ba)|0,Y=Y+Math.imul(Ee,rn)|0,ve=ve+Math.imul(Ue,Wt)|0,G=G+Math.imul(Ue,Lt)|0,G=G+Math.imul(fe,Wt)|0,Y=Y+Math.imul(fe,Lt)|0;var ti=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(ti>>>26)|0,ti&=67108863,ve=Math.imul(br,Mr),G=Math.imul(br,ma),G=G+Math.imul(hr,Mr)|0,Y=Math.imul(hr,ma),ve=ve+Math.imul(St,Aa)|0,G=G+Math.imul(St,Da)|0,G=G+Math.imul(zt,Aa)|0,Y=Y+Math.imul(zt,Da)|0,ve=ve+Math.imul(Qe,ba)|0,G=G+Math.imul(Qe,rn)|0,G=G+Math.imul(Xe,ba)|0,Y=Y+Math.imul(Xe,rn)|0,ve=ve+Math.imul(ie,Wt)|0,G=G+Math.imul(ie,Lt)|0,G=G+Math.imul(Ee,Wt)|0,Y=Y+Math.imul(Ee,Lt)|0;var gt=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(gt>>>26)|0,gt&=67108863,ve=Math.imul(br,Aa),G=Math.imul(br,Da),G=G+Math.imul(hr,Aa)|0,Y=Math.imul(hr,Da),ve=ve+Math.imul(St,ba)|0,G=G+Math.imul(St,rn)|0,G=G+Math.imul(zt,ba)|0,Y=Y+Math.imul(zt,rn)|0,ve=ve+Math.imul(Qe,Wt)|0,G=G+Math.imul(Qe,Lt)|0,G=G+Math.imul(Xe,Wt)|0,Y=Y+Math.imul(Xe,Lt)|0;var it=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(it>>>26)|0,it&=67108863,ve=Math.imul(br,ba),G=Math.imul(br,rn),G=G+Math.imul(hr,ba)|0,Y=Math.imul(hr,rn),ve=ve+Math.imul(St,Wt)|0,G=G+Math.imul(St,Lt)|0,G=G+Math.imul(zt,Wt)|0,Y=Y+Math.imul(zt,Lt)|0;var Rr=(ce+ve|0)+((G&8191)<<13)|0;ce=(Y+(G>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,ve=Math.imul(br,Wt),G=Math.imul(br,Lt),G=G+Math.imul(hr,Wt)|0,Y=Math.imul(hr,Lt);var Ar=(ce+ve|0)+((G&8191)<<13)|0;return ce=(Y+(G>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,le[0]=Ht,le[1]=Xt,le[2]=Pr,le[3]=Yr,le[4]=Kr,le[5]=na,le[6]=La,le[7]=Ga,le[8]=Ua,le[9]=Xa,le[10]=an,le[11]=Sa,le[12]=Zn,le[13]=Wn,le[14]=ti,le[15]=gt,le[16]=it,le[17]=Rr,le[18]=Ar,ce!==0&&(le[19]=ce,B.length++),B};Math.imul||(M=A);function g(O,P,U){U.negative=P.negative^O.negative,U.length=O.length+P.length;for(var B=0,X=0,$=0;$>>26)|0,X+=le>>>26,le&=67108863}U.words[$]=ce,B=le,le=X}return B!==0?U.words[$]=B:U.length--,U.strip()}function b(O,P,U){var B=new v;return B.mulp(O,P,U)}s.prototype.mulTo=function(P,U){var B,X=this.length+P.length;return this.length===10&&P.length===10?B=M(this,P,U):X<63?B=A(this,P,U):X<1024?B=g(this,P,U):B=b(this,P,U),B};function v(O,P){this.x=O,this.y=P}v.prototype.makeRBT=function(P){for(var U=new Array(P),B=s.prototype._countBits(P)-1,X=0;X>=1;return X},v.prototype.permute=function(P,U,B,X,$,le){for(var ce=0;ce>>1)$++;return 1<<$+1+X},v.prototype.conjugate=function(P,U,B){if(!(B<=1))for(var X=0;X>>13,B[2*le+1]=$&8191,$=$>>>13;for(le=2*U;le>=26,U+=X/67108864|0,U+=$>>>26,this.words[B]=$&67108863}return U!==0&&(this.words[B]=U,this.length++),this.length=P===0?1:this.length,this},s.prototype.muln=function(P){return this.clone().imuln(P)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(P){var U=w(P);if(U.length===0)return new s(1);for(var B=this,X=0;X=0);var U=P%26,B=(P-U)/26,X=67108863>>>26-U<<26-U,$;if(U!==0){var le=0;for($=0;$>>26-U}le&&(this.words[$]=le,this.length++)}if(B!==0){for($=this.length-1;$>=0;$--)this.words[$+B]=this.words[$];for($=0;$=0);var X;U?X=(U-U%26)/26:X=0;var $=P%26,le=Math.min((P-$)/26,this.length),ce=67108863^67108863>>>$<<$,ve=B;if(X-=le,X=Math.max(0,X),ve){for(var G=0;Gle)for(this.length-=le,G=0;G=0&&(Y!==0||G>=X);G--){var ee=this.words[G]|0;this.words[G]=Y<<26-$|ee>>>$,Y=ee&ce}return ve&&Y!==0&&(ve.words[ve.length++]=Y),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(P,U,B){return i(this.negative===0),this.iushrn(P,U,B)},s.prototype.shln=function(P){return this.clone().ishln(P)},s.prototype.ushln=function(P){return this.clone().iushln(P)},s.prototype.shrn=function(P){return this.clone().ishrn(P)},s.prototype.ushrn=function(P){return this.clone().iushrn(P)},s.prototype.testn=function(P){i(typeof P=="number"&&P>=0);var U=P%26,B=(P-U)/26,X=1<=0);var U=P%26,B=(P-U)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=B)return this;if(U!==0&&B++,this.length=Math.min(B,this.length),U!==0){var X=67108863^67108863>>>U<=67108864;U++)this.words[U]-=67108864,U===this.length-1?this.words[U+1]=1:this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},s.prototype.isubn=function(P){if(i(typeof P=="number"),i(P<67108864),P<0)return this.iaddn(-P);if(this.negative!==0)return this.negative=0,this.iaddn(P),this.negative=1,this;if(this.words[0]-=P,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U>26)-(ve/67108864|0),this.words[$+B]=le&67108863}for(;$>26,this.words[$+B]=le&67108863;if(ce===0)return this.strip();for(i(ce===-1),ce=0,$=0;$>26,this.words[$]=le&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(P,U){var B=this.length-P.length,X=this.clone(),$=P,le=$.words[$.length-1]|0,ce=this._countBits(le);B=26-ce,B!==0&&($=$.ushln(B),X.iushln(B),le=$.words[$.length-1]|0);var ve=X.length-$.length,G;if(U!=="mod"){G=new s(null),G.length=ve+1,G.words=new Array(G.length);for(var Y=0;Y=0;V--){var se=(X.words[$.length+V]|0)*67108864+(X.words[$.length+V-1]|0);for(se=Math.min(se/le|0,67108863),X._ishlnsubmul($,se,V);X.negative!==0;)se--,X.negative=0,X._ishlnsubmul($,1,V),X.isZero()||(X.negative^=1);G&&(G.words[V]=se)}return G&&G.strip(),X.strip(),U!=="div"&&B!==0&&X.iushrn(B),{div:G||null,mod:X}},s.prototype.divmod=function(P,U,B){if(i(!P.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var X,$,le;return this.negative!==0&&P.negative===0?(le=this.neg().divmod(P,U),U!=="mod"&&(X=le.div.neg()),U!=="div"&&($=le.mod.neg(),B&&$.negative!==0&&$.iadd(P)),{div:X,mod:$}):this.negative===0&&P.negative!==0?(le=this.divmod(P.neg(),U),U!=="mod"&&(X=le.div.neg()),{div:X,mod:le.mod}):(this.negative&P.negative)!==0?(le=this.neg().divmod(P.neg(),U),U!=="div"&&($=le.mod.neg(),B&&$.negative!==0&&$.isub(P)),{div:le.div,mod:$}):P.length>this.length||this.cmp(P)<0?{div:new s(0),mod:this}:P.length===1?U==="div"?{div:this.divn(P.words[0]),mod:null}:U==="mod"?{div:null,mod:new s(this.modn(P.words[0]))}:{div:this.divn(P.words[0]),mod:new s(this.modn(P.words[0]))}:this._wordDiv(P,U)},s.prototype.div=function(P){return this.divmod(P,"div",!1).div},s.prototype.mod=function(P){return this.divmod(P,"mod",!1).mod},s.prototype.umod=function(P){return this.divmod(P,"mod",!0).mod},s.prototype.divRound=function(P){var U=this.divmod(P);if(U.mod.isZero())return U.div;var B=U.div.negative!==0?U.mod.isub(P):U.mod,X=P.ushrn(1),$=P.andln(1),le=B.cmp(X);return le<0||$===1&&le===0?U.div:U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},s.prototype.modn=function(P){i(P<=67108863);for(var U=(1<<26)%P,B=0,X=this.length-1;X>=0;X--)B=(U*B+(this.words[X]|0))%P;return B},s.prototype.idivn=function(P){i(P<=67108863);for(var U=0,B=this.length-1;B>=0;B--){var X=(this.words[B]|0)+U*67108864;this.words[B]=X/P|0,U=X%P}return this.strip()},s.prototype.divn=function(P){return this.clone().idivn(P)},s.prototype.egcd=function(P){i(P.negative===0),i(!P.isZero());var U=this,B=P.clone();U.negative!==0?U=U.umod(P):U=U.clone();for(var X=new s(1),$=new s(0),le=new s(0),ce=new s(1),ve=0;U.isEven()&&B.isEven();)U.iushrn(1),B.iushrn(1),++ve;for(var G=B.clone(),Y=U.clone();!U.isZero();){for(var ee=0,V=1;(U.words[0]&V)===0&&ee<26;++ee,V<<=1);if(ee>0)for(U.iushrn(ee);ee-- >0;)(X.isOdd()||$.isOdd())&&(X.iadd(G),$.isub(Y)),X.iushrn(1),$.iushrn(1);for(var se=0,ae=1;(B.words[0]&ae)===0&&se<26;++se,ae<<=1);if(se>0)for(B.iushrn(se);se-- >0;)(le.isOdd()||ce.isOdd())&&(le.iadd(G),ce.isub(Y)),le.iushrn(1),ce.iushrn(1);U.cmp(B)>=0?(U.isub(B),X.isub(le),$.isub(ce)):(B.isub(U),le.isub(X),ce.isub($))}return{a:le,b:ce,gcd:B.iushln(ve)}},s.prototype._invmp=function(P){i(P.negative===0),i(!P.isZero());var U=this,B=P.clone();U.negative!==0?U=U.umod(P):U=U.clone();for(var X=new s(1),$=new s(0),le=B.clone();U.cmpn(1)>0&&B.cmpn(1)>0;){for(var ce=0,ve=1;(U.words[0]&ve)===0&&ce<26;++ce,ve<<=1);if(ce>0)for(U.iushrn(ce);ce-- >0;)X.isOdd()&&X.iadd(le),X.iushrn(1);for(var G=0,Y=1;(B.words[0]&Y)===0&&G<26;++G,Y<<=1);if(G>0)for(B.iushrn(G);G-- >0;)$.isOdd()&&$.iadd(le),$.iushrn(1);U.cmp(B)>=0?(U.isub(B),X.isub($)):(B.isub(U),$.isub(X))}var ee;return U.cmpn(1)===0?ee=X:ee=$,ee.cmpn(0)<0&&ee.iadd(P),ee},s.prototype.gcd=function(P){if(this.isZero())return P.abs();if(P.isZero())return this.abs();var U=this.clone(),B=P.clone();U.negative=0,B.negative=0;for(var X=0;U.isEven()&&B.isEven();X++)U.iushrn(1),B.iushrn(1);do{for(;U.isEven();)U.iushrn(1);for(;B.isEven();)B.iushrn(1);var $=U.cmp(B);if($<0){var le=U;U=B,B=le}else if($===0||B.cmpn(1)===0)break;U.isub(B)}while(!0);return B.iushln(X)},s.prototype.invm=function(P){return this.egcd(P).a.umod(P)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(P){return this.words[0]&P},s.prototype.bincn=function(P){i(typeof P=="number");var U=P%26,B=(P-U)/26,X=1<>>26,ce&=67108863,this.words[le]=ce}return $!==0&&(this.words[le]=$,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(P){var U=P<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var B;if(this.length>1)B=1;else{U&&(P=-P),i(P<=67108863,"Number is too big");var X=this.words[0]|0;B=X===P?0:XP.length)return 1;if(this.length=0;B--){var X=this.words[B]|0,$=P.words[B]|0;if(X!==$){X<$?U=-1:X>$&&(U=1);break}}return U},s.prototype.gtn=function(P){return this.cmpn(P)===1},s.prototype.gt=function(P){return this.cmp(P)===1},s.prototype.gten=function(P){return this.cmpn(P)>=0},s.prototype.gte=function(P){return this.cmp(P)>=0},s.prototype.ltn=function(P){return this.cmpn(P)===-1},s.prototype.lt=function(P){return this.cmp(P)===-1},s.prototype.lten=function(P){return this.cmpn(P)<=0},s.prototype.lte=function(P){return this.cmp(P)<=0},s.prototype.eqn=function(P){return this.cmpn(P)===0},s.prototype.eq=function(P){return this.cmp(P)===0},s.red=function(P){return new F(P)},s.prototype.toRed=function(P){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),P.convertTo(this)._forceRed(P)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(P){return this.red=P,this},s.prototype.forceRed=function(P){return i(!this.red,"Already a number in reduction context"),this._forceRed(P)},s.prototype.redAdd=function(P){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,P)},s.prototype.redIAdd=function(P){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,P)},s.prototype.redSub=function(P){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,P)},s.prototype.redISub=function(P){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,P)},s.prototype.redShl=function(P){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,P)},s.prototype.redMul=function(P){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.mul(this,P)},s.prototype.redIMul=function(P){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.imul(this,P)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(P){return i(this.red&&!P.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,P)};var u={k256:null,p224:null,p192:null,p25519:null};function y(O,P){this.name=O,this.p=new s(P,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var P=new s(null);return P.words=new Array(Math.ceil(this.n/13)),P},y.prototype.ireduce=function(P){var U=P,B;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),B=U.bitLength();while(B>this.n);var X=B0?U.isub(this.p):U.strip!==void 0?U.strip():U._strip(),U},y.prototype.split=function(P,U){P.iushrn(this.n,0,U)},y.prototype.imulK=function(P){return P.imul(this.k)};function m(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(m,y),m.prototype.split=function(P,U){for(var B=4194303,X=Math.min(P.length,9),$=0;$>>22,le=ce}le>>>=22,P.words[$-10]=le,le===0&&P.length>10?P.length-=10:P.length-=9},m.prototype.imulK=function(P){P.words[P.length]=0,P.words[P.length+1]=0,P.length+=2;for(var U=0,B=0;B>>=26,P.words[B]=$,U=X}return U!==0&&(P.words[P.length++]=U),P},s._prime=function(P){if(u[P])return u[P];var U;if(P==="k256")U=new m;else if(P==="p224")U=new R;else if(P==="p192")U=new L;else if(P==="p25519")U=new z;else throw new Error("Unknown prime "+P);return u[P]=U,U};function F(O){if(typeof O=="string"){var P=s._prime(O);this.m=P.p,this.prime=P}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(P){i(P.negative===0,"red works only with positives"),i(P.red,"red works only with red numbers")},F.prototype._verify2=function(P,U){i((P.negative|U.negative)===0,"red works only with positives"),i(P.red&&P.red===U.red,"red works only with red numbers")},F.prototype.imod=function(P){return this.prime?this.prime.ireduce(P)._forceRed(this):P.umod(this.m)._forceRed(this)},F.prototype.neg=function(P){return P.isZero()?P.clone():this.m.sub(P)._forceRed(this)},F.prototype.add=function(P,U){this._verify2(P,U);var B=P.add(U);return B.cmp(this.m)>=0&&B.isub(this.m),B._forceRed(this)},F.prototype.iadd=function(P,U){this._verify2(P,U);var B=P.iadd(U);return B.cmp(this.m)>=0&&B.isub(this.m),B},F.prototype.sub=function(P,U){this._verify2(P,U);var B=P.sub(U);return B.cmpn(0)<0&&B.iadd(this.m),B._forceRed(this)},F.prototype.isub=function(P,U){this._verify2(P,U);var B=P.isub(U);return B.cmpn(0)<0&&B.iadd(this.m),B},F.prototype.shl=function(P,U){return this._verify1(P),this.imod(P.ushln(U))},F.prototype.imul=function(P,U){return this._verify2(P,U),this.imod(P.imul(U))},F.prototype.mul=function(P,U){return this._verify2(P,U),this.imod(P.mul(U))},F.prototype.isqr=function(P){return this.imul(P,P.clone())},F.prototype.sqr=function(P){return this.mul(P,P)},F.prototype.sqrt=function(P){if(P.isZero())return P.clone();var U=this.m.andln(3);if(i(U%2===1),U===3){var B=this.m.add(new s(1)).iushrn(2);return this.pow(P,B)}for(var X=this.m.subn(1),$=0;!X.isZero()&&X.andln(1)===0;)$++,X.iushrn(1);i(!X.isZero());var le=new s(1).toRed(this),ce=le.redNeg(),ve=this.m.subn(1).iushrn(1),G=this.m.bitLength();for(G=new s(2*G*G).toRed(this);this.pow(G,ve).cmp(ce)!==0;)G.redIAdd(ce);for(var Y=this.pow(G,X),ee=this.pow(P,X.addn(1).iushrn(1)),V=this.pow(P,X),se=$;V.cmp(le)!==0;){for(var ae=V,j=0;ae.cmp(le)!==0;j++)ae=ae.redSqr();i(j=0;$--){for(var Y=U.words[$],ee=G-1;ee>=0;ee--){var V=Y>>ee&1;if(le!==X[0]&&(le=this.sqr(le)),V===0&&ce===0){ve=0;continue}ce<<=1,ce|=V,ve++,!(ve!==B&&($!==0||ee!==0))&&(le=this.mul(le,X[ce]),ve=0,ce=0)}G=26}return le},F.prototype.convertTo=function(P){var U=P.umod(this.m);return U===P?U.clone():U},F.prototype.convertFrom=function(P){var U=P.clone();return U.red=null,U},s.mont=function(P){return new N(P)};function N(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(N,F),N.prototype.convertTo=function(P){return this.imod(P.ushln(this.shift))},N.prototype.convertFrom=function(P){var U=this.imod(P.mul(this.rinv));return U.red=null,U},N.prototype.imul=function(P,U){if(P.isZero()||U.isZero())return P.words[0]=0,P.length=1,P;var B=P.imul(U),X=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=B.isub(X).iushrn(this.shift),le=$;return $.cmp(this.m)>=0?le=$.isub(this.m):$.cmpn(0)<0&&(le=$.iadd(this.m)),le._forceRed(this)},N.prototype.mul=function(P,U){if(P.isZero()||U.isZero())return new s(0)._forceRed(this);var B=P.mul(U),X=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=B.isub(X).iushrn(this.shift),le=$;return $.cmp(this.m)>=0?le=$.isub(this.m):$.cmpn(0)<0&&(le=$.iadd(this.m)),le._forceRed(this)},N.prototype.invm=function(P){var U=this.imod(P._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(e,this)}),6204:(function(e){"use strict";e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;o>>1;if(!(v<=0)){var u,y=o.mallocDouble(2*v*g),m=o.mallocInt32(g);if(g=s(_,v,y,m),g>0){if(v===1&&M)a.init(g),u=a.sweepComplete(v,A,0,g,y,m,0,g,y,m);else{var R=o.mallocDouble(2*v*b),L=o.mallocInt32(b);b=s(w,v,R,L),b>0&&(a.init(g+b),v===1?u=a.sweepBipartite(v,A,0,g,y,m,0,b,R,L):u=i(v,A,M,g,y,m,b,R,L),o.free(R),o.free(L))}o.free(y),o.free(m)}return u}}}var f;function p(_,w){f.push([_,w])}function c(_){return f=[],h(_,_,p,!0),f}function T(_,w){return f=[],h(_,w,p,!1),f}function l(_,w,A){switch(arguments.length){case 1:return c(_);case 2:return typeof w=="function"?h(_,_,w,!0):T(_,w);case 3:return h(_,w,A,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),2455:(function(e,t){"use strict";function r(){function i(h,f,p,c,T,l,_,w,A,M,g){for(var b=2*h,v=c,u=b*c;vA-w?i(h,f,p,c,T,l,_,w,A,M,g):n(h,f,p,c,T,l,_,w,A,M,g)}return s}function o(){function i(p,c,T,l,_,w,A,M,g,b,v){for(var u=2*p,y=l,m=u*l;y<_;++y,m+=u){var R=w[c+m],L=w[c+m+p],z=A[y];e:for(var F=M,N=u*M;Fb-g?l?i(p,c,T,_,w,A,M,g,b,v,u):n(p,c,T,_,w,A,M,g,b,v,u):l?s(p,c,T,_,w,A,M,g,b,v,u):h(p,c,T,_,w,A,M,g,b,v,u)}return f}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)}),7150:(function(e,t,r){"use strict";e.exports=O;var o=r(1888),a=r(8828),i=r(2455),n=i.partial,s=i.full,h=r(855),f=r(3545),p=r(8105),c=128,T=1<<22,l=1<<22,_=p("!(lo>=p0)&&!(p1>=hi)"),w=p("lo===p0"),A=p("lo0;){Y-=1;var se=Y*v,ae=m[se],j=m[se+1],Q=m[se+2],re=m[se+3],he=m[se+4],xe=m[se+5],Te=Y*u,Le=R[Te],Pe=R[Te+1],qe=xe&1,et=!!(xe&16),rt=$,$e=le,Ue=ve,fe=G;if(qe&&(rt=ve,$e=G,Ue=$,fe=le),!(xe&2&&(Q=A(P,ae,j,Q,rt,$e,Pe),j>=Q))&&!(xe&4&&(j=M(P,ae,j,Q,rt,$e,Le),j>=Q))){var ue=Q-j,ie=he-re;if(et){if(P*ue*(ue+ie)p&&T[b+f]>M;--g,b-=_){for(var v=b,u=b+_,y=0;y<_;++y,++v,++u){var m=T[v];T[v]=T[u],T[u]=m}var R=l[g];l[g]=l[g-1],l[g-1]=R}}function s(h,f,p,c,T,l){if(c<=p+1)return p;for(var _=p,w=c,A=c+p>>>1,M=2*h,g=A,b=T[M*A+f];_=R?(g=m,b=R):y>=z?(g=u,b=y):(g=L,b=z):R>=z?(g=m,b=R):z>=y?(g=u,b=y):(g=L,b=z);for(var O=M*(w-1),P=M*g,F=0;F=p0)&&!(p1>=hi)":f};function r(p){return t[p]}function o(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+u];if(R===A)if(v===m)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[m];w[m]=w[v],w[v++]=F}}return v}function a(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+u];if(RL;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[m];w[m]=w[v],w[v++]=F}}return v}function i(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+y];if(R<=A)if(v===m)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[m];w[m]=w[v],w[v++]=F}}return v}function n(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+y];if(R<=A)if(v===m)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[m];w[m]=w[v],w[v++]=F}}return v}function s(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+u],L=_[g+y];if(R<=A&&A<=L)if(v===m)v+=1,b+=M;else{for(var z=0;M>z;++z){var F=_[g+z];_[g+z]=_[b],_[b++]=F}var N=w[m];w[m]=w[v],w[v++]=N}}return v}function h(p,c,T,l,_,w,A){for(var M=2*p,g=M*T,b=g,v=T,u=c,y=p+c,m=T;l>m;++m,g+=M){var R=_[g+u],L=_[g+y];if(Rz;++z){var F=_[g+z];_[g+z]=_[b],_[b++]=F}var N=w[m];w[m]=w[v],w[v++]=N}}return v}function f(p,c,T,l,_,w,A,M){for(var g=2*p,b=g*T,v=b,u=T,y=c,m=p+c,R=T;l>R;++R,b+=g){var L=_[b+y],z=_[b+m];if(!(L>=A)&&!(M>=z))if(u===R)u+=1,v+=g;else{for(var F=0;g>F;++F){var N=_[b+F];_[b+F]=_[v],_[v++]=N}var O=w[R];w[R]=w[u],w[u++]=O}}return u}}),4192:(function(e){"use strict";e.exports=r;var t=32;function r(c,T){T<=4*t?o(0,T-1,c):p(0,T-1,c)}function o(c,T,l){for(var _=2*(c+1),w=c+1;w<=T;++w){for(var A=l[_++],M=l[_++],g=w,b=_-2;g-- >c;){var v=l[b-2],u=l[b-1];if(vl[T+1]:!0}function f(c,T,l,_){c*=2;var w=_[c];return w>1,g=M-_,b=M+_,v=w,u=g,y=M,m=b,R=A,L=c+1,z=T-1,F=0;h(v,u,l)&&(F=v,v=u,u=F),h(m,R,l)&&(F=m,m=R,R=F),h(v,y,l)&&(F=v,v=y,y=F),h(u,y,l)&&(F=u,u=y,y=F),h(v,m,l)&&(F=v,v=m,m=F),h(y,m,l)&&(F=y,y=m,m=F),h(u,R,l)&&(F=u,u=R,R=F),h(u,y,l)&&(F=u,u=y,y=F),h(m,R,l)&&(F=m,m=R,R=F);for(var N=l[2*u],O=l[2*u+1],P=l[2*m],U=l[2*m+1],B=2*v,X=2*y,$=2*R,le=2*w,ce=2*M,ve=2*A,G=0;G<2;++G){var Y=l[B+G],ee=l[X+G],V=l[$+G];l[le+G]=Y,l[ce+G]=ee,l[ve+G]=V}i(g,c,l),i(b,T,l);for(var se=L;se<=z;++se)if(f(se,N,O,l))se!==L&&a(se,L,l),++L;else if(!f(se,P,U,l))for(;;)if(f(z,P,U,l)){f(z,N,O,l)?(n(se,L,z,l),++L,--z):(a(se,z,l),--z);break}else{if(--z>>1;i(_,ee);for(var V=0,se=0,ce=0;ce=n)ae=ae-n|0,A(p,c,se--,ae);else if(ae>=0)A(h,f,V--,ae);else if(ae<=-n){ae=-ae-n|0;for(var j=0;j>>1;i(_,ee);for(var V=0,se=0,ae=0,ce=0;ce>1===_[2*ce+3]>>1&&(Q=2,ce+=1),j<0){for(var re=-(j>>1)-1,he=0;he>1)-1;Q===0?A(h,f,V--,re):Q===1?A(p,c,se--,re):Q===2&&A(T,l,ae--,re)}}}function v(y,m,R,L,z,F,N,O,P,U,B,X){var $=0,le=2*y,ce=m,ve=m+y,G=1,Y=1;L?Y=n:G=n;for(var ee=z;ee>>1;i(_,j);for(var Q=0,ee=0;ee=n?(he=!L,V-=n):(he=!!L,V-=1),he)M(h,f,Q++,V);else{var xe=X[V],Te=le*V,Le=B[Te+m+1],Pe=B[Te+m+1+y];e:for(var qe=0;qe>>1;i(_,V);for(var se=0,ve=0;ve=n)h[se++]=G-n;else{G-=1;var j=B[G],Q=$*G,re=U[Q+m+1],he=U[Q+m+1+y];e:for(var xe=0;xe=0;--xe)if(h[xe]===G){for(var qe=xe+1;qe0;){for(var w=f.pop(),T=f.pop(),A=-1,M=-1,l=c[T],b=1;b=0||(h.flip(T,w),i(s,h,f,A,T,M),i(s,h,f,T,M,A),i(s,h,f,M,w,A),i(s,h,f,w,A,M))}}}),5023:(function(e,t,r){"use strict";var o=r(2478);e.exports=f;function a(p,c,T,l,_,w,A){this.cells=p,this.neighbor=c,this.flags=l,this.constraint=T,this.active=_,this.next=w,this.boundary=A}var i=a.prototype;function n(p,c){return p[0]-c[0]||p[1]-c[1]||p[2]-c[2]}i.locate=(function(){var p=[0,0,0];return function(c,T,l){var _=c,w=T,A=l;return T0||A.length>0;){for(;w.length>0;){var u=w.pop();if(M[u]!==-_){M[u]=_;for(var y=g[u],m=0;m<3;++m){var R=v[3*u+m];R>=0&&M[R]===0&&(b[3*u+m]?A.push(R):(w.push(R),M[R]=_))}}}var L=A;A=w,w=L,A.length=0,_=-_}var z=h(g,M,c);return T?z.concat(l.boundary):z}}),8902:(function(e,t,r){"use strict";var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=A;function h(M,g,b,v,u){this.a=M,this.b=g,this.idx=b,this.lowerIds=v,this.upperIds=u}function f(M,g,b,v){this.a=M,this.b=g,this.type=b,this.idx=v}function p(M,g){var b=M.a[0]-g.a[0]||M.a[1]-g.a[1]||M.type-g.type;return b||M.type!==i&&(b=a(M.a,M.b,g.b),b)?b:M.idx-g.idx}function c(M,g){return a(M.a,M.b,g)}function T(M,g,b,v,u){for(var y=o.lt(g,v,c),m=o.gt(g,v,c),R=y;R1&&a(b[z[N-2]],b[z[N-1]],v)>0;)M.push([z[N-1],z[N-2],u]),N-=1;z.length=N,z.push(u);for(var F=L.upperIds,N=F.length;N>1&&a(b[F[N-2]],b[F[N-1]],v)<0;)M.push([F[N-2],F[N-1],u]),N-=1;F.length=N,F.push(u)}}function l(M,g){var b;return M.a[0]L[0]&&u.push(new f(L,R,s,y),new f(R,L,n,y))}u.sort(p);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new h([z,1],[z,0],-1,[],[],[],[])],N=[],y=0,O=u.length;y=0}})(),i.removeTriangle=function(h,f,p){var c=this.stars;n(c[h],f,p),n(c[f],p,h),n(c[p],h,f)},i.addTriangle=function(h,f,p){var c=this.stars;c[h].push(f,p),c[f].push(p,h),c[p].push(h,f)},i.opposite=function(h,f){for(var p=this.stars[f],c=1,T=p.length;c=0;--P){var Y=N[P];U=Y[0];var ee=z[U],V=ee[0],se=ee[1],ae=L[V],j=L[se];if((ae[0]-j[0]||ae[1]-j[1])<0){var Q=V;V=se,se=Q}ee[0]=V;var re=ee[1]=Y[1],he;for(O&&(he=ee[2]);P>0&&N[P-1][0]===U;){var Y=N[--P],xe=Y[1];O?z.push([re,xe,he]):z.push([re,xe]),re=xe}O?z.push([re,se,he]):z.push([re,se])}return B}function g(L,z,F){for(var N=z.length,O=new o(N),P=[],U=0;Uz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var N=0;N0||U.length>0}function R(L,z,F){var N;if(F){N=z;for(var O=new Array(z.length),P=0;PM+1)throw new Error(w+" map requires nshades to be at least size "+_.length);Array.isArray(f.alpha)?f.alpha.length!==2?g=[1,1]:g=f.alpha.slice():typeof f.alpha=="number"?g=[f.alpha,f.alpha]:g=[1,1],p=_.map(function(R){return Math.round(R.index*M)}),g[0]=Math.min(Math.max(g[0],0),1),g[1]=Math.min(Math.max(g[1],0),1);var v=_.map(function(R,L){var z=_[L].index,F=_[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=g[0]+(g[1]-g[0])*z),F}),u=[];for(b=0;b=0}function f(p,c,T,l){var _=o(c,T,l);if(_===0){var w=a(o(p,c,T)),A=a(o(p,c,l));if(w===A){if(w===0){var M=h(p,c,T),g=h(p,c,l);return M===g?0:M?1:-1}return 0}else{if(A===0)return w>0||h(p,c,l)?-1:1;if(w===0)return A>0||h(p,c,T)?1:-1}return a(A-w)}var b=o(p,c,T);if(b>0)return _>0&&o(p,c,l)>0?1:-1;if(b<0)return _>0||o(p,c,l)>0?1:-1;var v=o(p,c,l);return v>0||h(p,c,T)?1:-1}}),8572:(function(e){"use strict";e.exports=function(r){return r<0?-1:r>0?1:0}}),8507:(function(e){e.exports=o;var t=Math.min;function r(a,i){return a-i}function o(a,i){var n=a.length,s=a.length-i.length;if(s)return s;switch(n){case 0:return 0;case 1:return a[0]-i[0];case 2:return a[0]+a[1]-i[0]-i[1]||t(a[0],a[1])-t(i[0],i[1]);case 3:var h=a[0]+a[1],f=i[0]+i[1];if(s=h+a[2]-(f+i[2]),s)return s;var p=t(a[0],a[1]),c=t(i[0],i[1]);return t(p,a[2])-t(c,i[2])||t(p+a[2],h)-t(c+i[2],f);case 4:var T=a[0],l=a[1],_=a[2],w=a[3],A=i[0],M=i[1],g=i[2],b=i[3];return T+l+_+w-(A+M+g+b)||t(T,l,_,w)-t(A,M,g,b,A)||t(T+l,T+_,T+w,l+_,l+w,_+w)-t(A+M,A+g,A+b,M+g,M+b,g+b)||t(T+l+_,T+l+w,T+_+w,l+_+w)-t(A+M+g,A+M+b,A+g+b,M+g+b);default:for(var v=a.slice().sort(r),u=i.slice().sort(r),y=0;yr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}}),4750:(function(e,t,r){"use strict";e.exports=a;var o=r(3090);function a(i){var n=o(i),s=n.length;if(s<=2)return[];for(var h=new Array(s),f=n[s-1],p=0;p=f[A]&&(w+=1);l[_]=w}}return h}function s(h,f){try{return o(h,!0)}catch{var p=a(h);if(p.length<=f)return[];var c=i(h,p),T=o(c,!0);return n(T,p)}}}),4769:(function(e){"use strict";function t(o,a,i,n,s,h){var f=6*s*s-6*s,p=3*s*s-4*s+1,c=-6*s*s+6*s,T=3*s*s-2*s;if(o.length){h||(h=new Array(o.length));for(var l=o.length-1;l>=0;--l)h[l]=f*o[l]+p*a[l]+c*i[l]+T*n[l];return h}return f*o+p*a+c*i[l]+T*n}function r(o,a,i,n,s,h){var f=s-1,p=s*s,c=f*f,T=(1+2*s)*c,l=s*c,_=p*(3-2*s),w=p*f;if(o.length){h||(h=new Array(o.length));for(var A=o.length-1;A>=0;--A)h[A]=T*o[A]+l*a[A]+_*i[A]+w*n[A];return h}return T*o+l*a+_*i+w*n}e.exports=r,e.exports.derivative=t}),7642:(function(e,t,r){"use strict";var o=r(8954),a=r(1682);e.exports=h;function i(f,p){this.point=f,this.index=p}function n(f,p){for(var c=f.point,T=p.point,l=c.length,_=0;_=2)return!1;F[O]=P}return!0}):z=z.filter(function(F){for(var N=0;N<=T;++N){var O=y[F[N]];if(O<0)return!1;F[N]=O}return!0}),T&1)for(var w=0;w>>31},e.exports.exponent=function(_){var w=e.exports.hi(_);return(w<<1>>>21)-1023},e.exports.fraction=function(_){var w=e.exports.lo(_),A=e.exports.hi(_),M=A&(1<<20)-1;return A&2146435072&&(M+=1048576),[w,M]},e.exports.denormalized=function(_){var w=e.exports.hi(_);return!(w&2146435072)}}),1338:(function(e){"use strict";function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var h=new Array(s),f;if(n===a.length-1)for(f=0;f"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o}),3134:(function(e,t,r){"use strict";e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var h=0;h=T-1)for(var b=w.length-1,u=p-c[T-1],v=0;v=T-1)for(var g=w.length-1,b=p-c[T-1],v=0;v=0;--T)if(p[--c])return!1;return!0},s.jump=function(p){var c=this.lastT(),T=this.dimension;if(!(p0;--v)l.push(i(M[v-1],g[v-1],arguments[v])),_.push(0)}},s.push=function(p){var c=this.lastT(),T=this.dimension;if(!(p1e-6?1/A:0;this._time.push(p);for(var u=T;u>0;--u){var y=i(g[u-1],b[u-1],arguments[u]);l.push(y),_.push((y-l[w++])*v)}}},s.set=function(p){var c=this.dimension;if(!(p0;--M)T.push(i(w[M-1],A[M-1],arguments[M])),l.push(0)}},s.move=function(p){var c=this.lastT(),T=this.dimension;if(!(p<=c||arguments.length!==T+1)){var l=this._state,_=this._velocity,w=l.length-this.dimension,A=this.bounds,M=A[0],g=A[1],b=p-c,v=b>1e-6?1/b:0;this._time.push(p);for(var u=T;u>0;--u){var y=arguments[u];l.push(i(M[u-1],g[u-1],l[w++]+y)),_.push(y*v)}}},s.idle=function(p){var c=this.lastT();if(!(p=0;--v)l.push(i(M[v],g[v],l[w]+b*_[w])),_.push(0),w+=1}};function h(p){for(var c=new Array(p),T=0;T=0;--L){var u=y[L];m[L]<=0?y[L]=new o(u._color,u.key,u.value,y[L+1],u.right,u._count+1):y[L]=new o(u._color,u.key,u.value,u.left,y[L+1],u._count+1)}for(var L=y.length-1;L>1;--L){var z=y[L-1],u=y[L];if(z._color===r||u._color===r)break;var F=y[L-2];if(F.left===z)if(z.left===u){var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,y[L-2]=z,y[L-1]=u,n(F),n(z),L>=3){var O=y[L-3];O.left===F?O.left=z:O.right=z}break}}else{var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,y[L-2]=u,y[L-1]=z,n(F),n(z),n(u),L>=3){var O=y[L-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,y[L-2]=z,y[L-1]=u,n(F),n(z),L>=3){var O=y[L-3];O.right===F?O.right=z:O.left=z}break}}else{var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,y[L-2]=u,y[L-1]=z,n(F),n(z),n(u),L>=3){var O=y[L-3];O.right===F?O.right=u:O.left=u}break}}}return y[0]._color=r,new s(v,y[0])};function f(g,b){if(b.left){var v=f(g,b.left);if(v)return v}var v=g(b.key,b.value);if(v)return v;if(b.right)return f(g,b.right)}function p(g,b,v,u){var y=b(g,u.key);if(y<=0){if(u.left){var m=p(g,b,v,u.left);if(m)return m}var m=v(u.key,u.value);if(m)return m}if(u.right)return p(g,b,v,u.right)}function c(g,b,v,u,y){var m=v(g,y.key),R=v(b,y.key),L;if(m<=0&&(y.left&&(L=c(g,b,v,u,y.left),L)||R>0&&(L=u(y.key,y.value),L)))return L;if(R>0&&y.right)return c(g,b,v,u,y.right)}h.forEach=function(b,v,u){if(this.root)switch(arguments.length){case 1:return f(b,this.root);case 2:return p(v,this._compare,b,this.root);case 3:return this._compare(v,u)>=0?void 0:c(v,u,this._compare,b,this.root)}},Object.defineProperty(h,"begin",{get:function(){for(var g=[],b=this.root;b;)g.push(b),b=b.left;return new T(this,g)}}),Object.defineProperty(h,"end",{get:function(){for(var g=[],b=this.root;b;)g.push(b),b=b.right;return new T(this,g)}}),h.at=function(g){if(g<0)return new T(this,[]);for(var b=this.root,v=[];;){if(v.push(b),b.left){if(g=b.right._count)break;b=b.right}else break}return new T(this,[])},h.ge=function(g){for(var b=this._compare,v=this.root,u=[],y=0;v;){var m=b(g,v.key);u.push(v),m<=0&&(y=u.length),m<=0?v=v.left:v=v.right}return u.length=y,new T(this,u)},h.gt=function(g){for(var b=this._compare,v=this.root,u=[],y=0;v;){var m=b(g,v.key);u.push(v),m<0&&(y=u.length),m<0?v=v.left:v=v.right}return u.length=y,new T(this,u)},h.lt=function(g){for(var b=this._compare,v=this.root,u=[],y=0;v;){var m=b(g,v.key);u.push(v),m>0&&(y=u.length),m<=0?v=v.left:v=v.right}return u.length=y,new T(this,u)},h.le=function(g){for(var b=this._compare,v=this.root,u=[],y=0;v;){var m=b(g,v.key);u.push(v),m>=0&&(y=u.length),m<0?v=v.left:v=v.right}return u.length=y,new T(this,u)},h.find=function(g){for(var b=this._compare,v=this.root,u=[];v;){var y=b(g,v.key);if(u.push(v),y===0)return new T(this,u);y<=0?v=v.left:v=v.right}return new T(this,[])},h.remove=function(g){var b=this.find(g);return b?b.remove():this},h.get=function(g){for(var b=this._compare,v=this.root;v;){var u=b(g,v.key);if(u===0)return v.value;u<=0?v=v.left:v=v.right}};function T(g,b){this.tree=g,this._stack=b}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function _(g,b){g.key=b.key,g.value=b.value,g.left=b.left,g.right=b.right,g._color=b._color,g._count=b._count}function w(g){for(var b,v,u,y,m=g.length-1;m>=0;--m){if(b=g[m],m===0){b._color=r;return}if(v=g[m-1],v.left===b){if(u=v.right,u.right&&u.right._color===t){if(u=v.right=a(u),y=u.right=a(u.right),v.right=u.left,u.left=v,u.right=y,u._color=v._color,b._color=r,v._color=r,y._color=r,n(v),n(u),m>1){var R=g[m-2];R.left===v?R.left=u:R.right=u}g[m-1]=u;return}else if(u.left&&u.left._color===t){if(u=v.right=a(u),y=u.left=a(u.left),v.right=y.left,u.left=y.right,y.left=v,y.right=u,y._color=v._color,v._color=r,u._color=r,b._color=r,n(v),n(u),n(y),m>1){var R=g[m-2];R.left===v?R.left=y:R.right=y}g[m-1]=y;return}if(u._color===r)if(v._color===t){v._color=r,v.right=i(t,u);return}else{v.right=i(t,u);continue}else{if(u=a(u),v.right=u.left,u.left=v,u._color=v._color,v._color=t,n(v),n(u),m>1){var R=g[m-2];R.left===v?R.left=u:R.right=u}g[m-1]=u,g[m]=v,m+11){var R=g[m-2];R.right===v?R.right=u:R.left=u}g[m-1]=u;return}else if(u.right&&u.right._color===t){if(u=v.left=a(u),y=u.right=a(u.right),v.left=y.right,u.right=y.left,y.right=v,y.left=u,y._color=v._color,v._color=r,u._color=r,b._color=r,n(v),n(u),n(y),m>1){var R=g[m-2];R.right===v?R.right=y:R.left=y}g[m-1]=y;return}if(u._color===r)if(v._color===t){v._color=r,v.left=i(t,u);return}else{v.left=i(t,u);continue}else{if(u=a(u),v.left=u.right,u.right=v,u._color=v._color,v._color=t,n(v),n(u),m>1){var R=g[m-2];R.right===v?R.right=u:R.left=u}g[m-1]=u,g[m]=v,m+1=0;--u){var v=g[u];v.left===g[u+1]?b[u]=new o(v._color,v.key,v.value,b[u+1],v.right,v._count):b[u]=new o(v._color,v.key,v.value,v.left,b[u+1],v._count)}if(v=b[b.length-1],v.left&&v.right){var y=b.length;for(v=v.left;v.right;)b.push(v),v=v.right;var m=b[y-1];b.push(new o(v._color,m.key,m.value,v.left,v.right,v._count)),b[y-1].key=v.key,b[y-1].value=v.value;for(var u=b.length-2;u>=y;--u)v=b[u],b[u]=new o(v._color,v.key,v.value,v.left,b[u+1],v._count);b[y-1].left=b[y]}if(v=b[b.length-1],v._color===t){var R=b[b.length-2];R.left===v?R.left=null:R.right===v&&(R.right=null),b.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var g=0,b=this._stack;if(b.length===0){var v=this.tree.root;return v?v._count:0}else b[b.length-1].left&&(g=b[b.length-1].left._count);for(var u=b.length-2;u>=0;--u)b[u+1]===b[u].right&&(++g,b[u].left&&(g+=b[u].left._count));return g},enumerable:!0}),l.next=function(){var g=this._stack;if(g.length!==0){var b=g[g.length-1];if(b.right)for(b=b.right;b;)g.push(b),b=b.left;else for(g.pop();g.length>0&&g[g.length-1].right===b;)b=g[g.length-1],g.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var g=this._stack;if(g.length===0)return!1;if(g[g.length-1].right)return!0;for(var b=g.length-1;b>0;--b)if(g[b-1].left===g[b])return!0;return!1}}),l.update=function(g){var b=this._stack;if(b.length===0)throw new Error("Can't update empty node!");var v=new Array(b.length),u=b[b.length-1];v[v.length-1]=new o(u._color,u.key,g,u.left,u.right,u._count);for(var y=b.length-2;y>=0;--y)u=b[y],u.left===b[y+1]?v[y]=new o(u._color,u.key,u.value,v[y+1],u.right,u._count):v[y]=new o(u._color,u.key,u.value,u.left,v[y+1],u._count);return new s(this.tree._compare,v[0])},l.prev=function(){var g=this._stack;if(g.length!==0){var b=g[g.length-1];if(b.left)for(b=b.left;b;)g.push(b),b=b.right;else for(g.pop();g.length>0&&g[g.length-1].left===b;)b=g[g.length-1],g.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var g=this._stack;if(g.length===0)return!1;if(g[g.length-1].left)return!0;for(var b=g.length-1;b>0;--b)if(g[b-1].right===g[b])return!0;return!1}});function A(g,b){return gb?1:0}function M(g){return new s(g||A,null)}}),3837:(function(e,t,r){"use strict";e.exports=L;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=ArrayBuffer,p=DataView;function c(z){return f.isView(z)&&!(z instanceof p)}function T(z){return Array.isArray(z)||c(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function _(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var w=_.prototype;w.update=function(z){z=z||{};function F(V,se,ae){if(ae in z){var j=z[ae],Q=this[ae],re;(V?T(j)&&T(j[0]):T(j))?this[ae]=re=[se(j[0]),se(j[1]),se(j[2])]:this[ae]=re=[se(j),se(j),se(j)];for(var he=0;he<3;++he)if(re[he]!==Q[he])return!0}return!1}var N=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),P=F.bind(this,!1,String),U=F.bind(this,!0,function(V){if(T(V)){if(V.length===3)return[+V[0],+V[1],+V[2],1];if(V.length===4)return[+V[0],+V[1],+V[2],+V[3]]}return[0,0,0,1]}),B,X=!1,$=!1;if("bounds"in z)for(var le=z.bounds,ce=0;ce<2;++ce)for(var ve=0;ve<3;++ve)le[ce][ve]!==this.bounds[ce][ve]&&($=!0),this.bounds[ce][ve]=le[ce][ve];if("ticks"in z){B=z.ticks,X=!0,this.autoTicks=!1;for(var ce=0;ce<3;++ce)this.tickSpacing[ce]=0}else N("tickSpacing")&&(this.autoTicks=!0,$=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),$=!0,X=!0,this._firstInit=!1),$&&this.autoTicks&&(B=s.create(this.bounds,this.tickSpacing),X=!0),X){for(var ce=0;ce<3;++ce)B[ce].sort(function(se,ae){return se.x-ae.x});s.equal(B,this.ticks)?X=!1:this.ticks=B}O("tickEnable"),P("tickFont")&&(X=!0),P("tickFontStyle")&&(X=!0),P("tickFontWeight")&&(X=!0),P("tickFontVariant")&&(X=!0),N("tickSize"),N("tickAngle"),N("tickPad"),U("tickColor");var G=P("labels");P("labelFont")&&(G=!0),P("labelFontStyle")&&(G=!0),P("labelFontWeight")&&(G=!0),P("labelFontVariant")&&(G=!0),O("labelEnable"),N("labelSize"),N("labelPad"),U("labelColor"),O("lineEnable"),O("lineMirror"),N("lineWidth"),U("lineColor"),O("lineTickEnable"),O("lineTickMirror"),N("lineTickLength"),N("lineTickWidth"),U("lineTickColor"),O("gridEnable"),N("gridWidth"),U("gridColor"),O("zeroEnable"),U("zeroLineColor"),N("zeroLineWidth"),O("backgroundEnable"),U("backgroundColor");var Y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ee=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(G||X)&&this._text.update(this.bounds,this.labels,Y,this.ticks,ee):this._text=o(this.gl,this.bounds,this.labels,Y,this.ticks,ee),this._lines&&X&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function A(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new A,new A,new A];function g(z,F,N,O,P){for(var U=z.primalOffset,B=z.primalMinor,X=z.mirrorOffset,$=z.mirrorMinor,le=O[F],ce=0;ce<3;++ce)if(F!==ce){var ve=U,G=X,Y=B,ee=$;le&1<0?(Y[ce]=-1,ee[ce]=0):(Y[ce]=0,ee[ce]=1)}}var b=[0,0,0],v={model:h,view:h,projection:h,_ortho:!1};w.isOpaque=function(){return!0},w.isTransparent=function(){return!1},w.drawTransparent=function(z){};var u=0,y=[0,0,0],m=[0,0,0],R=[0,0,0];w.draw=function(z){z=z||v;for(var ae=this.gl,F=z.model||h,N=z.view||h,O=z.projection||h,P=this.bounds,U=z._ortho||!1,B=n(F,N,O,P,U),X=B.cubeEdges,$=B.axis,le=N[12],ce=N[13],ve=N[14],G=N[15],Y=U?2:1,ee=Y*this.pixelRatio*(O[3]*le+O[7]*ce+O[11]*ve+O[15]*G)/ae.drawingBufferHeight,V=0;V<3;++V)this.lastCubeProps.cubeEdges[V]=X[V],this.lastCubeProps.axis[V]=$[V];for(var se=M,V=0;V<3;++V)g(M[V],V,this.bounds,X,$);for(var ae=this.gl,j=b,V=0;V<3;++V)this.backgroundEnable[V]?j[V]=$[V]:j[V]=0;this._background.draw(F,N,O,P,j,this.backgroundColor),this._lines.bind(F,N,O,this);for(var V=0;V<3;++V){var Q=[0,0,0];$[V]>0?Q[V]=P[1][V]:Q[V]=P[0][V];for(var re=0;re<2;++re){var he=(V+1+re)%3,xe=(V+1+(re^1))%3;this.gridEnable[he]&&this._lines.drawGrid(he,xe,this.bounds,Q,this.gridColor[he],this.gridWidth[he]*this.pixelRatio)}for(var re=0;re<2;++re){var he=(V+1+re)%3,xe=(V+1+(re^1))%3;this.zeroEnable[xe]&&Math.min(P[0][xe],P[1][xe])<=0&&Math.max(P[0][xe],P[1][xe])>=0&&this._lines.drawZero(he,xe,this.bounds,Q,this.zeroLineColor[xe],this.zeroLineWidth[xe]*this.pixelRatio)}}for(var V=0;V<3;++V){this.lineEnable[V]&&this._lines.drawAxisLine(V,this.bounds,se[V].primalOffset,this.lineColor[V],this.lineWidth[V]*this.pixelRatio),this.lineMirror[V]&&this._lines.drawAxisLine(V,this.bounds,se[V].mirrorOffset,this.lineColor[V],this.lineWidth[V]*this.pixelRatio);for(var Te=l(y,se[V].primalMinor),Le=l(m,se[V].mirrorMinor),Pe=this.lineTickLength,re=0;re<3;++re){var qe=ee/F[5*re];Te[re]*=Pe[re]*qe,Le[re]*=Pe[re]*qe}this.lineTickEnable[V]&&this._lines.drawAxisTicks(V,se[V].primalOffset,Te,this.lineTickColor[V],this.lineTickWidth[V]*this.pixelRatio),this.lineTickMirror[V]&&this._lines.drawAxisTicks(V,se[V].mirrorOffset,Le,this.lineTickColor[V],this.lineTickWidth[V]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,N,O,this.pixelRatio);var et,rt=.5,$e,Ue;function fe(Xe){Ue=[0,0,0],Ue[Xe]=1}function ue(Xe,Tt,St){var zt=(Xe+1)%3,Ut=(Xe+2)%3,br=Tt[zt],hr=Tt[Ut],Or=St[zt],wr=St[Ut];if(br>0&&wr>0){fe(zt);return}else if(br>0&&wr<0){fe(zt);return}else if(br<0&&wr>0){fe(zt);return}else if(br<0&&wr<0){fe(zt);return}else if(hr>0&&Or>0){fe(Ut);return}else if(hr>0&&Or<0){fe(Ut);return}else if(hr<0&&Or>0){fe(Ut);return}else if(hr<0&&Or<0){fe(Ut);return}}for(var V=0;V<3;++V){for(var ie=se[V].primalMinor,Ee=se[V].mirrorMinor,We=l(R,se[V].primalOffset),re=0;re<3;++re)this.lineTickEnable[V]&&(We[re]+=ee*ie[re]*Math.max(this.lineTickLength[re],0)/F[5*re]);var Qe=[0,0,0];if(Qe[V]=1,this.tickEnable[V]){this.tickAngle[V]===-3600?(this.tickAngle[V]=0,this.tickAlign[V]="auto"):this.tickAlign[V]=-1,$e=1,et=[this.tickAlign[V],rt,$e],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]),Ue=[0,0,0],ue(V,ie,Ee);for(var re=0;re<3;++re)We[re]+=ee*ie[re]*this.tickPad[re]/F[5*re];this._text.drawTicks(V,this.tickSize[V],this.tickAngle[V],We,this.tickColor[V],Qe,Ue,et)}if(this.labelEnable[V]){$e=0,Ue=[0,0,0],this.labels[V].length>4&&(fe(V),$e=1),et=[this.labelAlign[V],rt,$e],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]);for(var re=0;re<3;++re)We[re]+=ee*ie[re]*this.labelPad[re]/F[5*re];We[V]+=.5*(P[0][V]+P[1][V]),this._text.drawLabel(V,this.labelSize[V],this.labelAngle[V],We,this.labelColor[V],[0,0,0],Ue,et)}}this._text.unbind()},w.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(z,F){var N=new _(z);return N.update(F),N}}),5304:(function(e,t,r){"use strict";e.exports=h;var o=r(2762),a=r(8116),i=r(1879).bg;function n(f,p,c,T){this.gl=f,this.buffer=p,this.vao=c,this.shader=T}var s=n.prototype;s.draw=function(f,p,c,T,l,_){for(var w=!1,A=0;A<3;++A)w=w||l[A];if(w){var M=this.gl;M.enable(M.POLYGON_OFFSET_FILL),M.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:f,view:p,projection:c,bounds:T,enable:l,colors:_},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),M.disable(M.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function h(f){for(var p=[],c=[],T=0,l=0;l<3;++l)for(var _=(l+1)%3,w=(l+2)%3,A=[0,0,0],M=[0,0,0],g=-1;g<=1;g+=2){c.push(T,T+2,T+1,T+1,T+2,T+3),A[l]=g,M[l]=g;for(var b=-1;b<=1;b+=2){A[_]=b;for(var v=-1;v<=1;v+=2)A[w]=v,p.push(A[0],A[1],A[2],M[0],M[1],M[2]),T+=1}var u=_;_=w,w=u}var y=o(f,new Float32Array(p)),m=o(f,new Uint16Array(c),f.ELEMENT_ARRAY_BUFFER),R=a(f,[{buffer:y,type:f.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:f.FLOAT,size:3,offset:12,stride:24}],m),L=i(f);return L.attributes.position.location=0,L.attributes.normal.location=1,new n(f,y,R,L)}}),6429:(function(e,t,r){"use strict";e.exports=g;var o=r(8828),a=r(6760),i=r(5202),n=r(3250),s=new Array(16),h=new Array(8),f=new Array(8),p=new Array(3),c=[0,0,0];(function(){for(var b=0;b<8;++b)h[b]=[1,1,1,1],f[b]=[1,1,1]})();function T(b,v,u){for(var y=0;y<4;++y){b[y]=u[12+y];for(var m=0;m<3;++m)b[y]+=v[m]*u[4*m+y]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function _(b){for(var v=0;v$&&(N|=1<$){N|=1<f[L][1])&&(se=L);for(var ae=-1,L=0;L<3;++L){var j=se^1<f[Q][0]&&(Q=j)}}var re=w;re[0]=re[1]=re[2]=0,re[o.log2(ae^se)]=se&ae,re[o.log2(se^Q)]=se&Q;var he=Q^7;he===N||he===V?(he=ae^7,re[o.log2(Q^he)]=he&Q):re[o.log2(ae^he)]=he&ae;for(var xe=A,Te=N,U=0;U<3;++U)Te&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +} +`]),h=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(c){return a(c,s,h,null,[{name:"position",type:"vec3"}])};var f=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),p=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);t.bg=function(c){return a(c,f,p,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),4935:(function(e,t,r){"use strict";e.exports=_;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},h=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var f=3;function p(w,A,M,g){this.gl=w,this.shader=A,this.buffer=M,this.vao=g,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var c=p.prototype,T=[0,0];c.bind=function(w,A,M,g){this.vao.bind(),this.shader.bind();var b=this.shader.uniforms;b.model=w,b.view=A,b.projection=M,b.pixelScale=g,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},c.unbind=function(){this.vao.unbind()},c.update=function(w,A,M,g,b){var v=[];function u(U,B,X,$,le,ce){var ve=[X.style,X.weight,X.variant,X.family].join("_"),G=h[ve];G||(G=h[ve]={});var Y=G[B];Y||(Y=G[B]=l(B,{triangles:!0,font:X.family,fontStyle:X.style,fontWeight:X.weight,fontVariant:X.variant,textAlign:"center",textBaseline:"middle",lineSpacing:le,styletags:ce}));for(var ee=($||12)/12,V=Y.positions,se=Y.cells,ae=0,j=se.length;ae=0;--re){var he=V[Q[re]];v.push(ee*he[0],-ee*he[1],U)}}for(var y=[0,0,0],m=[0,0,0],R=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},N=0;N<3;++N){R[N]=v.length/f|0,u(.5*(w[0][N]+w[1][N]),A[N],M[N],12,z,F),L[N]=(v.length/f|0)-R[N],y[N]=v.length/f|0;for(var O=0;O=0&&(f=s.length-h-1);var p=Math.pow(10,f),c=Math.round(i*n*p),T=c+"";if(T.indexOf("e")>=0)return T;var l=c/p,_=c%p;c<0?(l=-Math.ceil(l)|0,_=-_|0):(l=Math.floor(l)|0,_=_|0);var w=""+l;if(c<0&&(w="-"+w),f){for(var A=""+_;A.length=i[0][h];--c)f.push({x:c*n[h],text:r(n[h],c)});s.push(f)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var h=0;hw)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(_,g,M),w}function p(l,_){for(var w=o.malloc(l.length,_),A=l.length,M=0;M=0;--A){if(_[A]!==w)return!1;w*=l[A]}return!0}h.update=function(l,_){if(typeof _!="number"&&(_=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var w=l.dtype;if(n.indexOf(w)<0&&(w="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&w!=="uint16"?w="uint32":w="uint16"}if(w===l.dtype&&c(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=f(this.gl,this.type,this.length,this.usage,l.data,_):this.length=f(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),_);else{var M=o.malloc(l.size,w),g=i(M,l.shape);a.assign(g,l),_<0?this.length=f(this.gl,this.type,this.length,this.usage,M,_):this.length=f(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),_),o.free(M)}}else if(Array.isArray(l)){var b;this.type===this.gl.ELEMENT_ARRAY_BUFFER?b=p(l,"uint16"):b=p(l,"float32"),_<0?this.length=f(this.gl,this.type,this.length,this.usage,b,_):this.length=f(this.gl,this.type,this.length,this.usage,b.subarray(0,l.length),_),o.free(b)}else if(typeof l=="object"&&typeof l.length=="number")this.length=f(this.gl,this.type,this.length,this.usage,l,_);else if(typeof l=="number"||l===void 0){if(_>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,_,w,A){if(w=w||l.ARRAY_BUFFER,A=A||l.DYNAMIC_DRAW,w!==l.ARRAY_BUFFER&&w!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(A!==l.DYNAMIC_DRAW&&A!==l.STATIC_DRAW&&A!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var M=l.createBuffer(),g=new s(l,w,M,0,A);return g.update(_),g}e.exports=T}),6405:(function(e,t,r){"use strict";var o=r(2931);e.exports=function(i,n){var s=i.positions,h=i.vectors,f={positions:[],vertexIntensity:[],vertexIntensityBounds:i.vertexIntensityBounds,vectors:[],cells:[],coneOffset:i.coneOffset,colormap:i.colormap};if(i.positions.length===0)return n&&(n[0]=[0,0,0],n[1]=[0,0,0]),f;for(var p=0,c=1/0,T=-1/0,l=1/0,_=-1/0,w=1/0,A=-1/0,M=null,g=null,b=[],v=1/0,u=!1,y=i.coneSizemode==="raw",m=0;mp&&(p=o.length(L)),m&&!y){var z=2*o.distance(M,R)/(o.length(g)+o.length(L));z?(v=Math.min(v,z),u=!1):u=!0}u||(M=R,g=L),b.push(L)}var F=[c,l,w],N=[T,_,A];n&&(n[0]=F,n[1]=N),p===0&&(p=1);var O=1/p;isFinite(v)||(v=1),f.vectorScale=v;var P=i.coneSize||(y?1:.5);i.absoluteConeSize&&(P=i.absoluteConeSize*O),f.coneScale=P;for(var m=0,U=0;m=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(b){this.pickId=b};function _(b){for(var v=p({colormap:b,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),y=0;y<256;++y){for(var m=v[y],R=0;R<3;++R)u[4*y+R]=m[R];u[4*y+3]=m[3]*255}return f(u,[256,256,4],[4,0,1])}function w(b){for(var v=b.length,u=new Array(v),y=0;y0){var U=this.triShader;U.bind(),U.uniforms=z,this.triangleVAO.bind(),v.drawArrays(v.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(b){b=b||{};for(var v=this.gl,u=b.model||c,y=b.view||c,m=b.projection||c,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)R[0][L]=Math.max(R[0][L],this.clipBounds[0][L]),R[1][L]=Math.min(R[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(y),this._projection=[].slice.call(m),this._resolution=[v.drawingBufferWidth,v.drawingBufferHeight];var z={model:u,view:y,projection:m,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),v.drawArrays(v.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(b){if(!b||b.id!==this.pickId)return null;var v=b.value[0]+256*b.value[1]+65536*b.value[2],u=this.cells[v],y=this.positions[u[1]].slice(0,3),m={position:y,dataCoordinate:y,index:Math.floor(u[1]/48)};return this.traceType==="cone"?m.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(m.intensity=this.intensity[u[1]],m.velocity=this.vectors[u[1]].slice(0,3),m.divergence=this.vectors[u[1]][3],m.index=v),m},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function A(b,v){var u=o(b,v.meshShader.vertex,v.meshShader.fragment,null,v.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(b,v){var u=o(b,v.pickShader.vertex,v.pickShader.fragment,null,v.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function g(b,v,u){var y=u.shaders;arguments.length===1&&(v=b,b=v.gl);var m=A(b,y),R=M(b,y),L=n(b,f(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=b.LINEAR_MIPMAP_LINEAR,L.magFilter=b.LINEAR;var z=a(b),F=a(b),N=a(b),O=a(b),P=a(b),U=i(b,[{buffer:z,type:b.FLOAT,size:4},{buffer:P,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:N,type:b.FLOAT,size:4},{buffer:O,type:b.FLOAT,size:2},{buffer:F,type:b.FLOAT,size:4}]),B=new T(b,L,m,R,z,F,P,N,O,U,u.traceType||"cone");return B.update(v),B}e.exports=g}),614:(function(e,t,r){var o=r(3236),a=o([`precision highp float; precision highp float; #define GLSLIFY 1 @@ -422,40 +639,243 @@ void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; gl_FragColor = vec4(pickId, f_id.xyz); -}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}}),620:(function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]}),665:(function(e,t,r){"use strict";var o=r(3202);e.exports=s;var a=96;function i(h,c){var m=o(getComputedStyle(h).getPropertyValue(c));return m[0]*s(m[1],h)}function n(h,c){var m=document.createElement("div");m.style["font-size"]="128"+h,c.appendChild(m);var p=i(m,"font-size")/128;return c.removeChild(m),p}function s(h,c){switch(c=c||document.body,h=(h||"px").trim().toLowerCase(),(c===window||c===document)&&(c=document.body),h){case"%":return c.clientHeight/100;case"ch":case"ex":return n(h,c);case"em":return i(c,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return a;case"cm":return a/2.54;case"mm":return a/25.4;case"pt":return a/72;case"pc":return a/6}return 1}}),727:(function(e,t,r){"use strict";var o=r(2962),a=6;function i(S){var M=S===2?h:S===3?c:S===4?m:S===5?p:T;return S<6?M(o[S]):M(o)}function n(){return[[0]]}function s(S,M){return[[M[0]],[S[0][0]]]}function h(S){return function(y,b){return[S([[+b[0],+y[0][1]],[+b[1],+y[1][1]]]),S([[+y[0][0],+b[0]],[+y[1][0],+b[1]]]),S(y)]}}function c(S){return function(y,b){return[S([[+b[0],+y[0][1],+y[0][2]],[+b[1],+y[1][1],+y[1][2]],[+b[2],+y[2][1],+y[2][2]]]),S([[+y[0][0],+b[0],+y[0][2]],[+y[1][0],+b[1],+y[1][2]],[+y[2][0],+b[2],+y[2][2]]]),S([[+y[0][0],+y[0][1],+b[0]],[+y[1][0],+y[1][1],+b[1]],[+y[2][0],+y[2][1],+b[2]]]),S(y)]}}function m(S){return function(y,b){return[S([[+b[0],+y[0][1],+y[0][2],+y[0][3]],[+b[1],+y[1][1],+y[1][2],+y[1][3]],[+b[2],+y[2][1],+y[2][2],+y[2][3]],[+b[3],+y[3][1],+y[3][2],+y[3][3]]]),S([[+y[0][0],+b[0],+y[0][2],+y[0][3]],[+y[1][0],+b[1],+y[1][2],+y[1][3]],[+y[2][0],+b[2],+y[2][2],+y[2][3]],[+y[3][0],+b[3],+y[3][2],+y[3][3]]]),S([[+y[0][0],+y[0][1],+b[0],+y[0][3]],[+y[1][0],+y[1][1],+b[1],+y[1][3]],[+y[2][0],+y[2][1],+b[2],+y[2][3]],[+y[3][0],+y[3][1],+b[3],+y[3][3]]]),S([[+y[0][0],+y[0][1],+y[0][2],+b[0]],[+y[1][0],+y[1][1],+y[1][2],+b[1]],[+y[2][0],+y[2][1],+y[2][2],+b[2]],[+y[3][0],+y[3][1],+y[3][2],+b[3]]]),S(y)]}}function p(S){return function(y,b){return[S([[+b[0],+y[0][1],+y[0][2],+y[0][3],+y[0][4]],[+b[1],+y[1][1],+y[1][2],+y[1][3],+y[1][4]],[+b[2],+y[2][1],+y[2][2],+y[2][3],+y[2][4]],[+b[3],+y[3][1],+y[3][2],+y[3][3],+y[3][4]],[+b[4],+y[4][1],+y[4][2],+y[4][3],+y[4][4]]]),S([[+y[0][0],+b[0],+y[0][2],+y[0][3],+y[0][4]],[+y[1][0],+b[1],+y[1][2],+y[1][3],+y[1][4]],[+y[2][0],+b[2],+y[2][2],+y[2][3],+y[2][4]],[+y[3][0],+b[3],+y[3][2],+y[3][3],+y[3][4]],[+y[4][0],+b[4],+y[4][2],+y[4][3],+y[4][4]]]),S([[+y[0][0],+y[0][1],+b[0],+y[0][3],+y[0][4]],[+y[1][0],+y[1][1],+b[1],+y[1][3],+y[1][4]],[+y[2][0],+y[2][1],+b[2],+y[2][3],+y[2][4]],[+y[3][0],+y[3][1],+b[3],+y[3][3],+y[3][4]],[+y[4][0],+y[4][1],+b[4],+y[4][3],+y[4][4]]]),S([[+y[0][0],+y[0][1],+y[0][2],+b[0],+y[0][4]],[+y[1][0],+y[1][1],+y[1][2],+b[1],+y[1][4]],[+y[2][0],+y[2][1],+y[2][2],+b[2],+y[2][4]],[+y[3][0],+y[3][1],+y[3][2],+b[3],+y[3][4]],[+y[4][0],+y[4][1],+y[4][2],+b[4],+y[4][4]]]),S([[+y[0][0],+y[0][1],+y[0][2],+y[0][3],+b[0]],[+y[1][0],+y[1][1],+y[1][2],+y[1][3],+b[1]],[+y[2][0],+y[2][1],+y[2][2],+y[2][3],+b[2]],[+y[3][0],+y[3][1],+y[3][2],+y[3][3],+b[3]],[+y[4][0],+y[4][1],+y[4][2],+y[4][3],+b[4]]]),S(y)]}}function T(S){return function(y,b){return[S([[+b[0],+y[0][1],+y[0][2],+y[0][3],+y[0][4],+y[0][5]],[+b[1],+y[1][1],+y[1][2],+y[1][3],+y[1][4],+y[1][5]],[+b[2],+y[2][1],+y[2][2],+y[2][3],+y[2][4],+y[2][5]],[+b[3],+y[3][1],+y[3][2],+y[3][3],+y[3][4],+y[3][5]],[+b[4],+y[4][1],+y[4][2],+y[4][3],+y[4][4],+y[4][5]],[+b[5],+y[5][1],+y[5][2],+y[5][3],+y[5][4],+y[5][5]]]),S([[+y[0][0],+b[0],+y[0][2],+y[0][3],+y[0][4],+y[0][5]],[+y[1][0],+b[1],+y[1][2],+y[1][3],+y[1][4],+y[1][5]],[+y[2][0],+b[2],+y[2][2],+y[2][3],+y[2][4],+y[2][5]],[+y[3][0],+b[3],+y[3][2],+y[3][3],+y[3][4],+y[3][5]],[+y[4][0],+b[4],+y[4][2],+y[4][3],+y[4][4],+y[4][5]],[+y[5][0],+b[5],+y[5][2],+y[5][3],+y[5][4],+y[5][5]]]),S([[+y[0][0],+y[0][1],+b[0],+y[0][3],+y[0][4],+y[0][5]],[+y[1][0],+y[1][1],+b[1],+y[1][3],+y[1][4],+y[1][5]],[+y[2][0],+y[2][1],+b[2],+y[2][3],+y[2][4],+y[2][5]],[+y[3][0],+y[3][1],+b[3],+y[3][3],+y[3][4],+y[3][5]],[+y[4][0],+y[4][1],+b[4],+y[4][3],+y[4][4],+y[4][5]],[+y[5][0],+y[5][1],+b[5],+y[5][3],+y[5][4],+y[5][5]]]),S([[+y[0][0],+y[0][1],+y[0][2],+b[0],+y[0][4],+y[0][5]],[+y[1][0],+y[1][1],+y[1][2],+b[1],+y[1][4],+y[1][5]],[+y[2][0],+y[2][1],+y[2][2],+b[2],+y[2][4],+y[2][5]],[+y[3][0],+y[3][1],+y[3][2],+b[3],+y[3][4],+y[3][5]],[+y[4][0],+y[4][1],+y[4][2],+b[4],+y[4][4],+y[4][5]],[+y[5][0],+y[5][1],+y[5][2],+b[5],+y[5][4],+y[5][5]]]),S([[+y[0][0],+y[0][1],+y[0][2],+y[0][3],+b[0],+y[0][5]],[+y[1][0],+y[1][1],+y[1][2],+y[1][3],+b[1],+y[1][5]],[+y[2][0],+y[2][1],+y[2][2],+y[2][3],+b[2],+y[2][5]],[+y[3][0],+y[3][1],+y[3][2],+y[3][3],+b[3],+y[3][5]],[+y[4][0],+y[4][1],+y[4][2],+y[4][3],+b[4],+y[4][5]],[+y[5][0],+y[5][1],+y[5][2],+y[5][3],+b[5],+y[5][5]]]),S([[+y[0][0],+y[0][1],+y[0][2],+y[0][3],+y[0][4],+b[0]],[+y[1][0],+y[1][1],+y[1][2],+y[1][3],+y[1][4],+b[1]],[+y[2][0],+y[2][1],+y[2][2],+y[2][3],+y[2][4],+b[2]],[+y[3][0],+y[3][1],+y[3][2],+y[3][3],+y[3][4],+b[3]],[+y[4][0],+y[4][1],+y[4][2],+y[4][3],+y[4][4],+b[4]],[+y[5][0],+y[5][1],+y[5][2],+y[5][3],+y[5][4],+b[5]]]),S(y)]}}var l=[n,s];function _(S,M,y,b,v,u,g,f){return function(L,z){switch(L.length){case 0:return S(L,z);case 1:return M(L,z);case 2:return y(L,z);case 3:return b(L,z);case 4:return v(L,z);case 5:return u(L,z)}var F=g[L.length];return F||(F=g[L.length]=f(L.length)),F(L,z)}}function w(){for(;l.length1e-6?(_=Math.acos(w),S=Math.sin(_),M=Math.sin((1-i)*_)/S,y=Math.sin(i*_)/S):(M=1-i,y=i),r[0]=M*n+y*m,r[1]=M*s+y*p,r[2]=M*h+y*T,r[3]=M*c+y*l,r}}),799:(function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; -#define GLSLIFY 1 -attribute vec2 position; -varying vec2 uv; -void main() { - uv = position; - gl_Position = vec4(position, 0, 1); -}`]),n=o([`precision mediump float; +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}}),737:(function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}}),5171:(function(e,t,r){var o=r(737);e.exports=function(i){return o[i]}}),9165:(function(e,t,r){"use strict";e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,_,w,A){this.gl=l,this.shader=A,this.buffer=_,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var h=s.prototype;h.isOpaque=function(){return!this.hasAlpha},h.isTransparent=function(){return this.hasAlpha},h.drawTransparent=h.draw=function(l){var _=this.gl,w=this.shader.uniforms;this.shader.bind();var A=w.view=l.view||n,M=w.projection=l.projection||n;w.model=l.model||n,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var g=A[12],b=A[13],v=A[14],u=A[15],y=l._ortho||!1,m=y?2:1,R=m*this.pixelRatio*(M[3]*g+M[7]*b+M[11]*v+M[15]*u)/_.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)_.lineWidth(this.lineWidth[L]*this.pixelRatio),w.capSize=this.capSize[L]*R,this.lineCount[L]&&_.drawArrays(_.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function f(l,_){for(var w=0;w<3;++w)l[0][w]=Math.min(l[0][w],_[w]),l[1][w]=Math.max(l[1][w],_[w])}var p=(function(){for(var l=new Array(3),_=0;_<3;++_){for(var w=[],A=1;A<=2;++A)for(var M=-1;M<=1;M+=2){var g=(A+_)%3,b=[0,0,0];b[g]=M,w.push(b)}l[_]=w}return l})();function c(l,_,w,A){for(var M=p[A],g=0;g0){var z=y.slice();z[v]+=R[1][v],M.push(y[0],y[1],y[2],L[0],L[1],L[2],L[3],0,0,0,z[0],z[1],z[2],L[0],L[1],L[2],L[3],0,0,0),f(this.bounds,z),b+=2+c(M,z,L,v)}}}this.lineCount[v]=b-this.lineOffset[v]}this.buffer.update(M)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var _=l.gl,w=o(_),A=a(_,[{buffer:w,type:_.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:_.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:_.FLOAT,size:3,offset:28,stride:40}]),M=i(_);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var g=new s(_,w,A,M);return g.update(l),g}}),3436:(function(e,t,r){"use strict";var o=r(3236),a=r(9405),i=o([`precision highp float; #define GLSLIFY 1 -uniform sampler2D accumBuffer; -varying vec2 uv; +attribute vec3 position, offset; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; void main() { - vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); - gl_FragColor = min(vec4(1,1,1,1), accum); -}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}}),811:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r}}),840:(function(e,t,r){var o=r(3236),a=o([`precision highp float; + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),n=o([`precision highp float; #define GLSLIFY 1 -attribute vec3 position, normal; -attribute vec4 color; -attribute vec2 uv; +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} -uniform mat4 model - , view - , projection - , inverseModel; -uniform vec3 eyePosition - , lightPosition; +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} -varying vec3 f_normal - , f_lightDirection - , f_eyeDirection - , f_data; +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) discard; + + gl_FragColor = opacity * fragColor; +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}}),2260:(function(e,t,r){"use strict";var o=r(7766);e.exports=b;var a=null,i,n,s,h;function f(v){var u=v.getParameter(v.FRAMEBUFFER_BINDING),y=v.getParameter(v.RENDERBUFFER_BINDING),m=v.getParameter(v.TEXTURE_BINDING_2D);return[u,y,m]}function p(v,u){v.bindFramebuffer(v.FRAMEBUFFER,u[0]),v.bindRenderbuffer(v.RENDERBUFFER,u[1]),v.bindTexture(v.TEXTURE_2D,u[2])}function c(v,u){var y=v.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(y+1);for(var m=0;m<=y;++m){for(var R=new Array(y),L=0;L1&&F.drawBuffersWEBGL(a[z]);var B=y.getExtension("WEBGL_depth_texture");B?N?v.depth=l(y,R,L,B.UNSIGNED_INT_24_8_WEBGL,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O&&(v.depth=l(y,R,L,y.UNSIGNED_SHORT,y.DEPTH_COMPONENT,y.DEPTH_ATTACHMENT)):O&&N?v._depth_rb=_(y,R,L,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O?v._depth_rb=_(y,R,L,y.DEPTH_COMPONENT16,y.DEPTH_ATTACHMENT):N&&(v._depth_rb=_(y,R,L,y.STENCIL_INDEX,y.STENCIL_ATTACHMENT));var X=y.checkFramebufferStatus(y.FRAMEBUFFER);if(X!==y.FRAMEBUFFER_COMPLETE){v._destroyed=!0,y.bindFramebuffer(y.FRAMEBUFFER,null),y.deleteFramebuffer(v.handle),v.handle=null,v.depth&&(v.depth.dispose(),v.depth=null),v._depth_rb&&(y.deleteRenderbuffer(v._depth_rb),v._depth_rb=null);for(var U=0;UR||y<0||y>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");v._shape[0]=u,v._shape[1]=y;for(var L=f(m),z=0;zL||y<0||y>L)throw new Error("gl-fbo: Parameters are too large for FBO");m=m||{};var z=1;if("color"in m){if(z=Math.max(m.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(R){if(z>v.getParameter(R.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=v.UNSIGNED_BYTE,N=v.getExtension("OES_texture_float");if(m.float&&z>0){if(!N)throw new Error("gl-fbo: Context does not support floating point textures");F=v.FLOAT}else m.preferFloat&&z>0&&N&&(F=v.FLOAT);var O=!0;"depth"in m&&(O=!!m.depth);var P=!1;return"stencil"in m&&(P=!!m.stencil),new A(v,u,y,F,z,O,P,R)}}),2992:(function(e,t,r){var o=r(3387).sprintf,a=r(5171),i=r(1848),n=r(1085);e.exports=s;function s(h,f,p){"use strict";var c=i(f)||"of unknown name (see npm glsl-shader-name)",T="unknown type";p!==void 0&&(T=p===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=o(`Error compiling %s shader %s: +`,T,c),_=o("%s%s",l,h),w=h.split(` +`),A={},M=0;M max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(f){return a(f,i,n,null,h)},t.createPickShader=function(f){return a(f,i,s,null,h)}}),5714:(function(e,t,r){"use strict";e.exports=v;var o=r(2762),a=r(8116),i=r(7766),n=new Uint8Array(4),s=new Float32Array(n.buffer);function h(u,y,m,R){return n[0]=R,n[1]=m,n[2]=y,n[3]=u,s[0]}var f=r(2478),p=r(9618),c=r(7319),T=c.createShader,l=c.createPickShader,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(u,y){for(var m=0,R=0;R<3;++R){var L=u[R]-y[R];m+=L*L}return Math.sqrt(m)}function A(u){for(var y=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],m=0;m<3;++m)y[0][m]=Math.max(u[0][m],y[0][m]),y[1][m]=Math.min(u[1][m],y[1][m]);return y}function M(u,y,m,R){this.arcLength=u,this.position=y,this.index=m,this.dataCoordinate=R}function g(u,y,m,R,L,z){this.gl=u,this.shader=y,this.pickShader=m,this.buffer=R,this.vao=L,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var b=g.prototype;b.isTransparent=function(){return this.hasAlpha},b.isOpaque=function(){return!this.hasAlpha},b.pickSlots=1,b.setPickBase=function(u){this.pickId=u},b.drawTransparent=b.draw=function(u){if(this.vertexCount){var y=this.gl,m=this.shader,R=this.vao;m.bind(),m.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,clipBounds:A(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(y.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},b.drawPick=function(u){if(this.vertexCount){var y=this.gl,m=this.pickShader,R=this.vao;m.bind(),m.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,pickId:this.pickId,clipBounds:A(this.clipBounds),screenShape:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(y.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},b.update=function(u){var y,m;this.dirty=!0;var R=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var L=[],z=[],F=[],N=0,O=0,P=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],U=u.position||u.positions;if(U){var B=u.color||u.colors||[0,0,0,1],X=u.lineWidth||1,$=!1;e:for(y=1;y0){for(var ve=0;ve<24;++ve)L.push(L[L.length-12]);O+=2,$=!0}continue e}P[0][m]=Math.min(P[0][m],le[m],ce[m]),P[1][m]=Math.max(P[1][m],le[m],ce[m])}var G,Y;Array.isArray(B[0])?(G=B.length>y-1?B[y-1]:B.length>0?B[B.length-1]:[0,0,0,1],Y=B.length>y?B[y]:B.length>0?B[B.length-1]:[0,0,0,1]):G=Y=B,G.length===3&&(G=[G[0],G[1],G[2],1]),Y.length===3&&(Y=[Y[0],Y[1],Y[2],1]),!this.hasAlpha&&G[3]<1&&(this.hasAlpha=!0);var ee;Array.isArray(X)?ee=X.length>y-1?X[y-1]:X.length>0?X[X.length-1]:[0,0,0,1]:ee=X;var V=N;if(N+=w(le,ce),$){for(m=0;m<2;++m)L.push(le[0],le[1],le[2],ce[0],ce[1],ce[2],V,ee,G[0],G[1],G[2],G[3]);O+=2,$=!1}L.push(le[0],le[1],le[2],ce[0],ce[1],ce[2],V,ee,G[0],G[1],G[2],G[3],le[0],le[1],le[2],ce[0],ce[1],ce[2],V,-ee,G[0],G[1],G[2],G[3],ce[0],ce[1],ce[2],le[0],le[1],le[2],N,-ee,Y[0],Y[1],Y[2],Y[3],ce[0],ce[1],ce[2],le[0],le[1],le[2],N,ee,Y[0],Y[1],Y[2],Y[3]),O+=4}}if(this.buffer.update(L),z.push(N),F.push(U[U.length-1].slice()),this.bounds=P,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var se=u.dashes,ae=se.slice();for(ae.unshift(0),y=1;y1.0001)return null;m+=y[M]}return Math.abs(m-1)>.001?null:[g,h(p,y),y]}}),840:(function(e,t,r){var o=r(3236),a=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; varying vec4 f_color; varying vec2 f_uv; @@ -679,7 +1099,7 @@ void main() { gl_PointSize = pointSize; f_color = color; f_uv = uv; -}`]),c=o([`precision highp float; +}`]),f=o([`precision highp float; #define GLSLIFY 1 uniform sampler2D texture; @@ -694,7 +1114,7 @@ void main() { discard; } gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; -}`]),m=o([`precision highp float; +}`]),p=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position; @@ -709,7 +1129,7 @@ void main() { gl_Position = projection * (view * (model * vec4(position, 1.0))); f_id = id; f_position = position; -}`]),p=o([`precision highp float; +}`]),c=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { @@ -802,222 +1222,33 @@ uniform vec3 contourColor; void main() { gl_FragColor = vec4(contourColor, 1.0); } -`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:h,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:m,fragment:p,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:p,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:_,attributes:[{name:"position",type:"vec3"}]}}),855:(function(e,t,r){"use strict";e.exports={init:w,sweepBipartite:y,sweepComplete:b,scanBipartite:v,scanComplete:u};var o=r(1888),a=r(8828),i=r(4192),n=1<<28,s=1024,h=o.mallocInt32(s),c=o.mallocInt32(s),m=o.mallocInt32(s),p=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),_=o.mallocDouble(s*8);function w(g){var f=a.nextPow2(g);h.length>>1;i(_,J);for(var X=0,oe=0,se=0;se=n)ne=ne-n|0,S(m,p,oe--,ne);else if(ne>=0)S(h,c,X--,ne);else if(ne<=-n){ne=-ne-n|0;for(var j=0;j>>1;i(_,J);for(var X=0,oe=0,ne=0,se=0;se>1===_[2*se+3]>>1&&(ee=2,se+=1),j<0){for(var re=-(j>>1)-1,ue=0;ue>1)-1;ee===0?S(h,c,X--,re):ee===1?S(m,p,oe--,re):ee===2&&S(T,l,ne--,re)}}}function v(g,f,P,L,z,F,B,O,I,N,U,W){var Q=0,le=2*g,se=f,he=f+g,q=1,$=1;L?$=n:q=n;for(var J=z;J>>1;i(_,j);for(var ee=0,J=0;J=n?(ue=!L,X-=n):(ue=!!L,X-=1),ue)M(h,c,ee++,X);else{var _e=W[X],Te=le*X,Ie=U[Te+f+1],De=U[Te+f+1+g];e:for(var He=0;He>>1;i(_,X);for(var oe=0,he=0;he=n)h[oe++]=q-n;else{q-=1;var j=U[q],ee=Q*q,re=N[ee+f+1],ue=N[ee+f+1+g];e:for(var _e=0;_e=0;--_e)if(h[_e]===q){for(var He=_e+1;Heve&&Y>0){var ee=(G[Y][0]-ve)/(G[Y][0]-G[Y-1][0]);return G[Y][1]*(1-ee)+ee*G[Y-1][1]}}return 1}function N(ve,G){for(var Y=l({colormap:ve,nshades:256,format:"rgba"}),ee=new Uint8Array(256*4),V=0;V<256;++V){for(var se=Y[V],ae=0;ae<3;++ae)ee[4*V+ae]=se[ae];G?ee[4*V+3]=255*F(V/255,G):ee[4*V+3]=255*se[3]}return T(ee,[256,256,4],[4,0,1])}function O(ve){for(var G=ve.length,Y=new Array(G),ee=0;ee0){var Te=this.triShader;Te.bind(),Te.uniforms=j,this.triangleVAO.bind(),G.drawArrays(G.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Te=this.lineShader;Te.bind(),Te.uniforms=j,this.edgeVAO.bind(),G.lineWidth(this.lineWidth*this.pixelRatio),G.drawArrays(G.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Te=this.pointShader;Te.bind(),Te.uniforms=j,this.pointVAO.bind(),G.drawArrays(G.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Te=this.contourShader;Te.bind(),Te.uniforms=j,this.contourVAO.bind(),G.drawArrays(G.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(ve){ve=ve||{};for(var G=this.gl,Y=ve.model||R,ee=ve.view||R,V=ve.projection||R,se=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ae=0;ae<3;++ae)se[0][ae]=Math.max(se[0][ae],this.clipBounds[0][ae]),se[1][ae]=Math.min(se[1][ae],this.clipBounds[1][ae]);this._model=[].slice.call(Y),this._view=[].slice.call(ee),this._projection=[].slice.call(V),this._resolution=[G.drawingBufferWidth,G.drawingBufferHeight];var j={model:Y,view:ee,projection:V,clipBounds:se,pickId:this.pickId/255},Q=this.pickShader;if(Q.bind(),Q.uniforms=j,this.triangleCount>0&&(this.triangleVAO.bind(),G.drawArrays(G.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),G.lineWidth(this.lineWidth*this.pixelRatio),G.drawArrays(G.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var Q=this.pointPickShader;Q.bind(),Q.uniforms=j,this.pointVAO.bind(),G.drawArrays(G.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(ve){if(!ve||ve.id!==this.pickId)return null;for(var G=ve.value[0]+256*ve.value[1]+65536*ve.value[2],Y=this.cells[G],ee=this.positions,V=new Array(Y.length),se=0;seMath.abs(u))l.rotate(R,0,0,-v*y*Math.PI*g.rotateSpeed/window.innerWidth);else if(!g._ortho){var L=-g.zoomSpeed*m*u/window.innerHeight*(R-l.lastT())/20;l.pan(R,0,0,w*(Math.exp(L)-1))}}},!0)},g.enableMouseListeners(),g}}),799:(function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),n=o([`precision mediump float; #define GLSLIFY 1 -attribute vec4 uv; -attribute vec3 f; -attribute vec3 normal; - -uniform vec3 objectOffset; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 lightPosition, eyePosition; -uniform sampler2D colormap; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; +uniform sampler2D accumBuffer; +varying vec2 uv; void main() { - vec3 localCoordinate = vec3(uv.zw, f.x); - worldCoordinate = objectOffset + localCoordinate; - mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); - vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0); - vec4 clipPosition = projection * (view * worldPosition); - gl_Position = clipPosition; - kill = f.y; - value = f.z; - planeCoordinate = uv.xy; + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}}),4100:(function(e,t,r){"use strict";var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),h=r(2260),f=r(7169),p=r(351),c=r(4772),T=r(4040),l=r(799),_=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:b,createCamera:o};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function A(u,y){var m=null;try{m=u.getContext("webgl",y),m||(m=u.getContext("experimental-webgl",y))}catch{return null}return m}function M(u){var y=Math.round(Math.log(Math.abs(u))/Math.log(10));if(y<0){var m=Math.round(Math.pow(10,-y));return Math.ceil(u*m)/m}else if(y>0){var m=Math.round(Math.pow(10,y));return Math.ceil(u/m)*m}return Math.ceil(u)}function g(u){return typeof u=="boolean"?u:!0}function b(u){u=u||{},u.camera=u.camera||{};var y=u.canvas;if(!y)if(y=document.createElement("canvas"),u.container){var m=u.container;m.appendChild(y)}else document.body.appendChild(y);var R=u.gl;if(R||(u.glOptions&&(_=!!u.glOptions.preserveDrawingBuffer),R=A(y,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:_})),!R)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new w,F=h(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!_}),N=l(R),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,P={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},U=u.axes||{},B=a(R,U);B.enable=!U.disable;var X=u.spikes||{},$=n(R,X),le=[],ce=[],ve=[],G=[],Y=!0,ae=!0,ee=new Array(16),V=new Array(16),se={view:null,projection:ee,model:V,_ortho:!1},ae=!0,j=[R.drawingBufferWidth,R.drawingBufferHeight],Q=u.cameraObject||o(y,P),re={gl:R,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:y,selection:z,camera:Q,axes:B,axesPixels:null,spikes:$,bounds:L,objects:le,shape:j,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:g(u.autoResize),autoBounds:g(u.autoBounds),autoScale:!!u.autoScale,autoCenter:g(u.autoCenter),clipToBounds:g(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:se,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Ue){this.aspect[0]=Ue.x,this.aspect[1]=Ue.y,this.aspect[2]=Ue.z,ae=!0},setBounds:function(Ue,fe){this.bounds[0][Ue]=fe.min,this.bounds[1][Ue]=fe.max},setClearColor:function(Ue){this.clearColor=Ue},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},he=[R.drawingBufferWidth/re.pixelRatio|0,R.drawingBufferHeight/re.pixelRatio|0];function xe(){if(!re._stopped&&re.autoResize){var Ue=y.parentNode,fe=1,ue=1;Ue&&Ue!==document.body?(fe=Ue.clientWidth,ue=Ue.clientHeight):(fe=window.innerWidth,ue=window.innerHeight);var ie=Math.ceil(fe*re.pixelRatio)|0,Ee=Math.ceil(ue*re.pixelRatio)|0;if(ie!==y.width||Ee!==y.height){y.width=ie,y.height=Ee;var We=y.style;We.position=We.position||"absolute",We.left="0px",We.top="0px",We.width=fe+"px",We.height=ue+"px",Y=!0}}}re.autoResize&&xe(),window.addEventListener("resize",xe);function Te(){for(var Ue=le.length,fe=G.length,ue=0;ue0&&ve[fe-1]===0;)ve.pop(),G.pop().dispose()}re.update=function(Ue){re._stopped||(Ue=Ue||{},Y=!0,ae=!0)},re.add=function(Ue){re._stopped||(Ue.axes=B,le.push(Ue),ce.push(-1),Y=!0,ae=!0,Te())},re.remove=function(Ue){if(!re._stopped){var fe=le.indexOf(Ue);fe<0||(le.splice(fe,1),ce.pop(),Y=!0,ae=!0,Te())}},re.dispose=function(){if(!re._stopped&&(re._stopped=!0,window.removeEventListener("resize",xe),y.removeEventListener("webglcontextlost",Le),re.mouseListener.enabled=!1,!re.contextLost)){B.dispose(),$.dispose();for(var Ue=0;Uez.distance)continue;for(var St=0;St1e-6?(_=Math.acos(w),A=Math.sin(_),M=Math.sin((1-i)*_)/A,g=Math.sin(i*_)/A):(M=1-i,g=i),r[0]=M*n+g*p,r[1]=M*s+g*c,r[2]=M*h+g*T,r[3]=M*f+g*l,r}}),5964:(function(e){"use strict";e.exports=function(t){return!t&&t!==0?"":t.toString()}}),9366:(function(e,t,r){"use strict";var o=r(4359);e.exports=i;var a={};function i(n,s,h){var f=[s.style,s.weight,s.variant,s.family].join("_"),p=a[f];if(p||(p=a[f]={}),n in p)return p[n];var c={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};c.triangles=!0;var T=o(n,c);c.triangles=!1;var l=o(n,c),_,w;if(h&&h!==1){for(_=0;_ max(a, b)) || + (p < min(a, b))); +} - //Lighting geometry parameters - vec4 cameraCoordinate = view * worldPosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - lightDirection = lightPosition - cameraCoordinate.xyz; - eyeDirection = eyePosition - cameraCoordinate.xyz; - surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); -} -`]),n=a([`precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float beckmannSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness) { - return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 lowerBound, upperBound; -uniform float contourTint; -uniform vec4 contourColor; -uniform sampler2D colormap; -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform float vertexColor; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - if ( - kill > 0.0 || - vColor.a == 0.0 || - outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) - ) discard; - - vec3 N = normalize(surfaceNormal); - vec3 V = normalize(eyeDirection); - vec3 L = normalize(lightDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = max(beckmannSpecular(L, V, N, roughness), 0.); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - //decide how to interpolate color \u2014 in vertex or in fragment - vec4 surfaceColor = - step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + - step(.5, vertexColor) * vColor; - - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; -} -`]),s=a([`precision highp float; -#define GLSLIFY 1 - -attribute vec4 uv; -attribute float f; - -uniform vec3 objectOffset; -uniform mat3 permutation; -uniform mat4 model, view, projection; -uniform float height, zOffset; -uniform sampler2D colormap; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - vec3 dataCoordinate = permutation * vec3(uv.xy, height); - worldCoordinate = objectOffset + dataCoordinate; - mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); - vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); - - vec4 clipPosition = projection * (view * worldPosition); - clipPosition.z += zOffset; - - gl_Position = clipPosition; - value = f + objectOffset.z; - kill = -1.0; - planeCoordinate = uv.zw; - - vColor = texture2D(colormap, vec2(value, value)); - - //Don't do lighting for contours - surfaceNormal = vec3(1,0,0); - eyeDirection = vec3(0,1,0); - lightDirection = vec3(0,0,1); -} -`]),h=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec2 shape; -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 surfaceNormal; - -vec2 splitFloat(float v) { - float vh = 255.0 * v; - float upper = floor(vh); - float lower = fract(vh); - return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); -} - -void main() { - if ((kill > 0.0) || - (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; - - vec2 ux = splitFloat(planeCoordinate.x / shape.x); - vec2 uy = splitFloat(planeCoordinate.y / shape.y); - gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); -} -`]);t.createShader=function(c){var m=o(c,i,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createPickShader=function(c){var m=o(c,i,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createContourShader=function(c){var m=o(c,s,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m},t.createPickContourShader=function(c){var m=o(c,s,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m}}),1085:(function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var h=i.split(/\r?\n/),c=String(h.length+n-1).length;return h.map(function(m,p){var T=p+n,l=String(T).length,_=o(T,c-l);return _+s+m}).join(` -`)}}),1091:(function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}}),1125:(function(e,t,r){"use strict";e.exports=i;var o=r(3250)[3];function a(n,s,h,c){for(var m=0;m<2;++m){var p=n[m],T=s[m],l=Math.min(p,T),_=Math.max(p,T),w=h[m],S=c[m],M=Math.min(w,S),y=Math.max(w,S);if(y0&&p>0||m<0&&p<0)return!1;var T=o(h,n,s),l=o(c,n,s);return T>0&&l>0||T<0&&l<0?!1:m===0&&p===0&&T===0&&l===0?a(n,s,h,c):!0}}),1278:(function(e,t,r){"use strict";var o=r(2361),a=Math.pow(2,-1074),i=-1>>>0;e.exports=n;function n(s,h){if(isNaN(s)||isNaN(h))return NaN;if(s===h)return s;if(s===0)return h<0?-a:a;var c=o.hi(s),m=o.lo(s);return h>s==s>0?m===i?(c+=1,m=0):m+=1:m===0?(m=i,c-=1):m-=1,o.pack(m,c)}}),1283:(function(e,t,r){var o=r(9405),a=r(3236),i=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { @@ -1218,7 +1449,7 @@ void main() { ) discard; gl_FragColor = interpColor * opacity; } -`]),c=a([`precision highp float; +`]),f=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { @@ -1251,7 +1482,9 @@ void main() { if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; gl_FragColor = vec4(pickGroup, pickId.bgr); -}`]),m=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],p={vertex:i,fragment:h,attributes:m},T={vertex:n,fragment:h,attributes:m},l={vertex:s,fragment:h,attributes:m},_={vertex:i,fragment:c,attributes:m},w={vertex:n,fragment:c,attributes:m},S={vertex:s,fragment:c,attributes:m};function M(y,b){var v=o(y,b),u=v.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,v}t.createPerspective=function(y){return M(y,p)},t.createOrtho=function(y){return M(y,T)},t.createProject=function(y){return M(y,l)},t.createPickPerspective=function(y){return M(y,_)},t.createPickOrtho=function(y){return M(y,w)},t.createPickProject=function(y){return M(y,S)}}),1303:(function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){var h,c;if(s[0][0]s[1][0])h=s[1],c=s[0];else{var m=Math.min(n[0][1],n[1][1]),p=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return pl?m-l:p-l}var _,w;n[0][1]s[1][0])h=s[1],c=s[0];else return a(s,n);var m,p;if(n[0][0]n[1][0])m=n[1],p=n[0];else return-a(n,s);var T=o(h,c,p),l=o(h,c,m);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(p,m,c),l=o(p,m,h),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return c[0]-p[0]}}),1318:(function(e){"use strict";e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}}),1338:(function(e){"use strict";function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var h=new Array(s),c;if(n===a.length-1)for(c=0;c"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o}),1369:(function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,h=0;if(n===1)h=s[0];else if(n===2)h=s[0]+s[1]*67108864;else for(var c=0;ci)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?1:V}function v(V,se,ae,j,Q,re,he,xe,Te,Le,Pe,qe){this.gl=V,this.pixelRatio=1,this.shader=se,this.orthoShader=ae,this.projectShader=j,this.pointBuffer=Q,this.colorBuffer=re,this.glyphBuffer=he,this.idBuffer=xe,this.vao=Te,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Le,this.pickOrthoShader=Pe,this.pickProjectShader=qe,this.points=[],this._selectResult=new g(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=v.prototype;u.pickSlots=1,u.setPickBase=function(V){this.pickId=V},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var V=0;V<3;++V)if(this.axesProject[V]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var V=0;V<3;++V)if(this.axesProject[V]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],m=[0,0,0],R=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=c.slice(),N=[0,0,0],O=[[0,0,0],[0,0,0]];function P(V){return V[0]=V[1]=V[2]=0,V}function U(V,se){return V[0]=se[0],V[1]=se[1],V[2]=se[2],V[3]=1,V}function B(V,se,ae,j){return V[0]=se[0],V[1]=se[1],V[2]=se[2],V[ae]=j,V}function X(V){for(var se=O,ae=0;ae<2;++ae)for(var j=0;j<3;++j)se[ae][j]=Math.max(Math.min(V[ae][j],1e8),-1e8);return se}function $(V,se,ae,j){var Q=se.axesProject,re=se.gl,he=V.uniforms,xe=ae.model||c,Te=ae.view||c,Le=ae.projection||c,Pe=se.axesBounds,qe=X(se.clipBounds),et;se.axes&&se.axes.lastCubeProps?et=se.axes.lastCubeProps.axis:et=[1,1,1],y[0]=2/re.drawingBufferWidth,y[1]=2/re.drawingBufferHeight,V.bind(),he.view=Te,he.projection=Le,he.screenSize=y,he.highlightId=se.highlightId,he.highlightScale=se.highlightScale,he.clipBounds=qe,he.pickGroup=se.pickId/255,he.pixelRatio=j;for(var rt=0;rt<3;++rt)if(Q[rt]){he.scale=se.projectScale[rt],he.opacity=se.projectOpacity[rt];for(var $e=F,Ue=0;Ue<16;++Ue)$e[Ue]=0;for(var Ue=0;Ue<4;++Ue)$e[5*Ue]=1;$e[5*rt]=0,et[rt]<0?$e[12+rt]=Pe[0][rt]:$e[12+rt]=Pe[1][rt],s($e,xe,$e),he.model=$e;var fe=(rt+1)%3,ue=(rt+2)%3,ie=P(m),Ee=P(R);ie[fe]=1,Ee[ue]=1;var We=M(Le,Te,xe,U(L,ie)),Qe=M(Le,Te,xe,U(z,Ee));if(Math.abs(We[1])>Math.abs(Qe[1])){var Xe=We;We=Qe,Qe=Xe,Xe=ie,ie=Ee,Ee=Xe;var Tt=fe;fe=ue,ue=Tt}We[0]<0&&(ie[fe]=-1),Qe[1]>0&&(Ee[ue]=-1);for(var St=0,zt=0,Ue=0;Ue<4;++Ue)St+=Math.pow(xe[4*fe+Ue],2),zt+=Math.pow(xe[4*ue+Ue],2);ie[fe]/=Math.sqrt(St),Ee[ue]/=Math.sqrt(zt),he.axes[0]=ie,he.axes[1]=Ee,he.fragClipBounds[0]=B(N,qe[0],rt,-1e8),he.fragClipBounds[1]=B(N,qe[1],rt,1e8),se.vao.bind(),se.vao.draw(re.TRIANGLES,se.vertexCount),se.lineWidth>0&&(re.lineWidth(se.lineWidth*j),se.vao.draw(re.LINES,se.lineVertexCount,se.vertexCount)),se.vao.unbind()}}var le=[-1e8,-1e8,-1e8],ce=[1e8,1e8,1e8],ve=[le,ce];function G(V,se,ae,j,Q,re,he){var xe=ae.gl;if((re===ae.projectHasAlpha||he)&&$(se,ae,j,Q),re===ae.hasAlpha||he){V.bind();var Te=V.uniforms;Te.model=j.model||c,Te.view=j.view||c,Te.projection=j.projection||c,y[0]=2/xe.drawingBufferWidth,y[1]=2/xe.drawingBufferHeight,Te.screenSize=y,Te.highlightId=ae.highlightId,Te.highlightScale=ae.highlightScale,Te.fragClipBounds=ve,Te.clipBounds=ae.axes.bounds,Te.opacity=ae.opacity,Te.pickGroup=ae.pickId/255,Te.pixelRatio=Q,ae.vao.bind(),ae.vao.draw(xe.TRIANGLES,ae.vertexCount),ae.lineWidth>0&&(xe.lineWidth(ae.lineWidth*Q),ae.vao.draw(xe.LINES,ae.lineVertexCount,ae.vertexCount)),ae.vao.unbind()}}u.draw=function(V){var se=this.useOrtho?this.orthoShader:this.shader;G(se,this.projectShader,this,V,this.pixelRatio,!1,!1)},u.drawTransparent=function(V){var se=this.useOrtho?this.orthoShader:this.shader;G(se,this.projectShader,this,V,this.pixelRatio,!0,!1)},u.drawPick=function(V){var se=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;G(se,this.pickProjectShader,this,V,1,!0,!0)},u.pick=function(V){if(!V||V.id!==this.pickId)return null;var se=V.value[2]+(V.value[1]<<8)+(V.value[0]<<16);if(se>=this.pointCount||se<0)return null;var ae=this.points[se],j=this._selectResult;j.index=se;for(var Q=0;Q<3;++Q)j.position[Q]=j.dataCoordinate[Q]=ae[Q];return j},u.highlight=function(V){if(!V)this.highlightId=[1,1,1,1];else{var se=V.index,ae=se&255,j=se>>8&255,Q=se>>16&255;this.highlightId=[ae/255,j/255,Q/255,0]}};function Y(V,se,ae,j){var Q;w(V)?se0){var Er=0,mt=ue,ze=[0,0,0,1],Ze=[0,0,0,1],we=w(et)&&w(et[0]),ke=w(Ue)&&w(Ue[0]);e:for(var j=0;j0?1-zt[0][0]:Et<0?1+zt[1][0]:1,Ot*=Ot>0?1-zt[0][1]:Ot<0?1+zt[1][1]:1;for(var sr=[Et,Ot],Ca=Tt.cells||[],Aa=Tt.positions||[],Qe=0;Qethis.buffer.length){a.free(this.buffer);for(var w=this.buffer=a.mallocUint8(n(_*l*4)),A=0;A<_*l*4;++A)w[A]=255}return T}}}),p.begin=function(){var T=this.gl,l=this.shape;T&&(this.fbo.bind(),T.clearColor(1,1,1,1),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT))},p.end=function(){var T=this.gl;T&&(T.bindFramebuffer(T.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},p.query=function(T,l,_){if(!this.gl)return null;var w=this.fbo.shape.slice();T=T|0,l=l|0,typeof _!="number"&&(_=1);var A=Math.min(Math.max(T-_,0),w[0])|0,M=Math.min(Math.max(T+_,0),w[0])|0,g=Math.min(Math.max(l-_,0),w[1])|0,b=Math.min(Math.max(l+_,0),w[1])|0;if(M<=A||b<=g)return null;var v=[M-A,b-g],u=i(this.buffer,[v[0],v[1],4],[4,w[0]*4,1],4*(A+w[0]*g)),y=s(u.hi(v[0],v[1],1),_,_),m=y[0],R=y[1];if(m<0||Math.pow(this.radius,2)w)for(l=w;l<_;l++)this.gl.enableVertexAttribArray(l);else if(w>_)for(l=_;l=0){for(var O=N.type.charAt(N.type.length-1)|0,P=new Array(O),U=0;U=0;)B+=1;z[F]=B}var X=new Array(w.length);function $(){g.program=n.program(b,g._vref,g._fref,L,z);for(var le=0;le=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+g+": "+b);s(p,c,v[0],l,u,_,g)}else if(b.indexOf("mat")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+g+": "+b);h(p,c,v,l,u,_,g)}else throw new o("","Unknown data type for attribute "+g+": "+b);break}}return _}}),3327:(function(e,t,r){"use strict";var o=r(216),a=r(8866);e.exports=s;function i(h){return function(){return h}}function n(h,f){for(var p=new Array(h),c=0;c4)throw new a("","Invalid data type");switch(B.charAt(0)){case"b":case"i":h["uniform"+X+"iv"](c[z],F);break;case"v":h["uniform"+X+"fv"](c[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+B)}}else if(B.indexOf("mat")===0&&B.length===4){if(X=B.charCodeAt(B.length-1)-48,X<2||X>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+B);h["uniformMatrix"+X+"fv"](c[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+B)}}}}}function _(b,v){if(typeof v!="object")return[[b,v]];var u=[];for(var y in v){var m=v[y],R=b;parseInt(y)+""===y?R+="["+y+"]":R+="."+y,typeof m=="object"?u.push.apply(u,_(R,m)):u.push([R,m])}return u}function w(b){switch(b){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var v=b.indexOf("vec");if(0<=v&&v<=1&&b.length===4+v){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return b.charAt(0)==="b"?n(u,!1):n(u,0)}else if(b.indexOf("mat")===0&&b.length===4){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+b);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+b)}}function A(b,v,u){if(typeof u=="object"){var y=M(u);Object.defineProperty(b,v,{get:i(y),set:l(u),enumerable:!0,configurable:!1})}else c[u]?Object.defineProperty(b,v,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):b[v]=w(p[u].type)}function M(b){var v;if(Array.isArray(b)){v=new Array(b.length);for(var u=0;u1){p[0]in h||(h[p[0]]=[]),h=h[p[0]];for(var c=1;c1)for(var _=0;_"u"?r(606):WeakMap,n=new i,s=0;function h(A,M,g,b,v,u,y){this.id=A,this.src=M,this.type=g,this.shader=b,this.count=u,this.programs=[],this.cache=y}h.prototype.dispose=function(){if(--this.count===0){for(var A=this.cache,M=A.gl,g=this.programs,b=0,v=g.length;b=0?P[U]:N)}function F(I){var N=M(I);return N?L in N:f.indexOf(I)>=0}function B(I,N){var U,W=M(I);return W?W[L]=N:(U=f.indexOf(I),U>=0?P[U]=N:(U=f.length,P[U]=N,f[U]=I)),this}function O(I){var N=M(I),U,W;return N?L in N&&delete N[L]:(U=f.indexOf(I),U<0?!1:(W=f.length-1,f[U]=void 0,P[U]=P[W],f[U]=f[W],f.length=W,P.length=W,!0))}return Object.create(g.prototype,{get___:{value:y(z)},has___:{value:y(F)},set___:{value:y(B)},delete___:{value:y(O)}})};g.prototype=Object.create(Object.prototype,{get:{value:function(P,L){return this.get___(P,L)},writable:!0,configurable:!0},has:{value:function(P){return this.has___(P)},writable:!0,configurable:!0},set:{value:function(P,L){return this.set___(P,L)},writable:!0,configurable:!0},delete:{value:function(P){return this.delete___(P)},writable:!0,configurable:!0}}),typeof a=="function"?(function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function f(){this instanceof g||v();var P=new a,L=void 0,z=!1;function F(N,U){return L?P.has(N)?P.get(N):L.get___(N,U):P.get(N,U)}function B(N){return P.has(N)||(L?L.has___(N):!1)}var O;o?O=function(N,U){return P.set(N,U),P.has(N)||(L||(L=new g),L.set(N,U)),this}:O=function(N,U){if(z)try{P.set(N,U)}catch{L||(L=new g),L.set___(N,U)}else P.set(N,U);return this};function I(N){var U=!!P.delete(N);return L&&L.delete___(N)||U}return Object.create(g.prototype,{get___:{value:y(F)},has___:{value:y(B)},set___:{value:y(O)},delete___:{value:y(I)},permitHostObjects___:{value:y(function(N){if(N===r)z=!0;else throw new Error("bogus call to permitHostObjects___")})}})}f.prototype=g.prototype,e.exports=f,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=g)})()}),1570:(function(e){"use strict";e.exports=r;var t=[function(){function a(n,s,h,c){for(var m=Math.min(h,c)|0,p=Math.max(h,c)|0,T=n[2*m],l=n[2*m+1];T>1,w=s[2*_+1];if(w===p)return _;p>1,w=s[2*_+1];if(w===p)return _;p>1,w=s[2*_+1];if(w===p)return _;p>1,w=s[2*_+1];if(w===p)return _;p HALF_PI) && (b <= ONE_AND_HALF_PI)) ? - b - PI : - b; -} - -float look_horizontal_or_vertical(float a, float ratio) { - // ratio controls the ratio between being horizontal to (vertical + horizontal) - // if ratio is set to 0.5 then it is 50%, 50%. - // when using a higher ratio e.g. 0.75 the result would - // likely be more horizontal than vertical. - - float b = positive_angle(a); - - return - (b < ( ratio) * HALF_PI) ? 0.0 : - (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : - (b < (2.0 + ratio) * HALF_PI) ? 0.0 : - (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : - 0.0; -} - -float roundTo(float a, float b) { - return float(b * floor((a + 0.5 * b) / b)); -} - -float look_round_n_directions(float a, int n) { - float b = positive_angle(a); - float div = TWO_PI / float(n); - float c = roundTo(b, div); - return look_upwards(c); -} - -float applyAlignOption(float rawAngle, float delta) { - return - (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions - (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical - (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis - (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards - (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal - rawAngle; // otherwise return back raw input angle -} - -bool isAxisTitle = (axis.x == 0.0) && - (axis.y == 0.0) && - (axis.z == 0.0); - -void main() { - //Compute world offset - float axisDistance = position.z; - vec3 dataPosition = axisDistance * axis + offset; - - float beta = angle; // i.e. user defined attributes for each tick - - float axisAngle; - float clipAngle; - float flip; - - if (enableAlign) { - axisAngle = (isAxisTitle) ? HALF_PI : - computeViewAngle(dataPosition, dataPosition + axis); - clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); - - axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; - clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; - - flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), - vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; - - beta += applyAlignOption(clipAngle, flip * PI); - } - - //Compute plane offset - vec2 planeCoord = position.xy * pixelScale; - - mat2 planeXform = scale * mat2( - cos(beta), sin(beta), - -sin(beta), cos(beta) - ); - - vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; - - //Compute clip position - vec3 clipPosition = project(dataPosition); - - //Apply text offset in clip coordinates - clipPosition += vec3(viewOffset, 0.0); - - //Done - gl_Position = vec4(clipPosition, 1.0); -} -`]),h=o([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 color; -void main() { - gl_FragColor = color; -}`]);t.Q=function(p){return a(p,s,h,null,[{name:"position",type:"vec3"}])};var c=o([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec3 normal; - -uniform mat4 model, view, projection; -uniform vec3 enable; -uniform vec3 bounds[2]; - -varying vec3 colorChannel; - -void main() { - - vec3 signAxis = sign(bounds[1] - bounds[0]); - - vec3 realNormal = signAxis * normal; - - if(dot(realNormal, enable) > 0.0) { - vec3 minRange = min(bounds[0], bounds[1]); - vec3 maxRange = max(bounds[0], bounds[1]); - vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); - gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); - } else { - gl_Position = vec4(0,0,0,0); - } - - colorChannel = abs(realNormal); -} -`]),m=o([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 colors[3]; - -varying vec3 colorChannel; - -void main() { - gl_FragColor = colorChannel.x * colors[0] + - colorChannel.y * colors[1] + - colorChannel.z * colors[2]; -}`]);t.bg=function(p){return a(p,c,m,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),1888:(function(e,t,r){"use strict";var o=r(8828),a=r(1338),i=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var n=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",h=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var m=c.DATA,p=c.BUFFER;t.free=function(O){if(i.isBuffer(O))p[o.log2(O.length)].push(O);else{if(Object.prototype.toString.call(O)!=="[object ArrayBuffer]"&&(O=O.buffer),!O)return;var I=O.length||O.byteLength,N=o.log2(I)|0;m[N].push(O)}};function T(B){if(B){var O=B.length||B.byteLength,I=o.log2(O);m[I].push(B)}}function l(B){T(B.buffer)}t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=l,t.freeArrayBuffer=T,t.freeBuffer=function(O){p[o.log2(O.length)].push(O)},t.malloc=function(O,I){if(I===void 0||I==="arraybuffer")return _(O);switch(I){case"uint8":return w(O);case"uint16":return S(O);case"uint32":return M(O);case"int8":return y(O);case"int16":return b(O);case"int32":return v(O);case"float":case"float32":return u(O);case"double":case"float64":return g(O);case"uint8_clamped":return f(O);case"bigint64":return L(O);case"biguint64":return P(O);case"buffer":return F(O);case"data":case"dataview":return z(O);default:return null}return null};function _(O){var O=o.nextPow2(O),I=o.log2(O),N=m[I];return N.length>0?N.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=_;function w(B){return new Uint8Array(_(B),0,B)}t.mallocUint8=w;function S(B){return new Uint16Array(_(2*B),0,B)}t.mallocUint16=S;function M(B){return new Uint32Array(_(4*B),0,B)}t.mallocUint32=M;function y(B){return new Int8Array(_(B),0,B)}t.mallocInt8=y;function b(B){return new Int16Array(_(2*B),0,B)}t.mallocInt16=b;function v(B){return new Int32Array(_(4*B),0,B)}t.mallocInt32=v;function u(B){return new Float32Array(_(4*B),0,B)}t.mallocFloat32=t.mallocFloat=u;function g(B){return new Float64Array(_(8*B),0,B)}t.mallocFloat64=t.mallocDouble=g;function f(B){return n?new Uint8ClampedArray(_(B),0,B):w(B)}t.mallocUint8Clamped=f;function P(B){return s?new BigUint64Array(_(8*B),0,B):null}t.mallocBigUint64=P;function L(B){return h?new BigInt64Array(_(8*B),0,B):null}t.mallocBigInt64=L;function z(B){return new DataView(_(B),0,B)}t.mallocDataView=z;function F(B){B=o.nextPow2(B);var O=o.log2(B),I=p[O];return I.length>0?I.pop():new i(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)c.UINT8[O].length=0,c.UINT16[O].length=0,c.UINT32[O].length=0,c.INT8[O].length=0,c.INT16[O].length=0,c.INT32[O].length=0,c.FLOAT[O].length=0,c.DOUBLE[O].length=0,c.BIGUINT64[O].length=0,c.BIGINT64[O].length=0,c.UINT8C[O].length=0,m[O].length=0,p[O].length=0}}),1903:(function(e){e.exports=t;function t(r){var o=new Float32Array(16);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o}}),1944:(function(e,t,r){"use strict";var o=r(5250),a=r(8210);e.exports=i;function i(n,s){for(var h=o(n[0],s[0]),c=1;c>1,F=h(u[z],g);F<=0?(F===0&&(L=z),f=z+1):F>0&&(P=z-1)}return L}t.findCell=T;function l(u,g){for(var f=new Array(u.length),P=0,L=f.length;P=u.length||h(u[Q],z)!==0););}return f}t.incidence=l;function _(u,g){if(!g)return l(p(S(u,0)),u,0);for(var f=new Array(g),P=0;P>>I&1&&O.push(L[I]);g.push(O)}return m(g)}t.explode=w;function S(u,g){if(g<0)return[];for(var f=[],P=(1<0}b=b.filter(v);for(var u=b.length,g=new Array(u),f=new Array(u),y=0;y0;){var re=ne.pop(),ue=le[re];h(ue,function(He,et){return He-et});var _e=ue.length,Te=j[re],Ie;if(Te===0){var O=b[re];Ie=[O]}for(var y=0;y<_e;++y){var De=ue[y];if(!(j[De]>=0)&&(j[De]=Te^1,ne.push(De),Te===0)){var O=b[De];oe(O)||(O.reverse(),Ie.push(O))}}Te===0&&ee.push(Ie)}return ee}}),2145:(function(e,t){"use strict";t.uniforms=i,t.attributes=n;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},o=null;function a(s,h){if(!o){var c=Object.keys(r);o={};for(var m=0;m1)for(var _=0;_1&&F.drawBuffersWEBGL(a[z]);var U=g.getExtension("WEBGL_depth_texture");U?B?v.depth=l(g,P,L,U.UNSIGNED_INT_24_8_WEBGL,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O&&(v.depth=l(g,P,L,g.UNSIGNED_SHORT,g.DEPTH_COMPONENT,g.DEPTH_ATTACHMENT)):O&&B?v._depth_rb=_(g,P,L,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O?v._depth_rb=_(g,P,L,g.DEPTH_COMPONENT16,g.DEPTH_ATTACHMENT):B&&(v._depth_rb=_(g,P,L,g.STENCIL_INDEX,g.STENCIL_ATTACHMENT));var W=g.checkFramebufferStatus(g.FRAMEBUFFER);if(W!==g.FRAMEBUFFER_COMPLETE){v._destroyed=!0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.deleteFramebuffer(v.handle),v.handle=null,v.depth&&(v.depth.dispose(),v.depth=null),v._depth_rb&&(g.deleteRenderbuffer(v._depth_rb),v._depth_rb=null);for(var N=0;NP||g<0||g>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");v._shape[0]=u,v._shape[1]=g;for(var L=c(f),z=0;zL||g<0||g>L)throw new Error("gl-fbo: Parameters are too large for FBO");f=f||{};var z=1;if("color"in f){if(z=Math.max(f.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(P){if(z>v.getParameter(P.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=v.UNSIGNED_BYTE,B=v.getExtension("OES_texture_float");if(f.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=v.FLOAT}else f.preferFloat&&z>0&&B&&(F=v.FLOAT);var O=!0;"depth"in f&&(O=!!f.depth);var I=!1;return"stencil"in f&&(I=!!f.stencil),new S(v,u,g,F,z,O,I,P)}}),2272:(function(e,t,r){"use strict";var o=r(2646)[4],a=r(2478);e.exports=n;function i(s,h,c,m,p,T){var l=h.opposite(m,p);if(!(l<0)){if(p0;){for(var w=c.pop(),T=c.pop(),S=-1,M=-1,l=p[T],b=1;b=0||(h.flip(T,w),i(s,h,c,S,T,M),i(s,h,c,T,M,S),i(s,h,c,M,w,S),i(s,h,c,w,S,M))}}}),2334:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}}),2335:(function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}}),2361:(function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),o=new Uint32Array(r.buffer);if(r[0]=1,t=!0,o[1]===1072693248){let _=function(M,y){return o[0]=M,o[1]=y,r[0]},w=function(M){return r[0]=M,o[0]},S=function(M){return r[0]=M,o[1]};var a=_,i=w,n=S;e.exports=function(y){return r[0]=y,[o[0],o[1]]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}else if(o[0]===1072693248){let _=function(M,y){return o[1]=M,o[0]=y,r[0]},w=function(M){return r[0]=M,o[1]},S=function(M){return r[0]=M,o[0]};var s=_,h=w,c=S;e.exports=function(y){return r[0]=y,[o[1],o[0]]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}else t=!1}if(!t){let _=function(M,y){return l.writeUInt32LE(M,0,!0),l.writeUInt32LE(y,4,!0),l.readDoubleLE(0,!0)},w=function(M){return l.writeDoubleLE(M,0,!0),l.readUInt32LE(0,!0)},S=function(M){return l.writeDoubleLE(M,0,!0),l.readUInt32LE(4,!0)};var m=_,p=w,T=S,l=new Buffer(8);e.exports=function(y){return l.writeDoubleLE(y,0,!0),[l.readUInt32LE(0,!0),l.readUInt32LE(4,!0)]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}e.exports.sign=function(_){return e.exports.hi(_)>>>31},e.exports.exponent=function(_){var w=e.exports.hi(_);return(w<<1>>>21)-1023},e.exports.fraction=function(_){var w=e.exports.lo(_),S=e.exports.hi(_),M=S&(1<<20)-1;return S&2146435072&&(M+=1048576),[w,M]},e.exports.denormalized=function(_){var w=e.exports.hi(_);return!(w&2146435072)}}),2408:(function(e){e.exports=t;function t(r,o,a){var i=Math.sin(a),n=Math.cos(a),s=o[0],h=o[1],c=o[2],m=o[3],p=o[8],T=o[9],l=o[10],_=o[11];return o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=s*n-p*i,r[1]=h*n-T*i,r[2]=c*n-l*i,r[3]=m*n-_*i,r[8]=s*i+p*n,r[9]=h*i+T*n,r[10]=c*i+l*n,r[11]=m*i+_*n,r}}),2419:(function(e){"use strict";e.exports=t;function t(r){for(var o=1,a=1;aS-w?i(h,c,m,p,T,l,_,w,S,M,y):n(h,c,m,p,T,l,_,w,S,M,y)}return s}function o(){function i(m,p,T,l,_,w,S,M,y,b,v){for(var u=2*m,g=l,f=u*l;g<_;++g,f+=u){var P=w[p+f],L=w[p+f+m],z=S[g];e:for(var F=M,B=u*M;Fb-y?l?i(m,p,T,_,w,S,M,y,b,v,u):n(m,p,T,_,w,S,M,y,b,v,u):l?s(m,p,T,_,w,S,M,y,b,v,u):h(m,p,T,_,w,S,M,y,b,v,u)}return c}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)}),2478:(function(e){"use strict";function t(s,h,c,m,p){for(var T=p+1;m<=p;){var l=m+p>>>1,_=s[l],w=c!==void 0?c(_,h):_-h;w>=0?(T=l,p=l-1):m=l+1}return T}function r(s,h,c,m,p){for(var T=p+1;m<=p;){var l=m+p>>>1,_=s[l],w=c!==void 0?c(_,h):_-h;w>0?(T=l,p=l-1):m=l+1}return T}function o(s,h,c,m,p){for(var T=m-1;m<=p;){var l=m+p>>>1,_=s[l],w=c!==void 0?c(_,h):_-h;w<0?(T=l,m=l+1):p=l-1}return T}function a(s,h,c,m,p){for(var T=m-1;m<=p;){var l=m+p>>>1,_=s[l],w=c!==void 0?c(_,h):_-h;w<=0?(T=l,m=l+1):p=l-1}return T}function i(s,h,c,m,p){for(;m<=p;){var T=m+p>>>1,l=s[T],_=c!==void 0?c(l,h):l-h;if(_===0)return T;_<=0?m=T+1:p=T-1}return-1}function n(s,h,c,m,p,T){return typeof c=="function"?T(s,h,c,m===void 0?0:m|0,p===void 0?s.length-1:p|0):T(s,h,void 0,c===void 0?0:c|0,m===void 0?s.length-1:m|0)}e.exports={ge:function(s,h,c,m,p){return n(s,h,c,m,p,t)},gt:function(s,h,c,m,p){return n(s,h,c,m,p,r)},lt:function(s,h,c,m,p){return n(s,h,c,m,p,o)},le:function(s,h,c,m,p){return n(s,h,c,m,p,a)},eq:function(s,h,c,m,p){return n(s,h,c,m,p,i)}}}),2504:(function(e){e.exports=t;function t(r,o,a){var i=a[0],n=a[1],s=a[2];return r[0]=o[0]*i,r[1]=o[1]*i,r[2]=o[2]*i,r[3]=o[3]*i,r[4]=o[4]*n,r[5]=o[5]*n,r[6]=o[6]*n,r[7]=o[7]*n,r[8]=o[8]*s,r[9]=o[9]*s,r[10]=o[10]*s,r[11]=o[11]*s,r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15],r}}),2538:(function(e,t,r){"use strict";var o=r(8902),a=r(5542),i=r(2272),n=r(5023);e.exports=p;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function h(T,l){return T[0]-l[0]||T[1]-l[1]}function c(T){return T.map(s).sort(h)}function m(T,l,_){return l in T?T[l]:_}function p(T,l,_){Array.isArray(l)?(_=_||{},l=l||[]):(_=l||{},l=[]);var w=!!m(_,"delaunay",!0),S=!!m(_,"interior",!0),M=!!m(_,"exterior",!0),y=!!m(_,"infinity",!1);if(!S&&!M||T.length===0)return[];var b=o(T,l);if(w||S!==M||y){for(var v=a(T.length,c(l)),u=0;u0){if(le=1,q[J++]=m(v[P],w,S,M),P+=U,y>0)for(Q=1,L=v[P],X=q[J]=m(L,w,S,M),j=q[J+oe],ue=q[J+ee],Ie=q[J+_e],(X!==j||X!==ue||X!==Ie)&&(F=v[P+z],O=v[P+B],N=v[P+I],h(Q,le,L,F,O,N,X,j,ue,Ie,w,S,M),De=$[J]=se++),J+=1,P+=U,Q=2;Q0)for(Q=1,L=v[P],X=q[J]=m(L,w,S,M),j=q[J+oe],ue=q[J+ee],Ie=q[J+_e],(X!==j||X!==ue||X!==Ie)&&(F=v[P+z],O=v[P+B],N=v[P+I],h(Q,le,L,F,O,N,X,j,ue,Ie,w,S,M),De=$[J]=se++,Ie!==ue&&c($[J+ee],De,O,N,ue,Ie,w,S,M)),J+=1,P+=U,Q=2;Q0){if(Q=1,q[J++]=m(v[P],w,S,M),P+=U,b>0)for(le=1,L=v[P],X=q[J]=m(L,w,S,M),ue=q[J+ee],j=q[J+oe],Ie=q[J+_e],(X!==ue||X!==j||X!==Ie)&&(F=v[P+z],O=v[P+B],N=v[P+I],h(Q,le,L,F,O,N,X,ue,j,Ie,w,S,M),De=$[J]=se++),J+=1,P+=U,le=2;le0)for(le=1,L=v[P],X=q[J]=m(L,w,S,M),ue=q[J+ee],j=q[J+oe],Ie=q[J+_e],(X!==ue||X!==j||X!==Ie)&&(F=v[P+z],O=v[P+B],N=v[P+I],h(Q,le,L,F,O,N,X,ue,j,Ie,w,S,M),De=$[J]=se++,Ie!==ue&&c($[J+ee],De,N,F,Ie,ue,w,S,M)),J+=1,P+=U,le=2;le 0"),typeof s.vertex!="function"&&h("Must specify vertex creation function"),typeof s.cell!="function"&&h("Must specify cell creation function"),typeof s.phase!="function"&&h("Must specify phase function");for(var T=s.getters||[],l=new Array(m),_=0;_=0?l[_]=!0:l[_]=!1;return i(s.vertex,s.cell,s.phase,p,c,l)}}),2642:(function(e,t,r){"use strict";e.exports=i;var o=r(727);function a(n){for(var s=0,h=0;hl[1][2]&&(P[0]=-P[0]),l[0][2]>l[2][0]&&(P[1]=-P[1]),l[1][0]>l[0][1]&&(P[2]=-P[2]),!0};function w(y,b,v){var u=b[0],g=b[1],f=b[2],P=b[3];return y[0]=v[0]*u+v[4]*g+v[8]*f+v[12]*P,y[1]=v[1]*u+v[5]*g+v[9]*f+v[13]*P,y[2]=v[2]*u+v[6]*g+v[10]*f+v[14]*P,y[3]=v[3]*u+v[7]*g+v[11]*f+v[15]*P,y}function S(y,b){y[0][0]=b[0],y[0][1]=b[1],y[0][2]=b[2],y[1][0]=b[4],y[1][1]=b[5],y[1][2]=b[6],y[2][0]=b[8],y[2][1]=b[9],y[2][2]=b[10]}function M(y,b,v,u,g){y[0]=b[0]*u+v[0]*g,y[1]=b[1]*u+v[1]*g,y[2]=b[2]*u+v[2]*g}}),2653:(function(e,t,r){"use strict";var o=r(3865);e.exports=a;function a(i,n){for(var s=i.length,h=new Array(s),c=0;c=c[S]&&(w+=1);l[_]=w}}return h}function s(h,c){try{return o(h,!0)}catch{var m=a(h);if(m.length<=c)return[];var p=i(h,m),T=o(p,!0);return n(T,m)}}}),2762:(function(e,t,r){"use strict";var o=r(1888),a=r(5298),i=r(9618),n=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,_,w,S,M){this.gl=l,this.type=_,this.handle=w,this.length=S,this.usage=M}var h=s.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)};function c(l,_,w,S,M,y){var b=M.length*M.BYTES_PER_ELEMENT;if(y<0)return l.bufferData(_,M,S),b;if(b+y>w)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(_,y,M),w}function m(l,_){for(var w=o.malloc(l.length,_),S=l.length,M=0;M=0;--S){if(_[S]!==w)return!1;w*=l[S]}return!0}h.update=function(l,_){if(typeof _!="number"&&(_=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var w=l.dtype;if(n.indexOf(w)<0&&(w="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&w!=="uint16"?w="uint32":w="uint16"}if(w===l.dtype&&p(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,l.data,_):this.length=c(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),_);else{var M=o.malloc(l.size,w),y=i(M,l.shape);a.assign(y,l),_<0?this.length=c(this.gl,this.type,this.length,this.usage,M,_):this.length=c(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),_),o.free(M)}}else if(Array.isArray(l)){var b;this.type===this.gl.ELEMENT_ARRAY_BUFFER?b=m(l,"uint16"):b=m(l,"float32"),_<0?this.length=c(this.gl,this.type,this.length,this.usage,b,_):this.length=c(this.gl,this.type,this.length,this.usage,b.subarray(0,l.length),_),o.free(b)}else if(typeof l=="object"&&typeof l.length=="number")this.length=c(this.gl,this.type,this.length,this.usage,l,_);else if(typeof l=="number"||l===void 0){if(_>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,_,w,S){if(w=w||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,w!==l.ARRAY_BUFFER&&w!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var M=l.createBuffer(),y=new s(l,w,M,0,S);return y.update(_),y}e.exports=T}),2825:(function(e){e.exports=t;function t(r,o,a){var i=new Float32Array(3);return i[0]=r,i[1]=o,i[2]=a,i}}),2931:(function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}}),2933:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}}),2953:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}}),2962:(function(e,t,r){"use strict";var o=r(5250),a=r(8210),i=r(3012),n=r(7004),s=6;function h(S,M,y,b){return function(u){return b(S(y(u[0][0],u[1][1]),y(-u[0][1],u[1][0])))}}function c(S,M,y,b){return function(u){return b(S(M(S(y(u[1][1],u[2][2]),y(-u[1][2],u[2][1])),u[0][0]),S(M(S(y(u[1][0],u[2][2]),y(-u[1][2],u[2][0])),-u[0][1]),M(S(y(u[1][0],u[2][1]),y(-u[1][1],u[2][0])),u[0][2]))))}}function m(S,M,y,b){return function(u){return b(S(S(M(S(M(S(y(u[2][2],u[3][3]),y(-u[2][3],u[3][2])),u[1][1]),S(M(S(y(u[2][1],u[3][3]),y(-u[2][3],u[3][1])),-u[1][2]),M(S(y(u[2][1],u[3][2]),y(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),M(S(M(S(y(u[2][2],u[3][3]),y(-u[2][3],u[3][2])),u[1][0]),S(M(S(y(u[2][0],u[3][3]),y(-u[2][3],u[3][0])),-u[1][2]),M(S(y(u[2][0],u[3][2]),y(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),S(M(S(M(S(y(u[2][1],u[3][3]),y(-u[2][3],u[3][1])),u[1][0]),S(M(S(y(u[2][0],u[3][3]),y(-u[2][3],u[3][0])),-u[1][1]),M(S(y(u[2][0],u[3][1]),y(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),M(S(M(S(y(u[2][1],u[3][2]),y(-u[2][2],u[3][1])),u[1][0]),S(M(S(y(u[2][0],u[3][2]),y(-u[2][2],u[3][0])),-u[1][1]),M(S(y(u[2][0],u[3][1]),y(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function p(S,M,y,b){return function(u){return b(S(S(M(S(S(M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][2]),S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),-u[2][3]),M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][1]),S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),-u[2][3]),M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),S(M(S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),u[2][1]),S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),-u[2][2]),M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),M(S(M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][1]),S(M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),-u[2][2]),M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),M(S(S(M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][2]),S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),-u[2][3]),M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][3]),M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),S(M(S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][2]),M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),M(S(M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][0]),S(M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),-u[2][2]),M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),S(M(S(S(M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][1]),S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),-u[2][3]),M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),M(S(M(S(y(u[3][3],u[4][4]),y(-u[3][4],u[4][3])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][3]),M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),S(M(S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),M(S(M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),S(M(S(S(M(S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),u[2][1]),S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),-u[2][2]),M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),M(S(M(S(y(u[3][2],u[4][4]),y(-u[3][4],u[4][2])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][2]),M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),S(M(S(M(S(y(u[3][1],u[4][4]),y(-u[3][4],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][4]),y(-u[3][4],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),M(S(M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),M(S(S(M(S(M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][1]),S(M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),-u[2][2]),M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),M(S(M(S(y(u[3][2],u[4][3]),y(-u[3][3],u[4][2])),u[2][0]),S(M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),-u[2][2]),M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),S(M(S(M(S(y(u[3][1],u[4][3]),y(-u[3][3],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][3]),y(-u[3][3],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),M(S(M(S(y(u[3][1],u[4][2]),y(-u[3][2],u[4][1])),u[2][0]),S(M(S(y(u[3][0],u[4][2]),y(-u[3][2],u[4][0])),-u[2][1]),M(S(y(u[3][0],u[4][1]),y(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function T(S){var M=S===2?h:S===3?c:S===4?m:S===5?p:void 0;return M(a,i,o,n)}var l=[function(){return[0]},function(M){return[M[0][0]]}];function _(S,M,y,b,v,u,g,f){return function(L){switch(L.length){case 0:return S(L);case 1:return M(L);case 2:return y(L);case 3:return b(L);case 4:return v(L);case 5:return u(L)}var z=g[L.length];return z||(z=g[L.length]=f(L.length)),z(L)}}function w(){for(;l.length0){P=c[F][g][0],z=F;break}L=P[z^1];for(var B=0;B<2;++B)for(var O=c[B][g],I=0;I0&&(P=N,L=U,z=B)}return f||P&&l(P,z),L}function w(u,g){var f=c[g][u][0],P=[u];l(f,g);for(var L=f[g^1],z=g;;){for(;L!==u;)P.push(L),L=_(P[P.length-2],L,!1);if(c[0][u].length+c[1][u].length===0)break;var F=P[P.length-1],B=u,O=P[1],I=_(F,B,!0);if(o(n[F],n[B],n[O],n[I])<0)break;P.push(u),L=_(F,B)}return P}function S(u,g){return g[1]===g[g.length-1]}for(var m=0;m0;){var b=c[0][m].length,v=w(m,M);S(y,v)?y.push.apply(y,v):(y.length>0&&T.push(y),y=v)}y.length>0&&T.push(y)}return T}}),3090:(function(e,t,r){"use strict";e.exports=a;var o=r(3250)[3];function a(i){var n=i.length;if(n<3){for(var _=new Array(n),s=0;s1&&o(i[c[l-2]],i[c[l-1]],T)<=0;)l-=1,c.pop();for(c.push(p),l=m.length;l>1&&o(i[m[l-2]],i[m[l-1]],T)>=0;)l-=1,m.pop();m.push(p)}for(var _=new Array(m.length+c.length-2),w=0,s=0,S=c.length;s0;--M)_[w++]=m[M];return _}}),3105:(function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,h=n,c=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--c;i[n]=h<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}}),3126:(function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}}),3134:(function(e,t,r){"use strict";e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var h=0;h=0}function c(m,p,T,l){var _=o(p,T,l);if(_===0){var w=a(o(m,p,T)),S=a(o(m,p,l));if(w===S){if(w===0){var M=h(m,p,T),y=h(m,p,l);return M===y?0:M?1:-1}return 0}else{if(S===0)return w>0||h(m,p,l)?-1:1;if(w===0)return S>0||h(m,p,T)?1:-1}return a(S-w)}var b=o(m,p,T);if(b>0)return _>0&&o(m,p,l)>0?1:-1;if(b<0)return _>0||o(m,p,l)>0?1:-1;var v=o(m,p,l);return v>0||h(m,p,T)?1:-1}}),3202:(function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}}),3233:(function(e){"use strict";var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}}),3236:(function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a0){if(z<=0)return F;B=L+z}else if(L<0){if(z>=0)return F;B=-(L+z)}else return F;var O=c*B;return F>=O||F<=-O?F:w(g,f,P)},function(g,f,P,L){var z=g[0]-L[0],F=f[0]-L[0],B=P[0]-L[0],O=g[1]-L[1],I=f[1]-L[1],N=P[1]-L[1],U=g[2]-L[2],W=f[2]-L[2],Q=P[2]-L[2],le=F*N,se=B*I,he=B*O,q=z*N,$=z*I,J=F*O,X=U*(le-se)+W*(he-q)+Q*($-J),oe=(Math.abs(le)+Math.abs(se))*Math.abs(U)+(Math.abs(he)+Math.abs(q))*Math.abs(W)+(Math.abs($)+Math.abs(J))*Math.abs(Q),ne=m*oe;return X>ne||-X>ne?X:S(g,f,P,L)}];function y(u){var g=M[u.length];return g||(g=M[u.length]=_(u.length)),g.apply(void 0,u)}function b(u,g,f,P,L,z,F){return function(O,I,N,U,W){switch(arguments.length){case 0:case 1:return 0;case 2:return P(O,I);case 3:return L(O,I,N);case 4:return z(O,I,N,U);case 5:return F(O,I,N,U,W)}for(var Q=new Array(arguments.length),le=0;le4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":h["uniform"+W+"iv"](p[z],F);break;case"v":h["uniform"+W+"fv"](p[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(W=U.charCodeAt(U.length-1)-48,W<2||W>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);h["uniformMatrix"+W+"fv"](p[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+U)}}}}}function _(b,v){if(typeof v!="object")return[[b,v]];var u=[];for(var g in v){var f=v[g],P=b;parseInt(g)+""===g?P+="["+g+"]":P+="."+g,typeof f=="object"?u.push.apply(u,_(P,f)):u.push([P,f])}return u}function w(b){switch(b){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var v=b.indexOf("vec");if(0<=v&&v<=1&&b.length===4+v){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return b.charAt(0)==="b"?n(u,!1):n(u,0)}else if(b.indexOf("mat")===0&&b.length===4){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+b);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+b)}}function S(b,v,u){if(typeof u=="object"){var g=M(u);Object.defineProperty(b,v,{get:i(g),set:l(u),enumerable:!0,configurable:!1})}else p[u]?Object.defineProperty(b,v,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):b[v]=w(m[u].type)}function M(b){var v;if(Array.isArray(b)){v=new Array(b.length);for(var u=0;u=0!=v>=0&&p.push(w[0]+.5+.5*(b+v)/(b-v))}m+=y,++w[0]}}}function r(){return t()}var o=r;function a(s){var h={};return function(m,p,T){var l=m.dtype,_=m.order,w=[l,_.join()].join(),S=h[w];return S||(h[w]=S=s([l,_])),S(m.shape.slice(0),m.data,m.stride,m.offset|0,p,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})}),3352:(function(e,t,r){"use strict";var o=r(2478),a=0,i=1,n=2;e.exports=g;function s(f,P,L,z,F){this.mid=f,this.left=P,this.right=L,this.leftPoints=z,this.rightPoints=F,this.count=(P?P.count:0)+(L?L.count:0)+z.length}var h=s.prototype;function c(f,P){f.mid=P.mid,f.left=P.left,f.right=P.right,f.leftPoints=P.leftPoints,f.rightPoints=P.rightPoints,f.count=P.count}function m(f,P){var L=b(P);f.mid=L.mid,f.left=L.left,f.right=L.right,f.leftPoints=L.leftPoints,f.rightPoints=L.rightPoints,f.count=L.count}function p(f,P){var L=f.intervals([]);L.push(P),m(f,L)}function T(f,P){var L=f.intervals([]),z=L.indexOf(P);return z<0?a:(L.splice(z,1),m(f,L),i)}h.intervals=function(f){return f.push.apply(f,this.leftPoints),this.left&&this.left.intervals(f),this.right&&this.right.intervals(f),f},h.insert=function(f){var P=this.count-this.leftPoints.length;if(this.count+=1,f[1]3*(P+1)?p(this,f):this.left.insert(f):this.left=b([f]);else if(f[0]>this.mid)this.right?4*(this.right.count+1)>3*(P+1)?p(this,f):this.right.insert(f):this.right=b([f]);else{var L=o.ge(this.leftPoints,f,M),z=o.ge(this.rightPoints,f,y);this.leftPoints.splice(L,0,f),this.rightPoints.splice(z,0,f)}},h.remove=function(f){var P=this.count-this.leftPoints;if(f[1]3*(P-1))return T(this,f);var z=this.left.remove(f);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(f[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(P-1))return T(this,f);var z=this.right.remove(f);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===f?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===f){if(this.left&&this.right){for(var B=this,O=this.left;O.right;)B=O,O=O.right;if(B===this)O.right=this.right;else{var I=this.left,z=this.right;B.count-=O.count,B.right=O.left,O.left=I,O.right=z}c(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return i}for(var I=o.ge(this.leftPoints,f,M);I=0&&f[z][1]>=P;--z){var F=L(f[z]);if(F)return F}}function w(f,P){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(f,P);if(L)return L}return _(this.rightPoints,f,P)}else return w(this.leftPoints,P)},h.queryInterval=function(f,P,L){if(fthis.mid&&this.right){var z=this.right.queryInterval(f,P,L);if(z)return z}return Pthis.mid?_(this.rightPoints,f,L):w(this.leftPoints,L)};function S(f,P){return f-P}function M(f,P){var L=f[0]-P[0];return L||f[1]-P[1]}function y(f,P){var L=f[1]-P[1];return L||f[0]-P[0]}function b(f){if(f.length===0)return null;for(var P=[],L=0;L>1],F=[],B=[],O=[],L=0;L=0),y.type){case"b":_=parseInt(_,10).toString(2);break;case"c":_=String.fromCharCode(parseInt(_,10));break;case"d":case"i":_=parseInt(_,10);break;case"j":_=JSON.stringify(_,null,y.width?parseInt(y.width):0);break;case"e":_=y.precision?parseFloat(_).toExponential(y.precision):parseFloat(_).toExponential();break;case"f":_=y.precision?parseFloat(_).toFixed(y.precision):parseFloat(_);break;case"g":_=y.precision?String(Number(_.toPrecision(y.precision))):parseFloat(_);break;case"o":_=(parseInt(_,10)>>>0).toString(8);break;case"s":_=String(_),_=y.precision?_.substring(0,y.precision):_;break;case"t":_=String(!!_),_=y.precision?_.substring(0,y.precision):_;break;case"T":_=Object.prototype.toString.call(_).slice(8,-1).toLowerCase(),_=y.precision?_.substring(0,y.precision):_;break;case"u":_=parseInt(_,10)>>>0;break;case"v":_=_.valueOf(),_=y.precision?_.substring(0,y.precision):_;break;case"x":_=(parseInt(_,10)>>>0).toString(16);break;case"X":_=(parseInt(_,10)>>>0).toString(16).toUpperCase();break}a.json.test(y.type)?w+=_:(a.number.test(y.type)&&(!g||y.sign)?(f=g?"+":"-",_=_.toString().replace(a.sign,"")):f="",v=y.pad_char?y.pad_char==="0"?"0":y.pad_char.charAt(1):" ",u=y.width-(f+_).length,b=y.width&&u>0?v.repeat(u):"",w+=y.align?f+_+b:v==="0"?f+b+_:b+f+_)}return w}var h=Object.create(null);function c(m){if(h[m])return h[m];for(var p=m,T,l=[],_=0;p;){if((T=a.text.exec(p))!==null)l.push(T[0]);else if((T=a.modulo.exec(p))!==null)l.push("%");else if((T=a.placeholder.exec(p))!==null){if(T[2]){_|=1;var w=[],S=T[2],M=[];if((M=a.key.exec(S))!==null)for(w.push(M[1]);(S=S.substring(M[0].length))!=="";)if((M=a.key_access.exec(S))!==null)w.push(M[1]);else if((M=a.index_access.exec(S))!==null)w.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=w}else _|=2;if(_===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");p=p.substring(T[0].length)}return h[m]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=function(){return{sprintf:i,vsprintf:n}}.call(t,r,t,e),o!==void 0&&(e.exports=o))})()}),3390:(function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}}),3436:(function(e,t,r){"use strict";var o=r(3236),a=r(9405),i=o([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position, offset; -attribute vec4 color; -uniform mat4 model, view, projection; -uniform float capSize; -varying vec4 fragColor; -varying vec3 fragPosition; - -void main() { - vec4 worldPosition = model * vec4(position, 1.0); - worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); - gl_Position = projection * (view * worldPosition); - fragColor = color; - fragPosition = position; -}`]),n=o([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); + fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2]; } +`]),n=o([`precision mediump float; +#define GLSLIFY 1 -uniform vec3 clipBounds[2]; -uniform float opacity; -varying vec3 fragPosition; varying vec4 fragColor; void main() { - if ( - outOfRange(clipBounds[0], clipBounds[1], fragPosition) || - fragColor.a * opacity == 0. - ) discard; - - gl_FragColor = opacity * fragColor; -}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}}),3502:(function(e,t,r){e.exports=i;var o=r(5995),a=r(9127);function i(n,s){return a(o(n,s))}}),3508:(function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])}),3536:(function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=a*a+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}}),3545:(function(e,t,r){"use strict";e.exports=s;var o=r(8105),a=o("lom&&T[b+c]>M;--y,b-=_){for(var v=b,u=b+_,g=0;g<_;++g,++v,++u){var f=T[v];T[v]=T[u],T[u]=f}var P=l[y];l[y]=l[y-1],l[y-1]=P}}function s(h,c,m,p,T,l){if(p<=m+1)return m;for(var _=m,w=p,S=p+m>>>1,M=2*h,y=S,b=T[M*S+c];_=P?(y=f,b=P):g>=z?(y=u,b=g):(y=L,b=z):P>=z?(y=f,b=P):z>=g?(y=u,b=g):(y=L,b=z);for(var O=M*(w-1),I=M*y,F=0;Fthis.buffer.length){a.free(this.buffer);for(var w=this.buffer=a.mallocUint8(n(_*l*4)),S=0;S<_*l*4;++S)w[S]=255}return T}}}),m.begin=function(){var T=this.gl,l=this.shape;T&&(this.fbo.bind(),T.clearColor(1,1,1,1),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT))},m.end=function(){var T=this.gl;T&&(T.bindFramebuffer(T.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},m.query=function(T,l,_){if(!this.gl)return null;var w=this.fbo.shape.slice();T=T|0,l=l|0,typeof _!="number"&&(_=1);var S=Math.min(Math.max(T-_,0),w[0])|0,M=Math.min(Math.max(T+_,0),w[0])|0,y=Math.min(Math.max(l-_,0),w[1])|0,b=Math.min(Math.max(l+_,0),w[1])|0;if(M<=S||b<=y)return null;var v=[M-S,b-y],u=i(this.buffer,[v[0],v[1],4],[4,w[0]*4,1],4*(S+w[0]*y)),g=s(u.hi(v[0],v[1],1),_,_),f=g[0],P=g[1];if(f<0||Math.pow(this.radius,2)y|0},vertex:function(w,S,M,y,b,v,u,g,f,P,L,z,F){var B=(u<<0)+(g<<1)+(f<<2)+(P<<3)|0;if(!(B===0||B===15))switch(B){case 0:L.push([w-.5,S-.5]);break;case 1:L.push([w-.25-.25*(y+M-2*F)/(M-y),S-.25-.25*(b+M-2*F)/(M-b)]);break;case 2:L.push([w-.75-.25*(-y-M+2*F)/(y-M),S-.25-.25*(v+y-2*F)/(y-v)]);break;case 3:L.push([w-.5,S-.5-.5*(b+M+v+y-4*F)/(M-b+y-v)]);break;case 4:L.push([w-.25-.25*(v+b-2*F)/(b-v),S-.75-.25*(-b-M+2*F)/(b-M)]);break;case 5:L.push([w-.5-.5*(y+M+v+b-4*F)/(M-y+b-v),S-.5]);break;case 6:L.push([w-.5-.25*(-y-M+v+b)/(y-M+b-v),S-.5-.25*(-b-M+v+y)/(b-M+y-v)]);break;case 7:L.push([w-.75-.25*(v+b-2*F)/(b-v),S-.75-.25*(v+y-2*F)/(y-v)]);break;case 8:L.push([w-.75-.25*(-v-b+2*F)/(v-b),S-.75-.25*(-v-y+2*F)/(v-y)]);break;case 9:L.push([w-.5-.25*(y+M+-v-b)/(M-y+v-b),S-.5-.25*(b+M+-v-y)/(M-b+v-y)]);break;case 10:L.push([w-.5-.5*(-y-M+-v-b+4*F)/(y-M+v-b),S-.5]);break;case 11:L.push([w-.25-.25*(-v-b+2*F)/(v-b),S-.75-.25*(b+M-2*F)/(M-b)]);break;case 12:L.push([w-.5,S-.5-.5*(-b-M+-v-y+4*F)/(b-M+v-y)]);break;case 13:L.push([w-.75-.25*(y+M-2*F)/(M-y),S-.25-.25*(-v-y+2*F)/(v-y)]);break;case 14:L.push([w-.25-.25*(-y-M+2*F)/(y-M),S-.25-.25*(-b-M+2*F)/(b-M)]);break;case 15:L.push([w-.5,S-.5]);break}},cell:function(w,S,M,y,b,v,u,g,f){b?g.push([w,S]):g.push([S,w])}});return function(_,w){var S=[],M=[];return l(_,S,M,w),{positions:S,cells:M}}}};function n(m,p){var T=m.length+"d",l=i[T];if(l)return l(o,m,p)}function s(m,p){for(var T=a(m,p),l=T.length,_=new Array(l),w=new Array(l),S=0;S>1,T=-7,l=a?n-1:0,_=a?-1:1,w=r[o+l];for(l+=_,s=w&(1<<-T)-1,w>>=-T,T+=c;T>0;s=s*256+r[o+l],l+=_,T-=8);for(h=s&(1<<-T)-1,s>>=-T,T+=i;T>0;h=h*256+r[o+l],l+=_,T-=8);if(s===0)s=1-p;else{if(s===m)return h?NaN:(w?-1:1)*(1/0);h=h+Math.pow(2,i),s=s-p}return(w?-1:1)*h*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var h,c,m,p=s*8-n-1,T=(1<>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:s-1,S=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,h=T):(h=Math.floor(Math.log(o)/Math.LN2),o*(m=Math.pow(2,-h))<1&&(h--,m*=2),h+l>=1?o+=_/m:o+=_*Math.pow(2,1-l),o*m>=2&&(h++,m/=2),h+l>=T?(c=0,h=T):h+l>=1?(c=(o*m-1)*Math.pow(2,n),h=h+l):(c=o*Math.pow(2,l-1)*Math.pow(2,n),h=0));n>=8;r[a+w]=c&255,w+=S,c/=256,n-=8);for(h=h<0;r[a+w]=h&255,w+=S,h/=256,p-=8);r[a+w-S]|=M*128}}),3788:(function(e,t,r){"use strict";var o=r(8507),a=r(2419);e.exports=i;function i(n,s){return o(n,s)||a(n)-a(s)}}),3837:(function(e,t,r){"use strict";e.exports=L;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,m=DataView;function p(z){return c.isView(z)&&!(z instanceof m)}function T(z){return Array.isArray(z)||p(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function _(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var w=_.prototype;w.update=function(z){z=z||{};function F(X,oe,ne){if(ne in z){var j=z[ne],ee=this[ne],re;(X?T(j)&&T(j[0]):T(j))?this[ne]=re=[oe(j[0]),oe(j[1]),oe(j[2])]:this[ne]=re=[oe(j),oe(j),oe(j)];for(var ue=0;ue<3;++ue)if(re[ue]!==ee[ue])return!0}return!1}var B=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),I=F.bind(this,!1,String),N=F.bind(this,!0,function(X){if(T(X)){if(X.length===3)return[+X[0],+X[1],+X[2],1];if(X.length===4)return[+X[0],+X[1],+X[2],+X[3]]}return[0,0,0,1]}),U,W=!1,Q=!1;if("bounds"in z)for(var le=z.bounds,se=0;se<2;++se)for(var he=0;he<3;++he)le[se][he]!==this.bounds[se][he]&&(Q=!0),this.bounds[se][he]=le[se][he];if("ticks"in z){U=z.ticks,W=!0,this.autoTicks=!1;for(var se=0;se<3;++se)this.tickSpacing[se]=0}else B("tickSpacing")&&(this.autoTicks=!0,Q=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),Q=!0,W=!0,this._firstInit=!1),Q&&this.autoTicks&&(U=s.create(this.bounds,this.tickSpacing),W=!0),W){for(var se=0;se<3;++se)U[se].sort(function(oe,ne){return oe.x-ne.x});s.equal(U,this.ticks)?W=!1:this.ticks=U}O("tickEnable"),I("tickFont")&&(W=!0),I("tickFontStyle")&&(W=!0),I("tickFontWeight")&&(W=!0),I("tickFontVariant")&&(W=!0),B("tickSize"),B("tickAngle"),B("tickPad"),N("tickColor");var q=I("labels");I("labelFont")&&(q=!0),I("labelFontStyle")&&(q=!0),I("labelFontWeight")&&(q=!0),I("labelFontVariant")&&(q=!0),O("labelEnable"),B("labelSize"),B("labelPad"),N("labelColor"),O("lineEnable"),O("lineMirror"),B("lineWidth"),N("lineColor"),O("lineTickEnable"),O("lineTickMirror"),B("lineTickLength"),B("lineTickWidth"),N("lineTickColor"),O("gridEnable"),B("gridWidth"),N("gridColor"),O("zeroEnable"),N("zeroLineColor"),B("zeroLineWidth"),O("backgroundEnable"),N("backgroundColor");var $=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],J=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(q||W)&&this._text.update(this.bounds,this.labels,$,this.ticks,J):this._text=o(this.gl,this.bounds,this.labels,$,this.ticks,J),this._lines&&W&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new S,new S,new S];function y(z,F,B,O,I){for(var N=z.primalOffset,U=z.primalMinor,W=z.mirrorOffset,Q=z.mirrorMinor,le=O[F],se=0;se<3;++se)if(F!==se){var he=N,q=W,$=U,J=Q;le&1<0?($[se]=-1,J[se]=0):($[se]=0,J[se]=1)}}var b=[0,0,0],v={model:h,view:h,projection:h,_ortho:!1};w.isOpaque=function(){return!0},w.isTransparent=function(){return!1},w.drawTransparent=function(z){};var u=0,g=[0,0,0],f=[0,0,0],P=[0,0,0];w.draw=function(z){z=z||v;for(var ne=this.gl,F=z.model||h,B=z.view||h,O=z.projection||h,I=this.bounds,N=z._ortho||!1,U=n(F,B,O,I,N),W=U.cubeEdges,Q=U.axis,le=B[12],se=B[13],he=B[14],q=B[15],$=N?2:1,J=$*this.pixelRatio*(O[3]*le+O[7]*se+O[11]*he+O[15]*q)/ne.drawingBufferHeight,X=0;X<3;++X)this.lastCubeProps.cubeEdges[X]=W[X],this.lastCubeProps.axis[X]=Q[X];for(var oe=M,X=0;X<3;++X)y(M[X],X,this.bounds,W,Q);for(var ne=this.gl,j=b,X=0;X<3;++X)this.backgroundEnable[X]?j[X]=Q[X]:j[X]=0;this._background.draw(F,B,O,I,j,this.backgroundColor),this._lines.bind(F,B,O,this);for(var X=0;X<3;++X){var ee=[0,0,0];Q[X]>0?ee[X]=I[1][X]:ee[X]=I[0][X];for(var re=0;re<2;++re){var ue=(X+1+re)%3,_e=(X+1+(re^1))%3;this.gridEnable[ue]&&this._lines.drawGrid(ue,_e,this.bounds,ee,this.gridColor[ue],this.gridWidth[ue]*this.pixelRatio)}for(var re=0;re<2;++re){var ue=(X+1+re)%3,_e=(X+1+(re^1))%3;this.zeroEnable[_e]&&Math.min(I[0][_e],I[1][_e])<=0&&Math.max(I[0][_e],I[1][_e])>=0&&this._lines.drawZero(ue,_e,this.bounds,ee,this.zeroLineColor[_e],this.zeroLineWidth[_e]*this.pixelRatio)}}for(var X=0;X<3;++X){this.lineEnable[X]&&this._lines.drawAxisLine(X,this.bounds,oe[X].primalOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio),this.lineMirror[X]&&this._lines.drawAxisLine(X,this.bounds,oe[X].mirrorOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio);for(var Te=l(g,oe[X].primalMinor),Ie=l(f,oe[X].mirrorMinor),De=this.lineTickLength,re=0;re<3;++re){var He=J/F[5*re];Te[re]*=De[re]*He,Ie[re]*=De[re]*He}this.lineTickEnable[X]&&this._lines.drawAxisTicks(X,oe[X].primalOffset,Te,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio),this.lineTickMirror[X]&&this._lines.drawAxisTicks(X,oe[X].mirrorOffset,Ie,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,B,O,this.pixelRatio);var et,rt=.5,$e,ot;function Ae(Ke){ot=[0,0,0],ot[Ke]=1}function ge(Ke,kt,Et){var Bt=(Ke+1)%3,jt=(Ke+2)%3,_r=kt[Bt],pr=kt[jt],Or=Et[Bt],mr=Et[jt];if(_r>0&&mr>0){Ae(Bt);return}else if(_r>0&&mr<0){Ae(Bt);return}else if(_r<0&&mr>0){Ae(Bt);return}else if(_r<0&&mr<0){Ae(Bt);return}else if(pr>0&&Or>0){Ae(jt);return}else if(pr>0&&Or<0){Ae(jt);return}else if(pr<0&&Or>0){Ae(jt);return}else if(pr<0&&Or<0){Ae(jt);return}}for(var X=0;X<3;++X){for(var ce=oe[X].primalMinor,ze=oe[X].mirrorMinor,Qe=l(P,oe[X].primalOffset),re=0;re<3;++re)this.lineTickEnable[X]&&(Qe[re]+=J*ce[re]*Math.max(this.lineTickLength[re],0)/F[5*re]);var nt=[0,0,0];if(nt[X]=1,this.tickEnable[X]){this.tickAngle[X]===-3600?(this.tickAngle[X]=0,this.tickAlign[X]="auto"):this.tickAlign[X]=-1,$e=1,et=[this.tickAlign[X],rt,$e],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]),ot=[0,0,0],ge(X,ce,ze);for(var re=0;re<3;++re)Qe[re]+=J*ce[re]*this.tickPad[re]/F[5*re];this._text.drawTicks(X,this.tickSize[X],this.tickAngle[X],Qe,this.tickColor[X],nt,ot,et)}if(this.labelEnable[X]){$e=0,ot=[0,0,0],this.labels[X].length>4&&(Ae(X),$e=1),et=[this.labelAlign[X],rt,$e],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]);for(var re=0;re<3;++re)Qe[re]+=J*ce[re]*this.labelPad[re]/F[5*re];Qe[X]+=.5*(I[0][X]+I[1][X]),this._text.drawLabel(X,this.labelSize[X],this.labelAngle[X],Qe,this.labelColor[X],[0,0,0],ot,et)}}this._text.unbind()},w.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(z,F){var B=new _(z);return B.update(F),B}}),3840:(function(e){"use strict";e.exports=M;var t=0,r=1;function o(y,b,v,u,g,f){this._color=y,this.key=b,this.value=v,this.left=u,this.right=g,this._count=f}function a(y){return new o(y._color,y.key,y.value,y.left,y.right,y._count)}function i(y,b){return new o(y,b.key,b.value,b.left,b.right,b._count)}function n(y){y._count=1+(y.left?y.left._count:0)+(y.right?y.right._count:0)}function s(y,b){this._compare=y,this.root=b}var h=s.prototype;Object.defineProperty(h,"keys",{get:function(){var y=[];return this.forEach(function(b,v){y.push(b)}),y}}),Object.defineProperty(h,"values",{get:function(){var y=[];return this.forEach(function(b,v){y.push(v)}),y}}),Object.defineProperty(h,"length",{get:function(){return this.root?this.root._count:0}}),h.insert=function(y,b){for(var v=this._compare,u=this.root,g=[],f=[];u;){var P=v(y,u.key);g.push(u),f.push(P),P<=0?u=u.left:u=u.right}g.push(new o(t,y,b,null,null,1));for(var L=g.length-2;L>=0;--L){var u=g[L];f[L]<=0?g[L]=new o(u._color,u.key,u.value,g[L+1],u.right,u._count+1):g[L]=new o(u._color,u.key,u.value,u.left,g[L+1],u._count+1)}for(var L=g.length-1;L>1;--L){var z=g[L-1],u=g[L];if(z._color===r||u._color===r)break;var F=g[L-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,g[L-2]=z,g[L-1]=u,n(F),n(z),L>=3){var O=g[L-3];O.left===F?O.left=z:O.right=z}break}}else{var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,L-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,g[L-2]=u,g[L-1]=z,n(F),n(z),n(u),L>=3){var O=g[L-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,g[L-2]=z,g[L-1]=u,n(F),n(z),L>=3){var O=g[L-3];O.right===F?O.right=z:O.left=z}break}}else{var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,L-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,g[L-2]=u,g[L-1]=z,n(F),n(z),n(u),L>=3){var O=g[L-3];O.right===F?O.right=u:O.left=u}break}}}return g[0]._color=r,new s(v,g[0])};function c(y,b){if(b.left){var v=c(y,b.left);if(v)return v}var v=y(b.key,b.value);if(v)return v;if(b.right)return c(y,b.right)}function m(y,b,v,u){var g=b(y,u.key);if(g<=0){if(u.left){var f=m(y,b,v,u.left);if(f)return f}var f=v(u.key,u.value);if(f)return f}if(u.right)return m(y,b,v,u.right)}function p(y,b,v,u,g){var f=v(y,g.key),P=v(b,g.key),L;if(f<=0&&(g.left&&(L=p(y,b,v,u,g.left),L)||P>0&&(L=u(g.key,g.value),L)))return L;if(P>0&&g.right)return p(y,b,v,u,g.right)}h.forEach=function(b,v,u){if(this.root)switch(arguments.length){case 1:return c(b,this.root);case 2:return m(v,this._compare,b,this.root);case 3:return this._compare(v,u)>=0?void 0:p(v,u,this._compare,b,this.root)}},Object.defineProperty(h,"begin",{get:function(){for(var y=[],b=this.root;b;)y.push(b),b=b.left;return new T(this,y)}}),Object.defineProperty(h,"end",{get:function(){for(var y=[],b=this.root;b;)y.push(b),b=b.right;return new T(this,y)}}),h.at=function(y){if(y<0)return new T(this,[]);for(var b=this.root,v=[];;){if(v.push(b),b.left){if(y=b.right._count)break;b=b.right}else break}return new T(this,[])},h.ge=function(y){for(var b=this._compare,v=this.root,u=[],g=0;v;){var f=b(y,v.key);u.push(v),f<=0&&(g=u.length),f<=0?v=v.left:v=v.right}return u.length=g,new T(this,u)},h.gt=function(y){for(var b=this._compare,v=this.root,u=[],g=0;v;){var f=b(y,v.key);u.push(v),f<0&&(g=u.length),f<0?v=v.left:v=v.right}return u.length=g,new T(this,u)},h.lt=function(y){for(var b=this._compare,v=this.root,u=[],g=0;v;){var f=b(y,v.key);u.push(v),f>0&&(g=u.length),f<=0?v=v.left:v=v.right}return u.length=g,new T(this,u)},h.le=function(y){for(var b=this._compare,v=this.root,u=[],g=0;v;){var f=b(y,v.key);u.push(v),f>=0&&(g=u.length),f<0?v=v.left:v=v.right}return u.length=g,new T(this,u)},h.find=function(y){for(var b=this._compare,v=this.root,u=[];v;){var g=b(y,v.key);if(u.push(v),g===0)return new T(this,u);g<=0?v=v.left:v=v.right}return new T(this,[])},h.remove=function(y){var b=this.find(y);return b?b.remove():this},h.get=function(y){for(var b=this._compare,v=this.root;v;){var u=b(y,v.key);if(u===0)return v.value;u<=0?v=v.left:v=v.right}};function T(y,b){this.tree=y,this._stack=b}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function _(y,b){y.key=b.key,y.value=b.value,y.left=b.left,y.right=b.right,y._color=b._color,y._count=b._count}function w(y){for(var b,v,u,g,f=y.length-1;f>=0;--f){if(b=y[f],f===0){b._color=r;return}if(v=y[f-1],v.left===b){if(u=v.right,u.right&&u.right._color===t){if(u=v.right=a(u),g=u.right=a(u.right),v.right=u.left,u.left=v,u.right=g,u._color=v._color,b._color=r,v._color=r,g._color=r,n(v),n(u),f>1){var P=y[f-2];P.left===v?P.left=u:P.right=u}y[f-1]=u;return}else if(u.left&&u.left._color===t){if(u=v.right=a(u),g=u.left=a(u.left),v.right=g.left,u.left=g.right,g.left=v,g.right=u,g._color=v._color,v._color=r,u._color=r,b._color=r,n(v),n(u),n(g),f>1){var P=y[f-2];P.left===v?P.left=g:P.right=g}y[f-1]=g;return}if(u._color===r)if(v._color===t){v._color=r,v.right=i(t,u);return}else{v.right=i(t,u);continue}else{if(u=a(u),v.right=u.left,u.left=v,u._color=v._color,v._color=t,n(v),n(u),f>1){var P=y[f-2];P.left===v?P.left=u:P.right=u}y[f-1]=u,y[f]=v,f+11){var P=y[f-2];P.right===v?P.right=u:P.left=u}y[f-1]=u;return}else if(u.right&&u.right._color===t){if(u=v.left=a(u),g=u.right=a(u.right),v.left=g.right,u.right=g.left,g.right=v,g.left=u,g._color=v._color,v._color=r,u._color=r,b._color=r,n(v),n(u),n(g),f>1){var P=y[f-2];P.right===v?P.right=g:P.left=g}y[f-1]=g;return}if(u._color===r)if(v._color===t){v._color=r,v.left=i(t,u);return}else{v.left=i(t,u);continue}else{if(u=a(u),v.left=u.right,u.right=v,u._color=v._color,v._color=t,n(v),n(u),f>1){var P=y[f-2];P.right===v?P.right=u:P.left=u}y[f-1]=u,y[f]=v,f+1=0;--u){var v=y[u];v.left===y[u+1]?b[u]=new o(v._color,v.key,v.value,b[u+1],v.right,v._count):b[u]=new o(v._color,v.key,v.value,v.left,b[u+1],v._count)}if(v=b[b.length-1],v.left&&v.right){var g=b.length;for(v=v.left;v.right;)b.push(v),v=v.right;var f=b[g-1];b.push(new o(v._color,f.key,f.value,v.left,v.right,v._count)),b[g-1].key=v.key,b[g-1].value=v.value;for(var u=b.length-2;u>=g;--u)v=b[u],b[u]=new o(v._color,v.key,v.value,v.left,b[u+1],v._count);b[g-1].left=b[g]}if(v=b[b.length-1],v._color===t){var P=b[b.length-2];P.left===v?P.left=null:P.right===v&&(P.right=null),b.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var y=0,b=this._stack;if(b.length===0){var v=this.tree.root;return v?v._count:0}else b[b.length-1].left&&(y=b[b.length-1].left._count);for(var u=b.length-2;u>=0;--u)b[u+1]===b[u].right&&(++y,b[u].left&&(y+=b[u].left._count));return y},enumerable:!0}),l.next=function(){var y=this._stack;if(y.length!==0){var b=y[y.length-1];if(b.right)for(b=b.right;b;)y.push(b),b=b.left;else for(y.pop();y.length>0&&y[y.length-1].right===b;)b=y[y.length-1],y.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var y=this._stack;if(y.length===0)return!1;if(y[y.length-1].right)return!0;for(var b=y.length-1;b>0;--b)if(y[b-1].left===y[b])return!0;return!1}}),l.update=function(y){var b=this._stack;if(b.length===0)throw new Error("Can't update empty node!");var v=new Array(b.length),u=b[b.length-1];v[v.length-1]=new o(u._color,u.key,y,u.left,u.right,u._count);for(var g=b.length-2;g>=0;--g)u=b[g],u.left===b[g+1]?v[g]=new o(u._color,u.key,u.value,v[g+1],u.right,u._count):v[g]=new o(u._color,u.key,u.value,u.left,v[g+1],u._count);return new s(this.tree._compare,v[0])},l.prev=function(){var y=this._stack;if(y.length!==0){var b=y[y.length-1];if(b.left)for(b=b.left;b;)y.push(b),b=b.right;else for(y.pop();y.length>0&&y[y.length-1].left===b;)b=y[y.length-1],y.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var y=this._stack;if(y.length===0)return!1;if(y[y.length-1].left)return!0;for(var b=y.length-1;b>0;--b)if(y[b-1].right===y[b])return!0;return!1}});function S(y,b){return yb?1:0}function M(y){return new s(y||S,null)}}),3865:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}}),3952:(function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){for(var h=new Array(s+1),c=0;c20?52:h+32}}),4040:(function(e){e.exports=t;function t(r,o,a,i,n,s,h){var c=1/(o-a),m=1/(i-n),p=1/(s-h);return r[0]=-2*c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*m,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*p,r[11]=0,r[12]=(o+a)*c,r[13]=(n+i)*m,r[14]=(h+s)*p,r[15]=1,r}}),4041:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[0],c=a[1],m=a[2],p=a[3],T=p*i+c*s-m*n,l=p*n+m*i-h*s,_=p*s+h*n-c*i,w=-h*i-c*n-m*s;return r[0]=T*p+w*-h+l*-m-_*-c,r[1]=l*p+w*-c+_*-h-T*-m,r[2]=_*p+w*-m+T*-c-l*-h,r[3]=o[3],r}}),4081:(function(e){"use strict";e.exports=t;function t(r,o,a,i,n,s,h,c,m,p){var T=o+s+p;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(h-m)/l,r[1]=.5*(c-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var _=Math.max(o,s,p),l=Math.sqrt(2*_-T+1);o>=_?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(c+i)/l,r[3]=.5*(h-m)/l):s>=_?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(m+h)/l,r[3]=.5*(c-i)/l):(r[0]=.5*(i+c)/l,r[1]=.5*(h+m)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}}),4100:(function(e,t,r){"use strict";var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),h=r(2260),c=r(7169),m=r(351),p=r(4772),T=r(4040),l=r(799),_=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:b,createCamera:o};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function S(u,g){var f=null;try{f=u.getContext("webgl",g),f||(f=u.getContext("experimental-webgl",g))}catch{return null}return f}function M(u){var g=Math.round(Math.log(Math.abs(u))/Math.log(10));if(g<0){var f=Math.round(Math.pow(10,-g));return Math.ceil(u*f)/f}else if(g>0){var f=Math.round(Math.pow(10,g));return Math.ceil(u/f)*f}return Math.ceil(u)}function y(u){return typeof u=="boolean"?u:!0}function b(u){u=u||{},u.camera=u.camera||{};var g=u.canvas;if(!g)if(g=document.createElement("canvas"),u.container){var f=u.container;f.appendChild(g)}else document.body.appendChild(g);var P=u.gl;if(P||(u.glOptions&&(_=!!u.glOptions.preserveDrawingBuffer),P=S(g,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:_})),!P)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new w,F=h(P,P.drawingBufferWidth,P.drawingBufferHeight,{preferFloat:!_}),B=l(P),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,I={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(P,N);U.enable=!N.disable;var W=u.spikes||{},Q=n(P,W),le=[],se=[],he=[],q=[],$=!0,ne=!0,J=new Array(16),X=new Array(16),oe={view:null,projection:J,model:X,_ortho:!1},ne=!0,j=[P.drawingBufferWidth,P.drawingBufferHeight],ee=u.cameraObject||o(g,I),re={gl:P,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:g,selection:z,camera:ee,axes:U,axesPixels:null,spikes:Q,bounds:L,objects:le,shape:j,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:y(u.autoResize),autoBounds:y(u.autoBounds),autoScale:!!u.autoScale,autoCenter:y(u.autoCenter),clipToBounds:y(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:oe,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ot){this.aspect[0]=ot.x,this.aspect[1]=ot.y,this.aspect[2]=ot.z,ne=!0},setBounds:function(ot,Ae){this.bounds[0][ot]=Ae.min,this.bounds[1][ot]=Ae.max},setClearColor:function(ot){this.clearColor=ot},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},ue=[P.drawingBufferWidth/re.pixelRatio|0,P.drawingBufferHeight/re.pixelRatio|0];function _e(){if(!re._stopped&&re.autoResize){var ot=g.parentNode,Ae=1,ge=1;ot&&ot!==document.body?(Ae=ot.clientWidth,ge=ot.clientHeight):(Ae=window.innerWidth,ge=window.innerHeight);var ce=Math.ceil(Ae*re.pixelRatio)|0,ze=Math.ceil(ge*re.pixelRatio)|0;if(ce!==g.width||ze!==g.height){g.width=ce,g.height=ze;var Qe=g.style;Qe.position=Qe.position||"absolute",Qe.left="0px",Qe.top="0px",Qe.width=Ae+"px",Qe.height=ge+"px",$=!0}}}re.autoResize&&_e(),window.addEventListener("resize",_e);function Te(){for(var ot=le.length,Ae=q.length,ge=0;ge0&&he[Ae-1]===0;)he.pop(),q.pop().dispose()}re.update=function(ot){re._stopped||(ot=ot||{},$=!0,ne=!0)},re.add=function(ot){re._stopped||(ot.axes=U,le.push(ot),se.push(-1),$=!0,ne=!0,Te())},re.remove=function(ot){if(!re._stopped){var Ae=le.indexOf(ot);Ae<0||(le.splice(Ae,1),se.pop(),$=!0,ne=!0,Te())}},re.dispose=function(){if(!re._stopped&&(re._stopped=!0,window.removeEventListener("resize",_e),g.removeEventListener("webglcontextlost",Ie),re.mouseListener.enabled=!1,!re.contextLost)){U.dispose(),Q.dispose();for(var ot=0;otz.distance)continue;for(var Et=0;Etp;){var v=l[b-2],u=l[b-1];if(vl[T+1]:!0}function c(p,T,l,_){p*=2;var w=_[p];return w>1,y=M-_,b=M+_,v=w,u=y,g=M,f=b,P=S,L=p+1,z=T-1,F=0;h(v,u,l)&&(F=v,v=u,u=F),h(f,P,l)&&(F=f,f=P,P=F),h(v,g,l)&&(F=v,v=g,g=F),h(u,g,l)&&(F=u,u=g,g=F),h(v,f,l)&&(F=v,v=f,f=F),h(g,f,l)&&(F=g,g=f,f=F),h(u,P,l)&&(F=u,u=P,P=F),h(u,g,l)&&(F=u,u=g,g=F),h(f,P,l)&&(F=f,f=P,P=F);for(var B=l[2*u],O=l[2*u+1],I=l[2*f],N=l[2*f+1],U=2*v,W=2*g,Q=2*P,le=2*w,se=2*M,he=2*S,q=0;q<2;++q){var $=l[U+q],J=l[W+q],X=l[Q+q];l[le+q]=$,l[se+q]=J,l[he+q]=X}i(y,p,l),i(b,T,l);for(var oe=L;oe<=z;++oe)if(c(oe,B,O,l))oe!==L&&a(oe,L,l),++L;else if(!c(oe,I,N,l))for(;;)if(c(z,I,N,l)){c(z,B,O,l)?(n(oe,L,z,l),++L,--z):(a(oe,z,l),--z);break}else{if(--z0)if(w[0]!==M[1][0])S=_,_=_.right;else{var u=m(_.right,w);if(u)return u;_=_.left}else{if(w[0]!==M[1][0])return _;var u=m(_.right,w);if(u)return u;_=_.left}}return S}h.castUp=function(_){var w=o.le(this.coordinates,_[0]);if(w<0)return-1;var S=this.slabs[w],M=m(this.slabs[w],_),y=-1;if(M&&(y=M.value),this.coordinates[w]===_[0]){var b=null;if(M&&(b=M.key),w>0){var v=m(this.slabs[w-1],_);v&&(b?n(v.key,b)>0&&(b=v.key,y=v.value):(y=v.value,b=v.key))}var u=this.horizontal[w];if(u.length>0){var g=o.ge(u,_[1],c);if(g=u.length)return y;f=u[g]}}if(f.start)if(b){var P=i(b[0],b[1],[_[0],f.y]);b[0][0]>b[1][0]&&(P=-P),P>0&&(y=f.index)}else y=f.index;else f.y!==_[1]&&(y=f.index)}}}return y};function p(_,w,S,M){this.y=_,this.index=w,this.start=S,this.closed=M}function T(_,w,S,M){this.x=_,this.segment=w,this.create=S,this.index=M}function l(_){for(var w=_.length,S=2*w,M=new Array(S),y=0;yMath.abs(u))l.rotate(P,0,0,-v*g*Math.PI*y.rotateSpeed/window.innerWidth);else if(!y._ortho){var L=-y.zoomSpeed*f*u/window.innerHeight*(P-l.lastT())/20;l.pan(P,0,0,w*(Math.exp(L)-1))}}},!0)},y.enableMouseListeners(),y}}),4449:(function(e,t,r){"use strict";var o=r(2762),a=r(8116),i=r(1493);e.exports=T;var n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,_,w,S){this.gl=l,this.buffer=_,this.vao=w,this.shader=S,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var h=s.prototype,c=[0,0,0],m=[0,0,0],p=[0,0];h.isTransparent=function(){return!1},h.drawTransparent=function(l){},h.draw=function(l){var _=this.gl,w=this.vao,S=this.shader;w.bind(),S.bind();var M=l.model||n,y=l.view||n,b=l.projection||n,v;this.axes&&(v=this.axes.lastCubeProps.axis);for(var u=c,g=m,f=0;f<3;++f)v&&v[f]<0?(u[f]=this.bounds[0][f],g[f]=this.bounds[1][f]):(u[f]=this.bounds[1][f],g[f]=this.bounds[0][f]);p[0]=_.drawingBufferWidth,p[1]=_.drawingBufferHeight,S.uniforms.model=M,S.uniforms.view=y,S.uniforms.projection=b,S.uniforms.coordinates=[this.position,u,g],S.uniforms.colors=this.colors,S.uniforms.screenShape=p;for(var f=0;f<3;++f)S.uniforms.lineWidth=this.lineWidth[f]*this.pixelRatio,this.enabled[f]&&(w.draw(_.TRIANGLES,6,6*f),this.drawSides[f]&&w.draw(_.TRIANGLES,12,18+12*f));w.unbind()},h.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},h.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,_){var w=[];function S(u,g,f,P,L,z){var F=[u,g,f,0,0,0,1];F[P+3]=1,F[P]=L,w.push.apply(w,F),F[6]=-1,w.push.apply(w,F),F[P]=z,w.push.apply(w,F),w.push.apply(w,F),F[6]=1,w.push.apply(w,F),F[P]=L,w.push.apply(w,F)}S(0,0,0,0,0,1),S(0,0,0,1,0,1),S(0,0,0,2,0,1),S(1,0,0,1,-1,1),S(1,0,0,2,-1,1),S(0,1,0,0,-1,1),S(0,1,0,2,-1,1),S(0,0,1,0,-1,1),S(0,0,1,1,-1,1);var M=o(l,w),y=a(l,[{type:l.FLOAT,buffer:M,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:M,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:M,size:1,offset:24,stride:28}]),b=i(l);b.attributes.position.location=0,b.attributes.color.location=1,b.attributes.weight.location=2;var v=new s(l,M,y,b);return v.update(_),v}}),4494:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}}),4505:(function(e,t,r){e.exports=r(5847)}),4578:(function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}}),4623:(function(e){"use strict";"use restrict";e.exports=t;function t(r){this.roots=new Array(r),this.ranks=new Array(r);for(var o=0;o0)return 1<=0)return 1<=0;--l)h[l]=c*o[l]+m*a[l]+p*i[l]+T*n[l];return h}return c*o+m*a+p*i[l]+T*n}function r(o,a,i,n,s,h){var c=s-1,m=s*s,p=c*c,T=(1+2*s)*p,l=s*p,_=m*(3-2*s),w=m*c;if(o.length){h||(h=new Array(o.length));for(var S=o.length-1;S>=0;--S)h[S]=T*o[S]+l*a[S]+_*i[S]+w*n[S];return h}return T*o+l*a+_*i+w*n}e.exports=r,e.exports.derivative=t}),4772:(function(e){e.exports=t;function t(r,o,a,i,n){var s=1/Math.tan(o/2),h=1/(i-n);return r[0]=s/a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(n+i)*h,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*n*i*h,r[15]=0,r}}),4793:(function(e,t,r){"use strict";var o;function a(Ee,Se){if(!(Ee instanceof Se))throw new TypeError("Cannot call a class as a function")}function i(Ee,Se){for(var Le=0;Lev)throw new RangeError('The value "'+Ee+'" is invalid for option "size"');var Se=new Uint8Array(Ee);return Object.setPrototypeOf(Se,f.prototype),Se}function f(Ee,Se,Le){if(typeof Ee=="number"){if(typeof Se=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return F(Ee)}return P(Ee,Se,Le)}f.poolSize=8192;function P(Ee,Se,Le){if(typeof Ee=="string")return B(Ee,Se);if(ArrayBuffer.isView(Ee))return I(Ee);if(Ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+S(Ee));if(Oe(Ee,ArrayBuffer)||Ee&&Oe(Ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(Ee,SharedArrayBuffer)||Ee&&Oe(Ee.buffer,SharedArrayBuffer)))return N(Ee,Se,Le);if(typeof Ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=Ee.valueOf&&Ee.valueOf();if(at!=null&&at!==Ee)return f.from(at,Se,Le);var dt=U(Ee);if(dt)return dt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ee[Symbol.toPrimitive]=="function")return f.from(Ee[Symbol.toPrimitive]("string"),Se,Le);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+S(Ee))}f.from=function(Ee,Se,Le){return P(Ee,Se,Le)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function L(Ee){if(typeof Ee!="number")throw new TypeError('"size" argument must be of type number');if(Ee<0)throw new RangeError('The value "'+Ee+'" is invalid for option "size"')}function z(Ee,Se,Le){return L(Ee),Ee<=0?g(Ee):Se!==void 0?typeof Le=="string"?g(Ee).fill(Se,Le):g(Ee).fill(Se):g(Ee)}f.alloc=function(Ee,Se,Le){return z(Ee,Se,Le)};function F(Ee){return L(Ee),g(Ee<0?0:W(Ee)|0)}f.allocUnsafe=function(Ee){return F(Ee)},f.allocUnsafeSlow=function(Ee){return F(Ee)};function B(Ee,Se){if((typeof Se!="string"||Se==="")&&(Se="utf8"),!f.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se);var Le=le(Ee,Se)|0,at=g(Le),dt=at.write(Ee,Se);return dt!==Le&&(at=at.slice(0,dt)),at}function O(Ee){for(var Se=Ee.length<0?0:W(Ee.length)|0,Le=g(Se),at=0;at=v)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v.toString(16)+" bytes");return Ee|0}function Q(Ee){return+Ee!=Ee&&(Ee=0),f.alloc(+Ee)}f.isBuffer=function(Se){return Se!=null&&Se._isBuffer===!0&&Se!==f.prototype},f.compare=function(Se,Le){if(Oe(Se,Uint8Array)&&(Se=f.from(Se,Se.offset,Se.byteLength)),Oe(Le,Uint8Array)&&(Le=f.from(Le,Le.offset,Le.byteLength)),!f.isBuffer(Se)||!f.isBuffer(Le))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Se===Le)return 0;for(var at=Se.length,dt=Le.length,gt=0,Ct=Math.min(at,dt);gtdt.length?(f.isBuffer(Ct)||(Ct=f.from(Ct)),Ct.copy(dt,gt)):Uint8Array.prototype.set.call(dt,Ct,gt);else if(f.isBuffer(Ct))Ct.copy(dt,gt);else throw new TypeError('"list" argument must be an Array of Buffers');gt+=Ct.length}return dt};function le(Ee,Se){if(f.isBuffer(Ee))return Ee.length;if(ArrayBuffer.isView(Ee)||Oe(Ee,ArrayBuffer))return Ee.byteLength;if(typeof Ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+S(Ee));var Le=Ee.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&Le===0)return 0;for(var dt=!1;;)switch(Se){case"ascii":case"latin1":case"binary":return Le;case"utf8":case"utf-8":return pr(Ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le*2;case"hex":return Le>>>1;case"base64":return Er(Ee).length;default:if(dt)return at?-1:pr(Ee).length;Se=(""+Se).toLowerCase(),dt=!0}}f.byteLength=le;function se(Ee,Se,Le){var at=!1;if((Se===void 0||Se<0)&&(Se=0),Se>this.length||((Le===void 0||Le>this.length)&&(Le=this.length),Le<=0)||(Le>>>=0,Se>>>=0,Le<=Se))return"";for(Ee||(Ee="utf8");;)switch(Ee){case"hex":return De(this,Se,Le);case"utf8":case"utf-8":return re(this,Se,Le);case"ascii":return Te(this,Se,Le);case"latin1":case"binary":return Ie(this,Se,Le);case"base64":return ee(this,Se,Le);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He(this,Se,Le);default:if(at)throw new TypeError("Unknown encoding: "+Ee);Ee=(Ee+"").toLowerCase(),at=!0}}f.prototype._isBuffer=!0;function he(Ee,Se,Le){var at=Ee[Se];Ee[Se]=Ee[Le],Ee[Le]=at}f.prototype.swap16=function(){var Se=this.length;if(Se%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Le=0;LeLe&&(Se+=" ... "),""},b&&(f.prototype[b]=f.prototype.inspect),f.prototype.compare=function(Se,Le,at,dt,gt){if(Oe(Se,Uint8Array)&&(Se=f.from(Se,Se.offset,Se.byteLength)),!f.isBuffer(Se))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+S(Se));if(Le===void 0&&(Le=0),at===void 0&&(at=Se?Se.length:0),dt===void 0&&(dt=0),gt===void 0&&(gt=this.length),Le<0||at>Se.length||dt<0||gt>this.length)throw new RangeError("out of range index");if(dt>=gt&&Le>=at)return 0;if(dt>=gt)return-1;if(Le>=at)return 1;if(Le>>>=0,at>>>=0,dt>>>=0,gt>>>=0,this===Se)return 0;for(var Ct=gt-dt,or=at-Le,Qt=Math.min(Ct,or),Jt=this.slice(dt,gt),Sr=Se.slice(Le,at),oa=0;oa2147483647?Le=2147483647:Le<-2147483648&&(Le=-2147483648),Le=+Le,Xe(Le)&&(Le=dt?0:Ee.length-1),Le<0&&(Le=Ee.length+Le),Le>=Ee.length){if(dt)return-1;Le=Ee.length-1}else if(Le<0)if(dt)Le=0;else return-1;if(typeof Se=="string"&&(Se=f.from(Se,at)),f.isBuffer(Se))return Se.length===0?-1:$(Ee,Se,Le,at,dt);if(typeof Se=="number")return Se=Se&255,typeof Uint8Array.prototype.indexOf=="function"?dt?Uint8Array.prototype.indexOf.call(Ee,Se,Le):Uint8Array.prototype.lastIndexOf.call(Ee,Se,Le):$(Ee,[Se],Le,at,dt);throw new TypeError("val must be string, number or Buffer")}function $(Ee,Se,Le,at,dt){var gt=1,Ct=Ee.length,or=Se.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(Ee.length<2||Se.length<2)return-1;gt=2,Ct/=2,or/=2,Le/=2}function Qt(Sa,za){return gt===1?Sa[za]:Sa.readUInt16BE(za*gt)}var Jt;if(dt){var Sr=-1;for(Jt=Le;JtCt&&(Le=Ct-or),Jt=Le;Jt>=0;Jt--){for(var oa=!0,Ea=0;Eadt&&(at=dt)):at=dt;var gt=Se.length;at>gt/2&&(at=gt/2);var Ct;for(Ct=0;Ct>>0,isFinite(at)?(at=at>>>0,dt===void 0&&(dt="utf8")):(dt=at,at=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var gt=this.length-Le;if((at===void 0||at>gt)&&(at=gt),Se.length>0&&(at<0||Le<0)||Le>this.length)throw new RangeError("Attempt to write outside buffer bounds");dt||(dt="utf8");for(var Ct=!1;;)switch(dt){case"hex":return J(this,Se,Le,at);case"utf8":case"utf-8":return X(this,Se,Le,at);case"ascii":case"latin1":case"binary":return oe(this,Se,Le,at);case"base64":return ne(this,Se,Le,at);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,Se,Le,at);default:if(Ct)throw new TypeError("Unknown encoding: "+dt);dt=(""+dt).toLowerCase(),Ct=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(Ee,Se,Le){return Se===0&&Le===Ee.length?M.fromByteArray(Ee):M.fromByteArray(Ee.slice(Se,Le))}function re(Ee,Se,Le){Le=Math.min(Ee.length,Le);for(var at=[],dt=Se;dt239?4:gt>223?3:gt>191?2:1;if(dt+or<=Le){var Qt=void 0,Jt=void 0,Sr=void 0,oa=void 0;switch(or){case 1:gt<128&&(Ct=gt);break;case 2:Qt=Ee[dt+1],(Qt&192)===128&&(oa=(gt&31)<<6|Qt&63,oa>127&&(Ct=oa));break;case 3:Qt=Ee[dt+1],Jt=Ee[dt+2],(Qt&192)===128&&(Jt&192)===128&&(oa=(gt&15)<<12|(Qt&63)<<6|Jt&63,oa>2047&&(oa<55296||oa>57343)&&(Ct=oa));break;case 4:Qt=Ee[dt+1],Jt=Ee[dt+2],Sr=Ee[dt+3],(Qt&192)===128&&(Jt&192)===128&&(Sr&192)===128&&(oa=(gt&15)<<18|(Qt&63)<<12|(Jt&63)<<6|Sr&63,oa>65535&&oa<1114112&&(Ct=oa))}}Ct===null?(Ct=65533,or=1):Ct>65535&&(Ct-=65536,at.push(Ct>>>10&1023|55296),Ct=56320|Ct&1023),at.push(Ct),dt+=or}return _e(at)}var ue=4096;function _e(Ee){var Se=Ee.length;if(Se<=ue)return String.fromCharCode.apply(String,Ee);for(var Le="",at=0;atat)&&(Le=at);for(var dt="",gt=Se;gtat&&(Se=at),Le<0?(Le+=at,Le<0&&(Le=0)):Le>at&&(Le=at),LeLe)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(Se,Le,at){Se=Se>>>0,Le=Le>>>0,at||et(Se,Le,this.length);for(var dt=this[Se],gt=1,Ct=0;++Ct>>0,Le=Le>>>0,at||et(Se,Le,this.length);for(var dt=this[Se+--Le],gt=1;Le>0&&(gt*=256);)dt+=this[Se+--Le]*gt;return dt},f.prototype.readUint8=f.prototype.readUInt8=function(Se,Le){return Se=Se>>>0,Le||et(Se,1,this.length),this[Se]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(Se,Le){return Se=Se>>>0,Le||et(Se,2,this.length),this[Se]|this[Se+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(Se,Le){return Se=Se>>>0,Le||et(Se,2,this.length),this[Se]<<8|this[Se+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(Se,Le){return Se=Se>>>0,Le||et(Se,4,this.length),(this[Se]|this[Se+1]<<8|this[Se+2]<<16)+this[Se+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(Se,Le){return Se=Se>>>0,Le||et(Se,4,this.length),this[Se]*16777216+(this[Se+1]<<16|this[Se+2]<<8|this[Se+3])},f.prototype.readBigUInt64LE=Ce(function(Se){Se=Se>>>0,Et(Se,"offset");var Le=this[Se],at=this[Se+7];(Le===void 0||at===void 0)&&Bt(Se,this.length-8);var dt=Le+this[++Se]*Math.pow(2,8)+this[++Se]*Math.pow(2,16)+this[++Se]*Math.pow(2,24),gt=this[++Se]+this[++Se]*Math.pow(2,8)+this[++Se]*Math.pow(2,16)+at*Math.pow(2,24);return BigInt(dt)+(BigInt(gt)<>>0,Et(Se,"offset");var Le=this[Se],at=this[Se+7];(Le===void 0||at===void 0)&&Bt(Se,this.length-8);var dt=Le*Math.pow(2,24)+this[++Se]*Math.pow(2,16)+this[++Se]*Math.pow(2,8)+this[++Se],gt=this[++Se]*Math.pow(2,24)+this[++Se]*Math.pow(2,16)+this[++Se]*Math.pow(2,8)+at;return(BigInt(dt)<>>0,Le=Le>>>0,at||et(Se,Le,this.length);for(var dt=this[Se],gt=1,Ct=0;++Ct=gt&&(dt-=Math.pow(2,8*Le)),dt},f.prototype.readIntBE=function(Se,Le,at){Se=Se>>>0,Le=Le>>>0,at||et(Se,Le,this.length);for(var dt=Le,gt=1,Ct=this[Se+--dt];dt>0&&(gt*=256);)Ct+=this[Se+--dt]*gt;return gt*=128,Ct>=gt&&(Ct-=Math.pow(2,8*Le)),Ct},f.prototype.readInt8=function(Se,Le){return Se=Se>>>0,Le||et(Se,1,this.length),this[Se]&128?(255-this[Se]+1)*-1:this[Se]},f.prototype.readInt16LE=function(Se,Le){Se=Se>>>0,Le||et(Se,2,this.length);var at=this[Se]|this[Se+1]<<8;return at&32768?at|4294901760:at},f.prototype.readInt16BE=function(Se,Le){Se=Se>>>0,Le||et(Se,2,this.length);var at=this[Se+1]|this[Se]<<8;return at&32768?at|4294901760:at},f.prototype.readInt32LE=function(Se,Le){return Se=Se>>>0,Le||et(Se,4,this.length),this[Se]|this[Se+1]<<8|this[Se+2]<<16|this[Se+3]<<24},f.prototype.readInt32BE=function(Se,Le){return Se=Se>>>0,Le||et(Se,4,this.length),this[Se]<<24|this[Se+1]<<16|this[Se+2]<<8|this[Se+3]},f.prototype.readBigInt64LE=Ce(function(Se){Se=Se>>>0,Et(Se,"offset");var Le=this[Se],at=this[Se+7];(Le===void 0||at===void 0)&&Bt(Se,this.length-8);var dt=this[Se+4]+this[Se+5]*Math.pow(2,8)+this[Se+6]*Math.pow(2,16)+(at<<24);return(BigInt(dt)<>>0,Et(Se,"offset");var Le=this[Se],at=this[Se+7];(Le===void 0||at===void 0)&&Bt(Se,this.length-8);var dt=(Le<<24)+this[++Se]*Math.pow(2,16)+this[++Se]*Math.pow(2,8)+this[++Se];return(BigInt(dt)<>>0,Le||et(Se,4,this.length),y.read(this,Se,!0,23,4)},f.prototype.readFloatBE=function(Se,Le){return Se=Se>>>0,Le||et(Se,4,this.length),y.read(this,Se,!1,23,4)},f.prototype.readDoubleLE=function(Se,Le){return Se=Se>>>0,Le||et(Se,8,this.length),y.read(this,Se,!0,52,8)},f.prototype.readDoubleBE=function(Se,Le){return Se=Se>>>0,Le||et(Se,8,this.length),y.read(this,Se,!1,52,8)};function rt(Ee,Se,Le,at,dt,gt){if(!f.isBuffer(Ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(Se>dt||SeEe.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(Se,Le,at,dt){if(Se=+Se,Le=Le>>>0,at=at>>>0,!dt){var gt=Math.pow(2,8*at)-1;rt(this,Se,Le,at,gt,0)}var Ct=1,or=0;for(this[Le]=Se&255;++or>>0,at=at>>>0,!dt){var gt=Math.pow(2,8*at)-1;rt(this,Se,Le,at,gt,0)}var Ct=at-1,or=1;for(this[Le+Ct]=Se&255;--Ct>=0&&(or*=256);)this[Le+Ct]=Se/or&255;return Le+at},f.prototype.writeUint8=f.prototype.writeUInt8=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,1,255,0),this[Le]=Se&255,Le+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,2,65535,0),this[Le]=Se&255,this[Le+1]=Se>>>8,Le+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,2,65535,0),this[Le]=Se>>>8,this[Le+1]=Se&255,Le+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,4,4294967295,0),this[Le+3]=Se>>>24,this[Le+2]=Se>>>16,this[Le+1]=Se>>>8,this[Le]=Se&255,Le+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,4,4294967295,0),this[Le]=Se>>>24,this[Le+1]=Se>>>16,this[Le+2]=Se>>>8,this[Le+3]=Se&255,Le+4};function $e(Ee,Se,Le,at,dt){kt(Se,at,dt,Ee,Le,7);var gt=Number(Se&BigInt(4294967295));Ee[Le++]=gt,gt=gt>>8,Ee[Le++]=gt,gt=gt>>8,Ee[Le++]=gt,gt=gt>>8,Ee[Le++]=gt;var Ct=Number(Se>>BigInt(32)&BigInt(4294967295));return Ee[Le++]=Ct,Ct=Ct>>8,Ee[Le++]=Ct,Ct=Ct>>8,Ee[Le++]=Ct,Ct=Ct>>8,Ee[Le++]=Ct,Le}function ot(Ee,Se,Le,at,dt){kt(Se,at,dt,Ee,Le,7);var gt=Number(Se&BigInt(4294967295));Ee[Le+7]=gt,gt=gt>>8,Ee[Le+6]=gt,gt=gt>>8,Ee[Le+5]=gt,gt=gt>>8,Ee[Le+4]=gt;var Ct=Number(Se>>BigInt(32)&BigInt(4294967295));return Ee[Le+3]=Ct,Ct=Ct>>8,Ee[Le+2]=Ct,Ct=Ct>>8,Ee[Le+1]=Ct,Ct=Ct>>8,Ee[Le]=Ct,Le+8}f.prototype.writeBigUInt64LE=Ce(function(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return $e(this,Se,Le,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=Ce(function(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ot(this,Se,Le,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(Se,Le,at,dt){if(Se=+Se,Le=Le>>>0,!dt){var gt=Math.pow(2,8*at-1);rt(this,Se,Le,at,gt-1,-gt)}var Ct=0,or=1,Qt=0;for(this[Le]=Se&255;++Ct>0)-Qt&255;return Le+at},f.prototype.writeIntBE=function(Se,Le,at,dt){if(Se=+Se,Le=Le>>>0,!dt){var gt=Math.pow(2,8*at-1);rt(this,Se,Le,at,gt-1,-gt)}var Ct=at-1,or=1,Qt=0;for(this[Le+Ct]=Se&255;--Ct>=0&&(or*=256);)Se<0&&Qt===0&&this[Le+Ct+1]!==0&&(Qt=1),this[Le+Ct]=(Se/or>>0)-Qt&255;return Le+at},f.prototype.writeInt8=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,1,127,-128),Se<0&&(Se=255+Se+1),this[Le]=Se&255,Le+1},f.prototype.writeInt16LE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,2,32767,-32768),this[Le]=Se&255,this[Le+1]=Se>>>8,Le+2},f.prototype.writeInt16BE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,2,32767,-32768),this[Le]=Se>>>8,this[Le+1]=Se&255,Le+2},f.prototype.writeInt32LE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,4,2147483647,-2147483648),this[Le]=Se&255,this[Le+1]=Se>>>8,this[Le+2]=Se>>>16,this[Le+3]=Se>>>24,Le+4},f.prototype.writeInt32BE=function(Se,Le,at){return Se=+Se,Le=Le>>>0,at||rt(this,Se,Le,4,2147483647,-2147483648),Se<0&&(Se=4294967295+Se+1),this[Le]=Se>>>24,this[Le+1]=Se>>>16,this[Le+2]=Se>>>8,this[Le+3]=Se&255,Le+4},f.prototype.writeBigInt64LE=Ce(function(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return $e(this,Se,Le,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=Ce(function(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ot(this,Se,Le,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ae(Ee,Se,Le,at,dt,gt){if(Le+at>Ee.length)throw new RangeError("Index out of range");if(Le<0)throw new RangeError("Index out of range")}function ge(Ee,Se,Le,at,dt){return Se=+Se,Le=Le>>>0,dt||Ae(Ee,Se,Le,4,34028234663852886e22,-34028234663852886e22),y.write(Ee,Se,Le,at,23,4),Le+4}f.prototype.writeFloatLE=function(Se,Le,at){return ge(this,Se,Le,!0,at)},f.prototype.writeFloatBE=function(Se,Le,at){return ge(this,Se,Le,!1,at)};function ce(Ee,Se,Le,at,dt){return Se=+Se,Le=Le>>>0,dt||Ae(Ee,Se,Le,8,17976931348623157e292,-17976931348623157e292),y.write(Ee,Se,Le,at,52,8),Le+8}f.prototype.writeDoubleLE=function(Se,Le,at){return ce(this,Se,Le,!0,at)},f.prototype.writeDoubleBE=function(Se,Le,at){return ce(this,Se,Le,!1,at)},f.prototype.copy=function(Se,Le,at,dt){if(!f.isBuffer(Se))throw new TypeError("argument should be a Buffer");if(at||(at=0),!dt&&dt!==0&&(dt=this.length),Le>=Se.length&&(Le=Se.length),Le||(Le=0),dt>0&&dt=this.length)throw new RangeError("Index out of range");if(dt<0)throw new RangeError("sourceEnd out of bounds");dt>this.length&&(dt=this.length),Se.length-Le>>0,at=at===void 0?this.length:at>>>0,Se||(Se=0);var Ct;if(typeof Se=="number")for(Ct=Le;CtMath.pow(2,32)?dt=nt(String(Le)):typeof Le=="bigint"&&(dt=String(Le),(Le>Math.pow(BigInt(2),BigInt(32))||Le<-Math.pow(BigInt(2),BigInt(32)))&&(dt=nt(dt)),dt+="n"),at+=" It must be ".concat(Se,". Received ").concat(dt),at},RangeError);function nt(Ee){for(var Se="",Le=Ee.length,at=Ee[0]==="-"?1:0;Le>=at+4;Le-=3)Se="_".concat(Ee.slice(Le-3,Le)).concat(Se);return"".concat(Ee.slice(0,Le)).concat(Se)}function Ke(Ee,Se,Le){Et(Se,"offset"),(Ee[Se]===void 0||Ee[Se+Le]===void 0)&&Bt(Se,Ee.length-(Le+1))}function kt(Ee,Se,Le,at,dt,gt){if(Ee>Le||Ee3?Se===0||Se===BigInt(0)?or=">= 0".concat(Ct," and < 2").concat(Ct," ** ").concat((gt+1)*8).concat(Ct):or=">= -(2".concat(Ct," ** ").concat((gt+1)*8-1).concat(Ct,") and < 2 ** ")+"".concat((gt+1)*8-1).concat(Ct):or=">= ".concat(Se).concat(Ct," and <= ").concat(Le).concat(Ct),new ze.ERR_OUT_OF_RANGE("value",or,Ee)}Ke(at,dt,gt)}function Et(Ee,Se){if(typeof Ee!="number")throw new ze.ERR_INVALID_ARG_TYPE(Se,"number",Ee)}function Bt(Ee,Se,Le){throw Math.floor(Ee)!==Ee?(Et(Ee,Le),new ze.ERR_OUT_OF_RANGE(Le||"offset","an integer",Ee)):Se<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE(Le||"offset",">= ".concat(Le?1:0," and <= ").concat(Se),Ee)}var jt=/[^+/0-9A-Za-z-_]/g;function _r(Ee){if(Ee=Ee.split("=")[0],Ee=Ee.trim().replace(jt,""),Ee.length<2)return"";for(;Ee.length%4!==0;)Ee=Ee+"=";return Ee}function pr(Ee,Se){Se=Se||1/0;for(var Le,at=Ee.length,dt=null,gt=[],Ct=0;Ct55295&&Le<57344){if(!dt){if(Le>56319){(Se-=3)>-1&>.push(239,191,189);continue}else if(Ct+1===at){(Se-=3)>-1&>.push(239,191,189);continue}dt=Le;continue}if(Le<56320){(Se-=3)>-1&>.push(239,191,189),dt=Le;continue}Le=(dt-55296<<10|Le-56320)+65536}else dt&&(Se-=3)>-1&>.push(239,191,189);if(dt=null,Le<128){if((Se-=1)<0)break;gt.push(Le)}else if(Le<2048){if((Se-=2)<0)break;gt.push(Le>>6|192,Le&63|128)}else if(Le<65536){if((Se-=3)<0)break;gt.push(Le>>12|224,Le>>6&63|128,Le&63|128)}else if(Le<1114112){if((Se-=4)<0)break;gt.push(Le>>18|240,Le>>12&63|128,Le>>6&63|128,Le&63|128)}else throw new Error("Invalid code point")}return gt}function Or(Ee){for(var Se=[],Le=0;Le>8,dt=Le%256,gt.push(dt),gt.push(at);return gt}function Er(Ee){return M.toByteArray(_r(Ee))}function yt(Ee,Se,Le,at){var dt;for(dt=0;dt=Se.length||dt>=Ee.length);++dt)Se[dt+Le]=Ee[dt];return dt}function Oe(Ee,Se){return Ee instanceof Se||Ee!=null&&Ee.constructor!=null&&Ee.constructor.name!=null&&Ee.constructor.name===Se.name}function Xe(Ee){return Ee!==Ee}var be=(function(){for(var Ee="0123456789abcdef",Se=new Array(256),Le=0;Le<16;++Le)for(var at=Le*16,dt=0;dt<16;++dt)Se[at+dt]=Ee[Le]+Ee[dt];return Se})();function Ce(Ee){return typeof BigInt>"u"?Ne:Ee}function Ne(){throw new Error("BigInt not supported")}}),4844:(function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}}),4905:(function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),h=[];return h=h.concat(s(i)),h=h.concat(s(null)),h}}),4935:(function(e,t,r){"use strict";e.exports=_;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},h=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var c=3;function m(w,S,M,y){this.gl=w,this.shader=S,this.buffer=M,this.vao=y,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var p=m.prototype,T=[0,0];p.bind=function(w,S,M,y){this.vao.bind(),this.shader.bind();var b=this.shader.uniforms;b.model=w,b.view=S,b.projection=M,b.pixelScale=y,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},p.unbind=function(){this.vao.unbind()},p.update=function(w,S,M,y,b){var v=[];function u(N,U,W,Q,le,se){var he=[W.style,W.weight,W.variant,W.family].join("_"),q=h[he];q||(q=h[he]={});var $=q[U];$||($=q[U]=l(U,{triangles:!0,font:W.family,fontStyle:W.style,fontWeight:W.weight,fontVariant:W.variant,textAlign:"center",textBaseline:"middle",lineSpacing:le,styletags:se}));for(var J=(Q||12)/12,X=$.positions,oe=$.cells,ne=0,j=oe.length;ne=0;--re){var ue=X[ee[re]];v.push(J*ue[0],-J*ue[1],N)}}for(var g=[0,0,0],f=[0,0,0],P=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){P[B]=v.length/c|0,u(.5*(w[0][B]+w[1][B]),S[B],M[B],12,z,F),L[B]=(v.length/c|0)-P[B],g[B]=v.length/c|0;for(var O=0;O0||S.length>0;){for(;w.length>0;){var u=w.pop();if(M[u]!==-_){M[u]=_;for(var g=y[u],f=0;f<3;++f){var P=v[3*u+f];P>=0&&M[P]===0&&(b[3*u+f]?S.push(P):(w.push(P),M[P]=_))}}}var L=S;S=w,w=L,S.length=0,_=-_}var z=h(y,M,p);return T?z.concat(l.boundary):z}}),5033:(function(e){"use strict";e.exports=t;function t(r,o,a){var i=o||0,n=a||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[i*r[12]+r[8],i*r[13]+r[9],i*r[14]+r[10],i*r[15]+r[11]],[n*r[12]-r[8],n*r[13]-r[9],n*r[14]-r[10],n*r[15]-r[11]]]}}),5085:(function(e,t,r){e.exports=_;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function h(w){return function(S,M){var y=w[S];return y?!!y.queryPoint(M,s):!1}}function c(w){for(var S={},M=0;M0&&S[y]===M[0])b=w[y-1];else return 1;for(var v=1;b;){var u=b.key,g=o(M,u[0],u[1]);if(u[0][0]0)v=-1,b=b.right;else return 0;else if(g>0)b=b.left;else if(g<0)v=1,b=b.right;else return 0}return v}}function p(w){return 1}function T(w){return function(M){return w(M[0],M[1])?0:1}}function l(w,S){return function(y){return w(y[0],y[1])?0:S(y)}}function _(w){for(var S=w.length,M=[],y=[],b=0,v=0;v"u"?r(606):WeakMap,n=new i,s=0;function h(S,M,y,b,v,u,g){this.id=S,this.src=M,this.type=y,this.shader=b,this.count=u,this.programs=[],this.cache=g}h.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,M=S.gl,y=this.programs,b=0,v=y.length;b0&&(h=1/Math.sqrt(h),r[0]=a*h,r[1]=i*h,r[2]=n*h,r[3]=s*h),r}}),5202:(function(e,t,r){"use strict";var o=r(1944),a=r(8210);e.exports=s,e.exports.positive=h,e.exports.negative=c;function i(m,p){var T=a(o(m,p),[p[p.length-1]]);return T[T.length-1]}function n(m,p,T,l){var _=l-p,w=-p/_;w<0?w=0:w>1&&(w=1);for(var S=1-w,M=m.length,y=new Array(M),b=0;b0||_>0&&y<0){var b=n(w,y,S,_);T.push(b),l.push(b.slice())}y<0?l.push(S.slice()):y>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),_=y}return{positive:T,negative:l}}function h(m,p){for(var T=[],l=i(m[m.length-1],p),_=m[m.length-1],w=m[0],S=0;S0||l>0&&M<0)&&T.push(n(_,M,w,l)),M>=0&&T.push(w.slice()),l=M}return T}function c(m,p){for(var T=[],l=i(m[m.length-1],p),_=m[m.length-1],w=m[0],S=0;S0||l>0&&M<0)&&T.push(n(_,M,w,l)),M<=0&&T.push(w.slice()),l=M}return T}}),5219:(function(e){"use strict";e.exports=function(t){for(var r=t.length,o,a=0;a13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}}),5250:(function(e){"use strict";e.exports=r;var t=+(Math.pow(2,27)+1);function r(o,a,i){var n=o*a,s=t*o,h=s-o,c=s-h,m=o-c,p=t*a,T=p-a,l=p-T,_=a-l,w=n-c*l,S=w-m*l,M=S-c*_,y=m*_-M;return i?(i[0]=y,i[1]=n,i):[y,n]}}),5298:(function(e,t){"use strict";var r={"float64,2,1,0":function(){return function(m,p,T,l,_){var w=m[0],S=m[1],M=m[2],y=T[0],b=T[1],v=T[2];l|=0;var u=0,g=0,f=0,P=v,L=b-M*v,z=y-S*b;for(f=0;f0;){O<64?(y=O,O=0):(y=64,O-=64);for(var I=m[1]|0;I>0;){I<64?(b=I,I=0):(b=64,I-=64),l=F+O*u+I*g,S=B+O*P+I*L;var N=0,U=0,W=0,Q=f,le=u-v*f,se=g-y*u,he=z,q=P-v*z,$=L-y*P;for(W=0;W0;){L<64?(y=L,L=0):(y=64,L-=64);for(var z=m[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=f+L*v+z*b,S=P+L*g+z*u;var F=0,B=0,O=v,I=b-y*v,N=g,U=u-y*g;for(B=0;B0;){B<64?(b=B,B=0):(b=64,B-=64);for(var O=m[0]|0;O>0;){O<64?(M=O,O=0):(M=64,O-=64);for(var I=m[1]|0;I>0;){I<64?(y=I,I=0):(y=64,I-=64),l=z+B*g+O*v+I*u,S=F+B*L+O*f+I*P;var N=0,U=0,W=0,Q=g,le=v-b*g,se=u-M*v,he=L,q=f-b*L,$=P-M*f;for(W=0;W=0}})(),i.removeTriangle=function(h,c,m){var p=this.stars;n(p[h],c,m),n(p[c],m,h),n(p[m],h,c)},i.addTriangle=function(h,c,m){var p=this.stars;p[h].push(c,m),p[c].push(m,h),p[m].push(h,c)},i.opposite=function(h,c){for(var m=this.stars[c],p=1,T=m.length;p0;){var l=m.pop();h[l]=!1;for(var _=s[l],p=0;p<_.length;++p){var w=_[p];--c[w]===0&&m.push(w)}}for(var S=new Array(n.length),M=[],p=0;p0){for(var he=0;he<24;++he)L.push(L[L.length-12]);O+=2,Q=!0}continue e}I[0][f]=Math.min(I[0][f],le[f],se[f]),I[1][f]=Math.max(I[1][f],le[f],se[f])}var q,$;Array.isArray(U[0])?(q=U.length>g-1?U[g-1]:U.length>0?U[U.length-1]:[0,0,0,1],$=U.length>g?U[g]:U.length>0?U[U.length-1]:[0,0,0,1]):q=$=U,q.length===3&&(q=[q[0],q[1],q[2],1]),$.length===3&&($=[$[0],$[1],$[2],1]),!this.hasAlpha&&q[3]<1&&(this.hasAlpha=!0);var J;Array.isArray(W)?J=W.length>g-1?W[g-1]:W.length>0?W[W.length-1]:[0,0,0,1]:J=W;var X=B;if(B+=w(le,se),Q){for(f=0;f<2;++f)L.push(le[0],le[1],le[2],se[0],se[1],se[2],X,J,q[0],q[1],q[2],q[3]);O+=2,Q=!1}L.push(le[0],le[1],le[2],se[0],se[1],se[2],X,J,q[0],q[1],q[2],q[3],le[0],le[1],le[2],se[0],se[1],se[2],X,-J,q[0],q[1],q[2],q[3],se[0],se[1],se[2],le[0],le[1],le[2],B,-J,$[0],$[1],$[2],$[3],se[0],se[1],se[2],le[0],le[1],le[2],B,J,$[0],$[1],$[2],$[3]),O+=4}}if(this.buffer.update(L),z.push(B),F.push(N[N.length-1].slice()),this.bounds=I,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var oe=u.dashes,ne=oe.slice();for(ne.unshift(0),g=1;gr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}}),5771:(function(e,t,r){"use strict";var o=r(8507),a=r(3788),i=r(2419);e.exports=n;function n(s){s.sort(a);for(var h=s.length,c=0,m=0;m0){var l=s[c-1];if(o(p,l)===0&&i(l)!==T){c-=1;continue}}s[c++]=p}}return s.length=c,s}}),5838:(function(e,t,r){"use strict";e.exports=a;var o=r(7842);function a(i){for(var n=new Array(i.length),s=0;s0)continue;nt=ce.slice(0,1).join("")}return ee(nt),se+=nt.length,I=I.slice(nt.length),I.length}while(!0)}function $e(){return/[^a-fA-F0-9]/.test(B)?(ee(I.join("")),F=h,L):(I.push(B),O=B,L+1)}function ot(){return B==="."||/[eE]/.test(B)?(I.push(B),F=w,O=B,L+1):B==="x"&&I.length===1&&I[0]==="0"?(F=u,I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=h,L):(I.push(B),O=B,L+1)}function Ae(){return B==="f"&&(I.push(B),O=B,L+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=h,L):(I.push(B),O=B,L+1)}function ge(){if(/[^\d\w_]/.test(B)){var ce=I.join("");return j[ce]?F=y:ne[ce]?F=M:F=S,ee(I.join("")),F=h,L}return I.push(B),O=B,L+1}}}),5878:(function(e,t,r){"use strict";e.exports=n;var o=r(3250),a=r(2014);function i(s,h,c){var m=Math.abs(o(s,h,c)),p=Math.sqrt(Math.pow(h[0]-c[0],2)+Math.pow(h[1]-c[1],2));return m/p}function n(s,h,c){for(var m=h.length,p=s.length,T=new Array(m),l=new Array(m),_=new Array(m),w=new Array(m),S=0;S>1:(q>>1)-1}function P(q){for(var $=g(q);;){var J=$,X=2*q+1,oe=2*(q+1),ne=q;if(X0;){var J=f(q);if(J>=0){var X=g(J);if($0){var q=O[0];return u(0,U-1),U-=1,P(0),q}return-1}function F(q,$){var J=O[q];return _[J]===$?q:(_[J]=-1/0,L(q),z(),_[J]=$,U+=1,L(U-1))}function B(q){if(!w[q]){w[q]=!0;var $=T[q],J=l[q];T[J]>=0&&(T[J]=$),l[$]>=0&&(l[$]=J),I[$]>=0&&F(I[$],v($)),I[J]>=0&&F(I[J],v(J))}}for(var O=[],I=new Array(m),S=0;S>1;S>=0;--S)P(S);for(;;){var W=z();if(W<0||_[W]>c)break;B(W)}for(var Q=[],S=0;S=0&&J>=0&&$!==J){var X=I[$],oe=I[J];X!==oe&&he.push([X,oe])}}),a.unique(a.normalize(he)),{positions:Q,edges:he}}}),5911:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[0],c=a[1],m=a[2];return r[0]=n*m-s*c,r[1]=s*h-i*m,r[2]=i*c-n*h,r}}),5964:(function(e){"use strict";e.exports=function(t){return!t&&t!==0?"":t.toString()}}),5995:(function(e,t,r){"use strict";e.exports=i;var o=r(7642),a=r(6037);function i(n,s){return o(s).filter(function(h){for(var c=new Array(h.length),m=0;m2&&f[1]>2&&v(g.pick(-1,-1).lo(1,1).hi(f[0]-2,f[1]-2),u.pick(-1,-1,0).lo(1,1).hi(f[0]-2,f[1]-2),u.pick(-1,-1,1).lo(1,1).hi(f[0]-2,f[1]-2)),f[1]>2&&(b(g.pick(0,-1).lo(1).hi(f[1]-2),u.pick(0,-1,1).lo(1).hi(f[1]-2)),y(u.pick(0,-1,0).lo(1).hi(f[1]-2))),f[1]>2&&(b(g.pick(f[0]-1,-1).lo(1).hi(f[1]-2),u.pick(f[0]-1,-1,1).lo(1).hi(f[1]-2)),y(u.pick(f[0]-1,-1,0).lo(1).hi(f[1]-2))),f[0]>2&&(b(g.pick(-1,0).lo(1).hi(f[0]-2),u.pick(-1,0,0).lo(1).hi(f[0]-2)),y(u.pick(-1,0,1).lo(1).hi(f[0]-2))),f[0]>2&&(b(g.pick(-1,f[1]-1).lo(1).hi(f[0]-2),u.pick(-1,f[1]-1,0).lo(1).hi(f[0]-2)),y(u.pick(-1,f[1]-1,1).lo(1).hi(f[0]-2))),u.set(0,0,0,0),u.set(0,0,1,0),u.set(f[0]-1,0,0,0),u.set(f[0]-1,0,1,0),u.set(0,f[1]-1,0,0),u.set(0,f[1]-1,1,0),u.set(f[0]-1,f[1]-1,0,0),u.set(f[0]-1,f[1]-1,1,0),u}}function S(M){var y=M.join(),f=m[y];if(f)return f;for(var b=M.length,v=[T,l],u=1;u<=b;++u)v.push(_(u));var g=w,f=g.apply(void 0,v);return m[y]=f,f}e.exports=function(y,b,v){if(Array.isArray(v)||(typeof v=="string"?v=o(b.dimension,v):v=o(b.dimension,"clamp")),b.size===0)return y;if(b.dimension===0)return y.set(0),y;var u=S(v);return u(y,b)}}),6204:(function(e){"use strict";e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;om&&(m=o.length(L)),f&&!g){var z=2*o.distance(M,P)/(o.length(y)+o.length(L));z?(v=Math.min(v,z),u=!1):u=!0}u||(M=P,y=L),b.push(L)}var F=[p,l,w],B=[T,_,S];n&&(n[0]=F,n[1]=B),m===0&&(m=1);var O=1/m;isFinite(v)||(v=1),c.vectorScale=v;var I=i.coneSize||(g?1:.5);i.absoluteConeSize&&(I=i.absoluteConeSize*O),c.coneScale=I;for(var f=0,N=0;fQ&&(B|=1<Q){B|=1<c[L][1])&&(oe=L);for(var ne=-1,L=0;L<3;++L){var j=oe^1<c[ee][0]&&(ee=j)}}var re=w;re[0]=re[1]=re[2]=0,re[o.log2(ne^oe)]=oe&ne,re[o.log2(oe^ee)]=oeⅇvar ue=ee^7;ue===B||ue===X?(ue=ne^7,re[o.log2(ee^ue)]=ue&ee):re[o.log2(ne^ue)]=ue≠for(var _e=S,Te=B,N=0;N<3;++N)Te&1<=0&&(c=s.length-h-1);var m=Math.pow(10,c),p=Math.round(i*n*m),T=p+"";if(T.indexOf("e")>=0)return T;var l=p/m,_=p%m;p<0?(l=-Math.ceil(l)|0,_=-_|0):(l=Math.floor(l)|0,_=_|0);var w=""+l;if(p<0&&(w="-"+w),c){for(var S=""+_;S.length=i[0][h];--p)c.push({x:p*n[h],text:r(n[h],p)});s.push(c)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var h=0;hM+1)throw new Error(w+" map requires nshades to be at least size "+_.length);Array.isArray(c.alpha)?c.alpha.length!==2?y=[1,1]:y=c.alpha.slice():typeof c.alpha=="number"?y=[c.alpha,c.alpha]:y=[1,1],m=_.map(function(P){return Math.round(P.index*M)}),y[0]=Math.min(Math.max(y[0],0),1),y[1]=Math.min(Math.max(y[1],0),1);var v=_.map(function(P,L){var z=_[L].index,F=_[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=y[0]+(y[1]-y[0])*z),F}),u=[];for(b=0;b>1,B=c(g[F],f);B<=0?(B===0&&(z=F),P=F+1):B>0&&(L=F-1)}return z}o=l;function _(g,f){for(var P=new Array(g.length),L=0,z=P.length;L=g.length||c(g[le],F)!==0););}return P}o=_;function w(g,f){if(!f)return _(T(M(g,0)),g,0);for(var P=new Array(f),L=0;L>>N&1&&I.push(z[N]);f.push(I)}return p(f)}o=S;function M(g,f){if(f<0)return[];for(var P=[],L=(1<0?I:N},s.min=function(I,N){return I.cmp(N)<0?I:N},s.prototype._init=function(I,N,U){if(typeof I=="number")return this._initNumber(I,N,U);if(typeof I=="object")return this._initArray(I,N,U);N==="hex"&&(N=16),i(N===(N|0)&&N>=2&&N<=36),I=I.toString().replace(/\s+/g,"");var W=0;I[0]==="-"&&(W++,this.negative=1),W=0;W-=3)le=I[W]|I[W-1]<<8|I[W-2]<<16,this.words[Q]|=le<>>26-se&67108863,se+=24,se>=26&&(se-=26,Q++);else if(U==="le")for(W=0,Q=0;W>>26-se&67108863,se+=24,se>=26&&(se-=26,Q++);return this.strip()};function c(O,I){var N=O.charCodeAt(I);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function m(O,I,N){var U=c(O,N);return N-1>=I&&(U|=c(O,N-1)<<4),U}s.prototype._parseHex=function(I,N,U){this.length=Math.ceil((I.length-N)/6),this.words=new Array(this.length);for(var W=0;W=N;W-=2)se=m(I,N,W)<=18?(Q-=18,le+=1,this.words[le]|=se>>>26):Q+=8;else{var he=I.length-N;for(W=he%2===0?N+1:N;W=18?(Q-=18,le+=1,this.words[le]|=se>>>26):Q+=8}this.strip()};function p(O,I,N,U){for(var W=0,Q=Math.min(O.length,N),le=I;le=49?W+=se-49+10:se>=17?W+=se-17+10:W+=se}return W}s.prototype._parseBase=function(I,N,U){this.words=[0],this.length=1;for(var W=0,Q=1;Q<=67108863;Q*=N)W++;W--,Q=Q/N|0;for(var le=I.length-U,se=le%W,he=Math.min(le,le-se)+U,q=0,$=U;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(I,N){I=I||10,N=N|0||1;var U;if(I===16||I==="hex"){U="";for(var W=0,Q=0,le=0;le>>24-W&16777215,Q!==0||le!==this.length-1?U=T[6-he.length]+he+U:U=he+U,W+=2,W>=26&&(W-=26,le--)}for(Q!==0&&(U=Q.toString(16)+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}if(I===(I|0)&&I>=2&&I<=36){var q=l[I],$=_[I];U="";var J=this.clone();for(J.negative=0;!J.isZero();){var X=J.modn($).toString(I);J=J.idivn($),J.isZero()?U=X+U:U=T[q-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(I,N){return i(typeof h<"u"),this.toArrayLike(h,I,N)},s.prototype.toArray=function(I,N){return this.toArrayLike(Array,I,N)},s.prototype.toArrayLike=function(I,N,U){var W=this.byteLength(),Q=U||Math.max(1,W);i(W<=Q,"byte array longer than desired length"),i(Q>0,"Requested array length <= 0"),this.strip();var le=N==="le",se=new I(Q),he,q,$=this.clone();if(le){for(q=0;!$.isZero();q++)he=$.andln(255),$.iushrn(8),se[q]=he;for(;q=4096&&(U+=13,N>>>=13),N>=64&&(U+=7,N>>>=7),N>=8&&(U+=4,N>>>=4),N>=2&&(U+=2,N>>>=2),U+N},s.prototype._zeroBits=function(I){if(I===0)return 26;var N=I,U=0;return(N&8191)===0&&(U+=13,N>>>=13),(N&127)===0&&(U+=7,N>>>=7),(N&15)===0&&(U+=4,N>>>=4),(N&3)===0&&(U+=2,N>>>=2),(N&1)===0&&U++,U},s.prototype.bitLength=function(){var I=this.words[this.length-1],N=this._countBits(I);return(this.length-1)*26+N};function w(O){for(var I=new Array(O.bitLength()),N=0;N>>W}return I}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,N=0;NI.length?this.clone().ior(I):I.clone().ior(this)},s.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},s.prototype.iuand=function(I){var N;this.length>I.length?N=I:N=this;for(var U=0;UI.length?this.clone().iand(I):I.clone().iand(this)},s.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},s.prototype.iuxor=function(I){var N,U;this.length>I.length?(N=this,U=I):(N=I,U=this);for(var W=0;WI.length?this.clone().ixor(I):I.clone().ixor(this)},s.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},s.prototype.inotn=function(I){i(typeof I=="number"&&I>=0);var N=Math.ceil(I/26)|0,U=I%26;this._expand(N),U>0&&N--;for(var W=0;W0&&(this.words[W]=~this.words[W]&67108863>>26-U),this.strip()},s.prototype.notn=function(I){return this.clone().inotn(I)},s.prototype.setn=function(I,N){i(typeof I=="number"&&I>=0);var U=I/26|0,W=I%26;return this._expand(U+1),N?this.words[U]=this.words[U]|1<I.length?(U=this,W=I):(U=I,W=this);for(var Q=0,le=0;le>>26;for(;Q!==0&&le>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;leI.length?this.clone().iadd(I):I.clone().iadd(this)},s.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var N=this.iadd(I);return I.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var U=this.cmp(I);if(U===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Q;U>0?(W=this,Q=I):(W=I,Q=this);for(var le=0,se=0;se>26,this.words[se]=N&67108863;for(;le!==0&&se>26,this.words[se]=N&67108863;if(le===0&&se>>26,J=he&67108863,X=Math.min(q,I.length-1),oe=Math.max(0,q-O.length+1);oe<=X;oe++){var ne=q-oe|0;W=O.words[ne]|0,Q=I.words[oe]|0,le=W*Q+J,$+=le/67108864|0,J=le&67108863}N.words[q]=J|0,he=$|0}return he!==0?N.words[q]=he|0:N.length--,N.strip()}var M=function(I,N,U){var W=I.words,Q=N.words,le=U.words,se=0,he,q,$,J=W[0]|0,X=J&8191,oe=J>>>13,ne=W[1]|0,j=ne&8191,ee=ne>>>13,re=W[2]|0,ue=re&8191,_e=re>>>13,Te=W[3]|0,Ie=Te&8191,De=Te>>>13,He=W[4]|0,et=He&8191,rt=He>>>13,$e=W[5]|0,ot=$e&8191,Ae=$e>>>13,ge=W[6]|0,ce=ge&8191,ze=ge>>>13,Qe=W[7]|0,nt=Qe&8191,Ke=Qe>>>13,kt=W[8]|0,Et=kt&8191,Bt=kt>>>13,jt=W[9]|0,_r=jt&8191,pr=jt>>>13,Or=Q[0]|0,mr=Or&8191,Er=Or>>>13,yt=Q[1]|0,Oe=yt&8191,Xe=yt>>>13,be=Q[2]|0,Ce=be&8191,Ne=be>>>13,Ee=Q[3]|0,Se=Ee&8191,Le=Ee>>>13,at=Q[4]|0,dt=at&8191,gt=at>>>13,Ct=Q[5]|0,or=Ct&8191,Qt=Ct>>>13,Jt=Q[6]|0,Sr=Jt&8191,oa=Jt>>>13,Ea=Q[7]|0,Sa=Ea&8191,za=Ea>>>13,Na=Q[8]|0,Ta=Na&8191,nn=Na>>>13,gn=Q[9]|0,Ht=gn&8191,It=gn>>>13;U.negative=I.negative^N.negative,U.length=19,he=Math.imul(X,mr),q=Math.imul(X,Er),q=q+Math.imul(oe,mr)|0,$=Math.imul(oe,Er);var Gt=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,he=Math.imul(j,mr),q=Math.imul(j,Er),q=q+Math.imul(ee,mr)|0,$=Math.imul(ee,Er),he=he+Math.imul(X,Oe)|0,q=q+Math.imul(X,Xe)|0,q=q+Math.imul(oe,Oe)|0,$=$+Math.imul(oe,Xe)|0;var Xt=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,he=Math.imul(ue,mr),q=Math.imul(ue,Er),q=q+Math.imul(_e,mr)|0,$=Math.imul(_e,Er),he=he+Math.imul(j,Oe)|0,q=q+Math.imul(j,Xe)|0,q=q+Math.imul(ee,Oe)|0,$=$+Math.imul(ee,Xe)|0,he=he+Math.imul(X,Ce)|0,q=q+Math.imul(X,Ne)|0,q=q+Math.imul(oe,Ce)|0,$=$+Math.imul(oe,Ne)|0;var Rr=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,he=Math.imul(Ie,mr),q=Math.imul(Ie,Er),q=q+Math.imul(De,mr)|0,$=Math.imul(De,Er),he=he+Math.imul(ue,Oe)|0,q=q+Math.imul(ue,Xe)|0,q=q+Math.imul(_e,Oe)|0,$=$+Math.imul(_e,Xe)|0,he=he+Math.imul(j,Ce)|0,q=q+Math.imul(j,Ne)|0,q=q+Math.imul(ee,Ce)|0,$=$+Math.imul(ee,Ne)|0,he=he+Math.imul(X,Se)|0,q=q+Math.imul(X,Le)|0,q=q+Math.imul(oe,Se)|0,$=$+Math.imul(oe,Le)|0;var Yr=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,he=Math.imul(et,mr),q=Math.imul(et,Er),q=q+Math.imul(rt,mr)|0,$=Math.imul(rt,Er),he=he+Math.imul(Ie,Oe)|0,q=q+Math.imul(Ie,Xe)|0,q=q+Math.imul(De,Oe)|0,$=$+Math.imul(De,Xe)|0,he=he+Math.imul(ue,Ce)|0,q=q+Math.imul(ue,Ne)|0,q=q+Math.imul(_e,Ce)|0,$=$+Math.imul(_e,Ne)|0,he=he+Math.imul(j,Se)|0,q=q+Math.imul(j,Le)|0,q=q+Math.imul(ee,Se)|0,$=$+Math.imul(ee,Le)|0,he=he+Math.imul(X,dt)|0,q=q+Math.imul(X,gt)|0,q=q+Math.imul(oe,dt)|0,$=$+Math.imul(oe,gt)|0;var Jr=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,he=Math.imul(ot,mr),q=Math.imul(ot,Er),q=q+Math.imul(Ae,mr)|0,$=Math.imul(Ae,Er),he=he+Math.imul(et,Oe)|0,q=q+Math.imul(et,Xe)|0,q=q+Math.imul(rt,Oe)|0,$=$+Math.imul(rt,Xe)|0,he=he+Math.imul(Ie,Ce)|0,q=q+Math.imul(Ie,Ne)|0,q=q+Math.imul(De,Ce)|0,$=$+Math.imul(De,Ne)|0,he=he+Math.imul(ue,Se)|0,q=q+Math.imul(ue,Le)|0,q=q+Math.imul(_e,Se)|0,$=$+Math.imul(_e,Le)|0,he=he+Math.imul(j,dt)|0,q=q+Math.imul(j,gt)|0,q=q+Math.imul(ee,dt)|0,$=$+Math.imul(ee,gt)|0,he=he+Math.imul(X,or)|0,q=q+Math.imul(X,Qt)|0,q=q+Math.imul(oe,or)|0,$=$+Math.imul(oe,Qt)|0;var ia=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(ia>>>26)|0,ia&=67108863,he=Math.imul(ce,mr),q=Math.imul(ce,Er),q=q+Math.imul(ze,mr)|0,$=Math.imul(ze,Er),he=he+Math.imul(ot,Oe)|0,q=q+Math.imul(ot,Xe)|0,q=q+Math.imul(Ae,Oe)|0,$=$+Math.imul(Ae,Xe)|0,he=he+Math.imul(et,Ce)|0,q=q+Math.imul(et,Ne)|0,q=q+Math.imul(rt,Ce)|0,$=$+Math.imul(rt,Ne)|0,he=he+Math.imul(Ie,Se)|0,q=q+Math.imul(Ie,Le)|0,q=q+Math.imul(De,Se)|0,$=$+Math.imul(De,Le)|0,he=he+Math.imul(ue,dt)|0,q=q+Math.imul(ue,gt)|0,q=q+Math.imul(_e,dt)|0,$=$+Math.imul(_e,gt)|0,he=he+Math.imul(j,or)|0,q=q+Math.imul(j,Qt)|0,q=q+Math.imul(ee,or)|0,$=$+Math.imul(ee,Qt)|0,he=he+Math.imul(X,Sr)|0,q=q+Math.imul(X,oa)|0,q=q+Math.imul(oe,Sr)|0,$=$+Math.imul(oe,oa)|0;var Pa=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,he=Math.imul(nt,mr),q=Math.imul(nt,Er),q=q+Math.imul(Ke,mr)|0,$=Math.imul(Ke,Er),he=he+Math.imul(ce,Oe)|0,q=q+Math.imul(ce,Xe)|0,q=q+Math.imul(ze,Oe)|0,$=$+Math.imul(ze,Xe)|0,he=he+Math.imul(ot,Ce)|0,q=q+Math.imul(ot,Ne)|0,q=q+Math.imul(Ae,Ce)|0,$=$+Math.imul(Ae,Ne)|0,he=he+Math.imul(et,Se)|0,q=q+Math.imul(et,Le)|0,q=q+Math.imul(rt,Se)|0,$=$+Math.imul(rt,Le)|0,he=he+Math.imul(Ie,dt)|0,q=q+Math.imul(Ie,gt)|0,q=q+Math.imul(De,dt)|0,$=$+Math.imul(De,gt)|0,he=he+Math.imul(ue,or)|0,q=q+Math.imul(ue,Qt)|0,q=q+Math.imul(_e,or)|0,$=$+Math.imul(_e,Qt)|0,he=he+Math.imul(j,Sr)|0,q=q+Math.imul(j,oa)|0,q=q+Math.imul(ee,Sr)|0,$=$+Math.imul(ee,oa)|0,he=he+Math.imul(X,Sa)|0,q=q+Math.imul(X,za)|0,q=q+Math.imul(oe,Sa)|0,$=$+Math.imul(oe,za)|0;var Ga=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,he=Math.imul(Et,mr),q=Math.imul(Et,Er),q=q+Math.imul(Bt,mr)|0,$=Math.imul(Bt,Er),he=he+Math.imul(nt,Oe)|0,q=q+Math.imul(nt,Xe)|0,q=q+Math.imul(Ke,Oe)|0,$=$+Math.imul(Ke,Xe)|0,he=he+Math.imul(ce,Ce)|0,q=q+Math.imul(ce,Ne)|0,q=q+Math.imul(ze,Ce)|0,$=$+Math.imul(ze,Ne)|0,he=he+Math.imul(ot,Se)|0,q=q+Math.imul(ot,Le)|0,q=q+Math.imul(Ae,Se)|0,$=$+Math.imul(Ae,Le)|0,he=he+Math.imul(et,dt)|0,q=q+Math.imul(et,gt)|0,q=q+Math.imul(rt,dt)|0,$=$+Math.imul(rt,gt)|0,he=he+Math.imul(Ie,or)|0,q=q+Math.imul(Ie,Qt)|0,q=q+Math.imul(De,or)|0,$=$+Math.imul(De,Qt)|0,he=he+Math.imul(ue,Sr)|0,q=q+Math.imul(ue,oa)|0,q=q+Math.imul(_e,Sr)|0,$=$+Math.imul(_e,oa)|0,he=he+Math.imul(j,Sa)|0,q=q+Math.imul(j,za)|0,q=q+Math.imul(ee,Sa)|0,$=$+Math.imul(ee,za)|0,he=he+Math.imul(X,Ta)|0,q=q+Math.imul(X,nn)|0,q=q+Math.imul(oe,Ta)|0,$=$+Math.imul(oe,nn)|0;var ja=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(ja>>>26)|0,ja&=67108863,he=Math.imul(_r,mr),q=Math.imul(_r,Er),q=q+Math.imul(pr,mr)|0,$=Math.imul(pr,Er),he=he+Math.imul(Et,Oe)|0,q=q+Math.imul(Et,Xe)|0,q=q+Math.imul(Bt,Oe)|0,$=$+Math.imul(Bt,Xe)|0,he=he+Math.imul(nt,Ce)|0,q=q+Math.imul(nt,Ne)|0,q=q+Math.imul(Ke,Ce)|0,$=$+Math.imul(Ke,Ne)|0,he=he+Math.imul(ce,Se)|0,q=q+Math.imul(ce,Le)|0,q=q+Math.imul(ze,Se)|0,$=$+Math.imul(ze,Le)|0,he=he+Math.imul(ot,dt)|0,q=q+Math.imul(ot,gt)|0,q=q+Math.imul(Ae,dt)|0,$=$+Math.imul(Ae,gt)|0,he=he+Math.imul(et,or)|0,q=q+Math.imul(et,Qt)|0,q=q+Math.imul(rt,or)|0,$=$+Math.imul(rt,Qt)|0,he=he+Math.imul(Ie,Sr)|0,q=q+Math.imul(Ie,oa)|0,q=q+Math.imul(De,Sr)|0,$=$+Math.imul(De,oa)|0,he=he+Math.imul(ue,Sa)|0,q=q+Math.imul(ue,za)|0,q=q+Math.imul(_e,Sa)|0,$=$+Math.imul(_e,za)|0,he=he+Math.imul(j,Ta)|0,q=q+Math.imul(j,nn)|0,q=q+Math.imul(ee,Ta)|0,$=$+Math.imul(ee,nn)|0,he=he+Math.imul(X,Ht)|0,q=q+Math.imul(X,It)|0,q=q+Math.imul(oe,Ht)|0,$=$+Math.imul(oe,It)|0;var Xa=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Xa>>>26)|0,Xa&=67108863,he=Math.imul(_r,Oe),q=Math.imul(_r,Xe),q=q+Math.imul(pr,Oe)|0,$=Math.imul(pr,Xe),he=he+Math.imul(Et,Ce)|0,q=q+Math.imul(Et,Ne)|0,q=q+Math.imul(Bt,Ce)|0,$=$+Math.imul(Bt,Ne)|0,he=he+Math.imul(nt,Se)|0,q=q+Math.imul(nt,Le)|0,q=q+Math.imul(Ke,Se)|0,$=$+Math.imul(Ke,Le)|0,he=he+Math.imul(ce,dt)|0,q=q+Math.imul(ce,gt)|0,q=q+Math.imul(ze,dt)|0,$=$+Math.imul(ze,gt)|0,he=he+Math.imul(ot,or)|0,q=q+Math.imul(ot,Qt)|0,q=q+Math.imul(Ae,or)|0,$=$+Math.imul(Ae,Qt)|0,he=he+Math.imul(et,Sr)|0,q=q+Math.imul(et,oa)|0,q=q+Math.imul(rt,Sr)|0,$=$+Math.imul(rt,oa)|0,he=he+Math.imul(Ie,Sa)|0,q=q+Math.imul(Ie,za)|0,q=q+Math.imul(De,Sa)|0,$=$+Math.imul(De,za)|0,he=he+Math.imul(ue,Ta)|0,q=q+Math.imul(ue,nn)|0,q=q+Math.imul(_e,Ta)|0,$=$+Math.imul(_e,nn)|0,he=he+Math.imul(j,Ht)|0,q=q+Math.imul(j,It)|0,q=q+Math.imul(ee,Ht)|0,$=$+Math.imul(ee,It)|0;var sn=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(sn>>>26)|0,sn&=67108863,he=Math.imul(_r,Ce),q=Math.imul(_r,Ne),q=q+Math.imul(pr,Ce)|0,$=Math.imul(pr,Ne),he=he+Math.imul(Et,Se)|0,q=q+Math.imul(Et,Le)|0,q=q+Math.imul(Bt,Se)|0,$=$+Math.imul(Bt,Le)|0,he=he+Math.imul(nt,dt)|0,q=q+Math.imul(nt,gt)|0,q=q+Math.imul(Ke,dt)|0,$=$+Math.imul(Ke,gt)|0,he=he+Math.imul(ce,or)|0,q=q+Math.imul(ce,Qt)|0,q=q+Math.imul(ze,or)|0,$=$+Math.imul(ze,Qt)|0,he=he+Math.imul(ot,Sr)|0,q=q+Math.imul(ot,oa)|0,q=q+Math.imul(Ae,Sr)|0,$=$+Math.imul(Ae,oa)|0,he=he+Math.imul(et,Sa)|0,q=q+Math.imul(et,za)|0,q=q+Math.imul(rt,Sa)|0,$=$+Math.imul(rt,za)|0,he=he+Math.imul(Ie,Ta)|0,q=q+Math.imul(Ie,nn)|0,q=q+Math.imul(De,Ta)|0,$=$+Math.imul(De,nn)|0,he=he+Math.imul(ue,Ht)|0,q=q+Math.imul(ue,It)|0,q=q+Math.imul(_e,Ht)|0,$=$+Math.imul(_e,It)|0;var Ma=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,he=Math.imul(_r,Se),q=Math.imul(_r,Le),q=q+Math.imul(pr,Se)|0,$=Math.imul(pr,Le),he=he+Math.imul(Et,dt)|0,q=q+Math.imul(Et,gt)|0,q=q+Math.imul(Bt,dt)|0,$=$+Math.imul(Bt,gt)|0,he=he+Math.imul(nt,or)|0,q=q+Math.imul(nt,Qt)|0,q=q+Math.imul(Ke,or)|0,$=$+Math.imul(Ke,Qt)|0,he=he+Math.imul(ce,Sr)|0,q=q+Math.imul(ce,oa)|0,q=q+Math.imul(ze,Sr)|0,$=$+Math.imul(ze,oa)|0,he=he+Math.imul(ot,Sa)|0,q=q+Math.imul(ot,za)|0,q=q+Math.imul(Ae,Sa)|0,$=$+Math.imul(Ae,za)|0,he=he+Math.imul(et,Ta)|0,q=q+Math.imul(et,nn)|0,q=q+Math.imul(rt,Ta)|0,$=$+Math.imul(rt,nn)|0,he=he+Math.imul(Ie,Ht)|0,q=q+Math.imul(Ie,It)|0,q=q+Math.imul(De,Ht)|0,$=$+Math.imul(De,It)|0;var Xn=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,he=Math.imul(_r,dt),q=Math.imul(_r,gt),q=q+Math.imul(pr,dt)|0,$=Math.imul(pr,gt),he=he+Math.imul(Et,or)|0,q=q+Math.imul(Et,Qt)|0,q=q+Math.imul(Bt,or)|0,$=$+Math.imul(Bt,Qt)|0,he=he+Math.imul(nt,Sr)|0,q=q+Math.imul(nt,oa)|0,q=q+Math.imul(Ke,Sr)|0,$=$+Math.imul(Ke,oa)|0,he=he+Math.imul(ce,Sa)|0,q=q+Math.imul(ce,za)|0,q=q+Math.imul(ze,Sa)|0,$=$+Math.imul(ze,za)|0,he=he+Math.imul(ot,Ta)|0,q=q+Math.imul(ot,nn)|0,q=q+Math.imul(Ae,Ta)|0,$=$+Math.imul(Ae,nn)|0,he=he+Math.imul(et,Ht)|0,q=q+Math.imul(et,It)|0,q=q+Math.imul(rt,Ht)|0,$=$+Math.imul(rt,It)|0;var Kn=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,he=Math.imul(_r,or),q=Math.imul(_r,Qt),q=q+Math.imul(pr,or)|0,$=Math.imul(pr,Qt),he=he+Math.imul(Et,Sr)|0,q=q+Math.imul(Et,oa)|0,q=q+Math.imul(Bt,Sr)|0,$=$+Math.imul(Bt,oa)|0,he=he+Math.imul(nt,Sa)|0,q=q+Math.imul(nt,za)|0,q=q+Math.imul(Ke,Sa)|0,$=$+Math.imul(Ke,za)|0,he=he+Math.imul(ce,Ta)|0,q=q+Math.imul(ce,nn)|0,q=q+Math.imul(ze,Ta)|0,$=$+Math.imul(ze,nn)|0,he=he+Math.imul(ot,Ht)|0,q=q+Math.imul(ot,It)|0,q=q+Math.imul(Ae,Ht)|0,$=$+Math.imul(Ae,It)|0;var St=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(St>>>26)|0,St&=67108863,he=Math.imul(_r,Sr),q=Math.imul(_r,oa),q=q+Math.imul(pr,Sr)|0,$=Math.imul(pr,oa),he=he+Math.imul(Et,Sa)|0,q=q+Math.imul(Et,za)|0,q=q+Math.imul(Bt,Sa)|0,$=$+Math.imul(Bt,za)|0,he=he+Math.imul(nt,Ta)|0,q=q+Math.imul(nt,nn)|0,q=q+Math.imul(Ke,Ta)|0,$=$+Math.imul(Ke,nn)|0,he=he+Math.imul(ce,Ht)|0,q=q+Math.imul(ce,It)|0,q=q+Math.imul(ze,Ht)|0,$=$+Math.imul(ze,It)|0;var lt=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(lt>>>26)|0,lt&=67108863,he=Math.imul(_r,Sa),q=Math.imul(_r,za),q=q+Math.imul(pr,Sa)|0,$=Math.imul(pr,za),he=he+Math.imul(Et,Ta)|0,q=q+Math.imul(Et,nn)|0,q=q+Math.imul(Bt,Ta)|0,$=$+Math.imul(Bt,nn)|0,he=he+Math.imul(nt,Ht)|0,q=q+Math.imul(nt,It)|0,q=q+Math.imul(Ke,Ht)|0,$=$+Math.imul(Ke,It)|0;var br=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(br>>>26)|0,br&=67108863,he=Math.imul(_r,Ta),q=Math.imul(_r,nn),q=q+Math.imul(pr,Ta)|0,$=Math.imul(pr,nn),he=he+Math.imul(Et,Ht)|0,q=q+Math.imul(Et,It)|0,q=q+Math.imul(Bt,Ht)|0,$=$+Math.imul(Bt,It)|0;var kr=(se+he|0)+((q&8191)<<13)|0;se=($+(q>>>13)|0)+(kr>>>26)|0,kr&=67108863,he=Math.imul(_r,Ht),q=Math.imul(_r,It),q=q+Math.imul(pr,Ht)|0,$=Math.imul(pr,It);var Lr=(se+he|0)+((q&8191)<<13)|0;return se=($+(q>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,le[0]=Gt,le[1]=Xt,le[2]=Rr,le[3]=Yr,le[4]=Jr,le[5]=ia,le[6]=Pa,le[7]=Ga,le[8]=ja,le[9]=Xa,le[10]=sn,le[11]=Ma,le[12]=Xn,le[13]=Kn,le[14]=St,le[15]=lt,le[16]=br,le[17]=kr,le[18]=Lr,se!==0&&(le[19]=se,U.length++),U};Math.imul||(M=S);function y(O,I,N){N.negative=I.negative^O.negative,N.length=O.length+I.length;for(var U=0,W=0,Q=0;Q>>26)|0,W+=le>>>26,le&=67108863}N.words[Q]=se,U=le,le=W}return U!==0?N.words[Q]=U:N.length--,N.strip()}function b(O,I,N){var U=new v;return U.mulp(O,I,N)}s.prototype.mulTo=function(I,N){var U,W=this.length+I.length;return this.length===10&&I.length===10?U=M(this,I,N):W<63?U=S(this,I,N):W<1024?U=y(this,I,N):U=b(this,I,N),U};function v(O,I){this.x=O,this.y=I}v.prototype.makeRBT=function(I){for(var N=new Array(I),U=s.prototype._countBits(I)-1,W=0;W>=1;return W},v.prototype.permute=function(I,N,U,W,Q,le){for(var se=0;se>>1)Q++;return 1<>>13,U[2*le+1]=Q&8191,Q=Q>>>13;for(le=2*N;le>=26,N+=W/67108864|0,N+=Q>>>26,this.words[U]=Q&67108863}return N!==0&&(this.words[U]=N,this.length++),this},s.prototype.muln=function(I){return this.clone().imuln(I)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(I){var N=w(I);if(N.length===0)return new s(1);for(var U=this,W=0;W=0);var N=I%26,U=(I-N)/26,W=67108863>>>26-N<<26-N,Q;if(N!==0){var le=0;for(Q=0;Q>>26-N}le&&(this.words[Q]=le,this.length++)}if(U!==0){for(Q=this.length-1;Q>=0;Q--)this.words[Q+U]=this.words[Q];for(Q=0;Q=0);var W;N?W=(N-N%26)/26:W=0;var Q=I%26,le=Math.min((I-Q)/26,this.length),se=67108863^67108863>>>Q<le)for(this.length-=le,q=0;q=0&&($!==0||q>=W);q--){var J=this.words[q]|0;this.words[q]=$<<26-Q|J>>>Q,$=J&se}return he&&$!==0&&(he.words[he.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(I,N,U){return i(this.negative===0),this.iushrn(I,N,U)},s.prototype.shln=function(I){return this.clone().ishln(I)},s.prototype.ushln=function(I){return this.clone().iushln(I)},s.prototype.shrn=function(I){return this.clone().ishrn(I)},s.prototype.ushrn=function(I){return this.clone().iushrn(I)},s.prototype.testn=function(I){i(typeof I=="number"&&I>=0);var N=I%26,U=(I-N)/26,W=1<=0);var N=I%26,U=(I-N)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=U)return this;if(N!==0&&U++,this.length=Math.min(U,this.length),N!==0){var W=67108863^67108863>>>N<=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},s.prototype.isubn=function(I){if(i(typeof I=="number"),i(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var N=0;N>26)-(he/67108864|0),this.words[Q+U]=le&67108863}for(;Q>26,this.words[Q+U]=le&67108863;if(se===0)return this.strip();for(i(se===-1),se=0,Q=0;Q>26,this.words[Q]=le&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(I,N){var U=this.length-I.length,W=this.clone(),Q=I,le=Q.words[Q.length-1]|0,se=this._countBits(le);U=26-se,U!==0&&(Q=Q.ushln(U),W.iushln(U),le=Q.words[Q.length-1]|0);var he=W.length-Q.length,q;if(N!=="mod"){q=new s(null),q.length=he+1,q.words=new Array(q.length);for(var $=0;$=0;X--){var oe=(W.words[Q.length+X]|0)*67108864+(W.words[Q.length+X-1]|0);for(oe=Math.min(oe/le|0,67108863),W._ishlnsubmul(Q,oe,X);W.negative!==0;)oe--,W.negative=0,W._ishlnsubmul(Q,1,X),W.isZero()||(W.negative^=1);q&&(q.words[X]=oe)}return q&&q.strip(),W.strip(),N!=="div"&&U!==0&&W.iushrn(U),{div:q||null,mod:W}},s.prototype.divmod=function(I,N,U){if(i(!I.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var W,Q,le;return this.negative!==0&&I.negative===0?(le=this.neg().divmod(I,N),N!=="mod"&&(W=le.div.neg()),N!=="div"&&(Q=le.mod.neg(),U&&Q.negative!==0&&Q.iadd(I)),{div:W,mod:Q}):this.negative===0&&I.negative!==0?(le=this.divmod(I.neg(),N),N!=="mod"&&(W=le.div.neg()),{div:W,mod:le.mod}):(this.negative&I.negative)!==0?(le=this.neg().divmod(I.neg(),N),N!=="div"&&(Q=le.mod.neg(),U&&Q.negative!==0&&Q.isub(I)),{div:le.div,mod:Q}):I.length>this.length||this.cmp(I)<0?{div:new s(0),mod:this}:I.length===1?N==="div"?{div:this.divn(I.words[0]),mod:null}:N==="mod"?{div:null,mod:new s(this.modn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new s(this.modn(I.words[0]))}:this._wordDiv(I,N)},s.prototype.div=function(I){return this.divmod(I,"div",!1).div},s.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},s.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},s.prototype.divRound=function(I){var N=this.divmod(I);if(N.mod.isZero())return N.div;var U=N.div.negative!==0?N.mod.isub(I):N.mod,W=I.ushrn(1),Q=I.andln(1),le=U.cmp(W);return le<0||Q===1&&le===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},s.prototype.modn=function(I){i(I<=67108863);for(var N=(1<<26)%I,U=0,W=this.length-1;W>=0;W--)U=(N*U+(this.words[W]|0))%I;return U},s.prototype.idivn=function(I){i(I<=67108863);for(var N=0,U=this.length-1;U>=0;U--){var W=(this.words[U]|0)+N*67108864;this.words[U]=W/I|0,N=W%I}return this.strip()},s.prototype.divn=function(I){return this.clone().idivn(I)},s.prototype.egcd=function(I){i(I.negative===0),i(!I.isZero());var N=this,U=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var W=new s(1),Q=new s(0),le=new s(0),se=new s(1),he=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++he;for(var q=U.clone(),$=N.clone();!N.isZero();){for(var J=0,X=1;(N.words[0]&X)===0&&J<26;++J,X<<=1);if(J>0)for(N.iushrn(J);J-- >0;)(W.isOdd()||Q.isOdd())&&(W.iadd(q),Q.isub($)),W.iushrn(1),Q.iushrn(1);for(var oe=0,ne=1;(U.words[0]&ne)===0&&oe<26;++oe,ne<<=1);if(oe>0)for(U.iushrn(oe);oe-- >0;)(le.isOdd()||se.isOdd())&&(le.iadd(q),se.isub($)),le.iushrn(1),se.iushrn(1);N.cmp(U)>=0?(N.isub(U),W.isub(le),Q.isub(se)):(U.isub(N),le.isub(W),se.isub(Q))}return{a:le,b:se,gcd:U.iushln(he)}},s.prototype._invmp=function(I){i(I.negative===0),i(!I.isZero());var N=this,U=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var W=new s(1),Q=new s(0),le=U.clone();N.cmpn(1)>0&&U.cmpn(1)>0;){for(var se=0,he=1;(N.words[0]&he)===0&&se<26;++se,he<<=1);if(se>0)for(N.iushrn(se);se-- >0;)W.isOdd()&&W.iadd(le),W.iushrn(1);for(var q=0,$=1;(U.words[0]&$)===0&&q<26;++q,$<<=1);if(q>0)for(U.iushrn(q);q-- >0;)Q.isOdd()&&Q.iadd(le),Q.iushrn(1);N.cmp(U)>=0?(N.isub(U),W.isub(Q)):(U.isub(N),Q.isub(W))}var J;return N.cmpn(1)===0?J=W:J=Q,J.cmpn(0)<0&&J.iadd(I),J},s.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var N=this.clone(),U=I.clone();N.negative=0,U.negative=0;for(var W=0;N.isEven()&&U.isEven();W++)N.iushrn(1),U.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;U.isEven();)U.iushrn(1);var Q=N.cmp(U);if(Q<0){var le=N;N=U,U=le}else if(Q===0||U.cmpn(1)===0)break;N.isub(U)}while(!0);return U.iushln(W)},s.prototype.invm=function(I){return this.egcd(I).a.umod(I)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(I){return this.words[0]&I},s.prototype.bincn=function(I){i(typeof I=="number");var N=I%26,U=(I-N)/26,W=1<>>26,se&=67108863,this.words[le]=se}return Q!==0&&(this.words[le]=Q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(I){var N=I<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this.strip();var U;if(this.length>1)U=1;else{N&&(I=-I),i(I<=67108863,"Number is too big");var W=this.words[0]|0;U=W===I?0:WI.length)return 1;if(this.length=0;U--){var W=this.words[U]|0,Q=I.words[U]|0;if(W!==Q){WQ&&(N=1);break}}return N},s.prototype.gtn=function(I){return this.cmpn(I)===1},s.prototype.gt=function(I){return this.cmp(I)===1},s.prototype.gten=function(I){return this.cmpn(I)>=0},s.prototype.gte=function(I){return this.cmp(I)>=0},s.prototype.ltn=function(I){return this.cmpn(I)===-1},s.prototype.lt=function(I){return this.cmp(I)===-1},s.prototype.lten=function(I){return this.cmpn(I)<=0},s.prototype.lte=function(I){return this.cmp(I)<=0},s.prototype.eqn=function(I){return this.cmpn(I)===0},s.prototype.eq=function(I){return this.cmp(I)===0},s.red=function(I){return new F(I)},s.prototype.toRed=function(I){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(I){return this.red=I,this},s.prototype.forceRed=function(I){return i(!this.red,"Already a number in reduction context"),this._forceRed(I)},s.prototype.redAdd=function(I){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},s.prototype.redIAdd=function(I){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},s.prototype.redSub=function(I){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},s.prototype.redISub=function(I){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},s.prototype.redShl=function(I){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},s.prototype.redMul=function(I){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},s.prototype.redIMul=function(I){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(I){return i(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var u={k256:null,p224:null,p192:null,p25519:null};function g(O,I){this.name=O,this.p=new s(I,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}g.prototype._tmp=function(){var I=new s(null);return I.words=new Array(Math.ceil(this.n/13)),I},g.prototype.ireduce=function(I){var N=I,U;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),U=N.bitLength();while(U>this.n);var W=U0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},g.prototype.split=function(I,N){I.iushrn(this.n,0,N)},g.prototype.imulK=function(I){return I.imul(this.k)};function f(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(f,g),f.prototype.split=function(I,N){for(var U=4194303,W=Math.min(I.length,9),Q=0;Q>>22,le=se}le>>>=22,I.words[Q-10]=le,le===0&&I.length>10?I.length-=10:I.length-=9},f.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var N=0,U=0;U>>=26,I.words[U]=Q,N=W}return N!==0&&(I.words[I.length++]=N),I},s._prime=function(I){if(u[I])return u[I];var N;if(I==="k256")N=new f;else if(I==="p224")N=new P;else if(I==="p192")N=new L;else if(I==="p25519")N=new z;else throw new Error("Unknown prime "+I);return u[I]=N,N};function F(O){if(typeof O=="string"){var I=s._prime(O);this.m=I.p,this.prime=I}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(I){i(I.negative===0,"red works only with positives"),i(I.red,"red works only with red numbers")},F.prototype._verify2=function(I,N){i((I.negative|N.negative)===0,"red works only with positives"),i(I.red&&I.red===N.red,"red works only with red numbers")},F.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):I.umod(this.m)._forceRed(this)},F.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},F.prototype.add=function(I,N){this._verify2(I,N);var U=I.add(N);return U.cmp(this.m)>=0&&U.isub(this.m),U._forceRed(this)},F.prototype.iadd=function(I,N){this._verify2(I,N);var U=I.iadd(N);return U.cmp(this.m)>=0&&U.isub(this.m),U},F.prototype.sub=function(I,N){this._verify2(I,N);var U=I.sub(N);return U.cmpn(0)<0&&U.iadd(this.m),U._forceRed(this)},F.prototype.isub=function(I,N){this._verify2(I,N);var U=I.isub(N);return U.cmpn(0)<0&&U.iadd(this.m),U},F.prototype.shl=function(I,N){return this._verify1(I),this.imod(I.ushln(N))},F.prototype.imul=function(I,N){return this._verify2(I,N),this.imod(I.imul(N))},F.prototype.mul=function(I,N){return this._verify2(I,N),this.imod(I.mul(N))},F.prototype.isqr=function(I){return this.imul(I,I.clone())},F.prototype.sqr=function(I){return this.mul(I,I)},F.prototype.sqrt=function(I){if(I.isZero())return I.clone();var N=this.m.andln(3);if(i(N%2===1),N===3){var U=this.m.add(new s(1)).iushrn(2);return this.pow(I,U)}for(var W=this.m.subn(1),Q=0;!W.isZero()&&W.andln(1)===0;)Q++,W.iushrn(1);i(!W.isZero());var le=new s(1).toRed(this),se=le.redNeg(),he=this.m.subn(1).iushrn(1),q=this.m.bitLength();for(q=new s(2*q*q).toRed(this);this.pow(q,he).cmp(se)!==0;)q.redIAdd(se);for(var $=this.pow(q,W),J=this.pow(I,W.addn(1).iushrn(1)),X=this.pow(I,W),oe=Q;X.cmp(le)!==0;){for(var ne=X,j=0;ne.cmp(le)!==0;j++)ne=ne.redSqr();i(j=0;Q--){for(var $=N.words[Q],J=q-1;J>=0;J--){var X=$>>J&1;if(le!==W[0]&&(le=this.sqr(le)),X===0&&se===0){he=0;continue}se<<=1,se|=X,he++,!(he!==U&&(Q!==0||J!==0))&&(le=this.mul(le,W[se]),he=0,se=0)}q=26}return le},F.prototype.convertTo=function(I){var N=I.umod(this.m);return N===I?N.clone():N},F.prototype.convertFrom=function(I){var N=I.clone();return N.red=null,N},s.mont=function(I){return new B(I)};function B(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(B,F),B.prototype.convertTo=function(I){return this.imod(I.ushln(this.shift))},B.prototype.convertFrom=function(I){var N=this.imod(I.mul(this.rinv));return N.red=null,N},B.prototype.imul=function(I,N){if(I.isZero()||N.isZero())return I.words[0]=0,I.length=1,I;var U=I.imul(N),W=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(W).iushrn(this.shift),le=Q;return Q.cmp(this.m)>=0?le=Q.isub(this.m):Q.cmpn(0)<0&&(le=Q.iadd(this.m)),le._forceRed(this)},B.prototype.mul=function(I,N){if(I.isZero()||N.isZero())return new s(0)._forceRed(this);var U=I.mul(N),W=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(W).iushrn(this.shift),le=Q;return Q.cmp(this.m)>=0?le=Q.isub(this.m):Q.cmpn(0)<0&&(le=Q.iadd(this.m)),le._forceRed(this)},B.prototype.invm=function(I){var N=this.imod(I._invmp(this.m).mul(this.r2));return N._forceRed(this)}})(e,this)}),6860:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}}),6864:(function(e){e.exports=t;function t(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),6867:(function(e,t,r){"use strict";e.exports=l;var o=r(1888),a=r(855),i=r(7150);function n(_,w){for(var S=0;S<_;++S)if(!(w[S]<=w[S+_]))return!0;return!1}function s(_,w,S,M){for(var y=0,b=0,v=0,u=_.length;v>>1;if(!(v<=0)){var u,g=o.mallocDouble(2*v*y),f=o.mallocInt32(y);if(y=s(_,v,g,f),y>0){if(v===1&&M)a.init(y),u=a.sweepComplete(v,S,0,y,g,f,0,y,g,f);else{var P=o.mallocDouble(2*v*b),L=o.mallocInt32(b);b=s(w,v,P,L),b>0&&(a.init(y+b),v===1?u=a.sweepBipartite(v,S,0,y,g,f,0,b,P,L):u=i(v,S,M,y,g,f,b,P,L),o.free(P),o.free(L))}o.free(g),o.free(f)}return u}}}var c;function m(_,w){c.push([_,w])}function p(_){return c=[],h(_,_,m,!0),c}function T(_,w){return c=[],h(_,w,m,!1),c}function l(_,w,S){switch(arguments.length){case 1:return p(_);case 2:return typeof w=="function"?h(_,_,w,!0):T(_,w);case 3:return h(_,w,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),6894:(function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],h=o[1]-n,c=o[2]-s,m=Math.sin(i),p=Math.cos(i);return r[0]=o[0],r[1]=n+h*p-c*m,r[2]=s+h*m+c*p,r}}),7004:(function(e){"use strict";e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,h=r[n];a=s+h;var c=a-s,m=h-c;m&&(r[--i]=a,a=m)}for(var p=0,n=i;n=p0)&&!(p1>=hi)"),w=m("lo===p0"),S=m("lo0;){$-=1;var oe=$*v,ne=f[oe],j=f[oe+1],ee=f[oe+2],re=f[oe+3],ue=f[oe+4],_e=f[oe+5],Te=$*u,Ie=P[Te],De=P[Te+1],He=_e&1,et=!!(_e&16),rt=Q,$e=le,ot=he,Ae=q;if(He&&(rt=he,$e=q,ot=Q,Ae=le),!(_e&2&&(ee=S(I,ne,j,ee,rt,$e,De),j>=ee))&&!(_e&4&&(j=M(I,ne,j,ee,rt,$e,Ie),j>=ee))){var ge=ee-j,ce=ue-re;if(et){if(I*ge*(ge+ce)"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(h){var c=n.get(h),m=c&&(c._triangleBuffer.handle||c._triangleBuffer.buffer);if(!m||!h.isBuffer(m)){var p=a(h,new Float32Array([-1,-1,-1,4,4,-1]));c=i(h,[{buffer:p,type:h.FLOAT,size:2}]),c._triangleBuffer=p,n.set(h,c)}c.bind(),h.drawArrays(h.TRIANGLES,0,3),c.unbind()}e.exports=s}),7182:(function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},a=o.create(),i=o.create();e.exports=function(s,h,c,m,p,T){return o.identity(s),o.fromRotationTranslation(s,T,h),s[3]=p[0],s[7]=p[1],s[11]=p[2],s[15]=p[3],o.identity(i),m[2]!==0&&(i[9]=m[2],o.multiply(s,s,i)),m[1]!==0&&(i[9]=0,i[8]=m[1],o.multiply(s,s,i)),m[0]!==0&&(i[8]=0,i[4]=m[0],o.multiply(s,s,i)),o.scale(s,s,c),s}}),7201:(function(e,t,r){"use strict";var o=1e-6,a=1e-6,i=r(9405),n=r(2762),s=r(8116),h=r(7766),c=r(8406),m=r(6760),p=r(7608),T=r(9618),l=r(6729),_=r(7765),w=r(1888),S=r(840),M=r(7626),y=S.meshShader,b=S.wireShader,v=S.pointShader,u=S.pickShader,g=S.pointPickShader,f=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(he,q,$,J,X,oe,ne,j,ee,re,ue,_e,Te,Ie,De,He,et,rt,$e,ot,Ae,ge,ce,ze,Qe,nt,Ke){this.gl=he,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=q,this.dirty=!0,this.triShader=$,this.lineShader=J,this.pointShader=X,this.pickShader=oe,this.pointPickShader=ne,this.contourShader=j,this.trianglePositions=ee,this.triangleColors=ue,this.triangleNormals=Te,this.triangleUVs=_e,this.triangleIds=re,this.triangleVAO=Ie,this.triangleCount=0,this.lineWidth=1,this.edgePositions=De,this.edgeColors=et,this.edgeUVs=rt,this.edgeIds=He,this.edgeVAO=$e,this.edgeCount=0,this.pointPositions=ot,this.pointColors=ge,this.pointUVs=ce,this.pointSizes=ze,this.pointIds=Ae,this.pointVAO=Qe,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=nt,this.contourVAO=Ke,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=P,this._view=P,this._projection=P,this._resolution=[1,1]}var z=L.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(he){this.pickId=he};function F(he,q){if(!q||!q.length)return 1;for(var $=0;$he&&$>0){var J=(q[$][0]-he)/(q[$][0]-q[$-1][0]);return q[$][1]*(1-J)+J*q[$-1][1]}}return 1}function B(he,q){for(var $=l({colormap:he,nshades:256,format:"rgba"}),J=new Uint8Array(256*4),X=0;X<256;++X){for(var oe=$[X],ne=0;ne<3;++ne)J[4*X+ne]=oe[ne];q?J[4*X+3]=255*F(X/255,q):J[4*X+3]=255*oe[3]}return T(J,[256,256,4],[4,0,1])}function O(he){for(var q=he.length,$=new Array(q),J=0;J0){var Te=this.triShader;Te.bind(),Te.uniforms=j,this.triangleVAO.bind(),q.drawArrays(q.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Te=this.lineShader;Te.bind(),Te.uniforms=j,this.edgeVAO.bind(),q.lineWidth(this.lineWidth*this.pixelRatio),q.drawArrays(q.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Te=this.pointShader;Te.bind(),Te.uniforms=j,this.pointVAO.bind(),q.drawArrays(q.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Te=this.contourShader;Te.bind(),Te.uniforms=j,this.contourVAO.bind(),q.drawArrays(q.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(he){he=he||{};for(var q=this.gl,$=he.model||P,J=he.view||P,X=he.projection||P,oe=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ne=0;ne<3;++ne)oe[0][ne]=Math.max(oe[0][ne],this.clipBounds[0][ne]),oe[1][ne]=Math.min(oe[1][ne],this.clipBounds[1][ne]);this._model=[].slice.call($),this._view=[].slice.call(J),this._projection=[].slice.call(X),this._resolution=[q.drawingBufferWidth,q.drawingBufferHeight];var j={model:$,view:J,projection:X,clipBounds:oe,pickId:this.pickId/255},ee=this.pickShader;if(ee.bind(),ee.uniforms=j,this.triangleCount>0&&(this.triangleVAO.bind(),q.drawArrays(q.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),q.lineWidth(this.lineWidth*this.pixelRatio),q.drawArrays(q.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ee=this.pointPickShader;ee.bind(),ee.uniforms=j,this.pointVAO.bind(),q.drawArrays(q.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(he){if(!he||he.id!==this.pickId)return null;for(var q=he.value[0]+256*he.value[1]+65536*he.value[2],$=this.cells[q],J=this.positions,X=new Array($.length),oe=0;oe<$.length;++oe)X[oe]=J[$[oe]];var ne=he.coord[0],j=he.coord[1];if(!this.pickVertex){var ee=this.positions[$[0]],re=this.positions[$[1]],ue=this.positions[$[2]],_e=[(ee[0]+re[0]+ue[0])/3,(ee[1]+re[1]+ue[1])/3,(ee[2]+re[2]+ue[2])/3];return{_cellCenter:!0,position:[ne,j],index:q,cell:$,cellId:q,intensity:this.intensity[q],dataCoordinate:_e}}var Te=M(X,[ne*this.pixelRatio,this._resolution[1]-j*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!Te)return null;for(var Ie=Te[2],De=0,oe=0;oe<$.length;++oe)De+=Ie[oe]*this.intensity[$[oe]];return{position:Te[1],index:$[Te[0]],cell:$,cellId:q,intensity:De,dataCoordinate:this.positions[$[Te[0]]]}},z.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()};function I(he){var q=i(he,y.vertex,y.fragment);return q.attributes.position.location=0,q.attributes.color.location=2,q.attributes.uv.location=3,q.attributes.normal.location=4,q}function N(he){var q=i(he,b.vertex,b.fragment);return q.attributes.position.location=0,q.attributes.color.location=2,q.attributes.uv.location=3,q}function U(he){var q=i(he,v.vertex,v.fragment);return q.attributes.position.location=0,q.attributes.color.location=2,q.attributes.uv.location=3,q.attributes.pointSize.location=4,q}function W(he){var q=i(he,u.vertex,u.fragment);return q.attributes.position.location=0,q.attributes.id.location=1,q}function Q(he){var q=i(he,g.vertex,g.fragment);return q.attributes.position.location=0,q.attributes.id.location=1,q.attributes.pointSize.location=4,q}function le(he){var q=i(he,f.vertex,f.fragment);return q.attributes.position.location=0,q}function se(he,q){arguments.length===1&&(q=he,he=q.gl);var $=he.getExtension("OES_standard_derivatives")||he.getExtension("MOZ_OES_standard_derivatives")||he.getExtension("WEBKIT_OES_standard_derivatives");if(!$)throw new Error("derivatives not supported");var J=I(he),X=N(he),oe=U(he),ne=W(he),j=Q(he),ee=le(he),re=h(he,T(new Uint8Array([255,255,255,255]),[1,1,4]));re.generateMipmap(),re.minFilter=he.LINEAR_MIPMAP_LINEAR,re.magFilter=he.LINEAR;var ue=n(he),_e=n(he),Te=n(he),Ie=n(he),De=n(he),He=s(he,[{buffer:ue,type:he.FLOAT,size:3},{buffer:De,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_e,type:he.FLOAT,size:4},{buffer:Te,type:he.FLOAT,size:2},{buffer:Ie,type:he.FLOAT,size:3}]),et=n(he),rt=n(he),$e=n(he),ot=n(he),Ae=s(he,[{buffer:et,type:he.FLOAT,size:3},{buffer:ot,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:rt,type:he.FLOAT,size:4},{buffer:$e,type:he.FLOAT,size:2}]),ge=n(he),ce=n(he),ze=n(he),Qe=n(he),nt=n(he),Ke=s(he,[{buffer:ge,type:he.FLOAT,size:3},{buffer:nt,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:ce,type:he.FLOAT,size:4},{buffer:ze,type:he.FLOAT,size:2},{buffer:Qe,type:he.FLOAT,size:1}]),kt=n(he),Et=s(he,[{buffer:kt,type:he.FLOAT,size:3}]),Bt=new L(he,re,J,X,oe,ne,j,ee,ue,De,_e,Te,Ie,He,et,ot,rt,$e,Ae,ge,nt,ce,ze,Qe,Ke,kt,Et);return Bt.update(q),Bt}e.exports=se}),7261:(function(e,t,r){"use strict";e.exports=w;var o=r(9215),a=r(7608),i=r(6079),n=r(5911),s=r(3536),h=r(244);function c(S,M,y){return Math.sqrt(Math.pow(S,2)+Math.pow(M,2)+Math.pow(y,2))}function m(S){return Math.min(1,Math.max(-1,S))}function p(S){var M=Math.abs(S[0]),y=Math.abs(S[1]),b=Math.abs(S[2]),v=[0,0,0];M>Math.max(y,b)?v[2]=1:y>Math.max(M,b)?v[0]=1:v[1]=1;for(var u=0,g=0,f=0;f<3;++f)u+=S[f]*S[f],g+=v[f]*S[f];for(var f=0;f<3;++f)v[f]-=g/u*S[f];return s(v,v),v}function T(S,M,y,b,v,u,g,f){this.center=o(y),this.up=o(b),this.right=o(v),this.radius=o([u]),this.angle=o([g,f]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,M),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var P=0;P<16;++P)this.computedMatrix[P]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(S,M){S>0?S=Math.log(S):S=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(S){var M=this.radius.bounds[0];return S?(S[0]=Math.exp(M[0][0]),S[1]=Math.exp(M[1][0]),S):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var M=this.computedUp,y=this.computedRight,b=0,v=0,u=0;u<3;++u)v+=M[u]*y[u],b+=M[u]*M[u];for(var g=Math.sqrt(b),f=0,u=0;u<3;++u)y[u]-=M[u]*v/b,f+=y[u]*y[u],M[u]/=g;for(var P=Math.sqrt(f),u=0;u<3;++u)y[u]/=P;var L=this.computedToward;n(L,M,y),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],B=this.computedAngle[1],O=Math.cos(F),I=Math.sin(F),N=Math.cos(B),U=Math.sin(B),W=this.computedCenter,Q=O*N,le=I*N,se=U,he=-O*U,q=-I*U,$=N,J=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var oe=Q*y[u]+le*L[u]+se*M[u];X[4*u+1]=he*y[u]+q*L[u]+$*M[u],X[4*u+2]=oe,X[4*u+3]=0}var ne=X[1],j=X[5],ee=X[9],re=X[2],ue=X[6],_e=X[10],Te=j*_e-ee*ue,Ie=ee*re-ne*_e,De=ne*ue-j*re,He=c(Te,Ie,De);Te/=He,Ie/=He,De/=He,X[0]=Te,X[4]=Ie,X[8]=De;for(var u=0;u<3;++u)J[u]=W[u]+X[2+4*u]*z;for(var u=0;u<3;++u){for(var f=0,et=0;et<3;++et)f+=X[u+4*et]*J[et];X[12+u]=-f}X[15]=1},l.getMatrix=function(S,M){this.recalcMatrix(S);var y=this.computedMatrix;if(M){for(var b=0;b<16;++b)M[b]=y[b];return M}return y};var _=[0,0,0];l.rotate=function(S,M,y,b){if(this.angle.move(S,M,y),b){this.recalcMatrix(S);var v=this.computedMatrix;_[0]=v[2],_[1]=v[6],_[2]=v[10];for(var u=this.computedUp,g=this.computedRight,f=this.computedToward,P=0;P<3;++P)v[4*P]=u[P],v[4*P+1]=g[P],v[4*P+2]=f[P];i(v,v,b,_);for(var P=0;P<3;++P)u[P]=v[4*P],g[P]=v[4*P+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,g[0],g[1],g[2])}},l.pan=function(S,M,y,b){M=M||0,y=y||0,b=b||0,this.recalcMatrix(S);var v=this.computedMatrix,u=Math.exp(this.computedRadius[0]),g=v[1],f=v[5],P=v[9],L=c(g,f,P);g/=L,f/=L,P/=L;var z=v[0],F=v[4],B=v[8],O=z*g+F*f+B*P;z-=g*O,F-=f*O,B-=P*O;var I=c(z,F,B);z/=I,F/=I,B/=I;var N=z*M+g*y,U=F*M+f*y,W=B*M+P*y;this.center.move(S,N,U,W);var Q=Math.exp(this.computedRadius[0]);Q=Math.max(1e-4,Q+b),this.radius.set(S,Math.log(Q))},l.translate=function(S,M,y,b){this.center.move(S,M||0,y||0,b||0)},l.setMatrix=function(S,M,y,b){var v=1;typeof y=="number"&&(v=y|0),(v<0||v>3)&&(v=1);var u=(v+2)%3,g=(v+1)%3;M||(this.recalcMatrix(S),M=this.computedMatrix);var f=M[v],P=M[v+4],L=M[v+8];if(b){var F=Math.abs(f),B=Math.abs(P),O=Math.abs(L),I=Math.max(F,B,O);F===I?(f=f<0?-1:1,P=L=0):O===I?(L=L<0?-1:1,f=P=0):(P=P<0?-1:1,f=L=0)}else{var z=c(f,P,L);f/=z,P/=z,L/=z}var N=M[u],U=M[u+4],W=M[u+8],Q=N*f+U*P+W*L;N-=f*Q,U-=P*Q,W-=L*Q;var le=c(N,U,W);N/=le,U/=le,W/=le;var se=P*W-L*U,he=L*N-f*W,q=f*U-P*N,$=c(se,he,q);se/=$,he/=$,q/=$,this.center.jump(S,ge,ce,ze),this.radius.idle(S),this.up.jump(S,f,P,L),this.right.jump(S,N,U,W);var J,X;if(v===2){var oe=M[1],ne=M[5],j=M[9],ee=oe*N+ne*U+j*W,re=oe*se+ne*he+j*q;Ie<0?J=-Math.PI/2:J=Math.PI/2,X=Math.atan2(re,ee)}else{var ue=M[2],_e=M[6],Te=M[10],Ie=ue*f+_e*P+Te*L,De=ue*N+_e*U+Te*W,He=ue*se+_e*he+Te*q;J=Math.asin(m(Ie)),X=Math.atan2(He,De)}this.angle.jump(S,X,J),this.recalcMatrix(S);var et=M[2],rt=M[6],$e=M[10],ot=this.computedMatrix;a(ot,M);var Ae=ot[15],ge=ot[12]/Ae,ce=ot[13]/Ae,ze=ot[14]/Ae,Qe=Math.exp(this.computedRadius[0]);this.center.jump(S,ge-et*Qe,ce-rt*Qe,ze-$e*Qe)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,M){M>0&&this.radius.set(S,Math.log(M))},l.lookAt=function(S,M,y,b){this.recalcMatrix(S),M=M||this.computedEye,y=y||this.computedCenter,b=b||this.computedUp;var v=b[0],u=b[1],g=b[2],f=c(v,u,g);if(!(f<1e-6)){v/=f,u/=f,g/=f;var P=M[0]-y[0],L=M[1]-y[1],z=M[2]-y[2],F=c(P,L,z);if(!(F<1e-6)){P/=F,L/=F,z/=F;var B=this.computedRight,O=B[0],I=B[1],N=B[2],U=v*O+u*I+g*N;O-=U*v,I-=U*u,N-=U*g;var W=c(O,I,N);if(!(W<.01&&(O=u*z-g*L,I=g*P-v*z,N=v*L-u*P,W=c(O,I,N),W<1e-6))){O/=W,I/=W,N/=W,this.up.set(S,v,u,g),this.right.set(S,O,I,N),this.center.set(S,y[0],y[1],y[2]),this.radius.set(S,Math.log(F));var Q=u*N-g*I,le=g*O-v*N,se=v*I-u*O,he=c(Q,le,se);Q/=he,le/=he,se/=he;var q=v*P+u*L+g*z,$=O*P+I*L+N*z,J=Q*P+le*L+se*z,X=Math.asin(m(q)),oe=Math.atan2(J,$),ne=this.angle._state,j=ne[ne.length-1],ee=ne[ne.length-2];j=j%(2*Math.PI);var re=Math.abs(j+2*Math.PI-oe),ue=Math.abs(j-oe),_e=Math.abs(j-2*Math.PI-oe);re0)for(var G=0;GM)return b-1}return b},f=function(A,M,g){return Ag?g:A},p=function(A,M,g){var b=M.vectors,v=M.meshgrid,u=A[0],y=A[1],m=A[2],R=v[0].length,L=v[1].length,z=v[2].length,F=h(v[0],u),N=h(v[1],y),O=h(v[2],m),P=F+1,U=N+1,B=O+1;if(F=f(F,0,R-1),P=f(P,0,R-1),N=f(N,0,L-1),U=f(U,0,L-1),O=f(O,0,z-1),B=f(B,0,z-1),F<0||N<0||O<0||P>R-1||U>L-1||B>z-1)return o.create();var X=v[0][F],$=v[0][P],le=v[1][N],ce=v[1][U],ve=v[2][O],G=v[2][B],Y=(u-X)/($-X),ee=(y-le)/(ce-le),V=(m-ve)/(G-ve);isFinite(Y)||(Y=.5),isFinite(ee)||(ee=.5),isFinite(V)||(V=.5);var se,ae,j,Q,re,he;switch(g.reversedX&&(F=R-1-F,P=R-1-P),g.reversedY&&(N=L-1-N,U=L-1-U),g.reversedZ&&(O=z-1-O,B=z-1-B),g.filled){case 5:re=O,he=B,j=N*z,Q=U*z,se=F*z*L,ae=P*z*L;break;case 4:re=O,he=B,se=F*z,ae=P*z,j=N*z*R,Q=U*z*R;break;case 3:j=N,Q=U,re=O*L,he=B*L,se=F*L*z,ae=P*L*z;break;case 2:j=N,Q=U,se=F*L,ae=P*L,re=O*L*R,he=B*L*R;break;case 1:se=F,ae=P,re=O*R,he=B*R,j=N*R*z,Q=U*R*z;break;default:se=F,ae=P,j=N*R,Q=U*R,re=O*R*L,he=B*R*L;break}var xe=b[se+j+re],Te=b[se+j+he],Le=b[se+Q+re],Pe=b[se+Q+he],qe=b[ae+j+re],et=b[ae+j+he],rt=b[ae+Q+re],$e=b[ae+Q+he],Ue=o.create(),fe=o.create(),ue=o.create(),ie=o.create();o.lerp(Ue,xe,qe,Y),o.lerp(fe,Te,et,Y),o.lerp(ue,Le,rt,Y),o.lerp(ie,Pe,$e,Y);var Ee=o.create(),We=o.create();o.lerp(Ee,Ue,ue,ee),o.lerp(We,fe,ie,ee);var Qe=o.create();return o.lerp(Qe,Ee,We,V),Qe},c=function(A,M){var g=M[0],b=M[1],v=M[2];return A[0]=g<0?-g:g,A[1]=b<0?-b:b,A[2]=v<0?-v:v,A},T=function(A){var M=1/0;A.sort(function(u,y){return u-y});for(var g=A.length,b=1;bP||$eU||UeB)},$=o.distance(M[0],M[1]),le=10*$/b,ce=le*le,ve=1,G=0,Y=g.length;Y>1&&(ve=l(g));for(var ee=0;eeG&&(G=xe),re.push(xe),z.push({points:se,velocities:ae,divergences:re});for(var Te=0;Tece&&o.scale(Le,Le,le/Math.sqrt(Pe)),o.add(Le,Le,V),j=R(Le),o.squaredDistance(Q,Le)-ce>-1e-4*ce){se.push(Le),Q=Le,ae.push(j);var he=L(Le,j),xe=o.length(he);isFinite(xe)&&xe>G&&(G=xe),re.push(xe)}V=Le}}var qe=s(z,A.colormap,G,ve);return u?qe.tubeScale=u:(G===0&&(G=1),qe.tubeScale=v*.5*ve/G),qe};var _=r(6740),w=r(6405).createMesh;e.exports.createTubeMesh=function(A,M){return w(A,M,{shaders:_,traceType:"streamtube"})}}),990:(function(e,t,r){var o=r(9405),a=r(3236),i=a([`precision highp float; #define GLSLIFY 1 -attribute vec3 position, nextPosition; -attribute float arcLength, lineWidth; -attribute vec4 color; - -uniform vec2 screenShape; -uniform float pixelRatio; -uniform mat4 model, view, projection; +attribute vec4 uv; +attribute vec3 f; +attribute vec3 normal; -varying vec4 fragColor; -varying vec3 worldPosition; -varying float pixelArcLength; +uniform vec3 objectOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 lightPosition, eyePosition; +uniform sampler2D colormap; -vec4 project(vec3 p) { - return projection * (view * (model * vec4(p, 1.0))); -} +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; void main() { - vec4 startPoint = project(position); - vec4 endPoint = project(nextPosition); - - vec2 A = startPoint.xy / startPoint.w; - vec2 B = endPoint.xy / endPoint.w; + vec3 localCoordinate = vec3(uv.zw, f.x); + worldCoordinate = objectOffset + localCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0); + vec4 clipPosition = projection * (view * worldPosition); + gl_Position = clipPosition; + kill = f.y; + value = f.z; + planeCoordinate = uv.xy; - float clipAngle = atan( - (B.y - A.y) * screenShape.y, - (B.x - A.x) * screenShape.x - ); + vColor = texture2D(colormap, vec2(value, value)); - vec2 offset = 0.5 * pixelRatio * lineWidth * vec2( - sin(clipAngle), - -cos(clipAngle) - ) / screenShape; + //Lighting geometry parameters + vec4 cameraCoordinate = view * worldPosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + lightDirection = lightPosition - cameraCoordinate.xyz; + eyeDirection = eyePosition - cameraCoordinate.xyz; + surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); +} +`]),n=a([`precision highp float; +#define GLSLIFY 1 - gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw); +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} - worldPosition = position; - pixelArcLength = arcLength; - fragColor = color; +float beckmannSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness) { + return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); } -`]),n=o([`precision highp float; -#define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || @@ -1890,71 +1859,87 @@ bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } -uniform vec3 clipBounds[2]; -uniform sampler2D dashTexture; -uniform float dashScale; -uniform float opacity; +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; void main() { if ( - outOfRange(clipBounds[0], clipBounds[1], worldPosition) || - fragColor.a * opacity == 0. + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) ) discard; - float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; - if(dashWeight < 0.5) { - discard; + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; } - gl_FragColor = fragColor * opacity; + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color \u2014 in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; } -`]),s=o([`precision highp float; +`]),s=a([`precision highp float; #define GLSLIFY 1 -#define FLOAT_MAX 1.70141184e38 -#define FLOAT_MIN 1.17549435e-38 - -// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl -vec4 packFloat(float v) { - float av = abs(v); +attribute vec4 uv; +attribute float f; - //Handle special cases - if(av < FLOAT_MIN) { - return vec4(0.0, 0.0, 0.0, 0.0); - } else if(v > FLOAT_MAX) { - return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; - } else if(v < -FLOAT_MAX) { - return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; - } +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; - vec4 c = vec4(0,0,0,0); +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; - //Compute exponent and mantissa - float e = floor(log2(av)); - float m = av * pow(2.0, -e) - 1.0; +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); - //Unpack mantissa - c[1] = floor(128.0 * m); - m -= c[1] / 128.0; - c[2] = floor(32768.0 * m); - m -= c[2] / 32768.0; - c[3] = floor(8388608.0 * m); + vec4 clipPosition = projection * (view * worldPosition); + clipPosition.z += zOffset; - //Unpack exponent - float ebias = e + 127.0; - c[0] = floor(ebias / 2.0); - ebias -= c[0] * 2.0; - c[1] += floor(ebias) * 128.0; + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; - //Unpack sign bit - c[0] += 128.0 * step(0.0, -v); + vColor = texture2D(colormap, vec2(value, value)); - //Scale back to range - return c / 255.0; + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); } +`]),h=a([`precision highp float; +#define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || @@ -1976,24 +1961,39 @@ bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } -uniform float pickId; +uniform vec2 shape; uniform vec3 clipBounds[2]; +uniform float pickId; -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} void main() { - if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; - gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); -}`]),h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(c){return a(c,i,n,null,h)},t.createPickShader=function(c){return a(c,i,s,null,h)}}),7352:(function(e,t,r){"use strict";var o=r(5721),a=r(4750),i=r(2690);e.exports=n;function n(s){var h=s.length;if(h===0)return[];if(h===1)return[[0]];var c=s[0].length;return c===0?[]:c===1?o(s):c===2?a(s):i(s,c)}}),7399:(function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],h=a+a,c=i+i,m=n+n,p=a*h,T=i*h,l=i*c,_=n*h,w=n*c,S=n*m,M=s*h,y=s*c,b=s*m;return r[0]=1-l-S,r[1]=T+b,r[2]=_-y,r[3]=0,r[4]=T-b,r[5]=1-p-S,r[6]=w+M,r[7]=0,r[8]=_+y,r[9]=w-M,r[10]=1-p-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7417:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r}}),7442:(function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),h=T(),c=T(),m=T();e.exports=p;function p(w,S,M,y){if(n(S)===0||n(M)===0)return!1;var b=i(S,h.translate,h.scale,h.skew,h.perspective,h.quaternion),v=i(M,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!b||!v?!1:(o(m.translate,h.translate,c.translate,y),o(m.skew,h.skew,c.skew,y),o(m.scale,h.scale,c.scale,y),o(m.perspective,h.perspective,c.perspective,y),s(m.quaternion,h.quaternion,c.quaternion,y),a(w,m.translate,m.scale,m.skew,m.perspective,m.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:_(),quaternion:_()}}function l(w){return[w||0,w||0,w||0]}function _(){return[0,0,0,1]}}),7507:(function(e,t){"use strict";t.byteLength=c,t.toByteArray=p,t.fromByteArray=_;for(var r=[],o=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=i.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var M=w.indexOf("=");M===-1&&(M=S);var y=M===S?0:4-M%4;return[M,y]}function c(w){var S=h(w),M=S[0],y=S[1];return(M+y)*3/4-y}function m(w,S,M){return(S+M)*3/4-M}function p(w){var S,M=h(w),y=M[0],b=M[1],v=new a(m(w,y,b)),u=0,g=b>0?y-4:y,f;for(f=0;f>16&255,v[u++]=S>>8&255,v[u++]=S&255;return b===2&&(S=o[w.charCodeAt(f)]<<2|o[w.charCodeAt(f+1)]>>4,v[u++]=S&255),b===1&&(S=o[w.charCodeAt(f)]<<10|o[w.charCodeAt(f+1)]<<4|o[w.charCodeAt(f+2)]>>2,v[u++]=S>>8&255,v[u++]=S&255),v}function T(w){return r[w>>18&63]+r[w>>12&63]+r[w>>6&63]+r[w&63]}function l(w,S,M){for(var y,b=[],v=S;vg?g:u+v));return y===1?(S=w[M-1],b.push(r[S>>2]+r[S<<4&63]+"==")):y===2&&(S=(w[M-2]<<8)+w[M-1],b.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),b.join("")}}),7518:(function(e,t,r){"use strict";var o=r(1433);function a(s,h,c,m,p,T){this.location=s,this.dimension=h,this.a=c,this.b=m,this.c=p,this.d=T}a.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function i(s,h,c){this.gl=s,this._ext=h,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s1.0001)return null;f+=g[M]}return Math.abs(f-1)>.001?null:[y,h(m,g),g]}}),7636:(function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}}),7640:(function(e,t,r){"use strict";var o=r(1888);function a(p){return p==="uint32"?[o.mallocUint32,o.freeUint32]:null}var i={"uint32,1,0":function(p,T){return function(_,w,S,M,y,b,v,u,g,f,P){var L,z,F,B=_*y+M,O,I=p(u),N,U,W,Q;for(L=_+1;L<=w;++L){for(z=L,B+=y,F=B,N=0,U=B,O=0;O_;){N=0,U=F-y;t:for(O=0;OQ)break t;U+=f,N+=P}for(N=F,U=F-y,O=0;O>1,I=O-z,N=O+z,U=F,W=I,Q=O,le=N,se=B,he=w+1,q=S-1,$=!0,J,X,oe,ne,j,ee,re,ue,_e,Te=0,Ie=0,De=0,He,et,rt,$e,ot,Ae,ge,ce,ze,Qe,nt,Ke,kt,Et,Bt,jt,_r=g,pr=T(_r),Or=T(_r);et=b*U,rt=b*W,jt=y;e:for(He=0;He0){X=U,U=W,W=X;break e}if(De<0)break e;jt+=P}et=b*le,rt=b*se,jt=y;e:for(He=0;He0){X=le,le=se,se=X;break e}if(De<0)break e;jt+=P}et=b*U,rt=b*Q,jt=y;e:for(He=0;He0){X=U,U=Q,Q=X;break e}if(De<0)break e;jt+=P}et=b*W,rt=b*Q,jt=y;e:for(He=0;He0){X=W,W=Q,Q=X;break e}if(De<0)break e;jt+=P}et=b*U,rt=b*le,jt=y;e:for(He=0;He0){X=U,U=le,le=X;break e}if(De<0)break e;jt+=P}et=b*Q,rt=b*le,jt=y;e:for(He=0;He0){X=Q,Q=le,le=X;break e}if(De<0)break e;jt+=P}et=b*W,rt=b*se,jt=y;e:for(He=0;He0){X=W,W=se,se=X;break e}if(De<0)break e;jt+=P}et=b*W,rt=b*Q,jt=y;e:for(He=0;He0){X=W,W=Q,Q=X;break e}if(De<0)break e;jt+=P}et=b*le,rt=b*se,jt=y;e:for(He=0;He0){X=le,le=se,se=X;break e}if(De<0)break e;jt+=P}for(et=b*U,rt=b*W,$e=b*Q,ot=b*le,Ae=b*se,ge=b*F,ce=b*O,ze=b*B,Bt=0,jt=y,He=0;He0)q--;else if(De<0){for(et=b*ee,rt=b*he,$e=b*q,jt=y,He=0;He0)for(;;){re=y+q*b,Bt=0;e:for(He=0;He0){if(--qB){e:for(;;){for(re=y+he*b,Bt=0,jt=y,He=0;He1&&_?S(l,_[0],_[1]):S(l)}var c={"uint32,1,0":function(p,T){return function(l){var _=l.data,w=l.offset|0,S=l.shape,M=l.stride,y=M[0]|0,b=S[0]|0,v=M[1]|0,u=S[1]|0,g=v,f=v,P=1;b<=32?p(0,b-1,_,w,y,v,b,u,g,f,P):T(0,b-1,_,w,y,v,b,u,g,f,P)}}};function m(p,T){var l=[T,p].join(","),_=c[l],w=n(p,T),S=h(p,T,w);return _(w,S)}e.exports=m}),7642:(function(e,t,r){"use strict";var o=r(8954),a=r(1682);e.exports=h;function i(c,m){this.point=c,this.index=m}function n(c,m){for(var p=c.point,T=m.point,l=p.length,_=0;_=2)return!1;F[O]=I}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=g[F[B]];if(O<0)return!1;F[B]=O}return!0}),T&1)for(var w=0;w",N="",U=I.length,W=N.length,Q=F[0]===_||F[0]===M,le=0,se=-W;le>-1&&(le=B.indexOf(I,le),!(le===-1||(se=B.indexOf(N,le+U),se===-1)||se<=le));){for(var he=le;he=se)O[he]=null,B=B.substr(0,he)+" "+B.substr(he+1);else if(O[he]!==null){var q=O[he].indexOf(F[0]);q===-1?O[he]+=F:Q&&(O[he]=O[he].substr(0,q+1)+(1+parseInt(O[he][q+1]))+O[he].substr(q+2))}var $=le+U,J=B.substr($,se-$),X=J.indexOf(I);X!==-1?le=X:le=se+W}return O}function v(z,F,B){for(var O=F.textAlign||"start",I=F.textBaseline||"alphabetic",N=[1<<30,1<<30],U=[0,0],W=z.length,Q=0;Q/g,` -`):B=B.replace(/\/g," ");var U="",W=[];for(j=0;j-1?parseInt(ce[1+nt]):0,Et=Ke>-1?parseInt(ze[1+Ke]):0;kt!==Et&&(Qe=Qe.replace(De(),"?px "),ue*=Math.pow(.75,Et-kt),Qe=Qe.replace("?px ",De())),re+=.25*q*(Et-kt)}if(N.superscripts===!0){var Bt=ce.indexOf(_),jt=ze.indexOf(_),_r=Bt>-1?parseInt(ce[1+Bt]):0,pr=jt>-1?parseInt(ze[1+jt]):0;_r!==pr&&(Qe=Qe.replace(De(),"?px "),ue*=Math.pow(.75,pr-_r),Qe=Qe.replace("?px ",De())),re-=.25*q*(pr-_r)}if(N.bolds===!0){var Or=ce.indexOf(m)>-1,mr=ze.indexOf(m)>-1;!Or&&mr&&(Er?Qe=Qe.replace("italic ","italic bold "):Qe="bold "+Qe),Or&&!mr&&(Qe=Qe.replace("bold ",""))}if(N.italics===!0){var Er=ce.indexOf(T)>-1,yt=ze.indexOf(T)>-1;!Er&&yt&&(Qe="italic "+Qe),Er&&!yt&&(Qe=Qe.replace("italic ",""))}F.font=Qe}for(ne=0;ne0&&(I=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,I+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var W=u(F,B,z,I,N,U);return P(W,O,I)}}),7721:(function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}}),7765:(function(e,t,r){"use strict";e.exports=l;var o=r(9618),a=r(1888),i=r(446),n=r(1570);function s(_){for(var w=_.length,S=0,M=0;M"u"&&(M=s(_));var y=_.length;if(y===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var b=h(w,+S),v=c(_,M),u=m(v,w,b,+S),g=p(v,w.length|0),f=n(M)(_,v.data,g,b),P=T(v),L=[].slice.call(u.data,0,u.shape[0]);return a.free(b),a.free(v.data),a.free(u.data),a.free(g),{cells:f,vertexIds:P,vertexWeights:L}}}),7766:(function(e,t,r){"use strict";var o=r(9618),a=r(5298),i=r(1888);e.exports=u;var n=null,s=null,h=null;function c(g){n=[g.LINEAR,g.NEAREST_MIPMAP_LINEAR,g.LINEAR_MIPMAP_NEAREST,g.LINEAR_MIPMAP_NEAREST],s=[g.NEAREST,g.LINEAR,g.NEAREST_MIPMAP_NEAREST,g.NEAREST_MIPMAP_LINEAR,g.LINEAR_MIPMAP_NEAREST,g.LINEAR_MIPMAP_LINEAR],h=[g.REPEAT,g.CLAMP_TO_EDGE,g.MIRRORED_REPEAT]}function m(g){return typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement||typeof ImageData<"u"&&g instanceof ImageData}var p=function(g,f){a.muls(g,f,255)};function T(g,f,P){var L=g.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(f<0||f>z||P<0||P>z)throw new Error("gl-texture2d: Invalid texture size");return g._shape=[f,P],g.bind(),L.texImage2D(L.TEXTURE_2D,0,g.format,f,P,0,g.format,g.type,null),g._mipLevels=[0],g}function l(g,f,P,L,z,F){this.gl=g,this.handle=f,this.format=z,this.type=F,this._shape=[P,L],this._mipLevels=[0],this._magFilter=g.NEAREST,this._minFilter=g.NEAREST,this._wrapS=g.CLAMP_TO_EDGE,this._wrapT=g.CLAMP_TO_EDGE,this._anisoSamples=1;var B=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return B._wrapS},set:function(N){return B.wrapS=N}},{get:function(){return B._wrapT},set:function(N){return B.wrapT=N}}]),this._wrapVector=O;var I=[this._shape[0],this._shape[1]];Object.defineProperties(I,[{get:function(){return B._shape[0]},set:function(N){return B.width=N}},{get:function(){return B._shape[1]},set:function(N){return B.height=N}}]),this._shapeVector=I}var _=l.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(g){this.bind();var f=this.gl;if(this.type===f.FLOAT&&n.indexOf(g)>=0&&(f.getExtension("OES_texture_float_linear")||(g=f.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,g),this._minFilter=g}},magFilter:{get:function(){return this._magFilter},set:function(g){this.bind();var f=this.gl;if(this.type===f.FLOAT&&n.indexOf(g)>=0&&(f.getExtension("OES_texture_float_linear")||(g=f.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,g),this._magFilter=g}},mipSamples:{get:function(){return this._anisoSamples},set:function(g){var f=this._anisoSamples;if(this._anisoSamples=Math.max(g,1)|0,f!==this._anisoSamples){var P=this.gl.getExtension("EXT_texture_filter_anisotropic");P&&this.gl.texParameterf(this.gl.TEXTURE_2D,P.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(g){if(this.bind(),h.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,g),this._wrapS=g}},wrapT:{get:function(){return this._wrapT},set:function(g){if(this.bind(),h.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,g),this._wrapT=g}},wrap:{get:function(){return this._wrapVector},set:function(g){if(Array.isArray(g)||(g=[g,g]),g.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var f=0;f<2;++f)if(h.indexOf(g[f])<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);this._wrapS=g[0],this._wrapT=g[1];var P=this.gl;return this.bind(),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_S,this._wrapS),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_T,this._wrapT),g}},shape:{get:function(){return this._shapeVector},set:function(g){if(!Array.isArray(g))g=[g|0,g|0];else if(g.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,g[0]|0,g[1]|0),[g[0]|0,g[1]|0]}},width:{get:function(){return this._shape[0]},set:function(g){return g=g|0,T(this,g,this._shape[1]),g}},height:{get:function(){return this._shape[1]},set:function(g){return g=g|0,T(this,this._shape[0],g),g}}}),_.bind=function(g){var f=this.gl;return g!==void 0&&f.activeTexture(f.TEXTURE0+(g|0)),f.bindTexture(f.TEXTURE_2D,this.handle),g!==void 0?g|0:f.getParameter(f.ACTIVE_TEXTURE)-f.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var g=Math.min(this._shape[0],this._shape[1]),f=0;g>0;++f,g>>>=1)this._mipLevels.indexOf(f)<0&&this._mipLevels.push(f)},_.setPixels=function(g,f,P,L){var z=this.gl;this.bind(),Array.isArray(f)?(L=P,P=f[1]|0,f=f[0]|0):(f=f||0,P=P||0),L=L||0;var F=m(g)?g:g.raw;if(F){var B=this._mipLevels.indexOf(L)<0;B?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,f,P,this.format,this.type,F)}else if(g.shape&&g.stride&&g.data){if(g.shape.length<2||f+g.shape[1]>this._shape[1]>>>L||P+g.shape[0]>this._shape[0]>>>L||f<0||P<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,f,P,L,this.format,this.type,this._mipLevels,g)}else throw new Error("gl-texture2d: Unsupported data type")};function w(g,f){return g.length===3?f[2]===1&&f[1]===g[0]*g[2]&&f[0]===g[2]:f[0]===1&&f[1]===g[0]}function S(g,f,P,L,z,F,B,O){var I=O.dtype,N=O.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var U=0,W=0,Q=w(N,O.stride.slice());I==="float32"?U=g.FLOAT:I==="float64"?(U=g.FLOAT,Q=!1,I="float32"):I==="uint8"?U=g.UNSIGNED_BYTE:(U=g.UNSIGNED_BYTE,Q=!1,I="uint8");var le=1;if(N.length===2)W=g.LUMINANCE,N=[N[0],N[1],1],O=o(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)W=g.ALPHA;else if(N[2]===2)W=g.LUMINANCE_ALPHA;else if(N[2]===3)W=g.RGB;else if(N[2]===4)W=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");le=N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((W===g.LUMINANCE||W===g.ALPHA)&&(z===g.LUMINANCE||z===g.ALPHA)&&(W=z),W!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var se=O.size,he=B.indexOf(L)<0;if(he&&B.push(L),U===F&&Q)O.offset===0&&O.data.length===se?he?g.texImage2D(g.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data):g.texSubImage2D(g.TEXTURE_2D,L,f,P,N[0],N[1],z,F,O.data):he?g.texImage2D(g.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+se)):g.texSubImage2D(g.TEXTURE_2D,L,f,P,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+se));else{var q;F===g.FLOAT?q=i.mallocFloat32(se):q=i.mallocUint8(se);var $=o(q,N,[N[2],N[2]*N[0],1]);U===g.FLOAT&&F===g.UNSIGNED_BYTE?p($,O):a.assign($,O),he?g.texImage2D(g.TEXTURE_2D,L,z,N[0],N[1],0,z,F,q.subarray(0,se)):g.texSubImage2D(g.TEXTURE_2D,L,f,P,N[0],N[1],z,F,q.subarray(0,se)),F===g.FLOAT?i.freeFloat32(q):i.freeUint8(q)}}function M(g){var f=g.createTexture();return g.bindTexture(g.TEXTURE_2D,f),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),f}function y(g,f,P,L,z){var F=g.getParameter(g.MAX_TEXTURE_SIZE);if(f<0||f>F||P<0||P>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===g.FLOAT&&!g.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,L,f,P,0,L,z,null),new l(g,B,f,P,L,z)}function b(g,f,P,L,z,F){var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,z,z,F,f),new l(g,B,P,L,z,F)}function v(g,f){var P=f.dtype,L=f.shape.slice(),z=g.getParameter(g.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>z||L[1]<0||L[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=w(L,f.stride.slice()),B=0;P==="float32"?B=g.FLOAT:P==="float64"?(B=g.FLOAT,F=!1,P="float32"):P==="uint8"?B=g.UNSIGNED_BYTE:(B=g.UNSIGNED_BYTE,F=!1,P="uint8");var O=0;if(L.length===2)O=g.LUMINANCE,L=[L[0],L[1],1],f=o(f.data,L,[f.stride[0],f.stride[1],1],f.offset);else if(L.length===3)if(L[2]===1)O=g.ALPHA;else if(L[2]===2)O=g.LUMINANCE_ALPHA;else if(L[2]===3)O=g.RGB;else if(L[2]===4)O=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===g.FLOAT&&!g.getExtension("OES_texture_float")&&(B=g.UNSIGNED_BYTE,F=!1);var I,N,U=f.size;if(F)f.offset===0&&f.data.length===U?I=f.data:I=f.data.subarray(f.offset,f.offset+U);else{var W=[L[2],L[2]*L[0],1];N=i.malloc(U,P);var Q=o(N,L,W,0);(P==="float32"||P==="float64")&&B===g.UNSIGNED_BYTE?p(Q,f):a.assign(Q,f),I=N.subarray(0,U)}var le=M(g);return g.texImage2D(g.TEXTURE_2D,0,O,L[0],L[1],0,O,B,I),F||i.free(N),new l(g,le,L[0],L[1],O,B)}function u(g){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||c(g),typeof arguments[1]=="number")return y(g,arguments[1],arguments[2],arguments[3]||g.RGBA,arguments[4]||g.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return y(g,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var f=arguments[1],P=m(f)?f:f.raw;if(P)return b(g,P,f.width|0,f.height|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(f.shape&&f.data&&f.stride)return v(g,f)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),7790:(function(){}),7815:(function(e,t,r){"use strict";var o=r(2931),a=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],n=function(S,M,y,b){for(var v=S.points,u=S.velocities,g=S.divergences,f=[],P=[],L=[],z=[],F=[],B=[],O=0,I=0,N=a.create(),U=a.create(),W=8,Q=0;Q0)for(var q=0;qM)return b-1}return b},c=function(S,M,y){return Sy?y:S},m=function(S,M,y){var b=M.vectors,v=M.meshgrid,u=S[0],g=S[1],f=S[2],P=v[0].length,L=v[1].length,z=v[2].length,F=h(v[0],u),B=h(v[1],g),O=h(v[2],f),I=F+1,N=B+1,U=O+1;if(F=c(F,0,P-1),I=c(I,0,P-1),B=c(B,0,L-1),N=c(N,0,L-1),O=c(O,0,z-1),U=c(U,0,z-1),F<0||B<0||O<0||I>P-1||N>L-1||U>z-1)return o.create();var W=v[0][F],Q=v[0][I],le=v[1][B],se=v[1][N],he=v[2][O],q=v[2][U],$=(u-W)/(Q-W),J=(g-le)/(se-le),X=(f-he)/(q-he);isFinite($)||($=.5),isFinite(J)||(J=.5),isFinite(X)||(X=.5);var oe,ne,j,ee,re,ue;switch(y.reversedX&&(F=P-1-F,I=P-1-I),y.reversedY&&(B=L-1-B,N=L-1-N),y.reversedZ&&(O=z-1-O,U=z-1-U),y.filled){case 5:re=O,ue=U,j=B*z,ee=N*z,oe=F*z*L,ne=I*z*L;break;case 4:re=O,ue=U,oe=F*z,ne=I*z,j=B*z*P,ee=N*z*P;break;case 3:j=B,ee=N,re=O*L,ue=U*L,oe=F*L*z,ne=I*L*z;break;case 2:j=B,ee=N,oe=F*L,ne=I*L,re=O*L*P,ue=U*L*P;break;case 1:oe=F,ne=I,re=O*P,ue=U*P,j=B*P*z,ee=N*P*z;break;default:oe=F,ne=I,j=B*P,ee=N*P,re=O*P*L,ue=U*P*L;break}var _e=b[oe+j+re],Te=b[oe+j+ue],Ie=b[oe+ee+re],De=b[oe+ee+ue],He=b[ne+j+re],et=b[ne+j+ue],rt=b[ne+ee+re],$e=b[ne+ee+ue],ot=o.create(),Ae=o.create(),ge=o.create(),ce=o.create();o.lerp(ot,_e,He,$),o.lerp(Ae,Te,et,$),o.lerp(ge,Ie,rt,$),o.lerp(ce,De,$e,$);var ze=o.create(),Qe=o.create();o.lerp(ze,ot,ge,J),o.lerp(Qe,Ae,ce,J);var nt=o.create();return o.lerp(nt,ze,Qe,X),nt},p=function(S,M){var y=M[0],b=M[1],v=M[2];return S[0]=y<0?-y:y,S[1]=b<0?-b:b,S[2]=v<0?-v:v,S},T=function(S){var M=1/0;S.sort(function(u,g){return u-g});for(var y=S.length,b=1;bI||$eN||otU)},Q=o.distance(M[0],M[1]),le=10*Q/b,se=le*le,he=1,q=0,$=y.length;$>1&&(he=l(y));for(var J=0;J<$;J++){var X=o.create();o.copy(X,y[J]);var oe=[X],ne=[],j=P(X),ee=X;ne.push(j);var re=[],ue=L(X,j),_e=o.length(ue);isFinite(_e)&&_e>q&&(q=_e),re.push(_e),z.push({points:oe,velocities:ne,divergences:re});for(var Te=0;Tese&&o.scale(Ie,Ie,le/Math.sqrt(De)),o.add(Ie,Ie,X),j=P(Ie),o.squaredDistance(ee,Ie)-se>-1e-4*se){oe.push(Ie),ee=Ie,ne.push(j);var ue=L(Ie,j),_e=o.length(ue);isFinite(_e)&&_e>q&&(q=_e),re.push(_e)}X=Ie}}var He=s(z,S.colormap,q,he);return u?He.tubeScale=u:(q===0&&(q=1),He.tubeScale=v*.5*he/q),He};var _=r(6740),w=r(6405).createMesh;e.exports.createTubeMesh=function(S,M){return w(S,M,{shaders:_,traceType:"streamtube"})}}),7827:(function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),7842:(function(e,t,r){"use strict";var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),h=r(8697);e.exports=c;function c(m,p){if(o(m))return p?h(m,c(p)):[m[0].clone(),m[1].clone()];var T=0,l,_;if(a(m))l=m.clone();else if(typeof m=="string")l=n(m);else{if(m===0)return[i(0),i(1)];if(m===Math.floor(m))l=i(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),T-=256;l=i(m)}}if(o(p))l.mul(p[1]),_=p[0].clone();else if(a(p))_=p.clone();else if(typeof p=="string")_=n(p);else if(!p)_=i(1);else if(p===Math.floor(p))_=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T+=256;_=i(p)}return T>0?l=l.ushln(T):T<0&&(_=_.ushln(-T)),s(l,_)}}),7894:(function(e){e.exports=t;function t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7932:(function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])}),7960:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}}),8105:(function(e){"use strict";e.exports=r;var t={"lo===p0":o,"lo=p0)&&!(p1>=hi)":c};function r(m){return t[m]}function o(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+u];if(P===S)if(v===f)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[v],w[v++]=F}}return v}function a(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+u];if(PL;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[v],w[v++]=F}}return v}function i(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+g];if(P<=S)if(v===f)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[v],w[v++]=F}}return v}function n(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+g];if(P<=S)if(v===f)v+=1,b+=M;else{for(var L=0;M>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[v],w[v++]=F}}return v}function s(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+u],L=_[y+g];if(P<=S&&S<=L)if(v===f)v+=1,b+=M;else{for(var z=0;M>z;++z){var F=_[y+z];_[y+z]=_[b],_[b++]=F}var B=w[f];w[f]=w[v],w[v++]=B}}return v}function h(m,p,T,l,_,w,S){for(var M=2*m,y=M*T,b=y,v=T,u=p,g=m+p,f=T;l>f;++f,y+=M){var P=_[y+u],L=_[y+g];if(Pz;++z){var F=_[y+z];_[y+z]=_[b],_[b++]=F}var B=w[f];w[f]=w[v],w[v++]=B}}return v}function c(m,p,T,l,_,w,S,M){for(var y=2*m,b=y*T,v=b,u=T,g=p,f=m+p,P=T;l>P;++P,b+=y){var L=_[b+g],z=_[b+f];if(!(L>=S)&&!(M>=z))if(u===P)u+=1,v+=y;else{for(var F=0;y>F;++F){var B=_[b+F];_[b+F]=_[v],_[v++]=B}var O=w[P];w[P]=w[u],w[u++]=O}}return u}}),8107:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r}}),8116:(function(e,t,r){"use strict";var o=r(7518),a=r(870);function i(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function n(s,h,c,m){var p=s.createVertexArray?new i(s):s.getExtension("OES_vertex_array_object"),T;return p?T=o(s,p):T=a(s),T.update(h,c,m),T}e.exports=n}),8192:(function(e,t,r){e.exports=n;var o=r(2825),a=r(3536),i=r(244);function n(s,h){var c=o(s[0],s[1],s[2]),m=o(h[0],h[1],h[2]);a(c,c),a(m,m);var p=i(c,m);return p>1?0:Math.acos(p)}}),8210:(function(e){"use strict";e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,h=a-n,c=o-s,m=c+h;return m?[m,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],a[0]);var s=i+n,h=new Array(s),c=0,m=0,p=0,T=Math.abs,l=o[m],_=T(l),w=a[p],S=T(w),M,y;_=n?(M=l,m+=1,mc)for(var P=h[l],L=1/Math.sqrt(v*g),f=0;f<3;++f){var z=(f+1)%3,F=(f+2)%3;P[f]+=L*(u[z]*b[F]-u[F]*b[z])}}for(var m=0;mc)for(var L=1/Math.sqrt(B),f=0;f<3;++f)P[f]*=L;else for(var f=0;f<3;++f)P[f]=0}return h},t.faceNormals=function(a,i,n){for(var s=a.length,h=new Array(s),c=n===void 0?o:n,m=0;mc?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)S[l]*=M;h[m]=S}return h}}),8418:(function(e,t,r){"use strict";var o=r(5219),a=r(2762),i=r(8116),n=r(1888),s=r(6760),h=r(1283),c=r(9366),m=r(5964),p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function _(X){return T.isView(X)&&!(X instanceof l)}function w(X){return Array.isArray(X)||_(X)}e.exports=J;function S(X,oe){var ne=X[0],j=X[1],ee=X[2],re=X[3];return X[0]=oe[0]*ne+oe[4]*j+oe[8]*ee+oe[12]*re,X[1]=oe[1]*ne+oe[5]*j+oe[9]*ee+oe[13]*re,X[2]=oe[2]*ne+oe[6]*j+oe[10]*ee+oe[14]*re,X[3]=oe[3]*ne+oe[7]*j+oe[11]*ee+oe[15]*re,X}function M(X,oe,ne,j){return S(j,j,ne),S(j,j,oe),S(j,j,X)}function y(X,oe){this.index=X,this.dataCoordinate=this.position=oe}function b(X){return X===!0||X>1?1:X}function v(X,oe,ne,j,ee,re,ue,_e,Te,Ie,De,He){this.gl=X,this.pixelRatio=1,this.shader=oe,this.orthoShader=ne,this.projectShader=j,this.pointBuffer=ee,this.colorBuffer=re,this.glyphBuffer=ue,this.idBuffer=_e,this.vao=Te,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ie,this.pickOrthoShader=De,this.pickProjectShader=He,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=v.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var g=[0,0],f=[0,0,0],P=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=p.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function I(X){return X[0]=X[1]=X[2]=0,X}function N(X,oe){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[3]=1,X}function U(X,oe,ne,j){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[ne]=j,X}function W(X){for(var oe=O,ne=0;ne<2;++ne)for(var j=0;j<3;++j)oe[ne][j]=Math.max(Math.min(X[ne][j],1e8),-1e8);return oe}function Q(X,oe,ne,j){var ee=oe.axesProject,re=oe.gl,ue=X.uniforms,_e=ne.model||p,Te=ne.view||p,Ie=ne.projection||p,De=oe.axesBounds,He=W(oe.clipBounds),et;oe.axes&&oe.axes.lastCubeProps?et=oe.axes.lastCubeProps.axis:et=[1,1,1],g[0]=2/re.drawingBufferWidth,g[1]=2/re.drawingBufferHeight,X.bind(),ue.view=Te,ue.projection=Ie,ue.screenSize=g,ue.highlightId=oe.highlightId,ue.highlightScale=oe.highlightScale,ue.clipBounds=He,ue.pickGroup=oe.pickId/255,ue.pixelRatio=j;for(var rt=0;rt<3;++rt)if(ee[rt]){ue.scale=oe.projectScale[rt],ue.opacity=oe.projectOpacity[rt];for(var $e=F,ot=0;ot<16;++ot)$e[ot]=0;for(var ot=0;ot<4;++ot)$e[5*ot]=1;$e[5*rt]=0,et[rt]<0?$e[12+rt]=De[0][rt]:$e[12+rt]=De[1][rt],s($e,_e,$e),ue.model=$e;var Ae=(rt+1)%3,ge=(rt+2)%3,ce=I(f),ze=I(P);ce[Ae]=1,ze[ge]=1;var Qe=M(Ie,Te,_e,N(L,ce)),nt=M(Ie,Te,_e,N(z,ze));if(Math.abs(Qe[1])>Math.abs(nt[1])){var Ke=Qe;Qe=nt,nt=Ke,Ke=ce,ce=ze,ze=Ke;var kt=Ae;Ae=ge,ge=kt}Qe[0]<0&&(ce[Ae]=-1),nt[1]>0&&(ze[ge]=-1);for(var Et=0,Bt=0,ot=0;ot<4;++ot)Et+=Math.pow(_e[4*Ae+ot],2),Bt+=Math.pow(_e[4*ge+ot],2);ce[Ae]/=Math.sqrt(Et),ze[ge]/=Math.sqrt(Bt),ue.axes[0]=ce,ue.axes[1]=ze,ue.fragClipBounds[0]=U(B,He[0],rt,-1e8),ue.fragClipBounds[1]=U(B,He[1],rt,1e8),oe.vao.bind(),oe.vao.draw(re.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(re.lineWidth(oe.lineWidth*j),oe.vao.draw(re.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}var le=[-1e8,-1e8,-1e8],se=[1e8,1e8,1e8],he=[le,se];function q(X,oe,ne,j,ee,re,ue){var _e=ne.gl;if((re===ne.projectHasAlpha||ue)&&Q(oe,ne,j,ee),re===ne.hasAlpha||ue){X.bind();var Te=X.uniforms;Te.model=j.model||p,Te.view=j.view||p,Te.projection=j.projection||p,g[0]=2/_e.drawingBufferWidth,g[1]=2/_e.drawingBufferHeight,Te.screenSize=g,Te.highlightId=ne.highlightId,Te.highlightScale=ne.highlightScale,Te.fragClipBounds=he,Te.clipBounds=ne.axes.bounds,Te.opacity=ne.opacity,Te.pickGroup=ne.pickId/255,Te.pixelRatio=ee,ne.vao.bind(),ne.vao.draw(_e.TRIANGLES,ne.vertexCount),ne.lineWidth>0&&(_e.lineWidth(ne.lineWidth*ee),ne.vao.draw(_e.LINES,ne.lineVertexCount,ne.vertexCount)),ne.vao.unbind()}}u.draw=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;q(oe,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;q(oe,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var oe=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;q(oe,this.pickProjectShader,this,X,1,!0,!0)},u.pick=function(X){if(!X||X.id!==this.pickId)return null;var oe=X.value[2]+(X.value[1]<<8)+(X.value[0]<<16);if(oe>=this.pointCount||oe<0)return null;var ne=this.points[oe],j=this._selectResult;j.index=oe;for(var ee=0;ee<3;++ee)j.position[ee]=j.dataCoordinate[ee]=ne[ee];return j},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var oe=X.index,ne=oe&255,j=oe>>8&255,ee=oe>>16&255;this.highlightId=[ne/255,j/255,ee/255,0]}};function $(X,oe,ne,j){var ee;w(X)?oe0){var Er=0,yt=ge,Oe=[0,0,0,1],Xe=[0,0,0,1],be=w(et)&&w(et[0]),Ce=w(ot)&&w(ot[0]);e:for(var j=0;j0?1-Bt[0][0]:gt<0?1+Bt[1][0]:1,Ct*=Ct>0?1-Bt[0][1]:Ct<0?1+Bt[1][1]:1;for(var or=[gt,Ct],Ea=kt.cells||[],Sa=kt.positions||[],nt=0;nt=n?(M=l,m+=1,m0?1:0}}),8648:(function(e,t,r){e.exports=r(783)}),8692:(function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],h=o[0]-n,c=o[1]-s,m=Math.sin(i),p=Math.cos(i);return r[0]=n+h*p-c*m,r[1]=s+h*m+c*p,r[2]=o[2],r}}),8697:(function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}}),8731:(function(e,t,r){"use strict";e.exports=c;var o=r(8866);function a(m,p,T,l,_,w){this._gl=m,this._wrapper=p,this._index=T,this._locations=l,this._dimension=_,this._constFunc=w}var i=a.prototype;i.pointer=function(p,T,l,_){var w=this,S=w._gl,M=w._locations[w._index];S.vertexAttribPointer(M,w._dimension,p||S.FLOAT,!!T,l||0,_||0),S.enableVertexAttribArray(M)},i.set=function(m,p,T,l){return this._constFunc(this._locations[this._index],m,p,T,l)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(m){return m!==this._locations[this._index]&&(this._locations[this._index]=m|0,this._wrapper.program=null),m|0}});var n=[function(m,p,T){return T.length===void 0?m.vertexAttrib1f(p,T):m.vertexAttrib1fv(p,T)},function(m,p,T,l){return T.length===void 0?m.vertexAttrib2f(p,T,l):m.vertexAttrib2fv(p,T)},function(m,p,T,l,_){return T.length===void 0?m.vertexAttrib3f(p,T,l,_):m.vertexAttrib3fv(p,T)},function(m,p,T,l,_,w){return T.length===void 0?m.vertexAttrib4f(p,T,l,_,w):m.vertexAttrib4fv(p,T)}];function s(m,p,T,l,_,w,S){var M=n[_],y=new a(m,p,T,l,_,M);Object.defineProperty(w,S,{set:function(b){return m.disableVertexAttribArray(l[T]),M(m,l[T],b),b},get:function(){return y},enumerable:!0})}function h(m,p,T,l,_,w,S){for(var M=new Array(_),y=new Array(_),b=0;b<_;++b)s(m,p,T[b],l,_,M,b),y[b]=M[b];Object.defineProperty(M,"location",{set:function(g){if(Array.isArray(g))for(var f=0;f<_;++f)y[f].location=g[f];else for(var f=0;f<_;++f)y[f].location=g+f;return g},get:function(){for(var g=new Array(_),f=0;f<_;++f)g[f]=l[T[f]];return g},enumerable:!0}),M.pointer=function(g,f,P,L){g=g||m.FLOAT,f=!!f,P=P||_*_,L=L||0;for(var z=0;z<_;++z){var F=l[T[z]];m.vertexAttribPointer(F,_,g,f,P,L+z*_),m.enableVertexAttribArray(F)}};var v=new Array(_),u=m["vertexAttrib"+_+"fv"];Object.defineProperty(w,S,{set:function(g){for(var f=0;f<_;++f){var P=l[T[f]];if(m.disableVertexAttribArray(P),Array.isArray(g[0]))u.call(m,P,g[f]);else{for(var L=0;L<_;++L)v[L]=g[_*f+L];u.call(m,P,v)}}return g},get:function(){return M},enumerable:!0})}function c(m,p,T,l){for(var _={},w=0,S=T.length;w=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+y+": "+b);s(m,p,v[0],l,u,_,y)}else if(b.indexOf("mat")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+y+": "+b);h(m,p,v,l,u,_,y)}else throw new o("","Unknown data type for attribute "+y+": "+b);break}}return _}}),8828:(function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,h=n,c=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--c;i[n]=h<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}}),8866:(function(e){function t(r,o,a){this.shortMessage=o||"",this.longMessage=a||"",this.rawError=r||"",this.message="gl-shader: "+(o||r||"")+(a?` -`+a:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t}),8902:(function(e,t,r){"use strict";var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=S;function h(M,y,b,v,u){this.a=M,this.b=y,this.idx=b,this.lowerIds=v,this.upperIds=u}function c(M,y,b,v){this.a=M,this.b=y,this.type=b,this.idx=v}function m(M,y){var b=M.a[0]-y.a[0]||M.a[1]-y.a[1]||M.type-y.type;return b||M.type!==i&&(b=a(M.a,M.b,y.b),b)?b:M.idx-y.idx}function p(M,y){return a(M.a,M.b,y)}function T(M,y,b,v,u){for(var g=o.lt(y,v,p),f=o.gt(y,v,p),P=g;P1&&a(b[z[B-2]],b[z[B-1]],v)>0;)M.push([z[B-1],z[B-2],u]),B-=1;z.length=B,z.push(u);for(var F=L.upperIds,B=F.length;B>1&&a(b[F[B-2]],b[F[B-1]],v)<0;)M.push([F[B-2],F[B-1],u]),B-=1;F.length=B,F.push(u)}}function l(M,y){var b;return M.a[0]L[0]&&u.push(new c(L,P,s,g),new c(P,L,n,g))}u.sort(m);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new h([z,1],[z,0],-1,[],[],[],[])],B=[],g=0,O=u.length;g0;){_=v.pop();for(var u=_.adjacent,g=0;g<=S;++g){var f=u[g];if(!(!f.boundary||f.lastVisited<=-M)){for(var P=f.vertices,L=0;L<=S;++L){var z=P[L];z<0?y[L]=w:y[L]=b[z]}var F=this.orient();if(F>0)return f;f.lastVisited=-M,F===0&&v.push(f)}}}return null},T.walk=function(_,w){var S=this.vertices.length-1,M=this.dimension,y=this.vertices,b=this.tuple,v=w?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[v];e:for(;!u.boundary;){for(var g=u.vertices,f=u.adjacent,P=0;P<=M;++P)b[P]=y[g[P]];u.lastVisited=S;for(var P=0;P<=M;++P){var L=f[P];if(!(L.lastVisited>=S)){var z=b[P];b[P]=_;var F=this.orient();if(b[P]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-S:L.lastVisited=S}}return}return u},T.addPeaks=function(_,w){var S=this.vertices.length-1,M=this.dimension,y=this.vertices,b=this.tuple,v=this.interior,u=this.simplices,g=[w];w.lastVisited=S,w.vertices[w.vertices.indexOf(-1)]=S,w.boundary=!1,v.push(w);for(var f=[];g.length>0;){var w=g.pop(),P=w.vertices,L=w.adjacent,z=P.indexOf(S);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var B=L[F];if(!(!B.boundary||B.lastVisited>=S)){var O=B.vertices;if(B.lastVisited!==-S){for(var I=0,N=0;N<=M;++N)O[N]<0?(I=N,b[N]=_):b[N]=y[O[N]];var U=this.orient();if(U>0){O[I]=S,B.boundary=!1,v.push(B),g.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var W=B.adjacent,Q=P.slice(),le=L.slice(),se=new i(Q,le,!0);u.push(se);var he=W.indexOf(w);if(!(he<0)){W[he]=se,le[z]=B,Q[F]=-1,le[F]=w,L[F]=se,se.flip();for(var N=0;N<=M;++N){var q=Q[N];if(!(q<0||q===S)){for(var $=new Array(M-1),J=0,X=0;X<=M;++X){var oe=Q[X];oe<0||X===N||($[J++]=oe)}f.push(new n($,se,N))}}}}}}}f.sort(s);for(var F=0;F+1=0?v[g++]=u[P]:f=P&1;if(f===(_&1)){var L=v[0];v[0]=v[1],v[1]=L}w.push(v)}}return w};function l(_,w){var S=_.length;if(S===0)throw new Error("Must have at least d+1 points");var M=_[0].length;if(S<=M)throw new Error("Must input at least d+1 points");var y=_.slice(0,M+1),b=o.apply(void 0,y);if(b===0)throw new Error("Input not in general position");for(var v=new Array(M+1),u=0;u<=M;++u)v[u]=u;b<0&&(v[0]=1,v[1]=0);for(var g=new i(v,new Array(M+1),!1),f=g.adjacent,P=new Array(M+2),u=0;u<=M;++u){for(var L=v.slice(),z=0;z<=M;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var B=new i(L,new Array(M+1),!0);f[u]=B,P[u]=B}P[M+1]=g;for(var u=0;u<=M;++u)for(var L=f[u].vertices,O=f[u].adjacent,z=0;z<=M;++z){var I=L[z];if(I<0){O[z]=g;continue}for(var N=0;N<=M;++N)f[N].vertices.indexOf(I)<0&&(O[z]=f[N])}for(var U=new p(M,y,P),W=!!w,u=M+1;u=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(b){this.pickId=b};function _(b){for(var v=m({colormap:b,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),g=0;g<256;++g){for(var f=v[g],P=0;P<3;++P)u[4*g+P]=f[P];u[4*g+3]=f[3]*255}return c(u,[256,256,4],[4,0,1])}function w(b){for(var v=b.length,u=new Array(v),g=0;g0){var N=this.triShader;N.bind(),N.uniforms=z,this.triangleVAO.bind(),v.drawArrays(v.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(b){b=b||{};for(var v=this.gl,u=b.model||p,g=b.view||p,f=b.projection||p,P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)P[0][L]=Math.max(P[0][L],this.clipBounds[0][L]),P[1][L]=Math.min(P[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(g),this._projection=[].slice.call(f),this._resolution=[v.drawingBufferWidth,v.drawingBufferHeight];var z={model:u,view:g,projection:f,clipBounds:P,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),v.drawArrays(v.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(b){if(!b||b.id!==this.pickId)return null;var v=b.value[0]+256*b.value[1]+65536*b.value[2],u=this.cells[v],g=this.positions[u[1]].slice(0,3),f={position:g,dataCoordinate:g,index:Math.floor(u[1]/48)};return this.traceType==="cone"?f.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(f.intensity=this.intensity[u[1]],f.velocity=this.vectors[u[1]].slice(0,3),f.divergence=this.vectors[u[1]][3],f.index=v),f},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function S(b,v){var u=o(b,v.meshShader.vertex,v.meshShader.fragment,null,v.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(b,v){var u=o(b,v.pickShader.vertex,v.pickShader.fragment,null,v.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function y(b,v,u){var g=u.shaders;arguments.length===1&&(v=b,b=v.gl);var f=S(b,g),P=M(b,g),L=n(b,c(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=b.LINEAR_MIPMAP_LINEAR,L.magFilter=b.LINEAR;var z=a(b),F=a(b),B=a(b),O=a(b),I=a(b),N=i(b,[{buffer:z,type:b.FLOAT,size:4},{buffer:I,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:b.FLOAT,size:4},{buffer:O,type:b.FLOAT,size:2},{buffer:F,type:b.FLOAT,size:4}]),U=new T(b,L,f,P,z,F,I,B,O,N,u.traceType||"cone");return U.update(v),U}e.exports=y}),9127:(function(e,t,r){"use strict";e.exports=i;var o=r(6204),a=r(5771);function i(n){return a(o(n))}}),9131:(function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}}),9165:(function(e,t,r){"use strict";e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,_,w,S){this.gl=l,this.shader=S,this.buffer=_,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var h=s.prototype;h.isOpaque=function(){return!this.hasAlpha},h.isTransparent=function(){return this.hasAlpha},h.drawTransparent=h.draw=function(l){var _=this.gl,w=this.shader.uniforms;this.shader.bind();var S=w.view=l.view||n,M=w.projection=l.projection||n;w.model=l.model||n,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var y=S[12],b=S[13],v=S[14],u=S[15],g=l._ortho||!1,f=g?2:1,P=f*this.pixelRatio*(M[3]*y+M[7]*b+M[11]*v+M[15]*u)/_.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)_.lineWidth(this.lineWidth[L]*this.pixelRatio),w.capSize=this.capSize[L]*P,this.lineCount[L]&&_.drawArrays(_.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function c(l,_){for(var w=0;w<3;++w)l[0][w]=Math.min(l[0][w],_[w]),l[1][w]=Math.max(l[1][w],_[w])}var m=(function(){for(var l=new Array(3),_=0;_<3;++_){for(var w=[],S=1;S<=2;++S)for(var M=-1;M<=1;M+=2){var y=(S+_)%3,b=[0,0,0];b[y]=M,w.push(b)}l[_]=w}return l})();function p(l,_,w,S){for(var M=m[S],y=0;y0){var z=g.slice();z[v]+=P[1][v],M.push(g[0],g[1],g[2],L[0],L[1],L[2],L[3],0,0,0,z[0],z[1],z[2],L[0],L[1],L[2],L[3],0,0,0),c(this.bounds,z),b+=2+p(M,z,L,v)}}}this.lineCount[v]=b-this.lineOffset[v]}this.buffer.update(M)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var _=l.gl,w=o(_),S=a(_,[{buffer:w,type:_.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:_.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:_.FLOAT,size:3,offset:28,stride:40}]),M=i(_);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var y=new s(_,w,S,M);return y.update(l),y}}),9215:(function(e,t,r){"use strict";e.exports=c;var o=r(4769),a=r(2478);function i(m,p,T){return Math.min(p,Math.max(m,T))}function n(m,p,T){this.dimension=m.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=T-1)for(var b=w.length-1,u=m-p[T-1],v=0;v=T-1)for(var y=w.length-1,b=m-p[T-1],v=0;v=0;--T)if(m[--p])return!1;return!0},s.jump=function(m){var p=this.lastT(),T=this.dimension;if(!(m0;--v)l.push(i(M[v-1],y[v-1],arguments[v])),_.push(0)}},s.push=function(m){var p=this.lastT(),T=this.dimension;if(!(m1e-6?1/S:0;this._time.push(m);for(var u=T;u>0;--u){var g=i(y[u-1],b[u-1],arguments[u]);l.push(g),_.push((g-l[w++])*v)}}},s.set=function(m){var p=this.dimension;if(!(m0;--M)T.push(i(w[M-1],S[M-1],arguments[M])),l.push(0)}},s.move=function(m){var p=this.lastT(),T=this.dimension;if(!(m<=p||arguments.length!==T+1)){var l=this._state,_=this._velocity,w=l.length-this.dimension,S=this.bounds,M=S[0],y=S[1],b=m-p,v=b>1e-6?1/b:0;this._time.push(m);for(var u=T;u>0;--u){var g=arguments[u];l.push(i(M[u-1],y[u-1],l[w++]+g)),_.push(g*v)}}},s.idle=function(m){var p=this.lastT();if(!(m=0;--v)l.push(i(M[v],y[v],l[w]+b*_[w])),_.push(0),w+=1}};function h(m){for(var p=new Array(m),T=0;T1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}}),9226:(function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}}),9265:(function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}}),9288:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}}),9346:(function(e){"use strict";var t=new Float64Array(4),r=new Float64Array(4),o=new Float64Array(4);function a(i,n,s,h,c){t.length=p?(u=1,f=p+2*_+S):(u=-_/p,f=_*u+S)):(u=0,w>=0?(g=0,f=S):-w>=l?(g=1,f=l+2*w+S):(g=-w/l,f=w*g+S));else if(g<0)g=0,_>=0?(u=0,f=S):-_>=p?(u=1,f=p+2*_+S):(u=-_/p,f=_*u+S);else{var P=1/v;u*=P,g*=P,f=u*(p*u+T*g+2*_)+g*(T*u+l*g+2*w)+S}else{var L,z,F,B;u<0?(L=T+_,z=l+w,z>L?(F=z-L,B=p-2*T+l,F>=B?(u=1,g=0,f=p+2*_+S):(u=F/B,g=1-u,f=u*(p*u+T*g+2*_)+g*(T*u+l*g+2*w)+S)):(u=0,z<=0?(g=1,f=l+2*w+S):w>=0?(g=0,f=S):(g=-w/l,f=w*g+S))):g<0?(L=T+w,z=p+_,z>L?(F=z-L,B=p-2*T+l,F>=B?(g=1,u=0,f=l+2*w+S):(g=F/B,u=1-g,f=u*(p*u+T*g+2*_)+g*(T*u+l*g+2*w)+S)):(g=0,z<=0?(u=1,f=p+2*_+S):_>=0?(u=0,f=S):(u=-_/p,f=_*u+S))):(F=l+w-T-_,F<=0?(u=0,g=1,f=l+2*w+S):(B=p-2*T+l,F>=B?(u=1,g=0,f=p+2*_+S):(u=F/B,g=1-u,f=u*(p*u+T*g+2*_)+g*(T*u+l*g+2*w)+S)))}for(var O=1-u-g,m=0;mw)for(l=w;l<_;l++)this.gl.enableVertexAttribArray(l);else if(w>_)for(l=_;l=0){for(var O=B.type.charAt(B.type.length-1)|0,I=new Array(O),N=0;N=0;)U+=1;z[F]=U}var W=new Array(w.length);function Q(){y.program=n.program(b,y._vref,y._fref,L,z);for(var le=0;lene&&ee>0){var re=(j[ee][0]-ne)/(j[ee][0]-j[ee-1][0]);return j[ee][1]*(1-re)+re*j[ee-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[f.slice(),f.slice(),f.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function W(ne,j){var ee,re,ue,_e=j.axes&&j.axes.lastCubeProps.axis||N,Te=j.showSurface,Ie=j.showContour;for(ee=0;ee<3;++ee)for(Te=Te||j.surfaceProject[ee],re=0;re<3;++re)Ie=Ie||j.contourProject[ee][re];for(ee=0;ee<3;++ee){var De=U.projections[ee];for(re=0;re<16;++re)De[re]=0;for(re=0;re<4;++re)De[5*re]=1;De[5*ee]=0,De[12+ee]=j.axesBounds[+(_e[ee]>0)][ee],l(De,ne.model,De);var He=U.clipBounds[ee];for(ue=0;ue<2;++ue)for(re=0;re<3;++re)He[ue][re]=ne.clipBounds[ue][re];He[0][ee]=-1e8,He[1][ee]=1e8}return U.showSurface=Te,U.showContour=Ie,U}var Q={model:f,view:f,projection:f,inverseModel:f.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},le=f.slice(),se=[1,0,0,0,1,0,0,0,1];function he(ne,j){ne=ne||{};var ee=this.gl;ee.disable(ee.CULL_FACE),this._colorMap.bind(0);var re=Q;re.model=ne.model||f,re.view=ne.view||f,re.projection=ne.projection||f,re.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],re.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],re.objectOffset=this.objectOffset,re.contourColor=this.contourColor[0],re.inverseModel=_(re.inverseModel,re.model);for(var ue=0;ue<2;++ue)for(var _e=re.clipBounds[ue],Te=0;Te<3;++Te)_e[Te]=Math.min(Math.max(this.clipBounds[ue][Te],-1e8),1e8);re.kambient=this.ambientLight,re.kdiffuse=this.diffuseLight,re.kspecular=this.specularLight,re.roughness=this.roughness,re.fresnel=this.fresnel,re.opacity=this.opacity,re.height=0,re.permutation=se,re.vertexColor=this.vertexColor;var Ie=le;for(l(Ie,re.view,re.model),l(Ie,re.projection,Ie),_(Ie,Ie),ue=0;ue<3;++ue)re.eyePosition[ue]=Ie[12+ue]/Ie[15];var De=Ie[15];for(ue=0;ue<3;++ue)De+=this.lightPosition[ue]*Ie[4*ue+3];for(ue=0;ue<3;++ue){var He=Ie[12+ue];for(Te=0;Te<3;++Te)He+=Ie[4*Te+ue]*this.lightPosition[Te];re.lightPosition[ue]=He/De}var et=W(re,this);if(et.showSurface){for(this._shader.bind(),this._shader.uniforms=re,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ee.TRIANGLES,this._vertexCount),ue=0;ue<3;++ue)!this.surfaceProject[ue]||!this.vertexCount||(this._shader.uniforms.model=et.projections[ue],this._shader.uniforms.clipBounds=et.clipBounds[ue],this._vao.draw(ee.TRIANGLES,this._vertexCount));this._vao.unbind()}if(et.showContour){var rt=this._contourShader;re.kambient=1,re.kdiffuse=0,re.kspecular=0,re.opacity=1,rt.bind(),rt.uniforms=re;var $e=this._contourVAO;for($e.bind(),ue=0;ue<3;++ue)for(rt.uniforms.permutation=L[ue],ee.lineWidth(this.contourWidth[ue]*this.pixelRatio),Te=0;Te>4)/16)/255,ue=Math.floor(re),_e=re-ue,Te=j[1]*(ne.value[1]+(ne.value[2]&15)/16)/255,Ie=Math.floor(Te),De=Te-Ie;ue+=1,Ie+=1;var He=ee.position;He[0]=He[1]=He[2]=0;for(var et=0;et<2;++et)for(var rt=et?_e:1-_e,$e=0;$e<2;++$e)for(var ot=$e?De:1-De,Ae=ue+et,ge=Ie+$e,ce=rt*ot,ze=0;ze<3;++ze)He[ze]+=this._field[ze].get(Ae,ge)*ce;for(var Qe=this._pickResult.level,nt=0;nt<3;++nt)if(Qe[nt]=w.le(this.contourLevels[nt],He[nt]),Qe[nt]<0)this.contourLevels[nt].length>0&&(Qe[nt]=0);else if(Qe[nt]Math.abs(kt-He[nt])&&(Qe[nt]+=1)}for(ee.index[0]=_e<.5?ue:ue+1,ee.index[1]=De<.5?Ie:Ie+1,ee.uv[0]=re/j[0],ee.uv[1]=Te/j[1],ze=0;ze<3;++ze)ee.dataCoordinate[ze]=this._field[ze].get(ee.index[0],ee.index[1]);return ee},O.padField=function(ne,j){var ee=j.shape.slice(),re=ne.shape.slice();c.assign(ne.lo(1,1).hi(ee[0],ee[1]),j),c.assign(ne.lo(1).hi(ee[0],1),j.hi(ee[0],1)),c.assign(ne.lo(1,re[1]-1).hi(ee[0],1),j.lo(0,ee[1]-1).hi(ee[0],1)),c.assign(ne.lo(0,1).hi(1,ee[1]),j.hi(1)),c.assign(ne.lo(re[0]-1,1).hi(1,ee[1]),j.lo(ee[0]-1)),ne.set(0,0,j.get(0,0)),ne.set(0,re[1]-1,j.get(0,ee[1]-1)),ne.set(re[0]-1,0,j.get(ee[0]-1,0)),ne.set(re[0]-1,re[1]-1,j.get(ee[0]-1,ee[1]-1))};function $(ne,j){return Array.isArray(ne)?[j(ne[0]),j(ne[1]),j(ne[2])]:[j(ne),j(ne),j(ne)]}function J(ne){return Array.isArray(ne)?ne.length===3?[ne[0],ne[1],ne[2],1]:[ne[0],ne[1],ne[2],ne[3]]:[0,0,0,1]}function X(ne){if(Array.isArray(ne)){if(Array.isArray(ne))return[J(ne[0]),J(ne[1]),J(ne[2])];var j=J(ne);return[j.slice(),j.slice(),j.slice()]}}O.update=function(ne){ne=ne||{},this.objectOffset=ne.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ne&&(this.contourWidth=$(ne.contourWidth,Number)),"showContour"in ne&&(this.showContour=$(ne.showContour,Boolean)),"showSurface"in ne&&(this.showSurface=!!ne.showSurface),"contourTint"in ne&&(this.contourTint=$(ne.contourTint,Boolean)),"contourColor"in ne&&(this.contourColor=X(ne.contourColor)),"contourProject"in ne&&(this.contourProject=$(ne.contourProject,function(sn){return $(sn,Boolean)})),"surfaceProject"in ne&&(this.surfaceProject=ne.surfaceProject),"dynamicColor"in ne&&(this.dynamicColor=X(ne.dynamicColor)),"dynamicTint"in ne&&(this.dynamicTint=$(ne.dynamicTint,Number)),"dynamicWidth"in ne&&(this.dynamicWidth=$(ne.dynamicWidth,Number)),"opacity"in ne&&(this.opacity=ne.opacity),"opacityscale"in ne&&(this.opacityscale=ne.opacityscale),"colorBounds"in ne&&(this.colorBounds=ne.colorBounds),"vertexColor"in ne&&(this.vertexColor=ne.vertexColor?1:0),"colormap"in ne&&this._colorMap.setPixels(this.genColormap(ne.colormap,this.opacityscale));var j=ne.field||ne.coords&&ne.coords[2]||null,ee=!1;if(j||(this._field[2].shape[0]||this._field[2].shape[2]?j=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):j=this._field[2].hi(0,0)),"field"in ne||"coords"in ne){var re=(j.shape[0]+2)*(j.shape[1]+2);re>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(re))),this._field[2]=p(this._field[2].data,[j.shape[0]+2,j.shape[1]+2]),this.padField(this._field[2],j),this.shape=j.shape.slice();for(var ue=this.shape,_e=0;_e<2;++_e)this._field[2].size>this._field[_e].data.length&&(s.freeFloat(this._field[_e].data),this._field[_e].data=s.mallocFloat(this._field[2].size)),this._field[_e]=p(this._field[_e].data,[ue[0]+2,ue[1]+2]);if(ne.coords){var Te=ne.coords;if(!Array.isArray(Te)||Te.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(_e=0;_e<2;++_e){var Ie=Te[_e];for($e=0;$e<2;++$e)if(Ie.shape[$e]!==ue[$e])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[_e],Ie)}}else if(ne.ticks){var De=ne.ticks;if(!Array.isArray(De)||De.length!==2)throw new Error("gl-surface: invalid ticks");for(_e=0;_e<2;++_e){var He=De[_e];if((Array.isArray(He)||He.length)&&(He=p(He)),He.shape[0]!==ue[_e])throw new Error("gl-surface: invalid tick length");var et=p(He.data,ue);et.stride[_e]=He.stride[0],et.stride[_e^1]=0,this.padField(this._field[_e],et)}}else{for(_e=0;_e<2;++_e){var rt=[0,0];rt[_e]=1,this._field[_e]=p(this._field[_e].data,[ue[0]+2,ue[1]+2],rt,0)}this._field[0].set(0,0,0);for(var $e=0;$e0){for(var ja=0;ja<5;++ja)Qt.pop();be-=1}continue e}}}Ea.push(be)}this._contourOffsets[Jt]=oa,this._contourCounts[Jt]=Ea}var Xa=s.mallocFloat(Qt.length);for(_e=0;_e=0&&(v=y|0,b+=g*v,u-=v),new w(this.data,u,g,b)},S.step=function(y){var b=this.shape[0],v=this.stride[0],u=this.offset,g=0,f=Math.ceil;return typeof y=="number"&&(g=y|0,g<0?(u+=v*(b-1),b=f(-b/g)):b=f(b/g),v*=g),new w(this.data,b,v,u)},S.transpose=function(y){y=y===void 0?0:y|0;var b=this.shape,v=this.stride;return new w(this.data,b[y],v[y],this.offset)},S.pick=function(y){var b=[],v=[],u=this.offset;typeof y=="number"&&y>=0?u=u+this.stride[0]*y|0:(b.push(this.shape[0]),v.push(this.stride[0]));var g=l[b.length+1];return g(this.data,b,v,u)},function(y,b,v,u){return new w(y,b[0],v[0],u)}},2:function(T,l,_){function w(M,y,b,v,u,g){this.data=M,this.shape=[y,b],this.stride=[v,u],this.offset=g|0}var S=w.prototype;return S.dtype=T,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(y,b,v){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b,v):this.data[this.offset+this.stride[0]*y+this.stride[1]*b]=v},S.get=function(y,b){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b):this.data[this.offset+this.stride[0]*y+this.stride[1]*b]},S.index=function(y,b){return this.offset+this.stride[0]*y+this.stride[1]*b},S.hi=function(y,b){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(y,b){var v=this.offset,u=0,g=this.shape[0],f=this.shape[1],P=this.stride[0],L=this.stride[1];return typeof y=="number"&&y>=0&&(u=y|0,v+=P*u,g-=u),typeof b=="number"&&b>=0&&(u=b|0,v+=L*u,f-=u),new w(this.data,g,f,P,L,v)},S.step=function(y,b){var v=this.shape[0],u=this.shape[1],g=this.stride[0],f=this.stride[1],P=this.offset,L=0,z=Math.ceil;return typeof y=="number"&&(L=y|0,L<0?(P+=g*(v-1),v=z(-v/L)):v=z(v/L),g*=L),typeof b=="number"&&(L=b|0,L<0?(P+=f*(u-1),u=z(-u/L)):u=z(u/L),f*=L),new w(this.data,v,u,g,f,P)},S.transpose=function(y,b){y=y===void 0?0:y|0,b=b===void 0?1:b|0;var v=this.shape,u=this.stride;return new w(this.data,v[y],v[b],u[y],u[b],this.offset)},S.pick=function(y,b){var v=[],u=[],g=this.offset;typeof y=="number"&&y>=0?g=g+this.stride[0]*y|0:(v.push(this.shape[0]),u.push(this.stride[0])),typeof b=="number"&&b>=0?g=g+this.stride[1]*b|0:(v.push(this.shape[1]),u.push(this.stride[1]));var f=l[v.length+1];return f(this.data,v,u,g)},function(y,b,v,u){return new w(y,b[0],b[1],v[0],v[1],u)}},3:function(T,l,_){function w(M,y,b,v,u,g,f,P){this.data=M,this.shape=[y,b,v],this.stride=[u,g,f],this.offset=P|0}var S=w.prototype;return S.dtype=T,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var y=Math.abs(this.stride[0]),b=Math.abs(this.stride[1]),v=Math.abs(this.stride[2]);return y>b?b>v?[2,1,0]:y>v?[1,2,0]:[1,0,2]:y>v?[2,0,1]:v>b?[0,1,2]:[0,2,1]}}),S.set=function(y,b,v,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v,u):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v]=u},S.get=function(y,b,v){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v]},S.index=function(y,b,v){return this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v},S.hi=function(y,b,v){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof v!="number"||v<0?this.shape[2]:v|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(y,b,v){var u=this.offset,g=0,f=this.shape[0],P=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],B=this.stride[2];return typeof y=="number"&&y>=0&&(g=y|0,u+=z*g,f-=g),typeof b=="number"&&b>=0&&(g=b|0,u+=F*g,P-=g),typeof v=="number"&&v>=0&&(g=v|0,u+=B*g,L-=g),new w(this.data,f,P,L,z,F,B,u)},S.step=function(y,b,v){var u=this.shape[0],g=this.shape[1],f=this.shape[2],P=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,B=0,O=Math.ceil;return typeof y=="number"&&(B=y|0,B<0?(F+=P*(u-1),u=O(-u/B)):u=O(u/B),P*=B),typeof b=="number"&&(B=b|0,B<0?(F+=L*(g-1),g=O(-g/B)):g=O(g/B),L*=B),typeof v=="number"&&(B=v|0,B<0?(F+=z*(f-1),f=O(-f/B)):f=O(f/B),z*=B),new w(this.data,u,g,f,P,L,z,F)},S.transpose=function(y,b,v){y=y===void 0?0:y|0,b=b===void 0?1:b|0,v=v===void 0?2:v|0;var u=this.shape,g=this.stride;return new w(this.data,u[y],u[b],u[v],g[y],g[b],g[v],this.offset)},S.pick=function(y,b,v){var u=[],g=[],f=this.offset;typeof y=="number"&&y>=0?f=f+this.stride[0]*y|0:(u.push(this.shape[0]),g.push(this.stride[0])),typeof b=="number"&&b>=0?f=f+this.stride[1]*b|0:(u.push(this.shape[1]),g.push(this.stride[1])),typeof v=="number"&&v>=0?f=f+this.stride[2]*v|0:(u.push(this.shape[2]),g.push(this.stride[2]));var P=l[u.length+1];return P(this.data,u,g,f)},function(y,b,v,u){return new w(y,b[0],b[1],b[2],v[0],v[1],v[2],u)}},4:function(T,l,_){function w(M,y,b,v,u,g,f,P,L,z){this.data=M,this.shape=[y,b,v,u],this.stride=[g,f,P,L],this.offset=z|0}var S=w.prototype;return S.dtype=T,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:_}),S.set=function(y,b,v,u,g){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u,g):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u]=g},S.get=function(y,b,v,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u]},S.index=function(y,b,v,u){return this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u},S.hi=function(y,b,v,u){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof v!="number"||v<0?this.shape[2]:v|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(y,b,v,u){var g=this.offset,f=0,P=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.stride[0],O=this.stride[1],I=this.stride[2],N=this.stride[3];return typeof y=="number"&&y>=0&&(f=y|0,g+=B*f,P-=f),typeof b=="number"&&b>=0&&(f=b|0,g+=O*f,L-=f),typeof v=="number"&&v>=0&&(f=v|0,g+=I*f,z-=f),typeof u=="number"&&u>=0&&(f=u|0,g+=N*f,F-=f),new w(this.data,P,L,z,F,B,O,I,N,g)},S.step=function(y,b,v,u){var g=this.shape[0],f=this.shape[1],P=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],B=this.stride[2],O=this.stride[3],I=this.offset,N=0,U=Math.ceil;return typeof y=="number"&&(N=y|0,N<0?(I+=z*(g-1),g=U(-g/N)):g=U(g/N),z*=N),typeof b=="number"&&(N=b|0,N<0?(I+=F*(f-1),f=U(-f/N)):f=U(f/N),F*=N),typeof v=="number"&&(N=v|0,N<0?(I+=B*(P-1),P=U(-P/N)):P=U(P/N),B*=N),typeof u=="number"&&(N=u|0,N<0?(I+=O*(L-1),L=U(-L/N)):L=U(L/N),O*=N),new w(this.data,g,f,P,L,z,F,B,O,I)},S.transpose=function(y,b,v,u){y=y===void 0?0:y|0,b=b===void 0?1:b|0,v=v===void 0?2:v|0,u=u===void 0?3:u|0;var g=this.shape,f=this.stride;return new w(this.data,g[y],g[b],g[v],g[u],f[y],f[b],f[v],f[u],this.offset)},S.pick=function(y,b,v,u){var g=[],f=[],P=this.offset;typeof y=="number"&&y>=0?P=P+this.stride[0]*y|0:(g.push(this.shape[0]),f.push(this.stride[0])),typeof b=="number"&&b>=0?P=P+this.stride[1]*b|0:(g.push(this.shape[1]),f.push(this.stride[1])),typeof v=="number"&&v>=0?P=P+this.stride[2]*v|0:(g.push(this.shape[2]),f.push(this.stride[2])),typeof u=="number"&&u>=0?P=P+this.stride[3]*u|0:(g.push(this.shape[3]),f.push(this.stride[3]));var L=l[g.length+1];return L(this.data,g,f,P)},function(y,b,v,u){return new w(y,b[0],b[1],b[2],b[3],v[0],v[1],v[2],v[3],u)}},5:function(l,_,w){function S(y,b,v,u,g,f,P,L,z,F,B,O){this.data=y,this.shape=[b,v,u,g,f],this.stride=[P,L,z,F,B],this.offset=O|0}var M=S.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:w}),M.set=function(b,v,u,g,f,P){return l==="generic"?this.data.set(this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*g+this.stride[4]*f,P):this.data[this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*g+this.stride[4]*f]=P},M.get=function(b,v,u,g,f){return l==="generic"?this.data.get(this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*g+this.stride[4]*f):this.data[this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*g+this.stride[4]*f]},M.index=function(b,v,u,g,f){return this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*g+this.stride[4]*f},M.hi=function(b,v,u,g,f){return new S(this.data,typeof b!="number"||b<0?this.shape[0]:b|0,typeof v!="number"||v<0?this.shape[1]:v|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof g!="number"||g<0?this.shape[3]:g|0,typeof f!="number"||f<0?this.shape[4]:f|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(b,v,u,g,f){var P=this.offset,L=0,z=this.shape[0],F=this.shape[1],B=this.shape[2],O=this.shape[3],I=this.shape[4],N=this.stride[0],U=this.stride[1],W=this.stride[2],Q=this.stride[3],le=this.stride[4];return typeof b=="number"&&b>=0&&(L=b|0,P+=N*L,z-=L),typeof v=="number"&&v>=0&&(L=v|0,P+=U*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,P+=W*L,B-=L),typeof g=="number"&&g>=0&&(L=g|0,P+=Q*L,O-=L),typeof f=="number"&&f>=0&&(L=f|0,P+=le*L,I-=L),new S(this.data,z,F,B,O,I,N,U,W,Q,le,P)},M.step=function(b,v,u,g,f){var P=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.shape[4],O=this.stride[0],I=this.stride[1],N=this.stride[2],U=this.stride[3],W=this.stride[4],Q=this.offset,le=0,se=Math.ceil;return typeof b=="number"&&(le=b|0,le<0?(Q+=O*(P-1),P=se(-P/le)):P=se(P/le),O*=le),typeof v=="number"&&(le=v|0,le<0?(Q+=I*(L-1),L=se(-L/le)):L=se(L/le),I*=le),typeof u=="number"&&(le=u|0,le<0?(Q+=N*(z-1),z=se(-z/le)):z=se(z/le),N*=le),typeof g=="number"&&(le=g|0,le<0?(Q+=U*(F-1),F=se(-F/le)):F=se(F/le),U*=le),typeof f=="number"&&(le=f|0,le<0?(Q+=W*(B-1),B=se(-B/le)):B=se(B/le),W*=le),new S(this.data,P,L,z,F,B,O,I,N,U,W,Q)},M.transpose=function(b,v,u,g,f){b=b===void 0?0:b|0,v=v===void 0?1:v|0,u=u===void 0?2:u|0,g=g===void 0?3:g|0,f=f===void 0?4:f|0;var P=this.shape,L=this.stride;return new S(this.data,P[b],P[v],P[u],P[g],P[f],L[b],L[v],L[u],L[g],L[f],this.offset)},M.pick=function(b,v,u,g,f){var P=[],L=[],z=this.offset;typeof b=="number"&&b>=0?z=z+this.stride[0]*b|0:(P.push(this.shape[0]),L.push(this.stride[0])),typeof v=="number"&&v>=0?z=z+this.stride[1]*v|0:(P.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(P.push(this.shape[2]),L.push(this.stride[2])),typeof g=="number"&&g>=0?z=z+this.stride[3]*g|0:(P.push(this.shape[3]),L.push(this.stride[3])),typeof f=="number"&&f>=0?z=z+this.stride[4]*f|0:(P.push(this.shape[4]),L.push(this.stride[4]));var F=_[P.length+1];return F(this.data,P,L,z)},function(b,v,u,g){return new S(b,v[0],v[1],v[2],v[3],v[4],u[0],u[1],u[2],u[3],u[4],g)}}};function h(T,l){var _=l===-1?"T":String(l),w=s[_];return l===-1?w(T):l===0?w(T,m[T][0]):w(T,m[T],n)}function c(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function p(T,l,_,w){if(T===void 0){var u=m.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var S=l.length;if(_===void 0){_=new Array(S);for(var M=S-1,y=1;M>=0;--M)_[M]=y,y*=l[M]}if(w===void 0){w=0;for(var M=0;M1e-6?(_[0]=S/v,_[1]=M/v,_[2]=y/v,_[3]=b/v):(_[0]=_[1]=_[2]=0,_[3]=1)}function p(_,w,S){this.radius=o([S]),this.center=o(w),this.rotation=o(_),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var T=p.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(_){this.radius.curve(_),this.center.curve(_),this.rotation.curve(_);var w=this.computedRotation;m(w,w);var S=this.computedMatrix;i(S,w);var M=this.computedCenter,y=this.computedEye,b=this.computedUp,v=Math.exp(this.computedRadius[0]);y[0]=M[0]+v*S[2],y[1]=M[1]+v*S[6],y[2]=M[2]+v*S[10],b[0]=S[1],b[1]=S[5],b[2]=S[9];for(var u=0;u<3;++u){for(var g=0,f=0;f<3;++f)g+=S[u+4*f]*y[f];S[12+u]=-g}},T.getMatrix=function(_,w){this.recalcMatrix(_);var S=this.computedMatrix;if(w){for(var M=0;M<16;++M)w[M]=S[M];return w}return S},T.idle=function(_){this.center.idle(_),this.radius.idle(_),this.rotation.idle(_)},T.flush=function(_){this.center.flush(_),this.radius.flush(_),this.rotation.flush(_)},T.pan=function(_,w,S,M){w=w||0,S=S||0,M=M||0,this.recalcMatrix(_);var y=this.computedMatrix,b=y[1],v=y[5],u=y[9],g=h(b,v,u);b/=g,v/=g,u/=g;var f=y[0],P=y[4],L=y[8],z=f*b+P*v+L*u;f-=b*z,P-=v*z,L-=u*z;var F=h(f,P,L);f/=F,P/=F,L/=F;var B=y[2],O=y[6],I=y[10],N=B*b+O*v+I*u,U=B*f+O*P+I*L;B-=N*b+U*f,O-=N*v+U*P,I-=N*u+U*L;var W=h(B,O,I);B/=W,O/=W,I/=W;var Q=f*w+b*S,le=P*w+v*S,se=L*w+u*S;this.center.move(_,Q,le,se);var he=Math.exp(this.computedRadius[0]);he=Math.max(1e-4,he+M),this.radius.set(_,Math.log(he))},T.rotate=function(_,w,S,M){this.recalcMatrix(_),w=w||0,S=S||0;var y=this.computedMatrix,b=y[0],v=y[4],u=y[8],g=y[1],f=y[5],P=y[9],L=y[2],z=y[6],F=y[10],B=w*b+S*g,O=w*v+S*f,I=w*u+S*P,N=-(z*I-F*O),U=-(F*B-L*I),W=-(L*O-z*B),Q=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(U,2)-Math.pow(W,2))),le=c(N,U,W,Q);le>1e-6?(N/=le,U/=le,W/=le,Q/=le):(N=U=W=0,Q=1);var se=this.computedRotation,he=se[0],q=se[1],$=se[2],J=se[3],X=he*Q+J*N+q*W-$*U,oe=q*Q+J*U+$*N-he*W,ne=$*Q+J*W+he*U-q*N,j=J*Q-he*N-q*U-$*W;if(M){N=L,U=z,W=F;var ee=Math.sin(M)/h(N,U,W);N*=ee,U*=ee,W*=ee,Q=Math.cos(w),X=X*Q+j*N+oe*W-ne*U,oe=oe*Q+j*U+ne*N-X*W,ne=ne*Q+j*W+X*U-oe*N,j=j*Q-X*N-oe*U-ne*W}var re=c(X,oe,ne,j);re>1e-6?(X/=re,oe/=re,ne/=re,j/=re):(X=oe=ne=0,j=1),this.rotation.set(_,X,oe,ne,j)},T.lookAt=function(_,w,S,M){this.recalcMatrix(_),S=S||this.computedCenter,w=w||this.computedEye,M=M||this.computedUp;var y=this.computedMatrix;a(y,w,S,M);var b=this.computedRotation;s(b,y[0],y[1],y[2],y[4],y[5],y[6],y[8],y[9],y[10]),m(b,b),this.rotation.set(_,b[0],b[1],b[2],b[3]);for(var v=0,u=0;u<3;++u)v+=Math.pow(S[u]-w[u],2);this.radius.set(_,.5*Math.log(Math.max(v,1e-6))),this.center.set(_,S[0],S[1],S[2])},T.translate=function(_,w,S,M){this.center.move(_,w||0,S||0,M||0)},T.setMatrix=function(_,w){var S=this.computedRotation;s(S,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),m(S,S),this.rotation.set(_,S[0],S[1],S[2],S[3]);var M=this.computedMatrix;n(M,w);var y=M[15];if(Math.abs(y)>1e-6){var b=M[12]/y,v=M[13]/y,u=M[14]/y;this.recalcMatrix(_);var g=Math.exp(this.computedRadius[0]);this.center.set(_,b-M[2]*g,v-M[6]*g,u-M[10]*g),this.radius.idle(_)}else this.center.idle(_),this.radius.idle(_)},T.setDistance=function(_,w){w>0&&this.radius.set(_,Math.log(w))},T.setDistanceLimits=function(_,w){_>0?_=Math.log(_):_=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,_),this.radius.bounds[0][0]=_,this.radius.bounds[1][0]=w},T.getDistanceLimits=function(_){var w=this.radius.bounds;return _?(_[0]=Math.exp(w[0][0]),_[1]=Math.exp(w[1][0]),_):[Math.exp(w[0][0]),Math.exp(w[1][0])]},T.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},T.fromJSON=function(_){var w=this.lastT(),S=_.center;S&&this.center.set(w,S[0],S[1],S[2]);var M=_.rotation;M&&this.rotation.set(w,M[0],M[1],M[2],M[3]);var y=_.distance;y&&y>0&&this.radius.set(w,Math.log(y)),this.setDistanceLimits(_.zoomMin,_.zoomMax)};function l(_){_=_||{};var w=_.center||[0,0,0],S=_.rotation||[0,0,0,1],M=_.radius||1;w=[].slice.call(w,0,3),S=[].slice.call(S,0,4),m(S,S);var y=new p(S,w,Math.log(M));return y.setDistanceLimits(_.zoomMin,_.zoomMax),("eye"in _||"up"in _)&&y.lookAt(0,_.eye,_.center,_.up),y}}),9994:(function(e,t,r){"use strict";var o=r(9618),a=r(8277);e.exports=function(n,s){for(var h=[],c=n,m=1;Array.isArray(c);)h.push(c.length),m*=c.length,c=c[0];return h.length===0?o():(s||(s=o(new Float64Array(m),h)),a(s,n),s)}})},x={};function A(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,A),r.loaded=!0,r.exports}(function(){A.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){A.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}})();var E=A(1964);V.exports=E})()}}),y3=We({"node_modules/color-name/index.js"(Z,V){"use strict";V.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),DC=We({"node_modules/color-normalize/node_modules/color-parse/index.js"(Z,V){"use strict";var d=y3();V.exports=A;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),d[E])t=d[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var a=E.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],h=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(p,T){if(/%$/.test(p))return T===i?parseFloat(p)/100:a==="rgb"?parseFloat(p)*255/100:parseFloat(p);if(a[T]==="h"){if(/deg$/.test(p))return parseFloat(p);if(x[p]!==void 0)return x[p]}return parseFloat(p)}),s===a&&t.push(1),r=h||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),zC=We({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Z,V){"use strict";var d=DC();V.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t,r,o=d(E);if(!o.space)return[];var a=[0,0,0],i=o.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(o.values[0],a[0]),i[0]),e[1]=Math.min(Math.max(o.values[1],a[1]),i[1]),e[2]=Math.min(Math.max(o.values[2],a[2]),i[2]),o.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(o.alpha,0),1)),e};function x(A){var E=A[0]/360,e=A[1]/100,t=A[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=E+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),Ag=We({"node_modules/clamp/index.js"(Z,V){V.exports=d;function d(x,A,E){return AE?E:x:xA?A:x}}}),x_=We({"node_modules/dtype/index.js"(Z,V){V.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Ud=We({"node_modules/color-normalize/index.js"(Z,V){"use strict";var d=zC(),x=Ag(),A=x_();V.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=A(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),Jv=We({"src/lib/str2rgbarray.js"(Z,V){"use strict";var d=Ud();function x(A){return A?d(A):[0,0,0,1]}V.exports=x}}),$v=We({"src/lib/gl_format_color.js"(Z,V){"use strict";var d=Uo(),x=Af(),A=Ud(),E=xu(),e=nf().defaultLine,t=rh().isArrayOrTypedArray,r=A(e),o=1;function a(c,m){var p=c;return p[3]*=m,p}function i(c){if(d(c))return r;var m=A(c);return m.length?m:r}function n(c){return d(c)?c:o}function s(c,m,p){var T=c.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),_=t(m),w=E.extractOpts(c),S=[],M,y,b,v,u;if(w.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(c):M=i,l?y=function(f,P){return f[P]===void 0?r:A(M(f[P]))}:y=i,_?b=function(f,P){return f[P]===void 0?o:n(f[P])}:b=n,l||_)for(var g=0;g0){var p=o.c2l(c);o._lowerLogErrorBound||(o._lowerLogErrorBound=p),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,p)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function A(e){for(var t=0;t-1?-1:P.indexOf("right")>-1?1:0}function w(P){return P==null?0:P.indexOf("top")>-1?-1:P.indexOf("bottom")>-1?1:0}function S(P){var L=0,z=0,F=[L,z];if(Array.isArray(P))for(var B=0;B=0){var W=T(N.position,N.delaunayColor,N.delaunayAxis);W.opacity=P.opacity,this.delaunayMesh?this.delaunayMesh.update(W):(W.gl=L,this.delaunayMesh=E(W),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},p.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function f(P,L){var z=new m(P,L.uid);return z.update(L),z}V.exports=f}}),x3=We({"src/traces/scatter3d/attributes.js"(Z,V){"use strict";var d=vc(),x=_u(),A=Zl(),E=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=wl(),o=El(),a=_3(),i=b_(),n=Fo().extendFlat,s=Iu().overrideAll,h=Ad(),c=d.line,m=d.marker,p=m.line,T=n({width:c.width,dash:{valType:"enumerated",values:h(a),dflt:"solid"}},A("line"));function l(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var _=V.exports=s({x:d.x,y:d.y,z:{valType:"data_array"},text:n({},d.text,{}),texttemplate:t(),texttemplatefallback:r({editType:"calc"}),hovertext:n({},d.hovertext,{}),hovertemplate:e(),hovertemplatefallback:r(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:n({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l("x"),y:l("y"),z:l("z")},connectgaps:d.connectgaps,line:T,marker:n({symbol:{valType:"enumerated",values:h(i),dflt:"circle",arrayOk:!0},size:n({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:n({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:n({width:n({},p.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:n({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:o.opacity,hoverinfo:n({},o.hoverinfo)},"calc","nested");_.x.editType=_.y.editType=_.z.editType="calc+clearAxisTypes"}}),BC=We({"src/traces/scatter3d/defaults.js"(Z,V){"use strict";var d=Wi(),x=aa(),A=au(),E=Oh(),e=Gh(),t=Hh(),r=x3();V.exports=function(i,n,s,h){function c(M,y){return x.coerce(i,n,r,M,y)}var m=o(i,n,c,h);if(!m){n.visible=!1;return}c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),c("mode"),A.hasMarkers(n)&&E(i,n,s,h,c,{noSelect:!0,noAngle:!0}),A.hasLines(n)&&(c("connectgaps"),e(i,n,s,h,c)),A.hasText(n)&&(c("texttemplate"),c("texttemplatefallback"),t(i,n,h,c,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var p=(n.line||{}).color,T=(n.marker||{}).color;c("surfaceaxis")>=0&&c("surfacecolor",p||T);for(var l=["x","y","z"],_=0;_<3;++_){var w="projection."+l[_];c(w+".show")&&(c(w+".opacity"),c(w+".scale"))}var S=d.getComponentMethod("errorbars","supplyDefaults");S(i,n,p||T||s,{axis:"z"}),S(i,n,p||T||s,{axis:"y",inherit:"z"}),S(i,n,p||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var h=0,c=n("x"),m=n("y"),p=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),c&&m&&p&&(h=Math.min(c.length,m.length,p.length),i._length=i._xlength=i._ylength=i._zlength=h),h}}}),NC=We({"src/traces/scatter3d/calc.js"(Z,V){"use strict";var d=kv(),x=Wh();V.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(E,e),t}}}),UC=We({"node_modules/get-canvas-context/index.js"(Z,V){V.exports=d;function d(x,A){if(typeof x!="string")throw new TypeError("must specify type string");if(A=A||{},typeof document>"u"&&!A.canvas)return null;var E=A.canvas||document.createElement("canvas");typeof A.width=="number"&&(E.width=A.width),typeof A.height=="number"&&(E.height=A.height);var e=A,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));n[s]=p,h.tickmode=c}}o.ticks=n;for(var s=0;s<3;++s){E[s]=.5*(r.glplot.bounds[0][s]+r.glplot.bounds[1][s]);for(var T=0;T<2;++T)o.bounds[T][s]=r.glplot.bounds[T][s]}r.contourLevels=e(n)}}}),HC=We({"src/plots/gl3d/scene.js"(Z,V){"use strict";var d=Uf().gl_plot3d,x=d.createCamera,A=d.createScene,E=jC(),e=jy(),t=Wi(),r=aa(),o=r.preserveDrawingBuffer(),a=Mo(),i=hc(),n=Jv(),s=b3(),h=Bb(),c=VC(),m=qC(),p=GC(),T=ov().applyAutorangeOptions,l,_,w=!1;function S(z,F){var B=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.style.position="absolute",I.style.top=I.style.left="0px",I.style.width=I.style.height="100%",I.style["z-index"]=20,I.style["pointer-events"]="none",B.appendChild(I),this.svgContainer=I,B.id=z.id,B.style.position="absolute",B.style.top=B.style.left="0px",B.style.width=B.style.height="100%",O.appendChild(B),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=c(F,F[this.id]),this.spikeOptions=m(F[this.id]),this.container=B,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=S.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!_&&(l=document.createElement("canvas"),_=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!_))throw new Error("error creating static canvas/context for image server");F.gl=_,F.canvas=l}return F};var y=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!y||o)B=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return y=!1,B},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,B=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:B,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var B=z.graphDiv,O=B.layout,I=function(){var U={};return z.isCameraChanged(O)&&(U[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(U[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=U[z.id+".aspectmode"]="manual")),U},N=function(U){if(U.fullSceneLayout.dragmode!==!1){var W=I();U.saveLayout(O),U.graphDiv.emit("plotly_relayout",W)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){N(z)}),z.glplot.canvas.addEventListener("touchstart",function(){w=!0}),z.glplot.canvas.addEventListener("wheel",function(U){if(B._context._scrollZoom.gl3d){if(z.camera._ortho){var W=U.deltaX>U.deltaY?1.1:.9090909090909091,Q=z.glplot.getAspectratio();z.glplot.setAspectratio({x:W*Q.x,y:W*Q.y,z:W*Q.z})}N(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var U=I();z.graphDiv.emit("plotly_relayouting",U)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(U){B&&B.emit&&B.emit("plotly_webglcontextlost",{event:U,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,B,O=z.svgContainer,I=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var N=F._fullLayout._invScaleX,U=F._fullLayout._invScaleY,W=I.width*N,Q=I.height*U;O.setAttributeNS(null,"viewBox","0 0 "+W+" "+Q),O.setAttributeNS(null,"width",W),O.setAttributeNS(null,"height",Q),p(z),z.glplot.axes.update(z.axesOptions);for(var le=Object.keys(z.traces),se=null,he=z.glplot.selection,q=0;q")):B.type==="isosurface"||B.type==="volume"?(ne.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(he.traceCoordinate[3]),B.valuehoverformat),_e.push("value: "+ne.valueLabel),he.textLabel&&_e.push(he.textLabel),ue=_e.join("
")):ue=he.textLabel;var Te={x:he.traceCoordinate[0],y:he.traceCoordinate[1],z:he.traceCoordinate[2],data:X._input,fullData:X,curveNumber:X.index,pointNumber:oe};i.appendArrayPointValue(Te,X,oe),B._module.eventData&&(Te=X._module.eventData(Te,he,X,{},oe));var Ie={points:[Te]};if(z.fullSceneLayout.hovermode){var De=[];i.loneHover({trace:X,x:(.5+.5*J[0]/J[3])*W,y:(.5-.5*J[1]/J[3])*Q,xLabel:ne.xLabel,yLabel:ne.yLabel,zLabel:ne.zLabel,text:ue,name:se.name,color:i.castHoverOption(X,oe,"bgcolor")||se.color,borderColor:i.castHoverOption(X,oe,"bordercolor"),fontFamily:i.castHoverOption(X,oe,"font.family"),fontSize:i.castHoverOption(X,oe,"font.size"),fontColor:i.castHoverOption(X,oe,"font.color"),nameLength:i.castHoverOption(X,oe,"namelength"),textAlign:i.castHoverOption(X,oe,"align"),hovertemplate:r.castOption(X,oe,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Te,ne),eventData:[Te]},{container:O,gd:F,inOut_bbox:De}),Te.bbox=De[0]}he.distance<5&&(he.buttons||w)?F.emit("plotly_click",Ie):F.emit("plotly_hover",Ie),this.oldEventData=Ie}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var b=["xaxis","yaxis","zaxis"];function v(z,F,B){for(var O=z.fullSceneLayout,I=0;I<3;I++){var N=b[I],U=N.charAt(0),W=O[N],Q=F[U],le=F[U+"calendar"],se=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][I]=Math.min(B[0][I],0),B[1][I]=Math.max(B[1][I],se-1);else for(var he,q=0;q<(se||Q.length);q++)if(r.isArrayOrTypedArray(Q[q]))for(var $=0;$X[1][U])X[0][U]=-1,X[1][U]=1;else{var et=X[1][U]-X[0][U];X[0][U]-=et/32,X[1][U]+=et/32}if(j=[X[0][U],X[1][U]],j=T(j,Q),X[0][U]=j[0],X[1][U]=j[1],Q.isReversed()){var rt=X[0][U];X[0][U]=X[1][U],X[1][U]=rt}}else j=Q.range,X[0][U]=Q.r2l(j[0]),X[1][U]=Q.r2l(j[1]);X[0][U]===X[1][U]&&(X[0][U]-=1,X[1][U]+=1),oe[U]=X[1][U]-X[0][U],Q.range=[X[0][U],X[1][U]],Q.limitRange(),O.glplot.setBounds(U,{min:Q.range[0]*$[U],max:Q.range[1]*$[U]})}var $e,ot=se.aspectmode;if(ot==="cube")$e=[1,1,1];else if(ot==="manual"){var Ae=se.aspectratio;$e=[Ae.x,Ae.y,Ae.z]}else if(ot==="auto"||ot==="data"){var ge=[1,1,1];for(U=0;U<3;++U){Q=se[b[U]],le=Q.type;var ce=ne[le];ge[U]=Math.pow(ce.acc,1/ce.count)/$[U]}ot==="data"||Math.max.apply(null,ge)/Math.min.apply(null,ge)<=4?$e=ge:$e=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");se.aspectratio.x=he.aspectratio.x=$e[0],se.aspectratio.y=he.aspectratio.y=$e[1],se.aspectratio.z=he.aspectratio.z=$e[2],O.glplot.setAspectratio(se.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:se.aspectratio.x,y:se.aspectratio.y,z:se.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=se.aspectmode);var ze=se.domain||null,Qe=F._size||null;if(ze&&Qe){var nt=O.container.style;nt.position="absolute",nt.left=Qe.l+ze.x[0]*Qe.w+"px",nt.top=Qe.t+(1-ze.y[1])*Qe.h+"px",nt.width=Qe.w*(ze.x[1]-ze.x[0])+"px",nt.height=Qe.h*(ze.y[1]-ze.y[0])+"px"}O.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function g(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function f(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),f(z.camera)},M.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,g(B)),F.glplot.setAspectratio(z.aspectratio);var O=B.projection.type==="orthographic",I=F.camera._ortho;O!==I&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,B=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),I=O.get();function N(le,se,he,q){var $=["up","center","eye"],J=["x","y","z"];return se[$[he]]&&le[$[he]][J[q]]===se[$[he]][J[q]]}var U=!1;if(I===void 0)U=!0;else{for(var W=0;W<3;W++)for(var Q=0;Q<3;Q++)if(!N(B,I,W,Q)){U=!0;break}(!I.projection||B.projection&&B.projection.type!==I.projection.type)&&(U=!0)}return U},M.isAspectChanged=function(z){var F=this,B=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),I=O.get();return I===void 0||I.x!==B.x||I.y!==B.y||I.z!==B.z},M.saveLayout=function(z){var F=this,B=F.fullLayout,O,I,N,U,W,Q,le=F.isCameraChanged(z),se=F.isAspectChanged(z),he=le||se;if(he){var q={};if(le&&(O=F.getCamera(),I=r.nestedProperty(z,F.id+".camera"),N=I.get(),q[F.id+".camera"]=N),se&&(U=F.glplot.getAspectratio(),W=r.nestedProperty(z,F.id+".aspectratio"),Q=W.get(),q[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,q),le){I.set(O);var $=r.nestedProperty(B,F.id+".camera");$.set(O)}if(se){W.set(U);var J=r.nestedProperty(B,F.id+".aspectratio");J.set(U),F.glplot.redraw()}}return he},M.updateFx=function(z,F){var B=this,O=B.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var I=B.graphDiv,N=I._fullLayout,U=B.fullSceneLayout.camera,W=U.up.x,Q=U.up.y,le=U.up.z;if(le/Math.sqrt(W*W+Q*Q+le*le)<.999){var se=B.id+".camera.up",he={x:0,y:0,z:1},q={};q[se]=he;var $=I.layout;t.call("_storeDirectGUIEdit",$,N._preGUI,q),U.up=he,r.nestedProperty($,se).set(he)}}else O.keyBindingMode=z;B.fullSceneLayout.hovermode=F};function P(z,F,B){for(var O=0,I=B-1;O0)for(var W=255/U,Q=0;Q<3;++Q)z[N+Q]=Math.min(W*z[N+Q],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var B=F.glplot.gl,O=B.drawingBufferWidth,I=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var N=new Uint8Array(O*I*4);B.readPixels(0,0,O,I,B.RGBA,B.UNSIGNED_BYTE,N),P(N,O,I),L(N,O,I);var U=document.createElement("canvas");U.width=O,U.height=I;var W=U.getContext("2d",{willReadFrequently:!0}),Q=W.createImageData(O,I);Q.data.set(N),W.putImageData(Q,0,0);var le;switch(z){case"jpeg":le=U.toDataURL("image/jpeg");break;case"webp":le=U.toDataURL("image/webp");break;default:le=U.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),le},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var B=z.fullSceneLayout[b[F]];a.setConvert(B,z.fullLayout),B.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,B=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,B)},V.exports=S}}),WC=We({"src/plots/gl3d/layout/attributes.js"(Z,V){"use strict";V.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),w3=We({"src/plots/gl3d/layout/axis_attributes.js"(Z,V){"use strict";var d=Fi(),x=Of(),A=Fo().extendFlat,E=Iu().overrideAll;V.exports=E({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:A({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:A({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:A({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),T3=We({"src/plots/gl3d/layout/layout_attributes.js"(Z,V){"use strict";var d=w3(),x=Uu().attributes,A=Fo().extendFlat,E=aa().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}V.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:A(e(0,0,1),{}),center:A(e(0,0,0),{}),eye:A(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:d,yaxis:d,zaxis:d,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),XC=We({"src/plots/gl3d/layout/axis_defaults.js"(Z,V){"use strict";var d=Af().mix,x=aa(),A=sl(),E=w3(),e=Fb(),t=Gm(),r=["xaxis","yaxis","zaxis"],o=13600/187;V.exports=function(i,n,s){var h,c;function m(l,_){return x.coerce(h,c,E,l,_)}for(var p=0;p1;function m(p){if(!c){var T=d.validate(n[p],t[p]);if(T)return n[p]}}E(n,s,h,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:m,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,h){for(var c=s("bgcolor"),m=x.combine(c,h.paper_bgcolor),p=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",h.getDfltFromLayout("hovermode"))}}}),jd=We({"src/plots/gl3d/index.js"(Z){"use strict";var V=Iu().overrideAll,d=bd(),x=HC(),A=Ff().getSubplotData,E=aa(),e=Fh(),t="gl3d",r="scene";Z.name=t,Z.attr=r,Z.idRoot=r,Z.idRegex=Z.attrRegex=E.counterRegex("scene"),Z.attributes=WC(),Z.layoutAttributes=T3(),Z.baseLayoutAttrOverrides=V({hoverlabel:d.hoverlabel},"plot","nested"),Z.supplyLayoutDefaults=ZC(),Z.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],h=0;h0){P=h[L];break}return P}function T(g,f){if(!(g<1||f<1)){for(var P=m(g),L=m(f),z=1,F=0;FS;)L--,L/=p(L),L++,L1?z:1};function M(g,f,P){var L=P[8]+P[2]*f[0]+P[5]*f[1];return g[0]=(P[6]+P[0]*f[0]+P[3]*f[1])/L,g[1]=(P[7]+P[1]*f[0]+P[4]*f[1])/L,g}function y(g,f,P){return b(g,f,M,P),g}function b(g,f,P,L){for(var z=[0,0],F=g.shape[0],B=g.shape[1],O=0;O0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(f[L]=!0,z=this.contourStart[L];zQ&&(this.minValues[N]=Q),this.maxValues[N]h&&(o.isomin=null,o.isomax=null);var c=n("x"),m=n("y"),p=n("z"),T=n("value");if(!c||!c.length||!m||!m.length||!p||!p.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(M){n(M+"hoverformat");var y="caps."+M,b=n(y+".show");b&&n(y+".fill");var v="slices."+M,u=n(v+".show");u&&(n(v+".fill"),n(v+".locations"))});var _=n("spaceframe.show");_&&n("spaceframe.fill");var w=n("surface.show");w&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var S=n("contour.show");S&&(n("contour.color"),n("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(M){n(M)}),E(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}V.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),T_=We({"src/traces/streamtube/calc.js"(Z,V){"use strict";var d=aa(),x=nh();function A(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=E(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,h;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),h=t(o.starts.z||[]),i=Math.min(n.length,s.length,h.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=h||[];var c=0,m=1/0,p;for(p=0;p1&&(u=o[n-1],f=a[n-1],L=i[n-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(g>f?"-":"+")+"y"),S=S.replace("z",(P>L?"-":"+")+"z");var O=function(){n=0,z=[],F=[],B=[]};(!n||n0;m--){var p=Math.min(c[m],c[m-1]),T=Math.max(c[m],c[m-1]);if(T>p&&p-1}function ee(yt,Oe){return yt===null?Oe:yt}function re(yt,Oe,Xe){le();var be=[Oe],Ce=[Xe];if(X>=1)be=[Oe],Ce=[Xe];else if(X>0){var Ne=ne(Oe,Xe);be=Ne.xyzv,Ce=Ne.abc}for(var Ee=0;Ee-1?Xe[Le]:Q(at,dt,gt);or>-1?Se[Le]=or:Se[Le]=he(at,dt,gt,ee(yt,Ct))}q(Se[0],Se[1],Se[2])}}function ue(yt,Oe,Xe){var be=function(Ce,Ne,Ee){re(yt,[Oe[Ce],Oe[Ne],Oe[Ee]],[Xe[Ce],Xe[Ne],Xe[Ee]])};be(0,1,2),be(2,3,0)}function _e(yt,Oe,Xe){var be=function(Ce,Ne,Ee){re(yt,[Oe[Ce],Oe[Ne],Oe[Ee]],[Xe[Ce],Xe[Ne],Xe[Ee]])};be(0,1,2),be(3,0,1),be(2,3,0),be(1,2,3)}function Te(yt,Oe,Xe,be){var Ce=yt[3];Cebe&&(Ce=be);for(var Ne=(yt[3]-Ce)/(yt[3]-Oe[3]+1e-9),Ee=[],Se=0;Se<4;Se++)Ee[Se]=(1-Ne)*yt[Se]+Ne*Oe[Se];return Ee}function Ie(yt,Oe,Xe){return yt>=Oe&&yt<=Xe}function De(yt){var Oe=.001*(O-B);return yt>=B-Oe&&yt<=O+Oe}function He(yt){for(var Oe=[],Xe=0;Xe<4;Xe++){var be=yt[Xe];Oe.push([h._x[be],h._y[be],h._z[be],h._value[be]])}return Oe}var et=3;function rt(yt,Oe,Xe,be,Ce,Ne){Ne||(Ne=1),Xe=[-1,-1,-1];var Ee=!1,Se=[Ie(Oe[0][3],be,Ce),Ie(Oe[1][3],be,Ce),Ie(Oe[2][3],be,Ce)];if(!Se[0]&&!Se[1]&&!Se[2])return!1;var Le=function(dt,gt,Ct){return De(gt[0][3])&&De(gt[1][3])&&De(gt[2][3])?(re(dt,gt,Ct),!0):NeSe?[z,Ne]:[Ne,F];Bt(Oe,Le[0],Le[1])}}var at=[[Math.min(B,F),Math.max(B,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(dt){for(var gt=[],Ct=0;Ct0&&(Ea.push(Na.id),dt==="x"?Sa.push([Na.distRatio,0,0]):dt==="y"?Sa.push([0,Na.distRatio,0]):Sa.push([0,0,Na.distRatio]))}else dt==="x"?oa=Or(1,u-1):dt==="y"?oa=Or(1,g-1):oa=Or(1,f-1);Ea.length>0&&(dt==="x"?gt[or]=jt(yt,Ea,Qt,Jt,Sa,gt[or]):dt==="y"?gt[or]=_r(yt,Ea,Qt,Jt,Sa,gt[or]):gt[or]=pr(yt,Ea,Qt,Jt,Sa,gt[or]),or++),oa.length>0&&(dt==="x"?gt[or]=Qe(yt,oa,Qt,Jt,gt[or]):dt==="y"?gt[or]=nt(yt,oa,Qt,Jt,gt[or]):gt[or]=Ke(yt,oa,Qt,Jt,gt[or]),or++)}var Ta=h.caps[dt];Ta.show&&Ta.fill&&(oe(Ta.fill),dt==="x"?gt[or]=Qe(yt,[0,u-1],Qt,Jt,gt[or]):dt==="y"?gt[or]=nt(yt,[0,g-1],Qt,Jt,gt[or]):gt[or]=Ke(yt,[0,f-1],Qt,Jt,gt[or]),or++)}}),w===0&&se(),h._meshX=I,h._meshY=N,h._meshZ=U,h._meshIntensity=W,h._Xs=y,h._Ys=b,h._Zs=v}return Er(),h}function s(h,c){var m=h.glplot.gl,p=d({gl:m}),T=new o(h,p,c.uid);return p._trace=T,T.update(c),h.glplot.add(p),T}V.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),tL=We({"src/traces/isosurface/index.js"(Z,V){"use strict";V.exports={attributes:w_(),supplyDefaults:S3().supplyDefaults,calc:M3(),colorbar:{min:"cmin",max:"cmax"},plot:A_().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:jd(),categories:["gl3d","showLegend"],meta:{}}}}),rL=We({"lib/isosurface.js"(Z,V){"use strict";V.exports=tL()}}),E3=We({"src/traces/volume/attributes.js"(Z,V){"use strict";var d=Zl(),x=w_(),A=Sg(),E=El(),e=Fo().extendFlat,t=Iu().overrideAll,r=V.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate,hovertemplatefallback:x.hovertemplatefallback},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:A.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),aL=We({"src/traces/volume/defaults.js"(Z,V){"use strict";var d=aa(),x=E3(),A=S3().supplyIsoDefaults,E=A3().opacityscaleDefaults;V.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}A(t,r,o,a,i),E(t,r,a,i)}}}),nL=We({"src/traces/volume/convert.js"(Z,V){"use strict";var d=Uf().gl_mesh3d,x=$v().parseColorScale,A=aa().isArrayOrTypedArray,E=Jv(),e=xu().extractOpts,t=em(),r=A_().findNearestOnAxis,o=A_().generateIsoMeshes;function a(s,h,c){this.scene=s,this.uid=c,this.mesh=h,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var h=s.data.index,c=this.data._meshX[h],m=this.data._meshY[h],p=this.data._meshZ[h],T=this.data._Ys.length,l=this.data._Zs.length,_=r(c,this.data._Xs).id,w=r(m,this.data._Ys).id,S=r(p,this.data._Zs).id,M=s.index=S+l*w+l*T*_;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var y=this.data.hovertext||this.data.text;return A(y)&&y[M]!==void 0?s.textLabel=y[M]:y&&(s.textLabel=y),!0}},i.update=function(s){var h=this.scene,c=h.fullSceneLayout;this.data=o(s);function m(w,S,M,y){return S.map(function(b){return w.d2l(b,0,y)*M})}var p=t(m(c.xaxis,s._meshX,h.dataScale[0],s.xcalendar),m(c.yaxis,s._meshY,h.dataScale[1],s.ycalendar),m(c.zaxis,s._meshZ,h.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:p,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},_=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[_.min,_.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,h){var c=s.glplot.gl,m=d({gl:c}),p=new a(s,m,h.uid);return m._trace=p,p.update(h),s.glplot.add(m),p}V.exports=n}}),iL=We({"src/traces/volume/index.js"(Z,V){"use strict";V.exports={attributes:E3(),supplyDefaults:aL(),calc:M3(),colorbar:{min:"cmin",max:"cmax"},plot:nL(),moduleType:"trace",name:"volume",basePlotModule:jd(),categories:["gl3d","showLegend"],meta:{}}}}),oL=We({"lib/volume.js"(Z,V){"use strict";V.exports=iL()}}),sL=We({"src/traces/mesh3d/defaults.js"(Z,V){"use strict";var d=Wi(),x=aa(),A=yf(),E=Q0();V.exports=function(t,r,o,a){function i(m,p){return x.coerce(t,r,E,m,p)}function n(m){var p=m.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return p.every(function(T){return T&&T.length===p[0].length})&&p}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var h=d.getComponentMethod("calendars","handleTraceDefaults");h(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(m){i(m)});var c=i("contour.show");c&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),A(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),lL=We({"src/traces/mesh3d/calc.js"(Z,V){"use strict";var d=nh();V.exports=function(A,E){E.intensity&&d(A,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),uL=We({"src/traces/mesh3d/convert.js"(Z,V){"use strict";var d=Uf().gl_mesh3d,x=Uf().delaunay_triangulate,A=Uf().alpha_shape,E=Uf().convex_hull,e=$v().parseColorScale,t=aa().isArrayOrTypedArray,r=Jv(),o=xu().extractOpts,a=em();function i(l,_,w){this.scene=l,this.uid=w,this.mesh=_,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var _=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[_],this.data.y[_],this.data.z[_]];var w=this.data.hovertext||this.data.text;return t(w)&&w[_]!==void 0?l.textLabel=w[_]:w&&(l.textLabel=w),!0}};function s(l){for(var _=[],w=l.length,S=0;S=_-.5)return!1;return!0}n.update=function(l){var _=this.scene,w=_.fullSceneLayout;this.data=l;var S=l.x.length,M=a(h(w.xaxis,l.x,_.dataScale[0],l.xcalendar),h(w.yaxis,l.y,_.dataScale[1],l.ycalendar),h(w.zaxis,l.z,_.dataScale[2],l.zcalendar)),y;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!p(l.i,S)||!p(l.j,S)||!p(l.k,S))return;y=a(c(l.i),c(l.j),c(l.k))}else l.alphahull===0?y=E(M):l.alphahull>0?y=A(l.alphahull,M):y=m(l.delaunayaxis,M);var b={positions:M,cells:y,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var v=o(l);this.color="#fff";var u=l.intensitymode;b[u+"Intensity"]=l.intensity,b[u+"IntensityBounds"]=[v.min,v.max],b.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],b.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],b.cellColors=s(l.facecolor)):(this.color=l.color,b.meshColor=r(l.color));this.mesh.update(b)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,_){var w=l.glplot.gl,S=d({gl:w}),M=new i(l,S,_.uid);return S._trace=M,M.update(_),l.glplot.add(S),M}V.exports=T}}),cL=We({"src/traces/mesh3d/index.js"(Z,V){"use strict";V.exports={attributes:Q0(),supplyDefaults:sL(),calc:lL(),colorbar:{min:"cmin",max:"cmax"},plot:uL(),moduleType:"trace",name:"mesh3d",basePlotModule:jd(),categories:["gl3d","showLegend"],meta:{}}}}),fL=We({"lib/mesh3d.js"(Z,V){"use strict";V.exports=cL()}}),k3=We({"src/traces/cone/attributes.js"(Z,V){"use strict";var d=Zl(),x=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:E}=wl(),e=Q0(),t=El(),r=Fo().extendFlat,o={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:E({editType:"calc"}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:r({},t.showlegend,{dflt:!1})};r(o,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var a=["opacity","lightposition","lighting"];a.forEach(function(i){o[i]=e[i]}),o.hoverinfo=r({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=o}}),hL=We({"src/traces/cone/defaults.js"(Z,V){"use strict";var d=aa(),x=yf(),A=k3();V.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,A,T,l)}var i=a("u"),n=a("v"),s=a("w"),h=a("x"),c=a("y"),m=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!h||!h.length||!c||!c.length||!m||!m.length){t.visible=!1;return}var p=a("sizemode");a("sizeref",p==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),vL=We({"src/traces/cone/calc.js"(Z,V){"use strict";var d=nh();V.exports=function(A,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?p=c.slice(1,m-1):m===2?p=[(c[0]+c[1])/2]:p=c,p}function n(c){var m=c.length;return m===1?[.5,.5]:[c[1]-c[0],c[m-1]-c[m-2]]}function s(c,m){var p=c.fullSceneLayout,T=c.dataScale,l=m._len,_={};function w(he,q){var $=p[q],J=T[r[q]];return A.simpleMap(he,function(X){return $.d2l(X)*J})}if(_.vectors=t(w(m._u,"xaxis"),w(m._v,"yaxis"),w(m._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=w(m._Xs,"xaxis"),M=w(m._Ys,"yaxis"),y=w(m._Zs,"zaxis");_.meshgrid=[S,M,y],_.gridFill=m._gridFill;var b=m._slen;if(b)_.startingPositions=t(w(m._startsX,"xaxis"),w(m._startsY,"yaxis"),w(m._startsZ,"zaxis"));else{for(var v=M[0],u=i(S),g=i(y),f=new Array(u.length*g.length),P=0,L=0;Lv&&(v=P[0]),P[1]u&&(u=P[1])}function f(P){switch(P.type){case"GeometryCollection":P.geometries.forEach(f);break;case"Point":g(P.coordinates);break;case"MultiPoint":P.coordinates.forEach(g);break}}w.arcs.forEach(function(P){for(var L=-1,z=P.length,F;++Lv&&(v=F[0]),F[1]u&&(u=F[1])});for(M in w.objects)f(w.objects[M]);return[y,b,v,u]}function e(w,S){for(var M,y=w.length,b=y-S;b<--y;)M=w[b],w[b++]=w[y],w[y]=M}function t(w,S){return typeof S=="string"&&(S=w.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(M){return r(w,M)})}:r(w,S)}function r(w,S){var M=S.id,y=S.bbox,b=S.properties==null?{}:S.properties,v=o(w,S);return M==null&&y==null?{type:"Feature",properties:b,geometry:v}:y==null?{type:"Feature",id:M,properties:b,geometry:v}:{type:"Feature",id:M,bbox:y,properties:b,geometry:v}}function o(w,S){var M=A(w.transform),y=w.arcs;function b(L,z){z.length&&z.pop();for(var F=y[L<0?~L:L],B=0,O=F.length;B1)y=s(w,S,M);else for(b=0,y=new Array(v=w.arcs.length);b1)for(var z=1,F=g(P[0]),B,O;zF&&(O=P[0],P[0]=P[z],P[z]=O,F=B);return P}).filter(function(f){return f.length>0})}}function p(w,S){for(var M=0,y=w.length;M>>1;w[b]=2))throw new Error("n must be \u22652");f=w.bbox||E(w);var M=f[0],y=f[1],b=f[2],v=f[3],u;S={scale:[b-M?(b-M)/(u-1):1,v-y?(v-y)/(u-1):1],translate:[M,y]}}else f=w.bbox;var g=l(S),f,P,L=w.objects,z={};function F(I){return g(I)}function B(I){var N;switch(I.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:I.geometries.map(B)};break;case"Point":N={type:"Point",coordinates:F(I.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:I.coordinates.map(F)};break;default:return I}return I.id!=null&&(N.id=I.id),I.bbox!=null&&(N.bbox=I.bbox),I.properties!=null&&(N.properties=I.properties),N}function O(I){var N=0,U=1,W=I.length,Q,le=new Array(W);for(le[0]=g(I[0],0);++N0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},Z.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Z.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),A=0;Ae(B,z)),F)}function r(L,z,F={}){for(let O of L){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let I=0;Ir(B,z)),F)}function a(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return A({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return n(L.map(B=>a(B,z)),F)}function n(L,z={}){let F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=L,F}function s(L,z,F={}){return A({type:"MultiLineString",coordinates:L},z,F)}function h(L,z,F={}){return A({type:"MultiPoint",coordinates:L},z,F)}function c(L,z,F={}){return A({type:"MultiPolygon",coordinates:L},z,F)}function m(L,z,F={}){return A({type:"GeometryCollection",geometries:L},z,F)}function p(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");let F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L/F}function _(L,z){return M(l(L,z))}function w(L){let z=L%360;return z<0&&(z+=360),z}function S(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function M(L){return L%(2*Math.PI)*180/Math.PI}function y(L){return L%360*Math.PI/180}function b(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function v(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");let B=x[z];if(!B)throw new Error("invalid original units");let O=x[F];if(!O)throw new Error("invalid final units");return L/B*O}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function g(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function f(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function P(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}Z.areaFactors=x,Z.azimuthToBearing=S,Z.bearingToAzimuth=w,Z.convertArea=v,Z.convertLength=b,Z.degreesToRadians=y,Z.earthRadius=V,Z.factors=d,Z.feature=A,Z.featureCollection=n,Z.geometry=E,Z.geometryCollection=m,Z.isNumber=u,Z.isObject=g,Z.lengthToDegrees=_,Z.lengthToRadians=l,Z.lineString=a,Z.lineStrings=i,Z.multiLineString=s,Z.multiPoint=h,Z.multiPolygon=c,Z.point=e,Z.points=t,Z.polygon=r,Z.polygons=o,Z.radiansToDegrees=M,Z.radiansToLength=T,Z.round=p,Z.validateBBox=f,Z.validateId=P}}),k_=We({"node_modules/@turf/meta/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var V=E_();function d(l,_,w){if(l!==null)for(var S,M,y,b,v,u,g,f=0,P=0,L,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,I=0;Iu||F>g||B>f){v=P,u=S,g=F,f=B,y=0;return}var O=V.lineString.call(void 0,[v,P],w.properties);if(_(O,S,M,B,y)===!1)return!1;y++,v=P})===!1)return!1}}})}function h(l,_,w){var S=w,M=!1;return s(l,function(y,b,v,u,g){M===!1&&w===void 0?S=y:S=_(S,y,b,v,u,g),M=!0}),S}function c(l,_){if(!l)throw new Error("geojson is required");i(l,function(w,S,M){if(w.geometry!==null){var y=w.geometry.type,b=w.geometry.coordinates;switch(y){case"LineString":if(_(w,S,M,0,0)===!1)return!1;break;case"Polygon":for(var v=0;vi+A(n),0)}function A(a){let i=0,n;switch(a.type){case"Polygon":return E(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],p=h[0]*t,T=c[1]*t,l=m[0]*t;n+=(l-p)*Math.sin(T),s++}return n*e}var o=x;Z.area=x,Z.default=o}}),SL=We({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var V=E_(),d=k_();function x(E,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,E,function(a){t+=a[0],r+=a[1],o++},!0),V.point.call(void 0,[t/o,r/o],e.properties)}var A=x;Z.centroid=x,Z.default=A}}),ML=We({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var V=k_();function d(A,E={}){if(A.bbox!=null&&E.recompute!==!0)return A.bbox;let e=[1/0,1/0,-1/0,-1/0];return V.coordEach.call(void 0,A,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(b==="RUS"||b==="FJI"?u=function(z){var F;if(L(z)===null)F=z;else for(F=new Array(z.length),P=0;PF?B[O++]=[z[P][0]+360,z[P][1]]:P===F?(B[O++]=z[P],B[O++]=[z[P][0],-90]):B[O++]=z[P];var I=i.tester(B);I.pts.pop(),v.push(I)}:u=function(z){v.push(i.tester(z))},M.type){case"MultiPolygon":for(g=0;g0?I.properties.ct=l(I):I.properties.ct=[NaN,NaN],B.fIn=z,B.fOut=I,v.push(I)}else r.log(["Location",B.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete b[F]}switch(y.type){case"FeatureCollection":var P=y.features;for(u=0;uv&&(v=f,y=g)}else y=M;return E(y).geometry.coordinates}function _(S){var M=window.PlotlyGeoAssets||{},y=[];function b(P){return new Promise(function(L,z){d.json(P,function(F,B){if(F){delete M[P];var O=F.status===404?'GeoJSON at URL "'+P+'" does not exist.':"Unexpected error while fetching from "+P;return z(new Error(O))}return M[P]=B,L(B)})})}function v(P){return new Promise(function(L,z){var F=0,B=setInterval(function(){if(M[P]&&M[P]!=="pending")return clearInterval(B),L(M[P]);if(F>100)return clearInterval(B),z("Unexpected error while fetching from "+P);F++},50)})}for(var u=0;u")}}}),kL=We({"src/traces/scattergeo/event_data.js"(Z,V){"use strict";V.exports=function(x,A,E,e,t){x.lon=A.lon,x.lat=A.lat,x.location=A.loc?A.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),CL=We({"src/traces/scattergeo/select.js"(Z,V){"use strict";var d=au(),x=bs().BADNUM;V.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,a=[],i=t[0].trace,n,s,h,c,m,p=!d.hasMarkers(i)&&!d.hasText(i);if(p)return[];if(e===!1)for(m=0;mX?1:J>=X?0:NaN}function A(J){return J.length===1&&(J=E(J)),{left:function(X,oe,ne,j){for(ne==null&&(ne=0),j==null&&(j=X.length);ne>>1;J(X[ee],oe)<0?ne=ee+1:j=ee}return ne},right:function(X,oe,ne,j){for(ne==null&&(ne=0),j==null&&(j=X.length);ne>>1;J(X[ee],oe)>0?j=ee:ne=ee+1}return ne}}}function E(J){return function(X,oe){return x(J(X),oe)}}var e=A(x),t=e.right,r=e.left;function o(J,X){X==null&&(X=a);for(var oe=0,ne=J.length-1,j=J[0],ee=new Array(ne<0?0:ne);oeJ?1:X>=J?0:NaN}function s(J){return J===null?NaN:+J}function h(J,X){var oe=J.length,ne=0,j=-1,ee=0,re,ue,_e=0;if(X==null)for(;++j1)return _e/(ne-1)}function c(J,X){var oe=h(J,X);return oe&&Math.sqrt(oe)}function m(J,X){var oe=J.length,ne=-1,j,ee,re;if(X==null){for(;++ne=j)for(ee=re=j;++nej&&(ee=j),re=j)for(ee=re=j;++nej&&(ee=j),re0)return[J];if((ne=X0)for(J=Math.ceil(J/ue),X=Math.floor(X/ue),re=new Array(ee=Math.ceil(X-J+1));++j=0?(ee>=M?10:ee>=y?5:ee>=b?2:1)*Math.pow(10,j):-Math.pow(10,-j)/(ee>=M?10:ee>=y?5:ee>=b?2:1)}function g(J,X,oe){var ne=Math.abs(X-J)/Math.max(0,oe),j=Math.pow(10,Math.floor(Math.log(ne)/Math.LN10)),ee=ne/j;return ee>=M?j*=10:ee>=y?j*=5:ee>=b&&(j*=2),XDe;)He.pop(),--et;var rt=new Array(et+1),$e;for(ee=0;ee<=et;++ee)$e=rt[ee]=[],$e.x0=ee>0?He[ee-1]:Ie,$e.x1=ee=1)return+oe(J[ne-1],ne-1,J);var ne,j=(ne-1)*X,ee=Math.floor(j),re=+oe(J[ee],ee,J),ue=+oe(J[ee+1],ee+1,J);return re+(ue-re)*(j-ee)}}function z(J,X,oe){return J=l.call(J,s).sort(x),Math.ceil((oe-X)/(2*(L(J,.75)-L(J,.25))*Math.pow(J.length,-1/3)))}function F(J,X,oe){return Math.ceil((oe-X)/(3.5*c(J)*Math.pow(J.length,-1/3)))}function B(J,X){var oe=J.length,ne=-1,j,ee;if(X==null){for(;++ne=j)for(ee=j;++neee&&(ee=j)}else for(;++ne=j)for(ee=j;++neee&&(ee=j);return ee}function O(J,X){var oe=J.length,ne=oe,j=-1,ee,re=0;if(X==null)for(;++j=0;)for(re=J[X],oe=re.length;--oe>=0;)ee[--j]=re[oe];return ee}function U(J,X){var oe=J.length,ne=-1,j,ee;if(X==null){for(;++ne=j)for(ee=j;++nej&&(ee=j)}else for(;++ne=j)for(ee=j;++nej&&(ee=j);return ee}function W(J,X){for(var oe=X.length,ne=new Array(oe);oe--;)ne[oe]=J[X[oe]];return ne}function Q(J,X){if(oe=J.length){var oe,ne=0,j=0,ee,re=J[j];for(X==null&&(X=x);++ne0?1:Yt<0?-1:0},v=Math.sqrt,u=Math.tan;function g(Yt){return Yt>1?0:Yt<-1?a:Math.acos(Yt)}function f(Yt){return Yt>1?i:Yt<-1?-i:Math.asin(Yt)}function P(Yt){return(Yt=y(Yt/2))*Yt}function L(){}function z(Yt,vr){Yt&&B.hasOwnProperty(Yt.type)&&B[Yt.type](Yt,vr)}var F={Feature:function(Yt,vr){z(Yt.geometry,vr)},FeatureCollection:function(Yt,vr){for(var Qr=Yt.features,Wr=-1,xa=Qr.length;++Wr=0?1:-1,xa=Wr*Qr,Qa=l(vr),xn=y(vr),zn=q*xn,Gn=he*Qa+zn*l(xa),ni=zn*Wr*y(xa);U.add(T(ni,Gn)),se=Yt,he=Qa,q=xn}function j(Yt){return W.reset(),N(Yt,$),W*2}function ee(Yt){return[T(Yt[1],Yt[0]),f(Yt[2])]}function re(Yt){var vr=Yt[0],Qr=Yt[1],Wr=l(Qr);return[Wr*l(vr),Wr*y(vr),y(Qr)]}function ue(Yt,vr){return Yt[0]*vr[0]+Yt[1]*vr[1]+Yt[2]*vr[2]}function _e(Yt,vr){return[Yt[1]*vr[2]-Yt[2]*vr[1],Yt[2]*vr[0]-Yt[0]*vr[2],Yt[0]*vr[1]-Yt[1]*vr[0]]}function Te(Yt,vr){Yt[0]+=vr[0],Yt[1]+=vr[1],Yt[2]+=vr[2]}function Ie(Yt,vr){return[Yt[0]*vr,Yt[1]*vr,Yt[2]*vr]}function De(Yt){var vr=v(Yt[0]*Yt[0]+Yt[1]*Yt[1]+Yt[2]*Yt[2]);Yt[0]/=vr,Yt[1]/=vr,Yt[2]/=vr}var He,et,rt,$e,ot,Ae,ge,ce,ze=A(),Qe,nt,Ke={point:kt,lineStart:Bt,lineEnd:jt,polygonStart:function(){Ke.point=_r,Ke.lineStart=pr,Ke.lineEnd=Or,ze.reset(),$.polygonStart()},polygonEnd:function(){$.polygonEnd(),Ke.point=kt,Ke.lineStart=Bt,Ke.lineEnd=jt,U<0?(He=-(rt=180),et=-($e=90)):ze>r?$e=90:ze<-r&&(et=-90),nt[0]=He,nt[1]=rt},sphere:function(){He=-(rt=180),et=-($e=90)}};function kt(Yt,vr){Qe.push(nt=[He=Yt,rt=Yt]),vr$e&&($e=vr)}function Et(Yt,vr){var Qr=re([Yt*c,vr*c]);if(ce){var Wr=_e(ce,Qr),xa=[Wr[1],-Wr[0],0],Qa=_e(xa,Wr);De(Qa),Qa=ee(Qa);var xn=Yt-ot,zn=xn>0?1:-1,Gn=Qa[0]*h*zn,ni,wn=m(xn)>180;wn^(zn*ot$e&&($e=ni)):(Gn=(Gn+360)%360-180,wn^(zn*ot$e&&($e=vr))),wn?Ytmr(He,rt)&&(rt=Yt):mr(Yt,rt)>mr(He,rt)&&(He=Yt):rt>=He?(Ytrt&&(rt=Yt)):Yt>ot?mr(He,Yt)>mr(He,rt)&&(rt=Yt):mr(Yt,rt)>mr(He,rt)&&(He=Yt)}else Qe.push(nt=[He=Yt,rt=Yt]);vr$e&&($e=vr),ce=Qr,ot=Yt}function Bt(){Ke.point=Et}function jt(){nt[0]=He,nt[1]=rt,Ke.point=kt,ce=null}function _r(Yt,vr){if(ce){var Qr=Yt-ot;ze.add(m(Qr)>180?Qr+(Qr>0?360:-360):Qr)}else Ae=Yt,ge=vr;$.point(Yt,vr),Et(Yt,vr)}function pr(){$.lineStart()}function Or(){_r(Ae,ge),$.lineEnd(),m(ze)>r&&(He=-(rt=180)),nt[0]=He,nt[1]=rt,ce=null}function mr(Yt,vr){return(vr-=Yt)<0?vr+360:vr}function Er(Yt,vr){return Yt[0]-vr[0]}function yt(Yt,vr){return Yt[0]<=Yt[1]?Yt[0]<=vr&&vr<=Yt[1]:vrmr(Wr[0],Wr[1])&&(Wr[1]=xa[1]),mr(xa[0],Wr[1])>mr(Wr[0],Wr[1])&&(Wr[0]=xa[0])):Qa.push(Wr=xa);for(xn=-1/0,Qr=Qa.length-1,vr=0,Wr=Qa[Qr];vr<=Qr;Wr=xa,++vr)xa=Qa[vr],(zn=mr(Wr[1],xa[0]))>xn&&(xn=zn,He=xa[0],rt=Wr[1])}return Qe=nt=null,He===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,et],[rt,$e]]}var Xe,be,Ce,Ne,Ee,Se,Le,at,dt,gt,Ct,or,Qt,Jt,Sr,oa,Ea={sphere:L,point:Sa,lineStart:Na,lineEnd:gn,polygonStart:function(){Ea.lineStart=Ht,Ea.lineEnd=It},polygonEnd:function(){Ea.lineStart=Na,Ea.lineEnd=gn}};function Sa(Yt,vr){Yt*=c,vr*=c;var Qr=l(vr);za(Qr*l(Yt),Qr*y(Yt),y(vr))}function za(Yt,vr,Qr){++Xe,Ce+=(Yt-Ce)/Xe,Ne+=(vr-Ne)/Xe,Ee+=(Qr-Ee)/Xe}function Na(){Ea.point=Ta}function Ta(Yt,vr){Yt*=c,vr*=c;var Qr=l(vr);Jt=Qr*l(Yt),Sr=Qr*y(Yt),oa=y(vr),Ea.point=nn,za(Jt,Sr,oa)}function nn(Yt,vr){Yt*=c,vr*=c;var Qr=l(vr),Wr=Qr*l(Yt),xa=Qr*y(Yt),Qa=y(vr),xn=T(v((xn=Sr*Qa-oa*xa)*xn+(xn=oa*Wr-Jt*Qa)*xn+(xn=Jt*xa-Sr*Wr)*xn),Jt*Wr+Sr*xa+oa*Qa);be+=xn,Se+=xn*(Jt+(Jt=Wr)),Le+=xn*(Sr+(Sr=xa)),at+=xn*(oa+(oa=Qa)),za(Jt,Sr,oa)}function gn(){Ea.point=Sa}function Ht(){Ea.point=Gt}function It(){Xt(or,Qt),Ea.point=Sa}function Gt(Yt,vr){or=Yt,Qt=vr,Yt*=c,vr*=c,Ea.point=Xt;var Qr=l(vr);Jt=Qr*l(Yt),Sr=Qr*y(Yt),oa=y(vr),za(Jt,Sr,oa)}function Xt(Yt,vr){Yt*=c,vr*=c;var Qr=l(vr),Wr=Qr*l(Yt),xa=Qr*y(Yt),Qa=y(vr),xn=Sr*Qa-oa*xa,zn=oa*Wr-Jt*Qa,Gn=Jt*xa-Sr*Wr,ni=v(xn*xn+zn*zn+Gn*Gn),wn=f(ni),Sn=ni&&-wn/ni;dt+=Sn*xn,gt+=Sn*zn,Ct+=Sn*Gn,be+=wn,Se+=wn*(Jt+(Jt=Wr)),Le+=wn*(Sr+(Sr=xa)),at+=wn*(oa+(oa=Qa)),za(Jt,Sr,oa)}function Rr(Yt){Xe=be=Ce=Ne=Ee=Se=Le=at=dt=gt=Ct=0,N(Yt,Ea);var vr=dt,Qr=gt,Wr=Ct,xa=vr*vr+Qr*Qr+Wr*Wr;return xaa?Yt+Math.round(-Yt/s)*s:Yt,vr]}ia.invert=ia;function Pa(Yt,vr,Qr){return(Yt%=s)?vr||Qr?Jr(ja(Yt),Xa(vr,Qr)):ja(Yt):vr||Qr?Xa(vr,Qr):ia}function Ga(Yt){return function(vr,Qr){return vr+=Yt,[vr>a?vr-s:vr<-a?vr+s:vr,Qr]}}function ja(Yt){var vr=Ga(Yt);return vr.invert=Ga(-Yt),vr}function Xa(Yt,vr){var Qr=l(Yt),Wr=y(Yt),xa=l(vr),Qa=y(vr);function xn(zn,Gn){var ni=l(Gn),wn=l(zn)*ni,Sn=y(zn)*ni,Ln=y(Gn),un=Ln*Qr+wn*Wr;return[T(Sn*xa-un*Qa,wn*Qr-Ln*Wr),f(un*xa+Sn*Qa)]}return xn.invert=function(zn,Gn){var ni=l(Gn),wn=l(zn)*ni,Sn=y(zn)*ni,Ln=y(Gn),un=Ln*xa-Sn*Qa;return[T(Sn*xa+Ln*Qa,wn*Qr+un*Wr),f(un*Qr-wn*Wr)]},xn}function sn(Yt){Yt=Pa(Yt[0]*c,Yt[1]*c,Yt.length>2?Yt[2]*c:0);function vr(Qr){return Qr=Yt(Qr[0]*c,Qr[1]*c),Qr[0]*=h,Qr[1]*=h,Qr}return vr.invert=function(Qr){return Qr=Yt.invert(Qr[0]*c,Qr[1]*c),Qr[0]*=h,Qr[1]*=h,Qr},vr}function Ma(Yt,vr,Qr,Wr,xa,Qa){if(Qr){var xn=l(vr),zn=y(vr),Gn=Wr*Qr;xa==null?(xa=vr+Wr*s,Qa=vr-Gn/2):(xa=Xn(xn,xa),Qa=Xn(xn,Qa),(Wr>0?xaQa)&&(xa+=Wr*s));for(var ni,wn=xa;Wr>0?wn>Qa:wn1&&Yt.push(Yt.pop().concat(Yt.shift()))},result:function(){var Qr=Yt;return Yt=[],vr=null,Qr}}}function lt(Yt,vr){return m(Yt[0]-vr[0])=0;--zn)xa.point((Sn=wn[zn])[0],Sn[1]);else Wr(Ln.x,Ln.p.x,-1,xa);Ln=Ln.p}Ln=Ln.o,wn=Ln.z,un=!un}while(!Ln.v);xa.lineEnd()}}}function Lr(Yt){if(vr=Yt.length){for(var vr,Qr=0,Wr=Yt[0],xa;++Qr=0?1:-1,ds=Ps*as,Cs=ds>a,es=Oi*no;if(Tr.add(T(es*Ps*y(ds),Vi*Ro+es*l(ds))),xn+=Cs?as+Ps*s:as,Cs^un>=Qr^vi>=Qr){var ul=_e(re(Ln),re(Yi));De(ul);var Ws=_e(Qa,ul);De(Ws);var Fs=(Cs^as>=0?-1:1)*f(Ws[2]);(Wr>Fs||Wr===Fs&&(ul[0]||ul[1]))&&(zn+=Cs^as>=0?1:-1)}}return(xn<-r||xn0){for(Gn||(xa.polygonStart(),Gn=!0),xa.lineStart(),Ro=0;Ro1&&Qn&2&&no.push(no.pop().concat(no.shift())),wn.push(no.filter(_t))}}return Ln}}function _t(Yt){return Yt.length>1}function Wt(Yt,vr){return((Yt=Yt.x)[0]<0?Yt[1]-i-r:i-Yt[1])-((vr=vr.x)[0]<0?vr[1]-i-r:i-vr[1])}var Ar=Nr(function(){return!0},Vr,ba,[-a,-i]);function Vr(Yt){var vr=NaN,Qr=NaN,Wr=NaN,xa;return{lineStart:function(){Yt.lineStart(),xa=1},point:function(Qa,xn){var zn=Qa>0?a:-a,Gn=m(Qa-vr);m(Gn-a)0?i:-i),Yt.point(Wr,Qr),Yt.lineEnd(),Yt.lineStart(),Yt.point(zn,Qr),Yt.point(Qa,Qr),xa=0):Wr!==zn&&Gn>=a&&(m(vr-Wr)r?p((y(vr)*(Qa=l(Wr))*y(Qr)-y(Wr)*(xa=l(vr))*y(Yt))/(xa*Qa*xn)):(vr+Wr)/2}function ba(Yt,vr,Qr,Wr){var xa;if(Yt==null)xa=Qr*i,Wr.point(-a,xa),Wr.point(0,xa),Wr.point(a,xa),Wr.point(a,0),Wr.point(a,-xa),Wr.point(0,-xa),Wr.point(-a,-xa),Wr.point(-a,0),Wr.point(-a,xa);else if(m(Yt[0]-vr[0])>r){var Qa=Yt[0]0,xa=m(vr)>r;function Qa(wn,Sn,Ln,un){Ma(un,Yt,Qr,Ln,wn,Sn)}function xn(wn,Sn){return l(wn)*l(Sn)>vr}function zn(wn){var Sn,Ln,un,mi,Oi;return{lineStart:function(){mi=un=!1,Oi=1},point:function(Vi,Bi){var Yi=[Vi,Bi],vi,Qn=xn(Vi,Bi),no=Wr?Qn?0:ni(Vi,Bi):Qn?ni(Vi+(Vi<0?a:-a),Bi):0;if(!Sn&&(mi=un=Qn)&&wn.lineStart(),Qn!==un&&(vi=Gn(Sn,Yi),(!vi||lt(Sn,vi)||lt(Yi,vi))&&(Yi[2]=1)),Qn!==un)Oi=0,Qn?(wn.lineStart(),vi=Gn(Yi,Sn),wn.point(vi[0],vi[1])):(vi=Gn(Sn,Yi),wn.point(vi[0],vi[1],2),wn.lineEnd()),Sn=vi;else if(xa&&Sn&&Wr^Qn){var Ro;!(no&Ln)&&(Ro=Gn(Yi,Sn,!0))&&(Oi=0,Wr?(wn.lineStart(),wn.point(Ro[0][0],Ro[0][1]),wn.point(Ro[1][0],Ro[1][1]),wn.lineEnd()):(wn.point(Ro[1][0],Ro[1][1]),wn.lineEnd(),wn.lineStart(),wn.point(Ro[0][0],Ro[0][1],3)))}Qn&&(!Sn||!lt(Sn,Yi))&&wn.point(Yi[0],Yi[1]),Sn=Yi,un=Qn,Ln=no},lineEnd:function(){un&&wn.lineEnd(),Sn=null},clean:function(){return Oi|(mi&&un)<<1}}}function Gn(wn,Sn,Ln){var un=re(wn),mi=re(Sn),Oi=[1,0,0],Vi=_e(un,mi),Bi=ue(Vi,Vi),Yi=Vi[0],vi=Bi-Yi*Yi;if(!vi)return!Ln&&wn;var Qn=vr*Bi/vi,no=-vr*Yi/vi,Ro=_e(Oi,Vi),as=Ie(Oi,Qn),Ps=Ie(Vi,no);Te(as,Ps);var ds=Ro,Cs=ue(as,ds),es=ue(ds,ds),ul=Cs*Cs-es*(ue(as,as)-1);if(!(ul<0)){var Ws=v(ul),Fs=Ie(ds,(-Cs-Ws)/es);if(Te(Fs,as),Fs=ee(Fs),!Ln)return Fs;var Mi=wn[0],yo=Sn[0],Ss=wn[1],us=Sn[1],Pl;yo0^Fs[1]<(m(Fs[0]-Mi)a^(Mi<=Fs[0]&&Fs[0]<=yo)){var Vl=Ie(ds,(-Cs+Ws)/es);return Te(Vl,as),[Fs,ee(Vl)]}}}function ni(wn,Sn){var Ln=Wr?Yt:a-Yt,un=0;return wn<-Ln?un|=1:wn>Ln&&(un|=2),Sn<-Ln?un|=4:Sn>Ln&&(un|=8),un}return Nr(xn,zn,Qa,Wr?[0,-Yt]:[-a,Yt-a])}function $r(Yt,vr,Qr,Wr,xa,Qa){var xn=Yt[0],zn=Yt[1],Gn=vr[0],ni=vr[1],wn=0,Sn=1,Ln=Gn-xn,un=ni-zn,mi;if(mi=Qr-xn,!(!Ln&&mi>0)){if(mi/=Ln,Ln<0){if(mi0){if(mi>Sn)return;mi>wn&&(wn=mi)}if(mi=xa-xn,!(!Ln&&mi<0)){if(mi/=Ln,Ln<0){if(mi>Sn)return;mi>wn&&(wn=mi)}else if(Ln>0){if(mi0)){if(mi/=un,un<0){if(mi0){if(mi>Sn)return;mi>wn&&(wn=mi)}if(mi=Qa-zn,!(!un&&mi<0)){if(mi/=un,un<0){if(mi>Sn)return;mi>wn&&(wn=mi)}else if(un>0){if(mi0&&(Yt[0]=xn+wn*Ln,Yt[1]=zn+wn*un),Sn<1&&(vr[0]=xn+Sn*Ln,vr[1]=zn+Sn*un),!0}}}}}var ga=1e9,jn=-ga;function an(Yt,vr,Qr,Wr){function xa(ni,wn){return Yt<=ni&&ni<=Qr&&vr<=wn&&wn<=Wr}function Qa(ni,wn,Sn,Ln){var un=0,mi=0;if(ni==null||(un=xn(ni,Sn))!==(mi=xn(wn,Sn))||Gn(ni,wn)<0^Sn>0)do Ln.point(un===0||un===3?Yt:Qr,un>1?Wr:vr);while((un=(un+Sn+4)%4)!==mi);else Ln.point(wn[0],wn[1])}function xn(ni,wn){return m(ni[0]-Yt)0?0:3:m(ni[0]-Qr)0?2:1:m(ni[1]-vr)0?1:0:wn>0?3:2}function zn(ni,wn){return Gn(ni.x,wn.x)}function Gn(ni,wn){var Sn=xn(ni,1),Ln=xn(wn,1);return Sn!==Ln?Sn-Ln:Sn===0?wn[1]-ni[1]:Sn===1?ni[0]-wn[0]:Sn===2?ni[1]-wn[1]:wn[0]-ni[0]}return function(ni){var wn=ni,Sn=St(),Ln,un,mi,Oi,Vi,Bi,Yi,vi,Qn,no,Ro,as={point:Ps,lineStart:ul,lineEnd:Ws,polygonStart:Cs,polygonEnd:es};function Ps(Mi,yo){xa(Mi,yo)&&wn.point(Mi,yo)}function ds(){for(var Mi=0,yo=0,Ss=un.length;yoWr&&(Ku-Yu)*(Wr-Vl)>(Hl-Vl)*(Yt-Yu)&&++Mi:Hl<=Wr&&(Ku-Yu)*(Wr-Vl)<(Hl-Vl)*(Yt-Yu)&&--Mi;return Mi}function Cs(){wn=Sn,Ln=[],un=[],Ro=!0}function es(){var Mi=ds(),yo=Ro&&Mi,Ss=(Ln=x.merge(Ln)).length;(yo||Ss)&&(ni.polygonStart(),yo&&(ni.lineStart(),Qa(null,null,1,ni),ni.lineEnd()),Ss&&kr(Ln,zn,Mi,Qa,ni),ni.polygonEnd()),wn=ni,Ln=un=mi=null}function ul(){as.point=Fs,un&&un.push(mi=[]),no=!0,Qn=!1,Yi=vi=NaN}function Ws(){Ln&&(Fs(Oi,Vi),Bi&&Qn&&Sn.rejoin(),Ln.push(Sn.result())),as.point=Ps,Qn&&wn.lineEnd()}function Fs(Mi,yo){var Ss=xa(Mi,yo);if(un&&mi.push([Mi,yo]),no)Oi=Mi,Vi=yo,Bi=Ss,no=!1,Ss&&(wn.lineStart(),wn.point(Mi,yo));else if(Ss&&Qn)wn.point(Mi,yo);else{var us=[Yi=Math.max(jn,Math.min(ga,Yi)),vi=Math.max(jn,Math.min(ga,vi))],Pl=[Mi=Math.max(jn,Math.min(ga,Mi)),yo=Math.max(jn,Math.min(ga,yo))];$r(us,Pl,Yt,vr,Qr,Wr)?(Qn||(wn.lineStart(),wn.point(us[0],us[1])),wn.point(Pl[0],Pl[1]),Ss||wn.lineEnd(),Ro=!1):Ss&&(wn.lineStart(),wn.point(Mi,yo),Ro=!1)}Yi=Mi,vi=yo,Qn=Ss}return as}}function ei(){var Yt=0,vr=0,Qr=960,Wr=500,xa,Qa,xn;return xn={stream:function(zn){return xa&&Qa===zn?xa:xa=an(Yt,vr,Qr,Wr)(Qa=zn)},extent:function(zn){return arguments.length?(Yt=+zn[0][0],vr=+zn[0][1],Qr=+zn[1][0],Wr=+zn[1][1],xa=Qa=null,xn):[[Yt,vr],[Qr,Wr]]}}}var li=A(),_i,xi,Pi,Li={sphere:L,point:L,lineStart:ri,lineEnd:L,polygonStart:L,polygonEnd:L};function ri(){Li.point=Eo,Li.lineEnd=vo}function vo(){Li.point=Li.lineEnd=L}function Eo(Yt,vr){Yt*=c,vr*=c,_i=Yt,xi=y(vr),Pi=l(vr),Li.point=uo}function uo(Yt,vr){Yt*=c,vr*=c;var Qr=y(vr),Wr=l(vr),xa=m(Yt-_i),Qa=l(xa),xn=y(xa),zn=Wr*xn,Gn=Pi*Qr-xi*Wr*Qa,ni=xi*Qr+Pi*Wr*Qa;li.add(T(v(zn*zn+Gn*Gn),ni)),_i=Yt,xi=Qr,Pi=Wr}function ao(Yt){return li.reset(),N(Yt,Li),+li}var mo=[null,null],Bo={type:"LineString",coordinates:mo};function Go(Yt,vr){return mo[0]=Yt,mo[1]=vr,ao(Bo)}var Ko={Feature:function(Yt,vr){return eo(Yt.geometry,vr)},FeatureCollection:function(Yt,vr){for(var Qr=Yt.features,Wr=-1,xa=Qr.length;++Wr0&&(xa=Go(Yt[Qa],Yt[Qa-1]),xa>0&&Qr<=xa&&Wr<=xa&&(Qr+Wr-xa)*(1-Math.pow((Qr-Wr)/xa,2))r}).map(Ln)).concat(x.range(_(Qa/ni)*ni,xa,ni).filter(function(vi){return m(vi%Sn)>r}).map(un))}return Bi.lines=function(){return Yi().map(function(vi){return{type:"LineString",coordinates:vi}})},Bi.outline=function(){return{type:"Polygon",coordinates:[mi(Wr).concat(Oi(xn).slice(1),mi(Qr).reverse().slice(1),Oi(zn).reverse().slice(1))]}},Bi.extent=function(vi){return arguments.length?Bi.extentMajor(vi).extentMinor(vi):Bi.extentMinor()},Bi.extentMajor=function(vi){return arguments.length?(Wr=+vi[0][0],Qr=+vi[1][0],zn=+vi[0][1],xn=+vi[1][1],Wr>Qr&&(vi=Wr,Wr=Qr,Qr=vi),zn>xn&&(vi=zn,zn=xn,xn=vi),Bi.precision(Vi)):[[Wr,zn],[Qr,xn]]},Bi.extentMinor=function(vi){return arguments.length?(vr=+vi[0][0],Yt=+vi[1][0],Qa=+vi[0][1],xa=+vi[1][1],vr>Yt&&(vi=vr,vr=Yt,Yt=vi),Qa>xa&&(vi=Qa,Qa=xa,xa=vi),Bi.precision(Vi)):[[vr,Qa],[Yt,xa]]},Bi.step=function(vi){return arguments.length?Bi.stepMajor(vi).stepMinor(vi):Bi.stepMinor()},Bi.stepMajor=function(vi){return arguments.length?(wn=+vi[0],Sn=+vi[1],Bi):[wn,Sn]},Bi.stepMinor=function(vi){return arguments.length?(Gn=+vi[0],ni=+vi[1],Bi):[Gn,ni]},Bi.precision=function(vi){return arguments.length?(Vi=+vi,Ln=Nn(Qa,xa,90),un=pi(vr,Yt,Vi),mi=Nn(zn,xn,90),Oi=pi(Wr,Qr,Vi),Bi):Vi},Bi.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Io(){return gs()()}function Zi(Yt,vr){var Qr=Yt[0]*c,Wr=Yt[1]*c,xa=vr[0]*c,Qa=vr[1]*c,xn=l(Wr),zn=y(Wr),Gn=l(Qa),ni=y(Qa),wn=xn*l(Qr),Sn=xn*y(Qr),Ln=Gn*l(xa),un=Gn*y(xa),mi=2*f(v(P(Qa-Wr)+xn*Gn*P(xa-Qr))),Oi=y(mi),Vi=mi?function(Bi){var Yi=y(Bi*=mi)/Oi,vi=y(mi-Bi)/Oi,Qn=vi*wn+Yi*Ln,no=vi*Sn+Yi*un,Ro=vi*zn+Yi*ni;return[T(no,Qn)*h,T(Ro,v(Qn*Qn+no*no))*h]}:function(){return[Qr*h,Wr*h]};return Vi.distance=mi,Vi}function ys(Yt){return Yt}var rs=A(),fs=A(),el,ci,oo,so,js={point:L,lineStart:L,lineEnd:L,polygonStart:function(){js.lineStart=Es,js.lineEnd=Ks},polygonEnd:function(){js.lineStart=js.lineEnd=js.point=L,rs.add(m(fs)),fs.reset()},result:function(){var Yt=rs/2;return rs.reset(),Yt}};function Es(){js.point=Ni}function Ni(Yt,vr){js.point=Ns,el=oo=Yt,ci=so=vr}function Ns(Yt,vr){fs.add(so*Yt-oo*vr),oo=Yt,so=vr}function Ks(){Ns(el,ci)}var jo=1/0,hs=jo,ks=-jo,xs=ks,ll={point:ql,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var Yt=[[jo,hs],[ks,xs]];return ks=xs=-(hs=jo=1/0),Yt}};function ql(Yt,vr){Ytks&&(ks=Yt),vrxs&&(xs=vr)}var wu=0,Yl=0,kc=0,ec=0,vs=0,Ru=0,Cc=0,Ll=0,nl=0,Tu,nu,Rs,Gs,Qo={point:ws,lineStart:Au,lineEnd:Us,polygonStart:function(){Qo.lineStart=_f,Qo.lineEnd=qo},polygonEnd:function(){Qo.point=ws,Qo.lineStart=Au,Qo.lineEnd=Us},result:function(){var Yt=nl?[Cc/nl,Ll/nl]:Ru?[ec/Ru,vs/Ru]:kc?[wu/kc,Yl/kc]:[NaN,NaN];return wu=Yl=kc=ec=vs=Ru=Cc=Ll=nl=0,Yt}};function ws(Yt,vr){wu+=Yt,Yl+=vr,++kc}function Au(){Qo.point=fl}function fl(Yt,vr){Qo.point=lu,ws(Rs=Yt,Gs=vr)}function lu(Yt,vr){var Qr=Yt-Rs,Wr=vr-Gs,xa=v(Qr*Qr+Wr*Wr);ec+=xa*(Rs+Yt)/2,vs+=xa*(Gs+vr)/2,Ru+=xa,ws(Rs=Yt,Gs=vr)}function Us(){Qo.point=ws}function _f(){Qo.point=xf}function qo(){is(Tu,nu)}function xf(Yt,vr){Qo.point=is,ws(Tu=Rs=Yt,nu=Gs=vr)}function is(Yt,vr){var Qr=Yt-Rs,Wr=vr-Gs,xa=v(Qr*Qr+Wr*Wr);ec+=xa*(Rs+Yt)/2,vs+=xa*(Gs+vr)/2,Ru+=xa,xa=Gs*Yt-Rs*vr,Cc+=xa*(Rs+Yt),Ll+=xa*(Gs+vr),nl+=xa*3,ws(Rs=Yt,Gs=vr)}function Ui(Yt){this._context=Yt}Ui.prototype={_radius:4.5,pointRadius:function(Yt){return this._radius=Yt,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(Yt,vr){switch(this._point){case 0:{this._context.moveTo(Yt,vr),this._point=1;break}case 1:{this._context.lineTo(Yt,vr);break}default:{this._context.moveTo(Yt+this._radius,vr),this._context.arc(Yt,vr,this._radius,0,s);break}}},result:L};var ac=A(),uu,hl,Lc,ju,dc,Tl={point:L,lineStart:function(){Tl.point=Kc},lineEnd:function(){uu&&Fc(hl,Lc),Tl.point=L},polygonStart:function(){uu=!0},polygonEnd:function(){uu=null},result:function(){var Yt=+ac;return ac.reset(),Yt}};function Kc(Yt,vr){Tl.point=Fc,hl=ju=Yt,Lc=dc=vr}function Fc(Yt,vr){ju-=Yt,dc-=vr,ac.add(v(ju*ju+dc*dc)),ju=Yt,dc=vr}function pc(){this._string=[]}pc.prototype={_radius:4.5,_circle:tc(4.5),pointRadius:function(Yt){return(Yt=+Yt)!==this._radius&&(this._radius=Yt,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(Yt,vr){switch(this._point){case 0:{this._string.push("M",Yt,",",vr),this._point=1;break}case 1:{this._string.push("L",Yt,",",vr);break}default:{this._circle==null&&(this._circle=tc(this._radius)),this._string.push("M",Yt,",",vr,this._circle);break}}},result:function(){if(this._string.length){var Yt=this._string.join("");return this._string=[],Yt}else return null}};function tc(Yt){return"m0,"+Yt+"a"+Yt+","+Yt+" 0 1,1 0,"+-2*Yt+"a"+Yt+","+Yt+" 0 1,1 0,"+2*Yt+"z"}function Oc(Yt,vr){var Qr=4.5,Wr,xa;function Qa(xn){return xn&&(typeof Qr=="function"&&xa.pointRadius(+Qr.apply(this,arguments)),N(xn,Wr(xa))),xa.result()}return Qa.area=function(xn){return N(xn,Wr(js)),js.result()},Qa.measure=function(xn){return N(xn,Wr(Tl)),Tl.result()},Qa.bounds=function(xn){return N(xn,Wr(ll)),ll.result()},Qa.centroid=function(xn){return N(xn,Wr(Qo)),Qo.result()},Qa.projection=function(xn){return arguments.length?(Wr=xn==null?(Yt=null,ys):(Yt=xn).stream,Qa):Yt},Qa.context=function(xn){return arguments.length?(xa=xn==null?(vr=null,new pc):new Ui(vr=xn),typeof Qr!="function"&&xa.pointRadius(Qr),Qa):vr},Qa.pointRadius=function(xn){return arguments.length?(Qr=typeof xn=="function"?xn:(xa.pointRadius(+xn),+xn),Qa):Qr},Qa.projection(Yt).context(vr)}function Bc(Yt){return{stream:cu(Yt)}}function cu(Yt){return function(vr){var Qr=new Pc;for(var Wr in Yt)Qr[Wr]=Yt[Wr];return Qr.stream=vr,Qr}}function Pc(){}Pc.prototype={constructor:Pc,point:function(Yt,vr){this.stream.point(Yt,vr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Su(Yt,vr,Qr){var Wr=Yt.clipExtent&&Yt.clipExtent();return Yt.scale(150).translate([0,0]),Wr!=null&&Yt.clipExtent(null),N(Qr,Yt.stream(ll)),vr(ll.result()),Wr!=null&&Yt.clipExtent(Wr),Yt}function nc(Yt,vr,Qr){return Su(Yt,function(Wr){var xa=vr[1][0]-vr[0][0],Qa=vr[1][1]-vr[0][1],xn=Math.min(xa/(Wr[1][0]-Wr[0][0]),Qa/(Wr[1][1]-Wr[0][1])),zn=+vr[0][0]+(xa-xn*(Wr[1][0]+Wr[0][0]))/2,Gn=+vr[0][1]+(Qa-xn*(Wr[1][1]+Wr[0][1]))/2;Yt.scale(150*xn).translate([zn,Gn])},Qr)}function Al(Yt,vr,Qr){return nc(Yt,[[0,0],vr],Qr)}function rc(Yt,vr,Qr){return Su(Yt,function(Wr){var xa=+vr,Qa=xa/(Wr[1][0]-Wr[0][0]),xn=(xa-Qa*(Wr[1][0]+Wr[0][0]))/2,zn=-Qa*Wr[0][1];Yt.scale(150*Qa).translate([xn,zn])},Qr)}function Vu(Yt,vr,Qr){return Su(Yt,function(Wr){var xa=+vr,Qa=xa/(Wr[1][1]-Wr[0][1]),xn=-Qa*Wr[0][0],zn=(xa-Qa*(Wr[1][1]+Wr[0][1]))/2;Yt.scale(150*Qa).translate([xn,zn])},Qr)}var Ts=16,Ic=l(30*c);function sf(Yt,vr){return+vr?ic(Yt,vr):Nc(Yt)}function Nc(Yt){return cu({point:function(vr,Qr){vr=Yt(vr,Qr),this.stream.point(vr[0],vr[1])}})}function ic(Yt,vr){function Qr(Wr,xa,Qa,xn,zn,Gn,ni,wn,Sn,Ln,un,mi,Oi,Vi){var Bi=ni-Wr,Yi=wn-xa,vi=Bi*Bi+Yi*Yi;if(vi>4*vr&&Oi--){var Qn=xn+Ln,no=zn+un,Ro=Gn+mi,as=v(Qn*Qn+no*no+Ro*Ro),Ps=f(Ro/=as),ds=m(m(Ro)-1)vr||m((Bi*Ws+Yi*Fs)/vi-.5)>.3||xn*Ln+zn*un+Gn*mi2?Mi[2]%360*c:0,Ws()):[zn*h,Gn*h,ni*h]},es.angle=function(Mi){return arguments.length?(Sn=Mi%360*c,Ws()):Sn*h},es.reflectX=function(Mi){return arguments.length?(Ln=Mi?-1:1,Ws()):Ln<0},es.reflectY=function(Mi){return arguments.length?(un=Mi?-1:1,Ws()):un<0},es.precision=function(Mi){return arguments.length?(Ro=sf(as,no=Mi*Mi),Fs()):v(no)},es.fitExtent=function(Mi,yo){return nc(es,Mi,yo)},es.fitSize=function(Mi,yo){return Al(es,Mi,yo)},es.fitWidth=function(Mi,yo){return rc(es,Mi,yo)},es.fitHeight=function(Mi,yo){return Vu(es,Mi,yo)};function Ws(){var Mi=Hs(Qr,0,0,Ln,un,Sn).apply(null,vr(Qa,xn)),yo=(Sn?Hs:Uc)(Qr,Wr-Mi[0],xa-Mi[1],Ln,un,Sn);return wn=Pa(zn,Gn,ni),as=Jr(vr,yo),Ps=Jr(wn,as),Ro=sf(as,no),Fs()}function Fs(){return ds=Cs=null,es}return function(){return vr=Yt.apply(this,arguments),es.invert=vr.invert&&ul,Ws()}}function Ds(Yt){var vr=0,Qr=a/3,Wr=qu(Yt),xa=Wr(vr,Qr);return xa.parallels=function(Qa){return arguments.length?Wr(vr=Qa[0]*c,Qr=Qa[1]*c):[vr*h,Qr*h]},xa}function Du(Yt){var vr=l(Yt);function Qr(Wr,xa){return[Wr*vr,y(xa)/vr]}return Qr.invert=function(Wr,xa){return[Wr/vr,f(xa*vr)]},Qr}function Nl(Yt,vr){var Qr=y(Yt),Wr=(Qr+y(vr))/2;if(m(Wr)=.12&&Vi<.234&&Oi>=-.425&&Oi<-.214?xa:Vi>=.166&&Vi<.234&&Oi>=-.214&&Oi<-.115?xn:Qr).invert(Ln)},wn.stream=function(Ln){return Yt&&vr===Ln?Yt:Yt=jc([Qr.stream(vr=Ln),xa.stream(Ln),xn.stream(Ln)])},wn.precision=function(Ln){return arguments.length?(Qr.precision(Ln),xa.precision(Ln),xn.precision(Ln),Sn()):Qr.precision()},wn.scale=function(Ln){return arguments.length?(Qr.scale(Ln),xa.scale(Ln*.35),xn.scale(Ln),wn.translate(Qr.translate())):Qr.scale()},wn.translate=function(Ln){if(!arguments.length)return Qr.translate();var un=Qr.scale(),mi=+Ln[0],Oi=+Ln[1];return Wr=Qr.translate(Ln).clipExtent([[mi-.455*un,Oi-.238*un],[mi+.455*un,Oi+.238*un]]).stream(ni),Qa=xa.translate([mi-.307*un,Oi+.201*un]).clipExtent([[mi-.425*un+r,Oi+.12*un+r],[mi-.214*un-r,Oi+.234*un-r]]).stream(ni),zn=xn.translate([mi-.205*un,Oi+.212*un]).clipExtent([[mi-.214*un+r,Oi+.166*un+r],[mi-.115*un-r,Oi+.234*un-r]]).stream(ni),Sn()},wn.fitExtent=function(Ln,un){return nc(wn,Ln,un)},wn.fitSize=function(Ln,un){return Al(wn,Ln,un)},wn.fitWidth=function(Ln,un){return rc(wn,Ln,un)},wn.fitHeight=function(Ln,un){return Vu(wn,Ln,un)};function Sn(){return Yt=vr=null,wn}return wn.scale(1070)}function iu(Yt){return function(vr,Qr){var Wr=l(vr),xa=l(Qr),Qa=Yt(Wr*xa);return[Qa*xa*y(vr),Qa*y(Qr)]}}function Gu(Yt){return function(vr,Qr){var Wr=v(vr*vr+Qr*Qr),xa=Yt(Wr),Qa=y(xa),xn=l(xa);return[T(vr*Qa,Wr*xn),f(Wr&&Qr*Qa/Wr)]}}var zu=iu(function(Yt){return v(2/(1+Yt))});zu.invert=Gu(function(Yt){return 2*f(Yt/2)});function Mf(){return Jl(zu).scale(124.75).clipAngle(180-.001)}var mc=iu(function(Yt){return(Yt=g(Yt))&&Yt/y(Yt)});mc.invert=Gu(function(Yt){return Yt});function wc(){return Jl(mc).scale(79.4188).clipAngle(180-.001)}function ou(Yt,vr){return[Yt,S(u((i+vr)/2))]}ou.invert=function(Yt,vr){return[Yt,2*p(w(vr))-i]};function gc(){return kl(ou).scale(961/s)}function kl(Yt){var vr=Jl(Yt),Qr=vr.center,Wr=vr.scale,xa=vr.translate,Qa=vr.clipExtent,xn=null,zn,Gn,ni;vr.scale=function(Sn){return arguments.length?(Wr(Sn),wn()):Wr()},vr.translate=function(Sn){return arguments.length?(xa(Sn),wn()):xa()},vr.center=function(Sn){return arguments.length?(Qr(Sn),wn()):Qr()},vr.clipExtent=function(Sn){return arguments.length?(Sn==null?xn=zn=Gn=ni=null:(xn=+Sn[0][0],zn=+Sn[0][1],Gn=+Sn[1][0],ni=+Sn[1][1]),wn()):xn==null?null:[[xn,zn],[Gn,ni]]};function wn(){var Sn=a*Wr(),Ln=vr(sn(vr.rotate()).invert([0,0]));return Qa(xn==null?[[Ln[0]-Sn,Ln[1]-Sn],[Ln[0]+Sn,Ln[1]+Sn]]:Yt===ou?[[Math.max(Ln[0]-Sn,xn),zn],[Math.min(Ln[0]+Sn,Gn),ni]]:[[xn,Math.max(Ln[1]-Sn,zn)],[Gn,Math.min(Ln[1]+Sn,ni)]])}return wn()}function oc(Yt){return u((i+Yt)/2)}function lf(Yt,vr){var Qr=l(Yt),Wr=Yt===vr?y(Yt):S(Qr/l(vr))/S(oc(vr)/oc(Yt)),xa=Qr*M(oc(Yt),Wr)/Wr;if(!Wr)return ou;function Qa(xn,zn){xa>0?zn<-i+r&&(zn=-i+r):zn>i-r&&(zn=i-r);var Gn=xa/M(oc(zn),Wr);return[Gn*y(Wr*xn),xa-Gn*l(Wr*xn)]}return Qa.invert=function(xn,zn){var Gn=xa-zn,ni=b(Wr)*v(xn*xn+Gn*Gn),wn=T(xn,m(Gn))*b(Gn);return Gn*Wr<0&&(wn-=a*b(xn)*b(Gn)),[wn/Wr,2*p(M(xa/ni,1/Wr))-i]},Qa}function Tc(){return Ds(lf).scale(109.5).parallels([30,30])}function zs(Yt,vr){return[Yt,vr]}zs.invert=zs;function Ul(){return Jl(zs).scale(152.63)}function $l(Yt,vr){var Qr=l(Yt),Wr=Yt===vr?y(Yt):(Qr-l(vr))/(vr-Yt),xa=Qr/Wr+Yt;if(m(Wr)r&&--Wr>0);return[Yt/(.8707+(Qa=Qr*Qr)*(-.131979+Qa*(-.013791+Qa*Qa*Qa*(.003971-.001529*Qa)))),Qr]};function Fu(){return Jl(Wu).scale(175.295)}function vl(Yt,vr){return[l(vr)*y(Yt),y(vr)]}vl.invert=Gu(f);function jl(){return Jl(vl).scale(249.5).clipAngle(90+r)}function Xu(Yt,vr){var Qr=l(vr),Wr=1+l(Yt)*Qr;return[Qr*y(Yt)/Wr,y(vr)/Wr]}Xu.invert=Gu(function(Yt){return 2*p(Yt)});function lc(){return Jl(Xu).scale(250).clipAngle(142)}function Mu(Yt,vr){return[S(u((i+vr)/2)),-Yt]}Mu.invert=function(Yt,vr){return[-vr,2*p(w(Yt))-i]};function Zu(){var Yt=kl(Mu),vr=Yt.center,Qr=Yt.rotate;return Yt.center=function(Wr){return arguments.length?vr([-Wr[1],Wr[0]]):(Wr=vr(),[Wr[1],-Wr[0]])},Yt.rotate=function(Wr){return arguments.length?Qr([Wr[0],Wr[1],Wr.length>2?Wr[2]+90:90]):(Wr=Qr(),[Wr[0],Wr[1],Wr[2]-90])},Qr([0,0,90]).scale(159.155)}d.geoAlbers=tl,d.geoAlbersUsa=$c,d.geoArea=j,d.geoAzimuthalEqualArea=Mf,d.geoAzimuthalEqualAreaRaw=zu,d.geoAzimuthalEquidistant=wc,d.geoAzimuthalEquidistantRaw=mc,d.geoBounds=Oe,d.geoCentroid=Rr,d.geoCircle=Kn,d.geoClipAntimeridian=Ar,d.geoClipCircle=wa,d.geoClipExtent=ei,d.geoClipRectangle=an,d.geoConicConformal=Tc,d.geoConicConformalRaw=lf,d.geoConicEqualArea=Gl,d.geoConicEqualAreaRaw=Nl,d.geoConicEquidistant=Rc,d.geoConicEquidistantRaw=$l,d.geoContains=ko,d.geoDistance=Go,d.geoEqualEarth=Dc,d.geoEqualEarthRaw=sc,d.geoEquirectangular=Ul,d.geoEquirectangularRaw=zs,d.geoGnomonic=Vc,d.geoGnomonicRaw=Cl,d.geoGraticule=gs,d.geoGraticule10=Io,d.geoIdentity=vu,d.geoInterpolate=Zi,d.geoLength=ao,d.geoMercator=gc,d.geoMercatorRaw=ou,d.geoNaturalEarth1=Fu,d.geoNaturalEarth1Raw=Wu,d.geoOrthographic=jl,d.geoOrthographicRaw=vl,d.geoPath=Oc,d.geoProjection=Jl,d.geoProjectionMutator=qu,d.geoRotation=sn,d.geoStereographic=lc,d.geoStereographicRaw=Xu,d.geoStream=N,d.geoTransform=Bc,d.geoTransverseMercator=Zu,d.geoTransverseMercatorRaw=Mu,Object.defineProperty(d,"__esModule",{value:!0})})}}),LL=We({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z,R3(),Eg()):x(d.d3=d.d3||{},d.d3,d.d3)})(Z,function(d,x,A){"use strict";var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,h=Math.pow,c=Math.round,m=Math.sign||function(qe){return qe>0?1:qe<0?-1:0},p=Math.sin,T=Math.tan,l=1e-6,_=1e-12,w=Math.PI,S=w/2,M=w/4,y=Math.SQRT1_2,b=F(2),v=F(w),u=w*2,g=180/w,f=w/180;function P(qe){return qe?qe/Math.sin(qe):1}function L(qe){return qe>1?S:qe<-1?-S:Math.asin(qe)}function z(qe){return qe>1?0:qe<-1?w:Math.acos(qe)}function F(qe){return qe>0?Math.sqrt(qe):0}function B(qe){return qe=o(2*qe),(qe-1)/(qe+1)}function O(qe){return(o(qe)-o(-qe))/2}function I(qe){return(o(qe)+o(-qe))/2}function N(qe){return i(qe+F(qe*qe+1))}function U(qe){return i(qe+F(qe*qe-1))}function W(qe){var Ze=T(qe/2),it=2*i(r(qe/2))/(Ze*Ze);function ft(Mt,xt){var Pt=r(Mt),ir=r(xt),fr=p(xt),wr=ir*Pt,zr=-((1-wr?i((1+wr)/2)/(1-wr):-.5)+it/(1+wr));return[zr*ir*p(Mt),zr*fr]}return ft.invert=function(Mt,xt){var Pt=F(Mt*Mt+xt*xt),ir=-qe/2,fr=50,wr;if(!Pt)return[0,0];do{var zr=ir/2,Xr=r(zr),la=p(zr),pa=la/Xr,ka=-i(E(Xr));ir-=wr=(2/pa*ka-it*pa-Pt)/(-ka/(la*la)+1-it/(2*Xr*Xr))*(Xr<0?.7:1)}while(E(wr)>l&&--fr>0);var tn=p(ir);return[t(Mt*tn,Pt*r(ir)),L(xt*tn/Pt)]},ft}function Q(){var qe=S,Ze=x.geoProjectionMutator(W),it=Ze(qe);return it.radius=function(ft){return arguments.length?Ze(qe=ft*f):qe*g},it.scale(179.976).clipAngle(147)}function le(qe,Ze){var it=r(Ze),ft=P(z(it*r(qe/=2)));return[2*it*p(qe)*ft,p(Ze)*ft]}le.invert=function(qe,Ze){if(!(qe*qe+4*Ze*Ze>w*w+l)){var it=qe,ft=Ze,Mt=25;do{var xt=p(it),Pt=p(it/2),ir=r(it/2),fr=p(ft),wr=r(ft),zr=p(2*ft),Xr=fr*fr,la=wr*wr,pa=Pt*Pt,ka=1-la*ir*ir,tn=ka?z(wr*ir)*F(Dn=1/ka):Dn=0,Dn,In=2*tn*wr*Pt-qe,Yn=tn*fr-Ze,di=Dn*(la*pa+tn*wr*ir*Xr),Di=Dn*(.5*xt*zr-tn*2*fr*Pt),Ai=Dn*.25*(zr*Pt-tn*fr*la*xt),lo=Dn*(Xr*ir+tn*pa*wr),Vo=Di*Ai-lo*di;if(!Vo)break;var co=(Yn*Di-In*lo)/Vo,Lo=(In*Ai-Yn*di)/Vo;it-=co,ft-=Lo}while((E(co)>l||E(Lo)>l)&&--Mt>0);return[it,ft]}};function se(){return x.geoProjection(le).scale(152.63)}function he(qe){var Ze=p(qe),it=r(qe),ft=qe>=0?1:-1,Mt=T(ft*qe),xt=(1+Ze-it)/2;function Pt(ir,fr){var wr=r(fr),zr=r(ir/=2);return[(1+wr)*p(ir),(ft*fr>-t(zr,Mt)-.001?0:-ft*10)+xt+p(fr)*it-(1+wr)*Ze*zr]}return Pt.invert=function(ir,fr){var wr=0,zr=0,Xr=50;do{var la=r(wr),pa=p(wr),ka=r(zr),tn=p(zr),Dn=1+ka,In=Dn*pa-ir,Yn=xt+tn*it-Dn*Ze*la-fr,di=Dn*la/2,Di=-pa*tn,Ai=Ze*Dn*pa/2,lo=it*ka+Ze*la*tn,Vo=Di*Ai-lo*di,co=(Yn*Di-In*lo)/Vo/2,Lo=(In*Ai-Yn*di)/Vo;E(Lo)>2&&(Lo/=2),wr-=co,zr-=Lo}while((E(co)>l||E(Lo)>l)&&--Xr>0);return ft*zr>-t(r(wr),Mt)-.001?[wr*2,zr]:null},Pt}function q(){var qe=20*f,Ze=qe>=0?1:-1,it=T(Ze*qe),ft=x.geoProjectionMutator(he),Mt=ft(qe),xt=Mt.stream;return Mt.parallel=function(Pt){return arguments.length?(it=T((Ze=(qe=Pt*f)>=0?1:-1)*qe),ft(qe)):qe*g},Mt.stream=function(Pt){var ir=Mt.rotate(),fr=xt(Pt),wr=(Mt.rotate([0,0]),xt(Pt)),zr=Mt.precision();return Mt.rotate(ir),fr.sphere=function(){wr.polygonStart(),wr.lineStart();for(var Xr=Ze*-180;Ze*Xr<180;Xr+=Ze*90)wr.point(Xr,Ze*90);if(qe)for(;Ze*(Xr-=3*Ze*zr)>=-180;)wr.point(Xr,Ze*-t(r(Xr*f/2),it)*g);wr.lineEnd(),wr.polygonEnd()},fr},Mt.scale(218.695).center([0,28.0974])}function $(qe,Ze){var it=T(Ze/2),ft=F(1-it*it),Mt=1+ft*r(qe/=2),xt=p(qe)*ft/Mt,Pt=it/Mt,ir=xt*xt,fr=Pt*Pt;return[4/3*xt*(3+ir-3*fr),4/3*Pt*(3+3*ir-fr)]}$.invert=function(qe,Ze){if(qe*=3/8,Ze*=3/8,!qe&&E(Ze)>1)return null;var it=qe*qe,ft=Ze*Ze,Mt=1+it+ft,xt=F((Mt-F(Mt*Mt-4*Ze*Ze))/2),Pt=L(xt)/3,ir=xt?U(E(Ze/xt))/3:N(E(qe))/3,fr=r(Pt),wr=I(ir),zr=wr*wr-fr*fr;return[m(qe)*2*t(O(ir)*fr,.25-zr),m(Ze)*2*t(wr*p(Pt),.25+zr)]};function J(){return x.geoProjection($).scale(66.1603)}var X=F(8),oe=i(1+b);function ne(qe,Ze){var it=E(Ze);return it_&&--ft>0);return[qe/(r(it)*(X-1/p(it))),m(Ze)*it]};function j(){return x.geoProjection(ne).scale(112.314)}function ee(qe){var Ze=2*w/qe;function it(ft,Mt){var xt=x.geoAzimuthalEquidistantRaw(ft,Mt);if(E(ft)>S){var Pt=t(xt[1],xt[0]),ir=F(xt[0]*xt[0]+xt[1]*xt[1]),fr=Ze*c((Pt-S)/Ze)+S,wr=t(p(Pt-=fr),2-r(Pt));Pt=fr+L(w/ir*p(wr))-wr,xt[0]=ir*r(Pt),xt[1]=ir*p(Pt)}return xt}return it.invert=function(ft,Mt){var xt=F(ft*ft+Mt*Mt);if(xt>S){var Pt=t(Mt,ft),ir=Ze*c((Pt-S)/Ze)+S,fr=Pt>ir?-1:1,wr=xt*r(ir-Pt),zr=1/T(fr*z((wr-w)/F(w*(w-2*wr)+xt*xt)));Pt=ir+2*e((zr+fr*F(zr*zr-3))/3),ft=xt*r(Pt),Mt=xt*p(Pt)}return x.geoAzimuthalEquidistantRaw.invert(ft,Mt)},it}function re(){var qe=5,Ze=x.geoProjectionMutator(ee),it=Ze(qe),ft=it.stream,Mt=.01,xt=-r(Mt*f),Pt=p(Mt*f);return it.lobes=function(ir){return arguments.length?Ze(qe=+ir):qe},it.stream=function(ir){var fr=it.rotate(),wr=ft(ir),zr=(it.rotate([0,0]),ft(ir));return it.rotate(fr),wr.sphere=function(){zr.polygonStart(),zr.lineStart();for(var Xr=0,la=360/qe,pa=2*w/qe,ka=90-180/qe,tn=S;Xr0&&E(Mt)>l);return ft<0?NaN:it}function De(qe,Ze,it){return Ze===void 0&&(Ze=40),it===void 0&&(it=_),function(ft,Mt,xt,Pt){var ir,fr,wr;xt=xt===void 0?0:+xt,Pt=Pt===void 0?0:+Pt;for(var zr=0;zrir){xt-=fr/=2,Pt-=wr/=2;continue}ir=ka;var tn=(xt>0?-1:1)*it,Dn=(Pt>0?-1:1)*it,In=qe(xt+tn,Pt),Yn=qe(xt,Pt+Dn),di=(In[0]-Xr[0])/tn,Di=(In[1]-Xr[1])/tn,Ai=(Yn[0]-Xr[0])/Dn,lo=(Yn[1]-Xr[1])/Dn,Vo=lo*di-Di*Ai,co=(E(Vo)<.5?.5:1)/Vo;if(fr=(pa*Ai-la*lo)*co,wr=(la*Di-pa*di)*co,xt+=fr,Pt+=wr,E(fr)0&&(ir[1]*=1+fr/1.5*ir[0]*ir[0]),ir}return ft.invert=De(ft),ft}function et(){return x.geoProjection(He()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function rt(qe,Ze){var it=qe*p(Ze),ft=30,Mt;do Ze-=Mt=(Ze+p(Ze)-it)/(1+r(Ze));while(E(Mt)>l&&--ft>0);return Ze/2}function $e(qe,Ze,it){function ft(Mt,xt){return[qe*Mt*r(xt=rt(it,xt)),Ze*p(xt)]}return ft.invert=function(Mt,xt){return xt=L(xt/Ze),[Mt/(qe*r(xt)),L((2*xt+p(2*xt))/it)]},ft}var ot=$e(b/S,b,w);function Ae(){return x.geoProjection(ot).scale(169.529)}var ge=2.00276,ce=1.11072;function ze(qe,Ze){var it=rt(w,Ze);return[ge*qe/(1/r(Ze)+ce/r(it)),(Ze+b*p(it))/ge]}ze.invert=function(qe,Ze){var it=ge*Ze,ft=Ze<0?-M:M,Mt=25,xt,Pt;do Pt=it-b*p(ft),ft-=xt=(p(2*ft)+2*ft-w*p(Pt))/(2*r(2*ft)+2+w*r(Pt)*b*r(ft));while(E(xt)>l&&--Mt>0);return Pt=it-b*p(ft),[qe*(1/r(Pt)+ce/r(ft))/ge,Pt]};function Qe(){return x.geoProjection(ze).scale(160.857)}function nt(qe){var Ze=0,it=x.geoProjectionMutator(qe),ft=it(Ze);return ft.parallel=function(Mt){return arguments.length?it(Ze=Mt*f):Ze*g},ft}function Ke(qe,Ze){return[qe*r(Ze),Ze]}Ke.invert=function(qe,Ze){return[qe/r(Ze),Ze]};function kt(){return x.geoProjection(Ke).scale(152.63)}function Et(qe){if(!qe)return Ke;var Ze=1/T(qe);function it(ft,Mt){var xt=Ze+qe-Mt,Pt=xt&&ft*r(Mt)/xt;return[xt*p(Pt),Ze-xt*r(Pt)]}return it.invert=function(ft,Mt){var xt=F(ft*ft+(Mt=Ze-Mt)*Mt),Pt=Ze+qe-xt;return[xt/r(Pt)*t(ft,Mt),Pt]},it}function Bt(){return nt(Et).scale(123.082).center([0,26.1441]).parallel(45)}function jt(qe){function Ze(it,ft){var Mt=S-ft,xt=Mt&&it*qe*p(Mt)/Mt;return[Mt*p(xt)/qe,S-Mt*r(xt)]}return Ze.invert=function(it,ft){var Mt=it*qe,xt=S-ft,Pt=F(Mt*Mt+xt*xt),ir=t(Mt,xt);return[(Pt?Pt/p(Pt):1)*ir/qe,S-Pt]},Ze}function _r(){var qe=.5,Ze=x.geoProjectionMutator(jt),it=Ze(qe);return it.fraction=function(ft){return arguments.length?Ze(qe=+ft):qe},it.scale(158.837)}var pr=$e(1,4/w,w);function Or(){return x.geoProjection(pr).scale(152.63)}function mr(qe,Ze,it,ft,Mt,xt){var Pt=r(xt),ir;if(E(qe)>1||E(xt)>1)ir=z(it*Mt+Ze*ft*Pt);else{var fr=p(qe/2),wr=p(xt/2);ir=2*L(F(fr*fr+Ze*ft*wr*wr))}return E(ir)>l?[ir,t(ft*p(xt),Ze*Mt-it*ft*Pt)]:[0,0]}function Er(qe,Ze,it){return z((qe*qe+Ze*Ze-it*it)/(2*qe*Ze))}function yt(qe){return qe-2*w*a((qe+w)/(2*w))}function Oe(qe,Ze,it){for(var ft=[[qe[0],qe[1],p(qe[1]),r(qe[1])],[Ze[0],Ze[1],p(Ze[1]),r(Ze[1])],[it[0],it[1],p(it[1]),r(it[1])]],Mt=ft[2],xt,Pt=0;Pt<3;++Pt,Mt=xt)xt=ft[Pt],Mt.v=mr(xt[1]-Mt[1],Mt[3],Mt[2],xt[3],xt[2],xt[0]-Mt[0]),Mt.point=[0,0];var ir=Er(ft[0].v[0],ft[2].v[0],ft[1].v[0]),fr=Er(ft[0].v[0],ft[1].v[0],ft[2].v[0]),wr=w-ir;ft[2].point[1]=0,ft[0].point[0]=-(ft[1].point[0]=ft[0].v[0]/2);var zr=[ft[2].point[0]=ft[0].point[0]+ft[2].v[0]*r(ir),2*(ft[0].point[1]=ft[1].point[1]=ft[2].v[0]*p(ir))];function Xr(la,pa){var ka=p(pa),tn=r(pa),Dn=new Array(3),In;for(In=0;In<3;++In){var Yn=ft[In];if(Dn[In]=mr(pa-Yn[1],Yn[3],Yn[2],tn,ka,la-Yn[0]),!Dn[In][0])return Yn.point;Dn[In][1]=yt(Dn[In][1]-Yn.v[1])}var di=zr.slice();for(In=0;In<3;++In){var Di=In==2?0:In+1,Ai=Er(ft[In].v[0],Dn[In][0],Dn[Di][0]);Dn[In][1]<0&&(Ai=-Ai),In?In==1?(Ai=fr-Ai,di[0]-=Dn[In][0]*r(Ai),di[1]-=Dn[In][0]*p(Ai)):(Ai=wr-Ai,di[0]+=Dn[In][0]*r(Ai),di[1]+=Dn[In][0]*p(Ai)):(di[0]+=Dn[In][0]*r(Ai),di[1]-=Dn[In][0]*p(Ai))}return di[0]/=3,di[1]/=3,di}return Xr}function Xe(qe){return qe[0]*=f,qe[1]*=f,qe}function be(){return Ce([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ce(qe,Ze,it){var ft=x.geoCentroid({type:"MultiPoint",coordinates:[qe,Ze,it]}),Mt=[-ft[0],-ft[1]],xt=x.geoRotation(Mt),Pt=Oe(Xe(xt(qe)),Xe(xt(Ze)),Xe(xt(it)));Pt.invert=De(Pt);var ir=x.geoProjection(Pt).rotate(Mt),fr=ir.center;return delete ir.rotate,ir.center=function(wr){return arguments.length?fr(xt(wr)):xt.invert(fr())},ir.clipAngle(90)}function Ne(qe,Ze){var it=F(1-p(Ze));return[2/v*qe*it,v*(1-it)]}Ne.invert=function(qe,Ze){var it=(it=Ze/v-1)*it;return[it>0?qe*F(w/it)/2:0,L(1-it)]};function Ee(){return x.geoProjection(Ne).scale(95.6464).center([0,30])}function Se(qe){var Ze=T(qe);function it(ft,Mt){return[ft,(ft?ft/p(ft):1)*(p(Mt)*r(ft)-Ze*r(Mt))]}return it.invert=Ze?function(ft,Mt){ft&&(Mt*=p(ft)/ft);var xt=r(ft);return[ft,2*t(F(xt*xt+Ze*Ze-Mt*Mt)-xt,Ze-Mt)]}:function(ft,Mt){return[ft,L(ft?Mt*T(ft)/ft:Mt)]},it}function Le(){return nt(Se).scale(249.828).clipAngle(90)}var at=F(3);function dt(qe,Ze){return[at*qe*(2*r(2*Ze/3)-1)/v,at*v*p(Ze/3)]}dt.invert=function(qe,Ze){var it=3*L(Ze/(at*v));return[v*qe/(at*(2*r(2*it/3)-1)),it]};function gt(){return x.geoProjection(dt).scale(156.19)}function Ct(qe){var Ze=r(qe);function it(ft,Mt){return[ft*Ze,p(Mt)/Ze]}return it.invert=function(ft,Mt){return[ft/Ze,L(Mt*Ze)]},it}function or(){return nt(Ct).parallel(38.58).scale(195.044)}function Qt(qe){var Ze=r(qe);function it(ft,Mt){return[ft*Ze,(1+Ze)*T(Mt/2)]}return it.invert=function(ft,Mt){return[ft/Ze,e(Mt/(1+Ze))*2]},it}function Jt(){return nt(Qt).scale(124.75)}function Sr(qe,Ze){var it=F(8/(3*w));return[it*qe*(1-E(Ze)/w),it*Ze]}Sr.invert=function(qe,Ze){var it=F(8/(3*w)),ft=Ze/it;return[qe/(it*(1-E(ft)/w)),ft]};function oa(){return x.geoProjection(Sr).scale(165.664)}function Ea(qe,Ze){var it=F(4-3*p(E(Ze)));return[2/F(6*w)*qe*it,m(Ze)*F(2*w/3)*(2-it)]}Ea.invert=function(qe,Ze){var it=2-E(Ze)/F(2*w/3);return[qe*F(6*w)/(2*it),m(Ze)*L((4-it*it)/3)]};function Sa(){return x.geoProjection(Ea).scale(165.664)}function za(qe,Ze){var it=F(w*(4+w));return[2/it*qe*(1+F(1-4*Ze*Ze/(w*w))),4/it*Ze]}za.invert=function(qe,Ze){var it=F(w*(4+w))/2;return[qe*it/(1+F(1-Ze*Ze*(4+w)/(4*w))),Ze*it/2]};function Na(){return x.geoProjection(za).scale(180.739)}function Ta(qe,Ze){var it=(2+S)*p(Ze);Ze/=2;for(var ft=0,Mt=1/0;ft<10&&E(Mt)>l;ft++){var xt=r(Ze);Ze-=Mt=(Ze+p(Ze)*(xt+2)-it)/(2*xt*(1+xt))}return[2/F(w*(4+w))*qe*(1+r(Ze)),2*F(w/(4+w))*p(Ze)]}Ta.invert=function(qe,Ze){var it=Ze*F((4+w)/w)/2,ft=L(it),Mt=r(ft);return[qe/(2/F(w*(4+w))*(1+Mt)),L((ft+it*(Mt+2))/(2+S))]};function nn(){return x.geoProjection(Ta).scale(180.739)}function gn(qe,Ze){return[qe*(1+r(Ze))/F(2+w),2*Ze/F(2+w)]}gn.invert=function(qe,Ze){var it=F(2+w),ft=Ze*it/2;return[it*qe/(1+r(ft)),ft]};function Ht(){return x.geoProjection(gn).scale(173.044)}function It(qe,Ze){for(var it=(1+S)*p(Ze),ft=0,Mt=1/0;ft<10&&E(Mt)>l;ft++)Ze-=Mt=(Ze+p(Ze)-it)/(1+r(Ze));return it=F(2+w),[qe*(1+r(Ze))/it,2*Ze/it]}It.invert=function(qe,Ze){var it=1+S,ft=F(it/2);return[qe*2*ft/(1+r(Ze*=ft)),L((Ze+p(Ze))/it)]};function Gt(){return x.geoProjection(It).scale(173.044)}var Xt=3+2*b;function Rr(qe,Ze){var it=p(qe/=2),ft=r(qe),Mt=F(r(Ze)),xt=r(Ze/=2),Pt=p(Ze)/(xt+b*ft*Mt),ir=F(2/(1+Pt*Pt)),fr=F((b*xt+(ft+it)*Mt)/(b*xt+(ft-it)*Mt));return[Xt*(ir*(fr-1/fr)-2*i(fr)),Xt*(ir*Pt*(fr+1/fr)-2*e(Pt))]}Rr.invert=function(qe,Ze){if(!(xt=$.invert(qe/1.2,Ze*1.065)))return null;var it=xt[0],ft=xt[1],Mt=20,xt;qe/=Xt,Ze/=Xt;do{var Pt=it/2,ir=ft/2,fr=p(Pt),wr=r(Pt),zr=p(ir),Xr=r(ir),la=r(ft),pa=F(la),ka=zr/(Xr+b*wr*pa),tn=ka*ka,Dn=F(2/(1+tn)),In=b*Xr+(wr+fr)*pa,Yn=b*Xr+(wr-fr)*pa,di=In/Yn,Di=F(di),Ai=Di-1/Di,lo=Di+1/Di,Vo=Dn*Ai-2*i(Di)-qe,co=Dn*ka*lo-2*e(ka)-Ze,Lo=zr&&y*pa*fr*tn/zr,Zo=(b*wr*Xr+pa)/(2*(Xr+b*wr*pa)*(Xr+b*wr*pa)*pa),Os=-.5*ka*Dn*Dn*Dn,Ls=Os*Lo,Do=Os*Zo,zo=(zo=2*Xr+b*pa*(wr-fr))*zo*Di,il=(b*wr*Xr*pa+la)/zo,Sl=-(b*fr*zr)/(pa*zo),eu=Ai*Ls-2*il/Di+Dn*(il+il/di),Fl=Ai*Do-2*Sl/Di+Dn*(Sl+Sl/di),Js=ka*lo*Ls-2*Lo/(1+tn)+Dn*lo*Lo+Dn*ka*(il-il/di),Il=ka*lo*Do-2*Zo/(1+tn)+Dn*lo*Zo+Dn*ka*(Sl-Sl/di),ku=Fl*Js-Il*eu;if(!ku)break;var dl=(co*Fl-Vo*Il)/ku,pl=(Vo*Js-co*eu)/ku;it-=dl,ft=n(-S,s(S,ft-pl))}while((E(dl)>l||E(pl)>l)&&--Mt>0);return E(E(ft)-S)ft){var Xr=F(zr),la=t(wr,fr),pa=it*c(la/it),ka=la-pa,tn=qe*r(ka),Dn=(qe*p(ka)-ka*p(tn))/(S-tn),In=lt(ka,Dn),Yn=(w-qe)/br(In,tn,w);fr=Xr;var di=50,Di;do fr-=Di=(qe+br(In,tn,fr)*Yn-Xr)/(In(fr)*Yn);while(E(Di)>l&&--di>0);wr=ka*p(fr),frft){var fr=F(ir),wr=t(Pt,xt),zr=it*c(wr/it),Xr=wr-zr;xt=fr*r(Xr),Pt=fr*p(Xr);for(var la=xt-S,pa=p(xt),ka=Pt/pa,tn=xtl||E(ka)>l)&&--tn>0);return[Xr,la]},fr}var Tr=Lr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Cr(){return x.geoProjection(Tr).scale(149.995)}var Kr=Lr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Nr(){return x.geoProjection(Kr).scale(153.93)}var _t=Lr(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Wt(){return x.geoProjection(_t).scale(130.945)}function Ar(qe,Ze){var it=qe*qe,ft=Ze*Ze;return[qe*(1-.162388*ft)*(.87-952426e-9*it*it),Ze*(1+ft/12)]}Ar.invert=function(qe,Ze){var it=qe,ft=Ze,Mt=50,xt;do{var Pt=ft*ft;ft-=xt=(ft*(1+Pt/12)-Ze)/(1+Pt/4)}while(E(xt)>l&&--Mt>0);Mt=50,qe/=1-.162388*Pt;do{var ir=(ir=it*it)*ir;it-=xt=(it*(.87-952426e-9*ir)-qe)/(.87-.00476213*ir)}while(E(xt)>l&&--Mt>0);return[it,ft]};function Vr(){return x.geoProjection(Ar).scale(131.747)}var ma=Lr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ba(){return x.geoProjection(ma).scale(131.087)}function wa(qe){var Ze=qe(S,0)[0]-qe(-S,0)[0];function it(ft,Mt){var xt=ft>0?-.5:.5,Pt=qe(ft+xt*w,Mt);return Pt[0]-=xt*Ze,Pt}return qe.invert&&(it.invert=function(ft,Mt){var xt=ft>0?-.5:.5,Pt=qe.invert(ft+xt*Ze,Mt),ir=Pt[0]-xt*w;return ir<-w?ir+=2*w:ir>w&&(ir-=2*w),Pt[0]=ir,Pt}),it}function $r(qe,Ze){var it=m(qe),ft=m(Ze),Mt=r(Ze),xt=r(qe)*Mt,Pt=p(qe)*Mt,ir=p(ft*Ze);qe=E(t(Pt,ir)),Ze=L(xt),E(qe-S)>l&&(qe%=S);var fr=ga(qe>w/4?S-qe:qe,Ze);return qe>w/4&&(ir=fr[0],fr[0]=-fr[1],fr[1]=-ir),fr[0]*=it,fr[1]*=-ft,fr}$r.invert=function(qe,Ze){E(qe)>1&&(qe=m(qe)*2-qe),E(Ze)>1&&(Ze=m(Ze)*2-Ze);var it=m(qe),ft=m(Ze),Mt=-it*qe,xt=-ft*Ze,Pt=xt/Mt<1,ir=jn(Pt?xt:Mt,Pt?Mt:xt),fr=ir[0],wr=ir[1],zr=r(wr);return Pt&&(fr=-S-fr),[it*(t(p(fr)*zr,-p(wr))+w),ft*L(r(fr)*zr)]};function ga(qe,Ze){if(Ze===S)return[0,0];var it=p(Ze),ft=it*it,Mt=ft*ft,xt=1+Mt,Pt=1+3*Mt,ir=1-Mt,fr=L(1/F(xt)),wr=ir+ft*xt*fr,zr=(1-it)/wr,Xr=F(zr),la=zr*xt,pa=F(la),ka=Xr*ir,tn,Dn;if(qe===0)return[0,-(ka+ft*pa)];var In=r(Ze),Yn=1/In,di=2*it*In,Di=(-3*ft+fr*Pt)*di,Ai=(-wr*In-(1-it)*Di)/(wr*wr),lo=.5*Ai/Xr,Vo=ir*lo-2*ft*Xr*di,co=ft*xt*Ai+zr*Pt*di,Lo=-Yn*di,Zo=-Yn*co,Os=-2*Yn*Vo,Ls=4*qe/w,Do;if(qe>.222*w||Ze.175*w){if(tn=(ka+ft*F(la*(1+Mt)-ka*ka))/(1+Mt),qe>w/4)return[tn,tn];var zo=tn,il=.5*tn;tn=.5*(il+zo),Dn=50;do{var Sl=F(la-tn*tn),eu=tn*(Os+Lo*Sl)+Zo*L(tn/pa)-Ls;if(!eu)break;eu<0?il=tn:zo=tn,tn=.5*(il+zo)}while(E(zo-il)>l&&--Dn>0)}else{tn=l,Dn=25;do{var Fl=tn*tn,Js=F(la-Fl),Il=Os+Lo*Js,ku=tn*Il+Zo*L(tn/pa)-Ls,dl=Il+(Zo-Lo*Fl)/Js;tn-=Do=Js?ku/dl:0}while(E(Do)>l&&--Dn>0)}return[tn,-ka-ft*F(la-tn*tn)]}function jn(qe,Ze){for(var it=0,ft=1,Mt=.5,xt=50;;){var Pt=Mt*Mt,ir=F(Mt),fr=L(1/F(1+Pt)),wr=1-Pt+Mt*(1+Pt)*fr,zr=(1-ir)/wr,Xr=F(zr),la=zr*(1+Pt),pa=Xr*(1-Pt),ka=la-qe*qe,tn=F(ka),Dn=Ze+pa+Mt*tn;if(E(ft-it)<_||--xt===0||Dn===0)break;Dn>0?it=Mt:ft=Mt,Mt=.5*(it+ft)}if(!xt)return null;var In=L(ir),Yn=r(In),di=1/Yn,Di=2*ir*Yn,Ai=(-3*Mt+fr*(1+3*Pt))*Di,lo=(-wr*Yn-(1-ir)*Ai)/(wr*wr),Vo=.5*lo/Xr,co=(1-Pt)*Vo-2*Mt*Xr*Di,Lo=-2*di*co,Zo=-di*Di,Os=-di*(Mt*(1+Pt)*lo+zr*(1+3*Pt)*Di);return[w/4*(qe*(Lo+Zo*tn)+Os*L(qe/F(la))),In]}function an(){return x.geoProjection(wa($r)).scale(239.75)}function ei(qe,Ze,it){var ft,Mt,xt;return qe?(ft=li(qe,it),Ze?(Mt=li(Ze,1-it),xt=Mt[1]*Mt[1]+it*ft[0]*ft[0]*Mt[0]*Mt[0],[[ft[0]*Mt[2]/xt,ft[1]*ft[2]*Mt[0]*Mt[1]/xt],[ft[1]*Mt[1]/xt,-ft[0]*ft[2]*Mt[0]*Mt[2]/xt],[ft[2]*Mt[1]*Mt[2]/xt,-it*ft[0]*ft[1]*Mt[0]/xt]]):[[ft[0],0],[ft[1],0],[ft[2],0]]):(Mt=li(Ze,1-it),[[0,Mt[0]/Mt[1]],[1/Mt[1],0],[Mt[2]/Mt[1],0]])}function li(qe,Ze){var it,ft,Mt,xt,Pt;if(Ze=1-l)return it=(1-Ze)/4,ft=I(qe),xt=B(qe),Mt=1/ft,Pt=ft*O(qe),[xt+it*(Pt-qe)/(ft*ft),Mt-it*xt*Mt*(Pt-qe),Mt+it*xt*Mt*(Pt+qe),2*e(o(qe))-S+it*(Pt-qe)/ft];var ir=[1,0,0,0,0,0,0,0,0],fr=[F(Ze),0,0,0,0,0,0,0,0],wr=0;for(ft=F(1-Ze),Pt=1;E(fr[wr]/ir[wr])>l&&wr<8;)it=ir[wr++],fr[wr]=(it-ft)/2,ir[wr]=(it+ft)/2,ft=F(it*ft),Pt*=2;Mt=Pt*ir[wr]*qe;do xt=fr[wr]*p(ft=Mt)/ir[wr],Mt=(L(xt)+Mt)/2;while(--wr);return[p(Mt),xt=r(Mt),xt/r(Mt-ft),Mt]}function _i(qe,Ze,it){var ft=E(qe),Mt=E(Ze),xt=O(Mt);if(ft){var Pt=1/p(ft),ir=1/(T(ft)*T(ft)),fr=-(ir+it*(xt*xt*Pt*Pt)-1+it),wr=(it-1)*ir,zr=(-fr+F(fr*fr-4*wr))/2;return[xi(e(1/F(zr)),it)*m(qe),xi(e(F((zr/ir-1)/it)),1-it)*m(Ze)]}return[0,xi(e(xt),1-it)*m(Ze)]}function xi(qe,Ze){if(!Ze)return qe;if(Ze===1)return i(T(qe/2+M));for(var it=1,ft=F(1-Ze),Mt=F(Ze),xt=0;E(Mt)>l;xt++){if(qe%w){var Pt=e(ft*T(qe)/it);Pt<0&&(Pt+=w),qe+=Pt+~~(qe/w)*w}else qe+=qe;Mt=(it+ft)/2,ft=F(it*ft),Mt=((it=Mt)-ft)/2}return qe/(h(2,xt)*it)}function Pi(qe,Ze){var it=(b-1)/(b+1),ft=F(1-it*it),Mt=xi(S,ft*ft),xt=-1,Pt=i(T(w/4+E(Ze)/2)),ir=o(xt*Pt)/F(it),fr=Li(ir*r(xt*qe),ir*p(xt*qe)),wr=_i(fr[0],fr[1],ft*ft);return[-wr[1],(Ze>=0?1:-1)*(.5*Mt-wr[0])]}function Li(qe,Ze){var it=qe*qe,ft=Ze+1,Mt=1-it-Ze*Ze;return[.5*((qe>=0?S:-S)-t(Mt,2*qe)),-.25*i(Mt*Mt+4*it)+.5*i(ft*ft+it)]}function ri(qe,Ze){var it=Ze[0]*Ze[0]+Ze[1]*Ze[1];return[(qe[0]*Ze[0]+qe[1]*Ze[1])/it,(qe[1]*Ze[0]-qe[0]*Ze[1])/it]}Pi.invert=function(qe,Ze){var it=(b-1)/(b+1),ft=F(1-it*it),Mt=xi(S,ft*ft),xt=-1,Pt=ei(.5*Mt-Ze,-qe,ft*ft),ir=ri(Pt[0],Pt[1]),fr=t(ir[1],ir[0])/xt;return[fr,2*e(o(.5/xt*i(it*ir[0]*ir[0]+it*ir[1]*ir[1])))-S]};function vo(){return x.geoProjection(wa(Pi)).scale(151.496)}function Eo(qe){var Ze=p(qe),it=r(qe),ft=uo(qe);ft.invert=uo(-qe);function Mt(xt,Pt){var ir=ft(xt,Pt);xt=ir[0],Pt=ir[1];var fr=p(Pt),wr=r(Pt),zr=r(xt),Xr=z(Ze*fr+it*wr*zr),la=p(Xr),pa=E(la)>l?Xr/la:1;return[pa*it*p(xt),(E(xt)>S?pa:-pa)*(Ze*wr-it*fr*zr)]}return Mt.invert=function(xt,Pt){var ir=F(xt*xt+Pt*Pt),fr=-p(ir),wr=r(ir),zr=ir*wr,Xr=-Pt*fr,la=ir*Ze,pa=F(zr*zr+Xr*Xr-la*la),ka=t(zr*la+Xr*pa,Xr*la-zr*pa),tn=(ir>S?-1:1)*t(xt*fr,ir*r(ka)*wr+Pt*p(ka)*fr);return ft.invert(tn,ka)},Mt}function uo(qe){var Ze=p(qe),it=r(qe);return function(ft,Mt){var xt=r(Mt),Pt=r(ft)*xt,ir=p(ft)*xt,fr=p(Mt);return[t(ir,Pt*it-fr*Ze),L(fr*it+Pt*Ze)]}}function ao(){var qe=0,Ze=x.geoProjectionMutator(Eo),it=Ze(qe),ft=it.rotate,Mt=it.stream,xt=x.geoCircle();return it.parallel=function(Pt){if(!arguments.length)return qe*g;var ir=it.rotate();return Ze(qe=Pt*f).rotate(ir)},it.rotate=function(Pt){return arguments.length?(ft.call(it,[Pt[0],Pt[1]-qe*g]),xt.center([-Pt[0],-Pt[1]]),it):(Pt=ft.call(it),Pt[1]+=qe*g,Pt)},it.stream=function(Pt){return Pt=Mt(Pt),Pt.sphere=function(){Pt.polygonStart();var ir=.01,fr=xt.radius(90-ir)().coordinates[0],wr=fr.length-1,zr=-1,Xr;for(Pt.lineStart();++zr=0;)Pt.point((Xr=fr[zr])[0],Xr[1]);Pt.lineEnd(),Pt.polygonEnd()},Pt},it.scale(79.4187).parallel(45).clipAngle(180-.001)}var mo=3,Bo=L(1-1/mo)*g,Go=Ct(0);function Ko(qe){var Ze=Bo*f,it=Ne(w,Ze)[0]-Ne(-w,Ze)[0],ft=Go(0,Ze)[1],Mt=Ne(0,Ze)[1],xt=v-Mt,Pt=u/qe,ir=4/u,fr=ft+xt*xt*4/u;function wr(zr,Xr){var la,pa=E(Xr);if(pa>Ze){var ka=s(qe-1,n(0,a((zr+w)/Pt)));zr+=w*(qe-1)/qe-ka*Pt,la=Ne(zr,pa),la[0]=la[0]*u/it-u*(qe-1)/(2*qe)+ka*u/qe,la[1]=ft+(la[1]-Mt)*4*xt/u,Xr<0&&(la[1]=-la[1])}else la=Go(zr,Xr);return la[0]*=ir,la[1]/=fr,la}return wr.invert=function(zr,Xr){zr/=ir,Xr*=fr;var la=E(Xr);if(la>ft){var pa=s(qe-1,n(0,a((zr+w)/Pt)));zr=(zr+w*(qe-1)/qe-pa*Pt)*it/u;var ka=Ne.invert(zr,.25*(la-ft)*u/xt+Mt);return ka[0]-=w*(qe-1)/qe-pa*Pt,Xr<0&&(ka[1]=-ka[1]),ka}return Go.invert(zr,Xr)},wr}function Qi(qe,Ze){return[qe,Ze&1?90-l:Bo]}function eo(qe,Ze){return[qe,Ze&1?-90+l:-Bo]}function Ei(qe){return[qe[0]*(1-l),qe[1]]}function Xi(qe){var Ze=[].concat(A.range(-180,180+qe/2,qe).map(Qi),A.range(180,-180-qe/2,-qe).map(eo));return{type:"Polygon",coordinates:[qe===180?Ze.map(Ei):Ze]}}function Jo(){var qe=4,Ze=x.geoProjectionMutator(Ko),it=Ze(qe),ft=it.stream;return it.lobes=function(Mt){return arguments.length?Ze(qe=+Mt):qe},it.stream=function(Mt){var xt=it.rotate(),Pt=ft(Mt),ir=(it.rotate([0,0]),ft(Mt));return it.rotate(xt),Pt.sphere=function(){x.geoStream(Xi(180/qe),ir)},Pt},it.scale(239.75)}function ms(qe){var Ze=1+qe,it=p(1/Ze),ft=L(it),Mt=2*F(w/(xt=w+4*ft*Ze)),xt,Pt=.5*Mt*(Ze+F(qe*(2+qe))),ir=qe*qe,fr=Ze*Ze;function wr(zr,Xr){var la=1-p(Xr),pa,ka;if(la&&la<2){var tn=S-Xr,Dn=25,In;do{var Yn=p(tn),di=r(tn),Di=ft+t(Yn,Ze-di),Ai=1+fr-2*Ze*di;tn-=In=(tn-ir*ft-Ze*Yn+Ai*Di-.5*la*xt)/(2*Ze*Yn*Di)}while(E(In)>_&&--Dn>0);pa=Mt*F(Ai),ka=zr*Di/w}else pa=Mt*(qe+la),ka=zr*ft/w;return[pa*p(ka),Pt-pa*r(ka)]}return wr.invert=function(zr,Xr){var la=zr*zr+(Xr-=Pt)*Xr,pa=(1+fr-la/(Mt*Mt))/(2*Ze),ka=z(pa),tn=p(ka),Dn=ft+t(tn,Ze-pa);return[L(zr/F(la))*w/Dn,L(1-2*(ka-ir*ft-Ze*tn+(1+fr-2*Ze*pa)*Dn)/xt)]},wr}function _s(){var qe=1,Ze=x.geoProjectionMutator(ms),it=Ze(qe);return it.ratio=function(ft){return arguments.length?Ze(qe=+ft):qe},it.scale(167.774).center([0,18.67])}var ko=.7109889596207567,Nn=.0528035274542;function pi(qe,Ze){return Ze>-ko?(qe=ot(qe,Ze),qe[1]+=Nn,qe):Ke(qe,Ze)}pi.invert=function(qe,Ze){return Ze>-ko?ot.invert(qe,Ze-Nn):Ke.invert(qe,Ze)};function gs(){return x.geoProjection(pi).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Io(qe,Ze){return E(Ze)>ko?(qe=ot(qe,Ze),qe[1]-=Ze>0?Nn:-Nn,qe):Ke(qe,Ze)}Io.invert=function(qe,Ze){return E(Ze)>ko?ot.invert(qe,Ze+(Ze>0?Nn:-Nn)):Ke.invert(qe,Ze)};function Zi(){return x.geoProjection(Io).scale(152.63)}function ys(qe,Ze,it,ft){var Mt=F(4*w/(2*it+(1+qe-Ze/2)*p(2*it)+(qe+Ze)/2*p(4*it)+Ze/2*p(6*it))),xt=F(ft*p(it)*F((1+qe*r(2*it)+Ze*r(4*it))/(1+qe+Ze))),Pt=it*fr(1);function ir(Xr){return F(1+qe*r(2*Xr)+Ze*r(4*Xr))}function fr(Xr){var la=Xr*it;return(2*la+(1+qe-Ze/2)*p(2*la)+(qe+Ze)/2*p(4*la)+Ze/2*p(6*la))/it}function wr(Xr){return ir(Xr)*p(Xr)}var zr=function(Xr,la){var pa=it*Ie(fr,Pt*p(la)/it,la/w);isNaN(pa)&&(pa=it*m(la));var ka=Mt*ir(pa);return[ka*xt*Xr/w*r(pa),ka/xt*p(pa)]};return zr.invert=function(Xr,la){var pa=Ie(wr,la*xt/Mt);return[Xr*w/(r(pa)*Mt*xt*ir(pa)),L(it*fr(pa/it)/Pt)]},it===0&&(Mt=F(ft/w),zr=function(Xr,la){return[Xr*Mt,p(la)/Mt]},zr.invert=function(Xr,la){return[Xr/Mt,L(la*Mt)]}),zr}function rs(){var qe=1,Ze=0,it=45*f,ft=2,Mt=x.geoProjectionMutator(ys),xt=Mt(qe,Ze,it,ft);return xt.a=function(Pt){return arguments.length?Mt(qe=+Pt,Ze,it,ft):qe},xt.b=function(Pt){return arguments.length?Mt(qe,Ze=+Pt,it,ft):Ze},xt.psiMax=function(Pt){return arguments.length?Mt(qe,Ze,it=+Pt*f,ft):it*g},xt.ratio=function(Pt){return arguments.length?Mt(qe,Ze,it,ft=+Pt):ft},xt.scale(180.739)}function fs(qe,Ze,it,ft,Mt,xt,Pt,ir,fr,wr,zr){if(zr.nanEncountered)return NaN;var Xr,la,pa,ka,tn,Dn,In,Yn,di,Di;if(Xr=it-Ze,la=qe(Ze+Xr*.25),pa=qe(it-Xr*.25),isNaN(la)){zr.nanEncountered=!0;return}if(isNaN(pa)){zr.nanEncountered=!0;return}return ka=Xr*(ft+4*la+Mt)/12,tn=Xr*(Mt+4*pa+xt)/12,Dn=ka+tn,Di=(Dn-Pt)/15,wr>fr?(zr.maxDepthCount++,Dn+Di):Math.abs(Di)>1;do fr[Dn]>pa?tn=Dn:ka=Dn,Dn=ka+tn>>1;while(Dn>ka);var In=fr[Dn+1]-fr[Dn];return In&&(In=(pa-fr[Dn+1])/In),(Dn+1+In)/Pt}var Xr=2*zr(1)/w*xt/it,la=function(pa,ka){var tn=zr(E(p(ka))),Dn=ft(tn)*pa;return tn/=Xr,[Dn,ka>=0?tn:-tn]};return la.invert=function(pa,ka){var tn;return ka*=Xr,E(ka)<1&&(tn=m(ka)*L(Mt(E(ka))*xt)),[pa/ft(E(ka)),tn]},la}function oo(){var qe=0,Ze=2.5,it=1.183136,ft=x.geoProjectionMutator(ci),Mt=ft(qe,Ze,it);return Mt.alpha=function(xt){return arguments.length?ft(qe=+xt,Ze,it):qe},Mt.k=function(xt){return arguments.length?ft(qe,Ze=+xt,it):Ze},Mt.gamma=function(xt){return arguments.length?ft(qe,Ze,it=+xt):it},Mt.scale(152.63)}function so(qe,Ze){return E(qe[0]-Ze[0])=0;--fr)it=qe[1][fr],ft=it[0][0],Mt=it[0][1],xt=it[1][1],Pt=it[2][0],ir=it[2][1],Ze.push(js([[Pt-l,ir-l],[Pt-l,xt+l],[ft+l,xt+l],[ft+l,Mt-l]],30));return{type:"Polygon",coordinates:[A.merge(Ze)]}}function Ni(qe,Ze,it){var ft,Mt;function xt(fr,wr){for(var zr=wr<0?-1:1,Xr=Ze[+(wr<0)],la=0,pa=Xr.length-1;laXr[la][2][0];++la);var ka=qe(fr-Xr[la][1][0],wr);return ka[0]+=qe(Xr[la][1][0],zr*wr>zr*Xr[la][0][1]?Xr[la][0][1]:wr)[0],ka}it?xt.invert=it(xt):qe.invert&&(xt.invert=function(fr,wr){for(var zr=Mt[+(wr<0)],Xr=Ze[+(wr<0)],la=0,pa=zr.length;laka&&(tn=pa,pa=ka,ka=tn),[[Xr,pa],[la,ka]]})}),Pt):Ze.map(function(wr){return wr.map(function(zr){return[[zr[0][0]*g,zr[0][1]*g],[zr[1][0]*g,zr[1][1]*g],[zr[2][0]*g,zr[2][1]*g]]})})},Ze!=null&&Pt.lobes(Ze),Pt}var Ns=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ks(){return Ni(ze,Ns).scale(160.857)}var jo=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hs(){return Ni(Io,jo).scale(152.63)}var ks=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function xs(){return Ni(ot,ks).scale(169.529)}var ll=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function ql(){return Ni(ot,ll).scale(169.529).rotate([20,0])}var wu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Yl(){return Ni(pi,wu,De).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var kc=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function ec(){return Ni(Ke,kc).scale(152.63).rotate([-20,0])}function vs(qe,Ze){return[3/u*qe*F(w*w/3-Ze*Ze),Ze]}vs.invert=function(qe,Ze){return[u/3*qe/F(w*w/3-Ze*Ze),Ze]};function Ru(){return x.geoProjection(vs).scale(158.837)}function Cc(qe){function Ze(it,ft){if(E(E(ft)-S)2)return null;it/=2,ft/=2;var xt=it*it,Pt=ft*ft,ir=2*ft/(1+xt+Pt);return ir=h((1+ir)/(1-ir),1/qe),[t(2*it,1-xt-Pt)/qe,L((ir-1)/(ir+1))]},Ze}function Ll(){var qe=.5,Ze=x.geoProjectionMutator(Cc),it=Ze(qe);return it.spacing=function(ft){return arguments.length?Ze(qe=+ft):qe},it.scale(124.75)}var nl=w/b;function Tu(qe,Ze){return[qe*(1+F(r(Ze)))/2,Ze/(r(Ze/2)*r(qe/6))]}Tu.invert=function(qe,Ze){var it=E(qe),ft=E(Ze),Mt=l,xt=S;ftl||E(Dn)>l)&&--Mt>0);return Mt&&[it,ft]};function Gs(){return x.geoProjection(Rs).scale(139.98)}function Qo(qe,Ze){return[p(qe)/r(Ze),T(Ze)*r(qe)]}Qo.invert=function(qe,Ze){var it=qe*qe,ft=Ze*Ze,Mt=ft+1,xt=it+Mt,Pt=qe?y*F((xt-F(xt*xt-4*it))/it):1/F(Mt);return[L(qe*Pt),m(Ze)*z(Pt)]};function ws(){return x.geoProjection(Qo).scale(144.049).clipAngle(90-.001)}function Au(qe){var Ze=r(qe),it=T(M+qe/2);function ft(Mt,xt){var Pt=xt-qe,ir=E(Pt)=0;)zr=qe[wr],Xr=zr[0]+ir*(pa=Xr)-fr*la,la=zr[1]+ir*la+fr*pa;return Xr=ir*(pa=Xr)-fr*la,la=ir*la+fr*pa,[Xr,la]}return it.invert=function(ft,Mt){var xt=20,Pt=ft,ir=Mt;do{for(var fr=Ze,wr=qe[fr],zr=wr[0],Xr=wr[1],la=0,pa=0,ka;--fr>=0;)wr=qe[fr],la=zr+Pt*(ka=la)-ir*pa,pa=Xr+Pt*pa+ir*ka,zr=wr[0]+Pt*(ka=zr)-ir*Xr,Xr=wr[1]+Pt*Xr+ir*ka;la=zr+Pt*(ka=la)-ir*pa,pa=Xr+Pt*pa+ir*ka,zr=Pt*(ka=zr)-ir*Xr-ft,Xr=Pt*Xr+ir*ka-Mt;var tn=la*la+pa*pa,Dn,In;Pt-=Dn=(zr*la+Xr*pa)/tn,ir-=In=(Xr*la-zr*pa)/tn}while(E(Dn)+E(In)>l*l&&--xt>0);if(xt){var Yn=F(Pt*Pt+ir*ir),di=2*e(Yn*.5),Di=p(di);return[t(Pt*Di,Yn*r(di)),Yn?L(ir*Di/Yn):0]}},it}var qo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],xf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],is=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Ui=[[.9245,0],[0,0],[.01943,0]],ac=[[.721316,0],[0,0],[-.00881625,-.00617325]];function uu(){return Tl(qo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function hl(){return Tl(xf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Lc(){return Tl(is,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function ju(){return Tl(Ui,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function dc(){return Tl(ac,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Tl(qe,Ze){var it=x.geoProjection(_f(qe)).rotate(Ze).clipAngle(90),ft=x.geoRotation(Ze),Mt=it.center;return delete it.rotate,it.center=function(xt){return arguments.length?Mt(ft(xt)):ft.invert(Mt())},it}var Kc=F(6),Fc=F(7);function pc(qe,Ze){var it=L(7*p(Ze)/(3*Kc));return[Kc*qe*(2*r(2*it/3)-1)/Fc,9*p(it/3)/Fc]}pc.invert=function(qe,Ze){var it=3*L(Ze*Fc/9);return[qe*Fc/(Kc*(2*r(2*it/3)-1)),L(p(it)*3*Kc/7)]};function tc(){return x.geoProjection(pc).scale(164.859)}function Oc(qe,Ze){for(var it=(1+y)*p(Ze),ft=Ze,Mt=0,xt;Mt<25&&(ft-=xt=(p(ft/2)+p(ft)-it)/(.5*r(ft/2)+r(ft)),!(E(xt)_&&--ft>0);return xt=it*it,Pt=xt*xt,ir=xt*Pt,[qe/(.84719-.13063*xt+ir*ir*(-.04515+.05494*xt-.02326*Pt+.00331*ir)),it]};function nc(){return x.geoProjection(Su).scale(175.295)}function Al(qe,Ze){return[qe*(1+r(Ze))/2,2*(Ze-T(Ze/2))]}Al.invert=function(qe,Ze){for(var it=Ze/2,ft=0,Mt=1/0;ft<10&&E(Mt)>l;++ft){var xt=r(Ze/2);Ze-=Mt=(Ze-T(Ze/2)-it)/(1-.5/(xt*xt))}return[2*qe/(1+r(Ze)),Ze]};function rc(){return x.geoProjection(Al).scale(152.63)}var Vu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ts(){return Ni(ue(1/0),Vu).rotate([20,0]).scale(152.63)}function Ic(qe,Ze){var it=p(Ze),ft=r(Ze),Mt=m(qe);if(qe===0||E(Ze)===S)return[0,Ze];if(Ze===0)return[qe,0];if(E(qe)===S)return[qe*ft,S*it];var xt=w/(2*qe)-2*qe/w,Pt=2*Ze/w,ir=(1-Pt*Pt)/(it-Pt),fr=xt*xt,wr=ir*ir,zr=1+fr/wr,Xr=1+wr/fr,la=(xt*it/ir-xt/2)/zr,pa=(wr*it/fr+ir/2)/Xr,ka=la*la+ft*ft/zr,tn=pa*pa-(wr*it*it/fr+ir*it-1)/Xr;return[S*(la+F(ka)*Mt),S*(pa+F(tn<0?0:tn)*m(-Ze*xt)*Mt)]}Ic.invert=function(qe,Ze){qe/=S,Ze/=S;var it=qe*qe,ft=Ze*Ze,Mt=it+ft,xt=w*w;return[qe?(Mt-1+F((1-Mt)*(1-Mt)+4*it))/(2*qe)*S:0,Ie(function(Pt){return Mt*(w*p(Pt)-2*Pt)*w+4*Pt*Pt*(Ze-p(Pt))+2*w*Pt-xt*Ze},0)]};function sf(){return x.geoProjection(Ic).scale(127.267)}var Nc=1.0148,ic=.23185,Jc=-.14499,Kl=.02406,Uc=Nc,Hs=5*ic,Jl=7*Jc,qu=9*Kl,Ds=1.790857183;function Du(qe,Ze){var it=Ze*Ze;return[qe,Ze*(Nc+it*it*(ic+it*(Jc+Kl*it)))]}Du.invert=function(qe,Ze){Ze>Ds?Ze=Ds:Ze<-Ds&&(Ze=-Ds);var it=Ze,ft;do{var Mt=it*it;it-=ft=(it*(Nc+Mt*Mt*(ic+Mt*(Jc+Kl*Mt)))-Ze)/(Uc+Mt*Mt*(Hs+Mt*(Jl+qu*Mt)))}while(E(ft)>l);return[qe,it]};function Nl(){return x.geoProjection(Du).scale(139.319)}function Gl(qe,Ze){if(E(Ze)l&&--Mt>0);return Pt=T(ft),[(E(Ze)=0;)if(ft=Ze[ir],it[0]===ft[0]&&it[1]===ft[1]){if(xt)return[xt,it];xt=it}}}function kl(qe){for(var Ze=qe.length,it=[],ft=qe[Ze-1],Mt=0;Mt0?[-ft[0],0]:[180-ft[0],180])};var Ze=Tc.map(function(it){return{face:it,project:qe(it)}});return[-1,0,0,1,0,1,4,5].forEach(function(it,ft){var Mt=Ze[it];Mt&&(Mt.children||(Mt.children=[])).push(Ze[ft])}),mc(Ze[0],function(it,ft){return Ze[it<-w/2?ft<0?6:4:it<0?ft<0?2:0:itft^pa>ft&&it<(la-wr)*(ft-zr)/(pa-zr)+wr&&(Mt=!Mt)}return Mt}function Cl(qe,Ze){var it=Ze.stream,ft;if(!it)throw new Error("invalid projection");switch(qe&&qe.type){case"Feature":ft=vu;break;case"FeatureCollection":ft=Vc;break;default:ft=Fu;break}return ft(qe,it)}function Vc(qe,Ze){return{type:"FeatureCollection",features:qe.features.map(function(it){return vu(it,Ze)})}}function vu(qe,Ze){return{type:"Feature",id:qe.id,properties:qe.properties,geometry:Fu(qe.geometry,Ze)}}function Wu(qe,Ze){return{type:"GeometryCollection",geometries:qe.geometries.map(function(it){return Fu(it,Ze)})}}function Fu(qe,Ze){if(!qe)return null;if(qe.type==="GeometryCollection")return Wu(qe,Ze);var it;switch(qe.type){case"Point":it=Xu;break;case"MultiPoint":it=Xu;break;case"LineString":it=lc;break;case"MultiLineString":it=lc;break;case"Polygon":it=Mu;break;case"MultiPolygon":it=Mu;break;case"Sphere":it=Mu;break;default:return null}return x.geoStream(qe,Ze(it)),it.result()}var vl=[],jl=[],Xu={point:function(qe,Ze){vl.push([qe,Ze])},result:function(){var qe=vl.length?vl.length<2?{type:"Point",coordinates:vl[0]}:{type:"MultiPoint",coordinates:vl}:null;return vl=[],qe}},lc={lineStart:hu,point:function(qe,Ze){vl.push([qe,Ze])},lineEnd:function(){vl.length&&(jl.push(vl),vl=[])},result:function(){var qe=jl.length?jl.length<2?{type:"LineString",coordinates:jl[0]}:{type:"MultiLineString",coordinates:jl}:null;return jl=[],qe}},Mu={polygonStart:hu,lineStart:hu,point:function(qe,Ze){vl.push([qe,Ze])},lineEnd:function(){var qe=vl.length;if(qe){do vl.push(vl[0].slice());while(++qe<4);jl.push(vl),vl=[]}},polygonEnd:hu,result:function(){if(!jl.length)return null;var qe=[],Ze=[];return jl.forEach(function(it){sc(it)?qe.push([it]):Ze.push(it)}),Ze.forEach(function(it){var ft=it[0];qe.some(function(Mt){if(Dc(Mt[0],ft))return Mt.push(it),!0})||qe.push([it])}),jl=[],qe.length?qe.length>1?{type:"MultiPolygon",coordinates:qe}:{type:"Polygon",coordinates:qe[0]}:null}};function Zu(qe){var Ze=qe(S,0)[0]-qe(-S,0)[0];function it(ft,Mt){var xt=E(ft)0?ft-w:ft+w,Mt),ir=(Pt[0]-Pt[1])*y,fr=(Pt[0]+Pt[1])*y;if(xt)return[ir,fr];var wr=Ze*y,zr=ir>0^fr>0?-1:1;return[zr*ir-m(fr)*wr,zr*fr-m(ir)*wr]}return qe.invert&&(it.invert=function(ft,Mt){var xt=(ft+Mt)*y,Pt=(Mt-ft)*y,ir=E(xt)<.5*Ze&&E(Pt)<.5*Ze;if(!ir){var fr=Ze*y,wr=xt>0^Pt>0?-1:1,zr=-wr*ft+(Pt>0?1:-1)*fr,Xr=-wr*Mt+(xt>0?1:-1)*fr;xt=(-zr-Xr)*y,Pt=(zr-Xr)*y}var la=qe.invert(xt,Pt);return ir||(la[0]+=xt>0?w:-w),la}),x.geoProjection(it).rotate([-90,-90,45]).clipAngle(180-.001)}function Yt(){return Zu($r).scale(176.423)}function vr(){return Zu(Pi).scale(111.48)}function Qr(qe,Ze){if(!(0<=(Ze=+Ze)&&Ze<=20))throw new Error("invalid digits");function it(wr){var zr=wr.length,Xr=2,la=new Array(zr);for(la[0]=+wr[0].toFixed(Ze),la[1]=+wr[1].toFixed(Ze);Xr2||pa[0]!=zr[0]||pa[1]!=zr[1])&&(Xr.push(pa),zr=pa)}return Xr.length===1&&wr.length>1&&Xr.push(it(wr[wr.length-1])),Xr}function xt(wr){return wr.map(Mt)}function Pt(wr){if(wr==null)return wr;var zr;switch(wr.type){case"GeometryCollection":zr={type:"GeometryCollection",geometries:wr.geometries.map(Pt)};break;case"Point":zr={type:"Point",coordinates:it(wr.coordinates)};break;case"MultiPoint":zr={type:wr.type,coordinates:ft(wr.coordinates)};break;case"LineString":zr={type:wr.type,coordinates:Mt(wr.coordinates)};break;case"MultiLineString":case"Polygon":zr={type:wr.type,coordinates:xt(wr.coordinates)};break;case"MultiPolygon":zr={type:"MultiPolygon",coordinates:wr.coordinates.map(xt)};break;default:return wr}return wr.bbox!=null&&(zr.bbox=wr.bbox),zr}function ir(wr){var zr={type:"Feature",properties:wr.properties,geometry:Pt(wr.geometry)};return wr.id!=null&&(zr.id=wr.id),wr.bbox!=null&&(zr.bbox=wr.bbox),zr}if(qe!=null)switch(qe.type){case"Feature":return ir(qe);case"FeatureCollection":{var fr={type:"FeatureCollection",features:qe.features.map(ir)};return qe.bbox!=null&&(fr.bbox=qe.bbox),fr}default:return Pt(qe)}return qe}function Wr(qe){var Ze=p(qe);function it(ft,Mt){var xt=Ze?T(ft*Ze/2)/Ze:ft/2;if(!Mt)return[2*xt,-qe];var Pt=2*e(xt*p(Mt)),ir=1/T(Mt);return[p(Pt)*ir,Mt+(1-r(Pt))*ir-qe]}return it.invert=function(ft,Mt){if(E(Mt+=qe)l&&--ir>0);var la=ft*(wr=T(Pt)),pa=T(E(Mt)0?S:-S)*(fr+Mt*(zr-Pt)/2+Mt*Mt*(zr-2*fr+Pt)/2)]}xn.invert=function(qe,Ze){var it=Ze/S,ft=it*90,Mt=s(18,E(ft/5)),xt=n(0,a(Mt));do{var Pt=Qa[xt][1],ir=Qa[xt+1][1],fr=Qa[s(19,xt+2)][1],wr=fr-Pt,zr=fr-2*ir+Pt,Xr=2*(E(it)-ir)/wr,la=zr/wr,pa=Xr*(1-la*Xr*(1-2*la*Xr));if(pa>=0||xt===1){ft=(Ze>=0?5:-5)*(pa+Mt);var ka=50,tn;do Mt=s(18,E(ft)/5),xt=a(Mt),pa=Mt-xt,Pt=Qa[xt][1],ir=Qa[xt+1][1],fr=Qa[s(19,xt+2)][1],ft-=(tn=(Ze>=0?S:-S)*(ir+pa*(fr-Pt)/2+pa*pa*(fr-2*ir+Pt)/2)-Ze)*g;while(E(tn)>_&&--ka>0);break}}while(--xt>=0);var Dn=Qa[xt][0],In=Qa[xt+1][0],Yn=Qa[s(19,xt+2)][0];return[qe/(In+pa*(Yn-Dn)/2+pa*pa*(Yn-2*In+Dn)/2),ft*f]};function zn(){return x.geoProjection(xn).scale(152.63)}function Gn(qe){function Ze(it,ft){var Mt=r(ft),xt=(qe-1)/(qe-Mt*r(it));return[xt*Mt*p(it),xt*p(ft)]}return Ze.invert=function(it,ft){var Mt=it*it+ft*ft,xt=F(Mt),Pt=(qe-F(1-Mt*(qe+1)/(qe-1)))/((qe-1)/xt+xt/(qe-1));return[t(it*Pt,xt*F(1-Pt*Pt)),xt?L(ft*Pt/xt):0]},Ze}function ni(qe,Ze){var it=Gn(qe);if(!Ze)return it;var ft=r(Ze),Mt=p(Ze);function xt(Pt,ir){var fr=it(Pt,ir),wr=fr[1],zr=wr*Mt/(qe-1)+ft;return[fr[0]*ft/zr,wr/zr]}return xt.invert=function(Pt,ir){var fr=(qe-1)/(qe-1-ir*Mt);return it.invert(fr*Pt,fr*ir*ft)},xt}function wn(){var qe=2,Ze=0,it=x.geoProjectionMutator(ni),ft=it(qe,Ze);return ft.distance=function(Mt){return arguments.length?it(qe=+Mt,Ze):qe},ft.tilt=function(Mt){return arguments.length?it(qe,Ze=Mt*f):Ze*g},ft.scale(432.147).clipAngle(z(1/qe)*g-1e-6)}var Sn=1e-4,Ln=1e4,un=-180,mi=un+Sn,Oi=180,Vi=Oi-Sn,Bi=-90,Yi=Bi+Sn,vi=90,Qn=vi-Sn;function no(qe){return qe.length>0}function Ro(qe){return Math.floor(qe*Ln)/Ln}function as(qe){return qe===Bi||qe===vi?[0,qe]:[un,Ro(qe)]}function Ps(qe){var Ze=qe[0],it=qe[1],ft=!1;return Ze<=mi?(Ze=un,ft=!0):Ze>=Vi&&(Ze=Oi,ft=!0),it<=Yi?(it=Bi,ft=!0):it>=Qn&&(it=vi,ft=!0),ft?[Ze,it]:qe}function ds(qe){return qe.map(Ps)}function Cs(qe,Ze,it){for(var ft=0,Mt=qe.length;ft=Vi||zr<=Yi||zr>=Qn){xt[Pt]=Ps(fr);for(var Xr=Pt+1;Xrmi&&paYi&&ka=ir)break;it.push({index:-1,polygon:Ze,ring:xt=xt.slice(Xr-1)}),xt[0]=as(xt[0][1]),Pt=-1,ir=xt.length}}}}function es(qe){var Ze,it=qe.length,ft={},Mt={},xt,Pt,ir,fr,wr;for(Ze=0;Ze0?w-ir:ir)*g],wr=x.geoProjection(qe(Pt)).rotate(fr),zr=x.geoRotation(fr),Xr=wr.center;return delete wr.rotate,wr.center=function(la){return arguments.length?Xr(zr(la)):zr.invert(Xr())},wr.clipAngle(90)}function us(qe){var Ze=r(qe);function it(ft,Mt){var xt=x.geoGnomonicRaw(ft,Mt);return xt[0]*=Ze,xt}return it.invert=function(ft,Mt){return x.geoGnomonicRaw.invert(ft/Ze,Mt)},it}function Pl(){return Ql([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Ql(qe,Ze){return Ss(us,qe,Ze)}function du(qe){if(!(qe*=2))return x.geoAzimuthalEquidistantRaw;var Ze=-qe/2,it=-Ze,ft=qe*qe,Mt=T(it),xt=.5/p(it);function Pt(ir,fr){var wr=z(r(fr)*r(ir-Ze)),zr=z(r(fr)*r(ir-it)),Xr=fr<0?-1:1;return wr*=wr,zr*=zr,[(wr-zr)/(2*qe),Xr*F(4*ft*zr-(ft-wr+zr)*(ft-wr+zr))/(2*qe)]}return Pt.invert=function(ir,fr){var wr=fr*fr,zr=r(F(wr+(la=ir+Ze)*la)),Xr=r(F(wr+(la=ir+it)*la)),la,pa;return[t(pa=zr-Xr,la=(zr+Xr)*Mt),(fr<0?-1:1)*z(F(la*la+pa*pa)*xt)]},Pt}function Yu(){return Vl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Vl(qe,Ze){return Ss(du,qe,Ze)}function Ku(qe,Ze){if(E(Ze)l&&--ir>0);return[m(qe)*(F(Mt*Mt+4)+Mt)*w/4,S*Pt]};function pu(){return x.geoProjection(Eu).scale(127.16)}function Be(qe,Ze,it,ft,Mt){function xt(Pt,ir){var fr=it*p(ft*ir),wr=F(1-fr*fr),zr=F(2/(1+wr*r(Pt*=Mt)));return[qe*wr*zr*p(Pt),Ze*fr*zr]}return xt.invert=function(Pt,ir){var fr=Pt/qe,wr=ir/Ze,zr=F(fr*fr+wr*wr),Xr=2*L(zr/2);return[t(Pt*T(Xr),qe*zr)/Mt,zr&&L(ir*p(Xr)/(Ze*it*zr))/ft]},xt}function R(qe,Ze,it,ft){var Mt=w/3;qe=n(qe,l),Ze=n(Ze,l),qe=s(qe,S),Ze=s(Ze,w-l),it=n(it,0),it=s(it,100-l),ft=n(ft,l);var xt=it/100+1,Pt=ft/100,ir=z(xt*r(Mt))/Mt,fr=p(qe)/p(ir*S),wr=Ze/w,zr=F(Pt*p(qe/2)/p(Ze/2)),Xr=zr/F(wr*fr*ir),la=1/(zr*F(wr*fr*ir));return Be(Xr,la,fr,ir,wr)}function ae(){var qe=65*f,Ze=60*f,it=20,ft=200,Mt=x.geoProjectionMutator(R),xt=Mt(qe,Ze,it,ft);return xt.poleline=function(Pt){return arguments.length?Mt(qe=+Pt*f,Ze,it,ft):qe*g},xt.parallels=function(Pt){return arguments.length?Mt(qe,Ze=+Pt*f,it,ft):Ze*g},xt.inflation=function(Pt){return arguments.length?Mt(qe,Ze,it=+Pt,ft):it},xt.ratio=function(Pt){return arguments.length?Mt(qe,Ze,it,ft=+Pt):ft},xt.scale(163.775)}function xe(){return ae().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var we=4*w+3*F(3),Fe=2*F(2*w*F(3)/we),ct=$e(Fe*F(3)/w,Fe,we/6);function bt(){return x.geoProjection(ct).scale(176.84)}function zt(qe,Ze){return[qe*F(1-3*Ze*Ze/(w*w)),Ze]}zt.invert=function(qe,Ze){return[qe/F(1-3*Ze*Ze/(w*w)),Ze]};function Zt(){return x.geoProjection(zt).scale(152.63)}function gr(qe,Ze){var it=r(Ze),ft=r(qe)*it,Mt=1-ft,xt=r(qe=t(p(qe)*it,-p(Ze))),Pt=p(qe);return it=F(1-ft*ft),[Pt*it-xt*Mt,-xt*it-Pt*Mt]}gr.invert=function(qe,Ze){var it=(qe*qe+Ze*Ze)/-2,ft=F(-it*(2+it)),Mt=Ze*it+qe*ft,xt=qe*it-Ze*ft,Pt=F(xt*xt+Mt*Mt);return[t(ft*Mt,Pt*(1+it)),Pt?-L(ft*xt/Pt):0]};function yr(){return x.geoProjection(gr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Gr(qe,Ze){var it=le(qe,Ze);return[(it[0]+qe/S)/2,(it[1]+Ze)/2]}Gr.invert=function(qe,Ze){var it=qe,ft=Ze,Mt=25;do{var xt=r(ft),Pt=p(ft),ir=p(2*ft),fr=Pt*Pt,wr=xt*xt,zr=p(it),Xr=r(it/2),la=p(it/2),pa=la*la,ka=1-wr*Xr*Xr,tn=ka?z(xt*Xr)*F(Dn=1/ka):Dn=0,Dn,In=.5*(2*tn*xt*la+it/S)-qe,Yn=.5*(tn*Pt+ft)-Ze,di=.5*Dn*(wr*pa+tn*xt*Xr*fr)+.5/S,Di=Dn*(zr*ir/4-tn*Pt*la),Ai=.125*Dn*(ir*la-tn*Pt*wr*zr),lo=.5*Dn*(fr*Xr+tn*pa*xt)+.5,Vo=Di*Ai-lo*di,co=(Yn*Di-In*lo)/Vo,Lo=(In*Ai-Yn*di)/Vo;it-=co,ft-=Lo}while((E(co)>l||E(Lo)>l)&&--Mt>0);return[it,ft]};function ta(){return x.geoProjection(Gr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=Q,d.geoAiryRaw=W,d.geoAitoff=se,d.geoAitoffRaw=le,d.geoArmadillo=q,d.geoArmadilloRaw=he,d.geoAugust=J,d.geoAugustRaw=$,d.geoBaker=j,d.geoBakerRaw=ne,d.geoBerghaus=re,d.geoBerghausRaw=ee,d.geoBertin1953=et,d.geoBertin1953Raw=He,d.geoBoggs=Qe,d.geoBoggsRaw=ze,d.geoBonne=Bt,d.geoBonneRaw=Et,d.geoBottomley=_r,d.geoBottomleyRaw=jt,d.geoBromley=Or,d.geoBromleyRaw=pr,d.geoChamberlin=Ce,d.geoChamberlinRaw=Oe,d.geoChamberlinAfrica=be,d.geoCollignon=Ee,d.geoCollignonRaw=Ne,d.geoCraig=Le,d.geoCraigRaw=Se,d.geoCraster=gt,d.geoCrasterRaw=dt,d.geoCylindricalEqualArea=or,d.geoCylindricalEqualAreaRaw=Ct,d.geoCylindricalStereographic=Jt,d.geoCylindricalStereographicRaw=Qt,d.geoEckert1=oa,d.geoEckert1Raw=Sr,d.geoEckert2=Sa,d.geoEckert2Raw=Ea,d.geoEckert3=Na,d.geoEckert3Raw=za,d.geoEckert4=nn,d.geoEckert4Raw=Ta,d.geoEckert5=Ht,d.geoEckert5Raw=gn,d.geoEckert6=Gt,d.geoEckert6Raw=It,d.geoEisenlohr=Yr,d.geoEisenlohrRaw=Rr,d.geoFahey=Pa,d.geoFaheyRaw=ia,d.geoFoucaut=ja,d.geoFoucautRaw=Ga,d.geoFoucautSinusoidal=sn,d.geoFoucautSinusoidalRaw=Xa,d.geoGilbert=Kn,d.geoGingery=kr,d.geoGingeryRaw=St,d.geoGinzburg4=Cr,d.geoGinzburg4Raw=Tr,d.geoGinzburg5=Nr,d.geoGinzburg5Raw=Kr,d.geoGinzburg6=Wt,d.geoGinzburg6Raw=_t,d.geoGinzburg8=Vr,d.geoGinzburg8Raw=Ar,d.geoGinzburg9=ba,d.geoGinzburg9Raw=ma,d.geoGringorten=an,d.geoGringortenRaw=$r,d.geoGuyou=vo,d.geoGuyouRaw=Pi,d.geoHammer=Te,d.geoHammerRaw=ue,d.geoHammerRetroazimuthal=ao,d.geoHammerRetroazimuthalRaw=Eo,d.geoHealpix=Jo,d.geoHealpixRaw=Ko,d.geoHill=_s,d.geoHillRaw=ms,d.geoHomolosine=Zi,d.geoHomolosineRaw=Io,d.geoHufnagel=rs,d.geoHufnagelRaw=ys,d.geoHyperelliptical=oo,d.geoHyperellipticalRaw=ci,d.geoInterrupt=Ni,d.geoInterruptedBoggs=Ks,d.geoInterruptedHomolosine=hs,d.geoInterruptedMollweide=xs,d.geoInterruptedMollweideHemispheres=ql,d.geoInterruptedSinuMollweide=Yl,d.geoInterruptedSinusoidal=ec,d.geoKavrayskiy7=Ru,d.geoKavrayskiy7Raw=vs,d.geoLagrange=Ll,d.geoLagrangeRaw=Cc,d.geoLarrivee=nu,d.geoLarriveeRaw=Tu,d.geoLaskowski=Gs,d.geoLaskowskiRaw=Rs,d.geoLittrow=ws,d.geoLittrowRaw=Qo,d.geoLoximuthal=fl,d.geoLoximuthalRaw=Au,d.geoMiller=Us,d.geoMillerRaw=lu,d.geoModifiedStereographic=Tl,d.geoModifiedStereographicRaw=_f,d.geoModifiedStereographicAlaska=uu,d.geoModifiedStereographicGs48=hl,d.geoModifiedStereographicGs50=Lc,d.geoModifiedStereographicMiller=ju,d.geoModifiedStereographicLee=dc,d.geoMollweide=Ae,d.geoMollweideRaw=ot,d.geoMtFlatPolarParabolic=tc,d.geoMtFlatPolarParabolicRaw=pc,d.geoMtFlatPolarQuartic=Bc,d.geoMtFlatPolarQuarticRaw=Oc,d.geoMtFlatPolarSinusoidal=Pc,d.geoMtFlatPolarSinusoidalRaw=cu,d.geoNaturalEarth2=nc,d.geoNaturalEarth2Raw=Su,d.geoNellHammer=rc,d.geoNellHammerRaw=Al,d.geoInterruptedQuarticAuthalic=Ts,d.geoNicolosi=sf,d.geoNicolosiRaw=Ic,d.geoPatterson=Nl,d.geoPattersonRaw=Du,d.geoPolyconic=tl,d.geoPolyconicRaw=Gl,d.geoPolyhedral=mc,d.geoPolyhedralButterfly=zs,d.geoPolyhedralCollignon=Rc,d.geoPolyhedralWaterman=Vs,d.geoProject=Cl,d.geoGringortenQuincuncial=Yt,d.geoPeirceQuincuncial=vr,d.geoPierceQuincuncial=vr,d.geoQuantize=Qr,d.geoQuincuncial=Zu,d.geoRectangularPolyconic=xa,d.geoRectangularPolyconicRaw=Wr,d.geoRobinson=zn,d.geoRobinsonRaw=xn,d.geoSatellite=wn,d.geoSatelliteRaw=ni,d.geoSinuMollweide=gs,d.geoSinuMollweideRaw=pi,d.geoSinusoidal=kt,d.geoSinusoidalRaw=Ke,d.geoStitch=Fs,d.geoTimes=yo,d.geoTimesRaw=Mi,d.geoTwoPointAzimuthal=Ql,d.geoTwoPointAzimuthalRaw=us,d.geoTwoPointAzimuthalUsa=Pl,d.geoTwoPointEquidistant=Vl,d.geoTwoPointEquidistantRaw=du,d.geoTwoPointEquidistantUsa=Yu,d.geoVanDerGrinten=Hl,d.geoVanDerGrintenRaw=Ku,d.geoVanDerGrinten2=Ki,d.geoVanDerGrinten2Raw=Ou,d.geoVanDerGrinten3=Ju,d.geoVanDerGrinten3Raw=xo,d.geoVanDerGrinten4=pu,d.geoVanDerGrinten4Raw=Eu,d.geoWagner=ae,d.geoWagner7=xe,d.geoWagnerRaw=R,d.geoWagner4=bt,d.geoWagner4Raw=ct,d.geoWagner6=Zt,d.geoWagner6Raw=zt,d.geoWiechel=yr,d.geoWiechelRaw=gr,d.geoWinkel3=ta,d.geoWinkel3Raw=Gr,Object.defineProperty(d,"__esModule",{value:!0})})}}),PL=We({"src/plots/geo/zoom.js"(Z,V){"use strict";var d=Hi(),x=aa(),A=Wi(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(g,f){var P=g.projection,L;return f._isScoped?L=n:f._isClipped?L=h:L=s,L(g,P)}V.exports=o;function a(g,f){return d.behavior.zoom().translate(f.translate()).scale(f.scale())}function i(g,f,P){var L=g.id,z=g.graphDiv,F=z.layout,B=F[L],O=z._fullLayout,I=O[L],N={},U={};function W(Q,le){N[L+"."+Q]=x.nestedProperty(B,Q).get(),A.call("_storeDirectGUIEdit",F,O._preGUI,N);var se=x.nestedProperty(I,Q);se.get()!==le&&(se.set(le),x.nestedProperty(B,Q).set(le),U[L+"."+Q]=le)}P(W),W("projection.scale",f.scale()/g.fitScale),W("fitbounds",!1),z.emit("plotly_relayout",U)}function n(g,f){var P=a(g,f);function L(){d.select(this).style(t)}function z(){f.scale(d.event.scale).translate(d.event.translate),g.render(!0);var O=f.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/g.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var I=f.invert(g.midPt);O("center.lon",I[0]),O("center.lat",I[1])}function B(){d.select(this).style(r),i(g,f,F)}return P.on("zoomstart",L).on("zoom",z).on("zoomend",B),P}function s(g,f){var P=a(g,f),L=2,z,F,B,O,I,N,U,W,Q;function le(X){return f.invert(X)}function se(X){var oe=le(X);if(!oe)return!0;var ne=f(oe);return Math.abs(ne[0]-X[0])>L||Math.abs(ne[1]-X[1])>L}function he(){d.select(this).style(t),z=d.mouse(this),F=f.rotate(),B=f.translate(),O=F,I=le(z)}function q(){if(N=d.mouse(this),se(z)){P.scale(f.scale()),P.translate(f.translate());return}f.scale(d.event.scale),f.translate([B[0],d.event.translate[1]]),I?le(N)&&(W=le(N),U=[O[0]+(W[0]-I[0]),F[1],F[2]],f.rotate(U),O=U):(z=N,I=le(z)),Q=!0,g.render(!0);var X=f.rotate(),oe=f.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/g.fitScale,"geo.center.lon":oe[0],"geo.center.lat":oe[1],"geo.projection.rotation.lon":-X[0]})}function $(){d.select(this).style(r),Q&&i(g,f,J)}function J(X){var oe=f.rotate(),ne=f.invert(g.midPt);X("projection.rotation.lon",-oe[0]),X("center.lon",ne[0]),X("center.lat",ne[1])}return P.on("zoomstart",he).on("zoom",q).on("zoomend",$),P}function h(g,f){var P={r:f.rotate(),k:f.scale()},L=a(g,f),z=u(L,"zoomstart","zoom","zoomend"),F=0,B=L.on,O;L.on("zoomstart",function(){d.select(this).style(t);var Q=d.mouse(this),le=f.rotate(),se=le,he=f.translate(),q=m(le);O=c(f,Q),B.call(L,"zoom",function(){var $=d.mouse(this);if(f.scale(P.k=d.event.scale),!O)Q=$,O=c(f,Q);else if(c(f,$)){f.rotate(le).translate(he);var J=c(f,$),X=T(O,J),oe=M(p(q,X)),ne=P.r=l(oe,O,se);(!isFinite(ne[0])||!isFinite(ne[1])||!isFinite(ne[2]))&&(ne=se),f.rotate(ne),se=ne}N(z.of(this,arguments))}),I(z.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),B.call(L,"zoom",null),U(z.of(this,arguments)),i(g,f,W)}).on("zoom.redraw",function(){g.render(!0);var Q=f.rotate();g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/g.fitScale,"geo.projection.rotation.lon":-Q[0],"geo.projection.rotation.lat":-Q[1]})});function I(Q){F++||Q({type:"zoomstart"})}function N(Q){Q({type:"zoom"})}function U(Q){--F||Q({type:"zoomend"})}function W(Q){var le=f.rotate();Q("projection.rotation.lon",-le[0]),Q("projection.rotation.lat",-le[1])}return d.rebind(L,z,"on")}function c(g,f){var P=g.invert(f);return P&&isFinite(P[0])&&isFinite(P[1])&&y(P)}function m(g){var f=.5*g[0]*E,P=.5*g[1]*E,L=.5*g[2]*E,z=Math.sin(f),F=Math.cos(f),B=Math.sin(P),O=Math.cos(P),I=Math.sin(L),N=Math.cos(L);return[F*O*N+z*B*I,z*O*N-F*B*I,F*B*N+z*O*I,F*O*I-z*B*N]}function p(g,f){var P=g[0],L=g[1],z=g[2],F=g[3],B=f[0],O=f[1],I=f[2],N=f[3];return[P*B-L*O-z*I-F*N,P*O+L*B+z*N-F*I,P*I-L*N+z*B+F*O,P*N+L*I-z*O+F*B]}function T(g,f){if(!(!g||!f)){var P=v(g,f),L=Math.sqrt(b(P,P)),z=.5*Math.acos(Math.max(-1,Math.min(1,b(g,f)))),F=Math.sin(z)/L;return L&&[Math.cos(z),P[2]*F,-P[1]*F,P[0]*F]}}function l(g,f,P){var L=S(f,2,g[0]);L=S(L,1,g[1]),L=S(L,0,g[2]-P[2]);var z=f[0],F=f[1],B=f[2],O=L[0],I=L[1],N=L[2],U=Math.atan2(F,z)*e,W=Math.sqrt(z*z+F*F),Q,le;Math.abs(I)>W?(le=(I>0?90:-90)-U,Q=0):(le=Math.asin(I/W)*e-U,Q=Math.sqrt(W*W-I*I));var se=180-le-2*U,he=(Math.atan2(N,O)-Math.atan2(B,Q))*e,q=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,$=_(P[0],P[1],le,he),J=_(P[0],P[1],se,q);return $<=J?[le,he,P[2]]:[se,q,P[2]]}function _(g,f,P,L){var z=w(P-g),F=w(L-f);return Math.sqrt(z*z+F*F)}function w(g){return(g%360+540)%360-180}function S(g,f,P){var L=P*E,z=g.slice(),F=f===0?1:0,B=f===2?1:2,O=Math.cos(L),I=Math.sin(L);return z[F]=g[F]*O-g[B]*I,z[B]=g[B]*O+g[F]*I,z}function M(g){return[Math.atan2(2*(g[0]*g[1]+g[2]*g[3]),1-2*(g[1]*g[1]+g[2]*g[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(g[0]*g[2]-g[3]*g[1]))))*e,Math.atan2(2*(g[0]*g[3]+g[1]*g[2]),1-2*(g[2]*g[2]+g[3]*g[3]))*e]}function y(g){var f=g[0]*E,P=g[1]*E,L=Math.cos(P);return[L*Math.cos(f),L*Math.sin(f),Math.sin(P)]}function b(g,f){for(var P=0,L=0,z=g.length;L0&&I._module.calcGeoJSON(O,L)}if(!z){var N=this.updateProjection(P,L);if(N)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(L,F),this.updateDims(L,F),this.updateFx(L,F),s.generalUpdatePerTraceModule(this.graphDiv,this,P,F);var U=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=U.selectAll(".point"),this.dataPoints.text=U.selectAll("text"),this.dataPaths.line=U.selectAll(".js-line");var W=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=W.selectAll("path"),this._render()},v.updateProjection=function(P,L){var z=this.graphDiv,F=L[this.id],B=L._size,O=F.domain,I=F.projection,N=F.lonaxis,U=F.lataxis,W=N._ax,Q=U._ax,le=this.projection=u(F),se=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],he=F.center||{},q=I.rotation||{},$=N.range||[],J=U.range||[];if(F.fitbounds){W._length=se[1][0]-se[0][0],Q._length=se[1][1]-se[0][1],W.range=c(z,W),Q.range=c(z,Q);var X=(W.range[0]+W.range[1])/2,oe=(Q.range[0]+Q.range[1])/2;if(F._isScoped)he={lon:X,lat:oe};else if(F._isClipped){he={lon:X,lat:oe},q={lon:X,lat:oe,roll:q.roll};var ne=I.type,j=w.lonaxisSpan[ne]/2||180,ee=w.lataxisSpan[ne]/2||90;$=[X-j,X+j],J=[oe-ee,oe+ee]}else he={lon:X,lat:oe},q={lon:X,lat:q.lat,roll:q.roll}}le.center([he.lon-q.lon,he.lat-q.lat]).rotate([-q.lon,-q.lat,q.roll]).parallels(I.parallels);var re=f($,J);le.fitExtent(se,re);var ue=this.bounds=le.getBounds(re),_e=this.fitScale=le.scale(),Te=le.translate();if(F.fitbounds){var Ie=le.getBounds(f(W.range,Q.range)),De=Math.min((ue[1][0]-ue[0][0])/(Ie[1][0]-Ie[0][0]),(ue[1][1]-ue[0][1])/(Ie[1][1]-Ie[0][1]));isFinite(De)?le.scale(De*_e):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else le.scale(I.scale*_e);var He=this.midPt=[(ue[0][0]+ue[1][0])/2,(ue[0][1]+ue[1][1])/2];if(le.translate([Te[0]+(He[0]-Te[0]),Te[1]+(He[1]-Te[1])]).clipExtent(ue),F._isAlbersUsa){var et=le([he.lon,he.lat]),rt=le.translate();le.translate([rt[0]-(et[0]-rt[0]),rt[1]-(et[1]-rt[1])])}},v.updateBaseLayers=function(P,L){var z=this,F=z.topojson,B=z.layers,O=z.basePaths;function I(se){return se==="lonaxis"||se==="lataxis"}function N(se){return!!w.lineLayers[se]}function U(se){return!!w.fillLayers[se]}var W=this.hasChoropleth?w.layersForChoropleth:w.layers,Q=W.filter(function(se){return N(se)||U(se)?L["show"+se]:I(se)?L[se].showgrid:!0}),le=z.framework.selectAll(".layer").data(Q,String);le.exit().each(function(se){delete B[se],delete O[se],d.select(this).remove()}),le.enter().append("g").attr("class",function(se){return"layer "+se}).each(function(se){var he=B[se]=d.select(this);se==="bg"?z.bgRect=he.append("rect").style("pointer-events","all"):I(se)?O[se]=he.append("path").style("fill","none"):se==="backplot"?he.append("g").classed("choroplethlayer",!0):se==="frontplot"?he.append("g").classed("scatterlayer",!0):N(se)?O[se]=he.append("path").style("fill","none").style("stroke-miterlimit",2):U(se)&&(O[se]=he.append("path").style("stroke","none"))}),le.order(),le.each(function(se){var he=O[se],q=w.layerNameToAdjective[se];se==="frame"?he.datum(w.sphereSVG):N(se)||U(se)?he.datum(y(F,F.objects[se])):I(se)&&he.datum(g(se,L,P)).call(a.stroke,L[se].gridcolor).call(i.dashLine,L[se].griddash,L[se].gridwidth),N(se)?he.call(a.stroke,L[q+"color"]).call(i.dashLine,"",L[q+"width"]):U(se)&&he.call(a.fill,L[q+"color"])})},v.updateDims=function(P,L){var z=this.bounds,F=(L.framewidth||0)/2,B=z[0][0]-F,O=z[0][1]-F,I=z[1][0]-B+F,N=z[1][1]-O+F;i.setRect(this.clipRect,B,O,I,N),this.bgRect.call(i.setRect,B,O,I,N).call(a.fill,L.bgcolor),this.xaxis._offset=B,this.xaxis._length=I,this.yaxis._offset=O,this.yaxis._length=N},v.updateFx=function(P,L){var z=this,F=z.graphDiv,B=z.bgRect,O=P.dragmode,I=P.clickmode;if(z.isStatic)return;function N(){var le=z.viewInitial,se={};for(var he in le)se[z.id+"."+he]=le[he];t.call("_guiRelayout",F,se),F.emit("plotly_doubleclick",null)}function U(le){return z.projection.invert([le[0]+z.xaxis._offset,le[1]+z.yaxis._offset])}var W=function(le,se){if(se.isRect){var he=le.range={};he[z.id]=[U([se.xmin,se.ymin]),U([se.xmax,se.ymax])]}else{var q=le.lassoPoints={};q[z.id]=se.map(U)}},Q={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:W},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(le){le===2&&T(F)}};O==="pan"?(B.node().onmousedown=null,B.call(_(z,L)),B.on("dblclick.zoom",N),F._context._scrollZoom.geo||B.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(B.on(".zoom",null),Q.prepFn=function(le,se,he){p(le,se,he,Q,O)},m.init(Q)),B.on("mousemove",function(){var le=z.projection.invert(r.getPositionFromD3Event());if(!le)return m.unhover(F,d.event);z.xaxis.p2c=function(){return le[0]},z.yaxis.p2c=function(){return le[1]},n.hover(F,d.event,z.id)}),B.on("mouseout",function(){F._dragging||m.unhover(F,d.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(I.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,Q),I.indexOf("event")>-1&&n.click(F,d.event))})},v.makeFramework=function(){var P=this,L=P.graphDiv,z=L._fullLayout,F="clip"+z._uid+P.id;P.clipDef=z._clips.append("clipPath").attr("id",F),P.clipRect=P.clipDef.append("rect"),P.framework=d.select(P.container).append("g").attr("class","geo "+P.id).call(i.setClipUrl,F,L),P.project=function(B){var O=P.projection(B);return O?[O[0]-P.xaxis._offset,O[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(B){return P.project(B)[0]}},P.yaxis={_id:"y",c2p:function(B){return P.project(B)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(P.mockAxis,z)},v.saveViewInitial=function(P){var L=P.center||{},z=P.projection,F=z.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":z.scale};var B;P._isScoped?B={"center.lon":L.lon,"center.lat":L.lat}:P._isClipped?B={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:B={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,B)},v.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},v._render=function(){var P=this.projection,L=P.getPath(),z;function F(O){var I=P(O.lonlat);return I?o(I[0],I[1]):null}function B(O){return P.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",L);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return L(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",B).attr("transform",F)};function u(P){var L=P.projection,z=L.type,F=w.projNames[z];F="geo"+r.titleCase(F);for(var B=x[F]||e[F],O=B(),I=P._isSatellite?Math.acos(1/L.distance)*180/Math.PI:P._isClipped?w.lonaxisSpan[z]/2:null,N=["center","rotate","parallels","clipExtent"],U=function(le){return le?O:[]},W=0;Wq}else return!1},O.getPath=function(){return A().projection(O)},O.getBounds=function(le){return O.getPath().bounds(le)},O.precision(w.precision),P._isSatellite&&O.tilt(L.tilt).distance(L.distance),I&&O.clipAngle(I-w.clipPad),O}function g(P,L,z){var F=1e-6,B=2.5,O=L[P],I=w.scopeDefaults[L.scope],N,U,W;P==="lonaxis"?(N=I.lonaxisRange,U=I.lataxisRange,W=function(oe,ne){return[oe,ne]}):P==="lataxis"&&(N=I.lataxisRange,U=I.lonaxisRange,W=function(oe,ne){return[ne,oe]});var Q={type:"linear",range:[N[0],N[1]-F],tick0:O.tick0,dtick:O.dtick};h.setConvert(Q,z);var le=h.calcTicks(Q);!L.isScoped&&P==="lonaxis"&&le.pop();for(var se=le.length,he=new Array(se),q=0;q0&&B<0&&(B+=360);var N=(B-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,I],[F+N,I],[F+2*N,I],[F+3*N,I],[B,I],[B,O],[B-N,O],[B-2*N,O],[B-3*N,O],[F,O]]]}}}}),D3=We({"src/plots/geo/layout_attributes.js"(Z,V){"use strict";var d=nf(),x=Uu().attributes,A=zf().dash,E=Mg(),e=Iu().overrideAll,t=Ad(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},o=V.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),RL=We({"src/plots/geo/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=Id(),A=Ff().getSubplotData,E=Mg(),e=D3(),t=E.axesNames;V.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=A(n.fullData,"geo",n.id),h=s.map(function(J){return J.index}),c=i("resolution"),m=i("scope"),p=E.scopeDefaults[m],T=i("projection.type",p.projType),l=a._isAlbersUsa=T==="albers usa";l&&(m=a.scope="usa");var _=a._isScoped=m!=="world",w=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",M=a._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var y=d.extendDeep({},a._template);y.showcoastlines=!1,y.showcountries=!1,y.showframe=!1,y.showlakes=!1,y.showland=!1,y.showocean=!1,y.showrivers=!1,y.showsubunits=!1,y.lonaxis&&(y.lonaxis.showgrid=!1),y.lataxis&&(y.lataxis.showgrid=!1),a._template=y}for(var b=i("visible"),v,u=0;u0&&U<0&&(U+=360);var W=(N+U)/2,Q;if(!l){var le=_?p.projRotate:[W,0,0];Q=i("projection.rotation.lon",le[0]),i("projection.rotation.lat",le[1]),i("projection.rotation.roll",le[2]),v=i("showcoastlines",!_&&b),v&&(i("coastlinecolor"),i("coastlinewidth")),v=i("showocean",b?void 0:!1),v&&i("oceancolor")}var se,he;if(l?(se=-96.6,he=38.7):(se=_?W:Q,he=(I[0]+I[1])/2),i("center.lon",se),i("center.lat",he),w&&(i("projection.tilt"),i("projection.distance")),S){var q=p.projParallels||[0,60];i("projection.parallels",q)}i("projection.scale"),v=i("showland",b?void 0:!1),v&&i("landcolor"),v=i("showlakes",b?void 0:!1),v&&i("lakecolor"),v=i("showrivers",b?void 0:!1),v&&(i("rivercolor"),i("riverwidth")),v=i("showcountries",_&&m!=="usa"&&b),v&&(i("countrycolor"),i("countrywidth")),(m==="usa"||m==="north america"&&c===50)&&(i("showsubunits",b),i("subunitcolor"),i("subunitwidth")),_||(v=i("showframe",b),v&&(i("framecolor"),i("framewidth"))),i("bgcolor");var $=i("fitbounds");$&&(delete a.projection.scale,_?(delete a.center.lon,delete a.center.lat):M?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),z3=We({"src/plots/geo/index.js"(Z,V){"use strict";var d=Ff().getSubplotCalcData,x=aa().counterRegex,A=IL(),E="geo",e=x(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,h=n._subplots[E],c=0;c")}}}}),I_=We({"src/traces/choropleth/event_data.js"(Z,V){"use strict";V.exports=function(x,A,E,e,t){x.location=A.location,x.z=A.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),R_=We({"src/traces/choropleth/select.js"(Z,V){"use strict";V.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(A===!1)for(o=0;o=Math.min(U,W)&&T<=Math.max(U,W)?0:1/0}if(L=Math.min(Q,le)&&l<=Math.max(Q,le)?0:1/0}B=Math.sqrt(L*L+z*z),u=w[P]}}}else for(P=w.length-1;P>-1;P--)v=w[P],g=m[v],f=p[v],L=h.c2p(g)-T,z=c.c2p(f)-l,F=Math.sqrt(L*L+z*z),F100},Z.isDotSymbol=function(d){return typeof d=="string"?V.DOT_RE.test(d):d>200}}}),NL=We({"src/traces/scattergl/defaults.js"(Z,V){"use strict";var d=aa(),x=Wi(),A=z_(),E=kg(),e=Ev(),t=au(),r=I0(),o=cv(),a=Oh(),i=Gh(),n=fv(),s=Hh();V.exports=function(c,m,p,T){function l(u,g){return d.coerce(c,m,E,u,g)}var _=c.marker?A.isOpenSymbol(c.marker.symbol):!1,w=t.isBubble(c),S=r(c,m,T,l);if(!S){m.visible=!1;return}o(c,m,T,l),l("xhoverformat"),l("yhoverformat");var M=S>>1,c=r[h],m=a!==void 0?a(c,o):c-o;m>=0?(s=h,n=h-1):i=h+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var h=i+n>>>1,c=r[h],m=a!==void 0?a(c,o):c-o;m>0?(s=h,n=h-1):i=h+1}return s}function A(r,o,a,i,n){for(var s=i-1;i<=n;){var h=i+n>>>1,c=r[h],m=a!==void 0?a(c,o):c-o;m<0?(s=h,i=h+1):n=h-1}return s}function E(r,o,a,i,n){for(var s=i-1;i<=n;){var h=i+n>>>1,c=r[h],m=a!==void 0?a(c,o):c-o;m<=0?(s=h,i=h+1):n=h-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,h=r[s],c=a!==void 0?a(h,o):h-o;if(c===0)return s;c<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}V.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,A)},le:function(r,o,a,i,n){return t(r,o,a,i,n,E)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Pv=We({"node_modules/pick-by-alias/index.js"(Z,V){"use strict";V.exports=function(E,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(A=arguments),typeof A=="string"?A=A.split(/\s/).map(parseFloat):typeof A=="number"&&(A=[A]),A.length&&typeof A[0]=="number"?A.length===1?E={width:A[0],height:A[0],x:0,y:0}:A.length===2?E={width:A[0],height:A[1],x:0,y:0}:E={x:A[0],y:A[1],width:A[2]-A[0]||0,height:A[3]-A[1]||0}:A&&(A=d(A,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),E={x:A.left||0,y:A.top||0},A.width==null?A.right?E.width=A.right-E.x:E.width=0:E.width=A.width,A.height==null?A.bottom?E.height=A.bottom-E.y:E.height=0:E.height=A.height),E}}}),jp=We({"node_modules/array-bounds/index.js"(Z,V){"use strict";V.exports=d;function d(x,A){if(!x||x.length==null)throw Error("Argument should be an array");A==null?A=1:A=Math.floor(A);for(var E=Array(A*2),e=0;et&&(t=x[o]),x[o]>>1,w;m.dtype||(m.dtype="array"),typeof m.dtype=="string"?w=new(a(m.dtype))(_):m.dtype&&(w=m.dtype,Array.isArray(w)&&(w.length=_));for(let L=0;L<_;++L)w[L]=L;let S=[],M=[],y=[],b=[];u(0,0,1,w,0,1);let v=0;for(let L=0;Lp||I>n){for(let oe=0;oere||W>ue||Q=se||j===ee)return;let _e=S[ne];ee===void 0&&(ee=_e.length);for(let Ae=j;Ae=B&&ce<=I&&ze>=O&&ze<=N&&he.push(ge)}let Te=M[ne],Ie=Te[j*4+0],De=Te[j*4+1],He=Te[j*4+2],et=Te[j*4+3],rt=$(Te,j+1),$e=oe*.5,ot=ne+1;q(J,X,$e,ot,Ie,De||He||et||rt),q(J,X+$e,$e,ot,De,He||et||rt),q(J+$e,X,$e,ot,He,et||rt),q(J+$e,X+$e,$e,ot,et,rt)}function $(J,X){let oe=null,ne=0;for(;oe===null;)if(oe=J[X*4+ne],ne++,ne>J.length)return null;return oe}return he}function f(L,z,F,B,O){let I=[];for(let N=0;N1&&(c=1),c<-1&&(c=-1),h*Math.acos(c)},t=function(a,i,n,s,h,c,m,p,T,l,_,w){var S=Math.pow(h,2),M=Math.pow(c,2),y=Math.pow(_,2),b=Math.pow(w,2),v=S*M-S*b-M*y;v<0&&(v=0),v/=S*b+M*y,v=Math.sqrt(v)*(m===p?-1:1);var u=v*h/c*w,g=v*-c/h*_,f=l*u-T*g+(a+n)/2,P=T*u+l*g+(i+s)/2,L=(_-u)/h,z=(w-g)/c,F=(-_-u)/h,B=(-w-g)/c,O=e(1,0,L,z),I=e(L,z,F,B);return p===0&&I>0&&(I-=x),p===1&&I<0&&(I+=x),[f,P,O,I]},r=function(a){var i=a.px,n=a.py,s=a.cx,h=a.cy,c=a.rx,m=a.ry,p=a.xAxisRotation,T=p===void 0?0:p,l=a.largeArcFlag,_=l===void 0?0:l,w=a.sweepFlag,S=w===void 0?0:w,M=[];if(c===0||m===0)return[];var y=Math.sin(T*x/360),b=Math.cos(T*x/360),v=b*(i-s)/2+y*(n-h)/2,u=-y*(i-s)/2+b*(n-h)/2;if(v===0&&u===0)return[];c=Math.abs(c),m=Math.abs(m);var g=Math.pow(v,2)/Math.pow(c,2)+Math.pow(u,2)/Math.pow(m,2);g>1&&(c*=Math.sqrt(g),m*=Math.sqrt(g));var f=t(i,n,s,h,c,m,_,S,y,b,v,u),P=d(f,4),L=P[0],z=P[1],F=P[2],B=P[3],O=Math.abs(B)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var I=Math.max(Math.ceil(O),1);B/=I;for(var N=0;N4?(o=l[l.length-4],a=l[l.length-3]):(o=c,a=m),r.push(l)}return r}function A(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),B3=We({"node_modules/is-svg-path/index.js"(Z,V){"use strict";V.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),ZL=We({"node_modules/svg-path-bounds/index.js"(Z,V){"use strict";var d=zm(),x=O3(),A=XL(),E=B3(),e=ng();V.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=A(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),YL=We({"node_modules/normalize-svg-path/index.js"(Z,V){var d=Math.PI,x=o(120);V.exports=A;function A(a){for(var i,n=[],s=0,h=0,c=0,m=0,p=null,T=null,l=0,_=0,w=0,S=a.length;w7&&(n.push(M.splice(0,7)),M.unshift("C"));break;case"S":var b=l,v=_;(i=="C"||i=="S")&&(b+=b-s,v+=v-h),M=["C",b,v,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(p=l*2-p,T=_*2-T):(p=l,T=_),M=e(l,_,p,T,M[1],M[2]);break;case"Q":p=M[1],T=M[2],M=e(l,_,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,_,M[1],M[2]);break;case"H":M=E(l,_,M[1],_);break;case"V":M=E(l,_,l,M[1]);break;case"Z":M=E(l,_,c,m);break}i=y,l=M[M.length-2],_=M[M.length-1],M.length>4?(s=M[M.length-4],h=M[M.length-3]):(s=l,h=_),n.push(M)}return n}function E(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,h,c){return["C",a/3+2/3*n,i/3+2/3*s,h/3+2/3*n,c/3+2/3*s,h,c]}function t(a,i,n,s,h,c,m,p,T,l){if(l)f=l[0],P=l[1],u=l[2],g=l[3];else{var _=r(a,i,-h);a=_.x,i=_.y,_=r(p,T,-h),p=_.x,T=_.y;var w=(a-p)/2,S=(i-T)/2,M=w*w/(n*n)+S*S/(s*s);M>1&&(M=Math.sqrt(M),n=M*n,s=M*s);var y=n*n,b=s*s,v=(c==m?-1:1)*Math.sqrt(Math.abs((y*b-y*S*S-b*w*w)/(y*S*S+b*w*w)));v==1/0&&(v=1);var u=v*n*S/s+(a+p)/2,g=v*-s*w/n+(i+T)/2,f=Math.asin(((i-g)/s).toFixed(9)),P=Math.asin(((T-g)/s).toFixed(9));f=aP&&(f=f-d*2),!m&&P>f&&(P=P-d*2)}if(Math.abs(P-f)>x){var L=P,z=p,F=T;P=f+x*(m&&P>f?1:-1),p=u+n*Math.cos(P),T=g+s*Math.sin(P);var B=t(p,T,n,s,h,0,m,z,F,[P,L,u,g])}var O=Math.tan((P-f)/4),I=4/3*n*O,N=4/3*s*O,U=[2*a-(a+I*Math.sin(f)),2*i-(i-N*Math.cos(f)),p+I*Math.sin(P),T-N*Math.cos(P),p,T];if(l)return U;B&&(U=U.concat(B));for(var W=0;W0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(p)),r.translate(h*.5,c*.5),r.scale(_,_),i()){var w=new Path2D(n);r.fill(w),p&&r.stroke(w)}else{var S=x(n);A(r,S),r.fill(),p&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:m*.5});return M}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var h=n.getImageData(0,0,1,1);return a=h&&h.data&&h.data[3]===255}}}),qp=We({"src/traces/scattergl/convert.js"(Z,V){"use strict";var d=Uo(),x=$L(),A=Ud(),E=Wi(),e=aa(),t=e.isArrayOrTypedArray,r=Oo(),o=cc(),a=$v().formatColor,i=au(),n=C0(),s=z_(),h=Gd(),c=wd().DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},p=Th().appendArrayPointValue;function T(B,O){var I,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},U=B._context.plotGlPixelRatio;if(O.visible!==!0)return N;if(i.hasText(O)&&(N.text=l(B,O),N.textSel=M(B,O,O.selected),N.textUnsel=M(B,O,O.unselected)),i.hasMarkers(O)&&(N.marker=w(B,O),N.markerSel=S(B,O,O.selected),N.markerUnsel=S(B,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var W=O.marker.opacity;for(N.markerUnsel.opacity=new Array(W.length),I=0;I500?"bold":"normal":B}function w(B,O){var I=O._length,N=O.marker,U={},W,Q=t(N.symbol),le=t(N.angle),se=t(N.color),he=t(N.line.color),q=t(N.opacity),$=t(N.size),J=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||se||he||q||le){U.symbols=new Array(I),U.angles=new Array(I),U.colors=new Array(I),U.borderColors=new Array(I);var oe=N.symbol,ne=N.angle,j=a(N,N.opacity,I),ee=a(N.line,N.opacity,I);if(!t(ee[0])){var re=ee;for(ee=Array(I),W=0;Wh.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(he&&O.connectgaps){var $=W[0],J=W[1];for(Q=0;Q1?se[Q]:se[0]:se,X=t(he)?he.length>1?he[Q]:he[0]:he,oe=m[J],ne=m[X],j=q?q/.8+1:0,ee=-ne*j-ne*.5;W.offset[Q]=[oe*j/$,ee/$]}}return W}V.exports={style:T,markerStyle:w,markerSelection:S,linePositions:L,errorBarPositions:z,textPosition:F}}}),N3=We({"src/traces/scattergl/scene_update.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=c,u=b*2,g={},f,P=S.makeCalcdata(_,"x"),L=M.makeCalcdata(_,"y"),z=e(_,S,"x",P),F=e(_,M,"y",L),B=z.vals,O=F.vals;_._x=B,_._y=O,_.xperiodalignment&&(_._origX=P,_._xStarts=z.starts,_._xEnds=z.ends),_.yperiodalignment&&(_._origY=L,_._yStarts=F.starts,_._yEnds=F.ends);var I=new Array(u),N=new Array(b);for(f=0;f1&&x.extendFlat(y.line,n.linePositions(T,_,w)),y.errorX||y.errorY){var b=n.errorBarPositions(T,_,w,S,M);y.errorX&&x.extendFlat(y.errorX,b.x),y.errorY&&x.extendFlat(y.errorY,b.y)}return y.text&&(x.extendFlat(y.text,{positions:w},n.textPosition(T,_,y.text,y.marker)),x.extendFlat(y.textSel,{positions:w},n.textPosition(T,_,y.text,y.markerSel)),x.extendFlat(y.textUnsel,{positions:w},n.textPosition(T,_,y.text,y.markerUnsel))),y}}}),U3=We({"src/traces/scattergl/edit_style.js"(Z,V){"use strict";var d=aa(),x=Fi(),A=wd().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],h=a.textOptions[i],c=a.textSelectedOptions[i]||{},m=a.textUnselectedOptions[i]||{},p=d.extendFlat({},h),T,l;if(n.length||s.length){var _=c.color,w=m.color,S=h.color,M=d.isArrayOrTypedArray(S);for(p.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,a=E&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),of=We({"node_modules/object-assign/index.js"(Z,V){"use strict";var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}V.exports=e()?Object.assign:function(t,r){for(var o,a=E(t),i,n=1;ng.length)&&(f=g.length);for(var P=0,L=new Array(f);Pae&&Q>0){var re=(j[Q][0]-ae)/(j[Q][0]-j[Q-1][0]);return j[Q][1]*(1-re)+re*j[Q-1][1]}}return 1}var U=[0,0,0],B={showSurface:!1,showContour:!1,projections:[m.slice(),m.slice(),m.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function X(ae,j){var Q,re,he,xe=j.axes&&j.axes.lastCubeProps.axis||U,Te=j.showSurface,Le=j.showContour;for(Q=0;Q<3;++Q)for(Te=Te||j.surfaceProject[Q],re=0;re<3;++re)Le=Le||j.contourProject[Q][re];for(Q=0;Q<3;++Q){var Pe=B.projections[Q];for(re=0;re<16;++re)Pe[re]=0;for(re=0;re<4;++re)Pe[5*re]=1;Pe[5*Q]=0,Pe[12+Q]=j.axesBounds[+(xe[Q]>0)][Q],l(Pe,ae.model,Pe);var qe=B.clipBounds[Q];for(he=0;he<2;++he)for(re=0;re<3;++re)qe[he][re]=ae.clipBounds[he][re];qe[0][Q]=-1e8,qe[1][Q]=1e8}return B.showSurface=Te,B.showContour=Le,B}var $={model:m,view:m,projection:m,inverseModel:m.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},le=m.slice(),ce=[1,0,0,0,1,0,0,0,1];function ve(ae,j){ae=ae||{};var Q=this.gl;Q.disable(Q.CULL_FACE),this._colorMap.bind(0);var re=$;re.model=ae.model||m,re.view=ae.view||m,re.projection=ae.projection||m,re.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],re.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],re.objectOffset=this.objectOffset,re.contourColor=this.contourColor[0],re.inverseModel=_(re.inverseModel,re.model);for(var he=0;he<2;++he)for(var xe=re.clipBounds[he],Te=0;Te<3;++Te)xe[Te]=Math.min(Math.max(this.clipBounds[he][Te],-1e8),1e8);re.kambient=this.ambientLight,re.kdiffuse=this.diffuseLight,re.kspecular=this.specularLight,re.roughness=this.roughness,re.fresnel=this.fresnel,re.opacity=this.opacity,re.height=0,re.permutation=ce,re.vertexColor=this.vertexColor;var Le=le;for(l(Le,re.view,re.model),l(Le,re.projection,Le),_(Le,Le),he=0;he<3;++he)re.eyePosition[he]=Le[12+he]/Le[15];var Pe=Le[15];for(he=0;he<3;++he)Pe+=this.lightPosition[he]*Le[4*he+3];for(he=0;he<3;++he){var qe=Le[12+he];for(Te=0;Te<3;++Te)qe+=Le[4*Te+he]*this.lightPosition[Te];re.lightPosition[he]=qe/Pe}var et=X(re,this);if(et.showSurface){for(this._shader.bind(),this._shader.uniforms=re,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(Q.TRIANGLES,this._vertexCount),he=0;he<3;++he)!this.surfaceProject[he]||!this.vertexCount||(this._shader.uniforms.model=et.projections[he],this._shader.uniforms.clipBounds=et.clipBounds[he],this._vao.draw(Q.TRIANGLES,this._vertexCount));this._vao.unbind()}if(et.showContour){var rt=this._contourShader;re.kambient=1,re.kdiffuse=0,re.kspecular=0,re.opacity=1,rt.bind(),rt.uniforms=re;var $e=this._contourVAO;for($e.bind(),he=0;he<3;++he)for(rt.uniforms.permutation=L[he],Q.lineWidth(this.contourWidth[he]*this.pixelRatio),Te=0;Te>4)/16)/255,he=Math.floor(re),xe=re-he,Te=j[1]*(ae.value[1]+(ae.value[2]&15)/16)/255,Le=Math.floor(Te),Pe=Te-Le;he+=1,Le+=1;var qe=Q.position;qe[0]=qe[1]=qe[2]=0;for(var et=0;et<2;++et)for(var rt=et?xe:1-xe,$e=0;$e<2;++$e)for(var Ue=$e?Pe:1-Pe,fe=he+et,ue=Le+$e,ie=rt*Ue,Ee=0;Ee<3;++Ee)qe[Ee]+=this._field[Ee].get(fe,ue)*ie;for(var We=this._pickResult.level,Qe=0;Qe<3;++Qe)if(We[Qe]=w.le(this.contourLevels[Qe],qe[Qe]),We[Qe]<0)this.contourLevels[Qe].length>0&&(We[Qe]=0);else if(We[Qe]Math.abs(Tt-qe[Qe])&&(We[Qe]+=1)}for(Q.index[0]=xe<.5?he:he+1,Q.index[1]=Pe<.5?Le:Le+1,Q.uv[0]=re/j[0],Q.uv[1]=Te/j[1],Ee=0;Ee<3;++Ee)Q.dataCoordinate[Ee]=this._field[Ee].get(Q.index[0],Q.index[1]);return Q},O.padField=function(ae,j){var Q=j.shape.slice(),re=ae.shape.slice();f.assign(ae.lo(1,1).hi(Q[0],Q[1]),j),f.assign(ae.lo(1).hi(Q[0],1),j.hi(Q[0],1)),f.assign(ae.lo(1,re[1]-1).hi(Q[0],1),j.lo(0,Q[1]-1).hi(Q[0],1)),f.assign(ae.lo(0,1).hi(1,Q[1]),j.hi(1)),f.assign(ae.lo(re[0]-1,1).hi(1,Q[1]),j.lo(Q[0]-1)),ae.set(0,0,j.get(0,0)),ae.set(0,re[1]-1,j.get(0,Q[1]-1)),ae.set(re[0]-1,0,j.get(Q[0]-1,0)),ae.set(re[0]-1,re[1]-1,j.get(Q[0]-1,Q[1]-1))};function Y(ae,j){return Array.isArray(ae)?[j(ae[0]),j(ae[1]),j(ae[2])]:[j(ae),j(ae),j(ae)]}function ee(ae){return Array.isArray(ae)?ae.length===3?[ae[0],ae[1],ae[2],1]:[ae[0],ae[1],ae[2],ae[3]]:[0,0,0,1]}function V(ae){if(Array.isArray(ae)){if(Array.isArray(ae))return[ee(ae[0]),ee(ae[1]),ee(ae[2])];var j=ee(ae);return[j.slice(),j.slice(),j.slice()]}}O.update=function(ae){ae=ae||{},this.objectOffset=ae.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ae&&(this.contourWidth=Y(ae.contourWidth,Number)),"showContour"in ae&&(this.showContour=Y(ae.showContour,Boolean)),"showSurface"in ae&&(this.showSurface=!!ae.showSurface),"contourTint"in ae&&(this.contourTint=Y(ae.contourTint,Boolean)),"contourColor"in ae&&(this.contourColor=V(ae.contourColor)),"contourProject"in ae&&(this.contourProject=Y(ae.contourProject,function(an){return Y(an,Boolean)})),"surfaceProject"in ae&&(this.surfaceProject=ae.surfaceProject),"dynamicColor"in ae&&(this.dynamicColor=V(ae.dynamicColor)),"dynamicTint"in ae&&(this.dynamicTint=Y(ae.dynamicTint,Number)),"dynamicWidth"in ae&&(this.dynamicWidth=Y(ae.dynamicWidth,Number)),"opacity"in ae&&(this.opacity=ae.opacity),"opacityscale"in ae&&(this.opacityscale=ae.opacityscale),"colorBounds"in ae&&(this.colorBounds=ae.colorBounds),"vertexColor"in ae&&(this.vertexColor=ae.vertexColor?1:0),"colormap"in ae&&this._colorMap.setPixels(this.genColormap(ae.colormap,this.opacityscale));var j=ae.field||ae.coords&&ae.coords[2]||null,Q=!1;if(j||(this._field[2].shape[0]||this._field[2].shape[2]?j=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):j=this._field[2].hi(0,0)),"field"in ae||"coords"in ae){var re=(j.shape[0]+2)*(j.shape[1]+2);re>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(re))),this._field[2]=c(this._field[2].data,[j.shape[0]+2,j.shape[1]+2]),this.padField(this._field[2],j),this.shape=j.shape.slice();for(var he=this.shape,xe=0;xe<2;++xe)this._field[2].size>this._field[xe].data.length&&(s.freeFloat(this._field[xe].data),this._field[xe].data=s.mallocFloat(this._field[2].size)),this._field[xe]=c(this._field[xe].data,[he[0]+2,he[1]+2]);if(ae.coords){var Te=ae.coords;if(!Array.isArray(Te)||Te.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(xe=0;xe<2;++xe){var Le=Te[xe];for($e=0;$e<2;++$e)if(Le.shape[$e]!==he[$e])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[xe],Le)}}else if(ae.ticks){var Pe=ae.ticks;if(!Array.isArray(Pe)||Pe.length!==2)throw new Error("gl-surface: invalid ticks");for(xe=0;xe<2;++xe){var qe=Pe[xe];if((Array.isArray(qe)||qe.length)&&(qe=c(qe)),qe.shape[0]!==he[xe])throw new Error("gl-surface: invalid tick length");var et=c(qe.data,he);et.stride[xe]=qe.stride[0],et.stride[xe^1]=0,this.padField(this._field[xe],et)}}else{for(xe=0;xe<2;++xe){var rt=[0,0];rt[xe]=1,this._field[xe]=c(this._field[xe].data,[he[0]+2,he[1]+2],rt,0)}this._field[0].set(0,0,0);for(var $e=0;$e0){for(var Ua=0;Ua<5;++Ua)ir.pop();we-=1}continue e}}}Ca.push(we)}this._contourOffsets[ar]=ma,this._contourCounts[ar]=Ca}var Xa=s.mallocFloat(ir.length);for(xe=0;xez||R<0||R>z)throw new Error("gl-texture2d: Invalid texture size");return y._shape=[m,R],y.bind(),L.texImage2D(L.TEXTURE_2D,0,y.format,m,R,0,y.format,y.type,null),y._mipLevels=[0],y}function l(y,m,R,L,z,F){this.gl=y,this.handle=m,this.format=z,this.type=F,this._shape=[R,L],this._mipLevels=[0],this._magFilter=y.NEAREST,this._minFilter=y.NEAREST,this._wrapS=y.CLAMP_TO_EDGE,this._wrapT=y.CLAMP_TO_EDGE,this._anisoSamples=1;var N=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return N._wrapS},set:function(U){return N.wrapS=U}},{get:function(){return N._wrapT},set:function(U){return N.wrapT=U}}]),this._wrapVector=O;var P=[this._shape[0],this._shape[1]];Object.defineProperties(P,[{get:function(){return N._shape[0]},set:function(U){return N.width=U}},{get:function(){return N._shape[1]},set:function(U){return N.height=U}}]),this._shapeVector=P}var _=l.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(y){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(y)>=0&&(m.getExtension("OES_texture_float_linear")||(y=m.NEAREST)),s.indexOf(y)<0)throw new Error("gl-texture2d: Unknown filter mode "+y);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,y),this._minFilter=y}},magFilter:{get:function(){return this._magFilter},set:function(y){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(y)>=0&&(m.getExtension("OES_texture_float_linear")||(y=m.NEAREST)),s.indexOf(y)<0)throw new Error("gl-texture2d: Unknown filter mode "+y);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,y),this._magFilter=y}},mipSamples:{get:function(){return this._anisoSamples},set:function(y){var m=this._anisoSamples;if(this._anisoSamples=Math.max(y,1)|0,m!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(y){if(this.bind(),h.indexOf(y)<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,y),this._wrapS=y}},wrapT:{get:function(){return this._wrapT},set:function(y){if(this.bind(),h.indexOf(y)<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,y),this._wrapT=y}},wrap:{get:function(){return this._wrapVector},set:function(y){if(Array.isArray(y)||(y=[y,y]),y.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var m=0;m<2;++m)if(h.indexOf(y[m])<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);this._wrapS=y[0],this._wrapT=y[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),y}},shape:{get:function(){return this._shapeVector},set:function(y){if(!Array.isArray(y))y=[y|0,y|0];else if(y.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,y[0]|0,y[1]|0),[y[0]|0,y[1]|0]}},width:{get:function(){return this._shape[0]},set:function(y){return y=y|0,T(this,y,this._shape[1]),y}},height:{get:function(){return this._shape[1]},set:function(y){return y=y|0,T(this,this._shape[0],y),y}}}),_.bind=function(y){var m=this.gl;return y!==void 0&&m.activeTexture(m.TEXTURE0+(y|0)),m.bindTexture(m.TEXTURE_2D,this.handle),y!==void 0?y|0:m.getParameter(m.ACTIVE_TEXTURE)-m.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var y=Math.min(this._shape[0],this._shape[1]),m=0;y>0;++m,y>>>=1)this._mipLevels.indexOf(m)<0&&this._mipLevels.push(m)},_.setPixels=function(y,m,R,L){var z=this.gl;this.bind(),Array.isArray(m)?(L=R,R=m[1]|0,m=m[0]|0):(m=m||0,R=R||0),L=L||0;var F=p(y)?y:y.raw;if(F){var N=this._mipLevels.indexOf(L)<0;N?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,m,R,this.format,this.type,F)}else if(y.shape&&y.stride&&y.data){if(y.shape.length<2||m+y.shape[1]>this._shape[1]>>>L||R+y.shape[0]>this._shape[0]>>>L||m<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");A(z,m,R,L,this.format,this.type,this._mipLevels,y)}else throw new Error("gl-texture2d: Unsupported data type")};function w(y,m){return y.length===3?m[2]===1&&m[1]===y[0]*y[2]&&m[0]===y[2]:m[0]===1&&m[1]===y[0]}function A(y,m,R,L,z,F,N,O){var P=O.dtype,U=O.shape.slice();if(U.length<2||U.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var B=0,X=0,$=w(U,O.stride.slice());P==="float32"?B=y.FLOAT:P==="float64"?(B=y.FLOAT,$=!1,P="float32"):P==="uint8"?B=y.UNSIGNED_BYTE:(B=y.UNSIGNED_BYTE,$=!1,P="uint8");var le=1;if(U.length===2)X=y.LUMINANCE,U=[U[0],U[1],1],O=o(O.data,U,[O.stride[0],O.stride[1],1],O.offset);else if(U.length===3){if(U[2]===1)X=y.ALPHA;else if(U[2]===2)X=y.LUMINANCE_ALPHA;else if(U[2]===3)X=y.RGB;else if(U[2]===4)X=y.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");le=U[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((X===y.LUMINANCE||X===y.ALPHA)&&(z===y.LUMINANCE||z===y.ALPHA)&&(X=z),X!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ce=O.size,ve=N.indexOf(L)<0;if(ve&&N.push(L),B===F&&$)O.offset===0&&O.data.length===ce?ve?y.texImage2D(y.TEXTURE_2D,L,z,U[0],U[1],0,z,F,O.data):y.texSubImage2D(y.TEXTURE_2D,L,m,R,U[0],U[1],z,F,O.data):ve?y.texImage2D(y.TEXTURE_2D,L,z,U[0],U[1],0,z,F,O.data.subarray(O.offset,O.offset+ce)):y.texSubImage2D(y.TEXTURE_2D,L,m,R,U[0],U[1],z,F,O.data.subarray(O.offset,O.offset+ce));else{var G;F===y.FLOAT?G=i.mallocFloat32(ce):G=i.mallocUint8(ce);var Y=o(G,U,[U[2],U[2]*U[0],1]);B===y.FLOAT&&F===y.UNSIGNED_BYTE?c(Y,O):a.assign(Y,O),ve?y.texImage2D(y.TEXTURE_2D,L,z,U[0],U[1],0,z,F,G.subarray(0,ce)):y.texSubImage2D(y.TEXTURE_2D,L,m,R,U[0],U[1],z,F,G.subarray(0,ce)),F===y.FLOAT?i.freeFloat32(G):i.freeUint8(G)}}function M(y){var m=y.createTexture();return y.bindTexture(y.TEXTURE_2D,m),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.NEAREST),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,y.NEAREST),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),m}function g(y,m,R,L,z){var F=y.getParameter(y.MAX_TEXTURE_SIZE);if(m<0||m>F||R<0||R>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===y.FLOAT&&!y.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var N=M(y);return y.texImage2D(y.TEXTURE_2D,0,L,m,R,0,L,z,null),new l(y,N,m,R,L,z)}function b(y,m,R,L,z,F){var N=M(y);return y.texImage2D(y.TEXTURE_2D,0,z,z,F,m),new l(y,N,R,L,z,F)}function v(y,m){var R=m.dtype,L=m.shape.slice(),z=y.getParameter(y.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>z||L[1]<0||L[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=w(L,m.stride.slice()),N=0;R==="float32"?N=y.FLOAT:R==="float64"?(N=y.FLOAT,F=!1,R="float32"):R==="uint8"?N=y.UNSIGNED_BYTE:(N=y.UNSIGNED_BYTE,F=!1,R="uint8");var O=0;if(L.length===2)O=y.LUMINANCE,L=[L[0],L[1],1],m=o(m.data,L,[m.stride[0],m.stride[1],1],m.offset);else if(L.length===3)if(L[2]===1)O=y.ALPHA;else if(L[2]===2)O=y.LUMINANCE_ALPHA;else if(L[2]===3)O=y.RGB;else if(L[2]===4)O=y.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");N===y.FLOAT&&!y.getExtension("OES_texture_float")&&(N=y.UNSIGNED_BYTE,F=!1);var P,U,B=m.size;if(F)m.offset===0&&m.data.length===B?P=m.data:P=m.data.subarray(m.offset,m.offset+B);else{var X=[L[2],L[2]*L[0],1];U=i.malloc(B,R);var $=o(U,L,X,0);(R==="float32"||R==="float64")&&N===y.UNSIGNED_BYTE?c($,m):a.assign($,m),P=U.subarray(0,B)}var le=M(y);return y.texImage2D(y.TEXTURE_2D,0,O,L[0],L[1],0,O,N,P),F||i.free(U),new l(y,le,L[0],L[1],O,N)}function u(y){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||f(y),typeof arguments[1]=="number")return g(y,arguments[1],arguments[2],arguments[3]||y.RGBA,arguments[4]||y.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(y,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||y.RGBA,arguments[3]||y.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var m=arguments[1],R=p(m)?m:m.raw;if(R)return b(y,R,m.width|0,m.height|0,arguments[2]||y.RGBA,arguments[3]||y.UNSIGNED_BYTE);if(m.shape&&m.data&&m.stride)return v(y,m)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),1433:(function(e){"use strict";function t(r,o,a){o?o.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var i=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>i)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(c)}}),9226:(function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}}),3126:(function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}}),3990:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r}}),1091:(function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}}),5911:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[0],f=a[1],p=a[2];return r[0]=n*p-s*f,r[1]=s*h-i*p,r[2]=i*f-n*h,r}}),5455:(function(e,t,r){e.exports=r(7056)}),7056:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return Math.sqrt(a*a+i*i+n*n)}}),4008:(function(e,t,r){e.exports=r(6690)}),6690:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r}}),244:(function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]}}),2613:(function(e){e.exports=1e-6}),9922:(function(e,t,r){e.exports=a;var o=r(2613);function a(i,n){var s=i[0],h=i[1],f=i[2],p=n[0],c=n[1],T=n[2];return Math.abs(s-p)<=o*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(h-c)<=o*Math.max(1,Math.abs(h),Math.abs(c))&&Math.abs(f-T)<=o*Math.max(1,Math.abs(f),Math.abs(T))}}),9265:(function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}}),2681:(function(e){e.exports=t;function t(r,o){return r[0]=Math.floor(o[0]),r[1]=Math.floor(o[1]),r[2]=Math.floor(o[2]),r}}),5137:(function(e,t,r){e.exports=a;var o=r(1091)();function a(i,n,s,h,f,p){var c,T;for(n||(n=3),s||(s=0),h?T=Math.min(h*n+s,i.length):T=i.length,c=s;c0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}}),7636:(function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}}),6894:(function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],h=o[1]-n,f=o[2]-s,p=Math.sin(i),c=Math.cos(i);return r[0]=o[0],r[1]=n+h*c-f*p,r[2]=s+h*p+f*c,r}}),109:(function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],h=o[0]-n,f=o[2]-s,p=Math.sin(i),c=Math.cos(i);return r[0]=n+f*p+h*c,r[1]=o[1],r[2]=s+f*c-h*p,r}}),8692:(function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],h=o[0]-n,f=o[1]-s,p=Math.sin(i),c=Math.cos(i);return r[0]=n+h*c-f*p,r[1]=s+h*p+f*c,r[2]=o[2],r}}),2447:(function(e){e.exports=t;function t(r,o){return r[0]=Math.round(o[0]),r[1]=Math.round(o[1]),r[2]=Math.round(o[2]),r}}),6621:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r}}),8489:(function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r}}),1463:(function(e){e.exports=t;function t(r,o,a,i){return r[0]=o,r[1]=a,r[2]=i,r}}),6141:(function(e,t,r){e.exports=r(2953)}),5486:(function(e,t,r){e.exports=r(3066)}),2953:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}}),3066:(function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2];return o*o+a*a+i*i}}),2229:(function(e,t,r){e.exports=r(6843)}),6843:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r}}),492:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2];return r[0]=i*a[0]+n*a[3]+s*a[6],r[1]=i*a[1]+n*a[4]+s*a[7],r[2]=i*a[2]+n*a[5]+s*a[8],r}}),5673:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[3]*i+a[7]*n+a[11]*s+a[15];return h=h||1,r[0]=(a[0]*i+a[4]*n+a[8]*s+a[12])/h,r[1]=(a[1]*i+a[5]*n+a[9]*s+a[13])/h,r[2]=(a[2]*i+a[6]*n+a[10]*s+a[14])/h,r}}),264:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[0],f=a[1],p=a[2],c=a[3],T=c*i+f*s-p*n,l=c*n+p*i-h*s,_=c*s+h*n-f*i,w=-h*i-f*n-p*s;return r[0]=T*c+w*-h+l*-p-_*-f,r[1]=l*c+w*-f+_*-h-T*-p,r[2]=_*c+w*-p+T*-f-l*-h,r}}),4361:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]+a[0],r[1]=o[1]+a[1],r[2]=o[2]+a[2],r[3]=o[3]+a[3],r}}),2335:(function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}}),2933:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}}),7536:(function(e){e.exports=t;function t(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}}),4691:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return Math.sqrt(a*a+i*i+n*n+s*s)}}),1373:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r[3]=o[3]/a[3],r}}),3750:(function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]}}),3390:(function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}}),9970:(function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}}),4494:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}}),6808:(function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return Math.sqrt(o*o+a*a+i*i+n*n)}}),2573:(function(e){e.exports=t;function t(r,o,a,i){var n=o[0],s=o[1],h=o[2],f=o[3];return r[0]=n+i*(a[0]-n),r[1]=s+i*(a[1]-s),r[2]=h+i*(a[2]-h),r[3]=f+i*(a[3]-f),r}}),160:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}}),2334:(function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}}),3576:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a[0],r[1]=o[1]*a[1],r[2]=o[2]*a[2],r[3]=o[3]*a[3],r}}),1498:(function(e){e.exports=t;function t(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r}}),5177:(function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],h=a*a+i*i+n*n+s*s;return h>0&&(h=1/Math.sqrt(h),r[0]=a*h,r[1]=i*h,r[2]=n*h,r[3]=s*h),r}}),9131:(function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}}),9288:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}}),4844:(function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}}),4578:(function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}}),7960:(function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}}),483:(function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return o*o+a*a+i*i+n*n}}),6860:(function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}}),5352:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=o[3];return r[0]=a[0]*i+a[4]*n+a[8]*s+a[12]*h,r[1]=a[1]*i+a[5]*n+a[9]*s+a[13]*h,r[2]=a[2]*i+a[6]*n+a[10]*s+a[14]*h,r[3]=a[3]*i+a[7]*n+a[11]*s+a[15]*h,r}}),4041:(function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],h=a[0],f=a[1],p=a[2],c=a[3],T=c*i+f*s-p*n,l=c*n+p*i-h*s,_=c*s+h*n-f*i,w=-h*i-f*n-p*s;return r[0]=T*c+w*-h+l*-p-_*-f,r[1]=l*c+w*-f+_*-h-T*-p,r[2]=_*c+w*-p+T*-f-l*-h,r[3]=o[3],r}}),1848:(function(e,t,r){var o=r(4905),a=r(6468);e.exports=i;function i(n){for(var s=Array.isArray(n)?n:o(n),h=0;h0)continue;Qe=ie.slice(0,1).join("")}return Q(Qe),ce+=Qe.length,P=P.slice(Qe.length),P.length}while(!0)}function $e(){return/[^a-fA-F0-9]/.test(N)?(Q(P.join("")),F=h,L):(P.push(N),O=N,L+1)}function Ue(){return N==="."||/[eE]/.test(N)?(P.push(N),F=w,O=N,L+1):N==="x"&&P.length===1&&P[0]==="0"?(F=u,P.push(N),O=N,L+1):/[^\d]/.test(N)?(Q(P.join("")),F=h,L):(P.push(N),O=N,L+1)}function fe(){return N==="f"&&(P.push(N),O=N,L+=1),/[eE]/.test(N)||(N==="-"||N==="+")&&/[eE]/.test(O)?(P.push(N),O=N,L+1):/[^\d]/.test(N)?(Q(P.join("")),F=h,L):(P.push(N),O=N,L+1)}function ue(){if(/[^\d\w_]/.test(N)){var ie=P.join("");return j[ie]?F=g:ae[ie]?F=M:F=A,Q(P.join("")),F=h,L}return P.push(N),O=N,L+1}}}),3508:(function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])}),6852:(function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]}),7932:(function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])}),620:(function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]}),7827:(function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),4905:(function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),h=[];return h=h.concat(s(i)),h=h.concat(s(null)),h}}),3236:(function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a>1,T=-7,l=a?n-1:0,_=a?-1:1,w=r[o+l];for(l+=_,s=w&(1<<-T)-1,w>>=-T,T+=f;T>0;s=s*256+r[o+l],l+=_,T-=8);for(h=s&(1<<-T)-1,s>>=-T,T+=i;T>0;h=h*256+r[o+l],l+=_,T-=8);if(s===0)s=1-c;else{if(s===p)return h?NaN:(w?-1:1)*(1/0);h=h+Math.pow(2,i),s=s-c}return(w?-1:1)*h*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var h,f,p,c=s*8-n-1,T=(1<>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:s-1,A=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(f=isNaN(o)?1:0,h=T):(h=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-h))<1&&(h--,p*=2),h+l>=1?o+=_/p:o+=_*Math.pow(2,1-l),o*p>=2&&(h++,p/=2),h+l>=T?(f=0,h=T):h+l>=1?(f=(o*p-1)*Math.pow(2,n),h=h+l):(f=o*Math.pow(2,l-1)*Math.pow(2,n),h=0));n>=8;r[a+w]=f&255,w+=A,f/=256,n-=8);for(h=h<0;r[a+w]=h&255,w+=A,h/=256,c-=8);r[a+w-A]|=M*128}}),8954:(function(e,t,r){"use strict";e.exports=l;var o=r(3250),a=r(6803).Fw;function i(_,w,A){this.vertices=_,this.adjacent=w,this.boundary=A,this.lastVisited=-1}i.prototype.flip=function(){var _=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=_;var w=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=w};function n(_,w,A){this.vertices=_,this.cell=w,this.index=A}function s(_,w){return a(_.vertices,w.vertices)}function h(_){return function(){var w=this.tuple;return _.apply(this,w)}}function f(_){var w=o[_+1];return w||(w=o),h(w)}var p=[];function c(_,w,A){this.dimension=_,this.vertices=w,this.simplices=A,this.interior=A.filter(function(b){return!b.boundary}),this.tuple=new Array(_+1);for(var M=0;M<=_;++M)this.tuple[M]=this.vertices[M];var g=p[_];g||(g=p[_]=f(_)),this.orient=g}var T=c.prototype;T.handleBoundaryDegeneracy=function(_,w){var A=this.dimension,M=this.vertices.length-1,g=this.tuple,b=this.vertices,v=[_];for(_.lastVisited=-M;v.length>0;){_=v.pop();for(var u=_.adjacent,y=0;y<=A;++y){var m=u[y];if(!(!m.boundary||m.lastVisited<=-M)){for(var R=m.vertices,L=0;L<=A;++L){var z=R[L];z<0?g[L]=w:g[L]=b[z]}var F=this.orient();if(F>0)return m;m.lastVisited=-M,F===0&&v.push(m)}}}return null},T.walk=function(_,w){var A=this.vertices.length-1,M=this.dimension,g=this.vertices,b=this.tuple,v=w?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[v];e:for(;!u.boundary;){for(var y=u.vertices,m=u.adjacent,R=0;R<=M;++R)b[R]=g[y[R]];u.lastVisited=A;for(var R=0;R<=M;++R){var L=m[R];if(!(L.lastVisited>=A)){var z=b[R];b[R]=_;var F=this.orient();if(b[R]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-A:L.lastVisited=A}}return}return u},T.addPeaks=function(_,w){var A=this.vertices.length-1,M=this.dimension,g=this.vertices,b=this.tuple,v=this.interior,u=this.simplices,y=[w];w.lastVisited=A,w.vertices[w.vertices.indexOf(-1)]=A,w.boundary=!1,v.push(w);for(var m=[];y.length>0;){var w=y.pop(),R=w.vertices,L=w.adjacent,z=R.indexOf(A);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var N=L[F];if(!(!N.boundary||N.lastVisited>=A)){var O=N.vertices;if(N.lastVisited!==-A){for(var P=0,U=0;U<=M;++U)O[U]<0?(P=U,b[U]=_):b[U]=g[O[U]];var B=this.orient();if(B>0){O[P]=A,N.boundary=!1,v.push(N),y.push(N),N.lastVisited=A;continue}else N.lastVisited=-A}var X=N.adjacent,$=R.slice(),le=L.slice(),ce=new i($,le,!0);u.push(ce);var ve=X.indexOf(w);if(!(ve<0)){X[ve]=ce,le[z]=N,$[F]=-1,le[F]=w,L[F]=ce,ce.flip();for(var U=0;U<=M;++U){var G=$[U];if(!(G<0||G===A)){for(var Y=new Array(M-1),ee=0,V=0;V<=M;++V){var se=$[V];se<0||V===U||(Y[ee++]=se)}m.push(new n(Y,ce,U))}}}}}}}m.sort(s);for(var F=0;F+1=0?v[y++]=u[R]:m=R&1;if(m===(_&1)){var L=v[0];v[0]=v[1],v[1]=L}w.push(v)}}return w};function l(_,w){var A=_.length;if(A===0)throw new Error("Must have at least d+1 points");var M=_[0].length;if(A<=M)throw new Error("Must input at least d+1 points");var g=_.slice(0,M+1),b=o.apply(void 0,g);if(b===0)throw new Error("Input not in general position");for(var v=new Array(M+1),u=0;u<=M;++u)v[u]=u;b<0&&(v[0]=1,v[1]=0);for(var y=new i(v,new Array(M+1),!1),m=y.adjacent,R=new Array(M+2),u=0;u<=M;++u){for(var L=v.slice(),z=0;z<=M;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var N=new i(L,new Array(M+1),!0);m[u]=N,R[u]=N}R[M+1]=y;for(var u=0;u<=M;++u)for(var L=m[u].vertices,O=m[u].adjacent,z=0;z<=M;++z){var P=L[z];if(P<0){O[z]=y;continue}for(var U=0;U<=M;++U)m[U].vertices.indexOf(P)<0&&(O[z]=m[U])}for(var B=new c(M,g,R),X=!!w,u=M+1;u3*(R+1)?c(this,m):this.left.insert(m):this.left=b([m]);else if(m[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?c(this,m):this.right.insert(m):this.right=b([m]);else{var L=o.ge(this.leftPoints,m,M),z=o.ge(this.rightPoints,m,g);this.leftPoints.splice(L,0,m),this.rightPoints.splice(z,0,m)}},h.remove=function(m){var R=this.count-this.leftPoints;if(m[1]3*(R-1))return T(this,m);var z=this.left.remove(m);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(m[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(R-1))return T(this,m);var z=this.right.remove(m);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===m?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===m){if(this.left&&this.right){for(var N=this,O=this.left;O.right;)N=O,O=O.right;if(N===this)O.right=this.right;else{var P=this.left,z=this.right;N.count-=O.count,N.right=O.left,O.left=P,O.right=z}f(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?f(this,this.left):f(this,this.right);return i}for(var P=o.ge(this.leftPoints,m,M);P=0&&m[z][1]>=R;--z){var F=L(m[z]);if(F)return F}}function w(m,R){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(m,R);if(L)return L}return _(this.rightPoints,m,R)}else return w(this.leftPoints,R)},h.queryInterval=function(m,R,L){if(mthis.mid&&this.right){var z=this.right.queryInterval(m,R,L);if(z)return z}return Rthis.mid?_(this.rightPoints,m,L):w(this.leftPoints,L)};function A(m,R){return m-R}function M(m,R){var L=m[0]-R[0];return L||m[1]-R[1]}function g(m,R){var L=m[1]-R[1];return L||m[0]-R[0]}function b(m){if(m.length===0)return null;for(var R=[],L=0;L>1],F=[],N=[],O=[],L=0;L13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}}),395:(function(e){function t(r,o,a){return r*(1-a)+o*a}e.exports=t}),2652:(function(e,t,r){var o=r(4335),a=r(6864),i=r(1903),n=r(9921),s=r(7608),h=r(5665),f={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},p=a(),c=a(),T=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],_=[0,0,0];e.exports=function(b,v,u,y,m,R){if(v||(v=[0,0,0]),u||(u=[0,0,0]),y||(y=[0,0,0]),m||(m=[0,0,0,1]),R||(R=[0,0,0,1]),!o(p,b)||(i(c,p),c[3]=0,c[7]=0,c[11]=0,c[15]=1,Math.abs(n(c)<1e-8)))return!1;var L=p[3],z=p[7],F=p[11],N=p[12],O=p[13],P=p[14],U=p[15];if(L!==0||z!==0||F!==0){T[0]=L,T[1]=z,T[2]=F,T[3]=U;var B=s(c,c);if(!B)return!1;h(c,c),w(m,T,c)}else m[0]=m[1]=m[2]=0,m[3]=1;if(v[0]=N,v[1]=O,v[2]=P,A(l,p),u[0]=f.length(l[0]),f.normalize(l[0],l[0]),y[0]=f.dot(l[0],l[1]),M(l[1],l[1],l[0],1,-y[0]),u[1]=f.length(l[1]),f.normalize(l[1],l[1]),y[0]/=u[1],y[1]=f.dot(l[0],l[2]),M(l[2],l[2],l[0],1,-y[1]),y[2]=f.dot(l[1],l[2]),M(l[2],l[2],l[1],1,-y[2]),u[2]=f.length(l[2]),f.normalize(l[2],l[2]),y[1]/=u[2],y[2]/=u[2],f.cross(_,l[1],l[2]),f.dot(l[0],_)<0)for(var X=0;X<3;X++)u[X]*=-1,l[X][0]*=-1,l[X][1]*=-1,l[X][2]*=-1;return R[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),R[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),R[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),R[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(R[0]=-R[0]),l[0][2]>l[2][0]&&(R[1]=-R[1]),l[1][0]>l[0][1]&&(R[2]=-R[2]),!0};function w(g,b,v){var u=b[0],y=b[1],m=b[2],R=b[3];return g[0]=v[0]*u+v[4]*y+v[8]*m+v[12]*R,g[1]=v[1]*u+v[5]*y+v[9]*m+v[13]*R,g[2]=v[2]*u+v[6]*y+v[10]*m+v[14]*R,g[3]=v[3]*u+v[7]*y+v[11]*m+v[15]*R,g}function A(g,b){g[0][0]=b[0],g[0][1]=b[1],g[0][2]=b[2],g[1][0]=b[4],g[1][1]=b[5],g[1][2]=b[6],g[2][0]=b[8],g[2][1]=b[9],g[2][2]=b[10]}function M(g,b,v,u,y){g[0]=b[0]*u+v[0]*y,g[1]=b[1]*u+v[1]*y,g[2]=b[2]*u+v[2]*y}}),4335:(function(e){e.exports=function(r,o){var a=o[15];if(a===0)return!1;for(var i=1/a,n=0;n<16;n++)r[n]=o[n]*i;return!0}}),7442:(function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),h=T(),f=T(),p=T();e.exports=c;function c(w,A,M,g){if(n(A)===0||n(M)===0)return!1;var b=i(A,h.translate,h.scale,h.skew,h.perspective,h.quaternion),v=i(M,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!b||!v?!1:(o(p.translate,h.translate,f.translate,g),o(p.skew,h.skew,f.skew,g),o(p.scale,h.scale,f.scale,g),o(p.perspective,h.perspective,f.perspective,g),s(p.quaternion,h.quaternion,f.quaternion,g),a(w,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:_(),quaternion:_()}}function l(w){return[w||0,w||0,w||0]}function _(){return[0,0,0,1]}}),7182:(function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},a=o.create(),i=o.create();e.exports=function(s,h,f,p,c,T){return o.identity(s),o.fromRotationTranslation(s,T,h),s[3]=c[0],s[7]=c[1],s[11]=c[2],s[15]=c[3],o.identity(i),p[2]!==0&&(i[9]=p[2],o.multiply(s,s,i)),p[1]!==0&&(i[9]=0,i[8]=p[1],o.multiply(s,s,i)),p[0]!==0&&(i[8]=0,i[4]=p[0],o.multiply(s,s,i)),o.scale(s,s,f),s}}),1811:(function(e,t,r){"use strict";var o=r(2478),a=r(7442),i=r(7608),n=r(5567),s=r(2408),h=r(7089),f=r(6582),p=r(7656),c=r(2504),T=r(3536),l=[0,0,0];e.exports=M;function _(g){this._components=g.slice(),this._time=[0],this.prevMatrix=g.slice(),this.nextMatrix=g.slice(),this.computedMatrix=g.slice(),this.computedInverse=g.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var w=_.prototype;w.recalcMatrix=function(g){var b=this._time,v=o.le(b,g),u=this.computedMatrix;if(!(v<0)){var y=this._components;if(v===b.length-1)for(var m=16*v,R=0;R<16;++R)u[R]=y[m++];else{for(var L=b[v+1]-b[v],m=16*v,z=this.prevMatrix,F=!0,R=0;R<16;++R)z[R]=y[m++];for(var N=this.nextMatrix,R=0;R<16;++R)N[R]=y[m++],F=F&&z[R]===N[R];if(L<1e-6||F)for(var R=0;R<16;++R)u[R]=z[R];else a(u,z,N,(g-b[v])/L)}var O=this.computedUp;O[0]=u[1],O[1]=u[5],O[2]=u[9],T(O,O);var P=this.computedInverse;i(P,u);var U=this.computedEye,B=P[15];U[0]=P[12]/B,U[1]=P[13]/B,U[2]=P[14]/B;for(var X=this.computedCenter,$=Math.exp(this.computedRadius[0]),R=0;R<3;++R)X[R]=U[R]-u[2+4*R]*$}},w.idle=function(g){if(!(g1&&o(i[f[l-2]],i[f[l-1]],T)<=0;)l-=1,f.pop();for(f.push(c),l=p.length;l>1&&o(i[p[l-2]],i[p[l-1]],T)>=0;)l-=1,p.pop();p.push(c)}for(var _=new Array(p.length+f.length-2),w=0,s=0,A=f.length;s0;--M)_[w++]=p[M];return _}}),351:(function(e,t,r){"use strict";e.exports=a;var o=r(4687);function a(i,n){n||(n=i,i=window);var s=0,h=0,f=0,p={shift:!1,alt:!1,control:!1,meta:!1},c=!1;function T(m){var R=!1;return"altKey"in m&&(R=R||m.altKey!==p.alt,p.alt=!!m.altKey),"shiftKey"in m&&(R=R||m.shiftKey!==p.shift,p.shift=!!m.shiftKey),"ctrlKey"in m&&(R=R||m.ctrlKey!==p.control,p.control=!!m.ctrlKey),"metaKey"in m&&(R=R||m.metaKey!==p.meta,p.meta=!!m.metaKey),R}function l(m,R){var L=o.x(R),z=o.y(R);"buttons"in R&&(m=R.buttons|0),(m!==s||L!==h||z!==f||T(R))&&(s=m|0,h=L||0,f=z||0,n&&n(s,h,f,p))}function _(m){l(0,m)}function w(){(s||h||f||p.shift||p.alt||p.meta||p.control)&&(h=f=0,s=0,p.shift=p.alt=p.control=p.meta=!1,n&&n(0,0,0,p))}function A(m){T(m)&&n&&n(s,h,f,p)}function M(m){o.buttons(m)===0?l(0,m):l(s,m)}function g(m){l(s|o.buttons(m),m)}function b(m){l(s&~o.buttons(m),m)}function v(){c||(c=!0,i.addEventListener("mousemove",M),i.addEventListener("mousedown",g),i.addEventListener("mouseup",b),i.addEventListener("mouseleave",_),i.addEventListener("mouseenter",_),i.addEventListener("mouseout",_),i.addEventListener("mouseover",_),i.addEventListener("blur",w),i.addEventListener("keyup",A),i.addEventListener("keydown",A),i.addEventListener("keypress",A),i!==window&&(window.addEventListener("blur",w),window.addEventListener("keyup",A),window.addEventListener("keydown",A),window.addEventListener("keypress",A)))}function u(){c&&(c=!1,i.removeEventListener("mousemove",M),i.removeEventListener("mousedown",g),i.removeEventListener("mouseup",b),i.removeEventListener("mouseleave",_),i.removeEventListener("mouseenter",_),i.removeEventListener("mouseout",_),i.removeEventListener("mouseover",_),i.removeEventListener("blur",w),i.removeEventListener("keyup",A),i.removeEventListener("keydown",A),i.removeEventListener("keypress",A),i!==window&&(window.removeEventListener("blur",w),window.removeEventListener("keyup",A),window.removeEventListener("keydown",A),window.removeEventListener("keypress",A)))}v();var y={element:i};return Object.defineProperties(y,{enabled:{get:function(){return c},set:function(m){m?v():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return h},enumerable:!0},y:{get:function(){return f},enumerable:!0},mods:{get:function(){return p},enumerable:!0}}),y}}),24:(function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,h=a.clientY||0,f=o(i);return n[0]=s-f.left,n[1]=h-f.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}}),4687:(function(e,t){"use strict";function r(n){if(typeof n=="object"){if("buttons"in n)return n.buttons;if("which"in n){var s=n.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(le=1,G[ee++]=p(v[R],w,A,M),R+=B,g>0)for($=1,L=v[R],V=G[ee]=p(L,w,A,M),j=G[ee+se],he=G[ee+Q],Le=G[ee+xe],(V!==j||V!==he||V!==Le)&&(F=v[R+z],O=v[R+N],U=v[R+P],h($,le,L,F,O,U,V,j,he,Le,w,A,M),Pe=Y[ee]=ce++),ee+=1,R+=B,$=2;$0)for($=1,L=v[R],V=G[ee]=p(L,w,A,M),j=G[ee+se],he=G[ee+Q],Le=G[ee+xe],(V!==j||V!==he||V!==Le)&&(F=v[R+z],O=v[R+N],U=v[R+P],h($,le,L,F,O,U,V,j,he,Le,w,A,M),Pe=Y[ee]=ce++,Le!==he&&f(Y[ee+Q],Pe,O,U,he,Le,w,A,M)),ee+=1,R+=B,$=2;$0){if($=1,G[ee++]=p(v[R],w,A,M),R+=B,b>0)for(le=1,L=v[R],V=G[ee]=p(L,w,A,M),he=G[ee+Q],j=G[ee+se],Le=G[ee+xe],(V!==he||V!==j||V!==Le)&&(F=v[R+z],O=v[R+N],U=v[R+P],h($,le,L,F,O,U,V,he,j,Le,w,A,M),Pe=Y[ee]=ce++),ee+=1,R+=B,le=2;le0)for(le=1,L=v[R],V=G[ee]=p(L,w,A,M),he=G[ee+Q],j=G[ee+se],Le=G[ee+xe],(V!==he||V!==j||V!==Le)&&(F=v[R+z],O=v[R+N],U=v[R+P],h($,le,L,F,O,U,V,he,j,Le,w,A,M),Pe=Y[ee]=ce++,Le!==he&&f(Y[ee+Q],Pe,U,F,Le,he,w,A,M)),ee+=1,R+=B,le=2;le 0"),typeof s.vertex!="function"&&h("Must specify vertex creation function"),typeof s.cell!="function"&&h("Must specify cell creation function"),typeof s.phase!="function"&&h("Must specify phase function");for(var T=s.getters||[],l=new Array(p),_=0;_=0?l[_]=!0:l[_]=!1;return i(s.vertex,s.cell,s.phase,c,f,l)}}),6199:(function(e,t,r){"use strict";var o=r(1338),a={zero:function(M,g,b,v){var u=M[0],y=b[0];v|=0;var m=0,R=y;for(m=0;m2&&m[1]>2&&v(y.pick(-1,-1).lo(1,1).hi(m[0]-2,m[1]-2),u.pick(-1,-1,0).lo(1,1).hi(m[0]-2,m[1]-2),u.pick(-1,-1,1).lo(1,1).hi(m[0]-2,m[1]-2)),m[1]>2&&(b(y.pick(0,-1).lo(1).hi(m[1]-2),u.pick(0,-1,1).lo(1).hi(m[1]-2)),g(u.pick(0,-1,0).lo(1).hi(m[1]-2))),m[1]>2&&(b(y.pick(m[0]-1,-1).lo(1).hi(m[1]-2),u.pick(m[0]-1,-1,1).lo(1).hi(m[1]-2)),g(u.pick(m[0]-1,-1,0).lo(1).hi(m[1]-2))),m[0]>2&&(b(y.pick(-1,0).lo(1).hi(m[0]-2),u.pick(-1,0,0).lo(1).hi(m[0]-2)),g(u.pick(-1,0,1).lo(1).hi(m[0]-2))),m[0]>2&&(b(y.pick(-1,m[1]-1).lo(1).hi(m[0]-2),u.pick(-1,m[1]-1,0).lo(1).hi(m[0]-2)),g(u.pick(-1,m[1]-1,1).lo(1).hi(m[0]-2))),u.set(0,0,0,0),u.set(0,0,1,0),u.set(m[0]-1,0,0,0),u.set(m[0]-1,0,1,0),u.set(0,m[1]-1,0,0),u.set(0,m[1]-1,1,0),u.set(m[0]-1,m[1]-1,0,0),u.set(m[0]-1,m[1]-1,1,0),u}}function A(M){var g=M.join(),m=p[g];if(m)return m;for(var b=M.length,v=[T,l],u=1;u<=b;++u)v.push(_(u));var y=w,m=y.apply(void 0,v);return p[g]=m,m}e.exports=function(g,b,v){if(Array.isArray(v)||(typeof v=="string"?v=o(b.dimension,v):v=o(b.dimension,"clamp")),b.size===0)return g;if(b.dimension===0)return g.set(0),g;var u=A(v);return u(g,b)}}),4317:(function(e){"use strict";function t(n,s){var h=Math.floor(s),f=s-h,p=0<=h&&h0;){O<64?(g=O,O=0):(g=64,O-=64);for(var P=p[1]|0;P>0;){P<64?(b=P,P=0):(b=64,P-=64),l=F+O*u+P*y,A=N+O*R+P*L;var U=0,B=0,X=0,$=m,le=u-v*m,ce=y-g*u,ve=z,G=R-v*z,Y=L-g*R;for(X=0;X0;){L<64?(g=L,L=0):(g=64,L-=64);for(var z=p[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=m+L*v+z*b,A=R+L*y+z*u;var F=0,N=0,O=v,P=b-g*v,U=y,B=u-g*y;for(N=0;N0;){N<64?(b=N,N=0):(b=64,N-=64);for(var O=p[0]|0;O>0;){O<64?(M=O,O=0):(M=64,O-=64);for(var P=p[1]|0;P>0;){P<64?(g=P,P=0):(g=64,P-=64),l=z+N*y+O*v+P*u,A=F+N*L+O*m+P*R;var U=0,B=0,X=0,$=y,le=v-b*y,ce=u-M*v,ve=L,G=m-b*L,Y=R-M*m;for(X=0;X_;){U=0,B=F-g;t:for(O=0;O$)break t;B+=m,U+=R}for(U=F,B=F-g,O=0;O>1,P=O-z,U=O+z,B=F,X=P,$=O,le=U,ce=N,ve=w+1,G=A-1,Y=!0,ee,V,se,ae,j,Q,re,he,xe,Te=0,Le=0,Pe=0,qe,et,rt,$e,Ue,fe,ue,ie,Ee,We,Qe,Xe,Tt,St,zt,Ut,br=y,hr=T(br),Or=T(br);et=b*B,rt=b*X,Ut=g;e:for(qe=0;qe0){V=B,B=X,X=V;break e}if(Pe<0)break e;Ut+=R}et=b*le,rt=b*ce,Ut=g;e:for(qe=0;qe0){V=le,le=ce,ce=V;break e}if(Pe<0)break e;Ut+=R}et=b*B,rt=b*$,Ut=g;e:for(qe=0;qe0){V=B,B=$,$=V;break e}if(Pe<0)break e;Ut+=R}et=b*X,rt=b*$,Ut=g;e:for(qe=0;qe0){V=X,X=$,$=V;break e}if(Pe<0)break e;Ut+=R}et=b*B,rt=b*le,Ut=g;e:for(qe=0;qe0){V=B,B=le,le=V;break e}if(Pe<0)break e;Ut+=R}et=b*$,rt=b*le,Ut=g;e:for(qe=0;qe0){V=$,$=le,le=V;break e}if(Pe<0)break e;Ut+=R}et=b*X,rt=b*ce,Ut=g;e:for(qe=0;qe0){V=X,X=ce,ce=V;break e}if(Pe<0)break e;Ut+=R}et=b*X,rt=b*$,Ut=g;e:for(qe=0;qe0){V=X,X=$,$=V;break e}if(Pe<0)break e;Ut+=R}et=b*le,rt=b*ce,Ut=g;e:for(qe=0;qe0){V=le,le=ce,ce=V;break e}if(Pe<0)break e;Ut+=R}for(et=b*B,rt=b*X,$e=b*$,Ue=b*le,fe=b*ce,ue=b*F,ie=b*O,Ee=b*N,zt=0,Ut=g,qe=0;qe0)G--;else if(Pe<0){for(et=b*Q,rt=b*ve,$e=b*G,Ut=g,qe=0;qe0)for(;;){re=g+G*b,zt=0;e:for(qe=0;qe0){if(--GN){e:for(;;){for(re=g+ve*b,zt=0,Ut=g,qe=0;qe1&&_?A(l,_[0],_[1]):A(l)}var f={"uint32,1,0":function(c,T){return function(l){var _=l.data,w=l.offset|0,A=l.shape,M=l.stride,g=M[0]|0,b=A[0]|0,v=M[1]|0,u=A[1]|0,y=v,m=v,R=1;b<=32?c(0,b-1,_,w,g,v,b,u,y,m,R):T(0,b-1,_,w,g,v,b,u,y,m,R)}}};function p(c,T){var l=[T,c].join(","),_=f[l],w=n(c,T),A=h(c,T,w);return _(w,A)}e.exports=p}),446:(function(e,t,r){"use strict";var o=r(7640),a={};function i(n){var s=n.order,h=n.dtype,f=[s,h],p=f.join(":"),c=a[p];return c||(a[p]=c=o(s,h)),c(n),n}e.exports=i}),9618:(function(e,t,r){var o=r(7163),a=typeof Float64Array<"u";function i(T,l){return T[0]-l[0]}function n(){var T=this.stride,l=new Array(T.length),_;for(_=0;_=0&&(v=g|0,b+=y*v,u-=v),new w(this.data,u,y,b)},A.step=function(g){var b=this.shape[0],v=this.stride[0],u=this.offset,y=0,m=Math.ceil;return typeof g=="number"&&(y=g|0,y<0?(u+=v*(b-1),b=m(-b/y)):b=m(b/y),v*=y),new w(this.data,b,v,u)},A.transpose=function(g){g=g===void 0?0:g|0;var b=this.shape,v=this.stride;return new w(this.data,b[g],v[g],this.offset)},A.pick=function(g){var b=[],v=[],u=this.offset;typeof g=="number"&&g>=0?u=u+this.stride[0]*g|0:(b.push(this.shape[0]),v.push(this.stride[0]));var y=l[b.length+1];return y(this.data,b,v,u)},function(g,b,v,u){return new w(g,b[0],v[0],u)}},2:function(T,l,_){function w(M,g,b,v,u,y){this.data=M,this.shape=[g,b],this.stride=[v,u],this.offset=y|0}var A=w.prototype;return A.dtype=T,A.dimension=2,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(A,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),A.set=function(g,b,v){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b,v):this.data[this.offset+this.stride[0]*g+this.stride[1]*b]=v},A.get=function(g,b){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b):this.data[this.offset+this.stride[0]*g+this.stride[1]*b]},A.index=function(g,b){return this.offset+this.stride[0]*g+this.stride[1]*b},A.hi=function(g,b){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|0,typeof b!="number"||b<0?this.shape[1]:b|0,this.stride[0],this.stride[1],this.offset)},A.lo=function(g,b){var v=this.offset,u=0,y=this.shape[0],m=this.shape[1],R=this.stride[0],L=this.stride[1];return typeof g=="number"&&g>=0&&(u=g|0,v+=R*u,y-=u),typeof b=="number"&&b>=0&&(u=b|0,v+=L*u,m-=u),new w(this.data,y,m,R,L,v)},A.step=function(g,b){var v=this.shape[0],u=this.shape[1],y=this.stride[0],m=this.stride[1],R=this.offset,L=0,z=Math.ceil;return typeof g=="number"&&(L=g|0,L<0?(R+=y*(v-1),v=z(-v/L)):v=z(v/L),y*=L),typeof b=="number"&&(L=b|0,L<0?(R+=m*(u-1),u=z(-u/L)):u=z(u/L),m*=L),new w(this.data,v,u,y,m,R)},A.transpose=function(g,b){g=g===void 0?0:g|0,b=b===void 0?1:b|0;var v=this.shape,u=this.stride;return new w(this.data,v[g],v[b],u[g],u[b],this.offset)},A.pick=function(g,b){var v=[],u=[],y=this.offset;typeof g=="number"&&g>=0?y=y+this.stride[0]*g|0:(v.push(this.shape[0]),u.push(this.stride[0])),typeof b=="number"&&b>=0?y=y+this.stride[1]*b|0:(v.push(this.shape[1]),u.push(this.stride[1]));var m=l[v.length+1];return m(this.data,v,u,y)},function(g,b,v,u){return new w(g,b[0],b[1],v[0],v[1],u)}},3:function(T,l,_){function w(M,g,b,v,u,y,m,R){this.data=M,this.shape=[g,b,v],this.stride=[u,y,m],this.offset=R|0}var A=w.prototype;return A.dtype=T,A.dimension=3,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(A,"order",{get:function(){var g=Math.abs(this.stride[0]),b=Math.abs(this.stride[1]),v=Math.abs(this.stride[2]);return g>b?b>v?[2,1,0]:g>v?[1,2,0]:[1,0,2]:g>v?[2,0,1]:v>b?[0,1,2]:[0,2,1]}}),A.set=function(g,b,v,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v,u):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v]=u},A.get=function(g,b,v){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v]},A.index=function(g,b,v){return this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v},A.hi=function(g,b,v){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof v!="number"||v<0?this.shape[2]:v|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},A.lo=function(g,b,v){var u=this.offset,y=0,m=this.shape[0],R=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],N=this.stride[2];return typeof g=="number"&&g>=0&&(y=g|0,u+=z*y,m-=y),typeof b=="number"&&b>=0&&(y=b|0,u+=F*y,R-=y),typeof v=="number"&&v>=0&&(y=v|0,u+=N*y,L-=y),new w(this.data,m,R,L,z,F,N,u)},A.step=function(g,b,v){var u=this.shape[0],y=this.shape[1],m=this.shape[2],R=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,N=0,O=Math.ceil;return typeof g=="number"&&(N=g|0,N<0?(F+=R*(u-1),u=O(-u/N)):u=O(u/N),R*=N),typeof b=="number"&&(N=b|0,N<0?(F+=L*(y-1),y=O(-y/N)):y=O(y/N),L*=N),typeof v=="number"&&(N=v|0,N<0?(F+=z*(m-1),m=O(-m/N)):m=O(m/N),z*=N),new w(this.data,u,y,m,R,L,z,F)},A.transpose=function(g,b,v){g=g===void 0?0:g|0,b=b===void 0?1:b|0,v=v===void 0?2:v|0;var u=this.shape,y=this.stride;return new w(this.data,u[g],u[b],u[v],y[g],y[b],y[v],this.offset)},A.pick=function(g,b,v){var u=[],y=[],m=this.offset;typeof g=="number"&&g>=0?m=m+this.stride[0]*g|0:(u.push(this.shape[0]),y.push(this.stride[0])),typeof b=="number"&&b>=0?m=m+this.stride[1]*b|0:(u.push(this.shape[1]),y.push(this.stride[1])),typeof v=="number"&&v>=0?m=m+this.stride[2]*v|0:(u.push(this.shape[2]),y.push(this.stride[2]));var R=l[u.length+1];return R(this.data,u,y,m)},function(g,b,v,u){return new w(g,b[0],b[1],b[2],v[0],v[1],v[2],u)}},4:function(T,l,_){function w(M,g,b,v,u,y,m,R,L,z){this.data=M,this.shape=[g,b,v,u],this.stride=[y,m,R,L],this.offset=z|0}var A=w.prototype;return A.dtype=T,A.dimension=4,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(A,"order",{get:_}),A.set=function(g,b,v,u,y){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u,y):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u]=y},A.get=function(g,b,v,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u]},A.index=function(g,b,v,u){return this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*v+this.stride[3]*u},A.hi=function(g,b,v,u){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof v!="number"||v<0?this.shape[2]:v|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},A.lo=function(g,b,v,u){var y=this.offset,m=0,R=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.stride[0],O=this.stride[1],P=this.stride[2],U=this.stride[3];return typeof g=="number"&&g>=0&&(m=g|0,y+=N*m,R-=m),typeof b=="number"&&b>=0&&(m=b|0,y+=O*m,L-=m),typeof v=="number"&&v>=0&&(m=v|0,y+=P*m,z-=m),typeof u=="number"&&u>=0&&(m=u|0,y+=U*m,F-=m),new w(this.data,R,L,z,F,N,O,P,U,y)},A.step=function(g,b,v,u){var y=this.shape[0],m=this.shape[1],R=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],N=this.stride[2],O=this.stride[3],P=this.offset,U=0,B=Math.ceil;return typeof g=="number"&&(U=g|0,U<0?(P+=z*(y-1),y=B(-y/U)):y=B(y/U),z*=U),typeof b=="number"&&(U=b|0,U<0?(P+=F*(m-1),m=B(-m/U)):m=B(m/U),F*=U),typeof v=="number"&&(U=v|0,U<0?(P+=N*(R-1),R=B(-R/U)):R=B(R/U),N*=U),typeof u=="number"&&(U=u|0,U<0?(P+=O*(L-1),L=B(-L/U)):L=B(L/U),O*=U),new w(this.data,y,m,R,L,z,F,N,O,P)},A.transpose=function(g,b,v,u){g=g===void 0?0:g|0,b=b===void 0?1:b|0,v=v===void 0?2:v|0,u=u===void 0?3:u|0;var y=this.shape,m=this.stride;return new w(this.data,y[g],y[b],y[v],y[u],m[g],m[b],m[v],m[u],this.offset)},A.pick=function(g,b,v,u){var y=[],m=[],R=this.offset;typeof g=="number"&&g>=0?R=R+this.stride[0]*g|0:(y.push(this.shape[0]),m.push(this.stride[0])),typeof b=="number"&&b>=0?R=R+this.stride[1]*b|0:(y.push(this.shape[1]),m.push(this.stride[1])),typeof v=="number"&&v>=0?R=R+this.stride[2]*v|0:(y.push(this.shape[2]),m.push(this.stride[2])),typeof u=="number"&&u>=0?R=R+this.stride[3]*u|0:(y.push(this.shape[3]),m.push(this.stride[3]));var L=l[y.length+1];return L(this.data,y,m,R)},function(g,b,v,u){return new w(g,b[0],b[1],b[2],b[3],v[0],v[1],v[2],v[3],u)}},5:function(l,_,w){function A(g,b,v,u,y,m,R,L,z,F,N,O){this.data=g,this.shape=[b,v,u,y,m],this.stride=[R,L,z,F,N],this.offset=O|0}var M=A.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:w}),M.set=function(b,v,u,y,m,R){return l==="generic"?this.data.set(this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*y+this.stride[4]*m,R):this.data[this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*y+this.stride[4]*m]=R},M.get=function(b,v,u,y,m){return l==="generic"?this.data.get(this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*y+this.stride[4]*m):this.data[this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*y+this.stride[4]*m]},M.index=function(b,v,u,y,m){return this.offset+this.stride[0]*b+this.stride[1]*v+this.stride[2]*u+this.stride[3]*y+this.stride[4]*m},M.hi=function(b,v,u,y,m){return new A(this.data,typeof b!="number"||b<0?this.shape[0]:b|0,typeof v!="number"||v<0?this.shape[1]:v|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof y!="number"||y<0?this.shape[3]:y|0,typeof m!="number"||m<0?this.shape[4]:m|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(b,v,u,y,m){var R=this.offset,L=0,z=this.shape[0],F=this.shape[1],N=this.shape[2],O=this.shape[3],P=this.shape[4],U=this.stride[0],B=this.stride[1],X=this.stride[2],$=this.stride[3],le=this.stride[4];return typeof b=="number"&&b>=0&&(L=b|0,R+=U*L,z-=L),typeof v=="number"&&v>=0&&(L=v|0,R+=B*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,R+=X*L,N-=L),typeof y=="number"&&y>=0&&(L=y|0,R+=$*L,O-=L),typeof m=="number"&&m>=0&&(L=m|0,R+=le*L,P-=L),new A(this.data,z,F,N,O,P,U,B,X,$,le,R)},M.step=function(b,v,u,y,m){var R=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.shape[4],O=this.stride[0],P=this.stride[1],U=this.stride[2],B=this.stride[3],X=this.stride[4],$=this.offset,le=0,ce=Math.ceil;return typeof b=="number"&&(le=b|0,le<0?($+=O*(R-1),R=ce(-R/le)):R=ce(R/le),O*=le),typeof v=="number"&&(le=v|0,le<0?($+=P*(L-1),L=ce(-L/le)):L=ce(L/le),P*=le),typeof u=="number"&&(le=u|0,le<0?($+=U*(z-1),z=ce(-z/le)):z=ce(z/le),U*=le),typeof y=="number"&&(le=y|0,le<0?($+=B*(F-1),F=ce(-F/le)):F=ce(F/le),B*=le),typeof m=="number"&&(le=m|0,le<0?($+=X*(N-1),N=ce(-N/le)):N=ce(N/le),X*=le),new A(this.data,R,L,z,F,N,O,P,U,B,X,$)},M.transpose=function(b,v,u,y,m){b=b===void 0?0:b|0,v=v===void 0?1:v|0,u=u===void 0?2:u|0,y=y===void 0?3:y|0,m=m===void 0?4:m|0;var R=this.shape,L=this.stride;return new A(this.data,R[b],R[v],R[u],R[y],R[m],L[b],L[v],L[u],L[y],L[m],this.offset)},M.pick=function(b,v,u,y,m){var R=[],L=[],z=this.offset;typeof b=="number"&&b>=0?z=z+this.stride[0]*b|0:(R.push(this.shape[0]),L.push(this.stride[0])),typeof v=="number"&&v>=0?z=z+this.stride[1]*v|0:(R.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(R.push(this.shape[2]),L.push(this.stride[2])),typeof y=="number"&&y>=0?z=z+this.stride[3]*y|0:(R.push(this.shape[3]),L.push(this.stride[3])),typeof m=="number"&&m>=0?z=z+this.stride[4]*m|0:(R.push(this.shape[4]),L.push(this.stride[4]));var F=_[R.length+1];return F(this.data,R,L,z)},function(b,v,u,y){return new A(b,v[0],v[1],v[2],v[3],v[4],u[0],u[1],u[2],u[3],u[4],y)}}};function h(T,l){var _=l===-1?"T":String(l),w=s[_];return l===-1?w(T):l===0?w(T,p[T][0]):w(T,p[T],n)}function f(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var p={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function c(T,l,_,w){if(T===void 0){var u=p.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var A=l.length;if(_===void 0){_=new Array(A);for(var M=A-1,g=1;M>=0;--M)_[M]=g,g*=l[M]}if(w===void 0){w=0;for(var M=0;M>>0;e.exports=n;function n(s,h){if(isNaN(s)||isNaN(h))return NaN;if(s===h)return s;if(s===0)return h<0?-a:a;var f=o.hi(s),p=o.lo(s);return h>s==s>0?p===i?(f+=1,p=0):p+=1:p===0?(p=i,f-=1):p-=1,o.pack(p,f)}}),8406:(function(e,t){var r=1e-6,o=1e-6;t.vertexNormals=function(a,i,n){for(var s=i.length,h=new Array(s),f=n===void 0?r:n,p=0;pf)for(var R=h[l],L=1/Math.sqrt(v*y),m=0;m<3;++m){var z=(m+1)%3,F=(m+2)%3;R[m]+=L*(u[z]*b[F]-u[F]*b[z])}}for(var p=0;pf)for(var L=1/Math.sqrt(N),m=0;m<3;++m)R[m]*=L;else for(var m=0;m<3;++m)R[m]=0}return h},t.faceNormals=function(a,i,n){for(var s=a.length,h=new Array(s),f=n===void 0?o:n,p=0;pf?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)A[l]*=M;h[p]=A}return h}}),4081:(function(e){"use strict";e.exports=t;function t(r,o,a,i,n,s,h,f,p,c){var T=o+s+c;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(h-p)/l,r[1]=.5*(f-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var _=Math.max(o,s,c),l=Math.sqrt(2*_-T+1);o>=_?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(f+i)/l,r[3]=.5*(h-p)/l):s>=_?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(p+h)/l,r[3]=.5*(f-i)/l):(r[0]=.5*(i+f)/l,r[1]=.5*(h+p)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}}),9977:(function(e,t,r){"use strict";e.exports=l;var o=r(9215),a=r(6582),i=r(7399),n=r(7608),s=r(4081);function h(_,w,A){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(A,2))}function f(_,w,A,M){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(A,2)+Math.pow(M,2))}function p(_,w){var A=w[0],M=w[1],g=w[2],b=w[3],v=f(A,M,g,b);v>1e-6?(_[0]=A/v,_[1]=M/v,_[2]=g/v,_[3]=b/v):(_[0]=_[1]=_[2]=0,_[3]=1)}function c(_,w,A){this.radius=o([A]),this.center=o(w),this.rotation=o(_),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var T=c.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(_){this.radius.curve(_),this.center.curve(_),this.rotation.curve(_);var w=this.computedRotation;p(w,w);var A=this.computedMatrix;i(A,w);var M=this.computedCenter,g=this.computedEye,b=this.computedUp,v=Math.exp(this.computedRadius[0]);g[0]=M[0]+v*A[2],g[1]=M[1]+v*A[6],g[2]=M[2]+v*A[10],b[0]=A[1],b[1]=A[5],b[2]=A[9];for(var u=0;u<3;++u){for(var y=0,m=0;m<3;++m)y+=A[u+4*m]*g[m];A[12+u]=-y}},T.getMatrix=function(_,w){this.recalcMatrix(_);var A=this.computedMatrix;if(w){for(var M=0;M<16;++M)w[M]=A[M];return w}return A},T.idle=function(_){this.center.idle(_),this.radius.idle(_),this.rotation.idle(_)},T.flush=function(_){this.center.flush(_),this.radius.flush(_),this.rotation.flush(_)},T.pan=function(_,w,A,M){w=w||0,A=A||0,M=M||0,this.recalcMatrix(_);var g=this.computedMatrix,b=g[1],v=g[5],u=g[9],y=h(b,v,u);b/=y,v/=y,u/=y;var m=g[0],R=g[4],L=g[8],z=m*b+R*v+L*u;m-=b*z,R-=v*z,L-=u*z;var F=h(m,R,L);m/=F,R/=F,L/=F;var N=g[2],O=g[6],P=g[10],U=N*b+O*v+P*u,B=N*m+O*R+P*L;N-=U*b+B*m,O-=U*v+B*R,P-=U*u+B*L;var X=h(N,O,P);N/=X,O/=X,P/=X;var $=m*w+b*A,le=R*w+v*A,ce=L*w+u*A;this.center.move(_,$,le,ce);var ve=Math.exp(this.computedRadius[0]);ve=Math.max(1e-4,ve+M),this.radius.set(_,Math.log(ve))},T.rotate=function(_,w,A,M){this.recalcMatrix(_),w=w||0,A=A||0;var g=this.computedMatrix,b=g[0],v=g[4],u=g[8],y=g[1],m=g[5],R=g[9],L=g[2],z=g[6],F=g[10],N=w*b+A*y,O=w*v+A*m,P=w*u+A*R,U=-(z*P-F*O),B=-(F*N-L*P),X=-(L*O-z*N),$=Math.sqrt(Math.max(0,1-Math.pow(U,2)-Math.pow(B,2)-Math.pow(X,2))),le=f(U,B,X,$);le>1e-6?(U/=le,B/=le,X/=le,$/=le):(U=B=X=0,$=1);var ce=this.computedRotation,ve=ce[0],G=ce[1],Y=ce[2],ee=ce[3],V=ve*$+ee*U+G*X-Y*B,se=G*$+ee*B+Y*U-ve*X,ae=Y*$+ee*X+ve*B-G*U,j=ee*$-ve*U-G*B-Y*X;if(M){U=L,B=z,X=F;var Q=Math.sin(M)/h(U,B,X);U*=Q,B*=Q,X*=Q,$=Math.cos(w),V=V*$+j*U+se*X-ae*B,se=se*$+j*B+ae*U-V*X,ae=ae*$+j*X+V*B-se*U,j=j*$-V*U-se*B-ae*X}var re=f(V,se,ae,j);re>1e-6?(V/=re,se/=re,ae/=re,j/=re):(V=se=ae=0,j=1),this.rotation.set(_,V,se,ae,j)},T.lookAt=function(_,w,A,M){this.recalcMatrix(_),A=A||this.computedCenter,w=w||this.computedEye,M=M||this.computedUp;var g=this.computedMatrix;a(g,w,A,M);var b=this.computedRotation;s(b,g[0],g[1],g[2],g[4],g[5],g[6],g[8],g[9],g[10]),p(b,b),this.rotation.set(_,b[0],b[1],b[2],b[3]);for(var v=0,u=0;u<3;++u)v+=Math.pow(A[u]-w[u],2);this.radius.set(_,.5*Math.log(Math.max(v,1e-6))),this.center.set(_,A[0],A[1],A[2])},T.translate=function(_,w,A,M){this.center.move(_,w||0,A||0,M||0)},T.setMatrix=function(_,w){var A=this.computedRotation;s(A,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),p(A,A),this.rotation.set(_,A[0],A[1],A[2],A[3]);var M=this.computedMatrix;n(M,w);var g=M[15];if(Math.abs(g)>1e-6){var b=M[12]/g,v=M[13]/g,u=M[14]/g;this.recalcMatrix(_);var y=Math.exp(this.computedRadius[0]);this.center.set(_,b-M[2]*y,v-M[6]*y,u-M[10]*y),this.radius.idle(_)}else this.center.idle(_),this.radius.idle(_)},T.setDistance=function(_,w){w>0&&this.radius.set(_,Math.log(w))},T.setDistanceLimits=function(_,w){_>0?_=Math.log(_):_=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,_),this.radius.bounds[0][0]=_,this.radius.bounds[1][0]=w},T.getDistanceLimits=function(_){var w=this.radius.bounds;return _?(_[0]=Math.exp(w[0][0]),_[1]=Math.exp(w[1][0]),_):[Math.exp(w[0][0]),Math.exp(w[1][0])]},T.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},T.fromJSON=function(_){var w=this.lastT(),A=_.center;A&&this.center.set(w,A[0],A[1],A[2]);var M=_.rotation;M&&this.rotation.set(w,M[0],M[1],M[2],M[3]);var g=_.distance;g&&g>0&&this.radius.set(w,Math.log(g)),this.setDistanceLimits(_.zoomMin,_.zoomMax)};function l(_){_=_||{};var w=_.center||[0,0,0],A=_.rotation||[0,0,0,1],M=_.radius||1;w=[].slice.call(w,0,3),A=[].slice.call(A,0,4),p(A,A);var g=new c(A,w,Math.log(M));return g.setDistanceLimits(_.zoomMin,_.zoomMax),("eye"in _||"up"in _)&&g.lookAt(0,_.eye,_.center,_.up),g}}),1371:(function(e,t,r){"use strict";var o=r(3233);e.exports=function(i,n,s){return s=typeof s<"u"?s+"":" ",o(s,n)+i}}),3202:(function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}}),3088:(function(e,t,r){"use strict";e.exports=a;var o=r(3140);function a(i,n){for(var s=n.length|0,h=i.length,f=[new Array(s),new Array(s)],p=0;p0){R=f[F][y][0],z=F;break}L=R[z^1];for(var N=0;N<2;++N)for(var O=f[N][y],P=0;P0&&(R=U,L=B,z=N)}return m||R&&l(R,z),L}function w(u,y){var m=f[y][u][0],R=[u];l(m,y);for(var L=m[y^1],z=y;;){for(;L!==u;)R.push(L),L=_(R[R.length-2],L,!1);if(f[0][u].length+f[1][u].length===0)break;var F=R[R.length-1],N=u,O=R[1],P=_(F,N,!0);if(o(n[F],n[N],n[O],n[P])<0)break;R.push(u),L=_(F,N)}return R}function A(u,y){return y[1]===y[y.length-1]}for(var p=0;p0;){var b=f[0][p].length,v=w(p,M);A(g,v)?g.push.apply(g,v):(g.length>0&&T.push(g),g=v)}g.length>0&&T.push(g)}return T}}),5609:(function(e,t,r){"use strict";e.exports=a;var o=r(3134);function a(i,n){for(var s=o(i,n.length),h=new Array(n.length),f=new Array(n.length),p=[],c=0;c0;){var l=p.pop();h[l]=!1;for(var _=s[l],c=0;c<_.length;++c){var w=_[c];--f[w]===0&&p.push(w)}}for(var A=new Array(n.length),M=[],c=0;c0}b=b.filter(v);for(var u=b.length,y=new Array(u),m=new Array(u),g=0;g0;){var re=ae.pop(),he=le[re];h(he,function(qe,et){return qe-et});var xe=he.length,Te=j[re],Le;if(Te===0){var O=b[re];Le=[O]}for(var g=0;g=0)&&(j[Pe]=Te^1,ae.push(Pe),Te===0)){var O=b[Pe];se(O)||(O.reverse(),Le.push(O))}}Te===0&&Q.push(Le)}return Q}}),5085:(function(e,t,r){e.exports=_;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function h(w){return function(A,M){var g=w[A];return g?!!g.queryPoint(M,s):!1}}function f(w){for(var A={},M=0;M0&&A[g]===M[0])b=w[g-1];else return 1;for(var v=1;b;){var u=b.key,y=o(M,u[0],u[1]);if(u[0][0]0)v=-1,b=b.right;else return 0;else if(y>0)b=b.left;else if(y<0)v=1,b=b.right;else return 0}return v}}function c(w){return 1}function T(w){return function(M){return w(M[0],M[1])?0:1}}function l(w,A){return function(g){return w(g[0],g[1])?0:A(g)}}function _(w){for(var A=w.length,M=[],g=[],b=0,v=0;v=c?(u=1,m=c+2*_+A):(u=-_/c,m=_*u+A)):(u=0,w>=0?(y=0,m=A):-w>=l?(y=1,m=l+2*w+A):(y=-w/l,m=w*y+A));else if(y<0)y=0,_>=0?(u=0,m=A):-_>=c?(u=1,m=c+2*_+A):(u=-_/c,m=_*u+A);else{var R=1/v;u*=R,y*=R,m=u*(c*u+T*y+2*_)+y*(T*u+l*y+2*w)+A}else{var L,z,F,N;u<0?(L=T+_,z=l+w,z>L?(F=z-L,N=c-2*T+l,F>=N?(u=1,y=0,m=c+2*_+A):(u=F/N,y=1-u,m=u*(c*u+T*y+2*_)+y*(T*u+l*y+2*w)+A)):(u=0,z<=0?(y=1,m=l+2*w+A):w>=0?(y=0,m=A):(y=-w/l,m=w*y+A))):y<0?(L=T+w,z=c+_,z>L?(F=z-L,N=c-2*T+l,F>=N?(y=1,u=0,m=l+2*w+A):(y=F/N,u=1-y,m=u*(c*u+T*y+2*_)+y*(T*u+l*y+2*w)+A)):(y=0,z<=0?(u=1,m=c+2*_+A):_>=0?(u=0,m=A):(u=-_/c,m=_*u+A))):(F=l+w-T-_,F<=0?(u=0,y=1,m=l+2*w+A):(N=c-2*T+l,F>=N?(u=1,y=0,m=c+2*_+A):(u=F/N,y=1-u,m=u*(c*u+T*y+2*_)+y*(T*u+l*y+2*w)+A)))}for(var O=1-u-y,p=0;p0){var l=s[f-1];if(o(c,l)===0&&i(l)!==T){f-=1;continue}}s[f++]=c}}return s.length=f,s}}),3233:(function(e){"use strict";var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}}),3025:(function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}),7004:(function(e){"use strict";e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,h=r[n];a=s+h;var f=a-s,p=h-f;p&&(r[--i]=a,a=p)}for(var c=0,n=i;n0){if(z<=0)return F;N=L+z}else if(L<0){if(z>=0)return F;N=-(L+z)}else return F;var O=f*N;return F>=O||F<=-O?F:w(y,m,R)},function(y,m,R,L){var z=y[0]-L[0],F=m[0]-L[0],N=R[0]-L[0],O=y[1]-L[1],P=m[1]-L[1],U=R[1]-L[1],B=y[2]-L[2],X=m[2]-L[2],$=R[2]-L[2],le=F*U,ce=N*P,ve=N*O,G=z*U,Y=z*P,ee=F*O,V=B*(le-ce)+X*(ve-G)+$*(Y-ee),se=(Math.abs(le)+Math.abs(ce))*Math.abs(B)+(Math.abs(ve)+Math.abs(G))*Math.abs(X)+(Math.abs(Y)+Math.abs(ee))*Math.abs($),ae=p*se;return V>ae||-V>ae?V:A(y,m,R,L)}];function g(u){var y=M[u.length];return y||(y=M[u.length]=_(u.length)),y.apply(void 0,u)}function b(u,y,m,R,L,z,F){return function(O,P,U,B,X){switch(arguments.length){case 0:case 1:return 0;case 2:return R(O,P);case 3:return L(O,P,U);case 4:return z(O,P,U,B);case 5:return F(O,P,U,B,X)}for(var $=new Array(arguments.length),le=0;le0&&c>0||p<0&&c<0)return!1;var T=o(h,n,s),l=o(f,n,s);return T>0&&l>0||T<0&&l<0?!1:p===0&&c===0&&T===0&&l===0?a(n,s,h,f):!0}}),8545:(function(e){"use strict";e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,h=a-n,f=o-s,p=f+h;return p?[p,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],-a[0]);var s=i+n,h=new Array(s),f=0,p=0,c=0,T=Math.abs,l=o[p],_=T(l),w=-a[c],A=T(w),M,g;_=n?(M=l,p+=1,p=n?(M=l,p+=1,p"u"&&(M=s(_));var g=_.length;if(g===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var b=h(w,+A),v=f(_,M),u=p(v,w,b,+A),y=c(v,w.length|0),m=n(M)(_,v.data,y,b),R=T(v),L=[].slice.call(u.data,0,u.shape[0]);return a.free(b),a.free(v.data),a.free(u.data),a.free(y),{cells:m,vertexIds:R,vertexWeights:L}}}),1570:(function(e){"use strict";e.exports=r;var t=[function(){function a(n,s,h,f){for(var p=Math.min(h,f)|0,c=Math.max(h,f)|0,T=n[2*p],l=n[2*p+1];T>1,w=s[2*_+1];if(w===c)return _;c>1,w=s[2*_+1];if(w===c)return _;c>1,w=s[2*_+1];if(w===c)return _;c>1,w=s[2*_+1];if(w===c)return _;c>1,N=f(y[F],m);N<=0?(N===0&&(z=F),R=F+1):N>0&&(L=F-1)}return z}o=l;function _(y,m){for(var R=new Array(y.length),L=0,z=R.length;L=y.length||f(y[le],F)!==0););}return R}o=_;function w(y,m){if(!m)return _(T(M(y,0)),y,0);for(var R=new Array(m),L=0;L>>U&1&&P.push(z[U]);m.push(P)}return c(m)}o=A;function M(y,m){if(m<0)return[];for(var R=[],L=(1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,h=n,f=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--f;i[n]=h<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}}),2014:(function(e,t,r){"use strict";"use restrict";var o=r(3105),a=r(4623);function i(u){for(var y=0,m=Math.max,R=0,L=u.length;R>1,F=h(u[z],y);F<=0?(F===0&&(L=z),m=z+1):F>0&&(R=z-1)}return L}t.findCell=T;function l(u,y){for(var m=new Array(u.length),R=0,L=m.length;R=u.length||h(u[$],z)!==0););}return m}t.incidence=l;function _(u,y){if(!y)return l(c(A(u,0)),u,0);for(var m=new Array(y),R=0;R>>P&1&&O.push(L[P]);y.push(O)}return p(y)}t.explode=w;function A(u,y){if(y<0)return[];for(var m=[],R=(1<>1:(G>>1)-1}function R(G){for(var Y=y(G);;){var ee=Y,V=2*G+1,se=2*(G+1),ae=G;if(V0;){var ee=m(G);if(ee>=0){var V=y(ee);if(Y0){var G=O[0];return u(0,B-1),B-=1,R(0),G}return-1}function F(G,Y){var ee=O[G];return _[ee]===Y?G:(_[ee]=-1/0,L(G),z(),_[ee]=Y,B+=1,L(B-1))}function N(G){if(!w[G]){w[G]=!0;var Y=T[G],ee=l[G];T[ee]>=0&&(T[ee]=Y),l[Y]>=0&&(l[Y]=ee),P[Y]>=0&&F(P[Y],v(Y)),P[ee]>=0&&F(P[ee],v(ee))}}for(var O=[],P=new Array(p),A=0;A>1;A>=0;--A)R(A);for(;;){var X=z();if(X<0||_[X]>f)break;N(X)}for(var $=[],A=0;A=0&&ee>=0&&Y!==ee){var V=P[Y],se=P[ee];V!==se&&ve.push([V,se])}}),a.unique(a.normalize(ve)),{positions:$,edges:ve}}}),1303:(function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){var h,f;if(s[0][0]s[1][0])h=s[1],f=s[0];else{var p=Math.min(n[0][1],n[1][1]),c=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return cl?p-l:c-l}var _,w;n[0][1]s[1][0])h=s[1],f=s[0];else return a(s,n);var p,c;if(n[0][0]n[1][0])p=n[1],c=n[0];else return-a(n,s);var T=o(h,f,c),l=o(h,f,p);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(c,p,f),l=o(c,p,h),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return f[0]-c[0]}}),4209:(function(e,t,r){"use strict";e.exports=l;var o=r(2478),a=r(3840),i=r(3250),n=r(1303);function s(_,w,A){this.slabs=_,this.coordinates=w,this.horizontal=A}var h=s.prototype;function f(_,w){return _.y-w}function p(_,w){for(var A=null;_;){var M=_.key,g,b;M[0][0]0)if(w[0]!==M[1][0])A=_,_=_.right;else{var u=p(_.right,w);if(u)return u;_=_.left}else{if(w[0]!==M[1][0])return _;var u=p(_.right,w);if(u)return u;_=_.left}}return A}h.castUp=function(_){var w=o.le(this.coordinates,_[0]);if(w<0)return-1;var A=this.slabs[w],M=p(this.slabs[w],_),g=-1;if(M&&(g=M.value),this.coordinates[w]===_[0]){var b=null;if(M&&(b=M.key),w>0){var v=p(this.slabs[w-1],_);v&&(b?n(v.key,b)>0&&(b=v.key,g=v.value):(g=v.value,b=v.key))}var u=this.horizontal[w];if(u.length>0){var y=o.ge(u,_[1],f);if(y=u.length)return g;m=u[y]}}if(m.start)if(b){var R=i(b[0],b[1],[_[0],m.y]);b[0][0]>b[1][0]&&(R=-R),R>0&&(g=m.index)}else g=m.index;else m.y!==_[1]&&(g=m.index)}}}return g};function c(_,w,A,M){this.y=_,this.index=w,this.start=A,this.closed=M}function T(_,w,A,M){this.x=_,this.segment=w,this.create=A,this.index=M}function l(_){for(var w=_.length,A=2*w,M=new Array(A),g=0;g1&&(w=1);for(var A=1-w,M=p.length,g=new Array(M),b=0;b0||_>0&&g<0){var b=n(w,g,A,_);T.push(b),l.push(b.slice())}g<0?l.push(A.slice()):g>0?T.push(A.slice()):(T.push(A.slice()),l.push(A.slice())),_=g}return{positive:T,negative:l}}function h(p,c){for(var T=[],l=i(p[p.length-1],c),_=p[p.length-1],w=p[0],A=0;A0||l>0&&M<0)&&T.push(n(_,M,w,l)),M>=0&&T.push(w.slice()),l=M}return T}function f(p,c){for(var T=[],l=i(p[p.length-1],c),_=p[p.length-1],w=p[0],A=0;A0||l>0&&M<0)&&T.push(n(_,M,w,l)),M<=0&&T.push(w.slice()),l=M}return T}}),3387:(function(e,t,r){var o;(function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(p){return s(f(p),arguments)}function n(p,c){return i.apply(null,[p].concat(c||[]))}function s(p,c){var T=1,l=p.length,_,w="",A,M,g,b,v,u,y,m;for(A=0;A=0),g.type){case"b":_=parseInt(_,10).toString(2);break;case"c":_=String.fromCharCode(parseInt(_,10));break;case"d":case"i":_=parseInt(_,10);break;case"j":_=JSON.stringify(_,null,g.width?parseInt(g.width):0);break;case"e":_=g.precision?parseFloat(_).toExponential(g.precision):parseFloat(_).toExponential();break;case"f":_=g.precision?parseFloat(_).toFixed(g.precision):parseFloat(_);break;case"g":_=g.precision?String(Number(_.toPrecision(g.precision))):parseFloat(_);break;case"o":_=(parseInt(_,10)>>>0).toString(8);break;case"s":_=String(_),_=g.precision?_.substring(0,g.precision):_;break;case"t":_=String(!!_),_=g.precision?_.substring(0,g.precision):_;break;case"T":_=Object.prototype.toString.call(_).slice(8,-1).toLowerCase(),_=g.precision?_.substring(0,g.precision):_;break;case"u":_=parseInt(_,10)>>>0;break;case"v":_=_.valueOf(),_=g.precision?_.substring(0,g.precision):_;break;case"x":_=(parseInt(_,10)>>>0).toString(16);break;case"X":_=(parseInt(_,10)>>>0).toString(16).toUpperCase();break}a.json.test(g.type)?w+=_:(a.number.test(g.type)&&(!y||g.sign)?(m=y?"+":"-",_=_.toString().replace(a.sign,"")):m="",v=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",u=g.width-(m+_).length,b=g.width&&u>0?v.repeat(u):"",w+=g.align?m+_+b:v==="0"?m+b+_:b+m+_)}return w}var h=Object.create(null);function f(p){if(h[p])return h[p];for(var c=p,T,l=[],_=0;c;){if((T=a.text.exec(c))!==null)l.push(T[0]);else if((T=a.modulo.exec(c))!==null)l.push("%");else if((T=a.placeholder.exec(c))!==null){if(T[2]){_|=1;var w=[],A=T[2],M=[];if((M=a.key.exec(A))!==null)for(w.push(M[1]);(A=A.substring(M[0].length))!=="";)if((M=a.key_access.exec(A))!==null)w.push(M[1]);else if((M=a.index_access.exec(A))!==null)w.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=w}else _|=2;if(_===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");c=c.substring(T[0].length)}return h[p]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=function(){return{sprintf:i,vsprintf:n}}.call(t,r,t,e),o!==void 0&&(e.exports=o))})()}),3711:(function(e,t,r){"use strict";e.exports=f;var o=r(2640),a=r(781),i={"2d":function(p,c,T){var l=p({order:c,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(w,A,M,g){return w>g|0},vertex:function(w,A,M,g,b,v,u,y,m,R,L,z,F){var N=(u<<0)+(y<<1)+(m<<2)+(R<<3)|0;if(!(N===0||N===15))switch(N){case 0:L.push([w-.5,A-.5]);break;case 1:L.push([w-.25-.25*(g+M-2*F)/(M-g),A-.25-.25*(b+M-2*F)/(M-b)]);break;case 2:L.push([w-.75-.25*(-g-M+2*F)/(g-M),A-.25-.25*(v+g-2*F)/(g-v)]);break;case 3:L.push([w-.5,A-.5-.5*(b+M+v+g-4*F)/(M-b+g-v)]);break;case 4:L.push([w-.25-.25*(v+b-2*F)/(b-v),A-.75-.25*(-b-M+2*F)/(b-M)]);break;case 5:L.push([w-.5-.5*(g+M+v+b-4*F)/(M-g+b-v),A-.5]);break;case 6:L.push([w-.5-.25*(-g-M+v+b)/(g-M+b-v),A-.5-.25*(-b-M+v+g)/(b-M+g-v)]);break;case 7:L.push([w-.75-.25*(v+b-2*F)/(b-v),A-.75-.25*(v+g-2*F)/(g-v)]);break;case 8:L.push([w-.75-.25*(-v-b+2*F)/(v-b),A-.75-.25*(-v-g+2*F)/(v-g)]);break;case 9:L.push([w-.5-.25*(g+M+-v-b)/(M-g+v-b),A-.5-.25*(b+M+-v-g)/(M-b+v-g)]);break;case 10:L.push([w-.5-.5*(-g-M+-v-b+4*F)/(g-M+v-b),A-.5]);break;case 11:L.push([w-.25-.25*(-v-b+2*F)/(v-b),A-.75-.25*(b+M-2*F)/(M-b)]);break;case 12:L.push([w-.5,A-.5-.5*(-b-M+-v-g+4*F)/(b-M+v-g)]);break;case 13:L.push([w-.75-.25*(g+M-2*F)/(M-g),A-.25-.25*(-v-g+2*F)/(v-g)]);break;case 14:L.push([w-.25-.25*(-g-M+2*F)/(g-M),A-.25-.25*(-b-M+2*F)/(b-M)]);break;case 15:L.push([w-.5,A-.5]);break}},cell:function(w,A,M,g,b,v,u,y,m){b?y.push([w,A]):y.push([A,w])}});return function(_,w){var A=[],M=[];return l(_,A,M,w),{positions:A,cells:M}}}};function n(p,c){var T=p.length+"d",l=i[T];if(l)return l(o,p,c)}function s(p,c){for(var T=a(p,c),l=T.length,_=new Array(l),w=new Array(l),A=0;AMath.max(g,b)?v[2]=1:g>Math.max(M,b)?v[0]=1:v[1]=1;for(var u=0,y=0,m=0;m<3;++m)u+=A[m]*A[m],y+=v[m]*A[m];for(var m=0;m<3;++m)v[m]-=y/u*A[m];return s(v,v),v}function T(A,M,g,b,v,u,y,m){this.center=o(g),this.up=o(b),this.right=o(v),this.radius=o([u]),this.angle=o([y,m]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(A,M),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(A,M){A>0?A=Math.log(A):A=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,A),this.radius.bounds[0][0]=A,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(A){var M=this.radius.bounds[0];return A?(A[0]=Math.exp(M[0][0]),A[1]=Math.exp(M[1][0]),A):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(A){this.center.curve(A),this.up.curve(A),this.right.curve(A),this.radius.curve(A),this.angle.curve(A);for(var M=this.computedUp,g=this.computedRight,b=0,v=0,u=0;u<3;++u)v+=M[u]*g[u],b+=M[u]*M[u];for(var y=Math.sqrt(b),m=0,u=0;u<3;++u)g[u]-=M[u]*v/b,m+=g[u]*g[u],M[u]/=y;for(var R=Math.sqrt(m),u=0;u<3;++u)g[u]/=R;var L=this.computedToward;n(L,M,g),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],N=this.computedAngle[1],O=Math.cos(F),P=Math.sin(F),U=Math.cos(N),B=Math.sin(N),X=this.computedCenter,$=O*U,le=P*U,ce=B,ve=-O*B,G=-P*B,Y=U,ee=this.computedEye,V=this.computedMatrix,u=0;u<3;++u){var se=$*g[u]+le*L[u]+ce*M[u];V[4*u+1]=ve*g[u]+G*L[u]+Y*M[u],V[4*u+2]=se,V[4*u+3]=0}var ae=V[1],j=V[5],Q=V[9],re=V[2],he=V[6],xe=V[10],Te=j*xe-Q*he,Le=Q*re-ae*xe,Pe=ae*he-j*re,qe=f(Te,Le,Pe);Te/=qe,Le/=qe,Pe/=qe,V[0]=Te,V[4]=Le,V[8]=Pe;for(var u=0;u<3;++u)ee[u]=X[u]+V[2+4*u]*z;for(var u=0;u<3;++u){for(var m=0,et=0;et<3;++et)m+=V[u+4*et]*ee[et];V[12+u]=-m}V[15]=1},l.getMatrix=function(A,M){this.recalcMatrix(A);var g=this.computedMatrix;if(M){for(var b=0;b<16;++b)M[b]=g[b];return M}return g};var _=[0,0,0];l.rotate=function(A,M,g,b){if(this.angle.move(A,M,g),b){this.recalcMatrix(A);var v=this.computedMatrix;_[0]=v[2],_[1]=v[6],_[2]=v[10];for(var u=this.computedUp,y=this.computedRight,m=this.computedToward,R=0;R<3;++R)v[4*R]=u[R],v[4*R+1]=y[R],v[4*R+2]=m[R];i(v,v,b,_);for(var R=0;R<3;++R)u[R]=v[4*R],y[R]=v[4*R+1];this.up.set(A,u[0],u[1],u[2]),this.right.set(A,y[0],y[1],y[2])}},l.pan=function(A,M,g,b){M=M||0,g=g||0,b=b||0,this.recalcMatrix(A);var v=this.computedMatrix,u=Math.exp(this.computedRadius[0]),y=v[1],m=v[5],R=v[9],L=f(y,m,R);y/=L,m/=L,R/=L;var z=v[0],F=v[4],N=v[8],O=z*y+F*m+N*R;z-=y*O,F-=m*O,N-=R*O;var P=f(z,F,N);z/=P,F/=P,N/=P;var U=z*M+y*g,B=F*M+m*g,X=N*M+R*g;this.center.move(A,U,B,X);var $=Math.exp(this.computedRadius[0]);$=Math.max(1e-4,$+b),this.radius.set(A,Math.log($))},l.translate=function(A,M,g,b){this.center.move(A,M||0,g||0,b||0)},l.setMatrix=function(A,M,g,b){var v=1;typeof g=="number"&&(v=g|0),(v<0||v>3)&&(v=1);var u=(v+2)%3,y=(v+1)%3;M||(this.recalcMatrix(A),M=this.computedMatrix);var m=M[v],R=M[v+4],L=M[v+8];if(b){var F=Math.abs(m),N=Math.abs(R),O=Math.abs(L),P=Math.max(F,N,O);F===P?(m=m<0?-1:1,R=L=0):O===P?(L=L<0?-1:1,m=R=0):(R=R<0?-1:1,m=L=0)}else{var z=f(m,R,L);m/=z,R/=z,L/=z}var U=M[u],B=M[u+4],X=M[u+8],$=U*m+B*R+X*L;U-=m*$,B-=R*$,X-=L*$;var le=f(U,B,X);U/=le,B/=le,X/=le;var ce=R*X-L*B,ve=L*U-m*X,G=m*B-R*U,Y=f(ce,ve,G);ce/=Y,ve/=Y,G/=Y,this.center.jump(A,ue,ie,Ee),this.radius.idle(A),this.up.jump(A,m,R,L),this.right.jump(A,U,B,X);var ee,V;if(v===2){var se=M[1],ae=M[5],j=M[9],Q=se*U+ae*B+j*X,re=se*ce+ae*ve+j*G;Le<0?ee=-Math.PI/2:ee=Math.PI/2,V=Math.atan2(re,Q)}else{var he=M[2],xe=M[6],Te=M[10],Le=he*m+xe*R+Te*L,Pe=he*U+xe*B+Te*X,qe=he*ce+xe*ve+Te*G;ee=Math.asin(p(Le)),V=Math.atan2(qe,Pe)}this.angle.jump(A,V,ee),this.recalcMatrix(A);var et=M[2],rt=M[6],$e=M[10],Ue=this.computedMatrix;a(Ue,M);var fe=Ue[15],ue=Ue[12]/fe,ie=Ue[13]/fe,Ee=Ue[14]/fe,We=Math.exp(this.computedRadius[0]);this.center.jump(A,ue-et*We,ie-rt*We,Ee-$e*We)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(A){this.center.idle(A),this.up.idle(A),this.right.idle(A),this.radius.idle(A),this.angle.idle(A)},l.flush=function(A){this.center.flush(A),this.up.flush(A),this.right.flush(A),this.radius.flush(A),this.angle.flush(A)},l.setDistance=function(A,M){M>0&&this.radius.set(A,Math.log(M))},l.lookAt=function(A,M,g,b){this.recalcMatrix(A),M=M||this.computedEye,g=g||this.computedCenter,b=b||this.computedUp;var v=b[0],u=b[1],y=b[2],m=f(v,u,y);if(!(m<1e-6)){v/=m,u/=m,y/=m;var R=M[0]-g[0],L=M[1]-g[1],z=M[2]-g[2],F=f(R,L,z);if(!(F<1e-6)){R/=F,L/=F,z/=F;var N=this.computedRight,O=N[0],P=N[1],U=N[2],B=v*O+u*P+y*U;O-=B*v,P-=B*u,U-=B*y;var X=f(O,P,U);if(!(X<.01&&(O=u*z-y*L,P=y*R-v*z,U=v*L-u*R,X=f(O,P,U),X<1e-6))){O/=X,P/=X,U/=X,this.up.set(A,v,u,y),this.right.set(A,O,P,U),this.center.set(A,g[0],g[1],g[2]),this.radius.set(A,Math.log(F));var $=u*U-y*P,le=y*O-v*U,ce=v*P-u*O,ve=f($,le,ce);$/=ve,le/=ve,ce/=ve;var G=v*R+u*L+y*z,Y=O*R+P*L+U*z,ee=$*R+le*L+ce*z,V=Math.asin(p(G)),se=Math.atan2(ee,Y),ae=this.angle._state,j=ae[ae.length-1],Q=ae[ae.length-2];j=j%(2*Math.PI);var re=Math.abs(j+2*Math.PI-se),he=Math.abs(j-se),xe=Math.abs(j-2*Math.PI-se);re0?U.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=_;function w(N){return new Uint8Array(_(N),0,N)}t.mallocUint8=w;function A(N){return new Uint16Array(_(2*N),0,N)}t.mallocUint16=A;function M(N){return new Uint32Array(_(4*N),0,N)}t.mallocUint32=M;function g(N){return new Int8Array(_(N),0,N)}t.mallocInt8=g;function b(N){return new Int16Array(_(2*N),0,N)}t.mallocInt16=b;function v(N){return new Int32Array(_(4*N),0,N)}t.mallocInt32=v;function u(N){return new Float32Array(_(4*N),0,N)}t.mallocFloat32=t.mallocFloat=u;function y(N){return new Float64Array(_(8*N),0,N)}t.mallocFloat64=t.mallocDouble=y;function m(N){return n?new Uint8ClampedArray(_(N),0,N):w(N)}t.mallocUint8Clamped=m;function R(N){return s?new BigUint64Array(_(8*N),0,N):null}t.mallocBigUint64=R;function L(N){return h?new BigInt64Array(_(8*N),0,N):null}t.mallocBigInt64=L;function z(N){return new DataView(_(N),0,N)}t.mallocDataView=z;function F(N){N=o.nextPow2(N);var O=o.log2(N),P=c[O];return P.length>0?P.pop():new i(N)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)f.UINT8[O].length=0,f.UINT16[O].length=0,f.UINT32[O].length=0,f.INT8[O].length=0,f.INT16[O].length=0,f.INT32[O].length=0,f.FLOAT[O].length=0,f.DOUBLE[O].length=0,f.BIGUINT64[O].length=0,f.BIGINT64[O].length=0,f.UINT8C[O].length=0,p[O].length=0,c[O].length=0}}),1755:(function(e){"use strict";"use restrict";e.exports=t;function t(o){this.roots=new Array(o),this.ranks=new Array(o);for(var a=0;a",U="",B=P.length,X=U.length,$=F[0]===_||F[0]===M,le=0,ce=-X;le>-1&&(le=N.indexOf(P,le),!(le===-1||(ce=N.indexOf(U,le+B),ce===-1)||ce<=le));){for(var ve=le;ve=ce)O[ve]=null,N=N.substr(0,ve)+" "+N.substr(ve+1);else if(O[ve]!==null){var G=O[ve].indexOf(F[0]);G===-1?O[ve]+=F:$&&(O[ve]=O[ve].substr(0,G+1)+(1+parseInt(O[ve][G+1]))+O[ve].substr(G+2))}var Y=le+B,ee=N.substr(Y,ce-Y),V=ee.indexOf(P);V!==-1?le=V:le=ce+X}return O}function v(z,F,N){for(var O=F.textAlign||"start",P=F.textBaseline||"alphabetic",U=[1<<30,1<<30],B=[0,0],X=z.length,$=0;$/g,` +`):N=N.replace(/\/g," ");var B="",X=[];for(j=0;j-1?parseInt(ie[1+Qe]):0,St=Xe>-1?parseInt(Ee[1+Xe]):0;Tt!==St&&(We=We.replace(Pe(),"?px "),he*=Math.pow(.75,St-Tt),We=We.replace("?px ",Pe())),re+=.25*G*(St-Tt)}if(U.superscripts===!0){var zt=ie.indexOf(_),Ut=Ee.indexOf(_),br=zt>-1?parseInt(ie[1+zt]):0,hr=Ut>-1?parseInt(Ee[1+Ut]):0;br!==hr&&(We=We.replace(Pe(),"?px "),he*=Math.pow(.75,hr-br),We=We.replace("?px ",Pe())),re-=.25*G*(hr-br)}if(U.bolds===!0){var Or=ie.indexOf(p)>-1,wr=Ee.indexOf(p)>-1;!Or&&wr&&(Er?We=We.replace("italic ","italic bold "):We="bold "+We),Or&&!wr&&(We=We.replace("bold ",""))}if(U.italics===!0){var Er=ie.indexOf(T)>-1,mt=Ee.indexOf(T)>-1;!Er&&mt&&(We="italic "+We),Er&&!mt&&(We=We.replace("italic ",""))}F.font=We}for(ae=0;ae0&&(P=O.size),O.lineSpacing&&O.lineSpacing>0&&(U=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(B.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(B.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(B.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(B.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(B.superscripts=!!O.styletags.superscripts)),N.font=[O.fontStyle,O.fontVariant,O.fontWeight,P+"px",O.font].filter(function($){return $}).join(" "),N.textAlign="start",N.textBaseline="alphabetic",N.direction="ltr";var X=u(F,N,z,P,U,B);return R(X,O,P)}}),1538:(function(e){(function(){"use strict";if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(m){m.permitHostObjects___&&m.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var o=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var i=new a,n=Object.freeze({});if(i.set(n,1),i.get(n)!==1)o=!0;else{e.exports=WeakMap;return}}}var s=Object.prototype.hasOwnProperty,h=Object.getOwnPropertyNames,f=Object.defineProperty,p=Object.isExtensible,c="weakmap:",T=c+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var l=new ArrayBuffer(25),_=new Uint8Array(l);crypto.getRandomValues(_),T=c+"rand:"+Array.prototype.map.call(_,function(m){return(m%36).toString(36)}).join("")+"___"}function w(m){return!(m.substr(0,c.length)==c&&m.substr(m.length-3)==="___")}if(f(Object,"getOwnPropertyNames",{value:function(R){return h(R).filter(w)}}),"getPropertyNames"in Object){var A=Object.getPropertyNames;f(Object,"getPropertyNames",{value:function(R){return A(R).filter(w)}})}function M(m){if(m!==Object(m))throw new TypeError("Not an object: "+m);var R=m[T];if(R&&R.key===m)return R;if(p(m)){R={key:m};try{return f(m,T,{value:R,writable:!1,enumerable:!1,configurable:!1}),R}catch{return}}}(function(){var m=Object.freeze;f(Object,"freeze",{value:function(F){return M(F),m(F)}});var R=Object.seal;f(Object,"seal",{value:function(F){return M(F),R(F)}});var L=Object.preventExtensions;f(Object,"preventExtensions",{value:function(F){return M(F),L(F)}})})();function g(m){return m.prototype=null,Object.freeze(m)}var b=!1;function v(){!b&&typeof console<"u"&&(b=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var u=0,y=function(){this instanceof y||v();var m=[],R=[],L=u++;function z(P,U){var B,X=M(P);return X?L in X?X[L]:U:(B=m.indexOf(P),B>=0?R[B]:U)}function F(P){var U=M(P);return U?L in U:m.indexOf(P)>=0}function N(P,U){var B,X=M(P);return X?X[L]=U:(B=m.indexOf(P),B>=0?R[B]=U:(B=m.length,R[B]=U,m[B]=P)),this}function O(P){var U=M(P),B,X;return U?L in U&&delete U[L]:(B=m.indexOf(P),B<0?!1:(X=m.length-1,m[B]=void 0,R[B]=R[X],m[B]=m[X],m.length=X,R.length=X,!0))}return Object.create(y.prototype,{get___:{value:g(z)},has___:{value:g(F)},set___:{value:g(N)},delete___:{value:g(O)}})};y.prototype=Object.create(Object.prototype,{get:{value:function(R,L){return this.get___(R,L)},writable:!0,configurable:!0},has:{value:function(R){return this.has___(R)},writable:!0,configurable:!0},set:{value:function(R,L){return this.set___(R,L)},writable:!0,configurable:!0},delete:{value:function(R){return this.delete___(R)},writable:!0,configurable:!0}}),typeof a=="function"?(function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function m(){this instanceof y||v();var R=new a,L=void 0,z=!1;function F(U,B){return L?R.has(U)?R.get(U):L.get___(U,B):R.get(U,B)}function N(U){return R.has(U)||(L?L.has___(U):!1)}var O;o?O=function(U,B){return R.set(U,B),R.has(U)||(L||(L=new y),L.set(U,B)),this}:O=function(U,B){if(z)try{R.set(U,B)}catch{L||(L=new y),L.set___(U,B)}else R.set(U,B);return this};function P(U){var B=!!R.delete(U);return L&&L.delete___(U)||B}return Object.create(y.prototype,{get___:{value:g(F)},has___:{value:g(N)},set___:{value:g(O)},delete___:{value:g(P)},permitHostObjects___:{value:g(function(U){if(U===r)z=!0;else throw new Error("bogus call to permitHostObjects___")})}})}m.prototype=y.prototype,e.exports=m,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=y)})()}),236:(function(e,t,r){var o=r(8284);e.exports=a;function a(){var i={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var s=n.valueOf(i);return s&&s.identity===i?s:o(n,i)}}}),8284:(function(e){e.exports=t;function t(r,o){var a={identity:o},i=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(n){return n!==o?i.apply(this,arguments):a},writable:!0}),a}}),606:(function(e,t,r){var o=r(236);e.exports=a;function a(){var i=o();return{get:function(n,s){var h=i(n);return h.hasOwnProperty("value")?h.value:s},set:function(n,s){return i(n).value=s,this},has:function(n){return"value"in i(n)},delete:function(n){return delete i(n).value}}}}),3349:(function(e){"use strict";function t(){return function(s,h,f,p,c,T){var l=s[0],_=f[0],w=[0],A=_;p|=0;var M=0,g=_;for(M=0;M=0!=v>=0&&c.push(w[0]+.5+.5*(b+v)/(b-v))}p+=g,++w[0]}}}function r(){return t()}var o=r;function a(s){var h={};return function(p,c,T){var l=p.dtype,_=p.order,w=[l,_.join()].join(),A=h[w];return A||(h[w]=A=s([l,_])),A(p.shape.slice(0),p.data,p.stride,p.offset|0,c,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})}),781:(function(e,t,r){"use strict";e.exports=a;var o=r(3349);function a(i,n){var s=[];return n=+n||0,o(i.hi(i.shape[0]-1),s,n),s}}),7790:(function(){})},x={};function S(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,S),r.loaded=!0,r.exports}(function(){S.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){S.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}})();var E=S(1964);q.exports=E})()}}),w3=Ge({"node_modules/color-name/index.js"(Z,q){"use strict";q.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),DC=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"(Z,q){"use strict";var d=w3();q.exports=S;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function S(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),d[E])t=d[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var a=E.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],h=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(c,T){if(/%$/.test(c))return T===i?parseFloat(c)/100:a==="rgb"?parseFloat(c)*255/100:parseFloat(c);if(a[T]==="h"){if(/deg$/.test(c))return parseFloat(c);if(x[c]!==void 0)return x[c]}return parseFloat(c)}),s===a&&t.push(1),r=h||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),zC=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Z,q){"use strict";var d=DC();q.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t,r,o=d(E);if(!o.space)return[];var a=[0,0,0],i=o.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(o.values[0],a[0]),i[0]),e[1]=Math.min(Math.max(o.values[1],a[1]),i[1]),e[2]=Math.min(Math.max(o.values[2],a[2]),i[2]),o.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(o.alpha,0),1)),e};function x(S){var E=S[0]/360,e=S[1]/100,t=S[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=E+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),Rg=Ge({"node_modules/clamp/index.js"(Z,q){q.exports=d;function d(x,S,E){return SE?E:x:xS?S:x}}}),k_=Ge({"node_modules/dtype/index.js"(Z,q){q.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Wd=Ge({"node_modules/color-normalize/index.js"(Z,q){"use strict";var d=zC(),x=Rg(),S=k_();q.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=S(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),nd=Ge({"src/lib/str2rgbarray.js"(Z,q){"use strict";var d=Wd();function x(S){return S?d(S):[0,0,0,1]}q.exports=x}}),id=Ge({"src/lib/gl_format_color.js"(Z,q){"use strict";var d=Bo(),x=Ef(),S=Wd(),E=wu(),e=sf().defaultLine,t=nh().isArrayOrTypedArray,r=S(e),o=1;function a(f,p){var c=f;return c[3]*=p,c}function i(f){if(d(f))return r;var p=S(f);return p.length?p:r}function n(f){return d(f)?f:o}function s(f,p,c){var T=f.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),_=t(p),w=E.extractOpts(f),A=[],M,g,b,v,u;if(w.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(f):M=i,l?g=function(m,R){return m[R]===void 0?r:S(M(m[R]))}:g=i,_?b=function(m,R){return m[R]===void 0?o:n(m[R])}:b=n,l||_)for(var y=0;y0){var c=o.c2l(f);o._lowerLogErrorBound||(o._lowerLogErrorBound=c),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,c)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function S(e){for(var t=0;t-1?-1:R.indexOf("right")>-1?1:0}function w(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function A(R){var L=0,z=0,F=[L,z];if(Array.isArray(R))for(var N=0;N=0){var X=T(U.position,U.delaunayColor,U.delaunayAxis);X.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(X):(X.gl=L,this.delaunayMesh=E(X),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},c.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function m(R,L){var z=new p(R,L.uid);return z.update(L),z}q.exports=m}}),A3=Ge({"src/traces/scatter3d/attributes.js"(Z,q){"use strict";var d=gc(),x=bu(),S=Jl(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Tl(),o=Cl(),a=T3(),i=C_(),n=Do().extendFlat,s=Ru().overrideAll,h=Cd(),f=d.line,p=d.marker,c=p.line,T=n({width:f.width,dash:{valType:"enumerated",values:h(a),dflt:"solid"}},S("line"));function l(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var _=q.exports=s({x:d.x,y:d.y,z:{valType:"data_array"},text:n({},d.text,{}),texttemplate:t(),texttemplatefallback:r({editType:"calc"}),hovertext:n({},d.hovertext,{}),hovertemplate:e(),hovertemplatefallback:r(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:n({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l("x"),y:l("y"),z:l("z")},connectgaps:d.connectgaps,line:T,marker:n({symbol:{valType:"enumerated",values:h(i),dflt:"circle",arrayOk:!0},size:n({},p.size,{dflt:8}),sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:n({},p.opacity,{arrayOk:!1}),colorbar:p.colorbar,line:n({width:n({},c.width,{arrayOk:!1})},S("marker.line"))},S("marker")),textposition:n({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:o.opacity,hoverinfo:n({},o.hoverinfo)},"calc","nested");_.x.editType=_.y.editType=_.z.editType="calc+clearAxisTypes"}}),BC=Ge({"src/traces/scatter3d/defaults.js"(Z,q){"use strict";var d=Yi(),x=ta(),S=iu(),E=Nh(),e=Xh(),t=Zh(),r=A3();q.exports=function(i,n,s,h){function f(M,g){return x.coerce(i,n,r,M,g)}var p=o(i,n,f,h);if(!p){n.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),S.hasMarkers(n)&&E(i,n,s,h,f,{noAngle:!0,noLineDash:!0,noSelect:!0}),S.hasLines(n)&&(f("connectgaps"),e(i,n,s,h,f)),S.hasText(n)&&(f("texttemplate"),f("texttemplatefallback"),t(i,n,h,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var c=(n.line||{}).color,T=(n.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",c||T);for(var l=["x","y","z"],_=0;_<3;++_){var w="projection."+l[_];f(w+".show")&&(f(w+".opacity"),f(w+".scale"))}var A=d.getComponentMethod("errorbars","supplyDefaults");A(i,n,c||T||s,{axis:"z"}),A(i,n,c||T||s,{axis:"y",inherit:"z"}),A(i,n,c||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var h=0,f=n("x"),p=n("y"),c=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),f&&p&&c&&(h=Math.min(f.length,p.length,c.length),i._length=i._xlength=i._ylength=i._zlength=h),h}}}),NC=Ge({"src/traces/scatter3d/calc.js"(Z,q){"use strict";var d=Dv(),x=Yh();q.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(E,e),t}}}),UC=Ge({"node_modules/get-canvas-context/index.js"(Z,q){q.exports=d;function d(x,S){if(typeof x!="string")throw new TypeError("must specify type string");if(S=S||{},typeof document>"u"&&!S.canvas)return null;var E=S.canvas||document.createElement("canvas");typeof S.width=="number"&&(E.width=S.width),typeof S.height=="number"&&(E.height=S.height);var e=S,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));n[s]=c,h.tickmode=f}}o.ticks=n;for(var s=0;s<3;++s){E[s]=.5*(r.glplot.bounds[0][s]+r.glplot.bounds[1][s]);for(var T=0;T<2;++T)o.bounds[T][s]=r.glplot.bounds[T][s]}r.contourLevels=e(n)}}}),HC=Ge({"src/plots/gl3d/scene.js"(Z,q){"use strict";var d=Vf().gl_plot3d,x=d.createCamera,S=d.createScene,E=jC(),e=Ky(),t=Yi(),r=ta(),o=r.preserveDrawingBuffer(),a=Mo(),i=mc(),n=nd(),s=S3(),h=Vb(),f=VC(),p=qC(),c=GC(),T=uv().applyAutorangeOptions,l,_,w=!1;function A(z,F){var N=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var P=document.createElementNS("http://www.w3.org/2000/svg","svg");P.style.position="absolute",P.style.top=P.style.left="0px",P.style.width=P.style.height="100%",P.style["z-index"]=20,P.style["pointer-events"]="none",N.appendChild(P),this.svgContainer=P,N.id=z.id,N.style.position="absolute",N.style.top=N.style.left="0px",N.style.width=N.style.height="100%",O.appendChild(N),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=f(F,F[this.id]),this.spikeOptions=p(F[this.id]),this.container=N,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=A.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!_&&(l=document.createElement("canvas"),_=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!_))throw new Error("error creating static canvas/context for image server");F.gl=_,F.canvas=l}return F};var g=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),N=!0;try{z.glplot=S(F)}catch{if(z.staticMode||!g||o)N=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=S(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,N=!1}}}return g=!1,N},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,N=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:N,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var N=z.graphDiv,O=N.layout,P=function(){var B={};return z.isCameraChanged(O)&&(B[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(B[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=B[z.id+".aspectmode"]="manual")),B},U=function(B){if(B.fullSceneLayout.dragmode!==!1){var X=P();B.saveLayout(O),B.graphDiv.emit("plotly_relayout",X)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){U(z)}),z.glplot.canvas.addEventListener("touchstart",function(){w=!0}),z.glplot.canvas.addEventListener("wheel",function(B){if(N._context._scrollZoom.gl3d){if(z.camera._ortho){var X=B.deltaX>B.deltaY?1.1:.9090909090909091,$=z.glplot.getAspectratio();z.glplot.setAspectratio({x:X*$.x,y:X*$.y,z:X*$.z})}U(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var B=P();z.graphDiv.emit("plotly_relayouting",B)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(B){N&&N.emit&&N.emit("plotly_webglcontextlost",{event:B,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,N,O=z.svgContainer,P=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var U=F._fullLayout._invScaleX,B=F._fullLayout._invScaleY,X=P.width*U,$=P.height*B;O.setAttributeNS(null,"viewBox","0 0 "+X+" "+$),O.setAttributeNS(null,"width",X),O.setAttributeNS(null,"height",$),c(z),z.glplot.axes.update(z.axesOptions);for(var le=Object.keys(z.traces),ce=null,ve=z.glplot.selection,G=0;G")):N.type==="isosurface"||N.type==="volume"?(ae.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(ve.traceCoordinate[3]),N.valuehoverformat),xe.push("value: "+ae.valueLabel),ve.textLabel&&xe.push(ve.textLabel),he=xe.join("
")):he=ve.textLabel;var Te={x:ve.traceCoordinate[0],y:ve.traceCoordinate[1],z:ve.traceCoordinate[2],data:V._input,fullData:V,curveNumber:V.index,pointNumber:se};i.appendArrayPointValue(Te,V,se),N._module.eventData&&(Te=V._module.eventData(Te,ve,V,{},se));var Le={points:[Te]};if(z.fullSceneLayout.hovermode){var Pe=[];i.loneHover({trace:V,x:(.5+.5*ee[0]/ee[3])*X,y:(.5-.5*ee[1]/ee[3])*$,xLabel:ae.xLabel,yLabel:ae.yLabel,zLabel:ae.zLabel,text:he,name:ce.name,color:i.castHoverOption(V,se,"bgcolor")||ce.color,borderColor:i.castHoverOption(V,se,"bordercolor"),fontFamily:i.castHoverOption(V,se,"font.family"),fontSize:i.castHoverOption(V,se,"font.size"),fontColor:i.castHoverOption(V,se,"font.color"),nameLength:i.castHoverOption(V,se,"namelength"),textAlign:i.castHoverOption(V,se,"align"),hovertemplate:r.castOption(V,se,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Te,ae),eventData:[Te]},{container:O,gd:F,inOut_bbox:Pe}),Te.bbox=Pe[0]}ve.distance<5&&(ve.buttons||w)?F.emit("plotly_click",Le):F.emit("plotly_hover",Le),this.oldEventData=Le}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var b=["xaxis","yaxis","zaxis"];function v(z,F,N){for(var O=z.fullSceneLayout,P=0;P<3;P++){var U=b[P],B=U.charAt(0),X=O[U],$=F[B],le=F[B+"calendar"],ce=F["_"+B+"length"];if(!r.isArrayOrTypedArray($))N[0][P]=Math.min(N[0][P],0),N[1][P]=Math.max(N[1][P],ce-1);else for(var ve,G=0;G<(ce||$.length);G++)if(r.isArrayOrTypedArray($[G]))for(var Y=0;Y<$[G].length;++Y)ve=X.d2l($[G][Y],0,le),!isNaN(ve)&&isFinite(ve)&&(N[0][P]=Math.min(N[0][P],ve),N[1][P]=Math.max(N[1][P],ve));else ve=X.d2l($[G],0,le),!isNaN(ve)&&isFinite(ve)&&(N[0][P]=Math.min(N[0][P],ve),N[1][P]=Math.max(N[1][P],ve))}}function u(z,F){for(var N=z.fullSceneLayout,O=N.annotations||[],P=0;P<3;P++)for(var U=b[P],B=U.charAt(0),X=N[U],$=0;$V[1][B])V[0][B]=-1,V[1][B]=1;else{var et=V[1][B]-V[0][B];V[0][B]-=et/32,V[1][B]+=et/32}if(j=[V[0][B],V[1][B]],j=T(j,$),V[0][B]=j[0],V[1][B]=j[1],$.isReversed()){var rt=V[0][B];V[0][B]=V[1][B],V[1][B]=rt}}else j=$.range,V[0][B]=$.r2l(j[0]),V[1][B]=$.r2l(j[1]);V[0][B]===V[1][B]&&(V[0][B]-=1,V[1][B]+=1),se[B]=V[1][B]-V[0][B],$.range=[V[0][B],V[1][B]],$.limitRange(),O.glplot.setBounds(B,{min:$.range[0]*Y[B],max:$.range[1]*Y[B]})}var $e,Ue=ce.aspectmode;if(Ue==="cube")$e=[1,1,1];else if(Ue==="manual"){var fe=ce.aspectratio;$e=[fe.x,fe.y,fe.z]}else if(Ue==="auto"||Ue==="data"){var ue=[1,1,1];for(B=0;B<3;++B){$=ce[b[B]],le=$.type;var ie=ae[le];ue[B]=Math.pow(ie.acc,1/ie.count)/Y[B]}Ue==="data"||Math.max.apply(null,ue)/Math.min.apply(null,ue)<=4?$e=ue:$e=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");ce.aspectratio.x=ve.aspectratio.x=$e[0],ce.aspectratio.y=ve.aspectratio.y=$e[1],ce.aspectratio.z=ve.aspectratio.z=$e[2],O.glplot.setAspectratio(ce.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:ce.aspectratio.x,y:ce.aspectratio.y,z:ce.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=ce.aspectmode);var Ee=ce.domain||null,We=F._size||null;if(Ee&&We){var Qe=O.container.style;Qe.position="absolute",Qe.left=We.l+Ee.x[0]*We.w+"px",Qe.top=We.t+(1-Ee.y[1])*We.h+"px",Qe.width=We.w*(Ee.x[1]-Ee.x[0])+"px",Qe.height=We.h*(Ee.y[1]-Ee.y[0])+"px"}O.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function y(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function m(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),m(z.camera)},M.setViewport=function(z){var F=this,N=z.camera;F.camera.lookAt.apply(this,y(N)),F.glplot.setAspectratio(z.aspectratio);var O=N.projection.type==="orthographic",P=F.camera._ortho;O!==P&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,N=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),P=O.get();function U(le,ce,ve,G){var Y=["up","center","eye"],ee=["x","y","z"];return ce[Y[ve]]&&le[Y[ve]][ee[G]]===ce[Y[ve]][ee[G]]}var B=!1;if(P===void 0)B=!0;else{for(var X=0;X<3;X++)for(var $=0;$<3;$++)if(!U(N,P,X,$)){B=!0;break}(!P.projection||N.projection&&N.projection.type!==P.projection.type)&&(B=!0)}return B},M.isAspectChanged=function(z){var F=this,N=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),P=O.get();return P===void 0||P.x!==N.x||P.y!==N.y||P.z!==N.z},M.saveLayout=function(z){var F=this,N=F.fullLayout,O,P,U,B,X,$,le=F.isCameraChanged(z),ce=F.isAspectChanged(z),ve=le||ce;if(ve){var G={};if(le&&(O=F.getCamera(),P=r.nestedProperty(z,F.id+".camera"),U=P.get(),G[F.id+".camera"]=U),ce&&(B=F.glplot.getAspectratio(),X=r.nestedProperty(z,F.id+".aspectratio"),$=X.get(),G[F.id+".aspectratio"]=$),t.call("_storeDirectGUIEdit",z,N._preGUI,G),le){P.set(O);var Y=r.nestedProperty(N,F.id+".camera");Y.set(O)}if(ce){X.set(B);var ee=r.nestedProperty(N,F.id+".aspectratio");ee.set(B),F.glplot.redraw()}}return ve},M.updateFx=function(z,F){var N=this,O=N.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var P=N.graphDiv,U=P._fullLayout,B=N.fullSceneLayout.camera,X=B.up.x,$=B.up.y,le=B.up.z;if(le/Math.sqrt(X*X+$*$+le*le)<.999){var ce=N.id+".camera.up",ve={x:0,y:0,z:1},G={};G[ce]=ve;var Y=P.layout;t.call("_storeDirectGUIEdit",Y,U._preGUI,G),B.up=ve,r.nestedProperty(Y,ce).set(ve)}}else O.keyBindingMode=z;N.fullSceneLayout.hovermode=F};function R(z,F,N){for(var O=0,P=N-1;O0)for(var X=255/B,$=0;$<3;++$)z[U+$]=Math.min(X*z[U+$],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var N=F.glplot.gl,O=N.drawingBufferWidth,P=N.drawingBufferHeight;N.bindFramebuffer(N.FRAMEBUFFER,null);var U=new Uint8Array(O*P*4);N.readPixels(0,0,O,P,N.RGBA,N.UNSIGNED_BYTE,U),R(U,O,P),L(U,O,P);var B=document.createElement("canvas");B.width=O,B.height=P;var X=B.getContext("2d",{willReadFrequently:!0}),$=X.createImageData(O,P);$.data.set(U),X.putImageData($,0,0);var le;switch(z){case"jpeg":le=B.toDataURL("image/jpeg");break;case"webp":le=B.toDataURL("image/webp");break;default:le=B.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),le},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var N=z.fullSceneLayout[b[F]];a.setConvert(N,z.fullLayout),N.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,N=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,N)},q.exports=A}}),WC=Ge({"src/plots/gl3d/layout/attributes.js"(Z,q){"use strict";q.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),M3=Ge({"src/plots/gl3d/layout/axis_attributes.js"(Z,q){"use strict";var d=Bi(),x=Nf(),S=Do().extendFlat,E=Ru().overrideAll;q.exports=E({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:S({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:S({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:S({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),E3=Ge({"src/plots/gl3d/layout/layout_attributes.js"(Z,q){"use strict";var d=M3(),x=ju().attributes,S=Do().extendFlat,E=ta().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}q.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:S(e(0,0,1),{}),center:S(e(0,0,0),{}),eye:S(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:d,yaxis:d,zaxis:d,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),XC=Ge({"src/plots/gl3d/layout/axis_defaults.js"(Z,q){"use strict";var d=Ef().mix,x=ta(),S=ll(),E=M3(),e=Ub(),t=Qm(),r=["xaxis","yaxis","zaxis"],o=13600/187;q.exports=function(i,n,s){var h,f;function p(l,_){return x.coerce(h,f,E,l,_)}for(var c=0;c1;function p(c){if(!f){var T=d.validate(n[c],t[c]);if(T)return n[c]}}E(n,s,h,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:p,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,h){for(var f=s("bgcolor"),p=x.combine(f,h.paper_bgcolor),c=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",h.getDfltFromLayout("hovermode"))}}}),Xd=Ge({"src/plots/gl3d/index.js"(Z){"use strict";var q=Ru().overrideAll,d=Md(),x=HC(),S=Bf().getSubplotData,E=ta(),e=Bh(),t="gl3d",r="scene";Z.name=t,Z.attr=r,Z.idRoot=r,Z.idRegex=Z.attrRegex=E.counterRegex("scene"),Z.attributes=WC(),Z.layoutAttributes=E3(),Z.baseLayoutAttrOverrides=q({hoverlabel:d.hoverlabel},"plot","nested"),Z.supplyLayoutDefaults=ZC(),Z.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],h=0;h0){R=h[L];break}return R}function T(y,m){if(!(y<1||m<1)){for(var R=p(y),L=p(m),z=1,F=0;FA;)L--,L/=c(L),L++,L1?z:1};function M(y,m,R){var L=R[8]+R[2]*m[0]+R[5]*m[1];return y[0]=(R[6]+R[0]*m[0]+R[3]*m[1])/L,y[1]=(R[7]+R[1]*m[0]+R[4]*m[1])/L,y}function g(y,m,R){return b(y,m,M,R),y}function b(y,m,R,L){for(var z=[0,0],F=y.shape[0],N=y.shape[1],O=0;O0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(m[L]=!0,z=this.contourStart[L];z$&&(this.minValues[U]=$),this.maxValues[U]<$&&(this.maxValues[U]=$));for(U=0;U<3;U++)this.objectOffset[U]=.5*(this.minValues[U]+this.maxValues[U]);for(U=0;U<3;U++)for(B=0;Bh&&(o.isomin=null,o.isomax=null);var f=n("x"),p=n("y"),c=n("z"),T=n("value");if(!f||!f.length||!p||!p.length||!c||!c.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(M){n(M+"hoverformat");var g="caps."+M,b=n(g+".show");b&&n(g+".fill");var v="slices."+M,u=n(v+".show");u&&(n(v+".fill"),n(v+".locations"))});var _=n("spaceframe.show");_&&n("spaceframe.fill");var w=n("surface.show");w&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var A=n("contour.show");A&&(n("contour.color"),n("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(M){n(M)}),E(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}q.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),P_=Ge({"src/traces/streamtube/calc.js"(Z,q){"use strict";var d=ta(),x=oh();function S(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=E(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,h;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),h=t(o.starts.z||[]),i=Math.min(n.length,s.length,h.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=h||[];var f=0,p=1/0,c;for(c=0;c1&&(u=o[n-1],m=a[n-1],L=i[n-1]),s=0;su?"-":"+")+"x"),A=A.replace("y",(y>m?"-":"+")+"y"),A=A.replace("z",(R>L?"-":"+")+"z");var O=function(){n=0,z=[],F=[],N=[]};(!n||n0;p--){var c=Math.min(f[p],f[p-1]),T=Math.max(f[p],f[p-1]);if(T>c&&c-1}function Q(mt,ze){return mt===null?ze:mt}function re(mt,ze,Ze){le();var we=[ze],ke=[Ze];if(V>=1)we=[ze],ke=[Ze];else if(V>0){var Be=ae(ze,Ze);we=Be.xyzv,ke=Be.abc}for(var He=0;He-1?Ze[ot]:$(Ft,Mt,Et);sr>-1?nt[ot]=sr:nt[ot]=ve(Ft,Mt,Et,Q(mt,Ot))}G(nt[0],nt[1],nt[2])}}function he(mt,ze,Ze){var we=function(ke,Be,He){re(mt,[ze[ke],ze[Be],ze[He]],[Ze[ke],Ze[Be],Ze[He]])};we(0,1,2),we(2,3,0)}function xe(mt,ze,Ze){var we=function(ke,Be,He){re(mt,[ze[ke],ze[Be],ze[He]],[Ze[ke],Ze[Be],Ze[He]])};we(0,1,2),we(3,0,1),we(2,3,0),we(1,2,3)}function Te(mt,ze,Ze,we){var ke=mt[3];kewe&&(ke=we);for(var Be=(mt[3]-ke)/(mt[3]-ze[3]+1e-9),He=[],nt=0;nt<4;nt++)He[nt]=(1-Be)*mt[nt]+Be*ze[nt];return He}function Le(mt,ze,Ze){return mt>=ze&&mt<=Ze}function Pe(mt){var ze=.001*(O-N);return mt>=N-ze&&mt<=O+ze}function qe(mt){for(var ze=[],Ze=0;Ze<4;Ze++){var we=mt[Ze];ze.push([h._x[we],h._y[we],h._z[we],h._value[we]])}return ze}var et=3;function rt(mt,ze,Ze,we,ke,Be){Be||(Be=1),Ze=[-1,-1,-1];var He=!1,nt=[Le(ze[0][3],we,ke),Le(ze[1][3],we,ke),Le(ze[2][3],we,ke)];if(!nt[0]&&!nt[1]&&!nt[2])return!1;var ot=function(Mt,Et,Ot){return Pe(Et[0][3])&&Pe(Et[1][3])&&Pe(Et[2][3])?(re(Mt,Et,Ot),!0):Bent?[z,Be]:[Be,F];zt(ze,ot[0],ot[1])}}var Ft=[[Math.min(N,F),Math.max(N,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(Mt){for(var Et=[],Ot=0;Ot0&&(Ca.push(Ba.id),Mt==="x"?Aa.push([Ba.distRatio,0,0]):Mt==="y"?Aa.push([0,Ba.distRatio,0]):Aa.push([0,0,Ba.distRatio]))}else Mt==="x"?ma=Or(1,u-1):Mt==="y"?ma=Or(1,y-1):ma=Or(1,m-1);Ca.length>0&&(Mt==="x"?Et[sr]=Ut(mt,Ca,ir,ar,Aa,Et[sr]):Mt==="y"?Et[sr]=br(mt,Ca,ir,ar,Aa,Et[sr]):Et[sr]=hr(mt,Ca,ir,ar,Aa,Et[sr]),sr++),ma.length>0&&(Mt==="x"?Et[sr]=We(mt,ma,ir,ar,Et[sr]):Mt==="y"?Et[sr]=Qe(mt,ma,ir,ar,Et[sr]):Et[sr]=Xe(mt,ma,ir,ar,Et[sr]),sr++)}var ba=h.caps[Mt];ba.show&&ba.fill&&(se(ba.fill),Mt==="x"?Et[sr]=We(mt,[0,u-1],ir,ar,Et[sr]):Mt==="y"?Et[sr]=Qe(mt,[0,y-1],ir,ar,Et[sr]):Et[sr]=Xe(mt,[0,m-1],ir,ar,Et[sr]),sr++)}}),w===0&&ce(),h._meshX=P,h._meshY=U,h._meshZ=B,h._meshIntensity=X,h._Xs=g,h._Ys=b,h._Zs=v}return Er(),h}function s(h,f){var p=h.glplot.gl,c=d({gl:p}),T=new o(h,c,f.uid);return c._trace=T,T.update(f),h.glplot.add(c),T}q.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),tL=Ge({"src/traces/isosurface/index.js"(Z,q){"use strict";q.exports={attributes:L_(),supplyDefaults:C3().supplyDefaults,calc:L3(),colorbar:{min:"cmin",max:"cmax"},plot:I_().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:Xd(),categories:["gl3d","showLegend"],meta:{}}}}),rL=Ge({"lib/isosurface.js"(Z,q){"use strict";q.exports=tL()}}),P3=Ge({"src/traces/volume/attributes.js"(Z,q){"use strict";var d=Jl(),x=L_(),S=Dg(),E=Cl(),e=Do().extendFlat,t=Ru().overrideAll,r=q.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate,hovertemplatefallback:x.hovertemplatefallback},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:S.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),aL=Ge({"src/traces/volume/defaults.js"(Z,q){"use strict";var d=ta(),x=P3(),S=C3().supplyIsoDefaults,E=k3().opacityscaleDefaults;q.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}S(t,r,o,a,i),E(t,r,a,i)}}}),nL=Ge({"src/traces/volume/convert.js"(Z,q){"use strict";var d=Vf().gl_mesh3d,x=id().parseColorScale,S=ta().isArrayOrTypedArray,E=nd(),e=wu().extractOpts,t=om(),r=I_().findNearestOnAxis,o=I_().generateIsoMeshes;function a(s,h,f){this.scene=s,this.uid=f,this.mesh=h,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var h=s.data.index,f=this.data._meshX[h],p=this.data._meshY[h],c=this.data._meshZ[h],T=this.data._Ys.length,l=this.data._Zs.length,_=r(f,this.data._Xs).id,w=r(p,this.data._Ys).id,A=r(c,this.data._Zs).id,M=s.index=A+l*w+l*T*_;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var g=this.data.hovertext||this.data.text;return S(g)&&g[M]!==void 0?s.textLabel=g[M]:g&&(s.textLabel=g),!0}},i.update=function(s){var h=this.scene,f=h.fullSceneLayout;this.data=o(s);function p(w,A,M,g){return A.map(function(b){return w.d2l(b,0,g)*M})}var c=t(p(f.xaxis,s._meshX,h.dataScale[0],s.xcalendar),p(f.yaxis,s._meshY,h.dataScale[1],s.ycalendar),p(f.zaxis,s._meshZ,h.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:c,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},_=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[_.min,_.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,h){var f=s.glplot.gl,p=d({gl:f}),c=new a(s,p,h.uid);return p._trace=c,c.update(h),s.glplot.add(p),c}q.exports=n}}),iL=Ge({"src/traces/volume/index.js"(Z,q){"use strict";q.exports={attributes:P3(),supplyDefaults:aL(),calc:L3(),colorbar:{min:"cmin",max:"cmax"},plot:nL(),moduleType:"trace",name:"volume",basePlotModule:Xd(),categories:["gl3d","showLegend"],meta:{}}}}),oL=Ge({"lib/volume.js"(Z,q){"use strict";q.exports=iL()}}),sL=Ge({"src/traces/mesh3d/defaults.js"(Z,q){"use strict";var d=Yi(),x=ta(),S=bf(),E=im();q.exports=function(t,r,o,a){function i(p,c){return x.coerce(t,r,E,p,c)}function n(p){var c=p.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return c.every(function(T){return T&&T.length===c[0].length})&&c}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var h=d.getComponentMethod("calendars","handleTraceDefaults");h(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(p){i(p)});var f=i("contour.show");f&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),S(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),lL=Ge({"src/traces/mesh3d/calc.js"(Z,q){"use strict";var d=oh();q.exports=function(S,E){E.intensity&&d(S,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),uL=Ge({"src/traces/mesh3d/convert.js"(Z,q){"use strict";var d=Vf().gl_mesh3d,x=Vf().delaunay_triangulate,S=Vf().alpha_shape,E=Vf().convex_hull,e=id().parseColorScale,t=ta().isArrayOrTypedArray,r=nd(),o=wu().extractOpts,a=om();function i(l,_,w){this.scene=l,this.uid=w,this.mesh=_,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var _=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[_],this.data.y[_],this.data.z[_]];var w=this.data.hovertext||this.data.text;return t(w)&&w[_]!==void 0?l.textLabel=w[_]:w&&(l.textLabel=w),!0}};function s(l){for(var _=[],w=l.length,A=0;A=_-.5)return!1;return!0}n.update=function(l){var _=this.scene,w=_.fullSceneLayout;this.data=l;var A=l.x.length,M=a(h(w.xaxis,l.x,_.dataScale[0],l.xcalendar),h(w.yaxis,l.y,_.dataScale[1],l.ycalendar),h(w.zaxis,l.z,_.dataScale[2],l.zcalendar)),g;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!c(l.i,A)||!c(l.j,A)||!c(l.k,A))return;g=a(f(l.i),f(l.j),f(l.k))}else l.alphahull===0?g=E(M):l.alphahull>0?g=S(l.alphahull,M):g=p(l.delaunayaxis,M);var b={positions:M,cells:g,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var v=o(l);this.color="#fff";var u=l.intensitymode;b[u+"Intensity"]=l.intensity,b[u+"IntensityBounds"]=[v.min,v.max],b.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],b.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],b.cellColors=s(l.facecolor)):(this.color=l.color,b.meshColor=r(l.color));this.mesh.update(b)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,_){var w=l.glplot.gl,A=d({gl:w}),M=new i(l,A,_.uid);return A._trace=M,M.update(_),l.glplot.add(A),M}q.exports=T}}),cL=Ge({"src/traces/mesh3d/index.js"(Z,q){"use strict";q.exports={attributes:im(),supplyDefaults:sL(),calc:lL(),colorbar:{min:"cmin",max:"cmax"},plot:uL(),moduleType:"trace",name:"mesh3d",basePlotModule:Xd(),categories:["gl3d","showLegend"],meta:{}}}}),fL=Ge({"lib/mesh3d.js"(Z,q){"use strict";q.exports=cL()}}),I3=Ge({"src/traces/cone/attributes.js"(Z,q){"use strict";var d=Jl(),x=pc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Tl(),e=im(),t=Cl(),r=Do().extendFlat,o={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:S({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:E({editType:"calc"}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:r({},t.showlegend,{dflt:!1})};r(o,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var a=["opacity","lightposition","lighting"];a.forEach(function(i){o[i]=e[i]}),o.hoverinfo=r({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),q.exports=o}}),hL=Ge({"src/traces/cone/defaults.js"(Z,q){"use strict";var d=ta(),x=bf(),S=I3();q.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,S,T,l)}var i=a("u"),n=a("v"),s=a("w"),h=a("x"),f=a("y"),p=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!h||!h.length||!f||!f.length||!p||!p.length){t.visible=!1;return}var c=a("sizemode");a("sizeref",c==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),vL=Ge({"src/traces/cone/calc.js"(Z,q){"use strict";var d=oh();q.exports=function(S,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?c=f.slice(1,p-1):p===2?c=[(f[0]+f[1])/2]:c=f,c}function n(f){var p=f.length;return p===1?[.5,.5]:[f[1]-f[0],f[p-1]-f[p-2]]}function s(f,p){var c=f.fullSceneLayout,T=f.dataScale,l=p._len,_={};function w(ve,G){var Y=c[G],ee=T[r[G]];return S.simpleMap(ve,function(V){return Y.d2l(V)*ee})}if(_.vectors=t(w(p._u,"xaxis"),w(p._v,"yaxis"),w(p._w,"zaxis"),l),!l)return{positions:[],cells:[]};var A=w(p._Xs,"xaxis"),M=w(p._Ys,"yaxis"),g=w(p._Zs,"zaxis");_.meshgrid=[A,M,g],_.gridFill=p._gridFill;var b=p._slen;if(b)_.startingPositions=t(w(p._startsX,"xaxis"),w(p._startsY,"yaxis"),w(p._startsZ,"zaxis"));else{for(var v=M[0],u=i(A),y=i(g),m=new Array(u.length*y.length),R=0,L=0;Lv&&(v=R[0]),R[1]u&&(u=R[1])}function m(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(m);break;case"Point":y(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(y);break}}w.arcs.forEach(function(R){for(var L=-1,z=R.length,F;++Lv&&(v=F[0]),F[1]u&&(u=F[1])});for(M in w.objects)m(w.objects[M]);return[g,b,v,u]}function e(w,A){for(var M,g=w.length,b=g-A;b<--g;)M=w[b],w[b++]=w[g],w[g]=M}function t(w,A){return typeof A=="string"&&(A=w.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(M){return r(w,M)})}:r(w,A)}function r(w,A){var M=A.id,g=A.bbox,b=A.properties==null?{}:A.properties,v=o(w,A);return M==null&&g==null?{type:"Feature",properties:b,geometry:v}:g==null?{type:"Feature",id:M,properties:b,geometry:v}:{type:"Feature",id:M,bbox:g,properties:b,geometry:v}}function o(w,A){var M=S(w.transform),g=w.arcs;function b(L,z){z.length&&z.pop();for(var F=g[L<0?~L:L],N=0,O=F.length;N1)g=s(w,A,M);else for(b=0,g=new Array(v=w.arcs.length);b1)for(var z=1,F=y(R[0]),N,O;zF&&(O=R[0],R[0]=R[z],R[z]=O,F=N);return R}).filter(function(m){return m.length>0})}}function c(w,A){for(var M=0,g=w.length;M>>1;w[b]=2))throw new Error("n must be \u22652");m=w.bbox||E(w);var M=m[0],g=m[1],b=m[2],v=m[3],u;A={scale:[b-M?(b-M)/(u-1):1,v-g?(v-g)/(u-1):1],translate:[M,g]}}else m=w.bbox;var y=l(A),m,R,L=w.objects,z={};function F(P){return y(P)}function N(P){var U;switch(P.type){case"GeometryCollection":U={type:"GeometryCollection",geometries:P.geometries.map(N)};break;case"Point":U={type:"Point",coordinates:F(P.coordinates)};break;case"MultiPoint":U={type:"MultiPoint",coordinates:P.coordinates.map(F)};break;default:return P}return P.id!=null&&(U.id=P.id),P.bbox!=null&&(U.bbox=P.bbox),P.properties!=null&&(U.properties=P.properties),U}function O(P){var U=0,B=1,X=P.length,$,le=new Array(X);for(le[0]=y(P[0],0);++U0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},Z.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Z.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),S=0;Se(N,z)),F)}function r(L,z,F={}){for(let O of L){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let P=0;Pr(N,z)),F)}function a(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return S({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return n(L.map(N=>a(N,z)),F)}function n(L,z={}){let F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=L,F}function s(L,z,F={}){return S({type:"MultiLineString",coordinates:L},z,F)}function h(L,z,F={}){return S({type:"MultiPoint",coordinates:L},z,F)}function f(L,z,F={}){return S({type:"MultiPolygon",coordinates:L},z,F)}function p(L,z,F={}){return S({type:"GeometryCollection",geometries:L},z,F)}function c(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");let F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L/F}function _(L,z){return M(l(L,z))}function w(L){let z=L%360;return z<0&&(z+=360),z}function A(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function M(L){return L%(2*Math.PI)*180/Math.PI}function g(L){return L%360*Math.PI/180}function b(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function v(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");let N=x[z];if(!N)throw new Error("invalid original units");let O=x[F];if(!O)throw new Error("invalid final units");return L/N*O}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function y(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function m(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function R(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}Z.areaFactors=x,Z.azimuthToBearing=A,Z.bearingToAzimuth=w,Z.convertArea=v,Z.convertLength=b,Z.degreesToRadians=g,Z.earthRadius=q,Z.factors=d,Z.feature=S,Z.featureCollection=n,Z.geometry=E,Z.geometryCollection=p,Z.isNumber=u,Z.isObject=y,Z.lengthToDegrees=_,Z.lengthToRadians=l,Z.lineString=a,Z.lineStrings=i,Z.multiLineString=s,Z.multiPoint=h,Z.multiPolygon=f,Z.point=e,Z.points=t,Z.polygon=r,Z.polygons=o,Z.radiansToDegrees=M,Z.radiansToLength=T,Z.round=c,Z.validateBBox=m,Z.validateId=R}}),F_=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=z_();function d(l,_,w){if(l!==null)for(var A,M,g,b,v,u,y,m=0,R=0,L,z=l.type,F=z==="FeatureCollection",N=z==="Feature",O=F?l.features.length:1,P=0;Pu||F>y||N>m){v=R,u=A,y=F,m=N,g=0;return}var O=q.lineString.call(void 0,[v,R],w.properties);if(_(O,A,M,N,g)===!1)return!1;g++,v=R})===!1)return!1}}})}function h(l,_,w){var A=w,M=!1;return s(l,function(g,b,v,u,y){M===!1&&w===void 0?A=g:A=_(A,g,b,v,u,y),M=!0}),A}function f(l,_){if(!l)throw new Error("geojson is required");i(l,function(w,A,M){if(w.geometry!==null){var g=w.geometry.type,b=w.geometry.coordinates;switch(g){case"LineString":if(_(w,A,M,0,0)===!1)return!1;break;case"Polygon":for(var v=0;vi+S(n),0)}function S(a){let i=0,n;switch(a.type){case"Polygon":return E(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],c=h[0]*t,T=f[1]*t,l=p[0]*t;n+=(l-c)*Math.sin(T),s++}return n*e}var o=x;Z.area=x,Z.default=o}}),SL=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=z_(),d=F_();function x(E,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,E,function(a){t+=a[0],r+=a[1],o++},!0),q.point.call(void 0,[t/o,r/o],e.properties)}var S=x;Z.centroid=x,Z.default=S}}),ML=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=F_();function d(S,E={}){if(S.bbox!=null&&E.recompute!==!0)return S.bbox;let e=[1/0,1/0,-1/0,-1/0];return q.coordEach.call(void 0,S,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&O[P+1][0]<0)return P;return null}switch(y==="RUS"||y==="FJI"?R=function(O){var P;if(N(O)===null)P=O;else for(P=new Array(O.length),F=0;FP?U[B++]=[O[F][0]+360,O[F][1]]:F===P?(U[B++]=O[F],U[B++]=[O[F][0],-90]):U[B++]=O[F];var X=i.tester(U);X.pts.pop(),m.push(X)}:R=function(O){m.push(i.tester(O))},v.type){case"MultiPolygon":for(L=0;L0?X.properties.ct=A(X):X.properties.ct=[NaN,NaN],U.fIn=O,U.fOut=X,m.push(X)}else r.log(["Location",U.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete y[P]}switch(u.type){case"FeatureCollection":var F=u.features;for(R=0;Rm&&(m=z,u=L)}else u=v;return E(u).geometry.coordinates}function M(b){var v=window.PlotlyGeoAssets||{},u=[];function y(F){return new Promise(function(N,O){d.json(F,function(P,U){if(P){delete v[F];var B=P.status===404?'GeoJSON at URL "'+F+'" does not exist.':"Unexpected error while fetching from "+F;return O(new Error(B))}return v[F]=U,N(U)})})}function m(F){return new Promise(function(N,O){var P=0,U=setInterval(function(){if(v[F]&&v[F]!=="pending")return clearInterval(U),N(v[F]);if(P>100)return clearInterval(U),O("Unexpected error while fetching from "+F);P++},50)})}for(var R=0;R")}}}),CL=Ge({"src/traces/scattergeo/event_data.js"(Z,q){"use strict";q.exports=function(x,S,E,e,t){x.lon=S.lon,x.lat=S.lat,x.location=S.loc?S.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),LL=Ge({"src/traces/scattergeo/select.js"(Z,q){"use strict";var d=iu(),x=As().BADNUM;q.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,a=[],i=t[0].trace,n,s,h,f,p,c=!d.hasMarkers(i)&&!d.hasText(i);if(c)return[];if(e===!1)for(p=0;pV?1:ee>=V?0:NaN}function S(ee){return ee.length===1&&(ee=E(ee)),{left:function(V,se,ae,j){for(ae==null&&(ae=0),j==null&&(j=V.length);ae>>1;ee(V[Q],se)<0?ae=Q+1:j=Q}return ae},right:function(V,se,ae,j){for(ae==null&&(ae=0),j==null&&(j=V.length);ae>>1;ee(V[Q],se)>0?j=Q:ae=Q+1}return ae}}}function E(ee){return function(V,se){return x(ee(V),se)}}var e=S(x),t=e.right,r=e.left;function o(ee,V){V==null&&(V=a);for(var se=0,ae=ee.length-1,j=ee[0],Q=new Array(ae<0?0:ae);seee?1:V>=ee?0:NaN}function s(ee){return ee===null?NaN:+ee}function h(ee,V){var se=ee.length,ae=0,j=-1,Q=0,re,he,xe=0;if(V==null)for(;++j1)return xe/(ae-1)}function f(ee,V){var se=h(ee,V);return se&&Math.sqrt(se)}function p(ee,V){var se=ee.length,ae=-1,j,Q,re;if(V==null){for(;++ae=j)for(Q=re=j;++aej&&(Q=j),re=j)for(Q=re=j;++aej&&(Q=j),re0)return[ee];if((ae=V0)for(ee=Math.ceil(ee/he),V=Math.floor(V/he),re=new Array(Q=Math.ceil(V-ee+1));++j=0?(Q>=M?10:Q>=g?5:Q>=b?2:1)*Math.pow(10,j):-Math.pow(10,-j)/(Q>=M?10:Q>=g?5:Q>=b?2:1)}function y(ee,V,se){var ae=Math.abs(V-ee)/Math.max(0,se),j=Math.pow(10,Math.floor(Math.log(ae)/Math.LN10)),Q=ae/j;return Q>=M?j*=10:Q>=g?j*=5:Q>=b&&(j*=2),VPe;)qe.pop(),--et;var rt=new Array(et+1),$e;for(Q=0;Q<=et;++Q)$e=rt[Q]=[],$e.x0=Q>0?qe[Q-1]:Le,$e.x1=Q=1)return+se(ee[ae-1],ae-1,ee);var ae,j=(ae-1)*V,Q=Math.floor(j),re=+se(ee[Q],Q,ee),he=+se(ee[Q+1],Q+1,ee);return re+(he-re)*(j-Q)}}function z(ee,V,se){return ee=l.call(ee,s).sort(x),Math.ceil((se-V)/(2*(L(ee,.75)-L(ee,.25))*Math.pow(ee.length,-1/3)))}function F(ee,V,se){return Math.ceil((se-V)/(3.5*f(ee)*Math.pow(ee.length,-1/3)))}function N(ee,V){var se=ee.length,ae=-1,j,Q;if(V==null){for(;++ae=j)for(Q=j;++aeQ&&(Q=j)}else for(;++ae=j)for(Q=j;++aeQ&&(Q=j);return Q}function O(ee,V){var se=ee.length,ae=se,j=-1,Q,re=0;if(V==null)for(;++j=0;)for(re=ee[V],se=re.length;--se>=0;)Q[--j]=re[se];return Q}function B(ee,V){var se=ee.length,ae=-1,j,Q;if(V==null){for(;++ae=j)for(Q=j;++aej&&(Q=j)}else for(;++ae=j)for(Q=j;++aej&&(Q=j);return Q}function X(ee,V){for(var se=V.length,ae=new Array(se);se--;)ae[se]=ee[V[se]];return ae}function $(ee,V){if(se=ee.length){var se,ae=0,j=0,Q,re=ee[j];for(V==null&&(V=x);++ae0?1:Yt<0?-1:0},v=Math.sqrt,u=Math.tan;function y(Yt){return Yt>1?0:Yt<-1?a:Math.acos(Yt)}function m(Yt){return Yt>1?i:Yt<-1?-i:Math.asin(Yt)}function R(Yt){return(Yt=g(Yt/2))*Yt}function L(){}function z(Yt,mr){Yt&&N.hasOwnProperty(Yt.type)&&N[Yt.type](Yt,mr)}var F={Feature:function(Yt,mr){z(Yt.geometry,mr)},FeatureCollection:function(Yt,mr){for(var Jr=Yt.features,Wr=-1,xa=Jr.length;++Wr=0?1:-1,xa=Wr*Jr,$a=l(mr),xn=g(mr),Fn=G*xn,Gn=ve*$a+Fn*l(xa),ai=Fn*Wr*g(xa);B.add(T(ai,Gn)),ce=Yt,ve=$a,G=xn}function j(Yt){return X.reset(),U(Yt,Y),X*2}function Q(Yt){return[T(Yt[1],Yt[0]),m(Yt[2])]}function re(Yt){var mr=Yt[0],Jr=Yt[1],Wr=l(Jr);return[Wr*l(mr),Wr*g(mr),g(Jr)]}function he(Yt,mr){return Yt[0]*mr[0]+Yt[1]*mr[1]+Yt[2]*mr[2]}function xe(Yt,mr){return[Yt[1]*mr[2]-Yt[2]*mr[1],Yt[2]*mr[0]-Yt[0]*mr[2],Yt[0]*mr[1]-Yt[1]*mr[0]]}function Te(Yt,mr){Yt[0]+=mr[0],Yt[1]+=mr[1],Yt[2]+=mr[2]}function Le(Yt,mr){return[Yt[0]*mr,Yt[1]*mr,Yt[2]*mr]}function Pe(Yt){var mr=v(Yt[0]*Yt[0]+Yt[1]*Yt[1]+Yt[2]*Yt[2]);Yt[0]/=mr,Yt[1]/=mr,Yt[2]/=mr}var qe,et,rt,$e,Ue,fe,ue,ie,Ee=S(),We,Qe,Xe={point:Tt,lineStart:zt,lineEnd:Ut,polygonStart:function(){Xe.point=br,Xe.lineStart=hr,Xe.lineEnd=Or,Ee.reset(),Y.polygonStart()},polygonEnd:function(){Y.polygonEnd(),Xe.point=Tt,Xe.lineStart=zt,Xe.lineEnd=Ut,B<0?(qe=-(rt=180),et=-($e=90)):Ee>r?$e=90:Ee<-r&&(et=-90),Qe[0]=qe,Qe[1]=rt},sphere:function(){qe=-(rt=180),et=-($e=90)}};function Tt(Yt,mr){We.push(Qe=[qe=Yt,rt=Yt]),mr$e&&($e=mr)}function St(Yt,mr){var Jr=re([Yt*f,mr*f]);if(ie){var Wr=xe(ie,Jr),xa=[Wr[1],-Wr[0],0],$a=xe(xa,Wr);Pe($a),$a=Q($a);var xn=Yt-Ue,Fn=xn>0?1:-1,Gn=$a[0]*h*Fn,ai,wn=p(xn)>180;wn^(Fn*Ue$e&&($e=ai)):(Gn=(Gn+360)%360-180,wn^(Fn*Ue$e&&($e=mr))),wn?Ytwr(qe,rt)&&(rt=Yt):wr(Yt,rt)>wr(qe,rt)&&(qe=Yt):rt>=qe?(Ytrt&&(rt=Yt)):Yt>Ue?wr(qe,Yt)>wr(qe,rt)&&(rt=Yt):wr(Yt,rt)>wr(qe,rt)&&(qe=Yt)}else We.push(Qe=[qe=Yt,rt=Yt]);mr$e&&($e=mr),ie=Jr,Ue=Yt}function zt(){Xe.point=St}function Ut(){Qe[0]=qe,Qe[1]=rt,Xe.point=Tt,ie=null}function br(Yt,mr){if(ie){var Jr=Yt-Ue;Ee.add(p(Jr)>180?Jr+(Jr>0?360:-360):Jr)}else fe=Yt,ue=mr;Y.point(Yt,mr),St(Yt,mr)}function hr(){Y.lineStart()}function Or(){br(fe,ue),Y.lineEnd(),p(Ee)>r&&(qe=-(rt=180)),Qe[0]=qe,Qe[1]=rt,ie=null}function wr(Yt,mr){return(mr-=Yt)<0?mr+360:mr}function Er(Yt,mr){return Yt[0]-mr[0]}function mt(Yt,mr){return Yt[0]<=Yt[1]?Yt[0]<=mr&&mr<=Yt[1]:mrwr(Wr[0],Wr[1])&&(Wr[1]=xa[1]),wr(xa[0],Wr[1])>wr(Wr[0],Wr[1])&&(Wr[0]=xa[0])):$a.push(Wr=xa);for(xn=-1/0,Jr=$a.length-1,mr=0,Wr=$a[Jr];mr<=Jr;Wr=xa,++mr)xa=$a[mr],(Fn=wr(Wr[1],xa[0]))>xn&&(xn=Fn,qe=xa[0],rt=Wr[1])}return We=Qe=null,qe===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[qe,et],[rt,$e]]}var Ze,we,ke,Be,He,nt,ot,Ft,Mt,Et,Ot,sr,ir,ar,Mr,ma,Ca={sphere:L,point:Aa,lineStart:Ba,lineEnd:vn,polygonStart:function(){Ca.lineStart=Wt,Ca.lineEnd=Lt},polygonEnd:function(){Ca.lineStart=Ba,Ca.lineEnd=vn}};function Aa(Yt,mr){Yt*=f,mr*=f;var Jr=l(mr);Da(Jr*l(Yt),Jr*g(Yt),g(mr))}function Da(Yt,mr,Jr){++Ze,ke+=(Yt-ke)/Ze,Be+=(mr-Be)/Ze,He+=(Jr-He)/Ze}function Ba(){Ca.point=ba}function ba(Yt,mr){Yt*=f,mr*=f;var Jr=l(mr);ar=Jr*l(Yt),Mr=Jr*g(Yt),ma=g(mr),Ca.point=rn,Da(ar,Mr,ma)}function rn(Yt,mr){Yt*=f,mr*=f;var Jr=l(mr),Wr=Jr*l(Yt),xa=Jr*g(Yt),$a=g(mr),xn=T(v((xn=Mr*$a-ma*xa)*xn+(xn=ma*Wr-ar*$a)*xn+(xn=ar*xa-Mr*Wr)*xn),ar*Wr+Mr*xa+ma*$a);we+=xn,nt+=xn*(ar+(ar=Wr)),ot+=xn*(Mr+(Mr=xa)),Ft+=xn*(ma+(ma=$a)),Da(ar,Mr,ma)}function vn(){Ca.point=Aa}function Wt(){Ca.point=Ht}function Lt(){Xt(sr,ir),Ca.point=Aa}function Ht(Yt,mr){sr=Yt,ir=mr,Yt*=f,mr*=f,Ca.point=Xt;var Jr=l(mr);ar=Jr*l(Yt),Mr=Jr*g(Yt),ma=g(mr),Da(ar,Mr,ma)}function Xt(Yt,mr){Yt*=f,mr*=f;var Jr=l(mr),Wr=Jr*l(Yt),xa=Jr*g(Yt),$a=g(mr),xn=Mr*$a-ma*xa,Fn=ma*Wr-ar*$a,Gn=ar*xa-Mr*Wr,ai=v(xn*xn+Fn*Fn+Gn*Gn),wn=m(ai),Sn=ai&&-wn/ai;Mt+=Sn*xn,Et+=Sn*Fn,Ot+=Sn*Gn,we+=wn,nt+=wn*(ar+(ar=Wr)),ot+=wn*(Mr+(Mr=xa)),Ft+=wn*(ma+(ma=$a)),Da(ar,Mr,ma)}function Pr(Yt){Ze=we=ke=Be=He=nt=ot=Ft=Mt=Et=Ot=0,U(Yt,Ca);var mr=Mt,Jr=Et,Wr=Ot,xa=mr*mr+Jr*Jr+Wr*Wr;return xaa?Yt+Math.round(-Yt/s)*s:Yt,mr]}na.invert=na;function La(Yt,mr,Jr){return(Yt%=s)?mr||Jr?Kr(Ua(Yt),Xa(mr,Jr)):Ua(Yt):mr||Jr?Xa(mr,Jr):na}function Ga(Yt){return function(mr,Jr){return mr+=Yt,[mr>a?mr-s:mr<-a?mr+s:mr,Jr]}}function Ua(Yt){var mr=Ga(Yt);return mr.invert=Ga(-Yt),mr}function Xa(Yt,mr){var Jr=l(Yt),Wr=g(Yt),xa=l(mr),$a=g(mr);function xn(Fn,Gn){var ai=l(Gn),wn=l(Fn)*ai,Sn=g(Fn)*ai,Ln=g(Gn),sn=Ln*Jr+wn*Wr;return[T(Sn*xa-sn*$a,wn*Jr-Ln*Wr),m(sn*xa+Sn*$a)]}return xn.invert=function(Fn,Gn){var ai=l(Gn),wn=l(Fn)*ai,Sn=g(Fn)*ai,Ln=g(Gn),sn=Ln*xa-Sn*$a;return[T(Sn*xa+Ln*$a,wn*Jr+sn*Wr),m(sn*Jr-wn*Wr)]},xn}function an(Yt){Yt=La(Yt[0]*f,Yt[1]*f,Yt.length>2?Yt[2]*f:0);function mr(Jr){return Jr=Yt(Jr[0]*f,Jr[1]*f),Jr[0]*=h,Jr[1]*=h,Jr}return mr.invert=function(Jr){return Jr=Yt.invert(Jr[0]*f,Jr[1]*f),Jr[0]*=h,Jr[1]*=h,Jr},mr}function Sa(Yt,mr,Jr,Wr,xa,$a){if(Jr){var xn=l(mr),Fn=g(mr),Gn=Wr*Jr;xa==null?(xa=mr+Wr*s,$a=mr-Gn/2):(xa=Zn(xn,xa),$a=Zn(xn,$a),(Wr>0?xa<$a:xa>$a)&&(xa+=Wr*s));for(var ai,wn=xa;Wr>0?wn>$a:wn<$a;wn-=Gn)ai=Q([xn,-Fn*l(wn),-Fn*g(wn)]),Yt.point(ai[0],ai[1])}}function Zn(Yt,mr){mr=re(mr),mr[0]-=Yt,Pe(mr);var Jr=y(-mr[1]);return((-mr[2]<0?-Jr:Jr)+s-r)%s}function Wn(){var Yt=Yr([0,0]),mr=Yr(90),Jr=Yr(6),Wr,xa,$a={point:xn};function xn(Gn,ai){Wr.push(Gn=xa(Gn,ai)),Gn[0]*=h,Gn[1]*=h}function Fn(){var Gn=Yt.apply(this,arguments),ai=mr.apply(this,arguments)*f,wn=Jr.apply(this,arguments)*f;return Wr=[],xa=La(-Gn[0]*f,-Gn[1]*f,0).invert,Sa($a,ai,wn,1),Gn={type:"Polygon",coordinates:[Wr]},Wr=xa=null,Gn}return Fn.center=function(Gn){return arguments.length?(Yt=typeof Gn=="function"?Gn:Yr([+Gn[0],+Gn[1]]),Fn):Yt},Fn.radius=function(Gn){return arguments.length?(mr=typeof Gn=="function"?Gn:Yr(+Gn),Fn):mr},Fn.precision=function(Gn){return arguments.length?(Jr=typeof Gn=="function"?Gn:Yr(+Gn),Fn):Jr},Fn}function ti(){var Yt=[],mr;return{point:function(Jr,Wr,xa){mr.push([Jr,Wr,xa])},lineStart:function(){Yt.push(mr=[])},lineEnd:L,rejoin:function(){Yt.length>1&&Yt.push(Yt.pop().concat(Yt.shift()))},result:function(){var Jr=Yt;return Yt=[],mr=null,Jr}}}function gt(Yt,mr){return p(Yt[0]-mr[0])=0;--Fn)xa.point((Sn=wn[Fn])[0],Sn[1]);else Wr(Ln.x,Ln.p.x,-1,xa);Ln=Ln.p}Ln=Ln.o,wn=Ln.z,sn=!sn}while(!Ln.v);xa.lineEnd()}}}function Ar(Yt){if(mr=Yt.length){for(var mr,Jr=0,Wr=Yt[0],xa;++Jr=0?1:-1,_s=Rs*is,Ps=_s>a,ts=Ni*ao;if(pr.add(T(ts*Rs*g(_s),Wi*Po+ts*l(_s))),xn+=Ps?is+Rs*s:is,Ps^sn>=Jr^hi>=Jr){var ul=xe(re(Ln),re(Ji));Pe(ul);var Ys=xe($a,ul);Pe(Ys);var Ns=(Ps^is>=0?-1:1)*m(Ys[2]);(Wr>Ns||Wr===Ns&&(ul[0]||ul[1]))&&(Fn+=Ps^is>=0?1:-1)}}return(xn<-r||xn0){for(Gn||(xa.polygonStart(),Gn=!0),xa.lineStart(),Po=0;Po1&&Qn&2&&ao.push(ao.pop().concat(ao.shift())),wn.push(ao.filter(dt))}}return Ln}}function dt(Yt){return Yt.length>1}function qt(Yt,mr){return((Yt=Yt.x)[0]<0?Yt[1]-i-r:i-Yt[1])-((mr=mr.x)[0]<0?mr[1]-i-r:i-mr[1])}var fr=Ur(function(){return!0},Ir,Ta,[-a,-i]);function Ir(Yt){var mr=NaN,Jr=NaN,Wr=NaN,xa;return{lineStart:function(){Yt.lineStart(),xa=1},point:function($a,xn){var Fn=$a>0?a:-a,Gn=p($a-mr);p(Gn-a)0?i:-i),Yt.point(Wr,Jr),Yt.lineEnd(),Yt.lineStart(),Yt.point(Fn,Jr),Yt.point($a,Jr),xa=0):Wr!==Fn&&Gn>=a&&(p(mr-Wr)r?c((g(mr)*($a=l(Wr))*g(Jr)-g(Wr)*(xa=l(mr))*g(Yt))/(xa*$a*xn)):(mr+Wr)/2}function Ta(Yt,mr,Jr,Wr){var xa;if(Yt==null)xa=Jr*i,Wr.point(-a,xa),Wr.point(0,xa),Wr.point(a,xa),Wr.point(a,0),Wr.point(a,-xa),Wr.point(0,-xa),Wr.point(-a,-xa),Wr.point(-a,0),Wr.point(-a,xa);else if(p(Yt[0]-mr[0])>r){var $a=Yt[0]0,xa=p(mr)>r;function $a(wn,Sn,Ln,sn){Sa(sn,Yt,Jr,Ln,wn,Sn)}function xn(wn,Sn){return l(wn)*l(Sn)>mr}function Fn(wn){var Sn,Ln,sn,di,Ni;return{lineStart:function(){di=sn=!1,Ni=1},point:function(Wi,Ui){var Ji=[Wi,Ui],hi,Qn=xn(Wi,Ui),ao=Wr?Qn?0:ai(Wi,Ui):Qn?ai(Wi+(Wi<0?a:-a),Ui):0;if(!Sn&&(di=sn=Qn)&&wn.lineStart(),Qn!==sn&&(hi=Gn(Sn,Ji),(!hi||gt(Sn,hi)||gt(Ji,hi))&&(Ji[2]=1)),Qn!==sn)Ni=0,Qn?(wn.lineStart(),hi=Gn(Ji,Sn),wn.point(hi[0],hi[1])):(hi=Gn(Sn,Ji),wn.point(hi[0],hi[1],2),wn.lineEnd()),Sn=hi;else if(xa&&Sn&&Wr^Qn){var Po;!(ao&Ln)&&(Po=Gn(Ji,Sn,!0))&&(Ni=0,Wr?(wn.lineStart(),wn.point(Po[0][0],Po[0][1]),wn.point(Po[1][0],Po[1][1]),wn.lineEnd()):(wn.point(Po[1][0],Po[1][1]),wn.lineEnd(),wn.lineStart(),wn.point(Po[0][0],Po[0][1],3)))}Qn&&(!Sn||!gt(Sn,Ji))&&wn.point(Ji[0],Ji[1]),Sn=Ji,sn=Qn,Ln=ao},lineEnd:function(){sn&&wn.lineEnd(),Sn=null},clean:function(){return Ni|(di&&sn)<<1}}}function Gn(wn,Sn,Ln){var sn=re(wn),di=re(Sn),Ni=[1,0,0],Wi=xe(sn,di),Ui=he(Wi,Wi),Ji=Wi[0],hi=Ui-Ji*Ji;if(!hi)return!Ln&&wn;var Qn=mr*Ui/hi,ao=-mr*Ji/hi,Po=xe(Ni,Wi),is=Le(Ni,Qn),Rs=Le(Wi,ao);Te(is,Rs);var _s=Po,Ps=he(is,_s),ts=he(_s,_s),ul=Ps*Ps-ts*(he(is,is)-1);if(!(ul<0)){var Ys=v(ul),Ns=Le(_s,(-Ps-Ys)/ts);if(Te(Ns,is),Ns=Q(Ns),!Ln)return Ns;var ki=wn[0],go=Sn[0],Cs=wn[1],ds=Sn[1],zl;go0^Ns[1]<(p(Ns[0]-ki)a^(ki<=Ns[0]&&Ns[0]<=go)){var Wl=Le(_s,(-Ps+Ys)/ts);return Te(Wl,is),[Ns,Q(Wl)]}}}function ai(wn,Sn){var Ln=Wr?Yt:a-Yt,sn=0;return wn<-Ln?sn|=1:wn>Ln&&(sn|=2),Sn<-Ln?sn|=4:Sn>Ln&&(sn|=8),sn}return Ur(xn,Fn,$a,Wr?[0,-Yt]:[-a,Yt-a])}function ra(Yt,mr,Jr,Wr,xa,$a){var xn=Yt[0],Fn=Yt[1],Gn=mr[0],ai=mr[1],wn=0,Sn=1,Ln=Gn-xn,sn=ai-Fn,di;if(di=Jr-xn,!(!Ln&&di>0)){if(di/=Ln,Ln<0){if(di0){if(di>Sn)return;di>wn&&(wn=di)}if(di=xa-xn,!(!Ln&&di<0)){if(di/=Ln,Ln<0){if(di>Sn)return;di>wn&&(wn=di)}else if(Ln>0){if(di0)){if(di/=sn,sn<0){if(di0){if(di>Sn)return;di>wn&&(wn=di)}if(di=$a-Fn,!(!sn&&di<0)){if(di/=sn,sn<0){if(di>Sn)return;di>wn&&(wn=di)}else if(sn>0){if(di0&&(Yt[0]=xn+wn*Ln,Yt[1]=Fn+wn*sn),Sn<1&&(mr[0]=xn+Sn*Ln,mr[1]=Fn+Sn*sn),!0}}}}}var ha=1e9,pn=-ha;function _n(Yt,mr,Jr,Wr){function xa(ai,wn){return Yt<=ai&&ai<=Jr&&mr<=wn&&wn<=Wr}function $a(ai,wn,Sn,Ln){var sn=0,di=0;if(ai==null||(sn=xn(ai,Sn))!==(di=xn(wn,Sn))||Gn(ai,wn)<0^Sn>0)do Ln.point(sn===0||sn===3?Yt:Jr,sn>1?Wr:mr);while((sn=(sn+Sn+4)%4)!==di);else Ln.point(wn[0],wn[1])}function xn(ai,wn){return p(ai[0]-Yt)0?0:3:p(ai[0]-Jr)0?2:1:p(ai[1]-mr)0?1:0:wn>0?3:2}function Fn(ai,wn){return Gn(ai.x,wn.x)}function Gn(ai,wn){var Sn=xn(ai,1),Ln=xn(wn,1);return Sn!==Ln?Sn-Ln:Sn===0?wn[1]-ai[1]:Sn===1?ai[0]-wn[0]:Sn===2?ai[1]-wn[1]:wn[0]-ai[0]}return function(ai){var wn=ai,Sn=ti(),Ln,sn,di,Ni,Wi,Ui,Ji,hi,Qn,ao,Po,is={point:Rs,lineStart:ul,lineEnd:Ys,polygonStart:Ps,polygonEnd:ts};function Rs(ki,go){xa(ki,go)&&wn.point(ki,go)}function _s(){for(var ki=0,go=0,Cs=sn.length;goWr&&($u-Ju)*(Wr-Wl)>(Zl-Wl)*(Yt-Ju)&&++ki:Zl<=Wr&&($u-Ju)*(Wr-Wl)<(Zl-Wl)*(Yt-Ju)&&--ki;return ki}function Ps(){wn=Sn,Ln=[],sn=[],Po=!0}function ts(){var ki=_s(),go=Po&&ki,Cs=(Ln=x.merge(Ln)).length;(go||Cs)&&(ai.polygonStart(),go&&(ai.lineStart(),$a(null,null,1,ai),ai.lineEnd()),Cs&&Rr(Ln,Fn,ki,$a,ai),ai.polygonEnd()),wn=ai,Ln=sn=di=null}function ul(){is.point=Ns,sn&&sn.push(di=[]),ao=!0,Qn=!1,Ji=hi=NaN}function Ys(){Ln&&(Ns(Ni,Wi),Ui&&Qn&&Sn.rejoin(),Ln.push(Sn.result())),is.point=Rs,Qn&&wn.lineEnd()}function Ns(ki,go){var Cs=xa(ki,go);if(sn&&di.push([ki,go]),ao)Ni=ki,Wi=go,Ui=Cs,ao=!1,Cs&&(wn.lineStart(),wn.point(ki,go));else if(Cs&&Qn)wn.point(ki,go);else{var ds=[Ji=Math.max(pn,Math.min(ha,Ji)),hi=Math.max(pn,Math.min(ha,hi))],zl=[ki=Math.max(pn,Math.min(ha,ki)),go=Math.max(pn,Math.min(ha,go))];ra(ds,zl,Yt,mr,Jr,Wr)?(Qn||(wn.lineStart(),wn.point(ds[0],ds[1])),wn.point(zl[0],zl[1]),Cs||wn.lineEnd(),Po=!1):Cs&&(wn.lineStart(),wn.point(ki,go),Po=!1)}Ji=ki,hi=go,Qn=Cs}return is}}function jn(){var Yt=0,mr=0,Jr=960,Wr=500,xa,$a,xn;return xn={stream:function(Fn){return xa&&$a===Fn?xa:xa=_n(Yt,mr,Jr,Wr)($a=Fn)},extent:function(Fn){return arguments.length?(Yt=+Fn[0][0],mr=+Fn[0][1],Jr=+Fn[1][0],Wr=+Fn[1][1],xa=$a=null,xn):[[Yt,mr],[Jr,Wr]]}}}var li=S(),yi,gi,Si,Gi={sphere:L,point:L,lineStart:io,lineEnd:L,polygonStart:L,polygonEnd:L};function io(){Gi.point=ms,Gi.lineEnd=vo}function vo(){Gi.point=Gi.lineEnd=L}function ms(Yt,mr){Yt*=f,mr*=f,yi=Yt,gi=g(mr),Si=l(mr),Gi.point=pi}function pi(Yt,mr){Yt*=f,mr*=f;var Jr=g(mr),Wr=l(mr),xa=p(Yt-yi),$a=l(xa),xn=g(xa),Fn=Wr*xn,Gn=Si*Jr-gi*Wr*$a,ai=gi*Jr+Si*Wr*$a;li.add(T(v(Fn*Fn+Gn*Gn),ai)),yi=Yt,gi=Jr,Si=Wr}function lo(Yt){return li.reset(),U(Yt,Gi),+li}var Ai=[null,null],Fo={type:"LineString",coordinates:Ai};function No(Yt,mr){return Ai[0]=Yt,Ai[1]=mr,lo(Fo)}var $o={Feature:function(Yt,mr){return Hi(Yt.geometry,mr)},FeatureCollection:function(Yt,mr){for(var Jr=Yt.features,Wr=-1,xa=Jr.length;++Wr0&&(xa=No(Yt[$a],Yt[$a-1]),xa>0&&Jr<=xa&&Wr<=xa&&(Jr+Wr-xa)*(1-Math.pow((Jr-Wr)/xa,2))r}).map(Ln)).concat(x.range(_($a/ai)*ai,xa,ai).filter(function(hi){return p(hi%Sn)>r}).map(sn))}return Ui.lines=function(){return Ji().map(function(hi){return{type:"LineString",coordinates:hi}})},Ui.outline=function(){return{type:"Polygon",coordinates:[di(Wr).concat(Ni(xn).slice(1),di(Jr).reverse().slice(1),Ni(Fn).reverse().slice(1))]}},Ui.extent=function(hi){return arguments.length?Ui.extentMajor(hi).extentMinor(hi):Ui.extentMinor()},Ui.extentMajor=function(hi){return arguments.length?(Wr=+hi[0][0],Jr=+hi[1][0],Fn=+hi[0][1],xn=+hi[1][1],Wr>Jr&&(hi=Wr,Wr=Jr,Jr=hi),Fn>xn&&(hi=Fn,Fn=xn,xn=hi),Ui.precision(Wi)):[[Wr,Fn],[Jr,xn]]},Ui.extentMinor=function(hi){return arguments.length?(mr=+hi[0][0],Yt=+hi[1][0],$a=+hi[0][1],xa=+hi[1][1],mr>Yt&&(hi=mr,mr=Yt,Yt=hi),$a>xa&&(hi=$a,$a=xa,xa=hi),Ui.precision(Wi)):[[mr,$a],[Yt,xa]]},Ui.step=function(hi){return arguments.length?Ui.stepMajor(hi).stepMinor(hi):Ui.stepMinor()},Ui.stepMajor=function(hi){return arguments.length?(wn=+hi[0],Sn=+hi[1],Ui):[wn,Sn]},Ui.stepMinor=function(hi){return arguments.length?(Gn=+hi[0],ai=+hi[1],Ui):[Gn,ai]},Ui.precision=function(hi){return arguments.length?(Wi=+hi,Ln=zn($a,xa,90),sn=_i(mr,Yt,Wi),di=zn(Fn,xn,90),Ni=_i(Wr,Jr,Wi),Ui):Wi},Ui.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Qo(){return xs()()}function Ii(Yt,mr){var Jr=Yt[0]*f,Wr=Yt[1]*f,xa=mr[0]*f,$a=mr[1]*f,xn=l(Wr),Fn=g(Wr),Gn=l($a),ai=g($a),wn=xn*l(Jr),Sn=xn*g(Jr),Ln=Gn*l(xa),sn=Gn*g(xa),di=2*m(v(R($a-Wr)+xn*Gn*R(xa-Jr))),Ni=g(di),Wi=di?function(Ui){var Ji=g(Ui*=di)/Ni,hi=g(di-Ui)/Ni,Qn=hi*wn+Ji*Ln,ao=hi*Sn+Ji*sn,Po=hi*Fn+Ji*ai;return[T(ao,Qn)*h,T(Po,v(Qn*Qn+ao*ao))*h]}:function(){return[Jr*h,Wr*h]};return Wi.distance=di,Wi}function gs(Yt){return Yt}var Zo=S(),Ss=S(),zs,ui,po,oo,vs={point:L,lineStart:L,lineEnd:L,polygonStart:function(){vs.lineStart=Nl,vs.lineEnd=Ws},polygonEnd:function(){vs.lineStart=vs.lineEnd=vs.point=L,Zo.add(p(Ss)),Ss.reset()},result:function(){var Yt=Zo/2;return Zo.reset(),Yt}};function Nl(){vs.point=Ki}function Ki(Yt,mr){vs.point=Ts,zs=po=Yt,ui=oo=mr}function Ts(Yt,mr){Ss.add(oo*Yt-po*mr),po=Yt,oo=mr}function Ws(){Ts(zs,ui)}var as=1/0,bs=as,Go=-as,ns=Go,fl={point:Rl,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var Yt=[[as,bs],[Go,ns]];return Go=ns=-(bs=as=1/0),Yt}};function Rl(Yt,mr){YtGo&&(Go=Yt),mrns&&(ns=mr)}var Vu=0,Ul=0,Ic=0,rc=0,ys=0,Du=0,oc=0,Dl=0,il=0,Au,ou,Fs,Xs,es={point:Ms,lineStart:Su,lineEnd:qs,polygonStart:function(){es.lineStart=wf,es.lineEnd=Vo},polygonEnd:function(){es.point=Ms,es.lineStart=Su,es.lineEnd=qs},result:function(){var Yt=il?[oc/il,Dl/il]:Du?[rc/Du,ys/Du]:Ic?[Vu/Ic,Ul/Ic]:[NaN,NaN];return Vu=Ul=Ic=rc=ys=Du=oc=Dl=il=0,Yt}};function Ms(Yt,mr){Vu+=Yt,Ul+=mr,++Ic}function Su(){es.point=hl}function hl(Yt,mr){es.point=cu,Ms(Fs=Yt,Xs=mr)}function cu(Yt,mr){var Jr=Yt-Fs,Wr=mr-Xs,xa=v(Jr*Jr+Wr*Wr);rc+=xa*(Fs+Yt)/2,ys+=xa*(Xs+mr)/2,Du+=xa,Ms(Fs=Yt,Xs=mr)}function qs(){es.point=Ms}function wf(){es.point=Tf}function Vo(){ss(Au,ou)}function Tf(Yt,mr){es.point=ss,Ms(Au=Fs=Yt,ou=Xs=mr)}function ss(Yt,mr){var Jr=Yt-Fs,Wr=mr-Xs,xa=v(Jr*Jr+Wr*Wr);rc+=xa*(Fs+Yt)/2,ys+=xa*(Xs+mr)/2,Du+=xa,xa=Xs*Yt-Fs*mr,oc+=xa*(Fs+Yt),Dl+=xa*(Xs+mr),il+=xa*3,Ms(Fs=Yt,Xs=mr)}function Vi(Yt){this._context=Yt}Vi.prototype={_radius:4.5,pointRadius:function(Yt){return this._radius=Yt,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(Yt,mr){switch(this._point){case 0:{this._context.moveTo(Yt,mr),this._point=1;break}case 1:{this._context.lineTo(Yt,mr);break}default:{this._context.moveTo(Yt+this._radius,mr),this._context.arc(Yt,mr,this._radius,0,s);break}}},result:L};var sc=S(),fu,vl,Rc,qu,yc,Al={point:L,lineStart:function(){Al.point=$c},lineEnd:function(){fu&&Nc(vl,Rc),Al.point=L},polygonStart:function(){fu=!0},polygonEnd:function(){fu=null},result:function(){var Yt=+sc;return sc.reset(),Yt}};function $c(Yt,mr){Al.point=Nc,vl=qu=Yt,Rc=yc=mr}function Nc(Yt,mr){qu-=Yt,yc-=mr,sc.add(v(qu*qu+yc*yc)),qu=Yt,yc=mr}function _c(){this._string=[]}_c.prototype={_radius:4.5,_circle:ac(4.5),pointRadius:function(Yt){return(Yt=+Yt)!==this._radius&&(this._radius=Yt,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(Yt,mr){switch(this._point){case 0:{this._string.push("M",Yt,",",mr),this._point=1;break}case 1:{this._string.push("L",Yt,",",mr);break}default:{this._circle==null&&(this._circle=ac(this._radius)),this._string.push("M",Yt,",",mr,this._circle);break}}},result:function(){if(this._string.length){var Yt=this._string.join("");return this._string=[],Yt}else return null}};function ac(Yt){return"m0,"+Yt+"a"+Yt+","+Yt+" 0 1,1 0,"+-2*Yt+"a"+Yt+","+Yt+" 0 1,1 0,"+2*Yt+"z"}function Uc(Yt,mr){var Jr=4.5,Wr,xa;function $a(xn){return xn&&(typeof Jr=="function"&&xa.pointRadius(+Jr.apply(this,arguments)),U(xn,Wr(xa))),xa.result()}return $a.area=function(xn){return U(xn,Wr(vs)),vs.result()},$a.measure=function(xn){return U(xn,Wr(Al)),Al.result()},$a.bounds=function(xn){return U(xn,Wr(fl)),fl.result()},$a.centroid=function(xn){return U(xn,Wr(es)),es.result()},$a.projection=function(xn){return arguments.length?(Wr=xn==null?(Yt=null,gs):(Yt=xn).stream,$a):Yt},$a.context=function(xn){return arguments.length?(xa=xn==null?(mr=null,new _c):new Vi(mr=xn),typeof Jr!="function"&&xa.pointRadius(Jr),$a):mr},$a.pointRadius=function(xn){return arguments.length?(Jr=typeof xn=="function"?xn:(xa.pointRadius(+xn),+xn),$a):Jr},$a.projection(Yt).context(mr)}function jc(Yt){return{stream:hu(Yt)}}function hu(Yt){return function(mr){var Jr=new Dc;for(var Wr in Yt)Jr[Wr]=Yt[Wr];return Jr.stream=mr,Jr}}function Dc(){}Dc.prototype={constructor:Dc,point:function(Yt,mr){this.stream.point(Yt,mr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Mu(Yt,mr,Jr){var Wr=Yt.clipExtent&&Yt.clipExtent();return Yt.scale(150).translate([0,0]),Wr!=null&&Yt.clipExtent(null),U(Jr,Yt.stream(fl)),mr(fl.result()),Wr!=null&&Yt.clipExtent(Wr),Yt}function lc(Yt,mr,Jr){return Mu(Yt,function(Wr){var xa=mr[1][0]-mr[0][0],$a=mr[1][1]-mr[0][1],xn=Math.min(xa/(Wr[1][0]-Wr[0][0]),$a/(Wr[1][1]-Wr[0][1])),Fn=+mr[0][0]+(xa-xn*(Wr[1][0]+Wr[0][0]))/2,Gn=+mr[0][1]+($a-xn*(Wr[1][1]+Wr[0][1]))/2;Yt.scale(150*xn).translate([Fn,Gn])},Jr)}function Sl(Yt,mr,Jr){return lc(Yt,[[0,0],mr],Jr)}function nc(Yt,mr,Jr){return Mu(Yt,function(Wr){var xa=+mr,$a=xa/(Wr[1][0]-Wr[0][0]),xn=(xa-$a*(Wr[1][0]+Wr[0][0]))/2,Fn=-$a*Wr[0][1];Yt.scale(150*$a).translate([xn,Fn])},Jr)}function Gu(Yt,mr,Jr){return Mu(Yt,function(Wr){var xa=+mr,$a=xa/(Wr[1][1]-Wr[0][1]),xn=-$a*Wr[0][0],Fn=(xa-$a*(Wr[1][1]+Wr[0][1]))/2;Yt.scale(150*$a).translate([xn,Fn])},Jr)}var Es=16,zc=l(30*f);function ff(Yt,mr){return+mr?uc(Yt,mr):Vc(Yt)}function Vc(Yt){return hu({point:function(mr,Jr){mr=Yt(mr,Jr),this.stream.point(mr[0],mr[1])}})}function uc(Yt,mr){function Jr(Wr,xa,$a,xn,Fn,Gn,ai,wn,Sn,Ln,sn,di,Ni,Wi){var Ui=ai-Wr,Ji=wn-xa,hi=Ui*Ui+Ji*Ji;if(hi>4*mr&&Ni--){var Qn=xn+Ln,ao=Fn+sn,Po=Gn+di,is=v(Qn*Qn+ao*ao+Po*Po),Rs=m(Po/=is),_s=p(p(Po)-1)mr||p((Ui*Ys+Ji*Ns)/hi-.5)>.3||xn*Ln+Fn*sn+Gn*di2?ki[2]%360*f:0,Ys()):[Fn*h,Gn*h,ai*h]},ts.angle=function(ki){return arguments.length?(Sn=ki%360*f,Ys()):Sn*h},ts.reflectX=function(ki){return arguments.length?(Ln=ki?-1:1,Ys()):Ln<0},ts.reflectY=function(ki){return arguments.length?(sn=ki?-1:1,Ys()):sn<0},ts.precision=function(ki){return arguments.length?(Po=ff(is,ao=ki*ki),Ns()):v(ao)},ts.fitExtent=function(ki,go){return lc(ts,ki,go)},ts.fitSize=function(ki,go){return Sl(ts,ki,go)},ts.fitWidth=function(ki,go){return nc(ts,ki,go)},ts.fitHeight=function(ki,go){return Gu(ts,ki,go)};function Ys(){var ki=Zs(Jr,0,0,Ln,sn,Sn).apply(null,mr($a,xn)),go=(Sn?Zs:qc)(Jr,Wr-ki[0],xa-ki[1],Ln,sn,Sn);return wn=La(Fn,Gn,ai),is=Kr(mr,go),Rs=Kr(wn,is),Po=ff(is,ao),Ns()}function Ns(){return _s=Ps=null,ts}return function(){return mr=Yt.apply(this,arguments),ts.invert=mr.invert&&ul,Ys()}}function Os(Yt){var mr=0,Jr=a/3,Wr=Hu(Yt),xa=Wr(mr,Jr);return xa.parallels=function($a){return arguments.length?Wr(mr=$a[0]*f,Jr=$a[1]*f):[mr*h,Jr*h]},xa}function zu(Yt){var mr=l(Yt);function Jr(Wr,xa){return[Wr*mr,g(xa)/mr]}return Jr.invert=function(Wr,xa){return[Wr/mr,m(xa*mr)]},Jr}function ql(Yt,mr){var Jr=g(Yt),Wr=(Jr+g(mr))/2;if(p(Wr)=.12&&Wi<.234&&Ni>=-.425&&Ni<-.214?xa:Wi>=.166&&Wi<.234&&Ni>=-.214&&Ni<-.115?xn:Jr).invert(Ln)},wn.stream=function(Ln){return Yt&&mr===Ln?Yt:Yt=Gc([Jr.stream(mr=Ln),xa.stream(Ln),xn.stream(Ln)])},wn.precision=function(Ln){return arguments.length?(Jr.precision(Ln),xa.precision(Ln),xn.precision(Ln),Sn()):Jr.precision()},wn.scale=function(Ln){return arguments.length?(Jr.scale(Ln),xa.scale(Ln*.35),xn.scale(Ln),wn.translate(Jr.translate())):Jr.scale()},wn.translate=function(Ln){if(!arguments.length)return Jr.translate();var sn=Jr.scale(),di=+Ln[0],Ni=+Ln[1];return Wr=Jr.translate(Ln).clipExtent([[di-.455*sn,Ni-.238*sn],[di+.455*sn,Ni+.238*sn]]).stream(ai),$a=xa.translate([di-.307*sn,Ni+.201*sn]).clipExtent([[di-.425*sn+r,Ni+.12*sn+r],[di-.214*sn-r,Ni+.234*sn-r]]).stream(ai),Fn=xn.translate([di-.205*sn,Ni+.212*sn]).clipExtent([[di-.214*sn+r,Ni+.166*sn+r],[di-.115*sn-r,Ni+.234*sn-r]]).stream(ai),Sn()},wn.fitExtent=function(Ln,sn){return lc(wn,Ln,sn)},wn.fitSize=function(Ln,sn){return Sl(wn,Ln,sn)},wn.fitWidth=function(Ln,sn){return nc(wn,Ln,sn)},wn.fitHeight=function(Ln,sn){return Gu(wn,Ln,sn)};function Sn(){return Yt=mr=null,wn}return wn.scale(1070)}function su(Yt){return function(mr,Jr){var Wr=l(mr),xa=l(Jr),$a=Yt(Wr*xa);return[$a*xa*g(mr),$a*g(Jr)]}}function Wu(Yt){return function(mr,Jr){var Wr=v(mr*mr+Jr*Jr),xa=Yt(Wr),$a=g(xa),xn=l(xa);return[T(mr*$a,Wr*xn),m(Wr&&Jr*$a/Wr)]}}var Fu=su(function(Yt){return v(2/(1+Yt))});Fu.invert=Wu(function(Yt){return 2*m(Yt/2)});function kf(){return Ql(Fu).scale(124.75).clipAngle(180-.001)}var xc=su(function(Yt){return(Yt=y(Yt))&&Yt/g(Yt)});xc.invert=Wu(function(Yt){return Yt});function Mc(){return Ql(xc).scale(79.4188).clipAngle(180-.001)}function lu(Yt,mr){return[Yt,A(u((i+mr)/2))]}lu.invert=function(Yt,mr){return[Yt,2*c(w(mr))-i]};function bc(){return Ll(lu).scale(961/s)}function Ll(Yt){var mr=Ql(Yt),Jr=mr.center,Wr=mr.scale,xa=mr.translate,$a=mr.clipExtent,xn=null,Fn,Gn,ai;mr.scale=function(Sn){return arguments.length?(Wr(Sn),wn()):Wr()},mr.translate=function(Sn){return arguments.length?(xa(Sn),wn()):xa()},mr.center=function(Sn){return arguments.length?(Jr(Sn),wn()):Jr()},mr.clipExtent=function(Sn){return arguments.length?(Sn==null?xn=Fn=Gn=ai=null:(xn=+Sn[0][0],Fn=+Sn[0][1],Gn=+Sn[1][0],ai=+Sn[1][1]),wn()):xn==null?null:[[xn,Fn],[Gn,ai]]};function wn(){var Sn=a*Wr(),Ln=mr(an(mr.rotate()).invert([0,0]));return $a(xn==null?[[Ln[0]-Sn,Ln[1]-Sn],[Ln[0]+Sn,Ln[1]+Sn]]:Yt===lu?[[Math.max(Ln[0]-Sn,xn),Fn],[Math.min(Ln[0]+Sn,Gn),ai]]:[[xn,Math.max(Ln[1]-Sn,Fn)],[Gn,Math.min(Ln[1]+Sn,ai)]])}return wn()}function cc(Yt){return u((i+Yt)/2)}function hf(Yt,mr){var Jr=l(Yt),Wr=Yt===mr?g(Yt):A(Jr/l(mr))/A(cc(mr)/cc(Yt)),xa=Jr*M(cc(Yt),Wr)/Wr;if(!Wr)return lu;function $a(xn,Fn){xa>0?Fn<-i+r&&(Fn=-i+r):Fn>i-r&&(Fn=i-r);var Gn=xa/M(cc(Fn),Wr);return[Gn*g(Wr*xn),xa-Gn*l(Wr*xn)]}return $a.invert=function(xn,Fn){var Gn=xa-Fn,ai=b(Wr)*v(xn*xn+Gn*Gn),wn=T(xn,p(Gn))*b(Gn);return Gn*Wr<0&&(wn-=a*b(xn)*b(Gn)),[wn/Wr,2*c(M(xa/ai,1/Wr))-i]},$a}function Ec(){return Os(hf).scale(109.5).parallels([30,30])}function Bs(Yt,mr){return[Yt,mr]}Bs.invert=Bs;function Gl(){return Ql(Bs).scale(152.63)}function eu(Yt,mr){var Jr=l(Yt),Wr=Yt===mr?g(Yt):(Jr-l(mr))/(mr-Yt),xa=Jr/Wr+Yt;if(p(Wr)r&&--Wr>0);return[Yt/(.8707+($a=Jr*Jr)*(-.131979+$a*(-.013791+$a*$a*$a*(.003971-.001529*$a)))),Jr]};function Ou(){return Ql(Zu).scale(175.295)}function dl(Yt,mr){return[l(mr)*g(Yt),g(mr)]}dl.invert=Wu(m);function Hl(){return Ql(dl).scale(249.5).clipAngle(90+r)}function Yu(Yt,mr){var Jr=l(mr),Wr=1+l(Yt)*Jr;return[Jr*g(Yt)/Wr,g(mr)/Wr]}Yu.invert=Wu(function(Yt){return 2*c(Yt)});function hc(){return Ql(Yu).scale(250).clipAngle(142)}function Eu(Yt,mr){return[A(u((i+mr)/2)),-Yt]}Eu.invert=function(Yt,mr){return[-mr,2*c(w(Yt))-i]};function Ku(){var Yt=Ll(Eu),mr=Yt.center,Jr=Yt.rotate;return Yt.center=function(Wr){return arguments.length?mr([-Wr[1],Wr[0]]):(Wr=mr(),[Wr[1],-Wr[0]])},Yt.rotate=function(Wr){return arguments.length?Jr([Wr[0],Wr[1],Wr.length>2?Wr[2]+90:90]):(Wr=Jr(),[Wr[0],Wr[1],Wr[2]-90])},Jr([0,0,90]).scale(159.155)}d.geoAlbers=rl,d.geoAlbersUsa=ef,d.geoArea=j,d.geoAzimuthalEqualArea=kf,d.geoAzimuthalEqualAreaRaw=Fu,d.geoAzimuthalEquidistant=Mc,d.geoAzimuthalEquidistantRaw=xc,d.geoBounds=ze,d.geoCentroid=Pr,d.geoCircle=Wn,d.geoClipAntimeridian=fr,d.geoClipCircle=ua,d.geoClipExtent=jn,d.geoClipRectangle=_n,d.geoConicConformal=Ec,d.geoConicConformalRaw=hf,d.geoConicEqualArea=Xl,d.geoConicEqualAreaRaw=ql,d.geoConicEquidistant=Fc,d.geoConicEquidistantRaw=eu,d.geoContains=ko,d.geoDistance=No,d.geoEqualEarth=Oc,d.geoEqualEarthRaw=fc,d.geoEquirectangular=Gl,d.geoEquirectangularRaw=Bs,d.geoGnomonic=Hc,d.geoGnomonicRaw=Pl,d.geoGraticule=xs,d.geoGraticule10=Qo,d.geoIdentity=pu,d.geoInterpolate=Ii,d.geoLength=lo,d.geoMercator=bc,d.geoMercatorRaw=lu,d.geoNaturalEarth1=Ou,d.geoNaturalEarth1Raw=Zu,d.geoOrthographic=Hl,d.geoOrthographicRaw=dl,d.geoPath=Uc,d.geoProjection=Ql,d.geoProjectionMutator=Hu,d.geoRotation=an,d.geoStereographic=hc,d.geoStereographicRaw=Yu,d.geoStream=U,d.geoTransform=jc,d.geoTransverseMercator=Ku,d.geoTransverseMercatorRaw=Eu,Object.defineProperty(d,"__esModule",{value:!0})})}}),PL=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,O3(),Fg()):x(d.d3=d.d3||{},d.d3,d.d3)})(Z,function(d,x,S){"use strict";var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,h=Math.pow,f=Math.round,p=Math.sign||function(je){return je>0?1:je<0?-1:0},c=Math.sin,T=Math.tan,l=1e-6,_=1e-12,w=Math.PI,A=w/2,M=w/4,g=Math.SQRT1_2,b=F(2),v=F(w),u=w*2,y=180/w,m=w/180;function R(je){return je?je/Math.sin(je):1}function L(je){return je>1?A:je<-1?-A:Math.asin(je)}function z(je){return je>1?0:je<-1?w:Math.acos(je)}function F(je){return je>0?Math.sqrt(je):0}function N(je){return je=o(2*je),(je-1)/(je+1)}function O(je){return(o(je)-o(-je))/2}function P(je){return(o(je)+o(-je))/2}function U(je){return i(je+F(je*je+1))}function B(je){return i(je+F(je*je-1))}function X(je){var Ye=T(je/2),at=2*i(r(je/2))/(Ye*Ye);function ct(At,yt){var Ct=r(At),nr=r(yt),vr=c(yt),Tr=nr*Ct,Fr=-((1-Tr?i((1+Tr)/2)/(1-Tr):-.5)+at/(1+Tr));return[Fr*nr*c(At),Fr*vr]}return ct.invert=function(At,yt){var Ct=F(At*At+yt*yt),nr=-je/2,vr=50,Tr;if(!Ct)return[0,0];do{var Fr=nr/2,Xr=r(Fr),oa=c(Fr),ga=oa/Xr,Ma=-i(E(Xr));nr-=Tr=(2/ga*Ma-at*ga-Ct)/(-Ma/(oa*oa)+1-at/(2*Xr*Xr))*(Xr<0?.7:1)}while(E(Tr)>l&&--vr>0);var en=c(nr);return[t(At*en,Ct*r(nr)),L(yt*en/Ct)]},ct}function $(){var je=A,Ye=x.geoProjectionMutator(X),at=Ye(je);return at.radius=function(ct){return arguments.length?Ye(je=ct*m):je*y},at.scale(179.976).clipAngle(147)}function le(je,Ye){var at=r(Ye),ct=R(z(at*r(je/=2)));return[2*at*c(je)*ct,c(Ye)*ct]}le.invert=function(je,Ye){if(!(je*je+4*Ye*Ye>w*w+l)){var at=je,ct=Ye,At=25;do{var yt=c(at),Ct=c(at/2),nr=r(at/2),vr=c(ct),Tr=r(ct),Fr=c(2*ct),Xr=vr*vr,oa=Tr*Tr,ga=Ct*Ct,Ma=1-oa*nr*nr,en=Ma?z(Tr*nr)*F(Dn=1/Ma):Dn=0,Dn,In=2*en*Tr*Ct-je,Kn=en*vr-Ye,vi=Dn*(oa*ga+en*Tr*nr*Xr),zi=Dn*(.5*yt*Fr-en*2*vr*Ct),Mi=Dn*.25*(Fr*Ct-en*vr*oa*yt),so=Dn*(Xr*nr+en*ga*Tr),jo=zi*Mi-so*vi;if(!jo)break;var uo=(Kn*zi-In*so)/jo,Co=(In*Mi-Kn*vi)/jo;at-=uo,ct-=Co}while((E(uo)>l||E(Co)>l)&&--At>0);return[at,ct]}};function ce(){return x.geoProjection(le).scale(152.63)}function ve(je){var Ye=c(je),at=r(je),ct=je>=0?1:-1,At=T(ct*je),yt=(1+Ye-at)/2;function Ct(nr,vr){var Tr=r(vr),Fr=r(nr/=2);return[(1+Tr)*c(nr),(ct*vr>-t(Fr,At)-.001?0:-ct*10)+yt+c(vr)*at-(1+Tr)*Ye*Fr]}return Ct.invert=function(nr,vr){var Tr=0,Fr=0,Xr=50;do{var oa=r(Tr),ga=c(Tr),Ma=r(Fr),en=c(Fr),Dn=1+Ma,In=Dn*ga-nr,Kn=yt+en*at-Dn*Ye*oa-vr,vi=Dn*oa/2,zi=-ga*en,Mi=Ye*Dn*ga/2,so=at*Ma+Ye*oa*en,jo=zi*Mi-so*vi,uo=(Kn*zi-In*so)/jo/2,Co=(In*Mi-Kn*vi)/jo;E(Co)>2&&(Co/=2),Tr-=uo,Fr-=Co}while((E(uo)>l||E(Co)>l)&&--Xr>0);return ct*Fr>-t(r(Tr),At)-.001?[Tr*2,Fr]:null},Ct}function G(){var je=20*m,Ye=je>=0?1:-1,at=T(Ye*je),ct=x.geoProjectionMutator(ve),At=ct(je),yt=At.stream;return At.parallel=function(Ct){return arguments.length?(at=T((Ye=(je=Ct*m)>=0?1:-1)*je),ct(je)):je*y},At.stream=function(Ct){var nr=At.rotate(),vr=yt(Ct),Tr=(At.rotate([0,0]),yt(Ct)),Fr=At.precision();return At.rotate(nr),vr.sphere=function(){Tr.polygonStart(),Tr.lineStart();for(var Xr=Ye*-180;Ye*Xr<180;Xr+=Ye*90)Tr.point(Xr,Ye*90);if(je)for(;Ye*(Xr-=3*Ye*Fr)>=-180;)Tr.point(Xr,Ye*-t(r(Xr*m/2),at)*y);Tr.lineEnd(),Tr.polygonEnd()},vr},At.scale(218.695).center([0,28.0974])}function Y(je,Ye){var at=T(Ye/2),ct=F(1-at*at),At=1+ct*r(je/=2),yt=c(je)*ct/At,Ct=at/At,nr=yt*yt,vr=Ct*Ct;return[4/3*yt*(3+nr-3*vr),4/3*Ct*(3+3*nr-vr)]}Y.invert=function(je,Ye){if(je*=3/8,Ye*=3/8,!je&&E(Ye)>1)return null;var at=je*je,ct=Ye*Ye,At=1+at+ct,yt=F((At-F(At*At-4*Ye*Ye))/2),Ct=L(yt)/3,nr=yt?B(E(Ye/yt))/3:U(E(je))/3,vr=r(Ct),Tr=P(nr),Fr=Tr*Tr-vr*vr;return[p(je)*2*t(O(nr)*vr,.25-Fr),p(Ye)*2*t(Tr*c(Ct),.25+Fr)]};function ee(){return x.geoProjection(Y).scale(66.1603)}var V=F(8),se=i(1+b);function ae(je,Ye){var at=E(Ye);return at_&&--ct>0);return[je/(r(at)*(V-1/c(at))),p(Ye)*at]};function j(){return x.geoProjection(ae).scale(112.314)}function Q(je){var Ye=2*w/je;function at(ct,At){var yt=x.geoAzimuthalEquidistantRaw(ct,At);if(E(ct)>A){var Ct=t(yt[1],yt[0]),nr=F(yt[0]*yt[0]+yt[1]*yt[1]),vr=Ye*f((Ct-A)/Ye)+A,Tr=t(c(Ct-=vr),2-r(Ct));Ct=vr+L(w/nr*c(Tr))-Tr,yt[0]=nr*r(Ct),yt[1]=nr*c(Ct)}return yt}return at.invert=function(ct,At){var yt=F(ct*ct+At*At);if(yt>A){var Ct=t(At,ct),nr=Ye*f((Ct-A)/Ye)+A,vr=Ct>nr?-1:1,Tr=yt*r(nr-Ct),Fr=1/T(vr*z((Tr-w)/F(w*(w-2*Tr)+yt*yt)));Ct=nr+2*e((Fr+vr*F(Fr*Fr-3))/3),ct=yt*r(Ct),At=yt*c(Ct)}return x.geoAzimuthalEquidistantRaw.invert(ct,At)},at}function re(){var je=5,Ye=x.geoProjectionMutator(Q),at=Ye(je),ct=at.stream,At=.01,yt=-r(At*m),Ct=c(At*m);return at.lobes=function(nr){return arguments.length?Ye(je=+nr):je},at.stream=function(nr){var vr=at.rotate(),Tr=ct(nr),Fr=(at.rotate([0,0]),ct(nr));return at.rotate(vr),Tr.sphere=function(){Fr.polygonStart(),Fr.lineStart();for(var Xr=0,oa=360/je,ga=2*w/je,Ma=90-180/je,en=A;Xr0&&E(At)>l);return ct<0?NaN:at}function Pe(je,Ye,at){return Ye===void 0&&(Ye=40),at===void 0&&(at=_),function(ct,At,yt,Ct){var nr,vr,Tr;yt=yt===void 0?0:+yt,Ct=Ct===void 0?0:+Ct;for(var Fr=0;Frnr){yt-=vr/=2,Ct-=Tr/=2;continue}nr=Ma;var en=(yt>0?-1:1)*at,Dn=(Ct>0?-1:1)*at,In=je(yt+en,Ct),Kn=je(yt,Ct+Dn),vi=(In[0]-Xr[0])/en,zi=(In[1]-Xr[1])/en,Mi=(Kn[0]-Xr[0])/Dn,so=(Kn[1]-Xr[1])/Dn,jo=so*vi-zi*Mi,uo=(E(jo)<.5?.5:1)/jo;if(vr=(ga*Mi-oa*so)*uo,Tr=(oa*zi-ga*vi)*uo,yt+=vr,Ct+=Tr,E(vr)0&&(nr[1]*=1+vr/1.5*nr[0]*nr[0]),nr}return ct.invert=Pe(ct),ct}function et(){return x.geoProjection(qe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function rt(je,Ye){var at=je*c(Ye),ct=30,At;do Ye-=At=(Ye+c(Ye)-at)/(1+r(Ye));while(E(At)>l&&--ct>0);return Ye/2}function $e(je,Ye,at){function ct(At,yt){return[je*At*r(yt=rt(at,yt)),Ye*c(yt)]}return ct.invert=function(At,yt){return yt=L(yt/Ye),[At/(je*r(yt)),L((2*yt+c(2*yt))/at)]},ct}var Ue=$e(b/A,b,w);function fe(){return x.geoProjection(Ue).scale(169.529)}var ue=2.00276,ie=1.11072;function Ee(je,Ye){var at=rt(w,Ye);return[ue*je/(1/r(Ye)+ie/r(at)),(Ye+b*c(at))/ue]}Ee.invert=function(je,Ye){var at=ue*Ye,ct=Ye<0?-M:M,At=25,yt,Ct;do Ct=at-b*c(ct),ct-=yt=(c(2*ct)+2*ct-w*c(Ct))/(2*r(2*ct)+2+w*r(Ct)*b*r(ct));while(E(yt)>l&&--At>0);return Ct=at-b*c(ct),[je*(1/r(Ct)+ie/r(ct))/ue,Ct]};function We(){return x.geoProjection(Ee).scale(160.857)}function Qe(je){var Ye=0,at=x.geoProjectionMutator(je),ct=at(Ye);return ct.parallel=function(At){return arguments.length?at(Ye=At*m):Ye*y},ct}function Xe(je,Ye){return[je*r(Ye),Ye]}Xe.invert=function(je,Ye){return[je/r(Ye),Ye]};function Tt(){return x.geoProjection(Xe).scale(152.63)}function St(je){if(!je)return Xe;var Ye=1/T(je);function at(ct,At){var yt=Ye+je-At,Ct=yt&&ct*r(At)/yt;return[yt*c(Ct),Ye-yt*r(Ct)]}return at.invert=function(ct,At){var yt=F(ct*ct+(At=Ye-At)*At),Ct=Ye+je-yt;return[yt/r(Ct)*t(ct,At),Ct]},at}function zt(){return Qe(St).scale(123.082).center([0,26.1441]).parallel(45)}function Ut(je){function Ye(at,ct){var At=A-ct,yt=At&&at*je*c(At)/At;return[At*c(yt)/je,A-At*r(yt)]}return Ye.invert=function(at,ct){var At=at*je,yt=A-ct,Ct=F(At*At+yt*yt),nr=t(At,yt);return[(Ct?Ct/c(Ct):1)*nr/je,A-Ct]},Ye}function br(){var je=.5,Ye=x.geoProjectionMutator(Ut),at=Ye(je);return at.fraction=function(ct){return arguments.length?Ye(je=+ct):je},at.scale(158.837)}var hr=$e(1,4/w,w);function Or(){return x.geoProjection(hr).scale(152.63)}function wr(je,Ye,at,ct,At,yt){var Ct=r(yt),nr;if(E(je)>1||E(yt)>1)nr=z(at*At+Ye*ct*Ct);else{var vr=c(je/2),Tr=c(yt/2);nr=2*L(F(vr*vr+Ye*ct*Tr*Tr))}return E(nr)>l?[nr,t(ct*c(yt),Ye*At-at*ct*Ct)]:[0,0]}function Er(je,Ye,at){return z((je*je+Ye*Ye-at*at)/(2*je*Ye))}function mt(je){return je-2*w*a((je+w)/(2*w))}function ze(je,Ye,at){for(var ct=[[je[0],je[1],c(je[1]),r(je[1])],[Ye[0],Ye[1],c(Ye[1]),r(Ye[1])],[at[0],at[1],c(at[1]),r(at[1])]],At=ct[2],yt,Ct=0;Ct<3;++Ct,At=yt)yt=ct[Ct],At.v=wr(yt[1]-At[1],At[3],At[2],yt[3],yt[2],yt[0]-At[0]),At.point=[0,0];var nr=Er(ct[0].v[0],ct[2].v[0],ct[1].v[0]),vr=Er(ct[0].v[0],ct[1].v[0],ct[2].v[0]),Tr=w-nr;ct[2].point[1]=0,ct[0].point[0]=-(ct[1].point[0]=ct[0].v[0]/2);var Fr=[ct[2].point[0]=ct[0].point[0]+ct[2].v[0]*r(nr),2*(ct[0].point[1]=ct[1].point[1]=ct[2].v[0]*c(nr))];function Xr(oa,ga){var Ma=c(ga),en=r(ga),Dn=new Array(3),In;for(In=0;In<3;++In){var Kn=ct[In];if(Dn[In]=wr(ga-Kn[1],Kn[3],Kn[2],en,Ma,oa-Kn[0]),!Dn[In][0])return Kn.point;Dn[In][1]=mt(Dn[In][1]-Kn.v[1])}var vi=Fr.slice();for(In=0;In<3;++In){var zi=In==2?0:In+1,Mi=Er(ct[In].v[0],Dn[In][0],Dn[zi][0]);Dn[In][1]<0&&(Mi=-Mi),In?In==1?(Mi=vr-Mi,vi[0]-=Dn[In][0]*r(Mi),vi[1]-=Dn[In][0]*c(Mi)):(Mi=Tr-Mi,vi[0]+=Dn[In][0]*r(Mi),vi[1]+=Dn[In][0]*c(Mi)):(vi[0]+=Dn[In][0]*r(Mi),vi[1]-=Dn[In][0]*c(Mi))}return vi[0]/=3,vi[1]/=3,vi}return Xr}function Ze(je){return je[0]*=m,je[1]*=m,je}function we(){return ke([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ke(je,Ye,at){var ct=x.geoCentroid({type:"MultiPoint",coordinates:[je,Ye,at]}),At=[-ct[0],-ct[1]],yt=x.geoRotation(At),Ct=ze(Ze(yt(je)),Ze(yt(Ye)),Ze(yt(at)));Ct.invert=Pe(Ct);var nr=x.geoProjection(Ct).rotate(At),vr=nr.center;return delete nr.rotate,nr.center=function(Tr){return arguments.length?vr(yt(Tr)):yt.invert(vr())},nr.clipAngle(90)}function Be(je,Ye){var at=F(1-c(Ye));return[2/v*je*at,v*(1-at)]}Be.invert=function(je,Ye){var at=(at=Ye/v-1)*at;return[at>0?je*F(w/at)/2:0,L(1-at)]};function He(){return x.geoProjection(Be).scale(95.6464).center([0,30])}function nt(je){var Ye=T(je);function at(ct,At){return[ct,(ct?ct/c(ct):1)*(c(At)*r(ct)-Ye*r(At))]}return at.invert=Ye?function(ct,At){ct&&(At*=c(ct)/ct);var yt=r(ct);return[ct,2*t(F(yt*yt+Ye*Ye-At*At)-yt,Ye-At)]}:function(ct,At){return[ct,L(ct?At*T(ct)/ct:At)]},at}function ot(){return Qe(nt).scale(249.828).clipAngle(90)}var Ft=F(3);function Mt(je,Ye){return[Ft*je*(2*r(2*Ye/3)-1)/v,Ft*v*c(Ye/3)]}Mt.invert=function(je,Ye){var at=3*L(Ye/(Ft*v));return[v*je/(Ft*(2*r(2*at/3)-1)),at]};function Et(){return x.geoProjection(Mt).scale(156.19)}function Ot(je){var Ye=r(je);function at(ct,At){return[ct*Ye,c(At)/Ye]}return at.invert=function(ct,At){return[ct/Ye,L(At*Ye)]},at}function sr(){return Qe(Ot).parallel(38.58).scale(195.044)}function ir(je){var Ye=r(je);function at(ct,At){return[ct*Ye,(1+Ye)*T(At/2)]}return at.invert=function(ct,At){return[ct/Ye,e(At/(1+Ye))*2]},at}function ar(){return Qe(ir).scale(124.75)}function Mr(je,Ye){var at=F(8/(3*w));return[at*je*(1-E(Ye)/w),at*Ye]}Mr.invert=function(je,Ye){var at=F(8/(3*w)),ct=Ye/at;return[je/(at*(1-E(ct)/w)),ct]};function ma(){return x.geoProjection(Mr).scale(165.664)}function Ca(je,Ye){var at=F(4-3*c(E(Ye)));return[2/F(6*w)*je*at,p(Ye)*F(2*w/3)*(2-at)]}Ca.invert=function(je,Ye){var at=2-E(Ye)/F(2*w/3);return[je*F(6*w)/(2*at),p(Ye)*L((4-at*at)/3)]};function Aa(){return x.geoProjection(Ca).scale(165.664)}function Da(je,Ye){var at=F(w*(4+w));return[2/at*je*(1+F(1-4*Ye*Ye/(w*w))),4/at*Ye]}Da.invert=function(je,Ye){var at=F(w*(4+w))/2;return[je*at/(1+F(1-Ye*Ye*(4+w)/(4*w))),Ye*at/2]};function Ba(){return x.geoProjection(Da).scale(180.739)}function ba(je,Ye){var at=(2+A)*c(Ye);Ye/=2;for(var ct=0,At=1/0;ct<10&&E(At)>l;ct++){var yt=r(Ye);Ye-=At=(Ye+c(Ye)*(yt+2)-at)/(2*yt*(1+yt))}return[2/F(w*(4+w))*je*(1+r(Ye)),2*F(w/(4+w))*c(Ye)]}ba.invert=function(je,Ye){var at=Ye*F((4+w)/w)/2,ct=L(at),At=r(ct);return[je/(2/F(w*(4+w))*(1+At)),L((ct+at*(At+2))/(2+A))]};function rn(){return x.geoProjection(ba).scale(180.739)}function vn(je,Ye){return[je*(1+r(Ye))/F(2+w),2*Ye/F(2+w)]}vn.invert=function(je,Ye){var at=F(2+w),ct=Ye*at/2;return[at*je/(1+r(ct)),ct]};function Wt(){return x.geoProjection(vn).scale(173.044)}function Lt(je,Ye){for(var at=(1+A)*c(Ye),ct=0,At=1/0;ct<10&&E(At)>l;ct++)Ye-=At=(Ye+c(Ye)-at)/(1+r(Ye));return at=F(2+w),[je*(1+r(Ye))/at,2*Ye/at]}Lt.invert=function(je,Ye){var at=1+A,ct=F(at/2);return[je*2*ct/(1+r(Ye*=ct)),L((Ye+c(Ye))/at)]};function Ht(){return x.geoProjection(Lt).scale(173.044)}var Xt=3+2*b;function Pr(je,Ye){var at=c(je/=2),ct=r(je),At=F(r(Ye)),yt=r(Ye/=2),Ct=c(Ye)/(yt+b*ct*At),nr=F(2/(1+Ct*Ct)),vr=F((b*yt+(ct+at)*At)/(b*yt+(ct-at)*At));return[Xt*(nr*(vr-1/vr)-2*i(vr)),Xt*(nr*Ct*(vr+1/vr)-2*e(Ct))]}Pr.invert=function(je,Ye){if(!(yt=Y.invert(je/1.2,Ye*1.065)))return null;var at=yt[0],ct=yt[1],At=20,yt;je/=Xt,Ye/=Xt;do{var Ct=at/2,nr=ct/2,vr=c(Ct),Tr=r(Ct),Fr=c(nr),Xr=r(nr),oa=r(ct),ga=F(oa),Ma=Fr/(Xr+b*Tr*ga),en=Ma*Ma,Dn=F(2/(1+en)),In=b*Xr+(Tr+vr)*ga,Kn=b*Xr+(Tr-vr)*ga,vi=In/Kn,zi=F(vi),Mi=zi-1/zi,so=zi+1/zi,jo=Dn*Mi-2*i(zi)-je,uo=Dn*Ma*so-2*e(Ma)-Ye,Co=Fr&&g*ga*vr*en/Fr,Xo=(b*Tr*Xr+ga)/(2*(Xr+b*Tr*ga)*(Xr+b*Tr*ga)*ga),Us=-.5*Ma*Dn*Dn*Dn,Is=Us*Co,Io=Us*Xo,Ro=(Ro=2*Xr+b*ga*(Tr-vr))*Ro*zi,ol=(b*Tr*Xr*ga+oa)/Ro,Ml=-(b*vr*Fr)/(ga*Ro),ru=Mi*Is-2*ol/zi+Dn*(ol+ol/vi),jl=Mi*Io-2*Ml/zi+Dn*(Ml+Ml/vi),Qs=Ma*so*Is-2*Co/(1+en)+Dn*so*Co+Dn*Ma*(ol-ol/vi),Fl=Ma*so*Io-2*Xo/(1+en)+Dn*so*Xo+Dn*Ma*(Ml-Ml/vi),Cu=jl*Qs-Fl*ru;if(!Cu)break;var pl=(uo*jl-jo*Fl)/Cu,ml=(jo*Qs-uo*ru)/Cu;at-=pl,ct=n(-A,s(A,ct-ml))}while((E(pl)>l||E(ml)>l)&&--At>0);return E(E(ct)-A)ct){var Xr=F(Fr),oa=t(Tr,vr),ga=at*f(oa/at),Ma=oa-ga,en=je*r(Ma),Dn=(je*c(Ma)-Ma*c(en))/(A-en),In=gt(Ma,Dn),Kn=(w-je)/it(In,en,w);vr=Xr;var vi=50,zi;do vr-=zi=(je+it(In,en,vr)*Kn-Xr)/(In(vr)*Kn);while(E(zi)>l&&--vi>0);Tr=Ma*c(vr),vrct){var vr=F(nr),Tr=t(Ct,yt),Fr=at*f(Tr/at),Xr=Tr-Fr;yt=vr*r(Xr),Ct=vr*c(Xr);for(var oa=yt-A,ga=c(yt),Ma=Ct/ga,en=ytl||E(Ma)>l)&&--en>0);return[Xr,oa]},vr}var pr=Ar(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function kr(){return x.geoProjection(pr).scale(149.995)}var zr=Ar(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Ur(){return x.geoProjection(zr).scale(153.93)}var dt=Ar(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function qt(){return x.geoProjection(dt).scale(130.945)}function fr(je,Ye){var at=je*je,ct=Ye*Ye;return[je*(1-.162388*ct)*(.87-952426e-9*at*at),Ye*(1+ct/12)]}fr.invert=function(je,Ye){var at=je,ct=Ye,At=50,yt;do{var Ct=ct*ct;ct-=yt=(ct*(1+Ct/12)-Ye)/(1+Ct/4)}while(E(yt)>l&&--At>0);At=50,je/=1-.162388*Ct;do{var nr=(nr=at*at)*nr;at-=yt=(at*(.87-952426e-9*nr)-je)/(.87-.00476213*nr)}while(E(yt)>l&&--At>0);return[at,ct]};function Ir(){return x.geoProjection(fr).scale(131.747)}var da=Ar(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Ta(){return x.geoProjection(da).scale(131.087)}function ua(je){var Ye=je(A,0)[0]-je(-A,0)[0];function at(ct,At){var yt=ct>0?-.5:.5,Ct=je(ct+yt*w,At);return Ct[0]-=yt*Ye,Ct}return je.invert&&(at.invert=function(ct,At){var yt=ct>0?-.5:.5,Ct=je.invert(ct+yt*Ye,At),nr=Ct[0]-yt*w;return nr<-w?nr+=2*w:nr>w&&(nr-=2*w),Ct[0]=nr,Ct}),at}function ra(je,Ye){var at=p(je),ct=p(Ye),At=r(Ye),yt=r(je)*At,Ct=c(je)*At,nr=c(ct*Ye);je=E(t(Ct,nr)),Ye=L(yt),E(je-A)>l&&(je%=A);var vr=ha(je>w/4?A-je:je,Ye);return je>w/4&&(nr=vr[0],vr[0]=-vr[1],vr[1]=-nr),vr[0]*=at,vr[1]*=-ct,vr}ra.invert=function(je,Ye){E(je)>1&&(je=p(je)*2-je),E(Ye)>1&&(Ye=p(Ye)*2-Ye);var at=p(je),ct=p(Ye),At=-at*je,yt=-ct*Ye,Ct=yt/At<1,nr=pn(Ct?yt:At,Ct?At:yt),vr=nr[0],Tr=nr[1],Fr=r(Tr);return Ct&&(vr=-A-vr),[at*(t(c(vr)*Fr,-c(Tr))+w),ct*L(r(vr)*Fr)]};function ha(je,Ye){if(Ye===A)return[0,0];var at=c(Ye),ct=at*at,At=ct*ct,yt=1+At,Ct=1+3*At,nr=1-At,vr=L(1/F(yt)),Tr=nr+ct*yt*vr,Fr=(1-at)/Tr,Xr=F(Fr),oa=Fr*yt,ga=F(oa),Ma=Xr*nr,en,Dn;if(je===0)return[0,-(Ma+ct*ga)];var In=r(Ye),Kn=1/In,vi=2*at*In,zi=(-3*ct+vr*Ct)*vi,Mi=(-Tr*In-(1-at)*zi)/(Tr*Tr),so=.5*Mi/Xr,jo=nr*so-2*ct*Xr*vi,uo=ct*yt*Mi+Fr*Ct*vi,Co=-Kn*vi,Xo=-Kn*uo,Us=-2*Kn*jo,Is=4*je/w,Io;if(je>.222*w||Ye.175*w){if(en=(Ma+ct*F(oa*(1+At)-Ma*Ma))/(1+At),je>w/4)return[en,en];var Ro=en,ol=.5*en;en=.5*(ol+Ro),Dn=50;do{var Ml=F(oa-en*en),ru=en*(Us+Co*Ml)+Xo*L(en/ga)-Is;if(!ru)break;ru<0?ol=en:Ro=en,en=.5*(ol+Ro)}while(E(Ro-ol)>l&&--Dn>0)}else{en=l,Dn=25;do{var jl=en*en,Qs=F(oa-jl),Fl=Us+Co*Qs,Cu=en*Fl+Xo*L(en/ga)-Is,pl=Fl+(Xo-Co*jl)/Qs;en-=Io=Qs?Cu/pl:0}while(E(Io)>l&&--Dn>0)}return[en,-Ma-ct*F(oa-en*en)]}function pn(je,Ye){for(var at=0,ct=1,At=.5,yt=50;;){var Ct=At*At,nr=F(At),vr=L(1/F(1+Ct)),Tr=1-Ct+At*(1+Ct)*vr,Fr=(1-nr)/Tr,Xr=F(Fr),oa=Fr*(1+Ct),ga=Xr*(1-Ct),Ma=oa-je*je,en=F(Ma),Dn=Ye+ga+At*en;if(E(ct-at)<_||--yt===0||Dn===0)break;Dn>0?at=At:ct=At,At=.5*(at+ct)}if(!yt)return null;var In=L(nr),Kn=r(In),vi=1/Kn,zi=2*nr*Kn,Mi=(-3*At+vr*(1+3*Ct))*zi,so=(-Tr*Kn-(1-nr)*Mi)/(Tr*Tr),jo=.5*so/Xr,uo=(1-Ct)*jo-2*At*Xr*zi,Co=-2*vi*uo,Xo=-vi*zi,Us=-vi*(At*(1+Ct)*so+Fr*(1+3*Ct)*zi);return[w/4*(je*(Co+Xo*en)+Us*L(je/F(oa))),In]}function _n(){return x.geoProjection(ua(ra)).scale(239.75)}function jn(je,Ye,at){var ct,At,yt;return je?(ct=li(je,at),Ye?(At=li(Ye,1-at),yt=At[1]*At[1]+at*ct[0]*ct[0]*At[0]*At[0],[[ct[0]*At[2]/yt,ct[1]*ct[2]*At[0]*At[1]/yt],[ct[1]*At[1]/yt,-ct[0]*ct[2]*At[0]*At[2]/yt],[ct[2]*At[1]*At[2]/yt,-at*ct[0]*ct[1]*At[0]/yt]]):[[ct[0],0],[ct[1],0],[ct[2],0]]):(At=li(Ye,1-at),[[0,At[0]/At[1]],[1/At[1],0],[At[2]/At[1],0]])}function li(je,Ye){var at,ct,At,yt,Ct;if(Ye=1-l)return at=(1-Ye)/4,ct=P(je),yt=N(je),At=1/ct,Ct=ct*O(je),[yt+at*(Ct-je)/(ct*ct),At-at*yt*At*(Ct-je),At+at*yt*At*(Ct+je),2*e(o(je))-A+at*(Ct-je)/ct];var nr=[1,0,0,0,0,0,0,0,0],vr=[F(Ye),0,0,0,0,0,0,0,0],Tr=0;for(ct=F(1-Ye),Ct=1;E(vr[Tr]/nr[Tr])>l&&Tr<8;)at=nr[Tr++],vr[Tr]=(at-ct)/2,nr[Tr]=(at+ct)/2,ct=F(at*ct),Ct*=2;At=Ct*nr[Tr]*je;do yt=vr[Tr]*c(ct=At)/nr[Tr],At=(L(yt)+At)/2;while(--Tr);return[c(At),yt=r(At),yt/r(At-ct),At]}function yi(je,Ye,at){var ct=E(je),At=E(Ye),yt=O(At);if(ct){var Ct=1/c(ct),nr=1/(T(ct)*T(ct)),vr=-(nr+at*(yt*yt*Ct*Ct)-1+at),Tr=(at-1)*nr,Fr=(-vr+F(vr*vr-4*Tr))/2;return[gi(e(1/F(Fr)),at)*p(je),gi(e(F((Fr/nr-1)/at)),1-at)*p(Ye)]}return[0,gi(e(yt),1-at)*p(Ye)]}function gi(je,Ye){if(!Ye)return je;if(Ye===1)return i(T(je/2+M));for(var at=1,ct=F(1-Ye),At=F(Ye),yt=0;E(At)>l;yt++){if(je%w){var Ct=e(ct*T(je)/at);Ct<0&&(Ct+=w),je+=Ct+~~(je/w)*w}else je+=je;At=(at+ct)/2,ct=F(at*ct),At=((at=At)-ct)/2}return je/(h(2,yt)*at)}function Si(je,Ye){var at=(b-1)/(b+1),ct=F(1-at*at),At=gi(A,ct*ct),yt=-1,Ct=i(T(w/4+E(Ye)/2)),nr=o(yt*Ct)/F(at),vr=Gi(nr*r(yt*je),nr*c(yt*je)),Tr=yi(vr[0],vr[1],ct*ct);return[-Tr[1],(Ye>=0?1:-1)*(.5*At-Tr[0])]}function Gi(je,Ye){var at=je*je,ct=Ye+1,At=1-at-Ye*Ye;return[.5*((je>=0?A:-A)-t(At,2*je)),-.25*i(At*At+4*at)+.5*i(ct*ct+at)]}function io(je,Ye){var at=Ye[0]*Ye[0]+Ye[1]*Ye[1];return[(je[0]*Ye[0]+je[1]*Ye[1])/at,(je[1]*Ye[0]-je[0]*Ye[1])/at]}Si.invert=function(je,Ye){var at=(b-1)/(b+1),ct=F(1-at*at),At=gi(A,ct*ct),yt=-1,Ct=jn(.5*At-Ye,-je,ct*ct),nr=io(Ct[0],Ct[1]),vr=t(nr[1],nr[0])/yt;return[vr,2*e(o(.5/yt*i(at*nr[0]*nr[0]+at*nr[1]*nr[1])))-A]};function vo(){return x.geoProjection(ua(Si)).scale(151.496)}function ms(je){var Ye=c(je),at=r(je),ct=pi(je);ct.invert=pi(-je);function At(yt,Ct){var nr=ct(yt,Ct);yt=nr[0],Ct=nr[1];var vr=c(Ct),Tr=r(Ct),Fr=r(yt),Xr=z(Ye*vr+at*Tr*Fr),oa=c(Xr),ga=E(oa)>l?Xr/oa:1;return[ga*at*c(yt),(E(yt)>A?ga:-ga)*(Ye*Tr-at*vr*Fr)]}return At.invert=function(yt,Ct){var nr=F(yt*yt+Ct*Ct),vr=-c(nr),Tr=r(nr),Fr=nr*Tr,Xr=-Ct*vr,oa=nr*Ye,ga=F(Fr*Fr+Xr*Xr-oa*oa),Ma=t(Fr*oa+Xr*ga,Xr*oa-Fr*ga),en=(nr>A?-1:1)*t(yt*vr,nr*r(Ma)*Tr+Ct*c(Ma)*vr);return ct.invert(en,Ma)},At}function pi(je){var Ye=c(je),at=r(je);return function(ct,At){var yt=r(At),Ct=r(ct)*yt,nr=c(ct)*yt,vr=c(At);return[t(nr,Ct*at-vr*Ye),L(vr*at+Ct*Ye)]}}function lo(){var je=0,Ye=x.geoProjectionMutator(ms),at=Ye(je),ct=at.rotate,At=at.stream,yt=x.geoCircle();return at.parallel=function(Ct){if(!arguments.length)return je*y;var nr=at.rotate();return Ye(je=Ct*m).rotate(nr)},at.rotate=function(Ct){return arguments.length?(ct.call(at,[Ct[0],Ct[1]-je*y]),yt.center([-Ct[0],-Ct[1]]),at):(Ct=ct.call(at),Ct[1]+=je*y,Ct)},at.stream=function(Ct){return Ct=At(Ct),Ct.sphere=function(){Ct.polygonStart();var nr=.01,vr=yt.radius(90-nr)().coordinates[0],Tr=vr.length-1,Fr=-1,Xr;for(Ct.lineStart();++Fr=0;)Ct.point((Xr=vr[Fr])[0],Xr[1]);Ct.lineEnd(),Ct.polygonEnd()},Ct},at.scale(79.4187).parallel(45).clipAngle(180-.001)}var Ai=3,Fo=L(1-1/Ai)*y,No=Ot(0);function $o(je){var Ye=Fo*m,at=Be(w,Ye)[0]-Be(-w,Ye)[0],ct=No(0,Ye)[1],At=Be(0,Ye)[1],yt=v-At,Ct=u/je,nr=4/u,vr=ct+yt*yt*4/u;function Tr(Fr,Xr){var oa,ga=E(Xr);if(ga>Ye){var Ma=s(je-1,n(0,a((Fr+w)/Ct)));Fr+=w*(je-1)/je-Ma*Ct,oa=Be(Fr,ga),oa[0]=oa[0]*u/at-u*(je-1)/(2*je)+Ma*u/je,oa[1]=ct+(oa[1]-At)*4*yt/u,Xr<0&&(oa[1]=-oa[1])}else oa=No(Fr,Xr);return oa[0]*=nr,oa[1]/=vr,oa}return Tr.invert=function(Fr,Xr){Fr/=nr,Xr*=vr;var oa=E(Xr);if(oa>ct){var ga=s(je-1,n(0,a((Fr+w)/Ct)));Fr=(Fr+w*(je-1)/je-ga*Ct)*at/u;var Ma=Be.invert(Fr,.25*(oa-ct)*u/yt+At);return Ma[0]-=w*(je-1)/je-ga*Ct,Xr<0&&(Ma[1]=-Ma[1]),Ma}return No.invert(Fr,Xr)},Tr}function bo(je,Ye){return[je,Ye&1?90-l:Fo]}function Hi(je,Ye){return[je,Ye&1?-90+l:-Fo]}function Pi(je){return[je[0]*(1-l),je[1]]}function ji(je){var Ye=[].concat(S.range(-180,180+je/2,je).map(bo),S.range(180,-180-je/2,-je).map(Hi));return{type:"Polygon",coordinates:[je===180?Ye.map(Pi):Ye]}}function Uo(){var je=4,Ye=x.geoProjectionMutator($o),at=Ye(je),ct=at.stream;return at.lobes=function(At){return arguments.length?Ye(je=+At):je},at.stream=function(At){var yt=at.rotate(),Ct=ct(At),nr=(at.rotate([0,0]),ct(At));return at.rotate(yt),Ct.sphere=function(){x.geoStream(ji(180/je),nr)},Ct},at.scale(239.75)}function Ko(je){var Ye=1+je,at=c(1/Ye),ct=L(at),At=2*F(w/(yt=w+4*ct*Ye)),yt,Ct=.5*At*(Ye+F(je*(2+je))),nr=je*je,vr=Ye*Ye;function Tr(Fr,Xr){var oa=1-c(Xr),ga,Ma;if(oa&&oa<2){var en=A-Xr,Dn=25,In;do{var Kn=c(en),vi=r(en),zi=ct+t(Kn,Ye-vi),Mi=1+vr-2*Ye*vi;en-=In=(en-nr*ct-Ye*Kn+Mi*zi-.5*oa*yt)/(2*Ye*Kn*zi)}while(E(In)>_&&--Dn>0);ga=At*F(Mi),Ma=Fr*zi/w}else ga=At*(je+oa),Ma=Fr*ct/w;return[ga*c(Ma),Ct-ga*r(Ma)]}return Tr.invert=function(Fr,Xr){var oa=Fr*Fr+(Xr-=Ct)*Xr,ga=(1+vr-oa/(At*At))/(2*Ye),Ma=z(ga),en=c(Ma),Dn=ct+t(en,Ye-ga);return[L(Fr/F(oa))*w/Dn,L(1-2*(Ma-nr*ct-Ye*en+(1+vr-2*Ye*ga)*Dn)/yt)]},Tr}function us(){var je=1,Ye=x.geoProjectionMutator(Ko),at=Ye(je);return at.ratio=function(ct){return arguments.length?Ye(je=+ct):je},at.scale(167.774).center([0,18.67])}var ko=.7109889596207567,zn=.0528035274542;function _i(je,Ye){return Ye>-ko?(je=Ue(je,Ye),je[1]+=zn,je):Xe(je,Ye)}_i.invert=function(je,Ye){return Ye>-ko?Ue.invert(je,Ye-zn):Xe.invert(je,Ye)};function xs(){return x.geoProjection(_i).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Qo(je,Ye){return E(Ye)>ko?(je=Ue(je,Ye),je[1]-=Ye>0?zn:-zn,je):Xe(je,Ye)}Qo.invert=function(je,Ye){return E(Ye)>ko?Ue.invert(je,Ye+(Ye>0?zn:-zn)):Xe.invert(je,Ye)};function Ii(){return x.geoProjection(Qo).scale(152.63)}function gs(je,Ye,at,ct){var At=F(4*w/(2*at+(1+je-Ye/2)*c(2*at)+(je+Ye)/2*c(4*at)+Ye/2*c(6*at))),yt=F(ct*c(at)*F((1+je*r(2*at)+Ye*r(4*at))/(1+je+Ye))),Ct=at*vr(1);function nr(Xr){return F(1+je*r(2*Xr)+Ye*r(4*Xr))}function vr(Xr){var oa=Xr*at;return(2*oa+(1+je-Ye/2)*c(2*oa)+(je+Ye)/2*c(4*oa)+Ye/2*c(6*oa))/at}function Tr(Xr){return nr(Xr)*c(Xr)}var Fr=function(Xr,oa){var ga=at*Le(vr,Ct*c(oa)/at,oa/w);isNaN(ga)&&(ga=at*p(oa));var Ma=At*nr(ga);return[Ma*yt*Xr/w*r(ga),Ma/yt*c(ga)]};return Fr.invert=function(Xr,oa){var ga=Le(Tr,oa*yt/At);return[Xr*w/(r(ga)*At*yt*nr(ga)),L(at*vr(ga/at)/Ct)]},at===0&&(At=F(ct/w),Fr=function(Xr,oa){return[Xr*At,c(oa)/At]},Fr.invert=function(Xr,oa){return[Xr/At,L(oa*At)]}),Fr}function Zo(){var je=1,Ye=0,at=45*m,ct=2,At=x.geoProjectionMutator(gs),yt=At(je,Ye,at,ct);return yt.a=function(Ct){return arguments.length?At(je=+Ct,Ye,at,ct):je},yt.b=function(Ct){return arguments.length?At(je,Ye=+Ct,at,ct):Ye},yt.psiMax=function(Ct){return arguments.length?At(je,Ye,at=+Ct*m,ct):at*y},yt.ratio=function(Ct){return arguments.length?At(je,Ye,at,ct=+Ct):ct},yt.scale(180.739)}function Ss(je,Ye,at,ct,At,yt,Ct,nr,vr,Tr,Fr){if(Fr.nanEncountered)return NaN;var Xr,oa,ga,Ma,en,Dn,In,Kn,vi,zi;if(Xr=at-Ye,oa=je(Ye+Xr*.25),ga=je(at-Xr*.25),isNaN(oa)){Fr.nanEncountered=!0;return}if(isNaN(ga)){Fr.nanEncountered=!0;return}return Ma=Xr*(ct+4*oa+At)/12,en=Xr*(At+4*ga+yt)/12,Dn=Ma+en,zi=(Dn-Ct)/15,Tr>vr?(Fr.maxDepthCount++,Dn+zi):Math.abs(zi)>1;do vr[Dn]>ga?en=Dn:Ma=Dn,Dn=Ma+en>>1;while(Dn>Ma);var In=vr[Dn+1]-vr[Dn];return In&&(In=(ga-vr[Dn+1])/In),(Dn+1+In)/Ct}var Xr=2*Fr(1)/w*yt/at,oa=function(ga,Ma){var en=Fr(E(c(Ma))),Dn=ct(en)*ga;return en/=Xr,[Dn,Ma>=0?en:-en]};return oa.invert=function(ga,Ma){var en;return Ma*=Xr,E(Ma)<1&&(en=p(Ma)*L(At(E(Ma))*yt)),[ga/ct(E(Ma)),en]},oa}function po(){var je=0,Ye=2.5,at=1.183136,ct=x.geoProjectionMutator(ui),At=ct(je,Ye,at);return At.alpha=function(yt){return arguments.length?ct(je=+yt,Ye,at):je},At.k=function(yt){return arguments.length?ct(je,Ye=+yt,at):Ye},At.gamma=function(yt){return arguments.length?ct(je,Ye,at=+yt):at},At.scale(152.63)}function oo(je,Ye){return E(je[0]-Ye[0])=0;--vr)at=je[1][vr],ct=at[0][0],At=at[0][1],yt=at[1][1],Ct=at[2][0],nr=at[2][1],Ye.push(vs([[Ct-l,nr-l],[Ct-l,yt+l],[ct+l,yt+l],[ct+l,At-l]],30));return{type:"Polygon",coordinates:[S.merge(Ye)]}}function Ki(je,Ye,at){var ct,At;function yt(vr,Tr){for(var Fr=Tr<0?-1:1,Xr=Ye[+(Tr<0)],oa=0,ga=Xr.length-1;oaXr[oa][2][0];++oa);var Ma=je(vr-Xr[oa][1][0],Tr);return Ma[0]+=je(Xr[oa][1][0],Fr*Tr>Fr*Xr[oa][0][1]?Xr[oa][0][1]:Tr)[0],Ma}at?yt.invert=at(yt):je.invert&&(yt.invert=function(vr,Tr){for(var Fr=At[+(Tr<0)],Xr=Ye[+(Tr<0)],oa=0,ga=Fr.length;oaMa&&(en=ga,ga=Ma,Ma=en),[[Xr,ga],[oa,Ma]]})}),Ct):Ye.map(function(Tr){return Tr.map(function(Fr){return[[Fr[0][0]*y,Fr[0][1]*y],[Fr[1][0]*y,Fr[1][1]*y],[Fr[2][0]*y,Fr[2][1]*y]]})})},Ye!=null&&Ct.lobes(Ye),Ct}var Ts=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ws(){return Ki(Ee,Ts).scale(160.857)}var as=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function bs(){return Ki(Qo,as).scale(152.63)}var Go=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ns(){return Ki(Ue,Go).scale(169.529)}var fl=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Rl(){return Ki(Ue,fl).scale(169.529).rotate([20,0])}var Vu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Ul(){return Ki(_i,Vu,Pe).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Ic=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function rc(){return Ki(Xe,Ic).scale(152.63).rotate([-20,0])}function ys(je,Ye){return[3/u*je*F(w*w/3-Ye*Ye),Ye]}ys.invert=function(je,Ye){return[u/3*je/F(w*w/3-Ye*Ye),Ye]};function Du(){return x.geoProjection(ys).scale(158.837)}function oc(je){function Ye(at,ct){if(E(E(ct)-A)2)return null;at/=2,ct/=2;var yt=at*at,Ct=ct*ct,nr=2*ct/(1+yt+Ct);return nr=h((1+nr)/(1-nr),1/je),[t(2*at,1-yt-Ct)/je,L((nr-1)/(nr+1))]},Ye}function Dl(){var je=.5,Ye=x.geoProjectionMutator(oc),at=Ye(je);return at.spacing=function(ct){return arguments.length?Ye(je=+ct):je},at.scale(124.75)}var il=w/b;function Au(je,Ye){return[je*(1+F(r(Ye)))/2,Ye/(r(Ye/2)*r(je/6))]}Au.invert=function(je,Ye){var at=E(je),ct=E(Ye),At=l,yt=A;ctl||E(Dn)>l)&&--At>0);return At&&[at,ct]};function Xs(){return x.geoProjection(Fs).scale(139.98)}function es(je,Ye){return[c(je)/r(Ye),T(Ye)*r(je)]}es.invert=function(je,Ye){var at=je*je,ct=Ye*Ye,At=ct+1,yt=at+At,Ct=je?g*F((yt-F(yt*yt-4*at))/at):1/F(At);return[L(je*Ct),p(Ye)*z(Ct)]};function Ms(){return x.geoProjection(es).scale(144.049).clipAngle(90-.001)}function Su(je){var Ye=r(je),at=T(M+je/2);function ct(At,yt){var Ct=yt-je,nr=E(Ct)=0;)Fr=je[Tr],Xr=Fr[0]+nr*(ga=Xr)-vr*oa,oa=Fr[1]+nr*oa+vr*ga;return Xr=nr*(ga=Xr)-vr*oa,oa=nr*oa+vr*ga,[Xr,oa]}return at.invert=function(ct,At){var yt=20,Ct=ct,nr=At;do{for(var vr=Ye,Tr=je[vr],Fr=Tr[0],Xr=Tr[1],oa=0,ga=0,Ma;--vr>=0;)Tr=je[vr],oa=Fr+Ct*(Ma=oa)-nr*ga,ga=Xr+Ct*ga+nr*Ma,Fr=Tr[0]+Ct*(Ma=Fr)-nr*Xr,Xr=Tr[1]+Ct*Xr+nr*Ma;oa=Fr+Ct*(Ma=oa)-nr*ga,ga=Xr+Ct*ga+nr*Ma,Fr=Ct*(Ma=Fr)-nr*Xr-ct,Xr=Ct*Xr+nr*Ma-At;var en=oa*oa+ga*ga,Dn,In;Ct-=Dn=(Fr*oa+Xr*ga)/en,nr-=In=(Xr*oa-Fr*ga)/en}while(E(Dn)+E(In)>l*l&&--yt>0);if(yt){var Kn=F(Ct*Ct+nr*nr),vi=2*e(Kn*.5),zi=c(vi);return[t(Ct*zi,Kn*r(vi)),Kn?L(nr*zi/Kn):0]}},at}var Vo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Tf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],ss=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vi=[[.9245,0],[0,0],[.01943,0]],sc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function fu(){return Al(Vo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function vl(){return Al(Tf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Rc(){return Al(ss,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function qu(){return Al(Vi,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function yc(){return Al(sc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Al(je,Ye){var at=x.geoProjection(wf(je)).rotate(Ye).clipAngle(90),ct=x.geoRotation(Ye),At=at.center;return delete at.rotate,at.center=function(yt){return arguments.length?At(ct(yt)):ct.invert(At())},at}var $c=F(6),Nc=F(7);function _c(je,Ye){var at=L(7*c(Ye)/(3*$c));return[$c*je*(2*r(2*at/3)-1)/Nc,9*c(at/3)/Nc]}_c.invert=function(je,Ye){var at=3*L(Ye*Nc/9);return[je*Nc/($c*(2*r(2*at/3)-1)),L(c(at)*3*$c/7)]};function ac(){return x.geoProjection(_c).scale(164.859)}function Uc(je,Ye){for(var at=(1+g)*c(Ye),ct=Ye,At=0,yt;At<25&&(ct-=yt=(c(ct/2)+c(ct)-at)/(.5*r(ct/2)+r(ct)),!(E(yt)_&&--ct>0);return yt=at*at,Ct=yt*yt,nr=yt*Ct,[je/(.84719-.13063*yt+nr*nr*(-.04515+.05494*yt-.02326*Ct+.00331*nr)),at]};function lc(){return x.geoProjection(Mu).scale(175.295)}function Sl(je,Ye){return[je*(1+r(Ye))/2,2*(Ye-T(Ye/2))]}Sl.invert=function(je,Ye){for(var at=Ye/2,ct=0,At=1/0;ct<10&&E(At)>l;++ct){var yt=r(Ye/2);Ye-=At=(Ye-T(Ye/2)-at)/(1-.5/(yt*yt))}return[2*je/(1+r(Ye)),Ye]};function nc(){return x.geoProjection(Sl).scale(152.63)}var Gu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Es(){return Ki(he(1/0),Gu).rotate([20,0]).scale(152.63)}function zc(je,Ye){var at=c(Ye),ct=r(Ye),At=p(je);if(je===0||E(Ye)===A)return[0,Ye];if(Ye===0)return[je,0];if(E(je)===A)return[je*ct,A*at];var yt=w/(2*je)-2*je/w,Ct=2*Ye/w,nr=(1-Ct*Ct)/(at-Ct),vr=yt*yt,Tr=nr*nr,Fr=1+vr/Tr,Xr=1+Tr/vr,oa=(yt*at/nr-yt/2)/Fr,ga=(Tr*at/vr+nr/2)/Xr,Ma=oa*oa+ct*ct/Fr,en=ga*ga-(Tr*at*at/vr+nr*at-1)/Xr;return[A*(oa+F(Ma)*At),A*(ga+F(en<0?0:en)*p(-Ye*yt)*At)]}zc.invert=function(je,Ye){je/=A,Ye/=A;var at=je*je,ct=Ye*Ye,At=at+ct,yt=w*w;return[je?(At-1+F((1-At)*(1-At)+4*at))/(2*je)*A:0,Le(function(Ct){return At*(w*c(Ct)-2*Ct)*w+4*Ct*Ct*(Ye-c(Ct))+2*w*Ct-yt*Ye},0)]};function ff(){return x.geoProjection(zc).scale(127.267)}var Vc=1.0148,uc=.23185,Qc=-.14499,$l=.02406,qc=Vc,Zs=5*uc,Ql=7*Qc,Hu=9*$l,Os=1.790857183;function zu(je,Ye){var at=Ye*Ye;return[je,Ye*(Vc+at*at*(uc+at*(Qc+$l*at)))]}zu.invert=function(je,Ye){Ye>Os?Ye=Os:Ye<-Os&&(Ye=-Os);var at=Ye,ct;do{var At=at*at;at-=ct=(at*(Vc+At*At*(uc+At*(Qc+$l*At)))-Ye)/(qc+At*At*(Zs+At*(Ql+Hu*At)))}while(E(ct)>l);return[je,at]};function ql(){return x.geoProjection(zu).scale(139.319)}function Xl(je,Ye){if(E(Ye)l&&--At>0);return Ct=T(ct),[(E(Ye)=0;)if(ct=Ye[nr],at[0]===ct[0]&&at[1]===ct[1]){if(yt)return[yt,at];yt=at}}}function Ll(je){for(var Ye=je.length,at=[],ct=je[Ye-1],At=0;At0?[-ct[0],0]:[180-ct[0],180])};var Ye=Ec.map(function(at){return{face:at,project:je(at)}});return[-1,0,0,1,0,1,4,5].forEach(function(at,ct){var At=Ye[at];At&&(At.children||(At.children=[])).push(Ye[ct])}),xc(Ye[0],function(at,ct){return Ye[at<-w/2?ct<0?6:4:at<0?ct<0?2:0:atct^ga>ct&&at<(oa-Tr)*(ct-Fr)/(ga-Fr)+Tr&&(At=!At)}return At}function Pl(je,Ye){var at=Ye.stream,ct;if(!at)throw new Error("invalid projection");switch(je&&je.type){case"Feature":ct=pu;break;case"FeatureCollection":ct=Hc;break;default:ct=Ou;break}return ct(je,at)}function Hc(je,Ye){return{type:"FeatureCollection",features:je.features.map(function(at){return pu(at,Ye)})}}function pu(je,Ye){return{type:"Feature",id:je.id,properties:je.properties,geometry:Ou(je.geometry,Ye)}}function Zu(je,Ye){return{type:"GeometryCollection",geometries:je.geometries.map(function(at){return Ou(at,Ye)})}}function Ou(je,Ye){if(!je)return null;if(je.type==="GeometryCollection")return Zu(je,Ye);var at;switch(je.type){case"Point":at=Yu;break;case"MultiPoint":at=Yu;break;case"LineString":at=hc;break;case"MultiLineString":at=hc;break;case"Polygon":at=Eu;break;case"MultiPolygon":at=Eu;break;case"Sphere":at=Eu;break;default:return null}return x.geoStream(je,Ye(at)),at.result()}var dl=[],Hl=[],Yu={point:function(je,Ye){dl.push([je,Ye])},result:function(){var je=dl.length?dl.length<2?{type:"Point",coordinates:dl[0]}:{type:"MultiPoint",coordinates:dl}:null;return dl=[],je}},hc={lineStart:du,point:function(je,Ye){dl.push([je,Ye])},lineEnd:function(){dl.length&&(Hl.push(dl),dl=[])},result:function(){var je=Hl.length?Hl.length<2?{type:"LineString",coordinates:Hl[0]}:{type:"MultiLineString",coordinates:Hl}:null;return Hl=[],je}},Eu={polygonStart:du,lineStart:du,point:function(je,Ye){dl.push([je,Ye])},lineEnd:function(){var je=dl.length;if(je){do dl.push(dl[0].slice());while(++je<4);Hl.push(dl),dl=[]}},polygonEnd:du,result:function(){if(!Hl.length)return null;var je=[],Ye=[];return Hl.forEach(function(at){fc(at)?je.push([at]):Ye.push(at)}),Ye.forEach(function(at){var ct=at[0];je.some(function(At){if(Oc(At[0],ct))return At.push(at),!0})||je.push([at])}),Hl=[],je.length?je.length>1?{type:"MultiPolygon",coordinates:je}:{type:"Polygon",coordinates:je[0]}:null}};function Ku(je){var Ye=je(A,0)[0]-je(-A,0)[0];function at(ct,At){var yt=E(ct)0?ct-w:ct+w,At),nr=(Ct[0]-Ct[1])*g,vr=(Ct[0]+Ct[1])*g;if(yt)return[nr,vr];var Tr=Ye*g,Fr=nr>0^vr>0?-1:1;return[Fr*nr-p(vr)*Tr,Fr*vr-p(nr)*Tr]}return je.invert&&(at.invert=function(ct,At){var yt=(ct+At)*g,Ct=(At-ct)*g,nr=E(yt)<.5*Ye&&E(Ct)<.5*Ye;if(!nr){var vr=Ye*g,Tr=yt>0^Ct>0?-1:1,Fr=-Tr*ct+(Ct>0?1:-1)*vr,Xr=-Tr*At+(yt>0?1:-1)*vr;yt=(-Fr-Xr)*g,Ct=(Fr-Xr)*g}var oa=je.invert(yt,Ct);return nr||(oa[0]+=yt>0?w:-w),oa}),x.geoProjection(at).rotate([-90,-90,45]).clipAngle(180-.001)}function Yt(){return Ku(ra).scale(176.423)}function mr(){return Ku(Si).scale(111.48)}function Jr(je,Ye){if(!(0<=(Ye=+Ye)&&Ye<=20))throw new Error("invalid digits");function at(Tr){var Fr=Tr.length,Xr=2,oa=new Array(Fr);for(oa[0]=+Tr[0].toFixed(Ye),oa[1]=+Tr[1].toFixed(Ye);Xr2||ga[0]!=Fr[0]||ga[1]!=Fr[1])&&(Xr.push(ga),Fr=ga)}return Xr.length===1&&Tr.length>1&&Xr.push(at(Tr[Tr.length-1])),Xr}function yt(Tr){return Tr.map(At)}function Ct(Tr){if(Tr==null)return Tr;var Fr;switch(Tr.type){case"GeometryCollection":Fr={type:"GeometryCollection",geometries:Tr.geometries.map(Ct)};break;case"Point":Fr={type:"Point",coordinates:at(Tr.coordinates)};break;case"MultiPoint":Fr={type:Tr.type,coordinates:ct(Tr.coordinates)};break;case"LineString":Fr={type:Tr.type,coordinates:At(Tr.coordinates)};break;case"MultiLineString":case"Polygon":Fr={type:Tr.type,coordinates:yt(Tr.coordinates)};break;case"MultiPolygon":Fr={type:"MultiPolygon",coordinates:Tr.coordinates.map(yt)};break;default:return Tr}return Tr.bbox!=null&&(Fr.bbox=Tr.bbox),Fr}function nr(Tr){var Fr={type:"Feature",properties:Tr.properties,geometry:Ct(Tr.geometry)};return Tr.id!=null&&(Fr.id=Tr.id),Tr.bbox!=null&&(Fr.bbox=Tr.bbox),Fr}if(je!=null)switch(je.type){case"Feature":return nr(je);case"FeatureCollection":{var vr={type:"FeatureCollection",features:je.features.map(nr)};return je.bbox!=null&&(vr.bbox=je.bbox),vr}default:return Ct(je)}return je}function Wr(je){var Ye=c(je);function at(ct,At){var yt=Ye?T(ct*Ye/2)/Ye:ct/2;if(!At)return[2*yt,-je];var Ct=2*e(yt*c(At)),nr=1/T(At);return[c(Ct)*nr,At+(1-r(Ct))*nr-je]}return at.invert=function(ct,At){if(E(At+=je)l&&--nr>0);var oa=ct*(Tr=T(Ct)),ga=T(E(At)0?A:-A)*(vr+At*(Fr-Ct)/2+At*At*(Fr-2*vr+Ct)/2)]}xn.invert=function(je,Ye){var at=Ye/A,ct=at*90,At=s(18,E(ct/5)),yt=n(0,a(At));do{var Ct=$a[yt][1],nr=$a[yt+1][1],vr=$a[s(19,yt+2)][1],Tr=vr-Ct,Fr=vr-2*nr+Ct,Xr=2*(E(at)-nr)/Tr,oa=Fr/Tr,ga=Xr*(1-oa*Xr*(1-2*oa*Xr));if(ga>=0||yt===1){ct=(Ye>=0?5:-5)*(ga+At);var Ma=50,en;do At=s(18,E(ct)/5),yt=a(At),ga=At-yt,Ct=$a[yt][1],nr=$a[yt+1][1],vr=$a[s(19,yt+2)][1],ct-=(en=(Ye>=0?A:-A)*(nr+ga*(vr-Ct)/2+ga*ga*(vr-2*nr+Ct)/2)-Ye)*y;while(E(en)>_&&--Ma>0);break}}while(--yt>=0);var Dn=$a[yt][0],In=$a[yt+1][0],Kn=$a[s(19,yt+2)][0];return[je/(In+ga*(Kn-Dn)/2+ga*ga*(Kn-2*In+Dn)/2),ct*m]};function Fn(){return x.geoProjection(xn).scale(152.63)}function Gn(je){function Ye(at,ct){var At=r(ct),yt=(je-1)/(je-At*r(at));return[yt*At*c(at),yt*c(ct)]}return Ye.invert=function(at,ct){var At=at*at+ct*ct,yt=F(At),Ct=(je-F(1-At*(je+1)/(je-1)))/((je-1)/yt+yt/(je-1));return[t(at*Ct,yt*F(1-Ct*Ct)),yt?L(ct*Ct/yt):0]},Ye}function ai(je,Ye){var at=Gn(je);if(!Ye)return at;var ct=r(Ye),At=c(Ye);function yt(Ct,nr){var vr=at(Ct,nr),Tr=vr[1],Fr=Tr*At/(je-1)+ct;return[vr[0]*ct/Fr,Tr/Fr]}return yt.invert=function(Ct,nr){var vr=(je-1)/(je-1-nr*At);return at.invert(vr*Ct,vr*nr*ct)},yt}function wn(){var je=2,Ye=0,at=x.geoProjectionMutator(ai),ct=at(je,Ye);return ct.distance=function(At){return arguments.length?at(je=+At,Ye):je},ct.tilt=function(At){return arguments.length?at(je,Ye=At*m):Ye*y},ct.scale(432.147).clipAngle(z(1/je)*y-1e-6)}var Sn=1e-4,Ln=1e4,sn=-180,di=sn+Sn,Ni=180,Wi=Ni-Sn,Ui=-90,Ji=Ui+Sn,hi=90,Qn=hi-Sn;function ao(je){return je.length>0}function Po(je){return Math.floor(je*Ln)/Ln}function is(je){return je===Ui||je===hi?[0,je]:[sn,Po(je)]}function Rs(je){var Ye=je[0],at=je[1],ct=!1;return Ye<=di?(Ye=sn,ct=!0):Ye>=Wi&&(Ye=Ni,ct=!0),at<=Ji?(at=Ui,ct=!0):at>=Qn&&(at=hi,ct=!0),ct?[Ye,at]:je}function _s(je){return je.map(Rs)}function Ps(je,Ye,at){for(var ct=0,At=je.length;ct=Wi||Fr<=Ji||Fr>=Qn){yt[Ct]=Rs(vr);for(var Xr=Ct+1;Xrdi&&gaJi&&Ma=nr)break;at.push({index:-1,polygon:Ye,ring:yt=yt.slice(Xr-1)}),yt[0]=is(yt[0][1]),Ct=-1,nr=yt.length}}}}function ts(je){var Ye,at=je.length,ct={},At={},yt,Ct,nr,vr,Tr;for(Ye=0;Ye0?w-nr:nr)*y],Tr=x.geoProjection(je(Ct)).rotate(vr),Fr=x.geoRotation(vr),Xr=Tr.center;return delete Tr.rotate,Tr.center=function(oa){return arguments.length?Xr(Fr(oa)):Fr.invert(Xr())},Tr.clipAngle(90)}function ds(je){var Ye=r(je);function at(ct,At){var yt=x.geoGnomonicRaw(ct,At);return yt[0]*=Ye,yt}return at.invert=function(ct,At){return x.geoGnomonicRaw.invert(ct/Ye,At)},at}function zl(){return tu([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function tu(je,Ye){return Cs(ds,je,Ye)}function mu(je){if(!(je*=2))return x.geoAzimuthalEquidistantRaw;var Ye=-je/2,at=-Ye,ct=je*je,At=T(at),yt=.5/c(at);function Ct(nr,vr){var Tr=z(r(vr)*r(nr-Ye)),Fr=z(r(vr)*r(nr-at)),Xr=vr<0?-1:1;return Tr*=Tr,Fr*=Fr,[(Tr-Fr)/(2*je),Xr*F(4*ct*Fr-(ct-Tr+Fr)*(ct-Tr+Fr))/(2*je)]}return Ct.invert=function(nr,vr){var Tr=vr*vr,Fr=r(F(Tr+(oa=nr+Ye)*oa)),Xr=r(F(Tr+(oa=nr+at)*oa)),oa,ga;return[t(ga=Fr-Xr,oa=(Fr+Xr)*At),(vr<0?-1:1)*z(F(oa*oa+ga*ga)*yt)]},Ct}function Ju(){return Wl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Wl(je,Ye){return Cs(mu,je,Ye)}function $u(je,Ye){if(E(Ye)l&&--nr>0);return[p(je)*(F(At*At+4)+At)*w/4,A*Ct]};function gu(){return x.geoProjection(ku).scale(127.16)}function De(je,Ye,at,ct,At){function yt(Ct,nr){var vr=at*c(ct*nr),Tr=F(1-vr*vr),Fr=F(2/(1+Tr*r(Ct*=At)));return[je*Tr*Fr*c(Ct),Ye*vr*Fr]}return yt.invert=function(Ct,nr){var vr=Ct/je,Tr=nr/Ye,Fr=F(vr*vr+Tr*Tr),Xr=2*L(Fr/2);return[t(Ct*T(Xr),je*Fr)/At,Fr&&L(nr*c(Xr)/(Ye*at*Fr))/ct]},yt}function I(je,Ye,at,ct){var At=w/3;je=n(je,l),Ye=n(Ye,l),je=s(je,A),Ye=s(Ye,w-l),at=n(at,0),at=s(at,100-l),ct=n(ct,l);var yt=at/100+1,Ct=ct/100,nr=z(yt*r(At))/At,vr=c(je)/c(nr*A),Tr=Ye/w,Fr=F(Ct*c(je/2)/c(Ye/2)),Xr=Fr/F(Tr*vr*nr),oa=1/(Fr*F(Tr*vr*nr));return De(Xr,oa,vr,nr,Tr)}function ne(){var je=65*m,Ye=60*m,at=20,ct=200,At=x.geoProjectionMutator(I),yt=At(je,Ye,at,ct);return yt.poleline=function(Ct){return arguments.length?At(je=+Ct*m,Ye,at,ct):je*y},yt.parallels=function(Ct){return arguments.length?At(je,Ye=+Ct*m,at,ct):Ye*y},yt.inflation=function(Ct){return arguments.length?At(je,Ye,at=+Ct,ct):at},yt.ratio=function(Ct){return arguments.length?At(je,Ye,at,ct=+Ct):ct},yt.scale(163.775)}function be(){return ne().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ae=4*w+3*F(3),Re=2*F(2*w*F(3)/Ae),ut=$e(Re*F(3)/w,Re,Ae/6);function _t(){return x.geoProjection(ut).scale(176.84)}function Rt(je,Ye){return[je*F(1-3*Ye*Ye/(w*w)),Ye]}Rt.invert=function(je,Ye){return[je/F(1-3*Ye*Ye/(w*w)),Ye]};function Zt(){return x.geoProjection(Rt).scale(152.63)}function yr(je,Ye){var at=r(Ye),ct=r(je)*at,At=1-ct,yt=r(je=t(c(je)*at,-c(Ye))),Ct=c(je);return at=F(1-ct*ct),[Ct*at-yt*At,-yt*at-Ct*At]}yr.invert=function(je,Ye){var at=(je*je+Ye*Ye)/-2,ct=F(-at*(2+at)),At=Ye*at+je*ct,yt=je*at-Ye*ct,Ct=F(yt*yt+At*At);return[t(ct*At,Ct*(1+at)),Ct?-L(ct*yt/Ct):0]};function _r(){return x.geoProjection(yr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Gr(je,Ye){var at=le(je,Ye);return[(at[0]+je/A)/2,(at[1]+Ye)/2]}Gr.invert=function(je,Ye){var at=je,ct=Ye,At=25;do{var yt=r(ct),Ct=c(ct),nr=c(2*ct),vr=Ct*Ct,Tr=yt*yt,Fr=c(at),Xr=r(at/2),oa=c(at/2),ga=oa*oa,Ma=1-Tr*Xr*Xr,en=Ma?z(yt*Xr)*F(Dn=1/Ma):Dn=0,Dn,In=.5*(2*en*yt*oa+at/A)-je,Kn=.5*(en*Ct+ct)-Ye,vi=.5*Dn*(Tr*ga+en*yt*Xr*vr)+.5/A,zi=Dn*(Fr*nr/4-en*Ct*oa),Mi=.125*Dn*(nr*oa-en*Ct*Tr*Fr),so=.5*Dn*(vr*Xr+en*ga*yt)+.5,jo=zi*Mi-so*vi,uo=(Kn*zi-In*so)/jo,Co=(In*Mi-Kn*vi)/jo;at-=uo,ct-=Co}while((E(uo)>l||E(Co)>l)&&--At>0);return[at,ct]};function Qr(){return x.geoProjection(Gr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=$,d.geoAiryRaw=X,d.geoAitoff=ce,d.geoAitoffRaw=le,d.geoArmadillo=G,d.geoArmadilloRaw=ve,d.geoAugust=ee,d.geoAugustRaw=Y,d.geoBaker=j,d.geoBakerRaw=ae,d.geoBerghaus=re,d.geoBerghausRaw=Q,d.geoBertin1953=et,d.geoBertin1953Raw=qe,d.geoBoggs=We,d.geoBoggsRaw=Ee,d.geoBonne=zt,d.geoBonneRaw=St,d.geoBottomley=br,d.geoBottomleyRaw=Ut,d.geoBromley=Or,d.geoBromleyRaw=hr,d.geoChamberlin=ke,d.geoChamberlinRaw=ze,d.geoChamberlinAfrica=we,d.geoCollignon=He,d.geoCollignonRaw=Be,d.geoCraig=ot,d.geoCraigRaw=nt,d.geoCraster=Et,d.geoCrasterRaw=Mt,d.geoCylindricalEqualArea=sr,d.geoCylindricalEqualAreaRaw=Ot,d.geoCylindricalStereographic=ar,d.geoCylindricalStereographicRaw=ir,d.geoEckert1=ma,d.geoEckert1Raw=Mr,d.geoEckert2=Aa,d.geoEckert2Raw=Ca,d.geoEckert3=Ba,d.geoEckert3Raw=Da,d.geoEckert4=rn,d.geoEckert4Raw=ba,d.geoEckert5=Wt,d.geoEckert5Raw=vn,d.geoEckert6=Ht,d.geoEckert6Raw=Lt,d.geoEisenlohr=Yr,d.geoEisenlohrRaw=Pr,d.geoFahey=La,d.geoFaheyRaw=na,d.geoFoucaut=Ua,d.geoFoucautRaw=Ga,d.geoFoucautSinusoidal=an,d.geoFoucautSinusoidalRaw=Xa,d.geoGilbert=Wn,d.geoGingery=Rr,d.geoGingeryRaw=ti,d.geoGinzburg4=kr,d.geoGinzburg4Raw=pr,d.geoGinzburg5=Ur,d.geoGinzburg5Raw=zr,d.geoGinzburg6=qt,d.geoGinzburg6Raw=dt,d.geoGinzburg8=Ir,d.geoGinzburg8Raw=fr,d.geoGinzburg9=Ta,d.geoGinzburg9Raw=da,d.geoGringorten=_n,d.geoGringortenRaw=ra,d.geoGuyou=vo,d.geoGuyouRaw=Si,d.geoHammer=Te,d.geoHammerRaw=he,d.geoHammerRetroazimuthal=lo,d.geoHammerRetroazimuthalRaw=ms,d.geoHealpix=Uo,d.geoHealpixRaw=$o,d.geoHill=us,d.geoHillRaw=Ko,d.geoHomolosine=Ii,d.geoHomolosineRaw=Qo,d.geoHufnagel=Zo,d.geoHufnagelRaw=gs,d.geoHyperelliptical=po,d.geoHyperellipticalRaw=ui,d.geoInterrupt=Ki,d.geoInterruptedBoggs=Ws,d.geoInterruptedHomolosine=bs,d.geoInterruptedMollweide=ns,d.geoInterruptedMollweideHemispheres=Rl,d.geoInterruptedSinuMollweide=Ul,d.geoInterruptedSinusoidal=rc,d.geoKavrayskiy7=Du,d.geoKavrayskiy7Raw=ys,d.geoLagrange=Dl,d.geoLagrangeRaw=oc,d.geoLarrivee=ou,d.geoLarriveeRaw=Au,d.geoLaskowski=Xs,d.geoLaskowskiRaw=Fs,d.geoLittrow=Ms,d.geoLittrowRaw=es,d.geoLoximuthal=hl,d.geoLoximuthalRaw=Su,d.geoMiller=qs,d.geoMillerRaw=cu,d.geoModifiedStereographic=Al,d.geoModifiedStereographicRaw=wf,d.geoModifiedStereographicAlaska=fu,d.geoModifiedStereographicGs48=vl,d.geoModifiedStereographicGs50=Rc,d.geoModifiedStereographicMiller=qu,d.geoModifiedStereographicLee=yc,d.geoMollweide=fe,d.geoMollweideRaw=Ue,d.geoMtFlatPolarParabolic=ac,d.geoMtFlatPolarParabolicRaw=_c,d.geoMtFlatPolarQuartic=jc,d.geoMtFlatPolarQuarticRaw=Uc,d.geoMtFlatPolarSinusoidal=Dc,d.geoMtFlatPolarSinusoidalRaw=hu,d.geoNaturalEarth2=lc,d.geoNaturalEarth2Raw=Mu,d.geoNellHammer=nc,d.geoNellHammerRaw=Sl,d.geoInterruptedQuarticAuthalic=Es,d.geoNicolosi=ff,d.geoNicolosiRaw=zc,d.geoPatterson=ql,d.geoPattersonRaw=zu,d.geoPolyconic=rl,d.geoPolyconicRaw=Xl,d.geoPolyhedral=xc,d.geoPolyhedralButterfly=Bs,d.geoPolyhedralCollignon=Fc,d.geoPolyhedralWaterman=Gs,d.geoProject=Pl,d.geoGringortenQuincuncial=Yt,d.geoPeirceQuincuncial=mr,d.geoPierceQuincuncial=mr,d.geoQuantize=Jr,d.geoQuincuncial=Ku,d.geoRectangularPolyconic=xa,d.geoRectangularPolyconicRaw=Wr,d.geoRobinson=Fn,d.geoRobinsonRaw=xn,d.geoSatellite=wn,d.geoSatelliteRaw=ai,d.geoSinuMollweide=xs,d.geoSinuMollweideRaw=_i,d.geoSinusoidal=Tt,d.geoSinusoidalRaw=Xe,d.geoStitch=Ns,d.geoTimes=go,d.geoTimesRaw=ki,d.geoTwoPointAzimuthal=tu,d.geoTwoPointAzimuthalRaw=ds,d.geoTwoPointAzimuthalUsa=zl,d.geoTwoPointEquidistant=Wl,d.geoTwoPointEquidistantRaw=mu,d.geoTwoPointEquidistantUsa=Ju,d.geoVanDerGrinten=Zl,d.geoVanDerGrintenRaw=$u,d.geoVanDerGrinten2=$i,d.geoVanDerGrinten2Raw=Bu,d.geoVanDerGrinten3=Qu,d.geoVanDerGrinten3Raw=_o,d.geoVanDerGrinten4=gu,d.geoVanDerGrinten4Raw=ku,d.geoWagner=ne,d.geoWagner7=be,d.geoWagnerRaw=I,d.geoWagner4=_t,d.geoWagner4Raw=ut,d.geoWagner6=Zt,d.geoWagner6Raw=Rt,d.geoWiechel=_r,d.geoWiechelRaw=yr,d.geoWinkel3=Qr,d.geoWinkel3Raw=Gr,Object.defineProperty(d,"__esModule",{value:!0})})}}),IL=Ge({"src/plots/geo/zoom.js"(Z,q){"use strict";var d=Oi(),x=ta(),S=Yi(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(y,m){var R=y.projection,L;return m._isScoped?L=n:m._isClipped?L=h:L=s,L(y,R)}q.exports=o;function a(y,m){return d.behavior.zoom().translate(m.translate()).scale(m.scale())}function i(y,m,R){var L=y.id,z=y.graphDiv,F=z.layout,N=F[L],O=z._fullLayout,P=O[L],U={},B={};function X($,le){U[L+"."+$]=x.nestedProperty(N,$).get(),S.call("_storeDirectGUIEdit",F,O._preGUI,U);var ce=x.nestedProperty(P,$);ce.get()!==le&&(ce.set(le),x.nestedProperty(N,$).set(le),B[L+"."+$]=le)}R(X),X("projection.scale",m.scale()/y.fitScale),X("fitbounds",!1),z.emit("plotly_relayout",B)}function n(y,m){var R=a(y,m);function L(){d.select(this).style(t)}function z(){m.scale(d.event.scale).translate(d.event.translate),y.render(!0);var O=m.invert(y.midPt);y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/y.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var P=m.invert(y.midPt);O("center.lon",P[0]),O("center.lat",P[1])}function N(){d.select(this).style(r),i(y,m,F)}return R.on("zoomstart",L).on("zoom",z).on("zoomend",N),R}function s(y,m){var R=a(y,m),L=2,z,F,N,O,P,U,B,X,$;function le(V){return m.invert(V)}function ce(V){var se=le(V);if(!se)return!0;var ae=m(se);return Math.abs(ae[0]-V[0])>L||Math.abs(ae[1]-V[1])>L}function ve(){d.select(this).style(t),z=d.mouse(this),F=m.rotate(),N=m.translate(),O=F,P=le(z)}function G(){if(U=d.mouse(this),ce(z)){R.scale(m.scale()),R.translate(m.translate());return}m.scale(d.event.scale),m.translate([N[0],d.event.translate[1]]),P?le(U)&&(X=le(U),B=[O[0]+(X[0]-P[0]),F[1],F[2]],m.rotate(B),O=B):(z=U,P=le(z)),$=!0,y.render(!0);var V=m.rotate(),se=m.invert(y.midPt);y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/y.fitScale,"geo.center.lon":se[0],"geo.center.lat":se[1],"geo.projection.rotation.lon":-V[0]})}function Y(){d.select(this).style(r),$&&i(y,m,ee)}function ee(V){var se=m.rotate(),ae=m.invert(y.midPt);V("projection.rotation.lon",-se[0]),V("center.lon",ae[0]),V("center.lat",ae[1])}return R.on("zoomstart",ve).on("zoom",G).on("zoomend",Y),R}function h(y,m){var R={r:m.rotate(),k:m.scale()},L=a(y,m),z=u(L,"zoomstart","zoom","zoomend"),F=0,N=L.on,O;L.on("zoomstart",function(){d.select(this).style(t);var $=d.mouse(this),le=m.rotate(),ce=le,ve=m.translate(),G=p(le);O=f(m,$),N.call(L,"zoom",function(){var Y=d.mouse(this);if(m.scale(R.k=d.event.scale),!O)$=Y,O=f(m,$);else if(f(m,Y)){m.rotate(le).translate(ve);var ee=f(m,Y),V=T(O,ee),se=M(c(G,V)),ae=R.r=l(se,O,ce);(!isFinite(ae[0])||!isFinite(ae[1])||!isFinite(ae[2]))&&(ae=ce),m.rotate(ae),ce=ae}U(z.of(this,arguments))}),P(z.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),N.call(L,"zoom",null),B(z.of(this,arguments)),i(y,m,X)}).on("zoom.redraw",function(){y.render(!0);var $=m.rotate();y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/y.fitScale,"geo.projection.rotation.lon":-$[0],"geo.projection.rotation.lat":-$[1]})});function P($){F++||$({type:"zoomstart"})}function U($){$({type:"zoom"})}function B($){--F||$({type:"zoomend"})}function X($){var le=m.rotate();$("projection.rotation.lon",-le[0]),$("projection.rotation.lat",-le[1])}return d.rebind(L,z,"on")}function f(y,m){var R=y.invert(m);return R&&isFinite(R[0])&&isFinite(R[1])&&g(R)}function p(y){var m=.5*y[0]*E,R=.5*y[1]*E,L=.5*y[2]*E,z=Math.sin(m),F=Math.cos(m),N=Math.sin(R),O=Math.cos(R),P=Math.sin(L),U=Math.cos(L);return[F*O*U+z*N*P,z*O*U-F*N*P,F*N*U+z*O*P,F*O*P-z*N*U]}function c(y,m){var R=y[0],L=y[1],z=y[2],F=y[3],N=m[0],O=m[1],P=m[2],U=m[3];return[R*N-L*O-z*P-F*U,R*O+L*N+z*U-F*P,R*P-L*U+z*N+F*O,R*U+L*P-z*O+F*N]}function T(y,m){if(!(!y||!m)){var R=v(y,m),L=Math.sqrt(b(R,R)),z=.5*Math.acos(Math.max(-1,Math.min(1,b(y,m)))),F=Math.sin(z)/L;return L&&[Math.cos(z),R[2]*F,-R[1]*F,R[0]*F]}}function l(y,m,R){var L=A(m,2,y[0]);L=A(L,1,y[1]),L=A(L,0,y[2]-R[2]);var z=m[0],F=m[1],N=m[2],O=L[0],P=L[1],U=L[2],B=Math.atan2(F,z)*e,X=Math.sqrt(z*z+F*F),$,le;Math.abs(P)>X?(le=(P>0?90:-90)-B,$=0):(le=Math.asin(P/X)*e-B,$=Math.sqrt(X*X-P*P));var ce=180-le-2*B,ve=(Math.atan2(U,O)-Math.atan2(N,$))*e,G=(Math.atan2(U,O)-Math.atan2(N,-$))*e,Y=_(R[0],R[1],le,ve),ee=_(R[0],R[1],ce,G);return Y<=ee?[le,ve,R[2]]:[ce,G,R[2]]}function _(y,m,R,L){var z=w(R-y),F=w(L-m);return Math.sqrt(z*z+F*F)}function w(y){return(y%360+540)%360-180}function A(y,m,R){var L=R*E,z=y.slice(),F=m===0?1:0,N=m===2?1:2,O=Math.cos(L),P=Math.sin(L);return z[F]=y[F]*O-y[N]*P,z[N]=y[N]*O+y[F]*P,z}function M(y){return[Math.atan2(2*(y[0]*y[1]+y[2]*y[3]),1-2*(y[1]*y[1]+y[2]*y[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(y[0]*y[2]-y[3]*y[1]))))*e,Math.atan2(2*(y[0]*y[3]+y[1]*y[2]),1-2*(y[2]*y[2]+y[3]*y[3]))*e]}function g(y){var m=y[0]*E,R=y[1]*E,L=Math.cos(R);return[L*Math.cos(m),L*Math.sin(m),Math.sin(R)]}function b(y,m){for(var R=0,L=0,z=y.length;L0&&P._module.calcGeoJSON(O,L)}if(!z){var U=this.updateProjection(R,L);if(U)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(L,F),this.updateDims(L,F),this.updateFx(L,F),s.generalUpdatePerTraceModule(this.graphDiv,this,R,F);var B=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=B.selectAll(".point"),this.dataPoints.text=B.selectAll("text"),this.dataPaths.line=B.selectAll(".js-line");var X=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=X.selectAll("path"),this._render()},v.updateProjection=function(R,L){var z=this.graphDiv,F=L[this.id],N=L._size,O=F.domain,P=F.projection,U=F.lonaxis,B=F.lataxis,X=U._ax,$=B._ax,le=this.projection=u(F),ce=[[N.l+N.w*O.x[0],N.t+N.h*(1-O.y[1])],[N.l+N.w*O.x[1],N.t+N.h*(1-O.y[0])]],ve=F.center||{},G=P.rotation||{},Y=U.range||[],ee=B.range||[];if(F.fitbounds){X._length=ce[1][0]-ce[0][0],$._length=ce[1][1]-ce[0][1],X.range=f(z,X),$.range=f(z,$);var V=(X.range[0]+X.range[1])/2,se=($.range[0]+$.range[1])/2;if(F._isScoped)ve={lon:V,lat:se};else if(F._isClipped){ve={lon:V,lat:se},G={lon:V,lat:se,roll:G.roll};var ae=P.type,j=w.lonaxisSpan[ae]/2||180,Q=w.lataxisSpan[ae]/2||90;Y=[V-j,V+j],ee=[se-Q,se+Q]}else ve={lon:V,lat:se},G={lon:V,lat:G.lat,roll:G.roll}}le.center([ve.lon-G.lon,ve.lat-G.lat]).rotate([-G.lon,-G.lat,G.roll]).parallels(P.parallels);var re=m(Y,ee);le.fitExtent(ce,re);var he=this.bounds=le.getBounds(re),xe=this.fitScale=le.scale(),Te=le.translate();if(F.fitbounds){var Le=le.getBounds(m(X.range,$.range)),Pe=Math.min((he[1][0]-he[0][0])/(Le[1][0]-Le[0][0]),(he[1][1]-he[0][1])/(Le[1][1]-Le[0][1]));isFinite(Pe)?le.scale(Pe*xe):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else le.scale(P.scale*xe);var qe=this.midPt=[(he[0][0]+he[1][0])/2,(he[0][1]+he[1][1])/2];if(le.translate([Te[0]+(qe[0]-Te[0]),Te[1]+(qe[1]-Te[1])]).clipExtent(he),F._isAlbersUsa){var et=le([ve.lon,ve.lat]),rt=le.translate();le.translate([rt[0]-(et[0]-rt[0]),rt[1]-(et[1]-rt[1])])}},v.updateBaseLayers=function(R,L){var z=this,F=z.topojson,N=z.layers,O=z.basePaths;function P(ce){return ce==="lonaxis"||ce==="lataxis"}function U(ce){return!!w.lineLayers[ce]}function B(ce){return!!w.fillLayers[ce]}var X=this.hasChoropleth?w.layersForChoropleth:w.layers,$=X.filter(function(ce){return U(ce)||B(ce)?L["show"+ce]:P(ce)?L[ce].showgrid:!0}),le=z.framework.selectAll(".layer").data($,String);le.exit().each(function(ce){delete N[ce],delete O[ce],d.select(this).remove()}),le.enter().append("g").attr("class",function(ce){return"layer "+ce}).each(function(ce){var ve=N[ce]=d.select(this);ce==="bg"?z.bgRect=ve.append("rect").style("pointer-events","all"):P(ce)?O[ce]=ve.append("path").style("fill","none"):ce==="backplot"?ve.append("g").classed("choroplethlayer",!0):ce==="frontplot"?ve.append("g").classed("scatterlayer",!0):U(ce)?O[ce]=ve.append("path").style("fill","none").style("stroke-miterlimit",2):B(ce)&&(O[ce]=ve.append("path").style("stroke","none"))}),le.order(),le.each(function(ce){var ve=O[ce],G=w.layerNameToAdjective[ce];ce==="frame"?ve.datum(w.sphereSVG):U(ce)||B(ce)?ve.datum(g(F,F.objects[ce])):P(ce)&&ve.datum(y(ce,L,R)).call(a.stroke,L[ce].gridcolor).call(i.dashLine,L[ce].griddash,L[ce].gridwidth),U(ce)?ve.call(a.stroke,L[G+"color"]).call(i.dashLine,"",L[G+"width"]):B(ce)&&ve.call(a.fill,L[G+"color"])})},v.updateDims=function(R,L){var z=this.bounds,F=(L.framewidth||0)/2,N=z[0][0]-F,O=z[0][1]-F,P=z[1][0]-N+F,U=z[1][1]-O+F;i.setRect(this.clipRect,N,O,P,U),this.bgRect.call(i.setRect,N,O,P,U).call(a.fill,L.bgcolor),this.xaxis._offset=N,this.xaxis._length=P,this.yaxis._offset=O,this.yaxis._length=U},v.updateFx=function(R,L){var z=this,F=z.graphDiv,N=z.bgRect,O=R.dragmode,P=R.clickmode;if(z.isStatic)return;function U(){var le=z.viewInitial,ce={};for(var ve in le)ce[z.id+"."+ve]=le[ve];t.call("_guiRelayout",F,ce),F.emit("plotly_doubleclick",null)}function B(le){return z.projection.invert([le[0]+z.xaxis._offset,le[1]+z.yaxis._offset])}var X=function(le,ce){if(ce.isRect){var ve=le.range={};ve[z.id]=[B([ce.xmin,ce.ymin]),B([ce.xmax,ce.ymax])]}else{var G=le.lassoPoints={};G[z.id]=ce.map(B)}},$={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:X},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(le){le===2&&T(F)}};O==="pan"?(N.node().onmousedown=null,N.call(_(z,L)),N.on("dblclick.zoom",U),F._context._scrollZoom.geo||N.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(N.on(".zoom",null),$.prepFn=function(le,ce,ve){c(le,ce,ve,$,O)},p.init($)),N.on("mousemove",function(){var le=z.projection.invert(r.getPositionFromD3Event());if(!le)return p.unhover(F,d.event);z.xaxis.p2c=function(){return le[0]},z.yaxis.p2c=function(){return le[1]},n.hover(F,d.event,z.id)}),N.on("mouseout",function(){F._dragging||p.unhover(F,d.event)}),N.on("click",function(){O!=="select"&&O!=="lasso"&&(P.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,$),P.indexOf("event")>-1&&n.click(F,d.event))})},v.makeFramework=function(){var R=this,L=R.graphDiv,z=L._fullLayout,F="clip"+z._uid+R.id;R.clipDef=z._clips.append("clipPath").attr("id",F),R.clipRect=R.clipDef.append("rect"),R.framework=d.select(R.container).append("g").attr("class","geo "+R.id).call(i.setClipUrl,F,L),R.project=function(N){var O=R.projection(N);return O?[O[0]-R.xaxis._offset,O[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(N){return R.project(N)[0]}},R.yaxis={_id:"y",c2p:function(N){return R.project(N)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(R.mockAxis,z)},v.saveViewInitial=function(R){var L=R.center||{},z=R.projection,F=z.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":z.scale};var N;R._isScoped?N={"center.lon":L.lon,"center.lat":L.lat}:R._isClipped?N={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:N={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,N)},v.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},v._render=function(){var R=this.projection,L=R.getPath(),z;function F(O){var P=R(O.lonlat);return P?o(P[0],P[1]):null}function N(O){return R.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",L);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return L(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",N).attr("transform",F)};function u(R){var L=R.projection,z=L.type,F=w.projNames[z];F="geo"+r.titleCase(F);for(var N=x[F]||e[F],O=N(),P=R._isSatellite?Math.acos(1/L.distance)*180/Math.PI:R._isClipped?w.lonaxisSpan[z]/2:null,U=["center","rotate","parallels","clipExtent"],B=function(le){return le?O:[]},X=0;XG}else return!1},O.getPath=function(){return S().projection(O)},O.getBounds=function(le){return O.getPath().bounds(le)},O.precision(w.precision),R._isSatellite&&O.tilt(L.tilt).distance(L.distance),P&&O.clipAngle(P-w.clipPad),O}function y(R,L,z){var F=1e-6,N=2.5,O=L[R],P=w.scopeDefaults[L.scope],U,B,X;R==="lonaxis"?(U=P.lonaxisRange,B=P.lataxisRange,X=function(se,ae){return[se,ae]}):R==="lataxis"&&(U=P.lataxisRange,B=P.lonaxisRange,X=function(se,ae){return[ae,se]});var $={type:"linear",range:[U[0],U[1]-F],tick0:O.tick0,dtick:O.dtick};h.setConvert($,z);var le=h.calcTicks($);!L.isScoped&&R==="lonaxis"&&le.pop();for(var ce=le.length,ve=new Array(ce),G=0;G0&&N<0&&(N+=360);var U=(N-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,P],[F+U,P],[F+2*U,P],[F+3*U,P],[N,P],[N,O],[N-U,O],[N-2*U,O],[N-3*U,O],[F,O]]]}}}}),B3=Ge({"src/plots/geo/layout_attributes.js"(Z,q){"use strict";var d=sf(),x=ju().attributes,S=Of().dash,E=zg(),e=Ru().overrideAll,t=Cd(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:S},o=q.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),DL=Ge({"src/plots/geo/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Bd(),S=Bf().getSubplotData,E=zg(),e=B3(),t=E.axesNames;q.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=S(n.fullData,"geo",n.id),h=s.map(function(ee){return ee.index}),f=i("resolution"),p=i("scope"),c=E.scopeDefaults[p],T=i("projection.type",c.projType),l=a._isAlbersUsa=T==="albers usa";l&&(p=a.scope="usa");var _=a._isScoped=p!=="world",w=a._isSatellite=T==="satellite",A=a._isConic=T.indexOf("conic")!==-1||T==="albers",M=a._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var g=d.extendDeep({},a._template);g.showcoastlines=!1,g.showcountries=!1,g.showframe=!1,g.showlakes=!1,g.showland=!1,g.showocean=!1,g.showrivers=!1,g.showsubunits=!1,g.lonaxis&&(g.lonaxis.showgrid=!1),g.lataxis&&(g.lataxis.showgrid=!1),a._template=g}for(var b=i("visible"),v,u=0;u0&&B<0&&(B+=360);var X=(U+B)/2,$;if(!l){var le=_?c.projRotate:[X,0,0];$=i("projection.rotation.lon",le[0]),i("projection.rotation.lat",le[1]),i("projection.rotation.roll",le[2]),v=i("showcoastlines",!_&&b),v&&(i("coastlinecolor"),i("coastlinewidth")),v=i("showocean",b?void 0:!1),v&&i("oceancolor")}var ce,ve;if(l?(ce=-96.6,ve=38.7):(ce=_?X:$,ve=(P[0]+P[1])/2),i("center.lon",ce),i("center.lat",ve),w&&(i("projection.tilt"),i("projection.distance")),A){var G=c.projParallels||[0,60];i("projection.parallels",G)}i("projection.scale"),v=i("showland",b?void 0:!1),v&&i("landcolor"),v=i("showlakes",b?void 0:!1),v&&i("lakecolor"),v=i("showrivers",b?void 0:!1),v&&(i("rivercolor"),i("riverwidth")),v=i("showcountries",_&&p!=="usa"&&b),v&&(i("countrycolor"),i("countrywidth")),(p==="usa"||p==="north america"&&f===50)&&(i("showsubunits",b),i("subunitcolor"),i("subunitwidth")),_||(v=i("showframe",b),v&&(i("framecolor"),i("framewidth"))),i("bgcolor");var Y=i("fitbounds");Y&&(delete a.projection.scale,_?(delete a.center.lon,delete a.center.lat):M?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),N3=Ge({"src/plots/geo/index.js"(Z,q){"use strict";var d=Bf().getSubplotCalcData,x=ta().counterRegex,S=RL(),E="geo",e=x(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,h=n._subplots[E],f=0;f")}}}}),U_=Ge({"src/traces/choropleth/event_data.js"(Z,q){"use strict";q.exports=function(x,S,E,e,t){x.location=S.location,x.z=S.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),j_=Ge({"src/traces/choropleth/select.js"(Z,q){"use strict";q.exports=function(x,S){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(S===!1)for(o=0;o=Math.min(B,X)&&T<=Math.max(B,X)?0:1/0}if(L=Math.min($,le)&&l<=Math.max($,le)?0:1/0}N=Math.sqrt(L*L+z*z),u=w[R]}}}else for(R=w.length-1;R>-1;R--)v=w[R],y=p[v],m=c[v],L=h.c2p(y)-T,z=f.c2p(m)-l,F=Math.sqrt(L*L+z*z),F100},Z.isDotSymbol=function(d){return typeof d=="string"?q.DOT_RE.test(d):d>200}}}),UL=Ge({"src/traces/scattergl/defaults.js"(Z,q){"use strict";var d=ta(),x=Yi(),S=q_(),E=Og(),e=Rv(),t=iu(),r=B0(),o=vv(),a=Nh(),i=Xh(),n=dv(),s=Zh();q.exports=function(f,p,c,T){function l(u,y){return d.coerce(f,p,E,u,y)}var _=f.marker?S.isOpenSymbol(f.marker.symbol):!1,w=t.isBubble(f),A=r(f,p,T,l);if(!A){p.visible=!1;return}o(f,p,T,l),l("xhoverformat"),l("yhoverformat");var M=A>>1,f=r[h],p=a!==void 0?a(f,o):f-o;p>=0?(s=h,n=h-1):i=h+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var h=i+n>>>1,f=r[h],p=a!==void 0?a(f,o):f-o;p>0?(s=h,n=h-1):i=h+1}return s}function S(r,o,a,i,n){for(var s=i-1;i<=n;){var h=i+n>>>1,f=r[h],p=a!==void 0?a(f,o):f-o;p<0?(s=h,i=h+1):n=h-1}return s}function E(r,o,a,i,n){for(var s=i-1;i<=n;){var h=i+n>>>1,f=r[h],p=a!==void 0?a(f,o):f-o;p<=0?(s=h,i=h+1):n=h-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,h=r[s],f=a!==void 0?a(h,o):h-o;if(f===0)return s;f<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}q.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,S)},le:function(r,o,a,i,n){return t(r,o,a,i,n,E)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Ov=Ge({"node_modules/pick-by-alias/index.js"(Z,q){"use strict";q.exports=function(E,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(S=arguments),typeof S=="string"?S=S.split(/\s/).map(parseFloat):typeof S=="number"&&(S=[S]),S.length&&typeof S[0]=="number"?S.length===1?E={width:S[0],height:S[0],x:0,y:0}:S.length===2?E={width:S[0],height:S[1],x:0,y:0}:E={x:S[0],y:S[1],width:S[2]-S[0]||0,height:S[3]-S[1]||0}:S&&(S=d(S,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),E={x:S.left||0,y:S.top||0},S.width==null?S.right?E.width=S.right-E.x:E.width=0:E.width=S.width,S.height==null?S.bottom?E.height=S.bottom-E.y:E.height=0:E.height=S.height),E}}}),Xp=Ge({"node_modules/array-bounds/index.js"(Z,q){"use strict";q.exports=d;function d(x,S){if(!x||x.length==null)throw Error("Argument should be an array");S==null?S=1:S=Math.floor(S);for(var E=Array(S*2),e=0;et&&(t=x[o]),x[o]>>1,w;p.dtype||(p.dtype="array"),typeof p.dtype=="string"?w=new(a(p.dtype))(_):p.dtype&&(w=p.dtype,Array.isArray(w)&&(w.length=_));for(let L=0;L<_;++L)w[L]=L;let A=[],M=[],g=[],b=[];u(0,0,1,w,0,1);let v=0;for(let L=0;Lc||P>n){for(let se=0;sere||X>he||$=ce||j===Q)return;let xe=A[ae];Q===void 0&&(Q=xe.length);for(let fe=j;fe=N&&ie<=P&&Ee>=O&&Ee<=U&&ve.push(ue)}let Te=M[ae],Le=Te[j*4+0],Pe=Te[j*4+1],qe=Te[j*4+2],et=Te[j*4+3],rt=Y(Te,j+1),$e=se*.5,Ue=ae+1;G(ee,V,$e,Ue,Le,Pe||qe||et||rt),G(ee,V+$e,$e,Ue,Pe,qe||et||rt),G(ee+$e,V,$e,Ue,qe,et||rt),G(ee+$e,V+$e,$e,Ue,et,rt)}function Y(ee,V){let se=null,ae=0;for(;se===null;)if(se=ee[V*4+ae],ae++,ae>ee.length)return null;return se}return ve}function m(L,z,F,N,O){let P=[];for(let U=0;U1&&(f=1),f<-1&&(f=-1),h*Math.acos(f)},t=function(a,i,n,s,h,f,p,c,T,l,_,w){var A=Math.pow(h,2),M=Math.pow(f,2),g=Math.pow(_,2),b=Math.pow(w,2),v=A*M-A*b-M*g;v<0&&(v=0),v/=A*b+M*g,v=Math.sqrt(v)*(p===c?-1:1);var u=v*h/f*w,y=v*-f/h*_,m=l*u-T*y+(a+n)/2,R=T*u+l*y+(i+s)/2,L=(_-u)/h,z=(w-y)/f,F=(-_-u)/h,N=(-w-y)/f,O=e(1,0,L,z),P=e(L,z,F,N);return c===0&&P>0&&(P-=x),c===1&&P<0&&(P+=x),[m,R,O,P]},r=function(a){var i=a.px,n=a.py,s=a.cx,h=a.cy,f=a.rx,p=a.ry,c=a.xAxisRotation,T=c===void 0?0:c,l=a.largeArcFlag,_=l===void 0?0:l,w=a.sweepFlag,A=w===void 0?0:w,M=[];if(f===0||p===0)return[];var g=Math.sin(T*x/360),b=Math.cos(T*x/360),v=b*(i-s)/2+g*(n-h)/2,u=-g*(i-s)/2+b*(n-h)/2;if(v===0&&u===0)return[];f=Math.abs(f),p=Math.abs(p);var y=Math.pow(v,2)/Math.pow(f,2)+Math.pow(u,2)/Math.pow(p,2);y>1&&(f*=Math.sqrt(y),p*=Math.sqrt(y));var m=t(i,n,s,h,f,p,_,A,g,b,v,u),R=d(m,4),L=R[0],z=R[1],F=R[2],N=R[3],O=Math.abs(N)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var P=Math.max(Math.ceil(O),1);N/=P;for(var U=0;U4?(o=l[l.length-4],a=l[l.length-3]):(o=f,a=p),r.push(l)}return r}function S(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),V3=Ge({"node_modules/is-svg-path/index.js"(Z,q){"use strict";q.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),YL=Ge({"node_modules/svg-path-bounds/index.js"(Z,q){"use strict";var d=qm(),x=j3(),S=ZL(),E=V3(),e=vg();q.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=S(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),KL=Ge({"node_modules/normalize-svg-path/index.js"(Z,q){var d=Math.PI,x=o(120);q.exports=S;function S(a){for(var i,n=[],s=0,h=0,f=0,p=0,c=null,T=null,l=0,_=0,w=0,A=a.length;w7&&(n.push(M.splice(0,7)),M.unshift("C"));break;case"S":var b=l,v=_;(i=="C"||i=="S")&&(b+=b-s,v+=v-h),M=["C",b,v,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(c=l*2-c,T=_*2-T):(c=l,T=_),M=e(l,_,c,T,M[1],M[2]);break;case"Q":c=M[1],T=M[2],M=e(l,_,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,_,M[1],M[2]);break;case"H":M=E(l,_,M[1],_);break;case"V":M=E(l,_,l,M[1]);break;case"Z":M=E(l,_,f,p);break}i=g,l=M[M.length-2],_=M[M.length-1],M.length>4?(s=M[M.length-4],h=M[M.length-3]):(s=l,h=_),n.push(M)}return n}function E(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,h,f){return["C",a/3+2/3*n,i/3+2/3*s,h/3+2/3*n,f/3+2/3*s,h,f]}function t(a,i,n,s,h,f,p,c,T,l){if(l)m=l[0],R=l[1],u=l[2],y=l[3];else{var _=r(a,i,-h);a=_.x,i=_.y,_=r(c,T,-h),c=_.x,T=_.y;var w=(a-c)/2,A=(i-T)/2,M=w*w/(n*n)+A*A/(s*s);M>1&&(M=Math.sqrt(M),n=M*n,s=M*s);var g=n*n,b=s*s,v=(f==p?-1:1)*Math.sqrt(Math.abs((g*b-g*A*A-b*w*w)/(g*A*A+b*w*w)));v==1/0&&(v=1);var u=v*n*A/s+(a+c)/2,y=v*-s*w/n+(i+T)/2,m=Math.asin(((i-y)/s).toFixed(9)),R=Math.asin(((T-y)/s).toFixed(9));m=aR&&(m=m-d*2),!p&&R>m&&(R=R-d*2)}if(Math.abs(R-m)>x){var L=R,z=c,F=T;R=m+x*(p&&R>m?1:-1),c=u+n*Math.cos(R),T=y+s*Math.sin(R);var N=t(c,T,n,s,h,0,p,z,F,[R,L,u,y])}var O=Math.tan((R-m)/4),P=4/3*n*O,U=4/3*s*O,B=[2*a-(a+P*Math.sin(m)),2*i-(i-U*Math.cos(m)),c+P*Math.sin(R),T-U*Math.cos(R),c,T];if(l)return B;N&&(B=B.concat(N));for(var X=0;X0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(c)),r.translate(h*.5,f*.5),r.scale(_,_),i()){var w=new Path2D(n);r.fill(w),c&&r.stroke(w)}else{var A=x(n);S(r,A),r.fill(),c&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:p*.5});return M}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var h=n.getImageData(0,0,1,1);return a=h&&h.data&&h.data[3]===255}}}),Yp=Ge({"src/traces/scattergl/convert.js"(Z,q){"use strict";var d=Bo(),x=QL(),S=Wd(),E=Yi(),e=ta(),t=e.isArrayOrTypedArray,r=zo(),o=dc(),a=id().formatColor,i=iu(),n=z0(),s=q_(),h=Kd(),f=Ed().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},c=Sh().appendArrayPointValue;function T(N,O){var P,U={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},B=N._context.plotGlPixelRatio;if(O.visible!==!0)return U;if(i.hasText(O)&&(U.text=l(N,O),U.textSel=M(N,O,O.selected),U.textUnsel=M(N,O,O.unselected)),i.hasMarkers(O)&&(U.marker=w(N,O),U.markerSel=A(N,O,O.selected),U.markerUnsel=A(N,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var X=O.marker.opacity;for(U.markerUnsel.opacity=new Array(X.length),P=0;P500?"bold":"normal":N}function w(N,O){var P=O._length,U=O.marker,B={},X,$=t(U.symbol),le=t(U.angle),ce=t(U.color),ve=t(U.line.color),G=t(U.opacity),Y=t(U.size),ee=t(U.line.width),V;if($||(V=s.isOpenSymbol(U.symbol)),$||ce||ve||G||le){B.symbols=new Array(P),B.angles=new Array(P),B.colors=new Array(P),B.borderColors=new Array(P);var se=U.symbol,ae=U.angle,j=a(U,U.opacity,P),Q=a(U.line,U.opacity,P);if(!t(Q[0])){var re=Q;for(Q=Array(P),X=0;Xh.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(ve&&O.connectgaps){var Y=X[0],ee=X[1];for($=0;$1?ce[$]:ce[0]:ce,V=t(ve)?ve.length>1?ve[$]:ve[0]:ve,se=p[ee],ae=p[V],j=G?G/.8+1:0,Q=-ae*j-ae*.5;X.offset[$]=[se*j/Y,Q/Y]}}return X}q.exports={style:T,markerStyle:w,markerSelection:A,linePositions:L,errorBarPositions:z,textPosition:F}}}),q3=Ge({"src/traces/scattergl/scene_update.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=f,u=b*2,y={},m,R=A.makeCalcdata(_,"x"),L=M.makeCalcdata(_,"y"),z=e(_,A,"x",R),F=e(_,M,"y",L),N=z.vals,O=F.vals;_._x=N,_._y=O,_.xperiodalignment&&(_._origX=R,_._xStarts=z.starts,_._xEnds=z.ends),_.yperiodalignment&&(_._origY=L,_._yStarts=F.starts,_._yEnds=F.ends);var P=new Array(u),U=new Array(b);for(m=0;m1&&x.extendFlat(g.line,n.linePositions(T,_,w)),g.errorX||g.errorY){var b=n.errorBarPositions(T,_,w,A,M);g.errorX&&x.extendFlat(g.errorX,b.x),g.errorY&&x.extendFlat(g.errorY,b.y)}return g.text&&(x.extendFlat(g.text,{positions:w},n.textPosition(T,_,g.text,g.marker)),x.extendFlat(g.textSel,{positions:w},n.textPosition(T,_,g.text,g.markerSel)),x.extendFlat(g.textUnsel,{positions:w},n.textPosition(T,_,g.text,g.markerUnsel))),g}}}),G3=Ge({"src/traces/scattergl/edit_style.js"(Z,q){"use strict";var d=ta(),x=Bi(),S=Ed().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],h=a.textOptions[i],f=a.textSelectedOptions[i]||{},p=a.textUnselectedOptions[i]||{},c=d.extendFlat({},h),T,l;if(n.length||s.length){var _=f.color,w=p.color,A=h.color,M=d.isArrayOrTypedArray(A);for(c.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,a=E&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),cf=Ge({"node_modules/object-assign/index.js"(Z,q){"use strict";var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}q.exports=e()?Object.assign:function(t,r){for(var o,a=E(t),i,n=1;ny.length)&&(m=y.length);for(var R=0,L=new Array(m);Rge)?ot.tree=c($e,{bounds:Ke}):ge&&ge.length&&(ot.tree=ge),ot.tree){var kt={primitive:"points",usage:"static",data:ot.tree,type:"uint32"};ot.elements?ot.elements(kt):ot.elements=B.elements(kt)}var Et=S.float32($e);ce({data:Et,usage:"dynamic"});var Bt=S.fract32($e,Et);return ze({data:Bt,usage:"dynamic"}),Qe({data:new Uint8Array(nt),type:"uint8",usage:"stream"}),$e}},{marker:function($e,ot,Ae){var ge=ot.activation;if(ge.forEach(function(Bt){return Bt&&Bt.destroy&&Bt.destroy()}),ge.length=0,!$e||typeof $e[0]=="number"){var ce=g.addMarker($e);ge[ce]=!0}else{for(var ze=[],Qe=0,nt=Math.min($e.length,ot.count);Qe=0)return z;var F;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)F=g;else{F=new Uint8Array(g.length);for(var B=0,O=g.length;BL*4&&(this.tooManyColors=!0),this.updatePalette(P),z.length===1?z[0]:z},b.prototype.updatePalette=function(g){if(!this.tooManyColors){var f=this.maxColors,P=this.paletteTexture,L=Math.ceil(g.length*.25/f);if(L>1){g=g.slice();for(var z=g.length*.25%f;z80*I){le=he=B[0],se=q=B[1];for(var oe=I;oehe&&(he=$),J>q&&(q=J);X=Math.max(he-le,q-se),X=X!==0?32767/X:0}return E(W,Q,I,le,se,X,0),Q}function x(B,O,I,N,U){var W,Q;if(U===F(B,O,I,N)>0)for(W=O;W=O;W-=N)Q=P(W,B[W],B[W+1],Q);return Q&&S(Q,Q.next)&&(L(Q),Q=Q.next),Q}function A(B,O){if(!B)return B;O||(O=B);var I=B,N;do if(N=!1,!I.steiner&&(S(I,I.next)||w(I.prev,I,I.next)===0)){if(L(I),I=O=I.prev,I===I.next)break;N=!0}else I=I.next;while(N||I!==O);return O}function E(B,O,I,N,U,W,Q){if(B){!Q&&W&&c(B,N,U,W);for(var le=B,se,he;B.prev!==B.next;){if(se=B.prev,he=B.next,W?t(B,N,U,W):e(B)){O.push(se.i/I|0),O.push(B.i/I|0),O.push(he.i/I|0),L(B),B=he.next,le=he.next;continue}if(B=he,B===le){Q?Q===1?(B=r(A(B),O,I),E(B,O,I,N,U,W,2)):Q===2&&o(B,O,I,N,U,W):E(A(B),O,I,N,U,W,1);break}}}}function e(B){var O=B.prev,I=B,N=B.next;if(w(O,I,N)>=0)return!1;for(var U=O.x,W=I.x,Q=N.x,le=O.y,se=I.y,he=N.y,q=UW?U>Q?U:Q:W>Q?W:Q,X=le>se?le>he?le:he:se>he?se:he,oe=N.next;oe!==O;){if(oe.x>=q&&oe.x<=J&&oe.y>=$&&oe.y<=X&&l(U,le,W,se,Q,he,oe.x,oe.y)&&w(oe.prev,oe,oe.next)>=0)return!1;oe=oe.next}return!0}function t(B,O,I,N){var U=B.prev,W=B,Q=B.next;if(w(U,W,Q)>=0)return!1;for(var le=U.x,se=W.x,he=Q.x,q=U.y,$=W.y,J=Q.y,X=lese?le>he?le:he:se>he?se:he,j=q>$?q>J?q:J:$>J?$:J,ee=p(X,oe,O,I,N),re=p(ne,j,O,I,N),ue=B.prevZ,_e=B.nextZ;ue&&ue.z>=ee&&_e&&_e.z<=re;){if(ue.x>=X&&ue.x<=ne&&ue.y>=oe&&ue.y<=j&&ue!==U&&ue!==Q&&l(le,q,se,$,he,J,ue.x,ue.y)&&w(ue.prev,ue,ue.next)>=0||(ue=ue.prevZ,_e.x>=X&&_e.x<=ne&&_e.y>=oe&&_e.y<=j&&_e!==U&&_e!==Q&&l(le,q,se,$,he,J,_e.x,_e.y)&&w(_e.prev,_e,_e.next)>=0))return!1;_e=_e.nextZ}for(;ue&&ue.z>=ee;){if(ue.x>=X&&ue.x<=ne&&ue.y>=oe&&ue.y<=j&&ue!==U&&ue!==Q&&l(le,q,se,$,he,J,ue.x,ue.y)&&w(ue.prev,ue,ue.next)>=0)return!1;ue=ue.prevZ}for(;_e&&_e.z<=re;){if(_e.x>=X&&_e.x<=ne&&_e.y>=oe&&_e.y<=j&&_e!==U&&_e!==Q&&l(le,q,se,$,he,J,_e.x,_e.y)&&w(_e.prev,_e,_e.next)>=0)return!1;_e=_e.nextZ}return!0}function r(B,O,I){var N=B;do{var U=N.prev,W=N.next.next;!S(U,W)&&M(U,N,N.next,W)&&u(U,W)&&u(W,U)&&(O.push(U.i/I|0),O.push(N.i/I|0),O.push(W.i/I|0),L(N),L(N.next),N=B=W),N=N.next}while(N!==B);return A(N)}function o(B,O,I,N,U,W){var Q=B;do{for(var le=Q.next.next;le!==Q.prev;){if(Q.i!==le.i&&_(Q,le)){var se=f(Q,le);Q=A(Q,Q.next),se=A(se,se.next),E(Q,O,I,N,U,W,0),E(se,O,I,N,U,W,0);return}le=le.next}Q=Q.next}while(Q!==B)}function a(B,O,I,N){var U=[],W,Q,le,se,he;for(W=0,Q=O.length;W=I.next.y&&I.next.y!==I.y){var le=I.x+(U-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(le<=N&&le>W&&(W=le,Q=I.x=I.x&&I.x>=he&&N!==I.x&&l(UQ.x||I.x===Q.x&&h(Q,I)))&&(Q=I,$=J)),I=I.next;while(I!==se);return Q}function h(B,O){return w(B.prev,B,O.prev)<0&&w(O.next,B,B.next)<0}function c(B,O,I,N){var U=B;do U.z===0&&(U.z=p(U.x,U.y,O,I,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,m(U)}function m(B){var O,I,N,U,W,Q,le,se,he=1;do{for(I=B,B=null,W=null,Q=0;I;){for(Q++,N=I,le=0,O=0;O0||se>0&&N;)le!==0&&(se===0||!N||I.z<=N.z)?(U=I,I=I.nextZ,le--):(U=N,N=N.nextZ,se--),W?W.nextZ=U:B=U,U.prevZ=W,W=U;I=N}W.nextZ=null,he*=2}while(Q>1);return B}function p(B,O,I,N,U){return B=(B-I)*U|0,O=(O-N)*U|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function T(B){var O=B,I=B;do(O.x=(B-Q)*(W-le)&&(B-Q)*(N-le)>=(I-Q)*(O-le)&&(I-Q)*(W-le)>=(U-Q)*(N-le)}function _(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!v(B,O)&&(u(B,O)&&u(O,B)&&g(B,O)&&(w(B.prev,B,O.prev)||w(B,O.prev,O))||S(B,O)&&w(B.prev,B,B.next)>0&&w(O.prev,O,O.next)>0)}function w(B,O,I){return(O.y-B.y)*(I.x-O.x)-(O.x-B.x)*(I.y-O.y)}function S(B,O){return B.x===O.x&&B.y===O.y}function M(B,O,I,N){var U=b(w(B,O,I)),W=b(w(B,O,N)),Q=b(w(I,N,B)),le=b(w(I,N,O));return!!(U!==W&&Q!==le||U===0&&y(B,I,O)||W===0&&y(B,N,O)||Q===0&&y(I,B,N)||le===0&&y(I,O,N))}function y(B,O,I){return O.x<=Math.max(B.x,I.x)&&O.x>=Math.min(B.x,I.x)&&O.y<=Math.max(B.y,I.y)&&O.y>=Math.min(B.y,I.y)}function b(B){return B>0?1:B<0?-1:0}function v(B,O){var I=B;do{if(I.i!==B.i&&I.next.i!==B.i&&I.i!==O.i&&I.next.i!==O.i&&M(I,I.next,B,O))return!0;I=I.next}while(I!==B);return!1}function u(B,O){return w(B.prev,B,B.next)<0?w(B,O,B.next)>=0&&w(B,B.prev,O)>=0:w(B,O,B.prev)<0||w(B,B.next,O)<0}function g(B,O){var I=B,N=!1,U=(B.x+O.x)/2,W=(B.y+O.y)/2;do I.y>W!=I.next.y>W&&I.next.y!==I.y&&U<(I.next.x-I.x)*(W-I.y)/(I.next.y-I.y)+I.x&&(N=!N),I=I.next;while(I!==B);return N}function f(B,O){var I=new z(B.i,B.x,B.y),N=new z(O.i,O.x,O.y),U=B.next,W=O.prev;return B.next=O,O.prev=B,I.next=U,U.prev=I,N.next=I,I.prev=N,W.next=N,N.prev=W,N}function P(B,O,I,N){var U=new z(B,O,I);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function L(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function z(B,O,I){this.i=B,this.x=O,this.y=I,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(B,O,I,N){var U=O&&O.length,W=U?O[0]*I:B.length,Q=Math.abs(F(B,0,W,I));if(U)for(var le=0,se=O.length;le0&&(N+=B[U-1].length,I.holes.push(N))}return I}}}),iP=We({"node_modules/array-normalize/index.js"(Z,V){"use strict";var d=jp();V.exports=x;function x(A,E,e){if(!A||A.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=d(A,E));for(var t=0;t-1}}}),Y3=We({"node_modules/es5-ext/string/#/contains/index.js"(Z,V){"use strict";V.exports=yP()()?String.prototype.contains:_P()}}),ed=We({"node_modules/d/index.js"(Z,V){"use strict";var d=Gp(),x=X3(),A=U_(),E=Z3(),e=Y3(),t=V.exports=function(r,o){var a,i,n,s,h;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),h={value:o,configurable:a,enumerable:i,writable:n},s?A(E(s),h):h};t.gs=function(r,o,a){var i,n,s,h;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),h={get:o,set:a,configurable:i,enumerable:n},s?A(E(s),h):h}}}),Cg=We({"node_modules/es5-ext/function/is-arguments.js"(Z,V){"use strict";var d=Object.prototype.toString,x=d.call((function(){return arguments})());V.exports=function(A){return d.call(A)===x}}}),Lg=We({"node_modules/es5-ext/string/is-string.js"(Z,V){"use strict";var d=Object.prototype.toString,x=d.call("");V.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||d.call(A)===x)||!1}}}),xP=We({"node_modules/ext/global-this/is-implemented.js"(Z,V){"use strict";V.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),bP=We({"node_modules/ext/global-this/implementation.js"(Z,V){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};V.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}})()}}),Pg=We({"node_modules/ext/global-this/index.js"(Z,V){"use strict";V.exports=xP()()?globalThis:bP()}}),wP=We({"node_modules/es6-symbol/is-implemented.js"(Z,V){"use strict";var d=Pg(),x={object:!0,symbol:!0};V.exports=function(){var A=d.Symbol,E;if(typeof A!="function")return!1;E=A("test symbol");try{String(E)}catch{return!1}return!(!x[typeof A.iterator]||!x[typeof A.toPrimitive]||!x[typeof A.toStringTag])}}}),TP=We({"node_modules/es6-symbol/is-symbol.js"(Z,V){"use strict";V.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),K3=We({"node_modules/es6-symbol/validate-symbol.js"(Z,V){"use strict";var d=TP();V.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),AP=We({"node_modules/es6-symbol/lib/private/generate-name.js"(Z,V){"use strict";var d=ed(),x=Object.create,A=Object.defineProperty,E=Object.prototype,e=x(null);V.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,A(E,o,d.gs(null,function(i){a||(a=!0,A(this,o,d(i)),a=!1)})),o}}}),SP=We({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Z,V){"use strict";var d=ed(),x=Pg().Symbol;V.exports=function(A){return Object.defineProperties(A,{hasInstance:d("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:d("",x&&x.iterator||A("iterator")),match:d("",x&&x.match||A("match")),replace:d("",x&&x.replace||A("replace")),search:d("",x&&x.search||A("search")),species:d("",x&&x.species||A("species")),split:d("",x&&x.split||A("split")),toPrimitive:d("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:d("",x&&x.toStringTag||A("toStringTag")),unscopables:d("",x&&x.unscopables||A("unscopables"))})}}}),MP=We({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Z,V){"use strict";var d=ed(),x=K3(),A=Object.create(null);V.exports=function(E){return Object.defineProperties(E,{for:d(function(e){return A[e]?A[e]:A[e]=E(String(e))}),keyFor:d(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),EP=We({"node_modules/es6-symbol/polyfill.js"(Z,V){"use strict";var d=ed(),x=K3(),A=Pg().Symbol,E=AP(),e=SP(),t=MP(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;n=function(c){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(c)},V.exports=i=function h(c){var m;if(this instanceof h)throw new TypeError("Symbol is not a constructor");return s?A(c):(m=r(n.prototype),c=c===void 0?"":String(c),o(m,{__description__:d("",c),__name__:d("",E(c))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var h=x(this);return typeof h=="symbol"?h:h.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),Wd=We({"node_modules/es6-symbol/index.js"(Z,V){"use strict";V.exports=wP()()?Pg().Symbol:EP()}}),kP=We({"node_modules/es5-ext/array/#/clear.js"(Z,V){"use strict";var d=Qv();V.exports=function(){return d(this).length=0,this}}}),am=We({"node_modules/es5-ext/object/valid-callable.js"(Z,V){"use strict";V.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),CP=We({"node_modules/type/string/coerce.js"(Z,V){"use strict";var d=Gp(),x=N_(),A=Object.prototype.toString;V.exports=function(E){if(!d(E))return null;if(x(E)){var e=E.toString;if(typeof e!="function"||e===A)return null}try{return""+E}catch{return null}}}}),LP=We({"node_modules/type/lib/safe-to-string.js"(Z,V){"use strict";V.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),PP=We({"node_modules/type/lib/to-short-string.js"(Z,V){"use strict";var d=LP(),x=/[\n\r\u2028\u2029]/g;V.exports=function(A){var E=d(A);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"\u2026"),E=E.replace(x,function(e){switch(e){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),J3=We({"node_modules/type/lib/resolve-exception.js"(Z,V){"use strict";var d=Gp(),x=N_(),A=CP(),E=PP(),e=function(t,r){return t.replace("%v",E(r))};V.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=A(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),IP=We({"node_modules/type/value/ensure.js"(Z,V){"use strict";var d=J3(),x=Gp();V.exports=function(A){return x(A)?A:d(A,"Cannot use %v",arguments[1])}}}),RP=We({"node_modules/type/plain-function/ensure.js"(Z,V){"use strict";var d=J3(),x=X3();V.exports=function(A){return x(A)?A:d(A,"%v is not a plain function",arguments[1])}}}),DP=We({"node_modules/es5-ext/array/from/is-implemented.js"(Z,V){"use strict";V.exports=function(){var d=Array.from,x,A;return typeof d!="function"?!1:(x=["raz","dwa"],A=d(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),zP=We({"node_modules/es5-ext/function/is-function.js"(Z,V){"use strict";var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);V.exports=function(A){return typeof A=="function"&&x(d.call(A))}}}),FP=We({"node_modules/es5-ext/math/sign/is-implemented.js"(Z,V){"use strict";V.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),OP=We({"node_modules/es5-ext/math/sign/shim.js"(Z,V){"use strict";V.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),BP=We({"node_modules/es5-ext/math/sign/index.js"(Z,V){"use strict";V.exports=FP()()?Math.sign:OP()}}),NP=We({"node_modules/es5-ext/number/to-integer.js"(Z,V){"use strict";var d=BP(),x=Math.abs,A=Math.floor;V.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:d(E)*A(x(E)))}}}),UP=We({"node_modules/es5-ext/number/to-pos-integer.js"(Z,V){"use strict";var d=NP(),x=Math.max;V.exports=function(A){return x(0,d(A))}}}),jP=We({"node_modules/es5-ext/array/from/shim.js"(Z,V){"use strict";var d=Wd().iterator,x=Cg(),A=zP(),E=UP(),e=am(),t=Qv(),r=Hd(),o=Lg(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;V.exports=function(h){var c=arguments[1],m=arguments[2],p,T,l,_,w,S,M,y,b,v;if(h=Object(t(h)),r(c)&&e(c),!this||this===Array||!A(this)){if(!c){if(x(h))return w=h.length,w!==1?Array.apply(null,h):(_=new Array(1),_[0]=h[0],_);if(a(h)){for(_=new Array(w=h.length),T=0;T=55296&&S<=56319&&(v+=h[++T])),v=c?i.call(c,m,v,l):v,p?(n.value=v,s(_,l,n)):_[l]=v,++l;w=l}}if(w===void 0)for(w=E(h.length),p&&(_=new p(w)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,h){s>=n&&(this.__redo__[h]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(h,c){h>n&&(this.__redo__[c]=--h)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),ZP=We({"node_modules/es6-iterator/array.js"(Z,V){"use strict";var d=B_(),x=Y3(),A=ed(),E=Wd(),e=$3(),t=Object.defineProperty,r;r=V.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,A("c","Array Iterator"))}}),YP=We({"node_modules/es6-iterator/string.js"(Z,V){"use strict";var d=B_(),x=ed(),A=Wd(),E=$3(),e=Object.defineProperty,t;t=V.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),KP=We({"node_modules/es6-iterator/is-iterable.js"(Z,V){"use strict";var d=Cg(),x=Hd(),A=Lg(),E=Wd().iterator,e=Array.isArray;V.exports=function(t){return x(t)?e(t)||A(t)||d(t)?!0:typeof t[E]=="function":!1}}}),JP=We({"node_modules/es6-iterator/valid-iterable.js"(Z,V){"use strict";var d=KP();V.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),Q3=We({"node_modules/es6-iterator/get.js"(Z,V){"use strict";var d=Cg(),x=Lg(),A=ZP(),E=YP(),e=JP(),t=Wd().iterator;V.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new A(r):x(r)?new E(r):new A(r)}}}),$P=We({"node_modules/es6-iterator/for-of.js"(Z,V){"use strict";var d=Cg(),x=am(),A=Lg(),E=Q3(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;V.exports=function(o,a){var i,n=arguments[2],s,h,c,m,p,T,l;if(e(o)||d(o)?i="array":A(o)?i="string":o=E(o),x(a),h=function(){c=!0},i==="array"){r.call(o,function(_){return t.call(a,n,_,h),c});return}if(i==="string"){for(p=o.length,m=0;m=55296&&l<=56319&&(T+=o[++m])),t.call(a,n,T,h),!c);++m);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,h),c)return;s=o.next()}}}}),QP=We({"node_modules/es6-weak-map/is-native-implemented.js"(Z,V){"use strict";V.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),e8=We({"node_modules/es6-weak-map/polyfill.js"(Z,V){"use strict";var d=Hd(),x=B_(),A=uP(),E=Qv(),e=cP(),t=ed(),r=Q3(),o=$P(),a=Wd().toStringTag,i=QP(),n=Array.isArray,s=Object.defineProperty,h=Object.prototype.hasOwnProperty,c=Object.getPrototypeOf,m;V.exports=m=function(){var p=arguments[0],T;if(!(this instanceof m))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==m?x(new WeakMap,c(this)):this,d(p)&&(n(p)||(p=r(p))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),p&&o(p,function(l){E(l),T.set(l[0],l[1])}),T},i&&(x&&x(m,WeakMap),m.prototype=Object.create(WeakMap.prototype,{constructor:t(m)})),Object.defineProperties(m.prototype,{delete:t(function(p){return h.call(A(p),this.__weakMapData__)?(delete p[this.__weakMapData__],!0):!1}),get:t(function(p){if(h.call(A(p),this.__weakMapData__))return p[this.__weakMapData__]}),has:t(function(p){return h.call(A(p),this.__weakMapData__)}),set:t(function(p,T){return s(A(p),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(m.prototype,a,t("c","WeakMap"))}}),eT=We({"node_modules/es6-weak-map/index.js"(Z,V){"use strict";V.exports=oP()()?WeakMap:e8()}}),t8=We({"node_modules/array-find-index/index.js"(Z,V){"use strict";V.exports=function(d,x,A){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var E=Object(d),e=E.length;if(e===0)return-1;for(var t=0;tue)?Ue.tree=f($e,{bounds:Xe}):ue&&ue.length&&(Ue.tree=ue),Ue.tree){var Tt={primitive:"points",usage:"static",data:Ue.tree,type:"uint32"};Ue.elements?Ue.elements(Tt):Ue.elements=N.elements(Tt)}var St=A.float32($e);ie({data:St,usage:"dynamic"});var zt=A.fract32($e,St);return Ee({data:zt,usage:"dynamic"}),We({data:new Uint8Array(Qe),type:"uint8",usage:"stream"}),$e}},{marker:function($e,Ue,fe){var ue=Ue.activation;if(ue.forEach(function(zt){return zt&&zt.destroy&&zt.destroy()}),ue.length=0,!$e||typeof $e[0]=="number"){var ie=y.addMarker($e);ue[ie]=!0}else{for(var Ee=[],We=0,Qe=Math.min($e.length,Ue.count);We=0)return z;var F;if(y instanceof Uint8Array||y instanceof Uint8ClampedArray)F=y;else{F=new Uint8Array(y.length);for(var N=0,O=y.length;NL*4&&(this.tooManyColors=!0),this.updatePalette(R),z.length===1?z[0]:z},b.prototype.updatePalette=function(y){if(!this.tooManyColors){var m=this.maxColors,R=this.paletteTexture,L=Math.ceil(y.length*.25/m);if(L>1){y=y.slice();for(var z=y.length*.25%m;z80*P){le=ve=N[0],ce=G=N[1];for(var se=P;seve&&(ve=Y),ee>G&&(G=ee);V=Math.max(ve-le,G-ce),V=V!==0?32767/V:0}return E(X,$,P,le,ce,V,0),$}function x(N,O,P,U,B){var X,$;if(B===F(N,O,P,U)>0)for(X=O;X=O;X-=U)$=R(X,N[X],N[X+1],$);return $&&A($,$.next)&&(L($),$=$.next),$}function S(N,O){if(!N)return N;O||(O=N);var P=N,U;do if(U=!1,!P.steiner&&(A(P,P.next)||w(P.prev,P,P.next)===0)){if(L(P),P=O=P.prev,P===P.next)break;U=!0}else P=P.next;while(U||P!==O);return O}function E(N,O,P,U,B,X,$){if(N){!$&&X&&f(N,U,B,X);for(var le=N,ce,ve;N.prev!==N.next;){if(ce=N.prev,ve=N.next,X?t(N,U,B,X):e(N)){O.push(ce.i/P|0),O.push(N.i/P|0),O.push(ve.i/P|0),L(N),N=ve.next,le=ve.next;continue}if(N=ve,N===le){$?$===1?(N=r(S(N),O,P),E(N,O,P,U,B,X,2)):$===2&&o(N,O,P,U,B,X):E(S(N),O,P,U,B,X,1);break}}}}function e(N){var O=N.prev,P=N,U=N.next;if(w(O,P,U)>=0)return!1;for(var B=O.x,X=P.x,$=U.x,le=O.y,ce=P.y,ve=U.y,G=BX?B>$?B:$:X>$?X:$,V=le>ce?le>ve?le:ve:ce>ve?ce:ve,se=U.next;se!==O;){if(se.x>=G&&se.x<=ee&&se.y>=Y&&se.y<=V&&l(B,le,X,ce,$,ve,se.x,se.y)&&w(se.prev,se,se.next)>=0)return!1;se=se.next}return!0}function t(N,O,P,U){var B=N.prev,X=N,$=N.next;if(w(B,X,$)>=0)return!1;for(var le=B.x,ce=X.x,ve=$.x,G=B.y,Y=X.y,ee=$.y,V=lece?le>ve?le:ve:ce>ve?ce:ve,j=G>Y?G>ee?G:ee:Y>ee?Y:ee,Q=c(V,se,O,P,U),re=c(ae,j,O,P,U),he=N.prevZ,xe=N.nextZ;he&&he.z>=Q&&xe&&xe.z<=re;){if(he.x>=V&&he.x<=ae&&he.y>=se&&he.y<=j&&he!==B&&he!==$&&l(le,G,ce,Y,ve,ee,he.x,he.y)&&w(he.prev,he,he.next)>=0||(he=he.prevZ,xe.x>=V&&xe.x<=ae&&xe.y>=se&&xe.y<=j&&xe!==B&&xe!==$&&l(le,G,ce,Y,ve,ee,xe.x,xe.y)&&w(xe.prev,xe,xe.next)>=0))return!1;xe=xe.nextZ}for(;he&&he.z>=Q;){if(he.x>=V&&he.x<=ae&&he.y>=se&&he.y<=j&&he!==B&&he!==$&&l(le,G,ce,Y,ve,ee,he.x,he.y)&&w(he.prev,he,he.next)>=0)return!1;he=he.prevZ}for(;xe&&xe.z<=re;){if(xe.x>=V&&xe.x<=ae&&xe.y>=se&&xe.y<=j&&xe!==B&&xe!==$&&l(le,G,ce,Y,ve,ee,xe.x,xe.y)&&w(xe.prev,xe,xe.next)>=0)return!1;xe=xe.nextZ}return!0}function r(N,O,P){var U=N;do{var B=U.prev,X=U.next.next;!A(B,X)&&M(B,U,U.next,X)&&u(B,X)&&u(X,B)&&(O.push(B.i/P|0),O.push(U.i/P|0),O.push(X.i/P|0),L(U),L(U.next),U=N=X),U=U.next}while(U!==N);return S(U)}function o(N,O,P,U,B,X){var $=N;do{for(var le=$.next.next;le!==$.prev;){if($.i!==le.i&&_($,le)){var ce=m($,le);$=S($,$.next),ce=S(ce,ce.next),E($,O,P,U,B,X,0),E(ce,O,P,U,B,X,0);return}le=le.next}$=$.next}while($!==N)}function a(N,O,P,U){var B=[],X,$,le,ce,ve;for(X=0,$=O.length;X<$;X++)le=O[X]*U,ce=X<$-1?O[X+1]*U:N.length,ve=x(N,le,ce,U,!1),ve===ve.next&&(ve.steiner=!0),B.push(T(ve));for(B.sort(i),X=0;X=P.next.y&&P.next.y!==P.y){var le=P.x+(B-P.y)*(P.next.x-P.x)/(P.next.y-P.y);if(le<=U&&le>X&&(X=le,$=P.x=P.x&&P.x>=ve&&U!==P.x&&l(B$.x||P.x===$.x&&h($,P)))&&($=P,Y=ee)),P=P.next;while(P!==ce);return $}function h(N,O){return w(N.prev,N,O.prev)<0&&w(O.next,N,N.next)<0}function f(N,O,P,U){var B=N;do B.z===0&&(B.z=c(B.x,B.y,O,P,U)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==N);B.prevZ.nextZ=null,B.prevZ=null,p(B)}function p(N){var O,P,U,B,X,$,le,ce,ve=1;do{for(P=N,N=null,X=null,$=0;P;){for($++,U=P,le=0,O=0;O0||ce>0&&U;)le!==0&&(ce===0||!U||P.z<=U.z)?(B=P,P=P.nextZ,le--):(B=U,U=U.nextZ,ce--),X?X.nextZ=B:N=B,B.prevZ=X,X=B;P=U}X.nextZ=null,ve*=2}while($>1);return N}function c(N,O,P,U,B){return N=(N-P)*B|0,O=(O-U)*B|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,N|O<<1}function T(N){var O=N,P=N;do(O.x=(N-$)*(X-le)&&(N-$)*(U-le)>=(P-$)*(O-le)&&(P-$)*(X-le)>=(B-$)*(U-le)}function _(N,O){return N.next.i!==O.i&&N.prev.i!==O.i&&!v(N,O)&&(u(N,O)&&u(O,N)&&y(N,O)&&(w(N.prev,N,O.prev)||w(N,O.prev,O))||A(N,O)&&w(N.prev,N,N.next)>0&&w(O.prev,O,O.next)>0)}function w(N,O,P){return(O.y-N.y)*(P.x-O.x)-(O.x-N.x)*(P.y-O.y)}function A(N,O){return N.x===O.x&&N.y===O.y}function M(N,O,P,U){var B=b(w(N,O,P)),X=b(w(N,O,U)),$=b(w(P,U,N)),le=b(w(P,U,O));return!!(B!==X&&$!==le||B===0&&g(N,P,O)||X===0&&g(N,U,O)||$===0&&g(P,N,U)||le===0&&g(P,O,U))}function g(N,O,P){return O.x<=Math.max(N.x,P.x)&&O.x>=Math.min(N.x,P.x)&&O.y<=Math.max(N.y,P.y)&&O.y>=Math.min(N.y,P.y)}function b(N){return N>0?1:N<0?-1:0}function v(N,O){var P=N;do{if(P.i!==N.i&&P.next.i!==N.i&&P.i!==O.i&&P.next.i!==O.i&&M(P,P.next,N,O))return!0;P=P.next}while(P!==N);return!1}function u(N,O){return w(N.prev,N,N.next)<0?w(N,O,N.next)>=0&&w(N,N.prev,O)>=0:w(N,O,N.prev)<0||w(N,N.next,O)<0}function y(N,O){var P=N,U=!1,B=(N.x+O.x)/2,X=(N.y+O.y)/2;do P.y>X!=P.next.y>X&&P.next.y!==P.y&&B<(P.next.x-P.x)*(X-P.y)/(P.next.y-P.y)+P.x&&(U=!U),P=P.next;while(P!==N);return U}function m(N,O){var P=new z(N.i,N.x,N.y),U=new z(O.i,O.x,O.y),B=N.next,X=O.prev;return N.next=O,O.prev=N,P.next=B,B.prev=P,U.next=P,P.prev=U,X.next=U,U.prev=X,U}function R(N,O,P,U){var B=new z(N,O,P);return U?(B.next=U.next,B.prev=U,U.next.prev=B,U.next=B):(B.prev=B,B.next=B),B}function L(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function z(N,O,P){this.i=N,this.x=O,this.y=P,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(N,O,P,U){var B=O&&O.length,X=B?O[0]*P:N.length,$=Math.abs(F(N,0,X,P));if(B)for(var le=0,ce=O.length;le0&&(U+=N[B-1].length,P.holes.push(U))}return P}}}),oP=Ge({"node_modules/array-normalize/index.js"(Z,q){"use strict";var d=Xp();q.exports=x;function x(S,E,e){if(!S||S.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=d(S,E));for(var t=0;t-1}}}),Q3=Ge({"node_modules/es5-ext/string/#/contains/index.js"(Z,q){"use strict";q.exports=_P()()?String.prototype.contains:xP()}}),sd=Ge({"node_modules/d/index.js"(Z,q){"use strict";var d=Kp(),x=J3(),S=Z_(),E=$3(),e=Q3(),t=q.exports=function(r,o){var a,i,n,s,h;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),h={value:o,configurable:a,enumerable:i,writable:n},s?S(E(s),h):h};t.gs=function(r,o,a){var i,n,s,h;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),h={get:o,set:a,configurable:i,enumerable:n},s?S(E(s),h):h}}}),Bg=Ge({"node_modules/es5-ext/function/is-arguments.js"(Z,q){"use strict";var d=Object.prototype.toString,x=d.call((function(){return arguments})());q.exports=function(S){return d.call(S)===x}}}),Ng=Ge({"node_modules/es5-ext/string/is-string.js"(Z,q){"use strict";var d=Object.prototype.toString,x=d.call("");q.exports=function(S){return typeof S=="string"||S&&typeof S=="object"&&(S instanceof String||d.call(S)===x)||!1}}}),bP=Ge({"node_modules/ext/global-this/is-implemented.js"(Z,q){"use strict";q.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),wP=Ge({"node_modules/ext/global-this/implementation.js"(Z,q){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};q.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}})()}}),Ug=Ge({"node_modules/ext/global-this/index.js"(Z,q){"use strict";q.exports=bP()()?globalThis:wP()}}),TP=Ge({"node_modules/es6-symbol/is-implemented.js"(Z,q){"use strict";var d=Ug(),x={object:!0,symbol:!0};q.exports=function(){var S=d.Symbol,E;if(typeof S!="function")return!1;E=S("test symbol");try{String(E)}catch{return!1}return!(!x[typeof S.iterator]||!x[typeof S.toPrimitive]||!x[typeof S.toStringTag])}}}),AP=Ge({"node_modules/es6-symbol/is-symbol.js"(Z,q){"use strict";q.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),eT=Ge({"node_modules/es6-symbol/validate-symbol.js"(Z,q){"use strict";var d=AP();q.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),SP=Ge({"node_modules/es6-symbol/lib/private/generate-name.js"(Z,q){"use strict";var d=sd(),x=Object.create,S=Object.defineProperty,E=Object.prototype,e=x(null);q.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,S(E,o,d.gs(null,function(i){a||(a=!0,S(this,o,d(i)),a=!1)})),o}}}),MP=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Z,q){"use strict";var d=sd(),x=Ug().Symbol;q.exports=function(S){return Object.defineProperties(S,{hasInstance:d("",x&&x.hasInstance||S("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||S("isConcatSpreadable")),iterator:d("",x&&x.iterator||S("iterator")),match:d("",x&&x.match||S("match")),replace:d("",x&&x.replace||S("replace")),search:d("",x&&x.search||S("search")),species:d("",x&&x.species||S("species")),split:d("",x&&x.split||S("split")),toPrimitive:d("",x&&x.toPrimitive||S("toPrimitive")),toStringTag:d("",x&&x.toStringTag||S("toStringTag")),unscopables:d("",x&&x.unscopables||S("unscopables"))})}}}),EP=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Z,q){"use strict";var d=sd(),x=eT(),S=Object.create(null);q.exports=function(E){return Object.defineProperties(E,{for:d(function(e){return S[e]?S[e]:S[e]=E(String(e))}),keyFor:d(function(e){var t;x(e);for(t in S)if(S[t]===e)return t})})}}}),kP=Ge({"node_modules/es6-symbol/polyfill.js"(Z,q){"use strict";var d=sd(),x=eT(),S=Ug().Symbol,E=SP(),e=MP(),t=EP(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof S=="function")try{String(S()),s=!0}catch{}else S=null;n=function(f){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(f)},q.exports=i=function h(f){var p;if(this instanceof h)throw new TypeError("Symbol is not a constructor");return s?S(f):(p=r(n.prototype),f=f===void 0?"":String(f),o(p,{__description__:d("",f),__name__:d("",E(f))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var h=x(this);return typeof h=="symbol"?h:h.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),$d=Ge({"node_modules/es6-symbol/index.js"(Z,q){"use strict";q.exports=TP()()?Ug().Symbol:kP()}}),CP=Ge({"node_modules/es5-ext/array/#/clear.js"(Z,q){"use strict";var d=od();q.exports=function(){return d(this).length=0,this}}}),um=Ge({"node_modules/es5-ext/object/valid-callable.js"(Z,q){"use strict";q.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),LP=Ge({"node_modules/type/string/coerce.js"(Z,q){"use strict";var d=Kp(),x=X_(),S=Object.prototype.toString;q.exports=function(E){if(!d(E))return null;if(x(E)){var e=E.toString;if(typeof e!="function"||e===S)return null}try{return""+E}catch{return null}}}}),PP=Ge({"node_modules/type/lib/safe-to-string.js"(Z,q){"use strict";q.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),IP=Ge({"node_modules/type/lib/to-short-string.js"(Z,q){"use strict";var d=PP(),x=/[\n\r\u2028\u2029]/g;q.exports=function(S){var E=d(S);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"\u2026"),E=E.replace(x,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),tT=Ge({"node_modules/type/lib/resolve-exception.js"(Z,q){"use strict";var d=Kp(),x=X_(),S=LP(),E=IP(),e=function(t,r){return t.replace("%v",E(r))};q.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=S(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),RP=Ge({"node_modules/type/value/ensure.js"(Z,q){"use strict";var d=tT(),x=Kp();q.exports=function(S){return x(S)?S:d(S,"Cannot use %v",arguments[1])}}}),DP=Ge({"node_modules/type/plain-function/ensure.js"(Z,q){"use strict";var d=tT(),x=J3();q.exports=function(S){return x(S)?S:d(S,"%v is not a plain function",arguments[1])}}}),zP=Ge({"node_modules/es5-ext/array/from/is-implemented.js"(Z,q){"use strict";q.exports=function(){var d=Array.from,x,S;return typeof d!="function"?!1:(x=["raz","dwa"],S=d(x),!!(S&&S!==x&&S[1]==="dwa"))}}}),FP=Ge({"node_modules/es5-ext/function/is-function.js"(Z,q){"use strict";var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);q.exports=function(S){return typeof S=="function"&&x(d.call(S))}}}),OP=Ge({"node_modules/es5-ext/math/sign/is-implemented.js"(Z,q){"use strict";q.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),BP=Ge({"node_modules/es5-ext/math/sign/shim.js"(Z,q){"use strict";q.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),NP=Ge({"node_modules/es5-ext/math/sign/index.js"(Z,q){"use strict";q.exports=OP()()?Math.sign:BP()}}),UP=Ge({"node_modules/es5-ext/number/to-integer.js"(Z,q){"use strict";var d=NP(),x=Math.abs,S=Math.floor;q.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:d(E)*S(x(E)))}}}),jP=Ge({"node_modules/es5-ext/number/to-pos-integer.js"(Z,q){"use strict";var d=UP(),x=Math.max;q.exports=function(S){return x(0,d(S))}}}),VP=Ge({"node_modules/es5-ext/array/from/shim.js"(Z,q){"use strict";var d=$d().iterator,x=Bg(),S=FP(),E=jP(),e=um(),t=od(),r=Jd(),o=Ng(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;q.exports=function(h){var f=arguments[1],p=arguments[2],c,T,l,_,w,A,M,g,b,v;if(h=Object(t(h)),r(f)&&e(f),!this||this===Array||!S(this)){if(!f){if(x(h))return w=h.length,w!==1?Array.apply(null,h):(_=new Array(1),_[0]=h[0],_);if(a(h)){for(_=new Array(w=h.length),T=0;T=55296&&A<=56319&&(v+=h[++T])),v=f?i.call(f,p,v,l):v,c?(n.value=v,s(_,l,n)):_[l]=v,++l;w=l}}if(w===void 0)for(w=E(h.length),c&&(_=new c(w)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,h){s>=n&&(this.__redo__[h]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(h,f){h>n&&(this.__redo__[f]=--h)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),YP=Ge({"node_modules/es6-iterator/array.js"(Z,q){"use strict";var d=W_(),x=Q3(),S=sd(),E=$d(),e=rT(),t=Object.defineProperty,r;r=q.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",S("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:S(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,S("c","Array Iterator"))}}),KP=Ge({"node_modules/es6-iterator/string.js"(Z,q){"use strict";var d=W_(),x=sd(),S=$d(),E=rT(),e=Object.defineProperty,t;t=q.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,S.toStringTag,x("c","String Iterator"))}}),JP=Ge({"node_modules/es6-iterator/is-iterable.js"(Z,q){"use strict";var d=Bg(),x=Jd(),S=Ng(),E=$d().iterator,e=Array.isArray;q.exports=function(t){return x(t)?e(t)||S(t)||d(t)?!0:typeof t[E]=="function":!1}}}),$P=Ge({"node_modules/es6-iterator/valid-iterable.js"(Z,q){"use strict";var d=JP();q.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),aT=Ge({"node_modules/es6-iterator/get.js"(Z,q){"use strict";var d=Bg(),x=Ng(),S=YP(),E=KP(),e=$P(),t=$d().iterator;q.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new S(r):x(r)?new E(r):new S(r)}}}),QP=Ge({"node_modules/es6-iterator/for-of.js"(Z,q){"use strict";var d=Bg(),x=um(),S=Ng(),E=aT(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;q.exports=function(o,a){var i,n=arguments[2],s,h,f,p,c,T,l;if(e(o)||d(o)?i="array":S(o)?i="string":o=E(o),x(a),h=function(){f=!0},i==="array"){r.call(o,function(_){return t.call(a,n,_,h),f});return}if(i==="string"){for(c=o.length,p=0;p=55296&&l<=56319&&(T+=o[++p])),t.call(a,n,T,h),!f);++p);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,h),f)return;s=o.next()}}}}),e8=Ge({"node_modules/es6-weak-map/is-native-implemented.js"(Z,q){"use strict";q.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),t8=Ge({"node_modules/es6-weak-map/polyfill.js"(Z,q){"use strict";var d=Jd(),x=W_(),S=cP(),E=od(),e=fP(),t=sd(),r=aT(),o=QP(),a=$d().toStringTag,i=e8(),n=Array.isArray,s=Object.defineProperty,h=Object.prototype.hasOwnProperty,f=Object.getPrototypeOf,p;q.exports=p=function(){var c=arguments[0],T;if(!(this instanceof p))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==p?x(new WeakMap,f(this)):this,d(c)&&(n(c)||(c=r(c))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),c&&o(c,function(l){E(l),T.set(l[0],l[1])}),T},i&&(x&&x(p,WeakMap),p.prototype=Object.create(WeakMap.prototype,{constructor:t(p)})),Object.defineProperties(p.prototype,{delete:t(function(c){return h.call(S(c),this.__weakMapData__)?(delete c[this.__weakMapData__],!0):!1}),get:t(function(c){if(h.call(S(c),this.__weakMapData__))return c[this.__weakMapData__]}),has:t(function(c){return h.call(S(c),this.__weakMapData__)}),set:t(function(c,T){return s(S(c),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(p.prototype,a,t("c","WeakMap"))}}),nT=Ge({"node_modules/es6-weak-map/index.js"(Z,q){"use strict";q.exports=sP()()?WeakMap:t8()}}),r8=Ge({"node_modules/array-find-index/index.js"(Z,q){"use strict";q.exports=function(d,x,S){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,S);if(typeof x!="function")throw new TypeError("predicate must be a function");var E=Object(d),e=E.length;if(e===0)return-1;for(var t=0;tg.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},y=w(A({vert:h,frag:c,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),b;try{b=w(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{b=y}return{fill:w({primitive:"triangle",elements:(u,g)=>g.triangles,offset:0,vert:m,frag:p,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:y,miter:b}},_.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},_.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},_.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((S,M)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>_.precisionThreshold||S.scale[1]*S.viewport.height>_.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=_.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},_.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:S,gl:M}=this;if(w.forEach((b,v)=>{let u=this.passes[v];if(b!==void 0){if(b===null){this.passes[v]=null;return}if(typeof b[0]=="number"&&(b={positions:b}),b=E(b,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),u||(this.passes[v]=u={id:v,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},b=A({},_.defaults,b)),b.thickness!=null&&(u.thickness=parseFloat(b.thickness)),b.opacity!=null&&(u.opacity=parseFloat(b.opacity)),b.miterLimit!=null&&(u.miterLimit=parseFloat(b.miterLimit)),b.overlay!=null&&(u.overlay=!!b.overlay,v<_.maxLines&&(u.depth=2*(_.maxLines-1-v%_.maxLines)/_.maxLines-1)),b.join!=null&&(u.join=b.join),b.hole!=null&&(u.hole=b.hole),b.fill!=null&&(u.fill=b.fill?d(b.fill,"uint8"):null),b.viewport!=null&&(u.viewport=n(b.viewport)),u.viewport||(u.viewport=n([M.drawingBufferWidth,M.drawingBufferHeight])),b.close!=null&&(u.close=b.close),b.positions===null&&(b.positions=[]),b.positions){let P,L;if(b.positions.x&&b.positions.y){let O=b.positions.x,I=b.positions.y;L=u.count=Math.max(O.length,I.length),P=new Float64Array(L*2);for(let N=0;Nse-he),W=[],Q=0,le=u.hole!=null?u.hole[0]:null;if(le!=null){let se=s(U,he=>he>=le);U=U.slice(0,se),U.push(le)}for(let se=0;seJ-le+(U[se]-Q)),$=t(he,q);$=$.map(J=>J+Q+(J+Q{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}}),r8=We({"node_modules/regl-error2d/index.js"(Z,V){"use strict";var d=jp(),x=Ud(),A=V3(),E=Pv(),e=of(),t=Vp(),{float32:r,fract32:o}=O_();V.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h=n._gl,c,m,p,T,l,_,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),m=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=n.buffer({usage:"static",type:"float",data:a}),v(s),c=n({vert:` +`;q.exports=_;function _(w,A){if(!(this instanceof _))return new _(w,A);if(typeof w=="function"?(A||(A={}),A.regl=w):A=w,A.length&&(A.positions=A),w=A.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=_.shaders.has(w)?_.shaders.get(w):_.shaders.set(w,_.createShaders(w)).get(w),this.update(A)}_.dashMult=2,_.maxPatternLength=256,_.precisionThreshold=3e6,_.maxPoints=1e4,_.maxLines=2048,_.shaders=new i,_.createShaders=function(w){let A=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,y)=>y.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(u,y)=>[y.viewport.x,y.viewport.y,u.viewportWidth,u.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,y)=>!y.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},g=w(S({vert:h,frag:f,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),b;try{b=w(S({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{b=g}return{fill:w({primitive:"triangle",elements:(u,y)=>y.triangles,offset:0,vert:p,frag:c,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(u,y)=>[y.viewport.x,y.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:g,miter:b}},_.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},_.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},_.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((A,M)=>{if(A&&Array.isArray(A))return this.draw(...A);typeof A=="number"&&(A=this.passes[A]),A&&A.count>1&&A.opacity&&(this.regl._refresh(),A.fill&&A.triangles&&A.triangles.length>2&&this.shaders.fill(A),A.thickness&&(A.scale[0]*A.viewport.width>_.precisionThreshold||A.scale[1]*A.viewport.height>_.precisionThreshold?this.shaders.rect(A):A.join==="rect"||!A.join&&(A.thickness<=2||A.count>=_.maxPoints)?this.shaders.rect(A):this.shaders.miter(A)))}),this},_.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:A,gl:M}=this;if(w.forEach((b,v)=>{let u=this.passes[v];if(b!==void 0){if(b===null){this.passes[v]=null;return}if(typeof b[0]=="number"&&(b={positions:b}),b=E(b,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),u||(this.passes[v]=u={id:v,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:A.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:A.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},b=S({},_.defaults,b)),b.thickness!=null&&(u.thickness=parseFloat(b.thickness)),b.opacity!=null&&(u.opacity=parseFloat(b.opacity)),b.miterLimit!=null&&(u.miterLimit=parseFloat(b.miterLimit)),b.overlay!=null&&(u.overlay=!!b.overlay,v<_.maxLines&&(u.depth=2*(_.maxLines-1-v%_.maxLines)/_.maxLines-1)),b.join!=null&&(u.join=b.join),b.hole!=null&&(u.hole=b.hole),b.fill!=null&&(u.fill=b.fill?d(b.fill,"uint8"):null),b.viewport!=null&&(u.viewport=n(b.viewport)),u.viewport||(u.viewport=n([M.drawingBufferWidth,M.drawingBufferHeight])),b.close!=null&&(u.close=b.close),b.positions===null&&(b.positions=[]),b.positions){let R,L;if(b.positions.x&&b.positions.y){let O=b.positions.x,P=b.positions.y;L=u.count=Math.max(O.length,P.length),R=new Float64Array(L*2);for(let U=0;Uce-ve),X=[],$=0,le=u.hole!=null?u.hole[0]:null;if(le!=null){let ce=s(B,ve=>ve>=le);B=B.slice(0,ce),B.push(le)}for(let ce=0;ceee-le+(B[ce]-$)),Y=t(ve,G);Y=Y.map(ee=>ee+$+(ee+${w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}}),a8=Ge({"node_modules/regl-error2d/index.js"(Z,q){"use strict";var d=Xp(),x=Wd(),S=W3(),E=Ov(),e=cf(),t=Zp(),{float32:r,fract32:o}=H_();q.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h=n._gl,f,p,c,T,l,_,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},A=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),c=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=n.buffer({usage:"static",type:"float",data:a}),v(s),f=n({vert:` precision highp float; attribute vec2 position, positionFract; @@ -2614,10 +2614,10 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } - `,uniforms:{range:n.prop("range"),lineWidth:n.prop("lineWidth"),capSize:n.prop("capSize"),opacity:n.prop("opacity"),scale:n.prop("scale"),translate:n.prop("translate"),scaleFract:n.prop("scaleFract"),translateFract:n.prop("translateFract"),viewport:(g,f)=>[f.viewport.x,f.viewport.y,g.viewportWidth,g.viewportHeight]},attributes:{color:{buffer:T,offset:(g,f)=>f.offset*4,divisor:1},position:{buffer:m,offset:(g,f)=>f.offset*8,divisor:1},positionFract:{buffer:p,offset:(g,f)=>f.offset*8,divisor:1},error:{buffer:l,offset:(g,f)=>f.offset*16,divisor:1},direction:{buffer:_,stride:24,offset:0},lineOffset:{buffer:_,stride:24,offset:8},capOffset:{buffer:_,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(M,{update:v,draw:y,destroy:u,regl:n,gl:h,canvas:h.canvas,groups:S}),M;function M(g){g?v(g):g===null&&u(),y()}function y(g){if(typeof g=="number")return b(g);g&&!Array.isArray(g)&&(g=[g]),n._refresh(),S.forEach((f,P)=>{if(f){if(g&&(g[P]?f.draw=!0:f.draw=!1),!f.draw){f.draw=!0;return}b(P)}})}function b(g){typeof g=="number"&&(g=S[g]),g!=null&&g&&g.count&&g.color&&g.opacity&&g.positions&&g.positions.length>1&&(g.scaleRatio=[g.scale[0]*g.viewport.width,g.scale[1]*g.viewport.height],c(g),g.after&&g.after(g))}function v(g){if(!g)return;g.length!=null?typeof g[0]=="number"&&(g=[{positions:g}]):Array.isArray(g)||(g=[g]);let f=0,P=0;if(M.groups=S=g.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=E(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},w,F)),A(O,F,[{lineWidth:I=>+I*.5,capSize:I=>+I*.5,opacity:parseFloat,errors:I=>(I=t(I),P+=I.length,I),positions:(I,N)=>(I=t(I,"float64"),N.count=Math.floor(I.length/2),N.bounds=d(I,2),N.offset=f,f+=N.count,I)},{color:(I,N)=>{let U=N.count;if(I||(I="transparent"),!Array.isArray(I)||typeof I[0]=="number"){let Q=I;I=Array(U);for(let le=0;le{let W=N.bounds;return I||(I=W),N.scale=[1/(I[2]-I[0]),1/(I[3]-I[1])],N.translate=[-I[0],-I[1]],N.scaleFract=o(N.scale),N.translateFract=o(N.translate),I},viewport:I=>{let N;return Array.isArray(I)?N={x:I[0],y:I[1],width:I[2]-I[0],height:I[3]-I[1]}:I?(N={x:I.x||I.left||0,y:I.y||I.top||0},I.right?N.width=I.right-N.x:N.width=I.w||I.width||0,I.bottom?N.height=I.bottom-N.y:N.height=I.h||I.height||0):N={x:0,y:0,width:h.drawingBufferWidth,height:h.drawingBufferHeight},N}}]),O}),f||P){let F=S.reduce((N,U,W)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),I=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:W,count:Q,offset:le,color:se,errors:he}=N;Q&&(O.set(se,le*4),I.set(he,le*4),B.set(W,le*2))});var L=r(B);m(L);var z=o(B,L);p(z),T(O),l(I)}}function u(){m.destroy(),p.destroy(),T.destroy(),l.destroy(),_.destroy()}}}}),a8=We({"node_modules/unquote/index.js"(Z,V){var d=/[\'\"]/;V.exports=function(A){return A?(d.test(A.charAt(0))&&(A=A.substr(1)),d.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),rT=We({"node_modules/css-global-keywords/index.json"(Z,V){V.exports=["inherit","initial","unset"]}}),aT=We({"node_modules/css-system-font-keywords/index.json"(Z,V){V.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),nT=We({"node_modules/css-font-weight-keywords/index.json"(Z,V){V.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),iT=We({"node_modules/css-font-style-keywords/index.json"(Z,V){V.exports=["normal","italic","oblique"]}}),oT=We({"node_modules/css-font-stretch-keywords/index.json"(Z,V){V.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),n8=We({"node_modules/parenthesis/index.js"(Z,V){"use strict";function d(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var h=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),c=[];function m(p,T,l){var _=t.push(p.slice(s[0].length,-s[1].length))-1;return c.push(_),o+_+o}t.forEach(function(p,T){for(var l,_=0;p!=l;)if(l=p,p=p.replace(h,m),_++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=p}),c=c.reverse(),t=t.map(function(p){return c.forEach(function(T){p=p.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),p})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,h,c){for(var m=[],p,T=0;p=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");m.push(s.slice(0,p.index)),m.push(n(h[p[1]],h)),s=s.slice(p.index+p[0].length)}return m.push(s),m}return a?t:n(t[0],t)}function x(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(a,n)}return r}return E.reduce(function s(h,c){return Array.isArray(c)&&(c=c.reduce(s,"")),h+c},"");function n(s,h){if(E[h]==null)throw Error("Reference "+h+"is undefined");return E[h]}}function A(E,e){return Array.isArray(E)?x(E,e):d(E,e)}A.parse=d,A.stringify=x,V.exports=A}}),i8=We({"node_modules/string-split-by/index.js"(Z,V){"use strict";var d=n8();V.exports=function(A,E,e){if(A==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var t=d.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var a=[],i=0;i1&&qt===sr&&(qt==='"'||qt==="'"))return['"'+r(tt.substr(1,tt.length-2))+'"'];var ra=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(tt);if(ra)return o(tt.substr(0,ra.index)).concat(o(ra[1])).concat(o(tt.substr(ra.index+ra[0].length)));var da=tt.split(".");if(da.length===1)return['"'+r(tt)+'"'];for(var ca=[],ha=0;ha"u"?1:window.devicePixelRatio,$a=!1,ui={},Mn=function(Zr){},_n=function(){};if(typeof qt=="string"?sr=document.querySelector(qt):typeof qt=="object"&&(_(qt)?sr=qt:w(qt)?(ca=qt,da=ca.canvas):("gl"in qt?ca=qt.gl:"canvas"in qt?da=M(qt.canvas):"container"in qt&&(ra=M(qt.container)),"attributes"in qt&&(ha=qt.attributes),"extensions"in qt&&(Va=S(qt.extensions)),"optionalExtensions"in qt&&(dn=S(qt.optionalExtensions)),"onDone"in qt&&(Mn=qt.onDone),"profile"in qt&&($a=!!qt.profile),"pixelRatio"in qt&&(fn=+qt.pixelRatio),"cachedCode"in qt&&(ui=qt.cachedCode))),sr&&(sr.nodeName.toLowerCase()==="canvas"?da=sr:ra=sr),!ca){if(!da){var Ia=T(ra||document.body,Mn,fn);if(!Ia)return null;da=Ia.canvas,_n=Ia.onDestroy}ha.premultipliedAlpha===void 0&&(ha.premultipliedAlpha=!0),ca=l(da,ha)}return ca?{gl:ca,canvas:da,container:ra,extensions:Va,optionalExtensions:dn,pixelRatio:fn,profile:$a,cachedCode:ui,onDone:Mn,onDestroy:_n}:(_n(),Mn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(tt,qt){var sr={};function ra(ha){var Va=ha.toLowerCase(),dn;try{dn=sr[Va]=tt.getExtension(Va)}catch{}return!!dn}for(var da=0;da65535)<<4,tt>>>=qt,sr=(tt>255)<<3,tt>>>=sr,qt|=sr,sr=(tt>15)<<2,tt>>>=sr,qt|=sr,sr=(tt>3)<<1,tt>>>=sr,qt|=sr,qt|tt>>1}function I(){var tt=v(8,function(){return[]});function qt(ca){var ha=B(ca),Va=tt[O(ha)>>2];return Va.length>0?Va.pop():new ArrayBuffer(ha)}function sr(ca){tt[O(ca.byteLength)>>2].push(ca)}function ra(ca,ha){var Va=null;switch(ca){case u:Va=new Int8Array(qt(ha),0,ha);break;case g:Va=new Uint8Array(qt(ha),0,ha);break;case f:Va=new Int16Array(qt(2*ha),0,ha);break;case P:Va=new Uint16Array(qt(2*ha),0,ha);break;case L:Va=new Int32Array(qt(4*ha),0,ha);break;case z:Va=new Uint32Array(qt(4*ha),0,ha);break;case F:Va=new Float32Array(qt(4*ha),0,ha);break;default:return null}return Va.length!==ha?Va.subarray(0,ha):Va}function da(ca){sr(ca.buffer)}return{alloc:qt,free:sr,allocType:ra,freeType:da}}var N=I();N.zero=I();var U=3408,W=3410,Q=3411,le=3412,se=3413,he=3414,q=3415,$=33901,J=33902,X=3379,oe=3386,ne=34921,j=36347,ee=36348,re=35661,ue=35660,_e=34930,Te=36349,Ie=34076,De=34024,He=7936,et=7937,rt=7938,$e=35724,ot=34047,Ae=36063,ge=34852,ce=3553,ze=34067,Qe=34069,nt=33984,Ke=6408,kt=5126,Et=5121,Bt=36160,jt=36053,_r=36064,pr=16384,Or=function(tt,qt){var sr=1;qt.ext_texture_filter_anisotropic&&(sr=tt.getParameter(ot));var ra=1,da=1;qt.webgl_draw_buffers&&(ra=tt.getParameter(ge),da=tt.getParameter(Ae));var ca=!!qt.oes_texture_float;if(ca){var ha=tt.createTexture();tt.bindTexture(ce,ha),tt.texImage2D(ce,0,Ke,1,1,0,Ke,kt,null);var Va=tt.createFramebuffer();if(tt.bindFramebuffer(Bt,Va),tt.framebufferTexture2D(Bt,_r,ce,ha,0),tt.bindTexture(ce,null),tt.checkFramebufferStatus(Bt)!==jt)ca=!1;else{tt.viewport(0,0,1,1),tt.clearColor(1,0,0,1),tt.clear(pr);var dn=N.allocType(kt,4);tt.readPixels(0,0,1,1,Ke,kt,dn),tt.getError()?ca=!1:(tt.deleteFramebuffer(Va),tt.deleteTexture(ha),ca=dn[0]===1),N.freeType(dn)}}var fn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),$a=!0;if(!fn){var ui=tt.createTexture(),Mn=N.allocType(Et,36);tt.activeTexture(nt),tt.bindTexture(ze,ui),tt.texImage2D(Qe,0,Ke,3,3,0,Ke,Et,Mn),N.freeType(Mn),tt.bindTexture(ze,null),tt.deleteTexture(ui),$a=!tt.getError()}return{colorBits:[tt.getParameter(W),tt.getParameter(Q),tt.getParameter(le),tt.getParameter(se)],depthBits:tt.getParameter(he),stencilBits:tt.getParameter(q),subpixelBits:tt.getParameter(U),extensions:Object.keys(qt).filter(function(_n){return!!qt[_n]}),maxAnisotropic:sr,maxDrawbuffers:ra,maxColorAttachments:da,pointSizeDims:tt.getParameter($),lineWidthDims:tt.getParameter(J),maxViewportDims:tt.getParameter(oe),maxCombinedTextureUnits:tt.getParameter(re),maxCubeMapSize:tt.getParameter(Ie),maxRenderbufferSize:tt.getParameter(De),maxTextureUnits:tt.getParameter(_e),maxTextureSize:tt.getParameter(X),maxAttributes:tt.getParameter(ne),maxVertexUniforms:tt.getParameter(j),maxVertexTextureUnits:tt.getParameter(ue),maxVaryingVectors:tt.getParameter(ee),maxFragmentUniforms:tt.getParameter(Te),glsl:tt.getParameter($e),renderer:tt.getParameter(et),vendor:tt.getParameter(He),version:tt.getParameter(rt),readFloat:ca,npotTextureCube:$a}},mr=function(tt){return tt instanceof Uint8Array||tt instanceof Uint16Array||tt instanceof Uint32Array||tt instanceof Int8Array||tt instanceof Int16Array||tt instanceof Int32Array||tt instanceof Float32Array||tt instanceof Float64Array||tt instanceof Uint8ClampedArray};function Er(tt){return!!tt&&typeof tt=="object"&&Array.isArray(tt.shape)&&Array.isArray(tt.stride)&&typeof tt.offset=="number"&&tt.shape.length===tt.stride.length&&(Array.isArray(tt.data)||mr(tt.data))}var yt=function(tt){return Object.keys(tt).map(function(qt){return tt[qt]})},Oe={shape:Se,flatten:Ee};function Xe(tt,qt,sr){for(var ra=0;ra0){var ai;if(Array.isArray(_a[0])){bn=Ta(_a);for(var Ba=1,Ra=1;Ra0){if(typeof Ba[0]=="number"){var pn=N.allocType(Fa.dtype,Ba.length);Rr(pn,Ba),bn(pn,Un),N.freeType(pn)}else if(Array.isArray(Ba[0])||mr(Ba[0])){An=Ta(Ba);var vn=Na(Ba,An,Fa.dtype);bn(vn,Un),N.freeType(vn)}}}else if(Er(Ba)){An=Ba.shape;var On=Ba.stride,oi=0,bi=0,Tn=0,Zn=0;An.length===1?(oi=An[0],bi=1,Tn=On[0],Zn=0):An.length===2&&(oi=An[0],bi=An[1],Tn=On[0],Zn=On[1]);var gi=Array.isArray(Ba.data)?Fa.dtype:Xt(Ba.data),wi=N.allocType(gi,oi*bi);Yr(wi,Ba.data,oi,bi,Tn,Zn,Ba.offset),bn(wi,Un),N.freeType(wi)}return Cn}return Wa||Cn(Zr),Cn._reglType="buffer",Cn._buffer=Fa,Cn.subdata=ai,sr.profile&&(Cn.stats=Fa.stats),Cn.destroy=function(){Mn(Fa)},Cn}function Ia(){yt(ca).forEach(function(Zr){Zr.buffer=tt.createBuffer(),tt.bindBuffer(Zr.type,Zr.buffer),tt.bufferData(Zr.type,Zr.persistentData||Zr.byteLength,Zr.usage)})}return sr.profile&&(qt.getTotalBufferSize=function(){var Zr=0;return Object.keys(ca).forEach(function(_a){Zr+=ca[_a].stats.size}),Zr}),{create:_n,createStream:dn,destroyStream:fn,clear:function(){yt(ca).forEach(Mn),Va.forEach(Mn)},getBuffer:function(Zr){return Zr&&Zr._buffer instanceof ha?Zr._buffer:null},restore:Ia,_initBuffer:ui}}var ia=0,Pa=0,Ga=1,ja=1,Xa=4,sn=4,Ma={points:ia,point:Pa,lines:Ga,line:ja,triangles:Xa,triangle:sn,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Xn=0,Kn=1,St=4,lt=5120,br=5121,kr=5122,Lr=5123,Tr=5124,Cr=5125,Kr=34963,Nr=35040,_t=35044;function Wt(tt,qt,sr,ra){var da={},ca=0,ha={uint8:br,uint16:Lr};qt.oes_element_index_uint&&(ha.uint32=Cr);function Va(Ia){this.id=ca++,da[this.id]=this,this.buffer=Ia,this.primType=St,this.vertCount=0,this.type=0}Va.prototype.bind=function(){this.buffer.bind()};var dn=[];function fn(Ia){var Zr=dn.pop();return Zr||(Zr=new Va(sr.create(null,Kr,!0,!1)._buffer)),ui(Zr,Ia,Nr,-1,-1,0,0),Zr}function $a(Ia){dn.push(Ia)}function ui(Ia,Zr,_a,Wa,on,Fa,Cn){Ia.buffer.bind();var bn;if(Zr){var ai=Cn;!Cn&&(!mr(Zr)||Er(Zr)&&!mr(Zr.data))&&(ai=qt.oes_element_index_uint?Cr:Lr),sr._initBuffer(Ia.buffer,Zr,_a,ai,3)}else tt.bufferData(Kr,Fa,_a),Ia.buffer.dtype=bn||br,Ia.buffer.usage=_a,Ia.buffer.dimension=3,Ia.buffer.byteLength=Fa;if(bn=Cn,!Cn){switch(Ia.buffer.dtype){case br:case lt:bn=br;break;case Lr:case kr:bn=Lr;break;case Cr:case Tr:bn=Cr;break;default:}Ia.buffer.dtype=bn}Ia.type=bn;var Ba=on;Ba<0&&(Ba=Ia.buffer.byteLength,bn===Lr?Ba>>=1:bn===Cr&&(Ba>>=2)),Ia.vertCount=Ba;var Ra=Wa;if(Wa<0){Ra=St;var Un=Ia.buffer.dimension;Un===1&&(Ra=Xn),Un===2&&(Ra=Kn),Un===3&&(Ra=St)}Ia.primType=Ra}function Mn(Ia){ra.elementsCount--,delete da[Ia.id],Ia.buffer.destroy(),Ia.buffer=null}function _n(Ia,Zr){var _a=sr.create(null,Kr,!0),Wa=new Va(_a._buffer);ra.elementsCount++;function on(Fa){if(!Fa)_a(),Wa.primType=St,Wa.vertCount=0,Wa.type=br;else if(typeof Fa=="number")_a(Fa),Wa.primType=St,Wa.vertCount=Fa|0,Wa.type=br;else{var Cn=null,bn=_t,ai=-1,Ba=-1,Ra=0,Un=0;Array.isArray(Fa)||mr(Fa)||Er(Fa)?Cn=Fa:("data"in Fa&&(Cn=Fa.data),"usage"in Fa&&(bn=za[Fa.usage]),"primitive"in Fa&&(ai=Ma[Fa.primitive]),"count"in Fa&&(Ba=Fa.count|0),"type"in Fa&&(Un=ha[Fa.type]),"length"in Fa?Ra=Fa.length|0:(Ra=Ba,Un===Lr||Un===kr?Ra*=2:(Un===Cr||Un===Tr)&&(Ra*=4))),ui(Wa,Cn,bn,ai,Ba,Ra,Un)}return on}return on(Ia),on._reglType="elements",on._elements=Wa,on.subdata=function(Fa,Cn){return _a.subdata(Fa,Cn),on},on.destroy=function(){Mn(Wa)},on}return{create:_n,createStream:fn,destroyStream:$a,getElements:function(Ia){return typeof Ia=="function"&&Ia._elements instanceof Va?Ia._elements:null},clear:function(){yt(da).forEach(Mn)}}}var Ar=new Float32Array(1),Vr=new Uint32Array(Ar.buffer),ma=5123;function ba(tt){for(var qt=N.allocType(ma,tt.length),sr=0;sr>>31<<15,ca=(ra<<1>>>24)-127,ha=ra>>13&1023;if(ca<-24)qt[sr]=da;else if(ca<-14){var Va=-14-ca;qt[sr]=da+(ha+1024>>Va)}else ca>15?qt[sr]=da+31744:qt[sr]=da+(ca+15<<10)+ha}return qt}function wa(tt){return Array.isArray(tt)||mr(tt)}var $r=34467,ga=3553,jn=34067,an=34069,ei=6408,li=6406,_i=6407,xi=6409,Pi=6410,Li=32854,ri=32855,vo=36194,Eo=32819,uo=32820,ao=33635,mo=34042,Bo=6402,Go=34041,Ko=35904,Qi=35906,eo=36193,Ei=33776,Xi=33777,Jo=33778,ms=33779,_s=35986,ko=35987,Nn=34798,pi=35840,gs=35841,Io=35842,Zi=35843,ys=36196,rs=5121,fs=5123,el=5125,ci=5126,oo=10242,so=10243,js=10497,Es=33071,Ni=33648,Ns=10240,Ks=10241,jo=9728,hs=9729,ks=9984,xs=9985,ll=9986,ql=9987,wu=33170,Yl=4352,kc=4353,ec=4354,vs=34046,Ru=3317,Cc=37440,Ll=37441,nl=37443,Tu=37444,nu=33984,Rs=[ks,ll,xs,ql],Gs=[0,xi,Pi,_i,ei],Qo={};Qo[xi]=Qo[li]=Qo[Bo]=1,Qo[Go]=Qo[Pi]=2,Qo[_i]=Qo[Ko]=3,Qo[ei]=Qo[Qi]=4;function ws(tt){return"[object "+tt+"]"}var Au=ws("HTMLCanvasElement"),fl=ws("OffscreenCanvas"),lu=ws("CanvasRenderingContext2D"),Us=ws("ImageBitmap"),_f=ws("HTMLImageElement"),qo=ws("HTMLVideoElement"),xf=Object.keys(Le).concat([Au,fl,lu,Us,_f,qo]),is=[];is[rs]=1,is[ci]=4,is[eo]=2,is[fs]=2,is[el]=4;var Ui=[];Ui[Li]=2,Ui[ri]=2,Ui[vo]=2,Ui[Go]=4,Ui[Ei]=.5,Ui[Xi]=.5,Ui[Jo]=1,Ui[ms]=1,Ui[_s]=.5,Ui[ko]=1,Ui[Nn]=1,Ui[pi]=.5,Ui[gs]=.25,Ui[Io]=.5,Ui[Zi]=.25,Ui[ys]=.5;function ac(tt){return Array.isArray(tt)&&(tt.length===0||typeof tt[0]=="number")}function uu(tt){if(!Array.isArray(tt))return!1;var qt=tt.length;return!(qt===0||!wa(tt[0]))}function hl(tt){return Object.prototype.toString.call(tt)}function Lc(tt){return hl(tt)===Au}function ju(tt){return hl(tt)===fl}function dc(tt){return hl(tt)===lu}function Tl(tt){return hl(tt)===Us}function Kc(tt){return hl(tt)===_f}function Fc(tt){return hl(tt)===qo}function pc(tt){if(!tt)return!1;var qt=hl(tt);return xf.indexOf(qt)>=0?!0:ac(tt)||uu(tt)||Er(tt)}function tc(tt){return Le[Object.prototype.toString.call(tt)]|0}function Oc(tt,qt){var sr=qt.length;switch(tt.type){case rs:case fs:case el:case ci:var ra=N.allocType(tt.type,sr);ra.set(qt),tt.data=ra;break;case eo:tt.data=ba(qt);break;default:}}function Bc(tt,qt){return N.allocType(tt.type===eo?ci:tt.type,qt)}function cu(tt,qt){tt.type===eo?(tt.data=ba(qt),N.freeType(qt)):tt.data=qt}function Pc(tt,qt,sr,ra,da,ca){for(var ha=tt.width,Va=tt.height,dn=tt.channels,fn=ha*Va*dn,$a=Bc(tt,fn),ui=0,Mn=0;Mn=1;)Va+=ha*dn*dn,dn/=2;return Va}else return ha*sr*ra}function nc(tt,qt,sr,ra,da,ca,ha){var Va={"don't care":Yl,"dont care":Yl,nice:ec,fast:kc},dn={repeat:js,clamp:Es,mirror:Ni},fn={nearest:jo,linear:hs},$a=d({mipmap:ql,"nearest mipmap nearest":ks,"linear mipmap nearest":xs,"nearest mipmap linear":ll,"linear mipmap linear":ql},fn),ui={none:0,browser:Tu},Mn={uint8:rs,rgba4:Eo,rgb565:ao,"rgb5 a1":uo},_n={alpha:li,luminance:xi,"luminance alpha":Pi,rgb:_i,rgba:ei,rgba4:Li,"rgb5 a1":ri,rgb565:vo},Ia={};qt.ext_srgb&&(_n.srgb=Ko,_n.srgba=Qi),qt.oes_texture_float&&(Mn.float32=Mn.float=ci),qt.oes_texture_half_float&&(Mn.float16=Mn["half float"]=eo),qt.webgl_depth_texture&&(d(_n,{depth:Bo,"depth stencil":Go}),d(Mn,{uint16:fs,uint32:el,"depth stencil":mo})),qt.webgl_compressed_texture_s3tc&&d(Ia,{"rgb s3tc dxt1":Ei,"rgba s3tc dxt1":Xi,"rgba s3tc dxt3":Jo,"rgba s3tc dxt5":ms}),qt.webgl_compressed_texture_atc&&d(Ia,{"rgb atc":_s,"rgba atc explicit alpha":ko,"rgba atc interpolated alpha":Nn}),qt.webgl_compressed_texture_pvrtc&&d(Ia,{"rgb pvrtc 4bppv1":pi,"rgb pvrtc 2bppv1":gs,"rgba pvrtc 4bppv1":Io,"rgba pvrtc 2bppv1":Zi}),qt.webgl_compressed_texture_etc1&&(Ia["rgb etc1"]=ys);var Zr=Array.prototype.slice.call(tt.getParameter($r));Object.keys(Ia).forEach(function(ke){var Ye=Ia[ke];Zr.indexOf(Ye)>=0&&(_n[ke]=Ye)});var _a=Object.keys(_n);sr.textureFormats=_a;var Wa=[];Object.keys(_n).forEach(function(ke){var Ye=_n[ke];Wa[Ye]=ke});var on=[];Object.keys(Mn).forEach(function(ke){var Ye=Mn[ke];on[Ye]=ke});var Fa=[];Object.keys(fn).forEach(function(ke){var Ye=fn[ke];Fa[Ye]=ke});var Cn=[];Object.keys($a).forEach(function(ke){var Ye=$a[ke];Cn[Ye]=ke});var bn=[];Object.keys(dn).forEach(function(ke){var Ye=dn[ke];bn[Ye]=ke});var ai=_a.reduce(function(ke,Ye){var vt=_n[Ye];return vt===xi||vt===li||vt===xi||vt===Pi||vt===Bo||vt===Go||qt.ext_srgb&&(vt===Ko||vt===Qi)?ke[vt]=vt:vt===ri||Ye.indexOf("rgba")>=0?ke[vt]=ei:ke[vt]=_i,ke},{});function Ba(){this.internalformat=ei,this.format=ei,this.type=rs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Tu,this.width=0,this.height=0,this.channels=0}function Ra(ke,Ye){ke.internalformat=Ye.internalformat,ke.format=Ye.format,ke.type=Ye.type,ke.compressed=Ye.compressed,ke.premultiplyAlpha=Ye.premultiplyAlpha,ke.flipY=Ye.flipY,ke.unpackAlignment=Ye.unpackAlignment,ke.colorSpace=Ye.colorSpace,ke.width=Ye.width,ke.height=Ye.height,ke.channels=Ye.channels}function Un(ke,Ye){if(!(typeof Ye!="object"||!Ye)){if("premultiplyAlpha"in Ye&&(ke.premultiplyAlpha=Ye.premultiplyAlpha),"flipY"in Ye&&(ke.flipY=Ye.flipY),"alignment"in Ye&&(ke.unpackAlignment=Ye.alignment),"colorSpace"in Ye&&(ke.colorSpace=ui[Ye.colorSpace]),"type"in Ye){var vt=Ye.type;ke.type=Mn[vt]}var Ot=ke.width,dr=ke.height,Dr=ke.channels,ur=!1;"shape"in Ye?(Ot=Ye.shape[0],dr=Ye.shape[1],Ye.shape.length===3&&(Dr=Ye.shape[2],ur=!0)):("radius"in Ye&&(Ot=dr=Ye.radius),"width"in Ye&&(Ot=Ye.width),"height"in Ye&&(dr=Ye.height),"channels"in Ye&&(Dr=Ye.channels,ur=!0)),ke.width=Ot|0,ke.height=dr|0,ke.channels=Dr|0;var pt=!1;if("format"in Ye){var At=Ye.format,Dt=ke.internalformat=_n[At];ke.format=ai[Dt],At in Mn&&("type"in Ye||(ke.type=Mn[At])),At in Ia&&(ke.compressed=!0),pt=!0}!ur&&pt?ke.channels=Qo[ke.format]:ur&&!pt&&ke.channels!==Gs[ke.format]&&(ke.format=ke.internalformat=Gs[ke.channels])}}function An(ke){tt.pixelStorei(Cc,ke.flipY),tt.pixelStorei(Ll,ke.premultiplyAlpha),tt.pixelStorei(nl,ke.colorSpace),tt.pixelStorei(Ru,ke.unpackAlignment)}function pn(){Ba.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function vn(ke,Ye){var vt=null;if(pc(Ye)?vt=Ye:Ye&&(Un(ke,Ye),"x"in Ye&&(ke.xOffset=Ye.x|0),"y"in Ye&&(ke.yOffset=Ye.y|0),pc(Ye.data)&&(vt=Ye.data)),Ye.copy){var Ot=da.viewportWidth,dr=da.viewportHeight;ke.width=ke.width||Ot-ke.xOffset,ke.height=ke.height||dr-ke.yOffset,ke.needsCopy=!0}else if(!vt)ke.width=ke.width||1,ke.height=ke.height||1,ke.channels=ke.channels||4;else if(mr(vt))ke.channels=ke.channels||4,ke.data=vt,!("type"in Ye)&&ke.type===rs&&(ke.type=tc(vt));else if(ac(vt))ke.channels=ke.channels||4,Oc(ke,vt),ke.alignment=1,ke.needsFree=!0;else if(Er(vt)){var Dr=vt.data;!Array.isArray(Dr)&&ke.type===rs&&(ke.type=tc(Dr));var ur=vt.shape,pt=vt.stride,At,Dt,er,lr,ar,cr;ur.length===3?(er=ur[2],cr=pt[2]):(er=1,cr=1),At=ur[0],Dt=ur[1],lr=pt[0],ar=pt[1],ke.alignment=1,ke.width=At,ke.height=Dt,ke.channels=er,ke.format=ke.internalformat=Gs[er],ke.needsFree=!0,Pc(ke,Dr,lr,ar,cr,vt.offset)}else if(Lc(vt)||ju(vt)||dc(vt))Lc(vt)||ju(vt)?ke.element=vt:ke.element=vt.canvas,ke.width=ke.element.width,ke.height=ke.element.height,ke.channels=4;else if(Tl(vt))ke.element=vt,ke.width=vt.width,ke.height=vt.height,ke.channels=4;else if(Kc(vt))ke.element=vt,ke.width=vt.naturalWidth,ke.height=vt.naturalHeight,ke.channels=4;else if(Fc(vt))ke.element=vt,ke.width=vt.videoWidth,ke.height=vt.videoHeight,ke.channels=4;else if(uu(vt)){var nr=ke.width||vt[0].length,Vt=ke.height||vt.length,rr=ke.channels;wa(vt[0][0])?rr=rr||vt[0][0].length:rr=rr||1;for(var Nt=Oe.shape(vt),Pr=1,Hr=0;Hr>=dr,vt.height>>=dr,vn(vt,Ot[dr]),ke.mipmask|=1<=0&&!("faces"in Ye)&&(ke.genMipmaps=!0)}if("mag"in Ye){var Ot=Ye.mag;ke.magFilter=fn[Ot]}var dr=ke.wrapS,Dr=ke.wrapT;if("wrap"in Ye){var ur=Ye.wrap;typeof ur=="string"?dr=Dr=dn[ur]:Array.isArray(ur)&&(dr=dn[ur[0]],Dr=dn[ur[1]])}else{if("wrapS"in Ye){var pt=Ye.wrapS;dr=dn[pt]}if("wrapT"in Ye){var At=Ye.wrapT;Dr=dn[At]}}if(ke.wrapS=dr,ke.wrapT=Dr,"anisotropic"in Ye){var Dt=Ye.anisotropic;ke.anisotropic=Ye.anisotropic}if("mipmap"in Ye){var er=!1;switch(typeof Ye.mipmap){case"string":ke.mipmapHint=Va[Ye.mipmap],ke.genMipmaps=!0,er=!0;break;case"boolean":er=ke.genMipmaps=Ye.mipmap;break;case"object":ke.genMipmaps=!1,er=!0;break;default:}er&&!("min"in Ye)&&(ke.minFilter=ks)}}function rl(ke,Ye){tt.texParameteri(Ye,Ks,ke.minFilter),tt.texParameteri(Ye,Ns,ke.magFilter),tt.texParameteri(Ye,oo,ke.wrapS),tt.texParameteri(Ye,so,ke.wrapT),qt.ext_texture_filter_anisotropic&&tt.texParameteri(Ye,vs,ke.anisotropic),ke.genMipmaps&&(tt.hint(wu,ke.mipmapHint),tt.generateMipmap(Ye))}var Ml=0,ps={},qs=sr.maxTextureUnits,Ys=Array(qs).map(function(){return null});function Ri(ke){Ba.call(this),this.mipmask=0,this.internalformat=ei,this.id=Ml++,this.refCount=1,this.target=ke,this.texture=tt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Xo,ha.profile&&(this.stats={size:0})}function al(ke){tt.activeTexture(nu),tt.bindTexture(ke.target,ke.texture)}function go(){var ke=Ys[0];ke?tt.bindTexture(ke.target,ke.texture):tt.bindTexture(ga,null)}function de(ke){var Ye=ke.texture,vt=ke.unit,Ot=ke.target;vt>=0&&(tt.activeTexture(nu+vt),tt.bindTexture(Ot,null),Ys[vt]=null),tt.deleteTexture(Ye),ke.texture=null,ke.params=null,ke.pixels=null,ke.refCount=0,delete ps[ke.id],ca.textureCount--}d(Ri.prototype,{bind:function(){var ke=this;ke.bindCount+=1;var Ye=ke.unit;if(Ye<0){for(var vt=0;vt0)continue;Ot.unit=-1}Ys[vt]=ke,Ye=vt;break}Ye>=qs,ha.profile&&ca.maxTextureUnits>ar)-er,cr.height=cr.height||(vt.height>>ar)-lr,al(vt),oi(cr,ga,er,lr,ar),go(),Zn(cr),Ot}function Dr(ur,pt){var At=ur|0,Dt=pt|0||At;if(At===vt.width&&Dt===vt.height)return Ot;Ot.width=vt.width=At,Ot.height=vt.height=Dt,al(vt);for(var er=0;vt.mipmask>>er;++er){var lr=At>>er,ar=Dt>>er;if(!lr||!ar)break;tt.texImage2D(ga,er,vt.format,lr,ar,0,vt.format,vt.type,null)}return go(),ha.profile&&(vt.stats.size=Su(vt.internalformat,vt.type,At,Dt,!1,!1)),Ot}return Ot(ke,Ye),Ot.subimage=dr,Ot.resize=Dr,Ot._reglType="texture2d",Ot._texture=vt,ha.profile&&(Ot.stats=vt.stats),Ot.destroy=function(){vt.decRef()},Ot}function me(ke,Ye,vt,Ot,dr,Dr){var ur=new Ri(jn);ps[ur.id]=ur,ca.cubeCount++;var pt=new Array(6);function At(lr,ar,cr,nr,Vt,rr){var Nt,Pr=ur.texInfo;for(Xo.call(Pr),Nt=0;Nt<6;++Nt)pt[Nt]=Ji();if(typeof lr=="number"||!lr){var Hr=lr|0||1;for(Nt=0;Nt<6;++Nt)wi(pt[Nt],Hr,Hr)}else if(typeof lr=="object")if(ar)Ii(pt[0],lr),Ii(pt[1],ar),Ii(pt[2],cr),Ii(pt[3],nr),Ii(pt[4],Vt),Ii(pt[5],rr);else if(Qs(Pr,lr),Un(ur,lr),"faces"in lr){var fa=lr.faces;for(Nt=0;Nt<6;++Nt)Ra(pt[Nt],ur),Ii(pt[Nt],fa[Nt])}else for(Nt=0;Nt<6;++Nt)Ii(pt[Nt],lr);for(Ra(ur,pt[0]),Pr.genMipmaps?ur.mipmask=(pt[0].width<<1)-1:ur.mipmask=pt[0].mipmask,ur.internalformat=pt[0].internalformat,At.width=pt[0].width,At.height=pt[0].height,al(ur),Nt=0;Nt<6;++Nt)cs(pt[Nt],an+Nt);for(rl(Pr,jn),go(),ha.profile&&(ur.stats.size=Su(ur.internalformat,ur.type,At.width,At.height,Pr.genMipmaps,!0)),At.format=Wa[ur.internalformat],At.type=on[ur.type],At.mag=Fa[Pr.magFilter],At.min=Cn[Pr.minFilter],At.wrapS=bn[Pr.wrapS],At.wrapT=bn[Pr.wrapT],Nt=0;Nt<6;++Nt)yl(pt[Nt]);return At}function Dt(lr,ar,cr,nr,Vt){var rr=cr|0,Nt=nr|0,Pr=Vt|0,Hr=Tn();return Ra(Hr,ur),Hr.width=0,Hr.height=0,vn(Hr,ar),Hr.width=Hr.width||(ur.width>>Pr)-rr,Hr.height=Hr.height||(ur.height>>Pr)-Nt,al(ur),oi(Hr,an+lr,rr,Nt,Pr),go(),Zn(Hr),At}function er(lr){var ar=lr|0;if(ar!==ur.width){At.width=ur.width=ar,At.height=ur.height=ar,al(ur);for(var cr=0;cr<6;++cr)for(var nr=0;ur.mipmask>>nr;++nr)tt.texImage2D(an+cr,nr,ur.format,ar>>nr,ar>>nr,0,ur.format,ur.type,null);return go(),ha.profile&&(ur.stats.size=Su(ur.internalformat,ur.type,At.width,At.height,!1,!0)),At}}return At(ke,Ye,vt,Ot,dr,Dr),At.subimage=Dt,At.resize=er,At._reglType="textureCube",At._texture=ur,ha.profile&&(At.stats=ur.stats),At.destroy=function(){ur.decRef()},At}function te(){for(var ke=0;ke>Ot,vt.height>>Ot,0,vt.internalformat,vt.type,null);else for(var dr=0;dr<6;++dr)tt.texImage2D(an+dr,Ot,vt.internalformat,vt.width>>Ot,vt.height>>Ot,0,vt.internalformat,vt.type,null);rl(vt.texInfo,vt.target)})}function Ve(){for(var ke=0;ke=0?yl=!0:dn.indexOf(Xo)>=0&&(yl=!1))),("depthTexture"in Ri||"depthStencilTexture"in Ri)&&(Ys=!!(Ri.depthTexture||Ri.depthStencilTexture)),"depth"in Ri&&(typeof Ri.depth=="boolean"?cs=Ri.depth:(Ml=Ri.depth,Zs=!1)),"stencil"in Ri&&(typeof Ri.stencil=="boolean"?Zs=Ri.stencil:(ps=Ri.stencil,cs=!1)),"depthStencil"in Ri&&(typeof Ri.depthStencil=="boolean"?cs=Zs=Ri.depthStencil:(qs=Ri.depthStencil,cs=!1,Zs=!1))}var go=null,de=null,Y=null,me=null;if(Array.isArray(Ji))go=Ji.map(Ia);else if(Ji)go=[Ia(Ji)];else for(go=new Array(rl),gi=0;gi0&&(Zn.depth=vn[0].depth,Zn.stencil=vn[0].stencil,Zn.depthStencil=vn[0].depthStencil),vn[Tn]?vn[Tn](Zn):vn[Tn]=Ra(Zn)}return d(On,{width:gi,height:gi,color:Xo})}function oi(bi){var Tn,Zn=bi|0;if(Zn===On.width)return On;var gi=On.color;for(Tn=0;Tn=gi.byteLength?wi.subdata(gi):(wi.destroy(),Ra.buffers[bi]=null)),Ra.buffers[bi]||(wi=Ra.buffers[bi]=da.create(Tn,Tc,!1,!0)),Zn.buffer=da.getBuffer(wi),Zn.size=Zn.buffer.dimension|0,Zn.normalized=!1,Zn.type=Zn.buffer.dtype,Zn.offset=0,Zn.stride=0,Zn.divisor=0,Zn.state=1,On[bi]=1}else da.getBuffer(Tn)?(Zn.buffer=da.getBuffer(Tn),Zn.size=Zn.buffer.dimension|0,Zn.normalized=!1,Zn.type=Zn.buffer.dtype,Zn.offset=0,Zn.stride=0,Zn.divisor=0,Zn.state=1):da.getBuffer(Tn.buffer)?(Zn.buffer=da.getBuffer(Tn.buffer),Zn.size=(+Tn.size||Zn.buffer.dimension)|0,Zn.normalized=!!Tn.normalized||!1,"type"in Tn?Zn.type=oa[Tn.type]:Zn.type=Zn.buffer.dtype,Zn.offset=(Tn.offset||0)|0,Zn.stride=(Tn.stride||0)|0,Zn.divisor=(Tn.divisor||0)|0,Zn.state=1):"x"in Tn&&(Zn.x=+Tn.x||0,Zn.y=+Tn.y||0,Zn.z=+Tn.z||0,Zn.w=+Tn.w||0,Zn.state=2)}for(var Ii=0;Ii1)for(var An=0;AnZr&&(Zr=_a.stats.uniformsCount)}),Zr},sr.getMaxAttributesCount=function(){var Zr=0;return $a.forEach(function(_a){_a.stats.attributesCount>Zr&&(Zr=_a.stats.attributesCount)}),Zr});function Ia(){da={},ca={};for(var Zr=0;Zr<$a.length;++Zr)_n($a[Zr],null,$a[Zr].attributes.map(function(_a){return[_a.location,_a.name]}))}return{clear:function(){var Zr=tt.deleteShader.bind(tt);yt(da).forEach(Zr),da={},yt(ca).forEach(Zr),ca={},$a.forEach(function(_a){tt.deleteProgram(_a.program)}),$a.length=0,fn={},sr.shaderCount=0},program:function(Zr,_a,Wa,on){var Fa=fn[_a];Fa||(Fa=fn[_a]={});var Cn=Fa[Zr];if(Cn&&(Cn.refCount++,!on))return Cn;var bn=new Mn(_a,Zr);return sr.shaderCount++,_n(bn,Wa,on),Cn||(Fa[Zr]=bn),$a.push(bn),d(bn,{destroy:function(){if(bn.refCount--,bn.refCount<=0){tt.deleteProgram(bn.program);var ai=$a.indexOf(bn);$a.splice(ai,1),sr.shaderCount--}Fa[bn.vertId].refCount<=0&&(tt.deleteShader(ca[bn.vertId]),delete ca[bn.vertId],delete fn[bn.fragId][bn.vertId]),Object.keys(fn[bn.fragId]).length||(tt.deleteShader(da[bn.fragId]),delete da[bn.fragId],delete fn[bn.fragId])}})},restore:Ia,shader:dn,frag:-1,vert:-1}}var Ac=6408,hu=5121,sc=3333,Dc=5126;function Cl(tt,qt,sr,ra,da,ca,ha){function Va($a){var ui;qt.next===null?ui=hu:ui=qt.next.colorAttachments[0].texture._texture.type;var Mn=0,_n=0,Ia=ra.framebufferWidth,Zr=ra.framebufferHeight,_a=null;mr($a)?_a=$a:$a&&(Mn=$a.x|0,_n=$a.y|0,Ia=($a.width||ra.framebufferWidth-Mn)|0,Zr=($a.height||ra.framebufferHeight-_n)|0,_a=$a.data||null),sr();var Wa=Ia*Zr*4;return _a||(ui===hu?_a=new Uint8Array(Wa):ui===Dc&&(_a=_a||new Float32Array(Wa))),tt.pixelStorei(sc,4),tt.readPixels(Mn,_n,Ia,Zr,Ac,ui,_a),_a}function dn($a){var ui;return qt.setFBO({framebuffer:$a.framebuffer},function(){ui=Va($a)}),ui}function fn($a){return!$a||!("framebuffer"in $a)?Va($a):dn($a)}return fn}var Vc=0,vu="";function Wu(tt){return jl(Fu(Mu(tt)))}function Fu(tt){return Yt(wn(Zu(tt),tt.length*8))}function vl(tt,qt){var sr=Zu(tt);sr.length>16&&(sr=wn(sr,tt.length*8));for(var ra=Array(16),da=Array(16),ca=0;ca<16;ca++)ra[ca]=sr[ca]^909522486,da[ca]=sr[ca]^1549556828;var ha=wn(ra.concat(Zu(qt)),512+qt.length*8);return Yt(wn(da.concat(ha),768))}function jl(tt){for(var qt=Vc?"0123456789ABCDEF":"0123456789abcdef",sr="",ra,da=0;da>>4&15)+qt.charAt(ra&15);return sr}function Xu(tt){for(var qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sr="",ra=tt.length,da=0;datt.length*8?sr+=vu:sr+=qt.charAt(ca>>>6*(3-ha)&63);return sr}function lc(tt,qt){var sr=qt.length,ra=Array(),da,ca,ha,Va,dn=Array(Math.ceil(tt.length/2));for(da=0;da0;){for(Va=Array(),ha=0,da=0;da0||ca>0)&&(Va[Va.length]=ca);ra[ra.length]=ha,dn=Va}var fn="";for(da=ra.length-1;da>=0;da--)fn+=qt.charAt(ra[da]);var $a=Math.ceil(tt.length*8/(Math.log(qt.length)/Math.log(2)));for(da=fn.length;da<$a;da++)fn=qt[0]+fn;return fn}function Mu(tt){for(var qt="",sr=-1,ra,da;++sr>>6&31,128|ra&63):ra<=65535?qt+=String.fromCharCode(224|ra>>>12&15,128|ra>>>6&63,128|ra&63):ra<=2097151&&(qt+=String.fromCharCode(240|ra>>>18&7,128|ra>>>12&63,128|ra>>>6&63,128|ra&63));return qt}function Zu(tt){for(var qt=Array(tt.length>>2),sr=0;sr>5]|=(tt.charCodeAt(sr/8)&255)<<24-sr%32;return qt}function Yt(tt){for(var qt="",sr=0;sr>5]>>>24-sr%32&255);return qt}function vr(tt,qt){return tt>>>qt|tt<<32-qt}function Qr(tt,qt){return tt>>>qt}function Wr(tt,qt,sr){return tt&qt^~tt&sr}function xa(tt,qt,sr){return tt&qt^tt&sr^qt&sr}function Qa(tt){return vr(tt,2)^vr(tt,13)^vr(tt,22)}function xn(tt){return vr(tt,6)^vr(tt,11)^vr(tt,25)}function zn(tt){return vr(tt,7)^vr(tt,18)^Qr(tt,3)}function Gn(tt){return vr(tt,17)^vr(tt,19)^Qr(tt,10)}var ni=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function wn(tt,qt){var sr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ra=new Array(64),da,ca,ha,Va,dn,fn,$a,ui,Mn,_n,Ia,Zr;for(tt[qt>>5]|=128<<24-qt%32,tt[(qt+64>>9<<4)+15]=qt,Mn=0;Mn>16)+(qt>>16)+(sr>>16);return ra<<16|sr&65535}function Ln(tt){return Array.prototype.slice.call(tt)}function un(tt){return Ln(tt).join("")}function mi(tt){var qt=tt&&tt.cache,sr=0,ra=[],da=[],ca=[];function ha(Ia,Zr){var _a=Zr&&Zr.stable;if(!_a){for(var Wa=0;Wa0&&(Ia.push(on,"="),Ia.push.apply(Ia,Ln(arguments)),Ia.push(";")),on}return d(Zr,{def:Wa,toString:function(){return un([_a.length>0?"var "+_a.join(",")+";":"",un(Ia)])}})}function dn(){var Ia=Va(),Zr=Va(),_a=Ia.toString,Wa=Zr.toString;function on(Fa,Cn){Zr(Fa,Cn,"=",Ia.def(Fa,Cn),";")}return d(function(){Ia.apply(Ia,Ln(arguments))},{def:Ia.def,entry:Ia,exit:Zr,save:on,set:function(Fa,Cn,bn){on(Fa,Cn),Ia(Fa,Cn,"=",bn,";")},toString:function(){return _a()+Wa()}})}function fn(){var Ia=un(arguments),Zr=dn(),_a=dn(),Wa=Zr.toString,on=_a.toString;return d(Zr,{then:function(){return Zr.apply(Zr,Ln(arguments)),this},else:function(){return _a.apply(_a,Ln(arguments)),this},toString:function(){var Fa=on();return Fa&&(Fa="else{"+Fa+"}"),un(["if(",Ia,"){",Wa(),"}",Fa])}})}var $a=Va(),ui={};function Mn(Ia,Zr){var _a=[];function Wa(){var ai="a"+_a.length;return _a.push(ai),ai}Zr=Zr||0;for(var on=0;on[m.viewport.x,m.viewport.y,y.viewportWidth,y.viewportHeight]},attributes:{color:{buffer:T,offset:(y,m)=>m.offset*4,divisor:1},position:{buffer:p,offset:(y,m)=>m.offset*8,divisor:1},positionFract:{buffer:c,offset:(y,m)=>m.offset*8,divisor:1},error:{buffer:l,offset:(y,m)=>m.offset*16,divisor:1},direction:{buffer:_,stride:24,offset:0},lineOffset:{buffer:_,stride:24,offset:8},capOffset:{buffer:_,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(M,{update:v,draw:g,destroy:u,regl:n,gl:h,canvas:h.canvas,groups:A}),M;function M(y){y?v(y):y===null&&u(),g()}function g(y){if(typeof y=="number")return b(y);y&&!Array.isArray(y)&&(y=[y]),n._refresh(),A.forEach((m,R)=>{if(m){if(y&&(y[R]?m.draw=!0:m.draw=!1),!m.draw){m.draw=!0;return}b(R)}})}function b(y){typeof y=="number"&&(y=A[y]),y!=null&&y&&y.count&&y.color&&y.opacity&&y.positions&&y.positions.length>1&&(y.scaleRatio=[y.scale[0]*y.viewport.width,y.scale[1]*y.viewport.height],f(y),y.after&&y.after(y))}function v(y){if(!y)return;y.length!=null?typeof y[0]=="number"&&(y=[{positions:y}]):Array.isArray(y)||(y=[y]);let m=0,R=0;if(M.groups=A=y.map((F,N)=>{let O=A[N];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=E(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),O||(A[N]=O={id:N,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},w,F)),S(O,F,[{lineWidth:P=>+P*.5,capSize:P=>+P*.5,opacity:parseFloat,errors:P=>(P=t(P),R+=P.length,P),positions:(P,U)=>(P=t(P,"float64"),U.count=Math.floor(P.length/2),U.bounds=d(P,2),U.offset=m,m+=U.count,P)},{color:(P,U)=>{let B=U.count;if(P||(P="transparent"),!Array.isArray(P)||typeof P[0]=="number"){let $=P;P=Array(B);for(let le=0;le{let X=U.bounds;return P||(P=X),U.scale=[1/(P[2]-P[0]),1/(P[3]-P[1])],U.translate=[-P[0],-P[1]],U.scaleFract=o(U.scale),U.translateFract=o(U.translate),P},viewport:P=>{let U;return Array.isArray(P)?U={x:P[0],y:P[1],width:P[2]-P[0],height:P[3]-P[1]}:P?(U={x:P.x||P.left||0,y:P.y||P.top||0},P.right?U.width=P.right-U.x:U.width=P.w||P.width||0,P.bottom?U.height=P.bottom-U.y:U.height=P.h||P.height||0):U={x:0,y:0,width:h.drawingBufferWidth,height:h.drawingBufferHeight},U}}]),O}),m||R){let F=A.reduce((U,B,X)=>U+(B?B.count:0),0),N=new Float64Array(F*2),O=new Uint8Array(F*4),P=new Float32Array(F*4);A.forEach((U,B)=>{if(!U)return;let{positions:X,count:$,offset:le,color:ce,errors:ve}=U;$&&(O.set(ce,le*4),P.set(ve,le*4),N.set(X,le*2))});var L=r(N);p(L);var z=o(N,L);c(z),T(O),l(P)}}function u(){p.destroy(),c.destroy(),T.destroy(),l.destroy(),_.destroy()}}}}),n8=Ge({"node_modules/unquote/index.js"(Z,q){var d=/[\'\"]/;q.exports=function(S){return S?(d.test(S.charAt(0))&&(S=S.substr(1)),d.test(S.charAt(S.length-1))&&(S=S.substr(0,S.length-1)),S):""}}}),oT=Ge({"node_modules/css-global-keywords/index.json"(Z,q){q.exports=["inherit","initial","unset"]}}),sT=Ge({"node_modules/css-system-font-keywords/index.json"(Z,q){q.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),lT=Ge({"node_modules/css-font-weight-keywords/index.json"(Z,q){q.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),uT=Ge({"node_modules/css-font-style-keywords/index.json"(Z,q){q.exports=["normal","italic","oblique"]}}),cT=Ge({"node_modules/css-font-stretch-keywords/index.json"(Z,q){q.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),i8=Ge({"node_modules/parenthesis/index.js"(Z,q){"use strict";function d(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var h=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),f=[];function p(c,T,l){var _=t.push(c.slice(s[0].length,-s[1].length))-1;return f.push(_),o+_+o}t.forEach(function(c,T){for(var l,_=0;c!=l;)if(l=c,c=c.replace(h,p),_++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=c}),f=f.reverse(),t=t.map(function(c){return f.forEach(function(T){c=c.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),c})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,h,f){for(var p=[],c,T=0;c=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");p.push(s.slice(0,c.index)),p.push(n(h[c[1]],h)),s=s.slice(c.index+c[0].length)}return p.push(s),p}return a?t:n(t[0],t)}function x(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(a,n)}return r}return E.reduce(function s(h,f){return Array.isArray(f)&&(f=f.reduce(s,"")),h+f},"");function n(s,h){if(E[h]==null)throw Error("Reference "+h+"is undefined");return E[h]}}function S(E,e){return Array.isArray(E)?x(E,e):d(E,e)}S.parse=d,S.stringify=x,q.exports=S}}),o8=Ge({"node_modules/string-split-by/index.js"(Z,q){"use strict";var d=i8();q.exports=function(S,E,e){if(S==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var t=d.parse(S,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var a=[],i=0;i1&&Gt===or&&(Gt==='"'||Gt==="'"))return['"'+r(tt.substr(1,tt.length-2))+'"'];var ea=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(tt);if(ea)return o(tt.substr(0,ea.index)).concat(o(ea[1])).concat(o(tt.substr(ea.index+ea[0].length)));var pa=tt.split(".");if(pa.length===1)return['"'+r(tt)+'"'];for(var la=[],fa=0;fa"u"?1:window.devicePixelRatio,Ja=!1,si={},Mn=function(Zr){},yn=function(){};if(typeof Gt=="string"?or=document.querySelector(Gt):typeof Gt=="object"&&(_(Gt)?or=Gt:w(Gt)?(la=Gt,pa=la.canvas):("gl"in Gt?la=Gt.gl:"canvas"in Gt?pa=M(Gt.canvas):"container"in Gt&&(ea=M(Gt.container)),"attributes"in Gt&&(fa=Gt.attributes),"extensions"in Gt&&(ja=A(Gt.extensions)),"optionalExtensions"in Gt&&(hn=A(Gt.optionalExtensions)),"onDone"in Gt&&(Mn=Gt.onDone),"profile"in Gt&&(Ja=!!Gt.profile),"pixelRatio"in Gt&&(un=+Gt.pixelRatio),"cachedCode"in Gt&&(si=Gt.cachedCode))),or&&(or.nodeName.toLowerCase()==="canvas"?pa=or:ea=or),!la){if(!pa){var Pa=T(ea||document.body,Mn,un);if(!Pa)return null;pa=Pa.canvas,yn=Pa.onDestroy}fa.premultipliedAlpha===void 0&&(fa.premultipliedAlpha=!0),la=l(pa,fa)}return la?{gl:la,canvas:pa,container:ea,extensions:ja,optionalExtensions:hn,pixelRatio:un,profile:Ja,cachedCode:si,onDone:Mn,onDestroy:yn}:(yn(),Mn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(tt,Gt){var or={};function ea(fa){var ja=fa.toLowerCase(),hn;try{hn=or[ja]=tt.getExtension(ja)}catch{}return!!hn}for(var pa=0;pa65535)<<4,tt>>>=Gt,or=(tt>255)<<3,tt>>>=or,Gt|=or,or=(tt>15)<<2,tt>>>=or,Gt|=or,or=(tt>3)<<1,tt>>>=or,Gt|=or,Gt|tt>>1}function P(){var tt=v(8,function(){return[]});function Gt(la){var fa=N(la),ja=tt[O(fa)>>2];return ja.length>0?ja.pop():new ArrayBuffer(fa)}function or(la){tt[O(la.byteLength)>>2].push(la)}function ea(la,fa){var ja=null;switch(la){case u:ja=new Int8Array(Gt(fa),0,fa);break;case y:ja=new Uint8Array(Gt(fa),0,fa);break;case m:ja=new Int16Array(Gt(2*fa),0,fa);break;case R:ja=new Uint16Array(Gt(2*fa),0,fa);break;case L:ja=new Int32Array(Gt(4*fa),0,fa);break;case z:ja=new Uint32Array(Gt(4*fa),0,fa);break;case F:ja=new Float32Array(Gt(4*fa),0,fa);break;default:return null}return ja.length!==fa?ja.subarray(0,fa):ja}function pa(la){or(la.buffer)}return{alloc:Gt,free:or,allocType:ea,freeType:pa}}var U=P();U.zero=P();var B=3408,X=3410,$=3411,le=3412,ce=3413,ve=3414,G=3415,Y=33901,ee=33902,V=3379,se=3386,ae=34921,j=36347,Q=36348,re=35661,he=35660,xe=34930,Te=36349,Le=34076,Pe=34024,qe=7936,et=7937,rt=7938,$e=35724,Ue=34047,fe=36063,ue=34852,ie=3553,Ee=34067,We=34069,Qe=33984,Xe=6408,Tt=5126,St=5121,zt=36160,Ut=36053,br=36064,hr=16384,Or=function(tt,Gt){var or=1;Gt.ext_texture_filter_anisotropic&&(or=tt.getParameter(Ue));var ea=1,pa=1;Gt.webgl_draw_buffers&&(ea=tt.getParameter(ue),pa=tt.getParameter(fe));var la=!!Gt.oes_texture_float;if(la){var fa=tt.createTexture();tt.bindTexture(ie,fa),tt.texImage2D(ie,0,Xe,1,1,0,Xe,Tt,null);var ja=tt.createFramebuffer();if(tt.bindFramebuffer(zt,ja),tt.framebufferTexture2D(zt,br,ie,fa,0),tt.bindTexture(ie,null),tt.checkFramebufferStatus(zt)!==Ut)la=!1;else{tt.viewport(0,0,1,1),tt.clearColor(1,0,0,1),tt.clear(hr);var hn=U.allocType(Tt,4);tt.readPixels(0,0,1,1,Xe,Tt,hn),tt.getError()?la=!1:(tt.deleteFramebuffer(ja),tt.deleteTexture(fa),la=hn[0]===1),U.freeType(hn)}}var un=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ja=!0;if(!un){var si=tt.createTexture(),Mn=U.allocType(St,36);tt.activeTexture(Qe),tt.bindTexture(Ee,si),tt.texImage2D(We,0,Xe,3,3,0,Xe,St,Mn),U.freeType(Mn),tt.bindTexture(Ee,null),tt.deleteTexture(si),Ja=!tt.getError()}return{colorBits:[tt.getParameter(X),tt.getParameter($),tt.getParameter(le),tt.getParameter(ce)],depthBits:tt.getParameter(ve),stencilBits:tt.getParameter(G),subpixelBits:tt.getParameter(B),extensions:Object.keys(Gt).filter(function(yn){return!!Gt[yn]}),maxAnisotropic:or,maxDrawbuffers:ea,maxColorAttachments:pa,pointSizeDims:tt.getParameter(Y),lineWidthDims:tt.getParameter(ee),maxViewportDims:tt.getParameter(se),maxCombinedTextureUnits:tt.getParameter(re),maxCubeMapSize:tt.getParameter(Le),maxRenderbufferSize:tt.getParameter(Pe),maxTextureUnits:tt.getParameter(xe),maxTextureSize:tt.getParameter(V),maxAttributes:tt.getParameter(ae),maxVertexUniforms:tt.getParameter(j),maxVertexTextureUnits:tt.getParameter(he),maxVaryingVectors:tt.getParameter(Q),maxFragmentUniforms:tt.getParameter(Te),glsl:tt.getParameter($e),renderer:tt.getParameter(et),vendor:tt.getParameter(qe),version:tt.getParameter(rt),readFloat:la,npotTextureCube:Ja}},wr=function(tt){return tt instanceof Uint8Array||tt instanceof Uint16Array||tt instanceof Uint32Array||tt instanceof Int8Array||tt instanceof Int16Array||tt instanceof Int32Array||tt instanceof Float32Array||tt instanceof Float64Array||tt instanceof Uint8ClampedArray};function Er(tt){return!!tt&&typeof tt=="object"&&Array.isArray(tt.shape)&&Array.isArray(tt.stride)&&typeof tt.offset=="number"&&tt.shape.length===tt.stride.length&&(Array.isArray(tt.data)||wr(tt.data))}var mt=function(tt){return Object.keys(tt).map(function(Gt){return tt[Gt]})},ze={shape:nt,flatten:He};function Ze(tt,Gt,or){for(var ea=0;ea0){var ri;if(Array.isArray(_a[0])){bn=ba(_a);for(var Oa=1,Ia=1;Ia0){if(typeof Oa[0]=="number"){var dn=U.allocType(za.dtype,Oa.length);Pr(dn,Oa),bn(dn,Un),U.freeType(dn)}else if(Array.isArray(Oa[0])||wr(Oa[0])){An=ba(Oa);var fn=Ba(Oa,An,za.dtype);bn(fn,Un),U.freeType(fn)}}}else if(Er(Oa)){An=Oa.shape;var Bn=Oa.stride,ii=0,bi=0,Tn=0,Yn=0;An.length===1?(ii=An[0],bi=1,Tn=Bn[0],Yn=0):An.length===2&&(ii=An[0],bi=An[1],Tn=Bn[0],Yn=Bn[1]);var mi=Array.isArray(Oa.data)?za.dtype:Xt(Oa.data),wi=U.allocType(mi,ii*bi);Yr(wi,Oa.data,ii,bi,Tn,Yn,Oa.offset),bn(wi,Un),U.freeType(wi)}return Cn}return Ha||Cn(Zr),Cn._reglType="buffer",Cn._buffer=za,Cn.subdata=ri,or.profile&&(Cn.stats=za.stats),Cn.destroy=function(){Mn(za)},Cn}function Pa(){mt(la).forEach(function(Zr){Zr.buffer=tt.createBuffer(),tt.bindBuffer(Zr.type,Zr.buffer),tt.bufferData(Zr.type,Zr.persistentData||Zr.byteLength,Zr.usage)})}return or.profile&&(Gt.getTotalBufferSize=function(){var Zr=0;return Object.keys(la).forEach(function(_a){Zr+=la[_a].stats.size}),Zr}),{create:yn,createStream:hn,destroyStream:un,clear:function(){mt(la).forEach(Mn),ja.forEach(Mn)},getBuffer:function(Zr){return Zr&&Zr._buffer instanceof fa?Zr._buffer:null},restore:Pa,_initBuffer:si}}var na=0,La=0,Ga=1,Ua=1,Xa=4,an=4,Sa={points:na,point:La,lines:Ga,line:Ua,triangles:Xa,triangle:an,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Zn=0,Wn=1,ti=4,gt=5120,it=5121,Rr=5122,Ar=5123,pr=5124,kr=5125,zr=34963,Ur=35040,dt=35044;function qt(tt,Gt,or,ea){var pa={},la=0,fa={uint8:it,uint16:Ar};Gt.oes_element_index_uint&&(fa.uint32=kr);function ja(Pa){this.id=la++,pa[this.id]=this,this.buffer=Pa,this.primType=ti,this.vertCount=0,this.type=0}ja.prototype.bind=function(){this.buffer.bind()};var hn=[];function un(Pa){var Zr=hn.pop();return Zr||(Zr=new ja(or.create(null,zr,!0,!1)._buffer)),si(Zr,Pa,Ur,-1,-1,0,0),Zr}function Ja(Pa){hn.push(Pa)}function si(Pa,Zr,_a,Ha,nn,za,Cn){Pa.buffer.bind();var bn;if(Zr){var ri=Cn;!Cn&&(!wr(Zr)||Er(Zr)&&!wr(Zr.data))&&(ri=Gt.oes_element_index_uint?kr:Ar),or._initBuffer(Pa.buffer,Zr,_a,ri,3)}else tt.bufferData(zr,za,_a),Pa.buffer.dtype=bn||it,Pa.buffer.usage=_a,Pa.buffer.dimension=3,Pa.buffer.byteLength=za;if(bn=Cn,!Cn){switch(Pa.buffer.dtype){case it:case gt:bn=it;break;case Ar:case Rr:bn=Ar;break;case kr:case pr:bn=kr;break;default:}Pa.buffer.dtype=bn}Pa.type=bn;var Oa=nn;Oa<0&&(Oa=Pa.buffer.byteLength,bn===Ar?Oa>>=1:bn===kr&&(Oa>>=2)),Pa.vertCount=Oa;var Ia=Ha;if(Ha<0){Ia=ti;var Un=Pa.buffer.dimension;Un===1&&(Ia=Zn),Un===2&&(Ia=Wn),Un===3&&(Ia=ti)}Pa.primType=Ia}function Mn(Pa){ea.elementsCount--,delete pa[Pa.id],Pa.buffer.destroy(),Pa.buffer=null}function yn(Pa,Zr){var _a=or.create(null,zr,!0),Ha=new ja(_a._buffer);ea.elementsCount++;function nn(za){if(!za)_a(),Ha.primType=ti,Ha.vertCount=0,Ha.type=it;else if(typeof za=="number")_a(za),Ha.primType=ti,Ha.vertCount=za|0,Ha.type=it;else{var Cn=null,bn=dt,ri=-1,Oa=-1,Ia=0,Un=0;Array.isArray(za)||wr(za)||Er(za)?Cn=za:("data"in za&&(Cn=za.data),"usage"in za&&(bn=Da[za.usage]),"primitive"in za&&(ri=Sa[za.primitive]),"count"in za&&(Oa=za.count|0),"type"in za&&(Un=fa[za.type]),"length"in za?Ia=za.length|0:(Ia=Oa,Un===Ar||Un===Rr?Ia*=2:(Un===kr||Un===pr)&&(Ia*=4))),si(Ha,Cn,bn,ri,Oa,Ia,Un)}return nn}return nn(Pa),nn._reglType="elements",nn._elements=Ha,nn.subdata=function(za,Cn){return _a.subdata(za,Cn),nn},nn.destroy=function(){Mn(Ha)},nn}return{create:yn,createStream:un,destroyStream:Ja,getElements:function(Pa){return typeof Pa=="function"&&Pa._elements instanceof ja?Pa._elements:null},clear:function(){mt(pa).forEach(Mn)}}}var fr=new Float32Array(1),Ir=new Uint32Array(fr.buffer),da=5123;function Ta(tt){for(var Gt=U.allocType(da,tt.length),or=0;or>>31<<15,la=(ea<<1>>>24)-127,fa=ea>>13&1023;if(la<-24)Gt[or]=pa;else if(la<-14){var ja=-14-la;Gt[or]=pa+(fa+1024>>ja)}else la>15?Gt[or]=pa+31744:Gt[or]=pa+(la+15<<10)+fa}return Gt}function ua(tt){return Array.isArray(tt)||wr(tt)}var ra=34467,ha=3553,pn=34067,_n=34069,jn=6408,li=6406,yi=6407,gi=6409,Si=6410,Gi=32854,io=32855,vo=36194,ms=32819,pi=32820,lo=33635,Ai=34042,Fo=6402,No=34041,$o=35904,bo=35906,Hi=36193,Pi=33776,ji=33777,Uo=33778,Ko=33779,us=35986,ko=35987,zn=34798,_i=35840,xs=35841,Qo=35842,Ii=35843,gs=36196,Zo=5121,Ss=5123,zs=5125,ui=5126,po=10242,oo=10243,vs=10497,Nl=33071,Ki=33648,Ts=10240,Ws=10241,as=9728,bs=9729,Go=9984,ns=9985,fl=9986,Rl=9987,Vu=33170,Ul=4352,Ic=4353,rc=4354,ys=34046,Du=3317,oc=37440,Dl=37441,il=37443,Au=37444,ou=33984,Fs=[Go,fl,ns,Rl],Xs=[0,gi,Si,yi,jn],es={};es[gi]=es[li]=es[Fo]=1,es[No]=es[Si]=2,es[yi]=es[$o]=3,es[jn]=es[bo]=4;function Ms(tt){return"[object "+tt+"]"}var Su=Ms("HTMLCanvasElement"),hl=Ms("OffscreenCanvas"),cu=Ms("CanvasRenderingContext2D"),qs=Ms("ImageBitmap"),wf=Ms("HTMLImageElement"),Vo=Ms("HTMLVideoElement"),Tf=Object.keys(ot).concat([Su,hl,cu,qs,wf,Vo]),ss=[];ss[Zo]=1,ss[ui]=4,ss[Hi]=2,ss[Ss]=2,ss[zs]=4;var Vi=[];Vi[Gi]=2,Vi[io]=2,Vi[vo]=2,Vi[No]=4,Vi[Pi]=.5,Vi[ji]=.5,Vi[Uo]=1,Vi[Ko]=1,Vi[us]=.5,Vi[ko]=1,Vi[zn]=1,Vi[_i]=.5,Vi[xs]=.25,Vi[Qo]=.5,Vi[Ii]=.25,Vi[gs]=.5;function sc(tt){return Array.isArray(tt)&&(tt.length===0||typeof tt[0]=="number")}function fu(tt){if(!Array.isArray(tt))return!1;var Gt=tt.length;return!(Gt===0||!ua(tt[0]))}function vl(tt){return Object.prototype.toString.call(tt)}function Rc(tt){return vl(tt)===Su}function qu(tt){return vl(tt)===hl}function yc(tt){return vl(tt)===cu}function Al(tt){return vl(tt)===qs}function $c(tt){return vl(tt)===wf}function Nc(tt){return vl(tt)===Vo}function _c(tt){if(!tt)return!1;var Gt=vl(tt);return Tf.indexOf(Gt)>=0?!0:sc(tt)||fu(tt)||Er(tt)}function ac(tt){return ot[Object.prototype.toString.call(tt)]|0}function Uc(tt,Gt){var or=Gt.length;switch(tt.type){case Zo:case Ss:case zs:case ui:var ea=U.allocType(tt.type,or);ea.set(Gt),tt.data=ea;break;case Hi:tt.data=Ta(Gt);break;default:}}function jc(tt,Gt){return U.allocType(tt.type===Hi?ui:tt.type,Gt)}function hu(tt,Gt){tt.type===Hi?(tt.data=Ta(Gt),U.freeType(Gt)):tt.data=Gt}function Dc(tt,Gt,or,ea,pa,la){for(var fa=tt.width,ja=tt.height,hn=tt.channels,un=fa*ja*hn,Ja=jc(tt,un),si=0,Mn=0;Mn=1;)ja+=fa*hn*hn,hn/=2;return ja}else return fa*or*ea}function lc(tt,Gt,or,ea,pa,la,fa){var ja={"don't care":Ul,"dont care":Ul,nice:rc,fast:Ic},hn={repeat:vs,clamp:Nl,mirror:Ki},un={nearest:as,linear:bs},Ja=d({mipmap:Rl,"nearest mipmap nearest":Go,"linear mipmap nearest":ns,"nearest mipmap linear":fl,"linear mipmap linear":Rl},un),si={none:0,browser:Au},Mn={uint8:Zo,rgba4:ms,rgb565:lo,"rgb5 a1":pi},yn={alpha:li,luminance:gi,"luminance alpha":Si,rgb:yi,rgba:jn,rgba4:Gi,"rgb5 a1":io,rgb565:vo},Pa={};Gt.ext_srgb&&(yn.srgb=$o,yn.srgba=bo),Gt.oes_texture_float&&(Mn.float32=Mn.float=ui),Gt.oes_texture_half_float&&(Mn.float16=Mn["half float"]=Hi),Gt.webgl_depth_texture&&(d(yn,{depth:Fo,"depth stencil":No}),d(Mn,{uint16:Ss,uint32:zs,"depth stencil":Ai})),Gt.webgl_compressed_texture_s3tc&&d(Pa,{"rgb s3tc dxt1":Pi,"rgba s3tc dxt1":ji,"rgba s3tc dxt3":Uo,"rgba s3tc dxt5":Ko}),Gt.webgl_compressed_texture_atc&&d(Pa,{"rgb atc":us,"rgba atc explicit alpha":ko,"rgba atc interpolated alpha":zn}),Gt.webgl_compressed_texture_pvrtc&&d(Pa,{"rgb pvrtc 4bppv1":_i,"rgb pvrtc 2bppv1":xs,"rgba pvrtc 4bppv1":Qo,"rgba pvrtc 2bppv1":Ii}),Gt.webgl_compressed_texture_etc1&&(Pa["rgb etc1"]=gs);var Zr=Array.prototype.slice.call(tt.getParameter(ra));Object.keys(Pa).forEach(function(Me){var Ke=Pa[Me];Zr.indexOf(Ke)>=0&&(yn[Me]=Ke)});var _a=Object.keys(yn);or.textureFormats=_a;var Ha=[];Object.keys(yn).forEach(function(Me){var Ke=yn[Me];Ha[Ke]=Me});var nn=[];Object.keys(Mn).forEach(function(Me){var Ke=Mn[Me];nn[Ke]=Me});var za=[];Object.keys(un).forEach(function(Me){var Ke=un[Me];za[Ke]=Me});var Cn=[];Object.keys(Ja).forEach(function(Me){var Ke=Ja[Me];Cn[Ke]=Me});var bn=[];Object.keys(hn).forEach(function(Me){var Ke=hn[Me];bn[Ke]=Me});var ri=_a.reduce(function(Me,Ke){var ht=yn[Ke];return ht===gi||ht===li||ht===gi||ht===Si||ht===Fo||ht===No||Gt.ext_srgb&&(ht===$o||ht===bo)?Me[ht]=ht:ht===io||Ke.indexOf("rgba")>=0?Me[ht]=jn:Me[ht]=yi,Me},{});function Oa(){this.internalformat=jn,this.format=jn,this.type=Zo,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Au,this.width=0,this.height=0,this.channels=0}function Ia(Me,Ke){Me.internalformat=Ke.internalformat,Me.format=Ke.format,Me.type=Ke.type,Me.compressed=Ke.compressed,Me.premultiplyAlpha=Ke.premultiplyAlpha,Me.flipY=Ke.flipY,Me.unpackAlignment=Ke.unpackAlignment,Me.colorSpace=Ke.colorSpace,Me.width=Ke.width,Me.height=Ke.height,Me.channels=Ke.channels}function Un(Me,Ke){if(!(typeof Ke!="object"||!Ke)){if("premultiplyAlpha"in Ke&&(Me.premultiplyAlpha=Ke.premultiplyAlpha),"flipY"in Ke&&(Me.flipY=Ke.flipY),"alignment"in Ke&&(Me.unpackAlignment=Ke.alignment),"colorSpace"in Ke&&(Me.colorSpace=si[Ke.colorSpace]),"type"in Ke){var ht=Ke.type;Me.type=Mn[ht]}var Bt=Me.width,gr=Me.height,Dr=Me.channels,ur=!1;"shape"in Ke?(Bt=Ke.shape[0],gr=Ke.shape[1],Ke.shape.length===3&&(Dr=Ke.shape[2],ur=!0)):("radius"in Ke&&(Bt=gr=Ke.radius),"width"in Ke&&(Bt=Ke.width),"height"in Ke&&(gr=Ke.height),"channels"in Ke&&(Dr=Ke.channels,ur=!0)),Me.width=Bt|0,Me.height=gr|0,Me.channels=Dr|0;var vt=!1;if("format"in Ke){var wt=Ke.format,It=Me.internalformat=yn[wt];Me.format=ri[It],wt in Mn&&("type"in Ke||(Me.type=Mn[wt])),wt in Pa&&(Me.compressed=!0),vt=!0}!ur&&vt?Me.channels=es[Me.format]:ur&&!vt&&Me.channels!==Xs[Me.format]&&(Me.format=Me.internalformat=Xs[Me.channels])}}function An(Me){tt.pixelStorei(oc,Me.flipY),tt.pixelStorei(Dl,Me.premultiplyAlpha),tt.pixelStorei(il,Me.colorSpace),tt.pixelStorei(Du,Me.unpackAlignment)}function dn(){Oa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function fn(Me,Ke){var ht=null;if(_c(Ke)?ht=Ke:Ke&&(Un(Me,Ke),"x"in Ke&&(Me.xOffset=Ke.x|0),"y"in Ke&&(Me.yOffset=Ke.y|0),_c(Ke.data)&&(ht=Ke.data)),Ke.copy){var Bt=pa.viewportWidth,gr=pa.viewportHeight;Me.width=Me.width||Bt-Me.xOffset,Me.height=Me.height||gr-Me.yOffset,Me.needsCopy=!0}else if(!ht)Me.width=Me.width||1,Me.height=Me.height||1,Me.channels=Me.channels||4;else if(wr(ht))Me.channels=Me.channels||4,Me.data=ht,!("type"in Ke)&&Me.type===Zo&&(Me.type=ac(ht));else if(sc(ht))Me.channels=Me.channels||4,Uc(Me,ht),Me.alignment=1,Me.needsFree=!0;else if(Er(ht)){var Dr=ht.data;!Array.isArray(Dr)&&Me.type===Zo&&(Me.type=ac(Dr));var ur=ht.shape,vt=ht.stride,wt,It,$t,lr,tr,cr;ur.length===3?($t=ur[2],cr=vt[2]):($t=1,cr=1),wt=ur[0],It=ur[1],lr=vt[0],tr=vt[1],Me.alignment=1,Me.width=wt,Me.height=It,Me.channels=$t,Me.format=Me.internalformat=Xs[$t],Me.needsFree=!0,Dc(Me,Dr,lr,tr,cr,ht.offset)}else if(Rc(ht)||qu(ht)||yc(ht))Rc(ht)||qu(ht)?Me.element=ht:Me.element=ht.canvas,Me.width=Me.element.width,Me.height=Me.element.height,Me.channels=4;else if(Al(ht))Me.element=ht,Me.width=ht.width,Me.height=ht.height,Me.channels=4;else if($c(ht))Me.element=ht,Me.width=ht.naturalWidth,Me.height=ht.naturalHeight,Me.channels=4;else if(Nc(ht))Me.element=ht,Me.width=ht.videoWidth,Me.height=ht.videoHeight,Me.channels=4;else if(fu(ht)){var rr=Me.width||ht[0].length,Vt=Me.height||ht.length,er=Me.channels;ua(ht[0][0])?er=er||ht[0][0].length:er=er||1;for(var Nt=ze.shape(ht),Cr=1,Hr=0;Hr>=gr,ht.height>>=gr,fn(ht,Bt[gr]),Me.mipmask|=1<=0&&!("faces"in Ke)&&(Me.genMipmaps=!0)}if("mag"in Ke){var Bt=Ke.mag;Me.magFilter=un[Bt]}var gr=Me.wrapS,Dr=Me.wrapT;if("wrap"in Ke){var ur=Ke.wrap;typeof ur=="string"?gr=Dr=hn[ur]:Array.isArray(ur)&&(gr=hn[ur[0]],Dr=hn[ur[1]])}else{if("wrapS"in Ke){var vt=Ke.wrapS;gr=hn[vt]}if("wrapT"in Ke){var wt=Ke.wrapT;Dr=hn[wt]}}if(Me.wrapS=gr,Me.wrapT=Dr,"anisotropic"in Ke){var It=Ke.anisotropic;Me.anisotropic=Ke.anisotropic}if("mipmap"in Ke){var $t=!1;switch(typeof Ke.mipmap){case"string":Me.mipmapHint=ja[Ke.mipmap],Me.genMipmaps=!0,$t=!0;break;case"boolean":$t=Me.genMipmaps=Ke.mipmap;break;case"object":Me.genMipmaps=!1,$t=!0;break;default:}$t&&!("min"in Ke)&&(Me.minFilter=Go)}}function al(Me,Ke){tt.texParameteri(Ke,Ws,Me.minFilter),tt.texParameteri(Ke,Ts,Me.magFilter),tt.texParameteri(Ke,po,Me.wrapS),tt.texParameteri(Ke,oo,Me.wrapT),Gt.ext_texture_filter_anisotropic&&tt.texParameteri(Ke,ys,Me.anisotropic),Me.genMipmaps&&(tt.hint(Vu,Me.mipmapHint),tt.generateMipmap(Ke))}var El=0,ws={},Hs=or.maxTextureUnits,$s=Array(Hs).map(function(){return null});function Di(Me){Oa.call(this),this.mipmask=0,this.internalformat=jn,this.id=El++,this.refCount=1,this.target=Me,this.texture=tt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Wo,fa.profile&&(this.stats={size:0})}function nl(Me){tt.activeTexture(ou),tt.bindTexture(Me.target,Me.texture)}function mo(){var Me=$s[0];Me?tt.bindTexture(Me.target,Me.texture):tt.bindTexture(ha,null)}function me(Me){var Ke=Me.texture,ht=Me.unit,Bt=Me.target;ht>=0&&(tt.activeTexture(ou+ht),tt.bindTexture(Bt,null),$s[ht]=null),tt.deleteTexture(Ke),Me.texture=null,Me.params=null,Me.pixels=null,Me.refCount=0,delete ws[Me.id],la.textureCount--}d(Di.prototype,{bind:function(){var Me=this;Me.bindCount+=1;var Ke=Me.unit;if(Ke<0){for(var ht=0;ht0)continue;Bt.unit=-1}$s[ht]=Me,Ke=ht;break}Ke>=Hs,fa.profile&&la.maxTextureUnits>tr)-$t,cr.height=cr.height||(ht.height>>tr)-lr,nl(ht),ii(cr,ha,$t,lr,tr),mo(),Yn(cr),Bt}function Dr(ur,vt){var wt=ur|0,It=vt|0||wt;if(wt===ht.width&&It===ht.height)return Bt;Bt.width=ht.width=wt,Bt.height=ht.height=It,nl(ht);for(var $t=0;ht.mipmask>>$t;++$t){var lr=wt>>$t,tr=It>>$t;if(!lr||!tr)break;tt.texImage2D(ha,$t,ht.format,lr,tr,0,ht.format,ht.type,null)}return mo(),fa.profile&&(ht.stats.size=Mu(ht.internalformat,ht.type,wt,It,!1,!1)),Bt}return Bt(Me,Ke),Bt.subimage=gr,Bt.resize=Dr,Bt._reglType="texture2d",Bt._texture=ht,fa.profile&&(Bt.stats=ht.stats),Bt.destroy=function(){ht.decRef()},Bt}function ye(Me,Ke,ht,Bt,gr,Dr){var ur=new Di(pn);ws[ur.id]=ur,la.cubeCount++;var vt=new Array(6);function wt(lr,tr,cr,rr,Vt,er){var Nt,Cr=ur.texInfo;for(Wo.call(Cr),Nt=0;Nt<6;++Nt)vt[Nt]=Qi();if(typeof lr=="number"||!lr){var Hr=lr|0||1;for(Nt=0;Nt<6;++Nt)wi(vt[Nt],Hr,Hr)}else if(typeof lr=="object")if(tr)Ri(vt[0],lr),Ri(vt[1],tr),Ri(vt[2],cr),Ri(vt[3],rr),Ri(vt[4],Vt),Ri(vt[5],er);else if(tl(Cr,lr),Un(ur,lr),"faces"in lr){var ca=lr.faces;for(Nt=0;Nt<6;++Nt)Ia(vt[Nt],ur),Ri(vt[Nt],ca[Nt])}else for(Nt=0;Nt<6;++Nt)Ri(vt[Nt],lr);for(Ia(ur,vt[0]),Cr.genMipmaps?ur.mipmask=(vt[0].width<<1)-1:ur.mipmask=vt[0].mipmask,ur.internalformat=vt[0].internalformat,wt.width=vt[0].width,wt.height=vt[0].height,nl(ur),Nt=0;Nt<6;++Nt)ps(vt[Nt],_n+Nt);for(al(Cr,pn),mo(),fa.profile&&(ur.stats.size=Mu(ur.internalformat,ur.type,wt.width,wt.height,Cr.genMipmaps,!0)),wt.format=Ha[ur.internalformat],wt.type=nn[ur.type],wt.mag=za[Cr.magFilter],wt.min=Cn[Cr.minFilter],wt.wrapS=bn[Cr.wrapS],wt.wrapT=bn[Cr.wrapT],Nt=0;Nt<6;++Nt)_l(vt[Nt]);return wt}function It(lr,tr,cr,rr,Vt){var er=cr|0,Nt=rr|0,Cr=Vt|0,Hr=Tn();return Ia(Hr,ur),Hr.width=0,Hr.height=0,fn(Hr,tr),Hr.width=Hr.width||(ur.width>>Cr)-er,Hr.height=Hr.height||(ur.height>>Cr)-Nt,nl(ur),ii(Hr,_n+lr,er,Nt,Cr),mo(),Yn(Hr),wt}function $t(lr){var tr=lr|0;if(tr!==ur.width){wt.width=ur.width=tr,wt.height=ur.height=tr,nl(ur);for(var cr=0;cr<6;++cr)for(var rr=0;ur.mipmask>>rr;++rr)tt.texImage2D(_n+cr,rr,ur.format,tr>>rr,tr>>rr,0,ur.format,ur.type,null);return mo(),fa.profile&&(ur.stats.size=Mu(ur.internalformat,ur.type,wt.width,wt.height,!1,!0)),wt}}return wt(Me,Ke,ht,Bt,gr,Dr),wt.subimage=It,wt.resize=$t,wt._reglType="textureCube",wt._texture=ur,fa.profile&&(wt.stats=ur.stats),wt.destroy=function(){ur.decRef()},wt}function te(){for(var Me=0;Me>Bt,ht.height>>Bt,0,ht.internalformat,ht.type,null);else for(var gr=0;gr<6;++gr)tt.texImage2D(_n+gr,Bt,ht.internalformat,ht.width>>Bt,ht.height>>Bt,0,ht.internalformat,ht.type,null);al(ht.texInfo,ht.target)})}function Ne(){for(var Me=0;Me=0?_l=!0:hn.indexOf(Wo)>=0&&(_l=!1))),("depthTexture"in Di||"depthStencilTexture"in Di)&&($s=!!(Di.depthTexture||Di.depthStencilTexture)),"depth"in Di&&(typeof Di.depth=="boolean"?ps=Di.depth:(El=Di.depth,Js=!1)),"stencil"in Di&&(typeof Di.stencil=="boolean"?Js=Di.stencil:(ws=Di.stencil,ps=!1)),"depthStencil"in Di&&(typeof Di.depthStencil=="boolean"?ps=Js=Di.depthStencil:(Hs=Di.depthStencil,ps=!1,Js=!1))}var mo=null,me=null,K=null,ye=null;if(Array.isArray(Qi))mo=Qi.map(Pa);else if(Qi)mo=[Pa(Qi)];else for(mo=new Array(al),mi=0;mi0&&(Yn.depth=fn[0].depth,Yn.stencil=fn[0].stencil,Yn.depthStencil=fn[0].depthStencil),fn[Tn]?fn[Tn](Yn):fn[Tn]=Ia(Yn)}return d(Bn,{width:mi,height:mi,color:Wo})}function ii(bi){var Tn,Yn=bi|0;if(Yn===Bn.width)return Bn;var mi=Bn.color;for(Tn=0;Tn=mi.byteLength?wi.subdata(mi):(wi.destroy(),Ia.buffers[bi]=null)),Ia.buffers[bi]||(wi=Ia.buffers[bi]=pa.create(Tn,Ec,!1,!0)),Yn.buffer=pa.getBuffer(wi),Yn.size=Yn.buffer.dimension|0,Yn.normalized=!1,Yn.type=Yn.buffer.dtype,Yn.offset=0,Yn.stride=0,Yn.divisor=0,Yn.state=1,Bn[bi]=1}else pa.getBuffer(Tn)?(Yn.buffer=pa.getBuffer(Tn),Yn.size=Yn.buffer.dimension|0,Yn.normalized=!1,Yn.type=Yn.buffer.dtype,Yn.offset=0,Yn.stride=0,Yn.divisor=0,Yn.state=1):pa.getBuffer(Tn.buffer)?(Yn.buffer=pa.getBuffer(Tn.buffer),Yn.size=(+Tn.size||Yn.buffer.dimension)|0,Yn.normalized=!!Tn.normalized||!1,"type"in Tn?Yn.type=ma[Tn.type]:Yn.type=Yn.buffer.dtype,Yn.offset=(Tn.offset||0)|0,Yn.stride=(Tn.stride||0)|0,Yn.divisor=(Tn.divisor||0)|0,Yn.state=1):"x"in Tn&&(Yn.x=+Tn.x||0,Yn.y=+Tn.y||0,Yn.z=+Tn.z||0,Yn.w=+Tn.w||0,Yn.state=2)}for(var Ri=0;Ri1)for(var An=0;AnZr&&(Zr=_a.stats.uniformsCount)}),Zr},or.getMaxAttributesCount=function(){var Zr=0;return Ja.forEach(function(_a){_a.stats.attributesCount>Zr&&(Zr=_a.stats.attributesCount)}),Zr});function Pa(){pa={},la={};for(var Zr=0;Zr16&&(or=wn(or,tt.length*8));for(var ea=Array(16),pa=Array(16),la=0;la<16;la++)ea[la]=or[la]^909522486,pa[la]=or[la]^1549556828;var fa=wn(ea.concat(Ku(Gt)),512+Gt.length*8);return Yt(wn(pa.concat(fa),768))}function Hl(tt){for(var Gt=Hc?"0123456789ABCDEF":"0123456789abcdef",or="",ea,pa=0;pa>>4&15)+Gt.charAt(ea&15);return or}function Yu(tt){for(var Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="",ea=tt.length,pa=0;patt.length*8?or+=pu:or+=Gt.charAt(la>>>6*(3-fa)&63);return or}function hc(tt,Gt){var or=Gt.length,ea=Array(),pa,la,fa,ja,hn=Array(Math.ceil(tt.length/2));for(pa=0;pa0;){for(ja=Array(),fa=0,pa=0;pa0||la>0)&&(ja[ja.length]=la);ea[ea.length]=fa,hn=ja}var un="";for(pa=ea.length-1;pa>=0;pa--)un+=Gt.charAt(ea[pa]);var Ja=Math.ceil(tt.length*8/(Math.log(Gt.length)/Math.log(2)));for(pa=un.length;pa>>6&31,128|ea&63):ea<=65535?Gt+=String.fromCharCode(224|ea>>>12&15,128|ea>>>6&63,128|ea&63):ea<=2097151&&(Gt+=String.fromCharCode(240|ea>>>18&7,128|ea>>>12&63,128|ea>>>6&63,128|ea&63));return Gt}function Ku(tt){for(var Gt=Array(tt.length>>2),or=0;or>5]|=(tt.charCodeAt(or/8)&255)<<24-or%32;return Gt}function Yt(tt){for(var Gt="",or=0;or>5]>>>24-or%32&255);return Gt}function mr(tt,Gt){return tt>>>Gt|tt<<32-Gt}function Jr(tt,Gt){return tt>>>Gt}function Wr(tt,Gt,or){return tt&Gt^~tt&or}function xa(tt,Gt,or){return tt&Gt^tt&or^Gt&or}function $a(tt){return mr(tt,2)^mr(tt,13)^mr(tt,22)}function xn(tt){return mr(tt,6)^mr(tt,11)^mr(tt,25)}function Fn(tt){return mr(tt,7)^mr(tt,18)^Jr(tt,3)}function Gn(tt){return mr(tt,17)^mr(tt,19)^Jr(tt,10)}var ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function wn(tt,Gt){var or=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ea=new Array(64),pa,la,fa,ja,hn,un,Ja,si,Mn,yn,Pa,Zr;for(tt[Gt>>5]|=128<<24-Gt%32,tt[(Gt+64>>9<<4)+15]=Gt,Mn=0;Mn>16)+(Gt>>16)+(or>>16);return ea<<16|or&65535}function Ln(tt){return Array.prototype.slice.call(tt)}function sn(tt){return Ln(tt).join("")}function di(tt){var Gt=tt&&tt.cache,or=0,ea=[],pa=[],la=[];function fa(Pa,Zr){var _a=Zr&&Zr.stable;if(!_a){for(var Ha=0;Ha0&&(Pa.push(nn,"="),Pa.push.apply(Pa,Ln(arguments)),Pa.push(";")),nn}return d(Zr,{def:Ha,toString:function(){return sn([_a.length>0?"var "+_a.join(",")+";":"",sn(Pa)])}})}function hn(){var Pa=ja(),Zr=ja(),_a=Pa.toString,Ha=Zr.toString;function nn(za,Cn){Zr(za,Cn,"=",Pa.def(za,Cn),";")}return d(function(){Pa.apply(Pa,Ln(arguments))},{def:Pa.def,entry:Pa,exit:Zr,save:nn,set:function(za,Cn,bn){nn(za,Cn),Pa(za,Cn,"=",bn,";")},toString:function(){return _a()+Ha()}})}function un(){var Pa=sn(arguments),Zr=hn(),_a=hn(),Ha=Zr.toString,nn=_a.toString;return d(Zr,{then:function(){return Zr.apply(Zr,Ln(arguments)),this},else:function(){return _a.apply(_a,Ln(arguments)),this},toString:function(){var za=nn();return za&&(za="else{"+za+"}"),sn(["if(",Pa,"){",Ha(),"}",za])}})}var Ja=ja(),si={};function Mn(Pa,Zr){var _a=[];function Ha(){var ri="a"+_a.length;return _a.push(ri),ri}Zr=Zr||0;for(var nn=0;nn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ca={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ua={cw:Je,ccw:ht};function rn(tt){return Array.isArray(tt)||mr(tt)||Er(tt)}function Ja(tt){return tt.sort(function(qt,sr){return qt===we?-1:sr===we?1:qt=1,ra>=2,qt)}else if(sr===as){var da=tt.data;return new Aa(da.thisDep,da.contextDep,da.propDep,qt)}else{if(sr===Ps)return new Aa(!1,!1,!1,qt);if(sr===ds){for(var ca=!1,ha=!1,Va=!1,dn=0;dn=1&&(ha=!0),$a>=2&&(Va=!0)}else fn.type===as&&(ca=ca||fn.data.thisDep,ha=ha||fn.data.contextDep,Va=Va||fn.data.propDep)}return new Aa(ca,ha,Va,qt)}else return new Aa(sr===Ro,sr===no,sr===Qn,qt)}}var yi=new Aa(!1,!1,!1,function(){});function zi(tt,qt,sr,ra,da,ca,ha,Va,dn,fn,$a,ui,Mn,_n,Ia,Zr){var _a=fn.Record,Wa={add:32774,subtract:32778,"reverse subtract":32779};sr.ext_blend_minmax&&(Wa.min=mt,Wa.max=wt);var on=sr.angle_instanced_arrays,Fa=sr.webgl_draw_buffers,Cn=sr.oes_vertex_array_object,bn={dirty:!0,profile:Zr.profile},ai={},Ba=[],Ra={},Un={};function An(pt){return pt.replace(".","_")}function pn(pt,At,Dt){var er=An(pt);Ba.push(pt),ai[er]=bn[er]=!!Dt,Ra[er]=At}function vn(pt,At,Dt){var er=An(pt);Ba.push(pt),Array.isArray(Dt)?(bn[er]=Dt.slice(),ai[er]=Dt.slice()):bn[er]=ai[er]=Dt,Un[er]=At}function On(pt){return!!isNaN(pt)}pn(Cs,tn),pn(es,ka),vn(ul,"blendColor",[0,0,0,0]),vn(Ws,"blendEquationSeparate",[jr,jr]),vn(Fs,"blendFuncSeparate",[Br,hr,Br,hr]),pn(Mi,In,!0),vn(yo,"depthFunc",va),vn(Ss,"depthRange",[0,1]),vn(us,"depthMask",!0),vn(Pl,Pl,[!0,!0,!0,!0]),pn(Ql,pa),vn(du,"cullFace",Re),vn(Yu,Yu,ht),vn(Vl,Vl,1),pn(Ku,di),vn(Hl,"polygonOffset",[0,0]),pn(Ou,Di),pn(Ki,Ai),vn(xo,"sampleCoverage",[1,!1]),pn(Ju,Dn),vn(Eu,"stencilMask",-1),vn(pu,"stencilFunc",[$t,0,-1]),vn(Be,"stencilOpSeparate",[ve,Rt,Rt,Rt]),vn(R,"stencilOpSeparate",[Re,Rt,Rt,Rt]),pn(ae,Yn),vn(xe,"scissor",[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]),vn(we,we,[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]);var oi={gl:tt,context:Mn,strings:qt,next:ai,current:bn,draw:ui,elements:ca,buffer:da,shader:$a,attributes:fn.state,vao:fn,uniforms:dn,framebuffer:Va,extensions:sr,timer:_n,isBufferArgs:rn},bi={primTypes:Ma,compareFuncs:ya,blendFuncs:Za,blendEquations:Wa,stencilOps:Ca,glTypes:oa,orientationType:Ua};Fa&&(bi.backBuffer=[Re],bi.drawBuffer=v(ra.maxDrawbuffers,function(pt){return pt===0?[0]:v(pt,function(At){return Ha+At})}));var Tn=0;function Zn(){var pt=mi({cache:Ia}),At=pt.link,Dt=pt.global;pt.id=Tn++,pt.batchId="0";var er=At(oi),lr=pt.shared={props:"a0"};Object.keys(oi).forEach(function(rr){lr[rr]=Dt.def(er,".",rr)});var ar=pt.next={},cr=pt.current={};Object.keys(Un).forEach(function(rr){Array.isArray(bn[rr])&&(ar[rr]=Dt.def(lr.next,".",rr),cr[rr]=Dt.def(lr.current,".",rr))});var nr=pt.constants={};Object.keys(bi).forEach(function(rr){nr[rr]=Dt.def(JSON.stringify(bi[rr]))}),pt.invoke=function(rr,Nt){switch(Nt.type){case vi:var Pr=["this",lr.context,lr.props,pt.batchId];return rr.def(At(Nt.data),".call(",Pr.slice(0,Math.max(Nt.data.length+1,4)),")");case Qn:return rr.def(lr.props,Nt.data);case no:return rr.def(lr.context,Nt.data);case Ro:return rr.def("this",Nt.data);case as:return Nt.data.append(pt,rr),Nt.data.ref;case Ps:return Nt.data.toString();case ds:return Nt.data.map(function(Hr){return pt.invoke(rr,Hr)})}},pt.attribCache={};var Vt={};return pt.scopeAttrib=function(rr){var Nt=qt.id(rr);if(Nt in Vt)return Vt[Nt];var Pr=fn.scope[Nt];Pr||(Pr=fn.scope[Nt]=new _a);var Hr=Vt[Nt]=At(Pr);return Hr},pt}function gi(pt){var At=pt.static,Dt=pt.dynamic,er;if(Fe in At){var lr=!!At[Fe];er=Wn(function(cr,nr){return lr}),er.enable=lr}else if(Fe in Dt){var ar=Dt[Fe];er=ii(ar,function(cr,nr){return cr.invoke(nr,ar)})}return er}function wi(pt,At){var Dt=pt.static,er=pt.dynamic;if(ct in Dt){var lr=Dt[ct];return lr?(lr=Va.getFramebuffer(lr),Wn(function(cr,nr){var Vt=cr.link(lr),rr=cr.shared;nr.set(rr.framebuffer,".next",Vt);var Nt=rr.context;return nr.set(Nt,"."+ft,Vt+".width"),nr.set(Nt,"."+Mt,Vt+".height"),Vt})):Wn(function(cr,nr){var Vt=cr.shared;nr.set(Vt.framebuffer,".next","null");var rr=Vt.context;return nr.set(rr,"."+ft,rr+"."+fr),nr.set(rr,"."+Mt,rr+"."+wr),"null"})}else if(ct in er){var ar=er[ct];return ii(ar,function(cr,nr){var Vt=cr.invoke(nr,ar),rr=cr.shared,Nt=rr.framebuffer,Pr=nr.def(Nt,".getFramebuffer(",Vt,")");nr.set(Nt,".next",Pr);var Hr=rr.context;return nr.set(Hr,"."+ft,Pr+"?"+Pr+".width:"+Hr+"."+fr),nr.set(Hr,"."+Mt,Pr+"?"+Pr+".height:"+Hr+"."+wr),Pr})}else return null}function Ii(pt,At,Dt){var er=pt.static,lr=pt.dynamic;function ar(Vt){if(Vt in er){var rr=er[Vt],Nt=!0,Pr=rr.x|0,Hr=rr.y|0,fa,ln;return"width"in rr?fa=rr.width|0:Nt=!1,"height"in rr?ln=rr.height|0:Nt=!1,new Aa(!Nt&&At&&At.thisDep,!Nt&&At&&At.contextDep,!Nt&&At&&At.propDep,function(Bn,En){var en=Bn.shared.context,hn=fa;"width"in rr||(hn=En.def(en,".",ft,"-",Pr));var mn=ln;return"height"in rr||(mn=En.def(en,".",Mt,"-",Hr)),[Pr,Hr,hn,mn]})}else if(Vt in lr){var Oa=lr[Vt],Ya=ii(Oa,function(Bn,En){var en=Bn.invoke(En,Oa),hn=Bn.shared.context,mn=En.def(en,".x|0"),Pn=En.def(en,".y|0"),ti=En.def('"width" in ',en,"?",en,".width|0:","(",hn,".",ft,"-",mn,")"),io=En.def('"height" in ',en,"?",en,".height|0:","(",hn,".",Mt,"-",Pn,")");return[mn,Pn,ti,io]});return At&&(Ya.thisDep=Ya.thisDep||At.thisDep,Ya.contextDep=Ya.contextDep||At.contextDep,Ya.propDep=Ya.propDep||At.propDep),Ya}else return At?new Aa(At.thisDep,At.contextDep,At.propDep,function(Bn,En){var en=Bn.shared.context;return[0,0,En.def(en,".",ft),En.def(en,".",Mt)]}):null}var cr=ar(we);if(cr){var nr=cr;cr=new Aa(cr.thisDep,cr.contextDep,cr.propDep,function(Vt,rr){var Nt=nr.append(Vt,rr),Pr=Vt.shared.context;return rr.set(Pr,"."+xt,Nt[2]),rr.set(Pr,"."+Pt,Nt[3]),Nt})}return{viewport:cr,scissor_box:ar(xe)}}function cs(pt,At){var Dt=pt.static,er=typeof Dt[zt]=="string"&&typeof Dt[bt]=="string";if(er){if(Object.keys(At.dynamic).length>0)return null;var lr=At.static,ar=Object.keys(lr);if(ar.length>0&&typeof lr[ar[0]]=="number"){for(var cr=[],nr=0;nr"+mn+"?"+Nt+".constant["+mn+"]:0;"}).join(""),"}}else{","if(",fa,"(",Nt,".buffer)){",Bn,"=",ln,".createStream(",Xr,",",Nt,".buffer);","}else{",Bn,"=",ln,".getBuffer(",Nt,".buffer);","}",En,'="type" in ',Nt,"?",Hr.glTypes,"[",Nt,".type]:",Bn,".dtype;",Oa.normalized,"=!!",Nt,".normalized;");function en(hn){rr(Oa[hn],"=",Nt,".",hn,"|0;")}return en("size"),en("offset"),en("stride"),en("divisor"),rr("}}"),rr.exit("if(",Oa.isStream,"){",ln,".destroyStream(",Bn,");","}"),Oa}lr[ar]=ii(cr,nr)}),lr}function rl(pt){var At=pt.static,Dt=pt.dynamic,er={};return Object.keys(At).forEach(function(lr){var ar=At[lr];er[lr]=Wn(function(cr,nr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:cr.link(ar)})}),Object.keys(Dt).forEach(function(lr){var ar=Dt[lr];er[lr]=ii(ar,function(cr,nr){return cr.invoke(nr,ar)})}),er}function Ml(pt,At,Dt,er,lr){var ar=pt.static,cr=pt.dynamic,nr=cs(pt,At),Vt=wi(pt,lr),rr=Ii(pt,Vt,lr),Nt=Ji(pt,lr),Pr=yl(pt,lr),Hr=Zs(pt,lr,nr);function fa(en){var hn=rr[en];hn&&(Pr[en]=hn)}fa(we),fa(An(xe));var ln=Object.keys(Pr).length>0,Oa={framebuffer:Vt,draw:Nt,shader:Hr,state:Pr,dirty:ln,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Oa.profile=gi(pt,lr),Oa.uniforms=Xo(Dt,lr),Oa.drawVAO=Oa.scopeVAO=Nt.vao,!Oa.drawVAO&&Hr.program&&!nr&&sr.angle_instanced_arrays&&Nt.static.elements){var Ya=!0,Bn=Hr.program.attributes.map(function(en){var hn=At.static[en];return Ya=Ya&&!!hn,hn});if(Ya&&Bn.length>0){var En=fn.getVAO(fn.createVAO({attributes:Bn,elements:Nt.static.elements}));Oa.drawVAO=new Aa(null,null,null,function(en,hn){return en.link(En)}),Oa.useVAO=!0}}return nr?Oa.useVAO=!0:Oa.attributes=Qs(At,lr),Oa.context=rl(er,lr),Oa}function ps(pt,At,Dt){var er=pt.shared,lr=er.context,ar=pt.scope();Object.keys(Dt).forEach(function(cr){At.save(lr,"."+cr);var nr=Dt[cr],Vt=nr.append(pt,At);Array.isArray(Vt)?ar(lr,".",cr,"=[",Vt.join(),"];"):ar(lr,".",cr,"=",Vt,";")}),At(ar)}function qs(pt,At,Dt,er){var lr=pt.shared,ar=lr.gl,cr=lr.framebuffer,nr;Fa&&(nr=At.def(lr.extensions,".webgl_draw_buffers"));var Vt=pt.constants,rr=Vt.drawBuffer,Nt=Vt.backBuffer,Pr;Dt?Pr=Dt.append(pt,At):Pr=At.def(cr,".next"),er||At("if(",Pr,"!==",cr,".cur){"),At("if(",Pr,"){",ar,".bindFramebuffer(",ua,",",Pr,".framebuffer);"),Fa&&At(nr,".drawBuffersWEBGL(",rr,"[",Pr,".colorAttachments.length]);"),At("}else{",ar,".bindFramebuffer(",ua,",null);"),Fa&&At(nr,".drawBuffersWEBGL(",Nt,");"),At("}",cr,".cur=",Pr,";"),er||At("}")}function Ys(pt,At,Dt){var er=pt.shared,lr=er.gl,ar=pt.current,cr=pt.next,nr=er.current,Vt=er.next,rr=pt.cond(nr,".dirty");Ba.forEach(function(Nt){var Pr=An(Nt);if(!(Pr in Dt.state)){var Hr,fa;if(Pr in cr){Hr=cr[Pr],fa=ar[Pr];var ln=v(bn[Pr].length,function(Ya){return rr.def(Hr,"[",Ya,"]")});rr(pt.cond(ln.map(function(Ya,Bn){return Ya+"!=="+fa+"["+Bn+"]"}).join("||")).then(lr,".",Un[Pr],"(",ln,");",ln.map(function(Ya,Bn){return fa+"["+Bn+"]="+Ya}).join(";"),";"))}else{Hr=rr.def(Vt,".",Pr);var Oa=pt.cond(Hr,"!==",nr,".",Pr);rr(Oa),Pr in Ra?Oa(pt.cond(Hr).then(lr,".enable(",Ra[Pr],");").else(lr,".disable(",Ra[Pr],");"),nr,".",Pr,"=",Hr,";"):Oa(lr,".",Un[Pr],"(",Hr,");",nr,".",Pr,"=",Hr,";")}}}),Object.keys(Dt.state).length===0&&rr(nr,".dirty=false;"),At(rr)}function Ri(pt,At,Dt,er){var lr=pt.shared,ar=pt.current,cr=lr.current,nr=lr.gl,Vt;Ja(Object.keys(Dt)).forEach(function(rr){var Nt=Dt[rr];if(!(er&&!er(Nt))){var Pr=Nt.append(pt,At);if(Ra[rr]){var Hr=Ra[rr];Jn(Nt)?(Vt=pt.link(Pr,{stable:!0}),At(pt.cond(Vt).then(nr,".enable(",Hr,");").else(nr,".disable(",Hr,");")),At(cr,".",rr,"=",Vt,";")):(At(pt.cond(Pr).then(nr,".enable(",Hr,");").else(nr,".disable(",Hr,");")),At(cr,".",rr,"=",Pr,";"))}else if(wa(Pr)){var fa=ar[rr];At(nr,".",Un[rr],"(",Pr,");",Pr.map(function(ln,Oa){return fa+"["+Oa+"]="+ln}).join(";"),";")}else Jn(Nt)?(Vt=pt.link(Pr,{stable:!0}),At(nr,".",Un[rr],"(",Vt,");",cr,".",rr,"=",Vt,";")):At(nr,".",Un[rr],"(",Pr,");",cr,".",rr,"=",Pr,";")}})}function al(pt,At){on&&(pt.instancing=At.def(pt.shared.extensions,".angle_instanced_arrays"))}function go(pt,At,Dt,er,lr){var ar=pt.shared,cr=pt.stats,nr=ar.current,Vt=ar.timer,rr=Dt.profile;function Nt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Pr,Hr;function fa(en){Pr=At.def(),en(Pr,"=",Nt(),";"),typeof lr=="string"?en(cr,".count+=",lr,";"):en(cr,".count++;"),_n&&(er?(Hr=At.def(),en(Hr,"=",Vt,".getNumPendingQueries();")):en(Vt,".beginQuery(",cr,");"))}function ln(en){en(cr,".cpuTime+=",Nt(),"-",Pr,";"),_n&&(er?en(Vt,".pushScopeStats(",Hr,",",Vt,".getNumPendingQueries(),",cr,");"):en(Vt,".endQuery();"))}function Oa(en){var hn=At.def(nr,".profile");At(nr,".profile=",en,";"),At.exit(nr,".profile=",hn,";")}var Ya;if(rr){if(Jn(rr)){rr.enable?(fa(At),ln(At.exit),Oa("true")):Oa("false");return}Ya=rr.append(pt,At),Oa(Ya)}else Ya=At.def(nr,".profile");var Bn=pt.block();fa(Bn),At("if(",Ya,"){",Bn,"}");var En=pt.block();ln(En),At.exit("if(",Ya,"){",En,"}")}function de(pt,At,Dt,er,lr){var ar=pt.shared;function cr(Vt){switch(Vt){case Vo:case Os:case il:return 2;case co:case Ls:case Sl:return 3;case Lo:case Do:case eu:return 4;default:return 1}}function nr(Vt,rr,Nt){var Pr=ar.gl,Hr=At.def(Vt,".location"),fa=At.def(ar.attributes,"[",Hr,"]"),ln=Nt.state,Oa=Nt.buffer,Ya=[Nt.x,Nt.y,Nt.z,Nt.w],Bn=["buffer","normalized","offset","stride"];function En(){At("if(!",fa,".buffer){",Pr,".enableVertexAttribArray(",Hr,");}");var hn=Nt.type,mn;if(Nt.size?mn=At.def(Nt.size,"||",rr):mn=rr,At("if(",fa,".type!==",hn,"||",fa,".size!==",mn,"||",Bn.map(function(ti){return fa+"."+ti+"!=="+Nt[ti]}).join("||"),"){",Pr,".bindBuffer(",Xr,",",Oa,".buffer);",Pr,".vertexAttribPointer(",[Hr,mn,hn,Nt.normalized,Nt.stride,Nt.offset],");",fa,".type=",hn,";",fa,".size=",mn,";",Bn.map(function(ti){return fa+"."+ti+"="+Nt[ti]+";"}).join(""),"}"),on){var Pn=Nt.divisor;At("if(",fa,".divisor!==",Pn,"){",pt.instancing,".vertexAttribDivisorANGLE(",[Hr,Pn],");",fa,".divisor=",Pn,";}")}}function en(){At("if(",fa,".buffer){",Pr,".disableVertexAttribArray(",Hr,");",fa,".buffer=null;","}if(",Oi.map(function(hn,mn){return fa+"."+hn+"!=="+Ya[mn]}).join("||"),"){",Pr,".vertexAttrib4f(",Hr,",",Ya,");",Oi.map(function(hn,mn){return fa+"."+hn+"="+Ya[mn]+";"}).join(""),"}")}ln===Bi?En():ln===Yi?en():(At("if(",ln,"===",Bi,"){"),En(),At("}else{"),en(),At("}"))}er.forEach(function(Vt){var rr=Vt.name,Nt=Dt.attributes[rr],Pr;if(Nt){if(!lr(Nt))return;Pr=Nt.append(pt,At)}else{if(!lr(yi))return;var Hr=pt.scopeAttrib(rr);Pr={},Object.keys(new _a).forEach(function(fa){Pr[fa]=At.def(Hr,".",fa)})}nr(pt.link(Vt),cr(Vt.info.type),Pr)})}function Y(pt,At,Dt,er,lr,ar){for(var cr=pt.shared,nr=cr.gl,Vt,rr=0;rr1){for(var Ao=[],ls=[],bo=0;bo>1)",Oa],");")}function Pn(){Dt(Ya,".drawArraysInstancedANGLE(",[Hr,fa,ln,Oa],");")}Nt&&Nt!=="null"?En?mn():(Dt("if(",Nt,"){"),mn(),Dt("}else{"),Pn(),Dt("}")):Pn()}function hn(){function mn(){Dt(ar+".drawElements("+[Hr,ln,Bn,fa+"<<(("+Bn+"-"+Vi+")>>1)"]+");")}function Pn(){Dt(ar+".drawArrays("+[Hr,fa,ln]+");")}Nt&&Nt!=="null"?En?mn():(Dt("if(",Nt,"){"),mn(),Dt("}else{"),Pn(),Dt("}")):Pn()}on&&(typeof Oa!="number"||Oa>=0)?typeof Oa=="string"?(Dt("if(",Oa,">0){"),en(),Dt("}else if(",Oa,"<0){"),hn(),Dt("}")):en():hn()}function te(pt,At,Dt,er,lr){var ar=Zn(),cr=ar.proc("body",lr);return on&&(ar.instancing=cr.def(ar.shared.extensions,".angle_instanced_arrays")),pt(ar,cr,Dt,er),ar.compile().body}function pe(pt,At,Dt,er){al(pt,At),Dt.useVAO?Dt.drawVAO?At(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,At),");"):At(pt.shared.vao,".setVAO(",pt.shared.vao,".targetVAO);"):(At(pt.shared.vao,".setVAO(null);"),de(pt,At,Dt,er.attributes,function(){return!0})),Y(pt,At,Dt,er.uniforms,function(){return!0},!1),me(pt,At,At,Dt)}function Ve(pt,At){var Dt=pt.proc("draw",1);al(pt,Dt),ps(pt,Dt,At.context),qs(pt,Dt,At.framebuffer),Ys(pt,Dt,At),Ri(pt,Dt,At.state),go(pt,Dt,At,!1,!0);var er=At.shader.progVar.append(pt,Dt);if(Dt(pt.shared.gl,".useProgram(",er,".program);"),At.shader.program)pe(pt,Dt,At,At.shader.program);else{Dt(pt.shared.vao,".setVAO(null);");var lr=pt.global.def("{}"),ar=Dt.def(er,".id"),cr=Dt.def(lr,"[",ar,"]");Dt(pt.cond(cr).then(cr,".call(this,a0);").else(cr,"=",lr,"[",ar,"]=",pt.link(function(nr){return te(pe,pt,At,nr,1)}),"(",er,");",cr,".call(this,a0);"))}Object.keys(At.state).length>0&&Dt(pt.shared.current,".dirty=true;"),pt.shared.vao&&Dt(pt.shared.vao,".setVAO(null);")}function ke(pt,At,Dt,er){pt.batchId="a1",al(pt,At);function lr(){return!0}de(pt,At,Dt,er.attributes,lr),Y(pt,At,Dt,er.uniforms,lr,!1),me(pt,At,At,Dt)}function Ye(pt,At,Dt,er){al(pt,At);var lr=Dt.contextDep,ar=At.def(),cr="a0",nr="a1",Vt=At.def();pt.shared.props=Vt,pt.batchId=ar;var rr=pt.scope(),Nt=pt.scope();At(rr.entry,"for(",ar,"=0;",ar,"<",nr,";++",ar,"){",Vt,"=",cr,"[",ar,"];",Nt,"}",rr.exit);function Pr(Bn){return Bn.contextDep&&lr||Bn.propDep}function Hr(Bn){return!Pr(Bn)}if(Dt.needsContext&&ps(pt,Nt,Dt.context),Dt.needsFramebuffer&&qs(pt,Nt,Dt.framebuffer),Ri(pt,Nt,Dt.state,Pr),Dt.profile&&Pr(Dt.profile)&&go(pt,Nt,Dt,!1,!0),er)Dt.useVAO?Dt.drawVAO?Pr(Dt.drawVAO)?Nt(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,Nt),");"):rr(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,rr),");"):rr(pt.shared.vao,".setVAO(",pt.shared.vao,".targetVAO);"):(rr(pt.shared.vao,".setVAO(null);"),de(pt,rr,Dt,er.attributes,Hr),de(pt,Nt,Dt,er.attributes,Pr)),Y(pt,rr,Dt,er.uniforms,Hr,!1),Y(pt,Nt,Dt,er.uniforms,Pr,!0),me(pt,rr,Nt,Dt);else{var fa=pt.global.def("{}"),ln=Dt.shader.progVar.append(pt,Nt),Oa=Nt.def(ln,".id"),Ya=Nt.def(fa,"[",Oa,"]");Nt(pt.shared.gl,".useProgram(",ln,".program);","if(!",Ya,"){",Ya,"=",fa,"[",Oa,"]=",pt.link(function(Bn){return te(ke,pt,Dt,Bn,2)}),"(",ln,");}",Ya,".call(this,a0[",ar,"],",ar,");")}}function vt(pt,At){var Dt=pt.proc("batch",2);pt.batchId="0",al(pt,Dt);var er=!1,lr=!0;Object.keys(At.context).forEach(function(fa){er=er||At.context[fa].propDep}),er||(ps(pt,Dt,At.context),lr=!1);var ar=At.framebuffer,cr=!1;ar?(ar.propDep?er=cr=!0:ar.contextDep&&er&&(cr=!0),cr||qs(pt,Dt,ar)):qs(pt,Dt,null),At.state.viewport&&At.state.viewport.propDep&&(er=!0);function nr(fa){return fa.contextDep&&er||fa.propDep}Ys(pt,Dt,At),Ri(pt,Dt,At.state,function(fa){return!nr(fa)}),(!At.profile||!nr(At.profile))&&go(pt,Dt,At,!1,"a1"),At.contextDep=er,At.needsContext=lr,At.needsFramebuffer=cr;var Vt=At.shader.progVar;if(Vt.contextDep&&er||Vt.propDep)Ye(pt,Dt,At,null);else{var rr=Vt.append(pt,Dt);if(Dt(pt.shared.gl,".useProgram(",rr,".program);"),At.shader.program)Ye(pt,Dt,At,At.shader.program);else{Dt(pt.shared.vao,".setVAO(null);");var Nt=pt.global.def("{}"),Pr=Dt.def(rr,".id"),Hr=Dt.def(Nt,"[",Pr,"]");Dt(pt.cond(Hr).then(Hr,".call(this,a0,a1);").else(Hr,"=",Nt,"[",Pr,"]=",pt.link(function(fa){return te(Ye,pt,At,fa,2)}),"(",rr,");",Hr,".call(this,a0,a1);"))}}Object.keys(At.state).length>0&&Dt(pt.shared.current,".dirty=true;"),pt.shared.vao&&Dt(pt.shared.vao,".setVAO(null);")}function Ot(pt,At){var Dt=pt.proc("scope",3);pt.batchId="a2";var er=pt.shared,lr=er.current;if(ps(pt,Dt,At.context),At.framebuffer&&At.framebuffer.append(pt,Dt),Ja(Object.keys(At.state)).forEach(function(nr){var Vt=At.state[nr],rr=Vt.append(pt,Dt);wa(rr)?rr.forEach(function(Nt,Pr){On(Nt)?Dt.set(pt.next[nr],"["+Pr+"]",Nt):Dt.set(pt.next[nr],"["+Pr+"]",pt.link(Nt,{stable:!0}))}):Jn(Vt)?Dt.set(er.next,"."+nr,pt.link(rr,{stable:!0})):Dt.set(er.next,"."+nr,rr)}),go(pt,Dt,At,!0,!0),[Zt,Gr,yr,ta,gr].forEach(function(nr){var Vt=At.draw[nr];if(Vt){var rr=Vt.append(pt,Dt);On(rr)?Dt.set(er.draw,"."+nr,rr):Dt.set(er.draw,"."+nr,pt.link(rr),{stable:!0})}}),Object.keys(At.uniforms).forEach(function(nr){var Vt=At.uniforms[nr].append(pt,Dt);Array.isArray(Vt)&&(Vt="["+Vt.map(function(rr){return On(rr)?rr:pt.link(rr,{stable:!0})})+"]"),Dt.set(er.uniforms,"["+pt.link(qt.id(nr),{stable:!0})+"]",Vt)}),Object.keys(At.attributes).forEach(function(nr){var Vt=At.attributes[nr].append(pt,Dt),rr=pt.scopeAttrib(nr);Object.keys(new _a).forEach(function(Nt){Dt.set(rr,"."+Nt,Vt[Nt])})}),At.scopeVAO){var ar=At.scopeVAO.append(pt,Dt);On(ar)?Dt.set(er.vao,".targetVAO",ar):Dt.set(er.vao,".targetVAO",pt.link(ar,{stable:!0}))}function cr(nr){var Vt=At.shader[nr];if(Vt){var rr=Vt.append(pt,Dt);On(rr)?Dt.set(er.shader,"."+nr,rr):Dt.set(er.shader,"."+nr,pt.link(rr,{stable:!0}))}}cr(bt),cr(zt),Object.keys(At.state).length>0&&(Dt(lr,".dirty=true;"),Dt.exit(lr,".dirty=true;")),Dt("a1(",pt.shared.context,",a0,",pt.batchId,");")}function dr(pt){if(!(typeof pt!="object"||wa(pt))){for(var At=Object.keys(pt),Dt=0;Dt=0;--te){var pe=oi[te];pe&&pe(Ia,null,0)}sr.flush(),$a&&$a.update()}function Ii(){!gi&&oi.length>0&&(gi=c.next(wi))}function cs(){gi&&(c.cancel(wi),gi=null)}function Zs(te){te.preventDefault(),da=!0,cs(),bi.forEach(function(pe){pe()})}function Ji(te){sr.getError(),da=!1,ca.restore(),ai.restore(),on.restore(),Ba.restore(),Ra.restore(),Un.restore(),Cn.restore(),$a&&$a.restore(),An.procs.refresh(),Ii(),Tn.forEach(function(pe){pe()})}On&&(On.addEventListener(Wo,Zs,!1),On.addEventListener(Yo,Ji,!1));function yl(){oi.length=0,cs(),On&&(On.removeEventListener(Wo,Zs),On.removeEventListener(Yo,Ji)),ai.clear(),Un.clear(),Ra.clear(),Cn.clear(),Ba.clear(),Fa.clear(),on.clear(),$a&&$a.clear(),Zn.forEach(function(te){te()})}function Xo(te){function pe(ar){var cr=d({},ar);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function nr(Vt){if(Vt in cr){var rr=cr[Vt];delete cr[Vt],Object.keys(rr).forEach(function(Nt){cr[Vt+"."+Nt]=rr[Nt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in ar&&(cr.vao=ar.vao),cr}function Ve(ar,cr){var nr={},Vt={};return Object.keys(ar).forEach(function(rr){var Nt=ar[rr];if(h.isDynamic(Nt)){Vt[rr]=h.unbox(Nt,rr);return}else if(cr&&Array.isArray(Nt)){for(var Pr=0;Pr0)return pt.call(this,er(ar|0),ar|0)}else if(Array.isArray(ar)){if(ar.length)return pt.call(this,ar,ar.length)}else return ur.call(this,ar)}return d(lr,{stats:dr,destroy:function(){Dr.destroy()}})}var Qs=Un.setFBO=Xo({framebuffer:h.define.call(null,$s,"framebuffer")});function rl(te,pe){var Ve=0;An.procs.poll();var ke=pe.color;ke&&(sr.clearColor(+ke[0]||0,+ke[1]||0,+ke[2]||0,+ke[3]||0),Ve|=Is),"depth"in pe&&(sr.clearDepth(+pe.depth),Ve|=Xs),"stencil"in pe&&(sr.clearStencil(pe.stencil|0),Ve|=si),sr.clear(Ve)}function Ml(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var pe=0;pe<6;++pe)Qs(d({framebuffer:te.framebuffer.faces[pe]},te),rl);else Qs(te,rl);else rl(null,te)}function ps(te){oi.push(te);function pe(){var Ve=ol(oi,te);function ke(){var Ye=ol(oi,ke);oi[Ye]=oi[oi.length-1],oi.length-=1,oi.length<=0&&cs()}oi[Ve]=ke}return Ii(),{cancel:pe}}function qs(){var te=vn.viewport,pe=vn.scissor_box;te[0]=te[1]=pe[0]=pe[1]=0,Ia.viewportWidth=Ia.framebufferWidth=Ia.drawingBufferWidth=te[2]=pe[2]=sr.drawingBufferWidth,Ia.viewportHeight=Ia.framebufferHeight=Ia.drawingBufferHeight=te[3]=pe[3]=sr.drawingBufferHeight}function Ys(){Ia.tick+=1,Ia.time=al(),qs(),An.procs.poll()}function Ri(){Ba.refresh(),qs(),An.procs.refresh(),$a&&$a.update()}function al(){return(m()-ui)/1e3}Ri();function go(te,pe){var Ve;switch(te){case"frame":return ps(pe);case"lost":Ve=bi;break;case"restore":Ve=Tn;break;case"destroy":Ve=Zn;break;default:}return Ve.push(pe),{cancel:function(){for(var ke=0;ke=0},read:pn,destroy:yl,_gl:sr,_refresh:Ri,poll:function(){Ys(),$a&&$a.update()},now:al,stats:Va,getCachedCode:de,preloadCachedCode:Y});return qt.onDone(null,me),me}return Bu})}}),c8=We({"node_modules/gl-util/context.js"(Z,V){"use strict";var d=Pv();V.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},A(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}A(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function A(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),f8=We({"node_modules/font-atlas/index.js"(Z,V){"use strict";var d=lT(),x=[32,126];V.exports=A;function A(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],a=E.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var h=t.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,t.width,t.height),h.font=r,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";for(var c=o[0]/2,m=o[1]/2,n=0;ne[0]-o[0]/2&&(c=o[0]/2,m+=o[1]);return t}}}),uT=We({"node_modules/bit-twiddle/twiddle.js"(Z){"use strict";"use restrict";var V=32;Z.INT_BITS=V,Z.INT_MAX=2147483647,Z.INT_MIN=-1<0)-(A<0)},Z.abs=function(A){var E=A>>V-1;return(A^E)-E},Z.min=function(A,E){return E^(A^E)&-(A65535)<<4,A>>>=E,e=(A>255)<<3,A>>>=e,E|=e,e=(A>15)<<2,A>>>=e,E|=e,e=(A>3)<<1,A>>>=e,E|=e,E|A>>1},Z.log10=function(A){return A>=1e9?9:A>=1e8?8:A>=1e7?7:A>=1e6?6:A>=1e5?5:A>=1e4?4:A>=1e3?3:A>=100?2:A>=10?1:0},Z.popCount=function(A){return A=A-(A>>>1&1431655765),A=(A&858993459)+(A>>>2&858993459),(A+(A>>>4)&252645135)*16843009>>>24};function d(A){var E=32;return A&=-A,A&&E--,A&65535&&(E-=16),A&16711935&&(E-=8),A&252645135&&(E-=4),A&858993459&&(E-=2),A&1431655765&&(E-=1),E}Z.countTrailingZeros=d,Z.nextPow2=function(A){return A+=A===0,--A,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A+1},Z.prevPow2=function(A){return A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A-(A>>>1)},Z.parity=function(A){return A^=A>>>16,A^=A>>>8,A^=A>>>4,A&=15,27030>>>A&1};var x=new Array(256);(function(A){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;A[E]=t<>>8&255]<<16|x[A>>>16&255]<<8|x[A>>>24&255]},Z.interleave2=function(A,E){return A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A|E<<1},Z.deinterleave2=function(A,E){return A=A>>>E&1431655765,A=(A|A>>>1)&858993459,A=(A|A>>>2)&252645135,A=(A|A>>>4)&16711935,A=(A|A>>>16)&65535,A<<16>>16},Z.interleave3=function(A,E,e){return A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,A|e<<2},Z.deinterleave3=function(A,E){return A=A>>>E&1227133513,A=(A|A>>>2)&3272356035,A=(A|A>>>4)&251719695,A=(A|A>>>8)&4278190335,A=(A|A>>>16)&1023,A<<22>>22},Z.nextCombination=function(A){var E=A|A-1;return E+1|(~E&-~E)-1>>>d(A)+1}}}),h8=We({"node_modules/dup/dup.js"(Z,V){"use strict";function d(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===E.length-1)for(a=0;a"u"&&(e=0),typeof E){case"number":if(E>0)return x(E|0,e);break;case"object":if(typeof E.length=="number")return d(E,e,0);break}return[]}V.exports=A}}),v8=We({"node_modules/typedarray-pool/pool.js"(Z){"use strict";var V=uT(),d=h8(),x=Ep().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var A=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Z.free=function(u){if(x.isBuffer(u))o[V.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var g=u.length||u.byteLength,f=V.log2(g)|0;r[f].push(u)}};function a(v){if(v){var u=v.length||v.byteLength,g=V.log2(u);r[g].push(v)}}function i(v){a(v.buffer)}Z.freeUint8=Z.freeUint16=Z.freeUint32=Z.freeBigUint64=Z.freeInt8=Z.freeInt16=Z.freeInt32=Z.freeBigInt64=Z.freeFloat32=Z.freeFloat=Z.freeFloat64=Z.freeDouble=Z.freeUint8Clamped=Z.freeDataView=i,Z.freeArrayBuffer=a,Z.freeBuffer=function(u){o[V.log2(u.length)].push(u)},Z.malloc=function(u,g){if(g===void 0||g==="arraybuffer")return n(u);switch(g){case"uint8":return s(u);case"uint16":return h(u);case"uint32":return c(u);case"int8":return m(u);case"int16":return p(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return _(u);case"uint8_clamped":return w(u);case"bigint64":return M(u);case"biguint64":return S(u);case"buffer":return b(u);case"data":case"dataview":return y(u);default:return null}return null};function n(u){var u=V.nextPow2(u),g=V.log2(u),f=r[g];return f.length>0?f.pop():new ArrayBuffer(u)}Z.mallocArrayBuffer=n;function s(v){return new Uint8Array(n(v),0,v)}Z.mallocUint8=s;function h(v){return new Uint16Array(n(2*v),0,v)}Z.mallocUint16=h;function c(v){return new Uint32Array(n(4*v),0,v)}Z.mallocUint32=c;function m(v){return new Int8Array(n(v),0,v)}Z.mallocInt8=m;function p(v){return new Int16Array(n(2*v),0,v)}Z.mallocInt16=p;function T(v){return new Int32Array(n(4*v),0,v)}Z.mallocInt32=T;function l(v){return new Float32Array(n(4*v),0,v)}Z.mallocFloat32=Z.mallocFloat=l;function _(v){return new Float64Array(n(8*v),0,v)}Z.mallocFloat64=Z.mallocDouble=_;function w(v){return A?new Uint8ClampedArray(n(v),0,v):s(v)}Z.mallocUint8Clamped=w;function S(v){return E?new BigUint64Array(n(8*v),0,v):null}Z.mallocBigUint64=S;function M(v){return e?new BigInt64Array(n(8*v),0,v):null}Z.mallocBigInt64=M;function y(v){return new DataView(n(v),0,v)}Z.mallocDataView=y;function b(v){v=V.nextPow2(v);var u=V.log2(v),g=o[u];return g.length>0?g.pop():new x(v)}Z.mallocBuffer=b,Z.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),d8=We({"node_modules/is-plain-obj/index.js"(Z,V){"use strict";var d=Object.prototype.toString;V.exports=function(x){var A;return d.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),cT=We({"node_modules/parse-unit/index.js"(Z,V){V.exports=function(x,A){A||(A=[0,""]),x=String(x);var E=parseFloat(x,10);return A[0]=E,A[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",A}}}),p8=We({"node_modules/to-px/topx.js"(Z,V){"use strict";var d=cT();V.exports=e;var x=96;function A(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=A(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return A(r,"font-size");case"rem":return A(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),m8=We({"node_modules/detect-kerning/index.js"(Z,V){"use strict";V.exports=E;var d=E.canvas=document.createElement("canvas"),x=d.getContext("2d"),A=e([32,126]);E.createPairs=e,E.ascii=A;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=A),x.font=i+"px "+t;for(var s=0;si*n){var p=(m-c)/i;o[h]=p*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),y8=We({"node_modules/gl-text/dist.js"(Z,V){"use strict";var d=l8(),x=Pv(),A=u8(),E=c8(),e=eT(),t=Ud(),r=f8(),o=v8(),a=rm(),i=d8(),n=cT(),s=p8(),h=m8(),c=of(),m=g8(),p=Vp(),T=uT(),l=T.nextPow2,_=new e,w=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(w=!0),document.body.removeChild(S));var S,M=function(v){y(v)?(v={regl:v},this.gl=v.regl._gl):this.gl=E(v),this.shader=_.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=v.regl||A({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),_.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(v)?v:{})};M.prototype.createShader=function(){var v=this.regl,u=v({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:v.prop("count"),offset:v.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:v.this("sizeBuffer")},width:{offset:0,stride:8,buffer:v.this("sizeBuffer")},char:v.this("charBuffer"),position:v.this("position")},uniforms:{atlasSize:function(f,P){return[P.atlas.width,P.atlas.height]},atlasDim:function(f,P){return[P.atlas.cols,P.atlas.rows]},atlas:function(f,P){return P.atlas.texture},charStep:function(f,P){return P.atlas.step},em:function(f,P){return P.atlas.em},color:v.prop("color"),opacity:v.prop("opacity"),viewport:v.this("viewportArray"),scale:v.this("scale"),align:v.prop("align"),baseline:v.prop("baseline"),translate:v.this("translate"),positionOffset:v.prop("positionOffset")},primitive:"points",viewport:v.this("viewport"),vert:` +`),_a;if(Gt&&(_a=Zu(Zr),Gt[_a]))return Gt[_a].apply(null,pa);var Ha=Function.apply(null,ea.concat(Zr));return Gt&&(Gt[_a]=Ha),Ha.apply(null,pa)}return{global:Ja,link:fa,block:ja,proc:Mn,scope:hn,cond:un,compile:yn}}var Ni="xyzw".split(""),Wi=5121,Ui=1,Ji=2,hi=0,Qn=1,ao=2,Po=3,is=4,Rs=5,_s=6,Ps="dither",ts="blend.enable",ul="blend.color",Ys="blend.equation",Ns="blend.func",ki="depth.enable",go="depth.func",Cs="depth.range",ds="depth.mask",zl="colorMask",tu="cull.enable",mu="cull.face",Ju="frontFace",Wl="lineWidth",$u="polygonOffset.enable",Zl="polygonOffset.offset",Bu="sample.alpha",$i="sample.enable",_o="sample.coverage",Qu="stencil.enable",ku="stencil.mask",gu="stencil.func",De="stencil.opFront",I="stencil.opBack",ne="scissor.enable",be="scissor.box",Ae="viewport",Re="profile",ut="framebuffer",_t="vert",Rt="frag",Zt="elements",yr="primitive",_r="count",Gr="offset",Qr="instances",je="vao",Ye="Width",at="Height",ct=ut+Ye,At=ut+at,yt=Ae+Ye,Ct=Ae+at,nr="drawingBuffer",vr=nr+Ye,Tr=nr+at,Fr=[Ns,Ys,gu,De,I,_o,Ae,be,Zl],Xr=34962,oa=34963,ga=2884,Ma=3042,en=3024,Dn=2960,In=2929,Kn=3089,vi=32823,zi=32926,Mi=32928,so=5126,jo=35664,uo=35665,Co=35666,Xo=5124,Us=35667,Is=35668,Io=35669,Ro=35670,ol=35671,Ml=35672,ru=35673,jl=35674,Qs=35675,Fl=35676,Cu=35678,pl=35680,ml=4,pe=1028,Ie=1029,Je=2304,ft=2305,pt=32775,xt=32776,Jt=519,Pt=7680,dr=0,Nr=1,Vr=32774,va=513,sa=36160,qa=36064,Wa={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ya={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ea={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Na={cw:Je,ccw:ft};function tn(tt){return Array.isArray(tt)||wr(tt)||Er(tt)}function Ka(tt){return tt.sort(function(Gt,or){return Gt===Ae?-1:or===Ae?1:Gt=1,ea>=2,Gt)}else if(or===is){var pa=tt.data;return new wa(pa.thisDep,pa.contextDep,pa.propDep,Gt)}else{if(or===Rs)return new wa(!1,!1,!1,Gt);if(or===_s){for(var la=!1,fa=!1,ja=!1,hn=0;hn=1&&(fa=!0),Ja>=2&&(ja=!0)}else un.type===is&&(la=la||un.data.thisDep,fa=fa||un.data.contextDep,ja=ja||un.data.propDep)}return new wa(la,fa,ja,Gt)}else return new wa(or===Po,or===ao,or===Qn,Gt)}}var xi=new wa(!1,!1,!1,function(){});function Fi(tt,Gt,or,ea,pa,la,fa,ja,hn,un,Ja,si,Mn,yn,Pa,Zr){var _a=un.Record,Ha={add:32774,subtract:32778,"reverse subtract":32779};or.ext_blend_minmax&&(Ha.min=pt,Ha.max=xt);var nn=or.angle_instanced_arrays,za=or.webgl_draw_buffers,Cn=or.oes_vertex_array_object,bn={dirty:!0,profile:Zr.profile},ri={},Oa=[],Ia={},Un={};function An(vt){return vt.replace(".","_")}function dn(vt,wt,It){var $t=An(vt);Oa.push(vt),ri[$t]=bn[$t]=!!It,Ia[$t]=wt}function fn(vt,wt,It){var $t=An(vt);Oa.push(vt),Array.isArray(It)?(bn[$t]=It.slice(),ri[$t]=It.slice()):bn[$t]=ri[$t]=It,Un[$t]=wt}function Bn(vt){return!!isNaN(vt)}dn(Ps,en),dn(ts,Ma),fn(ul,"blendColor",[0,0,0,0]),fn(Ys,"blendEquationSeparate",[Vr,Vr]),fn(Ns,"blendFuncSeparate",[Nr,dr,Nr,dr]),dn(ki,In,!0),fn(go,"depthFunc",va),fn(Cs,"depthRange",[0,1]),fn(ds,"depthMask",!0),fn(zl,zl,[!0,!0,!0,!0]),dn(tu,ga),fn(mu,"cullFace",Ie),fn(Ju,Ju,ft),fn(Wl,Wl,1),dn($u,vi),fn(Zl,"polygonOffset",[0,0]),dn(Bu,zi),dn($i,Mi),fn(_o,"sampleCoverage",[1,!1]),dn(Qu,Dn),fn(ku,"stencilMask",-1),fn(gu,"stencilFunc",[Jt,0,-1]),fn(De,"stencilOpSeparate",[pe,Pt,Pt,Pt]),fn(I,"stencilOpSeparate",[Ie,Pt,Pt,Pt]),dn(ne,Kn),fn(be,"scissor",[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]),fn(Ae,Ae,[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]);var ii={gl:tt,context:Mn,strings:Gt,next:ri,current:bn,draw:si,elements:la,buffer:pa,shader:Ja,attributes:un.state,vao:un,uniforms:hn,framebuffer:ja,extensions:or,timer:yn,isBufferArgs:tn},bi={primTypes:Sa,compareFuncs:ya,blendFuncs:Wa,blendEquations:Ha,stencilOps:Ea,glTypes:ma,orientationType:Na};za&&(bi.backBuffer=[Ie],bi.drawBuffer=v(ea.maxDrawbuffers,function(vt){return vt===0?[0]:v(vt,function(wt){return qa+wt})}));var Tn=0;function Yn(){var vt=di({cache:Pa}),wt=vt.link,It=vt.global;vt.id=Tn++,vt.batchId="0";var $t=wt(ii),lr=vt.shared={props:"a0"};Object.keys(ii).forEach(function(er){lr[er]=It.def($t,".",er)});var tr=vt.next={},cr=vt.current={};Object.keys(Un).forEach(function(er){Array.isArray(bn[er])&&(tr[er]=It.def(lr.next,".",er),cr[er]=It.def(lr.current,".",er))});var rr=vt.constants={};Object.keys(bi).forEach(function(er){rr[er]=It.def(JSON.stringify(bi[er]))}),vt.invoke=function(er,Nt){switch(Nt.type){case hi:var Cr=["this",lr.context,lr.props,vt.batchId];return er.def(wt(Nt.data),".call(",Cr.slice(0,Math.max(Nt.data.length+1,4)),")");case Qn:return er.def(lr.props,Nt.data);case ao:return er.def(lr.context,Nt.data);case Po:return er.def("this",Nt.data);case is:return Nt.data.append(vt,er),Nt.data.ref;case Rs:return Nt.data.toString();case _s:return Nt.data.map(function(Hr){return vt.invoke(er,Hr)})}},vt.attribCache={};var Vt={};return vt.scopeAttrib=function(er){var Nt=Gt.id(er);if(Nt in Vt)return Vt[Nt];var Cr=un.scope[Nt];Cr||(Cr=un.scope[Nt]=new _a);var Hr=Vt[Nt]=wt(Cr);return Hr},vt}function mi(vt){var wt=vt.static,It=vt.dynamic,$t;if(Re in wt){var lr=!!wt[Re];$t=Xn(function(cr,rr){return lr}),$t.enable=lr}else if(Re in It){var tr=It[Re];$t=ni(tr,function(cr,rr){return cr.invoke(rr,tr)})}return $t}function wi(vt,wt){var It=vt.static,$t=vt.dynamic;if(ut in It){var lr=It[ut];return lr?(lr=ja.getFramebuffer(lr),Xn(function(cr,rr){var Vt=cr.link(lr),er=cr.shared;rr.set(er.framebuffer,".next",Vt);var Nt=er.context;return rr.set(Nt,"."+ct,Vt+".width"),rr.set(Nt,"."+At,Vt+".height"),Vt})):Xn(function(cr,rr){var Vt=cr.shared;rr.set(Vt.framebuffer,".next","null");var er=Vt.context;return rr.set(er,"."+ct,er+"."+vr),rr.set(er,"."+At,er+"."+Tr),"null"})}else if(ut in $t){var tr=$t[ut];return ni(tr,function(cr,rr){var Vt=cr.invoke(rr,tr),er=cr.shared,Nt=er.framebuffer,Cr=rr.def(Nt,".getFramebuffer(",Vt,")");rr.set(Nt,".next",Cr);var Hr=er.context;return rr.set(Hr,"."+ct,Cr+"?"+Cr+".width:"+Hr+"."+vr),rr.set(Hr,"."+At,Cr+"?"+Cr+".height:"+Hr+"."+Tr),Cr})}else return null}function Ri(vt,wt,It){var $t=vt.static,lr=vt.dynamic;function tr(Vt){if(Vt in $t){var er=$t[Vt],Nt=!0,Cr=er.x|0,Hr=er.y|0,ca,on;return"width"in er?ca=er.width|0:Nt=!1,"height"in er?on=er.height|0:Nt=!1,new wa(!Nt&&wt&&wt.thisDep,!Nt&&wt&&wt.contextDep,!Nt&&wt&&wt.propDep,function(Nn,En){var Qa=Nn.shared.context,cn=ca;"width"in er||(cn=En.def(Qa,".",ct,"-",Cr));var mn=on;return"height"in er||(mn=En.def(Qa,".",At,"-",Hr)),[Cr,Hr,cn,mn]})}else if(Vt in lr){var Fa=lr[Vt],Za=ni(Fa,function(Nn,En){var Qa=Nn.invoke(En,Fa),cn=Nn.shared.context,mn=En.def(Qa,".x|0"),Pn=En.def(Qa,".y|0"),ei=En.def('"width" in ',Qa,"?",Qa,".width|0:","(",cn,".",ct,"-",mn,")"),no=En.def('"height" in ',Qa,"?",Qa,".height|0:","(",cn,".",At,"-",Pn,")");return[mn,Pn,ei,no]});return wt&&(Za.thisDep=Za.thisDep||wt.thisDep,Za.contextDep=Za.contextDep||wt.contextDep,Za.propDep=Za.propDep||wt.propDep),Za}else return wt?new wa(wt.thisDep,wt.contextDep,wt.propDep,function(Nn,En){var Qa=Nn.shared.context;return[0,0,En.def(Qa,".",ct),En.def(Qa,".",At)]}):null}var cr=tr(Ae);if(cr){var rr=cr;cr=new wa(cr.thisDep,cr.contextDep,cr.propDep,function(Vt,er){var Nt=rr.append(Vt,er),Cr=Vt.shared.context;return er.set(Cr,"."+yt,Nt[2]),er.set(Cr,"."+Ct,Nt[3]),Nt})}return{viewport:cr,scissor_box:tr(be)}}function ps(vt,wt){var It=vt.static,$t=typeof It[Rt]=="string"&&typeof It[_t]=="string";if($t){if(Object.keys(wt.dynamic).length>0)return null;var lr=wt.static,tr=Object.keys(lr);if(tr.length>0&&typeof lr[tr[0]]=="number"){for(var cr=[],rr=0;rr"+mn+"?"+Nt+".constant["+mn+"]:0;"}).join(""),"}}else{","if(",ca,"(",Nt,".buffer)){",Nn,"=",on,".createStream(",Xr,",",Nt,".buffer);","}else{",Nn,"=",on,".getBuffer(",Nt,".buffer);","}",En,'="type" in ',Nt,"?",Hr.glTypes,"[",Nt,".type]:",Nn,".dtype;",Fa.normalized,"=!!",Nt,".normalized;");function Qa(cn){er(Fa[cn],"=",Nt,".",cn,"|0;")}return Qa("size"),Qa("offset"),Qa("stride"),Qa("divisor"),er("}}"),er.exit("if(",Fa.isStream,"){",on,".destroyStream(",Nn,");","}"),Fa}lr[tr]=ni(cr,rr)}),lr}function al(vt){var wt=vt.static,It=vt.dynamic,$t={};return Object.keys(wt).forEach(function(lr){var tr=wt[lr];$t[lr]=Xn(function(cr,rr){return typeof tr=="number"||typeof tr=="boolean"?""+tr:cr.link(tr)})}),Object.keys(It).forEach(function(lr){var tr=It[lr];$t[lr]=ni(tr,function(cr,rr){return cr.invoke(rr,tr)})}),$t}function El(vt,wt,It,$t,lr){var tr=vt.static,cr=vt.dynamic,rr=ps(vt,wt),Vt=wi(vt,lr),er=Ri(vt,Vt,lr),Nt=Qi(vt,lr),Cr=_l(vt,lr),Hr=Js(vt,lr,rr);function ca(Qa){var cn=er[Qa];cn&&(Cr[Qa]=cn)}ca(Ae),ca(An(be));var on=Object.keys(Cr).length>0,Fa={framebuffer:Vt,draw:Nt,shader:Hr,state:Cr,dirty:on,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Fa.profile=mi(vt,lr),Fa.uniforms=Wo(It,lr),Fa.drawVAO=Fa.scopeVAO=Nt.vao,!Fa.drawVAO&&Hr.program&&!rr&&or.angle_instanced_arrays&&Nt.static.elements){var Za=!0,Nn=Hr.program.attributes.map(function(Qa){var cn=wt.static[Qa];return Za=Za&&!!cn,cn});if(Za&&Nn.length>0){var En=un.getVAO(un.createVAO({attributes:Nn,elements:Nt.static.elements}));Fa.drawVAO=new wa(null,null,null,function(Qa,cn){return Qa.link(En)}),Fa.useVAO=!0}}return rr?Fa.useVAO=!0:Fa.attributes=tl(wt,lr),Fa.context=al($t,lr),Fa}function ws(vt,wt,It){var $t=vt.shared,lr=$t.context,tr=vt.scope();Object.keys(It).forEach(function(cr){wt.save(lr,"."+cr);var rr=It[cr],Vt=rr.append(vt,wt);Array.isArray(Vt)?tr(lr,".",cr,"=[",Vt.join(),"];"):tr(lr,".",cr,"=",Vt,";")}),wt(tr)}function Hs(vt,wt,It,$t){var lr=vt.shared,tr=lr.gl,cr=lr.framebuffer,rr;za&&(rr=wt.def(lr.extensions,".webgl_draw_buffers"));var Vt=vt.constants,er=Vt.drawBuffer,Nt=Vt.backBuffer,Cr;It?Cr=It.append(vt,wt):Cr=wt.def(cr,".next"),$t||wt("if(",Cr,"!==",cr,".cur){"),wt("if(",Cr,"){",tr,".bindFramebuffer(",sa,",",Cr,".framebuffer);"),za&&wt(rr,".drawBuffersWEBGL(",er,"[",Cr,".colorAttachments.length]);"),wt("}else{",tr,".bindFramebuffer(",sa,",null);"),za&&wt(rr,".drawBuffersWEBGL(",Nt,");"),wt("}",cr,".cur=",Cr,";"),$t||wt("}")}function $s(vt,wt,It){var $t=vt.shared,lr=$t.gl,tr=vt.current,cr=vt.next,rr=$t.current,Vt=$t.next,er=vt.cond(rr,".dirty");Oa.forEach(function(Nt){var Cr=An(Nt);if(!(Cr in It.state)){var Hr,ca;if(Cr in cr){Hr=cr[Cr],ca=tr[Cr];var on=v(bn[Cr].length,function(Za){return er.def(Hr,"[",Za,"]")});er(vt.cond(on.map(function(Za,Nn){return Za+"!=="+ca+"["+Nn+"]"}).join("||")).then(lr,".",Un[Cr],"(",on,");",on.map(function(Za,Nn){return ca+"["+Nn+"]="+Za}).join(";"),";"))}else{Hr=er.def(Vt,".",Cr);var Fa=vt.cond(Hr,"!==",rr,".",Cr);er(Fa),Cr in Ia?Fa(vt.cond(Hr).then(lr,".enable(",Ia[Cr],");").else(lr,".disable(",Ia[Cr],");"),rr,".",Cr,"=",Hr,";"):Fa(lr,".",Un[Cr],"(",Hr,");",rr,".",Cr,"=",Hr,";")}}}),Object.keys(It.state).length===0&&er(rr,".dirty=false;"),wt(er)}function Di(vt,wt,It,$t){var lr=vt.shared,tr=vt.current,cr=lr.current,rr=lr.gl,Vt;Ka(Object.keys(It)).forEach(function(er){var Nt=It[er];if(!($t&&!$t(Nt))){var Cr=Nt.append(vt,wt);if(Ia[er]){var Hr=Ia[er];Jn(Nt)?(Vt=vt.link(Cr,{stable:!0}),wt(vt.cond(Vt).then(rr,".enable(",Hr,");").else(rr,".disable(",Hr,");")),wt(cr,".",er,"=",Vt,";")):(wt(vt.cond(Cr).then(rr,".enable(",Hr,");").else(rr,".disable(",Hr,");")),wt(cr,".",er,"=",Cr,";"))}else if(ua(Cr)){var ca=tr[er];wt(rr,".",Un[er],"(",Cr,");",Cr.map(function(on,Fa){return ca+"["+Fa+"]="+on}).join(";"),";")}else Jn(Nt)?(Vt=vt.link(Cr,{stable:!0}),wt(rr,".",Un[er],"(",Vt,");",cr,".",er,"=",Vt,";")):wt(rr,".",Un[er],"(",Cr,");",cr,".",er,"=",Cr,";")}})}function nl(vt,wt){nn&&(vt.instancing=wt.def(vt.shared.extensions,".angle_instanced_arrays"))}function mo(vt,wt,It,$t,lr){var tr=vt.shared,cr=vt.stats,rr=tr.current,Vt=tr.timer,er=It.profile;function Nt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Cr,Hr;function ca(Qa){Cr=wt.def(),Qa(Cr,"=",Nt(),";"),typeof lr=="string"?Qa(cr,".count+=",lr,";"):Qa(cr,".count++;"),yn&&($t?(Hr=wt.def(),Qa(Hr,"=",Vt,".getNumPendingQueries();")):Qa(Vt,".beginQuery(",cr,");"))}function on(Qa){Qa(cr,".cpuTime+=",Nt(),"-",Cr,";"),yn&&($t?Qa(Vt,".pushScopeStats(",Hr,",",Vt,".getNumPendingQueries(),",cr,");"):Qa(Vt,".endQuery();"))}function Fa(Qa){var cn=wt.def(rr,".profile");wt(rr,".profile=",Qa,";"),wt.exit(rr,".profile=",cn,";")}var Za;if(er){if(Jn(er)){er.enable?(ca(wt),on(wt.exit),Fa("true")):Fa("false");return}Za=er.append(vt,wt),Fa(Za)}else Za=wt.def(rr,".profile");var Nn=vt.block();ca(Nn),wt("if(",Za,"){",Nn,"}");var En=vt.block();on(En),wt.exit("if(",Za,"){",En,"}")}function me(vt,wt,It,$t,lr){var tr=vt.shared;function cr(Vt){switch(Vt){case jo:case Us:case ol:return 2;case uo:case Is:case Ml:return 3;case Co:case Io:case ru:return 4;default:return 1}}function rr(Vt,er,Nt){var Cr=tr.gl,Hr=wt.def(Vt,".location"),ca=wt.def(tr.attributes,"[",Hr,"]"),on=Nt.state,Fa=Nt.buffer,Za=[Nt.x,Nt.y,Nt.z,Nt.w],Nn=["buffer","normalized","offset","stride"];function En(){wt("if(!",ca,".buffer){",Cr,".enableVertexAttribArray(",Hr,");}");var cn=Nt.type,mn;if(Nt.size?mn=wt.def(Nt.size,"||",er):mn=er,wt("if(",ca,".type!==",cn,"||",ca,".size!==",mn,"||",Nn.map(function(ei){return ca+"."+ei+"!=="+Nt[ei]}).join("||"),"){",Cr,".bindBuffer(",Xr,",",Fa,".buffer);",Cr,".vertexAttribPointer(",[Hr,mn,cn,Nt.normalized,Nt.stride,Nt.offset],");",ca,".type=",cn,";",ca,".size=",mn,";",Nn.map(function(ei){return ca+"."+ei+"="+Nt[ei]+";"}).join(""),"}"),nn){var Pn=Nt.divisor;wt("if(",ca,".divisor!==",Pn,"){",vt.instancing,".vertexAttribDivisorANGLE(",[Hr,Pn],");",ca,".divisor=",Pn,";}")}}function Qa(){wt("if(",ca,".buffer){",Cr,".disableVertexAttribArray(",Hr,");",ca,".buffer=null;","}if(",Ni.map(function(cn,mn){return ca+"."+cn+"!=="+Za[mn]}).join("||"),"){",Cr,".vertexAttrib4f(",Hr,",",Za,");",Ni.map(function(cn,mn){return ca+"."+cn+"="+Za[mn]+";"}).join(""),"}")}on===Ui?En():on===Ji?Qa():(wt("if(",on,"===",Ui,"){"),En(),wt("}else{"),Qa(),wt("}"))}$t.forEach(function(Vt){var er=Vt.name,Nt=It.attributes[er],Cr;if(Nt){if(!lr(Nt))return;Cr=Nt.append(vt,wt)}else{if(!lr(xi))return;var Hr=vt.scopeAttrib(er);Cr={},Object.keys(new _a).forEach(function(ca){Cr[ca]=wt.def(Hr,".",ca)})}rr(vt.link(Vt),cr(Vt.info.type),Cr)})}function K(vt,wt,It,$t,lr,tr){for(var cr=vt.shared,rr=cr.gl,Vt,er=0;er<$t.length;++er){var Nt=$t[er],Cr=Nt.name,Hr=Nt.info.type,ca=It.uniforms[Cr],on=vt.link(Nt),Fa=on+".location",Za;if(ca){if(!lr(ca))continue;if(Jn(ca)){var Nn=ca.value;if(Hr===Cu||Hr===pl){var En=vt.link(Nn._texture||Nn.color[0]._texture);wt(rr,".uniform1i(",Fa,",",En+".bind());"),wt.exit(En,".unbind();")}else if(Hr===jl||Hr===Qs||Hr===Fl){var Qa=vt.global.def("new Float32Array(["+Array.prototype.slice.call(Nn)+"])"),cn=2;Hr===Qs?cn=3:Hr===Fl&&(cn=4),wt(rr,".uniformMatrix",cn,"fv(",Fa,",false,",Qa,");")}else{switch(Hr){case so:Vt="1f";break;case jo:Vt="2f";break;case uo:Vt="3f";break;case Co:Vt="4f";break;case Ro:Vt="1i";break;case Xo:Vt="1i";break;case ol:Vt="2i";break;case Us:Vt="2i";break;case Ml:Vt="3i";break;case Is:Vt="3i";break;case ru:Vt="4i";break;case Io:Vt="4i";break}wt(rr,".uniform",Vt,"(",Fa,",",ua(Nn)?Array.prototype.slice.call(Nn):Nn,");")}continue}else Za=ca.append(vt,wt)}else{if(!lr(xi))continue;Za=wt.def(cr.uniforms,"[",Gt.id(Cr),"]")}Hr===Cu?wt("if(",Za,"&&",Za,'._reglType==="framebuffer"){',Za,"=",Za,".color[0];","}"):Hr===pl&&wt("if(",Za,"&&",Za,'._reglType==="framebufferCube"){',Za,"=",Za,".color[0];","}");var mn=1;switch(Hr){case Cu:case pl:var Pn=wt.def(Za,"._texture");wt(rr,".uniform1i(",Fa,",",Pn,".bind());"),wt.exit(Pn,".unbind();");continue;case Xo:case Ro:Vt="1i";break;case Us:case ol:Vt="2i",mn=2;break;case Is:case Ml:Vt="3i",mn=3;break;case Io:case ru:Vt="4i",mn=4;break;case so:Vt="1f";break;case jo:Vt="2f",mn=2;break;case uo:Vt="3f",mn=3;break;case Co:Vt="4f",mn=4;break;case jl:Vt="Matrix2fv";break;case Qs:Vt="Matrix3fv";break;case Fl:Vt="Matrix4fv";break}if(Vt.charAt(0)==="M"){wt(rr,".uniform",Vt,"(",Fa,",");var ei=Math.pow(Hr-jl+2,2),no=vt.global.def("new Float32Array(",ei,")");Array.isArray(Za)?wt("false,(",v(ei,function(ks){return no+"["+ks+"]="+Za[ks]}),",",no,")"):wt("false,(Array.isArray(",Za,")||",Za," instanceof Float32Array)?",Za,":(",v(ei,function(ks){return no+"["+ks+"]="+Za+"["+ks+"]"}),",",no,")"),wt(");")}else if(mn>1){for(var Ao=[],fs=[],xo=0;xo>1)",Fa],");")}function Pn(){It(Za,".drawArraysInstancedANGLE(",[Hr,ca,on,Fa],");")}Nt&&Nt!=="null"?En?mn():(It("if(",Nt,"){"),mn(),It("}else{"),Pn(),It("}")):Pn()}function cn(){function mn(){It(tr+".drawElements("+[Hr,on,Nn,ca+"<<(("+Nn+"-"+Wi+")>>1)"]+");")}function Pn(){It(tr+".drawArrays("+[Hr,ca,on]+");")}Nt&&Nt!=="null"?En?mn():(It("if(",Nt,"){"),mn(),It("}else{"),Pn(),It("}")):Pn()}nn&&(typeof Fa!="number"||Fa>=0)?typeof Fa=="string"?(It("if(",Fa,">0){"),Qa(),It("}else if(",Fa,"<0){"),cn(),It("}")):Qa():cn()}function te(vt,wt,It,$t,lr){var tr=Yn(),cr=tr.proc("body",lr);return nn&&(tr.instancing=cr.def(tr.shared.extensions,".angle_instanced_arrays")),vt(tr,cr,It,$t),tr.compile().body}function ge(vt,wt,It,$t){nl(vt,wt),It.useVAO?It.drawVAO?wt(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,wt),");"):wt(vt.shared.vao,".setVAO(",vt.shared.vao,".targetVAO);"):(wt(vt.shared.vao,".setVAO(null);"),me(vt,wt,It,$t.attributes,function(){return!0})),K(vt,wt,It,$t.uniforms,function(){return!0},!1),ye(vt,wt,wt,It)}function Ne(vt,wt){var It=vt.proc("draw",1);nl(vt,It),ws(vt,It,wt.context),Hs(vt,It,wt.framebuffer),$s(vt,It,wt),Di(vt,It,wt.state),mo(vt,It,wt,!1,!0);var $t=wt.shader.progVar.append(vt,It);if(It(vt.shared.gl,".useProgram(",$t,".program);"),wt.shader.program)ge(vt,It,wt,wt.shader.program);else{It(vt.shared.vao,".setVAO(null);");var lr=vt.global.def("{}"),tr=It.def($t,".id"),cr=It.def(lr,"[",tr,"]");It(vt.cond(cr).then(cr,".call(this,a0);").else(cr,"=",lr,"[",tr,"]=",vt.link(function(rr){return te(ge,vt,wt,rr,1)}),"(",$t,");",cr,".call(this,a0);"))}Object.keys(wt.state).length>0&&It(vt.shared.current,".dirty=true;"),vt.shared.vao&&It(vt.shared.vao,".setVAO(null);")}function Me(vt,wt,It,$t){vt.batchId="a1",nl(vt,wt);function lr(){return!0}me(vt,wt,It,$t.attributes,lr),K(vt,wt,It,$t.uniforms,lr,!1),ye(vt,wt,wt,It)}function Ke(vt,wt,It,$t){nl(vt,wt);var lr=It.contextDep,tr=wt.def(),cr="a0",rr="a1",Vt=wt.def();vt.shared.props=Vt,vt.batchId=tr;var er=vt.scope(),Nt=vt.scope();wt(er.entry,"for(",tr,"=0;",tr,"<",rr,";++",tr,"){",Vt,"=",cr,"[",tr,"];",Nt,"}",er.exit);function Cr(Nn){return Nn.contextDep&&lr||Nn.propDep}function Hr(Nn){return!Cr(Nn)}if(It.needsContext&&ws(vt,Nt,It.context),It.needsFramebuffer&&Hs(vt,Nt,It.framebuffer),Di(vt,Nt,It.state,Cr),It.profile&&Cr(It.profile)&&mo(vt,Nt,It,!1,!0),$t)It.useVAO?It.drawVAO?Cr(It.drawVAO)?Nt(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,Nt),");"):er(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,er),");"):er(vt.shared.vao,".setVAO(",vt.shared.vao,".targetVAO);"):(er(vt.shared.vao,".setVAO(null);"),me(vt,er,It,$t.attributes,Hr),me(vt,Nt,It,$t.attributes,Cr)),K(vt,er,It,$t.uniforms,Hr,!1),K(vt,Nt,It,$t.uniforms,Cr,!0),ye(vt,er,Nt,It);else{var ca=vt.global.def("{}"),on=It.shader.progVar.append(vt,Nt),Fa=Nt.def(on,".id"),Za=Nt.def(ca,"[",Fa,"]");Nt(vt.shared.gl,".useProgram(",on,".program);","if(!",Za,"){",Za,"=",ca,"[",Fa,"]=",vt.link(function(Nn){return te(Me,vt,It,Nn,2)}),"(",on,");}",Za,".call(this,a0[",tr,"],",tr,");")}}function ht(vt,wt){var It=vt.proc("batch",2);vt.batchId="0",nl(vt,It);var $t=!1,lr=!0;Object.keys(wt.context).forEach(function(ca){$t=$t||wt.context[ca].propDep}),$t||(ws(vt,It,wt.context),lr=!1);var tr=wt.framebuffer,cr=!1;tr?(tr.propDep?$t=cr=!0:tr.contextDep&&$t&&(cr=!0),cr||Hs(vt,It,tr)):Hs(vt,It,null),wt.state.viewport&&wt.state.viewport.propDep&&($t=!0);function rr(ca){return ca.contextDep&&$t||ca.propDep}$s(vt,It,wt),Di(vt,It,wt.state,function(ca){return!rr(ca)}),(!wt.profile||!rr(wt.profile))&&mo(vt,It,wt,!1,"a1"),wt.contextDep=$t,wt.needsContext=lr,wt.needsFramebuffer=cr;var Vt=wt.shader.progVar;if(Vt.contextDep&&$t||Vt.propDep)Ke(vt,It,wt,null);else{var er=Vt.append(vt,It);if(It(vt.shared.gl,".useProgram(",er,".program);"),wt.shader.program)Ke(vt,It,wt,wt.shader.program);else{It(vt.shared.vao,".setVAO(null);");var Nt=vt.global.def("{}"),Cr=It.def(er,".id"),Hr=It.def(Nt,"[",Cr,"]");It(vt.cond(Hr).then(Hr,".call(this,a0,a1);").else(Hr,"=",Nt,"[",Cr,"]=",vt.link(function(ca){return te(Ke,vt,wt,ca,2)}),"(",er,");",Hr,".call(this,a0,a1);"))}}Object.keys(wt.state).length>0&&It(vt.shared.current,".dirty=true;"),vt.shared.vao&&It(vt.shared.vao,".setVAO(null);")}function Bt(vt,wt){var It=vt.proc("scope",3);vt.batchId="a2";var $t=vt.shared,lr=$t.current;if(ws(vt,It,wt.context),wt.framebuffer&&wt.framebuffer.append(vt,It),Ka(Object.keys(wt.state)).forEach(function(rr){var Vt=wt.state[rr],er=Vt.append(vt,It);ua(er)?er.forEach(function(Nt,Cr){Bn(Nt)?It.set(vt.next[rr],"["+Cr+"]",Nt):It.set(vt.next[rr],"["+Cr+"]",vt.link(Nt,{stable:!0}))}):Jn(Vt)?It.set($t.next,"."+rr,vt.link(er,{stable:!0})):It.set($t.next,"."+rr,er)}),mo(vt,It,wt,!0,!0),[Zt,Gr,_r,Qr,yr].forEach(function(rr){var Vt=wt.draw[rr];if(Vt){var er=Vt.append(vt,It);Bn(er)?It.set($t.draw,"."+rr,er):It.set($t.draw,"."+rr,vt.link(er),{stable:!0})}}),Object.keys(wt.uniforms).forEach(function(rr){var Vt=wt.uniforms[rr].append(vt,It);Array.isArray(Vt)&&(Vt="["+Vt.map(function(er){return Bn(er)?er:vt.link(er,{stable:!0})})+"]"),It.set($t.uniforms,"["+vt.link(Gt.id(rr),{stable:!0})+"]",Vt)}),Object.keys(wt.attributes).forEach(function(rr){var Vt=wt.attributes[rr].append(vt,It),er=vt.scopeAttrib(rr);Object.keys(new _a).forEach(function(Nt){It.set(er,"."+Nt,Vt[Nt])})}),wt.scopeVAO){var tr=wt.scopeVAO.append(vt,It);Bn(tr)?It.set($t.vao,".targetVAO",tr):It.set($t.vao,".targetVAO",vt.link(tr,{stable:!0}))}function cr(rr){var Vt=wt.shader[rr];if(Vt){var er=Vt.append(vt,It);Bn(er)?It.set($t.shader,"."+rr,er):It.set($t.shader,"."+rr,vt.link(er,{stable:!0}))}}cr(_t),cr(Rt),Object.keys(wt.state).length>0&&(It(lr,".dirty=true;"),It.exit(lr,".dirty=true;")),It("a1(",vt.shared.context,",a0,",vt.batchId,");")}function gr(vt){if(!(typeof vt!="object"||ua(vt))){for(var wt=Object.keys(vt),It=0;It=0;--te){var ge=ii[te];ge&&ge(Pa,null,0)}or.flush(),Ja&&Ja.update()}function Ri(){!mi&&ii.length>0&&(mi=f.next(wi))}function ps(){mi&&(f.cancel(wi),mi=null)}function Js(te){te.preventDefault(),pa=!0,ps(),bi.forEach(function(ge){ge()})}function Qi(te){or.getError(),pa=!1,la.restore(),ri.restore(),nn.restore(),Oa.restore(),Ia.restore(),Un.restore(),Cn.restore(),Ja&&Ja.restore(),An.procs.refresh(),Ri(),Tn.forEach(function(ge){ge()})}Bn&&(Bn.addEventListener(Ho,Js,!1),Bn.addEventListener(Yo,Qi,!1));function _l(){ii.length=0,ps(),Bn&&(Bn.removeEventListener(Ho,Js),Bn.removeEventListener(Yo,Qi)),ri.clear(),Un.clear(),Ia.clear(),Cn.clear(),Oa.clear(),za.clear(),nn.clear(),Ja&&Ja.clear(),Yn.forEach(function(te){te()})}function Wo(te){function ge(tr){var cr=d({},tr);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function rr(Vt){if(Vt in cr){var er=cr[Vt];delete cr[Vt],Object.keys(er).forEach(function(Nt){cr[Vt+"."+Nt]=er[Nt]})}}return rr("blend"),rr("depth"),rr("cull"),rr("stencil"),rr("polygonOffset"),rr("scissor"),rr("sample"),"vao"in tr&&(cr.vao=tr.vao),cr}function Ne(tr,cr){var rr={},Vt={};return Object.keys(tr).forEach(function(er){var Nt=tr[er];if(h.isDynamic(Nt)){Vt[er]=h.unbox(Nt,er);return}else if(cr&&Array.isArray(Nt)){for(var Cr=0;Cr0)return vt.call(this,$t(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return vt.call(this,tr,tr.length)}else return ur.call(this,tr)}return d(lr,{stats:gr,destroy:function(){Dr.destroy()}})}var tl=Un.setFBO=Wo({framebuffer:h.define.call(null,el,"framebuffer")});function al(te,ge){var Ne=0;An.procs.poll();var Me=ge.color;Me&&(or.clearColor(+Me[0]||0,+Me[1]||0,+Me[2]||0,+Me[3]||0),Ne|=Ds),"depth"in ge&&(or.clearDepth(+ge.depth),Ne|=Ks),"stencil"in ge&&(or.clearStencil(ge.stencil|0),Ne|=oi),or.clear(Ne)}function El(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var ge=0;ge<6;++ge)tl(d({framebuffer:te.framebuffer.faces[ge]},te),al);else tl(te,al);else al(null,te)}function ws(te){ii.push(te);function ge(){var Ne=sl(ii,te);function Me(){var Ke=sl(ii,Me);ii[Ke]=ii[ii.length-1],ii.length-=1,ii.length<=0&&ps()}ii[Ne]=Me}return Ri(),{cancel:ge}}function Hs(){var te=fn.viewport,ge=fn.scissor_box;te[0]=te[1]=ge[0]=ge[1]=0,Pa.viewportWidth=Pa.framebufferWidth=Pa.drawingBufferWidth=te[2]=ge[2]=or.drawingBufferWidth,Pa.viewportHeight=Pa.framebufferHeight=Pa.drawingBufferHeight=te[3]=ge[3]=or.drawingBufferHeight}function $s(){Pa.tick+=1,Pa.time=nl(),Hs(),An.procs.poll()}function Di(){Oa.refresh(),Hs(),An.procs.refresh(),Ja&&Ja.update()}function nl(){return(p()-si)/1e3}Di();function mo(te,ge){var Ne;switch(te){case"frame":return ws(ge);case"lost":Ne=bi;break;case"restore":Ne=Tn;break;case"destroy":Ne=Yn;break;default:}return Ne.push(ge),{cancel:function(){for(var Me=0;Me=0},read:dn,destroy:_l,_gl:or,_refresh:Di,poll:function(){$s(),Ja&&Ja.update()},now:nl,stats:ja,getCachedCode:me,preloadCachedCode:K});return Gt.onDone(null,ye),ye}return Nu})}}),f8=Ge({"node_modules/gl-util/context.js"(Z,q){"use strict";var d=Ov();q.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},S(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}S(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function S(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),h8=Ge({"node_modules/font-atlas/index.js"(Z,q){"use strict";var d=hT(),x=[32,126];q.exports=S;function S(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],a=E.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var h=t.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,t.width,t.height),h.font=r,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";for(var f=o[0]/2,p=o[1]/2,n=0;ne[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return t}}}),vT=Ge({"node_modules/bit-twiddle/twiddle.js"(Z){"use strict";"use restrict";var q=32;Z.INT_BITS=q,Z.INT_MAX=2147483647,Z.INT_MIN=-1<0)-(S<0)},Z.abs=function(S){var E=S>>q-1;return(S^E)-E},Z.min=function(S,E){return E^(S^E)&-(S65535)<<4,S>>>=E,e=(S>255)<<3,S>>>=e,E|=e,e=(S>15)<<2,S>>>=e,E|=e,e=(S>3)<<1,S>>>=e,E|=e,E|S>>1},Z.log10=function(S){return S>=1e9?9:S>=1e8?8:S>=1e7?7:S>=1e6?6:S>=1e5?5:S>=1e4?4:S>=1e3?3:S>=100?2:S>=10?1:0},Z.popCount=function(S){return S=S-(S>>>1&1431655765),S=(S&858993459)+(S>>>2&858993459),(S+(S>>>4)&252645135)*16843009>>>24};function d(S){var E=32;return S&=-S,S&&E--,S&65535&&(E-=16),S&16711935&&(E-=8),S&252645135&&(E-=4),S&858993459&&(E-=2),S&1431655765&&(E-=1),E}Z.countTrailingZeros=d,Z.nextPow2=function(S){return S+=S===0,--S,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S+1},Z.prevPow2=function(S){return S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S-(S>>>1)},Z.parity=function(S){return S^=S>>>16,S^=S>>>8,S^=S>>>4,S&=15,27030>>>S&1};var x=new Array(256);(function(S){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;S[E]=t<>>8&255]<<16|x[S>>>16&255]<<8|x[S>>>24&255]},Z.interleave2=function(S,E){return S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,S|E<<1},Z.deinterleave2=function(S,E){return S=S>>>E&1431655765,S=(S|S>>>1)&858993459,S=(S|S>>>2)&252645135,S=(S|S>>>4)&16711935,S=(S|S>>>16)&65535,S<<16>>16},Z.interleave3=function(S,E,e){return S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,S|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,S|e<<2},Z.deinterleave3=function(S,E){return S=S>>>E&1227133513,S=(S|S>>>2)&3272356035,S=(S|S>>>4)&251719695,S=(S|S>>>8)&4278190335,S=(S|S>>>16)&1023,S<<22>>22},Z.nextCombination=function(S){var E=S|S-1;return E+1|(~E&-~E)-1>>>d(S)+1}}}),v8=Ge({"node_modules/dup/dup.js"(Z,q){"use strict";function d(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===E.length-1)for(a=0;a"u"&&(e=0),typeof E){case"number":if(E>0)return x(E|0,e);break;case"object":if(typeof E.length=="number")return d(E,e,0);break}return[]}q.exports=S}}),d8=Ge({"node_modules/typedarray-pool/pool.js"(Z){"use strict";var q=vT(),d=v8(),x=Rp().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var S=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Z.free=function(u){if(x.isBuffer(u))o[q.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var y=u.length||u.byteLength,m=q.log2(y)|0;r[m].push(u)}};function a(v){if(v){var u=v.length||v.byteLength,y=q.log2(u);r[y].push(v)}}function i(v){a(v.buffer)}Z.freeUint8=Z.freeUint16=Z.freeUint32=Z.freeBigUint64=Z.freeInt8=Z.freeInt16=Z.freeInt32=Z.freeBigInt64=Z.freeFloat32=Z.freeFloat=Z.freeFloat64=Z.freeDouble=Z.freeUint8Clamped=Z.freeDataView=i,Z.freeArrayBuffer=a,Z.freeBuffer=function(u){o[q.log2(u.length)].push(u)},Z.malloc=function(u,y){if(y===void 0||y==="arraybuffer")return n(u);switch(y){case"uint8":return s(u);case"uint16":return h(u);case"uint32":return f(u);case"int8":return p(u);case"int16":return c(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return _(u);case"uint8_clamped":return w(u);case"bigint64":return M(u);case"biguint64":return A(u);case"buffer":return b(u);case"data":case"dataview":return g(u);default:return null}return null};function n(u){var u=q.nextPow2(u),y=q.log2(u),m=r[y];return m.length>0?m.pop():new ArrayBuffer(u)}Z.mallocArrayBuffer=n;function s(v){return new Uint8Array(n(v),0,v)}Z.mallocUint8=s;function h(v){return new Uint16Array(n(2*v),0,v)}Z.mallocUint16=h;function f(v){return new Uint32Array(n(4*v),0,v)}Z.mallocUint32=f;function p(v){return new Int8Array(n(v),0,v)}Z.mallocInt8=p;function c(v){return new Int16Array(n(2*v),0,v)}Z.mallocInt16=c;function T(v){return new Int32Array(n(4*v),0,v)}Z.mallocInt32=T;function l(v){return new Float32Array(n(4*v),0,v)}Z.mallocFloat32=Z.mallocFloat=l;function _(v){return new Float64Array(n(8*v),0,v)}Z.mallocFloat64=Z.mallocDouble=_;function w(v){return S?new Uint8ClampedArray(n(v),0,v):s(v)}Z.mallocUint8Clamped=w;function A(v){return E?new BigUint64Array(n(8*v),0,v):null}Z.mallocBigUint64=A;function M(v){return e?new BigInt64Array(n(8*v),0,v):null}Z.mallocBigInt64=M;function g(v){return new DataView(n(v),0,v)}Z.mallocDataView=g;function b(v){v=q.nextPow2(v);var u=q.log2(v),y=o[u];return y.length>0?y.pop():new x(v)}Z.mallocBuffer=b,Z.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),p8=Ge({"node_modules/is-plain-obj/index.js"(Z,q){"use strict";var d=Object.prototype.toString;q.exports=function(x){var S;return d.call(x)==="[object Object]"&&(S=Object.getPrototypeOf(x),S===null||S===Object.getPrototypeOf({}))}}}),dT=Ge({"node_modules/parse-unit/index.js"(Z,q){q.exports=function(x,S){S||(S=[0,""]),x=String(x);var E=parseFloat(x,10);return S[0]=E,S[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",S}}}),m8=Ge({"node_modules/to-px/topx.js"(Z,q){"use strict";var d=dT();q.exports=e;var x=96;function S(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=S(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return S(r,"font-size");case"rem":return S(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),g8=Ge({"node_modules/detect-kerning/index.js"(Z,q){"use strict";q.exports=E;var d=E.canvas=document.createElement("canvas"),x=d.getContext("2d"),S=e([32,126]);E.createPairs=e,E.ascii=S;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=S),x.font=i+"px "+t;for(var s=0;si*n){var c=(p-f)/i;o[h]=c*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),_8=Ge({"node_modules/gl-text/dist.js"(Z,q){"use strict";var d=u8(),x=Ov(),S=c8(),E=f8(),e=nT(),t=Wd(),r=h8(),o=d8(),a=lm(),i=p8(),n=dT(),s=m8(),h=g8(),f=cf(),p=y8(),c=Zp(),T=vT(),l=T.nextPow2,_=new e,w=!1;document.body&&(A=document.body.appendChild(document.createElement("div")),A.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(A).fontStretch&&(w=!0),document.body.removeChild(A));var A,M=function(v){g(v)?(v={regl:v},this.gl=v.regl._gl):this.gl=E(v),this.shader=_.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=v.regl||S({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),_.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(v)?v:{})};M.prototype.createShader=function(){var v=this.regl,u=v({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:v.prop("count"),offset:v.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:v.this("sizeBuffer")},width:{offset:0,stride:8,buffer:v.this("sizeBuffer")},char:v.this("charBuffer"),position:v.this("position")},uniforms:{atlasSize:function(m,R){return[R.atlas.width,R.atlas.height]},atlasDim:function(m,R){return[R.atlas.cols,R.atlas.rows]},atlas:function(m,R){return R.atlas.texture},charStep:function(m,R){return R.atlas.step},em:function(m,R){return R.atlas.em},color:v.prop("color"),opacity:v.prop("opacity"),viewport:v.this("viewportArray"),scale:v.this("scale"),align:v.prop("align"),baseline:v.prop("baseline"),translate:v.this("translate"),positionOffset:v.prop("positionOffset")},primitive:"points",viewport:v.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -2691,17 +2691,17 @@ void main() { // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; - }`}),g={};return{regl:v,draw:u,atlas:g}},M.prototype.update=function(v){var u=this;if(typeof v=="string")v={text:v};else if(!v)return;v=x(v,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),v.opacity!=null&&(Array.isArray(v.opacity)?this.opacity=v.opacity.map(function(ce){return parseFloat(ce)}):this.opacity=parseFloat(v.opacity)),v.viewport!=null&&(this.viewport=a(v.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),v.kerning!=null&&(this.kerning=v.kerning),v.offset!=null&&(typeof v.offset=="number"&&(v.offset=[v.offset,0]),this.positionOffset=p(v.offset)),v.direction&&(this.direction=v.direction),v.range&&(this.range=v.range,this.scale=[1/(v.range[2]-v.range[0]),1/(v.range[3]-v.range[1])],this.translate=[-v.range[0],-v.range[1]]),v.scale&&(this.scale=v.scale),v.translate&&(this.translate=v.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!v.font&&(v.font=M.baseFontSize+"px sans-serif");var g=!1,f=!1;if(v.font&&(Array.isArray(v.font)?v.font:[v.font]).forEach(function(ce,ze){if(typeof ce=="string")try{ce=d.parse(ce)}catch{ce=d.parse(M.baseFontSize+"px "+ce)}else{var Qe=ce.style,nt=ce.weight,Ke=ce.stretch,kt=ce.variant;ce=d.parse(d.stringify(ce)),Qe&&(ce.style=Qe),nt&&(ce.weight=nt),Ke&&(ce.stretch=Ke),kt&&(ce.variant=kt)}var Et=d.stringify({size:M.baseFontSize,family:ce.family,stretch:w?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style}),Bt=n(ce.size),jt=Math.round(Bt[0]*s(Bt[1]));if(jt!==u.fontSize[ze]&&(f=!0,u.fontSize[ze]=jt),(!u.font[ze]||Et!=u.font[ze].baseString)&&(g=!0,u.font[ze]=M.fonts[Et],!u.font[ze])){var _r=ce.family.join(", "),pr=[ce.style];ce.style!=ce.variant&&pr.push(ce.variant),ce.variant!=ce.weight&&pr.push(ce.weight),w&&ce.weight!=ce.stretch&&pr.push(ce.stretch),u.font[ze]={baseString:Et,family:_r,weight:ce.weight,stretch:ce.stretch,style:ce.style,variant:ce.variant,width:{},kerning:{},metrics:m(_r,{origin:"top",fontSize:M.baseFontSize,fontStyle:pr.join(" ")})},M.fonts[Et]=u.font[ze]}}),(g||f)&&this.font.forEach(function(ce,ze){var Qe=d.stringify({size:u.fontSize[ze],family:ce.family,stretch:w?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style});if(u.fontAtlas[ze]=u.shader.atlas[Qe],!u.fontAtlas[ze]){var nt=ce.metrics;u.shader.atlas[Qe]=u.fontAtlas[ze]={fontString:Qe,step:Math.ceil(u.fontSize[ze]*nt.bottom*.5)*2,em:u.fontSize[ze],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}v.text==null&&(v.text=u.text)}),typeof v.text=="string"&&v.position&&v.position.length>2){for(var P=Array(v.position.length*.5),L=0;L2){for(var B=!v.position[0].length,O=o.mallocFloat(this.count*2),I=0,N=0;I1?u.align[ze]:u.align[0]:u.align;if(typeof Qe=="number")return Qe;switch(Qe){case"right":case"end":return-ce;case"center":case"centre":case"middle":return-ce*.5}return 0})),this.baseline==null&&v.baseline==null&&(v.baseline=0),v.baseline!=null&&(this.baseline=v.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ce,ze){var Qe=(u.font[ze]||u.font[0]).metrics,nt=0;return nt+=Qe.bottom*.5,typeof ce=="number"?nt+=ce-Qe.baseline:nt+=-Qe[ce],nt*=-1,nt})),v.color!=null)if(v.color||(v.color="transparent"),typeof v.color=="string"||!isNaN(v.color))this.color=t(v.color,"uint8");else{var Ie;if(typeof v.color[0]=="number"&&v.color.length>this.counts.length){var De=v.color.length;Ie=o.mallocUint8(De);for(var He=(v.color.subarray||v.color.slice).bind(v.color),et=0;et4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ot){var Ae=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Ae);for(var ge=0;ge1?this.counts[ge]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ge]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ge*4,ge*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ge]:this.opacity,baseline:this.baselineOffset[ge]!=null?this.baselineOffset[ge]:this.baselineOffset[0],align:this.align?this.alignOffset[ge]!=null?this.alignOffset[ge]:this.alignOffset[0]:0,atlas:this.fontAtlas[ge]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ge*2,ge*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function y(b){return typeof b=="function"&&b._gl&&b.prop&&b.texture&&b.buffer}V.exports=M}}),_8=We({"node_modules/@plotly/regl/dist/regl.unchecked.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?V.exports=x():d.createREGL=x()})(Z,function(){"use strict";var d=function(tt,qt){for(var sr=Object.keys(qt),ra=0;ra1&&qt===sr&&(qt==='"'||qt==="'"))return['"'+r(tt.substr(1,tt.length-2))+'"'];var ra=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(tt);if(ra)return o(tt.substr(0,ra.index)).concat(o(ra[1])).concat(o(tt.substr(ra.index+ra[0].length)));var da=tt.split(".");if(da.length===1)return['"'+r(tt)+'"'];for(var ca=[],ha=0;ha"u"?1:window.devicePixelRatio,$a=!1,ui={},Mn=function(Zr){},_n=function(){};if(typeof qt=="string"?sr=document.querySelector(qt):typeof qt=="object"&&(_(qt)?sr=qt:w(qt)?(ca=qt,da=ca.canvas):("gl"in qt?ca=qt.gl:"canvas"in qt?da=M(qt.canvas):"container"in qt&&(ra=M(qt.container)),"attributes"in qt&&(ha=qt.attributes),"extensions"in qt&&(Va=S(qt.extensions)),"optionalExtensions"in qt&&(dn=S(qt.optionalExtensions)),"onDone"in qt&&(Mn=qt.onDone),"profile"in qt&&($a=!!qt.profile),"pixelRatio"in qt&&(fn=+qt.pixelRatio),"cachedCode"in qt&&(ui=qt.cachedCode))),sr&&(sr.nodeName.toLowerCase()==="canvas"?da=sr:ra=sr),!ca){if(!da){var Ia=T(ra||document.body,Mn,fn);if(!Ia)return null;da=Ia.canvas,_n=Ia.onDestroy}ha.premultipliedAlpha===void 0&&(ha.premultipliedAlpha=!0),ca=l(da,ha)}return ca?{gl:ca,canvas:da,container:ra,extensions:Va,optionalExtensions:dn,pixelRatio:fn,profile:$a,cachedCode:ui,onDone:Mn,onDestroy:_n}:(_n(),Mn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(tt,qt){var sr={};function ra(ha){var Va=ha.toLowerCase(),dn;try{dn=sr[Va]=tt.getExtension(Va)}catch{}return!!dn}for(var da=0;da65535)<<4,tt>>>=qt,sr=(tt>255)<<3,tt>>>=sr,qt|=sr,sr=(tt>15)<<2,tt>>>=sr,qt|=sr,sr=(tt>3)<<1,tt>>>=sr,qt|=sr,qt|tt>>1}function I(){var tt=v(8,function(){return[]});function qt(ca){var ha=B(ca),Va=tt[O(ha)>>2];return Va.length>0?Va.pop():new ArrayBuffer(ha)}function sr(ca){tt[O(ca.byteLength)>>2].push(ca)}function ra(ca,ha){var Va=null;switch(ca){case u:Va=new Int8Array(qt(ha),0,ha);break;case g:Va=new Uint8Array(qt(ha),0,ha);break;case f:Va=new Int16Array(qt(2*ha),0,ha);break;case P:Va=new Uint16Array(qt(2*ha),0,ha);break;case L:Va=new Int32Array(qt(4*ha),0,ha);break;case z:Va=new Uint32Array(qt(4*ha),0,ha);break;case F:Va=new Float32Array(qt(4*ha),0,ha);break;default:return null}return Va.length!==ha?Va.subarray(0,ha):Va}function da(ca){sr(ca.buffer)}return{alloc:qt,free:sr,allocType:ra,freeType:da}}var N=I();N.zero=I();var U=3408,W=3410,Q=3411,le=3412,se=3413,he=3414,q=3415,$=33901,J=33902,X=3379,oe=3386,ne=34921,j=36347,ee=36348,re=35661,ue=35660,_e=34930,Te=36349,Ie=34076,De=34024,He=7936,et=7937,rt=7938,$e=35724,ot=34047,Ae=36063,ge=34852,ce=3553,ze=34067,Qe=34069,nt=33984,Ke=6408,kt=5126,Et=5121,Bt=36160,jt=36053,_r=36064,pr=16384,Or=function(tt,qt){var sr=1;qt.ext_texture_filter_anisotropic&&(sr=tt.getParameter(ot));var ra=1,da=1;qt.webgl_draw_buffers&&(ra=tt.getParameter(ge),da=tt.getParameter(Ae));var ca=!!qt.oes_texture_float;if(ca){var ha=tt.createTexture();tt.bindTexture(ce,ha),tt.texImage2D(ce,0,Ke,1,1,0,Ke,kt,null);var Va=tt.createFramebuffer();if(tt.bindFramebuffer(Bt,Va),tt.framebufferTexture2D(Bt,_r,ce,ha,0),tt.bindTexture(ce,null),tt.checkFramebufferStatus(Bt)!==jt)ca=!1;else{tt.viewport(0,0,1,1),tt.clearColor(1,0,0,1),tt.clear(pr);var dn=N.allocType(kt,4);tt.readPixels(0,0,1,1,Ke,kt,dn),tt.getError()?ca=!1:(tt.deleteFramebuffer(Va),tt.deleteTexture(ha),ca=dn[0]===1),N.freeType(dn)}}var fn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),$a=!0;if(!fn){var ui=tt.createTexture(),Mn=N.allocType(Et,36);tt.activeTexture(nt),tt.bindTexture(ze,ui),tt.texImage2D(Qe,0,Ke,3,3,0,Ke,Et,Mn),N.freeType(Mn),tt.bindTexture(ze,null),tt.deleteTexture(ui),$a=!tt.getError()}return{colorBits:[tt.getParameter(W),tt.getParameter(Q),tt.getParameter(le),tt.getParameter(se)],depthBits:tt.getParameter(he),stencilBits:tt.getParameter(q),subpixelBits:tt.getParameter(U),extensions:Object.keys(qt).filter(function(_n){return!!qt[_n]}),maxAnisotropic:sr,maxDrawbuffers:ra,maxColorAttachments:da,pointSizeDims:tt.getParameter($),lineWidthDims:tt.getParameter(J),maxViewportDims:tt.getParameter(oe),maxCombinedTextureUnits:tt.getParameter(re),maxCubeMapSize:tt.getParameter(Ie),maxRenderbufferSize:tt.getParameter(De),maxTextureUnits:tt.getParameter(_e),maxTextureSize:tt.getParameter(X),maxAttributes:tt.getParameter(ne),maxVertexUniforms:tt.getParameter(j),maxVertexTextureUnits:tt.getParameter(ue),maxVaryingVectors:tt.getParameter(ee),maxFragmentUniforms:tt.getParameter(Te),glsl:tt.getParameter($e),renderer:tt.getParameter(et),vendor:tt.getParameter(He),version:tt.getParameter(rt),readFloat:ca,npotTextureCube:$a}},mr=function(tt){return tt instanceof Uint8Array||tt instanceof Uint16Array||tt instanceof Uint32Array||tt instanceof Int8Array||tt instanceof Int16Array||tt instanceof Int32Array||tt instanceof Float32Array||tt instanceof Float64Array||tt instanceof Uint8ClampedArray};function Er(tt){return!!tt&&typeof tt=="object"&&Array.isArray(tt.shape)&&Array.isArray(tt.stride)&&typeof tt.offset=="number"&&tt.shape.length===tt.stride.length&&(Array.isArray(tt.data)||mr(tt.data))}var yt=function(tt){return Object.keys(tt).map(function(qt){return tt[qt]})},Oe={shape:Se,flatten:Ee};function Xe(tt,qt,sr){for(var ra=0;ra0){var ai;if(Array.isArray(_a[0])){bn=Ta(_a);for(var Ba=1,Ra=1;Ra0){if(typeof Ba[0]=="number"){var pn=N.allocType(Fa.dtype,Ba.length);Rr(pn,Ba),bn(pn,Un),N.freeType(pn)}else if(Array.isArray(Ba[0])||mr(Ba[0])){An=Ta(Ba);var vn=Na(Ba,An,Fa.dtype);bn(vn,Un),N.freeType(vn)}}}else if(Er(Ba)){An=Ba.shape;var On=Ba.stride,oi=0,bi=0,Tn=0,Zn=0;An.length===1?(oi=An[0],bi=1,Tn=On[0],Zn=0):An.length===2&&(oi=An[0],bi=An[1],Tn=On[0],Zn=On[1]);var gi=Array.isArray(Ba.data)?Fa.dtype:Xt(Ba.data),wi=N.allocType(gi,oi*bi);Yr(wi,Ba.data,oi,bi,Tn,Zn,Ba.offset),bn(wi,Un),N.freeType(wi)}return Cn}return Wa||Cn(Zr),Cn._reglType="buffer",Cn._buffer=Fa,Cn.subdata=ai,sr.profile&&(Cn.stats=Fa.stats),Cn.destroy=function(){Mn(Fa)},Cn}function Ia(){yt(ca).forEach(function(Zr){Zr.buffer=tt.createBuffer(),tt.bindBuffer(Zr.type,Zr.buffer),tt.bufferData(Zr.type,Zr.persistentData||Zr.byteLength,Zr.usage)})}return sr.profile&&(qt.getTotalBufferSize=function(){var Zr=0;return Object.keys(ca).forEach(function(_a){Zr+=ca[_a].stats.size}),Zr}),{create:_n,createStream:dn,destroyStream:fn,clear:function(){yt(ca).forEach(Mn),Va.forEach(Mn)},getBuffer:function(Zr){return Zr&&Zr._buffer instanceof ha?Zr._buffer:null},restore:Ia,_initBuffer:ui}}var ia=0,Pa=0,Ga=1,ja=1,Xa=4,sn=4,Ma={points:ia,point:Pa,lines:Ga,line:ja,triangles:Xa,triangle:sn,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Xn=0,Kn=1,St=4,lt=5120,br=5121,kr=5122,Lr=5123,Tr=5124,Cr=5125,Kr=34963,Nr=35040,_t=35044;function Wt(tt,qt,sr,ra){var da={},ca=0,ha={uint8:br,uint16:Lr};qt.oes_element_index_uint&&(ha.uint32=Cr);function Va(Ia){this.id=ca++,da[this.id]=this,this.buffer=Ia,this.primType=St,this.vertCount=0,this.type=0}Va.prototype.bind=function(){this.buffer.bind()};var dn=[];function fn(Ia){var Zr=dn.pop();return Zr||(Zr=new Va(sr.create(null,Kr,!0,!1)._buffer)),ui(Zr,Ia,Nr,-1,-1,0,0),Zr}function $a(Ia){dn.push(Ia)}function ui(Ia,Zr,_a,Wa,on,Fa,Cn){Ia.buffer.bind();var bn;if(Zr){var ai=Cn;!Cn&&(!mr(Zr)||Er(Zr)&&!mr(Zr.data))&&(ai=qt.oes_element_index_uint?Cr:Lr),sr._initBuffer(Ia.buffer,Zr,_a,ai,3)}else tt.bufferData(Kr,Fa,_a),Ia.buffer.dtype=bn||br,Ia.buffer.usage=_a,Ia.buffer.dimension=3,Ia.buffer.byteLength=Fa;if(bn=Cn,!Cn){switch(Ia.buffer.dtype){case br:case lt:bn=br;break;case Lr:case kr:bn=Lr;break;case Cr:case Tr:bn=Cr;break;default:}Ia.buffer.dtype=bn}Ia.type=bn;var Ba=on;Ba<0&&(Ba=Ia.buffer.byteLength,bn===Lr?Ba>>=1:bn===Cr&&(Ba>>=2)),Ia.vertCount=Ba;var Ra=Wa;if(Wa<0){Ra=St;var Un=Ia.buffer.dimension;Un===1&&(Ra=Xn),Un===2&&(Ra=Kn),Un===3&&(Ra=St)}Ia.primType=Ra}function Mn(Ia){ra.elementsCount--,delete da[Ia.id],Ia.buffer.destroy(),Ia.buffer=null}function _n(Ia,Zr){var _a=sr.create(null,Kr,!0),Wa=new Va(_a._buffer);ra.elementsCount++;function on(Fa){if(!Fa)_a(),Wa.primType=St,Wa.vertCount=0,Wa.type=br;else if(typeof Fa=="number")_a(Fa),Wa.primType=St,Wa.vertCount=Fa|0,Wa.type=br;else{var Cn=null,bn=_t,ai=-1,Ba=-1,Ra=0,Un=0;Array.isArray(Fa)||mr(Fa)||Er(Fa)?Cn=Fa:("data"in Fa&&(Cn=Fa.data),"usage"in Fa&&(bn=za[Fa.usage]),"primitive"in Fa&&(ai=Ma[Fa.primitive]),"count"in Fa&&(Ba=Fa.count|0),"type"in Fa&&(Un=ha[Fa.type]),"length"in Fa?Ra=Fa.length|0:(Ra=Ba,Un===Lr||Un===kr?Ra*=2:(Un===Cr||Un===Tr)&&(Ra*=4))),ui(Wa,Cn,bn,ai,Ba,Ra,Un)}return on}return on(Ia),on._reglType="elements",on._elements=Wa,on.subdata=function(Fa,Cn){return _a.subdata(Fa,Cn),on},on.destroy=function(){Mn(Wa)},on}return{create:_n,createStream:fn,destroyStream:$a,getElements:function(Ia){return typeof Ia=="function"&&Ia._elements instanceof Va?Ia._elements:null},clear:function(){yt(da).forEach(Mn)}}}var Ar=new Float32Array(1),Vr=new Uint32Array(Ar.buffer),ma=5123;function ba(tt){for(var qt=N.allocType(ma,tt.length),sr=0;sr>>31<<15,ca=(ra<<1>>>24)-127,ha=ra>>13&1023;if(ca<-24)qt[sr]=da;else if(ca<-14){var Va=-14-ca;qt[sr]=da+(ha+1024>>Va)}else ca>15?qt[sr]=da+31744:qt[sr]=da+(ca+15<<10)+ha}return qt}function wa(tt){return Array.isArray(tt)||mr(tt)}var $r=34467,ga=3553,jn=34067,an=34069,ei=6408,li=6406,_i=6407,xi=6409,Pi=6410,Li=32854,ri=32855,vo=36194,Eo=32819,uo=32820,ao=33635,mo=34042,Bo=6402,Go=34041,Ko=35904,Qi=35906,eo=36193,Ei=33776,Xi=33777,Jo=33778,ms=33779,_s=35986,ko=35987,Nn=34798,pi=35840,gs=35841,Io=35842,Zi=35843,ys=36196,rs=5121,fs=5123,el=5125,ci=5126,oo=10242,so=10243,js=10497,Es=33071,Ni=33648,Ns=10240,Ks=10241,jo=9728,hs=9729,ks=9984,xs=9985,ll=9986,ql=9987,wu=33170,Yl=4352,kc=4353,ec=4354,vs=34046,Ru=3317,Cc=37440,Ll=37441,nl=37443,Tu=37444,nu=33984,Rs=[ks,ll,xs,ql],Gs=[0,xi,Pi,_i,ei],Qo={};Qo[xi]=Qo[li]=Qo[Bo]=1,Qo[Go]=Qo[Pi]=2,Qo[_i]=Qo[Ko]=3,Qo[ei]=Qo[Qi]=4;function ws(tt){return"[object "+tt+"]"}var Au=ws("HTMLCanvasElement"),fl=ws("OffscreenCanvas"),lu=ws("CanvasRenderingContext2D"),Us=ws("ImageBitmap"),_f=ws("HTMLImageElement"),qo=ws("HTMLVideoElement"),xf=Object.keys(Le).concat([Au,fl,lu,Us,_f,qo]),is=[];is[rs]=1,is[ci]=4,is[eo]=2,is[fs]=2,is[el]=4;var Ui=[];Ui[Li]=2,Ui[ri]=2,Ui[vo]=2,Ui[Go]=4,Ui[Ei]=.5,Ui[Xi]=.5,Ui[Jo]=1,Ui[ms]=1,Ui[_s]=.5,Ui[ko]=1,Ui[Nn]=1,Ui[pi]=.5,Ui[gs]=.25,Ui[Io]=.5,Ui[Zi]=.25,Ui[ys]=.5;function ac(tt){return Array.isArray(tt)&&(tt.length===0||typeof tt[0]=="number")}function uu(tt){if(!Array.isArray(tt))return!1;var qt=tt.length;return!(qt===0||!wa(tt[0]))}function hl(tt){return Object.prototype.toString.call(tt)}function Lc(tt){return hl(tt)===Au}function ju(tt){return hl(tt)===fl}function dc(tt){return hl(tt)===lu}function Tl(tt){return hl(tt)===Us}function Kc(tt){return hl(tt)===_f}function Fc(tt){return hl(tt)===qo}function pc(tt){if(!tt)return!1;var qt=hl(tt);return xf.indexOf(qt)>=0?!0:ac(tt)||uu(tt)||Er(tt)}function tc(tt){return Le[Object.prototype.toString.call(tt)]|0}function Oc(tt,qt){var sr=qt.length;switch(tt.type){case rs:case fs:case el:case ci:var ra=N.allocType(tt.type,sr);ra.set(qt),tt.data=ra;break;case eo:tt.data=ba(qt);break;default:}}function Bc(tt,qt){return N.allocType(tt.type===eo?ci:tt.type,qt)}function cu(tt,qt){tt.type===eo?(tt.data=ba(qt),N.freeType(qt)):tt.data=qt}function Pc(tt,qt,sr,ra,da,ca){for(var ha=tt.width,Va=tt.height,dn=tt.channels,fn=ha*Va*dn,$a=Bc(tt,fn),ui=0,Mn=0;Mn=1;)Va+=ha*dn*dn,dn/=2;return Va}else return ha*sr*ra}function nc(tt,qt,sr,ra,da,ca,ha){var Va={"don't care":Yl,"dont care":Yl,nice:ec,fast:kc},dn={repeat:js,clamp:Es,mirror:Ni},fn={nearest:jo,linear:hs},$a=d({mipmap:ql,"nearest mipmap nearest":ks,"linear mipmap nearest":xs,"nearest mipmap linear":ll,"linear mipmap linear":ql},fn),ui={none:0,browser:Tu},Mn={uint8:rs,rgba4:Eo,rgb565:ao,"rgb5 a1":uo},_n={alpha:li,luminance:xi,"luminance alpha":Pi,rgb:_i,rgba:ei,rgba4:Li,"rgb5 a1":ri,rgb565:vo},Ia={};qt.ext_srgb&&(_n.srgb=Ko,_n.srgba=Qi),qt.oes_texture_float&&(Mn.float32=Mn.float=ci),qt.oes_texture_half_float&&(Mn.float16=Mn["half float"]=eo),qt.webgl_depth_texture&&(d(_n,{depth:Bo,"depth stencil":Go}),d(Mn,{uint16:fs,uint32:el,"depth stencil":mo})),qt.webgl_compressed_texture_s3tc&&d(Ia,{"rgb s3tc dxt1":Ei,"rgba s3tc dxt1":Xi,"rgba s3tc dxt3":Jo,"rgba s3tc dxt5":ms}),qt.webgl_compressed_texture_atc&&d(Ia,{"rgb atc":_s,"rgba atc explicit alpha":ko,"rgba atc interpolated alpha":Nn}),qt.webgl_compressed_texture_pvrtc&&d(Ia,{"rgb pvrtc 4bppv1":pi,"rgb pvrtc 2bppv1":gs,"rgba pvrtc 4bppv1":Io,"rgba pvrtc 2bppv1":Zi}),qt.webgl_compressed_texture_etc1&&(Ia["rgb etc1"]=ys);var Zr=Array.prototype.slice.call(tt.getParameter($r));Object.keys(Ia).forEach(function(ke){var Ye=Ia[ke];Zr.indexOf(Ye)>=0&&(_n[ke]=Ye)});var _a=Object.keys(_n);sr.textureFormats=_a;var Wa=[];Object.keys(_n).forEach(function(ke){var Ye=_n[ke];Wa[Ye]=ke});var on=[];Object.keys(Mn).forEach(function(ke){var Ye=Mn[ke];on[Ye]=ke});var Fa=[];Object.keys(fn).forEach(function(ke){var Ye=fn[ke];Fa[Ye]=ke});var Cn=[];Object.keys($a).forEach(function(ke){var Ye=$a[ke];Cn[Ye]=ke});var bn=[];Object.keys(dn).forEach(function(ke){var Ye=dn[ke];bn[Ye]=ke});var ai=_a.reduce(function(ke,Ye){var vt=_n[Ye];return vt===xi||vt===li||vt===xi||vt===Pi||vt===Bo||vt===Go||qt.ext_srgb&&(vt===Ko||vt===Qi)?ke[vt]=vt:vt===ri||Ye.indexOf("rgba")>=0?ke[vt]=ei:ke[vt]=_i,ke},{});function Ba(){this.internalformat=ei,this.format=ei,this.type=rs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Tu,this.width=0,this.height=0,this.channels=0}function Ra(ke,Ye){ke.internalformat=Ye.internalformat,ke.format=Ye.format,ke.type=Ye.type,ke.compressed=Ye.compressed,ke.premultiplyAlpha=Ye.premultiplyAlpha,ke.flipY=Ye.flipY,ke.unpackAlignment=Ye.unpackAlignment,ke.colorSpace=Ye.colorSpace,ke.width=Ye.width,ke.height=Ye.height,ke.channels=Ye.channels}function Un(ke,Ye){if(!(typeof Ye!="object"||!Ye)){if("premultiplyAlpha"in Ye&&(ke.premultiplyAlpha=Ye.premultiplyAlpha),"flipY"in Ye&&(ke.flipY=Ye.flipY),"alignment"in Ye&&(ke.unpackAlignment=Ye.alignment),"colorSpace"in Ye&&(ke.colorSpace=ui[Ye.colorSpace]),"type"in Ye){var vt=Ye.type;ke.type=Mn[vt]}var Ot=ke.width,dr=ke.height,Dr=ke.channels,ur=!1;"shape"in Ye?(Ot=Ye.shape[0],dr=Ye.shape[1],Ye.shape.length===3&&(Dr=Ye.shape[2],ur=!0)):("radius"in Ye&&(Ot=dr=Ye.radius),"width"in Ye&&(Ot=Ye.width),"height"in Ye&&(dr=Ye.height),"channels"in Ye&&(Dr=Ye.channels,ur=!0)),ke.width=Ot|0,ke.height=dr|0,ke.channels=Dr|0;var pt=!1;if("format"in Ye){var At=Ye.format,Dt=ke.internalformat=_n[At];ke.format=ai[Dt],At in Mn&&("type"in Ye||(ke.type=Mn[At])),At in Ia&&(ke.compressed=!0),pt=!0}!ur&&pt?ke.channels=Qo[ke.format]:ur&&!pt&&ke.channels!==Gs[ke.format]&&(ke.format=ke.internalformat=Gs[ke.channels])}}function An(ke){tt.pixelStorei(Cc,ke.flipY),tt.pixelStorei(Ll,ke.premultiplyAlpha),tt.pixelStorei(nl,ke.colorSpace),tt.pixelStorei(Ru,ke.unpackAlignment)}function pn(){Ba.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function vn(ke,Ye){var vt=null;if(pc(Ye)?vt=Ye:Ye&&(Un(ke,Ye),"x"in Ye&&(ke.xOffset=Ye.x|0),"y"in Ye&&(ke.yOffset=Ye.y|0),pc(Ye.data)&&(vt=Ye.data)),Ye.copy){var Ot=da.viewportWidth,dr=da.viewportHeight;ke.width=ke.width||Ot-ke.xOffset,ke.height=ke.height||dr-ke.yOffset,ke.needsCopy=!0}else if(!vt)ke.width=ke.width||1,ke.height=ke.height||1,ke.channels=ke.channels||4;else if(mr(vt))ke.channels=ke.channels||4,ke.data=vt,!("type"in Ye)&&ke.type===rs&&(ke.type=tc(vt));else if(ac(vt))ke.channels=ke.channels||4,Oc(ke,vt),ke.alignment=1,ke.needsFree=!0;else if(Er(vt)){var Dr=vt.data;!Array.isArray(Dr)&&ke.type===rs&&(ke.type=tc(Dr));var ur=vt.shape,pt=vt.stride,At,Dt,er,lr,ar,cr;ur.length===3?(er=ur[2],cr=pt[2]):(er=1,cr=1),At=ur[0],Dt=ur[1],lr=pt[0],ar=pt[1],ke.alignment=1,ke.width=At,ke.height=Dt,ke.channels=er,ke.format=ke.internalformat=Gs[er],ke.needsFree=!0,Pc(ke,Dr,lr,ar,cr,vt.offset)}else if(Lc(vt)||ju(vt)||dc(vt))Lc(vt)||ju(vt)?ke.element=vt:ke.element=vt.canvas,ke.width=ke.element.width,ke.height=ke.element.height,ke.channels=4;else if(Tl(vt))ke.element=vt,ke.width=vt.width,ke.height=vt.height,ke.channels=4;else if(Kc(vt))ke.element=vt,ke.width=vt.naturalWidth,ke.height=vt.naturalHeight,ke.channels=4;else if(Fc(vt))ke.element=vt,ke.width=vt.videoWidth,ke.height=vt.videoHeight,ke.channels=4;else if(uu(vt)){var nr=ke.width||vt[0].length,Vt=ke.height||vt.length,rr=ke.channels;wa(vt[0][0])?rr=rr||vt[0][0].length:rr=rr||1;for(var Nt=Oe.shape(vt),Pr=1,Hr=0;Hr>=dr,vt.height>>=dr,vn(vt,Ot[dr]),ke.mipmask|=1<=0&&!("faces"in Ye)&&(ke.genMipmaps=!0)}if("mag"in Ye){var Ot=Ye.mag;ke.magFilter=fn[Ot]}var dr=ke.wrapS,Dr=ke.wrapT;if("wrap"in Ye){var ur=Ye.wrap;typeof ur=="string"?dr=Dr=dn[ur]:Array.isArray(ur)&&(dr=dn[ur[0]],Dr=dn[ur[1]])}else{if("wrapS"in Ye){var pt=Ye.wrapS;dr=dn[pt]}if("wrapT"in Ye){var At=Ye.wrapT;Dr=dn[At]}}if(ke.wrapS=dr,ke.wrapT=Dr,"anisotropic"in Ye){var Dt=Ye.anisotropic;ke.anisotropic=Ye.anisotropic}if("mipmap"in Ye){var er=!1;switch(typeof Ye.mipmap){case"string":ke.mipmapHint=Va[Ye.mipmap],ke.genMipmaps=!0,er=!0;break;case"boolean":er=ke.genMipmaps=Ye.mipmap;break;case"object":ke.genMipmaps=!1,er=!0;break;default:}er&&!("min"in Ye)&&(ke.minFilter=ks)}}function rl(ke,Ye){tt.texParameteri(Ye,Ks,ke.minFilter),tt.texParameteri(Ye,Ns,ke.magFilter),tt.texParameteri(Ye,oo,ke.wrapS),tt.texParameteri(Ye,so,ke.wrapT),qt.ext_texture_filter_anisotropic&&tt.texParameteri(Ye,vs,ke.anisotropic),ke.genMipmaps&&(tt.hint(wu,ke.mipmapHint),tt.generateMipmap(Ye))}var Ml=0,ps={},qs=sr.maxTextureUnits,Ys=Array(qs).map(function(){return null});function Ri(ke){Ba.call(this),this.mipmask=0,this.internalformat=ei,this.id=Ml++,this.refCount=1,this.target=ke,this.texture=tt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Xo,ha.profile&&(this.stats={size:0})}function al(ke){tt.activeTexture(nu),tt.bindTexture(ke.target,ke.texture)}function go(){var ke=Ys[0];ke?tt.bindTexture(ke.target,ke.texture):tt.bindTexture(ga,null)}function de(ke){var Ye=ke.texture,vt=ke.unit,Ot=ke.target;vt>=0&&(tt.activeTexture(nu+vt),tt.bindTexture(Ot,null),Ys[vt]=null),tt.deleteTexture(Ye),ke.texture=null,ke.params=null,ke.pixels=null,ke.refCount=0,delete ps[ke.id],ca.textureCount--}d(Ri.prototype,{bind:function(){var ke=this;ke.bindCount+=1;var Ye=ke.unit;if(Ye<0){for(var vt=0;vt0)continue;Ot.unit=-1}Ys[vt]=ke,Ye=vt;break}Ye>=qs,ha.profile&&ca.maxTextureUnits>ar)-er,cr.height=cr.height||(vt.height>>ar)-lr,al(vt),oi(cr,ga,er,lr,ar),go(),Zn(cr),Ot}function Dr(ur,pt){var At=ur|0,Dt=pt|0||At;if(At===vt.width&&Dt===vt.height)return Ot;Ot.width=vt.width=At,Ot.height=vt.height=Dt,al(vt);for(var er=0;vt.mipmask>>er;++er){var lr=At>>er,ar=Dt>>er;if(!lr||!ar)break;tt.texImage2D(ga,er,vt.format,lr,ar,0,vt.format,vt.type,null)}return go(),ha.profile&&(vt.stats.size=Su(vt.internalformat,vt.type,At,Dt,!1,!1)),Ot}return Ot(ke,Ye),Ot.subimage=dr,Ot.resize=Dr,Ot._reglType="texture2d",Ot._texture=vt,ha.profile&&(Ot.stats=vt.stats),Ot.destroy=function(){vt.decRef()},Ot}function me(ke,Ye,vt,Ot,dr,Dr){var ur=new Ri(jn);ps[ur.id]=ur,ca.cubeCount++;var pt=new Array(6);function At(lr,ar,cr,nr,Vt,rr){var Nt,Pr=ur.texInfo;for(Xo.call(Pr),Nt=0;Nt<6;++Nt)pt[Nt]=Ji();if(typeof lr=="number"||!lr){var Hr=lr|0||1;for(Nt=0;Nt<6;++Nt)wi(pt[Nt],Hr,Hr)}else if(typeof lr=="object")if(ar)Ii(pt[0],lr),Ii(pt[1],ar),Ii(pt[2],cr),Ii(pt[3],nr),Ii(pt[4],Vt),Ii(pt[5],rr);else if(Qs(Pr,lr),Un(ur,lr),"faces"in lr){var fa=lr.faces;for(Nt=0;Nt<6;++Nt)Ra(pt[Nt],ur),Ii(pt[Nt],fa[Nt])}else for(Nt=0;Nt<6;++Nt)Ii(pt[Nt],lr);for(Ra(ur,pt[0]),Pr.genMipmaps?ur.mipmask=(pt[0].width<<1)-1:ur.mipmask=pt[0].mipmask,ur.internalformat=pt[0].internalformat,At.width=pt[0].width,At.height=pt[0].height,al(ur),Nt=0;Nt<6;++Nt)cs(pt[Nt],an+Nt);for(rl(Pr,jn),go(),ha.profile&&(ur.stats.size=Su(ur.internalformat,ur.type,At.width,At.height,Pr.genMipmaps,!0)),At.format=Wa[ur.internalformat],At.type=on[ur.type],At.mag=Fa[Pr.magFilter],At.min=Cn[Pr.minFilter],At.wrapS=bn[Pr.wrapS],At.wrapT=bn[Pr.wrapT],Nt=0;Nt<6;++Nt)yl(pt[Nt]);return At}function Dt(lr,ar,cr,nr,Vt){var rr=cr|0,Nt=nr|0,Pr=Vt|0,Hr=Tn();return Ra(Hr,ur),Hr.width=0,Hr.height=0,vn(Hr,ar),Hr.width=Hr.width||(ur.width>>Pr)-rr,Hr.height=Hr.height||(ur.height>>Pr)-Nt,al(ur),oi(Hr,an+lr,rr,Nt,Pr),go(),Zn(Hr),At}function er(lr){var ar=lr|0;if(ar!==ur.width){At.width=ur.width=ar,At.height=ur.height=ar,al(ur);for(var cr=0;cr<6;++cr)for(var nr=0;ur.mipmask>>nr;++nr)tt.texImage2D(an+cr,nr,ur.format,ar>>nr,ar>>nr,0,ur.format,ur.type,null);return go(),ha.profile&&(ur.stats.size=Su(ur.internalformat,ur.type,At.width,At.height,!1,!0)),At}}return At(ke,Ye,vt,Ot,dr,Dr),At.subimage=Dt,At.resize=er,At._reglType="textureCube",At._texture=ur,ha.profile&&(At.stats=ur.stats),At.destroy=function(){ur.decRef()},At}function te(){for(var ke=0;ke>Ot,vt.height>>Ot,0,vt.internalformat,vt.type,null);else for(var dr=0;dr<6;++dr)tt.texImage2D(an+dr,Ot,vt.internalformat,vt.width>>Ot,vt.height>>Ot,0,vt.internalformat,vt.type,null);rl(vt.texInfo,vt.target)})}function Ve(){for(var ke=0;ke=0?yl=!0:dn.indexOf(Xo)>=0&&(yl=!1))),("depthTexture"in Ri||"depthStencilTexture"in Ri)&&(Ys=!!(Ri.depthTexture||Ri.depthStencilTexture)),"depth"in Ri&&(typeof Ri.depth=="boolean"?cs=Ri.depth:(Ml=Ri.depth,Zs=!1)),"stencil"in Ri&&(typeof Ri.stencil=="boolean"?Zs=Ri.stencil:(ps=Ri.stencil,cs=!1)),"depthStencil"in Ri&&(typeof Ri.depthStencil=="boolean"?cs=Zs=Ri.depthStencil:(qs=Ri.depthStencil,cs=!1,Zs=!1))}var go=null,de=null,Y=null,me=null;if(Array.isArray(Ji))go=Ji.map(Ia);else if(Ji)go=[Ia(Ji)];else for(go=new Array(rl),gi=0;gi0&&(Zn.depth=vn[0].depth,Zn.stencil=vn[0].stencil,Zn.depthStencil=vn[0].depthStencil),vn[Tn]?vn[Tn](Zn):vn[Tn]=Ra(Zn)}return d(On,{width:gi,height:gi,color:Xo})}function oi(bi){var Tn,Zn=bi|0;if(Zn===On.width)return On;var gi=On.color;for(Tn=0;Tn=gi.byteLength?wi.subdata(gi):(wi.destroy(),Ra.buffers[bi]=null)),Ra.buffers[bi]||(wi=Ra.buffers[bi]=da.create(Tn,Tc,!1,!0)),Zn.buffer=da.getBuffer(wi),Zn.size=Zn.buffer.dimension|0,Zn.normalized=!1,Zn.type=Zn.buffer.dtype,Zn.offset=0,Zn.stride=0,Zn.divisor=0,Zn.state=1,On[bi]=1}else da.getBuffer(Tn)?(Zn.buffer=da.getBuffer(Tn),Zn.size=Zn.buffer.dimension|0,Zn.normalized=!1,Zn.type=Zn.buffer.dtype,Zn.offset=0,Zn.stride=0,Zn.divisor=0,Zn.state=1):da.getBuffer(Tn.buffer)?(Zn.buffer=da.getBuffer(Tn.buffer),Zn.size=(+Tn.size||Zn.buffer.dimension)|0,Zn.normalized=!!Tn.normalized||!1,"type"in Tn?Zn.type=oa[Tn.type]:Zn.type=Zn.buffer.dtype,Zn.offset=(Tn.offset||0)|0,Zn.stride=(Tn.stride||0)|0,Zn.divisor=(Tn.divisor||0)|0,Zn.state=1):"x"in Tn&&(Zn.x=+Tn.x||0,Zn.y=+Tn.y||0,Zn.z=+Tn.z||0,Zn.w=+Tn.w||0,Zn.state=2)}for(var Ii=0;Ii1)for(var An=0;AnZr&&(Zr=_a.stats.uniformsCount)}),Zr},sr.getMaxAttributesCount=function(){var Zr=0;return $a.forEach(function(_a){_a.stats.attributesCount>Zr&&(Zr=_a.stats.attributesCount)}),Zr});function Ia(){da={},ca={};for(var Zr=0;Zr<$a.length;++Zr)_n($a[Zr],null,$a[Zr].attributes.map(function(_a){return[_a.location,_a.name]}))}return{clear:function(){var Zr=tt.deleteShader.bind(tt);yt(da).forEach(Zr),da={},yt(ca).forEach(Zr),ca={},$a.forEach(function(_a){tt.deleteProgram(_a.program)}),$a.length=0,fn={},sr.shaderCount=0},program:function(Zr,_a,Wa,on){var Fa=fn[_a];Fa||(Fa=fn[_a]={});var Cn=Fa[Zr];if(Cn&&(Cn.refCount++,!on))return Cn;var bn=new Mn(_a,Zr);return sr.shaderCount++,_n(bn,Wa,on),Cn||(Fa[Zr]=bn),$a.push(bn),d(bn,{destroy:function(){if(bn.refCount--,bn.refCount<=0){tt.deleteProgram(bn.program);var ai=$a.indexOf(bn);$a.splice(ai,1),sr.shaderCount--}Fa[bn.vertId].refCount<=0&&(tt.deleteShader(ca[bn.vertId]),delete ca[bn.vertId],delete fn[bn.fragId][bn.vertId]),Object.keys(fn[bn.fragId]).length||(tt.deleteShader(da[bn.fragId]),delete da[bn.fragId],delete fn[bn.fragId])}})},restore:Ia,shader:dn,frag:-1,vert:-1}}var Ac=6408,hu=5121,sc=3333,Dc=5126;function Cl(tt,qt,sr,ra,da,ca,ha){function Va($a){var ui;qt.next===null?ui=hu:ui=qt.next.colorAttachments[0].texture._texture.type;var Mn=0,_n=0,Ia=ra.framebufferWidth,Zr=ra.framebufferHeight,_a=null;mr($a)?_a=$a:$a&&(Mn=$a.x|0,_n=$a.y|0,Ia=($a.width||ra.framebufferWidth-Mn)|0,Zr=($a.height||ra.framebufferHeight-_n)|0,_a=$a.data||null),sr();var Wa=Ia*Zr*4;return _a||(ui===hu?_a=new Uint8Array(Wa):ui===Dc&&(_a=_a||new Float32Array(Wa))),tt.pixelStorei(sc,4),tt.readPixels(Mn,_n,Ia,Zr,Ac,ui,_a),_a}function dn($a){var ui;return qt.setFBO({framebuffer:$a.framebuffer},function(){ui=Va($a)}),ui}function fn($a){return!$a||!("framebuffer"in $a)?Va($a):dn($a)}return fn}var Vc=0,vu="";function Wu(tt){return jl(Fu(Mu(tt)))}function Fu(tt){return Yt(wn(Zu(tt),tt.length*8))}function vl(tt,qt){var sr=Zu(tt);sr.length>16&&(sr=wn(sr,tt.length*8));for(var ra=Array(16),da=Array(16),ca=0;ca<16;ca++)ra[ca]=sr[ca]^909522486,da[ca]=sr[ca]^1549556828;var ha=wn(ra.concat(Zu(qt)),512+qt.length*8);return Yt(wn(da.concat(ha),768))}function jl(tt){for(var qt=Vc?"0123456789ABCDEF":"0123456789abcdef",sr="",ra,da=0;da>>4&15)+qt.charAt(ra&15);return sr}function Xu(tt){for(var qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sr="",ra=tt.length,da=0;datt.length*8?sr+=vu:sr+=qt.charAt(ca>>>6*(3-ha)&63);return sr}function lc(tt,qt){var sr=qt.length,ra=Array(),da,ca,ha,Va,dn=Array(Math.ceil(tt.length/2));for(da=0;da0;){for(Va=Array(),ha=0,da=0;da0||ca>0)&&(Va[Va.length]=ca);ra[ra.length]=ha,dn=Va}var fn="";for(da=ra.length-1;da>=0;da--)fn+=qt.charAt(ra[da]);var $a=Math.ceil(tt.length*8/(Math.log(qt.length)/Math.log(2)));for(da=fn.length;da<$a;da++)fn=qt[0]+fn;return fn}function Mu(tt){for(var qt="",sr=-1,ra,da;++sr>>6&31,128|ra&63):ra<=65535?qt+=String.fromCharCode(224|ra>>>12&15,128|ra>>>6&63,128|ra&63):ra<=2097151&&(qt+=String.fromCharCode(240|ra>>>18&7,128|ra>>>12&63,128|ra>>>6&63,128|ra&63));return qt}function Zu(tt){for(var qt=Array(tt.length>>2),sr=0;sr>5]|=(tt.charCodeAt(sr/8)&255)<<24-sr%32;return qt}function Yt(tt){for(var qt="",sr=0;sr>5]>>>24-sr%32&255);return qt}function vr(tt,qt){return tt>>>qt|tt<<32-qt}function Qr(tt,qt){return tt>>>qt}function Wr(tt,qt,sr){return tt&qt^~tt&sr}function xa(tt,qt,sr){return tt&qt^tt&sr^qt&sr}function Qa(tt){return vr(tt,2)^vr(tt,13)^vr(tt,22)}function xn(tt){return vr(tt,6)^vr(tt,11)^vr(tt,25)}function zn(tt){return vr(tt,7)^vr(tt,18)^Qr(tt,3)}function Gn(tt){return vr(tt,17)^vr(tt,19)^Qr(tt,10)}var ni=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function wn(tt,qt){var sr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ra=new Array(64),da,ca,ha,Va,dn,fn,$a,ui,Mn,_n,Ia,Zr;for(tt[qt>>5]|=128<<24-qt%32,tt[(qt+64>>9<<4)+15]=qt,Mn=0;Mn>16)+(qt>>16)+(sr>>16);return ra<<16|sr&65535}function Ln(tt){return Array.prototype.slice.call(tt)}function un(tt){return Ln(tt).join("")}function mi(tt){var qt=tt&&tt.cache,sr=0,ra=[],da=[],ca=[];function ha(Ia,Zr){var _a=Zr&&Zr.stable;if(!_a){for(var Wa=0;Wa0&&(Ia.push(on,"="),Ia.push.apply(Ia,Ln(arguments)),Ia.push(";")),on}return d(Zr,{def:Wa,toString:function(){return un([_a.length>0?"var "+_a.join(",")+";":"",un(Ia)])}})}function dn(){var Ia=Va(),Zr=Va(),_a=Ia.toString,Wa=Zr.toString;function on(Fa,Cn){Zr(Fa,Cn,"=",Ia.def(Fa,Cn),";")}return d(function(){Ia.apply(Ia,Ln(arguments))},{def:Ia.def,entry:Ia,exit:Zr,save:on,set:function(Fa,Cn,bn){on(Fa,Cn),Ia(Fa,Cn,"=",bn,";")},toString:function(){return _a()+Wa()}})}function fn(){var Ia=un(arguments),Zr=dn(),_a=dn(),Wa=Zr.toString,on=_a.toString;return d(Zr,{then:function(){return Zr.apply(Zr,Ln(arguments)),this},else:function(){return _a.apply(_a,Ln(arguments)),this},toString:function(){var Fa=on();return Fa&&(Fa="else{"+Fa+"}"),un(["if(",Ia,"){",Wa(),"}",Fa])}})}var $a=Va(),ui={};function Mn(Ia,Zr){var _a=[];function Wa(){var ai="a"+_a.length;return _a.push(ai),ai}Zr=Zr||0;for(var on=0;on2){for(var R=Array(v.position.length*.5),L=0;L2){for(var N=!v.position[0].length,O=o.mallocFloat(this.count*2),P=0,U=0;P1?u.align[Ee]:u.align[0]:u.align;if(typeof We=="number")return We;switch(We){case"right":case"end":return-ie;case"center":case"centre":case"middle":return-ie*.5}return 0})),this.baseline==null&&v.baseline==null&&(v.baseline=0),v.baseline!=null&&(this.baseline=v.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ie,Ee){var We=(u.font[Ee]||u.font[0]).metrics,Qe=0;return Qe+=We.bottom*.5,typeof ie=="number"?Qe+=ie-We.baseline:Qe+=-We[ie],Qe*=-1,Qe})),v.color!=null)if(v.color||(v.color="transparent"),typeof v.color=="string"||!isNaN(v.color))this.color=t(v.color,"uint8");else{var Le;if(typeof v.color[0]=="number"&&v.color.length>this.counts.length){var Pe=v.color.length;Le=o.mallocUint8(Pe);for(var qe=(v.color.subarray||v.color.slice).bind(v.color),et=0;et4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Ue){var fe=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(fe);for(var ue=0;ue1?this.counts[ue]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ue]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ue*4,ue*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ue]:this.opacity,baseline:this.baselineOffset[ue]!=null?this.baselineOffset[ue]:this.baselineOffset[0],align:this.align?this.alignOffset[ue]!=null?this.alignOffset[ue]:this.alignOffset[0]:0,atlas:this.fontAtlas[ue]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ue*2,ue*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function g(b){return typeof b=="function"&&b._gl&&b.prop&&b.texture&&b.buffer}q.exports=M}}),x8=Ge({"node_modules/@plotly/regl/dist/regl.unchecked.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?q.exports=x():d.createREGL=x()})(Z,function(){"use strict";var d=function(tt,Gt){for(var or=Object.keys(Gt),ea=0;ea1&&Gt===or&&(Gt==='"'||Gt==="'"))return['"'+r(tt.substr(1,tt.length-2))+'"'];var ea=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(tt);if(ea)return o(tt.substr(0,ea.index)).concat(o(ea[1])).concat(o(tt.substr(ea.index+ea[0].length)));var pa=tt.split(".");if(pa.length===1)return['"'+r(tt)+'"'];for(var la=[],fa=0;fa"u"?1:window.devicePixelRatio,Ja=!1,si={},Mn=function(Zr){},yn=function(){};if(typeof Gt=="string"?or=document.querySelector(Gt):typeof Gt=="object"&&(_(Gt)?or=Gt:w(Gt)?(la=Gt,pa=la.canvas):("gl"in Gt?la=Gt.gl:"canvas"in Gt?pa=M(Gt.canvas):"container"in Gt&&(ea=M(Gt.container)),"attributes"in Gt&&(fa=Gt.attributes),"extensions"in Gt&&(ja=A(Gt.extensions)),"optionalExtensions"in Gt&&(hn=A(Gt.optionalExtensions)),"onDone"in Gt&&(Mn=Gt.onDone),"profile"in Gt&&(Ja=!!Gt.profile),"pixelRatio"in Gt&&(un=+Gt.pixelRatio),"cachedCode"in Gt&&(si=Gt.cachedCode))),or&&(or.nodeName.toLowerCase()==="canvas"?pa=or:ea=or),!la){if(!pa){var Pa=T(ea||document.body,Mn,un);if(!Pa)return null;pa=Pa.canvas,yn=Pa.onDestroy}fa.premultipliedAlpha===void 0&&(fa.premultipliedAlpha=!0),la=l(pa,fa)}return la?{gl:la,canvas:pa,container:ea,extensions:ja,optionalExtensions:hn,pixelRatio:un,profile:Ja,cachedCode:si,onDone:Mn,onDestroy:yn}:(yn(),Mn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(tt,Gt){var or={};function ea(fa){var ja=fa.toLowerCase(),hn;try{hn=or[ja]=tt.getExtension(ja)}catch{}return!!hn}for(var pa=0;pa65535)<<4,tt>>>=Gt,or=(tt>255)<<3,tt>>>=or,Gt|=or,or=(tt>15)<<2,tt>>>=or,Gt|=or,or=(tt>3)<<1,tt>>>=or,Gt|=or,Gt|tt>>1}function P(){var tt=v(8,function(){return[]});function Gt(la){var fa=N(la),ja=tt[O(fa)>>2];return ja.length>0?ja.pop():new ArrayBuffer(fa)}function or(la){tt[O(la.byteLength)>>2].push(la)}function ea(la,fa){var ja=null;switch(la){case u:ja=new Int8Array(Gt(fa),0,fa);break;case y:ja=new Uint8Array(Gt(fa),0,fa);break;case m:ja=new Int16Array(Gt(2*fa),0,fa);break;case R:ja=new Uint16Array(Gt(2*fa),0,fa);break;case L:ja=new Int32Array(Gt(4*fa),0,fa);break;case z:ja=new Uint32Array(Gt(4*fa),0,fa);break;case F:ja=new Float32Array(Gt(4*fa),0,fa);break;default:return null}return ja.length!==fa?ja.subarray(0,fa):ja}function pa(la){or(la.buffer)}return{alloc:Gt,free:or,allocType:ea,freeType:pa}}var U=P();U.zero=P();var B=3408,X=3410,$=3411,le=3412,ce=3413,ve=3414,G=3415,Y=33901,ee=33902,V=3379,se=3386,ae=34921,j=36347,Q=36348,re=35661,he=35660,xe=34930,Te=36349,Le=34076,Pe=34024,qe=7936,et=7937,rt=7938,$e=35724,Ue=34047,fe=36063,ue=34852,ie=3553,Ee=34067,We=34069,Qe=33984,Xe=6408,Tt=5126,St=5121,zt=36160,Ut=36053,br=36064,hr=16384,Or=function(tt,Gt){var or=1;Gt.ext_texture_filter_anisotropic&&(or=tt.getParameter(Ue));var ea=1,pa=1;Gt.webgl_draw_buffers&&(ea=tt.getParameter(ue),pa=tt.getParameter(fe));var la=!!Gt.oes_texture_float;if(la){var fa=tt.createTexture();tt.bindTexture(ie,fa),tt.texImage2D(ie,0,Xe,1,1,0,Xe,Tt,null);var ja=tt.createFramebuffer();if(tt.bindFramebuffer(zt,ja),tt.framebufferTexture2D(zt,br,ie,fa,0),tt.bindTexture(ie,null),tt.checkFramebufferStatus(zt)!==Ut)la=!1;else{tt.viewport(0,0,1,1),tt.clearColor(1,0,0,1),tt.clear(hr);var hn=U.allocType(Tt,4);tt.readPixels(0,0,1,1,Xe,Tt,hn),tt.getError()?la=!1:(tt.deleteFramebuffer(ja),tt.deleteTexture(fa),la=hn[0]===1),U.freeType(hn)}}var un=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ja=!0;if(!un){var si=tt.createTexture(),Mn=U.allocType(St,36);tt.activeTexture(Qe),tt.bindTexture(Ee,si),tt.texImage2D(We,0,Xe,3,3,0,Xe,St,Mn),U.freeType(Mn),tt.bindTexture(Ee,null),tt.deleteTexture(si),Ja=!tt.getError()}return{colorBits:[tt.getParameter(X),tt.getParameter($),tt.getParameter(le),tt.getParameter(ce)],depthBits:tt.getParameter(ve),stencilBits:tt.getParameter(G),subpixelBits:tt.getParameter(B),extensions:Object.keys(Gt).filter(function(yn){return!!Gt[yn]}),maxAnisotropic:or,maxDrawbuffers:ea,maxColorAttachments:pa,pointSizeDims:tt.getParameter(Y),lineWidthDims:tt.getParameter(ee),maxViewportDims:tt.getParameter(se),maxCombinedTextureUnits:tt.getParameter(re),maxCubeMapSize:tt.getParameter(Le),maxRenderbufferSize:tt.getParameter(Pe),maxTextureUnits:tt.getParameter(xe),maxTextureSize:tt.getParameter(V),maxAttributes:tt.getParameter(ae),maxVertexUniforms:tt.getParameter(j),maxVertexTextureUnits:tt.getParameter(he),maxVaryingVectors:tt.getParameter(Q),maxFragmentUniforms:tt.getParameter(Te),glsl:tt.getParameter($e),renderer:tt.getParameter(et),vendor:tt.getParameter(qe),version:tt.getParameter(rt),readFloat:la,npotTextureCube:Ja}},wr=function(tt){return tt instanceof Uint8Array||tt instanceof Uint16Array||tt instanceof Uint32Array||tt instanceof Int8Array||tt instanceof Int16Array||tt instanceof Int32Array||tt instanceof Float32Array||tt instanceof Float64Array||tt instanceof Uint8ClampedArray};function Er(tt){return!!tt&&typeof tt=="object"&&Array.isArray(tt.shape)&&Array.isArray(tt.stride)&&typeof tt.offset=="number"&&tt.shape.length===tt.stride.length&&(Array.isArray(tt.data)||wr(tt.data))}var mt=function(tt){return Object.keys(tt).map(function(Gt){return tt[Gt]})},ze={shape:nt,flatten:He};function Ze(tt,Gt,or){for(var ea=0;ea0){var ri;if(Array.isArray(_a[0])){bn=ba(_a);for(var Oa=1,Ia=1;Ia0){if(typeof Oa[0]=="number"){var dn=U.allocType(za.dtype,Oa.length);Pr(dn,Oa),bn(dn,Un),U.freeType(dn)}else if(Array.isArray(Oa[0])||wr(Oa[0])){An=ba(Oa);var fn=Ba(Oa,An,za.dtype);bn(fn,Un),U.freeType(fn)}}}else if(Er(Oa)){An=Oa.shape;var Bn=Oa.stride,ii=0,bi=0,Tn=0,Yn=0;An.length===1?(ii=An[0],bi=1,Tn=Bn[0],Yn=0):An.length===2&&(ii=An[0],bi=An[1],Tn=Bn[0],Yn=Bn[1]);var mi=Array.isArray(Oa.data)?za.dtype:Xt(Oa.data),wi=U.allocType(mi,ii*bi);Yr(wi,Oa.data,ii,bi,Tn,Yn,Oa.offset),bn(wi,Un),U.freeType(wi)}return Cn}return Ha||Cn(Zr),Cn._reglType="buffer",Cn._buffer=za,Cn.subdata=ri,or.profile&&(Cn.stats=za.stats),Cn.destroy=function(){Mn(za)},Cn}function Pa(){mt(la).forEach(function(Zr){Zr.buffer=tt.createBuffer(),tt.bindBuffer(Zr.type,Zr.buffer),tt.bufferData(Zr.type,Zr.persistentData||Zr.byteLength,Zr.usage)})}return or.profile&&(Gt.getTotalBufferSize=function(){var Zr=0;return Object.keys(la).forEach(function(_a){Zr+=la[_a].stats.size}),Zr}),{create:yn,createStream:hn,destroyStream:un,clear:function(){mt(la).forEach(Mn),ja.forEach(Mn)},getBuffer:function(Zr){return Zr&&Zr._buffer instanceof fa?Zr._buffer:null},restore:Pa,_initBuffer:si}}var na=0,La=0,Ga=1,Ua=1,Xa=4,an=4,Sa={points:na,point:La,lines:Ga,line:Ua,triangles:Xa,triangle:an,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Zn=0,Wn=1,ti=4,gt=5120,it=5121,Rr=5122,Ar=5123,pr=5124,kr=5125,zr=34963,Ur=35040,dt=35044;function qt(tt,Gt,or,ea){var pa={},la=0,fa={uint8:it,uint16:Ar};Gt.oes_element_index_uint&&(fa.uint32=kr);function ja(Pa){this.id=la++,pa[this.id]=this,this.buffer=Pa,this.primType=ti,this.vertCount=0,this.type=0}ja.prototype.bind=function(){this.buffer.bind()};var hn=[];function un(Pa){var Zr=hn.pop();return Zr||(Zr=new ja(or.create(null,zr,!0,!1)._buffer)),si(Zr,Pa,Ur,-1,-1,0,0),Zr}function Ja(Pa){hn.push(Pa)}function si(Pa,Zr,_a,Ha,nn,za,Cn){Pa.buffer.bind();var bn;if(Zr){var ri=Cn;!Cn&&(!wr(Zr)||Er(Zr)&&!wr(Zr.data))&&(ri=Gt.oes_element_index_uint?kr:Ar),or._initBuffer(Pa.buffer,Zr,_a,ri,3)}else tt.bufferData(zr,za,_a),Pa.buffer.dtype=bn||it,Pa.buffer.usage=_a,Pa.buffer.dimension=3,Pa.buffer.byteLength=za;if(bn=Cn,!Cn){switch(Pa.buffer.dtype){case it:case gt:bn=it;break;case Ar:case Rr:bn=Ar;break;case kr:case pr:bn=kr;break;default:}Pa.buffer.dtype=bn}Pa.type=bn;var Oa=nn;Oa<0&&(Oa=Pa.buffer.byteLength,bn===Ar?Oa>>=1:bn===kr&&(Oa>>=2)),Pa.vertCount=Oa;var Ia=Ha;if(Ha<0){Ia=ti;var Un=Pa.buffer.dimension;Un===1&&(Ia=Zn),Un===2&&(Ia=Wn),Un===3&&(Ia=ti)}Pa.primType=Ia}function Mn(Pa){ea.elementsCount--,delete pa[Pa.id],Pa.buffer.destroy(),Pa.buffer=null}function yn(Pa,Zr){var _a=or.create(null,zr,!0),Ha=new ja(_a._buffer);ea.elementsCount++;function nn(za){if(!za)_a(),Ha.primType=ti,Ha.vertCount=0,Ha.type=it;else if(typeof za=="number")_a(za),Ha.primType=ti,Ha.vertCount=za|0,Ha.type=it;else{var Cn=null,bn=dt,ri=-1,Oa=-1,Ia=0,Un=0;Array.isArray(za)||wr(za)||Er(za)?Cn=za:("data"in za&&(Cn=za.data),"usage"in za&&(bn=Da[za.usage]),"primitive"in za&&(ri=Sa[za.primitive]),"count"in za&&(Oa=za.count|0),"type"in za&&(Un=fa[za.type]),"length"in za?Ia=za.length|0:(Ia=Oa,Un===Ar||Un===Rr?Ia*=2:(Un===kr||Un===pr)&&(Ia*=4))),si(Ha,Cn,bn,ri,Oa,Ia,Un)}return nn}return nn(Pa),nn._reglType="elements",nn._elements=Ha,nn.subdata=function(za,Cn){return _a.subdata(za,Cn),nn},nn.destroy=function(){Mn(Ha)},nn}return{create:yn,createStream:un,destroyStream:Ja,getElements:function(Pa){return typeof Pa=="function"&&Pa._elements instanceof ja?Pa._elements:null},clear:function(){mt(pa).forEach(Mn)}}}var fr=new Float32Array(1),Ir=new Uint32Array(fr.buffer),da=5123;function Ta(tt){for(var Gt=U.allocType(da,tt.length),or=0;or>>31<<15,la=(ea<<1>>>24)-127,fa=ea>>13&1023;if(la<-24)Gt[or]=pa;else if(la<-14){var ja=-14-la;Gt[or]=pa+(fa+1024>>ja)}else la>15?Gt[or]=pa+31744:Gt[or]=pa+(la+15<<10)+fa}return Gt}function ua(tt){return Array.isArray(tt)||wr(tt)}var ra=34467,ha=3553,pn=34067,_n=34069,jn=6408,li=6406,yi=6407,gi=6409,Si=6410,Gi=32854,io=32855,vo=36194,ms=32819,pi=32820,lo=33635,Ai=34042,Fo=6402,No=34041,$o=35904,bo=35906,Hi=36193,Pi=33776,ji=33777,Uo=33778,Ko=33779,us=35986,ko=35987,zn=34798,_i=35840,xs=35841,Qo=35842,Ii=35843,gs=36196,Zo=5121,Ss=5123,zs=5125,ui=5126,po=10242,oo=10243,vs=10497,Nl=33071,Ki=33648,Ts=10240,Ws=10241,as=9728,bs=9729,Go=9984,ns=9985,fl=9986,Rl=9987,Vu=33170,Ul=4352,Ic=4353,rc=4354,ys=34046,Du=3317,oc=37440,Dl=37441,il=37443,Au=37444,ou=33984,Fs=[Go,fl,ns,Rl],Xs=[0,gi,Si,yi,jn],es={};es[gi]=es[li]=es[Fo]=1,es[No]=es[Si]=2,es[yi]=es[$o]=3,es[jn]=es[bo]=4;function Ms(tt){return"[object "+tt+"]"}var Su=Ms("HTMLCanvasElement"),hl=Ms("OffscreenCanvas"),cu=Ms("CanvasRenderingContext2D"),qs=Ms("ImageBitmap"),wf=Ms("HTMLImageElement"),Vo=Ms("HTMLVideoElement"),Tf=Object.keys(ot).concat([Su,hl,cu,qs,wf,Vo]),ss=[];ss[Zo]=1,ss[ui]=4,ss[Hi]=2,ss[Ss]=2,ss[zs]=4;var Vi=[];Vi[Gi]=2,Vi[io]=2,Vi[vo]=2,Vi[No]=4,Vi[Pi]=.5,Vi[ji]=.5,Vi[Uo]=1,Vi[Ko]=1,Vi[us]=.5,Vi[ko]=1,Vi[zn]=1,Vi[_i]=.5,Vi[xs]=.25,Vi[Qo]=.5,Vi[Ii]=.25,Vi[gs]=.5;function sc(tt){return Array.isArray(tt)&&(tt.length===0||typeof tt[0]=="number")}function fu(tt){if(!Array.isArray(tt))return!1;var Gt=tt.length;return!(Gt===0||!ua(tt[0]))}function vl(tt){return Object.prototype.toString.call(tt)}function Rc(tt){return vl(tt)===Su}function qu(tt){return vl(tt)===hl}function yc(tt){return vl(tt)===cu}function Al(tt){return vl(tt)===qs}function $c(tt){return vl(tt)===wf}function Nc(tt){return vl(tt)===Vo}function _c(tt){if(!tt)return!1;var Gt=vl(tt);return Tf.indexOf(Gt)>=0?!0:sc(tt)||fu(tt)||Er(tt)}function ac(tt){return ot[Object.prototype.toString.call(tt)]|0}function Uc(tt,Gt){var or=Gt.length;switch(tt.type){case Zo:case Ss:case zs:case ui:var ea=U.allocType(tt.type,or);ea.set(Gt),tt.data=ea;break;case Hi:tt.data=Ta(Gt);break;default:}}function jc(tt,Gt){return U.allocType(tt.type===Hi?ui:tt.type,Gt)}function hu(tt,Gt){tt.type===Hi?(tt.data=Ta(Gt),U.freeType(Gt)):tt.data=Gt}function Dc(tt,Gt,or,ea,pa,la){for(var fa=tt.width,ja=tt.height,hn=tt.channels,un=fa*ja*hn,Ja=jc(tt,un),si=0,Mn=0;Mn=1;)ja+=fa*hn*hn,hn/=2;return ja}else return fa*or*ea}function lc(tt,Gt,or,ea,pa,la,fa){var ja={"don't care":Ul,"dont care":Ul,nice:rc,fast:Ic},hn={repeat:vs,clamp:Nl,mirror:Ki},un={nearest:as,linear:bs},Ja=d({mipmap:Rl,"nearest mipmap nearest":Go,"linear mipmap nearest":ns,"nearest mipmap linear":fl,"linear mipmap linear":Rl},un),si={none:0,browser:Au},Mn={uint8:Zo,rgba4:ms,rgb565:lo,"rgb5 a1":pi},yn={alpha:li,luminance:gi,"luminance alpha":Si,rgb:yi,rgba:jn,rgba4:Gi,"rgb5 a1":io,rgb565:vo},Pa={};Gt.ext_srgb&&(yn.srgb=$o,yn.srgba=bo),Gt.oes_texture_float&&(Mn.float32=Mn.float=ui),Gt.oes_texture_half_float&&(Mn.float16=Mn["half float"]=Hi),Gt.webgl_depth_texture&&(d(yn,{depth:Fo,"depth stencil":No}),d(Mn,{uint16:Ss,uint32:zs,"depth stencil":Ai})),Gt.webgl_compressed_texture_s3tc&&d(Pa,{"rgb s3tc dxt1":Pi,"rgba s3tc dxt1":ji,"rgba s3tc dxt3":Uo,"rgba s3tc dxt5":Ko}),Gt.webgl_compressed_texture_atc&&d(Pa,{"rgb atc":us,"rgba atc explicit alpha":ko,"rgba atc interpolated alpha":zn}),Gt.webgl_compressed_texture_pvrtc&&d(Pa,{"rgb pvrtc 4bppv1":_i,"rgb pvrtc 2bppv1":xs,"rgba pvrtc 4bppv1":Qo,"rgba pvrtc 2bppv1":Ii}),Gt.webgl_compressed_texture_etc1&&(Pa["rgb etc1"]=gs);var Zr=Array.prototype.slice.call(tt.getParameter(ra));Object.keys(Pa).forEach(function(Me){var Ke=Pa[Me];Zr.indexOf(Ke)>=0&&(yn[Me]=Ke)});var _a=Object.keys(yn);or.textureFormats=_a;var Ha=[];Object.keys(yn).forEach(function(Me){var Ke=yn[Me];Ha[Ke]=Me});var nn=[];Object.keys(Mn).forEach(function(Me){var Ke=Mn[Me];nn[Ke]=Me});var za=[];Object.keys(un).forEach(function(Me){var Ke=un[Me];za[Ke]=Me});var Cn=[];Object.keys(Ja).forEach(function(Me){var Ke=Ja[Me];Cn[Ke]=Me});var bn=[];Object.keys(hn).forEach(function(Me){var Ke=hn[Me];bn[Ke]=Me});var ri=_a.reduce(function(Me,Ke){var ht=yn[Ke];return ht===gi||ht===li||ht===gi||ht===Si||ht===Fo||ht===No||Gt.ext_srgb&&(ht===$o||ht===bo)?Me[ht]=ht:ht===io||Ke.indexOf("rgba")>=0?Me[ht]=jn:Me[ht]=yi,Me},{});function Oa(){this.internalformat=jn,this.format=jn,this.type=Zo,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Au,this.width=0,this.height=0,this.channels=0}function Ia(Me,Ke){Me.internalformat=Ke.internalformat,Me.format=Ke.format,Me.type=Ke.type,Me.compressed=Ke.compressed,Me.premultiplyAlpha=Ke.premultiplyAlpha,Me.flipY=Ke.flipY,Me.unpackAlignment=Ke.unpackAlignment,Me.colorSpace=Ke.colorSpace,Me.width=Ke.width,Me.height=Ke.height,Me.channels=Ke.channels}function Un(Me,Ke){if(!(typeof Ke!="object"||!Ke)){if("premultiplyAlpha"in Ke&&(Me.premultiplyAlpha=Ke.premultiplyAlpha),"flipY"in Ke&&(Me.flipY=Ke.flipY),"alignment"in Ke&&(Me.unpackAlignment=Ke.alignment),"colorSpace"in Ke&&(Me.colorSpace=si[Ke.colorSpace]),"type"in Ke){var ht=Ke.type;Me.type=Mn[ht]}var Bt=Me.width,gr=Me.height,Dr=Me.channels,ur=!1;"shape"in Ke?(Bt=Ke.shape[0],gr=Ke.shape[1],Ke.shape.length===3&&(Dr=Ke.shape[2],ur=!0)):("radius"in Ke&&(Bt=gr=Ke.radius),"width"in Ke&&(Bt=Ke.width),"height"in Ke&&(gr=Ke.height),"channels"in Ke&&(Dr=Ke.channels,ur=!0)),Me.width=Bt|0,Me.height=gr|0,Me.channels=Dr|0;var vt=!1;if("format"in Ke){var wt=Ke.format,It=Me.internalformat=yn[wt];Me.format=ri[It],wt in Mn&&("type"in Ke||(Me.type=Mn[wt])),wt in Pa&&(Me.compressed=!0),vt=!0}!ur&&vt?Me.channels=es[Me.format]:ur&&!vt&&Me.channels!==Xs[Me.format]&&(Me.format=Me.internalformat=Xs[Me.channels])}}function An(Me){tt.pixelStorei(oc,Me.flipY),tt.pixelStorei(Dl,Me.premultiplyAlpha),tt.pixelStorei(il,Me.colorSpace),tt.pixelStorei(Du,Me.unpackAlignment)}function dn(){Oa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function fn(Me,Ke){var ht=null;if(_c(Ke)?ht=Ke:Ke&&(Un(Me,Ke),"x"in Ke&&(Me.xOffset=Ke.x|0),"y"in Ke&&(Me.yOffset=Ke.y|0),_c(Ke.data)&&(ht=Ke.data)),Ke.copy){var Bt=pa.viewportWidth,gr=pa.viewportHeight;Me.width=Me.width||Bt-Me.xOffset,Me.height=Me.height||gr-Me.yOffset,Me.needsCopy=!0}else if(!ht)Me.width=Me.width||1,Me.height=Me.height||1,Me.channels=Me.channels||4;else if(wr(ht))Me.channels=Me.channels||4,Me.data=ht,!("type"in Ke)&&Me.type===Zo&&(Me.type=ac(ht));else if(sc(ht))Me.channels=Me.channels||4,Uc(Me,ht),Me.alignment=1,Me.needsFree=!0;else if(Er(ht)){var Dr=ht.data;!Array.isArray(Dr)&&Me.type===Zo&&(Me.type=ac(Dr));var ur=ht.shape,vt=ht.stride,wt,It,$t,lr,tr,cr;ur.length===3?($t=ur[2],cr=vt[2]):($t=1,cr=1),wt=ur[0],It=ur[1],lr=vt[0],tr=vt[1],Me.alignment=1,Me.width=wt,Me.height=It,Me.channels=$t,Me.format=Me.internalformat=Xs[$t],Me.needsFree=!0,Dc(Me,Dr,lr,tr,cr,ht.offset)}else if(Rc(ht)||qu(ht)||yc(ht))Rc(ht)||qu(ht)?Me.element=ht:Me.element=ht.canvas,Me.width=Me.element.width,Me.height=Me.element.height,Me.channels=4;else if(Al(ht))Me.element=ht,Me.width=ht.width,Me.height=ht.height,Me.channels=4;else if($c(ht))Me.element=ht,Me.width=ht.naturalWidth,Me.height=ht.naturalHeight,Me.channels=4;else if(Nc(ht))Me.element=ht,Me.width=ht.videoWidth,Me.height=ht.videoHeight,Me.channels=4;else if(fu(ht)){var rr=Me.width||ht[0].length,Vt=Me.height||ht.length,er=Me.channels;ua(ht[0][0])?er=er||ht[0][0].length:er=er||1;for(var Nt=ze.shape(ht),Cr=1,Hr=0;Hr>=gr,ht.height>>=gr,fn(ht,Bt[gr]),Me.mipmask|=1<=0&&!("faces"in Ke)&&(Me.genMipmaps=!0)}if("mag"in Ke){var Bt=Ke.mag;Me.magFilter=un[Bt]}var gr=Me.wrapS,Dr=Me.wrapT;if("wrap"in Ke){var ur=Ke.wrap;typeof ur=="string"?gr=Dr=hn[ur]:Array.isArray(ur)&&(gr=hn[ur[0]],Dr=hn[ur[1]])}else{if("wrapS"in Ke){var vt=Ke.wrapS;gr=hn[vt]}if("wrapT"in Ke){var wt=Ke.wrapT;Dr=hn[wt]}}if(Me.wrapS=gr,Me.wrapT=Dr,"anisotropic"in Ke){var It=Ke.anisotropic;Me.anisotropic=Ke.anisotropic}if("mipmap"in Ke){var $t=!1;switch(typeof Ke.mipmap){case"string":Me.mipmapHint=ja[Ke.mipmap],Me.genMipmaps=!0,$t=!0;break;case"boolean":$t=Me.genMipmaps=Ke.mipmap;break;case"object":Me.genMipmaps=!1,$t=!0;break;default:}$t&&!("min"in Ke)&&(Me.minFilter=Go)}}function al(Me,Ke){tt.texParameteri(Ke,Ws,Me.minFilter),tt.texParameteri(Ke,Ts,Me.magFilter),tt.texParameteri(Ke,po,Me.wrapS),tt.texParameteri(Ke,oo,Me.wrapT),Gt.ext_texture_filter_anisotropic&&tt.texParameteri(Ke,ys,Me.anisotropic),Me.genMipmaps&&(tt.hint(Vu,Me.mipmapHint),tt.generateMipmap(Ke))}var El=0,ws={},Hs=or.maxTextureUnits,$s=Array(Hs).map(function(){return null});function Di(Me){Oa.call(this),this.mipmask=0,this.internalformat=jn,this.id=El++,this.refCount=1,this.target=Me,this.texture=tt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Wo,fa.profile&&(this.stats={size:0})}function nl(Me){tt.activeTexture(ou),tt.bindTexture(Me.target,Me.texture)}function mo(){var Me=$s[0];Me?tt.bindTexture(Me.target,Me.texture):tt.bindTexture(ha,null)}function me(Me){var Ke=Me.texture,ht=Me.unit,Bt=Me.target;ht>=0&&(tt.activeTexture(ou+ht),tt.bindTexture(Bt,null),$s[ht]=null),tt.deleteTexture(Ke),Me.texture=null,Me.params=null,Me.pixels=null,Me.refCount=0,delete ws[Me.id],la.textureCount--}d(Di.prototype,{bind:function(){var Me=this;Me.bindCount+=1;var Ke=Me.unit;if(Ke<0){for(var ht=0;ht0)continue;Bt.unit=-1}$s[ht]=Me,Ke=ht;break}Ke>=Hs,fa.profile&&la.maxTextureUnits>tr)-$t,cr.height=cr.height||(ht.height>>tr)-lr,nl(ht),ii(cr,ha,$t,lr,tr),mo(),Yn(cr),Bt}function Dr(ur,vt){var wt=ur|0,It=vt|0||wt;if(wt===ht.width&&It===ht.height)return Bt;Bt.width=ht.width=wt,Bt.height=ht.height=It,nl(ht);for(var $t=0;ht.mipmask>>$t;++$t){var lr=wt>>$t,tr=It>>$t;if(!lr||!tr)break;tt.texImage2D(ha,$t,ht.format,lr,tr,0,ht.format,ht.type,null)}return mo(),fa.profile&&(ht.stats.size=Mu(ht.internalformat,ht.type,wt,It,!1,!1)),Bt}return Bt(Me,Ke),Bt.subimage=gr,Bt.resize=Dr,Bt._reglType="texture2d",Bt._texture=ht,fa.profile&&(Bt.stats=ht.stats),Bt.destroy=function(){ht.decRef()},Bt}function ye(Me,Ke,ht,Bt,gr,Dr){var ur=new Di(pn);ws[ur.id]=ur,la.cubeCount++;var vt=new Array(6);function wt(lr,tr,cr,rr,Vt,er){var Nt,Cr=ur.texInfo;for(Wo.call(Cr),Nt=0;Nt<6;++Nt)vt[Nt]=Qi();if(typeof lr=="number"||!lr){var Hr=lr|0||1;for(Nt=0;Nt<6;++Nt)wi(vt[Nt],Hr,Hr)}else if(typeof lr=="object")if(tr)Ri(vt[0],lr),Ri(vt[1],tr),Ri(vt[2],cr),Ri(vt[3],rr),Ri(vt[4],Vt),Ri(vt[5],er);else if(tl(Cr,lr),Un(ur,lr),"faces"in lr){var ca=lr.faces;for(Nt=0;Nt<6;++Nt)Ia(vt[Nt],ur),Ri(vt[Nt],ca[Nt])}else for(Nt=0;Nt<6;++Nt)Ri(vt[Nt],lr);for(Ia(ur,vt[0]),Cr.genMipmaps?ur.mipmask=(vt[0].width<<1)-1:ur.mipmask=vt[0].mipmask,ur.internalformat=vt[0].internalformat,wt.width=vt[0].width,wt.height=vt[0].height,nl(ur),Nt=0;Nt<6;++Nt)ps(vt[Nt],_n+Nt);for(al(Cr,pn),mo(),fa.profile&&(ur.stats.size=Mu(ur.internalformat,ur.type,wt.width,wt.height,Cr.genMipmaps,!0)),wt.format=Ha[ur.internalformat],wt.type=nn[ur.type],wt.mag=za[Cr.magFilter],wt.min=Cn[Cr.minFilter],wt.wrapS=bn[Cr.wrapS],wt.wrapT=bn[Cr.wrapT],Nt=0;Nt<6;++Nt)_l(vt[Nt]);return wt}function It(lr,tr,cr,rr,Vt){var er=cr|0,Nt=rr|0,Cr=Vt|0,Hr=Tn();return Ia(Hr,ur),Hr.width=0,Hr.height=0,fn(Hr,tr),Hr.width=Hr.width||(ur.width>>Cr)-er,Hr.height=Hr.height||(ur.height>>Cr)-Nt,nl(ur),ii(Hr,_n+lr,er,Nt,Cr),mo(),Yn(Hr),wt}function $t(lr){var tr=lr|0;if(tr!==ur.width){wt.width=ur.width=tr,wt.height=ur.height=tr,nl(ur);for(var cr=0;cr<6;++cr)for(var rr=0;ur.mipmask>>rr;++rr)tt.texImage2D(_n+cr,rr,ur.format,tr>>rr,tr>>rr,0,ur.format,ur.type,null);return mo(),fa.profile&&(ur.stats.size=Mu(ur.internalformat,ur.type,wt.width,wt.height,!1,!0)),wt}}return wt(Me,Ke,ht,Bt,gr,Dr),wt.subimage=It,wt.resize=$t,wt._reglType="textureCube",wt._texture=ur,fa.profile&&(wt.stats=ur.stats),wt.destroy=function(){ur.decRef()},wt}function te(){for(var Me=0;Me>Bt,ht.height>>Bt,0,ht.internalformat,ht.type,null);else for(var gr=0;gr<6;++gr)tt.texImage2D(_n+gr,Bt,ht.internalformat,ht.width>>Bt,ht.height>>Bt,0,ht.internalformat,ht.type,null);al(ht.texInfo,ht.target)})}function Ne(){for(var Me=0;Me=0?_l=!0:hn.indexOf(Wo)>=0&&(_l=!1))),("depthTexture"in Di||"depthStencilTexture"in Di)&&($s=!!(Di.depthTexture||Di.depthStencilTexture)),"depth"in Di&&(typeof Di.depth=="boolean"?ps=Di.depth:(El=Di.depth,Js=!1)),"stencil"in Di&&(typeof Di.stencil=="boolean"?Js=Di.stencil:(ws=Di.stencil,ps=!1)),"depthStencil"in Di&&(typeof Di.depthStencil=="boolean"?ps=Js=Di.depthStencil:(Hs=Di.depthStencil,ps=!1,Js=!1))}var mo=null,me=null,K=null,ye=null;if(Array.isArray(Qi))mo=Qi.map(Pa);else if(Qi)mo=[Pa(Qi)];else for(mo=new Array(al),mi=0;mi0&&(Yn.depth=fn[0].depth,Yn.stencil=fn[0].stencil,Yn.depthStencil=fn[0].depthStencil),fn[Tn]?fn[Tn](Yn):fn[Tn]=Ia(Yn)}return d(Bn,{width:mi,height:mi,color:Wo})}function ii(bi){var Tn,Yn=bi|0;if(Yn===Bn.width)return Bn;var mi=Bn.color;for(Tn=0;Tn=mi.byteLength?wi.subdata(mi):(wi.destroy(),Ia.buffers[bi]=null)),Ia.buffers[bi]||(wi=Ia.buffers[bi]=pa.create(Tn,Ec,!1,!0)),Yn.buffer=pa.getBuffer(wi),Yn.size=Yn.buffer.dimension|0,Yn.normalized=!1,Yn.type=Yn.buffer.dtype,Yn.offset=0,Yn.stride=0,Yn.divisor=0,Yn.state=1,Bn[bi]=1}else pa.getBuffer(Tn)?(Yn.buffer=pa.getBuffer(Tn),Yn.size=Yn.buffer.dimension|0,Yn.normalized=!1,Yn.type=Yn.buffer.dtype,Yn.offset=0,Yn.stride=0,Yn.divisor=0,Yn.state=1):pa.getBuffer(Tn.buffer)?(Yn.buffer=pa.getBuffer(Tn.buffer),Yn.size=(+Tn.size||Yn.buffer.dimension)|0,Yn.normalized=!!Tn.normalized||!1,"type"in Tn?Yn.type=ma[Tn.type]:Yn.type=Yn.buffer.dtype,Yn.offset=(Tn.offset||0)|0,Yn.stride=(Tn.stride||0)|0,Yn.divisor=(Tn.divisor||0)|0,Yn.state=1):"x"in Tn&&(Yn.x=+Tn.x||0,Yn.y=+Tn.y||0,Yn.z=+Tn.z||0,Yn.w=+Tn.w||0,Yn.state=2)}for(var Ri=0;Ri1)for(var An=0;AnZr&&(Zr=_a.stats.uniformsCount)}),Zr},or.getMaxAttributesCount=function(){var Zr=0;return Ja.forEach(function(_a){_a.stats.attributesCount>Zr&&(Zr=_a.stats.attributesCount)}),Zr});function Pa(){pa={},la={};for(var Zr=0;Zr16&&(or=wn(or,tt.length*8));for(var ea=Array(16),pa=Array(16),la=0;la<16;la++)ea[la]=or[la]^909522486,pa[la]=or[la]^1549556828;var fa=wn(ea.concat(Ku(Gt)),512+Gt.length*8);return Yt(wn(pa.concat(fa),768))}function Hl(tt){for(var Gt=Hc?"0123456789ABCDEF":"0123456789abcdef",or="",ea,pa=0;pa>>4&15)+Gt.charAt(ea&15);return or}function Yu(tt){for(var Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="",ea=tt.length,pa=0;patt.length*8?or+=pu:or+=Gt.charAt(la>>>6*(3-fa)&63);return or}function hc(tt,Gt){var or=Gt.length,ea=Array(),pa,la,fa,ja,hn=Array(Math.ceil(tt.length/2));for(pa=0;pa0;){for(ja=Array(),fa=0,pa=0;pa0||la>0)&&(ja[ja.length]=la);ea[ea.length]=fa,hn=ja}var un="";for(pa=ea.length-1;pa>=0;pa--)un+=Gt.charAt(ea[pa]);var Ja=Math.ceil(tt.length*8/(Math.log(Gt.length)/Math.log(2)));for(pa=un.length;pa>>6&31,128|ea&63):ea<=65535?Gt+=String.fromCharCode(224|ea>>>12&15,128|ea>>>6&63,128|ea&63):ea<=2097151&&(Gt+=String.fromCharCode(240|ea>>>18&7,128|ea>>>12&63,128|ea>>>6&63,128|ea&63));return Gt}function Ku(tt){for(var Gt=Array(tt.length>>2),or=0;or>5]|=(tt.charCodeAt(or/8)&255)<<24-or%32;return Gt}function Yt(tt){for(var Gt="",or=0;or>5]>>>24-or%32&255);return Gt}function mr(tt,Gt){return tt>>>Gt|tt<<32-Gt}function Jr(tt,Gt){return tt>>>Gt}function Wr(tt,Gt,or){return tt&Gt^~tt&or}function xa(tt,Gt,or){return tt&Gt^tt&or^Gt&or}function $a(tt){return mr(tt,2)^mr(tt,13)^mr(tt,22)}function xn(tt){return mr(tt,6)^mr(tt,11)^mr(tt,25)}function Fn(tt){return mr(tt,7)^mr(tt,18)^Jr(tt,3)}function Gn(tt){return mr(tt,17)^mr(tt,19)^Jr(tt,10)}var ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function wn(tt,Gt){var or=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ea=new Array(64),pa,la,fa,ja,hn,un,Ja,si,Mn,yn,Pa,Zr;for(tt[Gt>>5]|=128<<24-Gt%32,tt[(Gt+64>>9<<4)+15]=Gt,Mn=0;Mn>16)+(Gt>>16)+(or>>16);return ea<<16|or&65535}function Ln(tt){return Array.prototype.slice.call(tt)}function sn(tt){return Ln(tt).join("")}function di(tt){var Gt=tt&&tt.cache,or=0,ea=[],pa=[],la=[];function fa(Pa,Zr){var _a=Zr&&Zr.stable;if(!_a){for(var Ha=0;Ha0&&(Pa.push(nn,"="),Pa.push.apply(Pa,Ln(arguments)),Pa.push(";")),nn}return d(Zr,{def:Ha,toString:function(){return sn([_a.length>0?"var "+_a.join(",")+";":"",sn(Pa)])}})}function hn(){var Pa=ja(),Zr=ja(),_a=Pa.toString,Ha=Zr.toString;function nn(za,Cn){Zr(za,Cn,"=",Pa.def(za,Cn),";")}return d(function(){Pa.apply(Pa,Ln(arguments))},{def:Pa.def,entry:Pa,exit:Zr,save:nn,set:function(za,Cn,bn){nn(za,Cn),Pa(za,Cn,"=",bn,";")},toString:function(){return _a()+Ha()}})}function un(){var Pa=sn(arguments),Zr=hn(),_a=hn(),Ha=Zr.toString,nn=_a.toString;return d(Zr,{then:function(){return Zr.apply(Zr,Ln(arguments)),this},else:function(){return _a.apply(_a,Ln(arguments)),this},toString:function(){var za=nn();return za&&(za="else{"+za+"}"),sn(["if(",Pa,"){",Ha(),"}",za])}})}var Ja=ja(),si={};function Mn(Pa,Zr){var _a=[];function Ha(){var ri="a"+_a.length;return _a.push(ri),ri}Zr=Zr||0;for(var nn=0;nn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ca={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ua={cw:Je,ccw:ht};function rn(tt){return Array.isArray(tt)||mr(tt)||Er(tt)}function Ja(tt){return tt.sort(function(qt,sr){return qt===we?-1:sr===we?1:qt=1,ra>=2,qt)}else if(sr===as){var da=tt.data;return new Aa(da.thisDep,da.contextDep,da.propDep,qt)}else{if(sr===Ps)return new Aa(!1,!1,!1,qt);if(sr===ds){for(var ca=!1,ha=!1,Va=!1,dn=0;dn=1&&(ha=!0),$a>=2&&(Va=!0)}else fn.type===as&&(ca=ca||fn.data.thisDep,ha=ha||fn.data.contextDep,Va=Va||fn.data.propDep)}return new Aa(ca,ha,Va,qt)}else return new Aa(sr===Ro,sr===no,sr===Qn,qt)}}var yi=new Aa(!1,!1,!1,function(){});function zi(tt,qt,sr,ra,da,ca,ha,Va,dn,fn,$a,ui,Mn,_n,Ia,Zr){var _a=fn.Record,Wa={add:32774,subtract:32778,"reverse subtract":32779};sr.ext_blend_minmax&&(Wa.min=mt,Wa.max=wt);var on=sr.angle_instanced_arrays,Fa=sr.webgl_draw_buffers,Cn=sr.oes_vertex_array_object,bn={dirty:!0,profile:Zr.profile},ai={},Ba=[],Ra={},Un={};function An(pt){return pt.replace(".","_")}function pn(pt,At,Dt){var er=An(pt);Ba.push(pt),ai[er]=bn[er]=!!Dt,Ra[er]=At}function vn(pt,At,Dt){var er=An(pt);Ba.push(pt),Array.isArray(Dt)?(bn[er]=Dt.slice(),ai[er]=Dt.slice()):bn[er]=ai[er]=Dt,Un[er]=At}function On(pt){return!!isNaN(pt)}pn(Cs,tn),pn(es,ka),vn(ul,"blendColor",[0,0,0,0]),vn(Ws,"blendEquationSeparate",[jr,jr]),vn(Fs,"blendFuncSeparate",[Br,hr,Br,hr]),pn(Mi,In,!0),vn(yo,"depthFunc",va),vn(Ss,"depthRange",[0,1]),vn(us,"depthMask",!0),vn(Pl,Pl,[!0,!0,!0,!0]),pn(Ql,pa),vn(du,"cullFace",Re),vn(Yu,Yu,ht),vn(Vl,Vl,1),pn(Ku,di),vn(Hl,"polygonOffset",[0,0]),pn(Ou,Di),pn(Ki,Ai),vn(xo,"sampleCoverage",[1,!1]),pn(Ju,Dn),vn(Eu,"stencilMask",-1),vn(pu,"stencilFunc",[$t,0,-1]),vn(Be,"stencilOpSeparate",[ve,Rt,Rt,Rt]),vn(R,"stencilOpSeparate",[Re,Rt,Rt,Rt]),pn(ae,Yn),vn(xe,"scissor",[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]),vn(we,we,[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]);var oi={gl:tt,context:Mn,strings:qt,next:ai,current:bn,draw:ui,elements:ca,buffer:da,shader:$a,attributes:fn.state,vao:fn,uniforms:dn,framebuffer:Va,extensions:sr,timer:_n,isBufferArgs:rn},bi={primTypes:Ma,compareFuncs:ya,blendFuncs:Za,blendEquations:Wa,stencilOps:Ca,glTypes:oa,orientationType:Ua};Fa&&(bi.backBuffer=[Re],bi.drawBuffer=v(ra.maxDrawbuffers,function(pt){return pt===0?[0]:v(pt,function(At){return Ha+At})}));var Tn=0;function Zn(){var pt=mi({cache:Ia}),At=pt.link,Dt=pt.global;pt.id=Tn++,pt.batchId="0";var er=At(oi),lr=pt.shared={props:"a0"};Object.keys(oi).forEach(function(rr){lr[rr]=Dt.def(er,".",rr)});var ar=pt.next={},cr=pt.current={};Object.keys(Un).forEach(function(rr){Array.isArray(bn[rr])&&(ar[rr]=Dt.def(lr.next,".",rr),cr[rr]=Dt.def(lr.current,".",rr))});var nr=pt.constants={};Object.keys(bi).forEach(function(rr){nr[rr]=Dt.def(JSON.stringify(bi[rr]))}),pt.invoke=function(rr,Nt){switch(Nt.type){case vi:var Pr=["this",lr.context,lr.props,pt.batchId];return rr.def(At(Nt.data),".call(",Pr.slice(0,Math.max(Nt.data.length+1,4)),")");case Qn:return rr.def(lr.props,Nt.data);case no:return rr.def(lr.context,Nt.data);case Ro:return rr.def("this",Nt.data);case as:return Nt.data.append(pt,rr),Nt.data.ref;case Ps:return Nt.data.toString();case ds:return Nt.data.map(function(Hr){return pt.invoke(rr,Hr)})}},pt.attribCache={};var Vt={};return pt.scopeAttrib=function(rr){var Nt=qt.id(rr);if(Nt in Vt)return Vt[Nt];var Pr=fn.scope[Nt];Pr||(Pr=fn.scope[Nt]=new _a);var Hr=Vt[Nt]=At(Pr);return Hr},pt}function gi(pt){var At=pt.static,Dt=pt.dynamic,er;if(Fe in At){var lr=!!At[Fe];er=Wn(function(cr,nr){return lr}),er.enable=lr}else if(Fe in Dt){var ar=Dt[Fe];er=ii(ar,function(cr,nr){return cr.invoke(nr,ar)})}return er}function wi(pt,At){var Dt=pt.static,er=pt.dynamic;if(ct in Dt){var lr=Dt[ct];return lr?(lr=Va.getFramebuffer(lr),Wn(function(cr,nr){var Vt=cr.link(lr),rr=cr.shared;nr.set(rr.framebuffer,".next",Vt);var Nt=rr.context;return nr.set(Nt,"."+ft,Vt+".width"),nr.set(Nt,"."+Mt,Vt+".height"),Vt})):Wn(function(cr,nr){var Vt=cr.shared;nr.set(Vt.framebuffer,".next","null");var rr=Vt.context;return nr.set(rr,"."+ft,rr+"."+fr),nr.set(rr,"."+Mt,rr+"."+wr),"null"})}else if(ct in er){var ar=er[ct];return ii(ar,function(cr,nr){var Vt=cr.invoke(nr,ar),rr=cr.shared,Nt=rr.framebuffer,Pr=nr.def(Nt,".getFramebuffer(",Vt,")");nr.set(Nt,".next",Pr);var Hr=rr.context;return nr.set(Hr,"."+ft,Pr+"?"+Pr+".width:"+Hr+"."+fr),nr.set(Hr,"."+Mt,Pr+"?"+Pr+".height:"+Hr+"."+wr),Pr})}else return null}function Ii(pt,At,Dt){var er=pt.static,lr=pt.dynamic;function ar(Vt){if(Vt in er){var rr=er[Vt],Nt=!0,Pr=rr.x|0,Hr=rr.y|0,fa,ln;return"width"in rr?fa=rr.width|0:Nt=!1,"height"in rr?ln=rr.height|0:Nt=!1,new Aa(!Nt&&At&&At.thisDep,!Nt&&At&&At.contextDep,!Nt&&At&&At.propDep,function(Bn,En){var en=Bn.shared.context,hn=fa;"width"in rr||(hn=En.def(en,".",ft,"-",Pr));var mn=ln;return"height"in rr||(mn=En.def(en,".",Mt,"-",Hr)),[Pr,Hr,hn,mn]})}else if(Vt in lr){var Oa=lr[Vt],Ya=ii(Oa,function(Bn,En){var en=Bn.invoke(En,Oa),hn=Bn.shared.context,mn=En.def(en,".x|0"),Pn=En.def(en,".y|0"),ti=En.def('"width" in ',en,"?",en,".width|0:","(",hn,".",ft,"-",mn,")"),io=En.def('"height" in ',en,"?",en,".height|0:","(",hn,".",Mt,"-",Pn,")");return[mn,Pn,ti,io]});return At&&(Ya.thisDep=Ya.thisDep||At.thisDep,Ya.contextDep=Ya.contextDep||At.contextDep,Ya.propDep=Ya.propDep||At.propDep),Ya}else return At?new Aa(At.thisDep,At.contextDep,At.propDep,function(Bn,En){var en=Bn.shared.context;return[0,0,En.def(en,".",ft),En.def(en,".",Mt)]}):null}var cr=ar(we);if(cr){var nr=cr;cr=new Aa(cr.thisDep,cr.contextDep,cr.propDep,function(Vt,rr){var Nt=nr.append(Vt,rr),Pr=Vt.shared.context;return rr.set(Pr,"."+xt,Nt[2]),rr.set(Pr,"."+Pt,Nt[3]),Nt})}return{viewport:cr,scissor_box:ar(xe)}}function cs(pt,At){var Dt=pt.static,er=typeof Dt[zt]=="string"&&typeof Dt[bt]=="string";if(er){if(Object.keys(At.dynamic).length>0)return null;var lr=At.static,ar=Object.keys(lr);if(ar.length>0&&typeof lr[ar[0]]=="number"){for(var cr=[],nr=0;nr"+mn+"?"+Nt+".constant["+mn+"]:0;"}).join(""),"}}else{","if(",fa,"(",Nt,".buffer)){",Bn,"=",ln,".createStream(",Xr,",",Nt,".buffer);","}else{",Bn,"=",ln,".getBuffer(",Nt,".buffer);","}",En,'="type" in ',Nt,"?",Hr.glTypes,"[",Nt,".type]:",Bn,".dtype;",Oa.normalized,"=!!",Nt,".normalized;");function en(hn){rr(Oa[hn],"=",Nt,".",hn,"|0;")}return en("size"),en("offset"),en("stride"),en("divisor"),rr("}}"),rr.exit("if(",Oa.isStream,"){",ln,".destroyStream(",Bn,");","}"),Oa}lr[ar]=ii(cr,nr)}),lr}function rl(pt){var At=pt.static,Dt=pt.dynamic,er={};return Object.keys(At).forEach(function(lr){var ar=At[lr];er[lr]=Wn(function(cr,nr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:cr.link(ar)})}),Object.keys(Dt).forEach(function(lr){var ar=Dt[lr];er[lr]=ii(ar,function(cr,nr){return cr.invoke(nr,ar)})}),er}function Ml(pt,At,Dt,er,lr){var ar=pt.static,cr=pt.dynamic,nr=cs(pt,At),Vt=wi(pt,lr),rr=Ii(pt,Vt,lr),Nt=Ji(pt,lr),Pr=yl(pt,lr),Hr=Zs(pt,lr,nr);function fa(en){var hn=rr[en];hn&&(Pr[en]=hn)}fa(we),fa(An(xe));var ln=Object.keys(Pr).length>0,Oa={framebuffer:Vt,draw:Nt,shader:Hr,state:Pr,dirty:ln,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Oa.profile=gi(pt,lr),Oa.uniforms=Xo(Dt,lr),Oa.drawVAO=Oa.scopeVAO=Nt.vao,!Oa.drawVAO&&Hr.program&&!nr&&sr.angle_instanced_arrays&&Nt.static.elements){var Ya=!0,Bn=Hr.program.attributes.map(function(en){var hn=At.static[en];return Ya=Ya&&!!hn,hn});if(Ya&&Bn.length>0){var En=fn.getVAO(fn.createVAO({attributes:Bn,elements:Nt.static.elements}));Oa.drawVAO=new Aa(null,null,null,function(en,hn){return en.link(En)}),Oa.useVAO=!0}}return nr?Oa.useVAO=!0:Oa.attributes=Qs(At,lr),Oa.context=rl(er,lr),Oa}function ps(pt,At,Dt){var er=pt.shared,lr=er.context,ar=pt.scope();Object.keys(Dt).forEach(function(cr){At.save(lr,"."+cr);var nr=Dt[cr],Vt=nr.append(pt,At);Array.isArray(Vt)?ar(lr,".",cr,"=[",Vt.join(),"];"):ar(lr,".",cr,"=",Vt,";")}),At(ar)}function qs(pt,At,Dt,er){var lr=pt.shared,ar=lr.gl,cr=lr.framebuffer,nr;Fa&&(nr=At.def(lr.extensions,".webgl_draw_buffers"));var Vt=pt.constants,rr=Vt.drawBuffer,Nt=Vt.backBuffer,Pr;Dt?Pr=Dt.append(pt,At):Pr=At.def(cr,".next"),er||At("if(",Pr,"!==",cr,".cur){"),At("if(",Pr,"){",ar,".bindFramebuffer(",ua,",",Pr,".framebuffer);"),Fa&&At(nr,".drawBuffersWEBGL(",rr,"[",Pr,".colorAttachments.length]);"),At("}else{",ar,".bindFramebuffer(",ua,",null);"),Fa&&At(nr,".drawBuffersWEBGL(",Nt,");"),At("}",cr,".cur=",Pr,";"),er||At("}")}function Ys(pt,At,Dt){var er=pt.shared,lr=er.gl,ar=pt.current,cr=pt.next,nr=er.current,Vt=er.next,rr=pt.cond(nr,".dirty");Ba.forEach(function(Nt){var Pr=An(Nt);if(!(Pr in Dt.state)){var Hr,fa;if(Pr in cr){Hr=cr[Pr],fa=ar[Pr];var ln=v(bn[Pr].length,function(Ya){return rr.def(Hr,"[",Ya,"]")});rr(pt.cond(ln.map(function(Ya,Bn){return Ya+"!=="+fa+"["+Bn+"]"}).join("||")).then(lr,".",Un[Pr],"(",ln,");",ln.map(function(Ya,Bn){return fa+"["+Bn+"]="+Ya}).join(";"),";"))}else{Hr=rr.def(Vt,".",Pr);var Oa=pt.cond(Hr,"!==",nr,".",Pr);rr(Oa),Pr in Ra?Oa(pt.cond(Hr).then(lr,".enable(",Ra[Pr],");").else(lr,".disable(",Ra[Pr],");"),nr,".",Pr,"=",Hr,";"):Oa(lr,".",Un[Pr],"(",Hr,");",nr,".",Pr,"=",Hr,";")}}}),Object.keys(Dt.state).length===0&&rr(nr,".dirty=false;"),At(rr)}function Ri(pt,At,Dt,er){var lr=pt.shared,ar=pt.current,cr=lr.current,nr=lr.gl,Vt;Ja(Object.keys(Dt)).forEach(function(rr){var Nt=Dt[rr];if(!(er&&!er(Nt))){var Pr=Nt.append(pt,At);if(Ra[rr]){var Hr=Ra[rr];Jn(Nt)?(Vt=pt.link(Pr,{stable:!0}),At(pt.cond(Vt).then(nr,".enable(",Hr,");").else(nr,".disable(",Hr,");")),At(cr,".",rr,"=",Vt,";")):(At(pt.cond(Pr).then(nr,".enable(",Hr,");").else(nr,".disable(",Hr,");")),At(cr,".",rr,"=",Pr,";"))}else if(wa(Pr)){var fa=ar[rr];At(nr,".",Un[rr],"(",Pr,");",Pr.map(function(ln,Oa){return fa+"["+Oa+"]="+ln}).join(";"),";")}else Jn(Nt)?(Vt=pt.link(Pr,{stable:!0}),At(nr,".",Un[rr],"(",Vt,");",cr,".",rr,"=",Vt,";")):At(nr,".",Un[rr],"(",Pr,");",cr,".",rr,"=",Pr,";")}})}function al(pt,At){on&&(pt.instancing=At.def(pt.shared.extensions,".angle_instanced_arrays"))}function go(pt,At,Dt,er,lr){var ar=pt.shared,cr=pt.stats,nr=ar.current,Vt=ar.timer,rr=Dt.profile;function Nt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Pr,Hr;function fa(en){Pr=At.def(),en(Pr,"=",Nt(),";"),typeof lr=="string"?en(cr,".count+=",lr,";"):en(cr,".count++;"),_n&&(er?(Hr=At.def(),en(Hr,"=",Vt,".getNumPendingQueries();")):en(Vt,".beginQuery(",cr,");"))}function ln(en){en(cr,".cpuTime+=",Nt(),"-",Pr,";"),_n&&(er?en(Vt,".pushScopeStats(",Hr,",",Vt,".getNumPendingQueries(),",cr,");"):en(Vt,".endQuery();"))}function Oa(en){var hn=At.def(nr,".profile");At(nr,".profile=",en,";"),At.exit(nr,".profile=",hn,";")}var Ya;if(rr){if(Jn(rr)){rr.enable?(fa(At),ln(At.exit),Oa("true")):Oa("false");return}Ya=rr.append(pt,At),Oa(Ya)}else Ya=At.def(nr,".profile");var Bn=pt.block();fa(Bn),At("if(",Ya,"){",Bn,"}");var En=pt.block();ln(En),At.exit("if(",Ya,"){",En,"}")}function de(pt,At,Dt,er,lr){var ar=pt.shared;function cr(Vt){switch(Vt){case Vo:case Os:case il:return 2;case co:case Ls:case Sl:return 3;case Lo:case Do:case eu:return 4;default:return 1}}function nr(Vt,rr,Nt){var Pr=ar.gl,Hr=At.def(Vt,".location"),fa=At.def(ar.attributes,"[",Hr,"]"),ln=Nt.state,Oa=Nt.buffer,Ya=[Nt.x,Nt.y,Nt.z,Nt.w],Bn=["buffer","normalized","offset","stride"];function En(){At("if(!",fa,".buffer){",Pr,".enableVertexAttribArray(",Hr,");}");var hn=Nt.type,mn;if(Nt.size?mn=At.def(Nt.size,"||",rr):mn=rr,At("if(",fa,".type!==",hn,"||",fa,".size!==",mn,"||",Bn.map(function(ti){return fa+"."+ti+"!=="+Nt[ti]}).join("||"),"){",Pr,".bindBuffer(",Xr,",",Oa,".buffer);",Pr,".vertexAttribPointer(",[Hr,mn,hn,Nt.normalized,Nt.stride,Nt.offset],");",fa,".type=",hn,";",fa,".size=",mn,";",Bn.map(function(ti){return fa+"."+ti+"="+Nt[ti]+";"}).join(""),"}"),on){var Pn=Nt.divisor;At("if(",fa,".divisor!==",Pn,"){",pt.instancing,".vertexAttribDivisorANGLE(",[Hr,Pn],");",fa,".divisor=",Pn,";}")}}function en(){At("if(",fa,".buffer){",Pr,".disableVertexAttribArray(",Hr,");",fa,".buffer=null;","}if(",Oi.map(function(hn,mn){return fa+"."+hn+"!=="+Ya[mn]}).join("||"),"){",Pr,".vertexAttrib4f(",Hr,",",Ya,");",Oi.map(function(hn,mn){return fa+"."+hn+"="+Ya[mn]+";"}).join(""),"}")}ln===Bi?En():ln===Yi?en():(At("if(",ln,"===",Bi,"){"),En(),At("}else{"),en(),At("}"))}er.forEach(function(Vt){var rr=Vt.name,Nt=Dt.attributes[rr],Pr;if(Nt){if(!lr(Nt))return;Pr=Nt.append(pt,At)}else{if(!lr(yi))return;var Hr=pt.scopeAttrib(rr);Pr={},Object.keys(new _a).forEach(function(fa){Pr[fa]=At.def(Hr,".",fa)})}nr(pt.link(Vt),cr(Vt.info.type),Pr)})}function Y(pt,At,Dt,er,lr,ar){for(var cr=pt.shared,nr=cr.gl,Vt,rr=0;rr1){for(var Ao=[],ls=[],bo=0;bo>1)",Oa],");")}function Pn(){Dt(Ya,".drawArraysInstancedANGLE(",[Hr,fa,ln,Oa],");")}Nt&&Nt!=="null"?En?mn():(Dt("if(",Nt,"){"),mn(),Dt("}else{"),Pn(),Dt("}")):Pn()}function hn(){function mn(){Dt(ar+".drawElements("+[Hr,ln,Bn,fa+"<<(("+Bn+"-"+Vi+")>>1)"]+");")}function Pn(){Dt(ar+".drawArrays("+[Hr,fa,ln]+");")}Nt&&Nt!=="null"?En?mn():(Dt("if(",Nt,"){"),mn(),Dt("}else{"),Pn(),Dt("}")):Pn()}on&&(typeof Oa!="number"||Oa>=0)?typeof Oa=="string"?(Dt("if(",Oa,">0){"),en(),Dt("}else if(",Oa,"<0){"),hn(),Dt("}")):en():hn()}function te(pt,At,Dt,er,lr){var ar=Zn(),cr=ar.proc("body",lr);return on&&(ar.instancing=cr.def(ar.shared.extensions,".angle_instanced_arrays")),pt(ar,cr,Dt,er),ar.compile().body}function pe(pt,At,Dt,er){al(pt,At),Dt.useVAO?Dt.drawVAO?At(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,At),");"):At(pt.shared.vao,".setVAO(",pt.shared.vao,".targetVAO);"):(At(pt.shared.vao,".setVAO(null);"),de(pt,At,Dt,er.attributes,function(){return!0})),Y(pt,At,Dt,er.uniforms,function(){return!0},!1),me(pt,At,At,Dt)}function Ve(pt,At){var Dt=pt.proc("draw",1);al(pt,Dt),ps(pt,Dt,At.context),qs(pt,Dt,At.framebuffer),Ys(pt,Dt,At),Ri(pt,Dt,At.state),go(pt,Dt,At,!1,!0);var er=At.shader.progVar.append(pt,Dt);if(Dt(pt.shared.gl,".useProgram(",er,".program);"),At.shader.program)pe(pt,Dt,At,At.shader.program);else{Dt(pt.shared.vao,".setVAO(null);");var lr=pt.global.def("{}"),ar=Dt.def(er,".id"),cr=Dt.def(lr,"[",ar,"]");Dt(pt.cond(cr).then(cr,".call(this,a0);").else(cr,"=",lr,"[",ar,"]=",pt.link(function(nr){return te(pe,pt,At,nr,1)}),"(",er,");",cr,".call(this,a0);"))}Object.keys(At.state).length>0&&Dt(pt.shared.current,".dirty=true;"),pt.shared.vao&&Dt(pt.shared.vao,".setVAO(null);")}function ke(pt,At,Dt,er){pt.batchId="a1",al(pt,At);function lr(){return!0}de(pt,At,Dt,er.attributes,lr),Y(pt,At,Dt,er.uniforms,lr,!1),me(pt,At,At,Dt)}function Ye(pt,At,Dt,er){al(pt,At);var lr=Dt.contextDep,ar=At.def(),cr="a0",nr="a1",Vt=At.def();pt.shared.props=Vt,pt.batchId=ar;var rr=pt.scope(),Nt=pt.scope();At(rr.entry,"for(",ar,"=0;",ar,"<",nr,";++",ar,"){",Vt,"=",cr,"[",ar,"];",Nt,"}",rr.exit);function Pr(Bn){return Bn.contextDep&&lr||Bn.propDep}function Hr(Bn){return!Pr(Bn)}if(Dt.needsContext&&ps(pt,Nt,Dt.context),Dt.needsFramebuffer&&qs(pt,Nt,Dt.framebuffer),Ri(pt,Nt,Dt.state,Pr),Dt.profile&&Pr(Dt.profile)&&go(pt,Nt,Dt,!1,!0),er)Dt.useVAO?Dt.drawVAO?Pr(Dt.drawVAO)?Nt(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,Nt),");"):rr(pt.shared.vao,".setVAO(",Dt.drawVAO.append(pt,rr),");"):rr(pt.shared.vao,".setVAO(",pt.shared.vao,".targetVAO);"):(rr(pt.shared.vao,".setVAO(null);"),de(pt,rr,Dt,er.attributes,Hr),de(pt,Nt,Dt,er.attributes,Pr)),Y(pt,rr,Dt,er.uniforms,Hr,!1),Y(pt,Nt,Dt,er.uniforms,Pr,!0),me(pt,rr,Nt,Dt);else{var fa=pt.global.def("{}"),ln=Dt.shader.progVar.append(pt,Nt),Oa=Nt.def(ln,".id"),Ya=Nt.def(fa,"[",Oa,"]");Nt(pt.shared.gl,".useProgram(",ln,".program);","if(!",Ya,"){",Ya,"=",fa,"[",Oa,"]=",pt.link(function(Bn){return te(ke,pt,Dt,Bn,2)}),"(",ln,");}",Ya,".call(this,a0[",ar,"],",ar,");")}}function vt(pt,At){var Dt=pt.proc("batch",2);pt.batchId="0",al(pt,Dt);var er=!1,lr=!0;Object.keys(At.context).forEach(function(fa){er=er||At.context[fa].propDep}),er||(ps(pt,Dt,At.context),lr=!1);var ar=At.framebuffer,cr=!1;ar?(ar.propDep?er=cr=!0:ar.contextDep&&er&&(cr=!0),cr||qs(pt,Dt,ar)):qs(pt,Dt,null),At.state.viewport&&At.state.viewport.propDep&&(er=!0);function nr(fa){return fa.contextDep&&er||fa.propDep}Ys(pt,Dt,At),Ri(pt,Dt,At.state,function(fa){return!nr(fa)}),(!At.profile||!nr(At.profile))&&go(pt,Dt,At,!1,"a1"),At.contextDep=er,At.needsContext=lr,At.needsFramebuffer=cr;var Vt=At.shader.progVar;if(Vt.contextDep&&er||Vt.propDep)Ye(pt,Dt,At,null);else{var rr=Vt.append(pt,Dt);if(Dt(pt.shared.gl,".useProgram(",rr,".program);"),At.shader.program)Ye(pt,Dt,At,At.shader.program);else{Dt(pt.shared.vao,".setVAO(null);");var Nt=pt.global.def("{}"),Pr=Dt.def(rr,".id"),Hr=Dt.def(Nt,"[",Pr,"]");Dt(pt.cond(Hr).then(Hr,".call(this,a0,a1);").else(Hr,"=",Nt,"[",Pr,"]=",pt.link(function(fa){return te(Ye,pt,At,fa,2)}),"(",rr,");",Hr,".call(this,a0,a1);"))}}Object.keys(At.state).length>0&&Dt(pt.shared.current,".dirty=true;"),pt.shared.vao&&Dt(pt.shared.vao,".setVAO(null);")}function Ot(pt,At){var Dt=pt.proc("scope",3);pt.batchId="a2";var er=pt.shared,lr=er.current;if(ps(pt,Dt,At.context),At.framebuffer&&At.framebuffer.append(pt,Dt),Ja(Object.keys(At.state)).forEach(function(nr){var Vt=At.state[nr],rr=Vt.append(pt,Dt);wa(rr)?rr.forEach(function(Nt,Pr){On(Nt)?Dt.set(pt.next[nr],"["+Pr+"]",Nt):Dt.set(pt.next[nr],"["+Pr+"]",pt.link(Nt,{stable:!0}))}):Jn(Vt)?Dt.set(er.next,"."+nr,pt.link(rr,{stable:!0})):Dt.set(er.next,"."+nr,rr)}),go(pt,Dt,At,!0,!0),[Zt,Gr,yr,ta,gr].forEach(function(nr){var Vt=At.draw[nr];if(Vt){var rr=Vt.append(pt,Dt);On(rr)?Dt.set(er.draw,"."+nr,rr):Dt.set(er.draw,"."+nr,pt.link(rr),{stable:!0})}}),Object.keys(At.uniforms).forEach(function(nr){var Vt=At.uniforms[nr].append(pt,Dt);Array.isArray(Vt)&&(Vt="["+Vt.map(function(rr){return On(rr)?rr:pt.link(rr,{stable:!0})})+"]"),Dt.set(er.uniforms,"["+pt.link(qt.id(nr),{stable:!0})+"]",Vt)}),Object.keys(At.attributes).forEach(function(nr){var Vt=At.attributes[nr].append(pt,Dt),rr=pt.scopeAttrib(nr);Object.keys(new _a).forEach(function(Nt){Dt.set(rr,"."+Nt,Vt[Nt])})}),At.scopeVAO){var ar=At.scopeVAO.append(pt,Dt);On(ar)?Dt.set(er.vao,".targetVAO",ar):Dt.set(er.vao,".targetVAO",pt.link(ar,{stable:!0}))}function cr(nr){var Vt=At.shader[nr];if(Vt){var rr=Vt.append(pt,Dt);On(rr)?Dt.set(er.shader,"."+nr,rr):Dt.set(er.shader,"."+nr,pt.link(rr,{stable:!0}))}}cr(bt),cr(zt),Object.keys(At.state).length>0&&(Dt(lr,".dirty=true;"),Dt.exit(lr,".dirty=true;")),Dt("a1(",pt.shared.context,",a0,",pt.batchId,");")}function dr(pt){if(!(typeof pt!="object"||wa(pt))){for(var At=Object.keys(pt),Dt=0;Dt=0;--te){var pe=oi[te];pe&&pe(Ia,null,0)}sr.flush(),$a&&$a.update()}function Ii(){!gi&&oi.length>0&&(gi=c.next(wi))}function cs(){gi&&(c.cancel(wi),gi=null)}function Zs(te){te.preventDefault(),da=!0,cs(),bi.forEach(function(pe){pe()})}function Ji(te){sr.getError(),da=!1,ca.restore(),ai.restore(),on.restore(),Ba.restore(),Ra.restore(),Un.restore(),Cn.restore(),$a&&$a.restore(),An.procs.refresh(),Ii(),Tn.forEach(function(pe){pe()})}On&&(On.addEventListener(Wo,Zs,!1),On.addEventListener(Yo,Ji,!1));function yl(){oi.length=0,cs(),On&&(On.removeEventListener(Wo,Zs),On.removeEventListener(Yo,Ji)),ai.clear(),Un.clear(),Ra.clear(),Cn.clear(),Ba.clear(),Fa.clear(),on.clear(),$a&&$a.clear(),Zn.forEach(function(te){te()})}function Xo(te){function pe(ar){var cr=d({},ar);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function nr(Vt){if(Vt in cr){var rr=cr[Vt];delete cr[Vt],Object.keys(rr).forEach(function(Nt){cr[Vt+"."+Nt]=rr[Nt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in ar&&(cr.vao=ar.vao),cr}function Ve(ar,cr){var nr={},Vt={};return Object.keys(ar).forEach(function(rr){var Nt=ar[rr];if(h.isDynamic(Nt)){Vt[rr]=h.unbox(Nt,rr);return}else if(cr&&Array.isArray(Nt)){for(var Pr=0;Pr0)return pt.call(this,er(ar|0),ar|0)}else if(Array.isArray(ar)){if(ar.length)return pt.call(this,ar,ar.length)}else return ur.call(this,ar)}return d(lr,{stats:dr,destroy:function(){Dr.destroy()}})}var Qs=Un.setFBO=Xo({framebuffer:h.define.call(null,$s,"framebuffer")});function rl(te,pe){var Ve=0;An.procs.poll();var ke=pe.color;ke&&(sr.clearColor(+ke[0]||0,+ke[1]||0,+ke[2]||0,+ke[3]||0),Ve|=Is),"depth"in pe&&(sr.clearDepth(+pe.depth),Ve|=Xs),"stencil"in pe&&(sr.clearStencil(pe.stencil|0),Ve|=si),sr.clear(Ve)}function Ml(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var pe=0;pe<6;++pe)Qs(d({framebuffer:te.framebuffer.faces[pe]},te),rl);else Qs(te,rl);else rl(null,te)}function ps(te){oi.push(te);function pe(){var Ve=ol(oi,te);function ke(){var Ye=ol(oi,ke);oi[Ye]=oi[oi.length-1],oi.length-=1,oi.length<=0&&cs()}oi[Ve]=ke}return Ii(),{cancel:pe}}function qs(){var te=vn.viewport,pe=vn.scissor_box;te[0]=te[1]=pe[0]=pe[1]=0,Ia.viewportWidth=Ia.framebufferWidth=Ia.drawingBufferWidth=te[2]=pe[2]=sr.drawingBufferWidth,Ia.viewportHeight=Ia.framebufferHeight=Ia.drawingBufferHeight=te[3]=pe[3]=sr.drawingBufferHeight}function Ys(){Ia.tick+=1,Ia.time=al(),qs(),An.procs.poll()}function Ri(){Ba.refresh(),qs(),An.procs.refresh(),$a&&$a.update()}function al(){return(m()-ui)/1e3}Ri();function go(te,pe){var Ve;switch(te){case"frame":return ps(pe);case"lost":Ve=bi;break;case"restore":Ve=Tn;break;case"destroy":Ve=Zn;break;default:}return Ve.push(pe),{cancel:function(){for(var ke=0;ke=0},read:pn,destroy:yl,_gl:sr,_refresh:Ri,poll:function(){Ys(),$a&&$a.update()},now:al,stats:Va,getCachedCode:de,preloadCachedCode:Y});return qt.onDone(null,me),me}return Bu})}}),j_=We({"src/lib/prepare_regl.js"(Z,V){"use strict";var d=b3(),x=_8();V.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),fT=We({"src/traces/scattergl/plot.js"(h,V){"use strict";var d=q3(),x=tT(),A=r8(),E=y8(),e=aa(),t=lv().selectMode,r=j_(),o=au(),a=zb(),i=U3().styleTextSelection,n={};function s(c,m,p,T){var l=c._size,_=c.width*T,w=c.height*T,S=l.l*T,M=l.b*T,y=l.r*T,b=l.t*T,v=l.w*T,u=l.h*T;return[S+m.domain[0]*v,M+p.domain[0]*u,_-y-(1-m.domain[1])*v,w-b-(1-p.domain[1])*u]}var h=V.exports=function(m,p,T){if(T.length){var l=m._fullLayout,_=p._scene,w=p.xaxis,S=p.yaxis,M,y;if(_){var b=r(m,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!b){_.init();return}var v=_.count,u=l._glcanvas.data()[0].regl;if(a(m,p,T),_.dirty){if((_.line2d||_.error2d)&&!(_.scatter2d||_.fill2d||_.glText)&&u.clear({color:!0,depth:!0}),_.error2d===!0&&(_.error2d=A(u)),_.line2d===!0&&(_.line2d=x(u)),_.scatter2d===!0&&(_.scatter2d=d(u)),_.fill2d===!0&&(_.fill2d=x(u)),_.glText===!0)for(_.glText=new Array(v),M=0;M_.glText.length){var g=v-_.glText.length;for(M=0;Mre&&(isNaN(ee[ue])||isNaN(ee[ue+1]));)ue-=2;j.positions=ee.slice(re,ue+2)}return j}),_.line2d.update(_.lineOptions)),_.error2d){var L=(_.errorXOptions||[]).concat(_.errorYOptions||[]);_.error2d.update(L)}_.scatter2d&&_.scatter2d.update(_.markerOptions),_.fillOrder=e.repeat(null,v),_.fill2d&&(_.fillOptions=_.fillOptions.map(function(j,ee){var re=T[ee];if(!(!j||!re||!re[0]||!re[0].trace)){var ue=re[0],_e=ue.trace,Te=ue.t,Ie=_.lineOptions[ee],De,He,et=[];_e._ownfill&&et.push(ee),_e._nexttrace&&et.push(ee+1),et.length&&(_.fillOrder[ee]=et);var rt=[],$e=Ie&&Ie.positions||Te.positions,ot,Ae;if(_e.fill==="tozeroy"){for(ot=0;ot<$e.length&&isNaN($e[ot+1]);)ot+=2;for(Ae=$e.length-2;Ae>ot&&isNaN($e[Ae+1]);)Ae-=2;$e[ot+1]!==0&&(rt=[$e[ot],0]),rt=rt.concat($e.slice(ot,Ae+2)),$e[Ae+1]!==0&&(rt=rt.concat([$e[Ae],0]))}else if(_e.fill==="tozerox"){for(ot=0;ot<$e.length&&isNaN($e[ot]);)ot+=2;for(Ae=$e.length-2;Ae>ot&&isNaN($e[Ae]);)Ae-=2;$e[ot]!==0&&(rt=[0,$e[ot+1]]),rt=rt.concat($e.slice(ot,Ae+2)),$e[Ae]!==0&&(rt=rt.concat([0,$e[Ae+1]]))}else if(_e.fill==="toself"||_e.fill==="tonext"){for(rt=[],De=0,j.splitNull=!0,He=0;He<$e.length;He+=2)(isNaN($e[He])||isNaN($e[He+1]))&&(rt=rt.concat($e.slice(De,He)),rt.push($e[De],$e[De+1]),rt.push(null,null),De=He+2);rt=rt.concat($e.slice(De)),De&&rt.push($e[De],$e[De+1])}else{var ge=_e._nexttrace;if(ge){var ce=_.lineOptions[ee+1];if(ce){var ze=ce.positions;if(_e.fill==="tonexty"){for(rt=$e.slice(),ee=Math.floor(ze.length/2);ee--;){var Qe=ze[ee*2],nt=ze[ee*2+1];isNaN(Qe)||isNaN(nt)||rt.push(Qe,nt)}j.fill=ge.fillcolor}}}}if(_e._prevtrace&&_e._prevtrace.fill==="tonext"){var Ke=_.lineOptions[ee-1].positions,kt=rt.length/2;De=kt;var Et=[De];for(He=0;He-1;for(M=0;Mw&&p||_i,f;for(g?f=p.sizeAvg||Math.max(p.size,3):f=A(h,m),S=0;S<_.length;S++)w=_[S],M=c[w],y=x.getFromId(s,h._diag[w][0])||{},b=x.getFromId(s,h._diag[w][1])||{},E(s,h,y,b,T[S],T[S],f);var P=o(s,h);return P.matrix||(P.matrix=!0),P.matrixOptions=p,P.selectedOptions=t(s,h,h.selected),P.unselectedOptions=t(s,h,h.unselected),[{x:!1,y:!1,t:{},trace:h}]}}}),S8=We({"node_modules/performance-now/lib/performance-now.js"(Z,V){(function(){var d,x,A,E,e,t;typeof performance<"u"&&performance!==null&&performance.now?V.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(V.exports=function(){return(d()-e)/1e6},x=process.hrtime,d=function(){var r;return r=x(),r[0]*1e9+r[1]},E=d(),t=process.uptime()*1e9,e=E-t):Date.now?(V.exports=function(){return Date.now()-A},A=Date.now()):(V.exports=function(){return new Date().getTime()-A},A=new Date().getTime())}).call(Z)}}),M8=We({"node_modules/raf/index.js"(Z,V){var d=S8(),x=window,A=["moz","webkit"],E="AnimationFrame",e=x["request"+E],t=x["cancel"+E]||x["cancelRequest"+E];for(r=0;!e&&r{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let m=0;mf||!p.lower&&g{h[T+_]=m})}this.scatter.draw(...h)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,h,c){let m=s.id!=null?s.id:s,p=h,T=c;return m<<16|(p&255)<<8|T&255}function i(s,h,c){let m,p,T,l,_,w,S,M,y=s[h],b=s[c];return y.length>2?(m=y[0],T=y[2],p=y[1],l=y[3]):y.length?(m=p=y[0],T=l=y[1]):(m=y.x,p=y.y,T=y.x+y.width,l=y.y+y.height),b.length>2?(_=b[0],S=b[2],w=b[1],M=b[3]):b.length?(_=w=b[0],S=M=b[1]):(_=b.x,w=b.y,S=b.x+b.width,M=b.y+b.height),[_,p,S,l]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let h=t(s);return[h.x,h.y,h.x+h.width,h.y+h.height]}}}}),C8=We({"src/traces/splom/plot.js"(Z,V){"use strict";var d=k8(),x=aa(),A=cc(),E=lv().selectMode;V.exports=function(r,o,a){if(a.length)for(var i=0;i-1,B=E(p)||!!i.selectedpoints||F,O=!0;if(B){var I=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var N=i.selectedpoints,U={};for(_=0;_=W[Q][0]&&U<=W[Q][1])return!0;return!1}function h(U){U.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function c(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var W=p(U.brush.filter.getConsolidated(),U.height),Q=[0],le,se,he,q=W.length?W[0][0]:null,$=0;$U[1]+Q||W=.9*U[1]+.1*U[0]?"n":W<=.9*U[0]+.1*U[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function _(U){U.attr("stroke-dasharray",m)}function w(U,W){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),le=W?Q.transition().duration(d.bar.snapDuration).each("end",W):Q;_(le)}function S(U,W){var Q=U.brush,le=Q.filterSpecified,se=NaN,he={},q;if(le){var $=U.height,J=Q.filter.getConsolidated(),X=p(J,$),oe=NaN,ne=NaN,j=NaN;for(q=0;q<=X.length;q++){var ee=X[q];if(ee&&ee[0]<=W&&W<=ee[1]){oe=q;break}else if(ne=q?q-1:NaN,ee&&ee[0]>W){j=q;break}}if(se=oe,isNaN(se)&&(isNaN(ne)||isNaN(j)?se=isNaN(ne)?j:ne:se=W-X[ne][1]=Ie[0]&&Te<=Ie[1]){he.clickableOrdinalRange=Ie;break}}}return he}function M(U,W){x.event.sourceEvent.stopPropagation();var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,le=W.unitToPaddedPx.invert(Q),se=W.brush,he=S(W,Q),q=he.interval,$=se.svgBrush;if($.wasDragged=!1,$.grabbingBar=he.region==="ns",$.grabbingBar){var J=q.map(W.unitToPaddedPx);$.grabPoint=Q-J[0]-d.verticalPadding,$.barLength=J[1]-J[0]}$.clickableOrdinalRange=he.clickableOrdinalRange,$.stayingIntervals=W.multiselect&&se.filterSpecified?se.filter.getConsolidated():[],q&&($.stayingIntervals=$.stayingIntervals.filter(function(X){return X[0]!==q[0]&&X[1]!==q[1]})),$.startExtent=he.region?q[he.region==="s"?1:0]:le,W.parent.inBrushDrag=!0,$.brushStartCallback()}function y(U,W){x.event.sourceEvent.stopPropagation();var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,le=W.brush.svgBrush;le.wasDragged=!0,le._dragging=!0,le.grabbingBar?le.newExtent=[Q-le.grabPoint,Q+le.barLength-le.grabPoint].map(W.unitToPaddedPx.invert):le.newExtent=[le.startExtent,W.unitToPaddedPx.invert(Q)].sort(e),W.brush.filterSpecified=!0,le.extent=le.stayingIntervals.concat([le.newExtent]),le.brushCallback(W),w(U.parentNode)}function b(U,W){var Q=W.brush,le=Q.filter,se=Q.svgBrush;se._dragging||(v(U,W),y(U,W),W.brush.svgBrush.wasDragged=!1),se._dragging=!1;var he=x.event;he.sourceEvent.stopPropagation();var q=se.grabbingBar;if(se.grabbingBar=!1,se.grabLocation=void 0,W.parent.inBrushDrag=!1,l(),!se.wasDragged){se.wasDragged=void 0,se.clickableOrdinalRange?Q.filterSpecified&&W.multiselect?se.extent.push(se.clickableOrdinalRange):(se.extent=[se.clickableOrdinalRange],Q.filterSpecified=!0):q?(se.extent=se.stayingIntervals,se.extent.length===0&&z(Q)):z(Q),se.brushCallback(W),w(U.parentNode),se.brushEndCallback(Q.filterSpecified?le.getConsolidated():[]);return}var $=function(){le.set(le.getConsolidated())};if(W.ordinal){var J=W.unitTickvals;J[J.length-1]se.newExtent[0];se.extent=se.stayingIntervals.concat(X?[se.newExtent]:[]),se.extent.length||z(Q),se.brushCallback(W),X?w(U.parentNode,$):($(),w(U.parentNode))}else $();se.brushEndCallback(Q.filterSpecified?le.getConsolidated():[])}function v(U,W){var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,le=S(W,Q),se="crosshair";le.clickableOrdinalRange?se="pointer":le.region&&(se=le.region+"-resize"),x.select(document.body).style("cursor",se)}function u(U){U.on("mousemove",function(W){x.event.preventDefault(),W.parent.inBrushDrag||v(this,W)}).on("mouseleave",function(W){W.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(W){M(this,W)}).on("drag",function(W){y(this,W)}).on("dragend",function(W){b(this,W)}))}function g(U,W){return U[0]-W[0]}function f(U,W,Q){var le=Q._context.staticPlot,se=U.selectAll(".background").data(E);se.enter().append("rect").classed("background",!0).call(h).call(c).style("pointer-events",le?"none":"auto").attr("transform",t(0,d.verticalPadding)),se.call(u).attr("height",function($){return $.height-d.verticalPadding});var he=U.selectAll(".highlight-shadow").data(E);he.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",W).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),he.attr("y1",function($){return $.height}).call(_);var q=U.selectAll(".highlight").data(E);q.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),q.attr("y1",function($){return $.height}).call(_)}function P(U,W,Q){var le=U.selectAll("."+d.cn.axisBrush).data(E,A);le.enter().append("g").classed(d.cn.axisBrush,!0),f(le,W,Q)}function L(U){return U.svgBrush.extent.map(function(W){return W.slice()})}function z(U){U.filterSpecified=!1,U.svgBrush.extent=[[-1/0,1/0]]}function F(U){return function(Q){var le=Q.brush,se=L(le),he=se.slice();le.filter.set(he),U()}}function B(U){for(var W=U.slice(),Q=[],le,se=W.shift();se;){for(le=se.slice();(se=W.shift())&&se[0]<=le[1];)le[1]=Math.max(le[1],se[1]);Q.push(le)}return Q.length===1&&Q[0][0]>Q[0][1]&&(Q=[]),Q}function O(){var U=[],W,Q;return{set:function(le){U=le.map(function(se){return se.slice().sort(e)}).sort(g),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),W=B(U),Q=U.reduce(function(se,he){return[Math.min(se[0],he[0]),Math.max(se[1],he[1])]},[1/0,-1/0])},get:function(){return U.slice()},getConsolidated:function(){return W},getBounds:function(){return Q}}}function I(U,W,Q,le,se,he){var q=O();return q.set(Q),{filter:q,filterSpecified:W,svgBrush:{extent:[],brushStartCallback:le,brushCallback:F(se),brushEndCallback:he}}}function N(U,W){if(Array.isArray(U[0])?(U=U.map(function(le){return le.sort(e)}),W.multiselect?U=B(U.sort(g)):U=[U[0]]):U=[U.sort(e)],W.tickvals){var Q=W.tickvals.slice().sort(e);if(U=U.map(function(le){var se=[n(0,Q,le[0],[]),n(1,Q,le[1],[])];if(se[1]>se[0])return se}).filter(function(le){return le}),!U.length)return}return U.length>1?U:U[0]}V.exports={makeBrush:I,ensureAxisBrush:P,cleanRanges:N}}}),O8=We({"src/traces/parcoords/defaults.js"(Z,V){"use strict";var d=aa(),x=ah().hasColorscale,A=yf(),E=Uu().defaults,e=Zf(),t=Mo(),r=dT(),o=pT(),a=Ig().maxDimensionCount,i=V_();function n(h,c,m,p,T){var l=T("line.color",m);if(x(h,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(h,c,p,T,{prefix:"line.",cLetter:"c"}),l.length;c.line.color=m}return 1/0}function s(h,c,m,p){function T(M,y){return d.coerce(h,c,r.dimensions,M,y)}var l=T("values"),_=T("visible");if(l&&l.length||(_=c.visible=!1),_){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var w=T("range");c._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},t.setConvert(c._ax,p.layout),T("multiselect");var S=T("constraintrange");S&&(c.constraintrange=o.cleanRanges(S,c))}}V.exports=function(c,m,p,T){function l(y,b){return d.coerce(c,m,r,y,b)}var _=c.dimensions;Array.isArray(_)&&_.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),_.splice(a));var w=e(c,m,{name:"dimensions",layout:T,handleItemDefaults:s}),S=n(c,m,p,T,l);E(m,T,l),(!Array.isArray(w)||!w.length)&&(m.visible=!1),i(m,w,"values",S);var M=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",M),d.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),B8=We({"src/traces/parcoords/calc.js"(Z,V){"use strict";var d=aa().isArrayOrTypedArray,x=xu(),A=Iv().wrap;V.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:o,cscale:a})};function E(e){for(var t=new Array(e),r=0;r>>16,(Z&65280)>>>8,Z&255],alpha:1};if(typeof Z=="number")return{space:"rgb",values:[Z>>>16,(Z&65280)>>>8,Z&255],alpha:1};if(Z=String(Z).toLowerCase(),q_.default[Z])A=q_.default[Z].slice(),e="rgb";else if(Z==="transparent")E=0,e="rgb",A=[0,0,0];else if(Z[0]==="#"){var t=Z.slice(1),r=t.length,o=r<=4;E=1,o?(A=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(A=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),A[0]||(A[0]=0),A[1]||(A[1]=0),A[2]||(A[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Z)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(G_[n]!==void 0)return G_[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),E=A.length>i?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Z)&&(A=Z.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(V=Z.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:A,alpha:E}}var q_,mT,G_,U8=Bl({"node_modules/color-parse/index.js"(){q_=Y5(y3(),1),mT=N8,G_={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Rg,gT=Bl({"node_modules/color-space/rgb.js"(){Rg={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Dg,j8=Bl({"node_modules/color-space/hsl.js"(){gT(),Dg={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Z){var V=Z[0]/360,d=Z[1]/100,x=Z[2]/100,A,E,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(E=x<.5?x*(1+d):x+d-x*d,A=2*x-E,t=[0,0,0];o<3;)e=V+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?A+(E-A)*6*e:2*e<1?E:3*e<2?A+(E-A)*(2/3-e)*6:A,t[o++]=r*255;return t}},Rg.hsl=function(Z){var V=Z[0]/255,d=Z[1]/255,x=Z[2]/255,A=Math.min(V,d,x),E=Math.max(V,d,x),e=E-A,t,r,o;return E===A?t=0:V===E?t=(d-x)/e:d===E?t=2+(x-V)/e:x===E&&(t=4+(V-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(A+E)/2,E===A?r=0:o<=.5?r=e/(E+A):r=e/(2-E-A),[t,r*100,o*100]}}}),yT={};Hx(yT,{default:()=>V8});function V8(Z){Array.isArray(Z)&&Z.raw&&(Z=String.raw(...arguments)),Z instanceof Number&&(Z=+Z);var V,d,x,A=mT(Z);if(!A.space)return[];let E=A.space[0]==="h"?Dg.min:Rg.min,e=A.space[0]==="h"?Dg.max:Rg.max;return V=Array(3),V[0]=Math.min(Math.max(A.values[0],E[0]),e[0]),V[1]=Math.min(Math.max(A.values[1],E[1]),e[1]),V[2]=Math.min(Math.max(A.values[2],E[2]),e[2]),A.space[0]==="h"&&(V=Dg.rgb(V)),V.push(Math.min(Math.max(A.alpha,0),1)),V}var q8=Bl({"node_modules/color-rgba/index.js"(){U8(),gT(),j8()}}),_T=We({"src/traces/parcoords/helpers.js"(Z){"use strict";var V=aa().isTypedArray;Z.convertTypedArray=function(d){return V(d)?Array.prototype.slice.call(d):d},Z.isOrdinal=function(d){return!!d.tickvals},Z.isVisible=function(d){return d.visible||!("visible"in d)}}}),G8=We({"src/traces/parcoords/lines.js"(Z,V){"use strict";var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),_a;if(Gt&&(_a=Zu(Zr),Gt[_a]))return Gt[_a].apply(null,pa);var Ha=Function.apply(null,ea.concat(Zr));return Gt&&(Gt[_a]=Ha),Ha.apply(null,pa)}return{global:Ja,link:fa,block:ja,proc:Mn,scope:hn,cond:un,compile:yn}}var Ni="xyzw".split(""),Wi=5121,Ui=1,Ji=2,hi=0,Qn=1,ao=2,Po=3,is=4,Rs=5,_s=6,Ps="dither",ts="blend.enable",ul="blend.color",Ys="blend.equation",Ns="blend.func",ki="depth.enable",go="depth.func",Cs="depth.range",ds="depth.mask",zl="colorMask",tu="cull.enable",mu="cull.face",Ju="frontFace",Wl="lineWidth",$u="polygonOffset.enable",Zl="polygonOffset.offset",Bu="sample.alpha",$i="sample.enable",_o="sample.coverage",Qu="stencil.enable",ku="stencil.mask",gu="stencil.func",De="stencil.opFront",I="stencil.opBack",ne="scissor.enable",be="scissor.box",Ae="viewport",Re="profile",ut="framebuffer",_t="vert",Rt="frag",Zt="elements",yr="primitive",_r="count",Gr="offset",Qr="instances",je="vao",Ye="Width",at="Height",ct=ut+Ye,At=ut+at,yt=Ae+Ye,Ct=Ae+at,nr="drawingBuffer",vr=nr+Ye,Tr=nr+at,Fr=[Ns,Ys,gu,De,I,_o,Ae,be,Zl],Xr=34962,oa=34963,ga=2884,Ma=3042,en=3024,Dn=2960,In=2929,Kn=3089,vi=32823,zi=32926,Mi=32928,so=5126,jo=35664,uo=35665,Co=35666,Xo=5124,Us=35667,Is=35668,Io=35669,Ro=35670,ol=35671,Ml=35672,ru=35673,jl=35674,Qs=35675,Fl=35676,Cu=35678,pl=35680,ml=4,pe=1028,Ie=1029,Je=2304,ft=2305,pt=32775,xt=32776,Jt=519,Pt=7680,dr=0,Nr=1,Vr=32774,va=513,sa=36160,qa=36064,Wa={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ya={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ea={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Na={cw:Je,ccw:ft};function tn(tt){return Array.isArray(tt)||wr(tt)||Er(tt)}function Ka(tt){return tt.sort(function(Gt,or){return Gt===Ae?-1:or===Ae?1:Gt=1,ea>=2,Gt)}else if(or===is){var pa=tt.data;return new wa(pa.thisDep,pa.contextDep,pa.propDep,Gt)}else{if(or===Rs)return new wa(!1,!1,!1,Gt);if(or===_s){for(var la=!1,fa=!1,ja=!1,hn=0;hn=1&&(fa=!0),Ja>=2&&(ja=!0)}else un.type===is&&(la=la||un.data.thisDep,fa=fa||un.data.contextDep,ja=ja||un.data.propDep)}return new wa(la,fa,ja,Gt)}else return new wa(or===Po,or===ao,or===Qn,Gt)}}var xi=new wa(!1,!1,!1,function(){});function Fi(tt,Gt,or,ea,pa,la,fa,ja,hn,un,Ja,si,Mn,yn,Pa,Zr){var _a=un.Record,Ha={add:32774,subtract:32778,"reverse subtract":32779};or.ext_blend_minmax&&(Ha.min=pt,Ha.max=xt);var nn=or.angle_instanced_arrays,za=or.webgl_draw_buffers,Cn=or.oes_vertex_array_object,bn={dirty:!0,profile:Zr.profile},ri={},Oa=[],Ia={},Un={};function An(vt){return vt.replace(".","_")}function dn(vt,wt,It){var $t=An(vt);Oa.push(vt),ri[$t]=bn[$t]=!!It,Ia[$t]=wt}function fn(vt,wt,It){var $t=An(vt);Oa.push(vt),Array.isArray(It)?(bn[$t]=It.slice(),ri[$t]=It.slice()):bn[$t]=ri[$t]=It,Un[$t]=wt}function Bn(vt){return!!isNaN(vt)}dn(Ps,en),dn(ts,Ma),fn(ul,"blendColor",[0,0,0,0]),fn(Ys,"blendEquationSeparate",[Vr,Vr]),fn(Ns,"blendFuncSeparate",[Nr,dr,Nr,dr]),dn(ki,In,!0),fn(go,"depthFunc",va),fn(Cs,"depthRange",[0,1]),fn(ds,"depthMask",!0),fn(zl,zl,[!0,!0,!0,!0]),dn(tu,ga),fn(mu,"cullFace",Ie),fn(Ju,Ju,ft),fn(Wl,Wl,1),dn($u,vi),fn(Zl,"polygonOffset",[0,0]),dn(Bu,zi),dn($i,Mi),fn(_o,"sampleCoverage",[1,!1]),dn(Qu,Dn),fn(ku,"stencilMask",-1),fn(gu,"stencilFunc",[Jt,0,-1]),fn(De,"stencilOpSeparate",[pe,Pt,Pt,Pt]),fn(I,"stencilOpSeparate",[Ie,Pt,Pt,Pt]),dn(ne,Kn),fn(be,"scissor",[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]),fn(Ae,Ae,[0,0,tt.drawingBufferWidth,tt.drawingBufferHeight]);var ii={gl:tt,context:Mn,strings:Gt,next:ri,current:bn,draw:si,elements:la,buffer:pa,shader:Ja,attributes:un.state,vao:un,uniforms:hn,framebuffer:ja,extensions:or,timer:yn,isBufferArgs:tn},bi={primTypes:Sa,compareFuncs:ya,blendFuncs:Wa,blendEquations:Ha,stencilOps:Ea,glTypes:ma,orientationType:Na};za&&(bi.backBuffer=[Ie],bi.drawBuffer=v(ea.maxDrawbuffers,function(vt){return vt===0?[0]:v(vt,function(wt){return qa+wt})}));var Tn=0;function Yn(){var vt=di({cache:Pa}),wt=vt.link,It=vt.global;vt.id=Tn++,vt.batchId="0";var $t=wt(ii),lr=vt.shared={props:"a0"};Object.keys(ii).forEach(function(er){lr[er]=It.def($t,".",er)});var tr=vt.next={},cr=vt.current={};Object.keys(Un).forEach(function(er){Array.isArray(bn[er])&&(tr[er]=It.def(lr.next,".",er),cr[er]=It.def(lr.current,".",er))});var rr=vt.constants={};Object.keys(bi).forEach(function(er){rr[er]=It.def(JSON.stringify(bi[er]))}),vt.invoke=function(er,Nt){switch(Nt.type){case hi:var Cr=["this",lr.context,lr.props,vt.batchId];return er.def(wt(Nt.data),".call(",Cr.slice(0,Math.max(Nt.data.length+1,4)),")");case Qn:return er.def(lr.props,Nt.data);case ao:return er.def(lr.context,Nt.data);case Po:return er.def("this",Nt.data);case is:return Nt.data.append(vt,er),Nt.data.ref;case Rs:return Nt.data.toString();case _s:return Nt.data.map(function(Hr){return vt.invoke(er,Hr)})}},vt.attribCache={};var Vt={};return vt.scopeAttrib=function(er){var Nt=Gt.id(er);if(Nt in Vt)return Vt[Nt];var Cr=un.scope[Nt];Cr||(Cr=un.scope[Nt]=new _a);var Hr=Vt[Nt]=wt(Cr);return Hr},vt}function mi(vt){var wt=vt.static,It=vt.dynamic,$t;if(Re in wt){var lr=!!wt[Re];$t=Xn(function(cr,rr){return lr}),$t.enable=lr}else if(Re in It){var tr=It[Re];$t=ni(tr,function(cr,rr){return cr.invoke(rr,tr)})}return $t}function wi(vt,wt){var It=vt.static,$t=vt.dynamic;if(ut in It){var lr=It[ut];return lr?(lr=ja.getFramebuffer(lr),Xn(function(cr,rr){var Vt=cr.link(lr),er=cr.shared;rr.set(er.framebuffer,".next",Vt);var Nt=er.context;return rr.set(Nt,"."+ct,Vt+".width"),rr.set(Nt,"."+At,Vt+".height"),Vt})):Xn(function(cr,rr){var Vt=cr.shared;rr.set(Vt.framebuffer,".next","null");var er=Vt.context;return rr.set(er,"."+ct,er+"."+vr),rr.set(er,"."+At,er+"."+Tr),"null"})}else if(ut in $t){var tr=$t[ut];return ni(tr,function(cr,rr){var Vt=cr.invoke(rr,tr),er=cr.shared,Nt=er.framebuffer,Cr=rr.def(Nt,".getFramebuffer(",Vt,")");rr.set(Nt,".next",Cr);var Hr=er.context;return rr.set(Hr,"."+ct,Cr+"?"+Cr+".width:"+Hr+"."+vr),rr.set(Hr,"."+At,Cr+"?"+Cr+".height:"+Hr+"."+Tr),Cr})}else return null}function Ri(vt,wt,It){var $t=vt.static,lr=vt.dynamic;function tr(Vt){if(Vt in $t){var er=$t[Vt],Nt=!0,Cr=er.x|0,Hr=er.y|0,ca,on;return"width"in er?ca=er.width|0:Nt=!1,"height"in er?on=er.height|0:Nt=!1,new wa(!Nt&&wt&&wt.thisDep,!Nt&&wt&&wt.contextDep,!Nt&&wt&&wt.propDep,function(Nn,En){var Qa=Nn.shared.context,cn=ca;"width"in er||(cn=En.def(Qa,".",ct,"-",Cr));var mn=on;return"height"in er||(mn=En.def(Qa,".",At,"-",Hr)),[Cr,Hr,cn,mn]})}else if(Vt in lr){var Fa=lr[Vt],Za=ni(Fa,function(Nn,En){var Qa=Nn.invoke(En,Fa),cn=Nn.shared.context,mn=En.def(Qa,".x|0"),Pn=En.def(Qa,".y|0"),ei=En.def('"width" in ',Qa,"?",Qa,".width|0:","(",cn,".",ct,"-",mn,")"),no=En.def('"height" in ',Qa,"?",Qa,".height|0:","(",cn,".",At,"-",Pn,")");return[mn,Pn,ei,no]});return wt&&(Za.thisDep=Za.thisDep||wt.thisDep,Za.contextDep=Za.contextDep||wt.contextDep,Za.propDep=Za.propDep||wt.propDep),Za}else return wt?new wa(wt.thisDep,wt.contextDep,wt.propDep,function(Nn,En){var Qa=Nn.shared.context;return[0,0,En.def(Qa,".",ct),En.def(Qa,".",At)]}):null}var cr=tr(Ae);if(cr){var rr=cr;cr=new wa(cr.thisDep,cr.contextDep,cr.propDep,function(Vt,er){var Nt=rr.append(Vt,er),Cr=Vt.shared.context;return er.set(Cr,"."+yt,Nt[2]),er.set(Cr,"."+Ct,Nt[3]),Nt})}return{viewport:cr,scissor_box:tr(be)}}function ps(vt,wt){var It=vt.static,$t=typeof It[Rt]=="string"&&typeof It[_t]=="string";if($t){if(Object.keys(wt.dynamic).length>0)return null;var lr=wt.static,tr=Object.keys(lr);if(tr.length>0&&typeof lr[tr[0]]=="number"){for(var cr=[],rr=0;rr"+mn+"?"+Nt+".constant["+mn+"]:0;"}).join(""),"}}else{","if(",ca,"(",Nt,".buffer)){",Nn,"=",on,".createStream(",Xr,",",Nt,".buffer);","}else{",Nn,"=",on,".getBuffer(",Nt,".buffer);","}",En,'="type" in ',Nt,"?",Hr.glTypes,"[",Nt,".type]:",Nn,".dtype;",Fa.normalized,"=!!",Nt,".normalized;");function Qa(cn){er(Fa[cn],"=",Nt,".",cn,"|0;")}return Qa("size"),Qa("offset"),Qa("stride"),Qa("divisor"),er("}}"),er.exit("if(",Fa.isStream,"){",on,".destroyStream(",Nn,");","}"),Fa}lr[tr]=ni(cr,rr)}),lr}function al(vt){var wt=vt.static,It=vt.dynamic,$t={};return Object.keys(wt).forEach(function(lr){var tr=wt[lr];$t[lr]=Xn(function(cr,rr){return typeof tr=="number"||typeof tr=="boolean"?""+tr:cr.link(tr)})}),Object.keys(It).forEach(function(lr){var tr=It[lr];$t[lr]=ni(tr,function(cr,rr){return cr.invoke(rr,tr)})}),$t}function El(vt,wt,It,$t,lr){var tr=vt.static,cr=vt.dynamic,rr=ps(vt,wt),Vt=wi(vt,lr),er=Ri(vt,Vt,lr),Nt=Qi(vt,lr),Cr=_l(vt,lr),Hr=Js(vt,lr,rr);function ca(Qa){var cn=er[Qa];cn&&(Cr[Qa]=cn)}ca(Ae),ca(An(be));var on=Object.keys(Cr).length>0,Fa={framebuffer:Vt,draw:Nt,shader:Hr,state:Cr,dirty:on,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Fa.profile=mi(vt,lr),Fa.uniforms=Wo(It,lr),Fa.drawVAO=Fa.scopeVAO=Nt.vao,!Fa.drawVAO&&Hr.program&&!rr&&or.angle_instanced_arrays&&Nt.static.elements){var Za=!0,Nn=Hr.program.attributes.map(function(Qa){var cn=wt.static[Qa];return Za=Za&&!!cn,cn});if(Za&&Nn.length>0){var En=un.getVAO(un.createVAO({attributes:Nn,elements:Nt.static.elements}));Fa.drawVAO=new wa(null,null,null,function(Qa,cn){return Qa.link(En)}),Fa.useVAO=!0}}return rr?Fa.useVAO=!0:Fa.attributes=tl(wt,lr),Fa.context=al($t,lr),Fa}function ws(vt,wt,It){var $t=vt.shared,lr=$t.context,tr=vt.scope();Object.keys(It).forEach(function(cr){wt.save(lr,"."+cr);var rr=It[cr],Vt=rr.append(vt,wt);Array.isArray(Vt)?tr(lr,".",cr,"=[",Vt.join(),"];"):tr(lr,".",cr,"=",Vt,";")}),wt(tr)}function Hs(vt,wt,It,$t){var lr=vt.shared,tr=lr.gl,cr=lr.framebuffer,rr;za&&(rr=wt.def(lr.extensions,".webgl_draw_buffers"));var Vt=vt.constants,er=Vt.drawBuffer,Nt=Vt.backBuffer,Cr;It?Cr=It.append(vt,wt):Cr=wt.def(cr,".next"),$t||wt("if(",Cr,"!==",cr,".cur){"),wt("if(",Cr,"){",tr,".bindFramebuffer(",sa,",",Cr,".framebuffer);"),za&&wt(rr,".drawBuffersWEBGL(",er,"[",Cr,".colorAttachments.length]);"),wt("}else{",tr,".bindFramebuffer(",sa,",null);"),za&&wt(rr,".drawBuffersWEBGL(",Nt,");"),wt("}",cr,".cur=",Cr,";"),$t||wt("}")}function $s(vt,wt,It){var $t=vt.shared,lr=$t.gl,tr=vt.current,cr=vt.next,rr=$t.current,Vt=$t.next,er=vt.cond(rr,".dirty");Oa.forEach(function(Nt){var Cr=An(Nt);if(!(Cr in It.state)){var Hr,ca;if(Cr in cr){Hr=cr[Cr],ca=tr[Cr];var on=v(bn[Cr].length,function(Za){return er.def(Hr,"[",Za,"]")});er(vt.cond(on.map(function(Za,Nn){return Za+"!=="+ca+"["+Nn+"]"}).join("||")).then(lr,".",Un[Cr],"(",on,");",on.map(function(Za,Nn){return ca+"["+Nn+"]="+Za}).join(";"),";"))}else{Hr=er.def(Vt,".",Cr);var Fa=vt.cond(Hr,"!==",rr,".",Cr);er(Fa),Cr in Ia?Fa(vt.cond(Hr).then(lr,".enable(",Ia[Cr],");").else(lr,".disable(",Ia[Cr],");"),rr,".",Cr,"=",Hr,";"):Fa(lr,".",Un[Cr],"(",Hr,");",rr,".",Cr,"=",Hr,";")}}}),Object.keys(It.state).length===0&&er(rr,".dirty=false;"),wt(er)}function Di(vt,wt,It,$t){var lr=vt.shared,tr=vt.current,cr=lr.current,rr=lr.gl,Vt;Ka(Object.keys(It)).forEach(function(er){var Nt=It[er];if(!($t&&!$t(Nt))){var Cr=Nt.append(vt,wt);if(Ia[er]){var Hr=Ia[er];Jn(Nt)?(Vt=vt.link(Cr,{stable:!0}),wt(vt.cond(Vt).then(rr,".enable(",Hr,");").else(rr,".disable(",Hr,");")),wt(cr,".",er,"=",Vt,";")):(wt(vt.cond(Cr).then(rr,".enable(",Hr,");").else(rr,".disable(",Hr,");")),wt(cr,".",er,"=",Cr,";"))}else if(ua(Cr)){var ca=tr[er];wt(rr,".",Un[er],"(",Cr,");",Cr.map(function(on,Fa){return ca+"["+Fa+"]="+on}).join(";"),";")}else Jn(Nt)?(Vt=vt.link(Cr,{stable:!0}),wt(rr,".",Un[er],"(",Vt,");",cr,".",er,"=",Vt,";")):wt(rr,".",Un[er],"(",Cr,");",cr,".",er,"=",Cr,";")}})}function nl(vt,wt){nn&&(vt.instancing=wt.def(vt.shared.extensions,".angle_instanced_arrays"))}function mo(vt,wt,It,$t,lr){var tr=vt.shared,cr=vt.stats,rr=tr.current,Vt=tr.timer,er=It.profile;function Nt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Cr,Hr;function ca(Qa){Cr=wt.def(),Qa(Cr,"=",Nt(),";"),typeof lr=="string"?Qa(cr,".count+=",lr,";"):Qa(cr,".count++;"),yn&&($t?(Hr=wt.def(),Qa(Hr,"=",Vt,".getNumPendingQueries();")):Qa(Vt,".beginQuery(",cr,");"))}function on(Qa){Qa(cr,".cpuTime+=",Nt(),"-",Cr,";"),yn&&($t?Qa(Vt,".pushScopeStats(",Hr,",",Vt,".getNumPendingQueries(),",cr,");"):Qa(Vt,".endQuery();"))}function Fa(Qa){var cn=wt.def(rr,".profile");wt(rr,".profile=",Qa,";"),wt.exit(rr,".profile=",cn,";")}var Za;if(er){if(Jn(er)){er.enable?(ca(wt),on(wt.exit),Fa("true")):Fa("false");return}Za=er.append(vt,wt),Fa(Za)}else Za=wt.def(rr,".profile");var Nn=vt.block();ca(Nn),wt("if(",Za,"){",Nn,"}");var En=vt.block();on(En),wt.exit("if(",Za,"){",En,"}")}function me(vt,wt,It,$t,lr){var tr=vt.shared;function cr(Vt){switch(Vt){case jo:case Us:case ol:return 2;case uo:case Is:case Ml:return 3;case Co:case Io:case ru:return 4;default:return 1}}function rr(Vt,er,Nt){var Cr=tr.gl,Hr=wt.def(Vt,".location"),ca=wt.def(tr.attributes,"[",Hr,"]"),on=Nt.state,Fa=Nt.buffer,Za=[Nt.x,Nt.y,Nt.z,Nt.w],Nn=["buffer","normalized","offset","stride"];function En(){wt("if(!",ca,".buffer){",Cr,".enableVertexAttribArray(",Hr,");}");var cn=Nt.type,mn;if(Nt.size?mn=wt.def(Nt.size,"||",er):mn=er,wt("if(",ca,".type!==",cn,"||",ca,".size!==",mn,"||",Nn.map(function(ei){return ca+"."+ei+"!=="+Nt[ei]}).join("||"),"){",Cr,".bindBuffer(",Xr,",",Fa,".buffer);",Cr,".vertexAttribPointer(",[Hr,mn,cn,Nt.normalized,Nt.stride,Nt.offset],");",ca,".type=",cn,";",ca,".size=",mn,";",Nn.map(function(ei){return ca+"."+ei+"="+Nt[ei]+";"}).join(""),"}"),nn){var Pn=Nt.divisor;wt("if(",ca,".divisor!==",Pn,"){",vt.instancing,".vertexAttribDivisorANGLE(",[Hr,Pn],");",ca,".divisor=",Pn,";}")}}function Qa(){wt("if(",ca,".buffer){",Cr,".disableVertexAttribArray(",Hr,");",ca,".buffer=null;","}if(",Ni.map(function(cn,mn){return ca+"."+cn+"!=="+Za[mn]}).join("||"),"){",Cr,".vertexAttrib4f(",Hr,",",Za,");",Ni.map(function(cn,mn){return ca+"."+cn+"="+Za[mn]+";"}).join(""),"}")}on===Ui?En():on===Ji?Qa():(wt("if(",on,"===",Ui,"){"),En(),wt("}else{"),Qa(),wt("}"))}$t.forEach(function(Vt){var er=Vt.name,Nt=It.attributes[er],Cr;if(Nt){if(!lr(Nt))return;Cr=Nt.append(vt,wt)}else{if(!lr(xi))return;var Hr=vt.scopeAttrib(er);Cr={},Object.keys(new _a).forEach(function(ca){Cr[ca]=wt.def(Hr,".",ca)})}rr(vt.link(Vt),cr(Vt.info.type),Cr)})}function K(vt,wt,It,$t,lr,tr){for(var cr=vt.shared,rr=cr.gl,Vt,er=0;er<$t.length;++er){var Nt=$t[er],Cr=Nt.name,Hr=Nt.info.type,ca=It.uniforms[Cr],on=vt.link(Nt),Fa=on+".location",Za;if(ca){if(!lr(ca))continue;if(Jn(ca)){var Nn=ca.value;if(Hr===Cu||Hr===pl){var En=vt.link(Nn._texture||Nn.color[0]._texture);wt(rr,".uniform1i(",Fa,",",En+".bind());"),wt.exit(En,".unbind();")}else if(Hr===jl||Hr===Qs||Hr===Fl){var Qa=vt.global.def("new Float32Array(["+Array.prototype.slice.call(Nn)+"])"),cn=2;Hr===Qs?cn=3:Hr===Fl&&(cn=4),wt(rr,".uniformMatrix",cn,"fv(",Fa,",false,",Qa,");")}else{switch(Hr){case so:Vt="1f";break;case jo:Vt="2f";break;case uo:Vt="3f";break;case Co:Vt="4f";break;case Ro:Vt="1i";break;case Xo:Vt="1i";break;case ol:Vt="2i";break;case Us:Vt="2i";break;case Ml:Vt="3i";break;case Is:Vt="3i";break;case ru:Vt="4i";break;case Io:Vt="4i";break}wt(rr,".uniform",Vt,"(",Fa,",",ua(Nn)?Array.prototype.slice.call(Nn):Nn,");")}continue}else Za=ca.append(vt,wt)}else{if(!lr(xi))continue;Za=wt.def(cr.uniforms,"[",Gt.id(Cr),"]")}Hr===Cu?wt("if(",Za,"&&",Za,'._reglType==="framebuffer"){',Za,"=",Za,".color[0];","}"):Hr===pl&&wt("if(",Za,"&&",Za,'._reglType==="framebufferCube"){',Za,"=",Za,".color[0];","}");var mn=1;switch(Hr){case Cu:case pl:var Pn=wt.def(Za,"._texture");wt(rr,".uniform1i(",Fa,",",Pn,".bind());"),wt.exit(Pn,".unbind();");continue;case Xo:case Ro:Vt="1i";break;case Us:case ol:Vt="2i",mn=2;break;case Is:case Ml:Vt="3i",mn=3;break;case Io:case ru:Vt="4i",mn=4;break;case so:Vt="1f";break;case jo:Vt="2f",mn=2;break;case uo:Vt="3f",mn=3;break;case Co:Vt="4f",mn=4;break;case jl:Vt="Matrix2fv";break;case Qs:Vt="Matrix3fv";break;case Fl:Vt="Matrix4fv";break}if(Vt.charAt(0)==="M"){wt(rr,".uniform",Vt,"(",Fa,",");var ei=Math.pow(Hr-jl+2,2),no=vt.global.def("new Float32Array(",ei,")");Array.isArray(Za)?wt("false,(",v(ei,function(ks){return no+"["+ks+"]="+Za[ks]}),",",no,")"):wt("false,(Array.isArray(",Za,")||",Za," instanceof Float32Array)?",Za,":(",v(ei,function(ks){return no+"["+ks+"]="+Za+"["+ks+"]"}),",",no,")"),wt(");")}else if(mn>1){for(var Ao=[],fs=[],xo=0;xo>1)",Fa],");")}function Pn(){It(Za,".drawArraysInstancedANGLE(",[Hr,ca,on,Fa],");")}Nt&&Nt!=="null"?En?mn():(It("if(",Nt,"){"),mn(),It("}else{"),Pn(),It("}")):Pn()}function cn(){function mn(){It(tr+".drawElements("+[Hr,on,Nn,ca+"<<(("+Nn+"-"+Wi+")>>1)"]+");")}function Pn(){It(tr+".drawArrays("+[Hr,ca,on]+");")}Nt&&Nt!=="null"?En?mn():(It("if(",Nt,"){"),mn(),It("}else{"),Pn(),It("}")):Pn()}nn&&(typeof Fa!="number"||Fa>=0)?typeof Fa=="string"?(It("if(",Fa,">0){"),Qa(),It("}else if(",Fa,"<0){"),cn(),It("}")):Qa():cn()}function te(vt,wt,It,$t,lr){var tr=Yn(),cr=tr.proc("body",lr);return nn&&(tr.instancing=cr.def(tr.shared.extensions,".angle_instanced_arrays")),vt(tr,cr,It,$t),tr.compile().body}function ge(vt,wt,It,$t){nl(vt,wt),It.useVAO?It.drawVAO?wt(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,wt),");"):wt(vt.shared.vao,".setVAO(",vt.shared.vao,".targetVAO);"):(wt(vt.shared.vao,".setVAO(null);"),me(vt,wt,It,$t.attributes,function(){return!0})),K(vt,wt,It,$t.uniforms,function(){return!0},!1),ye(vt,wt,wt,It)}function Ne(vt,wt){var It=vt.proc("draw",1);nl(vt,It),ws(vt,It,wt.context),Hs(vt,It,wt.framebuffer),$s(vt,It,wt),Di(vt,It,wt.state),mo(vt,It,wt,!1,!0);var $t=wt.shader.progVar.append(vt,It);if(It(vt.shared.gl,".useProgram(",$t,".program);"),wt.shader.program)ge(vt,It,wt,wt.shader.program);else{It(vt.shared.vao,".setVAO(null);");var lr=vt.global.def("{}"),tr=It.def($t,".id"),cr=It.def(lr,"[",tr,"]");It(vt.cond(cr).then(cr,".call(this,a0);").else(cr,"=",lr,"[",tr,"]=",vt.link(function(rr){return te(ge,vt,wt,rr,1)}),"(",$t,");",cr,".call(this,a0);"))}Object.keys(wt.state).length>0&&It(vt.shared.current,".dirty=true;"),vt.shared.vao&&It(vt.shared.vao,".setVAO(null);")}function Me(vt,wt,It,$t){vt.batchId="a1",nl(vt,wt);function lr(){return!0}me(vt,wt,It,$t.attributes,lr),K(vt,wt,It,$t.uniforms,lr,!1),ye(vt,wt,wt,It)}function Ke(vt,wt,It,$t){nl(vt,wt);var lr=It.contextDep,tr=wt.def(),cr="a0",rr="a1",Vt=wt.def();vt.shared.props=Vt,vt.batchId=tr;var er=vt.scope(),Nt=vt.scope();wt(er.entry,"for(",tr,"=0;",tr,"<",rr,";++",tr,"){",Vt,"=",cr,"[",tr,"];",Nt,"}",er.exit);function Cr(Nn){return Nn.contextDep&&lr||Nn.propDep}function Hr(Nn){return!Cr(Nn)}if(It.needsContext&&ws(vt,Nt,It.context),It.needsFramebuffer&&Hs(vt,Nt,It.framebuffer),Di(vt,Nt,It.state,Cr),It.profile&&Cr(It.profile)&&mo(vt,Nt,It,!1,!0),$t)It.useVAO?It.drawVAO?Cr(It.drawVAO)?Nt(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,Nt),");"):er(vt.shared.vao,".setVAO(",It.drawVAO.append(vt,er),");"):er(vt.shared.vao,".setVAO(",vt.shared.vao,".targetVAO);"):(er(vt.shared.vao,".setVAO(null);"),me(vt,er,It,$t.attributes,Hr),me(vt,Nt,It,$t.attributes,Cr)),K(vt,er,It,$t.uniforms,Hr,!1),K(vt,Nt,It,$t.uniforms,Cr,!0),ye(vt,er,Nt,It);else{var ca=vt.global.def("{}"),on=It.shader.progVar.append(vt,Nt),Fa=Nt.def(on,".id"),Za=Nt.def(ca,"[",Fa,"]");Nt(vt.shared.gl,".useProgram(",on,".program);","if(!",Za,"){",Za,"=",ca,"[",Fa,"]=",vt.link(function(Nn){return te(Me,vt,It,Nn,2)}),"(",on,");}",Za,".call(this,a0[",tr,"],",tr,");")}}function ht(vt,wt){var It=vt.proc("batch",2);vt.batchId="0",nl(vt,It);var $t=!1,lr=!0;Object.keys(wt.context).forEach(function(ca){$t=$t||wt.context[ca].propDep}),$t||(ws(vt,It,wt.context),lr=!1);var tr=wt.framebuffer,cr=!1;tr?(tr.propDep?$t=cr=!0:tr.contextDep&&$t&&(cr=!0),cr||Hs(vt,It,tr)):Hs(vt,It,null),wt.state.viewport&&wt.state.viewport.propDep&&($t=!0);function rr(ca){return ca.contextDep&&$t||ca.propDep}$s(vt,It,wt),Di(vt,It,wt.state,function(ca){return!rr(ca)}),(!wt.profile||!rr(wt.profile))&&mo(vt,It,wt,!1,"a1"),wt.contextDep=$t,wt.needsContext=lr,wt.needsFramebuffer=cr;var Vt=wt.shader.progVar;if(Vt.contextDep&&$t||Vt.propDep)Ke(vt,It,wt,null);else{var er=Vt.append(vt,It);if(It(vt.shared.gl,".useProgram(",er,".program);"),wt.shader.program)Ke(vt,It,wt,wt.shader.program);else{It(vt.shared.vao,".setVAO(null);");var Nt=vt.global.def("{}"),Cr=It.def(er,".id"),Hr=It.def(Nt,"[",Cr,"]");It(vt.cond(Hr).then(Hr,".call(this,a0,a1);").else(Hr,"=",Nt,"[",Cr,"]=",vt.link(function(ca){return te(Ke,vt,wt,ca,2)}),"(",er,");",Hr,".call(this,a0,a1);"))}}Object.keys(wt.state).length>0&&It(vt.shared.current,".dirty=true;"),vt.shared.vao&&It(vt.shared.vao,".setVAO(null);")}function Bt(vt,wt){var It=vt.proc("scope",3);vt.batchId="a2";var $t=vt.shared,lr=$t.current;if(ws(vt,It,wt.context),wt.framebuffer&&wt.framebuffer.append(vt,It),Ka(Object.keys(wt.state)).forEach(function(rr){var Vt=wt.state[rr],er=Vt.append(vt,It);ua(er)?er.forEach(function(Nt,Cr){Bn(Nt)?It.set(vt.next[rr],"["+Cr+"]",Nt):It.set(vt.next[rr],"["+Cr+"]",vt.link(Nt,{stable:!0}))}):Jn(Vt)?It.set($t.next,"."+rr,vt.link(er,{stable:!0})):It.set($t.next,"."+rr,er)}),mo(vt,It,wt,!0,!0),[Zt,Gr,_r,Qr,yr].forEach(function(rr){var Vt=wt.draw[rr];if(Vt){var er=Vt.append(vt,It);Bn(er)?It.set($t.draw,"."+rr,er):It.set($t.draw,"."+rr,vt.link(er),{stable:!0})}}),Object.keys(wt.uniforms).forEach(function(rr){var Vt=wt.uniforms[rr].append(vt,It);Array.isArray(Vt)&&(Vt="["+Vt.map(function(er){return Bn(er)?er:vt.link(er,{stable:!0})})+"]"),It.set($t.uniforms,"["+vt.link(Gt.id(rr),{stable:!0})+"]",Vt)}),Object.keys(wt.attributes).forEach(function(rr){var Vt=wt.attributes[rr].append(vt,It),er=vt.scopeAttrib(rr);Object.keys(new _a).forEach(function(Nt){It.set(er,"."+Nt,Vt[Nt])})}),wt.scopeVAO){var tr=wt.scopeVAO.append(vt,It);Bn(tr)?It.set($t.vao,".targetVAO",tr):It.set($t.vao,".targetVAO",vt.link(tr,{stable:!0}))}function cr(rr){var Vt=wt.shader[rr];if(Vt){var er=Vt.append(vt,It);Bn(er)?It.set($t.shader,"."+rr,er):It.set($t.shader,"."+rr,vt.link(er,{stable:!0}))}}cr(_t),cr(Rt),Object.keys(wt.state).length>0&&(It(lr,".dirty=true;"),It.exit(lr,".dirty=true;")),It("a1(",vt.shared.context,",a0,",vt.batchId,");")}function gr(vt){if(!(typeof vt!="object"||ua(vt))){for(var wt=Object.keys(vt),It=0;It=0;--te){var ge=ii[te];ge&&ge(Pa,null,0)}or.flush(),Ja&&Ja.update()}function Ri(){!mi&&ii.length>0&&(mi=f.next(wi))}function ps(){mi&&(f.cancel(wi),mi=null)}function Js(te){te.preventDefault(),pa=!0,ps(),bi.forEach(function(ge){ge()})}function Qi(te){or.getError(),pa=!1,la.restore(),ri.restore(),nn.restore(),Oa.restore(),Ia.restore(),Un.restore(),Cn.restore(),Ja&&Ja.restore(),An.procs.refresh(),Ri(),Tn.forEach(function(ge){ge()})}Bn&&(Bn.addEventListener(Ho,Js,!1),Bn.addEventListener(Yo,Qi,!1));function _l(){ii.length=0,ps(),Bn&&(Bn.removeEventListener(Ho,Js),Bn.removeEventListener(Yo,Qi)),ri.clear(),Un.clear(),Ia.clear(),Cn.clear(),Oa.clear(),za.clear(),nn.clear(),Ja&&Ja.clear(),Yn.forEach(function(te){te()})}function Wo(te){function ge(tr){var cr=d({},tr);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function rr(Vt){if(Vt in cr){var er=cr[Vt];delete cr[Vt],Object.keys(er).forEach(function(Nt){cr[Vt+"."+Nt]=er[Nt]})}}return rr("blend"),rr("depth"),rr("cull"),rr("stencil"),rr("polygonOffset"),rr("scissor"),rr("sample"),"vao"in tr&&(cr.vao=tr.vao),cr}function Ne(tr,cr){var rr={},Vt={};return Object.keys(tr).forEach(function(er){var Nt=tr[er];if(h.isDynamic(Nt)){Vt[er]=h.unbox(Nt,er);return}else if(cr&&Array.isArray(Nt)){for(var Cr=0;Cr0)return vt.call(this,$t(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return vt.call(this,tr,tr.length)}else return ur.call(this,tr)}return d(lr,{stats:gr,destroy:function(){Dr.destroy()}})}var tl=Un.setFBO=Wo({framebuffer:h.define.call(null,el,"framebuffer")});function al(te,ge){var Ne=0;An.procs.poll();var Me=ge.color;Me&&(or.clearColor(+Me[0]||0,+Me[1]||0,+Me[2]||0,+Me[3]||0),Ne|=Ds),"depth"in ge&&(or.clearDepth(+ge.depth),Ne|=Ks),"stencil"in ge&&(or.clearStencil(ge.stencil|0),Ne|=oi),or.clear(Ne)}function El(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var ge=0;ge<6;++ge)tl(d({framebuffer:te.framebuffer.faces[ge]},te),al);else tl(te,al);else al(null,te)}function ws(te){ii.push(te);function ge(){var Ne=sl(ii,te);function Me(){var Ke=sl(ii,Me);ii[Ke]=ii[ii.length-1],ii.length-=1,ii.length<=0&&ps()}ii[Ne]=Me}return Ri(),{cancel:ge}}function Hs(){var te=fn.viewport,ge=fn.scissor_box;te[0]=te[1]=ge[0]=ge[1]=0,Pa.viewportWidth=Pa.framebufferWidth=Pa.drawingBufferWidth=te[2]=ge[2]=or.drawingBufferWidth,Pa.viewportHeight=Pa.framebufferHeight=Pa.drawingBufferHeight=te[3]=ge[3]=or.drawingBufferHeight}function $s(){Pa.tick+=1,Pa.time=nl(),Hs(),An.procs.poll()}function Di(){Oa.refresh(),Hs(),An.procs.refresh(),Ja&&Ja.update()}function nl(){return(p()-si)/1e3}Di();function mo(te,ge){var Ne;switch(te){case"frame":return ws(ge);case"lost":Ne=bi;break;case"restore":Ne=Tn;break;case"destroy":Ne=Yn;break;default:}return Ne.push(ge),{cancel:function(){for(var Me=0;Me=0},read:dn,destroy:_l,_gl:or,_refresh:Di,poll:function(){$s(),Ja&&Ja.update()},now:nl,stats:ja,getCachedCode:me,preloadCachedCode:K});return Gt.onDone(null,ye),ye}return Nu})}}),Y_=Ge({"src/lib/prepare_regl.js"(Z,q){"use strict";var d=S3(),x=x8();q.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),pT=Ge({"src/traces/scattergl/plot.js"(h,q){"use strict";var d=X3(),x=iT(),S=a8(),E=_8(),e=ta(),t=fv().selectMode,r=Y_(),o=iu(),a=Nb(),i=G3().styleTextSelection,n={};function s(f,p,c,T){var l=f._size,_=f.width*T,w=f.height*T,A=l.l*T,M=l.b*T,g=l.r*T,b=l.t*T,v=l.w*T,u=l.h*T;return[A+p.domain[0]*v,M+c.domain[0]*u,_-g-(1-p.domain[1])*v,w-b-(1-c.domain[1])*u]}var h=q.exports=function(p,c,T){if(T.length){var l=p._fullLayout,_=c._scene,w=c.xaxis,A=c.yaxis,M,g;if(_){var b=r(p,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!b){_.init();return}var v=_.count,u=l._glcanvas.data()[0].regl;if(a(p,c,T),_.dirty){if((_.line2d||_.error2d)&&!(_.scatter2d||_.fill2d||_.glText)&&u.clear({color:!0,depth:!0}),_.error2d===!0&&(_.error2d=S(u)),_.line2d===!0&&(_.line2d=x(u)),_.scatter2d===!0&&(_.scatter2d=d(u)),_.fill2d===!0&&(_.fill2d=x(u)),_.glText===!0)for(_.glText=new Array(v),M=0;M_.glText.length){var y=v-_.glText.length;for(M=0;MQ&&(isNaN(j[re])||isNaN(j[re+1]));)re-=2;ae.positions=j.slice(Q,re+2)}return ae}),_.line2d.update(_.lineOptions)),_.error2d){var L=(_.errorXOptions||[]).concat(_.errorYOptions||[]);_.error2d.update(L)}_.scatter2d&&_.scatter2d.update(_.markerOptions),_.fillOrder=e.repeat(null,v),_.fill2d&&(_.fillOptions=_.fillOptions.map(function(ae,j){var Q=T[j];if(!(!ae||!Q||!Q[0]||!Q[0].trace)){var re=Q[0],he=re.trace,xe=re.t,Te=_.lineOptions[j],Le,Pe,qe=[];he._ownfill&&qe.push(j),he._nexttrace&&qe.push(j+1),qe.length&&(_.fillOrder[j]=qe);var et=[],rt=Te&&Te.positions||xe.positions,$e,Ue;if(he.fill==="tozeroy"){for($e=0;$e$e&&isNaN(rt[Ue+1]);)Ue-=2;rt[$e+1]!==0&&(et=[rt[$e],0]),et=et.concat(rt.slice($e,Ue+2)),rt[Ue+1]!==0&&(et=et.concat([rt[Ue],0]))}else if(he.fill==="tozerox"){for($e=0;$e$e&&isNaN(rt[Ue]);)Ue-=2;rt[$e]!==0&&(et=[0,rt[$e+1]]),et=et.concat(rt.slice($e,Ue+2)),rt[Ue]!==0&&(et=et.concat([0,rt[Ue+1]]))}else if(he.fill==="toself"||he.fill==="tonext"){for(et=[],Le=0,ae.splitNull=!0,Pe=0;Pe-1;for(let[ae]of T)if(ae){var O=ae.trace,P=ae.t,U=P.index,B=O._length,X=P.x,$=P.y;if(O.selectedpoints||F||N){if(F||(F=!0),O.selectedpoints){var le=_.selectBatch[U]=e.selIndices2selPoints(O),ce={};for(g=0;gw&&c||_i,m;for(y?m=c.sizeAvg||Math.max(c.size,3):m=S(h,p),A=0;A<_.length;A++)w=_[A],M=f[w],g=x.getFromId(s,h._diag[w][0])||{},b=x.getFromId(s,h._diag[w][1])||{},E(s,h,g,b,T[A],T[A],m);var R=o(s,h);return R.matrix||(R.matrix=!0),R.matrixOptions=c,R.selectedOptions=t(s,h,h.selected),R.unselectedOptions=t(s,h,h.unselected),[{x:!1,y:!1,t:{},trace:h}]}}}),M8=Ge({"node_modules/performance-now/lib/performance-now.js"(Z,q){(function(){var d,x,S,E,e,t;typeof performance<"u"&&performance!==null&&performance.now?q.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(q.exports=function(){return(d()-e)/1e6},x=process.hrtime,d=function(){var r;return r=x(),r[0]*1e9+r[1]},E=d(),t=process.uptime()*1e9,e=E-t):Date.now?(q.exports=function(){return Date.now()-S},S=Date.now()):(q.exports=function(){return new Date().getTime()-S},S=new Date().getTime())}).call(Z)}}),E8=Ge({"node_modules/raf/index.js"(Z,q){var d=M8(),x=window,S=["moz","webkit"],E="AnimationFrame",e=x["request"+E],t=x["cancel"+E]||x["cancelRequest"+E];for(r=0;!e&&r{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let p=0;pm||!c.lower&&y{h[T+_]=p})}this.scatter.draw(...h)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,h,f){let p=s.id!=null?s.id:s,c=h,T=f;return p<<16|(c&255)<<8|T&255}function i(s,h,f){let p,c,T,l,_,w,A,M,g=s[h],b=s[f];return g.length>2?(p=g[0],T=g[2],c=g[1],l=g[3]):g.length?(p=c=g[0],T=l=g[1]):(p=g.x,c=g.y,T=g.x+g.width,l=g.y+g.height),b.length>2?(_=b[0],A=b[2],w=b[1],M=b[3]):b.length?(_=w=b[0],A=M=b[1]):(_=b.x,w=b.y,A=b.x+b.width,M=b.y+b.height),[_,c,A,l]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let h=t(s);return[h.x,h.y,h.x+h.width,h.y+h.height]}}}}),L8=Ge({"src/traces/splom/plot.js"(Z,q){"use strict";var d=C8(),x=ta(),S=dc(),E=fv().selectMode;q.exports=function(r,o,a){if(a.length)for(var i=0;i-1,N=E(c)||!!i.selectedpoints||F,O=!0;if(N){var P=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var U=i.selectedpoints,B={};for(_=0;_=X[$][0]&&B<=X[$][1])return!0;return!1}function h(B){B.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function f(B){B.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function p(B){if(!B.brush.filterSpecified)return"0,"+B.height;for(var X=c(B.brush.filter.getConsolidated(),B.height),$=[0],le,ce,ve,G=X.length?X[0][0]:null,Y=0;YB[1]+$||X=.9*B[1]+.1*B[0]?"n":X<=.9*B[0]+.1*B[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function _(B){B.attr("stroke-dasharray",p)}function w(B,X){var $=x.select(B).selectAll(".highlight, .highlight-shadow"),le=X?$.transition().duration(d.bar.snapDuration).each("end",X):$;_(le)}function A(B,X){var $=B.brush,le=$.filterSpecified,ce=NaN,ve={},G;if(le){var Y=B.height,ee=$.filter.getConsolidated(),V=c(ee,Y),se=NaN,ae=NaN,j=NaN;for(G=0;G<=V.length;G++){var Q=V[G];if(Q&&Q[0]<=X&&X<=Q[1]){se=G;break}else if(ae=G?G-1:NaN,Q&&Q[0]>X){j=G;break}}if(ce=se,isNaN(ce)&&(isNaN(ae)||isNaN(j)?ce=isNaN(ae)?j:ae:ce=X-V[ae][1]=Le[0]&&Te<=Le[1]){ve.clickableOrdinalRange=Le;break}}}return ve}function M(B,X){x.event.sourceEvent.stopPropagation();var $=X.height-x.mouse(B)[1]-2*d.verticalPadding,le=X.unitToPaddedPx.invert($),ce=X.brush,ve=A(X,$),G=ve.interval,Y=ce.svgBrush;if(Y.wasDragged=!1,Y.grabbingBar=ve.region==="ns",Y.grabbingBar){var ee=G.map(X.unitToPaddedPx);Y.grabPoint=$-ee[0]-d.verticalPadding,Y.barLength=ee[1]-ee[0]}Y.clickableOrdinalRange=ve.clickableOrdinalRange,Y.stayingIntervals=X.multiselect&&ce.filterSpecified?ce.filter.getConsolidated():[],G&&(Y.stayingIntervals=Y.stayingIntervals.filter(function(V){return V[0]!==G[0]&&V[1]!==G[1]})),Y.startExtent=ve.region?G[ve.region==="s"?1:0]:le,X.parent.inBrushDrag=!0,Y.brushStartCallback()}function g(B,X){x.event.sourceEvent.stopPropagation();var $=X.height-x.mouse(B)[1]-2*d.verticalPadding,le=X.brush.svgBrush;le.wasDragged=!0,le._dragging=!0,le.grabbingBar?le.newExtent=[$-le.grabPoint,$+le.barLength-le.grabPoint].map(X.unitToPaddedPx.invert):le.newExtent=[le.startExtent,X.unitToPaddedPx.invert($)].sort(e),X.brush.filterSpecified=!0,le.extent=le.stayingIntervals.concat([le.newExtent]),le.brushCallback(X),w(B.parentNode)}function b(B,X){var $=X.brush,le=$.filter,ce=$.svgBrush;ce._dragging||(v(B,X),g(B,X),X.brush.svgBrush.wasDragged=!1),ce._dragging=!1;var ve=x.event;ve.sourceEvent.stopPropagation();var G=ce.grabbingBar;if(ce.grabbingBar=!1,ce.grabLocation=void 0,X.parent.inBrushDrag=!1,l(),!ce.wasDragged){ce.wasDragged=void 0,ce.clickableOrdinalRange?$.filterSpecified&&X.multiselect?ce.extent.push(ce.clickableOrdinalRange):(ce.extent=[ce.clickableOrdinalRange],$.filterSpecified=!0):G?(ce.extent=ce.stayingIntervals,ce.extent.length===0&&z($)):z($),ce.brushCallback(X),w(B.parentNode),ce.brushEndCallback($.filterSpecified?le.getConsolidated():[]);return}var Y=function(){le.set(le.getConsolidated())};if(X.ordinal){var ee=X.unitTickvals;ee[ee.length-1]ce.newExtent[0];ce.extent=ce.stayingIntervals.concat(V?[ce.newExtent]:[]),ce.extent.length||z($),ce.brushCallback(X),V?w(B.parentNode,Y):(Y(),w(B.parentNode))}else Y();ce.brushEndCallback($.filterSpecified?le.getConsolidated():[])}function v(B,X){var $=X.height-x.mouse(B)[1]-2*d.verticalPadding,le=A(X,$),ce="crosshair";le.clickableOrdinalRange?ce="pointer":le.region&&(ce=le.region+"-resize"),x.select(document.body).style("cursor",ce)}function u(B){B.on("mousemove",function(X){x.event.preventDefault(),X.parent.inBrushDrag||v(this,X)}).on("mouseleave",function(X){X.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(X){M(this,X)}).on("drag",function(X){g(this,X)}).on("dragend",function(X){b(this,X)}))}function y(B,X){return B[0]-X[0]}function m(B,X,$){var le=$._context.staticPlot,ce=B.selectAll(".background").data(E);ce.enter().append("rect").classed("background",!0).call(h).call(f).style("pointer-events",le?"none":"auto").attr("transform",t(0,d.verticalPadding)),ce.call(u).attr("height",function(Y){return Y.height-d.verticalPadding});var ve=B.selectAll(".highlight-shadow").data(E);ve.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",X).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),ve.attr("y1",function(Y){return Y.height}).call(_);var G=B.selectAll(".highlight").data(E);G.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),G.attr("y1",function(Y){return Y.height}).call(_)}function R(B,X,$){var le=B.selectAll("."+d.cn.axisBrush).data(E,S);le.enter().append("g").classed(d.cn.axisBrush,!0),m(le,X,$)}function L(B){return B.svgBrush.extent.map(function(X){return X.slice()})}function z(B){B.filterSpecified=!1,B.svgBrush.extent=[[-1/0,1/0]]}function F(B){return function($){var le=$.brush,ce=L(le),ve=ce.slice();le.filter.set(ve),B()}}function N(B){for(var X=B.slice(),$=[],le,ce=X.shift();ce;){for(le=ce.slice();(ce=X.shift())&&ce[0]<=le[1];)le[1]=Math.max(le[1],ce[1]);$.push(le)}return $.length===1&&$[0][0]>$[0][1]&&($=[]),$}function O(){var B=[],X,$;return{set:function(le){B=le.map(function(ce){return ce.slice().sort(e)}).sort(y),B.length===1&&B[0][0]===-1/0&&B[0][1]===1/0&&(B=[[0,-1]]),X=N(B),$=B.reduce(function(ce,ve){return[Math.min(ce[0],ve[0]),Math.max(ce[1],ve[1])]},[1/0,-1/0])},get:function(){return B.slice()},getConsolidated:function(){return X},getBounds:function(){return $}}}function P(B,X,$,le,ce,ve){var G=O();return G.set($),{filter:G,filterSpecified:X,svgBrush:{extent:[],brushStartCallback:le,brushCallback:F(ce),brushEndCallback:ve}}}function U(B,X){if(Array.isArray(B[0])?(B=B.map(function(le){return le.sort(e)}),X.multiselect?B=N(B.sort(y)):B=[B[0]]):B=[B.sort(e)],X.tickvals){var $=X.tickvals.slice().sort(e);if(B=B.map(function(le){var ce=[n(0,$,le[0],[]),n(1,$,le[1],[])];if(ce[1]>ce[0])return ce}).filter(function(le){return le}),!B.length)return}return B.length>1?B:B[0]}q.exports={makeBrush:P,ensureAxisBrush:R,cleanRanges:U}}}),B8=Ge({"src/traces/parcoords/defaults.js"(Z,q){"use strict";var d=ta(),x=ih().hasColorscale,S=bf(),E=ju().defaults,e=Kf(),t=Mo(),r=yT(),o=_T(),a=jg().maxDimensionCount,i=K_();function n(h,f,p,c,T){var l=T("line.color",p);if(x(h,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),S(h,f,c,T,{prefix:"line.",cLetter:"c"}),l.length;f.line.color=p}return 1/0}function s(h,f,p,c){function T(M,g){return d.coerce(h,f,r.dimensions,M,g)}var l=T("values"),_=T("visible");if(l&&l.length||(_=f.visible=!1),_){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var w=T("range");f._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},t.setConvert(f._ax,c.layout),T("multiselect");var A=T("constraintrange");A&&(f.constraintrange=o.cleanRanges(A,f))}}q.exports=function(f,p,c,T){function l(g,b){return d.coerce(f,p,r,g,b)}var _=f.dimensions;Array.isArray(_)&&_.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),_.splice(a));var w=e(f,p,{name:"dimensions",layout:T,handleItemDefaults:s}),A=n(f,p,c,T,l);E(p,T,l),(!Array.isArray(w)||!w.length)&&(p.visible=!1),i(p,w,"values",A);var M=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",M),d.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),N8=Ge({"src/traces/parcoords/calc.js"(Z,q){"use strict";var d=ta().isArrayOrTypedArray,x=wu(),S=Bv().wrap;q.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),a=[[0,r.line.color],[1,r.line.color]]),S({lineColor:o,cscale:a})};function E(e){for(var t=new Array(e),r=0;r>>16,(Z&65280)>>>8,Z&255],alpha:1};if(typeof Z=="number")return{space:"rgb",values:[Z>>>16,(Z&65280)>>>8,Z&255],alpha:1};if(Z=String(Z).toLowerCase(),J_.default[Z])S=J_.default[Z].slice(),e="rgb";else if(Z==="transparent")E=0,e="rgb",S=[0,0,0];else if(Z[0]==="#"){var t=Z.slice(1),r=t.length,o=r<=4;E=1,o?(S=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(S=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),S[0]||(S[0]=0),S[1]||(S[1]=0),S[2]||(S[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Z)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;S=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=S.shift()),S=S.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if($_[n]!==void 0)return $_[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),E=S.length>i?S.pop():1}else/[0-9](?:\s|\/|,)/.test(Z)&&(S=Z.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(q=Z.match(/([a-z])/ig))==null?void 0:q.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:S,alpha:E}}var J_,xT,$_,j8=hs({"node_modules/color-parse/index.js"(){J_=Oh(w3(),1),xT=U8,$_={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Vg,bT=hs({"node_modules/color-space/rgb.js"(){Vg={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),qg,V8=hs({"node_modules/color-space/hsl.js"(){bT(),qg={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Z){var q=Z[0]/360,d=Z[1]/100,x=Z[2]/100,S,E,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(E=x<.5?x*(1+d):x+d-x*d,S=2*x-E,t=[0,0,0];o<3;)e=q+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?S+(E-S)*6*e:2*e<1?E:3*e<2?S+(E-S)*(2/3-e)*6:S,t[o++]=r*255;return t}},Vg.hsl=function(Z){var q=Z[0]/255,d=Z[1]/255,x=Z[2]/255,S=Math.min(q,d,x),E=Math.max(q,d,x),e=E-S,t,r,o;return E===S?t=0:q===E?t=(d-x)/e:d===E?t=2+(x-q)/e:x===E&&(t=4+(q-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(S+E)/2,E===S?r=0:o<=.5?r=e/(E+S):r=e/(2-E-S),[t,r*100,o*100]}}}),wT={};Jv(wT,{default:()=>q8});function q8(Z){Array.isArray(Z)&&Z.raw&&(Z=String.raw(...arguments)),Z instanceof Number&&(Z=+Z);var q,d,x,S=xT(Z);if(!S.space)return[];let E=S.space[0]==="h"?qg.min:Vg.min,e=S.space[0]==="h"?qg.max:Vg.max;return q=Array(3),q[0]=Math.min(Math.max(S.values[0],E[0]),e[0]),q[1]=Math.min(Math.max(S.values[1],E[1]),e[1]),q[2]=Math.min(Math.max(S.values[2],E[2]),e[2]),S.space[0]==="h"&&(q=qg.rgb(q)),q.push(Math.min(Math.max(S.alpha,0),1)),q}var G8=hs({"node_modules/color-rgba/index.js"(){j8(),bT(),V8()}}),TT=Ge({"src/traces/parcoords/helpers.js"(Z){"use strict";var q=ta().isTypedArray;Z.convertTypedArray=function(d){return q(d)?Array.prototype.slice.call(d):d},Z.isOrdinal=function(d){return!!d.tickvals},Z.isVisible=function(d){return d.visible||!("visible"in d)}}}),H8=Ge({"src/traces/parcoords/lines.js"(Z,q){"use strict";var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),A=Ig().maxDimensionCount,E=aa(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(b){b.read({x:0,y:0,width:1,height:1,data:r})}function n(b,v,u,g,f){var P=b._gl;P.enable(P.SCISSOR_TEST),P.scissor(v,u,g,f),b.clear({color:[0,0,0,0],depth:1})}function s(b,v,u,g,f,P){var L=P.key;function z(F){var B=Math.min(g,f-F*g);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],n(b,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!u.clearOnly&&(P.count=2*B,P.offset=2*F*g,v(P),F*g+B>>8*v)%256/255}function p(b,v,u){for(var g=new Array(b*(A+4)),f=0,P=0;PDe&&(De=ne[ue].dim1.canvasX,Te=ue);re===0&&n(f,0,0,B.canvasWidth,B.canvasHeight);var He=q(u);for(ue=0;ueue._length&&(ot=ot.slice(0,ue._length));var Ae=ue.tickvals,ge;function ce(kt,Et){return{val:kt,text:ge[Et]}}function ze(kt,Et){return kt.val-Et.val}if(A(Ae)&&Ae.length){x.isTypedArray(Ae)&&(Ae=Array.from(Ae)),ge=ue.ticktext,!A(ge)||!ge.length?ge=Ae.map(E(ue.tickformat)):ge.length>Ae.length?ge=ge.slice(0,Ae.length):Ae.length>ge.length&&(Ae=Ae.slice(0,ge.length));for(var Qe=1;Qe=Et||pr>=Bt)return;var Or=Ke.lineLayer.readPixel(_r,Bt-1-pr),mr=Or[3]!==0,Er=mr?Or[2]+256*(Or[1]+256*Or[0]):null,yt={x:_r,y:pr,clientX:kt.clientX,clientY:kt.clientY,dataIndex:Ke.model.key,curveNumber:Er};Er!==Te&&(mr?$.hover(yt):$.unhover&&$.unhover(yt),Te=Er)}}),_e.style("opacity",function(Ke){return Ke.pick?0:1}),oe.style("background","rgba(255, 255, 255, 0)");var De=oe.selectAll("."+T.cn.parcoords).data(ue,h);De.exit().remove(),De.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),De.attr("transform",function(Ke){return o(Ke.model.translateX,Ke.model.translateY)});var He=De.selectAll("."+T.cn.parcoordsControlView).data(c,h);He.enter().append("g").classed(T.cn.parcoordsControlView,!0),He.attr("transform",function(Ke){return o(Ke.model.pad.l,Ke.model.pad.t)});var et=He.selectAll("."+T.cn.yAxis).data(function(Ke){return Ke.dimensions},h);et.enter().append("g").classed(T.cn.yAxis,!0),He.each(function(Ke){N(et,Ke,j)}),_e.each(function(Ke){if(Ke.viewModel){!Ke.lineLayer||$?Ke.lineLayer=_(this,Ke):Ke.lineLayer.update(Ke),(Ke.key||Ke.key===0)&&(Ke.viewModel[Ke.key]=Ke.lineLayer);var kt=!Ke.context||$;Ke.lineLayer.render(Ke.viewModel.panels,kt)}}),et.attr("transform",function(Ke){return o(Ke.xScale(Ke.xIndex),0)}),et.call(d.behavior.drag().origin(function(Ke){return Ke}).on("drag",function(Ke){var kt=Ke.parent;re.linePickActive(!1),Ke.x=Math.max(-T.overdrag,Math.min(Ke.model.width+T.overdrag,d.event.x)),Ke.canvasX=Ke.x*Ke.model.canvasPixelRatio,et.sort(function(Et,Bt){return Et.x-Bt.x}).each(function(Et,Bt){Et.xIndex=Bt,Et.x=Ke===Et?Et.x:Et.xScale(Et.xIndex),Et.canvasX=Et.x*Et.model.canvasPixelRatio}),N(et,kt,j),et.filter(function(Et){return Math.abs(Ke.xIndex-Et.xIndex)!==0}).attr("transform",function(Et){return o(Et.xScale(Et.xIndex),0)}),d.select(this).attr("transform",o(Ke.x,0)),et.each(function(Et,Bt,jt){jt===Ke.parent.key&&(kt.dimensions[Bt]=Et)}),kt.contextLayer&&kt.contextLayer.render(kt.panels,!1,!L(kt)),kt.focusLayer.render&&kt.focusLayer.render(kt.panels)}).on("dragend",function(Ke){var kt=Ke.parent;Ke.x=Ke.xScale(Ke.xIndex),Ke.canvasX=Ke.x*Ke.model.canvasPixelRatio,N(et,kt,j),d.select(this).attr("transform",function(Et){return o(Et.x,0)}),kt.contextLayer&&kt.contextLayer.render(kt.panels,!1,!L(kt)),kt.focusLayer&&kt.focusLayer.render(kt.panels),kt.pickLayer&&kt.pickLayer.render(kt.panels,!0),re.linePickActive(!0),$&&$.axesMoved&&$.axesMoved(kt.key,kt.dimensions.map(function(Et){return Et.crossfilterDimensionIndex}))})),et.exit().remove();var rt=et.selectAll("."+T.cn.axisOverlays).data(c,h);rt.enter().append("g").classed(T.cn.axisOverlays,!0),rt.selectAll("."+T.cn.axis).remove();var $e=rt.selectAll("."+T.cn.axis).data(c,h);$e.enter().append("g").classed(T.cn.axis,!0),$e.each(function(Ke){var kt=Ke.model.height/Ke.model.tickDistance,Et=Ke.domainScale,Bt=Et.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(kt,Ke.tickFormat).tickValues(Ke.ordinal?Bt:null).tickFormat(function(jt){return p.isOrdinal(Ke)?jt:W(Ke.model.dimensions[Ke.visibleIndex],jt)}).scale(Et)),i.font($e.selectAll("text"),Ke.model.tickFont)}),$e.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),$e.selectAll("text").style("cursor","default");var ot=rt.selectAll("."+T.cn.axisHeading).data(c,h);ot.enter().append("g").classed(T.cn.axisHeading,!0);var Ae=ot.selectAll("."+T.cn.axisTitle).data(c,h);Ae.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",J?"none":"auto"),Ae.text(function(Ke){return Ke.label}).each(function(Ke){var kt=d.select(this);i.font(kt,Ke.model.labelFont),a.convertToTspans(kt,se)}).attr("transform",function(Ke){var kt=I(Ke.model.labelAngle,Ke.model.labelSide),Et=T.axisTitleOffset;return(kt.dir>0?"":o(0,2*Et+Ke.model.height))+r(kt.degrees)+o(-Et*kt.dx,-Et*kt.dy)}).attr("text-anchor",function(Ke){var kt=I(Ke.model.labelAngle,Ke.model.labelSide),Et=Math.abs(kt.dx),Bt=Math.abs(kt.dy);return 2*Et>Bt?kt.dir*kt.dx<0?"start":"end":"middle"});var ge=rt.selectAll("."+T.cn.axisExtent).data(c,h);ge.enter().append("g").classed(T.cn.axisExtent,!0);var ce=ge.selectAll("."+T.cn.axisExtentTop).data(c,h);ce.enter().append("g").classed(T.cn.axisExtentTop,!0),ce.attr("transform",o(0,-T.axisExtentOffset));var ze=ce.selectAll("."+T.cn.axisExtentTopText).data(c,h);ze.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),ze.text(function(Ke){return Q(Ke,!0)}).each(function(Ke){i.font(d.select(this),Ke.model.rangeFont)});var Qe=ge.selectAll("."+T.cn.axisExtentBottom).data(c,h);Qe.enter().append("g").classed(T.cn.axisExtentBottom,!0),Qe.attr("transform",function(Ke){return o(0,Ke.model.height+T.axisExtentOffset)});var nt=Qe.selectAll("."+T.cn.axisExtentBottomText).data(c,h);nt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(B),nt.text(function(Ke){return Q(Ke,!1)}).each(function(Ke){i.font(d.select(this),Ke.model.rangeFont)}),l.ensureAxisBrush(rt,ee,se)}}}),xT=We({"src/traces/parcoords/plot.js"(r,V){"use strict";var d=H8(),x=j_(),A=_T().isVisible,E={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=V.exports=function(a,i){var n=a._fullLayout,s=x(a,[],E);if(s){var h={},c={},m={},p={},T=n._size;i.forEach(function(M,y){var b=M[0].trace;m[y]=b.index;var v=p[y]=b.index;h[y]=a.data[v].dimensions,c[y]=a.data[v].dimensions.slice()});var l=function(M,y,b){var v=c[M][y],u=b.map(function(F){return F.slice()}),g="dimensions["+y+"].constraintrange",f=n._tracePreGUI[a._fullData[m[M]]._fullInput.uid];if(f[g]===void 0){var P=v.constraintrange;f[g]=P||null}var L=a._fullData[m[M]].dimensions[y];u.length?(u.length===1&&(u=u[0]),v.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete v.constraintrange,delete L.constraintrange,u=null);var z={};z[g]=u,a.emit("plotly_restyle",[z,[p[M]]])},_=function(M){a.emit("plotly_hover",M)},w=function(M){a.emit("plotly_unhover",M)},S=function(M,y){var b=t(y,c[M].filter(A));h[M].sort(b),c[M].filter(function(v){return!A(v)}).sort(function(v){return c[M].indexOf(v)}).forEach(function(v){h[M].splice(h[M].indexOf(v),1),h[M].splice(c[M].indexOf(v),0,v)}),a.emit("plotly_restyle",[{dimensions:[h[M]]},[p[M]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:_,unhover:w,axesMoved:S})}};r.reglPrecompiled=E}}),W8=We({"src/traces/parcoords/base_plot.js"(Z){"use strict";var V=Hi(),d=Ff().getModuleCalcData,x=xT(),A=Fh();Z.name="parcoords",Z.plot=function(E){var e=d(E.calcdata,"parcoords")[0];e.length&&x(E,e)},Z.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Z.toSVG=function(E){var e=E._fullLayout._glimages,t=V.select(E).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:A.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){V.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),X8=We({"src/traces/parcoords/base_index.js"(Z,V){"use strict";V.exports={attributes:dT(),supplyDefaults:O8(),calc:B8(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:W8(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Z8=We({"src/traces/parcoords/index.js"(Z,V){"use strict";var d=X8();d.plot=xT(),V.exports=d}}),Y8=We({"lib/parcoords.js"(Z,V){"use strict";V.exports=Z8()}}),bT=We({"src/traces/parcats/attributes.js"(Z,V){"use strict";var d=Fo().extendFlat,x=El(),A=_u(),E=Zl(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=wl(),r=Uu().attributes,o=d({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:t({editType:"plot"})});V.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:t({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:A({editType:"calc"}),tickfont:A({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:o,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),K8=We({"src/traces/parcats/defaults.js"(Z,V){"use strict";var d=aa(),x=ah().hasColorscale,A=yf(),E=Uu().defaults,e=Zf(),t=bT(),r=V_(),o=rh().isTypedArraySpec;function a(n,s,h,c,m){m("line.shape"),m("line.hovertemplate"),m("line.hovertemplatefallback");var p=m("line.color",c.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(p)){if(p.length)return m("line.colorscale"),A(n,s,c,m,{prefix:"line.",cLetter:"c"}),p.length;s.line.color=h}return 1/0}function i(n,s){function h(w,S){return d.coerce(n,s,t.dimensions,w,S)}var c=h("values"),m=h("visible");if(c&&c.length||(m=s.visible=!1),m){h("label"),h("displayindex",s._index);var p=n.categoryarray,T=d.isArrayOrTypedArray(p)&&p.length>0||o(p),l;T&&(l="array");var _=h("categoryorder",l);_==="array"?(h("categoryarray"),h("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&_==="array"&&(s.categoryorder="trace")}}V.exports=function(s,h,c,m){function p(w,S){return d.coerce(s,h,t,w,S)}var T=e(s,h,{name:"dimensions",handleItemDefaults:i}),l=a(s,h,c,m,p);E(h,m,p),(!Array.isArray(T)||!T.length)&&(h.visible=!1),r(h,T,"values",l),p("hoveron"),p("hovertemplate"),p("hovertemplatefallback"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var _=m.font;d.coerceFont(p,"labelfont",_,{overrideDflt:{size:Math.round(_.size)}}),d.coerceFont(p,"tickfont",_,{autoShadowDflt:!0,overrideDflt:{size:Math.round(_.size/1.2)}})}}}),J8=We({"src/traces/parcats/calc.js"(Z,V){"use strict";var d=Iv().wrap,x=ah().hasColorscale,A=nh(),E=tb(),e=Oo(),t=aa(),r=Uo();V.exports=function(_,w){var S=t.filterVisible(w.dimensions);if(S.length===0)return[];var M=S.map(function(q){var $;if(q.categoryorder==="trace")$=null;else if(q.categoryorder==="array")$=q.categoryarray;else{$=E(q.values);for(var J=!0,X=0;X<$.length;X++)if(!r($[X])){J=!1;break}$.sort(J?t.sorterAsc:void 0),q.categoryorder==="category descending"&&($=$.reverse())}return c(q.values,$)}),y,b,v;t.isArrayOrTypedArray(w.counts)?y=w.counts:y=[w.counts],m(S),S.forEach(function(q,$){p(q,M[$])});var u=w.line,g;u?(x(w,"line")&&A(_,w,{vals:w.line.color,containerStr:"line",cLetter:"c"}),g=e.tryColorscale(u)):g=t.identity;function f(q){var $,J;return t.isArrayOrTypedArray(u.color)?($=u.color[q%u.color.length],J=$):$=u.color,{color:g($),rawColor:J}}var P=S[0].values.length,L={},z=M.map(function(q){return q.inds});v=0;var F,B;for(F=0;F=l.length||_[l[w]]!==void 0)return!1;_[l[w]]=!0}return!0}}}),$8=We({"src/traces/parcats/parcats.js"(Z,V){"use strict";var d=Hi(),x=(Bp(),xd(Nd)).interpolateNumber,A=Yy(),E=hc(),e=aa(),t=e.strTranslate,r=Oo(),o=Af(),a=zl();function i(X,oe,ne,j){var ee=oe._context.staticPlot,re=X.map(se.bind(0,oe,ne)),ue=j.selectAll("g.parcatslayer").data([null]);ue.enter().append("g").attr("class","parcatslayer").style("pointer-events",ee?"none":"all");var _e=ue.selectAll("g.trace.parcats").data(re,n),Te=_e.enter().append("g").attr("class","trace parcats");_e.attr("transform",function(ce){return t(ce.x,ce.y)}),Te.append("g").attr("class","paths");var Ie=_e.select("g.paths"),De=Ie.selectAll("path.path").data(function(ce){return ce.paths},n);De.attr("fill",function(ce){return ce.model.color});var He=De.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ce){return ce.model.color}).attr("fill-opacity",0);_(He),De.attr("d",function(ce){return ce.svgD}),He.empty()||De.sort(h),De.exit().remove(),De.on("mouseover",c).on("mouseout",m).on("click",l),Te.append("g").attr("class","dimensions");var et=_e.select("g.dimensions"),rt=et.selectAll("g.dimension").data(function(ce){return ce.dimensions},n);rt.enter().append("g").attr("class","dimension"),rt.attr("transform",function(ce){return t(ce.x,0)}),rt.exit().remove();var $e=rt.selectAll("g.category").data(function(ce){return ce.categories},n),ot=$e.enter().append("g").attr("class","category");$e.attr("transform",function(ce){return t(0,ce.y)}),ot.append("rect").attr("class","catrect").attr("pointer-events","none"),$e.select("rect.catrect").attr("fill","none").attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),M(ot);var Ae=$e.selectAll("rect.bandrect").data(function(ce){return ce.bands},n);Ae.each(function(){e.raiseToTop(this)}),Ae.attr("fill",function(ce){return ce.color});var ge=Ae.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ce){return ce.color}).attr("fill-opacity",0);Ae.attr("fill",function(ce){return ce.color}).attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}).attr("y",function(ce){return ce.y}).attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":ce.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),b(ge),Ae.exit().remove(),ot.append("text").attr("class","catlabel").attr("pointer-events","none"),$e.select("text.catlabel").attr("text-anchor",function(ce){return s(ce)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ce){return s(ce)?ce.width+5:-5}).attr("y",function(ce){return ce.height/2}).text(function(ce){return ce.model.categoryLabel}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),oe)}),ot.append("text").attr("class","dimlabel"),$e.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ce){return ce.width/2}).attr("y",-5).text(function(ce,ze){return ze===0?ce.parcatsViewModel.model.dimensions[ce.model.dimensionInd].dimensionLabel:null}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.labelfont)}),$e.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),$e.exit().remove(),rt.call(d.behavior.drag().origin(function(ce){return{x:ce.x,y:0}}).on("dragstart",I).on("drag",N).on("dragend",U)),_e.each(function(ce){ce.traceSelection=d.select(this),ce.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),ce.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),_e.exit().remove()}V.exports=function(X,oe,ne,j){i(ne,X,j,oe)};function n(X){return X.key}function s(X){var oe=X.parcatsViewModel.dimensions.length,ne=X.parcatsViewModel.dimensions[oe-1].model.dimensionInd;return X.model.dimensionInd===ne}function h(X,oe){return X.model.rawColor>oe.model.rawColor?1:X.model.rawColor"),Ke=d.mouse(ee)[0];E.loneHover({trace:re,x:$e-_e.left+Te.left,y:ot-_e.top+Te.top,text:nt,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ae,idealAlign:Ke<$e?"right":"left",hovertemplate:(re.line||{}).hovertemplate,hovertemplateLabels:ze,eventData:[{data:re._input,fullData:re,count:ge,probability:ce}]},{container:ue._hoverlayer.node(),outerContainer:ue._paper.node(),gd:ee})}}}function m(X){if(!X.parcatsViewModel.dragDimension&&(_(d.select(this)),E.loneUnhover(X.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),X.parcatsViewModel.pathSelection.sort(h),X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var oe=p(X),ne=T(X);X.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:oe,event:d.event,constraints:ne})}}function p(X){for(var oe=[],ne=W(X.parcatsViewModel),j=0;j1&&Ie.displayInd===Te.dimensions.length-1?(et=ue.left,rt="left"):(et=ue.left+ue.width,rt="right");var $e=_e.model.count,ot=_e.model.categoryLabel,Ae=$e/_e.parcatsViewModel.model.count,ge={countLabel:$e,categoryLabel:ot,probabilityLabel:Ae.toFixed(3)},ce=[];_e.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ce.push(["Count:",ge.countLabel].join(" ")),_e.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ce.push(["P("+ge.categoryLabel+"):",ge.probabilityLabel].join(" "));var ze=ce.join("
");return{trace:De,x:j*(et-oe.left),y:ee*(He-oe.top),text:ze,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:rt,hovertemplate:De.hovertemplate,hovertemplateLabels:ge,eventData:[{data:De._input,fullData:De,count:$e,category:ot,probability:Ae}]}}function z(X,oe,ne){var j=[];return d.select(ne.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ee=this;j.push(L(X,oe,ee))}),j}function F(X,oe,ne){X._fullLayout._calcInverseTransform(X);var j=X._fullLayout._invScaleX,ee=X._fullLayout._invScaleY,re=ne.getBoundingClientRect(),ue=d.select(ne).datum(),_e=ue.categoryViewModel,Te=_e.parcatsViewModel,Ie=Te.model.dimensions[_e.model.dimensionInd],De=Te.trace,He=re.y+re.height/2,et,rt;Te.dimensions.length>1&&Ie.displayInd===Te.dimensions.length-1?(et=re.left,rt="left"):(et=re.left+re.width,rt="right");var $e=_e.model.categoryLabel,ot=ue.parcatsViewModel.model.count,Ae=0;ue.categoryViewModel.bands.forEach(function(jt){jt.color===ue.color&&(Ae+=jt.count)});var ge=_e.model.count,ce=0;Te.pathSelection.each(function(jt){jt.model.color===ue.color&&(ce+=jt.model.count)});var ze=Ae/ot,Qe=Ae/ce,nt=Ae/ge,Ke={countLabel:Ae,categoryLabel:$e,probabilityLabel:ze.toFixed(3)},kt=[];_e.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&kt.push(["Count:",Ke.countLabel].join(" ")),_e.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(kt.push("P(color \u2229 "+$e+"): "+Ke.probabilityLabel),kt.push("P("+$e+" | color): "+Qe.toFixed(3)),kt.push("P(color | "+$e+"): "+nt.toFixed(3)));var Et=kt.join("
"),Bt=o.mostReadable(ue.color,["black","white"]);return{trace:De,x:j*(et-oe.left),y:ee*(He-oe.top),text:Et,color:ue.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Bt,fontSize:10,idealAlign:rt,hovertemplate:De.hovertemplate,hovertemplateLabels:Ke,eventData:[{data:De._input,fullData:De,category:$e,count:ot,probability:ze,categorycount:ge,colorcount:ce,bandcolorcount:Ae}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var oe=d.mouse(this)[1];if(oe<-1)return;var ne=X.parcatsViewModel.graphDiv,j=ne._fullLayout,ee=j._paperdiv.node().getBoundingClientRect(),re=X.parcatsViewModel.hoveron,ue=this;if(re==="color"?(g(ue),P(ue,"plotly_hover",d.event)):(u(ue),f(ue,"plotly_hover",d.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var _e;re==="category"?_e=L(ne,ee,ue):re==="color"?_e=F(ne,ee,ue):re==="dimension"&&(_e=z(ne,ee,ue)),_e&&E.loneHover(_e,{container:j._hoverlayer.node(),outerContainer:j._paper.node(),gd:ne})}}}function O(X){var oe=X.parcatsViewModel;if(!oe.dragDimension&&(_(oe.pathSelection),M(oe.dimensionSelection.selectAll("g.category")),b(oe.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(oe.graphDiv._fullLayout._hoverlayer.node()),oe.pathSelection.sort(h),oe.hoverinfoItems.indexOf("skip")===-1)){var ne=X.parcatsViewModel.hoveron,j=this;ne==="color"?P(j,"plotly_unhover",d.event):f(j,"plotly_unhover",d.event)}}function I(X){X.parcatsViewModel.arrangement!=="fixed"&&(X.dragDimensionDisplayInd=X.model.displayInd,X.initialDragDimensionDisplayInds=X.parcatsViewModel.model.dimensions.map(function(oe){return oe.displayInd}),X.dragHasMoved=!1,X.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(oe){var ne=d.mouse(this)[0],j=d.mouse(this)[1];-2<=ne&&ne<=oe.width+2&&-2<=j&&j<=oe.height+2&&(X.dragCategoryDisplayInd=oe.model.displayInd,X.initialDragCategoryDisplayInds=X.model.categories.map(function(ee){return ee.displayInd}),oe.model.dragY=oe.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(ee){ee.yDe.y+De.height/2&&(re.model.displayInd=De.model.displayInd,De.model.displayInd=_e),X.dragCategoryDisplayInd=re.model.displayInd}if(X.dragCategoryDisplayInd===null||X.parcatsViewModel.arrangement==="freeform"){ee.model.dragX=d.event.x;var He=X.parcatsViewModel.dimensions[ne],et=X.parcatsViewModel.dimensions[j];He!==void 0&&ee.model.dragXet.x&&(ee.model.displayInd=et.model.displayInd,et.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ee.model.displayInd}$(X.parcatsViewModel),q(X.parcatsViewModel),le(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var oe={},ne=W(X.parcatsViewModel),j=X.parcatsViewModel.model.dimensions.map(function(et){return et.displayInd}),ee=X.initialDragDimensionDisplayInds.some(function(et,rt){return et!==j[rt]});ee&&j.forEach(function(et,rt){var $e=X.parcatsViewModel.model.dimensions[rt].containerInd;oe["dimensions["+$e+"].displayindex"]=et});var re=!1;if(X.dragCategoryDisplayInd!==null){var ue=X.model.categories.map(function(et){return et.displayInd});if(re=X.initialDragCategoryDisplayInds.some(function(et,rt){return et!==ue[rt]}),re){var _e=X.model.categories.slice().sort(function(et,rt){return et.displayInd-rt.displayInd}),Te=_e.map(function(et){return et.categoryValue}),Ie=_e.map(function(et){return et.categoryLabel});oe["dimensions["+X.model.containerInd+"].categoryarray"]=[Te],oe["dimensions["+X.model.containerInd+"].ticktext"]=[Ie],oe["dimensions["+X.model.containerInd+"].categoryorder"]="array"}}if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!X.dragHasMoved&&X.potentialClickBand&&(X.parcatsViewModel.hoveron==="color"?P(X.potentialClickBand,"plotly_click",d.event.sourceEvent):f(X.potentialClickBand,"plotly_click",d.event.sourceEvent)),X.model.dragX=null,X.dragCategoryDisplayInd!==null){var De=X.parcatsViewModel.dimensions[X.dragDimensionDisplayInd].categories[X.dragCategoryDisplayInd];De.model.dragY=null,X.dragCategoryDisplayInd=null}X.dragDimensionDisplayInd=null,X.parcatsViewModel.dragDimension=null,X.dragHasMoved=null,X.potentialClickBand=null,$(X.parcatsViewModel),q(X.parcatsViewModel);var He=d.transition().duration(300).ease("cubic-in-out");He.each(function(){le(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ee||re)&&A.restyle(X.parcatsViewModel.graphDiv,oe,[ne])})}}function W(X){for(var oe,ne=X.graphDiv._fullData,j=0;j=0;Te--)Ie+="C"+ue[Te]+","+(oe[Te+1]+j)+" "+re[Te]+","+(oe[Te]+j)+" "+(X[Te]+ne[Te])+","+(oe[Te]+j),Ie+="l-"+ne[Te]+",0 ";return Ie+="Z",Ie}function q(X){var oe=X.dimensions,ne=X.model,j=oe.map(function(Or){return Or.categories.map(function(mr){return mr.y})}),ee=X.model.dimensions.map(function(Or){return Or.categories.map(function(mr){return mr.displayInd})}),re=X.model.dimensions.map(function(Or){return Or.displayInd}),ue=X.dimensions.map(function(Or){return Or.model.dimensionInd}),_e=oe.map(function(Or){return Or.x}),Te=oe.map(function(Or){return Or.width}),Ie=[];for(var De in ne.paths)ne.paths.hasOwnProperty(De)&&Ie.push(ne.paths[De]);function He(Or){var mr=Or.categoryInds.map(function(yt,Oe){return ee[Oe][yt]}),Er=ue.map(function(yt){return mr[yt]});return Er}Ie.sort(function(Or,mr){var Er=He(Or),yt=He(mr);return X.sortpaths==="backward"&&(Er.reverse(),yt.reverse()),Er.push(Or.valueInds[0]),yt.push(mr.valueInds[0]),X.bundlecolors&&(Er.unshift(Or.rawColor),yt.unshift(mr.rawColor)),Eryt?1:0});for(var et=new Array(Ie.length),rt=oe[0].model.count,$e=oe[0].categories.map(function(Or){return Or.height}).reduce(function(Or,mr){return Or+mr}),ot=0;ot0?ge=$e*(Ae.count/rt):ge=0;for(var ce=new Array(j.length),ze=0;ze1?ue=(X.width-2*ne-j)/(ee-1):ue=0,_e=ne,Te=_e+ue*re;var Ie=[],De=X.model.maxCats,He=oe.categories.length,et=8,rt=oe.count,$e=X.height-et*(De-1),ot,Ae,ge,ce,ze,Qe=(De-He)*et/2,nt=oe.categories.map(function(Ke){return{displayInd:Ke.displayInd,categoryInd:Ke.categoryInd}});for(nt.sort(function(Ke,kt){return Ke.displayInd-kt.displayInd}),ze=0;ze0?ot=Ae.count/rt*$e:ot=0,ge={key:Ae.valueInds[0],model:Ae,width:j,height:ot,y:Ae.dragY!==null?Ae.dragY:Qe,bands:[],parcatsViewModel:X},Qe=Qe+ot+et,Ie.push(ge);return{key:oe.dimensionInd,x:oe.dragX!==null?oe.dragX:Te,y:0,width:j,model:oe,categories:Ie,parcatsViewModel:X,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),wT=We({"src/traces/parcats/plot.js"(Z,V){"use strict";var d=$8();V.exports=function(A,E,e,t){var r=A._fullLayout,o=r._paper,a=r._size;d(A,o,E,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),Q8=We({"src/traces/parcats/base_plot.js"(Z){"use strict";var V=Ff().getModuleCalcData,d=wT(),x="parcats";Z.name=x,Z.plot=function(A,E,e,t){var r=V(A.calcdata,x);if(r.length){var o=r[0];d(A,o,e,t)}},Z.clean=function(A,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),eI=We({"src/traces/parcats/index.js"(Z,V){"use strict";V.exports={attributes:bT(),supplyDefaults:K8(),calc:J8(),plot:wT(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:Q8(),categories:["noOpacity"],meta:{}}}}),tI=We({"lib/parcats.js"(Z,V){"use strict";V.exports=eI()}}),td=We({"src/plots/mapbox/constants.js"(Z,V){"use strict";var d=Ad(),x="1.13.4",A='\xA9 OpenStreetMap contributors',E=['\xA9 Carto',A].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);V.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].join(` +`),S=jg().maxDimensionCount,E=ta(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(b){b.read({x:0,y:0,width:1,height:1,data:r})}function n(b,v,u,y,m){var R=b._gl;R.enable(R.SCISSOR_TEST),R.scissor(v,u,y,m),b.clear({color:[0,0,0,0],depth:1})}function s(b,v,u,y,m,R){var L=R.key;function z(F){var N=Math.min(y,m-F*y);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],n(b,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!u.clearOnly&&(R.count=2*N,R.offset=2*F*y,v(R),F*y+N>>8*v)%256/255}function c(b,v,u){for(var y=new Array(b*(S+4)),m=0,R=0;RPe&&(Pe=ae[he].dim1.canvasX,Te=he);re===0&&n(m,0,0,N.canvasWidth,N.canvasHeight);var qe=G(u);for(he=0;hehe._length&&(Ue=Ue.slice(0,he._length));var fe=he.tickvals,ue;function ie(Tt,St){return{val:Tt,text:ue[St]}}function Ee(Tt,St){return Tt.val-St.val}if(S(fe)&&fe.length){x.isTypedArray(fe)&&(fe=Array.from(fe)),ue=he.ticktext,!S(ue)||!ue.length?ue=fe.map(E(he.tickformat)):ue.length>fe.length?ue=ue.slice(0,fe.length):fe.length>ue.length&&(fe=fe.slice(0,ue.length));for(var We=1;We=St||hr>=zt)return;var Or=Xe.lineLayer.readPixel(br,zt-1-hr),wr=Or[3]!==0,Er=wr?Or[2]+256*(Or[1]+256*Or[0]):null,mt={x:br,y:hr,clientX:Tt.clientX,clientY:Tt.clientY,dataIndex:Xe.model.key,curveNumber:Er};Er!==Te&&(wr?Y.hover(mt):Y.unhover&&Y.unhover(mt),Te=Er)}}),xe.style("opacity",function(Xe){return Xe.pick?0:1}),se.style("background","rgba(255, 255, 255, 0)");var Pe=se.selectAll("."+T.cn.parcoords).data(he,h);Pe.exit().remove(),Pe.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Pe.attr("transform",function(Xe){return o(Xe.model.translateX,Xe.model.translateY)});var qe=Pe.selectAll("."+T.cn.parcoordsControlView).data(f,h);qe.enter().append("g").classed(T.cn.parcoordsControlView,!0),qe.attr("transform",function(Xe){return o(Xe.model.pad.l,Xe.model.pad.t)});var et=qe.selectAll("."+T.cn.yAxis).data(function(Xe){return Xe.dimensions},h);et.enter().append("g").classed(T.cn.yAxis,!0),qe.each(function(Xe){U(et,Xe,j)}),xe.each(function(Xe){if(Xe.viewModel){!Xe.lineLayer||Y?Xe.lineLayer=_(this,Xe):Xe.lineLayer.update(Xe),(Xe.key||Xe.key===0)&&(Xe.viewModel[Xe.key]=Xe.lineLayer);var Tt=!Xe.context||Y;Xe.lineLayer.render(Xe.viewModel.panels,Tt)}}),et.attr("transform",function(Xe){return o(Xe.xScale(Xe.xIndex),0)}),et.call(d.behavior.drag().origin(function(Xe){return Xe}).on("drag",function(Xe){var Tt=Xe.parent;re.linePickActive(!1),Xe.x=Math.max(-T.overdrag,Math.min(Xe.model.width+T.overdrag,d.event.x)),Xe.canvasX=Xe.x*Xe.model.canvasPixelRatio,et.sort(function(St,zt){return St.x-zt.x}).each(function(St,zt){St.xIndex=zt,St.x=Xe===St?St.x:St.xScale(St.xIndex),St.canvasX=St.x*St.model.canvasPixelRatio}),U(et,Tt,j),et.filter(function(St){return Math.abs(Xe.xIndex-St.xIndex)!==0}).attr("transform",function(St){return o(St.xScale(St.xIndex),0)}),d.select(this).attr("transform",o(Xe.x,0)),et.each(function(St,zt,Ut){Ut===Xe.parent.key&&(Tt.dimensions[zt]=St)}),Tt.contextLayer&&Tt.contextLayer.render(Tt.panels,!1,!L(Tt)),Tt.focusLayer.render&&Tt.focusLayer.render(Tt.panels)}).on("dragend",function(Xe){var Tt=Xe.parent;Xe.x=Xe.xScale(Xe.xIndex),Xe.canvasX=Xe.x*Xe.model.canvasPixelRatio,U(et,Tt,j),d.select(this).attr("transform",function(St){return o(St.x,0)}),Tt.contextLayer&&Tt.contextLayer.render(Tt.panels,!1,!L(Tt)),Tt.focusLayer&&Tt.focusLayer.render(Tt.panels),Tt.pickLayer&&Tt.pickLayer.render(Tt.panels,!0),re.linePickActive(!0),Y&&Y.axesMoved&&Y.axesMoved(Tt.key,Tt.dimensions.map(function(St){return St.crossfilterDimensionIndex}))})),et.exit().remove();var rt=et.selectAll("."+T.cn.axisOverlays).data(f,h);rt.enter().append("g").classed(T.cn.axisOverlays,!0),rt.selectAll("."+T.cn.axis).remove();var $e=rt.selectAll("."+T.cn.axis).data(f,h);$e.enter().append("g").classed(T.cn.axis,!0),$e.each(function(Xe){var Tt=Xe.model.height/Xe.model.tickDistance,St=Xe.domainScale,zt=St.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Tt,Xe.tickFormat).tickValues(Xe.ordinal?zt:null).tickFormat(function(Ut){return c.isOrdinal(Xe)?Ut:X(Xe.model.dimensions[Xe.visibleIndex],Ut)}).scale(St)),i.font($e.selectAll("text"),Xe.model.tickFont)}),$e.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),$e.selectAll("text").style("cursor","default");var Ue=rt.selectAll("."+T.cn.axisHeading).data(f,h);Ue.enter().append("g").classed(T.cn.axisHeading,!0);var fe=Ue.selectAll("."+T.cn.axisTitle).data(f,h);fe.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ee?"none":"auto"),fe.text(function(Xe){return Xe.label}).each(function(Xe){var Tt=d.select(this);i.font(Tt,Xe.model.labelFont),a.convertToTspans(Tt,ce)}).attr("transform",function(Xe){var Tt=P(Xe.model.labelAngle,Xe.model.labelSide),St=T.axisTitleOffset;return(Tt.dir>0?"":o(0,2*St+Xe.model.height))+r(Tt.degrees)+o(-St*Tt.dx,-St*Tt.dy)}).attr("text-anchor",function(Xe){var Tt=P(Xe.model.labelAngle,Xe.model.labelSide),St=Math.abs(Tt.dx),zt=Math.abs(Tt.dy);return 2*St>zt?Tt.dir*Tt.dx<0?"start":"end":"middle"});var ue=rt.selectAll("."+T.cn.axisExtent).data(f,h);ue.enter().append("g").classed(T.cn.axisExtent,!0);var ie=ue.selectAll("."+T.cn.axisExtentTop).data(f,h);ie.enter().append("g").classed(T.cn.axisExtentTop,!0),ie.attr("transform",o(0,-T.axisExtentOffset));var Ee=ie.selectAll("."+T.cn.axisExtentTopText).data(f,h);Ee.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(N),Ee.text(function(Xe){return $(Xe,!0)}).each(function(Xe){i.font(d.select(this),Xe.model.rangeFont)});var We=ue.selectAll("."+T.cn.axisExtentBottom).data(f,h);We.enter().append("g").classed(T.cn.axisExtentBottom,!0),We.attr("transform",function(Xe){return o(0,Xe.model.height+T.axisExtentOffset)});var Qe=We.selectAll("."+T.cn.axisExtentBottomText).data(f,h);Qe.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(N),Qe.text(function(Xe){return $(Xe,!1)}).each(function(Xe){i.font(d.select(this),Xe.model.rangeFont)}),l.ensureAxisBrush(rt,Q,ce)}}}),AT=Ge({"src/traces/parcoords/plot.js"(r,q){"use strict";var d=W8(),x=Y_(),S=TT().isVisible,E={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=q.exports=function(a,i){var n=a._fullLayout,s=x(a,[],E);if(s){var h={},f={},p={},c={},T=n._size;i.forEach(function(M,g){var b=M[0].trace;p[g]=b.index;var v=c[g]=b.index;h[g]=a.data[v].dimensions,f[g]=a.data[v].dimensions.slice()});var l=function(M,g,b){var v=f[M][g],u=b.map(function(F){return F.slice()}),y="dimensions["+g+"].constraintrange",m=n._tracePreGUI[a._fullData[p[M]]._fullInput.uid];if(m[y]===void 0){var R=v.constraintrange;m[y]=R||null}var L=a._fullData[p[M]].dimensions[g];u.length?(u.length===1&&(u=u[0]),v.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete v.constraintrange,delete L.constraintrange,u=null);var z={};z[y]=u,a.emit("plotly_restyle",[z,[c[M]]])},_=function(M){a.emit("plotly_hover",M)},w=function(M){a.emit("plotly_unhover",M)},A=function(M,g){var b=t(g,f[M].filter(S));h[M].sort(b),f[M].filter(function(v){return!S(v)}).sort(function(v){return f[M].indexOf(v)}).forEach(function(v){h[M].splice(h[M].indexOf(v),1),h[M].splice(f[M].indexOf(v),0,v)}),a.emit("plotly_restyle",[{dimensions:[h[M]]},[c[M]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:_,unhover:w,axesMoved:A})}};r.reglPrecompiled=E}}),X8=Ge({"src/traces/parcoords/base_plot.js"(Z){"use strict";var q=Oi(),d=Bf().getModuleCalcData,x=AT(),S=Bh();Z.name="parcoords",Z.plot=function(E){var e=d(E.calcdata,"parcoords")[0];e.length&&x(E,e)},Z.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Z.toSVG=function(E){var e=E._fullLayout._glimages,t=q.select(E).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:S.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){q.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),Z8=Ge({"src/traces/parcoords/base_index.js"(Z,q){"use strict";q.exports={attributes:yT(),supplyDefaults:B8(),calc:N8(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:X8(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Y8=Ge({"src/traces/parcoords/index.js"(Z,q){"use strict";var d=Z8();d.plot=AT(),q.exports=d}}),K8=Ge({"lib/parcoords.js"(Z,q){"use strict";q.exports=Y8()}}),ST=Ge({"src/traces/parcats/attributes.js"(Z,q){"use strict";var d=Do().extendFlat,x=Cl(),S=bu(),E=Jl(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Tl(),r=ju().attributes,o=d({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:t({editType:"plot"})});q.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:t({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:S({editType:"calc"}),tickfont:S({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:o,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),J8=Ge({"src/traces/parcats/defaults.js"(Z,q){"use strict";var d=ta(),x=ih().hasColorscale,S=bf(),E=ju().defaults,e=Kf(),t=ST(),r=K_(),o=nh().isTypedArraySpec;function a(n,s,h,f,p){p("line.shape"),p("line.hovertemplate"),p("line.hovertemplatefallback");var c=p("line.color",f.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(c)){if(c.length)return p("line.colorscale"),S(n,s,f,p,{prefix:"line.",cLetter:"c"}),c.length;s.line.color=h}return 1/0}function i(n,s){function h(w,A){return d.coerce(n,s,t.dimensions,w,A)}var f=h("values"),p=h("visible");if(f&&f.length||(p=s.visible=!1),p){h("label"),h("displayindex",s._index);var c=n.categoryarray,T=d.isArrayOrTypedArray(c)&&c.length>0||o(c),l;T&&(l="array");var _=h("categoryorder",l);_==="array"?(h("categoryarray"),h("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&_==="array"&&(s.categoryorder="trace")}}q.exports=function(s,h,f,p){function c(w,A){return d.coerce(s,h,t,w,A)}var T=e(s,h,{name:"dimensions",handleItemDefaults:i}),l=a(s,h,f,p,c);E(h,p,c),(!Array.isArray(T)||!T.length)&&(h.visible=!1),r(h,T,"values",l),c("hoveron"),c("hovertemplate"),c("hovertemplatefallback"),c("arrangement"),c("bundlecolors"),c("sortpaths"),c("counts");var _=p.font;d.coerceFont(c,"labelfont",_,{overrideDflt:{size:Math.round(_.size)}}),d.coerceFont(c,"tickfont",_,{autoShadowDflt:!0,overrideDflt:{size:Math.round(_.size/1.2)}})}}}),$8=Ge({"src/traces/parcats/calc.js"(Z,q){"use strict";var d=Bv().wrap,x=ih().hasColorscale,S=oh(),E=nb(),e=zo(),t=ta(),r=Bo();q.exports=function(_,w){var A=t.filterVisible(w.dimensions);if(A.length===0)return[];var M=A.map(function(G){var Y;if(G.categoryorder==="trace")Y=null;else if(G.categoryorder==="array")Y=G.categoryarray;else{Y=E(G.values);for(var ee=!0,V=0;V=l.length||_[l[w]]!==void 0)return!1;_[l[w]]=!0}return!0}}}),Q8=Ge({"src/traces/parcats/parcats.js"(Z,q){"use strict";var d=Oi(),x=(Gp(),Pv(Hd)).interpolateNumber,S=a1(),E=mc(),e=ta(),t=e.strTranslate,r=zo(),o=Ef(),a=Il();function i(V,se,ae,j){var Q=se._context.staticPlot,re=V.map(ce.bind(0,se,ae)),he=j.selectAll("g.parcatslayer").data([null]);he.enter().append("g").attr("class","parcatslayer").style("pointer-events",Q?"none":"all");var xe=he.selectAll("g.trace.parcats").data(re,n),Te=xe.enter().append("g").attr("class","trace parcats");xe.attr("transform",function(ie){return t(ie.x,ie.y)}),Te.append("g").attr("class","paths");var Le=xe.select("g.paths"),Pe=Le.selectAll("path.path").data(function(ie){return ie.paths},n);Pe.attr("fill",function(ie){return ie.model.color});var qe=Pe.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ie){return ie.model.color}).attr("fill-opacity",0);_(qe),Pe.attr("d",function(ie){return ie.svgD}),qe.empty()||Pe.sort(h),Pe.exit().remove(),Pe.on("mouseover",f).on("mouseout",p).on("click",l),Te.append("g").attr("class","dimensions");var et=xe.select("g.dimensions"),rt=et.selectAll("g.dimension").data(function(ie){return ie.dimensions},n);rt.enter().append("g").attr("class","dimension"),rt.attr("transform",function(ie){return t(ie.x,0)}),rt.exit().remove();var $e=rt.selectAll("g.category").data(function(ie){return ie.categories},n),Ue=$e.enter().append("g").attr("class","category");$e.attr("transform",function(ie){return t(0,ie.y)}),Ue.append("rect").attr("class","catrect").attr("pointer-events","none"),$e.select("rect.catrect").attr("fill","none").attr("width",function(ie){return ie.width}).attr("height",function(ie){return ie.height}),M(Ue);var fe=$e.selectAll("rect.bandrect").data(function(ie){return ie.bands},n);fe.each(function(){e.raiseToTop(this)}),fe.attr("fill",function(ie){return ie.color});var ue=fe.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ie){return ie.color}).attr("fill-opacity",0);fe.attr("fill",function(ie){return ie.color}).attr("width",function(ie){return ie.width}).attr("height",function(ie){return ie.height}).attr("y",function(ie){return ie.y}).attr("cursor",function(ie){return ie.parcatsViewModel.arrangement==="fixed"?"default":ie.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),b(ue),fe.exit().remove(),Ue.append("text").attr("class","catlabel").attr("pointer-events","none"),$e.select("text.catlabel").attr("text-anchor",function(ie){return s(ie)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ie){return s(ie)?ie.width+5:-5}).attr("y",function(ie){return ie.height/2}).text(function(ie){return ie.model.categoryLabel}).each(function(ie){r.font(d.select(this),ie.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),se)}),Ue.append("text").attr("class","dimlabel"),$e.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ie){return ie.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ie){return ie.width/2}).attr("y",-5).text(function(ie,Ee){return Ee===0?ie.parcatsViewModel.model.dimensions[ie.model.dimensionInd].dimensionLabel:null}).each(function(ie){r.font(d.select(this),ie.parcatsViewModel.labelfont)}),$e.selectAll("rect.bandrect").on("mouseover",N).on("mouseout",O),$e.exit().remove(),rt.call(d.behavior.drag().origin(function(ie){return{x:ie.x,y:0}}).on("dragstart",P).on("drag",U).on("dragend",B)),xe.each(function(ie){ie.traceSelection=d.select(this),ie.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),ie.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),xe.exit().remove()}q.exports=function(V,se,ae,j){i(ae,V,j,se)};function n(V){return V.key}function s(V){var se=V.parcatsViewModel.dimensions.length,ae=V.parcatsViewModel.dimensions[se-1].model.dimensionInd;return V.model.dimensionInd===ae}function h(V,se){return V.model.rawColor>se.model.rawColor?1:V.model.rawColor"),Xe=d.mouse(Q)[0];E.loneHover({trace:re,x:$e-xe.left+Te.left,y:Ue-xe.top+Te.top,text:Qe,color:V.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:fe,idealAlign:Xe<$e?"right":"left",hovertemplate:(re.line||{}).hovertemplate,hovertemplateLabels:Ee,eventData:[{data:re._input,fullData:re,count:ue,probability:ie}]},{container:he._hoverlayer.node(),outerContainer:he._paper.node(),gd:Q})}}}function p(V){if(!V.parcatsViewModel.dragDimension&&(_(d.select(this)),E.loneUnhover(V.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),V.parcatsViewModel.pathSelection.sort(h),V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var se=c(V),ae=T(V);V.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:se,event:d.event,constraints:ae})}}function c(V){for(var se=[],ae=X(V.parcatsViewModel),j=0;j1&&Le.displayInd===Te.dimensions.length-1?(et=he.left,rt="left"):(et=he.left+he.width,rt="right");var $e=xe.model.count,Ue=xe.model.categoryLabel,fe=$e/xe.parcatsViewModel.model.count,ue={countLabel:$e,categoryLabel:Ue,probabilityLabel:fe.toFixed(3)},ie=[];xe.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ie.push(["Count:",ue.countLabel].join(" ")),xe.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ie.push(["P("+ue.categoryLabel+"):",ue.probabilityLabel].join(" "));var Ee=ie.join("
");return{trace:Pe,x:j*(et-se.left),y:Q*(qe-se.top),text:Ee,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:rt,hovertemplate:Pe.hovertemplate,hovertemplateLabels:ue,eventData:[{data:Pe._input,fullData:Pe,count:$e,category:Ue,probability:fe}]}}function z(V,se,ae){var j=[];return d.select(ae.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var Q=this;j.push(L(V,se,Q))}),j}function F(V,se,ae){V._fullLayout._calcInverseTransform(V);var j=V._fullLayout._invScaleX,Q=V._fullLayout._invScaleY,re=ae.getBoundingClientRect(),he=d.select(ae).datum(),xe=he.categoryViewModel,Te=xe.parcatsViewModel,Le=Te.model.dimensions[xe.model.dimensionInd],Pe=Te.trace,qe=re.y+re.height/2,et,rt;Te.dimensions.length>1&&Le.displayInd===Te.dimensions.length-1?(et=re.left,rt="left"):(et=re.left+re.width,rt="right");var $e=xe.model.categoryLabel,Ue=he.parcatsViewModel.model.count,fe=0;he.categoryViewModel.bands.forEach(function(Ut){Ut.color===he.color&&(fe+=Ut.count)});var ue=xe.model.count,ie=0;Te.pathSelection.each(function(Ut){Ut.model.color===he.color&&(ie+=Ut.model.count)});var Ee=fe/Ue,We=fe/ie,Qe=fe/ue,Xe={countLabel:fe,categoryLabel:$e,probabilityLabel:Ee.toFixed(3)},Tt=[];xe.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Tt.push(["Count:",Xe.countLabel].join(" ")),xe.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Tt.push("P(color \u2229 "+$e+"): "+Xe.probabilityLabel),Tt.push("P("+$e+" | color): "+We.toFixed(3)),Tt.push("P(color | "+$e+"): "+Qe.toFixed(3)));var St=Tt.join("
"),zt=o.mostReadable(he.color,["black","white"]);return{trace:Pe,x:j*(et-se.left),y:Q*(qe-se.top),text:St,color:he.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:zt,fontSize:10,idealAlign:rt,hovertemplate:Pe.hovertemplate,hovertemplateLabels:Xe,eventData:[{data:Pe._input,fullData:Pe,category:$e,count:Ue,probability:Ee,categorycount:ue,colorcount:ie,bandcolorcount:fe}]}}function N(V){if(!V.parcatsViewModel.dragDimension&&V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var se=d.mouse(this)[1];if(se<-1)return;var ae=V.parcatsViewModel.graphDiv,j=ae._fullLayout,Q=j._paperdiv.node().getBoundingClientRect(),re=V.parcatsViewModel.hoveron,he=this;if(re==="color"?(y(he),R(he,"plotly_hover",d.event)):(u(he),m(he,"plotly_hover",d.event)),V.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var xe;re==="category"?xe=L(ae,Q,he):re==="color"?xe=F(ae,Q,he):re==="dimension"&&(xe=z(ae,Q,he)),xe&&E.loneHover(xe,{container:j._hoverlayer.node(),outerContainer:j._paper.node(),gd:ae})}}}function O(V){var se=V.parcatsViewModel;if(!se.dragDimension&&(_(se.pathSelection),M(se.dimensionSelection.selectAll("g.category")),b(se.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(se.graphDiv._fullLayout._hoverlayer.node()),se.pathSelection.sort(h),se.hoverinfoItems.indexOf("skip")===-1)){var ae=V.parcatsViewModel.hoveron,j=this;ae==="color"?R(j,"plotly_unhover",d.event):m(j,"plotly_unhover",d.event)}}function P(V){V.parcatsViewModel.arrangement!=="fixed"&&(V.dragDimensionDisplayInd=V.model.displayInd,V.initialDragDimensionDisplayInds=V.parcatsViewModel.model.dimensions.map(function(se){return se.displayInd}),V.dragHasMoved=!1,V.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(se){var ae=d.mouse(this)[0],j=d.mouse(this)[1];-2<=ae&&ae<=se.width+2&&-2<=j&&j<=se.height+2&&(V.dragCategoryDisplayInd=se.model.displayInd,V.initialDragCategoryDisplayInds=V.model.categories.map(function(Q){return Q.displayInd}),se.model.dragY=se.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(Q){Q.yPe.y+Pe.height/2&&(re.model.displayInd=Pe.model.displayInd,Pe.model.displayInd=xe),V.dragCategoryDisplayInd=re.model.displayInd}if(V.dragCategoryDisplayInd===null||V.parcatsViewModel.arrangement==="freeform"){Q.model.dragX=d.event.x;var qe=V.parcatsViewModel.dimensions[ae],et=V.parcatsViewModel.dimensions[j];qe!==void 0&&Q.model.dragXet.x&&(Q.model.displayInd=et.model.displayInd,et.model.displayInd=V.dragDimensionDisplayInd),V.dragDimensionDisplayInd=Q.model.displayInd}Y(V.parcatsViewModel),G(V.parcatsViewModel),le(V.parcatsViewModel),$(V.parcatsViewModel)}}function B(V){if(V.parcatsViewModel.arrangement!=="fixed"&&V.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var se={},ae=X(V.parcatsViewModel),j=V.parcatsViewModel.model.dimensions.map(function(et){return et.displayInd}),Q=V.initialDragDimensionDisplayInds.some(function(et,rt){return et!==j[rt]});Q&&j.forEach(function(et,rt){var $e=V.parcatsViewModel.model.dimensions[rt].containerInd;se["dimensions["+$e+"].displayindex"]=et});var re=!1;if(V.dragCategoryDisplayInd!==null){var he=V.model.categories.map(function(et){return et.displayInd});if(re=V.initialDragCategoryDisplayInds.some(function(et,rt){return et!==he[rt]}),re){var xe=V.model.categories.slice().sort(function(et,rt){return et.displayInd-rt.displayInd}),Te=xe.map(function(et){return et.categoryValue}),Le=xe.map(function(et){return et.categoryLabel});se["dimensions["+V.model.containerInd+"].categoryarray"]=[Te],se["dimensions["+V.model.containerInd+"].ticktext"]=[Le],se["dimensions["+V.model.containerInd+"].categoryorder"]="array"}}if(V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!V.dragHasMoved&&V.potentialClickBand&&(V.parcatsViewModel.hoveron==="color"?R(V.potentialClickBand,"plotly_click",d.event.sourceEvent):m(V.potentialClickBand,"plotly_click",d.event.sourceEvent)),V.model.dragX=null,V.dragCategoryDisplayInd!==null){var Pe=V.parcatsViewModel.dimensions[V.dragDimensionDisplayInd].categories[V.dragCategoryDisplayInd];Pe.model.dragY=null,V.dragCategoryDisplayInd=null}V.dragDimensionDisplayInd=null,V.parcatsViewModel.dragDimension=null,V.dragHasMoved=null,V.potentialClickBand=null,Y(V.parcatsViewModel),G(V.parcatsViewModel);var qe=d.transition().duration(300).ease("cubic-in-out");qe.each(function(){le(V.parcatsViewModel,!0),$(V.parcatsViewModel,!0)}).each("end",function(){(Q||re)&&S.restyle(V.parcatsViewModel.graphDiv,se,[ae])})}}function X(V){for(var se,ae=V.graphDiv._fullData,j=0;j=0;Te--)Le+="C"+he[Te]+","+(se[Te+1]+j)+" "+re[Te]+","+(se[Te]+j)+" "+(V[Te]+ae[Te])+","+(se[Te]+j),Le+="l-"+ae[Te]+",0 ";return Le+="Z",Le}function G(V){var se=V.dimensions,ae=V.model,j=se.map(function(Or){return Or.categories.map(function(wr){return wr.y})}),Q=V.model.dimensions.map(function(Or){return Or.categories.map(function(wr){return wr.displayInd})}),re=V.model.dimensions.map(function(Or){return Or.displayInd}),he=V.dimensions.map(function(Or){return Or.model.dimensionInd}),xe=se.map(function(Or){return Or.x}),Te=se.map(function(Or){return Or.width}),Le=[];for(var Pe in ae.paths)ae.paths.hasOwnProperty(Pe)&&Le.push(ae.paths[Pe]);function qe(Or){var wr=Or.categoryInds.map(function(mt,ze){return Q[ze][mt]}),Er=he.map(function(mt){return wr[mt]});return Er}Le.sort(function(Or,wr){var Er=qe(Or),mt=qe(wr);return V.sortpaths==="backward"&&(Er.reverse(),mt.reverse()),Er.push(Or.valueInds[0]),mt.push(wr.valueInds[0]),V.bundlecolors&&(Er.unshift(Or.rawColor),mt.unshift(wr.rawColor)),Ermt?1:0});for(var et=new Array(Le.length),rt=se[0].model.count,$e=se[0].categories.map(function(Or){return Or.height}).reduce(function(Or,wr){return Or+wr}),Ue=0;Ue0?ue=$e*(fe.count/rt):ue=0;for(var ie=new Array(j.length),Ee=0;Ee1?he=(V.width-2*ae-j)/(Q-1):he=0,xe=ae,Te=xe+he*re;var Le=[],Pe=V.model.maxCats,qe=se.categories.length,et=8,rt=se.count,$e=V.height-et*(Pe-1),Ue,fe,ue,ie,Ee,We=(Pe-qe)*et/2,Qe=se.categories.map(function(Xe){return{displayInd:Xe.displayInd,categoryInd:Xe.categoryInd}});for(Qe.sort(function(Xe,Tt){return Xe.displayInd-Tt.displayInd}),Ee=0;Ee0?Ue=fe.count/rt*$e:Ue=0,ue={key:fe.valueInds[0],model:fe,width:j,height:Ue,y:fe.dragY!==null?fe.dragY:We,bands:[],parcatsViewModel:V},We=We+Ue+et,Le.push(ue);return{key:se.dimensionInd,x:se.dragX!==null?se.dragX:Te,y:0,width:j,model:se,categories:Le,parcatsViewModel:V,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),MT=Ge({"src/traces/parcats/plot.js"(Z,q){"use strict";var d=Q8();q.exports=function(S,E,e,t){var r=S._fullLayout,o=r._paper,a=r._size;d(S,o,E,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),eI=Ge({"src/traces/parcats/base_plot.js"(Z){"use strict";var q=Bf().getModuleCalcData,d=MT(),x="parcats";Z.name=x,Z.plot=function(S,E,e,t){var r=q(S.calcdata,x);if(r.length){var o=r[0];d(S,o,e,t)}},Z.clean=function(S,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),tI=Ge({"src/traces/parcats/index.js"(Z,q){"use strict";q.exports={attributes:ST(),supplyDefaults:J8(),calc:$8(),plot:MT(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:eI(),categories:["noOpacity"],meta:{}}}}),rI=Ge({"lib/parcats.js"(Z,q){"use strict";q.exports=tI()}}),ld=Ge({"src/plots/mapbox/constants.js"(Z,q){"use strict";var d=Cd(),x="1.13.4",S='\xA9 OpenStreetMap contributors',E=['\xA9 Carto',S].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:S,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);q.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",o.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),zg=We({"src/plots/mapbox/layout_attributes.js"(Z,V){"use strict";var d=aa(),x=Fi().defaultLine,A=Uu().attributes,E=_u(),e=vc().textposition,t=Iu().overrideAll,r=sl().templatedArray,o=td(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=V.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),H_=We({"src/traces/scattermapbox/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:A}=wl(),E=uv(),e=Up(),t=vc(),r=zg(),o=El(),a=Zl(),i=Fo().extendFlat,n=Iu().overrideAll,s=zg(),h=e.line,c=e.marker;V.exports=n({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:A({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},a("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:A()},"calc","nested")}}),TT=We({"src/traces/scattermapbox/constants.js"(Z,V){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),rI=We({"src/traces/scattermapbox/defaults.js"(Z,V){"use strict";var d=aa(),x=au(),A=Oh(),E=Gh(),e=Hh(),t=fv(),r=H_(),o=TT().isSupportedFont;V.exports=function(n,s,h,c){function m(g,f){return d.coerce(n,s,r,g,f)}function p(g,f){return d.coerce2(n,s,r,g,f)}var T=a(n,s,m);if(!T){s.visible=!1;return}if(m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),m("below"),x.hasMarkers(s)){A(n,s,h,c,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,h,c,m,{noDash:!0}),m("connectgaps"));var _=p("cluster.maxzoom"),w=p("cluster.step"),S=p("cluster.color",s.marker&&s.marker.color||h),M=p("cluster.size"),y=p("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||M!==!1||y!==!1,v=m("cluster.enabled",b);if(v||x.hasText(s)){var u=c.font.family;e(n,s,c,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}m("fill"),s.fill!=="none"&&t(n,s,h,m),d.coerceSelectionMarkerOpacity(s,m)};function a(i,n,s){var h=s("lon")||[],c=s("lat")||[],m=Math.min(h.length,c.length);return n._length=m,m}}}),AT=We({"src/traces/scattermapbox/format_labels.js"(Z,V){"use strict";var d=Mo();V.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),ST=We({"src/plots/mapbox/convert_text_opts.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var h;return n[0]&&n[1]?h=n.join("-"):n[0]?h=n[0]:n[1]?h=n[1]:h="center",{anchor:h,offset:s}}}}),aI=We({"src/traces/scattermapbox/convert.js"(Z,V){"use strict";var d=Uo(),x=aa(),A=bs().BADNUM,E=Vd(),e=xu(),t=Oo(),r=C0(),o=au(),a=TT().isSupportedFont,i=ST(),n=Th().appendArrayPointValue,s=zl().NEWLINES,h=zl().BR_TAG_ALL;V.exports=function(y,b){var v=b[0].trace,u=v.visible===!0&&v._length!==0,g=v.fill!=="none",f=o.hasLines(v),P=o.hasMarkers(v),L=o.hasText(v),z=P&&v.marker.symbol==="circle",F=P&&v.marker.symbol!=="circle",B=v.cluster&&v.cluster.enabled,O=c("fill"),I=c("line"),N=c("circle"),U=c("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((g||f)&&(Q=E.calcTraceToLineCoords(b)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":v.fillcolor})),f&&(I.geojson=E.makeLine(Q),I.layout.visibility="visible",x.extendFlat(I.paint,{"line-width":v.line.width,"line-color":v.line.color,"line-opacity":v.opacity})),z){var le=m(b);N.geojson=le.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],W.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(v.cluster.color,v.cluster.step),"circle-radius":w(v.cluster.size,v.cluster.step),"circle-opacity":w(v.cluster.opacity,v.cluster.step)}},W.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(v),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":le.mcc,"circle-radius":le.mrc,"circle-opacity":le.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||L)&&(U.geojson=p(b,y),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":v.marker.size/10}),"angle"in v.marker&&v.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=v.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":v.opacity*v.marker.opacity,"icon-color":v.marker.color})),L)){var se=(v.marker||{}).size,he=i(v.textposition,se);x.extendFlat(U.layout,{"text-size":v.textfont.size,"text-anchor":he.anchor,"text-offset":he.offset,"text-font":S(v)}),x.extendFlat(U.paint,{"text-color":v.textfont.color,"text-opacity":v.opacity})}return W};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(M){var y=M[0].trace,b=y.marker,v=y.selectedpoints,u=x.isArrayOrTypedArray(b.color),g=x.isArrayOrTypedArray(b.size),f=x.isArrayOrTypedArray(b.opacity),P;function L(se){return y.opacity*se}function z(se){return se/2}var F;u&&(e.hasColorscale(y,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;g&&(B=r(y));var O;f&&(O=function(se){var he=d(se)?+x.constrain(se,0,1):0;return L(he)});var I=[];for(P=0;P850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",g[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),nI=We({"src/traces/scattermapbox/plot.js"(Z,V){"use strict";var d=aa(),x=aI(),A=td().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,h=this.subplot.getMapLayers(),c=0;c=0;f--){var P=g[f];n.removeLayer(p.layerIds[P])}u||n.removeSource(p.sourceIds.circle)}function _(u){for(var g=E.nonCluster,f=0;f=0;f--){var P=g[f];n.removeLayer(p.layerIds[P]),u||n.removeSource(p.sourceIds[P])}}function S(u){m?l(u):w(u)}function M(u){c?T(u):_(u)}function y(){for(var u=c?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},V.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,h=new e(o,i.uid,n,s),c=x(o.gd,a),m=h.below=o.belowLookup["trace-"+i.uid],p,T,l;if(n)for(h.addSource("circle",c.circle,i.cluster),p=0;p=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,y=i-M;function b(B){var O=B.lonlat;if(O[0]===e||_&&T.indexOf(B.i+1)===-1)return 1/0;var I=x.modHalf(O[0],360),N=O[1],U=p.project([I,N]),W=U.x-c.c2p([y,N]),Q=U.y-m.c2p([I,n]),le=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-le,1-3/le)}if(d.getClosest(s,b,a),a.index!==!1){var v=s[a.index],u=v.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],f=c.c2p(g),P=m.c2p(g),L=v.mrc||1;a.x0=f-L,a.x1=f+L,a.y0=P-L,a.y1=P+L;var z={};z[h.subplot]={_subplot:p};var F=h._module.formatLabels(v,h,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(h,v),a.extraText=o(h,v,s[0].t.labels),a.hovertemplate=h.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,h=s.split("+"),c=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,p=h.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return c||m&&p?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(n.lon+_(T[0])):p&&l.push(n.lat+_(T[1])),(c||h.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}V.exports={hoverPoints:r,getExtraText:o}}}),iI=We({"src/traces/scattermapbox/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),oI=We({"src/traces/scattermapbox/select.js"(Z,V){"use strict";var d=aa(),x=au(),A=bs().BADNUM;V.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var G,ie,ye,Pe,je;for(ye=k,je=0;je<8;je++){if(Pe=this.sampleCurveX(ye)-k,Math.abs(Pe)ie)return ie;for(;GPe?G=ye:ie=ye,ye=(ie-G)*.5+G}return ye},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=n;function n(k,C){this.x=k,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,G=k.y-this.y;return C*C+G*G},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,G=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=G,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),G=Math.sin(k),ie=C*this.x-G*this.y,ye=G*this.x+C*this.y;return this.x=ie,this.y=ye,this},_rotateAround:function(k,C){var G=Math.cos(k),ie=Math.sin(k),ye=C.x+G*(this.x-C.x)-ie*(this.y-C.y),Pe=C.y+ie*(this.x-C.x)+G*(this.y-C.y);return this.x=ye,this.y=Pe,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(k){return k instanceof n?k:Array.isArray(k)?new n(k[0],k[1]):k};var s=typeof self<"u"?self:{};function h(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var G=0;G=1)return 1;var C=k*k,G=C*k;return 4*(k<.5?G:3*(k-C)+G-.75)}function p(k,C,G,ie){var ye=new o(k,C,G,ie);return function(Pe){return ye.solve(Pe)}}var T=p(.25,.1,.25,1);function l(k,C,G){return Math.min(G,Math.max(C,k))}function _(k,C,G){var ie=G-C,ye=((k-C)%ie+ie)%ie+C;return ye===C?G:ye}function w(k,C,G){if(!k.length)return G(null,[]);var ie=k.length,ye=new Array(k.length),Pe=null;k.forEach(function(je,ut){C(je,function(Lt,Ut){Lt&&(Pe=Lt),ye[ut]=Ut,--ie===0&&G(Pe,ye)})})}function S(k){var C=[];for(var G in k)C.push(k[G]);return C}function M(k,C){var G=[];for(var ie in k)ie in C||G.push(ie);return G}function y(k){for(var C=[],G=arguments.length-1;G-- >0;)C[G]=arguments[G+1];for(var ie=0,ye=C;ie>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function f(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function P(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(G){C[G]&&(C[G]=C[G].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,G){var ie={};for(var ye in k)ie[ye]=C.call(G||this,k[ye],ye,k);return ie}function B(k,C,G){var ie={};for(var ye in k)C.call(G||this,k[ye],ye,k)&&(ie[ye]=k[ye]);return ie}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function I(k,C){for(var G=0;G=0)return!0;return!1}var N={};function U(k){N[k]||(typeof console<"u"&&console.warn(k),N[k]=!0)}function W(k,C,G){return(G.y-k.y)*(C.x-k.x)>(C.y-k.y)*(G.x-k.x)}function Q(k){for(var C=0,G=0,ie=k.length,ye=ie-1,Pe=void 0,je=void 0;G@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,G={};if(k.replace(C,function(ye,Pe,je,ut){var Lt=je||ut;return G[Pe]=Lt?Lt.toLowerCase():!0,""}),G["max-age"]){var ie=parseInt(G["max-age"],10);isNaN(ie)?delete G["max-age"]:G["max-age"]=ie}return G}var q=null;function $(k){if(q==null){var C=k.navigator?k.navigator.userAgent:null;q=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return q}function J(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function X(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,G){return String.fromCharCode(+("0x"+G))}))}function oe(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ne=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ee=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,re,ue,_e={now:ne,frame:function(C){var G=j(C);return{cancel:function(){return ee(G)}}},getImageData:function(C,G){G===void 0&&(G=0);var ie=s.document.createElement("canvas"),ye=ie.getContext("2d");if(!ye)throw new Error("failed to create canvas 2d context");return ie.width=C.width,ie.height=C.height,ye.drawImage(C,0,0,C.width,C.height),ye.getImageData(-G,-G,C.width+2*G,C.height+2*G)},resolveURL:function(C){return re||(re=s.document.createElement("a")),re.href=C,re.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ue==null&&(ue=s.matchMedia("(prefers-reduced-motion: reduce)")),ue.matches):!1}},Te={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ie={supported:!1,testSupport:$e},De,He=!1,et,rt=!1;s.document&&(et=s.document.createElement("img"),et.onload=function(){De&&ot(De),De=null,rt=!0},et.onerror=function(){He=!0,De=null},et.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function $e(k){He||!et||(rt?ot(k):De=k)}function ot(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,et),k.isContextLost())return;Ie.supported=!0}catch{}k.deleteTexture(C),He=!0}var Ae="01";function ge(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",G="",ie=0;ie<10;ie++)G+=C[Math.floor(Math.random()*62)];var ye=720*60*1e3,Pe=[k,Ae,G].join(""),je=Date.now()+ye;return{token:Pe,tokenExpiresAt:je}}var ce=function(C,G){this._transformRequestFn=C,this._customAccessToken=G,this._createSkuToken()};ce.prototype._createSkuToken=function(){var C=ge();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ce.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ce.prototype.transformRequest=function(C,G){return this._transformRequestFn?this._transformRequestFn(C,G)||{url:C}:{url:C}},ce.prototype.normalizeStyleURL=function(C,G){if(!ze(C))return C;var ie=Bt(C);return ie.path="/styles/v1"+ie.path,this._makeAPIURL(ie,this._customAccessToken||G)},ce.prototype.normalizeGlyphsURL=function(C,G){if(!ze(C))return C;var ie=Bt(C);return ie.path="/fonts/v1"+ie.path,this._makeAPIURL(ie,this._customAccessToken||G)},ce.prototype.normalizeSourceURL=function(C,G){if(!ze(C))return C;var ie=Bt(C);return ie.path="/v4/"+ie.authority+".json",ie.params.push("secure"),this._makeAPIURL(ie,this._customAccessToken||G)},ce.prototype.normalizeSpriteURL=function(C,G,ie,ye){var Pe=Bt(C);return ze(C)?(Pe.path="/styles/v1"+Pe.path+"/sprite"+G+ie,this._makeAPIURL(Pe,this._customAccessToken||ye)):(Pe.path+=""+G+ie,jt(Pe))},ce.prototype.normalizeTileURL=function(C,G){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!ze(C))return C;var ie=Bt(C),ye=/(\.(png|jpg)\d*)(?=$)/,Pe=/^.+\/v4\//,je=_e.devicePixelRatio>=2||G===512?"@2x":"",ut=Ie.supported?".webp":"$1";ie.path=ie.path.replace(ye,""+je+ut),ie.path=ie.path.replace(Pe,"/"),ie.path="/v4"+ie.path;var Lt=this._customAccessToken||kt(ie.params)||Te.ACCESS_TOKEN;return Te.REQUIRE_ACCESS_TOKEN&&Lt&&this._skuToken&&ie.params.push("sku="+this._skuToken),this._makeAPIURL(ie,Lt)},ce.prototype.canonicalizeTileURL=function(C,G){var ie="/v4/",ye=/\.[\w]+$/,Pe=Bt(C);if(!Pe.path.match(/(^\/v4\/)/)||!Pe.path.match(ye))return C;var je="mapbox://tiles/";je+=Pe.path.replace(ie,"");var ut=Pe.params;return G&&(ut=ut.filter(function(Lt){return!Lt.match(/^access_token=/)})),ut.length&&(je+="?"+ut.join("&")),je},ce.prototype.canonicalizeTileset=function(C,G){for(var ie=G?ze(G):!1,ye=[],Pe=0,je=C.tiles||[];Pe=0&&C.params.splice(Pe,1)}if(ye.path!=="/"&&(C.path=""+ye.path+C.path),!Te.REQUIRE_ACCESS_TOKEN)return jt(C);if(G=G||Te.ACCESS_TOKEN,!G)throw new Error("An API access token is required to use Mapbox GL. "+ie);if(G[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+ie);return C.params=C.params.filter(function(je){return je.indexOf("access_token")===-1}),C.params.push("access_token="+G),jt(C)};function ze(k){return k.indexOf("mapbox:")===0}var Qe=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function nt(k){return Qe.test(k)}function Ke(k){return k.indexOf("sku=")>0&&nt(k)}function kt(k){for(var C=0,G=k;C=1&&s.localStorage.setItem(G,JSON.stringify(this.eventData))}catch{U("Unable to write to LocalStorage")}},Or.prototype.processRequests=function(C){},Or.prototype.postEvent=function(C,G,ie,ye){var Pe=this;if(Te.EVENTS_URL){var je=Bt(Te.EVENTS_URL);je.params.push("access_token="+(ye||Te.ACCESS_TOKEN||""));var ut={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Ae,userId:this.anonId},Lt=G?y(ut,G):ut,Ut={url:jt(je),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Lt])};this.pendingRequest=ia(Ut,function(Kt){Pe.pendingRequest=null,ie(Kt),Pe.saveEventData(),Pe.processRequests(ye)})}},Or.prototype.queueRequest=function(C,G){this.queue.push(C),this.processRequests(G)};var mr=(function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(ie,ye,Pe,je){this.skuToken=Pe,(Te.EVENTS_URL&&je||Te.ACCESS_TOKEN&&Array.isArray(ie)&&ie.some(function(ut){return ze(ut)||nt(ut)}))&&this.queueRequest({id:ye,timestamp:Date.now()},je)},C.prototype.processRequests=function(ie){var ye=this;if(!(this.pendingRequest||this.queue.length===0)){var Pe=this.queue.shift(),je=Pe.id,ut=Pe.timestamp;je&&this.success[je]||(this.anonId||this.fetchEventData(),P(this.anonId)||(this.anonId=g()),this.postEvent(ut,{skuToken:this.skuToken},function(Lt){Lt||je&&(ye.success[je]=!0)},ie))}},C})(Or),Er=(function(k){function C(G){k.call(this,"appUserTurnstile"),this._customAccessToken=G}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(ie,ye){Te.EVENTS_URL&&Te.ACCESS_TOKEN&&Array.isArray(ie)&&ie.some(function(Pe){return ze(Pe)||nt(Pe)})&&this.queueRequest(Date.now(),ye)},C.prototype.processRequests=function(ie){var ye=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Pe=pr(Te.ACCESS_TOKEN),je=Pe?Pe.u:Te.ACCESS_TOKEN,ut=je!==this.eventData.tokenU;P(this.anonId)||(this.anonId=g(),ut=!0);var Lt=this.queue.shift();if(this.eventData.lastSuccess){var Ut=new Date(this.eventData.lastSuccess),Kt=new Date(Lt),Mr=(Lt-this.eventData.lastSuccess)/(1440*60*1e3);ut=ut||Mr>=1||Mr<-1||Ut.getDate()!==Kt.getDate()}else ut=!0;if(!ut)return this.processRequests();this.postEvent(Lt,{"enabled.telemetry":!1},function(qr){qr||(ye.eventData.lastSuccess=Lt,ye.eventData.tokenU=je)},ie)}},C})(Or),yt=new Er,Oe=yt.postTurnstileEvent.bind(yt),Xe=new mr,be=Xe.postMapLoadEvent.bind(Xe),Ce="mapbox-tiles",Ne=500,Ee=50,Se=1e3*60*7,Le;function at(){s.caches&&!Le&&(Le=s.caches.open(Ce))}var dt;function gt(k,C){if(dt===void 0)try{new Response(new ReadableStream),dt=!0}catch{dt=!1}dt?C(k.body):k.blob().then(C)}function Ct(k,C,G){if(at(),!!Le){var ie={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(je,ut){return ie.headers.set(ut,je)});var ye=he(C.headers.get("Cache-Control")||"");if(!ye["no-store"]){ye["max-age"]&&ie.headers.set("Expires",new Date(G+ye["max-age"]*1e3).toUTCString());var Pe=new Date(ie.headers.get("Expires")).getTime()-G;PeDate.now()&&!G["no-cache"]}var Sr=1/0;function oa(k){Sr++,Sr>Ee&&(k.getActor().send("enforceCacheSizeLimit",Ne),Sr=0)}function Ea(k){at(),Le&&Le.then(function(C){C.keys().then(function(G){for(var ie=0;ie=200&&G.status<300||G.status===0)&&G.response!==null){var ye=G.response;if(k.type==="json")try{ye=JSON.parse(G.response)}catch(Pe){return C(Pe)}C(null,ye,G.getResponseHeader("Cache-Control"),G.getResponseHeader("Expires"))}else C(new gn(G.statusText,G.status,k.url))},G.send(k.body),{cancel:function(){return G.abort()}}}var Rr=function(k,C){if(!It(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Gt(k,C);if(se()&&self.worker&&self.worker.actor){var G=!0;return self.worker.actor.send("getResource",k,C,void 0,G)}}return Xt(k,C)},Yr=function(k,C){return Rr(y(k,{type:"json"}),C)},Jr=function(k,C){return Rr(y(k,{type:"arrayBuffer"}),C)},ia=function(k,C){return Rr(y(k,{method:"POST"}),C)};function Pa(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var Ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ja(k,C,G,ie){var ye=new s.Image,Pe=s.URL;ye.onload=function(){C(null,ye),Pe.revokeObjectURL(ye.src),ye.onload=null,s.requestAnimationFrame(function(){ye.src=Ga})},ye.onerror=function(){return C(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var je=new s.Blob([new Uint8Array(k)],{type:"image/png"});ye.cacheControl=G,ye.expires=ie,ye.src=k.byteLength?Pe.createObjectURL(je):Ga}function Xa(k,C){var G=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(G).then(function(ie){C(null,ie)}).catch(function(ie){C(new Error("Could not load image because of "+ie.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var sn,Ma,Xn=function(){sn=[],Ma=0};Xn();var Kn=function(k,C){if(Ie.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Ma>=Te.MAX_PARALLEL_IMAGE_REQUESTS){var G={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return sn.push(G),G}Ma++;var ie=!1,ye=function(){if(!ie)for(ie=!0,Ma--;sn.length&&Ma0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Tr.prototype.setEventedParent=function(C,G){return this._eventedParent=C,this._eventedParentData=G,this};var Cr=8,Kr={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Nr={"*":{type:"source"}},_t=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Wt={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ar={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Vr={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},ma={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},ba={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},wa={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},$r={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},ga=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],jn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},an={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ei={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},li={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_i={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},xi={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Pi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Li={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ri={type:"array",value:"*"},vo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Eo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},uo={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ao={type:"array",value:"*",minimum:1},mo={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Bo=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Go={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},Ko={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},Qi={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},eo={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ei={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Xi={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Jo={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ms={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_s={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},ko={"*":{type:"string"}},Nn={$version:Cr,$root:Kr,sources:Nr,source:_t,source_vector:Wt,source_raster:Ar,source_raster_dem:Vr,source_geojson:ma,source_video:ba,source_image:wa,layer:$r,layout:ga,layout_background:jn,layout_fill:an,layout_circle:ei,layout_heatmap:li,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:_i,layout_symbol:xi,layout_raster:Pi,layout_hillshade:Li,filter:ri,filter_operator:vo,geometry_type:Eo,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:uo,expression:ao,light:mo,paint:Bo,paint_fill:Go,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:Ko,paint_circle:Qi,paint_heatmap:eo,paint_symbol:Ei,paint_raster:Xi,paint_hillshade:Jo,paint_background:ms,transition:_s,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:ko},pi=function(C,G,ie,ye){this.message=(C?C+": ":"")+ie,ye&&(this.identifier=ye),G!=null&&G.__line__&&(this.line=G.__line__)};function gs(k){var C=k.key,G=k.value;return G?[new pi(C,G,"constants have been deprecated as of v8")]:[]}function Io(k){for(var C=[],G=arguments.length-1;G-- >0;)C[G]=arguments[G+1];for(var ie=0,ye=C;ie":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var ll=[el,ci,oo,so,js,jo,Es,ks(Ni),hs];function ql(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!ql(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var G=0,ie=ll;G255?255:Ut}function ye(Ut){return Ut<0?0:Ut>1?1:Ut}function Pe(Ut){return Ut[Ut.length-1]==="%"?ie(parseFloat(Ut)/100*255):ie(parseInt(Ut))}function je(Ut){return Ut[Ut.length-1]==="%"?ye(parseFloat(Ut)/100):ye(parseFloat(Ut))}function ut(Ut,Kt,Mr){return Mr<0?Mr+=1:Mr>1&&(Mr-=1),Mr*6<1?Ut+(Kt-Ut)*Mr*6:Mr*2<1?Kt:Mr*3<2?Ut+(Kt-Ut)*(2/3-Mr)*6:Ut}function Lt(Ut){var Kt=Ut.replace(/ /g,"").toLowerCase();if(Kt in G)return G[Kt].slice();if(Kt[0]==="#"){if(Kt.length===4){var Mr=parseInt(Kt.substr(1),16);return Mr>=0&&Mr<=4095?[(Mr&3840)>>4|(Mr&3840)>>8,Mr&240|(Mr&240)>>4,Mr&15|(Mr&15)<<4,1]:null}else if(Kt.length===7){var Mr=parseInt(Kt.substr(1),16);return Mr>=0&&Mr<=16777215?[(Mr&16711680)>>16,(Mr&65280)>>8,Mr&255,1]:null}return null}var qr=Kt.indexOf("("),Fr=Kt.indexOf(")");if(qr!==-1&&Fr+1===Kt.length){var na=Kt.substr(0,qr),La=Kt.substr(qr+1,Fr-(qr+1)).split(","),yn=1;switch(na){case"rgba":if(La.length!==4)return null;yn=je(La.pop());case"rgb":return La.length!==3?null:[Pe(La[0]),Pe(La[1]),Pe(La[2]),yn];case"hsla":if(La.length!==4)return null;yn=je(La.pop());case"hsl":if(La.length!==3)return null;var Ka=(parseFloat(La[0])%360+360)%360/360,qn=je(La[1]),kn=je(La[2]),Vn=kn<=.5?kn*(qn+1):kn+qn-kn*qn,$n=kn*2-Vn;return[ie(ut($n,Vn,Ka+1/3)*255),ie(ut($n,Vn,Ka)*255),ie(ut($n,Vn,Ka-1/3)*255),yn];default:return null}}return null}try{C.parseCSSColor=Lt}catch{}}),ec=kc.parseCSSColor,vs=function(C,G,ie,ye){ye===void 0&&(ye=1),this.r=C,this.g=G,this.b=ie,this.a=ye};vs.parse=function(C){if(C){if(C instanceof vs)return C;if(typeof C=="string"){var G=ec(C);if(G)return new vs(G[0]/255*G[3],G[1]/255*G[3],G[2]/255*G[3],G[3])}}},vs.prototype.toString=function(){var C=this.toArray(),G=C[0],ie=C[1],ye=C[2],Pe=C[3];return"rgba("+Math.round(G)+","+Math.round(ie)+","+Math.round(ye)+","+Pe+")"},vs.prototype.toArray=function(){var C=this,G=C.r,ie=C.g,ye=C.b,Pe=C.a;return Pe===0?[0,0,0,0]:[G*255/Pe,ie*255/Pe,ye*255/Pe,Pe]},vs.black=new vs(0,0,0,1),vs.white=new vs(1,1,1,1),vs.transparent=new vs(0,0,0,0),vs.red=new vs(1,0,0,1);var Ru=function(C,G,ie){C?this.sensitivity=G?"variant":"case":this.sensitivity=G?"accent":"base",this.locale=ie,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Ru.prototype.compare=function(C,G){return this.collator.compare(C,G)},Ru.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Cc=function(C,G,ie,ye,Pe){this.text=C,this.image=G,this.scale=ie,this.fontStack=ye,this.textColor=Pe},Ll=function(C){this.sections=C};Ll.fromString=function(C){return new Ll([new Cc(C,null,null,null,null)])},Ll.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},Ll.factory=function(C){return C instanceof Ll?C:Ll.fromString(C)},Ll.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},Ll.prototype.serialize=function(){for(var C=["format"],G=0,ie=this.sections;G=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof G=="number"&&G>=0&&G<=255)){var ye=typeof ie=="number"?[k,C,G,ie]:[k,C,G];return"Invalid rgba value ["+ye.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ie>"u"||typeof ie=="number"&&ie>=0&&ie<=1?null:"Invalid rgba value ["+[k,C,G,ie].join(", ")+"]: 'a' must be between 0 and 1."}function nu(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof vs)return!0;if(k instanceof Ru)return!0;if(k instanceof Ll)return!0;if(k instanceof nl)return!0;if(Array.isArray(k)){for(var C=0,G=k;C2){var ut=C[1];if(typeof ut!="string"||!(ut in Au)||ut==="object")return G.error('The item type argument of "array" must be one of string, number, boolean',1);je=Au[ut],ie++}else je=Ni;var Lt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return G.error('The length argument to "array" must be a positive integer literal',2);Lt=C[2],ie++}ye=ks(je,Lt)}else ye=Au[Pe];for(var Ut=[];ie1)&&G.push(ye)}}return G.concat(this.args.map(function(Pe){return Pe.serialize()}))};var lu=function(C){this.type=jo,this.sections=C};lu.parse=function(C,G){if(C.length<2)return G.error("Expected at least one argument.");var ie=C[1];if(!Array.isArray(ie)&&typeof ie=="object")return G.error("First argument must be an image or text section.");for(var ye=[],Pe=!1,je=1;je<=C.length-1;++je){var ut=C[je];if(Pe&&typeof ut=="object"&&!Array.isArray(ut)){Pe=!1;var Lt=null;if(ut["font-scale"]&&(Lt=G.parse(ut["font-scale"],1,ci),!Lt))return null;var Ut=null;if(ut["text-font"]&&(Ut=G.parse(ut["text-font"],1,ks(oo)),!Ut))return null;var Kt=null;if(ut["text-color"]&&(Kt=G.parse(ut["text-color"],1,js),!Kt))return null;var Mr=ye[ye.length-1];Mr.scale=Lt,Mr.font=Ut,Mr.textColor=Kt}else{var qr=G.parse(C[je],1,Ni);if(!qr)return null;var Fr=qr.type.kind;if(Fr!=="string"&&Fr!=="value"&&Fr!=="null"&&Fr!=="resolvedImage")return G.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Pe=!0,ye.push({content:qr,scale:null,font:null,textColor:null})}}return new lu(ye)},lu.prototype.evaluate=function(C){var G=function(ie){var ye=ie.content.evaluate(C);return Rs(ye)===hs?new Cc("",ye,null,null,null):new Cc(Gs(ye),null,ie.scale?ie.scale.evaluate(C):null,ie.font?ie.font.evaluate(C).join(","):null,ie.textColor?ie.textColor.evaluate(C):null)};return new Ll(this.sections.map(G))},lu.prototype.eachChild=function(C){for(var G=0,ie=this.sections;G-1),ie},Us.prototype.eachChild=function(C){C(this.input)},Us.prototype.outputDefined=function(){return!1},Us.prototype.serialize=function(){return["image",this.input.serialize()]};var _f={"to-boolean":so,"to-color":js,"to-number":ci,"to-string":oo},qo=function(C,G){this.type=C,this.args=G};qo.parse=function(C,G){if(C.length<2)return G.error("Expected at least one argument.");var ie=C[0];if((ie==="to-boolean"||ie==="to-string")&&C.length!==2)return G.error("Expected one argument.");for(var ye=_f[ie],Pe=[],je=1;je4?ie="Invalid rbga value "+JSON.stringify(G)+": expected an array containing either three or four numeric values.":ie=Tu(G[0],G[1],G[2],G[3]),!ie))return new vs(G[0]/255,G[1]/255,G[2]/255,G[3])}throw new ws(ie||"Could not parse color from value '"+(typeof G=="string"?G:String(JSON.stringify(G)))+"'")}else if(this.type.kind==="number"){for(var Lt=null,Ut=0,Kt=this.args;Ut=C[2]||k[1]<=C[1]||k[3]>=C[3])}function Kc(k,C){var G=ju(k[0]),ie=dc(k[1]),ye=Math.pow(2,C.z);return[Math.round(G*ye*hl),Math.round(ie*ye*hl)]}function Fc(k,C,G){var ie=k[0]-C[0],ye=k[1]-C[1],Pe=k[0]-G[0],je=k[1]-G[1];return ie*je-Pe*ye===0&&ie*Pe<=0&&ye*je<=0}function pc(k,C,G){return C[1]>k[1]!=G[1]>k[1]&&k[0]<(G[0]-C[0])*(k[1]-C[1])/(G[1]-C[1])+C[0]}function tc(k,C){for(var G=!1,ie=0,ye=C.length;ie0&&Mr<0||Kt<0&&Mr>0}function Pc(k,C,G,ie){var ye=[C[0]-k[0],C[1]-k[1]],Pe=[ie[0]-G[0],ie[1]-G[1]];return Bc(Pe,ye)===0?!1:!!(cu(k,C,G,ie)&&cu(G,ie,k,C))}function Su(k,C,G){for(var ie=0,ye=G;ieG[2]){var ye=ie*.5,Pe=k[0]-G[0]>ye?-ie:G[0]-k[0]>ye?ie:0;Pe===0&&(Pe=k[0]-G[2]>ye?-ie:G[2]-k[0]>ye?ie:0),k[0]+=Pe}Lc(C,k)}function Ic(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function sf(k,C,G,ie){for(var ye=Math.pow(2,ie.z)*hl,Pe=[ie.x*hl,ie.y*hl],je=[],ut=0,Lt=k;ut=0)return!1;var G=!0;return k.eachChild(function(ie){G&&!Jl(ie,C)&&(G=!1)}),G}var qu=function(C,G){this.type=G.type,this.name=C,this.boundExpression=G};qu.parse=function(C,G){if(C.length!==2||typeof C[1]!="string")return G.error("'var' expression requires exactly one string literal argument.");var ie=C[1];return G.scope.has(ie)?new qu(ie,G.scope.get(ie)):G.error('Unknown variable "'+ie+'". Make sure "'+ie+'" has been bound in an enclosing "let" expression before using it.',1)},qu.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},qu.prototype.eachChild=function(){},qu.prototype.outputDefined=function(){return!1},qu.prototype.serialize=function(){return["var",this.name]};var Ds=function(C,G,ie,ye,Pe){G===void 0&&(G=[]),ye===void 0&&(ye=new fs),Pe===void 0&&(Pe=[]),this.registry=C,this.path=G,this.key=G.map(function(je){return"["+je+"]"}).join(""),this.scope=ye,this.errors=Pe,this.expectedType=ie};Ds.prototype.parse=function(C,G,ie,ye,Pe){return Pe===void 0&&(Pe={}),G?this.concat(G,ie,ye)._parse(C,Pe):this._parse(C,Pe)},Ds.prototype._parse=function(C,G){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function ie(Kt,Mr,qr){return qr==="assert"?new fl(Mr,[Kt]):qr==="coerce"?new qo(Mr,[Kt]):Kt}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var ye=C[0];if(typeof ye!="string")return this.error("Expression name must be a string, but found "+typeof ye+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Pe=this.registry[ye];if(Pe){var je=Pe.parse(C,this);if(!je)return null;if(this.expectedType){var ut=this.expectedType,Lt=je.type;if((ut.kind==="string"||ut.kind==="number"||ut.kind==="boolean"||ut.kind==="object"||ut.kind==="array")&&Lt.kind==="value")je=ie(je,ut,G.typeAnnotation||"assert");else if((ut.kind==="color"||ut.kind==="formatted"||ut.kind==="resolvedImage")&&(Lt.kind==="value"||Lt.kind==="string"))je=ie(je,ut,G.typeAnnotation||"coerce");else if(this.checkSubtype(ut,Lt))return null}if(!(je instanceof Qo)&&je.type.kind!=="resolvedImage"&&Du(je)){var Ut=new is;try{je=new Qo(je.type,je.evaluate(Ut))}catch(Kt){return this.error(Kt.message),null}}return je}return this.error('Unknown expression "'+ye+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},Ds.prototype.concat=function(C,G,ie){var ye=typeof C=="number"?this.path.concat(C):this.path,Pe=ie?this.scope.concat(ie):this.scope;return new Ds(this.registry,ye,G||null,Pe,this.errors)},Ds.prototype.error=function(C){for(var G=[],ie=arguments.length-1;ie-- >0;)G[ie]=arguments[ie+1];var ye=""+this.key+G.map(function(Pe){return"["+Pe+"]"}).join("");this.errors.push(new rs(ye,C))},Ds.prototype.checkSubtype=function(C,G){var ie=ql(C,G);return ie&&this.error(ie),ie};function Du(k){if(k instanceof qu)return Du(k.boundExpression);if(k instanceof Ui&&k.name==="error")return!1;if(k instanceof uu)return!1;if(k instanceof Kl)return!1;var C=k instanceof qo||k instanceof fl,G=!0;return k.eachChild(function(ie){C?G=G&&Du(ie):G=G&&ie instanceof Qo}),G?Uc(k)&&Jl(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Nl(k,C){for(var G=k.length-1,ie=0,ye=G,Pe=0,je,ut;ie<=ye;)if(Pe=Math.floor((ie+ye)/2),je=k[Pe],ut=k[Pe+1],je<=C){if(Pe===G||CC)ye=Pe-1;else throw new ws("Input is not a number.");return 0}var Gl=function(C,G,ie){this.type=C,this.input=G,this.labels=[],this.outputs=[];for(var ye=0,Pe=ie;ye=ut)return G.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ut);var Mr=G.parse(Lt,Kt,Pe);if(!Mr)return null;Pe=Pe||Mr.type,ye.push([ut,Mr])}return new Gl(Pe,ie,ye)},Gl.prototype.evaluate=function(C){var G=this.labels,ie=this.outputs;if(G.length===1)return ie[0].evaluate(C);var ye=this.input.evaluate(C);if(ye<=G[0])return ie[0].evaluate(C);var Pe=G.length;if(ye>=G[Pe-1])return ie[Pe-1].evaluate(C);var je=Nl(G,ye);return ie[je].evaluate(C)},Gl.prototype.eachChild=function(C){C(this.input);for(var G=0,ie=this.outputs;G0&&C.push(this.labels[G]),C.push(this.outputs[G].serialize());return C};function tl(k,C,G){return k*(1-G)+C*G}function jc(k,C,G){return new vs(tl(k.r,C.r,G),tl(k.g,C.g,G),tl(k.b,C.b,G),tl(k.a,C.a,G))}function $c(k,C,G){return k.map(function(ie,ye){return tl(ie,C[ye],G)})}var iu=Object.freeze({__proto__:null,number:tl,color:jc,array:$c}),Gu=.95047,zu=1,Mf=1.08883,mc=4/29,wc=6/29,ou=3*wc*wc,gc=wc*wc*wc,kl=Math.PI/180,oc=180/Math.PI;function lf(k){return k>gc?Math.pow(k,1/3):k/ou+mc}function Tc(k){return k>wc?k*k*k:ou*(k-mc)}function zs(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Ul(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function $l(k){var C=Ul(k.r),G=Ul(k.g),ie=Ul(k.b),ye=lf((.4124564*C+.3575761*G+.1804375*ie)/Gu),Pe=lf((.2126729*C+.7151522*G+.072175*ie)/zu),je=lf((.0193339*C+.119192*G+.9503041*ie)/Mf);return{l:116*Pe-16,a:500*(ye-Pe),b:200*(Pe-je),alpha:k.a}}function Rc(k){var C=(k.l+16)/116,G=isNaN(k.a)?C:C+k.a/500,ie=isNaN(k.b)?C:C-k.b/200;return C=zu*Tc(C),G=Gu*Tc(G),ie=Mf*Tc(ie),new vs(zs(3.2404542*G-1.5371385*C-.4985314*ie),zs(-.969266*G+1.8760108*C+.041556*ie),zs(.0556434*G-.2040259*C+1.0572252*ie),k.alpha)}function Vs(k,C,G){return{l:tl(k.l,C.l,G),a:tl(k.a,C.a,G),b:tl(k.b,C.b,G),alpha:tl(k.alpha,C.alpha,G)}}function yc(k){var C=$l(k),G=C.l,ie=C.a,ye=C.b,Pe=Math.atan2(ye,ie)*oc;return{h:Pe<0?Pe+360:Pe,c:Math.sqrt(ie*ie+ye*ye),l:G,alpha:k.a}}function Hu(k){var C=k.h*kl,G=k.c,ie=k.l;return Rc({l:ie,a:Math.cos(C)*G,b:Math.sin(C)*G,alpha:k.alpha})}function fu(k,C,G){var ie=C-k;return k+G*(ie>180||ie<-180?ie-360*Math.round(ie/360):ie)}function Ac(k,C,G){return{h:fu(k.h,C.h,G),c:tl(k.c,C.c,G),l:tl(k.l,C.l,G),alpha:tl(k.alpha,C.alpha,G)}}var hu={forward:$l,reverse:Rc,interpolate:Vs},sc={forward:yc,reverse:Hu,interpolate:Ac},Dc=Object.freeze({__proto__:null,lab:hu,hcl:sc}),Cl=function(C,G,ie,ye,Pe){this.type=C,this.operator=G,this.interpolation=ie,this.input=ye,this.labels=[],this.outputs=[];for(var je=0,ut=Pe;je1}))return G.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ye={name:"cubic-bezier",controlPoints:Lt}}else return G.error("Unknown interpolation type "+String(ye[0]),1,0);if(C.length-1<4)return G.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return G.error("Expected an even number of arguments.");if(Pe=G.parse(Pe,2,ci),!Pe)return null;var Ut=[],Kt=null;ie==="interpolate-hcl"||ie==="interpolate-lab"?Kt=js:G.expectedType&&G.expectedType.kind!=="value"&&(Kt=G.expectedType);for(var Mr=0;Mr=qr)return G.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',na);var yn=G.parse(Fr,La,Kt);if(!yn)return null;Kt=Kt||yn.type,Ut.push([qr,yn])}return Kt.kind!=="number"&&Kt.kind!=="color"&&!(Kt.kind==="array"&&Kt.itemType.kind==="number"&&typeof Kt.N=="number")?G.error("Type "+xs(Kt)+" is not interpolatable."):new Cl(Kt,ie,ye,Pe,Ut)},Cl.prototype.evaluate=function(C){var G=this.labels,ie=this.outputs;if(G.length===1)return ie[0].evaluate(C);var ye=this.input.evaluate(C);if(ye<=G[0])return ie[0].evaluate(C);var Pe=G.length;if(ye>=G[Pe-1])return ie[Pe-1].evaluate(C);var je=Nl(G,ye),ut=G[je],Lt=G[je+1],Ut=Cl.interpolationFactor(this.interpolation,ye,ut,Lt),Kt=ie[je].evaluate(C),Mr=ie[je+1].evaluate(C);return this.operator==="interpolate"?iu[this.type.kind.toLowerCase()](Kt,Mr,Ut):this.operator==="interpolate-hcl"?sc.reverse(sc.interpolate(sc.forward(Kt),sc.forward(Mr),Ut)):hu.reverse(hu.interpolate(hu.forward(Kt),hu.forward(Mr),Ut))},Cl.prototype.eachChild=function(C){C(this.input);for(var G=0,ie=this.outputs;G=ie.length)throw new ws("Array index out of bounds: "+G+" > "+(ie.length-1)+".");if(G!==Math.floor(G))throw new ws("Array index must be an integer, but found "+G+" instead.");return ie[G]},Fu.prototype.eachChild=function(C){C(this.index),C(this.input)},Fu.prototype.outputDefined=function(){return!1},Fu.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var vl=function(C,G){this.type=so,this.needle=C,this.haystack=G};vl.parse=function(C,G){if(C.length!==3)return G.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var ie=G.parse(C[1],1,Ni),ye=G.parse(C[2],2,Ni);return!ie||!ye?null:wu(ie.type,[so,oo,ci,el,Ni])?new vl(ie,ye):G.error("Expected first argument to be of type boolean, string, number or null, but found "+xs(ie.type)+" instead")},vl.prototype.evaluate=function(C){var G=this.needle.evaluate(C),ie=this.haystack.evaluate(C);if(!ie)return!1;if(!Yl(G,["boolean","string","number","null"]))throw new ws("Expected first argument to be of type boolean, string, number or null, but found "+xs(Rs(G))+" instead.");if(!Yl(ie,["string","array"]))throw new ws("Expected second argument to be of type array or string, but found "+xs(Rs(ie))+" instead.");return ie.indexOf(G)>=0},vl.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},vl.prototype.outputDefined=function(){return!0},vl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var jl=function(C,G,ie){this.type=ci,this.needle=C,this.haystack=G,this.fromIndex=ie};jl.parse=function(C,G){if(C.length<=2||C.length>=5)return G.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ie=G.parse(C[1],1,Ni),ye=G.parse(C[2],2,Ni);if(!ie||!ye)return null;if(!wu(ie.type,[so,oo,ci,el,Ni]))return G.error("Expected first argument to be of type boolean, string, number or null, but found "+xs(ie.type)+" instead");if(C.length===4){var Pe=G.parse(C[3],3,ci);return Pe?new jl(ie,ye,Pe):null}else return new jl(ie,ye)},jl.prototype.evaluate=function(C){var G=this.needle.evaluate(C),ie=this.haystack.evaluate(C);if(!Yl(G,["boolean","string","number","null"]))throw new ws("Expected first argument to be of type boolean, string, number or null, but found "+xs(Rs(G))+" instead.");if(!Yl(ie,["string","array"]))throw new ws("Expected second argument to be of type array or string, but found "+xs(Rs(ie))+" instead.");if(this.fromIndex){var ye=this.fromIndex.evaluate(C);return ie.indexOf(G,ye)}return ie.indexOf(G)},jl.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},jl.prototype.outputDefined=function(){return!1},jl.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Xu=function(C,G,ie,ye,Pe,je){this.inputType=C,this.type=G,this.input=ie,this.cases=ye,this.outputs=Pe,this.otherwise=je};Xu.parse=function(C,G){if(C.length<5)return G.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return G.error("Expected an even number of arguments.");var ie,ye;G.expectedType&&G.expectedType.kind!=="value"&&(ye=G.expectedType);for(var Pe={},je=[],ut=2;utNumber.MAX_SAFE_INTEGER)return Kt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Fr=="number"&&Math.floor(Fr)!==Fr)return Kt.error("Numeric branch labels must be integer values.");if(!ie)ie=Rs(Fr);else if(Kt.checkSubtype(ie,Rs(Fr)))return null;if(typeof Pe[String(Fr)]<"u")return Kt.error("Branch labels must be unique.");Pe[String(Fr)]=je.length}var na=G.parse(Ut,ut,ye);if(!na)return null;ye=ye||na.type,je.push(na)}var La=G.parse(C[1],1,Ni);if(!La)return null;var yn=G.parse(C[C.length-1],C.length-1,ye);return!yn||La.type.kind!=="value"&&G.concat(1).checkSubtype(ie,La.type)?null:new Xu(ie,ye,La,Pe,je,yn)},Xu.prototype.evaluate=function(C){var G=this.input.evaluate(C),ie=Rs(G)===this.inputType&&this.outputs[this.cases[G]]||this.otherwise;return ie.evaluate(C)},Xu.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},Xu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},Xu.prototype.serialize=function(){for(var C=this,G=["match",this.input.serialize()],ie=Object.keys(this.cases).sort(),ye=[],Pe={},je=0,ut=ie;je=5)return G.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ie=G.parse(C[1],1,Ni),ye=G.parse(C[2],2,ci);if(!ie||!ye)return null;if(!wu(ie.type,[ks(Ni),oo,Ni]))return G.error("Expected first argument to be of type array or string, but found "+xs(ie.type)+" instead");if(C.length===4){var Pe=G.parse(C[3],3,ci);return Pe?new Mu(ie.type,ie,ye,Pe):null}else return new Mu(ie.type,ie,ye)},Mu.prototype.evaluate=function(C){var G=this.input.evaluate(C),ie=this.beginIndex.evaluate(C);if(!Yl(G,["string","array"]))throw new ws("Expected first argument to be of type array or string, but found "+xs(Rs(G))+" instead.");if(this.endIndex){var ye=this.endIndex.evaluate(C);return G.slice(ie,ye)}return G.slice(ie)},Mu.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},Mu.prototype.outputDefined=function(){return!1},Mu.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Zu(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Yt(k,C,G){return C===G}function vr(k,C,G){return C!==G}function Qr(k,C,G){return CG}function xa(k,C,G){return C<=G}function Qa(k,C,G){return C>=G}function xn(k,C,G,ie){return ie.compare(C,G)===0}function zn(k,C,G,ie){return!xn(k,C,G,ie)}function Gn(k,C,G,ie){return ie.compare(C,G)<0}function ni(k,C,G,ie){return ie.compare(C,G)>0}function wn(k,C,G,ie){return ie.compare(C,G)<=0}function Sn(k,C,G,ie){return ie.compare(C,G)>=0}function Ln(k,C,G){var ie=k!=="=="&&k!=="!=";return(function(){function ye(Pe,je,ut){this.type=so,this.lhs=Pe,this.rhs=je,this.collator=ut,this.hasUntypedArgument=Pe.type.kind==="value"||je.type.kind==="value"}return ye.parse=function(je,ut){if(je.length!==3&&je.length!==4)return ut.error("Expected two or three arguments.");var Lt=je[0],Ut=ut.parse(je[1],1,Ni);if(!Ut)return null;if(!Zu(Lt,Ut.type))return ut.concat(1).error('"'+Lt+`" comparisons are not supported for type '`+xs(Ut.type)+"'.");var Kt=ut.parse(je[2],2,Ni);if(!Kt)return null;if(!Zu(Lt,Kt.type))return ut.concat(2).error('"'+Lt+`" comparisons are not supported for type '`+xs(Kt.type)+"'.");if(Ut.type.kind!==Kt.type.kind&&Ut.type.kind!=="value"&&Kt.type.kind!=="value")return ut.error("Cannot compare types '"+xs(Ut.type)+"' and '"+xs(Kt.type)+"'.");ie&&(Ut.type.kind==="value"&&Kt.type.kind!=="value"?Ut=new fl(Kt.type,[Ut]):Ut.type.kind!=="value"&&Kt.type.kind==="value"&&(Kt=new fl(Ut.type,[Kt])));var Mr=null;if(je.length===4){if(Ut.type.kind!=="string"&&Kt.type.kind!=="string"&&Ut.type.kind!=="value"&&Kt.type.kind!=="value")return ut.error("Cannot use collator to compare non-string types.");if(Mr=ut.parse(je[3],3,Ks),!Mr)return null}return new ye(Ut,Kt,Mr)},ye.prototype.evaluate=function(je){var ut=this.lhs.evaluate(je),Lt=this.rhs.evaluate(je);if(ie&&this.hasUntypedArgument){var Ut=Rs(ut),Kt=Rs(Lt);if(Ut.kind!==Kt.kind||!(Ut.kind==="string"||Ut.kind==="number"))throw new ws('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Ut.kind+", "+Kt.kind+") instead.")}if(this.collator&&!ie&&this.hasUntypedArgument){var Mr=Rs(ut),qr=Rs(Lt);if(Mr.kind!=="string"||qr.kind!=="string")return C(je,ut,Lt)}return this.collator?G(je,ut,Lt,this.collator.evaluate(je)):C(je,ut,Lt)},ye.prototype.eachChild=function(je){je(this.lhs),je(this.rhs),this.collator&&je(this.collator)},ye.prototype.outputDefined=function(){return!0},ye.prototype.serialize=function(){var je=[k];return this.eachChild(function(ut){je.push(ut.serialize())}),je},ye})()}var un=Ln("==",Yt,xn),mi=Ln("!=",vr,zn),Oi=Ln("<",Qr,Gn),Vi=Ln(">",Wr,ni),Bi=Ln("<=",xa,wn),Yi=Ln(">=",Qa,Sn),vi=function(C,G,ie,ye,Pe){this.type=oo,this.number=C,this.locale=G,this.currency=ie,this.minFractionDigits=ye,this.maxFractionDigits=Pe};vi.parse=function(C,G){if(C.length!==3)return G.error("Expected two arguments.");var ie=G.parse(C[1],1,ci);if(!ie)return null;var ye=C[2];if(typeof ye!="object"||Array.isArray(ye))return G.error("NumberFormat options argument must be an object.");var Pe=null;if(ye.locale&&(Pe=G.parse(ye.locale,1,oo),!Pe))return null;var je=null;if(ye.currency&&(je=G.parse(ye.currency,1,oo),!je))return null;var ut=null;if(ye["min-fraction-digits"]&&(ut=G.parse(ye["min-fraction-digits"],1,ci),!ut))return null;var Lt=null;return ye["max-fraction-digits"]&&(Lt=G.parse(ye["max-fraction-digits"],1,ci),!Lt)?null:new vi(ie,Pe,je,ut,Lt)},vi.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},vi.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},vi.prototype.outputDefined=function(){return!1},vi.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var Qn=function(C){this.type=ci,this.input=C};Qn.parse=function(C,G){if(C.length!==2)return G.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var ie=G.parse(C[1],1);return ie?ie.type.kind!=="array"&&ie.type.kind!=="string"&&ie.type.kind!=="value"?G.error("Expected argument of type string or array, but found "+xs(ie.type)+" instead."):new Qn(ie):null},Qn.prototype.evaluate=function(C){var G=this.input.evaluate(C);if(typeof G=="string")return G.length;if(Array.isArray(G))return G.length;throw new ws("Expected value to be of type string or array, but found "+xs(Rs(G))+" instead.")},Qn.prototype.eachChild=function(C){C(this.input)},Qn.prototype.outputDefined=function(){return!1},Qn.prototype.serialize=function(){var C=["length"];return this.eachChild(function(G){C.push(G.serialize())}),C};var no={"==":un,"!=":mi,">":Vi,"<":Oi,">=":Yi,"<=":Bi,array:fl,at:Fu,boolean:fl,case:lc,coalesce:vu,collator:uu,format:lu,image:Us,in:vl,"index-of":jl,interpolate:Cl,"interpolate-hcl":Cl,"interpolate-lab":Cl,length:Qn,let:Wu,literal:Qo,match:Xu,number:fl,"number-format":vi,object:fl,slice:Mu,step:Gl,string:fl,"to-boolean":qo,"to-color":qo,"to-number":qo,"to-string":qo,var:qu,within:Kl};function Ro(k,C){var G=C[0],ie=C[1],ye=C[2],Pe=C[3];G=G.evaluate(k),ie=ie.evaluate(k),ye=ye.evaluate(k);var je=Pe?Pe.evaluate(k):1,ut=Tu(G,ie,ye,je);if(ut)throw new ws(ut);return new vs(G/255*je,ie/255*je,ye/255*je,je)}function as(k,C){return k in C}function Ps(k,C){var G=C[k];return typeof G>"u"?null:G}function ds(k,C,G,ie){for(;G<=ie;){var ye=G+ie>>1;if(C[ye]===k)return!0;C[ye]>k?ie=ye-1:G=ye+1}return!1}function Cs(k){return{type:k}}Ui.register(no,{error:[Ns,[oo],function(k,C){var G=C[0];throw new ws(G.evaluate(k))}],typeof:[oo,[Ni],function(k,C){var G=C[0];return xs(Rs(G.evaluate(k)))}],"to-rgba":[ks(ci,4),[js],function(k,C){var G=C[0];return G.evaluate(k).toArray()}],rgb:[js,[ci,ci,ci],Ro],rgba:[js,[ci,ci,ci,ci],Ro],has:{type:so,overloads:[[[oo],function(k,C){var G=C[0];return as(G.evaluate(k),k.properties())}],[[oo,Es],function(k,C){var G=C[0],ie=C[1];return as(G.evaluate(k),ie.evaluate(k))}]]},get:{type:Ni,overloads:[[[oo],function(k,C){var G=C[0];return Ps(G.evaluate(k),k.properties())}],[[oo,Es],function(k,C){var G=C[0],ie=C[1];return Ps(G.evaluate(k),ie.evaluate(k))}]]},"feature-state":[Ni,[oo],function(k,C){var G=C[0];return Ps(G.evaluate(k),k.featureState||{})}],properties:[Es,[],function(k){return k.properties()}],"geometry-type":[oo,[],function(k){return k.geometryType()}],id:[Ni,[],function(k){return k.id()}],zoom:[ci,[],function(k){return k.globals.zoom}],"heatmap-density":[ci,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[ci,[],function(k){return k.globals.lineProgress||0}],accumulated:[Ni,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[ci,Cs(ci),function(k,C){for(var G=0,ie=0,ye=C;ie":[so,[oo,Ni],function(k,C){var G=C[0],ie=C[1],ye=k.properties()[G.value],Pe=ie.value;return typeof ye==typeof Pe&&ye>Pe}],"filter-id->":[so,[Ni],function(k,C){var G=C[0],ie=k.id(),ye=G.value;return typeof ie==typeof ye&&ie>ye}],"filter-<=":[so,[oo,Ni],function(k,C){var G=C[0],ie=C[1],ye=k.properties()[G.value],Pe=ie.value;return typeof ye==typeof Pe&&ye<=Pe}],"filter-id-<=":[so,[Ni],function(k,C){var G=C[0],ie=k.id(),ye=G.value;return typeof ie==typeof ye&&ie<=ye}],"filter->=":[so,[oo,Ni],function(k,C){var G=C[0],ie=C[1],ye=k.properties()[G.value],Pe=ie.value;return typeof ye==typeof Pe&&ye>=Pe}],"filter-id->=":[so,[Ni],function(k,C){var G=C[0],ie=k.id(),ye=G.value;return typeof ie==typeof ye&&ie>=ye}],"filter-has":[so,[Ni],function(k,C){var G=C[0];return G.value in k.properties()}],"filter-has-id":[so,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[so,[ks(oo)],function(k,C){var G=C[0];return G.value.indexOf(k.geometryType())>=0}],"filter-id-in":[so,[ks(Ni)],function(k,C){var G=C[0];return G.value.indexOf(k.id())>=0}],"filter-in-small":[so,[oo,ks(Ni)],function(k,C){var G=C[0],ie=C[1];return ie.value.indexOf(k.properties()[G.value])>=0}],"filter-in-large":[so,[oo,ks(Ni)],function(k,C){var G=C[0],ie=C[1];return ds(k.properties()[G.value],ie.value,0,ie.value.length-1)}],all:{type:so,overloads:[[[so,so],function(k,C){var G=C[0],ie=C[1];return G.evaluate(k)&&ie.evaluate(k)}],[Cs(so),function(k,C){for(var G=0,ie=C;G-1}function Mi(k){return!!k.expression&&k.expression.interpolated}function yo(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function Ss(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function us(k){return k}function Pl(k,C){var G=C.type==="color",ie=k.stops&&typeof k.stops[0][0]=="object",ye=ie||k.property!==void 0,Pe=ie||!ye,je=k.type||(Mi(C)?"exponential":"interval");if(G&&(k=Io({},k),k.stops&&(k.stops=k.stops.map(function(Si){return[Si[0],vs.parse(Si[1])]})),k.default?k.default=vs.parse(k.default):k.default=vs.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Dc[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var ut,Lt,Ut;if(je==="exponential")ut=Vl;else if(je==="interval")ut=Yu;else if(je==="categorical"){ut=du,Lt=Object.create(null);for(var Kt=0,Mr=k.stops;Kt=k.stops[ie-1][0])return k.stops[ie-1][1];var ye=Nl(k.stops.map(function(Pe){return Pe[0]}),G);return k.stops[ye][1]}function Vl(k,C,G){var ie=k.base!==void 0?k.base:1;if(yo(G)!=="number")return Ql(k.default,C.default);var ye=k.stops.length;if(ye===1||G<=k.stops[0][0])return k.stops[0][1];if(G>=k.stops[ye-1][0])return k.stops[ye-1][1];var Pe=Nl(k.stops.map(function(Mr){return Mr[0]}),G),je=Hl(G,ie,k.stops[Pe][0],k.stops[Pe+1][0]),ut=k.stops[Pe][1],Lt=k.stops[Pe+1][1],Ut=iu[C.type]||us;if(k.colorSpace&&k.colorSpace!=="rgb"){var Kt=Dc[k.colorSpace];Ut=function(Mr,qr){return Kt.reverse(Kt.interpolate(Kt.forward(Mr),Kt.forward(qr),je))}}return typeof ut.evaluate=="function"?{evaluate:function(){for(var qr=[],Fr=arguments.length;Fr--;)qr[Fr]=arguments[Fr];var na=ut.evaluate.apply(void 0,qr),La=Lt.evaluate.apply(void 0,qr);if(!(na===void 0||La===void 0))return Ut(na,La,je)}}:Ut(ut,Lt,je)}function Ku(k,C,G){return C.type==="color"?G=vs.parse(G):C.type==="formatted"?G=Ll.fromString(G.toString()):C.type==="resolvedImage"?G=nl.fromString(G.toString()):yo(G)!==C.type&&(C.type!=="enum"||!C.values[G])&&(G=void 0),Ql(G,k.default,C.default)}function Hl(k,C,G,ie){var ye=ie-G,Pe=k-G;return ye===0?0:C===1?Pe/ye:(Math.pow(C,Pe)-1)/(Math.pow(C,ye)-1)}var Ou=function(C,G){this.expression=C,this._warningHistory={},this._evaluator=new is,this._defaultValue=G?we(G):null,this._enumValues=G&&G.type==="enum"?G.values:null};Ou.prototype.evaluateWithoutErrorHandling=function(C,G,ie,ye,Pe,je){return this._evaluator.globals=C,this._evaluator.feature=G,this._evaluator.featureState=ie,this._evaluator.canonical=ye,this._evaluator.availableImages=Pe||null,this._evaluator.formattedSection=je,this.expression.evaluate(this._evaluator)},Ou.prototype.evaluate=function(C,G,ie,ye,Pe,je){this._evaluator.globals=C,this._evaluator.feature=G||null,this._evaluator.featureState=ie||null,this._evaluator.canonical=ye,this._evaluator.availableImages=Pe||null,this._evaluator.formattedSection=je||null;try{var ut=this.expression.evaluate(this._evaluator);if(ut==null||typeof ut=="number"&&ut!==ut)return this._defaultValue;if(this._enumValues&&!(ut in this._enumValues))throw new ws("Expected value to be one of "+Object.keys(this._enumValues).map(function(Lt){return JSON.stringify(Lt)}).join(", ")+", but found "+JSON.stringify(ut)+" instead.");return ut}catch(Lt){return this._warningHistory[Lt.message]||(this._warningHistory[Lt.message]=!0,typeof console<"u"&&console.warn(Lt.message)),this._defaultValue}};function Ki(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in no}function xo(k,C){var G=new Ds(no,[],C?xe(C):void 0),ie=G.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ie?es(new Ou(ie,C)):ul(G.errors)}var Ju=function(C,G){this.kind=C,this._styleExpression=G,this.isStateDependent=C!=="constant"&&!Hs(G.expression)};Ju.prototype.evaluateWithoutErrorHandling=function(C,G,ie,ye,Pe,je){return this._styleExpression.evaluateWithoutErrorHandling(C,G,ie,ye,Pe,je)},Ju.prototype.evaluate=function(C,G,ie,ye,Pe,je){return this._styleExpression.evaluate(C,G,ie,ye,Pe,je)};var Eu=function(C,G,ie,ye){this.kind=C,this.zoomStops=ie,this._styleExpression=G,this.isStateDependent=C!=="camera"&&!Hs(G.expression),this.interpolationType=ye};Eu.prototype.evaluateWithoutErrorHandling=function(C,G,ie,ye,Pe,je){return this._styleExpression.evaluateWithoutErrorHandling(C,G,ie,ye,Pe,je)},Eu.prototype.evaluate=function(C,G,ie,ye,Pe,je){return this._styleExpression.evaluate(C,G,ie,ye,Pe,je)},Eu.prototype.interpolationFactor=function(C,G,ie){return this.interpolationType?Cl.interpolationFactor(this.interpolationType,C,G,ie):0};function pu(k,C){if(k=xo(k,C),k.result==="error")return k;var G=k.value.expression,ie=Uc(G);if(!ie&&!Ws(C))return ul([new rs("","data expressions not supported")]);var ye=Jl(G,["zoom"]);if(!ye&&!Fs(C))return ul([new rs("","zoom expressions not supported")]);var Pe=ae(G);if(!Pe&&!ye)return ul([new rs("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Pe instanceof rs)return ul([Pe]);if(Pe instanceof Cl&&!Mi(C))return ul([new rs("",'"interpolate" expressions cannot be used with this property')]);if(!Pe)return es(ie?new Ju("constant",k.value):new Ju("source",k.value));var je=Pe instanceof Cl?Pe.interpolation:void 0;return es(ie?new Eu("camera",k.value,Pe.labels,je):new Eu("composite",k.value,Pe.labels,je))}var Be=function(C,G){this._parameters=C,this._specification=G,Io(this,Pl(this._parameters,this._specification))};Be.deserialize=function(C){return new Be(C._parameters,C._specification)},Be.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function R(k,C){if(Ss(k))return new Be(k,C);if(Ki(k)){var G=pu(k,C);if(G.result==="error")throw new Error(G.value.map(function(ye){return ye.key+": "+ye.message}).join(", "));return G.value}else{var ie=k;return typeof k=="string"&&C.type==="color"&&(ie=vs.parse(k)),{kind:"constant",evaluate:function(){return ie}}}}function ae(k){var C=null;if(k instanceof Wu)C=ae(k.result);else if(k instanceof vu)for(var G=0,ie=k.args;Gie.maximum?[new pi(C,G,G+" is greater than the maximum value "+ie.maximum)]:[]}function zt(k){var C=k.valueSpec,G=Zi(k.value.type),ie,ye={},Pe,je,ut=G!=="categorical"&&k.value.property===void 0,Lt=!ut,Ut=yo(k.value.stops)==="array"&&yo(k.value.stops[0])==="array"&&yo(k.value.stops[0][0])==="object",Kt=Fe({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Mr,default:na}});return G==="identity"&&ut&&Kt.push(new pi(k.key,k.value,'missing required property "property"')),G!=="identity"&&!k.value.stops&&Kt.push(new pi(k.key,k.value,'missing required property "stops"')),G==="exponential"&&k.valueSpec.expression&&!Mi(k.valueSpec)&&Kt.push(new pi(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(Lt&&!Ws(k.valueSpec)?Kt.push(new pi(k.key,k.value,"property functions not supported")):ut&&!Fs(k.valueSpec)&&Kt.push(new pi(k.key,k.value,"zoom functions not supported"))),(G==="categorical"||Ut)&&k.value.property===void 0&&Kt.push(new pi(k.key,k.value,'"property" property is required')),Kt;function Mr(La){if(G==="identity")return[new pi(La.key,La.value,'identity function may not have a "stops" property')];var yn=[],Ka=La.value;return yn=yn.concat(ct({key:La.key,value:Ka,valueSpec:La.valueSpec,style:La.style,styleSpec:La.styleSpec,arrayElementValidator:qr})),yo(Ka)==="array"&&Ka.length===0&&yn.push(new pi(La.key,Ka,"array must have at least one stop")),yn}function qr(La){var yn=[],Ka=La.value,qn=La.key;if(yo(Ka)!=="array")return[new pi(qn,Ka,"array expected, "+yo(Ka)+" found")];if(Ka.length!==2)return[new pi(qn,Ka,"array length 2 expected, length "+Ka.length+" found")];if(Ut){if(yo(Ka[0])!=="object")return[new pi(qn,Ka,"object expected, "+yo(Ka[0])+" found")];if(Ka[0].zoom===void 0)return[new pi(qn,Ka,"object stop key must have zoom")];if(Ka[0].value===void 0)return[new pi(qn,Ka,"object stop key must have value")];if(je&&je>Zi(Ka[0].zoom))return[new pi(qn,Ka[0].zoom,"stop zoom values must appear in ascending order")];Zi(Ka[0].zoom)!==je&&(je=Zi(Ka[0].zoom),Pe=void 0,ye={}),yn=yn.concat(Fe({key:qn+"[0]",value:Ka[0],valueSpec:{zoom:{}},style:La.style,styleSpec:La.styleSpec,objectElementValidators:{zoom:bt,value:Fr}}))}else yn=yn.concat(Fr({key:qn+"[0]",value:Ka[0],valueSpec:{},style:La.style,styleSpec:La.styleSpec},Ka));return Ki(ys(Ka[1]))?yn.concat([new pi(qn+"[1]",Ka[1],"expressions are not allowed in function stops.")]):yn.concat(co({key:qn+"[1]",value:Ka[1],valueSpec:C,style:La.style,styleSpec:La.styleSpec}))}function Fr(La,yn){var Ka=yo(La.value),qn=Zi(La.value),kn=La.value!==null?La.value:yn;if(!ie)ie=Ka;else if(Ka!==ie)return[new pi(La.key,kn,Ka+" stop domain type must match previous stop domain type "+ie)];if(Ka!=="number"&&Ka!=="string"&&Ka!=="boolean")return[new pi(La.key,kn,"stop domain value must be a number, string, or boolean")];if(Ka!=="number"&&G!=="categorical"){var Vn="number expected, "+Ka+" found";return Ws(C)&&G===void 0&&(Vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new pi(La.key,kn,Vn)]}return G==="categorical"&&Ka==="number"&&(!isFinite(qn)||Math.floor(qn)!==qn)?[new pi(La.key,kn,"integer expected, found "+qn)]:G!=="categorical"&&Ka==="number"&&Pe!==void 0&&qn=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,G=k.slice(1);CC?1:0}function ft(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?xt(k[1],k[2],C):C==="any"?Pt(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Mt)):C==="none"?["all"].concat(k.slice(1).map(Mt).map(wr)):C==="in"?ir(k[1],k.slice(2)):C==="!in"?wr(ir(k[1],k.slice(2))):C==="has"?fr(k[1]):C==="!has"?wr(fr(k[1])):C==="within"?k:!0;return G}function xt(k,C,G){switch(k){case"$type":return["filter-type-"+G,C];case"$id":return["filter-id-"+G,C];default:return["filter-"+G,k,C]}}function Pt(k){return["any"].concat(k.map(Mt))}function ir(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(G){return typeof G!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(it)]]:["filter-in-small",k,["literal",C]]}}function fr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function wr(k){return["!",k]}function zr(k){return ta(ys(k.value))?Zt(Io({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Xr(k)}function Xr(k){var C=k.value,G=k.key;if(yo(C)!=="array")return[new pi(G,C,"array expected, "+yo(C)+" found")];var ie=k.styleSpec,ye,Pe=[];if(C.length<1)return[new pi(G,C,"filter array must have at least 1 element")];switch(Pe=Pe.concat(Gr({key:G+"[0]",value:C[0],valueSpec:ie.filter_operator,style:k.style,styleSpec:k.styleSpec})),Zi(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Zi(C[1])==="$type"&&Pe.push(new pi(G,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&Pe.push(new pi(G,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(ye=yo(C[1]),ye!=="string"&&Pe.push(new pi(G+"[1]",C[1],"string expected, "+ye+" found")));for(var je=2;je=Kt[Fr+0]&&ie>=Kt[Fr+1])?(je[qr]=!0,Pe.push(Ut[qr])):je[qr]=!1}}},Il.prototype._forEachCell=function(k,C,G,ie,ye,Pe,je,ut){for(var Lt=this._convertToCellCoord(k),Ut=this._convertToCellCoord(C),Kt=this._convertToCellCoord(G),Mr=this._convertToCellCoord(ie),qr=Lt;qr<=Kt;qr++)for(var Fr=Ut;Fr<=Mr;Fr++){var na=this.d*Fr+qr;if(!(ut&&!ut(this._convertFromCellCoord(qr),this._convertFromCellCoord(Fr),this._convertFromCellCoord(qr+1),this._convertFromCellCoord(Fr+1)))&&ye.call(this,k,C,G,ie,na,Pe,je,ut))return}},Il.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},Il.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},Il.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Js+this.cells.length+1+1,G=0,ie=0;ie=0)){var Mr=k[Kt];Ut[Kt]=pl[Lt].shallow.indexOf(Kt)>=0?Mr:mt(Mr,C)}k instanceof Error&&(Ut.message=k.message)}if(Ut.$name)throw new Error("$name property is reserved for worker serialization logic.");return Lt!=="Object"&&(Ut.$name=Lt),Ut}throw new Error("can't serialize object of type "+typeof k)}function wt(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||Je(k)||ht(k)||ArrayBuffer.isView(k)||k instanceof ku)return k;if(Array.isArray(k))return k.map(wt);if(typeof k=="object"){var C=k.$name||"Object",G=pl[C],ie=G.klass;if(!ie)throw new Error("can't deserialize unregistered class "+C);if(ie.deserialize)return ie.deserialize(k);for(var ye=Object.create(ie.prototype),Pe=0,je=Object.keys(k);Pe=0?Lt:wt(Lt)}}return ye}throw new Error("can't deserialize object of type "+typeof k)}var $t=function(){this.first=!0};$t.prototype.update=function(C,G){var ie=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=ie,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=ie,!0):(this.lastFloorZoom>ie?(this.lastIntegerZoom=ie+1,this.lastIntegerZoomTime=G):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function hr(k){for(var C=0,G=k;C=65097&&k<=65103)||Rt["CJK Compatibility Ideographs"](k)||Rt["CJK Compatibility"](k)||Rt["CJK Radicals Supplement"](k)||Rt["CJK Strokes"](k)||Rt["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||Rt["CJK Unified Ideographs Extension A"](k)||Rt["CJK Unified Ideographs"](k)||Rt["Enclosed CJK Letters and Months"](k)||Rt["Hangul Compatibility Jamo"](k)||Rt["Hangul Jamo Extended-A"](k)||Rt["Hangul Jamo Extended-B"](k)||Rt["Hangul Jamo"](k)||Rt["Hangul Syllables"](k)||Rt.Hiragana(k)||Rt["Ideographic Description Characters"](k)||Rt.Kanbun(k)||Rt["Kangxi Radicals"](k)||Rt["Katakana Phonetic Extensions"](k)||Rt.Katakana(k)&&k!==12540||Rt["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||Rt["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||Rt["Unified Canadian Aboriginal Syllabics"](k)||Rt["Unified Canadian Aboriginal Syllabics Extended"](k)||Rt["Vertical Forms"](k)||Rt["Yijing Hexagram Symbols"](k)||Rt["Yi Syllables"](k)||Rt["Yi Radicals"](k))}function Ha(k){return!!(Rt["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||Rt["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||Rt["Letterlike Symbols"](k)||Rt["Number Forms"](k)||Rt["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||Rt["Control Pictures"](k)&&k!==9251||Rt["Optical Character Recognition"](k)||Rt["Enclosed Alphanumerics"](k)||Rt["Geometric Shapes"](k)||Rt["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||Rt["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||Rt["CJK Symbols and Punctuation"](k)||Rt.Katakana(k)||Rt["Private Use Area"](k)||Rt["CJK Compatibility Forms"](k)||Rt["Small Form Variants"](k)||Rt["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function Za(k){return!(ua(k)||Ha(k))}function ya(k){return Rt.Arabic(k)||Rt["Arabic Supplement"](k)||Rt["Arabic Extended-A"](k)||Rt["Arabic Presentation Forms-A"](k)||Rt["Arabic Presentation Forms-B"](k)}function Ca(k){return k>=1424&&k<=2303||Rt["Arabic Presentation Forms-A"](k)||Rt["Arabic Presentation Forms-B"](k)}function Ua(k,C){return!(!C&&Ca(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||Rt.Khmer(k))}function rn(k){for(var C=0,G=k;C-1&&(Wn=Aa.error),Jn&&Jn(k)};function zi(){ji.fire(new kr("pluginStateChange",{pluginStatus:Wn,pluginURL:ii}))}var ji=new Tr,Po=function(){return Wn},qi=function(k){return k({pluginStatus:Wn,pluginURL:ii}),ji.on("pluginStateChange",k),k},Co=function(k,C,G){if(G===void 0&&(G=!1),Wn===Aa.deferred||Wn===Aa.loading||Wn===Aa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ii=_e.resolveURL(k),Wn=Aa.deferred,Jn=C,zi(),G||Bs()},Bs=function(){if(Wn!==Aa.deferred||!ii)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Wn=Aa.loading,zi(),ii&&Jr({url:ii},function(k){k?yi(k):(Wn=Aa.loaded,zi())})},Is={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Wn===Aa.loaded||Is.applyArabicShaping!=null},isLoading:function(){return Wn===Aa.loading},setState:function(C){Wn=C.pluginStatus,ii=C.pluginURL},isParsed:function(){return Is.applyArabicShaping!=null&&Is.processBidirectionalText!=null&&Is.processStyledBidirectionalText!=null},getPluginURL:function(){return ii}},Xs=function(){!Is.isLoading()&&!Is.isLoaded()&&Po()==="deferred"&&Bs()},si=function(C,G){this.zoom=C,G?(this.now=G.now,this.fadeDuration=G.fadeDuration,this.zoomHistory=G.zoomHistory,this.transition=G.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new $t,this.transition={})};si.prototype.isSupportedScript=function(C){return Ja(C,Is.isLoaded())},si.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},si.prototype.getCrossfadeParameters=function(){var C=this.zoom,G=C-Math.floor(C),ie=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:G+(1-G)*ie}:{fromScale:.5,toScale:1,t:1-(1-ie)*G}};var $i=function(C,G){this.property=C,this.value=G,this.expression=R(G===void 0?C.specification.default:G,C.specification)};$i.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},$i.prototype.possiblyEvaluate=function(C,G,ie){return this.property.possiblyEvaluate(this,C,G,ie)};var Wo=function(C){this.property=C,this.value=new $i(C,void 0)};Wo.prototype.transitioned=function(C,G){return new $s(this.property,this.value,G,y({},C.transition,this.transition),C.now)},Wo.prototype.untransitioned=function(){return new $s(this.property,this.value,null,{},0)};var Yo=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Yo.prototype.getValue=function(C){return O(this._values[C].value.value)},Yo.prototype.setValue=function(C,G){this._values.hasOwnProperty(C)||(this._values[C]=new Wo(this._values[C].property)),this._values[C].value=new $i(this._values[C].property,G===null?void 0:O(G))},Yo.prototype.getTransition=function(C){return O(this._values[C].transition)},Yo.prototype.setTransition=function(C,G){this._values.hasOwnProperty(C)||(this._values[C]=new Wo(this._values[C].property)),this._values[C].transition=O(G)||void 0},Yo.prototype.serialize=function(){for(var C={},G=0,ie=Object.keys(this._values);Gthis.end)return this.prior=null,Pe;if(this.value.isDataDriven())return this.prior=null,Pe;if(yeje.zoomHistory.lastIntegerZoom?{from:ie,to:ye}:{from:Pe,to:ye}},C.prototype.interpolate=function(ie){return ie},C})(qt),ra=function(C){this.specification=C};ra.prototype.possiblyEvaluate=function(C,G,ie,ye){if(C.value!==void 0)if(C.expression.kind==="constant"){var Pe=C.expression.evaluate(G,null,{},ie,ye);return this._calculate(Pe,Pe,Pe,G)}else return this._calculate(C.expression.evaluate(new si(Math.floor(G.zoom-1),G)),C.expression.evaluate(new si(Math.floor(G.zoom),G)),C.expression.evaluate(new si(Math.floor(G.zoom+1),G)),G)},ra.prototype._calculate=function(C,G,ie,ye){var Pe=ye.zoom;return Pe>ye.zoomHistory.lastIntegerZoom?{from:C,to:G}:{from:ie,to:G}},ra.prototype.interpolate=function(C){return C};var da=function(C){this.specification=C};da.prototype.possiblyEvaluate=function(C,G,ie,ye){return!!C.expression.evaluate(G,null,{},ie,ye)},da.prototype.interpolate=function(){return!1};var ca=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var G in C){var ie=C[G];ie.specification.overridable&&this.overridableProperties.push(G);var ye=this.defaultPropertyValues[G]=new $i(ie,void 0),Pe=this.defaultTransitionablePropertyValues[G]=new Wo(ie);this.defaultTransitioningPropertyValues[G]=Pe.untransitioned(),this.defaultPossiblyEvaluatedValues[G]=ye.possiblyEvaluate({})}};ve("DataDrivenProperty",qt),ve("DataConstantProperty",tt),ve("CrossFadedDataDrivenProperty",sr),ve("CrossFadedProperty",ra),ve("ColorRampProperty",da);var ha="-transition",Va=(function(k){function C(G,ie){if(k.call(this),this.id=G.id,this.type=G.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},G.type!=="custom"&&(G=G,this.metadata=G.metadata,this.minzoom=G.minzoom,this.maxzoom=G.maxzoom,G.type!=="background"&&(this.source=G.source,this.sourceLayer=G["source-layer"],this.filter=G.filter),ie.layout&&(this._unevaluatedLayout=new Wl(ie.layout)),ie.paint)){this._transitionablePaint=new Yo(ie.paint);for(var ye in G.paint)this.setPaintProperty(ye,G.paint[ye],{validate:!1});for(var Pe in G.layout)this.setLayoutProperty(Pe,G.layout[Pe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Bu(ie.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(ie){return ie==="visibility"?this.visibility:this._unevaluatedLayout.getValue(ie)},C.prototype.setLayoutProperty=function(ie,ye,Pe){if(Pe===void 0&&(Pe={}),ye!=null){var je="layers."+this.id+".layout."+ie;if(this._validate(Sl,je,ie,ye,Pe))return}if(ie==="visibility"){this.visibility=ye;return}this._unevaluatedLayout.setValue(ie,ye)},C.prototype.getPaintProperty=function(ie){return z(ie,ha)?this._transitionablePaint.getTransition(ie.slice(0,-ha.length)):this._transitionablePaint.getValue(ie)},C.prototype.setPaintProperty=function(ie,ye,Pe){if(Pe===void 0&&(Pe={}),ye!=null){var je="layers."+this.id+".paint."+ie;if(this._validate(il,je,ie,ye,Pe))return!1}if(z(ie,ha))return this._transitionablePaint.setTransition(ie.slice(0,-ha.length),ye||void 0),!1;var ut=this._transitionablePaint._values[ie],Lt=ut.property.specification["property-type"]==="cross-faded-data-driven",Ut=ut.value.isDataDriven(),Kt=ut.value;this._transitionablePaint.setValue(ie,ye),this._handleSpecialPaintPropertyUpdate(ie);var Mr=this._transitionablePaint._values[ie].value,qr=Mr.isDataDriven();return qr||Ut||Lt||this._handleOverridablePaintPropertyUpdate(ie,Kt,Mr)},C.prototype._handleSpecialPaintPropertyUpdate=function(ie){},C.prototype._handleOverridablePaintPropertyUpdate=function(ie,ye,Pe){return!1},C.prototype.isHidden=function(ie){return this.minzoom&&ie=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(ie){this._transitioningPaint=this._transitionablePaint.transitioned(ie,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(ie,ye){ie.getCrossfadeParameters&&(this._crossfadeParameters=ie.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ie,void 0,ye)),this.paint=this._transitioningPaint.possiblyEvaluate(ie,void 0,ye)},C.prototype.serialize=function(){var ie={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(ie.layout=ie.layout||{},ie.layout.visibility=this.visibility),B(ie,function(ye,Pe){return ye!==void 0&&!(Pe==="layout"&&!Object.keys(ye).length)&&!(Pe==="paint"&&!Object.keys(ye).length)})},C.prototype._validate=function(ie,ye,Pe,je,ut){return ut===void 0&&(ut={}),ut&&ut.validate===!1?!1:eu(this,ie.call(Do,{key:ye,layerType:this.type,objectKey:Pe,value:je,styleSpec:Nn,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var ie in this.paint._values){var ye=this.paint.get(ie);if(!(!(ye instanceof ol)||!Ws(ye.property.specification))&&(ye.value.kind==="source"||ye.value.kind==="composite")&&ye.value.isStateDependent)return!0}return!1},C})(Tr),dn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},fn=function(C,G){this._structArray=C,this._pos1=G*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},$a=128,ui=5,Mn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Mn.serialize=function(C,G){return C._trim(),G&&(C.isTransferred=!0,G.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Mn.deserialize=function(C){var G=Object.create(this.prototype);return G.arrayBuffer=C.arrayBuffer,G.length=C.length,G.capacity=C.arrayBuffer.byteLength/G.bytesPerElement,G._refreshViews(),G},Mn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Mn.prototype.clear=function(){this.length=0},Mn.prototype.resize=function(C){this.reserve(C),this.length=C},Mn.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*ui),$a),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var G=this.uint8;this._refreshViews(),G&&this.uint8.set(G)}},Mn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function _n(k,C){C===void 0&&(C=1);var G=0,ie=0,ye=k.map(function(je){var ut=Ia(je.type),Lt=G=Zr(G,Math.max(C,ut)),Ut=je.components||1;return ie=Math.max(ie,ut),G+=ut*Ut,{name:je.name,type:je.type,components:Ut,offset:Lt}}),Pe=Zr(G,Math.max(ie,C));return{members:ye,size:Pe,alignment:C}}function Ia(k){return dn[k].BYTES_PER_ELEMENT}function Zr(k,C){return Math.ceil(k/C)*C}var _a=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ie,ye)},C.prototype.emplace=function(ie,ye,Pe){var je=ie*2;return this.int16[je+0]=ye,this.int16[je+1]=Pe,ie},C})(Mn);_a.prototype.bytesPerElement=4,ve("StructArrayLayout2i4",_a);var Wa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je){var ut=this.length;return this.resize(ut+1),this.emplace(ut,ie,ye,Pe,je)},C.prototype.emplace=function(ie,ye,Pe,je,ut){var Lt=ie*4;return this.int16[Lt+0]=ye,this.int16[Lt+1]=Pe,this.int16[Lt+2]=je,this.int16[Lt+3]=ut,ie},C})(Mn);Wa.prototype.bytesPerElement=8,ve("StructArrayLayout4i8",Wa);var on=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt){var Ut=this.length;return this.resize(Ut+1),this.emplace(Ut,ie,ye,Pe,je,ut,Lt)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut){var Kt=ie*6;return this.int16[Kt+0]=ye,this.int16[Kt+1]=Pe,this.int16[Kt+2]=je,this.int16[Kt+3]=ut,this.int16[Kt+4]=Lt,this.int16[Kt+5]=Ut,ie},C})(Mn);on.prototype.bytesPerElement=12,ve("StructArrayLayout2i4i12",on);var Fa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt){var Ut=this.length;return this.resize(Ut+1),this.emplace(Ut,ie,ye,Pe,je,ut,Lt)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut){var Kt=ie*4,Mr=ie*8;return this.int16[Kt+0]=ye,this.int16[Kt+1]=Pe,this.uint8[Mr+4]=je,this.uint8[Mr+5]=ut,this.uint8[Mr+6]=Lt,this.uint8[Mr+7]=Ut,ie},C})(Mn);Fa.prototype.bytesPerElement=8,ve("StructArrayLayout2i4ub8",Fa);var Cn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ie,ye)},C.prototype.emplace=function(ie,ye,Pe){var je=ie*2;return this.float32[je+0]=ye,this.float32[je+1]=Pe,ie},C})(Mn);Cn.prototype.bytesPerElement=8,ve("StructArrayLayout2f8",Cn);var bn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr){var Fr=this.length;return this.resize(Fr+1),this.emplace(Fr,ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr){var na=ie*10;return this.uint16[na+0]=ye,this.uint16[na+1]=Pe,this.uint16[na+2]=je,this.uint16[na+3]=ut,this.uint16[na+4]=Lt,this.uint16[na+5]=Ut,this.uint16[na+6]=Kt,this.uint16[na+7]=Mr,this.uint16[na+8]=qr,this.uint16[na+9]=Fr,ie},C})(Mn);bn.prototype.bytesPerElement=20,ve("StructArrayLayout10ui20",bn);var ai=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na){var La=this.length;return this.resize(La+1),this.emplace(La,ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La){var yn=ie*12;return this.int16[yn+0]=ye,this.int16[yn+1]=Pe,this.int16[yn+2]=je,this.int16[yn+3]=ut,this.uint16[yn+4]=Lt,this.uint16[yn+5]=Ut,this.uint16[yn+6]=Kt,this.uint16[yn+7]=Mr,this.int16[yn+8]=qr,this.int16[yn+9]=Fr,this.int16[yn+10]=na,this.int16[yn+11]=La,ie},C})(Mn);ai.prototype.bytesPerElement=24,ve("StructArrayLayout4i4ui4i24",ai);var Ba=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe){var je=this.length;return this.resize(je+1),this.emplace(je,ie,ye,Pe)},C.prototype.emplace=function(ie,ye,Pe,je){var ut=ie*3;return this.float32[ut+0]=ye,this.float32[ut+1]=Pe,this.float32[ut+2]=je,ie},C})(Mn);Ba.prototype.bytesPerElement=12,ve("StructArrayLayout3f12",Ba);var Ra=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ie)},C.prototype.emplace=function(ie,ye){var Pe=ie*1;return this.uint32[Pe+0]=ye,ie},C})(Mn);Ra.prototype.bytesPerElement=4,ve("StructArrayLayout1ul4",Ra);var Un=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr){var qr=this.length;return this.resize(qr+1),this.emplace(qr,ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr){var Fr=ie*10,na=ie*5;return this.int16[Fr+0]=ye,this.int16[Fr+1]=Pe,this.int16[Fr+2]=je,this.int16[Fr+3]=ut,this.int16[Fr+4]=Lt,this.int16[Fr+5]=Ut,this.uint32[na+3]=Kt,this.uint16[Fr+8]=Mr,this.uint16[Fr+9]=qr,ie},C})(Mn);Un.prototype.bytesPerElement=20,ve("StructArrayLayout6i1ul2ui20",Un);var An=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt){var Ut=this.length;return this.resize(Ut+1),this.emplace(Ut,ie,ye,Pe,je,ut,Lt)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut){var Kt=ie*6;return this.int16[Kt+0]=ye,this.int16[Kt+1]=Pe,this.int16[Kt+2]=je,this.int16[Kt+3]=ut,this.int16[Kt+4]=Lt,this.int16[Kt+5]=Ut,ie},C})(Mn);An.prototype.bytesPerElement=12,ve("StructArrayLayout2i2i2i12",An);var pn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut){var Lt=this.length;return this.resize(Lt+1),this.emplace(Lt,ie,ye,Pe,je,ut)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt){var Ut=ie*4,Kt=ie*8;return this.float32[Ut+0]=ye,this.float32[Ut+1]=Pe,this.float32[Ut+2]=je,this.int16[Kt+6]=ut,this.int16[Kt+7]=Lt,ie},C})(Mn);pn.prototype.bytesPerElement=16,ve("StructArrayLayout2f1f2i16",pn);var vn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je){var ut=this.length;return this.resize(ut+1),this.emplace(ut,ie,ye,Pe,je)},C.prototype.emplace=function(ie,ye,Pe,je,ut){var Lt=ie*12,Ut=ie*3;return this.uint8[Lt+0]=ye,this.uint8[Lt+1]=Pe,this.float32[Ut+1]=je,this.float32[Ut+2]=ut,ie},C})(Mn);vn.prototype.bytesPerElement=12,ve("StructArrayLayout2ub2f12",vn);var On=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe){var je=this.length;return this.resize(je+1),this.emplace(je,ie,ye,Pe)},C.prototype.emplace=function(ie,ye,Pe,je){var ut=ie*3;return this.uint16[ut+0]=ye,this.uint16[ut+1]=Pe,this.uint16[ut+2]=je,ie},C})(Mn);On.prototype.bytesPerElement=6,ve("StructArrayLayout3ui6",On);var oi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn){var Vn=this.length;return this.resize(Vn+1),this.emplace(Vn,ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn,Vn){var $n=ie*24,hi=ie*12,Ci=ie*48;return this.int16[$n+0]=ye,this.int16[$n+1]=Pe,this.uint16[$n+2]=je,this.uint16[$n+3]=ut,this.uint32[hi+2]=Lt,this.uint32[hi+3]=Ut,this.uint32[hi+4]=Kt,this.uint16[$n+10]=Mr,this.uint16[$n+11]=qr,this.uint16[$n+12]=Fr,this.float32[hi+7]=na,this.float32[hi+8]=La,this.uint8[Ci+36]=yn,this.uint8[Ci+37]=Ka,this.uint8[Ci+38]=qn,this.uint32[hi+10]=kn,this.int16[$n+22]=Vn,ie},C})(Mn);oi.prototype.bytesPerElement=48,ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",oi);var bi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn,Vn,$n,hi,Ci,Si,fo,Gi,ro,os,ho,_o){var Ms=this.length;return this.resize(Ms+1),this.emplace(Ms,ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn,Vn,$n,hi,Ci,Si,fo,Gi,ro,os,ho,_o)},C.prototype.emplace=function(ie,ye,Pe,je,ut,Lt,Ut,Kt,Mr,qr,Fr,na,La,yn,Ka,qn,kn,Vn,$n,hi,Ci,Si,fo,Gi,ro,os,ho,_o,Ms){var ts=ie*34,_l=ie*17;return this.int16[ts+0]=ye,this.int16[ts+1]=Pe,this.int16[ts+2]=je,this.int16[ts+3]=ut,this.int16[ts+4]=Lt,this.int16[ts+5]=Ut,this.int16[ts+6]=Kt,this.int16[ts+7]=Mr,this.uint16[ts+8]=qr,this.uint16[ts+9]=Fr,this.uint16[ts+10]=na,this.uint16[ts+11]=La,this.uint16[ts+12]=yn,this.uint16[ts+13]=Ka,this.uint16[ts+14]=qn,this.uint16[ts+15]=kn,this.uint16[ts+16]=Vn,this.uint16[ts+17]=$n,this.uint16[ts+18]=hi,this.uint16[ts+19]=Ci,this.uint16[ts+20]=Si,this.uint16[ts+21]=fo,this.uint16[ts+22]=Gi,this.uint32[_l+12]=ro,this.float32[_l+13]=os,this.float32[_l+14]=ho,this.float32[_l+15]=_o,this.float32[_l+16]=Ms,ie},C})(Mn);bi.prototype.bytesPerElement=68,ve("StructArrayLayout8i15ui1ul4f68",bi);var Tn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ie)},C.prototype.emplace=function(ie,ye){var Pe=ie*1;return this.float32[Pe+0]=ye,ie},C})(Mn);Tn.prototype.bytesPerElement=4,ve("StructArrayLayout1f4",Tn);var Zn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe){var je=this.length;return this.resize(je+1),this.emplace(je,ie,ye,Pe)},C.prototype.emplace=function(ie,ye,Pe,je){var ut=ie*3;return this.int16[ut+0]=ye,this.int16[ut+1]=Pe,this.int16[ut+2]=je,ie},C})(Mn);Zn.prototype.bytesPerElement=6,ve("StructArrayLayout3i6",Zn);var gi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe){var je=this.length;return this.resize(je+1),this.emplace(je,ie,ye,Pe)},C.prototype.emplace=function(ie,ye,Pe,je){var ut=ie*2,Lt=ie*4;return this.uint32[ut+0]=ye,this.uint16[Lt+2]=Pe,this.uint16[Lt+3]=je,ie},C})(Mn);gi.prototype.bytesPerElement=8,ve("StructArrayLayout1ul2ui8",gi);var wi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ie,ye)},C.prototype.emplace=function(ie,ye,Pe){var je=ie*2;return this.uint16[je+0]=ye,this.uint16[je+1]=Pe,ie},C})(Mn);wi.prototype.bytesPerElement=4,ve("StructArrayLayout2ui4",wi);var Ii=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ie)},C.prototype.emplace=function(ie,ye){var Pe=ie*1;return this.uint16[Pe+0]=ye,ie},C})(Mn);Ii.prototype.bytesPerElement=2,ve("StructArrayLayout1ui2",Ii);var cs=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ie,ye,Pe,je){var ut=this.length;return this.resize(ut+1),this.emplace(ut,ie,ye,Pe,je)},C.prototype.emplace=function(ie,ye,Pe,je,ut){var Lt=ie*4;return this.float32[Lt+0]=ye,this.float32[Lt+1]=Pe,this.float32[Lt+2]=je,this.float32[Lt+3]=ut,ie},C})(Mn);cs.prototype.bytesPerElement=16,ve("StructArrayLayout4f16",cs);var Zs=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return G.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},G.x1.get=function(){return this._structArray.int16[this._pos2+2]},G.y1.get=function(){return this._structArray.int16[this._pos2+3]},G.x2.get=function(){return this._structArray.int16[this._pos2+4]},G.y2.get=function(){return this._structArray.int16[this._pos2+5]},G.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},G.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},G.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},G.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,G),C})(fn);Zs.prototype.size=20;var Ji=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ie){return new Zs(this,ie)},C})(Un);ve("CollisionBoxArray",Ji);var yl=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return G.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},G.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},G.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},G.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},G.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},G.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},G.segment.get=function(){return this._structArray.uint16[this._pos2+10]},G.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},G.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},G.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},G.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},G.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},G.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},G.placedOrientation.set=function(ie){this._structArray.uint8[this._pos1+37]=ie},G.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},G.hidden.set=function(ie){this._structArray.uint8[this._pos1+38]=ie},G.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},G.crossTileID.set=function(ie){this._structArray.uint32[this._pos4+10]=ie},G.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,G),C})(fn);yl.prototype.size=48;var Xo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ie){return new yl(this,ie)},C})(oi);ve("PlacedSymbolArray",Xo);var Qs=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return G.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},G.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},G.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},G.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},G.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},G.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},G.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},G.key.get=function(){return this._structArray.uint16[this._pos2+8]},G.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},G.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},G.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},G.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},G.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},G.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},G.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},G.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},G.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},G.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},G.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},G.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},G.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},G.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},G.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},G.crossTileID.set=function(ie){this._structArray.uint32[this._pos4+12]=ie},G.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},G.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},G.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},G.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,G),C})(fn);Qs.prototype.size=68;var rl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ie){return new Qs(this,ie)},C})(bi);ve("SymbolInstanceArray",rl);var Ml=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(ie){return this.float32[ie*1+0]},C})(Tn);ve("GlyphOffsetArray",Ml);var ps=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(ie){return this.int16[ie*3+0]},C.prototype.gety=function(ie){return this.int16[ie*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(ie){return this.int16[ie*3+2]},C})(Zn);ve("SymbolLineVertexArray",ps);var qs=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return G.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},G.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},G.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,G),C})(fn);qs.prototype.size=8;var Ys=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ie){return new qs(this,ie)},C})(gi);ve("FeatureIndexArray",Ys);var Ri=_n([{name:"a_pos",components:2,type:"Int16"}],4),al=Ri.members,go=function(C){C===void 0&&(C=[]),this.segments=C};go.prototype.prepareSegment=function(C,G,ie,ye){var Pe=this.segments[this.segments.length-1];return C>go.MAX_VERTEX_ARRAY_LENGTH&&U("Max vertices per segment is "+go.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!Pe||Pe.vertexLength+C>go.MAX_VERTEX_ARRAY_LENGTH||Pe.sortKey!==ye)&&(Pe={vertexOffset:G.length,primitiveOffset:ie.length,vertexLength:0,primitiveLength:0},ye!==void 0&&(Pe.sortKey=ye),this.segments.push(Pe)),Pe},go.prototype.get=function(){return this.segments},go.prototype.destroy=function(){for(var C=0,G=this.segments;C>>16)*Lt&65535)<<16)&4294967295,Kt=Kt<<15|Kt>>>17,Kt=(Kt&65535)*Ut+(((Kt>>>16)*Ut&65535)<<16)&4294967295,je^=Kt,je=je<<13|je>>>19,ut=(je&65535)*5+(((je>>>16)*5&65535)<<16)&4294967295,je=(ut&65535)+27492+(((ut>>>16)+58964&65535)<<16);switch(Kt=0,ye){case 3:Kt^=(G.charCodeAt(Mr+2)&255)<<16;case 2:Kt^=(G.charCodeAt(Mr+1)&255)<<8;case 1:Kt^=G.charCodeAt(Mr)&255,Kt=(Kt&65535)*Lt+(((Kt>>>16)*Lt&65535)<<16)&4294967295,Kt=Kt<<15|Kt>>>17,Kt=(Kt&65535)*Ut+(((Kt>>>16)*Ut&65535)<<16)&4294967295,je^=Kt}return je^=G.length,je^=je>>>16,je=(je&65535)*2246822507+(((je>>>16)*2246822507&65535)<<16)&4294967295,je^=je>>>13,je=(je&65535)*3266489909+(((je>>>16)*3266489909&65535)<<16)&4294967295,je^=je>>>16,je>>>0}k.exports=C}),te=t(function(k){function C(G,ie){for(var ye=G.length,Pe=ie^ye,je=0,ut;ye>=4;)ut=G.charCodeAt(je)&255|(G.charCodeAt(++je)&255)<<8|(G.charCodeAt(++je)&255)<<16|(G.charCodeAt(++je)&255)<<24,ut=(ut&65535)*1540483477+(((ut>>>16)*1540483477&65535)<<16),ut^=ut>>>24,ut=(ut&65535)*1540483477+(((ut>>>16)*1540483477&65535)<<16),Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16)^ut,ye-=4,++je;switch(ye){case 3:Pe^=(G.charCodeAt(je+2)&255)<<16;case 2:Pe^=(G.charCodeAt(je+1)&255)<<8;case 1:Pe^=G.charCodeAt(je)&255,Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16)}return Pe^=Pe>>>13,Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16),Pe^=Pe>>>15,Pe>>>0}k.exports=C}),pe=me,Ve=me,ke=te;pe.murmur3=Ve,pe.murmur2=ke;var Ye=function(){this.ids=[],this.positions=[],this.indexed=!1};Ye.prototype.add=function(C,G,ie,ye){this.ids.push(Ot(C)),this.positions.push(G,ie,ye)},Ye.prototype.getPositions=function(C){for(var G=Ot(C),ie=0,ye=this.ids.length-1;ie>1;this.ids[Pe]>=G?ye=Pe:ie=Pe+1}for(var je=[];this.ids[ie]===G;){var ut=this.positions[3*ie],Lt=this.positions[3*ie+1],Ut=this.positions[3*ie+2];je.push({index:ut,start:Lt,end:Ut}),ie++}return je},Ye.serialize=function(C,G){var ie=new Float64Array(C.ids),ye=new Uint32Array(C.positions);return dr(ie,ye,0,ie.length-1),G&&G.push(ie.buffer,ye.buffer),{ids:ie,positions:ye}},Ye.deserialize=function(C){var G=new Ye;return G.ids=C.ids,G.positions=C.positions,G.indexed=!0,G};var vt=Math.pow(2,53)-1;function Ot(k){var C=+k;return!isNaN(C)&&C<=vt?C:pe(String(k))}function dr(k,C,G,ie){for(;G>1],Pe=G-1,je=ie+1;;){do Pe++;while(k[Pe]ye);if(Pe>=je)break;Dr(k,Pe,je),Dr(C,3*Pe,3*je),Dr(C,3*Pe+1,3*je+1),Dr(C,3*Pe+2,3*je+2)}je-Gje.x+1||Ltje.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return G}function io(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?ti(k):[]}}function Ao(k,C,G,ie,ye){k.emplaceBack(C*2+(ie+1)/2,G*2+(ye+1)/2)}var ls=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new _a,this.indexArray=new On,this.segments=new go,this.programConfigurations=new Oa(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};ls.prototype.populate=function(C,G,ie){var ye=this.layers[0],Pe=[],je=null;ye.type==="circle"&&(je=ye.layout.get("circle-sort-key"));for(var ut=0,Lt=C;ut=en||qr<0||qr>=en)){var Fr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),na=Fr.vertexLength;Ao(this.layoutVertexArray,Mr,qr,-1,-1),Ao(this.layoutVertexArray,Mr,qr,1,-1),Ao(this.layoutVertexArray,Mr,qr,1,1),Ao(this.layoutVertexArray,Mr,qr,-1,1),this.indexArray.emplaceBack(na,na+1,na+2),this.indexArray.emplaceBack(na,na+3,na+2),Fr.vertexLength+=4,Fr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ie,{},ye)},ve("CircleBucket",ls,{omit:["layers"]});function bo(k,C){for(var G=0;G=3){for(var Pe=0;Pe1){if(uh(k,C))return!0;for(var ie=0;ie1?k.distSqr(G):k.distSqr(G.sub(C)._mult(ye)._add(C))}function Sh(k,C){for(var G=!1,ie,ye,Pe,je=0;jeC.y!=Pe.y>C.y&&C.x<(Pe.x-ye.x)*(C.y-ye.y)/(Pe.y-ye.y)+ye.x&&(G=!G)}return G}function kf(k,C){for(var G=!1,ie=0,ye=k.length-1;ieC.y!=je.y>C.y&&C.x<(je.x-Pe.x)*(C.y-Pe.y)/(je.y-Pe.y)+Pe.x&&(G=!G)}return G}function Mh(k,C,G,ie,ye){for(var Pe=0,je=k;Pe=ut.x&&ye>=ut.y)return!0}var Lt=[new i(C,G),new i(C,ye),new i(ie,ye),new i(ie,G)];if(k.length>2)for(var Ut=0,Kt=Lt;Utye.x&&C.x>ye.x||k.yye.y&&C.y>ye.y)return!1;var Pe=W(k,C,G[0]);return Pe!==W(k,C,G[1])||Pe!==W(k,C,G[2])||Pe!==W(k,C,G[3])}function Cf(k,C,G){var ie=C.paint.get(k).value;return ie.kind==="constant"?ie.value:G.programConfigurations.get(C.id).getMaxValue(k)}function ch(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function gh(k,C,G,ie,ye){if(!C[0]&&!C[1])return k;var Pe=i.convert(C)._mult(ye);G==="viewport"&&Pe._rotate(-ie);for(var je=[],ut=0;ut0&&(Pe=1/Math.sqrt(Pe)),k[0]=C[0]*Pe,k[1]=C[1]*Pe,k[2]=C[2]*Pe,k}function sx(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function lx(k,C,G){var ie=C[0],ye=C[1],Pe=C[2],je=G[0],ut=G[1],Lt=G[2];return k[0]=ye*Lt-Pe*ut,k[1]=Pe*je-ie*Lt,k[2]=ie*ut-ye*je,k}function ux(k,C,G){var ie=C[0],ye=C[1],Pe=C[2];return k[0]=ie*G[0]+ye*G[3]+Pe*G[6],k[1]=ie*G[1]+ye*G[4]+Pe*G[7],k[2]=ie*G[2]+ye*G[5]+Pe*G[8],k}var cx=_v,v5=(function(){var k=yv();return function(C,G,ie,ye,Pe,je){var ut,Lt;for(G||(G=3),ie||(ie=0),ye?Lt=Math.min(ye*G+ie,C.length):Lt=C.length,ut=ie;utk.width||ye.height>k.height||G.x>k.width-ye.width||G.y>k.height-ye.height)throw new RangeError("out of range source coordinates for image copy");if(ye.width>C.width||ye.height>C.height||ie.x>C.width-ye.width||ie.y>C.height-ye.height)throw new RangeError("out of range destination coordinates for image copy");for(var je=k.data,ut=C.data,Lt=0;Lt80*G){ut=Ut=k[0],Lt=Kt=k[1];for(var na=G;naUt&&(Ut=Mr),qr>Kt&&(Kt=qr);Fr=Math.max(Ut-ut,Kt-Lt),Fr=Fr!==0?1/Fr:0}return Qd(Pe,je,G,ut,Lt,Fr),je}function Jp(k,C,G,ie,ye){var Pe,je;if(ye===vm(k,C,G,ie)>0)for(Pe=C;Pe=C;Pe-=ie)je=Zg(Pe,k[Pe],k[Pe+1],je);return je&&tp(je,je.next)&&(np(je),je=je.next),je}function xv(k,C){if(!k)return k;C||(C=k);var G=k,ie;do if(ie=!1,!G.steiner&&(tp(G,G.next)||_c(G.prev,G,G.next)===0)){if(np(G),G=C=G.prev,G===G.next)break;ie=!0}else G=G.next;while(ie||G!==C);return C}function Qd(k,C,G,ie,ye,Pe,je){if(k){!je&&Pe&&$p(k,ie,ye,Pe);for(var ut=k,Lt,Ut;k.prev!==k.next;){if(Lt=k.prev,Ut=k.next,Pe?Hg(k,ie,ye,Pe):Gg(k)){C.push(Lt.i/G),C.push(k.i/G),C.push(Ut.i/G),np(k),k=Ut.next,ut=Ut.next;continue}if(k=Ut,k===ut){je?je===1?(k=ep(xv(k),C,G),Qd(k,C,G,ie,ye,Pe,2)):je===2&&Nh(k,C,G,ie,ye,Pe):Qd(xv(k),C,G,ie,ye,Pe,1);break}}}}function Gg(k){var C=k.prev,G=k,ie=k.next;if(_c(C,G,ie)>=0)return!1;for(var ye=k.next.next;ye!==k.prev;){if(wv(C.x,C.y,G.x,G.y,ie.x,ie.y,ye.x,ye.y)&&_c(ye.prev,ye,ye.next)>=0)return!1;ye=ye.next}return!0}function Hg(k,C,G,ie){var ye=k.prev,Pe=k,je=k.next;if(_c(ye,Pe,je)>=0)return!1;for(var ut=ye.xPe.x?ye.x>je.x?ye.x:je.x:Pe.x>je.x?Pe.x:je.x,Kt=ye.y>Pe.y?ye.y>je.y?ye.y:je.y:Pe.y>je.y?Pe.y:je.y,Mr=um(ut,Lt,C,G,ie),qr=um(Ut,Kt,C,G,ie),Fr=k.prevZ,na=k.nextZ;Fr&&Fr.z>=Mr&&na&&na.z<=qr;){if(Fr!==k.prev&&Fr!==k.next&&wv(ye.x,ye.y,Pe.x,Pe.y,je.x,je.y,Fr.x,Fr.y)&&_c(Fr.prev,Fr,Fr.next)>=0||(Fr=Fr.prevZ,na!==k.prev&&na!==k.next&&wv(ye.x,ye.y,Pe.x,Pe.y,je.x,je.y,na.x,na.y)&&_c(na.prev,na,na.next)>=0))return!1;na=na.nextZ}for(;Fr&&Fr.z>=Mr;){if(Fr!==k.prev&&Fr!==k.next&&wv(ye.x,ye.y,Pe.x,Pe.y,je.x,je.y,Fr.x,Fr.y)&&_c(Fr.prev,Fr,Fr.next)>=0)return!1;Fr=Fr.prevZ}for(;na&&na.z<=qr;){if(na!==k.prev&&na!==k.next&&wv(ye.x,ye.y,Pe.x,Pe.y,je.x,je.y,na.x,na.y)&&_c(na.prev,na,na.next)>=0)return!1;na=na.nextZ}return!0}function ep(k,C,G){var ie=k;do{var ye=ie.prev,Pe=ie.next.next;!tp(ye,Pe)&&Qp(ye,ie,ie.next,Pe)&&ap(ye,Pe)&&ap(Pe,ye)&&(C.push(ye.i/G),C.push(ie.i/G),C.push(Pe.i/G),np(ie),np(ie.next),ie=k=Pe),ie=ie.next}while(ie!==k);return xv(ie)}function Nh(k,C,G,ie,ye,Pe){var je=k;do{for(var ut=je.next.next;ut!==je.prev;){if(je.i!==ut.i&&sd(je,ut)){var Lt=fm(je,ut);je=xv(je,je.next),Lt=xv(Lt,Lt.next),Qd(je,C,G,ie,ye,Pe),Qd(Lt,C,G,ie,ye,Pe);return}ut=ut.next}je=je.next}while(je!==k)}function bv(k,C,G,ie){var ye=[],Pe,je,ut,Lt,Ut;for(Pe=0,je=C.length;Pe=G.next.y&&G.next.y!==G.y){var ut=G.x+(ye-G.y)*(G.next.x-G.x)/(G.next.y-G.y);if(ut<=ie&&ut>Pe){if(Pe=ut,ut===ie){if(ye===G.y)return G;if(ye===G.next.y)return G.next}je=G.x=G.x&&G.x>=Ut&&ie!==G.x&&wv(yeje.x||G.x===je.x&&_x(je,G)))&&(je=G,Mr=qr)),G=G.next;while(G!==Lt);return je}function _x(k,C){return _c(k.prev,k,C.prev)<0&&_c(C.next,k,k.next)<0}function $p(k,C,G,ie){var ye=k;do ye.z===null&&(ye.z=um(ye.x,ye.y,C,G,ie)),ye.prevZ=ye.prev,ye.nextZ=ye.next,ye=ye.next;while(ye!==k);ye.prevZ.nextZ=null,ye.prevZ=null,lm(ye)}function lm(k){var C,G,ie,ye,Pe,je,ut,Lt,Ut=1;do{for(G=k,k=null,Pe=null,je=0;G;){for(je++,ie=G,ut=0,C=0;C0||Lt>0&&ie;)ut!==0&&(Lt===0||!ie||G.z<=ie.z)?(ye=G,G=G.nextZ,ut--):(ye=ie,ie=ie.nextZ,Lt--),Pe?Pe.nextZ=ye:k=ye,ye.prevZ=Pe,Pe=ye;G=ie}Pe.nextZ=null,Ut*=2}while(je>1);return k}function um(k,C,G,ie,ye){return k=32767*(k-G)*ye,C=32767*(C-ie)*ye,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function cm(k){var C=k,G=k;do(C.x=0&&(k-je)*(ie-ut)-(G-je)*(C-ut)>=0&&(G-je)*(Pe-ut)-(ye-je)*(ie-ut)>=0}function sd(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Xg(k,C)&&(ap(k,C)&&ap(C,k)&&xx(k,C)&&(_c(k.prev,k,C.prev)||_c(k,C.prev,C))||tp(k,C)&&_c(k.prev,k,k.next)>0&&_c(C.prev,C,C.next)>0)}function _c(k,C,G){return(C.y-k.y)*(G.x-C.x)-(C.x-k.x)*(G.y-C.y)}function tp(k,C){return k.x===C.x&&k.y===C.y}function Qp(k,C,G,ie){var ye=Bv(_c(k,C,G)),Pe=Bv(_c(k,C,ie)),je=Bv(_c(G,ie,k)),ut=Bv(_c(G,ie,C));return!!(ye!==Pe&&je!==ut||ye===0&&rp(k,G,C)||Pe===0&&rp(k,ie,C)||je===0&&rp(G,k,ie)||ut===0&&rp(G,C,ie))}function rp(k,C,G){return C.x<=Math.max(k.x,G.x)&&C.x>=Math.min(k.x,G.x)&&C.y<=Math.max(k.y,G.y)&&C.y>=Math.min(k.y,G.y)}function Bv(k){return k>0?1:k<0?-1:0}function Xg(k,C){var G=k;do{if(G.i!==k.i&&G.next.i!==k.i&&G.i!==C.i&&G.next.i!==C.i&&Qp(G,G.next,k,C))return!0;G=G.next}while(G!==k);return!1}function ap(k,C){return _c(k.prev,k,k.next)<0?_c(k,C,k.next)>=0&&_c(k,k.prev,C)>=0:_c(k,C,k.prev)<0||_c(k,k.next,C)<0}function xx(k,C){var G=k,ie=!1,ye=(k.x+C.x)/2,Pe=(k.y+C.y)/2;do G.y>Pe!=G.next.y>Pe&&G.next.y!==G.y&&ye<(G.next.x-G.x)*(Pe-G.y)/(G.next.y-G.y)+G.x&&(ie=!ie),G=G.next;while(G!==k);return ie}function fm(k,C){var G=new hm(k.i,k.x,k.y),ie=new hm(C.i,C.x,C.y),ye=k.next,Pe=C.prev;return k.next=C,C.prev=k,G.next=ye,ye.prev=G,ie.next=G,G.prev=ie,Pe.next=ie,ie.prev=Pe,ie}function Zg(k,C,G,ie){var ye=new hm(k,C,G);return ie?(ye.next=ie.next,ye.prev=ie,ie.next.prev=ye,ie.next=ye):(ye.prev=ye,ye.next=ye),ye}function np(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function hm(k,C,G){this.i=k,this.x=C,this.y=G,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}od.deviation=function(k,C,G,ie){var ye=C&&C.length,Pe=ye?C[0]*G:k.length,je=Math.abs(vm(k,0,Pe,G));if(ye)for(var ut=0,Lt=C.length;ut0&&(ie+=k[ye-1].length,G.holes.push(ie))}return G},Kp.default=qg;function dm(k,C,G,ie,ye){tv(k,C,G||0,ie||k.length-1,ye||Yg)}function tv(k,C,G,ie,ye){for(;ie>G;){if(ie-G>600){var Pe=ie-G+1,je=C-G+1,ut=Math.log(Pe),Lt=.5*Math.exp(2*ut/3),Ut=.5*Math.sqrt(ut*Lt*(Pe-Lt)/Pe)*(je-Pe/2<0?-1:1),Kt=Math.max(G,Math.floor(C-je*Lt/Pe+Ut)),Mr=Math.min(ie,Math.floor(C+(Pe-je)*Lt/Pe+Ut));tv(k,C,Kt,Mr,ye)}var qr=k[C],Fr=G,na=ie;for(ld(k,G,C),ye(k[ie],qr)>0&&ld(k,G,ie);Fr0;)na--}ye(k[G],qr)===0?ld(k,G,na):(na++,ld(k,na,ie)),na<=C&&(G=na+1),C<=na&&(ie=na-1)}}function ld(k,C,G){var ie=k[C];k[C]=k[G],k[G]=ie}function Yg(k,C){return kC?1:0}function e0(k,C){var G=k.length;if(G<=1)return[k];for(var ie=[],ye,Pe,je=0;je1)for(var Lt=0;Lt>3}if(ie--,G===1||G===2)ye+=k.readSVarint(),Pe+=k.readSVarint(),G===1&&(ut&&je.push(ut),ut=[]),ut.push(new i(ye,Pe));else if(G===7)ut&&ut.push(ut[0].clone());else throw new Error("unknown command "+G)}return ut&&je.push(ut),je},Nv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,G=1,ie=0,ye=0,Pe=0,je=1/0,ut=-1/0,Lt=1/0,Ut=-1/0;k.pos>3}if(ie--,G===1||G===2)ye+=k.readSVarint(),Pe+=k.readSVarint(),yeut&&(ut=ye),PeUt&&(Ut=Pe);else if(G!==7)throw new Error("unknown command "+G)}return[je,Lt,ut,Ut]},Nv.prototype.toGeoJSON=function(k,C,G){var ie=this.extent*Math.pow(2,G),ye=this.extent*k,Pe=this.extent*C,je=this.loadGeometry(),ut=Nv.types[this.type],Lt,Ut;function Kt(Fr){for(var na=0;na>3;C=ie===1?k.readString():ie===2?k.readFloat():ie===3?k.readDouble():ie===4?k.readVarint64():ie===5?k.readVarint():ie===6?k.readSVarint():ie===7?k.readBoolean():null}return C}gm.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new mm(this._pbf,C,this.extent,this._keys,this._values)};var iy=wx;function wx(k,C){this.layers=k.readFields(Tx,{},C)}function Tx(k,C,G){if(k===3){var ie=new rv(G,G.readVarint()+G.pos);ie.length&&(C[ie.name]=ie)}}var oy=iy,ud=mm,sy=rv,av={VectorTile:oy,VectorTileFeature:ud,VectorTileLayer:sy},ly=av.VectorTileFeature.types,r0=500,cd=Math.pow(2,13);function Tv(k,C,G,ie,ye,Pe,je,ut){k.emplaceBack(C,G,Math.floor(ie*cd)*2+je,ye*cd*2,Pe*cd*2,Math.round(ut))}var Ih=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new on,this.indexArray=new On,this.programConfigurations=new Oa(C.layers,C.zoom),this.segments=new go,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};Ih.prototype.populate=function(C,G,ie){this.features=[],this.hasPattern=t0("fill-extrusion",this.layers,G);for(var ye=0,Pe=C;ye=1){var Vn=yn[qn-1];if(!Ax(kn,Vn)){Fr.vertexLength+4>go.MAX_VERTEX_ARRAY_LENGTH&&(Fr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var $n=kn.sub(Vn)._perp()._unit(),hi=Vn.dist(kn);Ka+hi>32768&&(Ka=0),Tv(this.layoutVertexArray,kn.x,kn.y,$n.x,$n.y,0,0,Ka),Tv(this.layoutVertexArray,kn.x,kn.y,$n.x,$n.y,0,1,Ka),Ka+=hi,Tv(this.layoutVertexArray,Vn.x,Vn.y,$n.x,$n.y,0,0,Ka),Tv(this.layoutVertexArray,Vn.x,Vn.y,$n.x,$n.y,0,1,Ka);var Ci=Fr.vertexLength;this.indexArray.emplaceBack(Ci,Ci+2,Ci+1),this.indexArray.emplaceBack(Ci+1,Ci+2,Ci+3),Fr.vertexLength+=4,Fr.primitiveLength+=2}}}}if(Fr.vertexLength+Ut>go.MAX_VERTEX_ARRAY_LENGTH&&(Fr=this.segments.prepareSegment(Ut,this.layoutVertexArray,this.indexArray)),ly[C.type]==="Polygon"){for(var Si=[],fo=[],Gi=Fr.vertexLength,ro=0,os=Lt;roen)||k.y===C.y&&(k.y<0||k.y>en)}function Sx(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>en})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>en})}var fd=new ca({"fill-extrusion-opacity":new tt(Nn["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qt(Nn["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new tt(Nn["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new tt(Nn["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new sr(Nn["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qt(Nn["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qt(Nn["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new tt(Nn["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),bf={paint:fd},Av=(function(k){function C(G){k.call(this,G,bf)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ie){return new Ih(ie)},C.prototype.queryRadius=function(){return ch(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(ie,ye,Pe,je,ut,Lt,Ut,Kt){var Mr=gh(ie,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Lt.angle,Ut),qr=this.paint.get("fill-extrusion-height").evaluate(ye,Pe),Fr=this.paint.get("fill-extrusion-base").evaluate(ye,Pe),na=Mx(Mr,Kt,Lt,0),La=_m(je,Fr,qr,Kt),yn=La[0],Ka=La[1];return uy(yn,Ka,na)},C})(Va);function Uv(k,C){return k.x*C.x+k.y*C.y}function ym(k,C){if(k.length===1){for(var G=0,ie=C[G++],ye;!ye||ie.equals(ye);)if(ye=C[G++],!ye)return 1/0;for(;G=2&&C[Ut-1].equals(C[Ut-2]);)Ut--;for(var Kt=0;Kt0;if(Si&&qn>Kt){var Gi=Fr.dist(na);if(Gi>2*Mr){var ro=Fr.sub(Fr.sub(na)._mult(Mr/Gi)._round());this.updateDistance(na,ro),this.addCurrentVertex(ro,yn,0,0,qr),na=ro}}var os=na&&La,ho=os?ie:Lt?"butt":ye;if(os&&ho==="round"&&(hiPe&&(ho="bevel"),ho==="bevel"&&(hi>2&&(ho="flipbevel"),hi100)kn=Ka.mult(-1);else{var _o=hi*yn.add(Ka).mag()/yn.sub(Ka).mag();kn._perp()._mult(_o*(fo?-1:1))}this.addCurrentVertex(Fr,kn,0,0,qr),this.addCurrentVertex(Fr,kn.mult(-1),0,0,qr)}else if(ho==="bevel"||ho==="fakeround"){var Ms=-Math.sqrt(hi*hi-1),ts=fo?Ms:0,_l=fo?0:Ms;if(na&&this.addCurrentVertex(Fr,yn,ts,_l,qr),ho==="fakeround")for(var ru=Math.round(Ci*180/Math.PI/bm),xl=1;xl2*Mr){var Xc=Fr.add(La.sub(Fr)._mult(Mr/vf)._round());this.updateDistance(Fr,Xc),this.addCurrentVertex(Xc,Ka,0,0,qr),Fr=Xc}}}}},Gc.prototype.addCurrentVertex=function(C,G,ie,ye,Pe,je){je===void 0&&(je=!1);var ut=G.x+G.y*ie,Lt=G.y-G.x*ie,Ut=-G.x+G.y*ye,Kt=-G.y-G.x*ye;this.addHalfVertex(C,ut,Lt,je,!1,ie,Pe),this.addHalfVertex(C,Ut,Kt,je,!0,-ye,Pe),this.distance>up/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,G,ie,ye,Pe,je))},Gc.prototype.addHalfVertex=function(C,G,ie,ye,Pe,je,ut){var Lt=C.x,Ut=C.y,Kt=this.lineClips?this.scaledDistance*(up-1):this.scaledDistance,Mr=Kt*n0;if(this.layoutVertexArray.emplaceBack((Lt<<1)+(ye?1:0),(Ut<<1)+(Pe?1:0),Math.round(a0*G)+128,Math.round(a0*ie)+128,(je===0?0:je<0?-1:1)+1|(Mr&63)<<2,Mr>>6),this.lineClips){var qr=this.scaledDistance-this.lineClips.start,Fr=this.lineClips.end-this.lineClips.start,na=qr/Fr;this.layoutVertexArray2.emplaceBack(na,this.lineClipsArray.length)}var La=ut.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,La),ut.primitiveLength++),Pe?this.e2=La:this.e1=La},Gc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Gc.prototype.updateDistance=function(C,G){this.distance+=C.dist(G),this.updateScaledDistance()},ve("LineBucket",Gc,{omit:["layers","patternFeatures"]});var wm=new ca({"line-cap":new tt(Nn.layout_line["line-cap"]),"line-join":new qt(Nn.layout_line["line-join"]),"line-miter-limit":new tt(Nn.layout_line["line-miter-limit"]),"line-round-limit":new tt(Nn.layout_line["line-round-limit"]),"line-sort-key":new qt(Nn.layout_line["line-sort-key"])}),Tm=new ca({"line-opacity":new qt(Nn.paint_line["line-opacity"]),"line-color":new qt(Nn.paint_line["line-color"]),"line-translate":new tt(Nn.paint_line["line-translate"]),"line-translate-anchor":new tt(Nn.paint_line["line-translate-anchor"]),"line-width":new qt(Nn.paint_line["line-width"]),"line-gap-width":new qt(Nn.paint_line["line-gap-width"]),"line-offset":new qt(Nn.paint_line["line-offset"]),"line-blur":new qt(Nn.paint_line["line-blur"]),"line-dasharray":new ra(Nn.paint_line["line-dasharray"]),"line-pattern":new sr(Nn.paint_line["line-pattern"]),"line-gradient":new da(Nn.paint_line["line-gradient"])}),i0={paint:Tm,layout:wm},kx=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(ie,ye){return ye=new si(Math.floor(ye.zoom),{now:ye.now,fadeDuration:ye.fadeDuration,zoomHistory:ye.zoomHistory,transition:ye.transition}),k.prototype.possiblyEvaluate.call(this,ie,ye)},C.prototype.evaluate=function(ie,ye,Pe,je){return ye=y({},ye,{zoom:Math.floor(ye.zoom)}),k.prototype.evaluate.call(this,ie,ye,Pe,je)},C})(qt),H=new kx(i0.paint.properties["line-width"].specification);H.useIntegerZoom=!0;var D=(function(k){function C(G){k.call(this,G,i0),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(ie){if(ie==="line-gradient"){var ye=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=ye._styleExpression.expression instanceof Gl,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(ie,ye){k.prototype.recalculate.call(this,ie,ye),this.paint._values["line-floorwidth"]=H.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ie)},C.prototype.createBucket=function(ie){return new Gc(ie)},C.prototype.queryRadius=function(ie){var ye=ie,Pe=K(Cf("line-width",this,ye),Cf("line-gap-width",this,ye)),je=Cf("line-offset",this,ye);return Pe/2+Math.abs(je)+ch(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(ie,ye,Pe,je,ut,Lt,Ut){var Kt=gh(ie,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Lt.angle,Ut),Mr=Ut/2*K(this.paint.get("line-width").evaluate(ye,Pe),this.paint.get("line-gap-width").evaluate(ye,Pe)),qr=this.paint.get("line-offset").evaluate(ye,Pe);return qr&&(je=fe(je,qr*Ut)),Ol(Kt,je,Mr)},C.prototype.isTileClipped=function(){return!0},C})(Va);function K(k,C){return C>0?C+2*k:k}function fe(k,C){for(var G=[],ie=new i(0,0),ye=0;ye":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Rn(k){for(var C="",G=0;G>1,Kt=-7,Mr=G?ye-1:0,qr=G?-1:1,Fr=k[C+Mr];for(Mr+=qr,Pe=Fr&(1<<-Kt)-1,Fr>>=-Kt,Kt+=ut;Kt>0;Pe=Pe*256+k[C+Mr],Mr+=qr,Kt-=8);for(je=Pe&(1<<-Kt)-1,Pe>>=-Kt,Kt+=ie;Kt>0;je=je*256+k[C+Mr],Mr+=qr,Kt-=8);if(Pe===0)Pe=1-Ut;else{if(Pe===Lt)return je?NaN:(Fr?-1:1)*(1/0);je=je+Math.pow(2,ie),Pe=Pe-Ut}return(Fr?-1:1)*je*Math.pow(2,Pe-ie)},po=function(k,C,G,ie,ye,Pe){var je,ut,Lt,Ut=Pe*8-ye-1,Kt=(1<>1,qr=ye===23?Math.pow(2,-24)-Math.pow(2,-77):0,Fr=ie?0:Pe-1,na=ie?1:-1,La=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(ut=isNaN(C)?1:0,je=Kt):(je=Math.floor(Math.log(C)/Math.LN2),C*(Lt=Math.pow(2,-je))<1&&(je--,Lt*=2),je+Mr>=1?C+=qr/Lt:C+=qr*Math.pow(2,1-Mr),C*Lt>=2&&(je++,Lt/=2),je+Mr>=Kt?(ut=0,je=Kt):je+Mr>=1?(ut=(C*Lt-1)*Math.pow(2,ye),je=je+Mr):(ut=C*Math.pow(2,Mr-1)*Math.pow(2,ye),je=0));ye>=8;k[G+Fr]=ut&255,Fr+=na,ut/=256,ye-=8);for(je=je<0;k[G+Fr]=je&255,Fr+=na,je/=256,Ut-=8);k[G+Fr-na]|=La*128},$o={read:ki,write:po},to=Ti;function Ti(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Ti.Varint=0,Ti.Fixed64=1,Ti.Bytes=2,Ti.Fixed32=5;var No=65536*65536,So=1/No,wo=12,fi=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Ti.prototype={destroy:function(){this.buf=null},readFields:function(k,C,G){for(G=G||this.length;this.pos>3,Pe=this.pos;this.type=ie&7,k(ye,C,this),this.pos===Pe&&this.skip(ie)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=cf(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=dh(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=cf(this.buf,this.pos)+cf(this.buf,this.pos+4)*No;return this.pos+=8,k},readSFixed64:function(){var k=cf(this.buf,this.pos)+dh(this.buf,this.pos+4)*No;return this.pos+=8,k},readFloat:function(){var k=$o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=$o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,G,ie;return ie=C[this.pos++],G=ie&127,ie<128||(ie=C[this.pos++],G|=(ie&127)<<7,ie<128)||(ie=C[this.pos++],G|=(ie&127)<<14,ie<128)||(ie=C[this.pos++],G|=(ie&127)<<21,ie<128)?G:(ie=C[this.pos],G|=(ie&15)<<28,Ho(G,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=wo&&fi?Dl(this.buf,C,k):Kf(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Ti.Bytes)return k.push(this.readVarint(C));var G=To(this);for(k=k||[];this.pos127;);else if(C===Ti.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Ti.Fixed32)this.pos+=4;else if(C===Ti.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){mu(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=Lu(this.buf,k,this.pos);var G=this.pos-C;G>=128&&_h(C,G,this),this.pos=C-1,this.writeVarint(G),this.pos+=G},writeFloat:function(k){this.realloc(4),$o.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),$o.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var G=0;G=128&&_h(G,ie,this),this.pos=G-1,this.writeVarint(ie),this.pos+=ie},writeMessage:function(k,C,G){this.writeTag(k,Ti.Bytes),this.writeRawMessage(C,G)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,wf,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,tf,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Gf,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Vf,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,qf,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,xc,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,rf,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,If,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Tf,C)},writeBytesField:function(k,C){this.writeTag(k,Ti.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Ti.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Ti.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Ti.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Ho(k,C,G){var ie=G.buf,ye,Pe;if(Pe=ie[G.pos++],ye=(Pe&112)>>4,Pe<128||(Pe=ie[G.pos++],ye|=(Pe&127)<<3,Pe<128)||(Pe=ie[G.pos++],ye|=(Pe&127)<<10,Pe<128)||(Pe=ie[G.pos++],ye|=(Pe&127)<<17,Pe<128)||(Pe=ie[G.pos++],ye|=(Pe&127)<<24,Pe<128)||(Pe=ie[G.pos++],ye|=(Pe&1)<<31,Pe<128))return ss(k,ye,C);throw new Error("Expected varint not more than 10 bytes")}function To(k){return k.type===Ti.Bytes?k.readVarint()+k.pos:k.pos+1}function ss(k,C,G){return G?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function mu(k,C){var G,ie;if(k>=0?(G=k%4294967296|0,ie=k/4294967296|0):(G=~(-k%4294967296),ie=~(-k/4294967296),G^4294967295?G=G+1|0:(G=0,ie=ie+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),su(G,ie,C),ef(ie,C)}function su(k,C,G){G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos]=k&127}function ef(k,C){var G=(k&7)<<4;C.buf[C.pos++]|=G|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function _h(k,C,G){var ie=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));G.realloc(ie);for(var ye=G.pos-1;ye>=k;ye--)G.buf[ye+ie]=G.buf[ye]}function wf(k,C){for(var G=0;G>>8,k[G+2]=C>>>16,k[G+3]=C>>>24}function dh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function Kf(k,C,G){for(var ie="",ye=C;ye239?4:Pe>223?3:Pe>191?2:1;if(ye+ut>G)break;var Lt,Ut,Kt;ut===1?Pe<128&&(je=Pe):ut===2?(Lt=k[ye+1],(Lt&192)===128&&(je=(Pe&31)<<6|Lt&63,je<=127&&(je=null))):ut===3?(Lt=k[ye+1],Ut=k[ye+2],(Lt&192)===128&&(Ut&192)===128&&(je=(Pe&15)<<12|(Lt&63)<<6|Ut&63,(je<=2047||je>=55296&&je<=57343)&&(je=null))):ut===4&&(Lt=k[ye+1],Ut=k[ye+2],Kt=k[ye+3],(Lt&192)===128&&(Ut&192)===128&&(Kt&192)===128&&(je=(Pe&15)<<18|(Lt&63)<<12|(Ut&63)<<6|Kt&63,(je<=65535||je>=1114112)&&(je=null))),je===null?(je=65533,ut=1):je>65535&&(je-=65536,ie+=String.fromCharCode(je>>>10&1023|55296),je=56320|je&1023),ie+=String.fromCharCode(je),ye+=ut}return ie}function Dl(k,C,G){return fi.decode(k.subarray(C,G))}function Lu(k,C,G){for(var ie=0,ye,Pe;ie55295&&ye<57344)if(Pe)if(ye<56320){k[G++]=239,k[G++]=191,k[G++]=189,Pe=ye;continue}else ye=Pe-55296<<10|ye-56320|65536,Pe=null;else{ye>56319||ie+1===C.length?(k[G++]=239,k[G++]=191,k[G++]=189):Pe=ye;continue}else Pe&&(k[G++]=239,k[G++]=191,k[G++]=189,Pe=null);ye<128?k[G++]=ye:(ye<2048?k[G++]=ye>>6|192:(ye<65536?k[G++]=ye>>12|224:(k[G++]=ye>>18|240,k[G++]=ye>>12&63|128),k[G++]=ye>>6&63|128),k[G++]=ye&63|128)}return G}var gu=3;function ph(k,C,G){k===1&&G.readMessage(uc,C)}function uc(k,C,G){if(k===3){var ie=G.readMessage(hd,{}),ye=ie.id,Pe=ie.bitmap,je=ie.width,ut=ie.height,Lt=ie.left,Ut=ie.top,Kt=ie.advance;C.push({id:ye,bitmap:new vh({width:je+2*gu,height:ut+2*gu},Pe),metrics:{width:je,height:ut,left:Lt,top:Ut,advance:Kt}})}}function hd(k,C,G){k===1?C.id=G.readVarint():k===2?C.bitmap=G.readBytes():k===3?C.width=G.readVarint():k===4?C.height=G.readVarint():k===5?C.left=G.readSVarint():k===6?C.top=G.readSVarint():k===7&&(C.advance=G.readVarint())}function Uh(k){return new to(k).readFields(ph,[])}var Rh=gu;function xh(k){for(var C=0,G=0,ie=0,ye=k;ie=0;Fr--){var na=ut[Fr];if(!(qr.w>na.w||qr.h>na.h)){if(qr.x=na.x,qr.y=na.y,Ut=Math.max(Ut,qr.y+qr.h),Lt=Math.max(Lt,qr.x+qr.w),qr.w===na.w&&qr.h===na.h){var La=ut.pop();Fr=0&&ye>=C&&Vh[this.text.charCodeAt(ye)];ye--)ie--;this.text=this.text.substring(C,ie),this.sectionIndex=this.sectionIndex.slice(C,ie)},ff.prototype.substring=function(C,G){var ie=new ff;return ie.text=this.text.substring(C,G),ie.sectionIndex=this.sectionIndex.slice(C,G),ie.sections=this.sections,ie},ff.prototype.toString=function(){return this.text},ff.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(G,ie){return Math.max(G,C.sections[ie].scale)},0)},ff.prototype.addTextSection=function(C,G){this.text+=C.text,this.sections.push(jv.forText(C.scale,C.fontStack||G));for(var ie=this.sections.length-1,ye=0;ye=jh?null:++this.imageSectionID:(this.imageSectionID=o0,this.imageSectionID)};function Cx(k,C){for(var G=[],ie=k.text,ye=0,Pe=0,je=C;Pe=0,Kt=0,Mr=0;Mr0&&Xc>fo&&(fo=Xc)}else{var bl=G[ro.fontStack],cl=bl&&bl[ho];if(cl&&cl.rect)ts=cl.rect,Ms=cl.metrics;else{var yu=C[ro.fontStack],Pu=yu&&yu[ho];if(!Pu)continue;Ms=Pu.metrics}_o=($n-ro.scale)*Hn}xl?(k.verticalizable=!0,Si.push({glyph:ho,imageName:_l,x:qr,y:Fr+_o,vertical:xl,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:os,metrics:Ms,rect:ts}),qr+=ru*ro.scale+Ut):(Si.push({glyph:ho,imageName:_l,x:qr,y:Fr+_o,vertical:xl,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:os,metrics:Ms,rect:ts}),qr+=Ms.advance*ro.scale+Ut)}if(Si.length!==0){var Wf=qr-Ut;na=Math.max(Wf,na),Rx(Si,0,Si.length-1,yn,fo)}qr=0;var Xf=Pe*$n+fo;Ci.lineOffset=Math.max(fo,hi),Fr+=Xf,La=Math.max(Xf,La),++Ka}var df=Fr-vd,Qf=Sm(je),eh=Qf.horizontalAlign,af=Qf.verticalAlign;Rf(k.positionedLines,yn,eh,af,na,La,Pe,df,ye.length),k.top+=-af*df,k.bottom=k.top+df,k.left+=-eh*na,k.right=k.left+na}function Rx(k,C,G,ie,ye){if(!(!ie&&!ye))for(var Pe=k[G],je=Pe.metrics.advance*Pe.scale,ut=(k[G].x+je)*ie,Lt=C;Lt<=G;Lt++)k[Lt].x-=ut,k[Lt].y+=ye}function Rf(k,C,G,ie,ye,Pe,je,ut,Lt){var Ut=(C-G)*ye,Kt=0;Pe!==je?Kt=-ut*ie-vd:Kt=(-ie*Lt+.5)*je;for(var Mr=0,qr=k;Mr-G/2;){if(je--,je<0)return!1;ut-=k[je].dist(Pe),Pe=k[je]}ut+=k[je].dist(k[je+1]),je++;for(var Lt=[],Ut=0;utie;)Ut-=Lt.shift().angleDelta;if(Ut>ye)return!1;je++,ut+=Mr.dist(qr)}return!0}function y5(k){for(var C=0,G=0;GUt){var na=(Ut-Lt)/Fr,La=tl(Mr.x,qr.x,na),yn=tl(Mr.y,qr.y,na),Ka=new Hf(La,yn,qr.angleTo(Mr),Kt);return Ka._round(),!je||g5(k,Ka,ut,je,C)?Ka:void 0}Lt+=Fr}}function uD(k,C,G,ie,ye,Pe,je,ut,Lt){var Ut=_5(ie,Pe,je),Kt=x5(ie,ye),Mr=Kt*je,qr=k[0].x===0||k[0].x===Lt||k[0].y===0||k[0].y===Lt;C-Mr=0&&Vn=0&&$n=0&&qr+Ut<=Kt){var hi=new Hf(Vn,$n,qn,na);hi._round(),(!ie||g5(k,hi,Pe,ie,ye))&&Fr.push(hi)}}Mr+=Ka}return!ut&&!Fr.length&&!je&&(Fr=b5(k,Mr/2,G,ie,ye,Pe,je,!0,Lt)),Fr}function w5(k,C,G,ie,ye){for(var Pe=[],je=0;je=ie&&Mr.x>=ie)&&(Kt.x>=ie?Kt=new i(ie,Kt.y+(Mr.y-Kt.y)*((ie-Kt.x)/(Mr.x-Kt.x)))._round():Mr.x>=ie&&(Mr=new i(ie,Kt.y+(Mr.y-Kt.y)*((ie-Kt.x)/(Mr.x-Kt.x)))._round()),!(Kt.y>=ye&&Mr.y>=ye)&&(Kt.y>=ye?Kt=new i(Kt.x+(Mr.x-Kt.x)*((ye-Kt.y)/(Mr.y-Kt.y)),ye)._round():Mr.y>=ye&&(Mr=new i(Kt.x+(Mr.x-Kt.x)*((ye-Kt.y)/(Mr.y-Kt.y)),ye)._round()),(!Lt||!Kt.equals(Lt[Lt.length-1]))&&(Lt=[Kt],Pe.push(Lt)),Lt.push(Mr)))))}return Pe}var u0=$u;function T5(k,C,G,ie){var ye=[],Pe=k.image,je=Pe.pixelRatio,ut=Pe.paddedRect.w-2*u0,Lt=Pe.paddedRect.h-2*u0,Ut=k.right-k.left,Kt=k.bottom-k.top,Mr=Pe.stretchX||[[0,ut]],qr=Pe.stretchY||[[0,Lt]],Fr=function(bl,cl){return bl+cl[1]-cl[0]},na=Mr.reduce(Fr,0),La=qr.reduce(Fr,0),yn=ut-na,Ka=Lt-La,qn=0,kn=na,Vn=0,$n=La,hi=0,Ci=yn,Si=0,fo=Ka;if(Pe.content&&ie){var Gi=Pe.content;qn=gy(Mr,0,Gi[0]),Vn=gy(qr,0,Gi[1]),kn=gy(Mr,Gi[0],Gi[2]),$n=gy(qr,Gi[1],Gi[3]),hi=Gi[0]-qn,Si=Gi[1]-Vn,Ci=Gi[2]-Gi[0]-kn,fo=Gi[3]-Gi[1]-$n}var ro=function(bl,cl,yu,Pu){var bc=yy(bl.stretch-qn,kn,Ut,k.left),Mc=_y(bl.fixed-hi,Ci,bl.stretch,na),vf=yy(cl.stretch-Vn,$n,Kt,k.top),Xc=_y(cl.fixed-Si,fo,cl.stretch,La),Wf=yy(yu.stretch-qn,kn,Ut,k.left),Xf=_y(yu.fixed-hi,Ci,yu.stretch,na),df=yy(Pu.stretch-Vn,$n,Kt,k.top),Qf=_y(Pu.fixed-Si,fo,Pu.stretch,La),eh=new i(bc,vf),af=new i(Wf,vf),th=new i(Wf,df),Lh=new i(bc,df),Gv=new i(Mc/je,Xc/je),md=new i(Xf/je,Qf/je),gd=C*Math.PI/180;if(gd){var yd=Math.sin(gd),g0=Math.cos(gd),qh=[g0,-yd,yd,g0];eh._matMult(qh),af._matMult(qh),Lh._matMult(qh),th._matMult(qh)}var Sy=bl.stretch+bl.fixed,jx=yu.stretch+yu.fixed,My=cl.stretch+cl.fixed,Vx=Pu.stretch+Pu.fixed,Dh={x:Pe.paddedRect.x+u0+Sy,y:Pe.paddedRect.y+u0+My,w:jx-Sy,h:Vx-My},y0=Ci/je/Ut,Ey=fo/je/Kt;return{tl:eh,tr:af,bl:Lh,br:th,tex:Dh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Gv,pixelOffsetBR:md,minFontScaleX:y0,minFontScaleY:Ey,isSDF:G}};if(!ie||!Pe.stretchX&&!Pe.stretchY)ye.push(ro({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ut+1},{fixed:0,stretch:Lt+1}));else for(var os=A5(Mr,yn,na),ho=A5(qr,Ka,La),_o=0;_o0&&(na=Math.max(10,na),this.circleDiameter=na)}else{var La=je.top*ut-Lt,yn=je.bottom*ut+Lt,Ka=je.left*ut-Lt,qn=je.right*ut+Lt,kn=je.collisionPadding;if(kn&&(Ka-=kn[0]*ut,La-=kn[1]*ut,qn+=kn[2]*ut,yn+=kn[3]*ut),Kt){var Vn=new i(Ka,La),$n=new i(qn,La),hi=new i(Ka,yn),Ci=new i(qn,yn),Si=Kt*Math.PI/180;Vn._rotate(Si),$n._rotate(Si),hi._rotate(Si),Ci._rotate(Si),Ka=Math.min(Vn.x,$n.x,hi.x,Ci.x),qn=Math.max(Vn.x,$n.x,hi.x,Ci.x),La=Math.min(Vn.y,$n.y,hi.y,Ci.y),yn=Math.max(Vn.y,$n.y,hi.y,Ci.y)}C.emplaceBack(G.x,G.y,Ka,La,qn,yn,ie,ye,Pe)}this.boxEndIndex=C.length},c0=function(C,G){if(C===void 0&&(C=[]),G===void 0&&(G=fD),this.data=C,this.length=this.data.length,this.compare=G,this.length>0)for(var ie=(this.length>>1)-1;ie>=0;ie--)this._down(ie)};c0.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},c0.prototype.pop=function(){if(this.length!==0){var C=this.data[0],G=this.data.pop();return this.length--,this.length>0&&(this.data[0]=G,this._down(0)),C}},c0.prototype.peek=function(){return this.data[0]},c0.prototype._up=function(C){for(var G=this,ie=G.data,ye=G.compare,Pe=ie[C];C>0;){var je=C-1>>1,ut=ie[je];if(ye(Pe,ut)>=0)break;ie[C]=ut,C=je}ie[C]=Pe},c0.prototype._down=function(C){for(var G=this,ie=G.data,ye=G.compare,Pe=this.length>>1,je=ie[C];C=0)break;ie[C]=Lt,C=ut}ie[C]=je};function fD(k,C){return kC?1:0}function hD(k,C,G){C===void 0&&(C=1),G===void 0&&(G=!1);for(var ie=1/0,ye=1/0,Pe=-1/0,je=-1/0,ut=k[0],Lt=0;LtPe)&&(Pe=Ut.x),(!Lt||Ut.y>je)&&(je=Ut.y)}var Kt=Pe-ie,Mr=je-ye,qr=Math.min(Kt,Mr),Fr=qr/2,na=new c0([],vD);if(qr===0)return new i(ie,ye);for(var La=ie;LaKa.d||!Ka.d)&&(Ka=kn,G&&console.log("found best %d after %d probes",Math.round(1e4*kn.d)/1e4,qn)),!(kn.max-Ka.d<=C)&&(Fr=kn.h/2,na.push(new f0(kn.p.x-Fr,kn.p.y-Fr,Fr,k)),na.push(new f0(kn.p.x+Fr,kn.p.y-Fr,Fr,k)),na.push(new f0(kn.p.x-Fr,kn.p.y+Fr,Fr,k)),na.push(new f0(kn.p.x+Fr,kn.p.y+Fr,Fr,k)),qn+=4)}return G&&(console.log("num probes: "+qn),console.log("best distance: "+Ka.d)),Ka.p}function vD(k,C){return C.max-k.max}function f0(k,C,G,ie){this.p=new i(k,C),this.h=G,this.d=dD(this.p,ie),this.max=this.d+this.h*Math.SQRT2}function dD(k,C){for(var G=!1,ie=1/0,ye=0;yek.y!=Kt.y>k.y&&k.x<(Kt.x-Ut.x)*(k.y-Ut.y)/(Kt.y-Ut.y)+Ut.x&&(G=!G),ie=Math.min(ie,$h(k,Ut,Kt))}return(G?1:-1)*Math.sqrt(ie)}function pD(k){for(var C=0,G=0,ie=0,ye=k[0],Pe=0,je=ye.length,ut=je-1;Pe=en||qh.y<0||qh.y>=en||yD(k,qh,g0,G,ie,ye,ho,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,Ka,$n,Si,Lt,kn,hi,fo,Fr,C,Pe,Ut,Kt,je)};if(Gi==="line")for(var Ms=0,ts=w5(C.geometry,0,0,en,en);Ms1){var vf=lD(Mc,Ci,G.vertical||na,ie,La,qn);vf&&_o(Mc,vf)}}else if(C.type==="Polygon")for(var Xc=0,Wf=e0(C.geometry,0);Xcdd&&U(k.layerIds[0]+': Value for "text-size" is >= '+Mm+'. Reduce your "text-size".')):yn.kind==="composite"&&(Ka=[Df*Fr.compositeTextSizes[0].evaluate(je,{},na),Df*Fr.compositeTextSizes[1].evaluate(je,{},na)],(Ka[0]>dd||Ka[1]>dd)&&U(k.layerIds[0]+': Value for "text-size" is >= '+Mm+'. Reduce your "text-size".')),k.addSymbols(k.text,La,Ka,ut,Pe,je,Ut,C,Lt.lineStartIndex,Lt.lineLength,qr,na);for(var qn=0,kn=Kt;qndd&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Mm+'. Reduce your "icon-size".')):eh.kind==="composite"&&(af=[Df*$n.compositeIconSizes[0].evaluate(Vn,{},Ci),Df*$n.compositeIconSizes[1].evaluate(Vn,{},Ci)],(af[0]>dd||af[1]>dd)&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Mm+'. Reduce your "icon-size".')),k.addSymbols(k.icon,df,af,kn,qn,Vn,!1,C,Gi.lineStartIndex,Gi.lineLength,-1,Ci),xl=k.icon.placedSymbolArray.length-1,Qf&&(ts=Qf.length*4,k.addSymbols(k.icon,Qf,af,kn,qn,Vn,Jf.vertical,C,Gi.lineStartIndex,Gi.lineLength,-1,Ci),bl=k.icon.placedSymbolArray.length-1)}for(var th in ie.horizontal){var Lh=ie.horizontal[th];if(!ro){yu=pe(Lh.text);var Gv=ut.layout.get("text-rotate").evaluate(Vn,{},Ci);ro=new xy(Lt,C,Ut,Kt,Mr,Lh,qr,Fr,na,Gv)}var md=Lh.positionedLines.length===1;if(_l+=M5(k,C,Lh,Pe,ut,na,Vn,La,Gi,ie.vertical?Jf.horizontal:Jf.horizontalOnly,md?Object.keys(ie.horizontal):[th],cl,xl,$n,Ci),md)break}ie.vertical&&(ru+=M5(k,C,ie.vertical,Pe,ut,na,Vn,La,Gi,Jf.vertical,["vertical"],cl,bl,$n,Ci));var gd=ro?ro.boxStartIndex:k.collisionBoxArray.length,yd=ro?ro.boxEndIndex:k.collisionBoxArray.length,g0=ho?ho.boxStartIndex:k.collisionBoxArray.length,qh=ho?ho.boxEndIndex:k.collisionBoxArray.length,Sy=os?os.boxStartIndex:k.collisionBoxArray.length,jx=os?os.boxEndIndex:k.collisionBoxArray.length,My=_o?_o.boxStartIndex:k.collisionBoxArray.length,Vx=_o?_o.boxEndIndex:k.collisionBoxArray.length,Dh=-1,y0=function(Cm,q5){return Cm&&Cm.circleDiameter?Math.max(Cm.circleDiameter,q5):q5};Dh=y0(ro,Dh),Dh=y0(ho,Dh),Dh=y0(os,Dh),Dh=y0(_o,Dh);var Ey=Dh>-1?1:0;Ey&&(Dh*=Si/Hn),k.glyphOffsetArray.length>=tu.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,Vn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,cl.right>=0?cl.right:-1,cl.center>=0?cl.center:-1,cl.left>=0?cl.left:-1,cl.vertical||-1,xl,bl,yu,gd,yd,g0,qh,Sy,jx,My,Vx,Ut,_l,ru,Ms,ts,Ey,0,qr,Pu,bc,Dh)}function _D(k,C,G,ie){var ye=k.compareText;if(!(C in ye))ye[C]=[];else for(var Pe=ye[C],je=Pe.length-1;je>=0;je--)if(ie.dist(Pe[je])0)&&(je.value.kind!=="constant"||je.value.value.length>0),Kt=Lt.value.kind!=="constant"||!!Lt.value.value||Object.keys(Lt.parameters).length>0,Mr=Pe.get("symbol-sort-key");if(this.features=[],!(!Ut&&!Kt)){for(var qr=G.iconDependencies,Fr=G.glyphDependencies,na=G.availableImages,La=new si(this.zoom),yn=0,Ka=C;yn=0;for(var ru=0,xl=fo.sections;ru=0;Lt--)je[Lt]={x:G[Lt].x,y:G[Lt].y,tileUnitDistanceFromAnchor:Pe},Lt>0&&(Pe+=G[Lt-1].dist(G[Lt]));for(var Ut=0;Ut0},tu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},tu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},tu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},tu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},tu.prototype.addIndicesForPlacedSymbol=function(C,G){for(var ie=C.placedSymbolArray.get(G),ye=ie.vertexStartIndex+ie.numGlyphs*4,Pe=ie.vertexStartIndex;Pe1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var ie=0,ye=this.symbolInstanceIndexes;ie=0&&Ut.indexOf(ut)===Lt&&G.addIndicesForPlacedSymbol(G.text,ut)}),je.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,je.verticalPlacedTextSymbolIndex),je.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,je.placedIconSymbolIndex),je.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,je.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ve("SymbolBucket",tu,{omit:["layers","collisionBoxArray","features","compareText"]}),tu.MAX_GLYPHS=65535,tu.addDynamicAttributes=Fx;function TD(k,C){return C.replace(/{([^{}]+)}/g,function(G,ie){return ie in k?String(k[ie]):""})}var AD=new ca({"symbol-placement":new tt(Nn.layout_symbol["symbol-placement"]),"symbol-spacing":new tt(Nn.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new tt(Nn.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qt(Nn.layout_symbol["symbol-sort-key"]),"symbol-z-order":new tt(Nn.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new tt(Nn.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new tt(Nn.layout_symbol["icon-ignore-placement"]),"icon-optional":new tt(Nn.layout_symbol["icon-optional"]),"icon-rotation-alignment":new tt(Nn.layout_symbol["icon-rotation-alignment"]),"icon-size":new qt(Nn.layout_symbol["icon-size"]),"icon-text-fit":new tt(Nn.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new tt(Nn.layout_symbol["icon-text-fit-padding"]),"icon-image":new qt(Nn.layout_symbol["icon-image"]),"icon-rotate":new qt(Nn.layout_symbol["icon-rotate"]),"icon-padding":new tt(Nn.layout_symbol["icon-padding"]),"icon-keep-upright":new tt(Nn.layout_symbol["icon-keep-upright"]),"icon-offset":new qt(Nn.layout_symbol["icon-offset"]),"icon-anchor":new qt(Nn.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new tt(Nn.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new tt(Nn.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new tt(Nn.layout_symbol["text-rotation-alignment"]),"text-field":new qt(Nn.layout_symbol["text-field"]),"text-font":new qt(Nn.layout_symbol["text-font"]),"text-size":new qt(Nn.layout_symbol["text-size"]),"text-max-width":new qt(Nn.layout_symbol["text-max-width"]),"text-line-height":new tt(Nn.layout_symbol["text-line-height"]),"text-letter-spacing":new qt(Nn.layout_symbol["text-letter-spacing"]),"text-justify":new qt(Nn.layout_symbol["text-justify"]),"text-radial-offset":new qt(Nn.layout_symbol["text-radial-offset"]),"text-variable-anchor":new tt(Nn.layout_symbol["text-variable-anchor"]),"text-anchor":new qt(Nn.layout_symbol["text-anchor"]),"text-max-angle":new tt(Nn.layout_symbol["text-max-angle"]),"text-writing-mode":new tt(Nn.layout_symbol["text-writing-mode"]),"text-rotate":new qt(Nn.layout_symbol["text-rotate"]),"text-padding":new tt(Nn.layout_symbol["text-padding"]),"text-keep-upright":new tt(Nn.layout_symbol["text-keep-upright"]),"text-transform":new qt(Nn.layout_symbol["text-transform"]),"text-offset":new qt(Nn.layout_symbol["text-offset"]),"text-allow-overlap":new tt(Nn.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new tt(Nn.layout_symbol["text-ignore-placement"]),"text-optional":new tt(Nn.layout_symbol["text-optional"])}),SD=new ca({"icon-opacity":new qt(Nn.paint_symbol["icon-opacity"]),"icon-color":new qt(Nn.paint_symbol["icon-color"]),"icon-halo-color":new qt(Nn.paint_symbol["icon-halo-color"]),"icon-halo-width":new qt(Nn.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qt(Nn.paint_symbol["icon-halo-blur"]),"icon-translate":new tt(Nn.paint_symbol["icon-translate"]),"icon-translate-anchor":new tt(Nn.paint_symbol["icon-translate-anchor"]),"text-opacity":new qt(Nn.paint_symbol["text-opacity"]),"text-color":new qt(Nn.paint_symbol["text-color"],{runtimeType:js,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new qt(Nn.paint_symbol["text-halo-color"]),"text-halo-width":new qt(Nn.paint_symbol["text-halo-width"]),"text-halo-blur":new qt(Nn.paint_symbol["text-halo-blur"]),"text-translate":new tt(Nn.paint_symbol["text-translate"]),"text-translate-anchor":new tt(Nn.paint_symbol["text-translate-anchor"])}),Ox={paint:SD,layout:AD},d0=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:el,this.defaultValue=C};d0.prototype.evaluate=function(C){if(C.formattedSection){var G=this.defaultValue.property.overrides;if(G&&G.hasOverride(C.formattedSection))return G.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},d0.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var G=this.defaultValue.value;C(G._styleExpression.expression)}},d0.prototype.outputDefined=function(){return!1},d0.prototype.serialize=function(){return null},ve("FormatSectionOverride",d0,{omit:["defaultValue"]});var MD=(function(k){function C(G){k.call(this,G,Ox)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(ie,ye){if(k.prototype.recalculate.call(this,ie,ye),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Pe=this.layout.get("text-writing-mode");if(Pe){for(var je=[],ut=0,Lt=Pe;ut",targetMapId:ye,sourceMapId:je.mapId})}}},p0.prototype.receive=function(C){var G=C.data,ie=G.id;if(ie&&!(G.targetMapId&&this.mapId!==G.targetMapId))if(G.type===""){delete this.tasks[ie];var ye=this.cancelCallbacks[ie];delete this.cancelCallbacks[ie],ye&&ye()}else se()||G.mustQueue?(this.tasks[ie]=G,this.taskQueue.push(ie),this.invoker.trigger()):this.processTask(ie,G)},p0.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),G=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),G&&this.processTask(C,G)}},p0.prototype.processTask=function(C,G){var ie=this;if(G.type===""){var ye=this.callbacks[C];delete this.callbacks[C],ye&&(G.error?ye(wt(G.error)):ye(null,wt(G.data)))}else{var Pe=!1,je=$(this.globalScope)?void 0:[],ut=G.hasCallback?function(qr,Fr){Pe=!0,delete ie.cancelCallbacks[C],ie.target.postMessage({id:C,type:"",sourceMapId:ie.mapId,error:qr?mt(qr):null,data:mt(Fr,je)},je)}:function(qr){Pe=!0},Lt=null,Ut=wt(G.data);if(this.parent[G.type])Lt=this.parent[G.type](G.sourceMapId,Ut,ut);else if(this.parent.getWorkerSource){var Kt=G.type.split("."),Mr=this.parent.getWorkerSource(G.sourceMapId,Kt[0],Ut.source);Lt=Mr[Kt[1]](Ut,ut)}else ut(new Error("Could not find function "+G.type));!Pe&&Lt&&Lt.cancel&&(this.cancelCallbacks[C]=Lt.cancel)}},p0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function OD(k,C,G){C=Math.pow(2,G)-C-1;var ie=I5(k*256,C*256,G),ye=I5((k+1)*256,(C+1)*256,G);return ie[0]+","+ie[1]+","+ye[0]+","+ye[1]}function I5(k,C,G){var ie=2*Math.PI*6378137/256/Math.pow(2,G),ye=k*ie-2*Math.PI*6378137/2,Pe=C*ie-2*Math.PI*6378137/2;return[ye,Pe]}var Hc=function(C,G){C&&(G?this.setSouthWest(C).setNorthEast(G):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};Hc.prototype.setNorthEast=function(C){return this._ne=C instanceof Qu?new Qu(C.lng,C.lat):Qu.convert(C),this},Hc.prototype.setSouthWest=function(C){return this._sw=C instanceof Qu?new Qu(C.lng,C.lat):Qu.convert(C),this},Hc.prototype.extend=function(C){var G=this._sw,ie=this._ne,ye,Pe;if(C instanceof Qu)ye=C,Pe=C;else if(C instanceof Hc){if(ye=C._sw,Pe=C._ne,!ye||!Pe)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var je=C;return this.extend(Hc.convert(je))}else{var ut=C;return this.extend(Qu.convert(ut))}return this}return!G&&!ie?(this._sw=new Qu(ye.lng,ye.lat),this._ne=new Qu(Pe.lng,Pe.lat)):(G.lng=Math.min(ye.lng,G.lng),G.lat=Math.min(ye.lat,G.lat),ie.lng=Math.max(Pe.lng,ie.lng),ie.lat=Math.max(Pe.lat,ie.lat)),this},Hc.prototype.getCenter=function(){return new Qu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Hc.prototype.getSouthWest=function(){return this._sw},Hc.prototype.getNorthEast=function(){return this._ne},Hc.prototype.getNorthWest=function(){return new Qu(this.getWest(),this.getNorth())},Hc.prototype.getSouthEast=function(){return new Qu(this.getEast(),this.getSouth())},Hc.prototype.getWest=function(){return this._sw.lng},Hc.prototype.getSouth=function(){return this._sw.lat},Hc.prototype.getEast=function(){return this._ne.lng},Hc.prototype.getNorth=function(){return this._ne.lat},Hc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Hc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Hc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Hc.prototype.contains=function(C){var G=Qu.convert(C),ie=G.lng,ye=G.lat,Pe=this._sw.lat<=ye&&ye<=this._ne.lat,je=this._sw.lng<=ie&&ie<=this._ne.lng;return this._sw.lng>this._ne.lng&&(je=this._sw.lng>=ie&&ie>=this._ne.lng),Pe&&je},Hc.convert=function(C){return!C||C instanceof Hc?C:new Hc(C)};var R5=63710088e-1,Qu=function(C,G){if(isNaN(C)||isNaN(G))throw new Error("Invalid LngLat object: ("+C+", "+G+")");if(this.lng=+C,this.lat=+G,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Qu.prototype.wrap=function(){return new Qu(_(this.lng,-180,180),this.lat)},Qu.prototype.toArray=function(){return[this.lng,this.lat]},Qu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Qu.prototype.distanceTo=function(C){var G=Math.PI/180,ie=this.lat*G,ye=C.lat*G,Pe=Math.sin(ie)*Math.sin(ye)+Math.cos(ie)*Math.cos(ye)*Math.cos((C.lng-this.lng)*G),je=R5*Math.acos(Math.min(Pe,1));return je},Qu.prototype.toBounds=function(C){C===void 0&&(C=0);var G=40075017,ie=360*C/G,ye=ie/Math.cos(Math.PI/180*this.lat);return new Hc(new Qu(this.lng-ye,this.lat-ie),new Qu(this.lng+ye,this.lat+ie))},Qu.convert=function(C){if(C instanceof Qu)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Qu(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Qu(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var D5=2*Math.PI*R5;function z5(k){return D5*Math.cos(k*Math.PI/180)}function F5(k){return(180+k)/360}function O5(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function B5(k,C){return k/z5(C)}function BD(k){return k*360-180}function Nx(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function ND(k,C){return k*z5(Nx(C))}function UD(k){return 1/Math.cos(k*Math.PI/180)}var hp=function(C,G,ie){ie===void 0&&(ie=0),this.x=+C,this.y=+G,this.z=+ie};hp.fromLngLat=function(C,G){G===void 0&&(G=0);var ie=Qu.convert(C);return new hp(F5(ie.lng),O5(ie.lat),B5(G,ie.lat))},hp.prototype.toLngLat=function(){return new Qu(BD(this.x),Nx(this.y))},hp.prototype.toAltitude=function(){return ND(this.z,this.y)},hp.prototype.meterInMercatorCoordinateUnits=function(){return 1/D5*UD(Nx(this.y))};var vp=function(C,G,ie){this.z=C,this.x=G,this.y=ie,this.key=km(0,C,C,G,ie)};vp.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},vp.prototype.url=function(C,G){var ie=OD(this.x,this.y,this.z),ye=jD(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(G==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",ye).replace("{bbox-epsg-3857}",ie)},vp.prototype.getTilePoint=function(C){var G=Math.pow(2,this.z);return new i((C.x*G-this.x)*en,(C.y*G-this.y)*en)},vp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var N5=function(C,G){this.wrap=C,this.canonical=G,this.key=km(C,G.z,G.z,G.x,G.y)},Wc=function(C,G,ie,ye,Pe){this.overscaledZ=C,this.wrap=G,this.canonical=new vp(ie,+ye,+Pe),this.key=km(G,C,ie,ye,Pe)};Wc.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Wc.prototype.scaledTo=function(C){var G=this.canonical.z-C;return C>this.canonical.z?new Wc(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wc(C,this.wrap,C,this.canonical.x>>G,this.canonical.y>>G)},Wc.prototype.calculateScaledKey=function(C,G){var ie=this.canonical.z-C;return C>this.canonical.z?km(this.wrap*+G,C,this.canonical.z,this.canonical.x,this.canonical.y):km(this.wrap*+G,C,C,this.canonical.x>>ie,this.canonical.y>>ie)},Wc.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var G=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>G&&C.canonical.y===this.canonical.y>>G},Wc.prototype.children=function(C){if(this.overscaledZ>=C)return[new Wc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var G=this.canonical.z+1,ie=this.canonical.x*2,ye=this.canonical.y*2;return[new Wc(G,this.wrap,G,ie,ye),new Wc(G,this.wrap,G,ie+1,ye),new Wc(G,this.wrap,G,ie,ye+1),new Wc(G,this.wrap,G,ie+1,ye+1)]},Wc.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;Pe--)ye=1<=this.dim+1||G<-1||G>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(G+1)*this.stride+(C+1)},Vv.prototype._unpackMapbox=function(C,G,ie){return(C*256*256+G*256+ie)/10-1e4},Vv.prototype._unpackTerrarium=function(C,G,ie){return C*256+G+ie/256-32768},Vv.prototype.getPixels=function(){return new Qc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vv.prototype.backfillBorder=function(C,G,ie){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var ye=G*this.dim,Pe=G*this.dim+this.dim,je=ie*this.dim,ut=ie*this.dim+this.dim;switch(G){case-1:ye=Pe-1;break;case 1:Pe=ye+1;break}switch(ie){case-1:je=ut-1;break;case 1:ut=je+1;break}for(var Lt=-G*this.dim,Ut=-ie*this.dim,Kt=je;Kt=0&&Mr[3]>=0&&Lt.insert(ut,Mr[0],Mr[1],Mr[2],Mr[3])}},qv.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new av.VectorTile(new to(this.rawTileData)).layers,this.sourceLayerCoder=new Ty(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},qv.prototype.query=function(C,G,ie,ye){var Pe=this;this.loadVTLayers();for(var je=C.params||{},ut=en/C.tileSize/C.scale,Lt=Ze(je.filter),Ut=C.queryGeometry,Kt=C.queryPadding*ut,Mr=j5(Ut),qr=this.grid.query(Mr.minX-Kt,Mr.minY-Kt,Mr.maxX+Kt,Mr.maxY+Kt),Fr=j5(C.cameraQueryGeometry),na=this.grid3D.query(Fr.minX-Kt,Fr.minY-Kt,Fr.maxX+Kt,Fr.maxY+Kt,function(hi,Ci,Si,fo){return Mh(C.cameraQueryGeometry,hi-Kt,Ci-Kt,Si+Kt,fo+Kt)}),La=0,yn=na;Laye)Pe=!1;else if(!G)Pe=!0;else if(this.expirationTime=Cr.maxzoom)&&Cr.visibility!=="none"){h(Tr,this.zoom,Xt);var Kr=Ga[Cr.id]=Cr.createBucket({index:Pa.bucketLayerIDs.length,layers:Tr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Xn,sourceID:this.source});Kr.populate(Kn,ja,this.tileID.canonical),Pa.bucketLayerIDs.push(Tr.map(function($r){return $r.id}))}}}}var Nr,_t,Wt,Ar,Vr=e.mapObject(ja.glyphDependencies,function($r){return Object.keys($r).map(Number)});Object.keys(Vr).length?Rr.send("getGlyphs",{uid:this.uid,stacks:Vr},function($r,ga){Nr||(Nr=$r,_t=ga,wa.call(Jr))}):_t={};var ma=Object.keys(ja.iconDependencies);ma.length?Rr.send("getImages",{icons:ma,source:this.source,tileID:this.tileID,type:"icons"},function($r,ga){Nr||(Nr=$r,Wt=ga,wa.call(Jr))}):Wt={};var ba=Object.keys(ja.patternDependencies);ba.length?Rr.send("getImages",{icons:ba,source:this.source,tileID:this.tileID,type:"patterns"},function($r,ga){Nr||(Nr=$r,Ar=ga,wa.call(Jr))}):Ar={},wa.call(this);function wa(){if(Nr)return Yr(Nr);if(_t&&Wt&&Ar){var $r=new n(_t),ga=new e.ImageAtlas(Wt,Ar);for(var jn in Ga){var an=Ga[jn];an instanceof e.SymbolBucket?(h(an.layers,this.zoom,Xt),e.performSymbolLayout(an,_t,$r.positions,Wt,ga.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):an.hasPattern&&(an instanceof e.LineBucket||an instanceof e.FillBucket||an instanceof e.FillExtrusionBucket)&&(h(an.layers,this.zoom,Xt),an.addFeatures(ja,this.tileID.canonical,ga.patternPositions))}this.status="done",Yr(null,{buckets:e.values(Ga).filter(function(ei){return!ei.isEmpty()}),featureIndex:Pa,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:$r.image,imageAtlas:ga,glyphMap:this.returnDependencies?_t:null,iconMap:this.returnDependencies?Wt:null,glyphPositions:this.returnDependencies?$r.positions:null})}}};function h(Ht,It,Gt){for(var Xt=new e.EvaluationParameters(It),Rr=0,Yr=Ht;Rr=0!=!!It&&Ht.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,y=function(It){this._feature=It,this.extent=e.EXTENT,this.type=It.type,this.properties=It.tags,"id"in It&&!isNaN(It.id)&&(this.id=parseInt(It.id,10))};y.prototype.loadGeometry=function(){if(this._feature.type===1){for(var It=[],Gt=0,Xt=this._feature.geometry;Gt"u"&&(Xt.push(ia),Pa=Xt.length-1,Yr[ia]=Pa),It.writeVarint(Pa);var Ga=Gt.properties[ia],ja=typeof Ga;ja!=="string"&&ja!=="boolean"&&ja!=="number"&&(Ga=JSON.stringify(Ga));var Xa=ja+":"+Ga,sn=Jr[Xa];typeof sn>"u"&&(Rr.push(Ga),sn=Rr.length-1,Jr[Xa]=sn),It.writeVarint(sn)}}function Q(Ht,It){return(It<<3)+(Ht&7)}function le(Ht){return Ht<<1^Ht>>31}function se(Ht,It){for(var Gt=Ht.loadGeometry(),Xt=Ht.type,Rr=0,Yr=0,Jr=Gt.length,ia=0;ia>1;$(Ht,It,Jr,Xt,Rr,Yr%2),q(Ht,It,Gt,Xt,Jr-1,Yr+1),q(Ht,It,Gt,Jr+1,Rr,Yr+1)}}function $(Ht,It,Gt,Xt,Rr,Yr){for(;Rr>Xt;){if(Rr-Xt>600){var Jr=Rr-Xt+1,ia=Gt-Xt+1,Pa=Math.log(Jr),Ga=.5*Math.exp(2*Pa/3),ja=.5*Math.sqrt(Pa*Ga*(Jr-Ga)/Jr)*(ia-Jr/2<0?-1:1),Xa=Math.max(Xt,Math.floor(Gt-ia*Ga/Jr+ja)),sn=Math.min(Rr,Math.floor(Gt+(Jr-ia)*Ga/Jr+ja));$(Ht,It,Gt,Xa,sn,Yr)}var Ma=It[2*Gt+Yr],Xn=Xt,Kn=Rr;for(J(Ht,It,Xt,Gt),It[2*Rr+Yr]>Ma&&J(Ht,It,Xt,Rr);XnMa;)Kn--}It[2*Xt+Yr]===Ma?J(Ht,It,Xt,Kn):(Kn++,J(Ht,It,Kn,Rr)),Kn<=Gt&&(Xt=Kn+1),Gt<=Kn&&(Rr=Kn-1)}}function J(Ht,It,Gt,Xt){X(Ht,Gt,Xt),X(It,2*Gt,2*Xt),X(It,2*Gt+1,2*Xt+1)}function X(Ht,It,Gt){var Xt=Ht[It];Ht[It]=Ht[Gt],Ht[Gt]=Xt}function oe(Ht,It,Gt,Xt,Rr,Yr,Jr){for(var ia=[0,Ht.length-1,0],Pa=[],Ga,ja;ia.length;){var Xa=ia.pop(),sn=ia.pop(),Ma=ia.pop();if(sn-Ma<=Jr){for(var Xn=Ma;Xn<=sn;Xn++)Ga=It[2*Xn],ja=It[2*Xn+1],Ga>=Gt&&Ga<=Rr&&ja>=Xt&&ja<=Yr&&Pa.push(Ht[Xn]);continue}var Kn=Math.floor((Ma+sn)/2);Ga=It[2*Kn],ja=It[2*Kn+1],Ga>=Gt&&Ga<=Rr&&ja>=Xt&&ja<=Yr&&Pa.push(Ht[Kn]);var St=(Xa+1)%2;(Xa===0?Gt<=Ga:Xt<=ja)&&(ia.push(Ma),ia.push(Kn-1),ia.push(St)),(Xa===0?Rr>=Ga:Yr>=ja)&&(ia.push(Kn+1),ia.push(sn),ia.push(St))}return Pa}function ne(Ht,It,Gt,Xt,Rr,Yr){for(var Jr=[0,Ht.length-1,0],ia=[],Pa=Rr*Rr;Jr.length;){var Ga=Jr.pop(),ja=Jr.pop(),Xa=Jr.pop();if(ja-Xa<=Yr){for(var sn=Xa;sn<=ja;sn++)j(It[2*sn],It[2*sn+1],Gt,Xt)<=Pa&&ia.push(Ht[sn]);continue}var Ma=Math.floor((Xa+ja)/2),Xn=It[2*Ma],Kn=It[2*Ma+1];j(Xn,Kn,Gt,Xt)<=Pa&&ia.push(Ht[Ma]);var St=(Ga+1)%2;(Ga===0?Gt-Rr<=Xn:Xt-Rr<=Kn)&&(Jr.push(Xa),Jr.push(Ma-1),Jr.push(St)),(Ga===0?Gt+Rr>=Xn:Xt+Rr>=Kn)&&(Jr.push(Ma+1),Jr.push(ja),Jr.push(St))}return ia}function j(Ht,It,Gt,Xt){var Rr=Ht-Gt,Yr=It-Xt;return Rr*Rr+Yr*Yr}var ee=function(Ht){return Ht[0]},re=function(Ht){return Ht[1]},ue=function(It,Gt,Xt,Rr,Yr){Gt===void 0&&(Gt=ee),Xt===void 0&&(Xt=re),Rr===void 0&&(Rr=64),Yr===void 0&&(Yr=Float64Array),this.nodeSize=Rr,this.points=It;for(var Jr=It.length<65536?Uint16Array:Uint32Array,ia=this.ids=new Jr(It.length),Pa=this.coords=new Yr(It.length*2),Ga=0;Ga=Rr;ja--){var Xa=+Date.now();Pa=this._cluster(Pa,ja),this.trees[ja]=new ue(Pa,ce,ze,Jr,Float32Array),Xt&&console.log("z%d: %d clusters in %dms",ja,Pa.length,+Date.now()-Xa)}return Xt&&console.timeEnd("total time"),this},Te.prototype.getClusters=function(It,Gt){var Xt=((It[0]+180)%360+360)%360-180,Rr=Math.max(-90,Math.min(90,It[1])),Yr=It[2]===180?180:((It[2]+180)%360+360)%360-180,Jr=Math.max(-90,Math.min(90,It[3]));if(It[2]-It[0]>=360)Xt=-180,Yr=180;else if(Xt>Yr){var ia=this.getClusters([Xt,Rr,180,Jr],Gt),Pa=this.getClusters([-180,Rr,Yr,Jr],Gt);return ia.concat(Pa)}for(var Ga=this.trees[this._limitZoom(Gt)],ja=Ga.range(rt(Xt),$e(Jr),rt(Yr),$e(Rr)),Xa=[],sn=0,Ma=ja;snGt&&(Kn+=kr.numPoints||1)}if(Kn>=Pa){for(var Lr=Xa.x*Xn,Tr=Xa.y*Xn,Cr=ia&&Xn>1?this._map(Xa,!0):null,Kr=(ja<<5)+(Gt+1)+this.points.length,Nr=0,_t=Ma;Nr<_t.length;Nr+=1){var Wt=_t[Nr],Ar=sn.points[Wt];if(!(Ar.zoom<=Gt)){Ar.zoom=Gt;var Vr=Ar.numPoints||1;Lr+=Ar.x*Vr,Tr+=Ar.y*Vr,Ar.parentId=Kr,ia&&(Cr||(Cr=this._map(Xa,!0)),ia(Cr,this._map(Ar)))}}Xa.parentId=Kr,Xt.push(Ie(Lr/Kn,Tr/Kn,Kr,Kn,Cr))}else if(Xt.push(Xa),Kn>1)for(var ma=0,ba=Ma;ma>5},Te.prototype._getOriginZoom=function(It){return(It-this.points.length)%32},Te.prototype._map=function(It,Gt){if(It.numPoints)return Gt?ge({},It.properties):It.properties;var Xt=this.points[It.index].properties,Rr=this.options.map(Xt);return Gt&&Rr===Xt?ge({},Rr):Rr};function Ie(Ht,It,Gt,Xt,Rr){return{x:Ht,y:It,zoom:1/0,id:Gt,parentId:-1,numPoints:Xt,properties:Rr}}function De(Ht,It){var Gt=Ht.geometry.coordinates,Xt=Gt[0],Rr=Gt[1];return{x:rt(Xt),y:$e(Rr),zoom:1/0,index:It,parentId:-1}}function He(Ht){return{type:"Feature",id:Ht.id,properties:et(Ht),geometry:{type:"Point",coordinates:[ot(Ht.x),Ae(Ht.y)]}}}function et(Ht){var It=Ht.numPoints,Gt=It>=1e4?Math.round(It/1e3)+"k":It>=1e3?Math.round(It/100)/10+"k":It;return ge(ge({},Ht.properties),{cluster:!0,cluster_id:Ht.id,point_count:It,point_count_abbreviated:Gt})}function rt(Ht){return Ht/360+.5}function $e(Ht){var It=Math.sin(Ht*Math.PI/180),Gt=.5-.25*Math.log((1+It)/(1-It))/Math.PI;return Gt<0?0:Gt>1?1:Gt}function ot(Ht){return(Ht-.5)*360}function Ae(Ht){var It=(180-Ht*360)*Math.PI/180;return 360*Math.atan(Math.exp(It))/Math.PI-90}function ge(Ht,It){for(var Gt in It)Ht[Gt]=It[Gt];return Ht}function ce(Ht){return Ht.x}function ze(Ht){return Ht.y}function Qe(Ht,It,Gt,Xt){for(var Rr=Xt,Yr=Gt-It>>1,Jr=Gt-It,ia,Pa=Ht[It],Ga=Ht[It+1],ja=Ht[Gt],Xa=Ht[Gt+1],sn=It+3;snRr)ia=sn,Rr=Ma;else if(Ma===Rr){var Xn=Math.abs(sn-Yr);XnXt&&(ia-It>3&&Qe(Ht,It,ia,Xt),Ht[ia+2]=Rr,Gt-ia>3&&Qe(Ht,ia,Gt,Xt))}function nt(Ht,It,Gt,Xt,Rr,Yr){var Jr=Rr-Gt,ia=Yr-Xt;if(Jr!==0||ia!==0){var Pa=((Ht-Gt)*Jr+(It-Xt)*ia)/(Jr*Jr+ia*ia);Pa>1?(Gt=Rr,Xt=Yr):Pa>0&&(Gt+=Jr*Pa,Xt+=ia*Pa)}return Jr=Ht-Gt,ia=It-Xt,Jr*Jr+ia*ia}function Ke(Ht,It,Gt,Xt){var Rr={id:typeof Ht>"u"?null:Ht,type:It,geometry:Gt,tags:Xt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return kt(Rr),Rr}function kt(Ht){var It=Ht.geometry,Gt=Ht.type;if(Gt==="Point"||Gt==="MultiPoint"||Gt==="LineString")Et(Ht,It);else if(Gt==="Polygon"||Gt==="MultiLineString")for(var Xt=0;Xt0&&(Xt?Jr+=(Rr*Ga-Pa*Yr)/2:Jr+=Math.sqrt(Math.pow(Pa-Rr,2)+Math.pow(Ga-Yr,2))),Rr=Pa,Yr=Ga}var ja=It.length-3;It[2]=1,Qe(It,0,ja,Gt),It[ja+2]=1,It.size=Math.abs(Jr),It.start=0,It.end=It.size}function Or(Ht,It,Gt,Xt){for(var Rr=0;Rr1?1:Gt}function yt(Ht,It,Gt,Xt,Rr,Yr,Jr,ia){if(Gt/=It,Xt/=It,Yr>=Gt&&Jr=Xt)return null;for(var Pa=[],Ga=0;Ga=Gt&&Xn=Xt)continue;var Kn=[];if(sn==="Point"||sn==="MultiPoint")Oe(Xa,Kn,Gt,Xt,Rr);else if(sn==="LineString")Xe(Xa,Kn,Gt,Xt,Rr,!1,ia.lineMetrics);else if(sn==="MultiLineString")Ce(Xa,Kn,Gt,Xt,Rr,!1);else if(sn==="Polygon")Ce(Xa,Kn,Gt,Xt,Rr,!0);else if(sn==="MultiPolygon")for(var St=0;St=Gt&&Jr<=Xt&&(It.push(Ht[Yr]),It.push(Ht[Yr+1]),It.push(Ht[Yr+2]))}}function Xe(Ht,It,Gt,Xt,Rr,Yr,Jr){for(var ia=be(Ht),Pa=Rr===0?Ee:Se,Ga=Ht.start,ja,Xa,sn=0;snGt&&(Xa=Pa(ia,Ma,Xn,St,lt,Gt),Jr&&(ia.start=Ga+ja*Xa)):br>Xt?kr=Gt&&(Xa=Pa(ia,Ma,Xn,St,lt,Gt),Lr=!0),kr>Xt&&br<=Xt&&(Xa=Pa(ia,Ma,Xn,St,lt,Xt),Lr=!0),!Yr&&Lr&&(Jr&&(ia.end=Ga+ja*Xa),It.push(ia),ia=be(Ht)),Jr&&(Ga+=ja)}var Tr=Ht.length-3;Ma=Ht[Tr],Xn=Ht[Tr+1],Kn=Ht[Tr+2],br=Rr===0?Ma:Xn,br>=Gt&&br<=Xt&&Ne(ia,Ma,Xn,Kn),Tr=ia.length-3,Yr&&Tr>=3&&(ia[Tr]!==ia[0]||ia[Tr+1]!==ia[1])&&Ne(ia,ia[0],ia[1],ia[2]),ia.length&&It.push(ia)}function be(Ht){var It=[];return It.size=Ht.size,It.start=Ht.start,It.end=Ht.end,It}function Ce(Ht,It,Gt,Xt,Rr,Yr){for(var Jr=0;JrJr.maxX&&(Jr.maxX=ja),Xa>Jr.maxY&&(Jr.maxY=Xa)}return Jr}function Qt(Ht,It,Gt,Xt){var Rr=It.geometry,Yr=It.type,Jr=[];if(Yr==="Point"||Yr==="MultiPoint")for(var ia=0;ia0&&It.size<(Rr?Jr:Xt)){Gt.numPoints+=It.length/3;return}for(var ia=[],Pa=0;PaJr)&&(Gt.numSimplified++,ia.push(It[Pa]),ia.push(It[Pa+1])),Gt.numPoints++;Rr&&Sr(ia,Yr),Ht.push(ia)}function Sr(Ht,It){for(var Gt=0,Xt=0,Rr=Ht.length,Yr=Rr-2;Xt0===It)for(Xt=0,Rr=Ht.length;Xt24)throw new Error("maxZoom should be in the 0-24 range");if(It.promoteId&&It.generateId)throw new Error("promoteId and generateId cannot be used together.");var Xt=Bt(Ht,It);this.tiles={},this.tileCoords=[],Gt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",It.indexMaxZoom,It.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Xt=Le(Xt,It),Xt.length&&this.splitTile(Xt,0,0,0),Gt&&(Xt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Ea.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ea.prototype.splitTile=function(Ht,It,Gt,Xt,Rr,Yr,Jr){for(var ia=[Ht,It,Gt,Xt],Pa=this.options,Ga=Pa.debug;ia.length;){Xt=ia.pop(),Gt=ia.pop(),It=ia.pop(),Ht=ia.pop();var ja=1<1&&console.time("creation"),sn=this.tiles[Xa]=or(Ht,It,Gt,Xt,Pa),this.tileCoords.push({z:It,x:Gt,y:Xt}),Ga)){Ga>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",It,Gt,Xt,sn.numFeatures,sn.numPoints,sn.numSimplified),console.timeEnd("creation"));var Ma="z"+It;this.stats[Ma]=(this.stats[Ma]||0)+1,this.total++}if(sn.source=Ht,Rr){if(It===Pa.maxZoom||It===Rr)continue;var Xn=1<1&&console.time("clipping");var Kn=.5*Pa.buffer/Pa.extent,St=.5-Kn,lt=.5+Kn,br=1+Kn,kr,Lr,Tr,Cr,Kr,Nr;kr=Lr=Tr=Cr=null,Kr=yt(Ht,ja,Gt-Kn,Gt+lt,0,sn.minX,sn.maxX,Pa),Nr=yt(Ht,ja,Gt+St,Gt+br,0,sn.minX,sn.maxX,Pa),Ht=null,Kr&&(kr=yt(Kr,ja,Xt-Kn,Xt+lt,1,sn.minY,sn.maxY,Pa),Lr=yt(Kr,ja,Xt+St,Xt+br,1,sn.minY,sn.maxY,Pa),Kr=null),Nr&&(Tr=yt(Nr,ja,Xt-Kn,Xt+lt,1,sn.minY,sn.maxY,Pa),Cr=yt(Nr,ja,Xt+St,Xt+br,1,sn.minY,sn.maxY,Pa),Nr=null),Ga>1&&console.timeEnd("clipping"),ia.push(kr||[],It+1,Gt*2,Xt*2),ia.push(Lr||[],It+1,Gt*2,Xt*2+1),ia.push(Tr||[],It+1,Gt*2+1,Xt*2),ia.push(Cr||[],It+1,Gt*2+1,Xt*2+1)}}},Ea.prototype.getTile=function(Ht,It,Gt){var Xt=this.options,Rr=Xt.extent,Yr=Xt.debug;if(Ht<0||Ht>24)return null;var Jr=1<1&&console.log("drilling down to z%d-%d-%d",Ht,It,Gt);for(var Pa=Ht,Ga=It,ja=Gt,Xa;!Xa&&Pa>0;)Pa--,Ga=Math.floor(Ga/2),ja=Math.floor(ja/2),Xa=this.tiles[Sa(Pa,Ga,ja)];return!Xa||!Xa.source?null:(Yr>1&&console.log("found parent tile z%d-%d-%d",Pa,Ga,ja),Yr>1&&console.time("drilling down"),this.splitTile(Xa.source,Pa,Ga,ja,Ht,It,Gt),Yr>1&&console.timeEnd("drilling down"),this.tiles[ia]?gt(this.tiles[ia],Rr):null)};function Sa(Ht,It,Gt){return((1<=0?0:de.button},r.remove=function(de){de.parentNode&&de.parentNode.removeChild(de)};function p(de,Y,me){var te,pe,Ve,ke=e.browser.devicePixelRatio>1?"@2x":"",Ye=e.getJSON(Y.transformRequest(Y.normalizeSpriteURL(de,ke,".json"),e.ResourceType.SpriteJSON),function(dr,Dr){Ye=null,Ve||(Ve=dr,te=Dr,Ot())}),vt=e.getImage(Y.transformRequest(Y.normalizeSpriteURL(de,ke,".png"),e.ResourceType.SpriteImage),function(dr,Dr){vt=null,Ve||(Ve=dr,pe=Dr,Ot())});function Ot(){if(Ve)me(Ve);else if(te&&pe){var dr=e.browser.getImageData(pe),Dr={};for(var ur in te){var pt=te[ur],At=pt.width,Dt=pt.height,er=pt.x,lr=pt.y,ar=pt.sdf,cr=pt.pixelRatio,nr=pt.stretchX,Vt=pt.stretchY,rr=pt.content,Nt=new e.RGBAImage({width:At,height:Dt});e.RGBAImage.copy(dr,Nt,{x:er,y:lr},{x:0,y:0},{width:At,height:Dt}),Dr[ur]={data:Nt,pixelRatio:cr,sdf:ar,stretchX:nr,stretchY:Vt,content:rr}}me(null,Dr)}}return{cancel:function(){Ye&&(Ye.cancel(),Ye=null),vt&&(vt.cancel(),vt=null)}}}function T(de){var Y=de.userImage;if(Y&&Y.render){var me=Y.render();if(me)return de.data.replace(new Uint8Array(Y.data.buffer)),!0}return!1}var l=1,_=(function(de){function Y(){de.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.isLoaded=function(){return this.loaded},Y.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var pe=0,Ve=this.requestors;pe=0?1.2:1))}b.prototype.draw=function(de){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(de,this.buffer,this.middle);for(var Y=this.ctx.getImageData(0,0,this.size,this.size),me=new Uint8ClampedArray(this.size*this.size),te=0;te65535){dr(new Error("glyphs > 65535 not supported"));return}if(pt.ranges[Dt]){dr(null,{stack:Dr,id:ur,glyph:At});return}var er=pt.requests[Dt];er||(er=pt.requests[Dt]=[],g.loadGlyphRange(Dr,Dt,te.url,te.requestManager,function(lr,ar){if(ar){for(var cr in ar)te._doesCharSupportLocalGlyph(+cr)||(pt.glyphs[+cr]=ar[+cr]);pt.ranges[Dt]=!0}for(var nr=0,Vt=er;nr1&&(Ot=Y[++vt]);var Dr=Math.abs(dr-Ot.left),ur=Math.abs(dr-Ot.right),pt=Math.min(Dr,ur),At=void 0,Dt=Ve/te*(pe+1);if(Ot.isDash){var er=pe-Math.abs(Dt);At=Math.sqrt(pt*pt+er*er)}else At=pe-Math.sqrt(pt*pt+Dt*Dt);this.data[Ye+dr]=Math.max(0,Math.min(255,At+128))}},F.prototype.addRegularDash=function(Y){for(var me=Y.length-1;me>=0;--me){var te=Y[me],pe=Y[me+1];te.zeroLength?Y.splice(me,1):pe&&pe.isDash===te.isDash&&(pe.left=te.left,Y.splice(me,1))}var Ve=Y[0],ke=Y[Y.length-1];Ve.isDash===ke.isDash&&(Ve.left=ke.left-this.width,ke.right=Ve.right+this.width);for(var Ye=this.width*this.nextRow,vt=0,Ot=Y[vt],dr=0;dr1&&(Ot=Y[++vt]);var Dr=Math.abs(dr-Ot.left),ur=Math.abs(dr-Ot.right),pt=Math.min(Dr,ur),At=Ot.isDash?pt:-pt;this.data[Ye+dr]=Math.max(0,Math.min(255,At+128))}},F.prototype.addDash=function(Y,me){var te=me?7:0,pe=2*te+1;if(this.nextRow+pe>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ve=0,ke=0;ke=te.minX&&Y.x=te.minY&&Y.y0&&(dr[new e.OverscaledTileID(te.overscaledZ,Ye,pe.z,ke,pe.y-1).key]={backfilled:!1},dr[new e.OverscaledTileID(te.overscaledZ,te.wrap,pe.z,pe.x,pe.y-1).key]={backfilled:!1},dr[new e.OverscaledTileID(te.overscaledZ,Ot,pe.z,vt,pe.y-1).key]={backfilled:!1}),pe.y+10&&(Ve.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ve))})},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.setData=function(te){var pe=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ve){if(Ve){pe.fire(new e.ErrorEvent(Ve));return}var ke={dataType:"source",sourceDataType:"content"};pe._collectResourceTiming&&pe._resourceTiming&&pe._resourceTiming.length>0&&(ke.resourceTiming=pe._resourceTiming,pe._resourceTiming=[]),pe.fire(new e.Event("data",ke))}),this},Y.prototype.getClusterExpansionZoom=function(te,pe){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},pe),this},Y.prototype.getClusterChildren=function(te,pe){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},pe),this},Y.prototype.getClusterLeaves=function(te,pe,Ve,ke){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:pe,offset:Ve},ke),this},Y.prototype._updateWorkerData=function(te){var pe=this;this._loaded=!1;var Ve=e.extend({},this.workerOptions),ke=this._data;typeof ke=="string"?(Ve.request=this.map._requestManager.transformRequest(e.browser.resolveURL(ke),e.ResourceType.Source),Ve.request.collectResourceTiming=this._collectResourceTiming):Ve.data=JSON.stringify(ke),this.actor.send(this.type+".loadData",Ve,function(Ye,vt){pe._removed||vt&&vt.abandoned||(pe._loaded=!0,vt&&vt.resourceTiming&&vt.resourceTiming[pe.id]&&(pe._resourceTiming=vt.resourceTiming[pe.id].slice(0)),pe.actor.send(pe.type+".coalesce",{source:Ve.source},null),te(Ye))})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.loadTile=function(te,pe){var Ve=this,ke=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var Ye={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(ke,Ye,function(vt,Ot){return delete te.request,te.unloadVectorData(),te.aborted?pe(null):vt?pe(vt):(te.loadVectorData(Ot,Ve.map.painter,ke==="reloadTile"),pe(null))})},Y.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},Y.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},Y.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},Y.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},Y.prototype.hasTransition=function(){return!1},Y})(e.Evented),le=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),se=(function(de){function Y(me,te,pe,Ve){de.call(this),this.id=me,this.dispatcher=pe,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ve),this.options=te}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(te,pe){var Ve=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(ke,Ye){Ve._loaded=!0,ke?Ve.fire(new e.ErrorEvent(ke)):Ye&&(Ve.image=Ye,te&&(Ve.coordinates=te),pe&&pe(),Ve._finishLoading())})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.updateImage=function(te){var pe=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){pe.texture=null}),this)},Y.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.setCoordinates=function(te){var pe=this;this.coordinates=te;var Ve=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=he(Ve),this.minzoom=this.maxzoom=this.tileID.z;var ke=Ve.map(function(Ye){return pe.tileID.getTilePoint(Ye)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(ke[0].x,ke[0].y,0,0),this._boundsArray.emplaceBack(ke[1].x,ke[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(ke[3].x,ke[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(ke[2].x,ke[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},Y.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,pe=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));for(var Ve in this.tiles){var ke=this.tiles[Ve];ke.state!=="loaded"&&(ke.state="loaded",ke.texture=this.texture)}}},Y.prototype.loadTile=function(te,pe){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},pe(null)):(te.state="errored",pe(null))},Y.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return!1},Y})(e.Evented);function he(de){for(var Y=1/0,me=1/0,te=-1/0,pe=-1/0,Ve=0,ke=de;Vepe.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+pe.start(0)+" and "+pe.end(0)+"-second mark."))):this.video.currentTime=te}},Y.prototype.getVideo=function(){return this.video},Y.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},Y.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,pe=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),pe.texSubImage2D(pe.TEXTURE_2D,0,0,0,pe.RGBA,pe.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));for(var Ve in this.tiles){var ke=this.tiles[Ve];ke.state!=="loaded"&&(ke.state="loaded",ke.texture=this.texture)}}},Y.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return this.video&&!this.video.paused},Y})(se),$=(function(de){function Y(me,te,pe,Ve){de.call(this,me,te,pe,Ve),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(ke){return!Array.isArray(ke)||ke.length!==2||ke.some(function(Ye){return typeof Ye!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+me,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+me,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+me,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+me,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+me,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},Y.prototype.getCanvas=function(){return this.canvas},Y.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},Y.prototype.onRemove=function(){this.pause()},Y.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var pe=this.map.painter.context,Ve=pe.gl;this.boundsBuffer||(this.boundsBuffer=pe.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(pe,this.canvas,Ve.RGBA,{premultiply:!0});for(var ke in this.tiles){var Ye=this.tiles[ke];Ye.state!=="loaded"&&(Ye.state="loaded",Ye.texture=this.texture)}}},Y.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return this._playing},Y.prototype._hasInvalidDimensions=function(){for(var te=0,pe=[this.canvas.width,this.canvas.height];tethis.max){var Ye=this._getAndRemoveByKey(this.order[0]);Ye&&this.onRemove(Ye)}return this},De.prototype.has=function(Y){return Y.wrapped().key in this.data},De.prototype.getAndRemove=function(Y){return this.has(Y)?this._getAndRemoveByKey(Y.wrapped().key):null},De.prototype._getAndRemoveByKey=function(Y){var me=this.data[Y].shift();return me.timeout&&clearTimeout(me.timeout),this.data[Y].length===0&&delete this.data[Y],this.order.splice(this.order.indexOf(Y),1),me.value},De.prototype.getByKey=function(Y){var me=this.data[Y];return me?me[0].value:null},De.prototype.get=function(Y){if(!this.has(Y))return null;var me=this.data[Y.wrapped().key][0];return me.value},De.prototype.remove=function(Y,me){if(!this.has(Y))return this;var te=Y.wrapped().key,pe=me===void 0?0:this.data[te].indexOf(me),Ve=this.data[te][pe];return this.data[te].splice(pe,1),Ve.timeout&&clearTimeout(Ve.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ve.value),this.order.splice(this.order.indexOf(te),1),this},De.prototype.setMaxSize=function(Y){for(this.max=Y;this.order.length>this.max;){var me=this._getAndRemoveByKey(this.order[0]);me&&this.onRemove(me)}return this},De.prototype.filter=function(Y){var me=[];for(var te in this.data)for(var pe=0,Ve=this.data[te];pe1||(Math.abs(Dr)>1&&(Math.abs(Dr+pt)===1?Dr+=pt:Math.abs(Dr-pt)===1&&(Dr-=pt)),!(!dr.dem||!Ot.dem)&&(Ot.dem.backfillBorder(dr.dem,Dr,ur),Ot.neighboringTiles&&Ot.neighboringTiles[At]&&(Ot.neighboringTiles[At].backfilled=!0)))}},Y.prototype.getTile=function(te){return this.getTileByID(te.key)},Y.prototype.getTileByID=function(te){return this._tiles[te]},Y.prototype._retainLoadedChildren=function(te,pe,Ve,ke){for(var Ye in this._tiles){var vt=this._tiles[Ye];if(!(ke[Ye]||!vt.hasData()||vt.tileID.overscaledZ<=pe||vt.tileID.overscaledZ>Ve)){for(var Ot=vt.tileID;vt&&vt.tileID.overscaledZ>pe+1;){var dr=vt.tileID.scaledTo(vt.tileID.overscaledZ-1);vt=this._tiles[dr.key],vt&&vt.hasData()&&(Ot=dr)}for(var Dr=Ot;Dr.overscaledZ>pe;)if(Dr=Dr.scaledTo(Dr.overscaledZ-1),te[Dr.key]){ke[Ot.key]=Ot;break}}}},Y.prototype.findLoadedParent=function(te,pe){if(te.key in this._loadedParentTiles){var Ve=this._loadedParentTiles[te.key];return Ve&&Ve.tileID.overscaledZ>=pe?Ve:null}for(var ke=te.overscaledZ-1;ke>=pe;ke--){var Ye=te.scaledTo(ke),vt=this._getLoadedTile(Ye);if(vt)return vt}},Y.prototype._getLoadedTile=function(te){var pe=this._tiles[te.key];if(pe&&pe.hasData())return pe;var Ve=this._cache.getByKey(te.wrapped().key);return Ve},Y.prototype.updateCacheSize=function(te){var pe=Math.ceil(te.width/this._source.tileSize)+1,Ve=Math.ceil(te.height/this._source.tileSize)+1,ke=pe*Ve,Ye=5,vt=Math.floor(ke*Ye),Ot=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,vt):vt;this._cache.setMaxSize(Ot)},Y.prototype.handleWrapJump=function(te){var pe=this._prevLng===void 0?te:this._prevLng,Ve=te-pe,ke=Ve/360,Ye=Math.round(ke);if(this._prevLng=te,Ye){var vt={};for(var Ot in this._tiles){var dr=this._tiles[Ot];dr.tileID=dr.tileID.unwrapTo(dr.tileID.wrap+Ye),vt[dr.tileID.key]=dr}this._tiles=vt;for(var Dr in this._timers)clearTimeout(this._timers[Dr]),delete this._timers[Dr];for(var ur in this._tiles){var pt=this._tiles[ur];this._setTileReloadTimer(ur,pt)}}},Y.prototype.update=function(te){var pe=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ve;this.used?this._source.tileID?Ve=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(fa){return new e.OverscaledTileID(fa.canonical.z,fa.wrap,fa.canonical.z,fa.canonical.x,fa.canonical.y)}):(Ve=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ve=Ve.filter(function(fa){return pe._source.hasTile(fa)}))):Ve=[];var ke=te.coveringZoomLevel(this._source),Ye=Math.max(ke-Y.maxOverzooming,this._source.minzoom),vt=Math.max(ke+Y.maxUnderzooming,this._source.minzoom),Ot=this._updateRetainedTiles(Ve,ke);if(Pa(this._source.type)){for(var dr={},Dr={},ur=Object.keys(Ot),pt=0,At=ur;ptthis._source.maxzoom){var ar=er.children(this._source.maxzoom)[0],cr=this.getTile(ar);if(cr&&cr.hasData()){Ve[ar.key]=ar;continue}}else{var nr=er.children(this._source.maxzoom);if(Ve[nr[0].key]&&Ve[nr[1].key]&&Ve[nr[2].key]&&Ve[nr[3].key])continue}for(var Vt=lr.wasRequested(),rr=er.overscaledZ-1;rr>=Ye;--rr){var Nt=er.scaledTo(rr);if(ke[Nt.key]||(ke[Nt.key]=!0,lr=this.getTile(Nt),!lr&&Vt&&(lr=this._addTile(Nt)),lr&&(Ve[Nt.key]=Nt,Vt=lr.wasRequested(),lr.hasData())))break}}}return Ve},Y.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var pe=[],Ve=void 0,ke=this._tiles[te].tileID;ke.overscaledZ>0;){if(ke.key in this._loadedParentTiles){Ve=this._loadedParentTiles[ke.key];break}pe.push(ke.key);var Ye=ke.scaledTo(ke.overscaledZ-1);if(Ve=this._getLoadedTile(Ye),Ve)break;ke=Ye}for(var vt=0,Ot=pe;vt0)&&(pe.hasData()&&pe.state!=="reloading"?this._cache.add(pe.tileID,pe,pe.getExpiryTimeout()):(pe.aborted=!0,this._abortTile(pe),this._unloadTile(pe))))},Y.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},Y.prototype.tilesIn=function(te,pe,Ve){var ke=this,Ye=[],vt=this.transform;if(!vt)return Ye;for(var Ot=Ve?vt.getCameraQueryGeometry(te):te,dr=te.map(function(rr){return vt.pointCoordinate(rr)}),Dr=Ot.map(function(rr){return vt.pointCoordinate(rr)}),ur=this.getIds(),pt=1/0,At=1/0,Dt=-1/0,er=-1/0,lr=0,ar=Dr;lr=0&&ln[1].y+fa>=0){var Oa=dr.map(function(Bn){return Pr.getTilePoint(Bn)}),Ya=Dr.map(function(Bn){return Pr.getTilePoint(Bn)});Ye.push({tile:Nt,tileID:Pr,queryGeometry:Oa,cameraQueryGeometry:Ya,scale:Hr})}}},Vt=0;Vt=e.browser.now())return!0}return!1},Y.prototype.setFeatureState=function(te,pe,Ve){te=te||"_geojsonTileLayer",this._state.updateState(te,pe,Ve)},Y.prototype.removeFeatureState=function(te,pe,Ve){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,pe,Ve)},Y.prototype.getFeatureState=function(te,pe){return te=te||"_geojsonTileLayer",this._state.getState(te,pe)},Y.prototype.setDependencies=function(te,pe,Ve){var ke=this._tiles[te];ke&&ke.setDependencies(pe,Ve)},Y.prototype.reloadTilesForDependencies=function(te,pe){for(var Ve in this._tiles){var ke=this._tiles[Ve];ke.hasDependency(te,pe)&&this._reloadTile(Ve,"reloading")}this._cache.filter(function(Ye){return!Ye.hasDependency(te,pe)})},Y})(e.Evented);Jr.maxOverzooming=10,Jr.maxUnderzooming=3;function ia(de,Y){var me=Math.abs(de.wrap*2)-+(de.wrap<0),te=Math.abs(Y.wrap*2)-+(Y.wrap<0);return de.overscaledZ-Y.overscaledZ||te-me||Y.canonical.y-de.canonical.y||Y.canonical.x-de.canonical.x}function Pa(de){return de==="raster"||de==="image"||de==="video"}function Ga(){return new e.window.Worker(go.workerUrl)}var ja="mapboxgl_preloaded_worker_pool",Xa=function(){this.active={}};Xa.prototype.acquire=function(Y){if(!this.workers)for(this.workers=[];this.workers.length0?(pe-ke)/Ye:0;return this.points[Ve].mult(1-vt).add(this.points[me].mult(vt))};var $r=function(Y,me,te){var pe=this.boxCells=[],Ve=this.circleCells=[];this.xCellCount=Math.ceil(Y/te),this.yCellCount=Math.ceil(me/te);for(var ke=0;kethis.width||pe<0||me>this.height)return Ve?!1:[];var Ye=[];if(Y<=0&&me<=0&&this.width<=te&&this.height<=pe){if(Ve)return!0;for(var vt=0;vt0:Ye}},$r.prototype._queryCircle=function(Y,me,te,pe,Ve){var ke=Y-te,Ye=Y+te,vt=me-te,Ot=me+te;if(Ye<0||ke>this.width||Ot<0||vt>this.height)return pe?!1:[];var dr=[],Dr={hitTest:pe,circle:{x:Y,y:me,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(ke,vt,Ye,Ot,this._queryCellCircle,dr,Dr,Ve),pe?dr.length>0:dr},$r.prototype.query=function(Y,me,te,pe,Ve){return this._query(Y,me,te,pe,!1,Ve)},$r.prototype.hitTest=function(Y,me,te,pe,Ve){return this._query(Y,me,te,pe,!0,Ve)},$r.prototype.hitTestCircle=function(Y,me,te,pe){return this._queryCircle(Y,me,te,!0,pe)},$r.prototype._queryCell=function(Y,me,te,pe,Ve,ke,Ye,vt){var Ot=Ye.seenUids,dr=this.boxCells[Ve];if(dr!==null)for(var Dr=this.bboxes,ur=0,pt=dr;ur=Dr[Dt+0]&&pe>=Dr[Dt+1]&&(!vt||vt(this.boxKeys[At]))){if(Ye.hitTest)return ke.push(!0),!0;ke.push({key:this.boxKeys[At],x1:Dr[Dt],y1:Dr[Dt+1],x2:Dr[Dt+2],y2:Dr[Dt+3]})}}}var er=this.circleCells[Ve];if(er!==null)for(var lr=this.circles,ar=0,cr=er;arYe*Ye+vt*vt},$r.prototype._circleAndRectCollide=function(Y,me,te,pe,Ve,ke,Ye){var vt=(ke-pe)/2,Ot=Math.abs(Y-(pe+vt));if(Ot>vt+te)return!1;var dr=(Ye-Ve)/2,Dr=Math.abs(me-(Ve+dr));if(Dr>dr+te)return!1;if(Ot<=vt||Dr<=dr)return!0;var ur=Ot-vt,pt=Dr-dr;return ur*ur+pt*pt<=te*te};function ga(de,Y,me,te,pe){var Ve=e.create();return Y?(e.scale(Ve,Ve,[1/pe,1/pe,1]),me||e.rotateZ(Ve,Ve,te.angle)):e.multiply(Ve,te.labelPlaneMatrix,de),Ve}function jn(de,Y,me,te,pe){if(Y){var Ve=e.clone(de);return e.scale(Ve,Ve,[pe,pe,1]),me||e.rotateZ(Ve,Ve,-te.angle),Ve}else return te.glCoordMatrix}function an(de,Y){var me=[de.x,de.y,0,1];ao(me,me,Y);var te=me[3];return{point:new e.Point(me[0]/te,me[1]/te),signedDistanceFromCamera:te}}function ei(de,Y){return .5+.5*(de/Y)}function li(de,Y){var me=de[0]/de[3],te=de[1]/de[3],pe=me>=-Y[0]&&me<=Y[0]&&te>=-Y[1]&&te<=Y[1];return pe}function _i(de,Y,me,te,pe,Ve,ke,Ye){var vt=te?de.textSizeData:de.iconSizeData,Ot=e.evaluateSizeForZoom(vt,me.transform.zoom),dr=[256/me.width*2+1,256/me.height*2+1],Dr=te?de.text.dynamicLayoutVertexArray:de.icon.dynamicLayoutVertexArray;Dr.clear();for(var ur=de.lineVertexArray,pt=te?de.text.placedSymbolArray:de.icon.placedSymbolArray,At=me.transform.width/me.transform.height,Dt=!1,er=0;erVe)return{useVertical:!0}}return(de===e.WritingMode.vertical?Y.yme.x)?{needsFlipping:!0}:null}function Li(de,Y,me,te,pe,Ve,ke,Ye,vt,Ot,dr,Dr,ur,pt){var At=Y/24,Dt=de.lineOffsetX*At,er=de.lineOffsetY*At,lr;if(de.numGlyphs>1){var ar=de.glyphStartIndex+de.numGlyphs,cr=de.lineStartIndex,nr=de.lineStartIndex+de.lineLength,Vt=xi(At,Ye,Dt,er,me,dr,Dr,de,vt,Ve,ur);if(!Vt)return{notEnoughRoom:!0};var rr=an(Vt.first.point,ke).point,Nt=an(Vt.last.point,ke).point;if(te&&!me){var Pr=Pi(de.writingMode,rr,Nt,pt);if(Pr)return Pr}lr=[Vt.first];for(var Hr=de.glyphStartIndex+1;Hr0?Ya.point:ri(Dr,Oa,fa,1,pe),En=Pi(de.writingMode,fa,Bn,pt);if(En)return En}var en=vo(At*Ye.getoffsetX(de.glyphStartIndex),Dt,er,me,dr,Dr,de.segment,de.lineStartIndex,de.lineStartIndex+de.lineLength,vt,Ve,ur);if(!en)return{notEnoughRoom:!0};lr=[en]}for(var hn=0,mn=lr;hn0?1:-1,At=0;te&&(pt*=-1,At=Math.PI),pt<0&&(At+=Math.PI);for(var Dt=pt>0?Ye+ke:Ye+ke+1,er=pe,lr=pe,ar=0,cr=0,nr=Math.abs(ur),Vt=[];ar+cr<=nr;){if(Dt+=pt,Dt=vt)return null;if(lr=er,Vt.push(er),er=Dr[Dt],er===void 0){var rr=new e.Point(Ot.getx(Dt),Ot.gety(Dt)),Nt=an(rr,dr);if(Nt.signedDistanceFromCamera>0)er=Dr[Dt]=Nt.point;else{var Pr=Dt-pt,Hr=ar===0?Ve:new e.Point(Ot.getx(Pr),Ot.gety(Pr));er=ri(Hr,rr,lr,nr-ar+1,dr)}}ar+=cr,cr=lr.dist(er)}var fa=(nr-ar)/cr,ln=er.sub(lr),Oa=ln.mult(fa)._add(lr);Oa._add(ln._unit()._perp()._mult(me*pt));var Ya=At+Math.atan2(er.y-lr.y,er.x-lr.x);return Vt.push(Oa),{point:Oa,angle:Ya,path:Vt}}var Eo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function uo(de,Y){for(var me=0;me=1;Pn--)mn.push(en.path[Pn]);for(var ti=1;ti0){for(var bo=mn[0].clone(),ns=mn[0].clone(),As=1;As=Ya.x&&ns.x<=Bn.x&&bo.y>=Ya.y&&ns.y<=Bn.y?ls=[mn]:ns.xBn.x||ns.yBn.y?ls=[]:ls=e.clipLine([mn],Ya.x,Ya.y,Bn.x,Bn.y)}for(var Ol=0,lh=ls;Ol=this.screenRightBoundary||pethis.screenBottomBoundary},Bo.prototype.isInsideGrid=function(Y,me,te,pe){return te>=0&&Y=0&&me0){var nr;return this.prevPlacement&&this.prevPlacement.variableOffsets[ur.crossTileID]&&this.prevPlacement.placements[ur.crossTileID]&&this.prevPlacement.placements[ur.crossTileID].text&&(nr=this.prevPlacement.variableOffsets[ur.crossTileID].anchor),this.variableOffsets[ur.crossTileID]={textOffset:er,width:te,height:pe,anchor:Y,textBoxScale:Ve,prevAnchor:nr},this.markUsedJustification(pt,Y,ur,At),pt.allowVerticalPlacement&&(this.markUsedOrientation(pt,At,ur),this.placedOrientations[ur.crossTileID]=At),{shift:lr,placedGlyphBoxes:ar}}},ko.prototype.placeLayerBucketPart=function(Y,me,te){var pe=this,Ve=Y.parameters,ke=Ve.bucket,Ye=Ve.layout,vt=Ve.posMatrix,Ot=Ve.textLabelPlaneMatrix,dr=Ve.labelToScreenMatrix,Dr=Ve.textPixelRatio,ur=Ve.holdingForFade,pt=Ve.collisionBoxArray,At=Ve.partiallyEvaluatedTextSize,Dt=Ve.collisionGroup,er=Ye.get("text-optional"),lr=Ye.get("icon-optional"),ar=Ye.get("text-allow-overlap"),cr=Ye.get("icon-allow-overlap"),nr=Ye.get("text-rotation-alignment")==="map",Vt=Ye.get("text-pitch-alignment")==="map",rr=Ye.get("icon-text-fit")!=="none",Nt=Ye.get("symbol-z-order")==="viewport-y",Pr=ar&&(cr||!ke.hasIconData()||lr),Hr=cr&&(ar||!ke.hasTextData()||er);!ke.collisionArrays&&pt&&ke.deserializeCollisionBoxes(pt);var fa=function(en,hn){if(!me[en.crossTileID]){if(ur){pe.placements[en.crossTileID]=new eo(!1,!1,!1);return}var mn=!1,Pn=!1,ti=!0,io=null,Ao={box:null,offscreen:null},ls={box:null,offscreen:null},bo=null,ns=null,As=null,Ol=0,lh=0,uh=0;hn.textFeatureIndex?Ol=hn.textFeatureIndex:en.useRuntimeCollisionCircles&&(Ol=en.featureIndex),hn.verticalTextFeatureIndex&&(lh=hn.verticalTextFeatureIndex);var Ef=hn.textBox;if(Ef){var mh=function(Cu){var Rl=e.WritingMode.horizontal;if(ke.allowVerticalPlacement&&!Cu&&pe.prevPlacement){var Lf=pe.prevPlacement.placedOrientations[en.crossTileID];Lf&&(pe.placedOrientations[en.crossTileID]=Lf,Rl=Lf,pe.markUsedOrientation(ke,Rl,en))}return Rl},$h=function(Cu,Rl){if(ke.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&hn.verticalTextBox)for(var Lf=0,Fv=ke.writingModes;Lf0&&(jf=jf.filter(function(Cu){return Cu!==Cf.anchor}),jf.unshift(Cf.anchor))}var ch=function(Cu,Rl,Lf){for(var Fv=Cu.x2-Cu.x1,nd=Cu.y2-Cu.y1,Xl=en.textBoxScale,Zd=rr&&!cr?Rl:null,yv={box:[],offscreen:!1},Hp=ar?jf.length*2:jf.length,hh=0;hh=jf.length,Yd=pe.attemptAnchorPlacement(_v,Cu,Fv,nd,Xl,nr,Vt,Dr,vt,Dt,Wp,en,ke,Lf,Zd);if(Yd&&(yv=Yd.placedGlyphBoxes,yv&&yv.box&&yv.box.length)){mn=!0,io=Yd.shift;break}}return yv},gh=function(){return ch(Ef,hn.iconBox,e.WritingMode.horizontal)},fh=function(){var Cu=hn.verticalTextBox,Rl=Ao&&Ao.box&&Ao.box.length;return ke.allowVerticalPlacement&&!Rl&&en.numVerticalGlyphVertices>0&&Cu?ch(Cu,hn.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};$h(gh,fh),Ao&&(mn=Ao.box,ti=Ao.offscreen);var Rv=mh(Ao&&Ao.box);if(!mn&&pe.prevPlacement){var Qh=pe.prevPlacement.variableOffsets[en.crossTileID];Qh&&(pe.variableOffsets[en.crossTileID]=Qh,pe.markUsedJustification(ke,Qh.anchor,en,Rv))}}else{var Sh=function(Cu,Rl){var Lf=pe.collisionIndex.placeCollisionBox(Cu,ar,Dr,vt,Dt.predicate);return Lf&&Lf.box&&Lf.box.length&&(pe.markUsedOrientation(ke,Rl,en),pe.placedOrientations[en.crossTileID]=Rl),Lf},kf=function(){return Sh(Ef,e.WritingMode.horizontal)},Mh=function(){var Cu=hn.verticalTextBox;return ke.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&Cu?Sh(Cu,e.WritingMode.vertical):{box:null,offscreen:null}};$h(kf,Mh),mh(Ao&&Ao.box&&Ao.box.length)}}if(bo=Ao,mn=bo&&bo.box&&bo.box.length>0,ti=bo&&bo.offscreen,en.useRuntimeCollisionCircles){var qc=ke.text.placedSymbolArray.get(en.centerJustifiedTextSymbolIndex),ev=e.evaluateSizeForFeature(ke.textSizeData,At,qc),Dv=Ye.get("text-padding"),uf=en.collisionCircleDiameter;ns=pe.collisionIndex.placeCollisionCircles(ar,qc,ke.lineVertexArray,ke.glyphOffsetArray,ev,vt,Ot,dr,te,Vt,Dt.predicate,uf,Dv),mn=ar||ns.circles.length>0&&!ns.collisionDetected,ti=ti&&ns.offscreen}if(hn.iconFeatureIndex&&(uh=hn.iconFeatureIndex),hn.iconBox){var pv=function(Cu){var Rl=rr&&io?_s(Cu,io.x,io.y,nr,Vt,pe.transform.angle):Cu;return pe.collisionIndex.placeCollisionBox(Rl,cr,Dr,vt,Dt.predicate)};ls&&ls.box&&ls.box.length&&hn.verticalIconBox?(As=pv(hn.verticalIconBox),Pn=As.box.length>0):(As=pv(hn.iconBox),Pn=As.box.length>0),ti=ti&&As.offscreen}var rd=er||en.numHorizontalGlyphVertices===0&&en.numVerticalGlyphVertices===0,ad=lr||en.numIconVertices===0;if(!rd&&!ad?Pn=mn=Pn&&mn:ad?rd||(Pn=Pn&&mn):mn=Pn&&mn,mn&&bo&&bo.box&&(ls&&ls.box&&lh?pe.collisionIndex.insertCollisionBox(bo.box,Ye.get("text-ignore-placement"),ke.bucketInstanceId,lh,Dt.ID):pe.collisionIndex.insertCollisionBox(bo.box,Ye.get("text-ignore-placement"),ke.bucketInstanceId,Ol,Dt.ID)),Pn&&As&&pe.collisionIndex.insertCollisionBox(As.box,Ye.get("icon-ignore-placement"),ke.bucketInstanceId,uh,Dt.ID),ns&&(mn&&pe.collisionIndex.insertCollisionCircles(ns.circles,Ye.get("text-ignore-placement"),ke.bucketInstanceId,Ol,Dt.ID),te)){var zv=ke.bucketInstanceId,mv=pe.collisionCircleArrays[zv];mv===void 0&&(mv=pe.collisionCircleArrays[zv]=new Ei);for(var gv=0;gv=0;--Oa){var Ya=ln[Oa];fa(ke.symbolInstances.get(Ya),ke.collisionArrays[Ya])}else for(var Bn=Y.symbolInstanceStart;Bn=0&&(ke>=0&&dr!==ke?Y.text.placedSymbolArray.get(dr).crossTileID=0:Y.text.placedSymbolArray.get(dr).crossTileID=te.crossTileID)}},ko.prototype.markUsedOrientation=function(Y,me,te){for(var pe=me===e.WritingMode.horizontal||me===e.WritingMode.horizontalOnly?me:0,Ve=me===e.WritingMode.vertical?me:0,ke=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],Ye=0,vt=ke;Ye0||Vt>0,fa=cr.numIconVertices>0,ln=pe.placedOrientations[cr.crossTileID],Oa=ln===e.WritingMode.vertical,Ya=ln===e.WritingMode.horizontal||ln===e.WritingMode.horizontalOnly;if(Hr){var Bn=el(Pr.text),En=Oa?ci:Bn;At(Y.text,nr,En);var en=Ya?ci:Bn;At(Y.text,Vt,en);var hn=Pr.text.isHidden();[cr.rightJustifiedTextSymbolIndex,cr.centerJustifiedTextSymbolIndex,cr.leftJustifiedTextSymbolIndex].forEach(function(uh){uh>=0&&(Y.text.placedSymbolArray.get(uh).hidden=hn||Oa?1:0)}),cr.verticalPlacedTextSymbolIndex>=0&&(Y.text.placedSymbolArray.get(cr.verticalPlacedTextSymbolIndex).hidden=hn||Ya?1:0);var mn=pe.variableOffsets[cr.crossTileID];mn&&pe.markUsedJustification(Y,mn.anchor,cr,ln);var Pn=pe.placedOrientations[cr.crossTileID];Pn&&(pe.markUsedJustification(Y,"left",cr,Pn),pe.markUsedOrientation(Y,Pn,cr))}if(fa){var ti=el(Pr.icon),io=!(ur&&cr.verticalPlacedIconSymbolIndex&&Oa);if(cr.placedIconSymbolIndex>=0){var Ao=io?ti:ci;At(Y.icon,cr.numIconVertices,Ao),Y.icon.placedSymbolArray.get(cr.placedIconSymbolIndex).hidden=Pr.icon.isHidden()}if(cr.verticalPlacedIconSymbolIndex>=0){var ls=io?ci:ti;At(Y.icon,cr.numVerticalIconVertices,ls),Y.icon.placedSymbolArray.get(cr.verticalPlacedIconSymbolIndex).hidden=Pr.icon.isHidden()}}if(Y.hasIconCollisionBoxData()||Y.hasTextCollisionBoxData()){var bo=Y.collisionArrays[ar];if(bo){var ns=new e.Point(0,0);if(bo.textBox||bo.verticalTextBox){var As=!0;if(Ot){var Ol=pe.variableOffsets[rr];Ol?(ns=ms(Ol.anchor,Ol.width,Ol.height,Ol.textOffset,Ol.textBoxScale),dr&&ns._rotate(Dr?pe.transform.angle:-pe.transform.angle)):As=!1}bo.textBox&&Nn(Y.textCollisionBox.collisionVertexArray,Pr.text.placed,!As||Oa,ns.x,ns.y),bo.verticalTextBox&&Nn(Y.textCollisionBox.collisionVertexArray,Pr.text.placed,!As||Ya,ns.x,ns.y)}var lh=!!(!Ya&&bo.verticalIconBox);bo.iconBox&&Nn(Y.iconCollisionBox.collisionVertexArray,Pr.icon.placed,lh,ur?ns.x:0,ur?ns.y:0),bo.verticalIconBox&&Nn(Y.iconCollisionBox.collisionVertexArray,Pr.icon.placed,!lh,ur?ns.x:0,ur?ns.y:0)}}},er=0;erY},ko.prototype.setStale=function(){this.stale=!0};function Nn(de,Y,me,te,pe){de.emplaceBack(Y?1:0,me?1:0,te||0,pe||0),de.emplaceBack(Y?1:0,me?1:0,te||0,pe||0),de.emplaceBack(Y?1:0,me?1:0,te||0,pe||0),de.emplaceBack(Y?1:0,me?1:0,te||0,pe||0)}var pi=Math.pow(2,25),gs=Math.pow(2,24),Io=Math.pow(2,17),Zi=Math.pow(2,16),ys=Math.pow(2,9),rs=Math.pow(2,8),fs=Math.pow(2,1);function el(de){if(de.opacity===0&&!de.placed)return 0;if(de.opacity===1&&de.placed)return 4294967295;var Y=de.placed?1:0,me=Math.floor(de.opacity*127);return me*pi+Y*gs+me*Io+Y*Zi+me*ys+Y*rs+me*fs+Y}var ci=0,oo=function(Y){this._sortAcrossTiles=Y.layout.get("symbol-z-order")!=="viewport-y"&&Y.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};oo.prototype.continuePlacement=function(Y,me,te,pe,Ve){for(var ke=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var Ye=Y[this._currentPlacementIndex],vt=me[Ye],Ot=this.placement.collisionIndex.transform.zoom;if(vt.type==="symbol"&&(!vt.minzoom||vt.minzoom<=Ot)&&(!vt.maxzoom||vt.maxzoom>Ot)){this._inProgressLayer||(this._inProgressLayer=new oo(vt));var dr=this._inProgressLayer.continuePlacement(te[vt.source],this.placement,this._showCollisionBoxes,vt,ke);if(dr)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},so.prototype.commit=function(Y){return this.placement.commit(Y),this.placement};var js=512/e.EXTENT/2,Es=function(Y,me,te){this.tileID=Y,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var pe=0;peY.overscaledZ)for(var Ot in vt){var dr=vt[Ot];dr.tileID.isChildOf(Y)&&dr.findMatches(me.symbolInstances,Y,ke)}else{var Dr=Y.scaledTo(Number(Ye)),ur=vt[Dr.key];ur&&ur.findMatches(me.symbolInstances,Y,ke)}}for(var pt=0;pt0)throw new Error("Unimplemented: "+ke.map(function(Ye){return Ye.command}).join(", ")+".");return Ve.forEach(function(Ye){Ye.command!=="setTransition"&&pe[Ye.command].apply(pe,Ye.args)}),this.stylesheet=te,!0},Y.prototype.addImage=function(te,pe){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,pe),this._afterImageUpdated(te)},Y.prototype.updateImage=function(te,pe){this.imageManager.updateImage(te,pe)},Y.prototype.getImage=function(te){return this.imageManager.getImage(te)},Y.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},Y.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},Y.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},Y.prototype.addSource=function(te,pe,Ve){var ke=this;if(Ve===void 0&&(Ve={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!pe.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(pe).join(", ")+".");var Ye=["vector","raster","geojson","video","image"],vt=Ye.indexOf(pe.type)>=0;if(!(vt&&this._validate(e.validateStyle.source,"sources."+te,pe,null,Ve))){this.map&&this.map._collectResourceTiming&&(pe.collectResourceTiming=!0);var Ot=this.sourceCaches[te]=new Jr(te,pe,this.dispatcher);Ot.style=this,Ot.setEventedParent(this,function(){return{isSourceLoaded:ke.loaded(),source:Ot.serialize(),sourceId:te}}),Ot.onAdd(this.map),this._changed=!0}},Y.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var pe in this._layers)if(this._layers[pe].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+pe+'" is using it.')));var Ve=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ve.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ve.setEventedParent(null),Ve.clearTiles(),Ve.onRemove&&Ve.onRemove(this.map),this._changed=!0},Y.prototype.setGeoJSONSourceData=function(te,pe){this._checkLoaded();var Ve=this.sourceCaches[te].getSource();Ve.setData(pe),this._changed=!0},Y.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},Y.prototype.addLayer=function(te,pe,Ve){Ve===void 0&&(Ve={}),this._checkLoaded();var ke=te.id;if(this.getLayer(ke)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+ke+'" already exists on this map')));return}var Ye;if(te.type==="custom"){if(jo(this,e.validateCustomStyleLayer(te)))return;Ye=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(ke,te.source),te=e.clone$1(te),te=e.extend(te,{source:ke})),this._validate(e.validateStyle.layer,"layers."+ke,te,{arrayIndex:-1},Ve))return;Ye=e.createStyleLayer(te),this._validateLayer(Ye),Ye.setEventedParent(this,{layer:{id:ke}}),this._serializedLayers[Ye.id]=Ye.serialize()}var vt=pe?this._order.indexOf(pe):this._order.length;if(pe&&vt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+pe+'" does not exist on this map.')));return}if(this._order.splice(vt,0,ke),this._layerOrderChanged=!0,this._layers[ke]=Ye,this._removedLayers[ke]&&Ye.source&&Ye.type!=="custom"){var Ot=this._removedLayers[ke];delete this._removedLayers[ke],Ot.type!==Ye.type?this._updatedSources[Ye.source]="clear":(this._updatedSources[Ye.source]="reload",this.sourceCaches[Ye.source].pause())}this._updateLayer(Ye),Ye.onAdd&&Ye.onAdd(this.map)},Y.prototype.moveLayer=function(te,pe){this._checkLoaded(),this._changed=!0;var Ve=this._layers[te];if(!Ve){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==pe){var ke=this._order.indexOf(te);this._order.splice(ke,1);var Ye=pe?this._order.indexOf(pe):this._order.length;if(pe&&Ye===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+pe+'" does not exist on this map.')));return}this._order.splice(Ye,0,te),this._layerOrderChanged=!0}},Y.prototype.removeLayer=function(te){this._checkLoaded();var pe=this._layers[te];if(!pe){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}pe.setEventedParent(null);var Ve=this._order.indexOf(te);this._order.splice(Ve,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=pe,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],pe.onRemove&&pe.onRemove(this.map)},Y.prototype.getLayer=function(te){return this._layers[te]},Y.prototype.hasLayer=function(te){return te in this._layers},Y.prototype.setLayerZoomRange=function(te,pe,Ve){this._checkLoaded();var ke=this.getLayer(te);if(!ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}ke.minzoom===pe&&ke.maxzoom===Ve||(pe!=null&&(ke.minzoom=pe),Ve!=null&&(ke.maxzoom=Ve),this._updateLayer(ke))},Y.prototype.setFilter=function(te,pe,Ve){Ve===void 0&&(Ve={}),this._checkLoaded();var ke=this.getLayer(te);if(!ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(ke.filter,pe)){if(pe==null){ke.filter=void 0,this._updateLayer(ke);return}this._validate(e.validateStyle.filter,"layers."+ke.id+".filter",pe,null,Ve)||(ke.filter=e.clone$1(pe),this._updateLayer(ke))}},Y.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},Y.prototype.setLayoutProperty=function(te,pe,Ve,ke){ke===void 0&&(ke={}),this._checkLoaded();var Ye=this.getLayer(te);if(!Ye){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(Ye.getLayoutProperty(pe),Ve)||(Ye.setLayoutProperty(pe,Ve,ke),this._updateLayer(Ye))},Y.prototype.getLayoutProperty=function(te,pe){var Ve=this.getLayer(te);if(!Ve){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ve.getLayoutProperty(pe)},Y.prototype.setPaintProperty=function(te,pe,Ve,ke){ke===void 0&&(ke={}),this._checkLoaded();var Ye=this.getLayer(te);if(!Ye){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(Ye.getPaintProperty(pe),Ve)){var vt=Ye.setPaintProperty(pe,Ve,ke);vt&&this._updateLayer(Ye),this._changed=!0,this._updatedPaintProps[te]=!0}},Y.prototype.getPaintProperty=function(te,pe){return this.getLayer(te).getPaintProperty(pe)},Y.prototype.setFeatureState=function(te,pe){this._checkLoaded();var Ve=te.source,ke=te.sourceLayer,Ye=this.sourceCaches[Ve];if(Ye===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ve+"' does not exist in the map's style.")));return}var vt=Ye.getSource().type;if(vt==="geojson"&&ke){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(vt==="vector"&&!ke){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Ye.setFeatureState(ke,te.id,pe)},Y.prototype.removeFeatureState=function(te,pe){this._checkLoaded();var Ve=te.source,ke=this.sourceCaches[Ve];if(ke===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ve+"' does not exist in the map's style.")));return}var Ye=ke.getSource().type,vt=Ye==="vector"?te.sourceLayer:void 0;if(Ye==="vector"&&!vt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(pe&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}ke.removeFeatureState(vt,te.id,pe)},Y.prototype.getFeatureState=function(te){this._checkLoaded();var pe=te.source,Ve=te.sourceLayer,ke=this.sourceCaches[pe];if(ke===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+pe+"' does not exist in the map's style.")));return}var Ye=ke.getSource().type;if(Ye==="vector"&&!Ve){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),ke.getFeatureState(Ve,te.id)},Y.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},Y.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},Y.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},Y.prototype._flattenAndSortRenderedFeatures=function(te){for(var pe=this,Ve=function(Ya){return pe._layers[Ya].type==="fill-extrusion"},ke={},Ye=[],vt=this._order.length-1;vt>=0;vt--){var Ot=this._order[vt];if(Ve(Ot)){ke[Ot]=vt;for(var dr=0,Dr=te;dr=0;ar--){var cr=this._order[ar];if(Ve(cr))for(var nr=Ye.length-1;nr>=0;nr--){var Vt=Ye[nr].feature;if(ke[Vt.layer.id] .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),Gg=Ge({"src/plots/mapbox/layout_attributes.js"(Z,q){"use strict";var d=ta(),x=Bi().defaultLine,S=ju().attributes,E=bu(),e=gc().textposition,t=Ru().overrideAll,r=ll().templatedArray,o=ld(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=q.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:S({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),Q_=Ge({"src/traces/scattermapbox/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:S}=Tl(),E=hv(),e=Wp(),t=gc(),r=Gg(),o=Cl(),a=Jl(),i=Do().extendFlat,n=Ru().overrideAll,s=Gg(),h=e.line,f=e.marker;q.exports=n({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},f.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},a("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:S()},"calc","nested")}}),ET=Ge({"src/traces/scattermapbox/constants.js"(Z,q){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];q.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),aI=Ge({"src/traces/scattermapbox/defaults.js"(Z,q){"use strict";var d=ta(),x=iu(),S=Nh(),E=Xh(),e=Zh(),t=dv(),r=Q_(),o=ET().isSupportedFont;q.exports=function(n,s,h,f){function p(y,m){return d.coerce(n,s,r,y,m)}function c(y,m){return d.coerce2(n,s,r,y,m)}var T=a(n,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),x.hasMarkers(s)){S(n,s,h,f,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,h,f,p,{noDash:!0}),p("connectgaps"));var _=c("cluster.maxzoom"),w=c("cluster.step"),A=c("cluster.color",s.marker&&s.marker.color||h),M=c("cluster.size"),g=c("cluster.opacity"),b=_!==!1||w!==!1||A!==!1||M!==!1||g!==!1,v=p("cluster.enabled",b);if(v||x.hasText(s)){var u=f.font.family;e(n,s,f,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}p("fill"),s.fill!=="none"&&t(n,s,h,p),d.coerceSelectionMarkerOpacity(s,p)};function a(i,n,s){var h=s("lon")||[],f=s("lat")||[],p=Math.min(h.length,f.length);return n._length=p,p}}}),kT=Ge({"src/traces/scattermapbox/format_labels.js"(Z,q){"use strict";var d=Mo();q.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=S.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),CT=Ge({"src/plots/mapbox/convert_text_opts.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var h;return n[0]&&n[1]?h=n.join("-"):n[0]?h=n[0]:n[1]?h=n[1]:h="center",{anchor:h,offset:s}}}}),nI=Ge({"src/traces/scattermapbox/convert.js"(Z,q){"use strict";var d=Bo(),x=ta(),S=As().BADNUM,E=Zd(),e=wu(),t=zo(),r=z0(),o=iu(),a=ET().isSupportedFont,i=CT(),n=Sh().appendArrayPointValue,s=Il().NEWLINES,h=Il().BR_TAG_ALL;q.exports=function(g,b){var v=b[0].trace,u=v.visible===!0&&v._length!==0,y=v.fill!=="none",m=o.hasLines(v),R=o.hasMarkers(v),L=o.hasText(v),z=R&&v.marker.symbol==="circle",F=R&&v.marker.symbol!=="circle",N=v.cluster&&v.cluster.enabled,O=f("fill"),P=f("line"),U=f("circle"),B=f("symbol"),X={fill:O,line:P,circle:U,symbol:B};if(!u)return X;var $;if((y||m)&&($=E.calcTraceToLineCoords(b)),y&&(O.geojson=E.makePolygon($),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":v.fillcolor})),m&&(P.geojson=E.makeLine($),P.layout.visibility="visible",x.extendFlat(P.paint,{"line-width":v.line.width,"line-color":v.line.color,"line-opacity":v.opacity})),z){var le=p(b);U.geojson=le.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],X.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(v.cluster.color,v.cluster.step),"circle-radius":w(v.cluster.size,v.cluster.step),"circle-opacity":w(v.cluster.opacity,v.cluster.step)}},X.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(v),"text-size":12}}),x.extendFlat(U.paint,{"circle-color":le.mcc,"circle-radius":le.mrc,"circle-opacity":le.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(B.geojson=c(b,g),x.extendFlat(B.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(B.layout,{"icon-size":v.marker.size/10}),"angle"in v.marker&&v.marker.angle!=="auto"&&x.extendFlat(B.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),B.layout["icon-allow-overlap"]=v.marker.allowoverlap,x.extendFlat(B.paint,{"icon-opacity":v.opacity*v.marker.opacity,"icon-color":v.marker.color})),L)){var ce=(v.marker||{}).size,ve=i(v.textposition,ce);x.extendFlat(B.layout,{"text-size":v.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":A(v)}),x.extendFlat(B.paint,{"text-color":v.textfont.color,"text-opacity":v.opacity})}return X};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var g=M[0].trace,b=g.marker,v=g.selectedpoints,u=x.isArrayOrTypedArray(b.color),y=x.isArrayOrTypedArray(b.size),m=x.isArrayOrTypedArray(b.opacity),R;function L(ce){return g.opacity*ce}function z(ce){return ce/2}var F;u&&(e.hasColorscale(g,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var N;y&&(N=r(g));var O;m&&(O=function(ce){var ve=d(ce)?+x.constrain(ce,0,1):0;return L(ve)});var P=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",y[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=b);var L=R.split(", ");return L}}}),iI=Ge({"src/traces/scattermapbox/plot.js"(Z,q){"use strict";var d=ta(),x=nI(),S=ld().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,h=this.subplot.getMapLayers(),f=0;f=0;m--){var R=y[m];n.removeLayer(c.layerIds[R])}u||n.removeSource(c.sourceIds.circle)}function _(u){for(var y=E.nonCluster,m=0;m=0;m--){var R=y[m];n.removeLayer(c.layerIds[R]),u||n.removeSource(c.sourceIds[R])}}function A(u){p?l(u):w(u)}function M(u){f?T(u):_(u)}function g(){for(var u=f?E.cluster:E.nonCluster,y=0;y=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},q.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,h=new e(o,i.uid,n,s),f=x(o.gd,a),p=h.below=o.belowLookup["trace-"+i.uid],c,T,l;if(n)for(h.addSource("circle",f.circle,i.cluster),c=0;c=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,g=i-M;function b(N){var O=N.lonlat;if(O[0]===e||_&&T.indexOf(N.i+1)===-1)return 1/0;var P=x.modHalf(O[0],360),U=O[1],B=c.project([P,U]),X=B.x-f.c2p([g,U]),$=B.y-p.c2p([P,n]),le=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(X*X+$*$)-le,1-3/le)}if(d.getClosest(s,b,a),a.index!==!1){var v=s[a.index],u=v.lonlat,y=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(y),R=p.c2p(y),L=v.mrc||1;a.x0=m-L,a.x1=m+L,a.y0=R-L,a.y1=R+L;var z={};z[h.subplot]={_subplot:c};var F=h._module.formatLabels(v,h,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=S(h,v),a.extraText=o(h,v,s[0].t.labels),a.hovertemplate=h.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,h=s.split("+"),f=h.indexOf("all")!==-1,p=h.indexOf("lon")!==-1,c=h.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return f||p&&c?l.push("("+_(T[1])+", "+_(T[0])+")"):p?l.push(n.lon+_(T[0])):c&&l.push(n.lat+_(T[1])),(f||h.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:o}}}),oI=Ge({"src/traces/scattermapbox/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),sI=Ge({"src/traces/scattermapbox/select.js"(Z,q){"use strict";var d=ta(),x=iu(),S=As().BADNUM;q.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var H,oe,_e,Ce,Oe;for(_e=k,Oe=0;Oe<8;Oe++){if(Ce=this.sampleCurveX(_e)-k,Math.abs(Ce)oe)return oe;for(;HCe?H=_e:oe=_e,_e=(oe-H)*.5+H}return _e},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=n;function n(k,C){this.x=k,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,H=k.y-this.y;return C*C+H*H},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,H=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=H,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),H=Math.sin(k),oe=C*this.x-H*this.y,_e=H*this.x+C*this.y;return this.x=oe,this.y=_e,this},_rotateAround:function(k,C){var H=Math.cos(k),oe=Math.sin(k),_e=C.x+H*(this.x-C.x)-oe*(this.y-C.y),Ce=C.y+oe*(this.x-C.x)+H*(this.y-C.y);return this.x=_e,this.y=Ce,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(k){return k instanceof n?k:Array.isArray(k)?new n(k[0],k[1]):k};var s=typeof self<"u"?self:{};function h(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var H=0;H=1)return 1;var C=k*k,H=C*k;return 4*(k<.5?H:3*(k-C)+H-.75)}function c(k,C,H,oe){var _e=new o(k,C,H,oe);return function(Ce){return _e.solve(Ce)}}var T=c(.25,.1,.25,1);function l(k,C,H){return Math.min(H,Math.max(C,k))}function _(k,C,H){var oe=H-C,_e=((k-C)%oe+oe)%oe+C;return _e===C?H:_e}function w(k,C,H){if(!k.length)return H(null,[]);var oe=k.length,_e=new Array(k.length),Ce=null;k.forEach(function(Oe,lt){C(Oe,function(kt,jt){kt&&(Ce=kt),_e[lt]=jt,--oe===0&&H(Ce,_e)})})}function A(k){var C=[];for(var H in k)C.push(k[H]);return C}function M(k,C){var H=[];for(var oe in k)oe in C||H.push(oe);return H}function g(k){for(var C=[],H=arguments.length-1;H-- >0;)C[H]=arguments[H+1];for(var oe=0,_e=C;oe<_e.length;oe+=1){var Ce=_e[oe];for(var Oe in Ce)k[Oe]=Ce[Oe]}return k}function b(k,C){for(var H={},oe=0;oe>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function m(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(H){C[H]&&(C[H]=C[H].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,H){var oe={};for(var _e in k)oe[_e]=C.call(H||this,k[_e],_e,k);return oe}function N(k,C,H){var oe={};for(var _e in k)C.call(H||this,k[_e],_e,k)&&(oe[_e]=k[_e]);return oe}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function P(k,C){for(var H=0;H=0)return!0;return!1}var U={};function B(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function X(k,C,H){return(H.y-k.y)*(C.x-k.x)>(C.y-k.y)*(H.x-k.x)}function $(k){for(var C=0,H=0,oe=k.length,_e=oe-1,Ce=void 0,Oe=void 0;H@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,H={};if(k.replace(C,function(_e,Ce,Oe,lt){var kt=Oe||lt;return H[Ce]=kt?kt.toLowerCase():!0,""}),H["max-age"]){var oe=parseInt(H["max-age"],10);isNaN(oe)?delete H["max-age"]:H["max-age"]=oe}return H}var G=null;function Y(k){if(G==null){var C=k.navigator?k.navigator.userAgent:null;G=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return G}function ee(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function V(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,H){return String.fromCharCode(+("0x"+H))}))}function se(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ae=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,Q=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,re,he,xe={now:ae,frame:function(C){var H=j(C);return{cancel:function(){return Q(H)}}},getImageData:function(C,H){H===void 0&&(H=0);var oe=s.document.createElement("canvas"),_e=oe.getContext("2d");if(!_e)throw new Error("failed to create canvas 2d context");return oe.width=C.width,oe.height=C.height,_e.drawImage(C,0,0,C.width,C.height),_e.getImageData(-H,-H,C.width+2*H,C.height+2*H)},resolveURL:function(C){return re||(re=s.document.createElement("a")),re.href=C,re.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(he==null&&(he=s.matchMedia("(prefers-reduced-motion: reduce)")),he.matches):!1}},Te={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Le={supported:!1,testSupport:$e},Pe,qe=!1,et,rt=!1;s.document&&(et=s.document.createElement("img"),et.onload=function(){Pe&&Ue(Pe),Pe=null,rt=!0},et.onerror=function(){qe=!0,Pe=null},et.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function $e(k){qe||!et||(rt?Ue(k):Pe=k)}function Ue(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,et),k.isContextLost())return;Le.supported=!0}catch{}k.deleteTexture(C),qe=!0}var fe="01";function ue(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",H="",oe=0;oe<10;oe++)H+=C[Math.floor(Math.random()*62)];var _e=720*60*1e3,Ce=[k,fe,H].join(""),Oe=Date.now()+_e;return{token:Ce,tokenExpiresAt:Oe}}var ie=function(C,H){this._transformRequestFn=C,this._customAccessToken=H,this._createSkuToken()};ie.prototype._createSkuToken=function(){var C=ue();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ie.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ie.prototype.transformRequest=function(C,H){return this._transformRequestFn?this._transformRequestFn(C,H)||{url:C}:{url:C}},ie.prototype.normalizeStyleURL=function(C,H){if(!Ee(C))return C;var oe=zt(C);return oe.path="/styles/v1"+oe.path,this._makeAPIURL(oe,this._customAccessToken||H)},ie.prototype.normalizeGlyphsURL=function(C,H){if(!Ee(C))return C;var oe=zt(C);return oe.path="/fonts/v1"+oe.path,this._makeAPIURL(oe,this._customAccessToken||H)},ie.prototype.normalizeSourceURL=function(C,H){if(!Ee(C))return C;var oe=zt(C);return oe.path="/v4/"+oe.authority+".json",oe.params.push("secure"),this._makeAPIURL(oe,this._customAccessToken||H)},ie.prototype.normalizeSpriteURL=function(C,H,oe,_e){var Ce=zt(C);return Ee(C)?(Ce.path="/styles/v1"+Ce.path+"/sprite"+H+oe,this._makeAPIURL(Ce,this._customAccessToken||_e)):(Ce.path+=""+H+oe,Ut(Ce))},ie.prototype.normalizeTileURL=function(C,H){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Ee(C))return C;var oe=zt(C),_e=/(\.(png|jpg)\d*)(?=$)/,Ce=/^.+\/v4\//,Oe=xe.devicePixelRatio>=2||H===512?"@2x":"",lt=Le.supported?".webp":"$1";oe.path=oe.path.replace(_e,""+Oe+lt),oe.path=oe.path.replace(Ce,"/"),oe.path="/v4"+oe.path;var kt=this._customAccessToken||Tt(oe.params)||Te.ACCESS_TOKEN;return Te.REQUIRE_ACCESS_TOKEN&&kt&&this._skuToken&&oe.params.push("sku="+this._skuToken),this._makeAPIURL(oe,kt)},ie.prototype.canonicalizeTileURL=function(C,H){var oe="/v4/",_e=/\.[\w]+$/,Ce=zt(C);if(!Ce.path.match(/(^\/v4\/)/)||!Ce.path.match(_e))return C;var Oe="mapbox://tiles/";Oe+=Ce.path.replace(oe,"");var lt=Ce.params;return H&&(lt=lt.filter(function(kt){return!kt.match(/^access_token=/)})),lt.length&&(Oe+="?"+lt.join("&")),Oe},ie.prototype.canonicalizeTileset=function(C,H){for(var oe=H?Ee(H):!1,_e=[],Ce=0,Oe=C.tiles||[];Ce=0&&C.params.splice(Ce,1)}if(_e.path!=="/"&&(C.path=""+_e.path+C.path),!Te.REQUIRE_ACCESS_TOKEN)return Ut(C);if(H=H||Te.ACCESS_TOKEN,!H)throw new Error("An API access token is required to use Mapbox GL. "+oe);if(H[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+oe);return C.params=C.params.filter(function(Oe){return Oe.indexOf("access_token")===-1}),C.params.push("access_token="+H),Ut(C)};function Ee(k){return k.indexOf("mapbox:")===0}var We=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Qe(k){return We.test(k)}function Xe(k){return k.indexOf("sku=")>0&&Qe(k)}function Tt(k){for(var C=0,H=k;C=1&&s.localStorage.setItem(H,JSON.stringify(this.eventData))}catch{B("Unable to write to LocalStorage")}},Or.prototype.processRequests=function(C){},Or.prototype.postEvent=function(C,H,oe,_e){var Ce=this;if(Te.EVENTS_URL){var Oe=zt(Te.EVENTS_URL);Oe.params.push("access_token="+(_e||Te.ACCESS_TOKEN||""));var lt={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:fe,userId:this.anonId},kt=H?g(lt,H):lt,jt={url:Ut(Oe),headers:{"Content-Type":"text/plain"},body:JSON.stringify([kt])};this.pendingRequest=na(jt,function(Kt){Ce.pendingRequest=null,oe(Kt),Ce.saveEventData(),Ce.processRequests(_e)})}},Or.prototype.queueRequest=function(C,H){this.queue.push(C),this.processRequests(H)};var wr=(function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(oe,_e,Ce,Oe){this.skuToken=Ce,(Te.EVENTS_URL&&Oe||Te.ACCESS_TOKEN&&Array.isArray(oe)&&oe.some(function(lt){return Ee(lt)||Qe(lt)}))&&this.queueRequest({id:_e,timestamp:Date.now()},Oe)},C.prototype.processRequests=function(oe){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){var Ce=this.queue.shift(),Oe=Ce.id,lt=Ce.timestamp;Oe&&this.success[Oe]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=y()),this.postEvent(lt,{skuToken:this.skuToken},function(kt){kt||Oe&&(_e.success[Oe]=!0)},oe))}},C})(Or),Er=(function(k){function C(H){k.call(this,"appUserTurnstile"),this._customAccessToken=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(oe,_e){Te.EVENTS_URL&&Te.ACCESS_TOKEN&&Array.isArray(oe)&&oe.some(function(Ce){return Ee(Ce)||Qe(Ce)})&&this.queueRequest(Date.now(),_e)},C.prototype.processRequests=function(oe){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Ce=hr(Te.ACCESS_TOKEN),Oe=Ce?Ce.u:Te.ACCESS_TOKEN,lt=Oe!==this.eventData.tokenU;R(this.anonId)||(this.anonId=y(),lt=!0);var kt=this.queue.shift();if(this.eventData.lastSuccess){var jt=new Date(this.eventData.lastSuccess),Kt=new Date(kt),Sr=(kt-this.eventData.lastSuccess)/(1440*60*1e3);lt=lt||Sr>=1||Sr<-1||jt.getDate()!==Kt.getDate()}else lt=!0;if(!lt)return this.processRequests();this.postEvent(kt,{"enabled.telemetry":!1},function(qr){qr||(_e.eventData.lastSuccess=kt,_e.eventData.tokenU=Oe)},oe)}},C})(Or),mt=new Er,ze=mt.postTurnstileEvent.bind(mt),Ze=new wr,we=Ze.postMapLoadEvent.bind(Ze),ke="mapbox-tiles",Be=500,He=50,nt=1e3*60*7,ot;function Ft(){s.caches&&!ot&&(ot=s.caches.open(ke))}var Mt;function Et(k,C){if(Mt===void 0)try{new Response(new ReadableStream),Mt=!0}catch{Mt=!1}Mt?C(k.body):k.blob().then(C)}function Ot(k,C,H){if(Ft(),!!ot){var oe={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(Oe,lt){return oe.headers.set(lt,Oe)});var _e=ve(C.headers.get("Cache-Control")||"");if(!_e["no-store"]){_e["max-age"]&&oe.headers.set("Expires",new Date(H+_e["max-age"]*1e3).toUTCString());var Ce=new Date(oe.headers.get("Expires")).getTime()-H;CeDate.now()&&!H["no-cache"]}var Mr=1/0;function ma(k){Mr++,Mr>He&&(k.getActor().send("enforceCacheSizeLimit",Be),Mr=0)}function Ca(k){Ft(),ot&&ot.then(function(C){C.keys().then(function(H){for(var oe=0;oe=200&&H.status<300||H.status===0)&&H.response!==null){var _e=H.response;if(k.type==="json")try{_e=JSON.parse(H.response)}catch(Ce){return C(Ce)}C(null,_e,H.getResponseHeader("Cache-Control"),H.getResponseHeader("Expires"))}else C(new vn(H.statusText,H.status,k.url))},H.send(k.body),{cancel:function(){return H.abort()}}}var Pr=function(k,C){if(!Lt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Ht(k,C);if(ce()&&self.worker&&self.worker.actor){var H=!0;return self.worker.actor.send("getResource",k,C,void 0,H)}}return Xt(k,C)},Yr=function(k,C){return Pr(g(k,{type:"json"}),C)},Kr=function(k,C){return Pr(g(k,{type:"arrayBuffer"}),C)},na=function(k,C){return Pr(g(k,{method:"POST"}),C)};function La(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var Ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ua(k,C,H,oe){var _e=new s.Image,Ce=s.URL;_e.onload=function(){C(null,_e),Ce.revokeObjectURL(_e.src),_e.onload=null,s.requestAnimationFrame(function(){_e.src=Ga})},_e.onerror=function(){return C(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var Oe=new s.Blob([new Uint8Array(k)],{type:"image/png"});_e.cacheControl=H,_e.expires=oe,_e.src=k.byteLength?Ce.createObjectURL(Oe):Ga}function Xa(k,C){var H=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(H).then(function(oe){C(null,oe)}).catch(function(oe){C(new Error("Could not load image because of "+oe.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var an,Sa,Zn=function(){an=[],Sa=0};Zn();var Wn=function(k,C){if(Le.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Sa>=Te.MAX_PARALLEL_IMAGE_REQUESTS){var H={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return an.push(H),H}Sa++;var oe=!1,_e=function(){if(!oe)for(oe=!0,Sa--;an.length&&Sa0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},pr.prototype.setEventedParent=function(C,H){return this._eventedParent=C,this._eventedParentData=H,this};var kr=8,zr={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Ur={"*":{type:"source"}},dt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],qt={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},fr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ir={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},da={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Ta={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},ua={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},ra={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},ha=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],pn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_n={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},jn={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},li={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},yi={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},gi={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Si={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Gi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},io={type:"array",value:"*"},vo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},ms={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},pi={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},lo={type:"array",value:"*",minimum:1},Ai={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Fo=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],No={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},$o={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},bo={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Hi={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Pi={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},ji={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Uo={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ko={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},us={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},ko={"*":{type:"string"}},zn={$version:kr,$root:zr,sources:Ur,source:dt,source_vector:qt,source_raster:fr,source_raster_dem:Ir,source_geojson:da,source_video:Ta,source_image:ua,layer:ra,layout:ha,layout_background:pn,layout_fill:_n,layout_circle:jn,layout_heatmap:li,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:yi,layout_symbol:gi,layout_raster:Si,layout_hillshade:Gi,filter:io,filter_operator:vo,geometry_type:ms,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:pi,expression:lo,light:Ai,paint:Fo,paint_fill:No,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:$o,paint_circle:bo,paint_heatmap:Hi,paint_symbol:Pi,paint_raster:ji,paint_hillshade:Uo,paint_background:Ko,transition:us,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:ko},_i=function(C,H,oe,_e){this.message=(C?C+": ":"")+oe,_e&&(this.identifier=_e),H!=null&&H.__line__&&(this.line=H.__line__)};function xs(k){var C=k.key,H=k.value;return H?[new _i(C,H,"constants have been deprecated as of v8")]:[]}function Qo(k){for(var C=[],H=arguments.length-1;H-- >0;)C[H]=arguments[H+1];for(var oe=0,_e=C;oe<_e.length;oe+=1){var Ce=_e[oe];for(var Oe in Ce)k[Oe]=Ce[Oe]}return k}function Ii(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function gs(k){if(Array.isArray(k))return k.map(gs);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var H in k)C[H]=gs(k[H]);return C}return Ii(k)}var Zo=(function(k){function C(H,oe){k.call(this,oe),this.message=oe,this.key=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C})(Error),Ss=function(C,H){H===void 0&&(H=[]),this.parent=C,this.bindings={};for(var oe=0,_e=H;oe<_e.length;oe+=1){var Ce=_e[oe],Oe=Ce[0],lt=Ce[1];this.bindings[Oe]=lt}};Ss.prototype.concat=function(C){return new Ss(this,C)},Ss.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},Ss.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var zs={kind:"null"},ui={kind:"number"},po={kind:"string"},oo={kind:"boolean"},vs={kind:"color"},Nl={kind:"object"},Ki={kind:"value"},Ts={kind:"error"},Ws={kind:"collator"},as={kind:"formatted"},bs={kind:"resolvedImage"};function Go(k,C){return{kind:"array",itemType:k,N:C}}function ns(k){if(k.kind==="array"){var C=ns(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var fl=[zs,ui,po,oo,vs,as,Nl,Go(Ki),bs];function Rl(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!Rl(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var H=0,oe=fl;H255?255:jt}function _e(jt){return jt<0?0:jt>1?1:jt}function Ce(jt){return jt[jt.length-1]==="%"?oe(parseFloat(jt)/100*255):oe(parseInt(jt))}function Oe(jt){return jt[jt.length-1]==="%"?_e(parseFloat(jt)/100):_e(parseFloat(jt))}function lt(jt,Kt,Sr){return Sr<0?Sr+=1:Sr>1&&(Sr-=1),Sr*6<1?jt+(Kt-jt)*Sr*6:Sr*2<1?Kt:Sr*3<2?jt+(Kt-jt)*(2/3-Sr)*6:jt}function kt(jt){var Kt=jt.replace(/ /g,"").toLowerCase();if(Kt in H)return H[Kt].slice();if(Kt[0]==="#"){if(Kt.length===4){var Sr=parseInt(Kt.substr(1),16);return Sr>=0&&Sr<=4095?[(Sr&3840)>>4|(Sr&3840)>>8,Sr&240|(Sr&240)>>4,Sr&15|(Sr&15)<<4,1]:null}else if(Kt.length===7){var Sr=parseInt(Kt.substr(1),16);return Sr>=0&&Sr<=16777215?[(Sr&16711680)>>16,(Sr&65280)>>8,Sr&255,1]:null}return null}var qr=Kt.indexOf("("),Br=Kt.indexOf(")");if(qr!==-1&&Br+1===Kt.length){var aa=Kt.substr(0,qr),ka=Kt.substr(qr+1,Br-(qr+1)).split(","),gn=1;switch(aa){case"rgba":if(ka.length!==4)return null;gn=Oe(ka.pop());case"rgb":return ka.length!==3?null:[Ce(ka[0]),Ce(ka[1]),Ce(ka[2]),gn];case"hsla":if(ka.length!==4)return null;gn=Oe(ka.pop());case"hsl":if(ka.length!==3)return null;var Ya=(parseFloat(ka[0])%360+360)%360/360,qn=Oe(ka[1]),kn=Oe(ka[2]),Vn=kn<=.5?kn*(qn+1):kn+qn-kn*qn,$n=kn*2-Vn;return[oe(lt($n,Vn,Ya+1/3)*255),oe(lt($n,Vn,Ya)*255),oe(lt($n,Vn,Ya-1/3)*255),gn];default:return null}}return null}try{C.parseCSSColor=kt}catch{}}),rc=Ic.parseCSSColor,ys=function(C,H,oe,_e){_e===void 0&&(_e=1),this.r=C,this.g=H,this.b=oe,this.a=_e};ys.parse=function(C){if(C){if(C instanceof ys)return C;if(typeof C=="string"){var H=rc(C);if(H)return new ys(H[0]/255*H[3],H[1]/255*H[3],H[2]/255*H[3],H[3])}}},ys.prototype.toString=function(){var C=this.toArray(),H=C[0],oe=C[1],_e=C[2],Ce=C[3];return"rgba("+Math.round(H)+","+Math.round(oe)+","+Math.round(_e)+","+Ce+")"},ys.prototype.toArray=function(){var C=this,H=C.r,oe=C.g,_e=C.b,Ce=C.a;return Ce===0?[0,0,0,0]:[H*255/Ce,oe*255/Ce,_e*255/Ce,Ce]},ys.black=new ys(0,0,0,1),ys.white=new ys(1,1,1,1),ys.transparent=new ys(0,0,0,0),ys.red=new ys(1,0,0,1);var Du=function(C,H,oe){C?this.sensitivity=H?"variant":"case":this.sensitivity=H?"accent":"base",this.locale=oe,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Du.prototype.compare=function(C,H){return this.collator.compare(C,H)},Du.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var oc=function(C,H,oe,_e,Ce){this.text=C,this.image=H,this.scale=oe,this.fontStack=_e,this.textColor=Ce},Dl=function(C){this.sections=C};Dl.fromString=function(C){return new Dl([new oc(C,null,null,null,null)])},Dl.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},Dl.factory=function(C){return C instanceof Dl?C:Dl.fromString(C)},Dl.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},Dl.prototype.serialize=function(){for(var C=["format"],H=0,oe=this.sections;H=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof H=="number"&&H>=0&&H<=255)){var _e=typeof oe=="number"?[k,C,H,oe]:[k,C,H];return"Invalid rgba value ["+_e.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof oe>"u"||typeof oe=="number"&&oe>=0&&oe<=1?null:"Invalid rgba value ["+[k,C,H,oe].join(", ")+"]: 'a' must be between 0 and 1."}function ou(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof ys)return!0;if(k instanceof Du)return!0;if(k instanceof Dl)return!0;if(k instanceof il)return!0;if(Array.isArray(k)){for(var C=0,H=k;C2){var lt=C[1];if(typeof lt!="string"||!(lt in Su)||lt==="object")return H.error('The item type argument of "array" must be one of string, number, boolean',1);Oe=Su[lt],oe++}else Oe=Ki;var kt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return H.error('The length argument to "array" must be a positive integer literal',2);kt=C[2],oe++}_e=Go(Oe,kt)}else _e=Su[Ce];for(var jt=[];oe1)&&H.push(_e)}}return H.concat(this.args.map(function(Ce){return Ce.serialize()}))};var cu=function(C){this.type=as,this.sections=C};cu.parse=function(C,H){if(C.length<2)return H.error("Expected at least one argument.");var oe=C[1];if(!Array.isArray(oe)&&typeof oe=="object")return H.error("First argument must be an image or text section.");for(var _e=[],Ce=!1,Oe=1;Oe<=C.length-1;++Oe){var lt=C[Oe];if(Ce&&typeof lt=="object"&&!Array.isArray(lt)){Ce=!1;var kt=null;if(lt["font-scale"]&&(kt=H.parse(lt["font-scale"],1,ui),!kt))return null;var jt=null;if(lt["text-font"]&&(jt=H.parse(lt["text-font"],1,Go(po)),!jt))return null;var Kt=null;if(lt["text-color"]&&(Kt=H.parse(lt["text-color"],1,vs),!Kt))return null;var Sr=_e[_e.length-1];Sr.scale=kt,Sr.font=jt,Sr.textColor=Kt}else{var qr=H.parse(C[Oe],1,Ki);if(!qr)return null;var Br=qr.type.kind;if(Br!=="string"&&Br!=="value"&&Br!=="null"&&Br!=="resolvedImage")return H.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ce=!0,_e.push({content:qr,scale:null,font:null,textColor:null})}}return new cu(_e)},cu.prototype.evaluate=function(C){var H=function(oe){var _e=oe.content.evaluate(C);return Fs(_e)===bs?new oc("",_e,null,null,null):new oc(Xs(_e),null,oe.scale?oe.scale.evaluate(C):null,oe.font?oe.font.evaluate(C).join(","):null,oe.textColor?oe.textColor.evaluate(C):null)};return new Dl(this.sections.map(H))},cu.prototype.eachChild=function(C){for(var H=0,oe=this.sections;H-1),oe},qs.prototype.eachChild=function(C){C(this.input)},qs.prototype.outputDefined=function(){return!1},qs.prototype.serialize=function(){return["image",this.input.serialize()]};var wf={"to-boolean":oo,"to-color":vs,"to-number":ui,"to-string":po},Vo=function(C,H){this.type=C,this.args=H};Vo.parse=function(C,H){if(C.length<2)return H.error("Expected at least one argument.");var oe=C[0];if((oe==="to-boolean"||oe==="to-string")&&C.length!==2)return H.error("Expected one argument.");for(var _e=wf[oe],Ce=[],Oe=1;Oe4?oe="Invalid rbga value "+JSON.stringify(H)+": expected an array containing either three or four numeric values.":oe=Au(H[0],H[1],H[2],H[3]),!oe))return new ys(H[0]/255,H[1]/255,H[2]/255,H[3])}throw new Ms(oe||"Could not parse color from value '"+(typeof H=="string"?H:String(JSON.stringify(H)))+"'")}else if(this.type.kind==="number"){for(var kt=null,jt=0,Kt=this.args;jt=C[2]||k[1]<=C[1]||k[3]>=C[3])}function $c(k,C){var H=qu(k[0]),oe=yc(k[1]),_e=Math.pow(2,C.z);return[Math.round(H*_e*vl),Math.round(oe*_e*vl)]}function Nc(k,C,H){var oe=k[0]-C[0],_e=k[1]-C[1],Ce=k[0]-H[0],Oe=k[1]-H[1];return oe*Oe-Ce*_e===0&&oe*Ce<=0&&_e*Oe<=0}function _c(k,C,H){return C[1]>k[1]!=H[1]>k[1]&&k[0]<(H[0]-C[0])*(k[1]-C[1])/(H[1]-C[1])+C[0]}function ac(k,C){for(var H=!1,oe=0,_e=C.length;oe<_e;oe++)for(var Ce=C[oe],Oe=0,lt=Ce.length;Oe0&&Sr<0||Kt<0&&Sr>0}function Dc(k,C,H,oe){var _e=[C[0]-k[0],C[1]-k[1]],Ce=[oe[0]-H[0],oe[1]-H[1]];return jc(Ce,_e)===0?!1:!!(hu(k,C,H,oe)&&hu(H,oe,k,C))}function Mu(k,C,H){for(var oe=0,_e=H;oe<_e.length;oe+=1)for(var Ce=_e[oe],Oe=0;OeH[2]){var _e=oe*.5,Ce=k[0]-H[0]>_e?-oe:H[0]-k[0]>_e?oe:0;Ce===0&&(Ce=k[0]-H[2]>_e?-oe:H[2]-k[0]>_e?oe:0),k[0]+=Ce}Rc(C,k)}function zc(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function ff(k,C,H,oe){for(var _e=Math.pow(2,oe.z)*vl,Ce=[oe.x*vl,oe.y*vl],Oe=[],lt=0,kt=k;lt=0)return!1;var H=!0;return k.eachChild(function(oe){H&&!Ql(oe,C)&&(H=!1)}),H}var Hu=function(C,H){this.type=H.type,this.name=C,this.boundExpression=H};Hu.parse=function(C,H){if(C.length!==2||typeof C[1]!="string")return H.error("'var' expression requires exactly one string literal argument.");var oe=C[1];return H.scope.has(oe)?new Hu(oe,H.scope.get(oe)):H.error('Unknown variable "'+oe+'". Make sure "'+oe+'" has been bound in an enclosing "let" expression before using it.',1)},Hu.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Hu.prototype.eachChild=function(){},Hu.prototype.outputDefined=function(){return!1},Hu.prototype.serialize=function(){return["var",this.name]};var Os=function(C,H,oe,_e,Ce){H===void 0&&(H=[]),_e===void 0&&(_e=new Ss),Ce===void 0&&(Ce=[]),this.registry=C,this.path=H,this.key=H.map(function(Oe){return"["+Oe+"]"}).join(""),this.scope=_e,this.errors=Ce,this.expectedType=oe};Os.prototype.parse=function(C,H,oe,_e,Ce){return Ce===void 0&&(Ce={}),H?this.concat(H,oe,_e)._parse(C,Ce):this._parse(C,Ce)},Os.prototype._parse=function(C,H){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function oe(Kt,Sr,qr){return qr==="assert"?new hl(Sr,[Kt]):qr==="coerce"?new Vo(Sr,[Kt]):Kt}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var _e=C[0];if(typeof _e!="string")return this.error("Expression name must be a string, but found "+typeof _e+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Ce=this.registry[_e];if(Ce){var Oe=Ce.parse(C,this);if(!Oe)return null;if(this.expectedType){var lt=this.expectedType,kt=Oe.type;if((lt.kind==="string"||lt.kind==="number"||lt.kind==="boolean"||lt.kind==="object"||lt.kind==="array")&&kt.kind==="value")Oe=oe(Oe,lt,H.typeAnnotation||"assert");else if((lt.kind==="color"||lt.kind==="formatted"||lt.kind==="resolvedImage")&&(kt.kind==="value"||kt.kind==="string"))Oe=oe(Oe,lt,H.typeAnnotation||"coerce");else if(this.checkSubtype(lt,kt))return null}if(!(Oe instanceof es)&&Oe.type.kind!=="resolvedImage"&&zu(Oe)){var jt=new ss;try{Oe=new es(Oe.type,Oe.evaluate(jt))}catch(Kt){return this.error(Kt.message),null}}return Oe}return this.error('Unknown expression "'+_e+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},Os.prototype.concat=function(C,H,oe){var _e=typeof C=="number"?this.path.concat(C):this.path,Ce=oe?this.scope.concat(oe):this.scope;return new Os(this.registry,_e,H||null,Ce,this.errors)},Os.prototype.error=function(C){for(var H=[],oe=arguments.length-1;oe-- >0;)H[oe]=arguments[oe+1];var _e=""+this.key+H.map(function(Ce){return"["+Ce+"]"}).join("");this.errors.push(new Zo(_e,C))},Os.prototype.checkSubtype=function(C,H){var oe=Rl(C,H);return oe&&this.error(oe),oe};function zu(k){if(k instanceof Hu)return zu(k.boundExpression);if(k instanceof Vi&&k.name==="error")return!1;if(k instanceof fu)return!1;if(k instanceof $l)return!1;var C=k instanceof Vo||k instanceof hl,H=!0;return k.eachChild(function(oe){C?H=H&&zu(oe):H=H&&oe instanceof es}),H?qc(k)&&Ql(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function ql(k,C){for(var H=k.length-1,oe=0,_e=H,Ce=0,Oe,lt;oe<=_e;)if(Ce=Math.floor((oe+_e)/2),Oe=k[Ce],lt=k[Ce+1],Oe<=C){if(Ce===H||CC)_e=Ce-1;else throw new Ms("Input is not a number.");return 0}var Xl=function(C,H,oe){this.type=C,this.input=H,this.labels=[],this.outputs=[];for(var _e=0,Ce=oe;_e=lt)return H.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',jt);var Sr=H.parse(kt,Kt,Ce);if(!Sr)return null;Ce=Ce||Sr.type,_e.push([lt,Sr])}return new Xl(Ce,oe,_e)},Xl.prototype.evaluate=function(C){var H=this.labels,oe=this.outputs;if(H.length===1)return oe[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=H[0])return oe[0].evaluate(C);var Ce=H.length;if(_e>=H[Ce-1])return oe[Ce-1].evaluate(C);var Oe=ql(H,_e);return oe[Oe].evaluate(C)},Xl.prototype.eachChild=function(C){C(this.input);for(var H=0,oe=this.outputs;H0&&C.push(this.labels[H]),C.push(this.outputs[H].serialize());return C};function rl(k,C,H){return k*(1-H)+C*H}function Gc(k,C,H){return new ys(rl(k.r,C.r,H),rl(k.g,C.g,H),rl(k.b,C.b,H),rl(k.a,C.a,H))}function ef(k,C,H){return k.map(function(oe,_e){return rl(oe,C[_e],H)})}var su=Object.freeze({__proto__:null,number:rl,color:Gc,array:ef}),Wu=.95047,Fu=1,kf=1.08883,xc=4/29,Mc=6/29,lu=3*Mc*Mc,bc=Mc*Mc*Mc,Ll=Math.PI/180,cc=180/Math.PI;function hf(k){return k>bc?Math.pow(k,1/3):k/lu+xc}function Ec(k){return k>Mc?k*k*k:lu*(k-xc)}function Bs(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Gl(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function eu(k){var C=Gl(k.r),H=Gl(k.g),oe=Gl(k.b),_e=hf((.4124564*C+.3575761*H+.1804375*oe)/Wu),Ce=hf((.2126729*C+.7151522*H+.072175*oe)/Fu),Oe=hf((.0193339*C+.119192*H+.9503041*oe)/kf);return{l:116*Ce-16,a:500*(_e-Ce),b:200*(Ce-Oe),alpha:k.a}}function Fc(k){var C=(k.l+16)/116,H=isNaN(k.a)?C:C+k.a/500,oe=isNaN(k.b)?C:C-k.b/200;return C=Fu*Ec(C),H=Wu*Ec(H),oe=kf*Ec(oe),new ys(Bs(3.2404542*H-1.5371385*C-.4985314*oe),Bs(-.969266*H+1.8760108*C+.041556*oe),Bs(.0556434*H-.2040259*C+1.0572252*oe),k.alpha)}function Gs(k,C,H){return{l:rl(k.l,C.l,H),a:rl(k.a,C.a,H),b:rl(k.b,C.b,H),alpha:rl(k.alpha,C.alpha,H)}}function wc(k){var C=eu(k),H=C.l,oe=C.a,_e=C.b,Ce=Math.atan2(_e,oe)*cc;return{h:Ce<0?Ce+360:Ce,c:Math.sqrt(oe*oe+_e*_e),l:H,alpha:k.a}}function Xu(k){var C=k.h*Ll,H=k.c,oe=k.l;return Fc({l:oe,a:Math.cos(C)*H,b:Math.sin(C)*H,alpha:k.alpha})}function vu(k,C,H){var oe=C-k;return k+H*(oe>180||oe<-180?oe-360*Math.round(oe/360):oe)}function kc(k,C,H){return{h:vu(k.h,C.h,H),c:rl(k.c,C.c,H),l:rl(k.l,C.l,H),alpha:rl(k.alpha,C.alpha,H)}}var du={forward:eu,reverse:Fc,interpolate:Gs},fc={forward:wc,reverse:Xu,interpolate:kc},Oc=Object.freeze({__proto__:null,lab:du,hcl:fc}),Pl=function(C,H,oe,_e,Ce){this.type=C,this.operator=H,this.interpolation=oe,this.input=_e,this.labels=[],this.outputs=[];for(var Oe=0,lt=Ce;Oe1}))return H.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_e={name:"cubic-bezier",controlPoints:kt}}else return H.error("Unknown interpolation type "+String(_e[0]),1,0);if(C.length-1<4)return H.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return H.error("Expected an even number of arguments.");if(Ce=H.parse(Ce,2,ui),!Ce)return null;var jt=[],Kt=null;oe==="interpolate-hcl"||oe==="interpolate-lab"?Kt=vs:H.expectedType&&H.expectedType.kind!=="value"&&(Kt=H.expectedType);for(var Sr=0;Sr=qr)return H.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',aa);var gn=H.parse(Br,ka,Kt);if(!gn)return null;Kt=Kt||gn.type,jt.push([qr,gn])}return Kt.kind!=="number"&&Kt.kind!=="color"&&!(Kt.kind==="array"&&Kt.itemType.kind==="number"&&typeof Kt.N=="number")?H.error("Type "+ns(Kt)+" is not interpolatable."):new Pl(Kt,oe,_e,Ce,jt)},Pl.prototype.evaluate=function(C){var H=this.labels,oe=this.outputs;if(H.length===1)return oe[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=H[0])return oe[0].evaluate(C);var Ce=H.length;if(_e>=H[Ce-1])return oe[Ce-1].evaluate(C);var Oe=ql(H,_e),lt=H[Oe],kt=H[Oe+1],jt=Pl.interpolationFactor(this.interpolation,_e,lt,kt),Kt=oe[Oe].evaluate(C),Sr=oe[Oe+1].evaluate(C);return this.operator==="interpolate"?su[this.type.kind.toLowerCase()](Kt,Sr,jt):this.operator==="interpolate-hcl"?fc.reverse(fc.interpolate(fc.forward(Kt),fc.forward(Sr),jt)):du.reverse(du.interpolate(du.forward(Kt),du.forward(Sr),jt))},Pl.prototype.eachChild=function(C){C(this.input);for(var H=0,oe=this.outputs;H=oe.length)throw new Ms("Array index out of bounds: "+H+" > "+(oe.length-1)+".");if(H!==Math.floor(H))throw new Ms("Array index must be an integer, but found "+H+" instead.");return oe[H]},Ou.prototype.eachChild=function(C){C(this.index),C(this.input)},Ou.prototype.outputDefined=function(){return!1},Ou.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var dl=function(C,H){this.type=oo,this.needle=C,this.haystack=H};dl.parse=function(C,H){if(C.length!==3)return H.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var oe=H.parse(C[1],1,Ki),_e=H.parse(C[2],2,Ki);return!oe||!_e?null:Vu(oe.type,[oo,po,ui,zs,Ki])?new dl(oe,_e):H.error("Expected first argument to be of type boolean, string, number or null, but found "+ns(oe.type)+" instead")},dl.prototype.evaluate=function(C){var H=this.needle.evaluate(C),oe=this.haystack.evaluate(C);if(!oe)return!1;if(!Ul(H,["boolean","string","number","null"]))throw new Ms("Expected first argument to be of type boolean, string, number or null, but found "+ns(Fs(H))+" instead.");if(!Ul(oe,["string","array"]))throw new Ms("Expected second argument to be of type array or string, but found "+ns(Fs(oe))+" instead.");return oe.indexOf(H)>=0},dl.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},dl.prototype.outputDefined=function(){return!0},dl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Hl=function(C,H,oe){this.type=ui,this.needle=C,this.haystack=H,this.fromIndex=oe};Hl.parse=function(C,H){if(C.length<=2||C.length>=5)return H.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var oe=H.parse(C[1],1,Ki),_e=H.parse(C[2],2,Ki);if(!oe||!_e)return null;if(!Vu(oe.type,[oo,po,ui,zs,Ki]))return H.error("Expected first argument to be of type boolean, string, number or null, but found "+ns(oe.type)+" instead");if(C.length===4){var Ce=H.parse(C[3],3,ui);return Ce?new Hl(oe,_e,Ce):null}else return new Hl(oe,_e)},Hl.prototype.evaluate=function(C){var H=this.needle.evaluate(C),oe=this.haystack.evaluate(C);if(!Ul(H,["boolean","string","number","null"]))throw new Ms("Expected first argument to be of type boolean, string, number or null, but found "+ns(Fs(H))+" instead.");if(!Ul(oe,["string","array"]))throw new Ms("Expected second argument to be of type array or string, but found "+ns(Fs(oe))+" instead.");if(this.fromIndex){var _e=this.fromIndex.evaluate(C);return oe.indexOf(H,_e)}return oe.indexOf(H)},Hl.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Hl.prototype.outputDefined=function(){return!1},Hl.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Yu=function(C,H,oe,_e,Ce,Oe){this.inputType=C,this.type=H,this.input=oe,this.cases=_e,this.outputs=Ce,this.otherwise=Oe};Yu.parse=function(C,H){if(C.length<5)return H.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return H.error("Expected an even number of arguments.");var oe,_e;H.expectedType&&H.expectedType.kind!=="value"&&(_e=H.expectedType);for(var Ce={},Oe=[],lt=2;ltNumber.MAX_SAFE_INTEGER)return Kt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Br=="number"&&Math.floor(Br)!==Br)return Kt.error("Numeric branch labels must be integer values.");if(!oe)oe=Fs(Br);else if(Kt.checkSubtype(oe,Fs(Br)))return null;if(typeof Ce[String(Br)]<"u")return Kt.error("Branch labels must be unique.");Ce[String(Br)]=Oe.length}var aa=H.parse(jt,lt,_e);if(!aa)return null;_e=_e||aa.type,Oe.push(aa)}var ka=H.parse(C[1],1,Ki);if(!ka)return null;var gn=H.parse(C[C.length-1],C.length-1,_e);return!gn||ka.type.kind!=="value"&&H.concat(1).checkSubtype(oe,ka.type)?null:new Yu(oe,_e,ka,Ce,Oe,gn)},Yu.prototype.evaluate=function(C){var H=this.input.evaluate(C),oe=Fs(H)===this.inputType&&this.outputs[this.cases[H]]||this.otherwise;return oe.evaluate(C)},Yu.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},Yu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},Yu.prototype.serialize=function(){for(var C=this,H=["match",this.input.serialize()],oe=Object.keys(this.cases).sort(),_e=[],Ce={},Oe=0,lt=oe;Oe=5)return H.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var oe=H.parse(C[1],1,Ki),_e=H.parse(C[2],2,ui);if(!oe||!_e)return null;if(!Vu(oe.type,[Go(Ki),po,Ki]))return H.error("Expected first argument to be of type array or string, but found "+ns(oe.type)+" instead");if(C.length===4){var Ce=H.parse(C[3],3,ui);return Ce?new Eu(oe.type,oe,_e,Ce):null}else return new Eu(oe.type,oe,_e)},Eu.prototype.evaluate=function(C){var H=this.input.evaluate(C),oe=this.beginIndex.evaluate(C);if(!Ul(H,["string","array"]))throw new Ms("Expected first argument to be of type array or string, but found "+ns(Fs(H))+" instead.");if(this.endIndex){var _e=this.endIndex.evaluate(C);return H.slice(oe,_e)}return H.slice(oe)},Eu.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},Eu.prototype.outputDefined=function(){return!1},Eu.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Ku(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Yt(k,C,H){return C===H}function mr(k,C,H){return C!==H}function Jr(k,C,H){return CH}function xa(k,C,H){return C<=H}function $a(k,C,H){return C>=H}function xn(k,C,H,oe){return oe.compare(C,H)===0}function Fn(k,C,H,oe){return!xn(k,C,H,oe)}function Gn(k,C,H,oe){return oe.compare(C,H)<0}function ai(k,C,H,oe){return oe.compare(C,H)>0}function wn(k,C,H,oe){return oe.compare(C,H)<=0}function Sn(k,C,H,oe){return oe.compare(C,H)>=0}function Ln(k,C,H){var oe=k!=="=="&&k!=="!=";return(function(){function _e(Ce,Oe,lt){this.type=oo,this.lhs=Ce,this.rhs=Oe,this.collator=lt,this.hasUntypedArgument=Ce.type.kind==="value"||Oe.type.kind==="value"}return _e.parse=function(Oe,lt){if(Oe.length!==3&&Oe.length!==4)return lt.error("Expected two or three arguments.");var kt=Oe[0],jt=lt.parse(Oe[1],1,Ki);if(!jt)return null;if(!Ku(kt,jt.type))return lt.concat(1).error('"'+kt+`" comparisons are not supported for type '`+ns(jt.type)+"'.");var Kt=lt.parse(Oe[2],2,Ki);if(!Kt)return null;if(!Ku(kt,Kt.type))return lt.concat(2).error('"'+kt+`" comparisons are not supported for type '`+ns(Kt.type)+"'.");if(jt.type.kind!==Kt.type.kind&&jt.type.kind!=="value"&&Kt.type.kind!=="value")return lt.error("Cannot compare types '"+ns(jt.type)+"' and '"+ns(Kt.type)+"'.");oe&&(jt.type.kind==="value"&&Kt.type.kind!=="value"?jt=new hl(Kt.type,[jt]):jt.type.kind!=="value"&&Kt.type.kind==="value"&&(Kt=new hl(jt.type,[Kt])));var Sr=null;if(Oe.length===4){if(jt.type.kind!=="string"&&Kt.type.kind!=="string"&&jt.type.kind!=="value"&&Kt.type.kind!=="value")return lt.error("Cannot use collator to compare non-string types.");if(Sr=lt.parse(Oe[3],3,Ws),!Sr)return null}return new _e(jt,Kt,Sr)},_e.prototype.evaluate=function(Oe){var lt=this.lhs.evaluate(Oe),kt=this.rhs.evaluate(Oe);if(oe&&this.hasUntypedArgument){var jt=Fs(lt),Kt=Fs(kt);if(jt.kind!==Kt.kind||!(jt.kind==="string"||jt.kind==="number"))throw new Ms('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+jt.kind+", "+Kt.kind+") instead.")}if(this.collator&&!oe&&this.hasUntypedArgument){var Sr=Fs(lt),qr=Fs(kt);if(Sr.kind!=="string"||qr.kind!=="string")return C(Oe,lt,kt)}return this.collator?H(Oe,lt,kt,this.collator.evaluate(Oe)):C(Oe,lt,kt)},_e.prototype.eachChild=function(Oe){Oe(this.lhs),Oe(this.rhs),this.collator&&Oe(this.collator)},_e.prototype.outputDefined=function(){return!0},_e.prototype.serialize=function(){var Oe=[k];return this.eachChild(function(lt){Oe.push(lt.serialize())}),Oe},_e})()}var sn=Ln("==",Yt,xn),di=Ln("!=",mr,Fn),Ni=Ln("<",Jr,Gn),Wi=Ln(">",Wr,ai),Ui=Ln("<=",xa,wn),Ji=Ln(">=",$a,Sn),hi=function(C,H,oe,_e,Ce){this.type=po,this.number=C,this.locale=H,this.currency=oe,this.minFractionDigits=_e,this.maxFractionDigits=Ce};hi.parse=function(C,H){if(C.length!==3)return H.error("Expected two arguments.");var oe=H.parse(C[1],1,ui);if(!oe)return null;var _e=C[2];if(typeof _e!="object"||Array.isArray(_e))return H.error("NumberFormat options argument must be an object.");var Ce=null;if(_e.locale&&(Ce=H.parse(_e.locale,1,po),!Ce))return null;var Oe=null;if(_e.currency&&(Oe=H.parse(_e.currency,1,po),!Oe))return null;var lt=null;if(_e["min-fraction-digits"]&&(lt=H.parse(_e["min-fraction-digits"],1,ui),!lt))return null;var kt=null;return _e["max-fraction-digits"]&&(kt=H.parse(_e["max-fraction-digits"],1,ui),!kt)?null:new hi(oe,Ce,Oe,lt,kt)},hi.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},hi.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},hi.prototype.outputDefined=function(){return!1},hi.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var Qn=function(C){this.type=ui,this.input=C};Qn.parse=function(C,H){if(C.length!==2)return H.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var oe=H.parse(C[1],1);return oe?oe.type.kind!=="array"&&oe.type.kind!=="string"&&oe.type.kind!=="value"?H.error("Expected argument of type string or array, but found "+ns(oe.type)+" instead."):new Qn(oe):null},Qn.prototype.evaluate=function(C){var H=this.input.evaluate(C);if(typeof H=="string")return H.length;if(Array.isArray(H))return H.length;throw new Ms("Expected value to be of type string or array, but found "+ns(Fs(H))+" instead.")},Qn.prototype.eachChild=function(C){C(this.input)},Qn.prototype.outputDefined=function(){return!1},Qn.prototype.serialize=function(){var C=["length"];return this.eachChild(function(H){C.push(H.serialize())}),C};var ao={"==":sn,"!=":di,">":Wi,"<":Ni,">=":Ji,"<=":Ui,array:hl,at:Ou,boolean:hl,case:hc,coalesce:pu,collator:fu,format:cu,image:qs,in:dl,"index-of":Hl,interpolate:Pl,"interpolate-hcl":Pl,"interpolate-lab":Pl,length:Qn,let:Zu,literal:es,match:Yu,number:hl,"number-format":hi,object:hl,slice:Eu,step:Xl,string:hl,"to-boolean":Vo,"to-color":Vo,"to-number":Vo,"to-string":Vo,var:Hu,within:$l};function Po(k,C){var H=C[0],oe=C[1],_e=C[2],Ce=C[3];H=H.evaluate(k),oe=oe.evaluate(k),_e=_e.evaluate(k);var Oe=Ce?Ce.evaluate(k):1,lt=Au(H,oe,_e,Oe);if(lt)throw new Ms(lt);return new ys(H/255*Oe,oe/255*Oe,_e/255*Oe,Oe)}function is(k,C){return k in C}function Rs(k,C){var H=C[k];return typeof H>"u"?null:H}function _s(k,C,H,oe){for(;H<=oe;){var _e=H+oe>>1;if(C[_e]===k)return!0;C[_e]>k?oe=_e-1:H=_e+1}return!1}function Ps(k){return{type:k}}Vi.register(ao,{error:[Ts,[po],function(k,C){var H=C[0];throw new Ms(H.evaluate(k))}],typeof:[po,[Ki],function(k,C){var H=C[0];return ns(Fs(H.evaluate(k)))}],"to-rgba":[Go(ui,4),[vs],function(k,C){var H=C[0];return H.evaluate(k).toArray()}],rgb:[vs,[ui,ui,ui],Po],rgba:[vs,[ui,ui,ui,ui],Po],has:{type:oo,overloads:[[[po],function(k,C){var H=C[0];return is(H.evaluate(k),k.properties())}],[[po,Nl],function(k,C){var H=C[0],oe=C[1];return is(H.evaluate(k),oe.evaluate(k))}]]},get:{type:Ki,overloads:[[[po],function(k,C){var H=C[0];return Rs(H.evaluate(k),k.properties())}],[[po,Nl],function(k,C){var H=C[0],oe=C[1];return Rs(H.evaluate(k),oe.evaluate(k))}]]},"feature-state":[Ki,[po],function(k,C){var H=C[0];return Rs(H.evaluate(k),k.featureState||{})}],properties:[Nl,[],function(k){return k.properties()}],"geometry-type":[po,[],function(k){return k.geometryType()}],id:[Ki,[],function(k){return k.id()}],zoom:[ui,[],function(k){return k.globals.zoom}],"heatmap-density":[ui,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[ui,[],function(k){return k.globals.lineProgress||0}],accumulated:[Ki,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[ui,Ps(ui),function(k,C){for(var H=0,oe=0,_e=C;oe<_e.length;oe+=1){var Ce=_e[oe];H+=Ce.evaluate(k)}return H}],"*":[ui,Ps(ui),function(k,C){for(var H=1,oe=0,_e=C;oe<_e.length;oe+=1){var Ce=_e[oe];H*=Ce.evaluate(k)}return H}],"-":{type:ui,overloads:[[[ui,ui],function(k,C){var H=C[0],oe=C[1];return H.evaluate(k)-oe.evaluate(k)}],[[ui],function(k,C){var H=C[0];return-H.evaluate(k)}]]},"/":[ui,[ui,ui],function(k,C){var H=C[0],oe=C[1];return H.evaluate(k)/oe.evaluate(k)}],"%":[ui,[ui,ui],function(k,C){var H=C[0],oe=C[1];return H.evaluate(k)%oe.evaluate(k)}],ln2:[ui,[],function(){return Math.LN2}],pi:[ui,[],function(){return Math.PI}],e:[ui,[],function(){return Math.E}],"^":[ui,[ui,ui],function(k,C){var H=C[0],oe=C[1];return Math.pow(H.evaluate(k),oe.evaluate(k))}],sqrt:[ui,[ui],function(k,C){var H=C[0];return Math.sqrt(H.evaluate(k))}],log10:[ui,[ui],function(k,C){var H=C[0];return Math.log(H.evaluate(k))/Math.LN10}],ln:[ui,[ui],function(k,C){var H=C[0];return Math.log(H.evaluate(k))}],log2:[ui,[ui],function(k,C){var H=C[0];return Math.log(H.evaluate(k))/Math.LN2}],sin:[ui,[ui],function(k,C){var H=C[0];return Math.sin(H.evaluate(k))}],cos:[ui,[ui],function(k,C){var H=C[0];return Math.cos(H.evaluate(k))}],tan:[ui,[ui],function(k,C){var H=C[0];return Math.tan(H.evaluate(k))}],asin:[ui,[ui],function(k,C){var H=C[0];return Math.asin(H.evaluate(k))}],acos:[ui,[ui],function(k,C){var H=C[0];return Math.acos(H.evaluate(k))}],atan:[ui,[ui],function(k,C){var H=C[0];return Math.atan(H.evaluate(k))}],min:[ui,Ps(ui),function(k,C){return Math.min.apply(Math,C.map(function(H){return H.evaluate(k)}))}],max:[ui,Ps(ui),function(k,C){return Math.max.apply(Math,C.map(function(H){return H.evaluate(k)}))}],abs:[ui,[ui],function(k,C){var H=C[0];return Math.abs(H.evaluate(k))}],round:[ui,[ui],function(k,C){var H=C[0],oe=H.evaluate(k);return oe<0?-Math.round(-oe):Math.round(oe)}],floor:[ui,[ui],function(k,C){var H=C[0];return Math.floor(H.evaluate(k))}],ceil:[ui,[ui],function(k,C){var H=C[0];return Math.ceil(H.evaluate(k))}],"filter-==":[oo,[po,Ki],function(k,C){var H=C[0],oe=C[1];return k.properties()[H.value]===oe.value}],"filter-id-==":[oo,[Ki],function(k,C){var H=C[0];return k.id()===H.value}],"filter-type-==":[oo,[po],function(k,C){var H=C[0];return k.geometryType()===H.value}],"filter-<":[oo,[po,Ki],function(k,C){var H=C[0],oe=C[1],_e=k.properties()[H.value],Ce=oe.value;return typeof _e==typeof Ce&&_e":[oo,[po,Ki],function(k,C){var H=C[0],oe=C[1],_e=k.properties()[H.value],Ce=oe.value;return typeof _e==typeof Ce&&_e>Ce}],"filter-id->":[oo,[Ki],function(k,C){var H=C[0],oe=k.id(),_e=H.value;return typeof oe==typeof _e&&oe>_e}],"filter-<=":[oo,[po,Ki],function(k,C){var H=C[0],oe=C[1],_e=k.properties()[H.value],Ce=oe.value;return typeof _e==typeof Ce&&_e<=Ce}],"filter-id-<=":[oo,[Ki],function(k,C){var H=C[0],oe=k.id(),_e=H.value;return typeof oe==typeof _e&&oe<=_e}],"filter->=":[oo,[po,Ki],function(k,C){var H=C[0],oe=C[1],_e=k.properties()[H.value],Ce=oe.value;return typeof _e==typeof Ce&&_e>=Ce}],"filter-id->=":[oo,[Ki],function(k,C){var H=C[0],oe=k.id(),_e=H.value;return typeof oe==typeof _e&&oe>=_e}],"filter-has":[oo,[Ki],function(k,C){var H=C[0];return H.value in k.properties()}],"filter-has-id":[oo,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[oo,[Go(po)],function(k,C){var H=C[0];return H.value.indexOf(k.geometryType())>=0}],"filter-id-in":[oo,[Go(Ki)],function(k,C){var H=C[0];return H.value.indexOf(k.id())>=0}],"filter-in-small":[oo,[po,Go(Ki)],function(k,C){var H=C[0],oe=C[1];return oe.value.indexOf(k.properties()[H.value])>=0}],"filter-in-large":[oo,[po,Go(Ki)],function(k,C){var H=C[0],oe=C[1];return _s(k.properties()[H.value],oe.value,0,oe.value.length-1)}],all:{type:oo,overloads:[[[oo,oo],function(k,C){var H=C[0],oe=C[1];return H.evaluate(k)&&oe.evaluate(k)}],[Ps(oo),function(k,C){for(var H=0,oe=C;H-1}function ki(k){return!!k.expression&&k.expression.interpolated}function go(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function Cs(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function ds(k){return k}function zl(k,C){var H=C.type==="color",oe=k.stops&&typeof k.stops[0][0]=="object",_e=oe||k.property!==void 0,Ce=oe||!_e,Oe=k.type||(ki(C)?"exponential":"interval");if(H&&(k=Qo({},k),k.stops&&(k.stops=k.stops.map(function(Ei){return[Ei[0],ys.parse(Ei[1])]})),k.default?k.default=ys.parse(k.default):k.default=ys.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Oc[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var lt,kt,jt;if(Oe==="exponential")lt=Wl;else if(Oe==="interval")lt=Ju;else if(Oe==="categorical"){lt=mu,kt=Object.create(null);for(var Kt=0,Sr=k.stops;Kt=k.stops[oe-1][0])return k.stops[oe-1][1];var _e=ql(k.stops.map(function(Ce){return Ce[0]}),H);return k.stops[_e][1]}function Wl(k,C,H){var oe=k.base!==void 0?k.base:1;if(go(H)!=="number")return tu(k.default,C.default);var _e=k.stops.length;if(_e===1||H<=k.stops[0][0])return k.stops[0][1];if(H>=k.stops[_e-1][0])return k.stops[_e-1][1];var Ce=ql(k.stops.map(function(Sr){return Sr[0]}),H),Oe=Zl(H,oe,k.stops[Ce][0],k.stops[Ce+1][0]),lt=k.stops[Ce][1],kt=k.stops[Ce+1][1],jt=su[C.type]||ds;if(k.colorSpace&&k.colorSpace!=="rgb"){var Kt=Oc[k.colorSpace];jt=function(Sr,qr){return Kt.reverse(Kt.interpolate(Kt.forward(Sr),Kt.forward(qr),Oe))}}return typeof lt.evaluate=="function"?{evaluate:function(){for(var qr=[],Br=arguments.length;Br--;)qr[Br]=arguments[Br];var aa=lt.evaluate.apply(void 0,qr),ka=kt.evaluate.apply(void 0,qr);if(!(aa===void 0||ka===void 0))return jt(aa,ka,Oe)}}:jt(lt,kt,Oe)}function $u(k,C,H){return C.type==="color"?H=ys.parse(H):C.type==="formatted"?H=Dl.fromString(H.toString()):C.type==="resolvedImage"?H=il.fromString(H.toString()):go(H)!==C.type&&(C.type!=="enum"||!C.values[H])&&(H=void 0),tu(H,k.default,C.default)}function Zl(k,C,H,oe){var _e=oe-H,Ce=k-H;return _e===0?0:C===1?Ce/_e:(Math.pow(C,Ce)-1)/(Math.pow(C,_e)-1)}var Bu=function(C,H){this.expression=C,this._warningHistory={},this._evaluator=new ss,this._defaultValue=H?Ae(H):null,this._enumValues=H&&H.type==="enum"?H.values:null};Bu.prototype.evaluateWithoutErrorHandling=function(C,H,oe,_e,Ce,Oe){return this._evaluator.globals=C,this._evaluator.feature=H,this._evaluator.featureState=oe,this._evaluator.canonical=_e,this._evaluator.availableImages=Ce||null,this._evaluator.formattedSection=Oe,this.expression.evaluate(this._evaluator)},Bu.prototype.evaluate=function(C,H,oe,_e,Ce,Oe){this._evaluator.globals=C,this._evaluator.feature=H||null,this._evaluator.featureState=oe||null,this._evaluator.canonical=_e,this._evaluator.availableImages=Ce||null,this._evaluator.formattedSection=Oe||null;try{var lt=this.expression.evaluate(this._evaluator);if(lt==null||typeof lt=="number"&<!==lt)return this._defaultValue;if(this._enumValues&&!(lt in this._enumValues))throw new Ms("Expected value to be one of "+Object.keys(this._enumValues).map(function(kt){return JSON.stringify(kt)}).join(", ")+", but found "+JSON.stringify(lt)+" instead.");return lt}catch(kt){return this._warningHistory[kt.message]||(this._warningHistory[kt.message]=!0,typeof console<"u"&&console.warn(kt.message)),this._defaultValue}};function $i(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in ao}function _o(k,C){var H=new Os(ao,[],C?be(C):void 0),oe=H.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return oe?ts(new Bu(oe,C)):ul(H.errors)}var Qu=function(C,H){this.kind=C,this._styleExpression=H,this.isStateDependent=C!=="constant"&&!Zs(H.expression)};Qu.prototype.evaluateWithoutErrorHandling=function(C,H,oe,_e,Ce,Oe){return this._styleExpression.evaluateWithoutErrorHandling(C,H,oe,_e,Ce,Oe)},Qu.prototype.evaluate=function(C,H,oe,_e,Ce,Oe){return this._styleExpression.evaluate(C,H,oe,_e,Ce,Oe)};var ku=function(C,H,oe,_e){this.kind=C,this.zoomStops=oe,this._styleExpression=H,this.isStateDependent=C!=="camera"&&!Zs(H.expression),this.interpolationType=_e};ku.prototype.evaluateWithoutErrorHandling=function(C,H,oe,_e,Ce,Oe){return this._styleExpression.evaluateWithoutErrorHandling(C,H,oe,_e,Ce,Oe)},ku.prototype.evaluate=function(C,H,oe,_e,Ce,Oe){return this._styleExpression.evaluate(C,H,oe,_e,Ce,Oe)},ku.prototype.interpolationFactor=function(C,H,oe){return this.interpolationType?Pl.interpolationFactor(this.interpolationType,C,H,oe):0};function gu(k,C){if(k=_o(k,C),k.result==="error")return k;var H=k.value.expression,oe=qc(H);if(!oe&&!Ys(C))return ul([new Zo("","data expressions not supported")]);var _e=Ql(H,["zoom"]);if(!_e&&!Ns(C))return ul([new Zo("","zoom expressions not supported")]);var Ce=ne(H);if(!Ce&&!_e)return ul([new Zo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ce instanceof Zo)return ul([Ce]);if(Ce instanceof Pl&&!ki(C))return ul([new Zo("",'"interpolate" expressions cannot be used with this property')]);if(!Ce)return ts(oe?new Qu("constant",k.value):new Qu("source",k.value));var Oe=Ce instanceof Pl?Ce.interpolation:void 0;return ts(oe?new ku("camera",k.value,Ce.labels,Oe):new ku("composite",k.value,Ce.labels,Oe))}var De=function(C,H){this._parameters=C,this._specification=H,Qo(this,zl(this._parameters,this._specification))};De.deserialize=function(C){return new De(C._parameters,C._specification)},De.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function I(k,C){if(Cs(k))return new De(k,C);if($i(k)){var H=gu(k,C);if(H.result==="error")throw new Error(H.value.map(function(_e){return _e.key+": "+_e.message}).join(", "));return H.value}else{var oe=k;return typeof k=="string"&&C.type==="color"&&(oe=ys.parse(k)),{kind:"constant",evaluate:function(){return oe}}}}function ne(k){var C=null;if(k instanceof Zu)C=ne(k.result);else if(k instanceof pu)for(var H=0,oe=k.args;Hoe.maximum?[new _i(C,H,H+" is greater than the maximum value "+oe.maximum)]:[]}function Rt(k){var C=k.valueSpec,H=Ii(k.value.type),oe,_e={},Ce,Oe,lt=H!=="categorical"&&k.value.property===void 0,kt=!lt,jt=go(k.value.stops)==="array"&&go(k.value.stops[0])==="array"&&go(k.value.stops[0][0])==="object",Kt=Re({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Sr,default:aa}});return H==="identity"&<&&Kt.push(new _i(k.key,k.value,'missing required property "property"')),H!=="identity"&&!k.value.stops&&Kt.push(new _i(k.key,k.value,'missing required property "stops"')),H==="exponential"&&k.valueSpec.expression&&!ki(k.valueSpec)&&Kt.push(new _i(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(kt&&!Ys(k.valueSpec)?Kt.push(new _i(k.key,k.value,"property functions not supported")):lt&&!Ns(k.valueSpec)&&Kt.push(new _i(k.key,k.value,"zoom functions not supported"))),(H==="categorical"||jt)&&k.value.property===void 0&&Kt.push(new _i(k.key,k.value,'"property" property is required')),Kt;function Sr(ka){if(H==="identity")return[new _i(ka.key,ka.value,'identity function may not have a "stops" property')];var gn=[],Ya=ka.value;return gn=gn.concat(ut({key:ka.key,value:Ya,valueSpec:ka.valueSpec,style:ka.style,styleSpec:ka.styleSpec,arrayElementValidator:qr})),go(Ya)==="array"&&Ya.length===0&&gn.push(new _i(ka.key,Ya,"array must have at least one stop")),gn}function qr(ka){var gn=[],Ya=ka.value,qn=ka.key;if(go(Ya)!=="array")return[new _i(qn,Ya,"array expected, "+go(Ya)+" found")];if(Ya.length!==2)return[new _i(qn,Ya,"array length 2 expected, length "+Ya.length+" found")];if(jt){if(go(Ya[0])!=="object")return[new _i(qn,Ya,"object expected, "+go(Ya[0])+" found")];if(Ya[0].zoom===void 0)return[new _i(qn,Ya,"object stop key must have zoom")];if(Ya[0].value===void 0)return[new _i(qn,Ya,"object stop key must have value")];if(Oe&&Oe>Ii(Ya[0].zoom))return[new _i(qn,Ya[0].zoom,"stop zoom values must appear in ascending order")];Ii(Ya[0].zoom)!==Oe&&(Oe=Ii(Ya[0].zoom),Ce=void 0,_e={}),gn=gn.concat(Re({key:qn+"[0]",value:Ya[0],valueSpec:{zoom:{}},style:ka.style,styleSpec:ka.styleSpec,objectElementValidators:{zoom:_t,value:Br}}))}else gn=gn.concat(Br({key:qn+"[0]",value:Ya[0],valueSpec:{},style:ka.style,styleSpec:ka.styleSpec},Ya));return $i(gs(Ya[1]))?gn.concat([new _i(qn+"[1]",Ya[1],"expressions are not allowed in function stops.")]):gn.concat(uo({key:qn+"[1]",value:Ya[1],valueSpec:C,style:ka.style,styleSpec:ka.styleSpec}))}function Br(ka,gn){var Ya=go(ka.value),qn=Ii(ka.value),kn=ka.value!==null?ka.value:gn;if(!oe)oe=Ya;else if(Ya!==oe)return[new _i(ka.key,kn,Ya+" stop domain type must match previous stop domain type "+oe)];if(Ya!=="number"&&Ya!=="string"&&Ya!=="boolean")return[new _i(ka.key,kn,"stop domain value must be a number, string, or boolean")];if(Ya!=="number"&&H!=="categorical"){var Vn="number expected, "+Ya+" found";return Ys(C)&&H===void 0&&(Vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _i(ka.key,kn,Vn)]}return H==="categorical"&&Ya==="number"&&(!isFinite(qn)||Math.floor(qn)!==qn)?[new _i(ka.key,kn,"integer expected, found "+qn)]:H!=="categorical"&&Ya==="number"&&Ce!==void 0&&qn=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,H=k.slice(1);CC?1:0}function ct(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?yt(k[1],k[2],C):C==="any"?Ct(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(At)):C==="none"?["all"].concat(k.slice(1).map(At).map(Tr)):C==="in"?nr(k[1],k.slice(2)):C==="!in"?Tr(nr(k[1],k.slice(2))):C==="has"?vr(k[1]):C==="!has"?Tr(vr(k[1])):C==="within"?k:!0;return H}function yt(k,C,H){switch(k){case"$type":return["filter-type-"+H,C];case"$id":return["filter-id-"+H,C];default:return["filter-"+H,k,C]}}function Ct(k){return["any"].concat(k.map(At))}function nr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(H){return typeof H!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(at)]]:["filter-in-small",k,["literal",C]]}}function vr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function Tr(k){return["!",k]}function Fr(k){return Qr(gs(k.value))?Zt(Qo({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Xr(k)}function Xr(k){var C=k.value,H=k.key;if(go(C)!=="array")return[new _i(H,C,"array expected, "+go(C)+" found")];var oe=k.styleSpec,_e,Ce=[];if(C.length<1)return[new _i(H,C,"filter array must have at least 1 element")];switch(Ce=Ce.concat(Gr({key:H+"[0]",value:C[0],valueSpec:oe.filter_operator,style:k.style,styleSpec:k.styleSpec})),Ii(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Ii(C[1])==="$type"&&Ce.push(new _i(H,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&Ce.push(new _i(H,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(_e=go(C[1]),_e!=="string"&&Ce.push(new _i(H+"[1]",C[1],"string expected, "+_e+" found")));for(var Oe=2;Oe=Kt[Br+0]&&oe>=Kt[Br+1])?(Oe[qr]=!0,Ce.push(jt[qr])):Oe[qr]=!1}}},Fl.prototype._forEachCell=function(k,C,H,oe,_e,Ce,Oe,lt){for(var kt=this._convertToCellCoord(k),jt=this._convertToCellCoord(C),Kt=this._convertToCellCoord(H),Sr=this._convertToCellCoord(oe),qr=kt;qr<=Kt;qr++)for(var Br=jt;Br<=Sr;Br++){var aa=this.d*Br+qr;if(!(lt&&!lt(this._convertFromCellCoord(qr),this._convertFromCellCoord(Br),this._convertFromCellCoord(qr+1),this._convertFromCellCoord(Br+1)))&&_e.call(this,k,C,H,oe,aa,Ce,Oe,lt))return}},Fl.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},Fl.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},Fl.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Qs+this.cells.length+1+1,H=0,oe=0;oe=0)){var Sr=k[Kt];jt[Kt]=ml[kt].shallow.indexOf(Kt)>=0?Sr:pt(Sr,C)}k instanceof Error&&(jt.message=k.message)}if(jt.$name)throw new Error("$name property is reserved for worker serialization logic.");return kt!=="Object"&&(jt.$name=kt),jt}throw new Error("can't serialize object of type "+typeof k)}function xt(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||Je(k)||ft(k)||ArrayBuffer.isView(k)||k instanceof Cu)return k;if(Array.isArray(k))return k.map(xt);if(typeof k=="object"){var C=k.$name||"Object",H=ml[C],oe=H.klass;if(!oe)throw new Error("can't deserialize unregistered class "+C);if(oe.deserialize)return oe.deserialize(k);for(var _e=Object.create(oe.prototype),Ce=0,Oe=Object.keys(k);Ce=0?kt:xt(kt)}}return _e}throw new Error("can't deserialize object of type "+typeof k)}var Jt=function(){this.first=!0};Jt.prototype.update=function(C,H){var oe=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=oe,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=oe,!0):(this.lastFloorZoom>oe?(this.lastIntegerZoom=oe+1,this.lastIntegerZoomTime=H):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function dr(k){for(var C=0,H=k;C=65097&&k<=65103)||Pt["CJK Compatibility Ideographs"](k)||Pt["CJK Compatibility"](k)||Pt["CJK Radicals Supplement"](k)||Pt["CJK Strokes"](k)||Pt["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||Pt["CJK Unified Ideographs Extension A"](k)||Pt["CJK Unified Ideographs"](k)||Pt["Enclosed CJK Letters and Months"](k)||Pt["Hangul Compatibility Jamo"](k)||Pt["Hangul Jamo Extended-A"](k)||Pt["Hangul Jamo Extended-B"](k)||Pt["Hangul Jamo"](k)||Pt["Hangul Syllables"](k)||Pt.Hiragana(k)||Pt["Ideographic Description Characters"](k)||Pt.Kanbun(k)||Pt["Kangxi Radicals"](k)||Pt["Katakana Phonetic Extensions"](k)||Pt.Katakana(k)&&k!==12540||Pt["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||Pt["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||Pt["Unified Canadian Aboriginal Syllabics"](k)||Pt["Unified Canadian Aboriginal Syllabics Extended"](k)||Pt["Vertical Forms"](k)||Pt["Yijing Hexagram Symbols"](k)||Pt["Yi Syllables"](k)||Pt["Yi Radicals"](k))}function qa(k){return!!(Pt["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||Pt["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||Pt["Letterlike Symbols"](k)||Pt["Number Forms"](k)||Pt["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||Pt["Control Pictures"](k)&&k!==9251||Pt["Optical Character Recognition"](k)||Pt["Enclosed Alphanumerics"](k)||Pt["Geometric Shapes"](k)||Pt["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||Pt["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||Pt["CJK Symbols and Punctuation"](k)||Pt.Katakana(k)||Pt["Private Use Area"](k)||Pt["CJK Compatibility Forms"](k)||Pt["Small Form Variants"](k)||Pt["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function Wa(k){return!(sa(k)||qa(k))}function ya(k){return Pt.Arabic(k)||Pt["Arabic Supplement"](k)||Pt["Arabic Extended-A"](k)||Pt["Arabic Presentation Forms-A"](k)||Pt["Arabic Presentation Forms-B"](k)}function Ea(k){return k>=1424&&k<=2303||Pt["Arabic Presentation Forms-A"](k)||Pt["Arabic Presentation Forms-B"](k)}function Na(k,C){return!(!C&&Ea(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||Pt.Khmer(k))}function tn(k){for(var C=0,H=k;C-1&&(Xn=wa.error),Jn&&Jn(k)};function Fi(){qi.fire(new Rr("pluginStateChange",{pluginStatus:Xn,pluginURL:ni}))}var qi=new pr,Lo=function(){return Xn},Xi=function(k){return k({pluginStatus:Xn,pluginURL:ni}),qi.on("pluginStateChange",k),k},Eo=function(k,C,H){if(H===void 0&&(H=!1),Xn===wa.deferred||Xn===wa.loading||Xn===wa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ni=xe.resolveURL(k),Xn=wa.deferred,Jn=C,Fi(),H||js()},js=function(){if(Xn!==wa.deferred||!ni)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Xn=wa.loading,Fi(),ni&&Kr({url:ni},function(k){k?xi(k):(Xn=wa.loaded,Fi())})},Ds={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Xn===wa.loaded||Ds.applyArabicShaping!=null},isLoading:function(){return Xn===wa.loading},setState:function(C){Xn=C.pluginStatus,ni=C.pluginURL},isParsed:function(){return Ds.applyArabicShaping!=null&&Ds.processBidirectionalText!=null&&Ds.processStyledBidirectionalText!=null},getPluginURL:function(){return ni}},Ks=function(){!Ds.isLoading()&&!Ds.isLoaded()&&Lo()==="deferred"&&js()},oi=function(C,H){this.zoom=C,H?(this.now=H.now,this.fadeDuration=H.fadeDuration,this.zoomHistory=H.zoomHistory,this.transition=H.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Jt,this.transition={})};oi.prototype.isSupportedScript=function(C){return Ka(C,Ds.isLoaded())},oi.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},oi.prototype.getCrossfadeParameters=function(){var C=this.zoom,H=C-Math.floor(C),oe=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:H+(1-H)*oe}:{fromScale:.5,toScale:1,t:1-(1-oe)*H}};var eo=function(C,H){this.property=C,this.value=H,this.expression=I(H===void 0?C.specification.default:H,C.specification)};eo.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},eo.prototype.possiblyEvaluate=function(C,H,oe){return this.property.possiblyEvaluate(this,C,H,oe)};var Ho=function(C){this.property=C,this.value=new eo(C,void 0)};Ho.prototype.transitioned=function(C,H){return new el(this.property,this.value,H,g({},C.transition,this.transition),C.now)},Ho.prototype.untransitioned=function(){return new el(this.property,this.value,null,{},0)};var Yo=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Yo.prototype.getValue=function(C){return O(this._values[C].value.value)},Yo.prototype.setValue=function(C,H){this._values.hasOwnProperty(C)||(this._values[C]=new Ho(this._values[C].property)),this._values[C].value=new eo(this._values[C].property,H===null?void 0:O(H))},Yo.prototype.getTransition=function(C){return O(this._values[C].transition)},Yo.prototype.setTransition=function(C,H){this._values.hasOwnProperty(C)||(this._values[C]=new Ho(this._values[C].property)),this._values[C].transition=O(H)||void 0},Yo.prototype.serialize=function(){for(var C={},H=0,oe=Object.keys(this._values);Hthis.end)return this.prior=null,Ce;if(this.value.isDataDriven())return this.prior=null,Ce;if(_eOe.zoomHistory.lastIntegerZoom?{from:oe,to:_e}:{from:Ce,to:_e}},C.prototype.interpolate=function(oe){return oe},C})(Gt),ea=function(C){this.specification=C};ea.prototype.possiblyEvaluate=function(C,H,oe,_e){if(C.value!==void 0)if(C.expression.kind==="constant"){var Ce=C.expression.evaluate(H,null,{},oe,_e);return this._calculate(Ce,Ce,Ce,H)}else return this._calculate(C.expression.evaluate(new oi(Math.floor(H.zoom-1),H)),C.expression.evaluate(new oi(Math.floor(H.zoom),H)),C.expression.evaluate(new oi(Math.floor(H.zoom+1),H)),H)},ea.prototype._calculate=function(C,H,oe,_e){var Ce=_e.zoom;return Ce>_e.zoomHistory.lastIntegerZoom?{from:C,to:H}:{from:oe,to:H}},ea.prototype.interpolate=function(C){return C};var pa=function(C){this.specification=C};pa.prototype.possiblyEvaluate=function(C,H,oe,_e){return!!C.expression.evaluate(H,null,{},oe,_e)},pa.prototype.interpolate=function(){return!1};var la=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var H in C){var oe=C[H];oe.specification.overridable&&this.overridableProperties.push(H);var _e=this.defaultPropertyValues[H]=new eo(oe,void 0),Ce=this.defaultTransitionablePropertyValues[H]=new Ho(oe);this.defaultTransitioningPropertyValues[H]=Ce.untransitioned(),this.defaultPossiblyEvaluatedValues[H]=_e.possiblyEvaluate({})}};pe("DataDrivenProperty",Gt),pe("DataConstantProperty",tt),pe("CrossFadedDataDrivenProperty",or),pe("CrossFadedProperty",ea),pe("ColorRampProperty",pa);var fa="-transition",ja=(function(k){function C(H,oe){if(k.call(this),this.id=H.id,this.type=H.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},H.type!=="custom"&&(H=H,this.metadata=H.metadata,this.minzoom=H.minzoom,this.maxzoom=H.maxzoom,H.type!=="background"&&(this.source=H.source,this.sourceLayer=H["source-layer"],this.filter=H.filter),oe.layout&&(this._unevaluatedLayout=new Yl(oe.layout)),oe.paint)){this._transitionablePaint=new Yo(oe.paint);for(var _e in H.paint)this.setPaintProperty(_e,H.paint[_e],{validate:!1});for(var Ce in H.layout)this.setLayoutProperty(Ce,H.layout[Ce],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Nu(oe.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(oe){return oe==="visibility"?this.visibility:this._unevaluatedLayout.getValue(oe)},C.prototype.setLayoutProperty=function(oe,_e,Ce){if(Ce===void 0&&(Ce={}),_e!=null){var Oe="layers."+this.id+".layout."+oe;if(this._validate(Ml,Oe,oe,_e,Ce))return}if(oe==="visibility"){this.visibility=_e;return}this._unevaluatedLayout.setValue(oe,_e)},C.prototype.getPaintProperty=function(oe){return z(oe,fa)?this._transitionablePaint.getTransition(oe.slice(0,-fa.length)):this._transitionablePaint.getValue(oe)},C.prototype.setPaintProperty=function(oe,_e,Ce){if(Ce===void 0&&(Ce={}),_e!=null){var Oe="layers."+this.id+".paint."+oe;if(this._validate(ol,Oe,oe,_e,Ce))return!1}if(z(oe,fa))return this._transitionablePaint.setTransition(oe.slice(0,-fa.length),_e||void 0),!1;var lt=this._transitionablePaint._values[oe],kt=lt.property.specification["property-type"]==="cross-faded-data-driven",jt=lt.value.isDataDriven(),Kt=lt.value;this._transitionablePaint.setValue(oe,_e),this._handleSpecialPaintPropertyUpdate(oe);var Sr=this._transitionablePaint._values[oe].value,qr=Sr.isDataDriven();return qr||jt||kt||this._handleOverridablePaintPropertyUpdate(oe,Kt,Sr)},C.prototype._handleSpecialPaintPropertyUpdate=function(oe){},C.prototype._handleOverridablePaintPropertyUpdate=function(oe,_e,Ce){return!1},C.prototype.isHidden=function(oe){return this.minzoom&&oe=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(oe){this._transitioningPaint=this._transitionablePaint.transitioned(oe,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(oe,_e){oe.getCrossfadeParameters&&(this._crossfadeParameters=oe.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(oe,void 0,_e)),this.paint=this._transitioningPaint.possiblyEvaluate(oe,void 0,_e)},C.prototype.serialize=function(){var oe={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(oe.layout=oe.layout||{},oe.layout.visibility=this.visibility),N(oe,function(_e,Ce){return _e!==void 0&&!(Ce==="layout"&&!Object.keys(_e).length)&&!(Ce==="paint"&&!Object.keys(_e).length)})},C.prototype._validate=function(oe,_e,Ce,Oe,lt){return lt===void 0&&(lt={}),lt&<.validate===!1?!1:ru(this,oe.call(Io,{key:_e,layerType:this.type,objectKey:Ce,value:Oe,styleSpec:zn,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var oe in this.paint._values){var _e=this.paint.get(oe);if(!(!(_e instanceof sl)||!Ys(_e.property.specification))&&(_e.value.kind==="source"||_e.value.kind==="composite")&&_e.value.isStateDependent)return!0}return!1},C})(pr),hn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},un=function(C,H){this._structArray=C,this._pos1=H*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ja=128,si=5,Mn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Mn.serialize=function(C,H){return C._trim(),H&&(C.isTransferred=!0,H.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Mn.deserialize=function(C){var H=Object.create(this.prototype);return H.arrayBuffer=C.arrayBuffer,H.length=C.length,H.capacity=C.arrayBuffer.byteLength/H.bytesPerElement,H._refreshViews(),H},Mn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Mn.prototype.clear=function(){this.length=0},Mn.prototype.resize=function(C){this.reserve(C),this.length=C},Mn.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*si),Ja),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var H=this.uint8;this._refreshViews(),H&&this.uint8.set(H)}},Mn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function yn(k,C){C===void 0&&(C=1);var H=0,oe=0,_e=k.map(function(Oe){var lt=Pa(Oe.type),kt=H=Zr(H,Math.max(C,lt)),jt=Oe.components||1;return oe=Math.max(oe,lt),H+=lt*jt,{name:Oe.name,type:Oe.type,components:jt,offset:kt}}),Ce=Zr(H,Math.max(oe,C));return{members:_e,size:Ce,alignment:C}}function Pa(k){return hn[k].BYTES_PER_ELEMENT}function Zr(k,C){return Math.ceil(k/C)*C}var _a=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,oe,_e)},C.prototype.emplace=function(oe,_e,Ce){var Oe=oe*2;return this.int16[Oe+0]=_e,this.int16[Oe+1]=Ce,oe},C})(Mn);_a.prototype.bytesPerElement=4,pe("StructArrayLayout2i4",_a);var Ha=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe){var lt=this.length;return this.resize(lt+1),this.emplace(lt,oe,_e,Ce,Oe)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt){var kt=oe*4;return this.int16[kt+0]=_e,this.int16[kt+1]=Ce,this.int16[kt+2]=Oe,this.int16[kt+3]=lt,oe},C})(Mn);Ha.prototype.bytesPerElement=8,pe("StructArrayLayout4i8",Ha);var nn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt){var jt=this.length;return this.resize(jt+1),this.emplace(jt,oe,_e,Ce,Oe,lt,kt)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt){var Kt=oe*6;return this.int16[Kt+0]=_e,this.int16[Kt+1]=Ce,this.int16[Kt+2]=Oe,this.int16[Kt+3]=lt,this.int16[Kt+4]=kt,this.int16[Kt+5]=jt,oe},C})(Mn);nn.prototype.bytesPerElement=12,pe("StructArrayLayout2i4i12",nn);var za=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt){var jt=this.length;return this.resize(jt+1),this.emplace(jt,oe,_e,Ce,Oe,lt,kt)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt){var Kt=oe*4,Sr=oe*8;return this.int16[Kt+0]=_e,this.int16[Kt+1]=Ce,this.uint8[Sr+4]=Oe,this.uint8[Sr+5]=lt,this.uint8[Sr+6]=kt,this.uint8[Sr+7]=jt,oe},C})(Mn);za.prototype.bytesPerElement=8,pe("StructArrayLayout2i4ub8",za);var Cn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,oe,_e)},C.prototype.emplace=function(oe,_e,Ce){var Oe=oe*2;return this.float32[Oe+0]=_e,this.float32[Oe+1]=Ce,oe},C})(Mn);Cn.prototype.bytesPerElement=8,pe("StructArrayLayout2f8",Cn);var bn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr){var Br=this.length;return this.resize(Br+1),this.emplace(Br,oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br){var aa=oe*10;return this.uint16[aa+0]=_e,this.uint16[aa+1]=Ce,this.uint16[aa+2]=Oe,this.uint16[aa+3]=lt,this.uint16[aa+4]=kt,this.uint16[aa+5]=jt,this.uint16[aa+6]=Kt,this.uint16[aa+7]=Sr,this.uint16[aa+8]=qr,this.uint16[aa+9]=Br,oe},C})(Mn);bn.prototype.bytesPerElement=20,pe("StructArrayLayout10ui20",bn);var ri=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa){var ka=this.length;return this.resize(ka+1),this.emplace(ka,oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka){var gn=oe*12;return this.int16[gn+0]=_e,this.int16[gn+1]=Ce,this.int16[gn+2]=Oe,this.int16[gn+3]=lt,this.uint16[gn+4]=kt,this.uint16[gn+5]=jt,this.uint16[gn+6]=Kt,this.uint16[gn+7]=Sr,this.int16[gn+8]=qr,this.int16[gn+9]=Br,this.int16[gn+10]=aa,this.int16[gn+11]=ka,oe},C})(Mn);ri.prototype.bytesPerElement=24,pe("StructArrayLayout4i4ui4i24",ri);var Oa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,oe,_e,Ce)},C.prototype.emplace=function(oe,_e,Ce,Oe){var lt=oe*3;return this.float32[lt+0]=_e,this.float32[lt+1]=Ce,this.float32[lt+2]=Oe,oe},C})(Mn);Oa.prototype.bytesPerElement=12,pe("StructArrayLayout3f12",Oa);var Ia=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe){var _e=this.length;return this.resize(_e+1),this.emplace(_e,oe)},C.prototype.emplace=function(oe,_e){var Ce=oe*1;return this.uint32[Ce+0]=_e,oe},C})(Mn);Ia.prototype.bytesPerElement=4,pe("StructArrayLayout1ul4",Ia);var Un=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr){var qr=this.length;return this.resize(qr+1),this.emplace(qr,oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr){var Br=oe*10,aa=oe*5;return this.int16[Br+0]=_e,this.int16[Br+1]=Ce,this.int16[Br+2]=Oe,this.int16[Br+3]=lt,this.int16[Br+4]=kt,this.int16[Br+5]=jt,this.uint32[aa+3]=Kt,this.uint16[Br+8]=Sr,this.uint16[Br+9]=qr,oe},C})(Mn);Un.prototype.bytesPerElement=20,pe("StructArrayLayout6i1ul2ui20",Un);var An=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt){var jt=this.length;return this.resize(jt+1),this.emplace(jt,oe,_e,Ce,Oe,lt,kt)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt){var Kt=oe*6;return this.int16[Kt+0]=_e,this.int16[Kt+1]=Ce,this.int16[Kt+2]=Oe,this.int16[Kt+3]=lt,this.int16[Kt+4]=kt,this.int16[Kt+5]=jt,oe},C})(Mn);An.prototype.bytesPerElement=12,pe("StructArrayLayout2i2i2i12",An);var dn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt){var kt=this.length;return this.resize(kt+1),this.emplace(kt,oe,_e,Ce,Oe,lt)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt){var jt=oe*4,Kt=oe*8;return this.float32[jt+0]=_e,this.float32[jt+1]=Ce,this.float32[jt+2]=Oe,this.int16[Kt+6]=lt,this.int16[Kt+7]=kt,oe},C})(Mn);dn.prototype.bytesPerElement=16,pe("StructArrayLayout2f1f2i16",dn);var fn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe){var lt=this.length;return this.resize(lt+1),this.emplace(lt,oe,_e,Ce,Oe)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt){var kt=oe*12,jt=oe*3;return this.uint8[kt+0]=_e,this.uint8[kt+1]=Ce,this.float32[jt+1]=Oe,this.float32[jt+2]=lt,oe},C})(Mn);fn.prototype.bytesPerElement=12,pe("StructArrayLayout2ub2f12",fn);var Bn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,oe,_e,Ce)},C.prototype.emplace=function(oe,_e,Ce,Oe){var lt=oe*3;return this.uint16[lt+0]=_e,this.uint16[lt+1]=Ce,this.uint16[lt+2]=Oe,oe},C})(Mn);Bn.prototype.bytesPerElement=6,pe("StructArrayLayout3ui6",Bn);var ii=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn){var Vn=this.length;return this.resize(Vn+1),this.emplace(Vn,oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn,Vn){var $n=oe*24,fi=oe*12,Li=oe*48;return this.int16[$n+0]=_e,this.int16[$n+1]=Ce,this.uint16[$n+2]=Oe,this.uint16[$n+3]=lt,this.uint32[fi+2]=kt,this.uint32[fi+3]=jt,this.uint32[fi+4]=Kt,this.uint16[$n+10]=Sr,this.uint16[$n+11]=qr,this.uint16[$n+12]=Br,this.float32[fi+7]=aa,this.float32[fi+8]=ka,this.uint8[Li+36]=gn,this.uint8[Li+37]=Ya,this.uint8[Li+38]=qn,this.uint32[fi+10]=kn,this.int16[$n+22]=Vn,oe},C})(Mn);ii.prototype.bytesPerElement=48,pe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ii);var bi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn,Vn,$n,fi,Li,Ei,co,Zi,ro,ls,fo,yo){var Ls=this.length;return this.resize(Ls+1),this.emplace(Ls,oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn,Vn,$n,fi,Li,Ei,co,Zi,ro,ls,fo,yo)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt,kt,jt,Kt,Sr,qr,Br,aa,ka,gn,Ya,qn,kn,Vn,$n,fi,Li,Ei,co,Zi,ro,ls,fo,yo,Ls){var rs=oe*34,xl=oe*17;return this.int16[rs+0]=_e,this.int16[rs+1]=Ce,this.int16[rs+2]=Oe,this.int16[rs+3]=lt,this.int16[rs+4]=kt,this.int16[rs+5]=jt,this.int16[rs+6]=Kt,this.int16[rs+7]=Sr,this.uint16[rs+8]=qr,this.uint16[rs+9]=Br,this.uint16[rs+10]=aa,this.uint16[rs+11]=ka,this.uint16[rs+12]=gn,this.uint16[rs+13]=Ya,this.uint16[rs+14]=qn,this.uint16[rs+15]=kn,this.uint16[rs+16]=Vn,this.uint16[rs+17]=$n,this.uint16[rs+18]=fi,this.uint16[rs+19]=Li,this.uint16[rs+20]=Ei,this.uint16[rs+21]=co,this.uint16[rs+22]=Zi,this.uint32[xl+12]=ro,this.float32[xl+13]=ls,this.float32[xl+14]=fo,this.float32[xl+15]=yo,this.float32[xl+16]=Ls,oe},C})(Mn);bi.prototype.bytesPerElement=68,pe("StructArrayLayout8i15ui1ul4f68",bi);var Tn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe){var _e=this.length;return this.resize(_e+1),this.emplace(_e,oe)},C.prototype.emplace=function(oe,_e){var Ce=oe*1;return this.float32[Ce+0]=_e,oe},C})(Mn);Tn.prototype.bytesPerElement=4,pe("StructArrayLayout1f4",Tn);var Yn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,oe,_e,Ce)},C.prototype.emplace=function(oe,_e,Ce,Oe){var lt=oe*3;return this.int16[lt+0]=_e,this.int16[lt+1]=Ce,this.int16[lt+2]=Oe,oe},C})(Mn);Yn.prototype.bytesPerElement=6,pe("StructArrayLayout3i6",Yn);var mi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,oe,_e,Ce)},C.prototype.emplace=function(oe,_e,Ce,Oe){var lt=oe*2,kt=oe*4;return this.uint32[lt+0]=_e,this.uint16[kt+2]=Ce,this.uint16[kt+3]=Oe,oe},C})(Mn);mi.prototype.bytesPerElement=8,pe("StructArrayLayout1ul2ui8",mi);var wi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,oe,_e)},C.prototype.emplace=function(oe,_e,Ce){var Oe=oe*2;return this.uint16[Oe+0]=_e,this.uint16[Oe+1]=Ce,oe},C})(Mn);wi.prototype.bytesPerElement=4,pe("StructArrayLayout2ui4",wi);var Ri=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe){var _e=this.length;return this.resize(_e+1),this.emplace(_e,oe)},C.prototype.emplace=function(oe,_e){var Ce=oe*1;return this.uint16[Ce+0]=_e,oe},C})(Mn);Ri.prototype.bytesPerElement=2,pe("StructArrayLayout1ui2",Ri);var ps=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(oe,_e,Ce,Oe){var lt=this.length;return this.resize(lt+1),this.emplace(lt,oe,_e,Ce,Oe)},C.prototype.emplace=function(oe,_e,Ce,Oe,lt){var kt=oe*4;return this.float32[kt+0]=_e,this.float32[kt+1]=Ce,this.float32[kt+2]=Oe,this.float32[kt+3]=lt,oe},C})(Mn);ps.prototype.bytesPerElement=16,pe("StructArrayLayout4f16",ps);var Js=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return H.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},H.x1.get=function(){return this._structArray.int16[this._pos2+2]},H.y1.get=function(){return this._structArray.int16[this._pos2+3]},H.x2.get=function(){return this._structArray.int16[this._pos2+4]},H.y2.get=function(){return this._structArray.int16[this._pos2+5]},H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,H),C})(un);Js.prototype.size=20;var Qi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(oe){return new Js(this,oe)},C})(Un);pe("CollisionBoxArray",Qi);var _l=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},H.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},H.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},H.segment.get=function(){return this._structArray.uint16[this._pos2+10]},H.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},H.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},H.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},H.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},H.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},H.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},H.placedOrientation.set=function(oe){this._structArray.uint8[this._pos1+37]=oe},H.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},H.hidden.set=function(oe){this._structArray.uint8[this._pos1+38]=oe},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},H.crossTileID.set=function(oe){this._structArray.uint32[this._pos4+10]=oe},H.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,H),C})(un);_l.prototype.size=48;var Wo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(oe){return new _l(this,oe)},C})(ii);pe("PlacedSymbolArray",Wo);var tl=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},H.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},H.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},H.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},H.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},H.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},H.key.get=function(){return this._structArray.uint16[this._pos2+8]},H.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},H.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},H.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},H.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},H.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},H.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},H.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},H.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},H.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},H.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},H.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},H.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},H.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},H.crossTileID.set=function(oe){this._structArray.uint32[this._pos4+12]=oe},H.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},H.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},H.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},H.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,H),C})(un);tl.prototype.size=68;var al=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(oe){return new tl(this,oe)},C})(bi);pe("SymbolInstanceArray",al);var El=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(oe){return this.float32[oe*1+0]},C})(Tn);pe("GlyphOffsetArray",El);var ws=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(oe){return this.int16[oe*3+0]},C.prototype.gety=function(oe){return this.int16[oe*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(oe){return this.int16[oe*3+2]},C})(Yn);pe("SymbolLineVertexArray",ws);var Hs=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,H),C})(un);Hs.prototype.size=8;var $s=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(oe){return new Hs(this,oe)},C})(mi);pe("FeatureIndexArray",$s);var Di=yn([{name:"a_pos",components:2,type:"Int16"}],4),nl=Di.members,mo=function(C){C===void 0&&(C=[]),this.segments=C};mo.prototype.prepareSegment=function(C,H,oe,_e){var Ce=this.segments[this.segments.length-1];return C>mo.MAX_VERTEX_ARRAY_LENGTH&&B("Max vertices per segment is "+mo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!Ce||Ce.vertexLength+C>mo.MAX_VERTEX_ARRAY_LENGTH||Ce.sortKey!==_e)&&(Ce={vertexOffset:H.length,primitiveOffset:oe.length,vertexLength:0,primitiveLength:0},_e!==void 0&&(Ce.sortKey=_e),this.segments.push(Ce)),Ce},mo.prototype.get=function(){return this.segments},mo.prototype.destroy=function(){for(var C=0,H=this.segments;C>>16)*kt&65535)<<16)&4294967295,Kt=Kt<<15|Kt>>>17,Kt=(Kt&65535)*jt+(((Kt>>>16)*jt&65535)<<16)&4294967295,Oe^=Kt,Oe=Oe<<13|Oe>>>19,lt=(Oe&65535)*5+(((Oe>>>16)*5&65535)<<16)&4294967295,Oe=(lt&65535)+27492+(((lt>>>16)+58964&65535)<<16);switch(Kt=0,_e){case 3:Kt^=(H.charCodeAt(Sr+2)&255)<<16;case 2:Kt^=(H.charCodeAt(Sr+1)&255)<<8;case 1:Kt^=H.charCodeAt(Sr)&255,Kt=(Kt&65535)*kt+(((Kt>>>16)*kt&65535)<<16)&4294967295,Kt=Kt<<15|Kt>>>17,Kt=(Kt&65535)*jt+(((Kt>>>16)*jt&65535)<<16)&4294967295,Oe^=Kt}return Oe^=H.length,Oe^=Oe>>>16,Oe=(Oe&65535)*2246822507+(((Oe>>>16)*2246822507&65535)<<16)&4294967295,Oe^=Oe>>>13,Oe=(Oe&65535)*3266489909+(((Oe>>>16)*3266489909&65535)<<16)&4294967295,Oe^=Oe>>>16,Oe>>>0}k.exports=C}),te=t(function(k){function C(H,oe){for(var _e=H.length,Ce=oe^_e,Oe=0,lt;_e>=4;)lt=H.charCodeAt(Oe)&255|(H.charCodeAt(++Oe)&255)<<8|(H.charCodeAt(++Oe)&255)<<16|(H.charCodeAt(++Oe)&255)<<24,lt=(lt&65535)*1540483477+(((lt>>>16)*1540483477&65535)<<16),lt^=lt>>>24,lt=(lt&65535)*1540483477+(((lt>>>16)*1540483477&65535)<<16),Ce=(Ce&65535)*1540483477+(((Ce>>>16)*1540483477&65535)<<16)^lt,_e-=4,++Oe;switch(_e){case 3:Ce^=(H.charCodeAt(Oe+2)&255)<<16;case 2:Ce^=(H.charCodeAt(Oe+1)&255)<<8;case 1:Ce^=H.charCodeAt(Oe)&255,Ce=(Ce&65535)*1540483477+(((Ce>>>16)*1540483477&65535)<<16)}return Ce^=Ce>>>13,Ce=(Ce&65535)*1540483477+(((Ce>>>16)*1540483477&65535)<<16),Ce^=Ce>>>15,Ce>>>0}k.exports=C}),ge=ye,Ne=ye,Me=te;ge.murmur3=Ne,ge.murmur2=Me;var Ke=function(){this.ids=[],this.positions=[],this.indexed=!1};Ke.prototype.add=function(C,H,oe,_e){this.ids.push(Bt(C)),this.positions.push(H,oe,_e)},Ke.prototype.getPositions=function(C){for(var H=Bt(C),oe=0,_e=this.ids.length-1;oe<_e;){var Ce=oe+_e>>1;this.ids[Ce]>=H?_e=Ce:oe=Ce+1}for(var Oe=[];this.ids[oe]===H;){var lt=this.positions[3*oe],kt=this.positions[3*oe+1],jt=this.positions[3*oe+2];Oe.push({index:lt,start:kt,end:jt}),oe++}return Oe},Ke.serialize=function(C,H){var oe=new Float64Array(C.ids),_e=new Uint32Array(C.positions);return gr(oe,_e,0,oe.length-1),H&&H.push(oe.buffer,_e.buffer),{ids:oe,positions:_e}},Ke.deserialize=function(C){var H=new Ke;return H.ids=C.ids,H.positions=C.positions,H.indexed=!0,H};var ht=Math.pow(2,53)-1;function Bt(k){var C=+k;return!isNaN(C)&&C<=ht?C:ge(String(k))}function gr(k,C,H,oe){for(;H>1],Ce=H-1,Oe=oe+1;;){do Ce++;while(k[Ce]<_e);do Oe--;while(k[Oe]>_e);if(Ce>=Oe)break;Dr(k,Ce,Oe),Dr(C,3*Ce,3*Oe),Dr(C,3*Ce+1,3*Oe+1),Dr(C,3*Ce+2,3*Oe+2)}Oe-HOe.x+1||ktOe.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return H}function no(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?ei(k):[]}}function Ao(k,C,H,oe,_e){k.emplaceBack(C*2+(oe+1)/2,H*2+(_e+1)/2)}var fs=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new _a,this.indexArray=new Bn,this.segments=new mo,this.programConfigurations=new Fa(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};fs.prototype.populate=function(C,H,oe){var _e=this.layers[0],Ce=[],Oe=null;_e.type==="circle"&&(Oe=_e.layout.get("circle-sort-key"));for(var lt=0,kt=C;lt=Qa||qr<0||qr>=Qa)){var Br=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),aa=Br.vertexLength;Ao(this.layoutVertexArray,Sr,qr,-1,-1),Ao(this.layoutVertexArray,Sr,qr,1,-1),Ao(this.layoutVertexArray,Sr,qr,1,1),Ao(this.layoutVertexArray,Sr,qr,-1,1),this.indexArray.emplaceBack(aa,aa+1,aa+2),this.indexArray.emplaceBack(aa,aa+3,aa+2),Br.vertexLength+=4,Br.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,oe,{},_e)},pe("CircleBucket",fs,{omit:["layers"]});function xo(k,C){for(var H=0;H=3){for(var Ce=0;Ce<_e.length;Ce++)if(Lf(k,_e[Ce]))return!0}if(ch(k,_e,H))return!0}return!1}function ch(k,C,H){if(k.length>1){if(fh(k,C))return!0;for(var oe=0;oe1?k.distSqr(H):k.distSqr(H.sub(C)._mult(_e)._add(C))}function Eh(k,C){for(var H=!1,oe,_e,Ce,Oe=0;OeC.y!=Ce.y>C.y&&C.x<(Ce.x-_e.x)*(C.y-_e.y)/(Ce.y-_e.y)+_e.x&&(H=!H)}return H}function Lf(k,C){for(var H=!1,oe=0,_e=k.length-1;oeC.y!=Oe.y>C.y&&C.x<(Oe.x-Ce.x)*(C.y-Ce.y)/(Oe.y-Ce.y)+Ce.x&&(H=!H)}return H}function kh(k,C,H,oe,_e){for(var Ce=0,Oe=k;Ce=lt.x&&_e>=lt.y)return!0}var kt=[new i(C,H),new i(C,_e),new i(oe,_e),new i(oe,H)];if(k.length>2)for(var jt=0,Kt=kt;jt_e.x&&C.x>_e.x||k.y_e.y&&C.y>_e.y)return!1;var Ce=X(k,C,H[0]);return Ce!==X(k,C,H[1])||Ce!==X(k,C,H[2])||Ce!==X(k,C,H[3])}function Pf(k,C,H){var oe=C.paint.get(k).value;return oe.kind==="constant"?oe.value:H.programConfigurations.get(C.id).getMaxValue(k)}function hh(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function _h(k,C,H,oe,_e){if(!C[0]&&!C[1])return k;var Ce=i.convert(C)._mult(_e);H==="viewport"&&Ce._rotate(-oe);for(var Oe=[],lt=0;lt0&&(Ce=1/Math.sqrt(Ce)),k[0]=C[0]*Ce,k[1]=C[1]*Ce,k[2]=C[2]*Ce,k}function px(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function mx(k,C,H){var oe=C[0],_e=C[1],Ce=C[2],Oe=H[0],lt=H[1],kt=H[2];return k[0]=_e*kt-Ce*lt,k[1]=Ce*Oe-oe*kt,k[2]=oe*lt-_e*Oe,k}function gx(k,C,H){var oe=C[0],_e=C[1],Ce=C[2];return k[0]=oe*H[0]+_e*H[3]+Ce*H[6],k[1]=oe*H[1]+_e*H[4]+Ce*H[7],k[2]=oe*H[2]+_e*H[5]+Ce*H[8],k}var yx=wv,g5=(function(){var k=bv();return function(C,H,oe,_e,Ce,Oe){var lt,kt;for(H||(H=3),oe||(oe=0),_e?kt=Math.min(_e*H+oe,C.length):kt=C.length,lt=oe;ltk.width||_e.height>k.height||H.x>k.width-_e.width||H.y>k.height-_e.height)throw new RangeError("out of range source coordinates for image copy");if(_e.width>C.width||_e.height>C.height||oe.x>C.width-_e.width||oe.y>C.height-_e.height)throw new RangeError("out of range destination coordinates for image copy");for(var Oe=k.data,lt=C.data,kt=0;kt<_e.height;kt++)for(var jt=((H.y+kt)*k.width+H.x)*Ce,Kt=((oe.y+kt)*C.width+oe.x)*Ce,Sr=0;Sr<_e.width*Ce;Sr++)lt[Kt+Sr]=Oe[jt+Sr];return C}var ph=function(C,H){Rf(this,C,1,H)};ph.prototype.resize=function(C){Qp(this,C,1)},ph.prototype.clone=function(){return new ph({width:this.width,height:this.height},new Uint8Array(this.data))},ph.copy=function(C,H,oe,_e,Ce){e0(C,H,oe,_e,Ce,1)};var tf=function(C,H){Rf(this,C,4,H)};tf.prototype.resize=function(C){Qp(this,C,4)},tf.prototype.replace=function(C,H){H?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},tf.prototype.clone=function(){return new tf({width:this.width,height:this.height},new Uint8Array(this.data))},tf.copy=function(C,H,oe,_e,Ce){e0(C,H,oe,_e,Ce,4)},pe("AlphaImage",ph),pe("RGBAImage",tf);var ap=new la({"heatmap-radius":new Gt(zn.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Gt(zn.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new tt(zn.paint_heatmap["heatmap-intensity"]),"heatmap-color":new pa(zn.paint_heatmap["heatmap-color"]),"heatmap-opacity":new tt(zn.paint_heatmap["heatmap-opacity"])}),hd={paint:ap};function np(k){var C={},H=k.resolution||256,oe=k.clips?k.clips.length:1,_e=k.image||new tf({width:H,height:oe}),Ce=function(qn,kn,Vn){C[k.evaluationKey]=Vn;var $n=k.expression.evaluate(C);_e.data[qn+kn+0]=Math.floor($n.r*255/$n.a),_e.data[qn+kn+1]=Math.floor($n.g*255/$n.a),_e.data[qn+kn+2]=Math.floor($n.b*255/$n.a),_e.data[qn+kn+3]=Math.floor($n.a*255)};if(k.clips)for(var jt=0,Kt=0;jt80*H){lt=jt=k[0],kt=Kt=k[1];for(var aa=H;aa<_e;aa+=H)Sr=k[aa],qr=k[aa+1],Srjt&&(jt=Sr),qr>Kt&&(Kt=qr);Br=Math.max(jt-lt,Kt-kt),Br=Br!==0?1/Br:0}return ip(Ce,Oe,H,lt,kt,Br),Oe}function a0(k,C,H,oe,_e){var Ce,Oe;if(_e===_m(k,C,H,oe)>0)for(Ce=C;Ce=C;Ce-=oe)Oe=ay(Ce,k[Ce],k[Ce+1],Oe);return Oe&&sp(Oe,Oe.next)&&(cp(Oe),Oe=Oe.next),Oe}function Tv(k,C){if(!k)return k;C||(C=k);var H=k,oe;do if(oe=!1,!H.steiner&&(sp(H,H.next)||Tc(H.prev,H,H.next)===0)){if(cp(H),H=C=H.prev,H===H.next)break;oe=!0}else H=H.next;while(oe||H!==C);return C}function ip(k,C,H,oe,_e,Ce,Oe){if(k){!Oe&&Ce&&n0(k,oe,_e,Ce);for(var lt=k,kt,jt;k.prev!==k.next;){if(kt=k.prev,jt=k.next,Ce?ey(k,oe,_e,Ce):Qg(k)){C.push(kt.i/H),C.push(k.i/H),C.push(jt.i/H),cp(k),k=jt.next,lt=jt.next;continue}if(k=jt,k===lt){Oe?Oe===1?(k=op(Tv(k),C,H),ip(k,C,H,oe,_e,Ce,2)):Oe===2&&jh(k,C,H,oe,_e,Ce):ip(Tv(k),C,H,oe,_e,Ce,1);break}}}}function Qg(k){var C=k.prev,H=k,oe=k.next;if(Tc(C,H,oe)>=0)return!1;for(var _e=k.next.next;_e!==k.prev;){if(Sv(C.x,C.y,H.x,H.y,oe.x,oe.y,_e.x,_e.y)&&Tc(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function ey(k,C,H,oe){var _e=k.prev,Ce=k,Oe=k.next;if(Tc(_e,Ce,Oe)>=0)return!1;for(var lt=_e.xCe.x?_e.x>Oe.x?_e.x:Oe.x:Ce.x>Oe.x?Ce.x:Oe.x,Kt=_e.y>Ce.y?_e.y>Oe.y?_e.y:Oe.y:Ce.y>Oe.y?Ce.y:Oe.y,Sr=pm(lt,kt,C,H,oe),qr=pm(jt,Kt,C,H,oe),Br=k.prevZ,aa=k.nextZ;Br&&Br.z>=Sr&&aa&&aa.z<=qr;){if(Br!==k.prev&&Br!==k.next&&Sv(_e.x,_e.y,Ce.x,Ce.y,Oe.x,Oe.y,Br.x,Br.y)&&Tc(Br.prev,Br,Br.next)>=0||(Br=Br.prevZ,aa!==k.prev&&aa!==k.next&&Sv(_e.x,_e.y,Ce.x,Ce.y,Oe.x,Oe.y,aa.x,aa.y)&&Tc(aa.prev,aa,aa.next)>=0))return!1;aa=aa.nextZ}for(;Br&&Br.z>=Sr;){if(Br!==k.prev&&Br!==k.next&&Sv(_e.x,_e.y,Ce.x,Ce.y,Oe.x,Oe.y,Br.x,Br.y)&&Tc(Br.prev,Br,Br.next)>=0)return!1;Br=Br.prevZ}for(;aa&&aa.z<=qr;){if(aa!==k.prev&&aa!==k.next&&Sv(_e.x,_e.y,Ce.x,Ce.y,Oe.x,Oe.y,aa.x,aa.y)&&Tc(aa.prev,aa,aa.next)>=0)return!1;aa=aa.nextZ}return!0}function op(k,C,H){var oe=k;do{var _e=oe.prev,Ce=oe.next.next;!sp(_e,Ce)&&i0(_e,oe,oe.next,Ce)&&up(_e,Ce)&&up(Ce,_e)&&(C.push(_e.i/H),C.push(oe.i/H),C.push(Ce.i/H),cp(oe),cp(oe.next),oe=k=Ce),oe=oe.next}while(oe!==k);return Tv(oe)}function jh(k,C,H,oe,_e,Ce){var Oe=k;do{for(var lt=Oe.next.next;lt!==Oe.prev;){if(Oe.i!==lt.i&&dd(Oe,lt)){var kt=gm(Oe,lt);Oe=Tv(Oe,Oe.next),kt=Tv(kt,kt.next),ip(Oe,C,H,oe,_e,Ce),ip(kt,C,H,oe,_e,Ce);return}lt=lt.next}Oe=Oe.next}while(Oe!==k)}function Av(k,C,H,oe){var _e=[],Ce,Oe,lt,kt,jt;for(Ce=0,Oe=C.length;Ce=H.next.y&&H.next.y!==H.y){var lt=H.x+(_e-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(lt<=oe&<>Ce){if(Ce=lt,lt===oe){if(_e===H.y)return H;if(_e===H.next.y)return H.next}Oe=H.x=H.x&&H.x>=jt&&oe!==H.x&&Sv(_eOe.x||H.x===Oe.x&&Ex(Oe,H)))&&(Oe=H,Sr=qr)),H=H.next;while(H!==kt);return Oe}function Ex(k,C){return Tc(k.prev,k,C.prev)<0&&Tc(C.next,k,k.next)<0}function n0(k,C,H,oe){var _e=k;do _e.z===null&&(_e.z=pm(_e.x,_e.y,C,H,oe)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==k);_e.prevZ.nextZ=null,_e.prevZ=null,dm(_e)}function dm(k){var C,H,oe,_e,Ce,Oe,lt,kt,jt=1;do{for(H=k,k=null,Ce=null,Oe=0;H;){for(Oe++,oe=H,lt=0,C=0;C0||kt>0&&oe;)lt!==0&&(kt===0||!oe||H.z<=oe.z)?(_e=H,H=H.nextZ,lt--):(_e=oe,oe=oe.nextZ,kt--),Ce?Ce.nextZ=_e:k=_e,_e.prevZ=Ce,Ce=_e;H=oe}Ce.nextZ=null,jt*=2}while(Oe>1);return k}function pm(k,C,H,oe,_e){return k=32767*(k-H)*_e,C=32767*(C-oe)*_e,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function mm(k){var C=k,H=k;do(C.x=0&&(k-Oe)*(oe-lt)-(H-Oe)*(C-lt)>=0&&(H-Oe)*(Ce-lt)-(_e-Oe)*(oe-lt)>=0}function dd(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!ry(k,C)&&(up(k,C)&&up(C,k)&&kx(k,C)&&(Tc(k.prev,k,C.prev)||Tc(k,C.prev,C))||sp(k,C)&&Tc(k.prev,k,k.next)>0&&Tc(C.prev,C,C.next)>0)}function Tc(k,C,H){return(C.y-k.y)*(H.x-C.x)-(C.x-k.x)*(H.y-C.y)}function sp(k,C){return k.x===C.x&&k.y===C.y}function i0(k,C,H,oe){var _e=Gv(Tc(k,C,H)),Ce=Gv(Tc(k,C,oe)),Oe=Gv(Tc(H,oe,k)),lt=Gv(Tc(H,oe,C));return!!(_e!==Ce&&Oe!==lt||_e===0&&lp(k,H,C)||Ce===0&&lp(k,oe,C)||Oe===0&&lp(H,k,oe)||lt===0&&lp(H,C,oe))}function lp(k,C,H){return C.x<=Math.max(k.x,H.x)&&C.x>=Math.min(k.x,H.x)&&C.y<=Math.max(k.y,H.y)&&C.y>=Math.min(k.y,H.y)}function Gv(k){return k>0?1:k<0?-1:0}function ry(k,C){var H=k;do{if(H.i!==k.i&&H.next.i!==k.i&&H.i!==C.i&&H.next.i!==C.i&&i0(H,H.next,k,C))return!0;H=H.next}while(H!==k);return!1}function up(k,C){return Tc(k.prev,k,k.next)<0?Tc(k,C,k.next)>=0&&Tc(k,k.prev,C)>=0:Tc(k,C,k.prev)<0||Tc(k,k.next,C)<0}function kx(k,C){var H=k,oe=!1,_e=(k.x+C.x)/2,Ce=(k.y+C.y)/2;do H.y>Ce!=H.next.y>Ce&&H.next.y!==H.y&&_e<(H.next.x-H.x)*(Ce-H.y)/(H.next.y-H.y)+H.x&&(oe=!oe),H=H.next;while(H!==k);return oe}function gm(k,C){var H=new ym(k.i,k.x,k.y),oe=new ym(C.i,C.x,C.y),_e=k.next,Ce=C.prev;return k.next=C,C.prev=k,H.next=_e,_e.prev=H,oe.next=H,H.prev=oe,Ce.next=oe,oe.prev=Ce,oe}function ay(k,C,H,oe){var _e=new ym(k,C,H);return oe?(_e.next=oe.next,_e.prev=oe,oe.next.prev=_e,oe.next=_e):(_e.prev=_e,_e.next=_e),_e}function cp(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function ym(k,C,H){this.i=k,this.x=C,this.y=H,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}vd.deviation=function(k,C,H,oe){var _e=C&&C.length,Ce=_e?C[0]*H:k.length,Oe=Math.abs(_m(k,0,Ce,H));if(_e)for(var lt=0,kt=C.length;lt0&&(oe+=k[_e-1].length,H.holes.push(oe))}return H},r0.default=$g;function xm(k,C,H,oe,_e){nv(k,C,H||0,oe||k.length-1,_e||ny)}function nv(k,C,H,oe,_e){for(;oe>H;){if(oe-H>600){var Ce=oe-H+1,Oe=C-H+1,lt=Math.log(Ce),kt=.5*Math.exp(2*lt/3),jt=.5*Math.sqrt(lt*kt*(Ce-kt)/Ce)*(Oe-Ce/2<0?-1:1),Kt=Math.max(H,Math.floor(C-Oe*kt/Ce+jt)),Sr=Math.min(oe,Math.floor(C+(Ce-Oe)*kt/Ce+jt));nv(k,C,Kt,Sr,_e)}var qr=k[C],Br=H,aa=oe;for(pd(k,H,C),_e(k[oe],qr)>0&&pd(k,H,oe);Br0;)aa--}_e(k[H],qr)===0?pd(k,H,aa):(aa++,pd(k,aa,oe)),aa<=C&&(H=aa+1),C<=aa&&(oe=aa-1)}}function pd(k,C,H){var oe=k[C];k[C]=k[H],k[H]=oe}function ny(k,C){return kC?1:0}function o0(k,C){var H=k.length;if(H<=1)return[k];for(var oe=[],_e,Ce,Oe=0;Oe1)for(var kt=0;kt>3}if(oe--,H===1||H===2)_e+=k.readSVarint(),Ce+=k.readSVarint(),H===1&&(lt&&Oe.push(lt),lt=[]),lt.push(new i(_e,Ce));else if(H===7)lt&<.push(lt[0].clone());else throw new Error("unknown command "+H)}return lt&&Oe.push(lt),Oe},Hv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,H=1,oe=0,_e=0,Ce=0,Oe=1/0,lt=-1/0,kt=1/0,jt=-1/0;k.pos>3}if(oe--,H===1||H===2)_e+=k.readSVarint(),Ce+=k.readSVarint(),_elt&&(lt=_e),Cejt&&(jt=Ce);else if(H!==7)throw new Error("unknown command "+H)}return[Oe,kt,lt,jt]},Hv.prototype.toGeoJSON=function(k,C,H){var oe=this.extent*Math.pow(2,H),_e=this.extent*k,Ce=this.extent*C,Oe=this.loadGeometry(),lt=Hv.types[this.type],kt,jt;function Kt(Br){for(var aa=0;aa>3;C=oe===1?k.readString():oe===2?k.readFloat():oe===3?k.readDouble():oe===4?k.readVarint64():oe===5?k.readVarint():oe===6?k.readSVarint():oe===7?k.readBoolean():null}return C}Tm.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new wm(this._pbf,C,this.extent,this._keys,this._values)};var dy=Lx;function Lx(k,C){this.layers=k.readFields(Px,{},C)}function Px(k,C,H){if(k===3){var oe=new iv(H,H.readVarint()+H.pos);oe.length&&(C[oe.name]=oe)}}var py=dy,md=wm,my=iv,ov={VectorTile:py,VectorTileFeature:md,VectorTileLayer:my},gy=ov.VectorTileFeature.types,l0=500,gd=Math.pow(2,13);function Mv(k,C,H,oe,_e,Ce,Oe,lt){k.emplaceBack(C,H,Math.floor(oe*gd)*2+Oe,_e*gd*2,Ce*gd*2,Math.round(lt))}var Dh=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new nn,this.indexArray=new Bn,this.programConfigurations=new Fa(C.layers,C.zoom),this.segments=new mo,this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};Dh.prototype.populate=function(C,H,oe){this.features=[],this.hasPattern=s0("fill-extrusion",this.layers,H);for(var _e=0,Ce=C;_e=1){var Vn=gn[qn-1];if(!Ix(kn,Vn)){Br.vertexLength+4>mo.MAX_VERTEX_ARRAY_LENGTH&&(Br=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var $n=kn.sub(Vn)._perp()._unit(),fi=Vn.dist(kn);Ya+fi>32768&&(Ya=0),Mv(this.layoutVertexArray,kn.x,kn.y,$n.x,$n.y,0,0,Ya),Mv(this.layoutVertexArray,kn.x,kn.y,$n.x,$n.y,0,1,Ya),Ya+=fi,Mv(this.layoutVertexArray,Vn.x,Vn.y,$n.x,$n.y,0,0,Ya),Mv(this.layoutVertexArray,Vn.x,Vn.y,$n.x,$n.y,0,1,Ya);var Li=Br.vertexLength;this.indexArray.emplaceBack(Li,Li+2,Li+1),this.indexArray.emplaceBack(Li+1,Li+2,Li+3),Br.vertexLength+=4,Br.primitiveLength+=2}}}}if(Br.vertexLength+jt>mo.MAX_VERTEX_ARRAY_LENGTH&&(Br=this.segments.prepareSegment(jt,this.layoutVertexArray,this.indexArray)),gy[C.type]==="Polygon"){for(var Ei=[],co=[],Zi=Br.vertexLength,ro=0,ls=kt;roQa)||k.y===C.y&&(k.y<0||k.y>Qa)}function Rx(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>Qa})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>Qa})}var yd=new la({"fill-extrusion-opacity":new tt(zn["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Gt(zn["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new tt(zn["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new tt(zn["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new or(zn["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Gt(zn["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Gt(zn["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new tt(zn["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),Af={paint:yd},Ev=(function(k){function C(H){k.call(this,H,Af)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(oe){return new Dh(oe)},C.prototype.queryRadius=function(){return hh(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(oe,_e,Ce,Oe,lt,kt,jt,Kt){var Sr=_h(oe,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),kt.angle,jt),qr=this.paint.get("fill-extrusion-height").evaluate(_e,Ce),Br=this.paint.get("fill-extrusion-base").evaluate(_e,Ce),aa=Dx(Sr,Kt,kt,0),ka=Sm(Oe,Br,qr,Kt),gn=ka[0],Ya=ka[1];return yy(gn,Ya,aa)},C})(ja);function Wv(k,C){return k.x*C.x+k.y*C.y}function Am(k,C){if(k.length===1){for(var H=0,oe=C[H++],_e;!_e||oe.equals(_e);)if(_e=C[H++],!_e)return 1/0;for(;H=2&&C[jt-1].equals(C[jt-2]);)jt--;for(var Kt=0;Kt0;if(Ei&&qn>Kt){var Zi=Br.dist(aa);if(Zi>2*Sr){var ro=Br.sub(Br.sub(aa)._mult(Sr/Zi)._round());this.updateDistance(aa,ro),this.addCurrentVertex(ro,gn,0,0,qr),aa=ro}}var ls=aa&&ka,fo=ls?oe:kt?"butt":_e;if(ls&&fo==="round"&&(fiCe&&(fo="bevel"),fo==="bevel"&&(fi>2&&(fo="flipbevel"),fi100)kn=Ya.mult(-1);else{var yo=fi*gn.add(Ya).mag()/gn.sub(Ya).mag();kn._perp()._mult(yo*(co?-1:1))}this.addCurrentVertex(Br,kn,0,0,qr),this.addCurrentVertex(Br,kn.mult(-1),0,0,qr)}else if(fo==="bevel"||fo==="fakeround"){var Ls=-Math.sqrt(fi*fi-1),rs=co?Ls:0,xl=co?0:Ls;if(aa&&this.addCurrentVertex(Br,gn,rs,xl,qr),fo==="fakeround")for(var nu=Math.round(Li*180/Math.PI/Em),bl=1;bl2*Sr){var Kc=Br.add(ka.sub(Br)._mult(Sr/gf)._round());this.updateDistance(Br,Kc),this.addCurrentVertex(Kc,Ya,0,0,qr),Br=Kc}}}}},Xc.prototype.addCurrentVertex=function(C,H,oe,_e,Ce,Oe){Oe===void 0&&(Oe=!1);var lt=H.x+H.y*oe,kt=H.y-H.x*oe,jt=-H.x+H.y*_e,Kt=-H.y-H.x*_e;this.addHalfVertex(C,lt,kt,Oe,!1,oe,Ce),this.addHalfVertex(C,jt,Kt,Oe,!0,-_e,Ce),this.distance>pp/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,H,oe,_e,Ce,Oe))},Xc.prototype.addHalfVertex=function(C,H,oe,_e,Ce,Oe,lt){var kt=C.x,jt=C.y,Kt=this.lineClips?this.scaledDistance*(pp-1):this.scaledDistance,Sr=Kt*c0;if(this.layoutVertexArray.emplaceBack((kt<<1)+(_e?1:0),(jt<<1)+(Ce?1:0),Math.round(u0*H)+128,Math.round(u0*oe)+128,(Oe===0?0:Oe<0?-1:1)+1|(Sr&63)<<2,Sr>>6),this.lineClips){var qr=this.scaledDistance-this.lineClips.start,Br=this.lineClips.end-this.lineClips.start,aa=qr/Br;this.layoutVertexArray2.emplaceBack(aa,this.lineClipsArray.length)}var ka=lt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ka),lt.primitiveLength++),Ce?this.e2=ka:this.e1=ka},Xc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Xc.prototype.updateDistance=function(C,H){this.distance+=C.dist(H),this.updateScaledDistance()},pe("LineBucket",Xc,{omit:["layers","patternFeatures"]});var km=new la({"line-cap":new tt(zn.layout_line["line-cap"]),"line-join":new Gt(zn.layout_line["line-join"]),"line-miter-limit":new tt(zn.layout_line["line-miter-limit"]),"line-round-limit":new tt(zn.layout_line["line-round-limit"]),"line-sort-key":new Gt(zn.layout_line["line-sort-key"])}),Cm=new la({"line-opacity":new Gt(zn.paint_line["line-opacity"]),"line-color":new Gt(zn.paint_line["line-color"]),"line-translate":new tt(zn.paint_line["line-translate"]),"line-translate-anchor":new tt(zn.paint_line["line-translate-anchor"]),"line-width":new Gt(zn.paint_line["line-width"]),"line-gap-width":new Gt(zn.paint_line["line-gap-width"]),"line-offset":new Gt(zn.paint_line["line-offset"]),"line-blur":new Gt(zn.paint_line["line-blur"]),"line-dasharray":new ea(zn.paint_line["line-dasharray"]),"line-pattern":new or(zn.paint_line["line-pattern"]),"line-gradient":new pa(zn.paint_line["line-gradient"])}),f0={paint:Cm,layout:km},Fx=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(oe,_e){return _e=new oi(Math.floor(_e.zoom),{now:_e.now,fadeDuration:_e.fadeDuration,zoomHistory:_e.zoomHistory,transition:_e.transition}),k.prototype.possiblyEvaluate.call(this,oe,_e)},C.prototype.evaluate=function(oe,_e,Ce,Oe){return _e=g({},_e,{zoom:Math.floor(_e.zoom)}),k.prototype.evaluate.call(this,oe,_e,Ce,Oe)},C})(Gt),W=new Fx(f0.paint.properties["line-width"].specification);W.useIntegerZoom=!0;var D=(function(k){function C(H){k.call(this,H,f0),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(oe){if(oe==="line-gradient"){var _e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=_e._styleExpression.expression instanceof Xl,this.gradientVersion=(this.gradientVersion+1)%f}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(oe,_e){k.prototype.recalculate.call(this,oe,_e),this.paint._values["line-floorwidth"]=W.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,oe)},C.prototype.createBucket=function(oe){return new Xc(oe)},C.prototype.queryRadius=function(oe){var _e=oe,Ce=J(Pf("line-width",this,_e),Pf("line-gap-width",this,_e)),Oe=Pf("line-offset",this,_e);return Ce/2+Math.abs(Oe)+hh(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(oe,_e,Ce,Oe,lt,kt,jt){var Kt=_h(oe,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),kt.angle,jt),Sr=jt/2*J(this.paint.get("line-width").evaluate(_e,Ce),this.paint.get("line-gap-width").evaluate(_e,Ce)),qr=this.paint.get("line-offset").evaluate(_e,Ce);return qr&&(Oe=de(Oe,qr*jt)),Vl(Kt,Oe,Sr)},C.prototype.isTileClipped=function(){return!0},C})(ja);function J(k,C){return C>0?C+2*k:k}function de(k,C){for(var H=[],oe=new i(0,0),_e=0;_e":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Rn(k){for(var C="",H=0;H>1,Kt=-7,Sr=H?_e-1:0,qr=H?-1:1,Br=k[C+Sr];for(Sr+=qr,Ce=Br&(1<<-Kt)-1,Br>>=-Kt,Kt+=lt;Kt>0;Ce=Ce*256+k[C+Sr],Sr+=qr,Kt-=8);for(Oe=Ce&(1<<-Kt)-1,Ce>>=-Kt,Kt+=oe;Kt>0;Oe=Oe*256+k[C+Sr],Sr+=qr,Kt-=8);if(Ce===0)Ce=1-jt;else{if(Ce===kt)return Oe?NaN:(Br?-1:1)*(1/0);Oe=Oe+Math.pow(2,oe),Ce=Ce-jt}return(Br?-1:1)*Oe*Math.pow(2,Ce-oe)},ho=function(k,C,H,oe,_e,Ce){var Oe,lt,kt,jt=Ce*8-_e-1,Kt=(1<>1,qr=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,Br=oe?0:Ce-1,aa=oe?1:-1,ka=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(lt=isNaN(C)?1:0,Oe=Kt):(Oe=Math.floor(Math.log(C)/Math.LN2),C*(kt=Math.pow(2,-Oe))<1&&(Oe--,kt*=2),Oe+Sr>=1?C+=qr/kt:C+=qr*Math.pow(2,1-Sr),C*kt>=2&&(Oe++,kt/=2),Oe+Sr>=Kt?(lt=0,Oe=Kt):Oe+Sr>=1?(lt=(C*kt-1)*Math.pow(2,_e),Oe=Oe+Sr):(lt=C*Math.pow(2,Sr-1)*Math.pow(2,_e),Oe=0));_e>=8;k[H+Br]=lt&255,Br+=aa,lt/=256,_e-=8);for(Oe=Oe<<_e|lt,jt+=_e;jt>0;k[H+Br]=Oe&255,Br+=aa,Oe/=256,jt-=8);k[H+Br-aa]|=ka*128},Jo={read:Ci,write:ho},to=Ti;function Ti(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Ti.Varint=0,Ti.Fixed64=1,Ti.Bytes=2,Ti.Fixed32=5;var Oo=65536*65536,So=1/Oo,wo=12,ci=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Ti.prototype={destroy:function(){this.buf=null},readFields:function(k,C,H){for(H=H||this.length;this.pos>3,Ce=this.pos;this.type=oe&7,k(_e,C,this),this.pos===Ce&&this.skip(oe)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=df(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=mh(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=df(this.buf,this.pos)+df(this.buf,this.pos+4)*Oo;return this.pos+=8,k},readSFixed64:function(){var k=df(this.buf,this.pos)+mh(this.buf,this.pos+4)*Oo;return this.pos+=8,k},readFloat:function(){var k=Jo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=Jo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,H,oe;return oe=C[this.pos++],H=oe&127,oe<128||(oe=C[this.pos++],H|=(oe&127)<<7,oe<128)||(oe=C[this.pos++],H|=(oe&127)<<14,oe<128)||(oe=C[this.pos++],H|=(oe&127)<<21,oe<128)?H:(oe=C[this.pos],H|=(oe&15)<<28,qo(H,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=wo&&ci?Bl(this.buf,C,k):$f(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Ti.Bytes)return k.push(this.readVarint(C));var H=To(this);for(k=k||[];this.pos127;);else if(C===Ti.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Ti.Fixed32)this.pos+=4;else if(C===Ti.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){yu(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=Pu(this.buf,k,this.pos);var H=this.pos-C;H>=128&&bh(C,H,this),this.pos=C-1,this.writeVarint(H),this.pos+=H},writeFloat:function(k){this.realloc(4),Jo.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),Jo.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var H=0;H=128&&bh(H,oe,this),this.pos=H-1,this.writeVarint(oe),this.pos+=oe},writeMessage:function(k,C,H){this.writeTag(k,Ti.Bytes),this.writeRawMessage(C,H)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,Sf,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,af,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Wf,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Gf,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Hf,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Ac,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,nf,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Df,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Mf,C)},writeBytesField:function(k,C){this.writeTag(k,Ti.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Ti.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Ti.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Ti.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Ti.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Ti.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function qo(k,C,H){var oe=H.buf,_e,Ce;if(Ce=oe[H.pos++],_e=(Ce&112)>>4,Ce<128||(Ce=oe[H.pos++],_e|=(Ce&127)<<3,Ce<128)||(Ce=oe[H.pos++],_e|=(Ce&127)<<10,Ce<128)||(Ce=oe[H.pos++],_e|=(Ce&127)<<17,Ce<128)||(Ce=oe[H.pos++],_e|=(Ce&127)<<24,Ce<128)||(Ce=oe[H.pos++],_e|=(Ce&1)<<31,Ce<128))return cs(k,_e,C);throw new Error("Expected varint not more than 10 bytes")}function To(k){return k.type===Ti.Bytes?k.readVarint()+k.pos:k.pos+1}function cs(k,C,H){return H?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function yu(k,C){var H,oe;if(k>=0?(H=k%4294967296|0,oe=k/4294967296|0):(H=~(-k%4294967296),oe=~(-k/4294967296),H^4294967295?H=H+1|0:(H=0,oe=oe+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),uu(H,oe,C),rf(oe,C)}function uu(k,C,H){H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos]=k&127}function rf(k,C){var H=(k&7)<<4;C.buf[C.pos++]|=H|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function bh(k,C,H){var oe=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));H.realloc(oe);for(var _e=H.pos-1;_e>=k;_e--)H.buf[_e+oe]=H.buf[_e]}function Sf(k,C){for(var H=0;H>>8,k[H+2]=C>>>16,k[H+3]=C>>>24}function mh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function $f(k,C,H){for(var oe="",_e=C;_e239?4:Ce>223?3:Ce>191?2:1;if(_e+lt>H)break;var kt,jt,Kt;lt===1?Ce<128&&(Oe=Ce):lt===2?(kt=k[_e+1],(kt&192)===128&&(Oe=(Ce&31)<<6|kt&63,Oe<=127&&(Oe=null))):lt===3?(kt=k[_e+1],jt=k[_e+2],(kt&192)===128&&(jt&192)===128&&(Oe=(Ce&15)<<12|(kt&63)<<6|jt&63,(Oe<=2047||Oe>=55296&&Oe<=57343)&&(Oe=null))):lt===4&&(kt=k[_e+1],jt=k[_e+2],Kt=k[_e+3],(kt&192)===128&&(jt&192)===128&&(Kt&192)===128&&(Oe=(Ce&15)<<18|(kt&63)<<12|(jt&63)<<6|Kt&63,(Oe<=65535||Oe>=1114112)&&(Oe=null))),Oe===null?(Oe=65533,lt=1):Oe>65535&&(Oe-=65536,oe+=String.fromCharCode(Oe>>>10&1023|55296),Oe=56320|Oe&1023),oe+=String.fromCharCode(Oe),_e+=lt}return oe}function Bl(k,C,H){return ci.decode(k.subarray(C,H))}function Pu(k,C,H){for(var oe=0,_e,Ce;oe55295&&_e<57344)if(Ce)if(_e<56320){k[H++]=239,k[H++]=191,k[H++]=189,Ce=_e;continue}else _e=Ce-55296<<10|_e-56320|65536,Ce=null;else{_e>56319||oe+1===C.length?(k[H++]=239,k[H++]=191,k[H++]=189):Ce=_e;continue}else Ce&&(k[H++]=239,k[H++]=191,k[H++]=189,Ce=null);_e<128?k[H++]=_e:(_e<2048?k[H++]=_e>>6|192:(_e<65536?k[H++]=_e>>12|224:(k[H++]=_e>>18|240,k[H++]=_e>>12&63|128),k[H++]=_e>>6&63|128),k[H++]=_e&63|128)}return H}var _u=3;function gh(k,C,H){k===1&&H.readMessage(vc,C)}function vc(k,C,H){if(k===3){var oe=H.readMessage(_d,{}),_e=oe.id,Ce=oe.bitmap,Oe=oe.width,lt=oe.height,kt=oe.left,jt=oe.top,Kt=oe.advance;C.push({id:_e,bitmap:new ph({width:Oe+2*_u,height:lt+2*_u},Ce),metrics:{width:Oe,height:lt,left:kt,top:jt,advance:Kt}})}}function _d(k,C,H){k===1?C.id=H.readVarint():k===2?C.bitmap=H.readBytes():k===3?C.width=H.readVarint():k===4?C.height=H.readVarint():k===5?C.left=H.readSVarint():k===6?C.top=H.readSVarint():k===7&&(C.advance=H.readVarint())}function Vh(k){return new to(k).readFields(gh,[])}var zh=_u;function wh(k){for(var C=0,H=0,oe=0,_e=k;oe<_e.length;oe+=1){var Ce=_e[oe];C+=Ce.w*Ce.h,H=Math.max(H,Ce.w)}k.sort(function(gn,Ya){return Ya.h-gn.h});for(var Oe=Math.max(Math.ceil(Math.sqrt(C/.95)),H),lt=[{x:0,y:0,w:Oe,h:1/0}],kt=0,jt=0,Kt=0,Sr=k;Kt=0;Br--){var aa=lt[Br];if(!(qr.w>aa.w||qr.h>aa.h)){if(qr.x=aa.x,qr.y=aa.y,jt=Math.max(jt,qr.y+qr.h),kt=Math.max(kt,qr.x+qr.w),qr.w===aa.w&&qr.h===aa.h){var ka=lt.pop();Br=0&&_e>=C&&Gh[this.text.charCodeAt(_e)];_e--)oe--;this.text=this.text.substring(C,oe),this.sectionIndex=this.sectionIndex.slice(C,oe)},pf.prototype.substring=function(C,H){var oe=new pf;return oe.text=this.text.substring(C,H),oe.sectionIndex=this.sectionIndex.slice(C,H),oe.sections=this.sections,oe},pf.prototype.toString=function(){return this.text},pf.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(H,oe){return Math.max(H,C.sections[oe].scale)},0)},pf.prototype.addTextSection=function(C,H){this.text+=C.text,this.sections.push(Xv.forText(C.scale,C.fontStack||H));for(var oe=this.sections.length-1,_e=0;_e=qh?null:++this.imageSectionID:(this.imageSectionID=h0,this.imageSectionID)};function Ox(k,C){for(var H=[],oe=k.text,_e=0,Ce=0,Oe=C;Ce=0,Kt=0,Sr=0;Sr0&&Kc>co&&(co=Kc)}else{var wl=H[ro.fontStack],cl=wl&&wl[fo];if(cl&&cl.rect)rs=cl.rect,Ls=cl.metrics;else{var xu=C[ro.fontStack],Iu=xu&&xu[fo];if(!Iu)continue;Ls=Iu.metrics}yo=($n-ro.scale)*Hn}bl?(k.verticalizable=!0,Ei.push({glyph:fo,imageName:xl,x:qr,y:Br+yo,vertical:bl,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:ls,metrics:Ls,rect:rs}),qr+=nu*ro.scale+jt):(Ei.push({glyph:fo,imageName:xl,x:qr,y:Br+yo,vertical:bl,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:ls,metrics:Ls,rect:rs}),qr+=Ls.advance*ro.scale+jt)}if(Ei.length!==0){var Zf=qr-jt;aa=Math.max(Zf,aa),jx(Ei,0,Ei.length-1,gn,co)}qr=0;var Yf=Ce*$n+co;Li.lineOffset=Math.max(co,fi),Br+=Yf,ka=Math.max(Yf,ka),++Ya}var yf=Br-xd,th=Pm(Oe),rh=th.horizontalAlign,of=th.verticalAlign;zf(k.positionedLines,gn,rh,of,aa,ka,Ce,yf,_e.length),k.top+=-of*yf,k.bottom=k.top+yf,k.left+=-rh*aa,k.right=k.left+aa}function jx(k,C,H,oe,_e){if(!(!oe&&!_e))for(var Ce=k[H],Oe=Ce.metrics.advance*Ce.scale,lt=(k[H].x+Oe)*oe,kt=C;kt<=H;kt++)k[kt].x-=lt,k[kt].y+=_e}function zf(k,C,H,oe,_e,Ce,Oe,lt,kt){var jt=(C-H)*_e,Kt=0;Ce!==Oe?Kt=-lt*oe-xd:Kt=(-oe*kt+.5)*Oe;for(var Sr=0,qr=k;Sr-H/2;){if(Oe--,Oe<0)return!1;lt-=k[Oe].dist(Ce),Ce=k[Oe]}lt+=k[Oe].dist(k[Oe+1]),Oe++;for(var kt=[],jt=0;ltoe;)jt-=kt.shift().angleDelta;if(jt>_e)return!1;Oe++,lt+=Sr.dist(qr)}return!0}function w5(k){for(var C=0,H=0;Hjt){var aa=(jt-kt)/Br,ka=rl(Sr.x,qr.x,aa),gn=rl(Sr.y,qr.y,aa),Ya=new Xf(ka,gn,qr.angleTo(Sr),Kt);return Ya._round(),!Oe||b5(k,Ya,lt,Oe,C)?Ya:void 0}kt+=Br}}function cD(k,C,H,oe,_e,Ce,Oe,lt,kt){var jt=T5(oe,Ce,Oe),Kt=A5(oe,_e),Sr=Kt*Oe,qr=k[0].x===0||k[0].x===kt||k[0].y===0||k[0].y===kt;C-Sr=0&&Vn=0&&$n=0&&qr+jt<=Kt){var fi=new Xf(Vn,$n,qn,aa);fi._round(),(!oe||b5(k,fi,Ce,oe,_e))&&Br.push(fi)}}Sr+=Ya}return!lt&&!Br.length&&!Oe&&(Br=S5(k,Sr/2,H,oe,_e,Ce,Oe,!0,kt)),Br}function M5(k,C,H,oe,_e){for(var Ce=[],Oe=0;Oe=oe&&Sr.x>=oe)&&(Kt.x>=oe?Kt=new i(oe,Kt.y+(Sr.y-Kt.y)*((oe-Kt.x)/(Sr.x-Kt.x)))._round():Sr.x>=oe&&(Sr=new i(oe,Kt.y+(Sr.y-Kt.y)*((oe-Kt.x)/(Sr.x-Kt.x)))._round()),!(Kt.y>=_e&&Sr.y>=_e)&&(Kt.y>=_e?Kt=new i(Kt.x+(Sr.x-Kt.x)*((_e-Kt.y)/(Sr.y-Kt.y)),_e)._round():Sr.y>=_e&&(Sr=new i(Kt.x+(Sr.x-Kt.x)*((_e-Kt.y)/(Sr.y-Kt.y)),_e)._round()),(!kt||!Kt.equals(kt[kt.length-1]))&&(kt=[Kt],Ce.push(kt)),kt.push(Sr)))))}return Ce}var p0=ec;function E5(k,C,H,oe){var _e=[],Ce=k.image,Oe=Ce.pixelRatio,lt=Ce.paddedRect.w-2*p0,kt=Ce.paddedRect.h-2*p0,jt=k.right-k.left,Kt=k.bottom-k.top,Sr=Ce.stretchX||[[0,lt]],qr=Ce.stretchY||[[0,kt]],Br=function(wl,cl){return wl+cl[1]-cl[0]},aa=Sr.reduce(Br,0),ka=qr.reduce(Br,0),gn=lt-aa,Ya=kt-ka,qn=0,kn=aa,Vn=0,$n=ka,fi=0,Li=gn,Ei=0,co=Ya;if(Ce.content&&oe){var Zi=Ce.content;qn=My(Sr,0,Zi[0]),Vn=My(qr,0,Zi[1]),kn=My(Sr,Zi[0],Zi[2]),$n=My(qr,Zi[1],Zi[3]),fi=Zi[0]-qn,Ei=Zi[1]-Vn,Li=Zi[2]-Zi[0]-kn,co=Zi[3]-Zi[1]-$n}var ro=function(wl,cl,xu,Iu){var Sc=Ey(wl.stretch-qn,kn,jt,k.left),Lc=ky(wl.fixed-fi,Li,wl.stretch,aa),gf=Ey(cl.stretch-Vn,$n,Kt,k.top),Kc=ky(cl.fixed-Ei,co,cl.stretch,ka),Zf=Ey(xu.stretch-qn,kn,jt,k.left),Yf=ky(xu.fixed-fi,Li,xu.stretch,aa),yf=Ey(Iu.stretch-Vn,$n,Kt,k.top),th=ky(Iu.fixed-Ei,co,Iu.stretch,ka),rh=new i(Sc,gf),of=new i(Zf,gf),ah=new i(Zf,yf),Ih=new i(Sc,yf),Kv=new i(Lc/Oe,Kc/Oe),Td=new i(Yf/Oe,th/Oe),Ad=C*Math.PI/180;if(Ad){var Sd=Math.sin(Ad),T0=Math.cos(Ad),Hh=[T0,-Sd,Sd,T0];rh._matMult(Hh),of._matMult(Hh),Ih._matMult(Hh),ah._matMult(Hh)}var Dy=wl.stretch+wl.fixed,Yx=xu.stretch+xu.fixed,zy=cl.stretch+cl.fixed,Kx=Iu.stretch+Iu.fixed,Fh={x:Ce.paddedRect.x+p0+Dy,y:Ce.paddedRect.y+p0+zy,w:Yx-Dy,h:Kx-zy},A0=Li/Oe/jt,Fy=co/Oe/Kt;return{tl:rh,tr:of,bl:Ih,br:ah,tex:Fh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Kv,pixelOffsetBR:Td,minFontScaleX:A0,minFontScaleY:Fy,isSDF:H}};if(!oe||!Ce.stretchX&&!Ce.stretchY)_e.push(ro({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:lt+1},{fixed:0,stretch:kt+1}));else for(var ls=k5(Sr,gn,aa),fo=k5(qr,Ya,ka),yo=0;yo0&&(aa=Math.max(10,aa),this.circleDiameter=aa)}else{var ka=Oe.top*lt-kt,gn=Oe.bottom*lt+kt,Ya=Oe.left*lt-kt,qn=Oe.right*lt+kt,kn=Oe.collisionPadding;if(kn&&(Ya-=kn[0]*lt,ka-=kn[1]*lt,qn+=kn[2]*lt,gn+=kn[3]*lt),Kt){var Vn=new i(Ya,ka),$n=new i(qn,ka),fi=new i(Ya,gn),Li=new i(qn,gn),Ei=Kt*Math.PI/180;Vn._rotate(Ei),$n._rotate(Ei),fi._rotate(Ei),Li._rotate(Ei),Ya=Math.min(Vn.x,$n.x,fi.x,Li.x),qn=Math.max(Vn.x,$n.x,fi.x,Li.x),ka=Math.min(Vn.y,$n.y,fi.y,Li.y),gn=Math.max(Vn.y,$n.y,fi.y,Li.y)}C.emplaceBack(H.x,H.y,Ya,ka,qn,gn,oe,_e,Ce)}this.boxEndIndex=C.length},m0=function(C,H){if(C===void 0&&(C=[]),H===void 0&&(H=hD),this.data=C,this.length=this.data.length,this.compare=H,this.length>0)for(var oe=(this.length>>1)-1;oe>=0;oe--)this._down(oe)};m0.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},m0.prototype.pop=function(){if(this.length!==0){var C=this.data[0],H=this.data.pop();return this.length--,this.length>0&&(this.data[0]=H,this._down(0)),C}},m0.prototype.peek=function(){return this.data[0]},m0.prototype._up=function(C){for(var H=this,oe=H.data,_e=H.compare,Ce=oe[C];C>0;){var Oe=C-1>>1,lt=oe[Oe];if(_e(Ce,lt)>=0)break;oe[C]=lt,C=Oe}oe[C]=Ce},m0.prototype._down=function(C){for(var H=this,oe=H.data,_e=H.compare,Ce=this.length>>1,Oe=oe[C];C=0)break;oe[C]=kt,C=lt}oe[C]=Oe};function hD(k,C){return kC?1:0}function vD(k,C,H){C===void 0&&(C=1),H===void 0&&(H=!1);for(var oe=1/0,_e=1/0,Ce=-1/0,Oe=-1/0,lt=k[0],kt=0;ktCe)&&(Ce=jt.x),(!kt||jt.y>Oe)&&(Oe=jt.y)}var Kt=Ce-oe,Sr=Oe-_e,qr=Math.min(Kt,Sr),Br=qr/2,aa=new m0([],dD);if(qr===0)return new i(oe,_e);for(var ka=oe;kaYa.d||!Ya.d)&&(Ya=kn,H&&console.log("found best %d after %d probes",Math.round(1e4*kn.d)/1e4,qn)),!(kn.max-Ya.d<=C)&&(Br=kn.h/2,aa.push(new g0(kn.p.x-Br,kn.p.y-Br,Br,k)),aa.push(new g0(kn.p.x+Br,kn.p.y-Br,Br,k)),aa.push(new g0(kn.p.x-Br,kn.p.y+Br,Br,k)),aa.push(new g0(kn.p.x+Br,kn.p.y+Br,Br,k)),qn+=4)}return H&&(console.log("num probes: "+qn),console.log("best distance: "+Ya.d)),Ya.p}function dD(k,C){return C.max-k.max}function g0(k,C,H,oe){this.p=new i(k,C),this.h=H,this.d=pD(this.p,oe),this.max=this.d+this.h*Math.SQRT2}function pD(k,C){for(var H=!1,oe=1/0,_e=0;_ek.y!=Kt.y>k.y&&k.x<(Kt.x-jt.x)*(k.y-jt.y)/(Kt.y-jt.y)+jt.x&&(H=!H),oe=Math.min(oe,tv(k,jt,Kt))}return(H?1:-1)*Math.sqrt(oe)}function mD(k){for(var C=0,H=0,oe=0,_e=k[0],Ce=0,Oe=_e.length,lt=Oe-1;Ce=Qa||Hh.y<0||Hh.y>=Qa||_D(k,Hh,T0,H,oe,_e,fo,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,Ya,$n,Ei,kt,kn,fi,co,Br,C,Ce,jt,Kt,Oe)};if(Zi==="line")for(var Ls=0,rs=M5(C.geometry,0,0,Qa,Qa);Ls1){var gf=uD(Lc,Li,H.vertical||aa,oe,ka,qn);gf&&yo(Lc,gf)}}else if(C.type==="Polygon")for(var Kc=0,Zf=o0(C.geometry,0);Kcbd&&B(k.layerIds[0]+': Value for "text-size" is >= '+Im+'. Reduce your "text-size".')):gn.kind==="composite"&&(Ya=[Ff*Br.compositeTextSizes[0].evaluate(Oe,{},aa),Ff*Br.compositeTextSizes[1].evaluate(Oe,{},aa)],(Ya[0]>bd||Ya[1]>bd)&&B(k.layerIds[0]+': Value for "text-size" is >= '+Im+'. Reduce your "text-size".')),k.addSymbols(k.text,ka,Ya,lt,Ce,Oe,jt,C,kt.lineStartIndex,kt.lineLength,qr,aa);for(var qn=0,kn=Kt;qnbd&&B(k.layerIds[0]+': Value for "icon-size" is >= '+Im+'. Reduce your "icon-size".')):rh.kind==="composite"&&(of=[Ff*$n.compositeIconSizes[0].evaluate(Vn,{},Li),Ff*$n.compositeIconSizes[1].evaluate(Vn,{},Li)],(of[0]>bd||of[1]>bd)&&B(k.layerIds[0]+': Value for "icon-size" is >= '+Im+'. Reduce your "icon-size".')),k.addSymbols(k.icon,yf,of,kn,qn,Vn,!1,C,Zi.lineStartIndex,Zi.lineLength,-1,Li),bl=k.icon.placedSymbolArray.length-1,th&&(rs=th.length*4,k.addSymbols(k.icon,th,of,kn,qn,Vn,Qf.vertical,C,Zi.lineStartIndex,Zi.lineLength,-1,Li),wl=k.icon.placedSymbolArray.length-1)}for(var ah in oe.horizontal){var Ih=oe.horizontal[ah];if(!ro){xu=ge(Ih.text);var Kv=lt.layout.get("text-rotate").evaluate(Vn,{},Li);ro=new Cy(kt,C,jt,Kt,Sr,Ih,qr,Br,aa,Kv)}var Td=Ih.positionedLines.length===1;if(xl+=L5(k,C,Ih,Ce,lt,aa,Vn,ka,Zi,oe.vertical?Qf.horizontal:Qf.horizontalOnly,Td?Object.keys(oe.horizontal):[ah],cl,bl,$n,Li),Td)break}oe.vertical&&(nu+=L5(k,C,oe.vertical,Ce,lt,aa,Vn,ka,Zi,Qf.vertical,["vertical"],cl,wl,$n,Li));var Ad=ro?ro.boxStartIndex:k.collisionBoxArray.length,Sd=ro?ro.boxEndIndex:k.collisionBoxArray.length,T0=fo?fo.boxStartIndex:k.collisionBoxArray.length,Hh=fo?fo.boxEndIndex:k.collisionBoxArray.length,Dy=ls?ls.boxStartIndex:k.collisionBoxArray.length,Yx=ls?ls.boxEndIndex:k.collisionBoxArray.length,zy=yo?yo.boxStartIndex:k.collisionBoxArray.length,Kx=yo?yo.boxEndIndex:k.collisionBoxArray.length,Fh=-1,A0=function(zm,X5){return zm&&zm.circleDiameter?Math.max(zm.circleDiameter,X5):X5};Fh=A0(ro,Fh),Fh=A0(fo,Fh),Fh=A0(ls,Fh),Fh=A0(yo,Fh);var Fy=Fh>-1?1:0;Fy&&(Fh*=Ei/Hn),k.glyphOffsetArray.length>=au.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,Vn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,cl.right>=0?cl.right:-1,cl.center>=0?cl.center:-1,cl.left>=0?cl.left:-1,cl.vertical||-1,bl,wl,xu,Ad,Sd,T0,Hh,Dy,Yx,zy,Kx,jt,xl,nu,Ls,rs,Fy,0,qr,Iu,Sc,Fh)}function xD(k,C,H,oe){var _e=k.compareText;if(!(C in _e))_e[C]=[];else for(var Ce=_e[C],Oe=Ce.length-1;Oe>=0;Oe--)if(oe.dist(Ce[Oe])0)&&(Oe.value.kind!=="constant"||Oe.value.value.length>0),Kt=kt.value.kind!=="constant"||!!kt.value.value||Object.keys(kt.parameters).length>0,Sr=Ce.get("symbol-sort-key");if(this.features=[],!(!jt&&!Kt)){for(var qr=H.iconDependencies,Br=H.glyphDependencies,aa=H.availableImages,ka=new oi(this.zoom),gn=0,Ya=C;gn=0;for(var nu=0,bl=co.sections;nu=0;kt--)Oe[kt]={x:H[kt].x,y:H[kt].y,tileUnitDistanceFromAnchor:Ce},kt>0&&(Ce+=H[kt-1].dist(H[kt]));for(var jt=0;jt0},au.prototype.hasIconData=function(){return this.icon.segments.get().length>0},au.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},au.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},au.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},au.prototype.addIndicesForPlacedSymbol=function(C,H){for(var oe=C.placedSymbolArray.get(H),_e=oe.vertexStartIndex+oe.numGlyphs*4,Ce=oe.vertexStartIndex;Ce<_e;Ce+=4)C.indexArray.emplaceBack(Ce,Ce+1,Ce+2),C.indexArray.emplaceBack(Ce+1,Ce+2,Ce+3)},au.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var H=Math.sin(C),oe=Math.cos(C),_e=[],Ce=[],Oe=[],lt=0;lt1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var oe=0,_e=this.symbolInstanceIndexes;oe<_e.length;oe+=1){var Ce=_e[oe],Oe=this.symbolInstances.get(Ce);this.featureSortOrder.push(Oe.featureIndex),[Oe.rightJustifiedTextSymbolIndex,Oe.centerJustifiedTextSymbolIndex,Oe.leftJustifiedTextSymbolIndex].forEach(function(lt,kt,jt){lt>=0&&jt.indexOf(lt)===kt&&H.addIndicesForPlacedSymbol(H.text,lt)}),Oe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Oe.verticalPlacedTextSymbolIndex),Oe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Oe.placedIconSymbolIndex),Oe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Oe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},pe("SymbolBucket",au,{omit:["layers","collisionBoxArray","features","compareText"]}),au.MAX_GLYPHS=65535,au.addDynamicAttributes=Gx;function AD(k,C){return C.replace(/{([^{}]+)}/g,function(H,oe){return oe in k?String(k[oe]):""})}var SD=new la({"symbol-placement":new tt(zn.layout_symbol["symbol-placement"]),"symbol-spacing":new tt(zn.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new tt(zn.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Gt(zn.layout_symbol["symbol-sort-key"]),"symbol-z-order":new tt(zn.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new tt(zn.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new tt(zn.layout_symbol["icon-ignore-placement"]),"icon-optional":new tt(zn.layout_symbol["icon-optional"]),"icon-rotation-alignment":new tt(zn.layout_symbol["icon-rotation-alignment"]),"icon-size":new Gt(zn.layout_symbol["icon-size"]),"icon-text-fit":new tt(zn.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new tt(zn.layout_symbol["icon-text-fit-padding"]),"icon-image":new Gt(zn.layout_symbol["icon-image"]),"icon-rotate":new Gt(zn.layout_symbol["icon-rotate"]),"icon-padding":new tt(zn.layout_symbol["icon-padding"]),"icon-keep-upright":new tt(zn.layout_symbol["icon-keep-upright"]),"icon-offset":new Gt(zn.layout_symbol["icon-offset"]),"icon-anchor":new Gt(zn.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new tt(zn.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new tt(zn.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new tt(zn.layout_symbol["text-rotation-alignment"]),"text-field":new Gt(zn.layout_symbol["text-field"]),"text-font":new Gt(zn.layout_symbol["text-font"]),"text-size":new Gt(zn.layout_symbol["text-size"]),"text-max-width":new Gt(zn.layout_symbol["text-max-width"]),"text-line-height":new tt(zn.layout_symbol["text-line-height"]),"text-letter-spacing":new Gt(zn.layout_symbol["text-letter-spacing"]),"text-justify":new Gt(zn.layout_symbol["text-justify"]),"text-radial-offset":new Gt(zn.layout_symbol["text-radial-offset"]),"text-variable-anchor":new tt(zn.layout_symbol["text-variable-anchor"]),"text-anchor":new Gt(zn.layout_symbol["text-anchor"]),"text-max-angle":new tt(zn.layout_symbol["text-max-angle"]),"text-writing-mode":new tt(zn.layout_symbol["text-writing-mode"]),"text-rotate":new Gt(zn.layout_symbol["text-rotate"]),"text-padding":new tt(zn.layout_symbol["text-padding"]),"text-keep-upright":new tt(zn.layout_symbol["text-keep-upright"]),"text-transform":new Gt(zn.layout_symbol["text-transform"]),"text-offset":new Gt(zn.layout_symbol["text-offset"]),"text-allow-overlap":new tt(zn.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new tt(zn.layout_symbol["text-ignore-placement"]),"text-optional":new tt(zn.layout_symbol["text-optional"])}),MD=new la({"icon-opacity":new Gt(zn.paint_symbol["icon-opacity"]),"icon-color":new Gt(zn.paint_symbol["icon-color"]),"icon-halo-color":new Gt(zn.paint_symbol["icon-halo-color"]),"icon-halo-width":new Gt(zn.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Gt(zn.paint_symbol["icon-halo-blur"]),"icon-translate":new tt(zn.paint_symbol["icon-translate"]),"icon-translate-anchor":new tt(zn.paint_symbol["icon-translate-anchor"]),"text-opacity":new Gt(zn.paint_symbol["text-opacity"]),"text-color":new Gt(zn.paint_symbol["text-color"],{runtimeType:vs,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Gt(zn.paint_symbol["text-halo-color"]),"text-halo-width":new Gt(zn.paint_symbol["text-halo-width"]),"text-halo-blur":new Gt(zn.paint_symbol["text-halo-blur"]),"text-translate":new tt(zn.paint_symbol["text-translate"]),"text-translate-anchor":new tt(zn.paint_symbol["text-translate-anchor"])}),Hx={paint:MD,layout:SD},x0=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:zs,this.defaultValue=C};x0.prototype.evaluate=function(C){if(C.formattedSection){var H=this.defaultValue.property.overrides;if(H&&H.hasOverride(C.formattedSection))return H.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},x0.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var H=this.defaultValue.value;C(H._styleExpression.expression)}},x0.prototype.outputDefined=function(){return!1},x0.prototype.serialize=function(){return null},pe("FormatSectionOverride",x0,{omit:["defaultValue"]});var ED=(function(k){function C(H){k.call(this,H,Hx)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(oe,_e){if(k.prototype.recalculate.call(this,oe,_e),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Ce=this.layout.get("text-writing-mode");if(Ce){for(var Oe=[],lt=0,kt=Ce;lt",targetMapId:_e,sourceMapId:Oe.mapId})}}},b0.prototype.receive=function(C){var H=C.data,oe=H.id;if(oe&&!(H.targetMapId&&this.mapId!==H.targetMapId))if(H.type===""){delete this.tasks[oe];var _e=this.cancelCallbacks[oe];delete this.cancelCallbacks[oe],_e&&_e()}else ce()||H.mustQueue?(this.tasks[oe]=H,this.taskQueue.push(oe),this.invoker.trigger()):this.processTask(oe,H)},b0.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),H=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),H&&this.processTask(C,H)}},b0.prototype.processTask=function(C,H){var oe=this;if(H.type===""){var _e=this.callbacks[C];delete this.callbacks[C],_e&&(H.error?_e(xt(H.error)):_e(null,xt(H.data)))}else{var Ce=!1,Oe=Y(this.globalScope)?void 0:[],lt=H.hasCallback?function(qr,Br){Ce=!0,delete oe.cancelCallbacks[C],oe.target.postMessage({id:C,type:"",sourceMapId:oe.mapId,error:qr?pt(qr):null,data:pt(Br,Oe)},Oe)}:function(qr){Ce=!0},kt=null,jt=xt(H.data);if(this.parent[H.type])kt=this.parent[H.type](H.sourceMapId,jt,lt);else if(this.parent.getWorkerSource){var Kt=H.type.split("."),Sr=this.parent.getWorkerSource(H.sourceMapId,Kt[0],jt.source);kt=Sr[Kt[1]](jt,lt)}else lt(new Error("Could not find function "+H.type));!Ce&&kt&&kt.cancel&&(this.cancelCallbacks[C]=kt.cancel)}},b0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function BD(k,C,H){C=Math.pow(2,H)-C-1;var oe=F5(k*256,C*256,H),_e=F5((k+1)*256,(C+1)*256,H);return oe[0]+","+oe[1]+","+_e[0]+","+_e[1]}function F5(k,C,H){var oe=2*Math.PI*6378137/256/Math.pow(2,H),_e=k*oe-2*Math.PI*6378137/2,Ce=C*oe-2*Math.PI*6378137/2;return[_e,Ce]}var Zc=function(C,H){C&&(H?this.setSouthWest(C).setNorthEast(H):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};Zc.prototype.setNorthEast=function(C){return this._ne=C instanceof tc?new tc(C.lng,C.lat):tc.convert(C),this},Zc.prototype.setSouthWest=function(C){return this._sw=C instanceof tc?new tc(C.lng,C.lat):tc.convert(C),this},Zc.prototype.extend=function(C){var H=this._sw,oe=this._ne,_e,Ce;if(C instanceof tc)_e=C,Ce=C;else if(C instanceof Zc){if(_e=C._sw,Ce=C._ne,!_e||!Ce)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var Oe=C;return this.extend(Zc.convert(Oe))}else{var lt=C;return this.extend(tc.convert(lt))}return this}return!H&&!oe?(this._sw=new tc(_e.lng,_e.lat),this._ne=new tc(Ce.lng,Ce.lat)):(H.lng=Math.min(_e.lng,H.lng),H.lat=Math.min(_e.lat,H.lat),oe.lng=Math.max(Ce.lng,oe.lng),oe.lat=Math.max(Ce.lat,oe.lat)),this},Zc.prototype.getCenter=function(){return new tc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Zc.prototype.getSouthWest=function(){return this._sw},Zc.prototype.getNorthEast=function(){return this._ne},Zc.prototype.getNorthWest=function(){return new tc(this.getWest(),this.getNorth())},Zc.prototype.getSouthEast=function(){return new tc(this.getEast(),this.getSouth())},Zc.prototype.getWest=function(){return this._sw.lng},Zc.prototype.getSouth=function(){return this._sw.lat},Zc.prototype.getEast=function(){return this._ne.lng},Zc.prototype.getNorth=function(){return this._ne.lat},Zc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Zc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Zc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Zc.prototype.contains=function(C){var H=tc.convert(C),oe=H.lng,_e=H.lat,Ce=this._sw.lat<=_e&&_e<=this._ne.lat,Oe=this._sw.lng<=oe&&oe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Oe=this._sw.lng>=oe&&oe>=this._ne.lng),Ce&&Oe},Zc.convert=function(C){return!C||C instanceof Zc?C:new Zc(C)};var O5=63710088e-1,tc=function(C,H){if(isNaN(C)||isNaN(H))throw new Error("Invalid LngLat object: ("+C+", "+H+")");if(this.lng=+C,this.lat=+H,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};tc.prototype.wrap=function(){return new tc(_(this.lng,-180,180),this.lat)},tc.prototype.toArray=function(){return[this.lng,this.lat]},tc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},tc.prototype.distanceTo=function(C){var H=Math.PI/180,oe=this.lat*H,_e=C.lat*H,Ce=Math.sin(oe)*Math.sin(_e)+Math.cos(oe)*Math.cos(_e)*Math.cos((C.lng-this.lng)*H),Oe=O5*Math.acos(Math.min(Ce,1));return Oe},tc.prototype.toBounds=function(C){C===void 0&&(C=0);var H=40075017,oe=360*C/H,_e=oe/Math.cos(Math.PI/180*this.lat);return new Zc(new tc(this.lng-_e,this.lat-oe),new tc(this.lng+_e,this.lat+oe))},tc.convert=function(C){if(C instanceof tc)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new tc(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new tc(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var B5=2*Math.PI*O5;function N5(k){return B5*Math.cos(k*Math.PI/180)}function U5(k){return(180+k)/360}function j5(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function V5(k,C){return k/N5(C)}function ND(k){return k*360-180}function Xx(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function UD(k,C){return k*N5(Xx(C))}function jD(k){return 1/Math.cos(k*Math.PI/180)}var yp=function(C,H,oe){oe===void 0&&(oe=0),this.x=+C,this.y=+H,this.z=+oe};yp.fromLngLat=function(C,H){H===void 0&&(H=0);var oe=tc.convert(C);return new yp(U5(oe.lng),j5(oe.lat),V5(H,oe.lat))},yp.prototype.toLngLat=function(){return new tc(ND(this.x),Xx(this.y))},yp.prototype.toAltitude=function(){return UD(this.z,this.y)},yp.prototype.meterInMercatorCoordinateUnits=function(){return 1/B5*jD(Xx(this.y))};var _p=function(C,H,oe){this.z=C,this.x=H,this.y=oe,this.key=Dm(0,C,C,H,oe)};_p.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},_p.prototype.url=function(C,H){var oe=BD(this.x,this.y,this.z),_e=VD(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(H==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_e).replace("{bbox-epsg-3857}",oe)},_p.prototype.getTilePoint=function(C){var H=Math.pow(2,this.z);return new i((C.x*H-this.x)*Qa,(C.y*H-this.y)*Qa)},_p.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var q5=function(C,H){this.wrap=C,this.canonical=H,this.key=Dm(C,H.z,H.z,H.x,H.y)},Yc=function(C,H,oe,_e,Ce){this.overscaledZ=C,this.wrap=H,this.canonical=new _p(oe,+_e,+Ce),this.key=Dm(H,C,oe,_e,Ce)};Yc.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Yc.prototype.scaledTo=function(C){var H=this.canonical.z-C;return C>this.canonical.z?new Yc(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Yc(C,this.wrap,C,this.canonical.x>>H,this.canonical.y>>H)},Yc.prototype.calculateScaledKey=function(C,H){var oe=this.canonical.z-C;return C>this.canonical.z?Dm(this.wrap*+H,C,this.canonical.z,this.canonical.x,this.canonical.y):Dm(this.wrap*+H,C,C,this.canonical.x>>oe,this.canonical.y>>oe)},Yc.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var H=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>H&&C.canonical.y===this.canonical.y>>H},Yc.prototype.children=function(C){if(this.overscaledZ>=C)return[new Yc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var H=this.canonical.z+1,oe=this.canonical.x*2,_e=this.canonical.y*2;return[new Yc(H,this.wrap,H,oe,_e),new Yc(H,this.wrap,H,oe+1,_e),new Yc(H,this.wrap,H,oe,_e+1),new Yc(H,this.wrap,H,oe+1,_e+1)]},Yc.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;Ce--)_e=1<=this.dim+1||H<-1||H>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(H+1)*this.stride+(C+1)},Zv.prototype._unpackMapbox=function(C,H,oe){return(C*256*256+H*256+oe)/10-1e4},Zv.prototype._unpackTerrarium=function(C,H,oe){return C*256+H+oe/256-32768},Zv.prototype.getPixels=function(){return new tf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Zv.prototype.backfillBorder=function(C,H,oe){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var _e=H*this.dim,Ce=H*this.dim+this.dim,Oe=oe*this.dim,lt=oe*this.dim+this.dim;switch(H){case-1:_e=Ce-1;break;case 1:Ce=_e+1;break}switch(oe){case-1:Oe=lt-1;break;case 1:lt=Oe+1;break}for(var kt=-H*this.dim,jt=-oe*this.dim,Kt=Oe;Kt=0&&Sr[3]>=0&&kt.insert(lt,Sr[0],Sr[1],Sr[2],Sr[3])}},Yv.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ov.VectorTile(new to(this.rawTileData)).layers,this.sourceLayerCoder=new Iy(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yv.prototype.query=function(C,H,oe,_e){var Ce=this;this.loadVTLayers();for(var Oe=C.params||{},lt=Qa/C.tileSize/C.scale,kt=Ye(Oe.filter),jt=C.queryGeometry,Kt=C.queryPadding*lt,Sr=H5(jt),qr=this.grid.query(Sr.minX-Kt,Sr.minY-Kt,Sr.maxX+Kt,Sr.maxY+Kt),Br=H5(C.cameraQueryGeometry),aa=this.grid3D.query(Br.minX-Kt,Br.minY-Kt,Br.maxX+Kt,Br.maxY+Kt,function(fi,Li,Ei,co){return kh(C.cameraQueryGeometry,fi-Kt,Li-Kt,Ei+Kt,co+Kt)}),ka=0,gn=aa;ka_e)Ce=!1;else if(!H)Ce=!0;else if(this.expirationTime=kr.maxzoom)&&kr.visibility!=="none"){h(pr,this.zoom,Xt);var zr=Ga[kr.id]=kr.createBucket({index:La.bucketLayerIDs.length,layers:pr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Zn,sourceID:this.source});zr.populate(Wn,Ua,this.tileID.canonical),La.bucketLayerIDs.push(pr.map(function(ra){return ra.id}))}}}}var Ur,dt,qt,fr,Ir=e.mapObject(Ua.glyphDependencies,function(ra){return Object.keys(ra).map(Number)});Object.keys(Ir).length?Pr.send("getGlyphs",{uid:this.uid,stacks:Ir},function(ra,ha){Ur||(Ur=ra,dt=ha,ua.call(Kr))}):dt={};var da=Object.keys(Ua.iconDependencies);da.length?Pr.send("getImages",{icons:da,source:this.source,tileID:this.tileID,type:"icons"},function(ra,ha){Ur||(Ur=ra,qt=ha,ua.call(Kr))}):qt={};var Ta=Object.keys(Ua.patternDependencies);Ta.length?Pr.send("getImages",{icons:Ta,source:this.source,tileID:this.tileID,type:"patterns"},function(ra,ha){Ur||(Ur=ra,fr=ha,ua.call(Kr))}):fr={},ua.call(this);function ua(){if(Ur)return Yr(Ur);if(dt&&qt&&fr){var ra=new n(dt),ha=new e.ImageAtlas(qt,fr);for(var pn in Ga){var _n=Ga[pn];_n instanceof e.SymbolBucket?(h(_n.layers,this.zoom,Xt),e.performSymbolLayout(_n,dt,ra.positions,qt,ha.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):_n.hasPattern&&(_n instanceof e.LineBucket||_n instanceof e.FillBucket||_n instanceof e.FillExtrusionBucket)&&(h(_n.layers,this.zoom,Xt),_n.addFeatures(Ua,this.tileID.canonical,ha.patternPositions))}this.status="done",Yr(null,{buckets:e.values(Ga).filter(function(jn){return!jn.isEmpty()}),featureIndex:La,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ra.image,imageAtlas:ha,glyphMap:this.returnDependencies?dt:null,iconMap:this.returnDependencies?qt:null,glyphPositions:this.returnDependencies?ra.positions:null})}}};function h(Wt,Lt,Ht){for(var Xt=new e.EvaluationParameters(Lt),Pr=0,Yr=Wt;Pr=0!=!!Lt&&Wt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,g=function(Lt){this._feature=Lt,this.extent=e.EXTENT,this.type=Lt.type,this.properties=Lt.tags,"id"in Lt&&!isNaN(Lt.id)&&(this.id=parseInt(Lt.id,10))};g.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Lt=[],Ht=0,Xt=this._feature.geometry;Ht"u"&&(Xt.push(na),La=Xt.length-1,Yr[na]=La),Lt.writeVarint(La);var Ga=Ht.properties[na],Ua=typeof Ga;Ua!=="string"&&Ua!=="boolean"&&Ua!=="number"&&(Ga=JSON.stringify(Ga));var Xa=Ua+":"+Ga,an=Kr[Xa];typeof an>"u"&&(Pr.push(Ga),an=Pr.length-1,Kr[Xa]=an),Lt.writeVarint(an)}}function $(Wt,Lt){return(Lt<<3)+(Wt&7)}function le(Wt){return Wt<<1^Wt>>31}function ce(Wt,Lt){for(var Ht=Wt.loadGeometry(),Xt=Wt.type,Pr=0,Yr=0,Kr=Ht.length,na=0;na>1;Y(Wt,Lt,Kr,Xt,Pr,Yr%2),G(Wt,Lt,Ht,Xt,Kr-1,Yr+1),G(Wt,Lt,Ht,Kr+1,Pr,Yr+1)}}function Y(Wt,Lt,Ht,Xt,Pr,Yr){for(;Pr>Xt;){if(Pr-Xt>600){var Kr=Pr-Xt+1,na=Ht-Xt+1,La=Math.log(Kr),Ga=.5*Math.exp(2*La/3),Ua=.5*Math.sqrt(La*Ga*(Kr-Ga)/Kr)*(na-Kr/2<0?-1:1),Xa=Math.max(Xt,Math.floor(Ht-na*Ga/Kr+Ua)),an=Math.min(Pr,Math.floor(Ht+(Kr-na)*Ga/Kr+Ua));Y(Wt,Lt,Ht,Xa,an,Yr)}var Sa=Lt[2*Ht+Yr],Zn=Xt,Wn=Pr;for(ee(Wt,Lt,Xt,Ht),Lt[2*Pr+Yr]>Sa&&ee(Wt,Lt,Xt,Pr);ZnSa;)Wn--}Lt[2*Xt+Yr]===Sa?ee(Wt,Lt,Xt,Wn):(Wn++,ee(Wt,Lt,Wn,Pr)),Wn<=Ht&&(Xt=Wn+1),Ht<=Wn&&(Pr=Wn-1)}}function ee(Wt,Lt,Ht,Xt){V(Wt,Ht,Xt),V(Lt,2*Ht,2*Xt),V(Lt,2*Ht+1,2*Xt+1)}function V(Wt,Lt,Ht){var Xt=Wt[Lt];Wt[Lt]=Wt[Ht],Wt[Ht]=Xt}function se(Wt,Lt,Ht,Xt,Pr,Yr,Kr){for(var na=[0,Wt.length-1,0],La=[],Ga,Ua;na.length;){var Xa=na.pop(),an=na.pop(),Sa=na.pop();if(an-Sa<=Kr){for(var Zn=Sa;Zn<=an;Zn++)Ga=Lt[2*Zn],Ua=Lt[2*Zn+1],Ga>=Ht&&Ga<=Pr&&Ua>=Xt&&Ua<=Yr&&La.push(Wt[Zn]);continue}var Wn=Math.floor((Sa+an)/2);Ga=Lt[2*Wn],Ua=Lt[2*Wn+1],Ga>=Ht&&Ga<=Pr&&Ua>=Xt&&Ua<=Yr&&La.push(Wt[Wn]);var ti=(Xa+1)%2;(Xa===0?Ht<=Ga:Xt<=Ua)&&(na.push(Sa),na.push(Wn-1),na.push(ti)),(Xa===0?Pr>=Ga:Yr>=Ua)&&(na.push(Wn+1),na.push(an),na.push(ti))}return La}function ae(Wt,Lt,Ht,Xt,Pr,Yr){for(var Kr=[0,Wt.length-1,0],na=[],La=Pr*Pr;Kr.length;){var Ga=Kr.pop(),Ua=Kr.pop(),Xa=Kr.pop();if(Ua-Xa<=Yr){for(var an=Xa;an<=Ua;an++)j(Lt[2*an],Lt[2*an+1],Ht,Xt)<=La&&na.push(Wt[an]);continue}var Sa=Math.floor((Xa+Ua)/2),Zn=Lt[2*Sa],Wn=Lt[2*Sa+1];j(Zn,Wn,Ht,Xt)<=La&&na.push(Wt[Sa]);var ti=(Ga+1)%2;(Ga===0?Ht-Pr<=Zn:Xt-Pr<=Wn)&&(Kr.push(Xa),Kr.push(Sa-1),Kr.push(ti)),(Ga===0?Ht+Pr>=Zn:Xt+Pr>=Wn)&&(Kr.push(Sa+1),Kr.push(Ua),Kr.push(ti))}return na}function j(Wt,Lt,Ht,Xt){var Pr=Wt-Ht,Yr=Lt-Xt;return Pr*Pr+Yr*Yr}var Q=function(Wt){return Wt[0]},re=function(Wt){return Wt[1]},he=function(Lt,Ht,Xt,Pr,Yr){Ht===void 0&&(Ht=Q),Xt===void 0&&(Xt=re),Pr===void 0&&(Pr=64),Yr===void 0&&(Yr=Float64Array),this.nodeSize=Pr,this.points=Lt;for(var Kr=Lt.length<65536?Uint16Array:Uint32Array,na=this.ids=new Kr(Lt.length),La=this.coords=new Yr(Lt.length*2),Ga=0;Ga=Pr;Ua--){var Xa=+Date.now();La=this._cluster(La,Ua),this.trees[Ua]=new he(La,ie,Ee,Kr,Float32Array),Xt&&console.log("z%d: %d clusters in %dms",Ua,La.length,+Date.now()-Xa)}return Xt&&console.timeEnd("total time"),this},Te.prototype.getClusters=function(Lt,Ht){var Xt=((Lt[0]+180)%360+360)%360-180,Pr=Math.max(-90,Math.min(90,Lt[1])),Yr=Lt[2]===180?180:((Lt[2]+180)%360+360)%360-180,Kr=Math.max(-90,Math.min(90,Lt[3]));if(Lt[2]-Lt[0]>=360)Xt=-180,Yr=180;else if(Xt>Yr){var na=this.getClusters([Xt,Pr,180,Kr],Ht),La=this.getClusters([-180,Pr,Yr,Kr],Ht);return na.concat(La)}for(var Ga=this.trees[this._limitZoom(Ht)],Ua=Ga.range(rt(Xt),$e(Kr),rt(Yr),$e(Pr)),Xa=[],an=0,Sa=Ua;anHt&&(Wn+=Rr.numPoints||1)}if(Wn>=La){for(var Ar=Xa.x*Zn,pr=Xa.y*Zn,kr=na&&Zn>1?this._map(Xa,!0):null,zr=(Ua<<5)+(Ht+1)+this.points.length,Ur=0,dt=Sa;Ur1)for(var da=0,Ta=Sa;da>5},Te.prototype._getOriginZoom=function(Lt){return(Lt-this.points.length)%32},Te.prototype._map=function(Lt,Ht){if(Lt.numPoints)return Ht?ue({},Lt.properties):Lt.properties;var Xt=this.points[Lt.index].properties,Pr=this.options.map(Xt);return Ht&&Pr===Xt?ue({},Pr):Pr};function Le(Wt,Lt,Ht,Xt,Pr){return{x:Wt,y:Lt,zoom:1/0,id:Ht,parentId:-1,numPoints:Xt,properties:Pr}}function Pe(Wt,Lt){var Ht=Wt.geometry.coordinates,Xt=Ht[0],Pr=Ht[1];return{x:rt(Xt),y:$e(Pr),zoom:1/0,index:Lt,parentId:-1}}function qe(Wt){return{type:"Feature",id:Wt.id,properties:et(Wt),geometry:{type:"Point",coordinates:[Ue(Wt.x),fe(Wt.y)]}}}function et(Wt){var Lt=Wt.numPoints,Ht=Lt>=1e4?Math.round(Lt/1e3)+"k":Lt>=1e3?Math.round(Lt/100)/10+"k":Lt;return ue(ue({},Wt.properties),{cluster:!0,cluster_id:Wt.id,point_count:Lt,point_count_abbreviated:Ht})}function rt(Wt){return Wt/360+.5}function $e(Wt){var Lt=Math.sin(Wt*Math.PI/180),Ht=.5-.25*Math.log((1+Lt)/(1-Lt))/Math.PI;return Ht<0?0:Ht>1?1:Ht}function Ue(Wt){return(Wt-.5)*360}function fe(Wt){var Lt=(180-Wt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Lt))/Math.PI-90}function ue(Wt,Lt){for(var Ht in Lt)Wt[Ht]=Lt[Ht];return Wt}function ie(Wt){return Wt.x}function Ee(Wt){return Wt.y}function We(Wt,Lt,Ht,Xt){for(var Pr=Xt,Yr=Ht-Lt>>1,Kr=Ht-Lt,na,La=Wt[Lt],Ga=Wt[Lt+1],Ua=Wt[Ht],Xa=Wt[Ht+1],an=Lt+3;anPr)na=an,Pr=Sa;else if(Sa===Pr){var Zn=Math.abs(an-Yr);ZnXt&&(na-Lt>3&&We(Wt,Lt,na,Xt),Wt[na+2]=Pr,Ht-na>3&&We(Wt,na,Ht,Xt))}function Qe(Wt,Lt,Ht,Xt,Pr,Yr){var Kr=Pr-Ht,na=Yr-Xt;if(Kr!==0||na!==0){var La=((Wt-Ht)*Kr+(Lt-Xt)*na)/(Kr*Kr+na*na);La>1?(Ht=Pr,Xt=Yr):La>0&&(Ht+=Kr*La,Xt+=na*La)}return Kr=Wt-Ht,na=Lt-Xt,Kr*Kr+na*na}function Xe(Wt,Lt,Ht,Xt){var Pr={id:typeof Wt>"u"?null:Wt,type:Lt,geometry:Ht,tags:Xt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Tt(Pr),Pr}function Tt(Wt){var Lt=Wt.geometry,Ht=Wt.type;if(Ht==="Point"||Ht==="MultiPoint"||Ht==="LineString")St(Wt,Lt);else if(Ht==="Polygon"||Ht==="MultiLineString")for(var Xt=0;Xt0&&(Xt?Kr+=(Pr*Ga-La*Yr)/2:Kr+=Math.sqrt(Math.pow(La-Pr,2)+Math.pow(Ga-Yr,2))),Pr=La,Yr=Ga}var Ua=Lt.length-3;Lt[2]=1,We(Lt,0,Ua,Ht),Lt[Ua+2]=1,Lt.size=Math.abs(Kr),Lt.start=0,Lt.end=Lt.size}function Or(Wt,Lt,Ht,Xt){for(var Pr=0;Pr1?1:Ht}function mt(Wt,Lt,Ht,Xt,Pr,Yr,Kr,na){if(Ht/=Lt,Xt/=Lt,Yr>=Ht&&Kr=Xt)return null;for(var La=[],Ga=0;Ga=Ht&&Zn=Xt)continue;var Wn=[];if(an==="Point"||an==="MultiPoint")ze(Xa,Wn,Ht,Xt,Pr);else if(an==="LineString")Ze(Xa,Wn,Ht,Xt,Pr,!1,na.lineMetrics);else if(an==="MultiLineString")ke(Xa,Wn,Ht,Xt,Pr,!1);else if(an==="Polygon")ke(Xa,Wn,Ht,Xt,Pr,!0);else if(an==="MultiPolygon")for(var ti=0;ti=Ht&&Kr<=Xt&&(Lt.push(Wt[Yr]),Lt.push(Wt[Yr+1]),Lt.push(Wt[Yr+2]))}}function Ze(Wt,Lt,Ht,Xt,Pr,Yr,Kr){for(var na=we(Wt),La=Pr===0?He:nt,Ga=Wt.start,Ua,Xa,an=0;anHt&&(Xa=La(na,Sa,Zn,ti,gt,Ht),Kr&&(na.start=Ga+Ua*Xa)):it>Xt?Rr=Ht&&(Xa=La(na,Sa,Zn,ti,gt,Ht),Ar=!0),Rr>Xt&&it<=Xt&&(Xa=La(na,Sa,Zn,ti,gt,Xt),Ar=!0),!Yr&&Ar&&(Kr&&(na.end=Ga+Ua*Xa),Lt.push(na),na=we(Wt)),Kr&&(Ga+=Ua)}var pr=Wt.length-3;Sa=Wt[pr],Zn=Wt[pr+1],Wn=Wt[pr+2],it=Pr===0?Sa:Zn,it>=Ht&&it<=Xt&&Be(na,Sa,Zn,Wn),pr=na.length-3,Yr&&pr>=3&&(na[pr]!==na[0]||na[pr+1]!==na[1])&&Be(na,na[0],na[1],na[2]),na.length&&Lt.push(na)}function we(Wt){var Lt=[];return Lt.size=Wt.size,Lt.start=Wt.start,Lt.end=Wt.end,Lt}function ke(Wt,Lt,Ht,Xt,Pr,Yr){for(var Kr=0;KrKr.maxX&&(Kr.maxX=Ua),Xa>Kr.maxY&&(Kr.maxY=Xa)}return Kr}function ir(Wt,Lt,Ht,Xt){var Pr=Lt.geometry,Yr=Lt.type,Kr=[];if(Yr==="Point"||Yr==="MultiPoint")for(var na=0;na0&&Lt.size<(Pr?Kr:Xt)){Ht.numPoints+=Lt.length/3;return}for(var na=[],La=0;LaKr)&&(Ht.numSimplified++,na.push(Lt[La]),na.push(Lt[La+1])),Ht.numPoints++;Pr&&Mr(na,Yr),Wt.push(na)}function Mr(Wt,Lt){for(var Ht=0,Xt=0,Pr=Wt.length,Yr=Pr-2;Xt0===Lt)for(Xt=0,Pr=Wt.length;Xt24)throw new Error("maxZoom should be in the 0-24 range");if(Lt.promoteId&&Lt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Xt=zt(Wt,Lt);this.tiles={},this.tileCoords=[],Ht&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Lt.indexMaxZoom,Lt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Xt=ot(Xt,Lt),Xt.length&&this.splitTile(Xt,0,0,0),Ht&&(Xt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Ca.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ca.prototype.splitTile=function(Wt,Lt,Ht,Xt,Pr,Yr,Kr){for(var na=[Wt,Lt,Ht,Xt],La=this.options,Ga=La.debug;na.length;){Xt=na.pop(),Ht=na.pop(),Lt=na.pop(),Wt=na.pop();var Ua=1<1&&console.time("creation"),an=this.tiles[Xa]=sr(Wt,Lt,Ht,Xt,La),this.tileCoords.push({z:Lt,x:Ht,y:Xt}),Ga)){Ga>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Lt,Ht,Xt,an.numFeatures,an.numPoints,an.numSimplified),console.timeEnd("creation"));var Sa="z"+Lt;this.stats[Sa]=(this.stats[Sa]||0)+1,this.total++}if(an.source=Wt,Pr){if(Lt===La.maxZoom||Lt===Pr)continue;var Zn=1<1&&console.time("clipping");var Wn=.5*La.buffer/La.extent,ti=.5-Wn,gt=.5+Wn,it=1+Wn,Rr,Ar,pr,kr,zr,Ur;Rr=Ar=pr=kr=null,zr=mt(Wt,Ua,Ht-Wn,Ht+gt,0,an.minX,an.maxX,La),Ur=mt(Wt,Ua,Ht+ti,Ht+it,0,an.minX,an.maxX,La),Wt=null,zr&&(Rr=mt(zr,Ua,Xt-Wn,Xt+gt,1,an.minY,an.maxY,La),Ar=mt(zr,Ua,Xt+ti,Xt+it,1,an.minY,an.maxY,La),zr=null),Ur&&(pr=mt(Ur,Ua,Xt-Wn,Xt+gt,1,an.minY,an.maxY,La),kr=mt(Ur,Ua,Xt+ti,Xt+it,1,an.minY,an.maxY,La),Ur=null),Ga>1&&console.timeEnd("clipping"),na.push(Rr||[],Lt+1,Ht*2,Xt*2),na.push(Ar||[],Lt+1,Ht*2,Xt*2+1),na.push(pr||[],Lt+1,Ht*2+1,Xt*2),na.push(kr||[],Lt+1,Ht*2+1,Xt*2+1)}}},Ca.prototype.getTile=function(Wt,Lt,Ht){var Xt=this.options,Pr=Xt.extent,Yr=Xt.debug;if(Wt<0||Wt>24)return null;var Kr=1<1&&console.log("drilling down to z%d-%d-%d",Wt,Lt,Ht);for(var La=Wt,Ga=Lt,Ua=Ht,Xa;!Xa&&La>0;)La--,Ga=Math.floor(Ga/2),Ua=Math.floor(Ua/2),Xa=this.tiles[Aa(La,Ga,Ua)];return!Xa||!Xa.source?null:(Yr>1&&console.log("found parent tile z%d-%d-%d",La,Ga,Ua),Yr>1&&console.time("drilling down"),this.splitTile(Xa.source,La,Ga,Ua,Wt,Lt,Ht),Yr>1&&console.timeEnd("drilling down"),this.tiles[na]?Et(this.tiles[na],Pr):null)};function Aa(Wt,Lt,Ht){return((1<=0?0:me.button},r.remove=function(me){me.parentNode&&me.parentNode.removeChild(me)};function c(me,K,ye){var te,ge,Ne,Me=e.browser.devicePixelRatio>1?"@2x":"",Ke=e.getJSON(K.transformRequest(K.normalizeSpriteURL(me,Me,".json"),e.ResourceType.SpriteJSON),function(gr,Dr){Ke=null,Ne||(Ne=gr,te=Dr,Bt())}),ht=e.getImage(K.transformRequest(K.normalizeSpriteURL(me,Me,".png"),e.ResourceType.SpriteImage),function(gr,Dr){ht=null,Ne||(Ne=gr,ge=Dr,Bt())});function Bt(){if(Ne)ye(Ne);else if(te&&ge){var gr=e.browser.getImageData(ge),Dr={};for(var ur in te){var vt=te[ur],wt=vt.width,It=vt.height,$t=vt.x,lr=vt.y,tr=vt.sdf,cr=vt.pixelRatio,rr=vt.stretchX,Vt=vt.stretchY,er=vt.content,Nt=new e.RGBAImage({width:wt,height:It});e.RGBAImage.copy(gr,Nt,{x:$t,y:lr},{x:0,y:0},{width:wt,height:It}),Dr[ur]={data:Nt,pixelRatio:cr,sdf:tr,stretchX:rr,stretchY:Vt,content:er}}ye(null,Dr)}}return{cancel:function(){Ke&&(Ke.cancel(),Ke=null),ht&&(ht.cancel(),ht=null)}}}function T(me){var K=me.userImage;if(K&&K.render){var ye=K.render();if(ye)return me.data.replace(new Uint8Array(K.data.buffer)),!0}return!1}var l=1,_=(function(me){function K(){me.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.isLoaded=function(){return this.loaded},K.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var ge=0,Ne=this.requestors;ge=0?1.2:1))}b.prototype.draw=function(me){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(me,this.buffer,this.middle);for(var K=this.ctx.getImageData(0,0,this.size,this.size),ye=new Uint8ClampedArray(this.size*this.size),te=0;te65535){gr(new Error("glyphs > 65535 not supported"));return}if(vt.ranges[It]){gr(null,{stack:Dr,id:ur,glyph:wt});return}var $t=vt.requests[It];$t||($t=vt.requests[It]=[],y.loadGlyphRange(Dr,It,te.url,te.requestManager,function(lr,tr){if(tr){for(var cr in tr)te._doesCharSupportLocalGlyph(+cr)||(vt.glyphs[+cr]=tr[+cr]);vt.ranges[It]=!0}for(var rr=0,Vt=$t;rr1&&(Bt=K[++ht]);var Dr=Math.abs(gr-Bt.left),ur=Math.abs(gr-Bt.right),vt=Math.min(Dr,ur),wt=void 0,It=Ne/te*(ge+1);if(Bt.isDash){var $t=ge-Math.abs(It);wt=Math.sqrt(vt*vt+$t*$t)}else wt=ge-Math.sqrt(vt*vt+It*It);this.data[Ke+gr]=Math.max(0,Math.min(255,wt+128))}},F.prototype.addRegularDash=function(K){for(var ye=K.length-1;ye>=0;--ye){var te=K[ye],ge=K[ye+1];te.zeroLength?K.splice(ye,1):ge&&ge.isDash===te.isDash&&(ge.left=te.left,K.splice(ye,1))}var Ne=K[0],Me=K[K.length-1];Ne.isDash===Me.isDash&&(Ne.left=Me.left-this.width,Me.right=Ne.right+this.width);for(var Ke=this.width*this.nextRow,ht=0,Bt=K[ht],gr=0;gr1&&(Bt=K[++ht]);var Dr=Math.abs(gr-Bt.left),ur=Math.abs(gr-Bt.right),vt=Math.min(Dr,ur),wt=Bt.isDash?vt:-vt;this.data[Ke+gr]=Math.max(0,Math.min(255,wt+128))}},F.prototype.addDash=function(K,ye){var te=ye?7:0,ge=2*te+1;if(this.nextRow+ge>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ne=0,Me=0;Me=te.minX&&K.x=te.minY&&K.y0&&(gr[new e.OverscaledTileID(te.overscaledZ,Ke,ge.z,Me,ge.y-1).key]={backfilled:!1},gr[new e.OverscaledTileID(te.overscaledZ,te.wrap,ge.z,ge.x,ge.y-1).key]={backfilled:!1},gr[new e.OverscaledTileID(te.overscaledZ,Bt,ge.z,ht,ge.y-1).key]={backfilled:!1}),ge.y+10&&(Ne.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ne))})},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setData=function(te){var ge=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ne){if(Ne){ge.fire(new e.ErrorEvent(Ne));return}var Me={dataType:"source",sourceDataType:"content"};ge._collectResourceTiming&&ge._resourceTiming&&ge._resourceTiming.length>0&&(Me.resourceTiming=ge._resourceTiming,ge._resourceTiming=[]),ge.fire(new e.Event("data",Me))}),this},K.prototype.getClusterExpansionZoom=function(te,ge){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},ge),this},K.prototype.getClusterChildren=function(te,ge){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},ge),this},K.prototype.getClusterLeaves=function(te,ge,Ne,Me){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:ge,offset:Ne},Me),this},K.prototype._updateWorkerData=function(te){var ge=this;this._loaded=!1;var Ne=e.extend({},this.workerOptions),Me=this._data;typeof Me=="string"?(Ne.request=this.map._requestManager.transformRequest(e.browser.resolveURL(Me),e.ResourceType.Source),Ne.request.collectResourceTiming=this._collectResourceTiming):Ne.data=JSON.stringify(Me),this.actor.send(this.type+".loadData",Ne,function(Ke,ht){ge._removed||ht&&ht.abandoned||(ge._loaded=!0,ht&&ht.resourceTiming&&ht.resourceTiming[ge.id]&&(ge._resourceTiming=ht.resourceTiming[ge.id].slice(0)),ge.actor.send(ge.type+".coalesce",{source:Ne.source},null),te(Ke))})},K.prototype.loaded=function(){return this._loaded},K.prototype.loadTile=function(te,ge){var Ne=this,Me=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var Ke={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(Me,Ke,function(ht,Bt){return delete te.request,te.unloadVectorData(),te.aborted?ge(null):ht?ge(ht):(te.loadVectorData(Bt,Ne.map.painter,Me==="reloadTile"),ge(null))})},K.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},K.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},K.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},K.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},K.prototype.hasTransition=function(){return!1},K})(e.Evented),le=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ce=(function(me){function K(ye,te,ge,Ne){me.call(this),this.id=ye,this.dispatcher=ge,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ne),this.options=te}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.load=function(te,ge){var Ne=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(Me,Ke){Ne._loaded=!0,Me?Ne.fire(new e.ErrorEvent(Me)):Ke&&(Ne.image=Ke,te&&(Ne.coordinates=te),ge&&ge(),Ne._finishLoading())})},K.prototype.loaded=function(){return this._loaded},K.prototype.updateImage=function(te){var ge=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){ge.texture=null}),this)},K.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setCoordinates=function(te){var ge=this;this.coordinates=te;var Ne=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=ve(Ne),this.minzoom=this.maxzoom=this.tileID.z;var Me=Ne.map(function(Ke){return ge.tileID.getTilePoint(Ke)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(Me[0].x,Me[0].y,0,0),this._boundsArray.emplaceBack(Me[1].x,Me[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(Me[3].x,Me[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(Me[2].x,Me[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,ge=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,ge.RGBA),this.texture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE));for(var Ne in this.tiles){var Me=this.tiles[Ne];Me.state!=="loaded"&&(Me.state="loaded",Me.texture=this.texture)}}},K.prototype.loadTile=function(te,ge){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},ge(null)):(te.state="errored",ge(null))},K.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return!1},K})(e.Evented);function ve(me){for(var K=1/0,ye=1/0,te=-1/0,ge=-1/0,Ne=0,Me=me;Nege.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+ge.start(0)+" and "+ge.end(0)+"-second mark."))):this.video.currentTime=te}},K.prototype.getVideo=function(){return this.video},K.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,ge=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE),ge.texSubImage2D(ge.TEXTURE_2D,0,0,0,ge.RGBA,ge.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,ge.RGBA),this.texture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE));for(var Ne in this.tiles){var Me=this.tiles[Ne];Me.state!=="loaded"&&(Me.state="loaded",Me.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this.video&&!this.video.paused},K})(ce),Y=(function(me){function K(ye,te,ge,Ne){me.call(this,ye,te,ge,Ne),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(Me){return!Array.isArray(Me)||Me.length!==2||Me.some(function(Ke){return typeof Ke!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},K.prototype.getCanvas=function(){return this.canvas},K.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},K.prototype.onRemove=function(){this.pause()},K.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var ge=this.map.painter.context,Ne=ge.gl;this.boundsBuffer||(this.boundsBuffer=ge.createVertexBuffer(this._boundsArray,le.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(ge,this.canvas,Ne.RGBA,{premultiply:!0});for(var Me in this.tiles){var Ke=this.tiles[Me];Ke.state!=="loaded"&&(Ke.state="loaded",Ke.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this._playing},K.prototype._hasInvalidDimensions=function(){for(var te=0,ge=[this.canvas.width,this.canvas.height];tethis.max){var Ke=this._getAndRemoveByKey(this.order[0]);Ke&&this.onRemove(Ke)}return this},Pe.prototype.has=function(K){return K.wrapped().key in this.data},Pe.prototype.getAndRemove=function(K){return this.has(K)?this._getAndRemoveByKey(K.wrapped().key):null},Pe.prototype._getAndRemoveByKey=function(K){var ye=this.data[K].shift();return ye.timeout&&clearTimeout(ye.timeout),this.data[K].length===0&&delete this.data[K],this.order.splice(this.order.indexOf(K),1),ye.value},Pe.prototype.getByKey=function(K){var ye=this.data[K];return ye?ye[0].value:null},Pe.prototype.get=function(K){if(!this.has(K))return null;var ye=this.data[K.wrapped().key][0];return ye.value},Pe.prototype.remove=function(K,ye){if(!this.has(K))return this;var te=K.wrapped().key,ge=ye===void 0?0:this.data[te].indexOf(ye),Ne=this.data[te][ge];return this.data[te].splice(ge,1),Ne.timeout&&clearTimeout(Ne.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ne.value),this.order.splice(this.order.indexOf(te),1),this},Pe.prototype.setMaxSize=function(K){for(this.max=K;this.order.length>this.max;){var ye=this._getAndRemoveByKey(this.order[0]);ye&&this.onRemove(ye)}return this},Pe.prototype.filter=function(K){var ye=[];for(var te in this.data)for(var ge=0,Ne=this.data[te];ge1||(Math.abs(Dr)>1&&(Math.abs(Dr+vt)===1?Dr+=vt:Math.abs(Dr-vt)===1&&(Dr-=vt)),!(!gr.dem||!Bt.dem)&&(Bt.dem.backfillBorder(gr.dem,Dr,ur),Bt.neighboringTiles&&Bt.neighboringTiles[wt]&&(Bt.neighboringTiles[wt].backfilled=!0)))}},K.prototype.getTile=function(te){return this.getTileByID(te.key)},K.prototype.getTileByID=function(te){return this._tiles[te]},K.prototype._retainLoadedChildren=function(te,ge,Ne,Me){for(var Ke in this._tiles){var ht=this._tiles[Ke];if(!(Me[Ke]||!ht.hasData()||ht.tileID.overscaledZ<=ge||ht.tileID.overscaledZ>Ne)){for(var Bt=ht.tileID;ht&&ht.tileID.overscaledZ>ge+1;){var gr=ht.tileID.scaledTo(ht.tileID.overscaledZ-1);ht=this._tiles[gr.key],ht&&ht.hasData()&&(Bt=gr)}for(var Dr=Bt;Dr.overscaledZ>ge;)if(Dr=Dr.scaledTo(Dr.overscaledZ-1),te[Dr.key]){Me[Bt.key]=Bt;break}}}},K.prototype.findLoadedParent=function(te,ge){if(te.key in this._loadedParentTiles){var Ne=this._loadedParentTiles[te.key];return Ne&&Ne.tileID.overscaledZ>=ge?Ne:null}for(var Me=te.overscaledZ-1;Me>=ge;Me--){var Ke=te.scaledTo(Me),ht=this._getLoadedTile(Ke);if(ht)return ht}},K.prototype._getLoadedTile=function(te){var ge=this._tiles[te.key];if(ge&&ge.hasData())return ge;var Ne=this._cache.getByKey(te.wrapped().key);return Ne},K.prototype.updateCacheSize=function(te){var ge=Math.ceil(te.width/this._source.tileSize)+1,Ne=Math.ceil(te.height/this._source.tileSize)+1,Me=ge*Ne,Ke=5,ht=Math.floor(Me*Ke),Bt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,ht):ht;this._cache.setMaxSize(Bt)},K.prototype.handleWrapJump=function(te){var ge=this._prevLng===void 0?te:this._prevLng,Ne=te-ge,Me=Ne/360,Ke=Math.round(Me);if(this._prevLng=te,Ke){var ht={};for(var Bt in this._tiles){var gr=this._tiles[Bt];gr.tileID=gr.tileID.unwrapTo(gr.tileID.wrap+Ke),ht[gr.tileID.key]=gr}this._tiles=ht;for(var Dr in this._timers)clearTimeout(this._timers[Dr]),delete this._timers[Dr];for(var ur in this._tiles){var vt=this._tiles[ur];this._setTileReloadTimer(ur,vt)}}},K.prototype.update=function(te){var ge=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ne;this.used?this._source.tileID?Ne=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ca){return new e.OverscaledTileID(ca.canonical.z,ca.wrap,ca.canonical.z,ca.canonical.x,ca.canonical.y)}):(Ne=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ne=Ne.filter(function(ca){return ge._source.hasTile(ca)}))):Ne=[];var Me=te.coveringZoomLevel(this._source),Ke=Math.max(Me-K.maxOverzooming,this._source.minzoom),ht=Math.max(Me+K.maxUnderzooming,this._source.minzoom),Bt=this._updateRetainedTiles(Ne,Me);if(La(this._source.type)){for(var gr={},Dr={},ur=Object.keys(Bt),vt=0,wt=ur;vtthis._source.maxzoom){var tr=$t.children(this._source.maxzoom)[0],cr=this.getTile(tr);if(cr&&cr.hasData()){Ne[tr.key]=tr;continue}}else{var rr=$t.children(this._source.maxzoom);if(Ne[rr[0].key]&&Ne[rr[1].key]&&Ne[rr[2].key]&&Ne[rr[3].key])continue}for(var Vt=lr.wasRequested(),er=$t.overscaledZ-1;er>=Ke;--er){var Nt=$t.scaledTo(er);if(Me[Nt.key]||(Me[Nt.key]=!0,lr=this.getTile(Nt),!lr&&Vt&&(lr=this._addTile(Nt)),lr&&(Ne[Nt.key]=Nt,Vt=lr.wasRequested(),lr.hasData())))break}}}return Ne},K.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var ge=[],Ne=void 0,Me=this._tiles[te].tileID;Me.overscaledZ>0;){if(Me.key in this._loadedParentTiles){Ne=this._loadedParentTiles[Me.key];break}ge.push(Me.key);var Ke=Me.scaledTo(Me.overscaledZ-1);if(Ne=this._getLoadedTile(Ke),Ne)break;Me=Ke}for(var ht=0,Bt=ge;ht0)&&(ge.hasData()&&ge.state!=="reloading"?this._cache.add(ge.tileID,ge,ge.getExpiryTimeout()):(ge.aborted=!0,this._abortTile(ge),this._unloadTile(ge))))},K.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},K.prototype.tilesIn=function(te,ge,Ne){var Me=this,Ke=[],ht=this.transform;if(!ht)return Ke;for(var Bt=Ne?ht.getCameraQueryGeometry(te):te,gr=te.map(function(er){return ht.pointCoordinate(er)}),Dr=Bt.map(function(er){return ht.pointCoordinate(er)}),ur=this.getIds(),vt=1/0,wt=1/0,It=-1/0,$t=-1/0,lr=0,tr=Dr;lr=0&&on[1].y+ca>=0){var Fa=gr.map(function(Nn){return Cr.getTilePoint(Nn)}),Za=Dr.map(function(Nn){return Cr.getTilePoint(Nn)});Ke.push({tile:Nt,tileID:Cr,queryGeometry:Fa,cameraQueryGeometry:Za,scale:Hr})}}},Vt=0;Vt=e.browser.now())return!0}return!1},K.prototype.setFeatureState=function(te,ge,Ne){te=te||"_geojsonTileLayer",this._state.updateState(te,ge,Ne)},K.prototype.removeFeatureState=function(te,ge,Ne){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,ge,Ne)},K.prototype.getFeatureState=function(te,ge){return te=te||"_geojsonTileLayer",this._state.getState(te,ge)},K.prototype.setDependencies=function(te,ge,Ne){var Me=this._tiles[te];Me&&Me.setDependencies(ge,Ne)},K.prototype.reloadTilesForDependencies=function(te,ge){for(var Ne in this._tiles){var Me=this._tiles[Ne];Me.hasDependency(te,ge)&&this._reloadTile(Ne,"reloading")}this._cache.filter(function(Ke){return!Ke.hasDependency(te,ge)})},K})(e.Evented);Kr.maxOverzooming=10,Kr.maxUnderzooming=3;function na(me,K){var ye=Math.abs(me.wrap*2)-+(me.wrap<0),te=Math.abs(K.wrap*2)-+(K.wrap<0);return me.overscaledZ-K.overscaledZ||te-ye||K.canonical.y-me.canonical.y||K.canonical.x-me.canonical.x}function La(me){return me==="raster"||me==="image"||me==="video"}function Ga(){return new e.window.Worker(mo.workerUrl)}var Ua="mapboxgl_preloaded_worker_pool",Xa=function(){this.active={}};Xa.prototype.acquire=function(K){if(!this.workers)for(this.workers=[];this.workers.length0?(ge-Me)/Ke:0;return this.points[Ne].mult(1-ht).add(this.points[ye].mult(ht))};var ra=function(K,ye,te){var ge=this.boxCells=[],Ne=this.circleCells=[];this.xCellCount=Math.ceil(K/te),this.yCellCount=Math.ceil(ye/te);for(var Me=0;Methis.width||ge<0||ye>this.height)return Ne?!1:[];var Ke=[];if(K<=0&&ye<=0&&this.width<=te&&this.height<=ge){if(Ne)return!0;for(var ht=0;ht0:Ke}},ra.prototype._queryCircle=function(K,ye,te,ge,Ne){var Me=K-te,Ke=K+te,ht=ye-te,Bt=ye+te;if(Ke<0||Me>this.width||Bt<0||ht>this.height)return ge?!1:[];var gr=[],Dr={hitTest:ge,circle:{x:K,y:ye,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(Me,ht,Ke,Bt,this._queryCellCircle,gr,Dr,Ne),ge?gr.length>0:gr},ra.prototype.query=function(K,ye,te,ge,Ne){return this._query(K,ye,te,ge,!1,Ne)},ra.prototype.hitTest=function(K,ye,te,ge,Ne){return this._query(K,ye,te,ge,!0,Ne)},ra.prototype.hitTestCircle=function(K,ye,te,ge){return this._queryCircle(K,ye,te,!0,ge)},ra.prototype._queryCell=function(K,ye,te,ge,Ne,Me,Ke,ht){var Bt=Ke.seenUids,gr=this.boxCells[Ne];if(gr!==null)for(var Dr=this.bboxes,ur=0,vt=gr;ur=Dr[It+0]&&ge>=Dr[It+1]&&(!ht||ht(this.boxKeys[wt]))){if(Ke.hitTest)return Me.push(!0),!0;Me.push({key:this.boxKeys[wt],x1:Dr[It],y1:Dr[It+1],x2:Dr[It+2],y2:Dr[It+3]})}}}var $t=this.circleCells[Ne];if($t!==null)for(var lr=this.circles,tr=0,cr=$t;trKe*Ke+ht*ht},ra.prototype._circleAndRectCollide=function(K,ye,te,ge,Ne,Me,Ke){var ht=(Me-ge)/2,Bt=Math.abs(K-(ge+ht));if(Bt>ht+te)return!1;var gr=(Ke-Ne)/2,Dr=Math.abs(ye-(Ne+gr));if(Dr>gr+te)return!1;if(Bt<=ht||Dr<=gr)return!0;var ur=Bt-ht,vt=Dr-gr;return ur*ur+vt*vt<=te*te};function ha(me,K,ye,te,ge){var Ne=e.create();return K?(e.scale(Ne,Ne,[1/ge,1/ge,1]),ye||e.rotateZ(Ne,Ne,te.angle)):e.multiply(Ne,te.labelPlaneMatrix,me),Ne}function pn(me,K,ye,te,ge){if(K){var Ne=e.clone(me);return e.scale(Ne,Ne,[ge,ge,1]),ye||e.rotateZ(Ne,Ne,-te.angle),Ne}else return te.glCoordMatrix}function _n(me,K){var ye=[me.x,me.y,0,1];lo(ye,ye,K);var te=ye[3];return{point:new e.Point(ye[0]/te,ye[1]/te),signedDistanceFromCamera:te}}function jn(me,K){return .5+.5*(me/K)}function li(me,K){var ye=me[0]/me[3],te=me[1]/me[3],ge=ye>=-K[0]&&ye<=K[0]&&te>=-K[1]&&te<=K[1];return ge}function yi(me,K,ye,te,ge,Ne,Me,Ke){var ht=te?me.textSizeData:me.iconSizeData,Bt=e.evaluateSizeForZoom(ht,ye.transform.zoom),gr=[256/ye.width*2+1,256/ye.height*2+1],Dr=te?me.text.dynamicLayoutVertexArray:me.icon.dynamicLayoutVertexArray;Dr.clear();for(var ur=me.lineVertexArray,vt=te?me.text.placedSymbolArray:me.icon.placedSymbolArray,wt=ye.transform.width/ye.transform.height,It=!1,$t=0;$tNe)return{useVertical:!0}}return(me===e.WritingMode.vertical?K.yye.x)?{needsFlipping:!0}:null}function Gi(me,K,ye,te,ge,Ne,Me,Ke,ht,Bt,gr,Dr,ur,vt){var wt=K/24,It=me.lineOffsetX*wt,$t=me.lineOffsetY*wt,lr;if(me.numGlyphs>1){var tr=me.glyphStartIndex+me.numGlyphs,cr=me.lineStartIndex,rr=me.lineStartIndex+me.lineLength,Vt=gi(wt,Ke,It,$t,ye,gr,Dr,me,ht,Ne,ur);if(!Vt)return{notEnoughRoom:!0};var er=_n(Vt.first.point,Me).point,Nt=_n(Vt.last.point,Me).point;if(te&&!ye){var Cr=Si(me.writingMode,er,Nt,vt);if(Cr)return Cr}lr=[Vt.first];for(var Hr=me.glyphStartIndex+1;Hr0?Za.point:io(Dr,Fa,ca,1,ge),En=Si(me.writingMode,ca,Nn,vt);if(En)return En}var Qa=vo(wt*Ke.getoffsetX(me.glyphStartIndex),It,$t,ye,gr,Dr,me.segment,me.lineStartIndex,me.lineStartIndex+me.lineLength,ht,Ne,ur);if(!Qa)return{notEnoughRoom:!0};lr=[Qa]}for(var cn=0,mn=lr;cn0?1:-1,wt=0;te&&(vt*=-1,wt=Math.PI),vt<0&&(wt+=Math.PI);for(var It=vt>0?Ke+Me:Ke+Me+1,$t=ge,lr=ge,tr=0,cr=0,rr=Math.abs(ur),Vt=[];tr+cr<=rr;){if(It+=vt,It=ht)return null;if(lr=$t,Vt.push($t),$t=Dr[It],$t===void 0){var er=new e.Point(Bt.getx(It),Bt.gety(It)),Nt=_n(er,gr);if(Nt.signedDistanceFromCamera>0)$t=Dr[It]=Nt.point;else{var Cr=It-vt,Hr=tr===0?Ne:new e.Point(Bt.getx(Cr),Bt.gety(Cr));$t=io(Hr,er,lr,rr-tr+1,gr)}}tr+=cr,cr=lr.dist($t)}var ca=(rr-tr)/cr,on=$t.sub(lr),Fa=on.mult(ca)._add(lr);Fa._add(on._unit()._perp()._mult(ye*vt));var Za=wt+Math.atan2($t.y-lr.y,$t.x-lr.x);return Vt.push(Fa),{point:Fa,angle:Za,path:Vt}}var ms=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pi(me,K){for(var ye=0;ye=1;Pn--)mn.push(Qa.path[Pn]);for(var ei=1;ei0){for(var xo=mn[0].clone(),os=mn[0].clone(),ks=1;ks=Za.x&&os.x<=Nn.x&&xo.y>=Za.y&&os.y<=Nn.y?fs=[mn]:os.xNn.x||os.yNn.y?fs=[]:fs=e.clipLine([mn],Za.x,Za.y,Nn.x,Nn.y)}for(var Vl=0,ch=fs;Vl=this.screenRightBoundary||gethis.screenBottomBoundary},Fo.prototype.isInsideGrid=function(K,ye,te,ge){return te>=0&&K=0&&ye0){var rr;return this.prevPlacement&&this.prevPlacement.variableOffsets[ur.crossTileID]&&this.prevPlacement.placements[ur.crossTileID]&&this.prevPlacement.placements[ur.crossTileID].text&&(rr=this.prevPlacement.variableOffsets[ur.crossTileID].anchor),this.variableOffsets[ur.crossTileID]={textOffset:$t,width:te,height:ge,anchor:K,textBoxScale:Ne,prevAnchor:rr},this.markUsedJustification(vt,K,ur,wt),vt.allowVerticalPlacement&&(this.markUsedOrientation(vt,wt,ur),this.placedOrientations[ur.crossTileID]=wt),{shift:lr,placedGlyphBoxes:tr}}},ko.prototype.placeLayerBucketPart=function(K,ye,te){var ge=this,Ne=K.parameters,Me=Ne.bucket,Ke=Ne.layout,ht=Ne.posMatrix,Bt=Ne.textLabelPlaneMatrix,gr=Ne.labelToScreenMatrix,Dr=Ne.textPixelRatio,ur=Ne.holdingForFade,vt=Ne.collisionBoxArray,wt=Ne.partiallyEvaluatedTextSize,It=Ne.collisionGroup,$t=Ke.get("text-optional"),lr=Ke.get("icon-optional"),tr=Ke.get("text-allow-overlap"),cr=Ke.get("icon-allow-overlap"),rr=Ke.get("text-rotation-alignment")==="map",Vt=Ke.get("text-pitch-alignment")==="map",er=Ke.get("icon-text-fit")!=="none",Nt=Ke.get("symbol-z-order")==="viewport-y",Cr=tr&&(cr||!Me.hasIconData()||lr),Hr=cr&&(tr||!Me.hasTextData()||$t);!Me.collisionArrays&&vt&&Me.deserializeCollisionBoxes(vt);var ca=function(Qa,cn){if(!ye[Qa.crossTileID]){if(ur){ge.placements[Qa.crossTileID]=new Hi(!1,!1,!1);return}var mn=!1,Pn=!1,ei=!0,no=null,Ao={box:null,offscreen:null},fs={box:null,offscreen:null},xo=null,os=null,ks=null,Vl=0,ch=0,fh=0;cn.textFeatureIndex?Vl=cn.textFeatureIndex:Qa.useRuntimeCollisionCircles&&(Vl=Qa.featureIndex),cn.verticalTextFeatureIndex&&(ch=cn.verticalTextFeatureIndex);var Cf=cn.textBox;if(Cf){var yh=function(Lu){var Ol=e.WritingMode.horizontal;if(Me.allowVerticalPlacement&&!Lu&&ge.prevPlacement){var If=ge.prevPlacement.placedOrientations[Qa.crossTileID];If&&(ge.placedOrientations[Qa.crossTileID]=If,Ol=If,ge.markUsedOrientation(Me,Ol,Qa))}return Ol},tv=function(Lu,Ol){if(Me.allowVerticalPlacement&&Qa.numVerticalGlyphVertices>0&&cn.verticalTextBox)for(var If=0,Vv=Me.writingModes;If0&&(qf=qf.filter(function(Lu){return Lu!==Pf.anchor}),qf.unshift(Pf.anchor))}var hh=function(Lu,Ol,If){for(var Vv=Lu.x2-Lu.x1,fd=Lu.y2-Lu.y1,Kl=Qa.textBoxScale,ep=er&&!cr?Ol:null,bv={box:[],offscreen:!1},Jp=tr?qf.length*2:qf.length,dh=0;dh=qf.length,tp=ge.attemptAnchorPlacement(wv,Lu,Vv,fd,Kl,rr,Vt,Dr,ht,It,$p,Qa,Me,If,ep);if(tp&&(bv=tp.placedGlyphBoxes,bv&&bv.box&&bv.box.length)){mn=!0,no=tp.shift;break}}return bv},_h=function(){return hh(Cf,cn.iconBox,e.WritingMode.horizontal)},vh=function(){var Lu=cn.verticalTextBox,Ol=Ao&&Ao.box&&Ao.box.length;return Me.allowVerticalPlacement&&!Ol&&Qa.numVerticalGlyphVertices>0&&Lu?hh(Lu,cn.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};tv(_h,vh),Ao&&(mn=Ao.box,ei=Ao.offscreen);var Nv=yh(Ao&&Ao.box);if(!mn&&ge.prevPlacement){var rv=ge.prevPlacement.variableOffsets[Qa.crossTileID];rv&&(ge.variableOffsets[Qa.crossTileID]=rv,ge.markUsedJustification(Me,rv.anchor,Qa,Nv))}}else{var Eh=function(Lu,Ol){var If=ge.collisionIndex.placeCollisionBox(Lu,tr,Dr,ht,It.predicate);return If&&If.box&&If.box.length&&(ge.markUsedOrientation(Me,Ol,Qa),ge.placedOrientations[Qa.crossTileID]=Ol),If},Lf=function(){return Eh(Cf,e.WritingMode.horizontal)},kh=function(){var Lu=cn.verticalTextBox;return Me.allowVerticalPlacement&&Qa.numVerticalGlyphVertices>0&&Lu?Eh(Lu,e.WritingMode.vertical):{box:null,offscreen:null}};tv(Lf,kh),yh(Ao&&Ao.box&&Ao.box.length)}}if(xo=Ao,mn=xo&&xo.box&&xo.box.length>0,ei=xo&&xo.offscreen,Qa.useRuntimeCollisionCircles){var Wc=Me.text.placedSymbolArray.get(Qa.centerJustifiedTextSymbolIndex),av=e.evaluateSizeForFeature(Me.textSizeData,wt,Wc),Uv=Ke.get("text-padding"),vf=Qa.collisionCircleDiameter;os=ge.collisionIndex.placeCollisionCircles(tr,Wc,Me.lineVertexArray,Me.glyphOffsetArray,av,ht,Bt,gr,te,Vt,It.predicate,vf,Uv),mn=tr||os.circles.length>0&&!os.collisionDetected,ei=ei&&os.offscreen}if(cn.iconFeatureIndex&&(fh=cn.iconFeatureIndex),cn.iconBox){var yv=function(Lu){var Ol=er&&no?us(Lu,no.x,no.y,rr,Vt,ge.transform.angle):Lu;return ge.collisionIndex.placeCollisionBox(Ol,cr,Dr,ht,It.predicate)};fs&&fs.box&&fs.box.length&&cn.verticalIconBox?(ks=yv(cn.verticalIconBox),Pn=ks.box.length>0):(ks=yv(cn.iconBox),Pn=ks.box.length>0),ei=ei&&ks.offscreen}var ud=$t||Qa.numHorizontalGlyphVertices===0&&Qa.numVerticalGlyphVertices===0,cd=lr||Qa.numIconVertices===0;if(!ud&&!cd?Pn=mn=Pn&&mn:cd?ud||(Pn=Pn&&mn):mn=Pn&&mn,mn&&xo&&xo.box&&(fs&&fs.box&&ch?ge.collisionIndex.insertCollisionBox(xo.box,Ke.get("text-ignore-placement"),Me.bucketInstanceId,ch,It.ID):ge.collisionIndex.insertCollisionBox(xo.box,Ke.get("text-ignore-placement"),Me.bucketInstanceId,Vl,It.ID)),Pn&&ks&&ge.collisionIndex.insertCollisionBox(ks.box,Ke.get("icon-ignore-placement"),Me.bucketInstanceId,fh,It.ID),os&&(mn&&ge.collisionIndex.insertCollisionCircles(os.circles,Ke.get("text-ignore-placement"),Me.bucketInstanceId,Vl,It.ID),te)){var jv=Me.bucketInstanceId,_v=ge.collisionCircleArrays[jv];_v===void 0&&(_v=ge.collisionCircleArrays[jv]=new Pi);for(var xv=0;xv=0;--Fa){var Za=on[Fa];ca(Me.symbolInstances.get(Za),Me.collisionArrays[Za])}else for(var Nn=K.symbolInstanceStart;Nn=0&&(Me>=0&&gr!==Me?K.text.placedSymbolArray.get(gr).crossTileID=0:K.text.placedSymbolArray.get(gr).crossTileID=te.crossTileID)}},ko.prototype.markUsedOrientation=function(K,ye,te){for(var ge=ye===e.WritingMode.horizontal||ye===e.WritingMode.horizontalOnly?ye:0,Ne=ye===e.WritingMode.vertical?ye:0,Me=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],Ke=0,ht=Me;Ke0||Vt>0,ca=cr.numIconVertices>0,on=ge.placedOrientations[cr.crossTileID],Fa=on===e.WritingMode.vertical,Za=on===e.WritingMode.horizontal||on===e.WritingMode.horizontalOnly;if(Hr){var Nn=zs(Cr.text),En=Fa?ui:Nn;wt(K.text,rr,En);var Qa=Za?ui:Nn;wt(K.text,Vt,Qa);var cn=Cr.text.isHidden();[cr.rightJustifiedTextSymbolIndex,cr.centerJustifiedTextSymbolIndex,cr.leftJustifiedTextSymbolIndex].forEach(function(fh){fh>=0&&(K.text.placedSymbolArray.get(fh).hidden=cn||Fa?1:0)}),cr.verticalPlacedTextSymbolIndex>=0&&(K.text.placedSymbolArray.get(cr.verticalPlacedTextSymbolIndex).hidden=cn||Za?1:0);var mn=ge.variableOffsets[cr.crossTileID];mn&&ge.markUsedJustification(K,mn.anchor,cr,on);var Pn=ge.placedOrientations[cr.crossTileID];Pn&&(ge.markUsedJustification(K,"left",cr,Pn),ge.markUsedOrientation(K,Pn,cr))}if(ca){var ei=zs(Cr.icon),no=!(ur&&cr.verticalPlacedIconSymbolIndex&&Fa);if(cr.placedIconSymbolIndex>=0){var Ao=no?ei:ui;wt(K.icon,cr.numIconVertices,Ao),K.icon.placedSymbolArray.get(cr.placedIconSymbolIndex).hidden=Cr.icon.isHidden()}if(cr.verticalPlacedIconSymbolIndex>=0){var fs=no?ui:ei;wt(K.icon,cr.numVerticalIconVertices,fs),K.icon.placedSymbolArray.get(cr.verticalPlacedIconSymbolIndex).hidden=Cr.icon.isHidden()}}if(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData()){var xo=K.collisionArrays[tr];if(xo){var os=new e.Point(0,0);if(xo.textBox||xo.verticalTextBox){var ks=!0;if(Bt){var Vl=ge.variableOffsets[er];Vl?(os=Ko(Vl.anchor,Vl.width,Vl.height,Vl.textOffset,Vl.textBoxScale),gr&&os._rotate(Dr?ge.transform.angle:-ge.transform.angle)):ks=!1}xo.textBox&&zn(K.textCollisionBox.collisionVertexArray,Cr.text.placed,!ks||Fa,os.x,os.y),xo.verticalTextBox&&zn(K.textCollisionBox.collisionVertexArray,Cr.text.placed,!ks||Za,os.x,os.y)}var ch=!!(!Za&&xo.verticalIconBox);xo.iconBox&&zn(K.iconCollisionBox.collisionVertexArray,Cr.icon.placed,ch,ur?os.x:0,ur?os.y:0),xo.verticalIconBox&&zn(K.iconCollisionBox.collisionVertexArray,Cr.icon.placed,!ch,ur?os.x:0,ur?os.y:0)}}},$t=0;$tK},ko.prototype.setStale=function(){this.stale=!0};function zn(me,K,ye,te,ge){me.emplaceBack(K?1:0,ye?1:0,te||0,ge||0),me.emplaceBack(K?1:0,ye?1:0,te||0,ge||0),me.emplaceBack(K?1:0,ye?1:0,te||0,ge||0),me.emplaceBack(K?1:0,ye?1:0,te||0,ge||0)}var _i=Math.pow(2,25),xs=Math.pow(2,24),Qo=Math.pow(2,17),Ii=Math.pow(2,16),gs=Math.pow(2,9),Zo=Math.pow(2,8),Ss=Math.pow(2,1);function zs(me){if(me.opacity===0&&!me.placed)return 0;if(me.opacity===1&&me.placed)return 4294967295;var K=me.placed?1:0,ye=Math.floor(me.opacity*127);return ye*_i+K*xs+ye*Qo+K*Ii+ye*gs+K*Zo+ye*Ss+K}var ui=0,po=function(K){this._sortAcrossTiles=K.layout.get("symbol-z-order")!=="viewport-y"&&K.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};po.prototype.continuePlacement=function(K,ye,te,ge,Ne){for(var Me=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var Ke=K[this._currentPlacementIndex],ht=ye[Ke],Bt=this.placement.collisionIndex.transform.zoom;if(ht.type==="symbol"&&(!ht.minzoom||ht.minzoom<=Bt)&&(!ht.maxzoom||ht.maxzoom>Bt)){this._inProgressLayer||(this._inProgressLayer=new po(ht));var gr=this._inProgressLayer.continuePlacement(te[ht.source],this.placement,this._showCollisionBoxes,ht,Me);if(gr)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},oo.prototype.commit=function(K){return this.placement.commit(K),this.placement};var vs=512/e.EXTENT/2,Nl=function(K,ye,te){this.tileID=K,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var ge=0;geK.overscaledZ)for(var Bt in ht){var gr=ht[Bt];gr.tileID.isChildOf(K)&&gr.findMatches(ye.symbolInstances,K,Me)}else{var Dr=K.scaledTo(Number(Ke)),ur=ht[Dr.key];ur&&ur.findMatches(ye.symbolInstances,K,Me)}}for(var vt=0;vt0)throw new Error("Unimplemented: "+Me.map(function(Ke){return Ke.command}).join(", ")+".");return Ne.forEach(function(Ke){Ke.command!=="setTransition"&&ge[Ke.command].apply(ge,Ke.args)}),this.stylesheet=te,!0},K.prototype.addImage=function(te,ge){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,ge),this._afterImageUpdated(te)},K.prototype.updateImage=function(te,ge){this.imageManager.updateImage(te,ge)},K.prototype.getImage=function(te){return this.imageManager.getImage(te)},K.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},K.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},K.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},K.prototype.addSource=function(te,ge,Ne){var Me=this;if(Ne===void 0&&(Ne={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!ge.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(ge).join(", ")+".");var Ke=["vector","raster","geojson","video","image"],ht=Ke.indexOf(ge.type)>=0;if(!(ht&&this._validate(e.validateStyle.source,"sources."+te,ge,null,Ne))){this.map&&this.map._collectResourceTiming&&(ge.collectResourceTiming=!0);var Bt=this.sourceCaches[te]=new Kr(te,ge,this.dispatcher);Bt.style=this,Bt.setEventedParent(this,function(){return{isSourceLoaded:Me.loaded(),source:Bt.serialize(),sourceId:te}}),Bt.onAdd(this.map),this._changed=!0}},K.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var ge in this._layers)if(this._layers[ge].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+ge+'" is using it.')));var Ne=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ne.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ne.setEventedParent(null),Ne.clearTiles(),Ne.onRemove&&Ne.onRemove(this.map),this._changed=!0},K.prototype.setGeoJSONSourceData=function(te,ge){this._checkLoaded();var Ne=this.sourceCaches[te].getSource();Ne.setData(ge),this._changed=!0},K.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},K.prototype.addLayer=function(te,ge,Ne){Ne===void 0&&(Ne={}),this._checkLoaded();var Me=te.id;if(this.getLayer(Me)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Me+'" already exists on this map')));return}var Ke;if(te.type==="custom"){if(as(this,e.validateCustomStyleLayer(te)))return;Ke=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(Me,te.source),te=e.clone$1(te),te=e.extend(te,{source:Me})),this._validate(e.validateStyle.layer,"layers."+Me,te,{arrayIndex:-1},Ne))return;Ke=e.createStyleLayer(te),this._validateLayer(Ke),Ke.setEventedParent(this,{layer:{id:Me}}),this._serializedLayers[Ke.id]=Ke.serialize()}var ht=ge?this._order.indexOf(ge):this._order.length;if(ge&&ht===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+ge+'" does not exist on this map.')));return}if(this._order.splice(ht,0,Me),this._layerOrderChanged=!0,this._layers[Me]=Ke,this._removedLayers[Me]&&Ke.source&&Ke.type!=="custom"){var Bt=this._removedLayers[Me];delete this._removedLayers[Me],Bt.type!==Ke.type?this._updatedSources[Ke.source]="clear":(this._updatedSources[Ke.source]="reload",this.sourceCaches[Ke.source].pause())}this._updateLayer(Ke),Ke.onAdd&&Ke.onAdd(this.map)},K.prototype.moveLayer=function(te,ge){this._checkLoaded(),this._changed=!0;var Ne=this._layers[te];if(!Ne){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==ge){var Me=this._order.indexOf(te);this._order.splice(Me,1);var Ke=ge?this._order.indexOf(ge):this._order.length;if(ge&&Ke===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+ge+'" does not exist on this map.')));return}this._order.splice(Ke,0,te),this._layerOrderChanged=!0}},K.prototype.removeLayer=function(te){this._checkLoaded();var ge=this._layers[te];if(!ge){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}ge.setEventedParent(null);var Ne=this._order.indexOf(te);this._order.splice(Ne,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=ge,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],ge.onRemove&&ge.onRemove(this.map)},K.prototype.getLayer=function(te){return this._layers[te]},K.prototype.hasLayer=function(te){return te in this._layers},K.prototype.setLayerZoomRange=function(te,ge,Ne){this._checkLoaded();var Me=this.getLayer(te);if(!Me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}Me.minzoom===ge&&Me.maxzoom===Ne||(ge!=null&&(Me.minzoom=ge),Ne!=null&&(Me.maxzoom=Ne),this._updateLayer(Me))},K.prototype.setFilter=function(te,ge,Ne){Ne===void 0&&(Ne={}),this._checkLoaded();var Me=this.getLayer(te);if(!Me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(Me.filter,ge)){if(ge==null){Me.filter=void 0,this._updateLayer(Me);return}this._validate(e.validateStyle.filter,"layers."+Me.id+".filter",ge,null,Ne)||(Me.filter=e.clone$1(ge),this._updateLayer(Me))}},K.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},K.prototype.setLayoutProperty=function(te,ge,Ne,Me){Me===void 0&&(Me={}),this._checkLoaded();var Ke=this.getLayer(te);if(!Ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(Ke.getLayoutProperty(ge),Ne)||(Ke.setLayoutProperty(ge,Ne,Me),this._updateLayer(Ke))},K.prototype.getLayoutProperty=function(te,ge){var Ne=this.getLayer(te);if(!Ne){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ne.getLayoutProperty(ge)},K.prototype.setPaintProperty=function(te,ge,Ne,Me){Me===void 0&&(Me={}),this._checkLoaded();var Ke=this.getLayer(te);if(!Ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(Ke.getPaintProperty(ge),Ne)){var ht=Ke.setPaintProperty(ge,Ne,Me);ht&&this._updateLayer(Ke),this._changed=!0,this._updatedPaintProps[te]=!0}},K.prototype.getPaintProperty=function(te,ge){return this.getLayer(te).getPaintProperty(ge)},K.prototype.setFeatureState=function(te,ge){this._checkLoaded();var Ne=te.source,Me=te.sourceLayer,Ke=this.sourceCaches[Ne];if(Ke===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ne+"' does not exist in the map's style.")));return}var ht=Ke.getSource().type;if(ht==="geojson"&&Me){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(ht==="vector"&&!Me){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Ke.setFeatureState(Me,te.id,ge)},K.prototype.removeFeatureState=function(te,ge){this._checkLoaded();var Ne=te.source,Me=this.sourceCaches[Ne];if(Me===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ne+"' does not exist in the map's style.")));return}var Ke=Me.getSource().type,ht=Ke==="vector"?te.sourceLayer:void 0;if(Ke==="vector"&&!ht){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(ge&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Me.removeFeatureState(ht,te.id,ge)},K.prototype.getFeatureState=function(te){this._checkLoaded();var ge=te.source,Ne=te.sourceLayer,Me=this.sourceCaches[ge];if(Me===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+ge+"' does not exist in the map's style.")));return}var Ke=Me.getSource().type;if(Ke==="vector"&&!Ne){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Me.getFeatureState(Ne,te.id)},K.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},K.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},K.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},K.prototype._flattenAndSortRenderedFeatures=function(te){for(var ge=this,Ne=function(Za){return ge._layers[Za].type==="fill-extrusion"},Me={},Ke=[],ht=this._order.length-1;ht>=0;ht--){var Bt=this._order[ht];if(Ne(Bt)){Me[Bt]=ht;for(var gr=0,Dr=te;gr=0;tr--){var cr=this._order[tr];if(Ne(cr))for(var rr=Ke.length-1;rr>=0;rr--){var Vt=Ke[rr].feature;if(Me[Vt.layer.id] 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Tl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Al=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -2901,7 +2901,7 @@ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Kc=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +}`,$c=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -2917,20 +2917,20 @@ void main() { #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,Fc=`#ifdef GL_ES +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,Nc=`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,pc="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",tc=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +}`,_c="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",ac=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Oc="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Bc=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,Uc="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",jc=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -2942,7 +2942,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,cu=` +}`,hu=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color @@ -2958,7 +2958,7 @@ void main() { #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Pc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Dc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -2968,7 +2968,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Su=` +}`,Mu=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur @@ -2982,7 +2982,7 @@ void main() { #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,nc=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,lc=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from @@ -3000,7 +3000,7 @@ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Al=` +}`,Sl=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; @@ -3025,7 +3025,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,rc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,nc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -3041,7 +3041,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Vu=` +}`,Gu=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; @@ -3060,11 +3060,11 @@ void main() { #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Ts=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Es=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Ic="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",sf=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,zc="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",ff=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -3072,13 +3072,13 @@ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)* #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Nc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +}`,Vc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,ic=`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,uc=`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -3095,7 +3095,7 @@ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scal #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Jc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +}`,Qc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3109,7 +3109,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,Kl=`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,$l=`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; @@ -3132,7 +3132,7 @@ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float ga #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Uc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +}`,qc=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3146,58 +3146,58 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,Hs=Vs(wu,Yl),Jl=Vs(kc,ec),qu=Vs(vs,Ru),Ds=Vs(Cc,Ll),Du=Vs(nl,Tu),Nl=Vs(nu,Rs),Gl=Vs(Gs,Qo),tl=Vs(ws,Au),jc=Vs(fl,lu),$c=Vs(Us,_f),iu=Vs(qo,xf),Gu=Vs(is,Ui),zu=Vs(ac,uu),Mf=Vs(hl,Lc),mc=Vs(ju,dc),wc=Vs(Tl,Kc),ou=Vs(Fc,pc),gc=Vs(tc,Oc),kl=Vs(Bc,cu),oc=Vs(Pc,Su),lf=Vs(nc,Al),Tc=Vs(rc,Vu),zs=Vs(Ts,Ic),Ul=Vs(sf,Nc),$l=Vs(ic,Jc),Rc=Vs(Kl,Uc);function Vs(de,Y){var me=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=Y.match(/attribute ([\w]+) ([\w]+)/g),pe=de.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ve=Y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ke=Ve?Ve.concat(pe):pe,Ye={};return de=de.replace(me,function(vt,Ot,dr,Dr,ur){return Ye[ur]=!0,Ot==="define"?` +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,Zs=Gs(Vu,Ul),Ql=Gs(Ic,rc),Hu=Gs(ys,Du),Os=Gs(oc,Dl),zu=Gs(il,Au),ql=Gs(ou,Fs),Xl=Gs(Xs,es),rl=Gs(Ms,Su),Gc=Gs(hl,cu),ef=Gs(qs,wf),su=Gs(Vo,Tf),Wu=Gs(ss,Vi),Fu=Gs(sc,fu),kf=Gs(vl,Rc),xc=Gs(qu,yc),Mc=Gs(Al,$c),lu=Gs(Nc,_c),bc=Gs(ac,Uc),Ll=Gs(jc,hu),cc=Gs(Dc,Mu),hf=Gs(lc,Sl),Ec=Gs(nc,Gu),Bs=Gs(Es,zc),Gl=Gs(ff,Vc),eu=Gs(uc,Qc),Fc=Gs($l,qc);function Gs(me,K){var ye=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=K.match(/attribute ([\w]+) ([\w]+)/g),ge=me.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ne=K.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Me=Ne?Ne.concat(ge):ge,Ke={};return me=me.replace(ye,function(ht,Bt,gr,Dr,ur){return Ke[ur]=!0,Bt==="define"?` #ifndef HAS_UNIFORM_u_`+ur+` -varying `+dr+" "+Dr+" "+ur+`; +varying `+gr+" "+Dr+" "+ur+`; #else -uniform `+dr+" "+Dr+" u_"+ur+`; +uniform `+gr+" "+Dr+" u_"+ur+`; #endif `:` #ifdef HAS_UNIFORM_u_`+ur+` - `+dr+" "+Dr+" "+ur+" = u_"+ur+`; + `+gr+" "+Dr+" "+ur+" = u_"+ur+`; #endif -`}),Y=Y.replace(me,function(vt,Ot,dr,Dr,ur){var pt=Dr==="float"?"vec2":"vec4",At=ur.match(/color/)?"color":pt;return Ye[ur]?Ot==="define"?` +`}),K=K.replace(ye,function(ht,Bt,gr,Dr,ur){var vt=Dr==="float"?"vec2":"vec4",wt=ur.match(/color/)?"color":vt;return Ke[ur]?Bt==="define"?` #ifndef HAS_UNIFORM_u_`+ur+` uniform lowp float u_`+ur+`_t; -attribute `+dr+" "+pt+" a_"+ur+`; -varying `+dr+" "+Dr+" "+ur+`; +attribute `+gr+" "+vt+" a_"+ur+`; +varying `+gr+" "+Dr+" "+ur+`; #else -uniform `+dr+" "+Dr+" u_"+ur+`; +uniform `+gr+" "+Dr+" u_"+ur+`; #endif -`:At==="vec4"?` +`:wt==="vec4"?` #ifndef HAS_UNIFORM_u_`+ur+` `+ur+" = a_"+ur+`; #else - `+dr+" "+Dr+" "+ur+" = u_"+ur+`; + `+gr+" "+Dr+" "+ur+" = u_"+ur+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ur+` - `+ur+" = unpack_mix_"+At+"(a_"+ur+", u_"+ur+`_t); + `+ur+" = unpack_mix_"+wt+"(a_"+ur+", u_"+ur+`_t); #else - `+dr+" "+Dr+" "+ur+" = u_"+ur+`; + `+gr+" "+Dr+" "+ur+" = u_"+ur+`; #endif -`:Ot==="define"?` +`:Bt==="define"?` #ifndef HAS_UNIFORM_u_`+ur+` uniform lowp float u_`+ur+`_t; -attribute `+dr+" "+pt+" a_"+ur+`; +attribute `+gr+" "+vt+" a_"+ur+`; #else -uniform `+dr+" "+Dr+" u_"+ur+`; +uniform `+gr+" "+Dr+" u_"+ur+`; #endif -`:At==="vec4"?` +`:wt==="vec4"?` #ifndef HAS_UNIFORM_u_`+ur+` - `+dr+" "+Dr+" "+ur+" = a_"+ur+`; + `+gr+" "+Dr+" "+ur+" = a_"+ur+`; #else - `+dr+" "+Dr+" "+ur+" = u_"+ur+`; + `+gr+" "+Dr+" "+ur+" = u_"+ur+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ur+` - `+dr+" "+Dr+" "+ur+" = unpack_mix_"+At+"(a_"+ur+", u_"+ur+`_t); + `+gr+" "+Dr+" "+ur+" = unpack_mix_"+wt+"(a_"+ur+", u_"+ur+`_t); #else - `+dr+" "+Dr+" "+ur+" = u_"+ur+`; + `+gr+" "+Dr+" "+ur+" = u_"+ur+`; #endif -`}),{fragmentSource:de,vertexSource:Y,staticAttributes:te,staticUniforms:ke}}var yc=Object.freeze({__proto__:null,prelude:Hs,background:Jl,backgroundPattern:qu,circle:Ds,clippingMask:Du,heatmap:Nl,heatmapTexture:Gl,collisionBox:tl,collisionCircle:jc,debug:$c,fill:iu,fillOutline:Gu,fillOutlinePattern:zu,fillPattern:Mf,fillExtrusion:mc,fillExtrusionPattern:wc,hillshadePrepare:ou,hillshade:gc,line:kl,lineGradient:oc,linePattern:lf,lineSDF:Tc,raster:zs,symbolIcon:Ul,symbolSDF:$l,symbolTextAndIcon:Rc}),Hu=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Hu.prototype.bind=function(Y,me,te,pe,Ve,ke,Ye,vt){this.context=Y;for(var Ot=this.boundPaintVertexBuffers.length!==pe.length,dr=0;!Ot&&dr>16,Ye>>16],u_pixel_coord_lower:[ke&65535,Ye&65535]}}function sc(de,Y,me,te){var pe=me.imageManager.getPattern(de.from.toString()),Ve=me.imageManager.getPattern(de.to.toString()),ke=me.imageManager.getPixelSize(),Ye=ke.width,vt=ke.height,Ot=Math.pow(2,te.tileID.overscaledZ),dr=te.tileSize*Math.pow(2,me.transform.tileZoom)/Ot,Dr=dr*(te.tileID.canonical.x+te.tileID.wrap*Ot),ur=dr*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:pe.tl,u_pattern_br_a:pe.br,u_pattern_tl_b:Ve.tl,u_pattern_br_b:Ve.br,u_texsize:[Ye,vt],u_mix:Y.t,u_pattern_size_a:pe.displaySize,u_pattern_size_b:Ve.displaySize,u_scale_a:Y.fromScale,u_scale_b:Y.toScale,u_tile_units_to_pixels:1/Go(te,1,me.transform.tileZoom),u_pixel_coord_upper:[Dr>>16,ur>>16],u_pixel_coord_lower:[Dr&65535,ur&65535]}}var Dc=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_lightpos:new e.Uniform3f(de,Y.u_lightpos),u_lightintensity:new e.Uniform1f(de,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(de,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(de,Y.u_vertical_gradient),u_opacity:new e.Uniform1f(de,Y.u_opacity)}},Cl=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_lightpos:new e.Uniform3f(de,Y.u_lightpos),u_lightintensity:new e.Uniform1f(de,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(de,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(de,Y.u_vertical_gradient),u_height_factor:new e.Uniform1f(de,Y.u_height_factor),u_image:new e.Uniform1i(de,Y.u_image),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(de,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(de,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(de,Y.u_scale),u_fade:new e.Uniform1f(de,Y.u_fade),u_opacity:new e.Uniform1f(de,Y.u_opacity)}},Vc=function(de,Y,me,te){var pe=Y.style.light,Ve=pe.properties.get("position"),ke=[Ve.x,Ve.y,Ve.z],Ye=e.create$1();pe.properties.get("anchor")==="viewport"&&e.fromRotation(Ye,-Y.transform.angle),e.transformMat3(ke,ke,Ye);var vt=pe.properties.get("color");return{u_matrix:de,u_lightpos:ke,u_lightintensity:pe.properties.get("intensity"),u_lightcolor:[vt.r,vt.g,vt.b],u_vertical_gradient:+me,u_opacity:te}},vu=function(de,Y,me,te,pe,Ve,ke){return e.extend(Vc(de,Y,me,te),hu(Ve,Y,ke),{u_height_factor:-Math.pow(2,pe.overscaledZ)/ke.tileSize/8})},Wu=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix)}},Fu=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_image:new e.Uniform1i(de,Y.u_image),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(de,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(de,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(de,Y.u_scale),u_fade:new e.Uniform1f(de,Y.u_fade)}},vl=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_world:new e.Uniform2f(de,Y.u_world)}},jl=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_world:new e.Uniform2f(de,Y.u_world),u_image:new e.Uniform1i(de,Y.u_image),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(de,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(de,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(de,Y.u_scale),u_fade:new e.Uniform1f(de,Y.u_fade)}},Xu=function(de){return{u_matrix:de}},lc=function(de,Y,me,te){return e.extend(Xu(de),hu(me,Y,te))},Mu=function(de,Y){return{u_matrix:de,u_world:Y}},Zu=function(de,Y,me,te,pe){return e.extend(lc(de,Y,me,te),{u_world:pe})},Yt=function(de,Y){return{u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(de,Y.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(de,Y.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(de,Y.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix)}},vr=function(de,Y,me,te){var pe=de.transform,Ve,ke;if(te.paint.get("circle-pitch-alignment")==="map"){var Ye=Go(me,1,pe.zoom);Ve=!0,ke=[Ye,Ye]}else Ve=!1,ke=pe.pixelsToGLUnits;return{u_camera_to_center_distance:pe.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:de.translatePosMatrix(Y.posMatrix,me,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ve,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:ke}},Qr=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(de,Y.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(de,Y.u_extrude_scale),u_overscale_factor:new e.Uniform1f(de,Y.u_overscale_factor)}},Wr=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_inv_matrix:new e.UniformMatrix4f(de,Y.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(de,Y.u_viewport_size)}},xa=function(de,Y,me){var te=Go(me,1,Y.zoom),pe=Math.pow(2,Y.zoom-me.tileID.overscaledZ),Ve=me.tileID.overscaleFactor();return{u_matrix:de,u_camera_to_center_distance:Y.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[Y.pixelsToGLUnits[0]/(te*pe),Y.pixelsToGLUnits[1]/(te*pe)],u_overscale_factor:Ve}},Qa=function(de,Y,me){return{u_matrix:de,u_inv_matrix:Y,u_camera_to_center_distance:me.cameraToCenterDistance,u_viewport_size:[me.width,me.height]}},xn=function(de,Y){return{u_color:new e.UniformColor(de,Y.u_color),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_overlay:new e.Uniform1i(de,Y.u_overlay),u_overlay_scale:new e.Uniform1f(de,Y.u_overlay_scale)}},zn=function(de,Y,me){return me===void 0&&(me=1),{u_matrix:de,u_color:Y,u_overlay:0,u_overlay_scale:me}},Gn=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix)}},ni=function(de){return{u_matrix:de}},wn=function(de,Y){return{u_extrude_scale:new e.Uniform1f(de,Y.u_extrude_scale),u_intensity:new e.Uniform1f(de,Y.u_intensity),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix)}},Sn=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_world:new e.Uniform2f(de,Y.u_world),u_image:new e.Uniform1i(de,Y.u_image),u_color_ramp:new e.Uniform1i(de,Y.u_color_ramp),u_opacity:new e.Uniform1f(de,Y.u_opacity)}},Ln=function(de,Y,me,te){return{u_matrix:de,u_extrude_scale:Go(Y,1,me),u_intensity:te}},un=function(de,Y,me,te){var pe=e.create();e.ortho(pe,0,de.width,de.height,0,0,1);var Ve=de.context.gl;return{u_matrix:pe,u_world:[Ve.drawingBufferWidth,Ve.drawingBufferHeight],u_image:me,u_color_ramp:te,u_opacity:Y.paint.get("heatmap-opacity")}},mi=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_image:new e.Uniform1i(de,Y.u_image),u_latrange:new e.Uniform2f(de,Y.u_latrange),u_light:new e.Uniform2f(de,Y.u_light),u_shadow:new e.UniformColor(de,Y.u_shadow),u_highlight:new e.UniformColor(de,Y.u_highlight),u_accent:new e.UniformColor(de,Y.u_accent)}},Oi=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_image:new e.Uniform1i(de,Y.u_image),u_dimension:new e.Uniform2f(de,Y.u_dimension),u_zoom:new e.Uniform1f(de,Y.u_zoom),u_unpack:new e.Uniform4f(de,Y.u_unpack)}},Vi=function(de,Y,me){var te=me.paint.get("hillshade-shadow-color"),pe=me.paint.get("hillshade-highlight-color"),Ve=me.paint.get("hillshade-accent-color"),ke=me.paint.get("hillshade-illumination-direction")*(Math.PI/180);me.paint.get("hillshade-illumination-anchor")==="viewport"&&(ke-=de.transform.angle);var Ye=!de.options.moving;return{u_matrix:de.transform.calculatePosMatrix(Y.tileID.toUnwrapped(),Ye),u_image:0,u_latrange:Yi(de,Y.tileID),u_light:[me.paint.get("hillshade-exaggeration"),ke],u_shadow:te,u_highlight:pe,u_accent:Ve}},Bi=function(de,Y){var me=Y.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[me,me],u_zoom:de.overscaledZ,u_unpack:Y.getUnpackVector()}};function Yi(de,Y){var me=Math.pow(2,Y.canonical.z),te=Y.canonical.y;return[new e.MercatorCoordinate(0,te/me).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/me).toLngLat().lat]}var vi=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_ratio:new e.Uniform1f(de,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(de,Y.u_units_to_pixels)}},Qn=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_ratio:new e.Uniform1f(de,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(de,Y.u_units_to_pixels),u_image:new e.Uniform1i(de,Y.u_image),u_image_height:new e.Uniform1f(de,Y.u_image_height)}},no=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_ratio:new e.Uniform1f(de,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_image:new e.Uniform1i(de,Y.u_image),u_units_to_pixels:new e.Uniform2f(de,Y.u_units_to_pixels),u_scale:new e.Uniform3f(de,Y.u_scale),u_fade:new e.Uniform1f(de,Y.u_fade)}},Ro=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_ratio:new e.Uniform1f(de,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(de,Y.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(de,Y.u_patternscale_a),u_patternscale_b:new e.Uniform2f(de,Y.u_patternscale_b),u_sdfgamma:new e.Uniform1f(de,Y.u_sdfgamma),u_image:new e.Uniform1i(de,Y.u_image),u_tex_y_a:new e.Uniform1f(de,Y.u_tex_y_a),u_tex_y_b:new e.Uniform1f(de,Y.u_tex_y_b),u_mix:new e.Uniform1f(de,Y.u_mix)}},as=function(de,Y,me){var te=de.transform;return{u_matrix:ul(de,Y,me),u_ratio:1/Go(Y,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Ps=function(de,Y,me,te){return e.extend(as(de,Y,me),{u_image:0,u_image_height:te})},ds=function(de,Y,me,te){var pe=de.transform,Ve=es(Y,pe);return{u_matrix:ul(de,Y,me),u_texsize:Y.imageAtlasTexture.size,u_ratio:1/Go(Y,1,pe.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ve,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/pe.pixelsToGLUnits[0],1/pe.pixelsToGLUnits[1]]}},Cs=function(de,Y,me,te,pe){var Ve=de.transform,ke=de.lineAtlas,Ye=es(Y,Ve),vt=me.layout.get("line-cap")==="round",Ot=ke.getDash(te.from,vt),dr=ke.getDash(te.to,vt),Dr=Ot.width*pe.fromScale,ur=dr.width*pe.toScale;return e.extend(as(de,Y,me),{u_patternscale_a:[Ye/Dr,-Ot.height/2],u_patternscale_b:[Ye/ur,-dr.height/2],u_sdfgamma:ke.width/(Math.min(Dr,ur)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:Ot.y,u_tex_y_b:dr.y,u_mix:pe.t})};function es(de,Y){return 1/Go(de,1,Y.tileZoom)}function ul(de,Y,me){return de.translatePosMatrix(Y.tileID.posMatrix,Y,me.paint.get("line-translate"),me.paint.get("line-translate-anchor"))}var Ws=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_tl_parent:new e.Uniform2f(de,Y.u_tl_parent),u_scale_parent:new e.Uniform1f(de,Y.u_scale_parent),u_buffer_scale:new e.Uniform1f(de,Y.u_buffer_scale),u_fade_t:new e.Uniform1f(de,Y.u_fade_t),u_opacity:new e.Uniform1f(de,Y.u_opacity),u_image0:new e.Uniform1i(de,Y.u_image0),u_image1:new e.Uniform1i(de,Y.u_image1),u_brightness_low:new e.Uniform1f(de,Y.u_brightness_low),u_brightness_high:new e.Uniform1f(de,Y.u_brightness_high),u_saturation_factor:new e.Uniform1f(de,Y.u_saturation_factor),u_contrast_factor:new e.Uniform1f(de,Y.u_contrast_factor),u_spin_weights:new e.Uniform3f(de,Y.u_spin_weights)}},Fs=function(de,Y,me,te,pe){return{u_matrix:de,u_tl_parent:Y,u_scale_parent:me,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*pe.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:pe.paint.get("raster-brightness-min"),u_brightness_high:pe.paint.get("raster-brightness-max"),u_saturation_factor:Ss(pe.paint.get("raster-saturation")),u_contrast_factor:yo(pe.paint.get("raster-contrast")),u_spin_weights:Mi(pe.paint.get("raster-hue-rotate"))}};function Mi(de){de*=Math.PI/180;var Y=Math.sin(de),me=Math.cos(de);return[(2*me+1)/3,(-Math.sqrt(3)*Y-me+1)/3,(Math.sqrt(3)*Y-me+1)/3]}function yo(de){return de>0?1/(1-de):1+de}function Ss(de){return de>0?1-1/(1.001-de):-de}var us=function(de,Y){return{u_is_size_zoom_constant:new e.Uniform1i(de,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(de,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(de,Y.u_size_t),u_size:new e.Uniform1f(de,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(de,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(de,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(de,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(de,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(de,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(de,Y.u_coord_matrix),u_is_text:new e.Uniform1i(de,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(de,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_texture:new e.Uniform1i(de,Y.u_texture)}},Pl=function(de,Y){return{u_is_size_zoom_constant:new e.Uniform1i(de,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(de,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(de,Y.u_size_t),u_size:new e.Uniform1f(de,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(de,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(de,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(de,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(de,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(de,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(de,Y.u_coord_matrix),u_is_text:new e.Uniform1i(de,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(de,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_texture:new e.Uniform1i(de,Y.u_texture),u_gamma_scale:new e.Uniform1f(de,Y.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(de,Y.u_is_halo)}},Ql=function(de,Y){return{u_is_size_zoom_constant:new e.Uniform1i(de,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(de,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(de,Y.u_size_t),u_size:new e.Uniform1f(de,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(de,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(de,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(de,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(de,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(de,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(de,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(de,Y.u_coord_matrix),u_is_text:new e.Uniform1i(de,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(de,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_texsize_icon:new e.Uniform2f(de,Y.u_texsize_icon),u_texture:new e.Uniform1i(de,Y.u_texture),u_texture_icon:new e.Uniform1i(de,Y.u_texture_icon),u_gamma_scale:new e.Uniform1f(de,Y.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(de,Y.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(de,Y.u_is_halo)}},du=function(de,Y,me,te,pe,Ve,ke,Ye,vt,Ot){var dr=pe.transform;return{u_is_size_zoom_constant:+(de==="constant"||de==="source"),u_is_size_feature_constant:+(de==="constant"||de==="camera"),u_size_t:Y?Y.uSizeT:0,u_size:Y?Y.uSize:0,u_camera_to_center_distance:dr.cameraToCenterDistance,u_pitch:dr.pitch/360*2*Math.PI,u_rotate_symbol:+me,u_aspect_ratio:dr.width/dr.height,u_fade_change:pe.options.fadeDuration?pe.symbolFadeChange:1,u_matrix:Ve,u_label_plane_matrix:ke,u_coord_matrix:Ye,u_is_text:+vt,u_pitch_with_map:+te,u_texsize:Ot,u_texture:0}},Yu=function(de,Y,me,te,pe,Ve,ke,Ye,vt,Ot,dr){var Dr=pe.transform;return e.extend(du(de,Y,me,te,pe,Ve,ke,Ye,vt,Ot),{u_gamma_scale:te?Math.cos(Dr._pitch)*Dr.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+dr})},Vl=function(de,Y,me,te,pe,Ve,ke,Ye,vt,Ot){return e.extend(Yu(de,Y,me,te,pe,Ve,ke,Ye,!0,vt,!0),{u_texsize_icon:Ot,u_texture_icon:1})},Ku=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_opacity:new e.Uniform1f(de,Y.u_opacity),u_color:new e.UniformColor(de,Y.u_color)}},Hl=function(de,Y){return{u_matrix:new e.UniformMatrix4f(de,Y.u_matrix),u_opacity:new e.Uniform1f(de,Y.u_opacity),u_image:new e.Uniform1i(de,Y.u_image),u_pattern_tl_a:new e.Uniform2f(de,Y.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(de,Y.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(de,Y.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(de,Y.u_pattern_br_b),u_texsize:new e.Uniform2f(de,Y.u_texsize),u_mix:new e.Uniform1f(de,Y.u_mix),u_pattern_size_a:new e.Uniform2f(de,Y.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(de,Y.u_pattern_size_b),u_scale_a:new e.Uniform1f(de,Y.u_scale_a),u_scale_b:new e.Uniform1f(de,Y.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(de,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(de,Y.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(de,Y.u_tile_units_to_pixels)}},Ou=function(de,Y,me){return{u_matrix:de,u_opacity:Y,u_color:me}},Ki=function(de,Y,me,te,pe,Ve){return e.extend(sc(te,Ve,me,pe),{u_matrix:de,u_opacity:Y})},xo={fillExtrusion:Dc,fillExtrusionPattern:Cl,fill:Wu,fillPattern:Fu,fillOutline:vl,fillOutlinePattern:jl,circle:Yt,collisionBox:Qr,collisionCircle:Wr,debug:xn,clippingMask:Gn,heatmap:wn,heatmapTexture:Sn,hillshade:mi,hillshadePrepare:Oi,line:vi,lineGradient:Qn,linePattern:no,lineSDF:Ro,raster:Ws,symbolIcon:us,symbolSDF:Pl,symbolTextAndIcon:Ql,background:Ku,backgroundPattern:Hl},Ju;function Eu(de,Y,me,te,pe,Ve,ke){for(var Ye=de.context,vt=Ye.gl,Ot=de.useProgram("collisionBox"),dr=[],Dr=0,ur=0,pt=0;pt0){var nr=e.create(),Vt=lr;e.mul(nr,er.placementInvProjMatrix,de.transform.glCoordMatrix),e.mul(nr,nr,er.placementViewportMatrix),dr.push({circleArray:cr,circleOffset:ur,transform:Vt,invTransform:nr}),Dr+=cr.length/4,ur=Dr}ar&&Ot.draw(Ye,vt.LINES,Sa.disabled,Ta.disabled,de.colorModeForRenderPass(),Rr.disabled,xa(lr,de.transform,Dt),me.id,ar.layoutVertexBuffer,ar.indexBuffer,ar.segments,null,de.transform.zoom,null,null,ar.collisionVertexBuffer)}}if(!(!ke||!dr.length)){var rr=de.useProgram("collisionCircle"),Nt=new e.StructArrayLayout2f1f2i16;Nt.resize(Dr*4),Nt._trim();for(var Pr=0,Hr=0,fa=dr;Hr=0&&(At[er.associatedIconIndex]={shiftedAnchor:Ya,angle:Bn})}}if(dr){pt.clear();for(var en=de.icon.placedSymbolArray,hn=0;hn0){var ke=e.browser.now(),Ye=(ke-de.timeAdded)/Ve,vt=Y?(ke-Y.timeAdded)/Ve:-1,Ot=me.getSource(),dr=pe.coveringZoomLevel({tileSize:Ot.tileSize,roundZoom:Ot.roundZoom}),Dr=!Y||Math.abs(Y.tileID.overscaledZ-dr)>Math.abs(de.tileID.overscaledZ-dr),ur=Dr&&de.refreshedUponExpiration?1:e.clamp(Dr?Ye:1-vt,0,1);return de.refreshedUponExpiration&&Ye>=1&&(de.refreshedUponExpiration=!1),Y?{opacity:1,mix:1-ur}:{opacity:ur,mix:0}}else return{opacity:1,mix:0}}function wr(de,Y,me){var te=me.paint.get("background-color"),pe=me.paint.get("background-opacity");if(pe!==0){var Ve=de.context,ke=Ve.gl,Ye=de.transform,vt=Ye.tileSize,Ot=me.paint.get("background-pattern");if(!de.isPatternMissing(Ot)){var dr=!Ot&&te.a===1&&pe===1&&de.opaquePassEnabledForLayer()?"opaque":"translucent";if(de.renderPass===dr){var Dr=Ta.disabled,ur=de.depthModeForSublayer(0,dr==="opaque"?Sa.ReadWrite:Sa.ReadOnly),pt=de.colorModeForRenderPass(),At=de.useProgram(Ot?"backgroundPattern":"background"),Dt=Ye.coveringTiles({tileSize:vt});Ot&&(Ve.activeTexture.set(ke.TEXTURE0),de.imageManager.bind(de.context));for(var er=me.getCrossfadeParameters(),lr=0,ar=Dt;lr "+me.overscaledZ);var lr=er+" "+pt+"kb";lo(de,lr),ke.draw(te,pe.TRIANGLES,Ye,vt,It.alphaBlended,Rr.disabled,zn(Ve,e.Color.transparent,Dt),dr,de.debugBuffer,de.quadTriangleIndexBuffer,de.debugSegments)}function lo(de,Y){de.initDebugOverlayCanvas();var me=de.debugOverlayCanvas,te=de.context.gl,pe=de.debugOverlayCanvas.getContext("2d");pe.clearRect(0,0,me.width,me.height),pe.shadowColor="white",pe.shadowBlur=2,pe.lineWidth=1.5,pe.strokeStyle="white",pe.textBaseline="top",pe.font="bold 36px Open Sans, sans-serif",pe.fillText(Y,5,5),pe.strokeText(Y,5,5),de.debugOverlayTexture.update(me),de.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function Vo(de,Y,me){var te=de.context,pe=me.implementation;if(de.renderPass==="offscreen"){var Ve=pe.prerender;Ve&&(de.setCustomLayerDefaults(),te.setColorMode(de.colorModeForRenderPass()),Ve.call(pe,te.gl,de.transform.customLayerMatrix()),te.setDirty(),de.setBaseState())}else if(de.renderPass==="translucent"){de.setCustomLayerDefaults(),te.setColorMode(de.colorModeForRenderPass()),te.setStencilMode(Ta.disabled);var ke=pe.renderingMode==="3d"?new Sa(de.context.gl.LEQUAL,Sa.ReadWrite,de.depthRangeFor3D):de.depthModeForSublayer(0,Sa.ReadOnly);te.setDepthMode(ke),pe.render(te.gl,de.transform.customLayerMatrix()),te.setDirty(),de.setBaseState(),te.bindFramebuffer.set(null)}}var co={symbol:R,circle:zt,heatmap:Zt,line:ta,fill:qe,"fill-extrusion":it,hillshade:Mt,raster:ir,background:wr,debug:Di,custom:Vo},Lo=function(Y,me){this.context=new Yr(Y),this.transform=me,this._tileTextures={},this.setup(),this.numSublayers=Jr.maxUnderzooming+Jr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ks,this.gpuTimers={}};Lo.prototype.resize=function(Y,me){if(this.width=Y*e.browser.devicePixelRatio,this.height=me*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,pe=this.style._order;te256&&this.clearStencil(),te.setColorMode(It.disabled),te.setDepthMode(Sa.disabled);var Ve=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var ke=0,Ye=me;ke256&&this.clearStencil();var Y=this.nextStencilID++,me=this.context.gl;return new Ta({func:me.NOTEQUAL,mask:255},Y,255,me.KEEP,me.KEEP,me.REPLACE)},Lo.prototype.stencilModeForClipping=function(Y){var me=this.context.gl;return new Ta({func:me.EQUAL,mask:255},this._tileClippingMaskIDs[Y.key],0,me.KEEP,me.KEEP,me.REPLACE)},Lo.prototype.stencilConfigForOverlap=function(Y){var me,te=this.context.gl,pe=Y.sort(function(Ot,dr){return dr.overscaledZ-Ot.overscaledZ}),Ve=pe[pe.length-1].overscaledZ,ke=pe[0].overscaledZ-Ve+1;if(ke>1){this.currentStencilSource=void 0,this.nextStencilID+ke>256&&this.clearStencil();for(var Ye={},vt=0;vt=0;this.currentLayer--){var nr=this.style._layers[pe[this.currentLayer]],Vt=Ve[nr.source],rr=vt[nr.source];this._renderTileClippingMasks(nr,rr),this.renderLayer(this,Vt,nr,rr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?me.pop():null},Lo.prototype.isPatternMissing=function(Y){if(!Y)return!1;if(!Y.from||!Y.to)return!0;var me=this.imageManager.getPattern(Y.from.toString()),te=this.imageManager.getPattern(Y.to.toString());return!me||!te},Lo.prototype.useProgram=function(Y,me){this.cache=this.cache||{};var te=""+Y+(me?me.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new Ac(this.context,Y,yc[Y],me,xo[Y],this._showOverdrawInspector)),this.cache[te]},Lo.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Lo.prototype.setBaseState=function(){var Y=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(Y.FUNC_ADD)},Lo.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var Y=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,Y.RGBA)}},Lo.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Zo=function(Y,me){this.points=Y,this.planes=me};Zo.fromInvProjectionMatrix=function(Y,me,te){var pe=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],Ve=Math.pow(2,te),ke=pe.map(function(Ot){return e.transformMat4([],Ot,Y)}).map(function(Ot){return e.scale$1([],Ot,1/Ot[3]/me*Ve)}),Ye=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],vt=Ye.map(function(Ot){var dr=e.sub([],ke[Ot[0]],ke[Ot[1]]),Dr=e.sub([],ke[Ot[2]],ke[Ot[1]]),ur=e.normalize([],e.cross([],dr,Dr)),pt=-e.dot(ur,ke[Ot[1]]);return ur.concat(pt)});return new Zo(ke,vt)};var Os=function(Y,me){this.min=Y,this.max=me,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Os.prototype.quadrant=function(Y){for(var me=[Y%2===0,Y<2],te=e.clone$2(this.min),pe=e.clone$2(this.max),Ve=0;Ve=0;if(ke===0)return 0;ke!==me.length&&(te=!1)}if(te)return 2;for(var vt=0;vt<3;vt++){for(var Ot=Number.MAX_VALUE,dr=-Number.MAX_VALUE,Dr=0;Drthis.max[vt]-this.min[vt])return 0}return 1};var Ls=function(Y,me,te,pe){if(Y===void 0&&(Y=0),me===void 0&&(me=0),te===void 0&&(te=0),pe===void 0&&(pe=0),isNaN(Y)||Y<0||isNaN(me)||me<0||isNaN(te)||te<0||isNaN(pe)||pe<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=Y,this.bottom=me,this.left=te,this.right=pe};Ls.prototype.interpolate=function(Y,me,te){return me.top!=null&&Y.top!=null&&(this.top=e.number(Y.top,me.top,te)),me.bottom!=null&&Y.bottom!=null&&(this.bottom=e.number(Y.bottom,me.bottom,te)),me.left!=null&&Y.left!=null&&(this.left=e.number(Y.left,me.left,te)),me.right!=null&&Y.right!=null&&(this.right=e.number(Y.right,me.right,te)),this},Ls.prototype.getCenter=function(Y,me){var te=e.clamp((this.left+Y-this.right)/2,0,Y),pe=e.clamp((this.top+me-this.bottom)/2,0,me);return new e.Point(te,pe)},Ls.prototype.equals=function(Y){return this.top===Y.top&&this.bottom===Y.bottom&&this.left===Y.left&&this.right===Y.right},Ls.prototype.clone=function(){return new Ls(this.top,this.bottom,this.left,this.right)},Ls.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Do=function(Y,me,te,pe,Ve){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ve===void 0?!0:Ve,this._minZoom=Y||0,this._maxZoom=me||22,this._minPitch=te??0,this._maxPitch=pe??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ls,this._posMatrixCache={},this._alignedPosMatrixCache={}},zo={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Do.prototype.clone=function(){var Y=new Do(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return Y.tileSize=this.tileSize,Y.latRange=this.latRange,Y.width=this.width,Y.height=this.height,Y._center=this._center,Y.zoom=this.zoom,Y.angle=this.angle,Y._fov=this._fov,Y._pitch=this._pitch,Y._unmodified=this._unmodified,Y._edgeInsets=this._edgeInsets.clone(),Y._calcMatrices(),Y},zo.minZoom.get=function(){return this._minZoom},zo.minZoom.set=function(de){this._minZoom!==de&&(this._minZoom=de,this.zoom=Math.max(this.zoom,de))},zo.maxZoom.get=function(){return this._maxZoom},zo.maxZoom.set=function(de){this._maxZoom!==de&&(this._maxZoom=de,this.zoom=Math.min(this.zoom,de))},zo.minPitch.get=function(){return this._minPitch},zo.minPitch.set=function(de){this._minPitch!==de&&(this._minPitch=de,this.pitch=Math.max(this.pitch,de))},zo.maxPitch.get=function(){return this._maxPitch},zo.maxPitch.set=function(de){this._maxPitch!==de&&(this._maxPitch=de,this.pitch=Math.min(this.pitch,de))},zo.renderWorldCopies.get=function(){return this._renderWorldCopies},zo.renderWorldCopies.set=function(de){de===void 0?de=!0:de===null&&(de=!1),this._renderWorldCopies=de},zo.worldSize.get=function(){return this.tileSize*this.scale},zo.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},zo.size.get=function(){return new e.Point(this.width,this.height)},zo.bearing.get=function(){return-this.angle/Math.PI*180},zo.bearing.set=function(de){var Y=-e.wrap(de,-180,180)*Math.PI/180;this.angle!==Y&&(this._unmodified=!1,this.angle=Y,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},zo.pitch.get=function(){return this._pitch/Math.PI*180},zo.pitch.set=function(de){var Y=e.clamp(de,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==Y&&(this._unmodified=!1,this._pitch=Y,this._calcMatrices())},zo.fov.get=function(){return this._fov/Math.PI*180},zo.fov.set=function(de){de=Math.max(.01,Math.min(60,de)),this._fov!==de&&(this._unmodified=!1,this._fov=de/180*Math.PI,this._calcMatrices())},zo.zoom.get=function(){return this._zoom},zo.zoom.set=function(de){var Y=Math.min(Math.max(de,this.minZoom),this.maxZoom);this._zoom!==Y&&(this._unmodified=!1,this._zoom=Y,this.scale=this.zoomScale(Y),this.tileZoom=Math.floor(Y),this.zoomFraction=Y-this.tileZoom,this._constrain(),this._calcMatrices())},zo.center.get=function(){return this._center},zo.center.set=function(de){de.lat===this._center.lat&&de.lng===this._center.lng||(this._unmodified=!1,this._center=de,this._constrain(),this._calcMatrices())},zo.padding.get=function(){return this._edgeInsets.toJSON()},zo.padding.set=function(de){this._edgeInsets.equals(de)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,de,1),this._calcMatrices())},zo.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Do.prototype.isPaddingEqual=function(Y){return this._edgeInsets.equals(Y)},Do.prototype.interpolatePadding=function(Y,me,te){this._unmodified=!1,this._edgeInsets.interpolate(Y,me,te),this._constrain(),this._calcMatrices()},Do.prototype.coveringZoomLevel=function(Y){var me=(Y.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/Y.tileSize));return Math.max(0,me)},Do.prototype.getVisibleUnwrappedCoordinates=function(Y){var me=[new e.UnwrappedTileID(0,Y)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),pe=this.pointCoordinate(new e.Point(this.width,0)),Ve=this.pointCoordinate(new e.Point(this.width,this.height)),ke=this.pointCoordinate(new e.Point(0,this.height)),Ye=Math.floor(Math.min(te.x,pe.x,Ve.x,ke.x)),vt=Math.floor(Math.max(te.x,pe.x,Ve.x,ke.x)),Ot=1,dr=Ye-Ot;dr<=vt+Ot;dr++)dr!==0&&me.push(new e.UnwrappedTileID(dr,Y));return me},Do.prototype.coveringTiles=function(Y){var me=this.coveringZoomLevel(Y),te=me;if(Y.minzoom!==void 0&&meY.maxzoom&&(me=Y.maxzoom);var pe=e.MercatorCoordinate.fromLngLat(this.center),Ve=Math.pow(2,me),ke=[Ve*pe.x,Ve*pe.y,0],Ye=Zo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,me),vt=Y.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(vt=me);var Ot=3,dr=function(Oa){return{aabb:new Os([Oa*Ve,0,0],[(Oa+1)*Ve,Ve,0]),zoom:0,x:0,y:0,wrap:Oa,fullyVisible:!1}},Dr=[],ur=[],pt=me,At=Y.reparseOverscaled?te:me;if(this._renderWorldCopies)for(var Dt=1;Dt<=3;Dt++)Dr.push(dr(-Dt)),Dr.push(dr(Dt));for(Dr.push(dr(0));Dr.length>0;){var er=Dr.pop(),lr=er.x,ar=er.y,cr=er.fullyVisible;if(!cr){var nr=er.aabb.intersects(Ye);if(nr===0)continue;cr=nr===2}var Vt=er.aabb.distanceX(ke),rr=er.aabb.distanceY(ke),Nt=Math.max(Math.abs(Vt),Math.abs(rr)),Pr=Ot+(1<Pr&&er.zoom>=vt){ur.push({tileID:new e.OverscaledTileID(er.zoom===pt?At:er.zoom,er.wrap,er.zoom,lr,ar),distanceSq:e.sqrLen([ke[0]-.5-lr,ke[1]-.5-ar])});continue}for(var Hr=0;Hr<4;Hr++){var fa=(lr<<1)+Hr%2,ln=(ar<<1)+(Hr>>1);Dr.push({aabb:er.aabb.quadrant(Hr),zoom:er.zoom+1,x:fa,y:ln,wrap:er.wrap,fullyVisible:cr})}}return ur.sort(function(Oa,Ya){return Oa.distanceSq-Ya.distanceSq}).map(function(Oa){return Oa.tileID})},Do.prototype.resize=function(Y,me){this.width=Y,this.height=me,this.pixelsToGLUnits=[2/Y,-2/me],this._constrain(),this._calcMatrices()},zo.unmodified.get=function(){return this._unmodified},Do.prototype.zoomScale=function(Y){return Math.pow(2,Y)},Do.prototype.scaleZoom=function(Y){return Math.log(Y)/Math.LN2},Do.prototype.project=function(Y){var me=e.clamp(Y.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(Y.lng)*this.worldSize,e.mercatorYfromLat(me)*this.worldSize)},Do.prototype.unproject=function(Y){return new e.MercatorCoordinate(Y.x/this.worldSize,Y.y/this.worldSize).toLngLat()},zo.point.get=function(){return this.project(this.center)},Do.prototype.setLocationAtPoint=function(Y,me){var te=this.pointCoordinate(me),pe=this.pointCoordinate(this.centerPoint),Ve=this.locationCoordinate(Y),ke=new e.MercatorCoordinate(Ve.x-(te.x-pe.x),Ve.y-(te.y-pe.y));this.center=this.coordinateLocation(ke),this._renderWorldCopies&&(this.center=this.center.wrap())},Do.prototype.locationPoint=function(Y){return this.coordinatePoint(this.locationCoordinate(Y))},Do.prototype.pointLocation=function(Y){return this.coordinateLocation(this.pointCoordinate(Y))},Do.prototype.locationCoordinate=function(Y){return e.MercatorCoordinate.fromLngLat(Y)},Do.prototype.coordinateLocation=function(Y){return Y.toLngLat()},Do.prototype.pointCoordinate=function(Y){var me=0,te=[Y.x,Y.y,0,1],pe=[Y.x,Y.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(pe,pe,this.pixelMatrixInverse);var Ve=te[3],ke=pe[3],Ye=te[0]/Ve,vt=pe[0]/ke,Ot=te[1]/Ve,dr=pe[1]/ke,Dr=te[2]/Ve,ur=pe[2]/ke,pt=Dr===ur?0:(me-Dr)/(ur-Dr);return new e.MercatorCoordinate(e.number(Ye,vt,pt)/this.worldSize,e.number(Ot,dr,pt)/this.worldSize)},Do.prototype.coordinatePoint=function(Y){var me=[Y.x*this.worldSize,Y.y*this.worldSize,0,1];return e.transformMat4(me,me,this.pixelMatrix),new e.Point(me[0]/me[3],me[1]/me[3])},Do.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Do.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Do.prototype.setMaxBounds=function(Y){Y?(this.lngRange=[Y.getWest(),Y.getEast()],this.latRange=[Y.getSouth(),Y.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Do.prototype.calculatePosMatrix=function(Y,me){me===void 0&&(me=!1);var te=Y.key,pe=me?this._alignedPosMatrixCache:this._posMatrixCache;if(pe[te])return pe[te];var Ve=Y.canonical,ke=this.worldSize/this.zoomScale(Ve.z),Ye=Ve.x+Math.pow(2,Ve.z)*Y.wrap,vt=e.identity(new Float64Array(16));return e.translate(vt,vt,[Ye*ke,Ve.y*ke,0]),e.scale(vt,vt,[ke/e.EXTENT,ke/e.EXTENT,1]),e.multiply(vt,me?this.alignedProjMatrix:this.projMatrix,vt),pe[te]=new Float32Array(vt),pe[te]},Do.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Do.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var Y=-90,me=90,te=-180,pe=180,Ve,ke,Ye,vt,Ot=this.size,dr=this._unmodified;if(this.latRange){var Dr=this.latRange;Y=e.mercatorYfromLat(Dr[1])*this.worldSize,me=e.mercatorYfromLat(Dr[0])*this.worldSize,Ve=me-Yme&&(vt=me-er)}if(this.lngRange){var lr=pt.x,ar=Ot.x/2;lr-arpe&&(Ye=pe-ar)}(Ye!==void 0||vt!==void 0)&&(this.center=this.unproject(new e.Point(Ye!==void 0?Ye:pt.x,vt!==void 0?vt:pt.y))),this._unmodified=dr,this._constraining=!1}},Do.prototype._calcMatrices=function(){if(this.height){var Y=this._fov/2,me=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(Y)*this.height;var te=Math.PI/2+this._pitch,pe=this._fov*(.5+me.y/this.height),Ve=Math.sin(pe)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-pe,.01,Math.PI-.01)),ke=this.point,Ye=ke.x,vt=ke.y,Ot=Math.cos(Math.PI/2-this._pitch)*Ve+this.cameraToCenterDistance,dr=Ot*1.01,Dr=this.height/50,ur=new Float64Array(16);e.perspective(ur,this._fov,this.width/this.height,Dr,dr),ur[8]=-me.x*2/this.width,ur[9]=me.y*2/this.height,e.scale(ur,ur,[1,-1,1]),e.translate(ur,ur,[0,0,-this.cameraToCenterDistance]),e.rotateX(ur,ur,this._pitch),e.rotateZ(ur,ur,this.angle),e.translate(ur,ur,[-Ye,-vt,0]),this.mercatorMatrix=e.scale([],ur,[this.worldSize,this.worldSize,this.worldSize]),e.scale(ur,ur,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ur,this.invProjMatrix=e.invert([],this.projMatrix);var pt=this.width%2/2,At=this.height%2/2,Dt=Math.cos(this.angle),er=Math.sin(this.angle),lr=Ye-Math.round(Ye)+Dt*pt+er*At,ar=vt-Math.round(vt)+Dt*At+er*pt,cr=new Float64Array(ur);if(e.translate(cr,cr,[lr>.5?lr-1:lr,ar>.5?ar-1:ar,0]),this.alignedProjMatrix=cr,ur=e.create(),e.scale(ur,ur,[this.width/2,-this.height/2,1]),e.translate(ur,ur,[1,-1,0]),this.labelPlaneMatrix=ur,ur=e.create(),e.scale(ur,ur,[1,-1,1]),e.translate(ur,ur,[-1,-1,0]),e.scale(ur,ur,[2/this.width,2/this.height,1]),this.glCoordMatrix=ur,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),ur=e.invert(new Float64Array(16),this.pixelMatrix),!ur)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ur,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Do.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var Y=this.pointCoordinate(new e.Point(0,0)),me=[Y.x*this.worldSize,Y.y*this.worldSize,0,1],te=e.transformMat4(me,me,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},Do.prototype.getCameraPoint=function(){var Y=this._pitch,me=Math.tan(Y)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,me))},Do.prototype.getCameraQueryGeometry=function(Y){var me=this.getCameraPoint();if(Y.length===1)return[Y[0],me];for(var te=me.x,pe=me.y,Ve=me.x,ke=me.y,Ye=0,vt=Y;Ye=3&&!Y.some(function(te){return isNaN(te)})){var me=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(Y[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+Y[2],+Y[1]],zoom:+Y[0],bearing:me,pitch:+(Y[4]||0)}),!0}return!1},Sl.prototype._updateHashUnthrottled=function(){var Y=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,Y)}catch{}};var eu={linearity:.3,easing:e.bezier(0,0,.3,1)},Fl=e.extend({deceleration:2500,maxSpeed:1400},eu),Js=e.extend({deceleration:20,maxSpeed:1400},eu),Il=e.extend({deceleration:1e3,maxSpeed:360},eu),ku=e.extend({deceleration:1e3,maxSpeed:90},eu),dl=function(Y){this._map=Y,this.clear()};dl.prototype.clear=function(){this._inertiaBuffer=[]},dl.prototype.record=function(Y){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:Y})},dl.prototype._drainInertiaBuffer=function(){for(var Y=this._inertiaBuffer,me=e.browser.now(),te=160;Y.length>0&&me-Y[0].time>te;)Y.shift()},dl.prototype._onMoveEnd=function(Y){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var me={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,pe=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new Re(Y.type,this._map,Y))},mt.prototype.dblclick=function(Y){return this._firePreventable(new Re(Y.type,this._map,Y))},mt.prototype.mouseover=function(Y){this._map.fire(new Re(Y.type,this._map,Y))},mt.prototype.mouseout=function(Y){this._map.fire(new Re(Y.type,this._map,Y))},mt.prototype.touchstart=function(Y){return this._firePreventable(new Je(Y.type,this._map,Y))},mt.prototype.touchmove=function(Y){this._map.fire(new Je(Y.type,this._map,Y))},mt.prototype.touchend=function(Y){this._map.fire(new Je(Y.type,this._map,Y))},mt.prototype.touchcancel=function(Y){this._map.fire(new Je(Y.type,this._map,Y))},mt.prototype._firePreventable=function(Y){if(this._map.fire(Y),Y.defaultPrevented)return{}},mt.prototype.isEnabled=function(){return!0},mt.prototype.isActive=function(){return!1},mt.prototype.enable=function(){},mt.prototype.disable=function(){};var wt=function(Y){this._map=Y};wt.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},wt.prototype.mousemove=function(Y){this._map.fire(new Re(Y.type,this._map,Y))},wt.prototype.mousedown=function(){this._delayContextMenu=!0},wt.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Re("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},wt.prototype.contextmenu=function(Y){this._delayContextMenu?this._contextMenuEvent=Y:this._map.fire(new Re(Y.type,this._map,Y)),this._map.listens("contextmenu")&&Y.preventDefault()},wt.prototype.isEnabled=function(){return!0},wt.prototype.isActive=function(){return!1},wt.prototype.enable=function(){},wt.prototype.disable=function(){};var $t=function(Y,me){this._map=Y,this._el=Y.getCanvasContainer(),this._container=Y.getContainer(),this._clickTolerance=me.clickTolerance||1};$t.prototype.isEnabled=function(){return!!this._enabled},$t.prototype.isActive=function(){return!!this._active},$t.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},$t.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},$t.prototype.mousedown=function(Y,me){this.isEnabled()&&Y.shiftKey&&Y.button===0&&(r.disableDrag(),this._startPos=this._lastPos=me,this._active=!0)},$t.prototype.mousemoveWindow=function(Y,me){if(this._active){var te=me;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=Y.timeStamp),te.length===this.numTouches&&(this.centroid=hr(me),this.touches=Rt(te,me)))},ua.prototype.touchmove=function(Y,me,te){if(!(this.aborted||!this.centroid)){var pe=Rt(te,me);for(var Ve in this.touches){var ke=this.touches[Ve],Ye=pe[Ve];(!Ye||Ye.dist(ke)>va)&&(this.aborted=!0)}}},ua.prototype.touchend=function(Y,me,te){if((!this.centroid||Y.timeStamp-this.startTime>jr)&&(this.aborted=!0),te.length===0){var pe=!this.aborted&&this.centroid;if(this.reset(),pe)return pe}};var Ha=function(Y){this.singleTap=new ua(Y),this.numTaps=Y.numTaps,this.reset()};Ha.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ha.prototype.touchstart=function(Y,me,te){this.singleTap.touchstart(Y,me,te)},Ha.prototype.touchmove=function(Y,me,te){this.singleTap.touchmove(Y,me,te)},Ha.prototype.touchend=function(Y,me,te){var pe=this.singleTap.touchend(Y,me,te);if(pe){var Ve=Y.timeStamp-this.lastTime0&&(this._active=!0);var pe=Rt(te,me),Ve=new e.Point(0,0),ke=new e.Point(0,0),Ye=0;for(var vt in pe){var Ot=pe[vt],dr=this._touches[vt];dr&&(Ve._add(Ot),ke._add(Ot.sub(dr)),Ye++,pe[vt]=Ot)}if(this._touches=pe,!(YeMath.abs(de.x)}var si=100,$i=(function(de){function Y(){de.apply(this,arguments)}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.reset=function(){de.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},Y.prototype._start=function(te){this._lastPoints=te,Xs(te[0].sub(te[1]))&&(this._valid=!1)},Y.prototype._move=function(te,pe,Ve){var ke=te[0].sub(this._lastPoints[0]),Ye=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(ke,Ye,Ve.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var vt=(ke.y+Ye.y)/2,Ot=-.5;return{pitchDelta:vt*Ot}}},Y.prototype.gestureBeginsVertically=function(te,pe,Ve){if(this._valid!==void 0)return this._valid;var ke=2,Ye=te.mag()>=ke,vt=pe.mag()>=ke;if(!(!Ye&&!vt)){if(!Ye||!vt)return this._firstMove===void 0&&(this._firstMove=Ve),Ve-this._firstMove0==pe.y>0;return Xs(te)&&Xs(pe)&&Ot}},Y})(yi),Wo={panStep:100,bearingStep:15,pitchStep:10},Yo=function(){var Y=Wo;this._panStep=Y.panStep,this._bearingStep=Y.bearingStep,this._pitchStep=Y.pitchStep,this._rotationDisabled=!1};Yo.prototype.reset=function(){this._active=!1},Yo.prototype.keydown=function(Y){var me=this;if(!(Y.altKey||Y.ctrlKey||Y.metaKey)){var te=0,pe=0,Ve=0,ke=0,Ye=0;switch(Y.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:Y.shiftKey?pe=-1:(Y.preventDefault(),ke=-1);break;case 39:Y.shiftKey?pe=1:(Y.preventDefault(),ke=1);break;case 38:Y.shiftKey?Ve=1:(Y.preventDefault(),Ye=-1);break;case 40:Y.shiftKey?Ve=-1:(Y.preventDefault(),Ye=1);break;default:return}return this._rotationDisabled&&(pe=0,Ve=0),{cameraAnimation:function(vt){var Ot=vt.getZoom();vt.easeTo({duration:300,easeId:"keyboardHandler",easing:$s,zoom:te?Math.round(Ot)+te*(Y.shiftKey?2:1):Ot,bearing:vt.getBearing()+pe*me._bearingStep,pitch:vt.getPitch()+Ve*me._pitchStep,offset:[-ke*me._panStep,-Ye*me._panStep],center:vt.getCenter()},{originalEvent:Y})}}}},Yo.prototype.enable=function(){this._enabled=!0},Yo.prototype.disable=function(){this._enabled=!1,this.reset()},Yo.prototype.isEnabled=function(){return this._enabled},Yo.prototype.isActive=function(){return this._active},Yo.prototype.disableRotation=function(){this._rotationDisabled=!0},Yo.prototype.enableRotation=function(){this._rotationDisabled=!1};function $s(de){return de*(2-de)}var ml=4.000244140625,Wl=1/100,ol=1/450,Bu=2,tt=function(Y,me){this._map=Y,this._el=Y.getCanvasContainer(),this._handler=me,this._delta=0,this._defaultZoomRate=Wl,this._wheelZoomRate=ol,e.bindAll(["_onTimeout"],this)};tt.prototype.setZoomRate=function(Y){this._defaultZoomRate=Y},tt.prototype.setWheelZoomRate=function(Y){this._wheelZoomRate=Y},tt.prototype.isEnabled=function(){return!!this._enabled},tt.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},tt.prototype.isZooming=function(){return!!this._zooming},tt.prototype.enable=function(Y){this.isEnabled()||(this._enabled=!0,this._aroundCenter=Y&&Y.around==="center")},tt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},tt.prototype.wheel=function(Y){if(this.isEnabled()){var me=Y.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?Y.deltaY*40:Y.deltaY,te=e.browser.now(),pe=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,me!==0&&me%ml===0?this._type="wheel":me!==0&&Math.abs(me)<4?this._type="trackpad":pe>400?(this._type=null,this._lastValue=me,this._timeout=setTimeout(this._onTimeout,40,Y)):this._type||(this._type=Math.abs(pe*me)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,me+=this._lastValue)),Y.shiftKey&&me&&(me=me/4),this._type&&(this._lastWheelEvent=Y,this._delta-=me,this._active||this._start(Y)),Y.preventDefault()}},tt.prototype._onTimeout=function(Y){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Y)},tt.prototype._start=function(Y){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var me=r.mousePos(this._el,Y);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(me)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},tt.prototype.renderFrame=function(){var Y=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var me=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>ml?this._wheelZoomRate:this._defaultZoomRate,pe=Bu/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&pe!==0&&(pe=1/pe);var Ve=typeof this._targetZoom=="number"?me.zoomScale(this._targetZoom):me.scale;this._targetZoom=Math.min(me.maxZoom,Math.max(me.minZoom,me.scaleZoom(Ve*pe))),this._type==="wheel"&&(this._startZoom=me.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var ke=typeof this._targetZoom=="number"?this._targetZoom:me.zoom,Ye=this._startZoom,vt=this._easing,Ot=!1,dr;if(this._type==="wheel"&&Ye&&vt){var Dr=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),ur=vt(Dr);dr=e.number(Ye,ke,ur),Dr<1?this._frameId||(this._frameId=!0):Ot=!0}else dr=ke,Ot=!0;return this._active=!0,Ot&&(this._active=!1,this._finishTimeout=setTimeout(function(){Y._zooming=!1,Y._handler._triggerRenderFrame(),delete Y._targetZoom,delete Y._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Ot,zoomDelta:dr-me.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},tt.prototype._smoothOutEasing=function(Y){var me=e.ease;if(this._prevEase){var te=this._prevEase,pe=(e.browser.now()-te.start)/te.duration,Ve=te.easing(pe+.01)-te.easing(pe),ke=.27/Math.sqrt(Ve*Ve+1e-4)*.01,Ye=Math.sqrt(.27*.27-ke*ke);me=e.bezier(ke,Ye,.25,1)}return this._prevEase={start:e.browser.now(),duration:Y,easing:me},me},tt.prototype.reset=function(){this._active=!1};var qt=function(Y,me){this._clickZoom=Y,this._tapZoom=me};qt.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},qt.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},qt.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},qt.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var sr=function(){this.reset()};sr.prototype.reset=function(){this._active=!1},sr.prototype.dblclick=function(Y,me){return Y.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(Y.shiftKey?-1:1),around:te.unproject(me)},{originalEvent:Y})}}},sr.prototype.enable=function(){this._enabled=!0},sr.prototype.disable=function(){this._enabled=!1,this.reset()},sr.prototype.isEnabled=function(){return this._enabled},sr.prototype.isActive=function(){return this._active};var ra=function(){this._tap=new Ha({numTouches:1,numTaps:1}),this.reset()};ra.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ra.prototype.touchstart=function(Y,me,te){this._swipePoint||(this._tapTime&&Y.timeStamp-this._tapTime>Br&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=me[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(Y,me,te))},ra.prototype.touchmove=function(Y,me,te){if(!this._tapTime)this._tap.touchmove(Y,me,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var pe=me[0],Ve=pe.y-this._swipePoint.y;return this._swipePoint=pe,Y.preventDefault(),this._active=!0,{zoomDelta:Ve/128}}},ra.prototype.touchend=function(Y,me,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var pe=this._tap.touchend(Y,me,te);pe&&(this._tapTime=Y.timeStamp)}},ra.prototype.touchcancel=function(){this.reset()},ra.prototype.enable=function(){this._enabled=!0},ra.prototype.disable=function(){this._enabled=!1,this.reset()},ra.prototype.isEnabled=function(){return this._enabled},ra.prototype.isActive=function(){return this._active};var da=function(Y,me,te){this._el=Y,this._mousePan=me,this._touchPan=te};da.prototype.enable=function(Y){this._inertiaOptions=Y||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},da.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},da.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},da.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ca=function(Y,me,te){this._pitchWithRotate=Y.pitchWithRotate,this._mouseRotate=me,this._mousePitch=te};ca.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ca.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ca.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ca.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ha=function(Y,me,te,pe){this._el=Y,this._touchZoom=me,this._touchRotate=te,this._tapDragZoom=pe,this._rotationDisabled=!1,this._enabled=!0};ha.prototype.enable=function(Y){this._touchZoom.enable(Y),this._rotationDisabled||this._touchRotate.enable(Y),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},ha.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},ha.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ha.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ha.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ha.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Va=function(de){return de.zoom||de.drag||de.pitch||de.rotate},dn=(function(de){function Y(){de.apply(this,arguments)}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y})(e.Event);function fn(de){return de.panDelta&&de.panDelta.mag()||de.zoomDelta||de.bearingDelta||de.pitchDelta}var $a=function(Y,me){this._map=Y,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dl(Y),this._bearingSnap=me.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(me),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var pe=0,Ve=this._listeners;peYe?Math.min(2,Vt):Math.max(.5,Vt),Oa=Math.pow(ln,1-Hr),Ya=ke.unproject(cr.add(nr.mult(Hr*Oa)).mult(fa));ke.setLocationAtPoint(ke.renderWorldCopies?Ya.wrap():Ya,er)}Ve._fireMoveEvents(pe)},function(Hr){Ve._afterEase(pe,Hr)},te),this},Y.prototype._prepareEase=function(te,pe,Ve){Ve===void 0&&(Ve={}),this._moving=!0,!pe&&!Ve.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ve.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ve.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ve.pitching&&this.fire(new e.Event("pitchstart",te))},Y.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},Y.prototype._afterEase=function(te,pe){if(!(this._easeId&&pe&&this._easeId===pe)){delete this._easeId;var Ve=this._zooming,ke=this._rotating,Ye=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ve&&this.fire(new e.Event("zoomend",te)),ke&&this.fire(new e.Event("rotateend",te)),Ye&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},Y.prototype.flyTo=function(te,pe){var Ve=this;if(!te.essential&&e.browser.prefersReducedMotion){var ke=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ke,pe)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var Ye=this.transform,vt=this.getZoom(),Ot=this.getBearing(),dr=this.getPitch(),Dr=this.getPadding(),ur="zoom"in te?e.clamp(+te.zoom,Ye.minZoom,Ye.maxZoom):vt,pt="bearing"in te?this._normalizeBearing(te.bearing,Ot):Ot,At="pitch"in te?+te.pitch:dr,Dt="padding"in te?te.padding:Ye.padding,er=Ye.zoomScale(ur-vt),lr=e.Point.convert(te.offset),ar=Ye.centerPoint.add(lr),cr=Ye.pointLocation(ar),nr=e.LngLat.convert(te.center||cr);this._normalizeCenter(nr);var Vt=Ye.project(cr),rr=Ye.project(nr).sub(Vt),Nt=te.curve,Pr=Math.max(Ye.width,Ye.height),Hr=Pr/er,fa=rr.mag();if("minZoom"in te){var ln=e.clamp(Math.min(te.minZoom,vt,ur),Ye.minZoom,Ye.maxZoom),Oa=Pr/Ye.zoomScale(ln-vt);Nt=Math.sqrt(Oa/fa*2)}var Ya=Nt*Nt;function Bn(bo){var ns=(Hr*Hr-Pr*Pr+(bo?-1:1)*Ya*Ya*fa*fa)/(2*(bo?Hr:Pr)*Ya*fa);return Math.log(Math.sqrt(ns*ns+1)-ns)}function En(bo){return(Math.exp(bo)-Math.exp(-bo))/2}function en(bo){return(Math.exp(bo)+Math.exp(-bo))/2}function hn(bo){return En(bo)/en(bo)}var mn=Bn(0),Pn=function(bo){return en(mn)/en(mn+Nt*bo)},ti=function(bo){return Pr*((en(mn)*hn(mn+Nt*bo)-En(mn))/Ya)/fa},io=(Bn(1)-mn)/Nt;if(Math.abs(fa)<1e-6||!isFinite(io)){if(Math.abs(Pr-Hr)<1e-6)return this.easeTo(te,pe);var Ao=Hrte.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=Ot!==pt,this._pitching=At!==dr,this._padding=!Ye.isPaddingEqual(Dt),this._prepareEase(pe,!1),this._ease(function(bo){var ns=bo*io,As=1/Pn(ns);Ye.zoom=bo===1?ur:vt+Ye.scaleZoom(As),Ve._rotating&&(Ye.bearing=e.number(Ot,pt,bo)),Ve._pitching&&(Ye.pitch=e.number(dr,At,bo)),Ve._padding&&(Ye.interpolatePadding(Dr,Dt,bo),ar=Ye.centerPoint.add(lr));var Ol=bo===1?nr:Ye.unproject(Vt.add(rr.mult(ti(ns))).mult(As));Ye.setLocationAtPoint(Ye.renderWorldCopies?Ol.wrap():Ol,ar),Ve._fireMoveEvents(pe)},function(){return Ve._afterEase(pe)},te),this},Y.prototype.isEasing=function(){return!!this._easeFrameId},Y.prototype.stop=function(){return this._stop()},Y.prototype._stop=function(te,pe){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ve=this._onEaseEnd;delete this._onEaseEnd,Ve.call(this,pe)}if(!te){var ke=this.handlers;ke&&ke.stop(!1)}return this},Y.prototype._ease=function(te,pe,Ve){Ve.animate===!1||Ve.duration===0?(te(1),pe()):(this._easeStart=e.browser.now(),this._easeOptions=Ve,this._onEaseFrame=te,this._onEaseEnd=pe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},Y.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},Y.prototype._normalizeBearing=function(te,pe){te=e.wrap(te,-180,180);var Ve=Math.abs(te-pe);return Math.abs(te-360-pe)180?-360:Ve<-180?360:0}},Y})(e.Evented),Mn=function(Y){Y===void 0&&(Y={}),this.options=Y,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mn.prototype.getDefaultPosition=function(){return"bottom-right"},Mn.prototype.onAdd=function(Y){var me=this.options&&this.options.compact;return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),me&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),me===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mn.prototype._setElementTitle=function(Y,me){var te=this._map._getUIString("AttributionControl."+me);Y.title=te,Y.setAttribute("aria-label",te)},Mn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Mn.prototype._updateEditLink=function(){var Y=this._editLink;Y||(Y=this._editLink=this._container.querySelector(".mapbox-improve-map"));var me=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(Y){var te=me.reduce(function(pe,Ve,ke){return Ve.value&&(pe+=Ve.key+"="+Ve.value+(ke=0)return!1;return!0});var Ye=Y.join(" | ");Ye!==this._attribHTML&&(this._attribHTML=Ye,Y.length?(this._innerContainer.innerHTML=Ye,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var _n=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};_n.prototype.onAdd=function(Y){this._map=Y,this._container=r.create("div","mapboxgl-ctrl");var me=r.create("a","mapboxgl-ctrl-logo");return me.target="_blank",me.rel="noopener nofollow",me.href="https://www.mapbox.com/",me.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),me.setAttribute("rel","noopener nofollow"),this._container.appendChild(me),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_n.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_n.prototype.getDefaultPosition=function(){return"bottom-left"},_n.prototype._updateLogo=function(Y){(!Y||Y.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},_n.prototype._logoRequired=function(){if(this._map.style){var Y=this._map.style.sourceCaches;for(var me in Y){var te=Y[me].getSource();if(te.mapbox_logo)return!0}return!1}},_n.prototype._updateCompact=function(){var Y=this._container.children;if(Y.length){var me=Y[0];this._map.getCanvasContainer().offsetWidth<250?me.classList.add("mapboxgl-compact"):me.classList.remove("mapboxgl-compact")}};var Ia=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ia.prototype.add=function(Y){var me=++this._id,te=this._queue;return te.push({callback:Y,id:me,cancelled:!1}),me},Ia.prototype.remove=function(Y){for(var me=this._currentlyRunning,te=me?this._queue.concat(me):this._queue,pe=0,Ve=te;pete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchai)throw new Error("maxPitch must be less than or equal to "+ai);var Ve=new Do(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(de.call(this,Ve,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Ia,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Zr,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof Wa)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return pe._update(!1)}),this.on("moveend",function(){return pe._update(!1)}),this.on("zoom",function(){return pe._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new $a(this,te);var ke=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new Sl(ke).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Mn({customAttribution:te.customAttribution})),this.addControl(new _n,te.logoPosition),this.on("style.load",function(){pe.transform.unmodified&&pe.jumpTo(pe.style.stylesheet)}),this.on("data",function(Ye){pe._update(Ye.dataType==="style"),pe.fire(new e.Event(Ye.dataType+"data",Ye))}),this.on("dataloading",function(Ye){pe.fire(new e.Event(Ye.dataType+"dataloading",Ye))})}de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y;var me={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return Y.prototype._getMapId=function(){return this._mapId},Y.prototype.addControl=function(pe,Ve){if(Ve===void 0&&(pe.getDefaultPosition?Ve=pe.getDefaultPosition():Ve="top-right"),!pe||!pe.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var ke=pe.onAdd(this);this._controls.push(pe);var Ye=this._controlPositions[Ve];return Ve.indexOf("bottom")!==-1?Ye.insertBefore(ke,Ye.firstChild):Ye.appendChild(ke),this},Y.prototype.removeControl=function(pe){if(!pe||!pe.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ve=this._controls.indexOf(pe);return Ve>-1&&this._controls.splice(Ve,1),pe.onRemove(this),this},Y.prototype.hasControl=function(pe){return this._controls.indexOf(pe)>-1},Y.prototype.resize=function(pe){var Ve=this._containerDimensions(),ke=Ve[0],Ye=Ve[1];this._resizeCanvas(ke,Ye),this.transform.resize(ke,Ye),this.painter.resize(ke,Ye);var vt=!this._moving;return vt&&(this.stop(),this.fire(new e.Event("movestart",pe)).fire(new e.Event("move",pe))),this.fire(new e.Event("resize",pe)),vt&&this.fire(new e.Event("moveend",pe)),this},Y.prototype.getBounds=function(){return this.transform.getBounds()},Y.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},Y.prototype.setMaxBounds=function(pe){return this.transform.setMaxBounds(e.LngLatBounds.convert(pe)),this._update()},Y.prototype.setMinZoom=function(pe){if(pe=pe??Fa,pe>=Fa&&pe<=this.transform.maxZoom)return this.transform.minZoom=pe,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=pe,this._update(),this.getZoom()>pe&&this.setZoom(pe),this;throw new Error("maxZoom must be greater than the current minZoom")},Y.prototype.getMaxZoom=function(){return this.transform.maxZoom},Y.prototype.setMinPitch=function(pe){if(pe=pe??bn,pe=bn&&pe<=this.transform.maxPitch)return this.transform.minPitch=pe,this._update(),this.getPitch()ai)throw new Error("maxPitch must be less than or equal to "+ai);if(pe>=this.transform.minPitch)return this.transform.maxPitch=pe,this._update(),this.getPitch()>pe&&this.setPitch(pe),this;throw new Error("maxPitch must be greater than the current minPitch")},Y.prototype.getMaxPitch=function(){return this.transform.maxPitch},Y.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},Y.prototype.setRenderWorldCopies=function(pe){return this.transform.renderWorldCopies=pe,this._update()},Y.prototype.project=function(pe){return this.transform.locationPoint(e.LngLat.convert(pe))},Y.prototype.unproject=function(pe){return this.transform.pointLocation(e.Point.convert(pe))},Y.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},Y.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},Y.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},Y.prototype._createDelegatedListener=function(pe,Ve,ke){var Ye=this,vt;if(pe==="mouseenter"||pe==="mouseover"){var Ot=!1,dr=function(er){var lr=Ye.getLayer(Ve)?Ye.queryRenderedFeatures(er.point,{layers:[Ve]}):[];lr.length?Ot||(Ot=!0,ke.call(Ye,new Re(pe,Ye,er.originalEvent,{features:lr}))):Ot=!1},Dr=function(){Ot=!1};return{layer:Ve,listener:ke,delegates:{mousemove:dr,mouseout:Dr}}}else if(pe==="mouseleave"||pe==="mouseout"){var ur=!1,pt=function(er){var lr=Ye.getLayer(Ve)?Ye.queryRenderedFeatures(er.point,{layers:[Ve]}):[];lr.length?ur=!0:ur&&(ur=!1,ke.call(Ye,new Re(pe,Ye,er.originalEvent)))},At=function(er){ur&&(ur=!1,ke.call(Ye,new Re(pe,Ye,er.originalEvent)))};return{layer:Ve,listener:ke,delegates:{mousemove:pt,mouseout:At}}}else{var Dt=function(er){var lr=Ye.getLayer(Ve)?Ye.queryRenderedFeatures(er.point,{layers:[Ve]}):[];lr.length&&(er.features=lr,ke.call(Ye,er),delete er.features)};return{layer:Ve,listener:ke,delegates:(vt={},vt[pe]=Dt,vt)}}},Y.prototype.on=function(pe,Ve,ke){if(ke===void 0)return de.prototype.on.call(this,pe,Ve);var Ye=this._createDelegatedListener(pe,Ve,ke);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[pe]=this._delegatedListeners[pe]||[],this._delegatedListeners[pe].push(Ye);for(var vt in Ye.delegates)this.on(vt,Ye.delegates[vt]);return this},Y.prototype.once=function(pe,Ve,ke){if(ke===void 0)return de.prototype.once.call(this,pe,Ve);var Ye=this._createDelegatedListener(pe,Ve,ke);for(var vt in Ye.delegates)this.once(vt,Ye.delegates[vt]);return this},Y.prototype.off=function(pe,Ve,ke){var Ye=this;if(ke===void 0)return de.prototype.off.call(this,pe,Ve);var vt=function(Ot){for(var dr=Ot[pe],Dr=0;Dr180;){var ke=me.locationPoint(de);if(ke.x>=0&&ke.y>=0&&ke.x<=me.width&&ke.y<=me.height)break;de.lng>me.center.lng?de.lng-=360:de.lng+=360}return de}var oi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function bi(de,Y,me){var te=de.classList;for(var pe in oi)te.remove("mapboxgl-"+me+"-anchor-"+pe);te.add("mapboxgl-"+me+"-anchor-"+Y)}var Tn=(function(de){function Y(me,te){if(de.call(this),(me instanceof e.window.HTMLElement||te)&&(me=e.extend({element:me},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=me&&me.anchor||"center",this._color=me&&me.color||"#3FB1CE",this._scale=me&&me.scale||1,this._draggable=me&&me.draggable||!1,this._clickTolerance=me&&me.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=me&&me.rotation||0,this._rotationAlignment=me&&me.rotationAlignment||"auto",this._pitchAlignment=me&&me.pitchAlignment&&me.pitchAlignment!=="auto"?me.pitchAlignment:this._rotationAlignment,!me||!me.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var pe=r.createNS("http://www.w3.org/2000/svg","svg"),Ve=41,ke=27;pe.setAttributeNS(null,"display","block"),pe.setAttributeNS(null,"height",Ve+"px"),pe.setAttributeNS(null,"width",ke+"px"),pe.setAttributeNS(null,"viewBox","0 0 "+ke+" "+Ve);var Ye=r.createNS("http://www.w3.org/2000/svg","g");Ye.setAttributeNS(null,"stroke","none"),Ye.setAttributeNS(null,"stroke-width","1"),Ye.setAttributeNS(null,"fill","none"),Ye.setAttributeNS(null,"fill-rule","evenodd");var vt=r.createNS("http://www.w3.org/2000/svg","g");vt.setAttributeNS(null,"fill-rule","nonzero");var Ot=r.createNS("http://www.w3.org/2000/svg","g");Ot.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Ot.setAttributeNS(null,"fill","#000000");for(var dr=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Dr=0,ur=dr;Dr=pe}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},Y.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},Y.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},Y.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},Y.prototype.isDraggable=function(){return this._draggable},Y.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},Y.prototype.getRotation=function(){return this._rotation},Y.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},Y.prototype.getRotationAlignment=function(){return this._rotationAlignment},Y.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},Y.prototype.getPitchAlignment=function(){return this._pitchAlignment},Y})(e.Evented),Zn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},gi;function wi(de){gi!==void 0?de(gi):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(Y){gi=Y.state!=="denied",de(gi)}):(gi=!!e.window.navigator.geolocation,de(gi))}var Ii=0,cs=!1,Zs=(function(de){function Y(me){de.call(this),this.options=e.extend({},Zn,me),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),wi(this._setupUI),this._container},Y.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ii=0,cs=!1},Y.prototype._isOutOfMapMaxBounds=function(te){var pe=this._map.getMaxBounds(),Ve=te.coords;return pe&&(Ve.longitudepe.getEast()||Ve.latitudepe.getNorth())},Y.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},Y.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},Y.prototype._updateCamera=function(te){var pe=new e.LngLat(te.coords.longitude,te.coords.latitude),Ve=te.coords.accuracy,ke=this._map.getBearing(),Ye=e.extend({bearing:ke},this.options.fitBoundsOptions);this._map.fitBounds(pe.toBounds(Ve),Ye,{geolocateSource:!0})},Y.prototype._updateMarker=function(te){if(te){var pe=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(pe).addTo(this._map),this._userLocationDotMarker.setLngLat(pe).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},Y.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,pe=this._map.unproject([0,te]),Ve=this._map.unproject([1,te]),ke=pe.distanceTo(Ve),Ye=Math.ceil(2*this._accuracy/ke);this._circleElement.style.width=Ye+"px",this._circleElement.style.height=Ye+"px"},Y.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},Y.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var pe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&cs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},Y.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},Y.prototype._setupUI=function(te){var pe=this;if(this._container.addEventListener("contextmenu",function(Ye){return Ye.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ve=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ve,this._geolocateButton.setAttribute("aria-label",Ve)}else{var ke=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=ke,this._geolocateButton.setAttribute("aria-label",ke)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Tn(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Tn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(Ye){var vt=Ye.originalEvent&&Ye.originalEvent.type==="resize";!Ye.geolocateSource&&pe._watchState==="ACTIVE_LOCK"&&!vt&&(pe._watchState="BACKGROUND",pe._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),pe._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),pe.fire(new e.Event("trackuserlocationend")))})},Y.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ii--,cs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ii++;var te;Ii>1?(te={maximumAge:6e5,timeout:0},cs=!0):(te=this.options.positionOptions,cs=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},Y.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},Y})(e.Evented),Ji={maxWidth:100,unit:"metric"},yl=function(Y){this.options=e.extend({},Ji,Y),e.bindAll(["_onMove","setUnit"],this)};yl.prototype.getDefaultPosition=function(){return"bottom-left"},yl.prototype._onMove=function(){Xo(this._map,this._container,this.options)},yl.prototype.onAdd=function(Y){return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",Y.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},yl.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},yl.prototype.setUnit=function(Y){this.options.unit=Y,Xo(this._map,this._container,this.options)};function Xo(de,Y,me){var te=me&&me.maxWidth||100,pe=de._container.clientHeight/2,Ve=de.unproject([0,pe]),ke=de.unproject([te,pe]),Ye=Ve.distanceTo(ke);if(me&&me.unit==="imperial"){var vt=3.2808*Ye;if(vt>5280){var Ot=vt/5280;Qs(Y,te,Ot,de._getUIString("ScaleControl.Miles"))}else Qs(Y,te,vt,de._getUIString("ScaleControl.Feet"))}else if(me&&me.unit==="nautical"){var dr=Ye/1852;Qs(Y,te,dr,de._getUIString("ScaleControl.NauticalMiles"))}else Ye>=1e3?Qs(Y,te,Ye/1e3,de._getUIString("ScaleControl.Kilometers")):Qs(Y,te,Ye,de._getUIString("ScaleControl.Meters"))}function Qs(de,Y,me,te){var pe=Ml(me),Ve=pe/me;de.style.width=Y*Ve+"px",de.innerHTML=pe+" "+te}function rl(de){var Y=Math.pow(10,Math.ceil(-Math.log(de)/Math.LN10));return Math.round(de*Y)/Y}function Ml(de){var Y=Math.pow(10,(""+Math.floor(de)).length-1),me=de/Y;return me=me>=10?10:me>=5?5:me>=3?3:me>=2?2:me>=1?1:rl(me),Y*me}var ps=function(Y){this._fullscreen=!1,Y&&Y.container&&(Y.container instanceof e.window.HTMLElement?this._container=Y.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};ps.prototype.onAdd=function(Y){return this._map=Y,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ps.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ps.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},ps.prototype._setupUI=function(){var Y=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",Y).setAttribute("aria-hidden",!0),Y.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ps.prototype._updateTitle=function(){var Y=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Y),this._fullscreenButton.title=Y},ps.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ps.prototype._isFullscreen=function(){return this._fullscreen},ps.prototype._changeIcon=function(){var Y=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;Y===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ps.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var qs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ys=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Ri=(function(de){function Y(me){de.call(this),this.options=e.extend(Object.create(qs),me),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return de&&(Y.__proto__=de),Y.prototype=Object.create(de&&de.prototype),Y.prototype.constructor=Y,Y.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},Y.prototype.isOpen=function(){return!!this._map},Y.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},Y.prototype.getLngLat=function(){return this._lngLat},Y.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},Y.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},Y.prototype.getElement=function(){return this._container},Y.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},Y.prototype.setHTML=function(te){var pe=e.window.document.createDocumentFragment(),Ve=e.window.document.createElement("body"),ke;for(Ve.innerHTML=te;ke=Ve.firstChild,!!ke;)pe.appendChild(ke);return this.setDOMContent(pe)},Y.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},Y.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},Y.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},Y.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},Y.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},Y.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},Y.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},Y.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},Y.prototype._onMouseUp=function(te){this._update(te.point)},Y.prototype._onMouseMove=function(te){this._update(te.point)},Y.prototype._onDrag=function(te){this._update(te.point)},Y.prototype._update=function(te){var pe=this,Ve=this._lngLat||this._trackPointer;if(!(!this._map||!Ve||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(pt){return pe._container.classList.add(pt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=On(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var ke=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),Ye=this.options.anchor,vt=al(this.options.offset);if(!Ye){var Ot=this._container.offsetWidth,dr=this._container.offsetHeight,Dr;ke.y+vt.bottom.ythis._map.transform.height-dr?Dr=["bottom"]:Dr=[],ke.xthis._map.transform.width-Ot/2&&Dr.push("right"),Dr.length===0?Ye="bottom":Ye=Dr.join("-")}var ur=ke.add(vt[Ye]).round();r.setTransform(this._container,oi[Ye]+" translate("+ur.x+"px,"+ur.y+"px)"),bi(this._container,Ye,"popup")}},Y.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(Ys);te&&te.focus()}},Y.prototype._onClose=function(){this.remove()},Y})(e.Evented);function al(de){if(de)if(typeof de=="number"){var Y=Math.round(Math.sqrt(.5*Math.pow(de,2)));return{center:new e.Point(0,0),top:new e.Point(0,de),"top-left":new e.Point(Y,Y),"top-right":new e.Point(-Y,Y),bottom:new e.Point(0,-de),"bottom-left":new e.Point(Y,-Y),"bottom-right":new e.Point(-Y,-Y),left:new e.Point(de,0),right:new e.Point(-de,0)}}else if(de instanceof e.Point||Array.isArray(de)){var me=e.Point.convert(de);return{center:me,top:me,"top-left":me,"top-right":me,bottom:me,"bottom-left":me,"bottom-right":me,left:me,right:me}}else return{center:e.Point.convert(de.center||[0,0]),top:e.Point.convert(de.top||[0,0]),"top-left":e.Point.convert(de["top-left"]||[0,0]),"top-right":e.Point.convert(de["top-right"]||[0,0]),bottom:e.Point.convert(de.bottom||[0,0]),"bottom-left":e.Point.convert(de["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(de["bottom-right"]||[0,0]),left:e.Point.convert(de.left||[0,0]),right:e.Point.convert(de.right||[0,0])};else return al(new e.Point(0,0))}var go={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Ra,NavigationControl:pn,GeolocateControl:Zs,AttributionControl:Mn,ScaleControl:yl,FullscreenControl:ps,Popup:Ri,Marker:Tn,Style:ll,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Kn,clearPrewarmedResources:St,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(de){e.config.ACCESS_TOKEN=de},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(de){e.config.API_URL=de},get workerCount(){return Xa.workerCount},set workerCount(de){Xa.workerCount=de},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(de){e.config.MAX_PARALLEL_IMAGE_REQUESTS=de},clearStorage:function(Y){e.clearTileCache(Y)},workerUrl:""};return go}),A})}}),sI=We({"src/plots/mapbox/layers.js"(Z,V){"use strict";var d=aa(),x=zl().sanitizeHTML,A=ST(),E=td();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var h=i.symbol,c=A(h.textposition,h.iconsize);d.extendFlat(n,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":h.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":h.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,h={type:n},c;return n==="geojson"?c="data":n==="vector"?c=typeof s=="string"?"url":"tiles":n==="raster"?(c="tiles",h.tileSize=256):n==="image"&&(c="url",h.coordinates=i.coordinates),h[c]=s,i.sourceattribution&&(h.attribution=x(i.sourceattribution)),h}V.exports=function(n,s,h){var c=new e(n,s);return c.update(h),c}}}),lI=We({"src/plots/mapbox/mapbox.js"(Z,V){"use strict";var d=MT(),x=aa(),A=qd(),E=Wi(),e=Mo(),t=ih(),r=hc(),o=lv(),a=o.drawMode,i=o.selectMode,n=Ec().prepSelect,s=Ec().clearOutline,h=Ec().clearSelectionsCache,c=Ec().selectOnClick,m=td(),p=sI();function T(y,b){this.id=b,this.gd=y;var v=y._fullLayout,u=y._context;this.container=v._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=v._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(v),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(y,b,v){var u=this,g=b[u.id];u.map&&g.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var f;u.map?f=new Promise(function(P,L){u.updateMap(y,b,P,L)}):f=new Promise(function(P,L){u.createMap(y,b,P,L)}),v.push(f)},l.createMap=function(y,b,v,u){var g=this,f=b[g.id],P=g.styleObj=w(f.style,b);g.accessToken=f.accesstoken;var L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=g.map=new d.Map({container:g.div,style:P.style,center:M(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(y,b);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(y)),Promise.all(B).then(function(){g.fillBelowLookup(y,b),g.updateData(y),g.updateLayout(b),g.resolveOnRender(v)}).catch(u)},l.updateMap=function(y,b,v,u){var g=this,f=g.map,P=b[this.id];g.rejectOnError(u);var L=[],z=w(P.style,b);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,f.setStyle(z.style),g.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(y)),Promise.all(L).then(function(){g.fillBelowLookup(y,b),g.updateData(y),g.updateLayout(b),g.resolveOnRender(v)}).catch(u)},l.fillBelowLookup=function(y,b){var v=b[this.id],u=v.layers,g,f,P=this.belowLookup={},L=!1;for(g=0;g1)for(g=0;g-1&&c(z.originalEvent,u,[v.xaxis],[v.yaxis],v.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(y){var b=this,v=b.map,u=b.gd;if(b.isStatic)return;function g(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=y.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(g)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:y.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:y[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:P},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),v.off("click",b.onClickInPanHandler),i(f)||a(f)?(v.dragPan.disable(),v.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){n(z,F,B,b.dragOptions,f)},t.init(b.dragOptions)):(v.dragPan.enable(),v.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),v.on("click",b.onClickInPanHandler))},l.updateFramework=function(y){var b=y[this.id].domain,v=y._size,u=this.div.style;u.width=v.w*(b.x[1]-b.x[0])+"px",u.height=v.h*(b.y[1]-b.y[0])+"px",u.left=v.l+b.x[0]*v.w+"px",u.top=v.t+(1-b.y[1])*v.h+"px",this.xaxis._offset=v.l+b.x[0]*v.w,this.xaxis._length=v.w*(b.x[1]-b.x[0]),this.yaxis._offset=v.t+(1-b.y[1])*v.h,this.yaxis._length=v.h*(b.y[1]-b.y[0])},l.updateLayers=function(y){var b=y[this.id],v=b.layers,u=this.layerList,g;if(v.length!==u.length){for(g=0;gB/2){var O=P.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,p),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var I=1;F.width+6>B&&(I=B/(F.width+6));var N=[_.l+_.w*M.x[1],_.t+_.h*(1-M.y[0])];L.attr("transform",x(N[0],N[1])+A(I))}};function c(p,T){var l=p._fullLayout,_=p._context;if(_.mapboxAccessToken==="")return"";for(var w=[],S=[],M=!1,y=!1,b=0;b1&&d.warn(n.multipleTokensErrorMsg),w[0]):(S.length&&d.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function m(p){return typeof p=="string"&&(n.styleValuesMapbox.indexOf(p)!==-1||p.indexOf("mapbox://")===0||p.indexOf("stamen")===0)}Z.updateFx=function(p){for(var T=p._fullLayout,l=T._subplots[i],_=0;_=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),h=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,h),o[0].trace._glTrace=i,i}}}),dI=We({"src/traces/choroplethmapbox/index.js"(Z,V){"use strict";var d=["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");V.exports={attributes:ET(),supplyDefaults:hI(),colorbar:Pd(),calc:C_(),plot:vI(),hoverPoints:P_(),eventData:I_(),selectPoints:R_(),styleOnSelect:function(x,A){if(A){var E=A[0].trace;E._glTrace.updateOnSelect(A)}},getBelow:function(x,A){for(var E=A.getMapLayers(),e=E.length-2;e>=0;e--){var t=E[e].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=e+1;r0?+p[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var y=E.extractOpts(a),b=y.reversescale?E.flipScale(y.colorscale):y.colorscale,v=b[0][1],u=A.opacity(v)<1?v:A.addOpacity(v,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),xI=We({"src/traces/densitymapbox/hover.js"(Z,V){"use strict";var d=Mo(),x=W_().hoverPoints,A=W_().getExtraText;V.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var h=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),bI=We({"src/traces/densitymapbox/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),wI=We({"src/traces/densitymapbox/index.js"(Z,V){"use strict";var d=["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");V.exports={attributes:CT(),supplyDefaults:mI(),colorbar:Pd(),formatLabels:AT(),calc:gI(),plot:_I(),hoverPoints:xI(),eventData:bI(),getBelow:function(x,A){for(var E=A.getMapLayers(),e=0;eESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +`}),{fragmentSource:me,vertexSource:K,staticAttributes:te,staticUniforms:Me}}var wc=Object.freeze({__proto__:null,prelude:Zs,background:Ql,backgroundPattern:Hu,circle:Os,clippingMask:zu,heatmap:ql,heatmapTexture:Xl,collisionBox:rl,collisionCircle:Gc,debug:ef,fill:su,fillOutline:Wu,fillOutlinePattern:Fu,fillPattern:kf,fillExtrusion:xc,fillExtrusionPattern:Mc,hillshadePrepare:lu,hillshade:bc,line:Ll,lineGradient:cc,linePattern:hf,lineSDF:Ec,raster:Bs,symbolIcon:Gl,symbolSDF:eu,symbolTextAndIcon:Fc}),Xu=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Xu.prototype.bind=function(K,ye,te,ge,Ne,Me,Ke,ht){this.context=K;for(var Bt=this.boundPaintVertexBuffers.length!==ge.length,gr=0;!Bt&&gr>16,Ke>>16],u_pixel_coord_lower:[Me&65535,Ke&65535]}}function fc(me,K,ye,te){var ge=ye.imageManager.getPattern(me.from.toString()),Ne=ye.imageManager.getPattern(me.to.toString()),Me=ye.imageManager.getPixelSize(),Ke=Me.width,ht=Me.height,Bt=Math.pow(2,te.tileID.overscaledZ),gr=te.tileSize*Math.pow(2,ye.transform.tileZoom)/Bt,Dr=gr*(te.tileID.canonical.x+te.tileID.wrap*Bt),ur=gr*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ge.tl,u_pattern_br_a:ge.br,u_pattern_tl_b:Ne.tl,u_pattern_br_b:Ne.br,u_texsize:[Ke,ht],u_mix:K.t,u_pattern_size_a:ge.displaySize,u_pattern_size_b:Ne.displaySize,u_scale_a:K.fromScale,u_scale_b:K.toScale,u_tile_units_to_pixels:1/No(te,1,ye.transform.tileZoom),u_pixel_coord_upper:[Dr>>16,ur>>16],u_pixel_coord_lower:[Dr&65535,ur&65535]}}var Oc=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_lightpos:new e.Uniform3f(me,K.u_lightpos),u_lightintensity:new e.Uniform1f(me,K.u_lightintensity),u_lightcolor:new e.Uniform3f(me,K.u_lightcolor),u_vertical_gradient:new e.Uniform1f(me,K.u_vertical_gradient),u_opacity:new e.Uniform1f(me,K.u_opacity)}},Pl=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_lightpos:new e.Uniform3f(me,K.u_lightpos),u_lightintensity:new e.Uniform1f(me,K.u_lightintensity),u_lightcolor:new e.Uniform3f(me,K.u_lightcolor),u_vertical_gradient:new e.Uniform1f(me,K.u_vertical_gradient),u_height_factor:new e.Uniform1f(me,K.u_height_factor),u_image:new e.Uniform1i(me,K.u_image),u_texsize:new e.Uniform2f(me,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(me,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(me,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(me,K.u_scale),u_fade:new e.Uniform1f(me,K.u_fade),u_opacity:new e.Uniform1f(me,K.u_opacity)}},Hc=function(me,K,ye,te){var ge=K.style.light,Ne=ge.properties.get("position"),Me=[Ne.x,Ne.y,Ne.z],Ke=e.create$1();ge.properties.get("anchor")==="viewport"&&e.fromRotation(Ke,-K.transform.angle),e.transformMat3(Me,Me,Ke);var ht=ge.properties.get("color");return{u_matrix:me,u_lightpos:Me,u_lightintensity:ge.properties.get("intensity"),u_lightcolor:[ht.r,ht.g,ht.b],u_vertical_gradient:+ye,u_opacity:te}},pu=function(me,K,ye,te,ge,Ne,Me){return e.extend(Hc(me,K,ye,te),du(Ne,K,Me),{u_height_factor:-Math.pow(2,ge.overscaledZ)/Me.tileSize/8})},Zu=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix)}},Ou=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_image:new e.Uniform1i(me,K.u_image),u_texsize:new e.Uniform2f(me,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(me,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(me,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(me,K.u_scale),u_fade:new e.Uniform1f(me,K.u_fade)}},dl=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_world:new e.Uniform2f(me,K.u_world)}},Hl=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_world:new e.Uniform2f(me,K.u_world),u_image:new e.Uniform1i(me,K.u_image),u_texsize:new e.Uniform2f(me,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(me,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(me,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(me,K.u_scale),u_fade:new e.Uniform1f(me,K.u_fade)}},Yu=function(me){return{u_matrix:me}},hc=function(me,K,ye,te){return e.extend(Yu(me),du(ye,K,te))},Eu=function(me,K){return{u_matrix:me,u_world:K}},Ku=function(me,K,ye,te,ge){return e.extend(hc(me,K,ye,te),{u_world:ge})},Yt=function(me,K){return{u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(me,K.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(me,K.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(me,K.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(me,K.u_matrix)}},mr=function(me,K,ye,te){var ge=me.transform,Ne,Me;if(te.paint.get("circle-pitch-alignment")==="map"){var Ke=No(ye,1,ge.zoom);Ne=!0,Me=[Ke,Ke]}else Ne=!1,Me=ge.pixelsToGLUnits;return{u_camera_to_center_distance:ge.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:me.translatePosMatrix(K.posMatrix,ye,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ne,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:Me}},Jr=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(me,K.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(me,K.u_extrude_scale),u_overscale_factor:new e.Uniform1f(me,K.u_overscale_factor)}},Wr=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_inv_matrix:new e.UniformMatrix4f(me,K.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(me,K.u_viewport_size)}},xa=function(me,K,ye){var te=No(ye,1,K.zoom),ge=Math.pow(2,K.zoom-ye.tileID.overscaledZ),Ne=ye.tileID.overscaleFactor();return{u_matrix:me,u_camera_to_center_distance:K.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[K.pixelsToGLUnits[0]/(te*ge),K.pixelsToGLUnits[1]/(te*ge)],u_overscale_factor:Ne}},$a=function(me,K,ye){return{u_matrix:me,u_inv_matrix:K,u_camera_to_center_distance:ye.cameraToCenterDistance,u_viewport_size:[ye.width,ye.height]}},xn=function(me,K){return{u_color:new e.UniformColor(me,K.u_color),u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_overlay:new e.Uniform1i(me,K.u_overlay),u_overlay_scale:new e.Uniform1f(me,K.u_overlay_scale)}},Fn=function(me,K,ye){return ye===void 0&&(ye=1),{u_matrix:me,u_color:K,u_overlay:0,u_overlay_scale:ye}},Gn=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix)}},ai=function(me){return{u_matrix:me}},wn=function(me,K){return{u_extrude_scale:new e.Uniform1f(me,K.u_extrude_scale),u_intensity:new e.Uniform1f(me,K.u_intensity),u_matrix:new e.UniformMatrix4f(me,K.u_matrix)}},Sn=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_world:new e.Uniform2f(me,K.u_world),u_image:new e.Uniform1i(me,K.u_image),u_color_ramp:new e.Uniform1i(me,K.u_color_ramp),u_opacity:new e.Uniform1f(me,K.u_opacity)}},Ln=function(me,K,ye,te){return{u_matrix:me,u_extrude_scale:No(K,1,ye),u_intensity:te}},sn=function(me,K,ye,te){var ge=e.create();e.ortho(ge,0,me.width,me.height,0,0,1);var Ne=me.context.gl;return{u_matrix:ge,u_world:[Ne.drawingBufferWidth,Ne.drawingBufferHeight],u_image:ye,u_color_ramp:te,u_opacity:K.paint.get("heatmap-opacity")}},di=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_image:new e.Uniform1i(me,K.u_image),u_latrange:new e.Uniform2f(me,K.u_latrange),u_light:new e.Uniform2f(me,K.u_light),u_shadow:new e.UniformColor(me,K.u_shadow),u_highlight:new e.UniformColor(me,K.u_highlight),u_accent:new e.UniformColor(me,K.u_accent)}},Ni=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_image:new e.Uniform1i(me,K.u_image),u_dimension:new e.Uniform2f(me,K.u_dimension),u_zoom:new e.Uniform1f(me,K.u_zoom),u_unpack:new e.Uniform4f(me,K.u_unpack)}},Wi=function(me,K,ye){var te=ye.paint.get("hillshade-shadow-color"),ge=ye.paint.get("hillshade-highlight-color"),Ne=ye.paint.get("hillshade-accent-color"),Me=ye.paint.get("hillshade-illumination-direction")*(Math.PI/180);ye.paint.get("hillshade-illumination-anchor")==="viewport"&&(Me-=me.transform.angle);var Ke=!me.options.moving;return{u_matrix:me.transform.calculatePosMatrix(K.tileID.toUnwrapped(),Ke),u_image:0,u_latrange:Ji(me,K.tileID),u_light:[ye.paint.get("hillshade-exaggeration"),Me],u_shadow:te,u_highlight:ge,u_accent:Ne}},Ui=function(me,K){var ye=K.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[ye,ye],u_zoom:me.overscaledZ,u_unpack:K.getUnpackVector()}};function Ji(me,K){var ye=Math.pow(2,K.canonical.z),te=K.canonical.y;return[new e.MercatorCoordinate(0,te/ye).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/ye).toLngLat().lat]}var hi=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_ratio:new e.Uniform1f(me,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(me,K.u_units_to_pixels)}},Qn=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_ratio:new e.Uniform1f(me,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(me,K.u_units_to_pixels),u_image:new e.Uniform1i(me,K.u_image),u_image_height:new e.Uniform1f(me,K.u_image_height)}},ao=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_texsize:new e.Uniform2f(me,K.u_texsize),u_ratio:new e.Uniform1f(me,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_image:new e.Uniform1i(me,K.u_image),u_units_to_pixels:new e.Uniform2f(me,K.u_units_to_pixels),u_scale:new e.Uniform3f(me,K.u_scale),u_fade:new e.Uniform1f(me,K.u_fade)}},Po=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_ratio:new e.Uniform1f(me,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(me,K.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(me,K.u_patternscale_a),u_patternscale_b:new e.Uniform2f(me,K.u_patternscale_b),u_sdfgamma:new e.Uniform1f(me,K.u_sdfgamma),u_image:new e.Uniform1i(me,K.u_image),u_tex_y_a:new e.Uniform1f(me,K.u_tex_y_a),u_tex_y_b:new e.Uniform1f(me,K.u_tex_y_b),u_mix:new e.Uniform1f(me,K.u_mix)}},is=function(me,K,ye){var te=me.transform;return{u_matrix:ul(me,K,ye),u_ratio:1/No(K,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Rs=function(me,K,ye,te){return e.extend(is(me,K,ye),{u_image:0,u_image_height:te})},_s=function(me,K,ye,te){var ge=me.transform,Ne=ts(K,ge);return{u_matrix:ul(me,K,ye),u_texsize:K.imageAtlasTexture.size,u_ratio:1/No(K,1,ge.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ne,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/ge.pixelsToGLUnits[0],1/ge.pixelsToGLUnits[1]]}},Ps=function(me,K,ye,te,ge){var Ne=me.transform,Me=me.lineAtlas,Ke=ts(K,Ne),ht=ye.layout.get("line-cap")==="round",Bt=Me.getDash(te.from,ht),gr=Me.getDash(te.to,ht),Dr=Bt.width*ge.fromScale,ur=gr.width*ge.toScale;return e.extend(is(me,K,ye),{u_patternscale_a:[Ke/Dr,-Bt.height/2],u_patternscale_b:[Ke/ur,-gr.height/2],u_sdfgamma:Me.width/(Math.min(Dr,ur)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:Bt.y,u_tex_y_b:gr.y,u_mix:ge.t})};function ts(me,K){return 1/No(me,1,K.tileZoom)}function ul(me,K,ye){return me.translatePosMatrix(K.tileID.posMatrix,K,ye.paint.get("line-translate"),ye.paint.get("line-translate-anchor"))}var Ys=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_tl_parent:new e.Uniform2f(me,K.u_tl_parent),u_scale_parent:new e.Uniform1f(me,K.u_scale_parent),u_buffer_scale:new e.Uniform1f(me,K.u_buffer_scale),u_fade_t:new e.Uniform1f(me,K.u_fade_t),u_opacity:new e.Uniform1f(me,K.u_opacity),u_image0:new e.Uniform1i(me,K.u_image0),u_image1:new e.Uniform1i(me,K.u_image1),u_brightness_low:new e.Uniform1f(me,K.u_brightness_low),u_brightness_high:new e.Uniform1f(me,K.u_brightness_high),u_saturation_factor:new e.Uniform1f(me,K.u_saturation_factor),u_contrast_factor:new e.Uniform1f(me,K.u_contrast_factor),u_spin_weights:new e.Uniform3f(me,K.u_spin_weights)}},Ns=function(me,K,ye,te,ge){return{u_matrix:me,u_tl_parent:K,u_scale_parent:ye,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*ge.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:ge.paint.get("raster-brightness-min"),u_brightness_high:ge.paint.get("raster-brightness-max"),u_saturation_factor:Cs(ge.paint.get("raster-saturation")),u_contrast_factor:go(ge.paint.get("raster-contrast")),u_spin_weights:ki(ge.paint.get("raster-hue-rotate"))}};function ki(me){me*=Math.PI/180;var K=Math.sin(me),ye=Math.cos(me);return[(2*ye+1)/3,(-Math.sqrt(3)*K-ye+1)/3,(Math.sqrt(3)*K-ye+1)/3]}function go(me){return me>0?1/(1-me):1+me}function Cs(me){return me>0?1-1/(1.001-me):-me}var ds=function(me,K){return{u_is_size_zoom_constant:new e.Uniform1i(me,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(me,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(me,K.u_size_t),u_size:new e.Uniform1f(me,K.u_size),u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(me,K.u_pitch),u_rotate_symbol:new e.Uniform1i(me,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(me,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(me,K.u_fade_change),u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(me,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(me,K.u_coord_matrix),u_is_text:new e.Uniform1i(me,K.u_is_text),u_pitch_with_map:new e.Uniform1i(me,K.u_pitch_with_map),u_texsize:new e.Uniform2f(me,K.u_texsize),u_texture:new e.Uniform1i(me,K.u_texture)}},zl=function(me,K){return{u_is_size_zoom_constant:new e.Uniform1i(me,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(me,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(me,K.u_size_t),u_size:new e.Uniform1f(me,K.u_size),u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(me,K.u_pitch),u_rotate_symbol:new e.Uniform1i(me,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(me,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(me,K.u_fade_change),u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(me,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(me,K.u_coord_matrix),u_is_text:new e.Uniform1i(me,K.u_is_text),u_pitch_with_map:new e.Uniform1i(me,K.u_pitch_with_map),u_texsize:new e.Uniform2f(me,K.u_texsize),u_texture:new e.Uniform1i(me,K.u_texture),u_gamma_scale:new e.Uniform1f(me,K.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(me,K.u_is_halo)}},tu=function(me,K){return{u_is_size_zoom_constant:new e.Uniform1i(me,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(me,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(me,K.u_size_t),u_size:new e.Uniform1f(me,K.u_size),u_camera_to_center_distance:new e.Uniform1f(me,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(me,K.u_pitch),u_rotate_symbol:new e.Uniform1i(me,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(me,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(me,K.u_fade_change),u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(me,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(me,K.u_coord_matrix),u_is_text:new e.Uniform1i(me,K.u_is_text),u_pitch_with_map:new e.Uniform1i(me,K.u_pitch_with_map),u_texsize:new e.Uniform2f(me,K.u_texsize),u_texsize_icon:new e.Uniform2f(me,K.u_texsize_icon),u_texture:new e.Uniform1i(me,K.u_texture),u_texture_icon:new e.Uniform1i(me,K.u_texture_icon),u_gamma_scale:new e.Uniform1f(me,K.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(me,K.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(me,K.u_is_halo)}},mu=function(me,K,ye,te,ge,Ne,Me,Ke,ht,Bt){var gr=ge.transform;return{u_is_size_zoom_constant:+(me==="constant"||me==="source"),u_is_size_feature_constant:+(me==="constant"||me==="camera"),u_size_t:K?K.uSizeT:0,u_size:K?K.uSize:0,u_camera_to_center_distance:gr.cameraToCenterDistance,u_pitch:gr.pitch/360*2*Math.PI,u_rotate_symbol:+ye,u_aspect_ratio:gr.width/gr.height,u_fade_change:ge.options.fadeDuration?ge.symbolFadeChange:1,u_matrix:Ne,u_label_plane_matrix:Me,u_coord_matrix:Ke,u_is_text:+ht,u_pitch_with_map:+te,u_texsize:Bt,u_texture:0}},Ju=function(me,K,ye,te,ge,Ne,Me,Ke,ht,Bt,gr){var Dr=ge.transform;return e.extend(mu(me,K,ye,te,ge,Ne,Me,Ke,ht,Bt),{u_gamma_scale:te?Math.cos(Dr._pitch)*Dr.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+gr})},Wl=function(me,K,ye,te,ge,Ne,Me,Ke,ht,Bt){return e.extend(Ju(me,K,ye,te,ge,Ne,Me,Ke,!0,ht,!0),{u_texsize_icon:Bt,u_texture_icon:1})},$u=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_opacity:new e.Uniform1f(me,K.u_opacity),u_color:new e.UniformColor(me,K.u_color)}},Zl=function(me,K){return{u_matrix:new e.UniformMatrix4f(me,K.u_matrix),u_opacity:new e.Uniform1f(me,K.u_opacity),u_image:new e.Uniform1i(me,K.u_image),u_pattern_tl_a:new e.Uniform2f(me,K.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(me,K.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(me,K.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(me,K.u_pattern_br_b),u_texsize:new e.Uniform2f(me,K.u_texsize),u_mix:new e.Uniform1f(me,K.u_mix),u_pattern_size_a:new e.Uniform2f(me,K.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(me,K.u_pattern_size_b),u_scale_a:new e.Uniform1f(me,K.u_scale_a),u_scale_b:new e.Uniform1f(me,K.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(me,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(me,K.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(me,K.u_tile_units_to_pixels)}},Bu=function(me,K,ye){return{u_matrix:me,u_opacity:K,u_color:ye}},$i=function(me,K,ye,te,ge,Ne){return e.extend(fc(te,Ne,ye,ge),{u_matrix:me,u_opacity:K})},_o={fillExtrusion:Oc,fillExtrusionPattern:Pl,fill:Zu,fillPattern:Ou,fillOutline:dl,fillOutlinePattern:Hl,circle:Yt,collisionBox:Jr,collisionCircle:Wr,debug:xn,clippingMask:Gn,heatmap:wn,heatmapTexture:Sn,hillshade:di,hillshadePrepare:Ni,line:hi,lineGradient:Qn,linePattern:ao,lineSDF:Po,raster:Ys,symbolIcon:ds,symbolSDF:zl,symbolTextAndIcon:tu,background:$u,backgroundPattern:Zl},Qu;function ku(me,K,ye,te,ge,Ne,Me){for(var Ke=me.context,ht=Ke.gl,Bt=me.useProgram("collisionBox"),gr=[],Dr=0,ur=0,vt=0;vt0){var rr=e.create(),Vt=lr;e.mul(rr,$t.placementInvProjMatrix,me.transform.glCoordMatrix),e.mul(rr,rr,$t.placementViewportMatrix),gr.push({circleArray:cr,circleOffset:ur,transform:Vt,invTransform:rr}),Dr+=cr.length/4,ur=Dr}tr&&Bt.draw(Ke,ht.LINES,Aa.disabled,ba.disabled,me.colorModeForRenderPass(),Pr.disabled,xa(lr,me.transform,It),ye.id,tr.layoutVertexBuffer,tr.indexBuffer,tr.segments,null,me.transform.zoom,null,null,tr.collisionVertexBuffer)}}if(!(!Me||!gr.length)){var er=me.useProgram("collisionCircle"),Nt=new e.StructArrayLayout2f1f2i16;Nt.resize(Dr*4),Nt._trim();for(var Cr=0,Hr=0,ca=gr;Hr=0&&(wt[$t.associatedIconIndex]={shiftedAnchor:Za,angle:Nn})}}if(gr){vt.clear();for(var Qa=me.icon.placedSymbolArray,cn=0;cn0){var Me=e.browser.now(),Ke=(Me-me.timeAdded)/Ne,ht=K?(Me-K.timeAdded)/Ne:-1,Bt=ye.getSource(),gr=ge.coveringZoomLevel({tileSize:Bt.tileSize,roundZoom:Bt.roundZoom}),Dr=!K||Math.abs(K.tileID.overscaledZ-gr)>Math.abs(me.tileID.overscaledZ-gr),ur=Dr&&me.refreshedUponExpiration?1:e.clamp(Dr?Ke:1-ht,0,1);return me.refreshedUponExpiration&&Ke>=1&&(me.refreshedUponExpiration=!1),K?{opacity:1,mix:1-ur}:{opacity:ur,mix:0}}else return{opacity:1,mix:0}}function Tr(me,K,ye){var te=ye.paint.get("background-color"),ge=ye.paint.get("background-opacity");if(ge!==0){var Ne=me.context,Me=Ne.gl,Ke=me.transform,ht=Ke.tileSize,Bt=ye.paint.get("background-pattern");if(!me.isPatternMissing(Bt)){var gr=!Bt&&te.a===1&&ge===1&&me.opaquePassEnabledForLayer()?"opaque":"translucent";if(me.renderPass===gr){var Dr=ba.disabled,ur=me.depthModeForSublayer(0,gr==="opaque"?Aa.ReadWrite:Aa.ReadOnly),vt=me.colorModeForRenderPass(),wt=me.useProgram(Bt?"backgroundPattern":"background"),It=Ke.coveringTiles({tileSize:ht});Bt&&(Ne.activeTexture.set(Me.TEXTURE0),me.imageManager.bind(me.context));for(var $t=ye.getCrossfadeParameters(),lr=0,tr=It;lr "+ye.overscaledZ);var lr=$t+" "+vt+"kb";so(me,lr),Me.draw(te,ge.TRIANGLES,Ke,ht,Lt.alphaBlended,Pr.disabled,Fn(Ne,e.Color.transparent,It),gr,me.debugBuffer,me.quadTriangleIndexBuffer,me.debugSegments)}function so(me,K){me.initDebugOverlayCanvas();var ye=me.debugOverlayCanvas,te=me.context.gl,ge=me.debugOverlayCanvas.getContext("2d");ge.clearRect(0,0,ye.width,ye.height),ge.shadowColor="white",ge.shadowBlur=2,ge.lineWidth=1.5,ge.strokeStyle="white",ge.textBaseline="top",ge.font="bold 36px Open Sans, sans-serif",ge.fillText(K,5,5),ge.strokeText(K,5,5),me.debugOverlayTexture.update(ye),me.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function jo(me,K,ye){var te=me.context,ge=ye.implementation;if(me.renderPass==="offscreen"){var Ne=ge.prerender;Ne&&(me.setCustomLayerDefaults(),te.setColorMode(me.colorModeForRenderPass()),Ne.call(ge,te.gl,me.transform.customLayerMatrix()),te.setDirty(),me.setBaseState())}else if(me.renderPass==="translucent"){me.setCustomLayerDefaults(),te.setColorMode(me.colorModeForRenderPass()),te.setStencilMode(ba.disabled);var Me=ge.renderingMode==="3d"?new Aa(me.context.gl.LEQUAL,Aa.ReadWrite,me.depthRangeFor3D):me.depthModeForSublayer(0,Aa.ReadOnly);te.setDepthMode(Me),ge.render(te.gl,me.transform.customLayerMatrix()),te.setDirty(),me.setBaseState(),te.bindFramebuffer.set(null)}}var uo={symbol:I,circle:Rt,heatmap:Zt,line:Qr,fill:je,"fill-extrusion":at,hillshade:At,raster:nr,background:Tr,debug:zi,custom:jo},Co=function(K,ye){this.context=new Yr(K),this.transform=ye,this._tileTextures={},this.setup(),this.numSublayers=Kr.maxUnderzooming+Kr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ws,this.gpuTimers={}};Co.prototype.resize=function(K,ye){if(this.width=K*e.browser.devicePixelRatio,this.height=ye*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,ge=this.style._order;te256&&this.clearStencil(),te.setColorMode(Lt.disabled),te.setDepthMode(Aa.disabled);var Ne=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Me=0,Ke=ye;Me256&&this.clearStencil();var K=this.nextStencilID++,ye=this.context.gl;return new ba({func:ye.NOTEQUAL,mask:255},K,255,ye.KEEP,ye.KEEP,ye.REPLACE)},Co.prototype.stencilModeForClipping=function(K){var ye=this.context.gl;return new ba({func:ye.EQUAL,mask:255},this._tileClippingMaskIDs[K.key],0,ye.KEEP,ye.KEEP,ye.REPLACE)},Co.prototype.stencilConfigForOverlap=function(K){var ye,te=this.context.gl,ge=K.sort(function(Bt,gr){return gr.overscaledZ-Bt.overscaledZ}),Ne=ge[ge.length-1].overscaledZ,Me=ge[0].overscaledZ-Ne+1;if(Me>1){this.currentStencilSource=void 0,this.nextStencilID+Me>256&&this.clearStencil();for(var Ke={},ht=0;ht=0;this.currentLayer--){var rr=this.style._layers[ge[this.currentLayer]],Vt=Ne[rr.source],er=ht[rr.source];this._renderTileClippingMasks(rr,er),this.renderLayer(this,Vt,rr,er)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?ye.pop():null},Co.prototype.isPatternMissing=function(K){if(!K)return!1;if(!K.from||!K.to)return!0;var ye=this.imageManager.getPattern(K.from.toString()),te=this.imageManager.getPattern(K.to.toString());return!ye||!te},Co.prototype.useProgram=function(K,ye){this.cache=this.cache||{};var te=""+K+(ye?ye.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new kc(this.context,K,wc[K],ye,_o[K],this._showOverdrawInspector)),this.cache[te]},Co.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Co.prototype.setBaseState=function(){var K=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(K.FUNC_ADD)},Co.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var K=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,K.RGBA)}},Co.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Xo=function(K,ye){this.points=K,this.planes=ye};Xo.fromInvProjectionMatrix=function(K,ye,te){var ge=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],Ne=Math.pow(2,te),Me=ge.map(function(Bt){return e.transformMat4([],Bt,K)}).map(function(Bt){return e.scale$1([],Bt,1/Bt[3]/ye*Ne)}),Ke=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],ht=Ke.map(function(Bt){var gr=e.sub([],Me[Bt[0]],Me[Bt[1]]),Dr=e.sub([],Me[Bt[2]],Me[Bt[1]]),ur=e.normalize([],e.cross([],gr,Dr)),vt=-e.dot(ur,Me[Bt[1]]);return ur.concat(vt)});return new Xo(Me,ht)};var Us=function(K,ye){this.min=K,this.max=ye,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Us.prototype.quadrant=function(K){for(var ye=[K%2===0,K<2],te=e.clone$2(this.min),ge=e.clone$2(this.max),Ne=0;Ne=0;if(Me===0)return 0;Me!==ye.length&&(te=!1)}if(te)return 2;for(var ht=0;ht<3;ht++){for(var Bt=Number.MAX_VALUE,gr=-Number.MAX_VALUE,Dr=0;Drthis.max[ht]-this.min[ht])return 0}return 1};var Is=function(K,ye,te,ge){if(K===void 0&&(K=0),ye===void 0&&(ye=0),te===void 0&&(te=0),ge===void 0&&(ge=0),isNaN(K)||K<0||isNaN(ye)||ye<0||isNaN(te)||te<0||isNaN(ge)||ge<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=K,this.bottom=ye,this.left=te,this.right=ge};Is.prototype.interpolate=function(K,ye,te){return ye.top!=null&&K.top!=null&&(this.top=e.number(K.top,ye.top,te)),ye.bottom!=null&&K.bottom!=null&&(this.bottom=e.number(K.bottom,ye.bottom,te)),ye.left!=null&&K.left!=null&&(this.left=e.number(K.left,ye.left,te)),ye.right!=null&&K.right!=null&&(this.right=e.number(K.right,ye.right,te)),this},Is.prototype.getCenter=function(K,ye){var te=e.clamp((this.left+K-this.right)/2,0,K),ge=e.clamp((this.top+ye-this.bottom)/2,0,ye);return new e.Point(te,ge)},Is.prototype.equals=function(K){return this.top===K.top&&this.bottom===K.bottom&&this.left===K.left&&this.right===K.right},Is.prototype.clone=function(){return new Is(this.top,this.bottom,this.left,this.right)},Is.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Io=function(K,ye,te,ge,Ne){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ne===void 0?!0:Ne,this._minZoom=K||0,this._maxZoom=ye||22,this._minPitch=te??0,this._maxPitch=ge??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Is,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ro={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Io.prototype.clone=function(){var K=new Io(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return K.tileSize=this.tileSize,K.latRange=this.latRange,K.width=this.width,K.height=this.height,K._center=this._center,K.zoom=this.zoom,K.angle=this.angle,K._fov=this._fov,K._pitch=this._pitch,K._unmodified=this._unmodified,K._edgeInsets=this._edgeInsets.clone(),K._calcMatrices(),K},Ro.minZoom.get=function(){return this._minZoom},Ro.minZoom.set=function(me){this._minZoom!==me&&(this._minZoom=me,this.zoom=Math.max(this.zoom,me))},Ro.maxZoom.get=function(){return this._maxZoom},Ro.maxZoom.set=function(me){this._maxZoom!==me&&(this._maxZoom=me,this.zoom=Math.min(this.zoom,me))},Ro.minPitch.get=function(){return this._minPitch},Ro.minPitch.set=function(me){this._minPitch!==me&&(this._minPitch=me,this.pitch=Math.max(this.pitch,me))},Ro.maxPitch.get=function(){return this._maxPitch},Ro.maxPitch.set=function(me){this._maxPitch!==me&&(this._maxPitch=me,this.pitch=Math.min(this.pitch,me))},Ro.renderWorldCopies.get=function(){return this._renderWorldCopies},Ro.renderWorldCopies.set=function(me){me===void 0?me=!0:me===null&&(me=!1),this._renderWorldCopies=me},Ro.worldSize.get=function(){return this.tileSize*this.scale},Ro.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ro.size.get=function(){return new e.Point(this.width,this.height)},Ro.bearing.get=function(){return-this.angle/Math.PI*180},Ro.bearing.set=function(me){var K=-e.wrap(me,-180,180)*Math.PI/180;this.angle!==K&&(this._unmodified=!1,this.angle=K,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ro.pitch.get=function(){return this._pitch/Math.PI*180},Ro.pitch.set=function(me){var K=e.clamp(me,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==K&&(this._unmodified=!1,this._pitch=K,this._calcMatrices())},Ro.fov.get=function(){return this._fov/Math.PI*180},Ro.fov.set=function(me){me=Math.max(.01,Math.min(60,me)),this._fov!==me&&(this._unmodified=!1,this._fov=me/180*Math.PI,this._calcMatrices())},Ro.zoom.get=function(){return this._zoom},Ro.zoom.set=function(me){var K=Math.min(Math.max(me,this.minZoom),this.maxZoom);this._zoom!==K&&(this._unmodified=!1,this._zoom=K,this.scale=this.zoomScale(K),this.tileZoom=Math.floor(K),this.zoomFraction=K-this.tileZoom,this._constrain(),this._calcMatrices())},Ro.center.get=function(){return this._center},Ro.center.set=function(me){me.lat===this._center.lat&&me.lng===this._center.lng||(this._unmodified=!1,this._center=me,this._constrain(),this._calcMatrices())},Ro.padding.get=function(){return this._edgeInsets.toJSON()},Ro.padding.set=function(me){this._edgeInsets.equals(me)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,me,1),this._calcMatrices())},Ro.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Io.prototype.isPaddingEqual=function(K){return this._edgeInsets.equals(K)},Io.prototype.interpolatePadding=function(K,ye,te){this._unmodified=!1,this._edgeInsets.interpolate(K,ye,te),this._constrain(),this._calcMatrices()},Io.prototype.coveringZoomLevel=function(K){var ye=(K.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/K.tileSize));return Math.max(0,ye)},Io.prototype.getVisibleUnwrappedCoordinates=function(K){var ye=[new e.UnwrappedTileID(0,K)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),ge=this.pointCoordinate(new e.Point(this.width,0)),Ne=this.pointCoordinate(new e.Point(this.width,this.height)),Me=this.pointCoordinate(new e.Point(0,this.height)),Ke=Math.floor(Math.min(te.x,ge.x,Ne.x,Me.x)),ht=Math.floor(Math.max(te.x,ge.x,Ne.x,Me.x)),Bt=1,gr=Ke-Bt;gr<=ht+Bt;gr++)gr!==0&&ye.push(new e.UnwrappedTileID(gr,K));return ye},Io.prototype.coveringTiles=function(K){var ye=this.coveringZoomLevel(K),te=ye;if(K.minzoom!==void 0&&yeK.maxzoom&&(ye=K.maxzoom);var ge=e.MercatorCoordinate.fromLngLat(this.center),Ne=Math.pow(2,ye),Me=[Ne*ge.x,Ne*ge.y,0],Ke=Xo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,ye),ht=K.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(ht=ye);var Bt=3,gr=function(Fa){return{aabb:new Us([Fa*Ne,0,0],[(Fa+1)*Ne,Ne,0]),zoom:0,x:0,y:0,wrap:Fa,fullyVisible:!1}},Dr=[],ur=[],vt=ye,wt=K.reparseOverscaled?te:ye;if(this._renderWorldCopies)for(var It=1;It<=3;It++)Dr.push(gr(-It)),Dr.push(gr(It));for(Dr.push(gr(0));Dr.length>0;){var $t=Dr.pop(),lr=$t.x,tr=$t.y,cr=$t.fullyVisible;if(!cr){var rr=$t.aabb.intersects(Ke);if(rr===0)continue;cr=rr===2}var Vt=$t.aabb.distanceX(Me),er=$t.aabb.distanceY(Me),Nt=Math.max(Math.abs(Vt),Math.abs(er)),Cr=Bt+(1<Cr&&$t.zoom>=ht){ur.push({tileID:new e.OverscaledTileID($t.zoom===vt?wt:$t.zoom,$t.wrap,$t.zoom,lr,tr),distanceSq:e.sqrLen([Me[0]-.5-lr,Me[1]-.5-tr])});continue}for(var Hr=0;Hr<4;Hr++){var ca=(lr<<1)+Hr%2,on=(tr<<1)+(Hr>>1);Dr.push({aabb:$t.aabb.quadrant(Hr),zoom:$t.zoom+1,x:ca,y:on,wrap:$t.wrap,fullyVisible:cr})}}return ur.sort(function(Fa,Za){return Fa.distanceSq-Za.distanceSq}).map(function(Fa){return Fa.tileID})},Io.prototype.resize=function(K,ye){this.width=K,this.height=ye,this.pixelsToGLUnits=[2/K,-2/ye],this._constrain(),this._calcMatrices()},Ro.unmodified.get=function(){return this._unmodified},Io.prototype.zoomScale=function(K){return Math.pow(2,K)},Io.prototype.scaleZoom=function(K){return Math.log(K)/Math.LN2},Io.prototype.project=function(K){var ye=e.clamp(K.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(K.lng)*this.worldSize,e.mercatorYfromLat(ye)*this.worldSize)},Io.prototype.unproject=function(K){return new e.MercatorCoordinate(K.x/this.worldSize,K.y/this.worldSize).toLngLat()},Ro.point.get=function(){return this.project(this.center)},Io.prototype.setLocationAtPoint=function(K,ye){var te=this.pointCoordinate(ye),ge=this.pointCoordinate(this.centerPoint),Ne=this.locationCoordinate(K),Me=new e.MercatorCoordinate(Ne.x-(te.x-ge.x),Ne.y-(te.y-ge.y));this.center=this.coordinateLocation(Me),this._renderWorldCopies&&(this.center=this.center.wrap())},Io.prototype.locationPoint=function(K){return this.coordinatePoint(this.locationCoordinate(K))},Io.prototype.pointLocation=function(K){return this.coordinateLocation(this.pointCoordinate(K))},Io.prototype.locationCoordinate=function(K){return e.MercatorCoordinate.fromLngLat(K)},Io.prototype.coordinateLocation=function(K){return K.toLngLat()},Io.prototype.pointCoordinate=function(K){var ye=0,te=[K.x,K.y,0,1],ge=[K.x,K.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(ge,ge,this.pixelMatrixInverse);var Ne=te[3],Me=ge[3],Ke=te[0]/Ne,ht=ge[0]/Me,Bt=te[1]/Ne,gr=ge[1]/Me,Dr=te[2]/Ne,ur=ge[2]/Me,vt=Dr===ur?0:(ye-Dr)/(ur-Dr);return new e.MercatorCoordinate(e.number(Ke,ht,vt)/this.worldSize,e.number(Bt,gr,vt)/this.worldSize)},Io.prototype.coordinatePoint=function(K){var ye=[K.x*this.worldSize,K.y*this.worldSize,0,1];return e.transformMat4(ye,ye,this.pixelMatrix),new e.Point(ye[0]/ye[3],ye[1]/ye[3])},Io.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Io.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Io.prototype.setMaxBounds=function(K){K?(this.lngRange=[K.getWest(),K.getEast()],this.latRange=[K.getSouth(),K.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Io.prototype.calculatePosMatrix=function(K,ye){ye===void 0&&(ye=!1);var te=K.key,ge=ye?this._alignedPosMatrixCache:this._posMatrixCache;if(ge[te])return ge[te];var Ne=K.canonical,Me=this.worldSize/this.zoomScale(Ne.z),Ke=Ne.x+Math.pow(2,Ne.z)*K.wrap,ht=e.identity(new Float64Array(16));return e.translate(ht,ht,[Ke*Me,Ne.y*Me,0]),e.scale(ht,ht,[Me/e.EXTENT,Me/e.EXTENT,1]),e.multiply(ht,ye?this.alignedProjMatrix:this.projMatrix,ht),ge[te]=new Float32Array(ht),ge[te]},Io.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Io.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var K=-90,ye=90,te=-180,ge=180,Ne,Me,Ke,ht,Bt=this.size,gr=this._unmodified;if(this.latRange){var Dr=this.latRange;K=e.mercatorYfromLat(Dr[1])*this.worldSize,ye=e.mercatorYfromLat(Dr[0])*this.worldSize,Ne=ye-Kye&&(ht=ye-$t)}if(this.lngRange){var lr=vt.x,tr=Bt.x/2;lr-trge&&(Ke=ge-tr)}(Ke!==void 0||ht!==void 0)&&(this.center=this.unproject(new e.Point(Ke!==void 0?Ke:vt.x,ht!==void 0?ht:vt.y))),this._unmodified=gr,this._constraining=!1}},Io.prototype._calcMatrices=function(){if(this.height){var K=this._fov/2,ye=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(K)*this.height;var te=Math.PI/2+this._pitch,ge=this._fov*(.5+ye.y/this.height),Ne=Math.sin(ge)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-ge,.01,Math.PI-.01)),Me=this.point,Ke=Me.x,ht=Me.y,Bt=Math.cos(Math.PI/2-this._pitch)*Ne+this.cameraToCenterDistance,gr=Bt*1.01,Dr=this.height/50,ur=new Float64Array(16);e.perspective(ur,this._fov,this.width/this.height,Dr,gr),ur[8]=-ye.x*2/this.width,ur[9]=ye.y*2/this.height,e.scale(ur,ur,[1,-1,1]),e.translate(ur,ur,[0,0,-this.cameraToCenterDistance]),e.rotateX(ur,ur,this._pitch),e.rotateZ(ur,ur,this.angle),e.translate(ur,ur,[-Ke,-ht,0]),this.mercatorMatrix=e.scale([],ur,[this.worldSize,this.worldSize,this.worldSize]),e.scale(ur,ur,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ur,this.invProjMatrix=e.invert([],this.projMatrix);var vt=this.width%2/2,wt=this.height%2/2,It=Math.cos(this.angle),$t=Math.sin(this.angle),lr=Ke-Math.round(Ke)+It*vt+$t*wt,tr=ht-Math.round(ht)+It*wt+$t*vt,cr=new Float64Array(ur);if(e.translate(cr,cr,[lr>.5?lr-1:lr,tr>.5?tr-1:tr,0]),this.alignedProjMatrix=cr,ur=e.create(),e.scale(ur,ur,[this.width/2,-this.height/2,1]),e.translate(ur,ur,[1,-1,0]),this.labelPlaneMatrix=ur,ur=e.create(),e.scale(ur,ur,[1,-1,1]),e.translate(ur,ur,[-1,-1,0]),e.scale(ur,ur,[2/this.width,2/this.height,1]),this.glCoordMatrix=ur,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),ur=e.invert(new Float64Array(16),this.pixelMatrix),!ur)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ur,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Io.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var K=this.pointCoordinate(new e.Point(0,0)),ye=[K.x*this.worldSize,K.y*this.worldSize,0,1],te=e.transformMat4(ye,ye,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},Io.prototype.getCameraPoint=function(){var K=this._pitch,ye=Math.tan(K)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,ye))},Io.prototype.getCameraQueryGeometry=function(K){var ye=this.getCameraPoint();if(K.length===1)return[K[0],ye];for(var te=ye.x,ge=ye.y,Ne=ye.x,Me=ye.y,Ke=0,ht=K;Ke=3&&!K.some(function(te){return isNaN(te)})){var ye=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(K[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+K[2],+K[1]],zoom:+K[0],bearing:ye,pitch:+(K[4]||0)}),!0}return!1},Ml.prototype._updateHashUnthrottled=function(){var K=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,K)}catch{}};var ru={linearity:.3,easing:e.bezier(0,0,.3,1)},jl=e.extend({deceleration:2500,maxSpeed:1400},ru),Qs=e.extend({deceleration:20,maxSpeed:1400},ru),Fl=e.extend({deceleration:1e3,maxSpeed:360},ru),Cu=e.extend({deceleration:1e3,maxSpeed:90},ru),pl=function(K){this._map=K,this.clear()};pl.prototype.clear=function(){this._inertiaBuffer=[]},pl.prototype.record=function(K){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:K})},pl.prototype._drainInertiaBuffer=function(){for(var K=this._inertiaBuffer,ye=e.browser.now(),te=160;K.length>0&&ye-K[0].time>te;)K.shift()},pl.prototype._onMoveEnd=function(K){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var ye={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,ge=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new Ie(K.type,this._map,K))},pt.prototype.dblclick=function(K){return this._firePreventable(new Ie(K.type,this._map,K))},pt.prototype.mouseover=function(K){this._map.fire(new Ie(K.type,this._map,K))},pt.prototype.mouseout=function(K){this._map.fire(new Ie(K.type,this._map,K))},pt.prototype.touchstart=function(K){return this._firePreventable(new Je(K.type,this._map,K))},pt.prototype.touchmove=function(K){this._map.fire(new Je(K.type,this._map,K))},pt.prototype.touchend=function(K){this._map.fire(new Je(K.type,this._map,K))},pt.prototype.touchcancel=function(K){this._map.fire(new Je(K.type,this._map,K))},pt.prototype._firePreventable=function(K){if(this._map.fire(K),K.defaultPrevented)return{}},pt.prototype.isEnabled=function(){return!0},pt.prototype.isActive=function(){return!1},pt.prototype.enable=function(){},pt.prototype.disable=function(){};var xt=function(K){this._map=K};xt.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},xt.prototype.mousemove=function(K){this._map.fire(new Ie(K.type,this._map,K))},xt.prototype.mousedown=function(){this._delayContextMenu=!0},xt.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ie("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},xt.prototype.contextmenu=function(K){this._delayContextMenu?this._contextMenuEvent=K:this._map.fire(new Ie(K.type,this._map,K)),this._map.listens("contextmenu")&&K.preventDefault()},xt.prototype.isEnabled=function(){return!0},xt.prototype.isActive=function(){return!1},xt.prototype.enable=function(){},xt.prototype.disable=function(){};var Jt=function(K,ye){this._map=K,this._el=K.getCanvasContainer(),this._container=K.getContainer(),this._clickTolerance=ye.clickTolerance||1};Jt.prototype.isEnabled=function(){return!!this._enabled},Jt.prototype.isActive=function(){return!!this._active},Jt.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Jt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Jt.prototype.mousedown=function(K,ye){this.isEnabled()&&K.shiftKey&&K.button===0&&(r.disableDrag(),this._startPos=this._lastPos=ye,this._active=!0)},Jt.prototype.mousemoveWindow=function(K,ye){if(this._active){var te=ye;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=K.timeStamp),te.length===this.numTouches&&(this.centroid=dr(ye),this.touches=Pt(te,ye)))},sa.prototype.touchmove=function(K,ye,te){if(!(this.aborted||!this.centroid)){var ge=Pt(te,ye);for(var Ne in this.touches){var Me=this.touches[Ne],Ke=ge[Ne];(!Ke||Ke.dist(Me)>va)&&(this.aborted=!0)}}},sa.prototype.touchend=function(K,ye,te){if((!this.centroid||K.timeStamp-this.startTime>Vr)&&(this.aborted=!0),te.length===0){var ge=!this.aborted&&this.centroid;if(this.reset(),ge)return ge}};var qa=function(K){this.singleTap=new sa(K),this.numTaps=K.numTaps,this.reset()};qa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qa.prototype.touchstart=function(K,ye,te){this.singleTap.touchstart(K,ye,te)},qa.prototype.touchmove=function(K,ye,te){this.singleTap.touchmove(K,ye,te)},qa.prototype.touchend=function(K,ye,te){var ge=this.singleTap.touchend(K,ye,te);if(ge){var Ne=K.timeStamp-this.lastTime0&&(this._active=!0);var ge=Pt(te,ye),Ne=new e.Point(0,0),Me=new e.Point(0,0),Ke=0;for(var ht in ge){var Bt=ge[ht],gr=this._touches[ht];gr&&(Ne._add(Bt),Me._add(Bt.sub(gr)),Ke++,ge[ht]=Bt)}if(this._touches=ge,!(KeMath.abs(me.x)}var oi=100,eo=(function(me){function K(){me.apply(this,arguments)}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.reset=function(){me.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},K.prototype._start=function(te){this._lastPoints=te,Ks(te[0].sub(te[1]))&&(this._valid=!1)},K.prototype._move=function(te,ge,Ne){var Me=te[0].sub(this._lastPoints[0]),Ke=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Me,Ke,Ne.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var ht=(Me.y+Ke.y)/2,Bt=-.5;return{pitchDelta:ht*Bt}}},K.prototype.gestureBeginsVertically=function(te,ge,Ne){if(this._valid!==void 0)return this._valid;var Me=2,Ke=te.mag()>=Me,ht=ge.mag()>=Me;if(!(!Ke&&!ht)){if(!Ke||!ht)return this._firstMove===void 0&&(this._firstMove=Ne),Ne-this._firstMove0==ge.y>0;return Ks(te)&&Ks(ge)&&Bt}},K})(xi),Ho={panStep:100,bearingStep:15,pitchStep:10},Yo=function(){var K=Ho;this._panStep=K.panStep,this._bearingStep=K.bearingStep,this._pitchStep=K.pitchStep,this._rotationDisabled=!1};Yo.prototype.reset=function(){this._active=!1},Yo.prototype.keydown=function(K){var ye=this;if(!(K.altKey||K.ctrlKey||K.metaKey)){var te=0,ge=0,Ne=0,Me=0,Ke=0;switch(K.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:K.shiftKey?ge=-1:(K.preventDefault(),Me=-1);break;case 39:K.shiftKey?ge=1:(K.preventDefault(),Me=1);break;case 38:K.shiftKey?Ne=1:(K.preventDefault(),Ke=-1);break;case 40:K.shiftKey?Ne=-1:(K.preventDefault(),Ke=1);break;default:return}return this._rotationDisabled&&(ge=0,Ne=0),{cameraAnimation:function(ht){var Bt=ht.getZoom();ht.easeTo({duration:300,easeId:"keyboardHandler",easing:el,zoom:te?Math.round(Bt)+te*(K.shiftKey?2:1):Bt,bearing:ht.getBearing()+ge*ye._bearingStep,pitch:ht.getPitch()+Ne*ye._pitchStep,offset:[-Me*ye._panStep,-Ke*ye._panStep],center:ht.getCenter()},{originalEvent:K})}}}},Yo.prototype.enable=function(){this._enabled=!0},Yo.prototype.disable=function(){this._enabled=!1,this.reset()},Yo.prototype.isEnabled=function(){return this._enabled},Yo.prototype.isActive=function(){return this._active},Yo.prototype.disableRotation=function(){this._rotationDisabled=!0},Yo.prototype.enableRotation=function(){this._rotationDisabled=!1};function el(me){return me*(2-me)}var yl=4.000244140625,Yl=1/100,sl=1/450,Nu=2,tt=function(K,ye){this._map=K,this._el=K.getCanvasContainer(),this._handler=ye,this._delta=0,this._defaultZoomRate=Yl,this._wheelZoomRate=sl,e.bindAll(["_onTimeout"],this)};tt.prototype.setZoomRate=function(K){this._defaultZoomRate=K},tt.prototype.setWheelZoomRate=function(K){this._wheelZoomRate=K},tt.prototype.isEnabled=function(){return!!this._enabled},tt.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},tt.prototype.isZooming=function(){return!!this._zooming},tt.prototype.enable=function(K){this.isEnabled()||(this._enabled=!0,this._aroundCenter=K&&K.around==="center")},tt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},tt.prototype.wheel=function(K){if(this.isEnabled()){var ye=K.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?K.deltaY*40:K.deltaY,te=e.browser.now(),ge=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,ye!==0&&ye%yl===0?this._type="wheel":ye!==0&&Math.abs(ye)<4?this._type="trackpad":ge>400?(this._type=null,this._lastValue=ye,this._timeout=setTimeout(this._onTimeout,40,K)):this._type||(this._type=Math.abs(ge*ye)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ye+=this._lastValue)),K.shiftKey&&ye&&(ye=ye/4),this._type&&(this._lastWheelEvent=K,this._delta-=ye,this._active||this._start(K)),K.preventDefault()}},tt.prototype._onTimeout=function(K){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(K)},tt.prototype._start=function(K){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var ye=r.mousePos(this._el,K);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(ye)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},tt.prototype.renderFrame=function(){var K=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var ye=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>yl?this._wheelZoomRate:this._defaultZoomRate,ge=Nu/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&ge!==0&&(ge=1/ge);var Ne=typeof this._targetZoom=="number"?ye.zoomScale(this._targetZoom):ye.scale;this._targetZoom=Math.min(ye.maxZoom,Math.max(ye.minZoom,ye.scaleZoom(Ne*ge))),this._type==="wheel"&&(this._startZoom=ye.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Me=typeof this._targetZoom=="number"?this._targetZoom:ye.zoom,Ke=this._startZoom,ht=this._easing,Bt=!1,gr;if(this._type==="wheel"&&Ke&&ht){var Dr=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),ur=ht(Dr);gr=e.number(Ke,Me,ur),Dr<1?this._frameId||(this._frameId=!0):Bt=!0}else gr=Me,Bt=!0;return this._active=!0,Bt&&(this._active=!1,this._finishTimeout=setTimeout(function(){K._zooming=!1,K._handler._triggerRenderFrame(),delete K._targetZoom,delete K._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Bt,zoomDelta:gr-ye.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},tt.prototype._smoothOutEasing=function(K){var ye=e.ease;if(this._prevEase){var te=this._prevEase,ge=(e.browser.now()-te.start)/te.duration,Ne=te.easing(ge+.01)-te.easing(ge),Me=.27/Math.sqrt(Ne*Ne+1e-4)*.01,Ke=Math.sqrt(.27*.27-Me*Me);ye=e.bezier(Me,Ke,.25,1)}return this._prevEase={start:e.browser.now(),duration:K,easing:ye},ye},tt.prototype.reset=function(){this._active=!1};var Gt=function(K,ye){this._clickZoom=K,this._tapZoom=ye};Gt.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Gt.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Gt.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Gt.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var or=function(){this.reset()};or.prototype.reset=function(){this._active=!1},or.prototype.dblclick=function(K,ye){return K.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(K.shiftKey?-1:1),around:te.unproject(ye)},{originalEvent:K})}}},or.prototype.enable=function(){this._enabled=!0},or.prototype.disable=function(){this._enabled=!1,this.reset()},or.prototype.isEnabled=function(){return this._enabled},or.prototype.isActive=function(){return this._active};var ea=function(){this._tap=new qa({numTouches:1,numTaps:1}),this.reset()};ea.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ea.prototype.touchstart=function(K,ye,te){this._swipePoint||(this._tapTime&&K.timeStamp-this._tapTime>Nr&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=ye[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(K,ye,te))},ea.prototype.touchmove=function(K,ye,te){if(!this._tapTime)this._tap.touchmove(K,ye,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var ge=ye[0],Ne=ge.y-this._swipePoint.y;return this._swipePoint=ge,K.preventDefault(),this._active=!0,{zoomDelta:Ne/128}}},ea.prototype.touchend=function(K,ye,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var ge=this._tap.touchend(K,ye,te);ge&&(this._tapTime=K.timeStamp)}},ea.prototype.touchcancel=function(){this.reset()},ea.prototype.enable=function(){this._enabled=!0},ea.prototype.disable=function(){this._enabled=!1,this.reset()},ea.prototype.isEnabled=function(){return this._enabled},ea.prototype.isActive=function(){return this._active};var pa=function(K,ye,te){this._el=K,this._mousePan=ye,this._touchPan=te};pa.prototype.enable=function(K){this._inertiaOptions=K||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},pa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},pa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},pa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var la=function(K,ye,te){this._pitchWithRotate=K.pitchWithRotate,this._mouseRotate=ye,this._mousePitch=te};la.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},la.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},la.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},la.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fa=function(K,ye,te,ge){this._el=K,this._touchZoom=ye,this._touchRotate=te,this._tapDragZoom=ge,this._rotationDisabled=!1,this._enabled=!0};fa.prototype.enable=function(K){this._touchZoom.enable(K),this._rotationDisabled||this._touchRotate.enable(K),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fa.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fa.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fa.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fa.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fa.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ja=function(me){return me.zoom||me.drag||me.pitch||me.rotate},hn=(function(me){function K(){me.apply(this,arguments)}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K})(e.Event);function un(me){return me.panDelta&&me.panDelta.mag()||me.zoomDelta||me.bearingDelta||me.pitchDelta}var Ja=function(K,ye){this._map=K,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new pl(K),this._bearingSnap=ye.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ye),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var ge=0,Ne=this._listeners;geKe?Math.min(2,Vt):Math.max(.5,Vt),Fa=Math.pow(on,1-Hr),Za=Me.unproject(cr.add(rr.mult(Hr*Fa)).mult(ca));Me.setLocationAtPoint(Me.renderWorldCopies?Za.wrap():Za,$t)}Ne._fireMoveEvents(ge)},function(Hr){Ne._afterEase(ge,Hr)},te),this},K.prototype._prepareEase=function(te,ge,Ne){Ne===void 0&&(Ne={}),this._moving=!0,!ge&&!Ne.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ne.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ne.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ne.pitching&&this.fire(new e.Event("pitchstart",te))},K.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},K.prototype._afterEase=function(te,ge){if(!(this._easeId&&ge&&this._easeId===ge)){delete this._easeId;var Ne=this._zooming,Me=this._rotating,Ke=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ne&&this.fire(new e.Event("zoomend",te)),Me&&this.fire(new e.Event("rotateend",te)),Ke&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},K.prototype.flyTo=function(te,ge){var Ne=this;if(!te.essential&&e.browser.prefersReducedMotion){var Me=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Me,ge)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var Ke=this.transform,ht=this.getZoom(),Bt=this.getBearing(),gr=this.getPitch(),Dr=this.getPadding(),ur="zoom"in te?e.clamp(+te.zoom,Ke.minZoom,Ke.maxZoom):ht,vt="bearing"in te?this._normalizeBearing(te.bearing,Bt):Bt,wt="pitch"in te?+te.pitch:gr,It="padding"in te?te.padding:Ke.padding,$t=Ke.zoomScale(ur-ht),lr=e.Point.convert(te.offset),tr=Ke.centerPoint.add(lr),cr=Ke.pointLocation(tr),rr=e.LngLat.convert(te.center||cr);this._normalizeCenter(rr);var Vt=Ke.project(cr),er=Ke.project(rr).sub(Vt),Nt=te.curve,Cr=Math.max(Ke.width,Ke.height),Hr=Cr/$t,ca=er.mag();if("minZoom"in te){var on=e.clamp(Math.min(te.minZoom,ht,ur),Ke.minZoom,Ke.maxZoom),Fa=Cr/Ke.zoomScale(on-ht);Nt=Math.sqrt(Fa/ca*2)}var Za=Nt*Nt;function Nn(xo){var os=(Hr*Hr-Cr*Cr+(xo?-1:1)*Za*Za*ca*ca)/(2*(xo?Hr:Cr)*Za*ca);return Math.log(Math.sqrt(os*os+1)-os)}function En(xo){return(Math.exp(xo)-Math.exp(-xo))/2}function Qa(xo){return(Math.exp(xo)+Math.exp(-xo))/2}function cn(xo){return En(xo)/Qa(xo)}var mn=Nn(0),Pn=function(xo){return Qa(mn)/Qa(mn+Nt*xo)},ei=function(xo){return Cr*((Qa(mn)*cn(mn+Nt*xo)-En(mn))/Za)/ca},no=(Nn(1)-mn)/Nt;if(Math.abs(ca)<1e-6||!isFinite(no)){if(Math.abs(Cr-Hr)<1e-6)return this.easeTo(te,ge);var Ao=Hrte.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=Bt!==vt,this._pitching=wt!==gr,this._padding=!Ke.isPaddingEqual(It),this._prepareEase(ge,!1),this._ease(function(xo){var os=xo*no,ks=1/Pn(os);Ke.zoom=xo===1?ur:ht+Ke.scaleZoom(ks),Ne._rotating&&(Ke.bearing=e.number(Bt,vt,xo)),Ne._pitching&&(Ke.pitch=e.number(gr,wt,xo)),Ne._padding&&(Ke.interpolatePadding(Dr,It,xo),tr=Ke.centerPoint.add(lr));var Vl=xo===1?rr:Ke.unproject(Vt.add(er.mult(ei(os))).mult(ks));Ke.setLocationAtPoint(Ke.renderWorldCopies?Vl.wrap():Vl,tr),Ne._fireMoveEvents(ge)},function(){return Ne._afterEase(ge)},te),this},K.prototype.isEasing=function(){return!!this._easeFrameId},K.prototype.stop=function(){return this._stop()},K.prototype._stop=function(te,ge){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ne=this._onEaseEnd;delete this._onEaseEnd,Ne.call(this,ge)}if(!te){var Me=this.handlers;Me&&Me.stop(!1)}return this},K.prototype._ease=function(te,ge,Ne){Ne.animate===!1||Ne.duration===0?(te(1),ge()):(this._easeStart=e.browser.now(),this._easeOptions=Ne,this._onEaseFrame=te,this._onEaseEnd=ge,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},K.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},K.prototype._normalizeBearing=function(te,ge){te=e.wrap(te,-180,180);var Ne=Math.abs(te-ge);return Math.abs(te-360-ge)180?-360:Ne<-180?360:0}},K})(e.Evented),Mn=function(K){K===void 0&&(K={}),this.options=K,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mn.prototype.getDefaultPosition=function(){return"bottom-right"},Mn.prototype.onAdd=function(K){var ye=this.options&&this.options.compact;return this._map=K,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),ye&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),ye===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mn.prototype._setElementTitle=function(K,ye){var te=this._map._getUIString("AttributionControl."+ye);K.title=te,K.setAttribute("aria-label",te)},Mn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Mn.prototype._updateEditLink=function(){var K=this._editLink;K||(K=this._editLink=this._container.querySelector(".mapbox-improve-map"));var ye=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(K){var te=ye.reduce(function(ge,Ne,Me){return Ne.value&&(ge+=Ne.key+"="+Ne.value+(Me=0)return!1;return!0});var Ke=K.join(" | ");Ke!==this._attribHTML&&(this._attribHTML=Ke,K.length?(this._innerContainer.innerHTML=Ke,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var yn=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};yn.prototype.onAdd=function(K){this._map=K,this._container=r.create("div","mapboxgl-ctrl");var ye=r.create("a","mapboxgl-ctrl-logo");return ye.target="_blank",ye.rel="noopener nofollow",ye.href="https://www.mapbox.com/",ye.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ye.setAttribute("rel","noopener nofollow"),this._container.appendChild(ye),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},yn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},yn.prototype.getDefaultPosition=function(){return"bottom-left"},yn.prototype._updateLogo=function(K){(!K||K.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},yn.prototype._logoRequired=function(){if(this._map.style){var K=this._map.style.sourceCaches;for(var ye in K){var te=K[ye].getSource();if(te.mapbox_logo)return!0}return!1}},yn.prototype._updateCompact=function(){var K=this._container.children;if(K.length){var ye=K[0];this._map.getCanvasContainer().offsetWidth<250?ye.classList.add("mapboxgl-compact"):ye.classList.remove("mapboxgl-compact")}};var Pa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Pa.prototype.add=function(K){var ye=++this._id,te=this._queue;return te.push({callback:K,id:ye,cancelled:!1}),ye},Pa.prototype.remove=function(K){for(var ye=this._currentlyRunning,te=ye?this._queue.concat(ye):this._queue,ge=0,Ne=te;gete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchri)throw new Error("maxPitch must be less than or equal to "+ri);var Ne=new Io(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(me.call(this,Ne,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Pa,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Zr,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof Ha)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return ge._update(!1)}),this.on("moveend",function(){return ge._update(!1)}),this.on("zoom",function(){return ge._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ja(this,te);var Me=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new Ml(Me).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Mn({customAttribution:te.customAttribution})),this.addControl(new yn,te.logoPosition),this.on("style.load",function(){ge.transform.unmodified&&ge.jumpTo(ge.style.stylesheet)}),this.on("data",function(Ke){ge._update(Ke.dataType==="style"),ge.fire(new e.Event(Ke.dataType+"data",Ke))}),this.on("dataloading",function(Ke){ge.fire(new e.Event(Ke.dataType+"dataloading",Ke))})}me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K;var ye={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return K.prototype._getMapId=function(){return this._mapId},K.prototype.addControl=function(ge,Ne){if(Ne===void 0&&(ge.getDefaultPosition?Ne=ge.getDefaultPosition():Ne="top-right"),!ge||!ge.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var Me=ge.onAdd(this);this._controls.push(ge);var Ke=this._controlPositions[Ne];return Ne.indexOf("bottom")!==-1?Ke.insertBefore(Me,Ke.firstChild):Ke.appendChild(Me),this},K.prototype.removeControl=function(ge){if(!ge||!ge.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ne=this._controls.indexOf(ge);return Ne>-1&&this._controls.splice(Ne,1),ge.onRemove(this),this},K.prototype.hasControl=function(ge){return this._controls.indexOf(ge)>-1},K.prototype.resize=function(ge){var Ne=this._containerDimensions(),Me=Ne[0],Ke=Ne[1];this._resizeCanvas(Me,Ke),this.transform.resize(Me,Ke),this.painter.resize(Me,Ke);var ht=!this._moving;return ht&&(this.stop(),this.fire(new e.Event("movestart",ge)).fire(new e.Event("move",ge))),this.fire(new e.Event("resize",ge)),ht&&this.fire(new e.Event("moveend",ge)),this},K.prototype.getBounds=function(){return this.transform.getBounds()},K.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},K.prototype.setMaxBounds=function(ge){return this.transform.setMaxBounds(e.LngLatBounds.convert(ge)),this._update()},K.prototype.setMinZoom=function(ge){if(ge=ge??za,ge>=za&&ge<=this.transform.maxZoom)return this.transform.minZoom=ge,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=ge,this._update(),this.getZoom()>ge&&this.setZoom(ge),this;throw new Error("maxZoom must be greater than the current minZoom")},K.prototype.getMaxZoom=function(){return this.transform.maxZoom},K.prototype.setMinPitch=function(ge){if(ge=ge??bn,ge=bn&&ge<=this.transform.maxPitch)return this.transform.minPitch=ge,this._update(),this.getPitch()ri)throw new Error("maxPitch must be less than or equal to "+ri);if(ge>=this.transform.minPitch)return this.transform.maxPitch=ge,this._update(),this.getPitch()>ge&&this.setPitch(ge),this;throw new Error("maxPitch must be greater than the current minPitch")},K.prototype.getMaxPitch=function(){return this.transform.maxPitch},K.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},K.prototype.setRenderWorldCopies=function(ge){return this.transform.renderWorldCopies=ge,this._update()},K.prototype.project=function(ge){return this.transform.locationPoint(e.LngLat.convert(ge))},K.prototype.unproject=function(ge){return this.transform.pointLocation(e.Point.convert(ge))},K.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},K.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},K.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},K.prototype._createDelegatedListener=function(ge,Ne,Me){var Ke=this,ht;if(ge==="mouseenter"||ge==="mouseover"){var Bt=!1,gr=function($t){var lr=Ke.getLayer(Ne)?Ke.queryRenderedFeatures($t.point,{layers:[Ne]}):[];lr.length?Bt||(Bt=!0,Me.call(Ke,new Ie(ge,Ke,$t.originalEvent,{features:lr}))):Bt=!1},Dr=function(){Bt=!1};return{layer:Ne,listener:Me,delegates:{mousemove:gr,mouseout:Dr}}}else if(ge==="mouseleave"||ge==="mouseout"){var ur=!1,vt=function($t){var lr=Ke.getLayer(Ne)?Ke.queryRenderedFeatures($t.point,{layers:[Ne]}):[];lr.length?ur=!0:ur&&(ur=!1,Me.call(Ke,new Ie(ge,Ke,$t.originalEvent)))},wt=function($t){ur&&(ur=!1,Me.call(Ke,new Ie(ge,Ke,$t.originalEvent)))};return{layer:Ne,listener:Me,delegates:{mousemove:vt,mouseout:wt}}}else{var It=function($t){var lr=Ke.getLayer(Ne)?Ke.queryRenderedFeatures($t.point,{layers:[Ne]}):[];lr.length&&($t.features=lr,Me.call(Ke,$t),delete $t.features)};return{layer:Ne,listener:Me,delegates:(ht={},ht[ge]=It,ht)}}},K.prototype.on=function(ge,Ne,Me){if(Me===void 0)return me.prototype.on.call(this,ge,Ne);var Ke=this._createDelegatedListener(ge,Ne,Me);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[ge]=this._delegatedListeners[ge]||[],this._delegatedListeners[ge].push(Ke);for(var ht in Ke.delegates)this.on(ht,Ke.delegates[ht]);return this},K.prototype.once=function(ge,Ne,Me){if(Me===void 0)return me.prototype.once.call(this,ge,Ne);var Ke=this._createDelegatedListener(ge,Ne,Me);for(var ht in Ke.delegates)this.once(ht,Ke.delegates[ht]);return this},K.prototype.off=function(ge,Ne,Me){var Ke=this;if(Me===void 0)return me.prototype.off.call(this,ge,Ne);var ht=function(Bt){for(var gr=Bt[ge],Dr=0;Dr180;){var Me=ye.locationPoint(me);if(Me.x>=0&&Me.y>=0&&Me.x<=ye.width&&Me.y<=ye.height)break;me.lng>ye.center.lng?me.lng-=360:me.lng+=360}return me}var ii={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function bi(me,K,ye){var te=me.classList;for(var ge in ii)te.remove("mapboxgl-"+ye+"-anchor-"+ge);te.add("mapboxgl-"+ye+"-anchor-"+K)}var Tn=(function(me){function K(ye,te){if(me.call(this),(ye instanceof e.window.HTMLElement||te)&&(ye=e.extend({element:ye},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=ye&&ye.anchor||"center",this._color=ye&&ye.color||"#3FB1CE",this._scale=ye&&ye.scale||1,this._draggable=ye&&ye.draggable||!1,this._clickTolerance=ye&&ye.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=ye&&ye.rotation||0,this._rotationAlignment=ye&&ye.rotationAlignment||"auto",this._pitchAlignment=ye&&ye.pitchAlignment&&ye.pitchAlignment!=="auto"?ye.pitchAlignment:this._rotationAlignment,!ye||!ye.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var ge=r.createNS("http://www.w3.org/2000/svg","svg"),Ne=41,Me=27;ge.setAttributeNS(null,"display","block"),ge.setAttributeNS(null,"height",Ne+"px"),ge.setAttributeNS(null,"width",Me+"px"),ge.setAttributeNS(null,"viewBox","0 0 "+Me+" "+Ne);var Ke=r.createNS("http://www.w3.org/2000/svg","g");Ke.setAttributeNS(null,"stroke","none"),Ke.setAttributeNS(null,"stroke-width","1"),Ke.setAttributeNS(null,"fill","none"),Ke.setAttributeNS(null,"fill-rule","evenodd");var ht=r.createNS("http://www.w3.org/2000/svg","g");ht.setAttributeNS(null,"fill-rule","nonzero");var Bt=r.createNS("http://www.w3.org/2000/svg","g");Bt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Bt.setAttributeNS(null,"fill","#000000");for(var gr=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Dr=0,ur=gr;Dr=ge}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},K.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},K.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},K.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},K.prototype.isDraggable=function(){return this._draggable},K.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},K.prototype.getRotation=function(){return this._rotation},K.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},K.prototype.getRotationAlignment=function(){return this._rotationAlignment},K.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},K.prototype.getPitchAlignment=function(){return this._pitchAlignment},K})(e.Evented),Yn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},mi;function wi(me){mi!==void 0?me(mi):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(K){mi=K.state!=="denied",me(mi)}):(mi=!!e.window.navigator.geolocation,me(mi))}var Ri=0,ps=!1,Js=(function(me){function K(ye){me.call(this),this.options=e.extend({},Yn,ye),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),wi(this._setupUI),this._container},K.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ri=0,ps=!1},K.prototype._isOutOfMapMaxBounds=function(te){var ge=this._map.getMaxBounds(),Ne=te.coords;return ge&&(Ne.longitudege.getEast()||Ne.latitudege.getNorth())},K.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},K.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},K.prototype._updateCamera=function(te){var ge=new e.LngLat(te.coords.longitude,te.coords.latitude),Ne=te.coords.accuracy,Me=this._map.getBearing(),Ke=e.extend({bearing:Me},this.options.fitBoundsOptions);this._map.fitBounds(ge.toBounds(Ne),Ke,{geolocateSource:!0})},K.prototype._updateMarker=function(te){if(te){var ge=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(ge).addTo(this._map),this._userLocationDotMarker.setLngLat(ge).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},K.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,ge=this._map.unproject([0,te]),Ne=this._map.unproject([1,te]),Me=ge.distanceTo(Ne),Ke=Math.ceil(2*this._accuracy/Me);this._circleElement.style.width=Ke+"px",this._circleElement.style.height=Ke+"px"},K.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},K.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var ge=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ge,this._geolocateButton.setAttribute("aria-label",ge),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&ps)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},K.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},K.prototype._setupUI=function(te){var ge=this;if(this._container.addEventListener("contextmenu",function(Ke){return Ke.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ne,this._geolocateButton.setAttribute("aria-label",Ne)}else{var Me=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Me,this._geolocateButton.setAttribute("aria-label",Me)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Tn(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Tn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(Ke){var ht=Ke.originalEvent&&Ke.originalEvent.type==="resize";!Ke.geolocateSource&&ge._watchState==="ACTIVE_LOCK"&&!ht&&(ge._watchState="BACKGROUND",ge._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),ge._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),ge.fire(new e.Event("trackuserlocationend")))})},K.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ri--,ps=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ri++;var te;Ri>1?(te={maximumAge:6e5,timeout:0},ps=!0):(te=this.options.positionOptions,ps=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},K.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},K})(e.Evented),Qi={maxWidth:100,unit:"metric"},_l=function(K){this.options=e.extend({},Qi,K),e.bindAll(["_onMove","setUnit"],this)};_l.prototype.getDefaultPosition=function(){return"bottom-left"},_l.prototype._onMove=function(){Wo(this._map,this._container,this.options)},_l.prototype.onAdd=function(K){return this._map=K,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",K.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},_l.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},_l.prototype.setUnit=function(K){this.options.unit=K,Wo(this._map,this._container,this.options)};function Wo(me,K,ye){var te=ye&&ye.maxWidth||100,ge=me._container.clientHeight/2,Ne=me.unproject([0,ge]),Me=me.unproject([te,ge]),Ke=Ne.distanceTo(Me);if(ye&&ye.unit==="imperial"){var ht=3.2808*Ke;if(ht>5280){var Bt=ht/5280;tl(K,te,Bt,me._getUIString("ScaleControl.Miles"))}else tl(K,te,ht,me._getUIString("ScaleControl.Feet"))}else if(ye&&ye.unit==="nautical"){var gr=Ke/1852;tl(K,te,gr,me._getUIString("ScaleControl.NauticalMiles"))}else Ke>=1e3?tl(K,te,Ke/1e3,me._getUIString("ScaleControl.Kilometers")):tl(K,te,Ke,me._getUIString("ScaleControl.Meters"))}function tl(me,K,ye,te){var ge=El(ye),Ne=ge/ye;me.style.width=K*Ne+"px",me.innerHTML=ge+" "+te}function al(me){var K=Math.pow(10,Math.ceil(-Math.log(me)/Math.LN10));return Math.round(me*K)/K}function El(me){var K=Math.pow(10,(""+Math.floor(me)).length-1),ye=me/K;return ye=ye>=10?10:ye>=5?5:ye>=3?3:ye>=2?2:ye>=1?1:al(ye),K*ye}var ws=function(K){this._fullscreen=!1,K&&K.container&&(K.container instanceof e.window.HTMLElement?this._container=K.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};ws.prototype.onAdd=function(K){return this._map=K,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ws.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ws.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},ws.prototype._setupUI=function(){var K=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",K).setAttribute("aria-hidden",!0),K.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ws.prototype._updateTitle=function(){var K=this._getTitle();this._fullscreenButton.setAttribute("aria-label",K),this._fullscreenButton.title=K},ws.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ws.prototype._isFullscreen=function(){return this._fullscreen},ws.prototype._changeIcon=function(){var K=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;K===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ws.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Hs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},$s=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Di=(function(me){function K(ye){me.call(this),this.options=e.extend(Object.create(Hs),ye),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return me&&(K.__proto__=me),K.prototype=Object.create(me&&me.prototype),K.prototype.constructor=K,K.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},K.prototype.isOpen=function(){return!!this._map},K.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},K.prototype.getLngLat=function(){return this._lngLat},K.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},K.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},K.prototype.getElement=function(){return this._container},K.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},K.prototype.setHTML=function(te){var ge=e.window.document.createDocumentFragment(),Ne=e.window.document.createElement("body"),Me;for(Ne.innerHTML=te;Me=Ne.firstChild,!!Me;)ge.appendChild(Me);return this.setDOMContent(ge)},K.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},K.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},K.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},K.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},K.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},K.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},K.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},K.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},K.prototype._onMouseUp=function(te){this._update(te.point)},K.prototype._onMouseMove=function(te){this._update(te.point)},K.prototype._onDrag=function(te){this._update(te.point)},K.prototype._update=function(te){var ge=this,Ne=this._lngLat||this._trackPointer;if(!(!this._map||!Ne||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(vt){return ge._container.classList.add(vt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Bn(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var Me=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),Ke=this.options.anchor,ht=nl(this.options.offset);if(!Ke){var Bt=this._container.offsetWidth,gr=this._container.offsetHeight,Dr;Me.y+ht.bottom.ythis._map.transform.height-gr?Dr=["bottom"]:Dr=[],Me.xthis._map.transform.width-Bt/2&&Dr.push("right"),Dr.length===0?Ke="bottom":Ke=Dr.join("-")}var ur=Me.add(ht[Ke]).round();r.setTransform(this._container,ii[Ke]+" translate("+ur.x+"px,"+ur.y+"px)"),bi(this._container,Ke,"popup")}},K.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector($s);te&&te.focus()}},K.prototype._onClose=function(){this.remove()},K})(e.Evented);function nl(me){if(me)if(typeof me=="number"){var K=Math.round(Math.sqrt(.5*Math.pow(me,2)));return{center:new e.Point(0,0),top:new e.Point(0,me),"top-left":new e.Point(K,K),"top-right":new e.Point(-K,K),bottom:new e.Point(0,-me),"bottom-left":new e.Point(K,-K),"bottom-right":new e.Point(-K,-K),left:new e.Point(me,0),right:new e.Point(-me,0)}}else if(me instanceof e.Point||Array.isArray(me)){var ye=e.Point.convert(me);return{center:ye,top:ye,"top-left":ye,"top-right":ye,bottom:ye,"bottom-left":ye,"bottom-right":ye,left:ye,right:ye}}else return{center:e.Point.convert(me.center||[0,0]),top:e.Point.convert(me.top||[0,0]),"top-left":e.Point.convert(me["top-left"]||[0,0]),"top-right":e.Point.convert(me["top-right"]||[0,0]),bottom:e.Point.convert(me.bottom||[0,0]),"bottom-left":e.Point.convert(me["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(me["bottom-right"]||[0,0]),left:e.Point.convert(me.left||[0,0]),right:e.Point.convert(me.right||[0,0])};else return nl(new e.Point(0,0))}var mo={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Ia,NavigationControl:dn,GeolocateControl:Js,AttributionControl:Mn,ScaleControl:_l,FullscreenControl:ws,Popup:Di,Marker:Tn,Style:fl,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Wn,clearPrewarmedResources:ti,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(me){e.config.ACCESS_TOKEN=me},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(me){e.config.API_URL=me},get workerCount(){return Xa.workerCount},set workerCount(me){Xa.workerCount=me},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(me){e.config.MAX_PARALLEL_IMAGE_REQUESTS=me},clearStorage:function(K){e.clearTileCache(K)},workerUrl:""};return mo}),S})}}),lI=Ge({"src/plots/mapbox/layers.js"(Z,q){"use strict";var d=ta(),x=Il().sanitizeHTML,S=CT(),E=ld();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var h=i.symbol,f=S(h.textposition,h.iconsize);d.extendFlat(n,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":h.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":h.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,h={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",h.tileSize=256):n==="image"&&(f="url",h.coordinates=i.coordinates),h[f]=s,i.sourceattribution&&(h.attribution=x(i.sourceattribution)),h}q.exports=function(n,s,h){var f=new e(n,s);return f.update(h),f}}}),uI=Ge({"src/plots/mapbox/mapbox.js"(Z,q){"use strict";var d=LT(),x=ta(),S=Yd(),E=Yi(),e=Mo(),t=sh(),r=mc(),o=fv(),a=o.drawMode,i=o.selectMode,n=Pc().prepSelect,s=Pc().clearOutline,h=Pc().clearSelectionsCache,f=Pc().selectOnClick,p=ld(),c=lI();function T(g,b){this.id=b,this.gd=g;var v=g._fullLayout,u=g._context;this.container=v._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=v._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(v),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(g,b,v){var u=this,y=b[u.id];u.map&&y.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var m;u.map?m=new Promise(function(R,L){u.updateMap(g,b,R,L)}):m=new Promise(function(R,L){u.createMap(g,b,R,L)}),v.push(m)},l.createMap=function(g,b,v,u){var y=this,m=b[y.id],R=y.styleObj=w(m.style,b);y.accessToken=m.accesstoken;var L=m.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new d.Map({container:y.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var N=[];N.push(new Promise(function(O){F.once("load",O)})),N=N.concat(S.fetchTraceGeoData(g)),Promise.all(N).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.updateMap=function(g,b,v,u){var y=this,m=y.map,R=b[this.id];y.rejectOnError(u);var L=[],z=w(R.style,b);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,m.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){m.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.fillBelowLookup=function(g,b){var v=b[this.id],u=v.layers,y,m,R=this.belowLookup={},L=!1;for(y=0;y1)for(y=0;y-1&&f(z.originalEvent,u,[v.xaxis],[v.yaxis],v.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,v=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var m=g.dragmode,R;R=function(z,F){if(F.isRect){var N=z.range={};N[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:R},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),v.off("click",b.onClickInPanHandler),i(m)||a(m)?(v.dragPan.disable(),v.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,N){n(z,F,N,b.dragOptions,m)},t.init(b.dragOptions)):(v.dragPan.enable(),v.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),v.on("click",b.onClickInPanHandler))},l.updateFramework=function(g){var b=g[this.id].domain,v=g._size,u=this.div.style;u.width=v.w*(b.x[1]-b.x[0])+"px",u.height=v.h*(b.y[1]-b.y[0])+"px",u.left=v.l+b.x[0]*v.w+"px",u.top=v.t+(1-b.y[1])*v.h+"px",this.xaxis._offset=v.l+b.x[0]*v.w,this.xaxis._length=v.w*(b.x[1]-b.x[0]),this.yaxis._offset=v.t+(1-b.y[1])*v.h,this.yaxis._length=v.h*(b.y[1]-b.y[0])},l.updateLayers=function(g){var b=g[this.id],v=b.layers,u=this.layerList,y;if(v.length!==u.length){for(y=0;yN/2){var O=R.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,c),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var P=1;F.width+6>N&&(P=N/(F.width+6));var U=[_.l+_.w*M.x[1],_.t+_.h*(1-M.y[0])];L.attr("transform",x(U[0],U[1])+S(P))}};function f(c,T){var l=c._fullLayout,_=c._context;if(_.mapboxAccessToken==="")return"";for(var w=[],A=[],M=!1,g=!1,b=0;b1&&d.warn(n.multipleTokensErrorMsg),w[0]):(A.length&&d.log(["Listed mapbox access token(s)",A.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function p(c){return typeof c=="string"&&(n.styleValuesMapbox.indexOf(c)!==-1||c.indexOf("mapbox://")===0||c.indexOf("stamen")===0)}Z.updateFx=function(c){for(var T=c._fullLayout,l=T._subplots[i],_=0;_=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),h=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,h),o[0].trace._glTrace=i,i}}}),pI=Ge({"src/traces/choroplethmapbox/index.js"(Z,q){"use strict";var d=["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");q.exports={attributes:PT(),supplyDefaults:vI(),colorbar:Od(),calc:O_(),plot:dI(),hoverPoints:N_(),eventData:U_(),selectPoints:j_(),styleOnSelect:function(x,S){if(S){var E=S[0].trace;E._glTrace.updateOnSelect(S)}},getBelow:function(x,S){for(var E=S.getMapLayers(),e=E.length-2;e>=0;e--){var t=E[e].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=e+1;r0?+c[f]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:A})}}var g=E.extractOpts(a),b=g.reversescale?E.flipScale(g.colorscale):g.colorscale,v=b[0][1],u=S.opacity(v)<1?v:S.addOpacity(v,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},q.exports=function(t,r){var o=r[0].trace,a=new S(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),bI=Ge({"src/traces/densitymapbox/hover.js"(Z,q){"use strict";var d=Mo(),x=ex().hoverPoints,S=ex().getExtraText;q.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var h=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return a.extraText=S(n,s,i[0].t.labels),[a]}}}}),wI=Ge({"src/traces/densitymapbox/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),TI=Ge({"src/traces/densitymapbox/index.js"(Z,q){"use strict";var d=["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");q.exports={attributes:RT(),supplyDefaults:gI(),colorbar:Od(),formatLabels:kT(),calc:yI(),plot:xI(),hoverPoints:bI(),eventData:wI(),getBelow:function(x,S){for(var E=S.getMapLayers(),e=0;eESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} @@ -3208,10 +3208,10 @@ uniform `+dr+" "+Dr+" u_"+ur+`; {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),SI=We({"src/plots/map/styles/arcgis-sat.js"(Z,V){V.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),Xd=We({"src/plots/map/constants.js"(Z,V){"use strict";var d=Ad(),x=AI(),A=SI(),E='\xA9 OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:A,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);V.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error."}}}),Fg=We({"src/plots/map/layout_attributes.js"(Z,V){"use strict";var d=aa(),x=Fi().defaultLine,A=Uu().attributes,E=_u(),e=vc().textposition,t=Iu().overrideAll,r=sl().templatedArray,o=Xd(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=V.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),Z_=We({"src/traces/scattermap/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:A}=wl(),E=uv(),e=Up(),t=vc(),r=Fg(),o=El(),a=Zl(),i=Fo().extendFlat,n=Iu().overrideAll,s=Fg(),h=e.line,c=e.marker;V.exports=n({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:A({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},a("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:A()},"calc","nested")}}),LT=We({"src/traces/scattermap/constants.js"(Z,V){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),MI=We({"src/traces/scattermap/defaults.js"(Z,V){"use strict";var d=aa(),x=au(),A=Oh(),E=Gh(),e=Hh(),t=fv(),r=Z_(),o=LT().isSupportedFont;V.exports=function(n,s,h,c){function m(g,f){return d.coerce(n,s,r,g,f)}function p(g,f){return d.coerce2(n,s,r,g,f)}var T=a(n,s,m);if(!T){s.visible=!1;return}if(m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),m("below"),x.hasMarkers(s)){A(n,s,h,c,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,h,c,m,{noDash:!0}),m("connectgaps"));var _=p("cluster.maxzoom"),w=p("cluster.step"),S=p("cluster.color",s.marker&&s.marker.color||h),M=p("cluster.size"),y=p("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||M!==!1||y!==!1,v=m("cluster.enabled",b);if(v||x.hasText(s)){var u=c.font.family;e(n,s,c,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}m("fill"),s.fill!=="none"&&t(n,s,h,m),d.coerceSelectionMarkerOpacity(s,m)};function a(i,n,s){var h=s("lon")||[],c=s("lat")||[],m=Math.min(h.length,c.length);return n._length=m,m}}}),PT=We({"src/traces/scattermap/format_labels.js"(Z,V){"use strict";var d=Mo();V.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),IT=We({"src/plots/map/convert_text_opts.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var h;return n[0]&&n[1]?h=n.join("-"):n[0]?h=n[0]:n[1]?h=n[1]:h="center",{anchor:h,offset:s}}}}),EI=We({"src/traces/scattermap/convert.js"(Z,V){"use strict";var d=Uo(),x=aa(),A=bs().BADNUM,E=Vd(),e=xu(),t=Oo(),r=C0(),o=au(),a=LT().isSupportedFont,i=IT(),n=Th().appendArrayPointValue,s=zl().NEWLINES,h=zl().BR_TAG_ALL;V.exports=function(y,b){var v=b[0].trace,u=v.visible===!0&&v._length!==0,g=v.fill!=="none",f=o.hasLines(v),P=o.hasMarkers(v),L=o.hasText(v),z=P&&v.marker.symbol==="circle",F=P&&v.marker.symbol!=="circle",B=v.cluster&&v.cluster.enabled,O=c("fill"),I=c("line"),N=c("circle"),U=c("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((g||f)&&(Q=E.calcTraceToLineCoords(b)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":v.fillcolor})),f&&(I.geojson=E.makeLine(Q),I.layout.visibility="visible",x.extendFlat(I.paint,{"line-width":v.line.width,"line-color":v.line.color,"line-opacity":v.opacity})),z){var le=m(b);N.geojson=le.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],W.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(v.cluster.color,v.cluster.step),"circle-radius":w(v.cluster.size,v.cluster.step),"circle-opacity":w(v.cluster.opacity,v.cluster.step)}},W.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(v),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":le.mcc,"circle-radius":le.mrc,"circle-opacity":le.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||L)&&(U.geojson=p(b,y),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":v.marker.size/10}),"angle"in v.marker&&v.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=v.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":v.opacity*v.marker.opacity,"icon-color":v.marker.color})),L)){var se=(v.marker||{}).size,he=i(v.textposition,se);x.extendFlat(U.layout,{"text-size":v.textfont.size,"text-anchor":he.anchor,"text-offset":he.offset,"text-font":S(v)}),x.extendFlat(U.paint,{"text-color":v.textfont.color,"text-opacity":v.opacity})}return W};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(M){var y=M[0].trace,b=y.marker,v=y.selectedpoints,u=x.isArrayOrTypedArray(b.color),g=x.isArrayOrTypedArray(b.size),f=x.isArrayOrTypedArray(b.opacity),P;function L(se){return y.opacity*se}function z(se){return se/2}var F;u&&(e.hasColorscale(y,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;g&&(B=r(y));var O;f&&(O=function(se){var he=d(se)?+x.constrain(se,0,1):0;return L(he)});var I=[];for(P=0;P850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",g[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),kI=We({"src/traces/scattermap/plot.js"(Z,V){"use strict";var d=aa(),x=EI(),A=Xd().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,h=this.subplot.getMapLayers(),c=0;c=0;f--){var P=g[f];n.removeLayer(p.layerIds[P])}u||n.removeSource(p.sourceIds.circle)}function _(u){for(var g=E.nonCluster,f=0;f=0;f--){var P=g[f];n.removeLayer(p.layerIds[P]),u||n.removeSource(p.sourceIds[P])}}function S(u){m?l(u):w(u)}function M(u){c?T(u):_(u)}function y(){for(var u=c?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},V.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,h=new e(o,i.uid,n,s),c=x(o.gd,a),m=h.below=o.belowLookup["trace-"+i.uid],p,T,l;if(n)for(h.addSource("circle",c.circle,i.cluster),p=0;p=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,y=i-M;function b(B){var O=B.lonlat;if(O[0]===e||_&&T.indexOf(B.i+1)===-1)return 1/0;var I=x.modHalf(O[0],360),N=O[1],U=p.project([I,N]),W=U.x-c.c2p([y,N]),Q=U.y-m.c2p([I,n]),le=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-le,1-3/le)}if(d.getClosest(s,b,a),a.index!==!1){var v=s[a.index],u=v.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],f=c.c2p(g),P=m.c2p(g),L=v.mrc||1;a.x0=f-L,a.x1=f+L,a.y0=P-L,a.y1=P+L;var z={};z[h.subplot]={_subplot:p};var F=h._module.formatLabels(v,h,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(h,v),a.extraText=o(h,v,s[0].t.labels),a.hovertemplate=h.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,h=s.split("+"),c=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,p=h.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return c||m&&p?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(n.lon+_(T[0])):p&&l.push(n.lat+_(T[1])),(c||h.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}V.exports={hoverPoints:r,getExtraText:o}}}),CI=We({"src/traces/scattermap/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),LI=We({"src/traces/scattermap/select.js"(Z,V){"use strict";var d=aa(),x=au(),A=bs().BADNUM;V.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var K=H,fe=0;fe<8;fe++){var Me=this.sampleCurveX(K)-H;if(Math.abs(Me)Me?Ge=K:st=K,K=.5*(st-Ge)+Ge;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var h=r(n);let c,m;function p(){return c==null&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),c}function T(){if(m==null&&(m=!1,p())){let D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let fe=0;fe<25;fe++){let Me=4*fe;D.fillStyle=`rgb(${Me},${Me+1},${Me+2})`,D.fillRect(fe%5,Math.floor(fe/5),1,1)}let K=D.getImageData(0,0,5,5).data;for(let fe=0;fe<100;fe++)if(fe%4!=3&&K[fe]!==fe){m=!0;break}}}return m||!1}function l(H,D,K,fe){let Me=new h(H,D,K,fe);return Ue=>Me.solve(Ue)}let _=l(.25,.1,.25,1);function w(H,D,K){return Math.min(K,Math.max(D,H))}function S(H,D,K){let fe=K-D,Me=((H-D)%fe+fe)%fe+D;return Me===D?K:Me}function M(H,...D){for(let K of D)for(let fe in K)H[fe]=K[fe];return H}let y=1;function b(H,D,K){let fe={};for(let Me in H)fe[Me]=D.call(this,H[Me],Me,H);return fe}function v(H,D,K){let fe={};for(let Me in H)D.call(this,H[Me],Me,H)&&(fe[Me]=H[Me]);return fe}function u(H){return Array.isArray(H)?H.map(u):typeof H=="object"&&H?b(H,u):H}let g={};function f(H){g[H]||(typeof console<"u"&&console.warn(H),g[H]=!0)}function P(H,D,K){return(K.y-H.y)*(D.x-H.x)>(D.y-H.y)*(K.x-H.x)}function L(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let z=null;function F(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}let B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(H,D,K,fe,Me){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Ue=new VideoFrame(H,{timestamp:0});try{let Ge=Ue?.format;if(!Ge||!Ge.startsWith("BGR")&&!Ge.startsWith("RGB"))throw new Error(`Unrecognized format ${Ge}`);let st=Ge.startsWith("BGR"),Tt=new Uint8ClampedArray(fe*Me*4);if(yield Ue.copyTo(Tt,(function(Ft,tr,xr,Ir,Ur){let ea=4*Math.max(-tr,0),sa=(Math.max(0,xr)-xr)*Ir*4+ea,Da=4*Ir,qa=Math.max(0,tr),Fn=Math.max(0,xr);return{rect:{x:qa,y:Fn,width:Math.min(Ft.width,tr+Ir)-qa,height:Math.min(Ft.height,xr+Ur)-Fn},layout:[{offset:sa,stride:Da}]}})(H,D,K,fe,Me)),st)for(let Ft=0;FtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,$=function(H,D){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){let fe=le(H.url);if(fe)return fe(H,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:se},D)}if(!(/^file:/.test(K=H.url)||/^file:/.test(q())&&!/^\w+:/.test(K))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(fe,Me){return t(this,void 0,void 0,function*(){let Ue=new Request(fe.url,{method:fe.method||"GET",body:fe.body,credentials:fe.credentials,headers:fe.headers,cache:fe.cache,referrer:q(),signal:Me.signal});fe.type!=="json"||Ue.headers.has("Accept")||Ue.headers.set("Accept","application/json");let Ge=yield fetch(Ue);if(!Ge.ok){let Ft=yield Ge.blob();throw new he(Ge.status,Ge.statusText,fe.url,Ft)}let st;st=fe.type==="arrayBuffer"||fe.type==="image"?Ge.arrayBuffer():fe.type==="json"?Ge.json():Ge.text();let Tt=yield st;if(Me.signal.aborted)throw W();return{data:Tt,cacheControl:Ge.headers.get("Cache-Control"),expires:Ge.headers.get("Expires")}})})(H,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:se},D)}var K;return(function(fe,Me){return new Promise((Ue,Ge)=>{var st;let Tt=new XMLHttpRequest;Tt.open(fe.method||"GET",fe.url,!0),fe.type!=="arrayBuffer"&&fe.type!=="image"||(Tt.responseType="arraybuffer");for(let Ft in fe.headers)Tt.setRequestHeader(Ft,fe.headers[Ft]);fe.type==="json"&&(Tt.responseType="text",!((st=fe.headers)===null||st===void 0)&&st.Accept||Tt.setRequestHeader("Accept","application/json")),Tt.withCredentials=fe.credentials==="include",Tt.onerror=()=>{Ge(new Error(Tt.statusText))},Tt.onload=()=>{if(!Me.signal.aborted)if((Tt.status>=200&&Tt.status<300||Tt.status===0)&&Tt.response!==null){let Ft=Tt.response;if(fe.type==="json")try{Ft=JSON.parse(Tt.response)}catch(tr){return void Ge(tr)}Ue({data:Ft,cacheControl:Tt.getResponseHeader("Cache-Control"),expires:Tt.getResponseHeader("Expires")})}else{let Ft=new Blob([Tt.response],{type:Tt.getResponseHeader("Content-Type")});Ge(new he(Tt.status,Tt.statusText,fe.url,Ft))}},Me.signal.addEventListener("abort",()=>{Tt.abort(),Ge(W())}),Tt.send(fe.body)})})(H,D)};function J(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;let D=new URL(H),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(H,D,K){K[H]&&K[H].indexOf(D)!==-1||(K[H]=K[H]||[],K[H].push(D))}function oe(H,D,K){if(K&&K[H]){let fe=K[H].indexOf(D);fe!==-1&&K[H].splice(fe,1)}}class ne{constructor(D,K={}){M(this,K),this.type=D}}class j extends ne{constructor(D,K={}){super("error",M({error:D},K))}}class ee{on(D,K){return this._listeners=this._listeners||{},X(D,K,this._listeners),this}off(D,K){return oe(D,K,this._listeners),oe(D,K,this._oneTimeListeners),this}once(D,K){return K?(this._oneTimeListeners=this._oneTimeListeners||{},X(D,K,this._oneTimeListeners),this):new Promise(fe=>this.once(D,fe))}fire(D,K){typeof D=="string"&&(D=new ne(D,K||{}));let fe=D.type;if(this.listens(fe)){D.target=this;let Me=this._listeners&&this._listeners[fe]?this._listeners[fe].slice():[];for(let st of Me)st.call(this,D);let Ue=this._oneTimeListeners&&this._oneTimeListeners[fe]?this._oneTimeListeners[fe].slice():[];for(let st of Ue)oe(fe,st,this._oneTimeListeners),st.call(this,D);let Ge=this._eventedParent;Ge&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ge.fire(D))}else D instanceof j&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,K){return this._eventedParent=D,this._eventedParentData=K,this}}var re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let ue=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function _e(H,D){let K={};for(let fe in H)fe!=="ref"&&(K[fe]=H[fe]);return ue.forEach(fe=>{fe in D&&(K[fe]=D[fe])}),K}function Te(H,D){if(Array.isArray(H)){if(!Array.isArray(D)||H.length!==D.length)return!1;for(let K=0;K`:H.itemType.kind==="value"?"array":`array<${D}>`}return H.kind}let be=[nt,Ke,kt,Et,Bt,Or,jt,Oe(_r),mr,Er,yt];function Ce(H,D){if(D.kind==="error")return null;if(H.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!Ce(H.itemType,D.itemType))&&(typeof H.N!="number"||H.N===D.N))return null}else{if(H.kind===D.kind)return null;if(H.kind==="value"){for(let K of be)if(!Ce(K,D))return null}}return`Expected ${Xe(H)} but found ${Xe(D)} instead.`}function Ne(H,D){return D.some(K=>K.kind===H.kind)}function Ee(H,D){return D.some(K=>K==="null"?H===null:K==="array"?Array.isArray(H):K==="object"?H&&!Array.isArray(H)&&typeof H=="object":K===typeof H)}function Se(H,D){return H.kind==="array"&&D.kind==="array"?H.itemType.kind===D.itemType.kind&&typeof H.N=="number":H.kind===D.kind}let Le=.96422,at=.82521,dt=4/29,gt=6/29,Ct=3*gt*gt,or=gt*gt*gt,Qt=Math.PI/180,Jt=180/Math.PI;function Sr(H){return(H%=360)<0&&(H+=360),H}function oa([H,D,K,fe]){let Me,Ue,Ge=Sa((.2225045*(H=Ea(H))+.7168786*(D=Ea(D))+.0606169*(K=Ea(K)))/1);H===D&&D===K?Me=Ue=Ge:(Me=Sa((.4360747*H+.3850649*D+.1430804*K)/Le),Ue=Sa((.0139322*H+.0971045*D+.7141733*K)/at));let st=116*Ge-16;return[st<0?0:st,500*(Me-Ge),200*(Ge-Ue),fe]}function Ea(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function Sa(H){return H>or?Math.pow(H,1/3):H/Ct+dt}function za([H,D,K,fe]){let Me=(H+16)/116,Ue=isNaN(D)?Me:Me+D/500,Ge=isNaN(K)?Me:Me-K/200;return Me=1*Ta(Me),Ue=Le*Ta(Ue),Ge=at*Ta(Ge),[Na(3.1338561*Ue-1.6168667*Me-.4906146*Ge),Na(-.9787684*Ue+1.9161415*Me+.033454*Ge),Na(.0719453*Ue-.2289914*Me+1.4052427*Ge),fe]}function Na(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function Ta(H){return H>gt?H*H*H:Ct*(H-dt)}function nn(H){return parseInt(H.padEnd(2,H),16)/255}function gn(H,D){return Ht(D?H/100:H,0,1)}function Ht(H,D,K){return Math.min(Math.max(D,H),K)}function It(H){return!H.some(Number.isNaN)}let Gt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Xt{constructor(D,K,fe,Me=1,Ue=!0){this.r=D,this.g=K,this.b=fe,this.a=Me,Ue||(this.r*=Me,this.g*=Me,this.b*=Me,Me||this.overwriteGetter("rgb",[D,K,fe,Me]))}static parse(D){if(D instanceof Xt)return D;if(typeof D!="string")return;let K=(function(fe){if((fe=fe.toLowerCase().trim())==="transparent")return[0,0,0,0];let Me=Gt[fe];if(Me){let[Ge,st,Tt]=Me;return[Ge/255,st/255,Tt/255,1]}if(fe.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(fe)){let Ge=fe.length<6?1:2,st=1;return[nn(fe.slice(st,st+=Ge)),nn(fe.slice(st,st+=Ge)),nn(fe.slice(st,st+=Ge)),nn(fe.slice(st,st+Ge)||"ff")]}if(fe.startsWith("rgb")){let Ge=fe.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ge){let[st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa,Fn]=Ge,cn=[tr||" ",Ur||" ",Da].join("");if(cn===" "||cn===" /"||cn===",,"||cn===",,,"){let Rn=[Ft,Ir,sa].join(""),Hn=Rn==="%%%"?100:Rn===""?255:0;if(Hn){let ki=[Ht(+Tt/Hn,0,1),Ht(+xr/Hn,0,1),Ht(+ea/Hn,0,1),qa?gn(+qa,Fn):1];if(It(ki))return ki}}return}}let Ue=fe.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ue){let[Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea]=Ue,sa=[Tt||" ",tr||" ",Ir].join("");if(sa===" "||sa===" /"||sa===",,"||sa===",,,"){let Da=[+st,Ht(+Ft,0,100),Ht(+xr,0,100),Ur?gn(+Ur,ea):1];if(It(Da))return(function([qa,Fn,cn,Rn]){function Hn(ki){let po=(ki+qa/30)%12,$o=Fn*Math.min(cn,1-cn);return cn-$o*Math.max(-1,Math.min(po-3,9-po,1))}return qa=Sr(qa),Fn/=100,cn/=100,[Hn(0),Hn(8),Hn(4),Rn]})(Da)}}})(D);return K?new Xt(...K,!1):void 0}get rgb(){let{r:D,g:K,b:fe,a:Me}=this,Ue=Me||1/0;return this.overwriteGetter("rgb",[D/Ue,K/Ue,fe/Ue,Me])}get hcl(){return this.overwriteGetter("hcl",(function(D){let[K,fe,Me,Ue]=oa(D),Ge=Math.sqrt(fe*fe+Me*Me);return[Math.round(1e4*Ge)?Sr(Math.atan2(Me,fe)*Jt):NaN,Ge,K,Ue]})(this.rgb))}get lab(){return this.overwriteGetter("lab",oa(this.rgb))}overwriteGetter(D,K){return Object.defineProperty(this,D,{value:K}),K}toString(){let[D,K,fe,Me]=this.rgb;return`rgba(${[D,K,fe].map(Ue=>Math.round(255*Ue)).join(",")},${Me})`}}Xt.black=new Xt(0,0,0,1),Xt.white=new Xt(1,1,1,1),Xt.transparent=new Xt(0,0,0,0),Xt.red=new Xt(1,0,0,1);class Rr{constructor(D,K,fe){this.sensitivity=D?K?"variant":"case":K?"accent":"base",this.locale=fe,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,K){return this.collator.compare(D,K)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Yr{constructor(D,K,fe,Me,Ue){this.text=D,this.image=K,this.scale=fe,this.fontStack=Me,this.textColor=Ue}}class Jr{constructor(D){this.sections=D}static fromString(D){return new Jr([new Yr(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof Jr?D:Jr.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class ia{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof ia)return D;if(typeof D=="number")return new ia([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(let K of D)if(typeof K!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new ia(D)}}toString(){return JSON.stringify(this.values)}}let Pa=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ga{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ga)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let K=0;K=0&&H<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof K=="number"&&K>=0&&K<=255?fe===void 0||typeof fe=="number"&&fe>=0&&fe<=1?null:`Invalid rgba value [${[H,D,K,fe].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof fe=="number"?[H,D,K,fe]:[H,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sn(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof Xt||H instanceof Rr||H instanceof Jr||H instanceof ia||H instanceof Ga||H instanceof ja)return!0;if(Array.isArray(H)){for(let D of H)if(!sn(D))return!1;return!0}if(typeof H=="object"){for(let D in H)if(!sn(H[D]))return!1;return!0}return!1}function Ma(H){if(H===null)return nt;if(typeof H=="string")return kt;if(typeof H=="boolean")return Et;if(typeof H=="number")return Ke;if(H instanceof Xt)return Bt;if(H instanceof Rr)return pr;if(H instanceof Jr)return Or;if(H instanceof ia)return mr;if(H instanceof Ga)return yt;if(H instanceof ja)return Er;if(Array.isArray(H)){let D=H.length,K;for(let fe of H){let Me=Ma(fe);if(K){if(K===Me)continue;K=_r;break}K=Me}return Oe(K||_r,D)}return jt}function Xn(H){let D=typeof H;return H===null?"":D==="string"||D==="number"||D==="boolean"?String(H):H instanceof Xt||H instanceof Jr||H instanceof ia||H instanceof Ga||H instanceof ja?H.toString():JSON.stringify(H)}class Kn{constructor(D,K){this.type=D,this.value=K}static parse(D,K){if(D.length!==2)return K.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!sn(D[1]))return K.error("invalid value");let fe=D[1],Me=Ma(fe),Ue=K.expectedType;return Me.kind!=="array"||Me.N!==0||!Ue||Ue.kind!=="array"||typeof Ue.N=="number"&&Ue.N!==0||(Me=Ue),new Kn(Me,fe)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class St{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}let lt={string:kt,number:Ke,boolean:Et,object:jt};class br{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let fe,Me=1,Ue=D[0];if(Ue==="array"){let st,Tt;if(D.length>2){let Ft=D[1];if(typeof Ft!="string"||!(Ft in lt)||Ft==="object")return K.error('The item type argument of "array" must be one of string, number, boolean',1);st=lt[Ft],Me++}else st=_r;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return K.error('The length argument to "array" must be a positive integer literal',2);Tt=D[2],Me++}fe=Oe(st,Tt)}else{if(!lt[Ue])throw new Error(`Types doesn't contain name = ${Ue}`);fe=lt[Ue]}let Ge=[];for(;MeD.outputDefined())}}let kr={"to-boolean":Et,"to-color":Bt,"to-number":Ke,"to-string":kt};class Lr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let fe=D[0];if(!kr[fe])throw new Error(`Can't parse ${fe} as it is not part of the known types`);if((fe==="to-boolean"||fe==="to-string")&&D.length!==2)return K.error("Expected one argument.");let Me=kr[fe],Ue=[];for(let Ge=1;Ge4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:Xa(K[0],K[1],K[2],K[3]),!fe))return new Xt(K[0]/255,K[1]/255,K[2]/255,K[3])}throw new St(fe||`Could not parse color from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"padding":{let K;for(let fe of this.args){K=fe.evaluate(D);let Me=ia.parse(K);if(Me)return Me}throw new St(`Could not parse padding from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"variableAnchorOffsetCollection":{let K;for(let fe of this.args){K=fe.evaluate(D);let Me=Ga.parse(K);if(Me)return Me}throw new St(`Could not parse variableAnchorOffsetCollection from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"number":{let K=null;for(let fe of this.args){if(K=fe.evaluate(D),K===null)return 0;let Me=Number(K);if(!isNaN(Me))return Me}throw new St(`Could not convert ${JSON.stringify(K)} to number.`)}case"formatted":return Jr.fromString(Xn(this.args[0].evaluate(D)));case"resolvedImage":return ja.fromString(Xn(this.args[0].evaluate(D)));default:return Xn(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}let Tr=["Unknown","Point","LineString","Polygon"];class Cr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Tr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let K=this._parseColorCache[D];return K||(K=this._parseColorCache[D]=Xt.parse(D)),K}}class Kr{constructor(D,K,fe=[],Me,Ue=new Qe,Ge=[]){this.registry=D,this.path=fe,this.key=fe.map(st=>`[${st}]`).join(""),this.scope=Ue,this.errors=Ge,this.expectedType=Me,this._isConstant=K}parse(D,K,fe,Me,Ue={}){return K?this.concat(K,fe,Me)._parse(D,Ue):this._parse(D,Ue)}_parse(D,K){function fe(Me,Ue,Ge){return Ge==="assert"?new br(Ue,[Me]):Ge==="coerce"?new Lr(Ue,[Me]):Me}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Me=D[0];if(typeof Me!="string")return this.error(`Expression name must be a string, but found ${typeof Me} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Ue=this.registry[Me];if(Ue){let Ge=Ue.parse(D,this);if(!Ge)return null;if(this.expectedType){let st=this.expectedType,Tt=Ge.type;if(st.kind!=="string"&&st.kind!=="number"&&st.kind!=="boolean"&&st.kind!=="object"&&st.kind!=="array"||Tt.kind!=="value")if(st.kind!=="color"&&st.kind!=="formatted"&&st.kind!=="resolvedImage"||Tt.kind!=="value"&&Tt.kind!=="string")if(st.kind!=="padding"||Tt.kind!=="value"&&Tt.kind!=="number"&&Tt.kind!=="array")if(st.kind!=="variableAnchorOffsetCollection"||Tt.kind!=="value"&&Tt.kind!=="array"){if(this.checkSubtype(st,Tt))return null}else Ge=fe(Ge,st,K.typeAnnotation||"coerce");else Ge=fe(Ge,st,K.typeAnnotation||"coerce");else Ge=fe(Ge,st,K.typeAnnotation||"coerce");else Ge=fe(Ge,st,K.typeAnnotation||"assert")}if(!(Ge instanceof Kn)&&Ge.type.kind!=="resolvedImage"&&this._isConstant(Ge)){let st=new Cr;try{Ge=new Kn(Ge.type,Ge.evaluate(st))}catch(Tt){return this.error(Tt.message),null}}return Ge}return this.error(`Unknown expression "${Me}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,K,fe){let Me=typeof D=="number"?this.path.concat(D):this.path,Ue=fe?this.scope.concat(fe):this.scope;return new Kr(this.registry,this._isConstant,Me,K||null,Ue,this.errors)}error(D,...K){let fe=`${this.key}${K.map(Me=>`[${Me}]`).join("")}`;this.errors.push(new ze(fe,D))}checkSubtype(D,K){let fe=Ce(D,K);return fe&&this.error(fe),fe}}class Nr{constructor(D,K){this.type=K.type,this.bindings=[].concat(D),this.result=K}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(let K of this.bindings)D(K[1]);D(this.result)}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);let fe=[];for(let Ue=1;Ue=fe.length)throw new St(`Array index out of bounds: ${K} > ${fe.length-1}.`);if(K!==Math.floor(K))throw new St(`Array index must be an integer, but found ${K} instead.`);return fe[K]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class Ar{constructor(D,K){this.type=Et,this.needle=D,this.haystack=K}static parse(D,K){if(D.length!==3)return K.error(`Expected 2 arguments, but found ${D.length-1} instead.`);let fe=K.parse(D[1],1,_r),Me=K.parse(D[2],2,_r);return fe&&Me?Ne(fe.type,[Et,kt,Ke,nt,_r])?new Ar(fe,Me):K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xe(fe.type)} instead`):null}evaluate(D){let K=this.needle.evaluate(D),fe=this.haystack.evaluate(D);if(!fe)return!1;if(!Ee(K,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${Xe(Ma(K))} instead.`);if(!Ee(fe,["string","array"]))throw new St(`Expected second argument to be of type array or string, but found ${Xe(Ma(fe))} instead.`);return fe.indexOf(K)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class Vr{constructor(D,K,fe){this.type=Ke,this.needle=D,this.haystack=K,this.fromIndex=fe}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let fe=K.parse(D[1],1,_r),Me=K.parse(D[2],2,_r);if(!fe||!Me)return null;if(!Ne(fe.type,[Et,kt,Ke,nt,_r]))return K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xe(fe.type)} instead`);if(D.length===4){let Ue=K.parse(D[3],3,Ke);return Ue?new Vr(fe,Me,Ue):null}return new Vr(fe,Me)}evaluate(D){let K=this.needle.evaluate(D),fe=this.haystack.evaluate(D);if(!Ee(K,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${Xe(Ma(K))} instead.`);let Me;if(this.fromIndex&&(Me=this.fromIndex.evaluate(D)),Ee(fe,["string"])){let Ue=fe.indexOf(K,Me);return Ue===-1?-1:[...fe.slice(0,Ue)].length}if(Ee(fe,["array"]))return fe.indexOf(K,Me);throw new St(`Expected second argument to be of type array or string, but found ${Xe(Ma(fe))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class ma{constructor(D,K,fe,Me,Ue,Ge){this.inputType=D,this.type=K,this.input=fe,this.cases=Me,this.outputs=Ue,this.otherwise=Ge}static parse(D,K){if(D.length<5)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return K.error("Expected an even number of arguments.");let fe,Me;K.expectedType&&K.expectedType.kind!=="value"&&(Me=K.expectedType);let Ue={},Ge=[];for(let Ft=2;FtNumber.MAX_SAFE_INTEGER)return Ir.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ea=="number"&&Math.floor(ea)!==ea)return Ir.error("Numeric branch labels must be integer values.");if(fe){if(Ir.checkSubtype(fe,Ma(ea)))return null}else fe=Ma(ea);if(Ue[String(ea)]!==void 0)return Ir.error("Branch labels must be unique.");Ue[String(ea)]=Ge.length}let Ur=K.parse(xr,Ft,Me);if(!Ur)return null;Me=Me||Ur.type,Ge.push(Ur)}let st=K.parse(D[1],1,_r);if(!st)return null;let Tt=K.parse(D[D.length-1],D.length-1,Me);return Tt?st.type.kind!=="value"&&K.concat(1).checkSubtype(fe,st.type)?null:new ma(fe,Me,st,Ue,Ge,Tt):null}evaluate(D){let K=this.input.evaluate(D);return(Ma(K)===this.inputType&&this.outputs[this.cases[K]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class ba{constructor(D,K,fe){this.type=D,this.branches=K,this.otherwise=fe}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return K.error("Expected an odd number of arguments.");let fe;K.expectedType&&K.expectedType.kind!=="value"&&(fe=K.expectedType);let Me=[];for(let Ge=1;GeK.outputDefined())&&this.otherwise.outputDefined()}}class wa{constructor(D,K,fe,Me){this.type=D,this.input=K,this.beginIndex=fe,this.endIndex=Me}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let fe=K.parse(D[1],1,_r),Me=K.parse(D[2],2,Ke);if(!fe||!Me)return null;if(!Ne(fe.type,[Oe(_r),kt,_r]))return K.error(`Expected first argument to be of type array or string, but found ${Xe(fe.type)} instead`);if(D.length===4){let Ue=K.parse(D[3],3,Ke);return Ue?new wa(fe.type,fe,Me,Ue):null}return new wa(fe.type,fe,Me)}evaluate(D){let K=this.input.evaluate(D),fe=this.beginIndex.evaluate(D),Me;if(this.endIndex&&(Me=this.endIndex.evaluate(D)),Ee(K,["string"]))return[...K].slice(fe,Me).join("");if(Ee(K,["array"]))return K.slice(fe,Me);throw new St(`Expected first argument to be of type array or string, but found ${Xe(Ma(K))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function $r(H,D){let K=H.length-1,fe,Me,Ue=0,Ge=K,st=0;for(;Ue<=Ge;)if(st=Math.floor((Ue+Ge)/2),fe=H[st],Me=H[st+1],fe<=D){if(st===K||DD))throw new St("Input is not a number.");Ge=st-1}return 0}class ga{constructor(D,K,fe){this.type=D,this.input=K,this.labels=[],this.outputs=[];for(let[Me,Ue]of fe)this.labels.push(Me),this.outputs.push(Ue)}static parse(D,K){if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");let fe=K.parse(D[1],1,Ke);if(!fe)return null;let Me=[],Ue=null;K.expectedType&&K.expectedType.kind!=="value"&&(Ue=K.expectedType);for(let Ge=1;Ge=st)return K.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ft);let xr=K.parse(Tt,tr,Ue);if(!xr)return null;Ue=Ue||xr.type,Me.push([st,xr])}return new ga(Ue,fe,Me)}evaluate(D){let K=this.labels,fe=this.outputs;if(K.length===1)return fe[0].evaluate(D);let Me=this.input.evaluate(D);if(Me<=K[0])return fe[0].evaluate(D);let Ue=K.length;return Me>=K[Ue-1]?fe[Ue-1].evaluate(D):fe[$r(K,Me)].evaluate(D)}eachChild(D){D(this.input);for(let K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function jn(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var an=ei;function ei(H,D,K,fe){this.cx=3*H,this.bx=3*(K-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(fe-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=D,this.p2x=K,this.p2y=fe}ei.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,D){if(D===void 0&&(D=1e-6),H<0)return 0;if(H>1)return 1;for(var K=H,fe=0;fe<8;fe++){var Me=this.sampleCurveX(K)-H;if(Math.abs(Me)Me?Ge=K:st=K,K=.5*(st-Ge)+Ge;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var li=jn(an);function _i(H,D,K){return H+K*(D-H)}function xi(H,D,K){return H.map((fe,Me)=>_i(fe,D[Me],K))}let Pi={number:_i,color:function(H,D,K,fe="rgb"){switch(fe){case"rgb":{let[Me,Ue,Ge,st]=xi(H.rgb,D.rgb,K);return new Xt(Me,Ue,Ge,st,!1)}case"hcl":{let[Me,Ue,Ge,st]=H.hcl,[Tt,Ft,tr,xr]=D.hcl,Ir,Ur;if(isNaN(Me)||isNaN(Tt))isNaN(Me)?isNaN(Tt)?Ir=NaN:(Ir=Tt,Ge!==1&&Ge!==0||(Ur=Ft)):(Ir=Me,tr!==1&&tr!==0||(Ur=Ue));else{let Fn=Tt-Me;Tt>Me&&Fn>180?Fn-=360:Tt180&&(Fn+=360),Ir=Me+K*Fn}let[ea,sa,Da,qa]=(function([Fn,cn,Rn,Hn]){return Fn=isNaN(Fn)?0:Fn*Qt,za([Rn,Math.cos(Fn)*cn,Math.sin(Fn)*cn,Hn])})([Ir,Ur??_i(Ue,Ft,K),_i(Ge,tr,K),_i(st,xr,K)]);return new Xt(ea,sa,Da,qa,!1)}case"lab":{let[Me,Ue,Ge,st]=za(xi(H.lab,D.lab,K));return new Xt(Me,Ue,Ge,st,!1)}}},array:xi,padding:function(H,D,K){return new ia(xi(H.values,D.values,K))},variableAnchorOffsetCollection:function(H,D,K){let fe=H.values,Me=D.values;if(fe.length!==Me.length)throw new St(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${D.toString()}`);let Ue=[];for(let Ge=0;Getypeof tr!="number"||tr<0||tr>1))return K.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Me={name:"cubic-bezier",controlPoints:Ft}}}if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");if(Ue=K.parse(Ue,2,Ke),!Ue)return null;let st=[],Tt=null;fe==="interpolate-hcl"||fe==="interpolate-lab"?Tt=Bt:K.expectedType&&K.expectedType.kind!=="value"&&(Tt=K.expectedType);for(let Ft=0;Ft=tr)return K.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Ir);let ea=K.parse(xr,Ur,Tt);if(!ea)return null;Tt=Tt||ea.type,st.push([tr,ea])}return Se(Tt,Ke)||Se(Tt,Bt)||Se(Tt,mr)||Se(Tt,yt)||Se(Tt,Oe(Ke))?new Li(Tt,fe,Me,Ue,st):K.error(`Type ${Xe(Tt)} is not interpolatable.`)}evaluate(D){let K=this.labels,fe=this.outputs;if(K.length===1)return fe[0].evaluate(D);let Me=this.input.evaluate(D);if(Me<=K[0])return fe[0].evaluate(D);let Ue=K.length;if(Me>=K[Ue-1])return fe[Ue-1].evaluate(D);let Ge=$r(K,Me),st=Li.interpolationFactor(this.interpolation,Me,K[Ge],K[Ge+1]),Tt=fe[Ge].evaluate(D),Ft=fe[Ge+1].evaluate(D);switch(this.operator){case"interpolate":return Pi[this.type.kind](Tt,Ft,st);case"interpolate-hcl":return Pi.color(Tt,Ft,st,"hcl");case"interpolate-lab":return Pi.color(Tt,Ft,st,"lab")}}eachChild(D){D(this.input);for(let K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ri(H,D,K,fe){let Me=fe-K,Ue=H-K;return Me===0?0:D===1?Ue/Me:(Math.pow(D,Ue)-1)/(Math.pow(D,Me)-1)}class vo{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expectected at least one argument.");let fe=null,Me=K.expectedType;Me&&Me.kind!=="value"&&(fe=Me);let Ue=[];for(let st of D.slice(1)){let Tt=K.parse(st,1+Ue.length,fe,void 0,{typeAnnotation:"omit"});if(!Tt)return null;fe=fe||Tt.type,Ue.push(Tt)}if(!fe)throw new Error("No output type");let Ge=Me&&Ue.some(st=>Ce(Me,st.type));return new vo(Ge?_r:fe,Ue)}evaluate(D){let K,fe=null,Me=0;for(let Ue of this.args)if(Me++,fe=Ue.evaluate(D),fe&&fe instanceof ja&&!fe.available&&(K||(K=fe.name),fe=null,Me===this.args.length&&(fe=K)),fe!==null)break;return fe}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function Eo(H,D){return H==="=="||H==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function uo(H,D,K,fe){return fe.compare(D,K)===0}function ao(H,D,K){let fe=H!=="=="&&H!=="!=";return class H5{constructor(Ue,Ge,st){this.type=Et,this.lhs=Ue,this.rhs=Ge,this.collator=st,this.hasUntypedArgument=Ue.type.kind==="value"||Ge.type.kind==="value"}static parse(Ue,Ge){if(Ue.length!==3&&Ue.length!==4)return Ge.error("Expected two or three arguments.");let st=Ue[0],Tt=Ge.parse(Ue[1],1,_r);if(!Tt)return null;if(!Eo(st,Tt.type))return Ge.concat(1).error(`"${st}" comparisons are not supported for type '${Xe(Tt.type)}'.`);let Ft=Ge.parse(Ue[2],2,_r);if(!Ft)return null;if(!Eo(st,Ft.type))return Ge.concat(2).error(`"${st}" comparisons are not supported for type '${Xe(Ft.type)}'.`);if(Tt.type.kind!==Ft.type.kind&&Tt.type.kind!=="value"&&Ft.type.kind!=="value")return Ge.error(`Cannot compare types '${Xe(Tt.type)}' and '${Xe(Ft.type)}'.`);fe&&(Tt.type.kind==="value"&&Ft.type.kind!=="value"?Tt=new br(Ft.type,[Tt]):Tt.type.kind!=="value"&&Ft.type.kind==="value"&&(Ft=new br(Tt.type,[Ft])));let tr=null;if(Ue.length===4){if(Tt.type.kind!=="string"&&Ft.type.kind!=="string"&&Tt.type.kind!=="value"&&Ft.type.kind!=="value")return Ge.error("Cannot use collator to compare non-string types.");if(tr=Ge.parse(Ue[3],3,pr),!tr)return null}return new H5(Tt,Ft,tr)}evaluate(Ue){let Ge=this.lhs.evaluate(Ue),st=this.rhs.evaluate(Ue);if(fe&&this.hasUntypedArgument){let Tt=Ma(Ge),Ft=Ma(st);if(Tt.kind!==Ft.kind||Tt.kind!=="string"&&Tt.kind!=="number")throw new St(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${Tt.kind}, ${Ft.kind}) instead.`)}if(this.collator&&!fe&&this.hasUntypedArgument){let Tt=Ma(Ge),Ft=Ma(st);if(Tt.kind!=="string"||Ft.kind!=="string")return D(Ue,Ge,st)}return this.collator?K(Ue,Ge,st,this.collator.evaluate(Ue)):D(Ue,Ge,st)}eachChild(Ue){Ue(this.lhs),Ue(this.rhs),this.collator&&Ue(this.collator)}outputDefined(){return!0}}}let mo=ao("==",function(H,D,K){return D===K},uo),Bo=ao("!=",function(H,D,K){return D!==K},function(H,D,K,fe){return!uo(0,D,K,fe)}),Go=ao("<",function(H,D,K){return D",function(H,D,K){return D>K},function(H,D,K,fe){return fe.compare(D,K)>0}),Qi=ao("<=",function(H,D,K){return D<=K},function(H,D,K,fe){return fe.compare(D,K)<=0}),eo=ao(">=",function(H,D,K){return D>=K},function(H,D,K,fe){return fe.compare(D,K)>=0});class Ei{constructor(D,K,fe){this.type=pr,this.locale=fe,this.caseSensitive=D,this.diacriticSensitive=K}static parse(D,K){if(D.length!==2)return K.error("Expected one argument.");let fe=D[1];if(typeof fe!="object"||Array.isArray(fe))return K.error("Collator options argument must be an object.");let Me=K.parse(fe["case-sensitive"]!==void 0&&fe["case-sensitive"],1,Et);if(!Me)return null;let Ue=K.parse(fe["diacritic-sensitive"]!==void 0&&fe["diacritic-sensitive"],1,Et);if(!Ue)return null;let Ge=null;return fe.locale&&(Ge=K.parse(fe.locale,1,kt),!Ge)?null:new Ei(Me,Ue,Ge)}evaluate(D){return new Rr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class Xi{constructor(D,K,fe,Me,Ue){this.type=kt,this.number=D,this.locale=K,this.currency=fe,this.minFractionDigits=Me,this.maxFractionDigits=Ue}static parse(D,K){if(D.length!==3)return K.error("Expected two arguments.");let fe=K.parse(D[1],1,Ke);if(!fe)return null;let Me=D[2];if(typeof Me!="object"||Array.isArray(Me))return K.error("NumberFormat options argument must be an object.");let Ue=null;if(Me.locale&&(Ue=K.parse(Me.locale,1,kt),!Ue))return null;let Ge=null;if(Me.currency&&(Ge=K.parse(Me.currency,1,kt),!Ge))return null;let st=null;if(Me["min-fraction-digits"]&&(st=K.parse(Me["min-fraction-digits"],1,Ke),!st))return null;let Tt=null;return Me["max-fraction-digits"]&&(Tt=K.parse(Me["max-fraction-digits"],1,Ke),!Tt)?null:new Xi(fe,Ue,Ge,st,Tt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class Jo{constructor(D){this.type=Or,this.sections=D}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let fe=D[1];if(!Array.isArray(fe)&&typeof fe=="object")return K.error("First argument must be an image or text section.");let Me=[],Ue=!1;for(let Ge=1;Ge<=D.length-1;++Ge){let st=D[Ge];if(Ue&&typeof st=="object"&&!Array.isArray(st)){Ue=!1;let Tt=null;if(st["font-scale"]&&(Tt=K.parse(st["font-scale"],1,Ke),!Tt))return null;let Ft=null;if(st["text-font"]&&(Ft=K.parse(st["text-font"],1,Oe(kt)),!Ft))return null;let tr=null;if(st["text-color"]&&(tr=K.parse(st["text-color"],1,Bt),!tr))return null;let xr=Me[Me.length-1];xr.scale=Tt,xr.font=Ft,xr.textColor=tr}else{let Tt=K.parse(D[Ge],1,_r);if(!Tt)return null;let Ft=Tt.type.kind;if(Ft!=="string"&&Ft!=="value"&&Ft!=="null"&&Ft!=="resolvedImage")return K.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ue=!0,Me.push({content:Tt,scale:null,font:null,textColor:null})}}return new Jo(Me)}evaluate(D){return new Jr(this.sections.map(K=>{let fe=K.content.evaluate(D);return Ma(fe)===Er?new Yr("",fe,null,null,null):new Yr(Xn(fe),null,K.scale?K.scale.evaluate(D):null,K.font?K.font.evaluate(D).join(","):null,K.textColor?K.textColor.evaluate(D):null)}))}eachChild(D){for(let K of this.sections)D(K.content),K.scale&&D(K.scale),K.font&&D(K.font),K.textColor&&D(K.textColor)}outputDefined(){return!1}}class ms{constructor(D){this.type=Er,this.input=D}static parse(D,K){if(D.length!==2)return K.error("Expected two arguments.");let fe=K.parse(D[1],1,kt);return fe?new ms(fe):K.error("No image name provided.")}evaluate(D){let K=this.input.evaluate(D),fe=ja.fromString(K);return fe&&D.availableImages&&(fe.available=D.availableImages.indexOf(K)>-1),fe}eachChild(D){D(this.input)}outputDefined(){return!1}}class _s{constructor(D){this.type=Ke,this.input=D}static parse(D,K){if(D.length!==2)return K.error(`Expected 1 argument, but found ${D.length-1} instead.`);let fe=K.parse(D[1],1);return fe?fe.type.kind!=="array"&&fe.type.kind!=="string"&&fe.type.kind!=="value"?K.error(`Expected argument of type string or array, but found ${Xe(fe.type)} instead.`):new _s(fe):null}evaluate(D){let K=this.input.evaluate(D);if(typeof K=="string")return[...K].length;if(Array.isArray(K))return K.length;throw new St(`Expected value to be of type string or array, but found ${Xe(Ma(K))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}let ko=8192;function Nn(H,D){let K=(180+H[0])/360,fe=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Me=Math.pow(2,D.z);return[Math.round(K*Me*ko),Math.round(fe*Me*ko)]}function pi(H,D){let K=Math.pow(2,D.z);return[(Me=(H[0]/ko+D.x)/K,360*Me-180),(fe=(H[1]/ko+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*fe)*Math.PI/180))-90)];var fe,Me}function gs(H,D){H[0]=Math.min(H[0],D[0]),H[1]=Math.min(H[1],D[1]),H[2]=Math.max(H[2],D[0]),H[3]=Math.max(H[3],D[1])}function Io(H,D){return!(H[0]<=D[0]||H[2]>=D[2]||H[1]<=D[1]||H[3]>=D[3])}function Zi(H,D,K){let fe=H[0]-D[0],Me=H[1]-D[1],Ue=H[0]-K[0],Ge=H[1]-K[1];return fe*Ge-Ue*Me==0&&fe*Ue<=0&&Me*Ge<=0}function ys(H,D,K,fe){return(Me=[fe[0]-K[0],fe[1]-K[1]])[0]*(Ue=[D[0]-H[0],D[1]-H[1]])[1]-Me[1]*Ue[0]!=0&&!(!so(H,D,K,fe)||!so(K,fe,H,D));var Me,Ue}function rs(H,D,K){for(let fe of K)for(let Me=0;Me(Me=H)[1]!=(Ge=st[Tt+1])[1]>Me[1]&&Me[0]<(Ge[0]-Ue[0])*(Me[1]-Ue[1])/(Ge[1]-Ue[1])+Ue[0]&&(fe=!fe)}var Me,Ue,Ge;return fe}function el(H,D){for(let K of D)if(fs(H,K))return!0;return!1}function ci(H,D){for(let K of H)if(!fs(K,D))return!1;for(let K=0;K0&&st<0||Ge<0&&st>0}function js(H,D,K){let fe=[];for(let Me=0;MeK[2]){let Me=.5*fe,Ue=H[0]-K[0]>Me?-fe:K[0]-H[0]>Me?fe:0;Ue===0&&(Ue=H[0]-K[2]>Me?-fe:K[2]-H[0]>Me?fe:0),H[0]+=Ue}gs(D,H)}function Ns(H,D,K,fe){let Me=Math.pow(2,fe.z)*ko,Ue=[fe.x*ko,fe.y*ko],Ge=[];for(let st of H)for(let Tt of st){let Ft=[Tt.x+Ue[0],Tt.y+Ue[1]];Ni(Ft,D,K,Me),Ge.push(Ft)}return Ge}function Ks(H,D,K,fe){let Me=Math.pow(2,fe.z)*ko,Ue=[fe.x*ko,fe.y*ko],Ge=[];for(let Tt of H){let Ft=[];for(let tr of Tt){let xr=[tr.x+Ue[0],tr.y+Ue[1]];gs(D,xr),Ft.push(xr)}Ge.push(Ft)}if(D[2]-D[0]<=Me/2){(st=D)[0]=st[1]=1/0,st[2]=st[3]=-1/0;for(let Tt of Ge)for(let Ft of Tt)Ni(Ft,D,K,Me)}var st;return Ge}class jo{constructor(D,K){this.type=Et,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(sn(D[1])){let fe=D[1];if(fe.type==="FeatureCollection"){let Me=[];for(let Ue of fe.features){let{type:Ge,coordinates:st}=Ue.geometry;Ge==="Polygon"&&Me.push(st),Ge==="MultiPolygon"&&Me.push(...st)}if(Me.length)return new jo(fe,{type:"MultiPolygon",coordinates:Me})}else if(fe.type==="Feature"){let Me=fe.geometry.type;if(Me==="Polygon"||Me==="MultiPolygon")return new jo(fe,fe.geometry)}else if(fe.type==="Polygon"||fe.type==="MultiPolygon")return new jo(fe,fe)}return K.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(K,fe){let Me=[1/0,1/0,-1/0,-1/0],Ue=[1/0,1/0,-1/0,-1/0],Ge=K.canonicalID();if(fe.type==="Polygon"){let st=js(fe.coordinates,Ue,Ge),Tt=Ns(K.geometry(),Me,Ue,Ge);if(!Io(Me,Ue))return!1;for(let Ft of Tt)if(!fs(Ft,st))return!1}if(fe.type==="MultiPolygon"){let st=Es(fe.coordinates,Ue,Ge),Tt=Ns(K.geometry(),Me,Ue,Ge);if(!Io(Me,Ue))return!1;for(let Ft of Tt)if(!el(Ft,st))return!1}return!0})(D,this.geometries);if(D.geometryType()==="LineString")return(function(K,fe){let Me=[1/0,1/0,-1/0,-1/0],Ue=[1/0,1/0,-1/0,-1/0],Ge=K.canonicalID();if(fe.type==="Polygon"){let st=js(fe.coordinates,Ue,Ge),Tt=Ks(K.geometry(),Me,Ue,Ge);if(!Io(Me,Ue))return!1;for(let Ft of Tt)if(!ci(Ft,st))return!1}if(fe.type==="MultiPolygon"){let st=Es(fe.coordinates,Ue,Ge),Tt=Ks(K.geometry(),Me,Ue,Ge);if(!Io(Me,Ue))return!1;for(let Ft of Tt)if(!oo(Ft,st))return!1}return!0})(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let hs=class{constructor(H=[],D=(K,fe)=>Kfe?1:0){if(this.data=H,this.length=this.data.length,this.compare=D,this.length>0)for(let K=(this.length>>1)-1;K>=0;K--)this._down(K)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;let H=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),H}peek(){return this.data[0]}_up(H){let{data:D,compare:K}=this,fe=D[H];for(;H>0;){let Me=H-1>>1,Ue=D[Me];if(K(fe,Ue)>=0)break;D[H]=Ue,H=Me}D[H]=fe}_down(H){let{data:D,compare:K}=this,fe=this.length>>1,Me=D[H];for(;H=0)break;D[H]=D[Ue],H=Ue}D[H]=Me}};function ks(H,D,K,fe,Me){xs(H,D,K,fe||H.length-1,Me||ql)}function xs(H,D,K,fe,Me){for(;fe>K;){if(fe-K>600){var Ue=fe-K+1,Ge=D-K+1,st=Math.log(Ue),Tt=.5*Math.exp(2*st/3),Ft=.5*Math.sqrt(st*Tt*(Ue-Tt)/Ue)*(Ge-Ue/2<0?-1:1);xs(H,D,Math.max(K,Math.floor(D-Ge*Tt/Ue+Ft)),Math.min(fe,Math.floor(D+(Ue-Ge)*Tt/Ue+Ft)),Me)}var tr=H[D],xr=K,Ir=fe;for(ll(H,K,D),Me(H[fe],tr)>0&&ll(H,K,fe);xr0;)Ir--}Me(H[K],tr)===0?ll(H,K,Ir):ll(H,++Ir,fe),Ir<=D&&(K=Ir+1),D<=Ir&&(fe=Ir-1)}}function ll(H,D,K){var fe=H[D];H[D]=H[K],H[K]=fe}function ql(H,D){return HD?1:0}function wu(H,D){if(H.length<=1)return[H];let K=[],fe,Me;for(let Ue of H){let Ge=kc(Ue);Ge!==0&&(Ue.area=Math.abs(Ge),Me===void 0&&(Me=Ge<0),Me===Ge<0?(fe&&K.push(fe),fe=[Ue]):fe.push(Ue))}if(fe&&K.push(fe),D>1)for(let Ue=0;Ue1?(Ft=D[Tt+1][0],tr=D[Tt+1][1]):Ur>0&&(Ft+=xr/this.kx*Ur,tr+=Ir/this.ky*Ur)),xr=this.wrap(K[0]-Ft)*this.kx,Ir=(K[1]-tr)*this.ky;let ea=xr*xr+Ir*Ir;ea180;)D-=360;return D}}function Ll(H,D){return D[0]-H[0]}function nl(H){return H[1]-H[0]+1}function Tu(H,D){return H[1]>=H[0]&&H[1]H[1])return[null,null];let K=nl(H);if(D){if(K===2)return[H,null];let Me=Math.floor(K/2);return[[H[0],H[0]+Me],[H[0]+Me,H[1]]]}if(K===1)return[H,null];let fe=Math.floor(K/2)-1;return[[H[0],H[0]+fe],[H[0]+fe+1,H[1]]]}function Rs(H,D){if(!Tu(D,H.length))return[1/0,1/0,-1/0,-1/0];let K=[1/0,1/0,-1/0,-1/0];for(let fe=D[0];fe<=D[1];++fe)gs(K,H[fe]);return K}function Gs(H){let D=[1/0,1/0,-1/0,-1/0];for(let K of H)for(let fe of K)gs(D,fe);return D}function Qo(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function ws(H,D,K){if(!Qo(H)||!Qo(D))return NaN;let fe=0,Me=0;return H[2]D[2]&&(fe=H[0]-D[2]),H[1]>D[3]&&(Me=H[1]-D[3]),H[3]=fe)return fe;if(Io(Me,Ue)){if(xf(H,D))return 0}else if(xf(D,H))return 0;let Ge=1/0;for(let st of H)for(let Tt=0,Ft=st.length,tr=Ft-1;Tt0;){let Tt=Ge.pop();if(Tt[0]>=Ue)continue;let Ft=Tt[1],tr=D?50:100;if(nl(Ft)<=tr){if(!Tu(Ft,H.length))return NaN;if(D){let xr=qo(H,Ft,K,fe);if(isNaN(xr)||xr===0)return xr;Ue=Math.min(Ue,xr)}else for(let xr=Ft[0];xr<=Ft[1];++xr){let Ir=_f(H[xr],K,fe);if(Ue=Math.min(Ue,Ir),Ue===0)return 0}}else{let xr=nu(Ft,D);Ui(Ge,Ue,fe,H,st,xr[0]),Ui(Ge,Ue,fe,H,st,xr[1])}}return Ue}function hl(H,D,K,fe,Me,Ue=1/0){let Ge=Math.min(Ue,Me.distance(H[0],K[0]));if(Ge===0)return Ge;let st=new hs([[0,[0,H.length-1],[0,K.length-1]]],Ll);for(;st.length>0;){let Tt=st.pop();if(Tt[0]>=Ge)continue;let Ft=Tt[1],tr=Tt[2],xr=D?50:100,Ir=fe?50:100;if(nl(Ft)<=xr&&nl(tr)<=Ir){if(!Tu(Ft,H.length)&&Tu(tr,K.length))return NaN;let Ur;if(D&&fe)Ur=lu(H,Ft,K,tr,Me),Ge=Math.min(Ge,Ur);else if(D&&!fe){let ea=H.slice(Ft[0],Ft[1]+1);for(let sa=tr[0];sa<=tr[1];++sa)if(Ur=Au(K[sa],ea,Me),Ge=Math.min(Ge,Ur),Ge===0)return Ge}else if(!D&&fe){let ea=K.slice(tr[0],tr[1]+1);for(let sa=Ft[0];sa<=Ft[1];++sa)if(Ur=Au(H[sa],ea,Me),Ge=Math.min(Ge,Ur),Ge===0)return Ge}else Ur=Us(H,Ft,K,tr,Me),Ge=Math.min(Ge,Ur)}else{let Ur=nu(Ft,D),ea=nu(tr,fe);ac(st,Ge,Me,H,K,Ur[0],ea[0]),ac(st,Ge,Me,H,K,Ur[0],ea[1]),ac(st,Ge,Me,H,K,Ur[1],ea[0]),ac(st,Ge,Me,H,K,Ur[1],ea[1])}}return Ge}function Lc(H){return H.type==="MultiPolygon"?H.coordinates.map(D=>({type:"Polygon",coordinates:D})):H.type==="MultiLineString"?H.coordinates.map(D=>({type:"LineString",coordinates:D})):H.type==="MultiPoint"?H.coordinates.map(D=>({type:"Point",coordinates:D})):[H]}class ju{constructor(D,K){this.type=Ke,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(sn(D[1])){let fe=D[1];if(fe.type==="FeatureCollection")return new ju(fe,fe.features.map(Me=>Lc(Me.geometry)).flat());if(fe.type==="Feature")return new ju(fe,Lc(fe.geometry));if("type"in fe&&"coordinates"in fe)return new ju(fe,Lc(fe))}return K.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(K,fe){let Me=K.geometry(),Ue=Me.flat().map(Tt=>pi([Tt.x,Tt.y],K.canonical));if(Me.length===0)return NaN;let Ge=new Cc(Ue[0][1]),st=1/0;for(let Tt of fe){switch(Tt.type){case"Point":st=Math.min(st,hl(Ue,!1,[Tt.coordinates],!1,Ge,st));break;case"LineString":st=Math.min(st,hl(Ue,!1,Tt.coordinates,!0,Ge,st));break;case"Polygon":st=Math.min(st,uu(Ue,!1,Tt.coordinates,Ge,st))}if(st===0)return st}return st})(D,this.geometries);if(D.geometryType()==="LineString")return(function(K,fe){let Me=K.geometry(),Ue=Me.flat().map(Tt=>pi([Tt.x,Tt.y],K.canonical));if(Me.length===0)return NaN;let Ge=new Cc(Ue[0][1]),st=1/0;for(let Tt of fe){switch(Tt.type){case"Point":st=Math.min(st,hl(Ue,!0,[Tt.coordinates],!1,Ge,st));break;case"LineString":st=Math.min(st,hl(Ue,!0,Tt.coordinates,!0,Ge,st));break;case"Polygon":st=Math.min(st,uu(Ue,!0,Tt.coordinates,Ge,st))}if(st===0)return st}return st})(D,this.geometries);if(D.geometryType()==="Polygon")return(function(K,fe){let Me=K.geometry();if(Me.length===0||Me[0].length===0)return NaN;let Ue=wu(Me,0).map(Tt=>Tt.map(Ft=>Ft.map(tr=>pi([tr.x,tr.y],K.canonical)))),Ge=new Cc(Ue[0][0][0][1]),st=1/0;for(let Tt of fe)for(let Ft of Ue){switch(Tt.type){case"Point":st=Math.min(st,uu([Tt.coordinates],!1,Ft,Ge,st));break;case"LineString":st=Math.min(st,uu(Tt.coordinates,!0,Ft,Ge,st));break;case"Polygon":st=Math.min(st,is(Ft,Tt.coordinates,Ge,st))}if(st===0)return st}return st})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let dc={"==":mo,"!=":Bo,">":Ko,"<":Go,">=":eo,"<=":Qi,array:br,at:Wt,boolean:br,case:ba,coalesce:vo,collator:Ei,format:Jo,image:ms,in:Ar,"index-of":Vr,interpolate:Li,"interpolate-hcl":Li,"interpolate-lab":Li,length:_s,let:Nr,literal:Kn,match:ma,number:br,"number-format":Xi,object:br,slice:wa,step:ga,string:br,"to-boolean":Lr,"to-color":Lr,"to-number":Lr,"to-string":Lr,var:_t,within:jo,distance:ju};class Tl{constructor(D,K,fe,Me){this.name=D,this.type=K,this._evaluate=fe,this.args=Me}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,K){let fe=D[0],Me=Tl.definitions[fe];if(!Me)return K.error(`Unknown expression "${fe}". If you wanted a literal array, use ["literal", [...]].`,0);let Ue=Array.isArray(Me)?Me[0]:Me.type,Ge=Array.isArray(Me)?[[Me[1],Me[2]]]:Me.overloads,st=Ge.filter(([Ft])=>!Array.isArray(Ft)||Ft.length===D.length-1),Tt=null;for(let[Ft,tr]of st){Tt=new Kr(K.registry,Oc,K.path,null,K.scope);let xr=[],Ir=!1;for(let Ur=1;Ur{return Ir=xr,Array.isArray(Ir)?`(${Ir.map(Xe).join(", ")})`:`(${Xe(Ir.type)}...)`;var Ir}).join(" | "),tr=[];for(let xr=1;xr{K=D?K&&Oc(fe):K&&fe instanceof Kn}),!!K&&Bc(H)&&Pc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bc(H){if(H instanceof Tl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof jo||H instanceof ju)return!1;let D=!0;return H.eachChild(K=>{D&&!Bc(K)&&(D=!1)}),D}function cu(H){if(H instanceof Tl&&H.name==="feature-state")return!1;let D=!0;return H.eachChild(K=>{D&&!cu(K)&&(D=!1)}),D}function Pc(H,D){if(H instanceof Tl&&D.indexOf(H.name)>=0)return!1;let K=!0;return H.eachChild(fe=>{K&&!Pc(fe,D)&&(K=!1)}),K}function Su(H){return{result:"success",value:H}}function nc(H){return{result:"error",value:H}}function Al(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function rc(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function Vu(H){return!!H.expression&&H.expression.interpolated}function Ts(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function Ic(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function sf(H){return H}function Nc(H,D){let K=D.type==="color",fe=H.stops&&typeof H.stops[0][0]=="object",Me=fe||!(fe||H.property!==void 0),Ue=H.type||(Vu(D)?"exponential":"interval");if(K||D.type==="padding"){let tr=K?Xt.parse:ia.parse;(H=ce({},H)).stops&&(H.stops=H.stops.map(xr=>[xr[0],tr(xr[1])])),H.default=tr(H.default?H.default:D.default)}if(H.colorSpace&&(Ge=H.colorSpace)!=="rgb"&&Ge!=="hcl"&&Ge!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var Ge;let st,Tt,Ft;if(Ue==="exponential")st=Uc;else if(Ue==="interval")st=Kl;else if(Ue==="categorical"){st=Jc,Tt=Object.create(null);for(let tr of H.stops)Tt[tr[0]]=tr[1];Ft=typeof H.stops[0][0]}else{if(Ue!=="identity")throw new Error(`Unknown function type "${Ue}"`);st=Hs}if(fe){let tr={},xr=[];for(let ea=0;eaea[0]),evaluate:({zoom:ea},sa)=>Uc({stops:Ir,base:H.base},D,ea).evaluate(ea,sa)}}if(Me){let tr=Ue==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:tr,interpolationFactor:Li.interpolationFactor.bind(void 0,tr),zoomStops:H.stops.map(xr=>xr[0]),evaluate:({zoom:xr})=>st(H,D,xr,Tt,Ft)}}return{kind:"source",evaluate(tr,xr){let Ir=xr&&xr.properties?xr.properties[H.property]:void 0;return Ir===void 0?ic(H.default,D.default):st(H,D,Ir,Tt,Ft)}}}function ic(H,D,K){return H!==void 0?H:D!==void 0?D:K!==void 0?K:void 0}function Jc(H,D,K,fe,Me){return ic(typeof K===Me?fe[K]:void 0,H.default,D.default)}function Kl(H,D,K){if(Ts(K)!=="number")return ic(H.default,D.default);let fe=H.stops.length;if(fe===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[fe-1][0])return H.stops[fe-1][1];let Me=$r(H.stops.map(Ue=>Ue[0]),K);return H.stops[Me][1]}function Uc(H,D,K){let fe=H.base!==void 0?H.base:1;if(Ts(K)!=="number")return ic(H.default,D.default);let Me=H.stops.length;if(Me===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[Me-1][0])return H.stops[Me-1][1];let Ue=$r(H.stops.map(tr=>tr[0]),K),Ge=(function(tr,xr,Ir,Ur){let ea=Ur-Ir,sa=tr-Ir;return ea===0?0:xr===1?sa/ea:(Math.pow(xr,sa)-1)/(Math.pow(xr,ea)-1)})(K,fe,H.stops[Ue][0],H.stops[Ue+1][0]),st=H.stops[Ue][1],Tt=H.stops[Ue+1][1],Ft=Pi[D.type]||sf;return typeof st.evaluate=="function"?{evaluate(...tr){let xr=st.evaluate.apply(void 0,tr),Ir=Tt.evaluate.apply(void 0,tr);if(xr!==void 0&&Ir!==void 0)return Ft(xr,Ir,Ge,H.colorSpace)}}:Ft(st,Tt,Ge,H.colorSpace)}function Hs(H,D,K){switch(D.type){case"color":K=Xt.parse(K);break;case"formatted":K=Jr.fromString(K.toString());break;case"resolvedImage":K=ja.fromString(K.toString());break;case"padding":K=ia.parse(K);break;default:Ts(K)===D.type||D.type==="enum"&&D.values[K]||(K=void 0)}return ic(K,H.default,D.default)}Tl.register(dc,{error:[{kind:"error"},[kt],(H,[D])=>{throw new St(D.evaluate(H))}],typeof:[kt,[_r],(H,[D])=>Xe(Ma(D.evaluate(H)))],"to-rgba":[Oe(Ke,4),[Bt],(H,[D])=>{let[K,fe,Me,Ue]=D.evaluate(H).rgb;return[255*K,255*fe,255*Me,Ue]}],rgb:[Bt,[Ke,Ke,Ke],Kc],rgba:[Bt,[Ke,Ke,Ke,Ke],Kc],has:{type:Et,overloads:[[[kt],(H,[D])=>Fc(D.evaluate(H),H.properties())],[[kt,jt],(H,[D,K])=>Fc(D.evaluate(H),K.evaluate(H))]]},get:{type:_r,overloads:[[[kt],(H,[D])=>pc(D.evaluate(H),H.properties())],[[kt,jt],(H,[D,K])=>pc(D.evaluate(H),K.evaluate(H))]]},"feature-state":[_r,[kt],(H,[D])=>pc(D.evaluate(H),H.featureState||{})],properties:[jt,[],H=>H.properties()],"geometry-type":[kt,[],H=>H.geometryType()],id:[_r,[],H=>H.id()],zoom:[Ke,[],H=>H.globals.zoom],"heatmap-density":[Ke,[],H=>H.globals.heatmapDensity||0],"line-progress":[Ke,[],H=>H.globals.lineProgress||0],accumulated:[_r,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[Ke,tc(Ke),(H,D)=>{let K=0;for(let fe of D)K+=fe.evaluate(H);return K}],"*":[Ke,tc(Ke),(H,D)=>{let K=1;for(let fe of D)K*=fe.evaluate(H);return K}],"-":{type:Ke,overloads:[[[Ke,Ke],(H,[D,K])=>D.evaluate(H)-K.evaluate(H)],[[Ke],(H,[D])=>-D.evaluate(H)]]},"/":[Ke,[Ke,Ke],(H,[D,K])=>D.evaluate(H)/K.evaluate(H)],"%":[Ke,[Ke,Ke],(H,[D,K])=>D.evaluate(H)%K.evaluate(H)],ln2:[Ke,[],()=>Math.LN2],pi:[Ke,[],()=>Math.PI],e:[Ke,[],()=>Math.E],"^":[Ke,[Ke,Ke],(H,[D,K])=>Math.pow(D.evaluate(H),K.evaluate(H))],sqrt:[Ke,[Ke],(H,[D])=>Math.sqrt(D.evaluate(H))],log10:[Ke,[Ke],(H,[D])=>Math.log(D.evaluate(H))/Math.LN10],ln:[Ke,[Ke],(H,[D])=>Math.log(D.evaluate(H))],log2:[Ke,[Ke],(H,[D])=>Math.log(D.evaluate(H))/Math.LN2],sin:[Ke,[Ke],(H,[D])=>Math.sin(D.evaluate(H))],cos:[Ke,[Ke],(H,[D])=>Math.cos(D.evaluate(H))],tan:[Ke,[Ke],(H,[D])=>Math.tan(D.evaluate(H))],asin:[Ke,[Ke],(H,[D])=>Math.asin(D.evaluate(H))],acos:[Ke,[Ke],(H,[D])=>Math.acos(D.evaluate(H))],atan:[Ke,[Ke],(H,[D])=>Math.atan(D.evaluate(H))],min:[Ke,tc(Ke),(H,D)=>Math.min(...D.map(K=>K.evaluate(H)))],max:[Ke,tc(Ke),(H,D)=>Math.max(...D.map(K=>K.evaluate(H)))],abs:[Ke,[Ke],(H,[D])=>Math.abs(D.evaluate(H))],round:[Ke,[Ke],(H,[D])=>{let K=D.evaluate(H);return K<0?-Math.round(-K):Math.round(K)}],floor:[Ke,[Ke],(H,[D])=>Math.floor(D.evaluate(H))],ceil:[Ke,[Ke],(H,[D])=>Math.ceil(D.evaluate(H))],"filter-==":[Et,[kt,_r],(H,[D,K])=>H.properties()[D.value]===K.value],"filter-id-==":[Et,[_r],(H,[D])=>H.id()===D.value],"filter-type-==":[Et,[kt],(H,[D])=>H.geometryType()===D.value],"filter-<":[Et,[kt,_r],(H,[D,K])=>{let fe=H.properties()[D.value],Me=K.value;return typeof fe==typeof Me&&fe{let K=H.id(),fe=D.value;return typeof K==typeof fe&&K":[Et,[kt,_r],(H,[D,K])=>{let fe=H.properties()[D.value],Me=K.value;return typeof fe==typeof Me&&fe>Me}],"filter-id->":[Et,[_r],(H,[D])=>{let K=H.id(),fe=D.value;return typeof K==typeof fe&&K>fe}],"filter-<=":[Et,[kt,_r],(H,[D,K])=>{let fe=H.properties()[D.value],Me=K.value;return typeof fe==typeof Me&&fe<=Me}],"filter-id-<=":[Et,[_r],(H,[D])=>{let K=H.id(),fe=D.value;return typeof K==typeof fe&&K<=fe}],"filter->=":[Et,[kt,_r],(H,[D,K])=>{let fe=H.properties()[D.value],Me=K.value;return typeof fe==typeof Me&&fe>=Me}],"filter-id->=":[Et,[_r],(H,[D])=>{let K=H.id(),fe=D.value;return typeof K==typeof fe&&K>=fe}],"filter-has":[Et,[_r],(H,[D])=>D.value in H.properties()],"filter-has-id":[Et,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[Et,[Oe(kt)],(H,[D])=>D.value.indexOf(H.geometryType())>=0],"filter-id-in":[Et,[Oe(_r)],(H,[D])=>D.value.indexOf(H.id())>=0],"filter-in-small":[Et,[kt,Oe(_r)],(H,[D,K])=>K.value.indexOf(H.properties()[D.value])>=0],"filter-in-large":[Et,[kt,Oe(_r)],(H,[D,K])=>(function(fe,Me,Ue,Ge){for(;Ue<=Ge;){let st=Ue+Ge>>1;if(Me[st]===fe)return!0;Me[st]>fe?Ge=st-1:Ue=st+1}return!1})(H.properties()[D.value],K.value,0,K.value.length-1)],all:{type:Et,overloads:[[[Et,Et],(H,[D,K])=>D.evaluate(H)&&K.evaluate(H)],[tc(Et),(H,D)=>{for(let K of D)if(!K.evaluate(H))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],(H,[D,K])=>D.evaluate(H)||K.evaluate(H)],[tc(Et),(H,D)=>{for(let K of D)if(K.evaluate(H))return!0;return!1}]]},"!":[Et,[Et],(H,[D])=>!D.evaluate(H)],"is-supported-script":[Et,[kt],(H,[D])=>{let K=H.globals&&H.globals.isSupportedScript;return!K||K(D.evaluate(H))}],upcase:[kt,[kt],(H,[D])=>D.evaluate(H).toUpperCase()],downcase:[kt,[kt],(H,[D])=>D.evaluate(H).toLowerCase()],concat:[kt,tc(_r),(H,D)=>D.map(K=>Xn(K.evaluate(H))).join("")],"resolved-locale":[kt,[pr],(H,[D])=>D.evaluate(H).resolvedLocale()]});class Jl{constructor(D,K){var fe;this.expression=D,this._warningHistory={},this._evaluator=new Cr,this._defaultValue=K?(fe=K).type==="color"&&Ic(fe.default)?new Xt(0,0,0,0):fe.type==="color"?Xt.parse(fe.default)||null:fe.type==="padding"?ia.parse(fe.default)||null:fe.type==="variableAnchorOffsetCollection"?Ga.parse(fe.default)||null:fe.default===void 0?null:fe.default:null,this._enumValues=K&&K.type==="enum"?K.values:null}evaluateWithoutErrorHandling(D,K,fe,Me,Ue,Ge){return this._evaluator.globals=D,this._evaluator.feature=K,this._evaluator.featureState=fe,this._evaluator.canonical=Me,this._evaluator.availableImages=Ue||null,this._evaluator.formattedSection=Ge,this.expression.evaluate(this._evaluator)}evaluate(D,K,fe,Me,Ue,Ge){this._evaluator.globals=D,this._evaluator.feature=K||null,this._evaluator.featureState=fe||null,this._evaluator.canonical=Me,this._evaluator.availableImages=Ue||null,this._evaluator.formattedSection=Ge||null;try{let st=this.expression.evaluate(this._evaluator);if(st==null||typeof st=="number"&&st!=st)return this._defaultValue;if(this._enumValues&&!(st in this._enumValues))throw new St(`Expected value to be one of ${Object.keys(this._enumValues).map(Tt=>JSON.stringify(Tt)).join(", ")}, but found ${JSON.stringify(st)} instead.`);return st}catch(st){return this._warningHistory[st.message]||(this._warningHistory[st.message]=!0,typeof console<"u"&&console.warn(st.message)),this._defaultValue}}}function qu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in dc}function Ds(H,D){let K=new Kr(dc,Oc,[],D?(function(Me){let Ue={color:Bt,string:kt,number:Ke,enum:kt,boolean:Et,formatted:Or,padding:mr,resolvedImage:Er,variableAnchorOffsetCollection:yt};return Me.type==="array"?Oe(Ue[Me.value]||_r,Me.length):Ue[Me.type]})(D):void 0),fe=K.parse(H,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return fe?Su(new Jl(fe,D)):nc(K.errors)}class Du{constructor(D,K){this.kind=D,this._styleExpression=K,this.isStateDependent=D!=="constant"&&!cu(K.expression)}evaluateWithoutErrorHandling(D,K,fe,Me,Ue,Ge){return this._styleExpression.evaluateWithoutErrorHandling(D,K,fe,Me,Ue,Ge)}evaluate(D,K,fe,Me,Ue,Ge){return this._styleExpression.evaluate(D,K,fe,Me,Ue,Ge)}}class Nl{constructor(D,K,fe,Me){this.kind=D,this.zoomStops=fe,this._styleExpression=K,this.isStateDependent=D!=="camera"&&!cu(K.expression),this.interpolationType=Me}evaluateWithoutErrorHandling(D,K,fe,Me,Ue,Ge){return this._styleExpression.evaluateWithoutErrorHandling(D,K,fe,Me,Ue,Ge)}evaluate(D,K,fe,Me,Ue,Ge){return this._styleExpression.evaluate(D,K,fe,Me,Ue,Ge)}interpolationFactor(D,K,fe){return this.interpolationType?Li.interpolationFactor(this.interpolationType,D,K,fe):0}}function Gl(H,D){let K=Ds(H,D);if(K.result==="error")return K;let fe=K.value.expression,Me=Bc(fe);if(!Me&&!Al(D))return nc([new ze("","data expressions not supported")]);let Ue=Pc(fe,["zoom"]);if(!Ue&&!rc(D))return nc([new ze("","zoom expressions not supported")]);let Ge=jc(fe);return Ge||Ue?Ge instanceof ze?nc([Ge]):Ge instanceof Li&&!Vu(D)?nc([new ze("",'"interpolate" expressions cannot be used with this property')]):Su(Ge?new Nl(Me?"camera":"composite",K.value,Ge.labels,Ge instanceof Li?Ge.interpolation:void 0):new Du(Me?"constant":"source",K.value)):nc([new ze("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class tl{constructor(D,K){this._parameters=D,this._specification=K,ce(this,Nc(this._parameters,this._specification))}static deserialize(D){return new tl(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function jc(H){let D=null;if(H instanceof Nr)D=jc(H.result);else if(H instanceof vo){for(let K of H.args)if(D=jc(K),D)break}else(H instanceof ga||H instanceof Li)&&H.input instanceof Tl&&H.input.name==="zoom"&&(D=H);return D instanceof ze||H.eachChild(K=>{let fe=jc(K);fe instanceof ze?D=fe:!D&&fe?D=new ze("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&fe&&D!==fe&&(D=new ze("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function $c(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(let D of H.slice(1))if(!$c(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}let iu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gu(H){if(H==null)return{filter:()=>!0,needGeometry:!1};$c(H)||(H=mc(H));let D=Ds(H,iu);if(D.result==="error")throw new Error(D.value.map(K=>`${K.key}: ${K.message}`).join(", "));return{filter:(K,fe,Me)=>D.value.evaluate(K,fe,{},Me),needGeometry:Mf(H)}}function zu(H,D){return HD?1:0}function Mf(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?wc(H[1],H[2],D):D==="any"?(K=H.slice(1),["any"].concat(K.map(mc))):D==="all"?["all"].concat(H.slice(1).map(mc)):D==="none"?["all"].concat(H.slice(1).map(mc).map(kl)):D==="in"?ou(H[1],H.slice(2)):D==="!in"?kl(ou(H[1],H.slice(2))):D==="has"?gc(H[1]):D!=="!has"||kl(gc(H[1]));var K}function wc(H,D,K){switch(H){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,H,D]}}function ou(H,D){if(D.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(K=>typeof K!=typeof D[0])?["filter-in-large",H,["literal",D.sort(zu)]]:["filter-in-small",H,["literal",D]]}}function gc(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function kl(H){return["!",H]}function oc(H){let D=typeof H;if(D==="number"||D==="boolean"||D==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Me="[";for(let Ue of H)Me+=`${oc(Ue)},`;return`${Me}]`}let K=Object.keys(H).sort(),fe="{";for(let Me=0;Mefe.maximum?[new ge(D,K,`${K} is greater than the maximum value ${fe.maximum}`)]:[]}function yc(H){let D=H.valueSpec,K=zs(H.value.type),fe,Me,Ue,Ge={},st=K!=="categorical"&&H.value.property===void 0,Tt=!st,Ft=Ts(H.value.stops)==="array"&&Ts(H.value.stops[0])==="array"&&Ts(H.value.stops[0][0])==="object",tr=$l({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Ur){if(K==="identity")return[new ge(Ur.key,Ur.value,'identity function may not have a "stops" property')];let ea=[],sa=Ur.value;return ea=ea.concat(Rc({key:Ur.key,value:sa,valueSpec:Ur.valueSpec,validateSpec:Ur.validateSpec,style:Ur.style,styleSpec:Ur.styleSpec,arrayElementValidator:xr})),Ts(sa)==="array"&&sa.length===0&&ea.push(new ge(Ur.key,sa,"array must have at least one stop")),ea},default:function(Ur){return Ur.validateSpec({key:Ur.key,value:Ur.value,valueSpec:D,validateSpec:Ur.validateSpec,style:Ur.style,styleSpec:Ur.styleSpec})}}});return K==="identity"&&st&&tr.push(new ge(H.key,H.value,'missing required property "property"')),K==="identity"||H.value.stops||tr.push(new ge(H.key,H.value,'missing required property "stops"')),K==="exponential"&&H.valueSpec.expression&&!Vu(H.valueSpec)&&tr.push(new ge(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(Tt&&!Al(H.valueSpec)?tr.push(new ge(H.key,H.value,"property functions not supported")):st&&!rc(H.valueSpec)&&tr.push(new ge(H.key,H.value,"zoom functions not supported"))),K!=="categorical"&&!Ft||H.value.property!==void 0||tr.push(new ge(H.key,H.value,'"property" property is required')),tr;function xr(Ur){let ea=[],sa=Ur.value,Da=Ur.key;if(Ts(sa)!=="array")return[new ge(Da,sa,`array expected, ${Ts(sa)} found`)];if(sa.length!==2)return[new ge(Da,sa,`array length 2 expected, length ${sa.length} found`)];if(Ft){if(Ts(sa[0])!=="object")return[new ge(Da,sa,`object expected, ${Ts(sa[0])} found`)];if(sa[0].zoom===void 0)return[new ge(Da,sa,"object stop key must have zoom")];if(sa[0].value===void 0)return[new ge(Da,sa,"object stop key must have value")];if(Ue&&Ue>zs(sa[0].zoom))return[new ge(Da,sa[0].zoom,"stop zoom values must appear in ascending order")];zs(sa[0].zoom)!==Ue&&(Ue=zs(sa[0].zoom),Me=void 0,Ge={}),ea=ea.concat($l({key:`${Da}[0]`,value:sa[0],valueSpec:{zoom:{}},validateSpec:Ur.validateSpec,style:Ur.style,styleSpec:Ur.styleSpec,objectElementValidators:{zoom:Vs,value:Ir}}))}else ea=ea.concat(Ir({key:`${Da}[0]`,value:sa[0],valueSpec:{},validateSpec:Ur.validateSpec,style:Ur.style,styleSpec:Ur.styleSpec},sa));return qu(Ul(sa[1]))?ea.concat([new ge(`${Da}[1]`,sa[1],"expressions are not allowed in function stops.")]):ea.concat(Ur.validateSpec({key:`${Da}[1]`,value:sa[1],valueSpec:D,validateSpec:Ur.validateSpec,style:Ur.style,styleSpec:Ur.styleSpec}))}function Ir(Ur,ea){let sa=Ts(Ur.value),Da=zs(Ur.value),qa=Ur.value!==null?Ur.value:ea;if(fe){if(sa!==fe)return[new ge(Ur.key,qa,`${sa} stop domain type must match previous stop domain type ${fe}`)]}else fe=sa;if(sa!=="number"&&sa!=="string"&&sa!=="boolean")return[new ge(Ur.key,qa,"stop domain value must be a number, string, or boolean")];if(sa!=="number"&&K!=="categorical"){let Fn=`number expected, ${sa} found`;return Al(D)&&K===void 0&&(Fn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ge(Ur.key,qa,Fn)]}return K!=="categorical"||sa!=="number"||isFinite(Da)&&Math.floor(Da)===Da?K!=="categorical"&&sa==="number"&&Me!==void 0&&Danew ge(`${H.key}${fe.key}`,H.value,fe.message));let K=D.value.expression||D.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!K.outputDefined())return[new ge(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!cu(K))return[new ge(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!cu(K))return[new ge(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Pc(K,["zoom","feature-state"]))return[new ge(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!Bc(K))return[new ge(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fu(H){let D=H.key,K=H.value,fe=H.valueSpec,Me=[];return Array.isArray(fe.values)?fe.values.indexOf(zs(K))===-1&&Me.push(new ge(D,K,`expected one of [${fe.values.join(", ")}], ${JSON.stringify(K)} found`)):Object.keys(fe.values).indexOf(zs(K))===-1&&Me.push(new ge(D,K,`expected one of [${Object.keys(fe.values).join(", ")}], ${JSON.stringify(K)} found`)),Me}function Ac(H){return $c(Ul(H.value))?Hu(ce({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):hu(H)}function hu(H){let D=H.value,K=H.key;if(Ts(D)!=="array")return[new ge(K,D,`array expected, ${Ts(D)} found`)];let fe=H.styleSpec,Me,Ue=[];if(D.length<1)return[new ge(K,D,"filter array must have at least 1 element")];switch(Ue=Ue.concat(fu({key:`${K}[0]`,value:D[0],valueSpec:fe.filter_operator,style:H.style,styleSpec:H.styleSpec})),zs(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&zs(D[1])==="$type"&&Ue.push(new ge(K,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Ue.push(new ge(K,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Me=Ts(D[1]),Me!=="string"&&Ue.push(new ge(`${K}[1]`,D[1],`string expected, ${Me} found`)));for(let Ge=2;Ge{Ft in K&&D.push(new ge(fe,K[Ft],`"${Ft}" is prohibited for ref layers`))}),Me.layers.forEach(Ft=>{zs(Ft.id)===st&&(Tt=Ft)}),Tt?Tt.ref?D.push(new ge(fe,K.ref,"ref cannot reference another ref layer")):Ge=zs(Tt.type):D.push(new ge(fe,K.ref,`ref layer "${st}" not found`))}else if(Ge!=="background")if(K.source){let Tt=Me.sources&&Me.sources[K.source],Ft=Tt&&zs(Tt.type);Tt?Ft==="vector"&&Ge==="raster"?D.push(new ge(fe,K.source,`layer "${K.id}" requires a raster source`)):Ft!=="raster-dem"&&Ge==="hillshade"?D.push(new ge(fe,K.source,`layer "${K.id}" requires a raster-dem source`)):Ft==="raster"&&Ge!=="raster"?D.push(new ge(fe,K.source,`layer "${K.id}" requires a vector source`)):Ft!=="vector"||K["source-layer"]?Ft==="raster-dem"&&Ge!=="hillshade"?D.push(new ge(fe,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ge!=="line"||!K.paint||!K.paint["line-gradient"]||Ft==="geojson"&&Tt.lineMetrics||D.push(new ge(fe,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new ge(fe,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new ge(fe,K.source,`source "${K.source}" not found`))}else D.push(new ge(fe,K,'missing required property "source"'));return D=D.concat($l({key:fe,value:K,valueSpec:Ue.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${fe}.type`,value:K.type,valueSpec:Ue.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:K,objectKey:"type"}),filter:Ac,layout:Tt=>$l({layer:K,key:Tt.key,value:Tt.value,style:Tt.style,styleSpec:Tt.styleSpec,validateSpec:Tt.validateSpec,objectElementValidators:{"*":Ft=>Cl(ce({layerType:Ge},Ft))}}),paint:Tt=>$l({layer:K,key:Tt.key,value:Tt.value,style:Tt.style,styleSpec:Tt.styleSpec,validateSpec:Tt.validateSpec,objectElementValidators:{"*":Ft=>Dc(ce({layerType:Ge},Ft))}})}})),D}function vu(H){let D=H.value,K=H.key,fe=Ts(D);return fe!=="string"?[new ge(K,D,`string expected, ${fe} found`)]:[]}let Wu={promoteId:function({key:H,value:D}){if(Ts(D)==="string")return vu({key:H,value:D});{let K=[];for(let fe in D)K.push(...vu({key:`${H}.${fe}`,value:D[fe]}));return K}}};function Fu(H){let D=H.value,K=H.key,fe=H.styleSpec,Me=H.style,Ue=H.validateSpec;if(!D.type)return[new ge(K,D,'"type" is required')];let Ge=zs(D.type),st;switch(Ge){case"vector":case"raster":return st=$l({key:K,value:D,valueSpec:fe[`source_${Ge.replace("-","_")}`],style:H.style,styleSpec:fe,objectElementValidators:Wu,validateSpec:Ue}),st;case"raster-dem":return st=(function(Tt){var Ft;let tr=(Ft=Tt.sourceName)!==null&&Ft!==void 0?Ft:"",xr=Tt.value,Ir=Tt.styleSpec,Ur=Ir.source_raster_dem,ea=Tt.style,sa=[],Da=Ts(xr);if(xr===void 0)return sa;if(Da!=="object")return sa.push(new ge("source_raster_dem",xr,`object expected, ${Da} found`)),sa;let qa=zs(xr.encoding)==="custom",Fn=["redFactor","greenFactor","blueFactor","baseShift"],cn=Tt.value.encoding?`"${Tt.value.encoding}"`:"Default";for(let Rn in xr)!qa&&Fn.includes(Rn)?sa.push(new ge(Rn,xr[Rn],`In "${tr}": "${Rn}" is only valid when "encoding" is set to "custom". ${cn} encoding found`)):Ur[Rn]?sa=sa.concat(Tt.validateSpec({key:Rn,value:xr[Rn],valueSpec:Ur[Rn],validateSpec:Tt.validateSpec,style:ea,styleSpec:Ir})):sa.push(new ge(Rn,xr[Rn],`unknown property "${Rn}"`));return sa})({sourceName:K,value:D,style:H.style,styleSpec:fe,validateSpec:Ue}),st;case"geojson":if(st=$l({key:K,value:D,valueSpec:fe.source_geojson,style:Me,styleSpec:fe,validateSpec:Ue,objectElementValidators:Wu}),D.cluster)for(let Tt in D.clusterProperties){let[Ft,tr]=D.clusterProperties[Tt],xr=typeof Ft=="string"?[Ft,["accumulated"],["get",Tt]]:Ft;st.push(...Hu({key:`${K}.${Tt}.map`,value:tr,validateSpec:Ue,expressionContext:"cluster-map"})),st.push(...Hu({key:`${K}.${Tt}.reduce`,value:xr,validateSpec:Ue,expressionContext:"cluster-reduce"}))}return st;case"video":return $l({key:K,value:D,valueSpec:fe.source_video,style:Me,validateSpec:Ue,styleSpec:fe});case"image":return $l({key:K,value:D,valueSpec:fe.source_image,style:Me,validateSpec:Ue,styleSpec:fe});case"canvas":return[new ge(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fu({key:`${K}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:Me,validateSpec:Ue,styleSpec:fe})}}function vl(H){let D=H.value,K=H.styleSpec,fe=K.light,Me=H.style,Ue=[],Ge=Ts(D);if(D===void 0)return Ue;if(Ge!=="object")return Ue=Ue.concat([new ge("light",D,`object expected, ${Ge} found`)]),Ue;for(let st in D){let Tt=st.match(/^(.*)-transition$/);Ue=Ue.concat(Tt&&fe[Tt[1]]&&fe[Tt[1]].transition?H.validateSpec({key:st,value:D[st],valueSpec:K.transition,validateSpec:H.validateSpec,style:Me,styleSpec:K}):fe[st]?H.validateSpec({key:st,value:D[st],valueSpec:fe[st],validateSpec:H.validateSpec,style:Me,styleSpec:K}):[new ge(st,D[st],`unknown property "${st}"`)])}return Ue}function jl(H){let D=H.value,K=H.styleSpec,fe=K.sky,Me=H.style,Ue=Ts(D);if(D===void 0)return[];if(Ue!=="object")return[new ge("sky",D,`object expected, ${Ue} found`)];let Ge=[];for(let st in D)Ge=Ge.concat(fe[st]?H.validateSpec({key:st,value:D[st],valueSpec:fe[st],style:Me,styleSpec:K}):[new ge(st,D[st],`unknown property "${st}"`)]);return Ge}function Xu(H){let D=H.value,K=H.styleSpec,fe=K.terrain,Me=H.style,Ue=[],Ge=Ts(D);if(D===void 0)return Ue;if(Ge!=="object")return Ue=Ue.concat([new ge("terrain",D,`object expected, ${Ge} found`)]),Ue;for(let st in D)Ue=Ue.concat(fe[st]?H.validateSpec({key:st,value:D[st],valueSpec:fe[st],validateSpec:H.validateSpec,style:Me,styleSpec:K}):[new ge(st,D[st],`unknown property "${st}"`)]);return Ue}function lc(H){let D=[],K=H.value,fe=H.key;if(Array.isArray(K)){let Me=[],Ue=[];for(let Ge in K)K[Ge].id&&Me.includes(K[Ge].id)&&D.push(new ge(fe,K,`all the sprites' ids must be unique, but ${K[Ge].id} is duplicated`)),Me.push(K[Ge].id),K[Ge].url&&Ue.includes(K[Ge].url)&&D.push(new ge(fe,K,`all the sprites' URLs must be unique, but ${K[Ge].url} is duplicated`)),Ue.push(K[Ge].url),D=D.concat($l({key:`${fe}[${Ge}]`,value:K[Ge],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return D}return vu({key:fe,value:K})}let Mu={"*":()=>[],array:Rc,boolean:function(H){let D=H.value,K=H.key,fe=Ts(D);return fe!=="boolean"?[new ge(K,D,`boolean expected, ${fe} found`)]:[]},number:Vs,color:function(H){let D=H.key,K=H.value,fe=Ts(K);return fe!=="string"?[new ge(D,K,`color expected, ${fe} found`)]:Xt.parse(String(K))?[]:[new ge(D,K,`color expected, "${K}" found`)]},constants:Tc,enum:fu,filter:Ac,function:yc,layer:Vc,object:$l,source:Fu,light:vl,sky:jl,terrain:Xu,projection:function(H){let D=H.value,K=H.styleSpec,fe=K.projection,Me=H.style,Ue=Ts(D);if(D===void 0)return[];if(Ue!=="object")return[new ge("projection",D,`object expected, ${Ue} found`)];let Ge=[];for(let st in D)Ge=Ge.concat(fe[st]?H.validateSpec({key:st,value:D[st],valueSpec:fe[st],style:Me,styleSpec:K}):[new ge(st,D[st],`unknown property "${st}"`)]);return Ge},string:vu,formatted:function(H){return vu(H).length===0?[]:Hu(H)},resolvedImage:function(H){return vu(H).length===0?[]:Hu(H)},padding:function(H){let D=H.key,K=H.value;if(Ts(K)==="array"){if(K.length<1||K.length>4)return[new ge(D,K,`padding requires 1 to 4 values; ${K.length} values found`)];let fe={type:"number"},Me=[];for(let Ue=0;Ue[]}})),H.constants&&(K=K.concat(Tc({key:"constants",value:H.constants,style:H,styleSpec:D,validateSpec:Zu}))),Wr(K)}function Qr(H){return function(D){return H(x0(_d({},D),{validateSpec:Zu}))}}function Wr(H){return[].concat(H).sort((D,K)=>D.line-K.line)}function xa(H){return function(...D){return Wr(H.apply(this,D))}}vr.source=xa(Qr(Fu)),vr.sprite=xa(Qr(lc)),vr.glyphs=xa(Qr(Yt)),vr.light=xa(Qr(vl)),vr.sky=xa(Qr(jl)),vr.terrain=xa(Qr(Xu)),vr.layer=xa(Qr(Vc)),vr.filter=xa(Qr(Ac)),vr.paintProperty=xa(Qr(Dc)),vr.layoutProperty=xa(Qr(Cl));let Qa=vr,xn=Qa.light,zn=Qa.sky,Gn=Qa.paintProperty,ni=Qa.layoutProperty;function wn(H,D){let K=!1;if(D&&D.length)for(let fe of D)H.fire(new j(new Error(fe.message))),K=!0;return K}class Sn{constructor(D,K,fe){let Me=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;let Ge=new Int32Array(this.arrayBuffer);D=Ge[0],this.d=(K=Ge[1])+2*(fe=Ge[2]);for(let Tt=0;Tt=xr[ea+0]&&Me>=xr[ea+1])?(st[Ur]=!0,Ge.push(tr[Ur])):st[Ur]=!1}}}}_forEachCell(D,K,fe,Me,Ue,Ge,st,Tt){let Ft=this._convertToCellCoord(D),tr=this._convertToCellCoord(K),xr=this._convertToCellCoord(fe),Ir=this._convertToCellCoord(Me);for(let Ur=Ft;Ur<=xr;Ur++)for(let ea=tr;ea<=Ir;ea++){let sa=this.d*ea+Ur;if((!Tt||Tt(this._convertFromCellCoord(Ur),this._convertFromCellCoord(ea),this._convertFromCellCoord(Ur+1),this._convertFromCellCoord(ea+1)))&&Ue.call(this,D,K,fe,Me,sa,Ge,st,Tt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let D=this.cells,K=3+this.cells.length+1+1,fe=0;for(let Ge=0;Ge=0)continue;let Ge=H[Ue];Me[Ue]=Ln[K].shallow.indexOf(Ue)>=0?Ge:Bi(Ge,D)}H instanceof Error&&(Me.message=H.message)}if(Me.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(Me.$name=K),Me}function Yi(H){if(Vi(H))return H;if(Array.isArray(H))return H.map(Yi);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);let D=Oi(H)||"Object";if(!Ln[D])throw new Error(`can't deserialize unregistered class ${D}`);let{klass:K}=Ln[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(H);let fe=Object.create(K.prototype);for(let Me of Object.keys(H)){if(Me==="$name")continue;let Ue=H[Me];fe[Me]=Ln[D].shallow.indexOf(Me)>=0?Ue:Yi(Ue)}return fe}class vi{constructor(){this.first=!0}update(D,K){let fe=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=fe,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=fe,!0):(this.lastFloorZoom>fe?(this.lastIntegerZoom=fe+1,this.lastIntegerZoomTime=K):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function no(H){for(let D of H)if(es(D.charCodeAt(0)))return!0;return!1}function Ro(H){for(let D of H)if(!ds(D.charCodeAt(0)))return!1;return!0}function as(H){let D=H.map(K=>{try{return new RegExp(`\\p{sc=${K}}`,"u").source}catch{return null}}).filter(K=>K);return new RegExp(D.join("|"),"u")}let Ps=as(["Arab","Dupl","Mong","Ougr","Syrc"]);function ds(H){return!Ps.test(String.fromCodePoint(H))}let Cs=as(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function es(H){return!(H!==746&&H!==747&&(H<4352||!(Qn["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||Qn["CJK Compatibility"](H)||Qn["CJK Strokes"](H)||!(!Qn["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||Qn["Enclosed CJK Letters and Months"](H)||Qn["Ideographic Description Characters"](H)||Qn.Kanbun(H)||Qn.Katakana(H)&&H!==12540||!(!Qn["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!Qn["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||Qn["Vertical Forms"](H)||Qn["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||Cs.test(String.fromCodePoint(H)))))}function ul(H){return!(es(H)||(function(D){return!!(Qn["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||Qn["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||Qn["Letterlike Symbols"](D)||Qn["Number Forms"](D)||Qn["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||Qn["Control Pictures"](D)&&D!==9251||Qn["Optical Character Recognition"](D)||Qn["Enclosed Alphanumerics"](D)||Qn["Geometric Shapes"](D)||Qn["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||Qn["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||Qn["CJK Symbols and Punctuation"](D)||Qn.Katakana(D)||Qn["Private Use Area"](D)||Qn["CJK Compatibility Forms"](D)||Qn["Small Form Variants"](D)||Qn["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)})(H))}let Ws=as(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Fs(H){return Ws.test(String.fromCodePoint(H))}function Mi(H,D){return!(!D&&Fs(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||Qn.Khmer(H))}function yo(H){for(let D of H)if(Fs(D.charCodeAt(0)))return!0;return!1}let Ss=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class us{constructor(D,K){this.zoom=D,K?(this.now=K.now,this.fadeDuration=K.fadeDuration,this.zoomHistory=K.zoomHistory,this.transition=K.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vi,this.transition={})}isSupportedScript(D){return(function(K,fe){for(let Me of K)if(!Mi(Me.charCodeAt(0),fe))return!1;return!0})(D,Ss.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let D=this.zoom,K=D-Math.floor(D),fe=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:K+(1-K)*fe}:{fromScale:.5,toScale:1,t:1-(1-fe)*K}}}class Pl{constructor(D,K){this.property=D,this.value=K,this.expression=(function(fe,Me){if(Ic(fe))return new tl(fe,Me);if(qu(fe)){let Ue=Gl(fe,Me);if(Ue.result==="error")throw new Error(Ue.value.map(Ge=>`${Ge.key}: ${Ge.message}`).join(", "));return Ue.value}{let Ue=fe;return Me.type==="color"&&typeof fe=="string"?Ue=Xt.parse(fe):Me.type!=="padding"||typeof fe!="number"&&!Array.isArray(fe)?Me.type==="variableAnchorOffsetCollection"&&Array.isArray(fe)&&(Ue=Ga.parse(fe)):Ue=ia.parse(fe),{kind:"constant",evaluate:()=>Ue}}})(K===void 0?D.specification.default:K,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,K,fe){return this.property.possiblyEvaluate(this,D,K,fe)}}class Ql{constructor(D){this.property=D,this.value=new Pl(D,void 0)}transitioned(D,K){return new Yu(this.property,this.value,K,M({},D.transition,this.transition),D.now)}untransitioned(){return new Yu(this.property,this.value,null,{},0)}}class du{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Ql(this._values[D].property)),this._values[D].value=new Pl(this._values[D].property,K===null?void 0:u(K))}getTransition(D){return u(this._values[D].transition)}setTransition(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Ql(this._values[D].property)),this._values[D].transition=u(K)||void 0}serialize(){let D={};for(let K of Object.keys(this._values)){let fe=this.getValue(K);fe!==void 0&&(D[K]=fe);let Me=this.getTransition(K);Me!==void 0&&(D[`${K}-transition`]=Me)}return D}transitioned(D,K){let fe=new Vl(this._properties);for(let Me of Object.keys(this._values))fe._values[Me]=this._values[Me].transitioned(D,K._values[Me]);return fe}untransitioned(){let D=new Vl(this._properties);for(let K of Object.keys(this._values))D._values[K]=this._values[K].untransitioned();return D}}class Yu{constructor(D,K,fe,Me,Ue){this.property=D,this.value=K,this.begin=Ue+Me.delay||0,this.end=this.begin+Me.duration||0,D.specification.transition&&(Me.delay||Me.duration)&&(this.prior=fe)}possiblyEvaluate(D,K,fe){let Me=D.now||0,Ue=this.value.possiblyEvaluate(D,K,fe),Ge=this.prior;if(Ge){if(Me>this.end)return this.prior=null,Ue;if(this.value.isDataDriven())return this.prior=null,Ue;if(Me=1)return 1;let Ft=Tt*Tt,tr=Ft*Tt;return 4*(Tt<.5?tr:3*(Tt-Ft)+tr-.75)})(st))}}return Ue}}class Vl{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,K,fe){let Me=new Ou(this._properties);for(let Ue of Object.keys(this._values))Me._values[Ue]=this._values[Ue].possiblyEvaluate(D,K,fe);return Me}hasTransition(){for(let D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Ku{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,K){this._values[D]=new Pl(this._values[D].property,K===null?void 0:u(K))}serialize(){let D={};for(let K of Object.keys(this._values)){let fe=this.getValue(K);fe!==void 0&&(D[K]=fe)}return D}possiblyEvaluate(D,K,fe){let Me=new Ou(this._properties);for(let Ue of Object.keys(this._values))Me._values[Ue]=this._values[Ue].possiblyEvaluate(D,K,fe);return Me}}class Hl{constructor(D,K,fe){this.property=D,this.value=K,this.parameters=fe}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,K,fe,Me){return this.property.evaluate(this.value,this.parameters,D,K,fe,Me)}}class Ou{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Ki{constructor(D){this.specification=D}possiblyEvaluate(D,K){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(K)}interpolate(D,K,fe){let Me=Pi[this.specification.type];return Me?Me(D,K,fe):D}}class xo{constructor(D,K){this.specification=D,this.overrides=K}possiblyEvaluate(D,K,fe,Me){return new Hl(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(K,null,{},fe,Me)}:D.expression,K)}interpolate(D,K,fe){if(D.value.kind!=="constant"||K.value.kind!=="constant")return D;if(D.value.value===void 0||K.value.value===void 0)return new Hl(this,{kind:"constant",value:void 0},D.parameters);let Me=Pi[this.specification.type];if(Me){let Ue=Me(D.value.value,K.value.value,fe);return new Hl(this,{kind:"constant",value:Ue},D.parameters)}return D}evaluate(D,K,fe,Me,Ue,Ge){return D.kind==="constant"?D.value:D.evaluate(K,fe,Me,Ue,Ge)}}class Ju extends xo{possiblyEvaluate(D,K,fe,Me){if(D.value===void 0)return new Hl(this,{kind:"constant",value:void 0},K);if(D.expression.kind==="constant"){let Ue=D.expression.evaluate(K,null,{},fe,Me),Ge=D.property.specification.type==="resolvedImage"&&typeof Ue!="string"?Ue.name:Ue,st=this._calculate(Ge,Ge,Ge,K);return new Hl(this,{kind:"constant",value:st},K)}if(D.expression.kind==="camera"){let Ue=this._calculate(D.expression.evaluate({zoom:K.zoom-1}),D.expression.evaluate({zoom:K.zoom}),D.expression.evaluate({zoom:K.zoom+1}),K);return new Hl(this,{kind:"constant",value:Ue},K)}return new Hl(this,D.expression,K)}evaluate(D,K,fe,Me,Ue,Ge){if(D.kind==="source"){let st=D.evaluate(K,fe,Me,Ue,Ge);return this._calculate(st,st,st,K)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(K.zoom)-1},fe,Me),D.evaluate({zoom:Math.floor(K.zoom)},fe,Me),D.evaluate({zoom:Math.floor(K.zoom)+1},fe,Me),K):D.value}_calculate(D,K,fe,Me){return Me.zoom>Me.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:fe,to:K}}interpolate(D){return D}}class Eu{constructor(D){this.specification=D}possiblyEvaluate(D,K,fe,Me){if(D.value!==void 0){if(D.expression.kind==="constant"){let Ue=D.expression.evaluate(K,null,{},fe,Me);return this._calculate(Ue,Ue,Ue,K)}return this._calculate(D.expression.evaluate(new us(Math.floor(K.zoom-1),K)),D.expression.evaluate(new us(Math.floor(K.zoom),K)),D.expression.evaluate(new us(Math.floor(K.zoom+1),K)),K)}}_calculate(D,K,fe,Me){return Me.zoom>Me.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:fe,to:K}}interpolate(D){return D}}class pu{constructor(D){this.specification=D}possiblyEvaluate(D,K,fe,Me){return!!D.expression.evaluate(K,null,{},fe,Me)}interpolate(){return!1}}class Be{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let K in D){let fe=D[K];fe.specification.overridable&&this.overridableProperties.push(K);let Me=this.defaultPropertyValues[K]=new Pl(fe,void 0),Ue=this.defaultTransitionablePropertyValues[K]=new Ql(fe);this.defaultTransitioningPropertyValues[K]=Ue.untransitioned(),this.defaultPossiblyEvaluatedValues[K]=Me.possiblyEvaluate({})}}}un("DataDrivenProperty",xo),un("DataConstantProperty",Ki),un("CrossFadedDataDrivenProperty",Ju),un("CrossFadedProperty",Eu),un("ColorRampProperty",pu);let R="-transition";class ae extends ee{constructor(D,K){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),K.layout&&(this._unevaluatedLayout=new Ku(K.layout)),K.paint)){this._transitionablePaint=new du(K.paint);for(let fe in D.paint)this.setPaintProperty(fe,D.paint[fe],{validate:!1});for(let fe in D.layout)this.setLayoutProperty(fe,D.layout[fe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ou(K.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,K,fe={}){K!=null&&this._validate(ni,`layers.${this.id}.layout.${D}`,D,K,fe)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,K):this.visibility=K)}getPaintProperty(D){return D.endsWith(R)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,K,fe={}){if(K!=null&&this._validate(Gn,`layers.${this.id}.paint.${D}`,D,K,fe))return!1;if(D.endsWith(R))return this._transitionablePaint.setTransition(D.slice(0,-11),K||void 0),!1;{let Me=this._transitionablePaint._values[D],Ue=Me.property.specification["property-type"]==="cross-faded-data-driven",Ge=Me.value.isDataDriven(),st=Me.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);let Tt=this._transitionablePaint._values[D].value;return Tt.isDataDriven()||Ge||Ue||this._handleOverridablePaintPropertyUpdate(D,st,Tt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,K,fe){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,K){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,K)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,K)}serialize(){let D={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),v(D,(K,fe)=>!(K===void 0||fe==="layout"&&!Object.keys(K).length||fe==="paint"&&!Object.keys(K).length))}_validate(D,K,fe,Me,Ue={}){return(!Ue||Ue.validate!==!1)&&wn(this,D.call(Qa,{key:K,layerType:this.type,objectKey:fe,value:Me,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let D in this.paint._values){let K=this.paint.get(D);if(K instanceof Hl&&Al(K.property.specification)&&(K.value.kind==="source"||K.value.kind==="composite")&&K.value.isStateDependent)return!0}return!1}}let xe={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class we{constructor(D,K){this._structArray=D,this._pos1=K*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fe{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,K){return D._trim(),K&&(D.isTransferred=!0,K.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){let K=Object.create(this.prototype);return K.arrayBuffer=D.arrayBuffer,K.length=D.length,K.capacity=D.arrayBuffer.byteLength/K.bytesPerElement,K._refreshViews(),K}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let K=this.uint8;this._refreshViews(),K&&this.uint8.set(K)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ct(H,D=1){let K=0,fe=0;return{members:H.map(Me=>{let Ue=xe[Me.type].BYTES_PER_ELEMENT,Ge=K=bt(K,Math.max(D,Ue)),st=Me.components||1;return fe=Math.max(fe,Ue),K+=Ue*st,{name:Me.name,type:Me.type,components:st,offset:Ge}}),size:bt(K,Math.max(fe,D)),alignment:D}}function bt(H,D){return Math.ceil(H/D)*D}class zt extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K){let fe=this.length;return this.resize(fe+1),this.emplace(fe,D,K)}emplace(D,K,fe){let Me=2*D;return this.int16[Me+0]=K,this.int16[Me+1]=fe,D}}zt.prototype.bytesPerElement=4,un("StructArrayLayout2i4",zt);class Zt extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe){let Me=this.length;return this.resize(Me+1),this.emplace(Me,D,K,fe)}emplace(D,K,fe,Me){let Ue=3*D;return this.int16[Ue+0]=K,this.int16[Ue+1]=fe,this.int16[Ue+2]=Me,D}}Zt.prototype.bytesPerElement=6,un("StructArrayLayout3i6",Zt);class gr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,D,K,fe,Me)}emplace(D,K,fe,Me,Ue){let Ge=4*D;return this.int16[Ge+0]=K,this.int16[Ge+1]=fe,this.int16[Ge+2]=Me,this.int16[Ge+3]=Ue,D}}gr.prototype.bytesPerElement=8,un("StructArrayLayout4i8",gr);class yr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge){let st=this.length;return this.resize(st+1),this.emplace(st,D,K,fe,Me,Ue,Ge)}emplace(D,K,fe,Me,Ue,Ge,st){let Tt=6*D;return this.int16[Tt+0]=K,this.int16[Tt+1]=fe,this.int16[Tt+2]=Me,this.int16[Tt+3]=Ue,this.int16[Tt+4]=Ge,this.int16[Tt+5]=st,D}}yr.prototype.bytesPerElement=12,un("StructArrayLayout2i4i12",yr);class Gr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge){let st=this.length;return this.resize(st+1),this.emplace(st,D,K,fe,Me,Ue,Ge)}emplace(D,K,fe,Me,Ue,Ge,st){let Tt=4*D,Ft=8*D;return this.int16[Tt+0]=K,this.int16[Tt+1]=fe,this.uint8[Ft+4]=Me,this.uint8[Ft+5]=Ue,this.uint8[Ft+6]=Ge,this.uint8[Ft+7]=st,D}}Gr.prototype.bytesPerElement=8,un("StructArrayLayout2i4ub8",Gr);class ta extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K){let fe=this.length;return this.resize(fe+1),this.emplace(fe,D,K)}emplace(D,K,fe){let Me=2*D;return this.float32[Me+0]=K,this.float32[Me+1]=fe,D}}ta.prototype.bytesPerElement=8,un("StructArrayLayout2f8",ta);class qe extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr){let xr=this.length;return this.resize(xr+1),this.emplace(xr,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr)}emplace(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr){let Ir=10*D;return this.uint16[Ir+0]=K,this.uint16[Ir+1]=fe,this.uint16[Ir+2]=Me,this.uint16[Ir+3]=Ue,this.uint16[Ir+4]=Ge,this.uint16[Ir+5]=st,this.uint16[Ir+6]=Tt,this.uint16[Ir+7]=Ft,this.uint16[Ir+8]=tr,this.uint16[Ir+9]=xr,D}}qe.prototype.bytesPerElement=20,un("StructArrayLayout10ui20",qe);class Ze extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir){let Ur=this.length;return this.resize(Ur+1),this.emplace(Ur,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir)}emplace(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur){let ea=12*D;return this.int16[ea+0]=K,this.int16[ea+1]=fe,this.int16[ea+2]=Me,this.int16[ea+3]=Ue,this.uint16[ea+4]=Ge,this.uint16[ea+5]=st,this.uint16[ea+6]=Tt,this.uint16[ea+7]=Ft,this.int16[ea+8]=tr,this.int16[ea+9]=xr,this.int16[ea+10]=Ir,this.int16[ea+11]=Ur,D}}Ze.prototype.bytesPerElement=24,un("StructArrayLayout4i4ui4i24",Ze);class it extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,fe){let Me=this.length;return this.resize(Me+1),this.emplace(Me,D,K,fe)}emplace(D,K,fe,Me){let Ue=3*D;return this.float32[Ue+0]=K,this.float32[Ue+1]=fe,this.float32[Ue+2]=Me,D}}it.prototype.bytesPerElement=12,un("StructArrayLayout3f12",it);class ft extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint32[1*D+0]=K,D}}ft.prototype.bytesPerElement=4,un("StructArrayLayout1ul4",ft);class Mt extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge,st,Tt,Ft){let tr=this.length;return this.resize(tr+1),this.emplace(tr,D,K,fe,Me,Ue,Ge,st,Tt,Ft)}emplace(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr){let xr=10*D,Ir=5*D;return this.int16[xr+0]=K,this.int16[xr+1]=fe,this.int16[xr+2]=Me,this.int16[xr+3]=Ue,this.int16[xr+4]=Ge,this.int16[xr+5]=st,this.uint32[Ir+3]=Tt,this.uint16[xr+8]=Ft,this.uint16[xr+9]=tr,D}}Mt.prototype.bytesPerElement=20,un("StructArrayLayout6i1ul2ui20",Mt);class xt extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge){let st=this.length;return this.resize(st+1),this.emplace(st,D,K,fe,Me,Ue,Ge)}emplace(D,K,fe,Me,Ue,Ge,st){let Tt=6*D;return this.int16[Tt+0]=K,this.int16[Tt+1]=fe,this.int16[Tt+2]=Me,this.int16[Tt+3]=Ue,this.int16[Tt+4]=Ge,this.int16[Tt+5]=st,D}}xt.prototype.bytesPerElement=12,un("StructArrayLayout2i2i2i12",xt);class Pt extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue){let Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,D,K,fe,Me,Ue)}emplace(D,K,fe,Me,Ue,Ge){let st=4*D,Tt=8*D;return this.float32[st+0]=K,this.float32[st+1]=fe,this.float32[st+2]=Me,this.int16[Tt+6]=Ue,this.int16[Tt+7]=Ge,D}}Pt.prototype.bytesPerElement=16,un("StructArrayLayout2f1f2i16",Pt);class ir extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge){let st=this.length;return this.resize(st+1),this.emplace(st,D,K,fe,Me,Ue,Ge)}emplace(D,K,fe,Me,Ue,Ge,st){let Tt=16*D,Ft=4*D,tr=8*D;return this.uint8[Tt+0]=K,this.uint8[Tt+1]=fe,this.float32[Ft+1]=Me,this.float32[Ft+2]=Ue,this.int16[tr+6]=Ge,this.int16[tr+7]=st,D}}ir.prototype.bytesPerElement=16,un("StructArrayLayout2ub2f2i16",ir);class fr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,fe){let Me=this.length;return this.resize(Me+1),this.emplace(Me,D,K,fe)}emplace(D,K,fe,Me){let Ue=3*D;return this.uint16[Ue+0]=K,this.uint16[Ue+1]=fe,this.uint16[Ue+2]=Me,D}}fr.prototype.bytesPerElement=6,un("StructArrayLayout3ui6",fr);class wr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa){let Fn=this.length;return this.resize(Fn+1),this.emplace(Fn,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa)}emplace(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa,Fn){let cn=24*D,Rn=12*D,Hn=48*D;return this.int16[cn+0]=K,this.int16[cn+1]=fe,this.uint16[cn+2]=Me,this.uint16[cn+3]=Ue,this.uint32[Rn+2]=Ge,this.uint32[Rn+3]=st,this.uint32[Rn+4]=Tt,this.uint16[cn+10]=Ft,this.uint16[cn+11]=tr,this.uint16[cn+12]=xr,this.float32[Rn+7]=Ir,this.float32[Rn+8]=Ur,this.uint8[Hn+36]=ea,this.uint8[Hn+37]=sa,this.uint8[Hn+38]=Da,this.uint32[Rn+10]=qa,this.int16[cn+22]=Fn,D}}wr.prototype.bytesPerElement=48,un("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",wr);class zr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa,Fn,cn,Rn,Hn,ki,po,$o,to,Ti,No,So){let wo=this.length;return this.resize(wo+1),this.emplace(wo,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa,Fn,cn,Rn,Hn,ki,po,$o,to,Ti,No,So)}emplace(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa,Da,qa,Fn,cn,Rn,Hn,ki,po,$o,to,Ti,No,So,wo){let fi=32*D,Ho=16*D;return this.int16[fi+0]=K,this.int16[fi+1]=fe,this.int16[fi+2]=Me,this.int16[fi+3]=Ue,this.int16[fi+4]=Ge,this.int16[fi+5]=st,this.int16[fi+6]=Tt,this.int16[fi+7]=Ft,this.uint16[fi+8]=tr,this.uint16[fi+9]=xr,this.uint16[fi+10]=Ir,this.uint16[fi+11]=Ur,this.uint16[fi+12]=ea,this.uint16[fi+13]=sa,this.uint16[fi+14]=Da,this.uint16[fi+15]=qa,this.uint16[fi+16]=Fn,this.uint16[fi+17]=cn,this.uint16[fi+18]=Rn,this.uint16[fi+19]=Hn,this.uint16[fi+20]=ki,this.uint16[fi+21]=po,this.uint16[fi+22]=$o,this.uint32[Ho+12]=to,this.float32[Ho+13]=Ti,this.float32[Ho+14]=No,this.uint16[fi+30]=So,this.uint16[fi+31]=wo,D}}zr.prototype.bytesPerElement=64,un("StructArrayLayout8i15ui1ul2f2ui64",zr);class Xr extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.float32[1*D+0]=K,D}}Xr.prototype.bytesPerElement=4,un("StructArrayLayout1f4",Xr);class la extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,fe){let Me=this.length;return this.resize(Me+1),this.emplace(Me,D,K,fe)}emplace(D,K,fe,Me){let Ue=3*D;return this.uint16[6*D+0]=K,this.float32[Ue+1]=fe,this.float32[Ue+2]=Me,D}}la.prototype.bytesPerElement=12,un("StructArrayLayout1ui2f12",la);class pa extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,fe){let Me=this.length;return this.resize(Me+1),this.emplace(Me,D,K,fe)}emplace(D,K,fe,Me){let Ue=4*D;return this.uint32[2*D+0]=K,this.uint16[Ue+2]=fe,this.uint16[Ue+3]=Me,D}}pa.prototype.bytesPerElement=8,un("StructArrayLayout1ul2ui8",pa);class ka extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K){let fe=this.length;return this.resize(fe+1),this.emplace(fe,D,K)}emplace(D,K,fe){let Me=2*D;return this.uint16[Me+0]=K,this.uint16[Me+1]=fe,D}}ka.prototype.bytesPerElement=4,un("StructArrayLayout2ui4",ka);class tn extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint16[1*D+0]=K,D}}tn.prototype.bytesPerElement=2,un("StructArrayLayout1ui2",tn);class Dn extends Fe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,fe,Me){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,D,K,fe,Me)}emplace(D,K,fe,Me,Ue){let Ge=4*D;return this.float32[Ge+0]=K,this.float32[Ge+1]=fe,this.float32[Ge+2]=Me,this.float32[Ge+3]=Ue,D}}Dn.prototype.bytesPerElement=16,un("StructArrayLayout4f16",Dn);class In extends we{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}In.prototype.size=20;class Yn extends Mt{get(D){return new In(this,D)}}un("CollisionBoxArray",Yn);class di extends we{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}di.prototype.size=48;class Di extends wr{get(D){return new di(this,D)}}un("PlacedSymbolArray",Di);class Ai extends we{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Ai.prototype.size=64;class lo extends zr{get(D){return new Ai(this,D)}}un("SymbolInstanceArray",lo);class Vo extends Xr{getoffsetX(D){return this.float32[1*D+0]}}un("GlyphOffsetArray",Vo);class co extends Zt{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}un("SymbolLineVertexArray",co);class Lo extends we{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Lo.prototype.size=12;class Zo extends la{get(D){return new Lo(this,D)}}un("TextAnchorOffsetArray",Zo);class Os extends we{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Os.prototype.size=8;class Ls extends pa{get(D){return new Os(this,D)}}un("FeatureIndexArray",Ls);class Do extends zt{}class zo extends zt{}class il extends zt{}class Sl extends yr{}class eu extends Gr{}class Fl extends ta{}class Js extends qe{}class Il extends Ze{}class ku extends it{}class dl extends ft{}class pl extends xt{}class ve extends ir{}class Re extends fr{}class Je extends ka{}let ht=ct([{name:"a_pos",components:2,type:"Int16"}],4),{members:mt}=ht;class wt{constructor(D=[]){this.segments=D}prepareSegment(D,K,fe,Me){let Ue=this.segments[this.segments.length-1];return D>wt.MAX_VERTEX_ARRAY_LENGTH&&f(`Max vertices per segment is ${wt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Ue||Ue.vertexLength+D>wt.MAX_VERTEX_ARRAY_LENGTH||Ue.sortKey!==Me)&&(Ue={vertexOffset:K.length,primitiveOffset:fe.length,vertexLength:0,primitiveLength:0},Me!==void 0&&(Ue.sortKey=Me),this.segments.push(Ue)),Ue}get(){return this.segments}destroy(){for(let D of this.segments)for(let K in D.vaos)D.vaos[K].destroy()}static simpleSegment(D,K,fe,Me){return new wt([{vertexOffset:D,primitiveOffset:K,vertexLength:fe,primitiveLength:Me,vaos:{},sortKey:0}])}}function $t(H,D){return 256*(H=w(Math.floor(H),0,255))+w(Math.floor(D),0,255)}wt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,un("SegmentVector",wt);let Rt=ct([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var hr={exports:{}},Br={exports:{}};Br.exports=function(H,D){var K,fe,Me,Ue,Ge,st,Tt,Ft;for(fe=H.length-(K=3&H.length),Me=D,Ge=3432918353,st=461845907,Ft=0;Ft>>16)*Ge&65535)<<16)&4294967295)<<15|Tt>>>17))*st+(((Tt>>>16)*st&65535)<<16)&4294967295)<<13|Me>>>19))+((5*(Me>>>16)&65535)<<16)&4294967295))+((58964+(Ue>>>16)&65535)<<16);switch(Tt=0,K){case 3:Tt^=(255&H.charCodeAt(Ft+2))<<16;case 2:Tt^=(255&H.charCodeAt(Ft+1))<<8;case 1:Me^=Tt=(65535&(Tt=(Tt=(65535&(Tt^=255&H.charCodeAt(Ft)))*Ge+(((Tt>>>16)*Ge&65535)<<16)&4294967295)<<15|Tt>>>17))*st+(((Tt>>>16)*st&65535)<<16)&4294967295}return Me^=H.length,Me=2246822507*(65535&(Me^=Me>>>16))+((2246822507*(Me>>>16)&65535)<<16)&4294967295,Me=3266489909*(65535&(Me^=Me>>>13))+((3266489909*(Me>>>16)&65535)<<16)&4294967295,(Me^=Me>>>16)>>>0};var jr=Br.exports,va={exports:{}};va.exports=function(H,D){for(var K,fe=H.length,Me=D^fe,Ue=0;fe>=4;)K=1540483477*(65535&(K=255&H.charCodeAt(Ue)|(255&H.charCodeAt(++Ue))<<8|(255&H.charCodeAt(++Ue))<<16|(255&H.charCodeAt(++Ue))<<24))+((1540483477*(K>>>16)&65535)<<16),Me=1540483477*(65535&Me)+((1540483477*(Me>>>16)&65535)<<16)^(K=1540483477*(65535&(K^=K>>>24))+((1540483477*(K>>>16)&65535)<<16)),fe-=4,++Ue;switch(fe){case 3:Me^=(255&H.charCodeAt(Ue+2))<<16;case 2:Me^=(255&H.charCodeAt(Ue+1))<<8;case 1:Me=1540483477*(65535&(Me^=255&H.charCodeAt(Ue)))+((1540483477*(Me>>>16)&65535)<<16)}return Me=1540483477*(65535&(Me^=Me>>>13))+((1540483477*(Me>>>16)&65535)<<16),(Me^=Me>>>15)>>>0};var ua=jr,Ha=va.exports;hr.exports=ua,hr.exports.murmur3=ua,hr.exports.murmur2=Ha;var Za=r(hr.exports);class ya{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,K,fe,Me){this.ids.push(Ca(D)),this.positions.push(K,fe,Me)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let K=Ca(D),fe=0,Me=this.ids.length-1;for(;fe>1;this.ids[Ge]>=K?Me=Ge:fe=Ge+1}let Ue=[];for(;this.ids[fe]===K;)Ue.push({index:this.positions[3*fe],start:this.positions[3*fe+1],end:this.positions[3*fe+2]}),fe++;return Ue}static serialize(D,K){let fe=new Float64Array(D.ids),Me=new Uint32Array(D.positions);return Ua(fe,Me,0,fe.length-1),K&&K.push(fe.buffer,Me.buffer),{ids:fe,positions:Me}}static deserialize(D){let K=new ya;return K.ids=D.ids,K.positions=D.positions,K.indexed=!0,K}}function Ca(H){let D=+H;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Za(String(H))}function Ua(H,D,K,fe){for(;K>1],Ue=K-1,Ge=fe+1;for(;;){do Ue++;while(H[Ue]Me);if(Ue>=Ge)break;rn(H,Ue,Ge),rn(D,3*Ue,3*Ge),rn(D,3*Ue+1,3*Ge+1),rn(D,3*Ue+2,3*Ge+2)}Ge-K`u_${Me}`),this.type=fe}setUniform(D,K,fe){D.set(fe.constantOr(this.value))}getBinding(D,K,fe){return this.type==="color"?new Wn(D,K):new Aa(D,K)}}class ji{constructor(D,K){this.uniformNames=K.map(fe=>`u_${fe}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,K){this.pixelRatioFrom=K.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=K.tlbr,this.patternTo=D.tlbr}setUniform(D,K,fe,Me){let Ue=Me==="u_pattern_to"?this.patternTo:Me==="u_pattern_from"?this.patternFrom:Me==="u_pixel_ratio_to"?this.pixelRatioTo:Me==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ue&&D.set(Ue)}getBinding(D,K,fe){return fe.substr(0,9)==="u_pattern"?new Jn(D,K):new Aa(D,K)}}class Po{constructor(D,K,fe,Me){this.expression=D,this.type=fe,this.maxValue=0,this.paintVertexAttributes=K.map(Ue=>({name:`a_${Ue}`,type:"Float32",components:fe==="color"?2:1,offset:0})),this.paintVertexArray=new Me}populatePaintArray(D,K,fe,Me,Ue){let Ge=this.paintVertexArray.length,st=this.expression.evaluate(new us(0),K,{},Me,[],Ue);this.paintVertexArray.resize(D),this._setPaintValue(Ge,D,st)}updatePaintArray(D,K,fe,Me){let Ue=this.expression.evaluate({zoom:0},fe,Me);this._setPaintValue(D,K,Ue)}_setPaintValue(D,K,fe){if(this.type==="color"){let Me=yi(fe);for(let Ue=D;Ue`u_${st}_t`),this.type=fe,this.useIntegerZoom=Me,this.zoom=Ue,this.maxValue=0,this.paintVertexAttributes=K.map(st=>({name:`a_${st}`,type:"Float32",components:fe==="color"?4:2,offset:0})),this.paintVertexArray=new Ge}populatePaintArray(D,K,fe,Me,Ue){let Ge=this.expression.evaluate(new us(this.zoom),K,{},Me,[],Ue),st=this.expression.evaluate(new us(this.zoom+1),K,{},Me,[],Ue),Tt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Tt,D,Ge,st)}updatePaintArray(D,K,fe,Me){let Ue=this.expression.evaluate({zoom:this.zoom},fe,Me),Ge=this.expression.evaluate({zoom:this.zoom+1},fe,Me);this._setPaintValue(D,K,Ue,Ge)}_setPaintValue(D,K,fe,Me){if(this.type==="color"){let Ue=yi(fe),Ge=yi(Me);for(let st=D;st`#define HAS_UNIFORM_${Me}`))}return D}getBinderAttributes(){let D=[];for(let K in this.binders){let fe=this.binders[K];if(fe instanceof Po||fe instanceof qi)for(let Me=0;Me!0){this.programConfigurations={};for(let Me of D)this.programConfigurations[Me.id]=new Bs(Me,K,fe);this.needsUpload=!1,this._featureMap=new ya,this._bufferOffset=0}populatePaintArrays(D,K,fe,Me,Ue,Ge){for(let st in this.programConfigurations)this.programConfigurations[st].populatePaintArrays(D,K,Me,Ue,Ge);K.id!==void 0&&this._featureMap.add(K.id,fe,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,K,fe,Me){for(let Ue of fe)this.needsUpload=this.programConfigurations[Ue.id].updatePaintArrays(D,this._featureMap,K,Ue,Me)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(let K in this.programConfigurations)this.programConfigurations[K].upload(D);this.needsUpload=!1}}destroy(){for(let D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Xs(H,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${D}-`,"").replace(/-/g,"_")]}function si(H,D,K){let fe={color:{source:ta,composite:Dn},number:{source:Xr,composite:ta}},Me=(function(Ue){return{"line-pattern":{source:Js,composite:Js},"fill-pattern":{source:Js,composite:Js},"fill-extrusion-pattern":{source:Js,composite:Js}}[Ue]})(H);return Me&&Me[K]||fe[D][K]}un("ConstantBinder",zi),un("CrossFadedConstantBinder",ji),un("SourceExpressionBinder",Po),un("CrossFadedCompositeBinder",Co),un("CompositeExpressionBinder",qi),un("ProgramConfiguration",Bs,{omit:["_buffers"]}),un("ProgramConfigurationSet",Is);let $i=8192,Wo=Math.pow(2,14)-1,Yo=-Wo-1;function $s(H){let D=$i/H.extent,K=H.loadGeometry();for(let fe=0;feGe.x+1||TtGe.y+1)&&f("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function ml(H,D){return{type:H.type,id:H.id,properties:H.properties,geometry:D?$s(H):[]}}function Wl(H,D,K,fe,Me){H.emplaceBack(2*D+(fe+1)/2,2*K+(Me+1)/2)}class ol{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new zo,this.indexArray=new Re,this.segments=new wt,this.programConfigurations=new Is(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,fe){let Me=this.layers[0],Ue=[],Ge=null,st=!1;Me.type==="circle"&&(Ge=Me.layout.get("circle-sort-key"),st=!Ge.isConstant());for(let{feature:Tt,id:Ft,index:tr,sourceLayerIndex:xr}of D){let Ir=this.layers[0]._featureFilter.needGeometry,Ur=ml(Tt,Ir);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),Ur,fe))continue;let ea=st?Ge.evaluate(Ur,{},fe):void 0,sa={id:Ft,properties:Tt.properties,type:Tt.type,sourceLayerIndex:xr,index:tr,geometry:Ir?Ur.geometry:$s(Tt),patterns:{},sortKey:ea};Ue.push(sa)}st&&Ue.sort((Tt,Ft)=>Tt.sortKey-Ft.sortKey);for(let Tt of Ue){let{geometry:Ft,index:tr,sourceLayerIndex:xr}=Tt,Ir=D[tr].feature;this.addFeature(Tt,Ft,tr,fe),K.featureIndex.insert(Ir,Ft,tr,xr,this.index)}}update(D,K,fe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,fe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,mt),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,K,fe,Me){for(let Ue of K)for(let Ge of Ue){let st=Ge.x,Tt=Ge.y;if(st<0||st>=$i||Tt<0||Tt>=$i)continue;let Ft=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),tr=Ft.vertexLength;Wl(this.layoutVertexArray,st,Tt,-1,-1),Wl(this.layoutVertexArray,st,Tt,1,-1),Wl(this.layoutVertexArray,st,Tt,1,1),Wl(this.layoutVertexArray,st,Tt,-1,1),this.indexArray.emplaceBack(tr,tr+1,tr+2),this.indexArray.emplaceBack(tr,tr+3,tr+2),Ft.vertexLength+=4,Ft.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,fe,{},Me)}}function Bu(H,D){for(let K=0;K1){if(ra(H,D))return!0;for(let fe=0;fe1?K:K.sub(D)._mult(Me)._add(D))}function Va(H,D){let K,fe,Me,Ue=!1;for(let Ge=0;GeD.y!=Me.y>D.y&&D.x<(Me.x-fe.x)*(D.y-fe.y)/(Me.y-fe.y)+fe.x&&(Ue=!Ue)}return Ue}function dn(H,D){let K=!1;for(let fe=0,Me=H.length-1;feD.y!=Ge.y>D.y&&D.x<(Ge.x-Ue.x)*(D.y-Ue.y)/(Ge.y-Ue.y)+Ue.x&&(K=!K)}return K}function fn(H,D,K){let fe=K[0],Me=K[2];if(H.xMe.x&&D.x>Me.x||H.yMe.y&&D.y>Me.y)return!1;let Ue=P(H,D,K[0]);return Ue!==P(H,D,K[1])||Ue!==P(H,D,K[2])||Ue!==P(H,D,K[3])}function $a(H,D,K){let fe=D.paint.get(H).value;return fe.kind==="constant"?fe.value:K.programConfigurations.get(D.id).getMaxValue(H)}function ui(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function Mn(H,D,K,fe,Me){if(!D[0]&&!D[1])return H;let Ue=i.convert(D)._mult(Me);K==="viewport"&&Ue._rotate(-fe);let Ge=[];for(let st=0;stRa(Da,sa))})(Ft,Tt),Ur=xr?tr*st:tr;for(let ea of Me)for(let sa of ea){let Da=xr?sa:Ra(sa,Tt),qa=Ur,Fn=ai([],[sa.x,sa.y,0,1],Tt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?qa*=Fn[3]/Ge.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(qa*=Ge.cameraToCenterDistance/Fn[3]),tt(Ir,Da,qa))return!0}return!1}}function Ra(H,D){let K=ai([],[H.x,H.y,0,1],D);return new i(K[0]/K[3],K[1]/K[3])}class Un extends ol{}let An;un("HeatmapBucket",Un,{omit:["layers"]});var pn={get paint(){return An=An||new Be({"heatmap-radius":new xo(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xo(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ki(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new pu(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ki(re.paint_heatmap["heatmap-opacity"])})}};function vn(H,{width:D,height:K},fe,Me){if(Me){if(Me instanceof Uint8ClampedArray)Me=new Uint8Array(Me.buffer);else if(Me.length!==D*K*fe)throw new RangeError(`mismatched image size. expected: ${Me.length} but got: ${D*K*fe}`)}else Me=new Uint8Array(D*K*fe);return H.width=D,H.height=K,H.data=Me,H}function On(H,{width:D,height:K},fe){if(D===H.width&&K===H.height)return;let Me=vn({},{width:D,height:K},fe);oi(H,Me,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,D),height:Math.min(H.height,K)},fe),H.width=D,H.height=K,H.data=Me.data}function oi(H,D,K,fe,Me,Ue){if(Me.width===0||Me.height===0)return D;if(Me.width>H.width||Me.height>H.height||K.x>H.width-Me.width||K.y>H.height-Me.height)throw new RangeError("out of range source coordinates for image copy");if(Me.width>D.width||Me.height>D.height||fe.x>D.width-Me.width||fe.y>D.height-Me.height)throw new RangeError("out of range destination coordinates for image copy");let Ge=H.data,st=D.data;if(Ge===st)throw new Error("srcData equals dstData, so image is already copied");for(let Tt=0;Tt{D[H.evaluationKey]=Tt;let Ft=H.expression.evaluate(D);Me.data[Ge+st+0]=Math.floor(255*Ft.r/Ft.a),Me.data[Ge+st+1]=Math.floor(255*Ft.g/Ft.a),Me.data[Ge+st+2]=Math.floor(255*Ft.b/Ft.a),Me.data[Ge+st+3]=Math.floor(255*Ft.a)};if(H.clips)for(let Ge=0,st=0;Ge80*K){st=1/0,Tt=1/0;let tr=-1/0,xr=-1/0;for(let Ir=K;Irtr&&(tr=Ur),ea>xr&&(xr=ea)}Ft=Math.max(tr-st,xr-Tt),Ft=Ft!==0?32767/Ft:0}return Ml(Ue,Ge,K,st,Tt,Ft,0),Ge}function Qs(H,D,K,fe,Me){let Ue;if(Me===(function(Ge,st,Tt,Ft){let tr=0;for(let xr=st,Ir=Tt-Ft;xr0)for(let Ge=D;Ge=D;Ge-=fe)Ue=ur(Ge/fe|0,H[Ge],H[Ge+1],Ue);return Ue&&ke(Ue,Ue.next)&&(pt(Ue),Ue=Ue.next),Ue}function rl(H,D){if(!H)return H;D||(D=H);let K,fe=H;do if(K=!1,fe.steiner||!ke(fe,fe.next)&&Ve(fe.prev,fe,fe.next)!==0)fe=fe.next;else{if(pt(fe),fe=D=fe.prev,fe===fe.next)break;K=!0}while(K||fe!==D);return D}function Ml(H,D,K,fe,Me,Ue,Ge){if(!H)return;!Ge&&Ue&&(function(Tt,Ft,tr,xr){let Ir=Tt;do Ir.z===0&&(Ir.z=Y(Ir.x,Ir.y,Ft,tr,xr)),Ir.prevZ=Ir.prev,Ir.nextZ=Ir.next,Ir=Ir.next;while(Ir!==Tt);Ir.prevZ.nextZ=null,Ir.prevZ=null,(function(Ur){let ea,sa=1;do{let Da,qa=Ur;Ur=null;let Fn=null;for(ea=0;qa;){ea++;let cn=qa,Rn=0;for(let ki=0;ki0||Hn>0&&cn;)Rn!==0&&(Hn===0||!cn||qa.z<=cn.z)?(Da=qa,qa=qa.nextZ,Rn--):(Da=cn,cn=cn.nextZ,Hn--),Fn?Fn.nextZ=Da:Ur=Da,Da.prevZ=Fn,Fn=Da;qa=cn}Fn.nextZ=null,sa*=2}while(ea>1)})(Ir)})(H,fe,Me,Ue);let st=H;for(;H.prev!==H.next;){let Tt=H.prev,Ft=H.next;if(Ue?qs(H,fe,Me,Ue):ps(H))D.push(Tt.i,H.i,Ft.i),pt(H),H=Ft.next,st=Ft.next;else if((H=Ft)===st){Ge?Ge===1?Ml(H=Ys(rl(H),D),D,K,fe,Me,Ue,2):Ge===2&&Ri(H,D,K,fe,Me,Ue):Ml(rl(H),D,K,fe,Me,Ue,1);break}}}function ps(H){let D=H.prev,K=H,fe=H.next;if(Ve(D,K,fe)>=0)return!1;let Me=D.x,Ue=K.x,Ge=fe.x,st=D.y,Tt=K.y,Ft=fe.y,tr=MeUe?Me>Ge?Me:Ge:Ue>Ge?Ue:Ge,Ur=st>Tt?st>Ft?st:Ft:Tt>Ft?Tt:Ft,ea=fe.next;for(;ea!==D;){if(ea.x>=tr&&ea.x<=Ir&&ea.y>=xr&&ea.y<=Ur&&te(Me,st,Ue,Tt,Ge,Ft,ea.x,ea.y)&&Ve(ea.prev,ea,ea.next)>=0)return!1;ea=ea.next}return!0}function qs(H,D,K,fe){let Me=H.prev,Ue=H,Ge=H.next;if(Ve(Me,Ue,Ge)>=0)return!1;let st=Me.x,Tt=Ue.x,Ft=Ge.x,tr=Me.y,xr=Ue.y,Ir=Ge.y,Ur=stTt?st>Ft?st:Ft:Tt>Ft?Tt:Ft,Da=tr>xr?tr>Ir?tr:Ir:xr>Ir?xr:Ir,qa=Y(Ur,ea,D,K,fe),Fn=Y(sa,Da,D,K,fe),cn=H.prevZ,Rn=H.nextZ;for(;cn&&cn.z>=qa&&Rn&&Rn.z<=Fn;){if(cn.x>=Ur&&cn.x<=sa&&cn.y>=ea&&cn.y<=Da&&cn!==Me&&cn!==Ge&&te(st,tr,Tt,xr,Ft,Ir,cn.x,cn.y)&&Ve(cn.prev,cn,cn.next)>=0||(cn=cn.prevZ,Rn.x>=Ur&&Rn.x<=sa&&Rn.y>=ea&&Rn.y<=Da&&Rn!==Me&&Rn!==Ge&&te(st,tr,Tt,xr,Ft,Ir,Rn.x,Rn.y)&&Ve(Rn.prev,Rn,Rn.next)>=0))return!1;Rn=Rn.nextZ}for(;cn&&cn.z>=qa;){if(cn.x>=Ur&&cn.x<=sa&&cn.y>=ea&&cn.y<=Da&&cn!==Me&&cn!==Ge&&te(st,tr,Tt,xr,Ft,Ir,cn.x,cn.y)&&Ve(cn.prev,cn,cn.next)>=0)return!1;cn=cn.prevZ}for(;Rn&&Rn.z<=Fn;){if(Rn.x>=Ur&&Rn.x<=sa&&Rn.y>=ea&&Rn.y<=Da&&Rn!==Me&&Rn!==Ge&&te(st,tr,Tt,xr,Ft,Ir,Rn.x,Rn.y)&&Ve(Rn.prev,Rn,Rn.next)>=0)return!1;Rn=Rn.nextZ}return!0}function Ys(H,D){let K=H;do{let fe=K.prev,Me=K.next.next;!ke(fe,Me)&&Ye(fe,K,K.next,Me)&&dr(fe,Me)&&dr(Me,fe)&&(D.push(fe.i,K.i,Me.i),pt(K),pt(K.next),K=H=Me),K=K.next}while(K!==H);return rl(K)}function Ri(H,D,K,fe,Me,Ue){let Ge=H;do{let st=Ge.next.next;for(;st!==Ge.prev;){if(Ge.i!==st.i&&pe(Ge,st)){let Tt=Dr(Ge,st);return Ge=rl(Ge,Ge.next),Tt=rl(Tt,Tt.next),Ml(Ge,D,K,fe,Me,Ue,0),void Ml(Tt,D,K,fe,Me,Ue,0)}st=st.next}Ge=Ge.next}while(Ge!==H)}function al(H,D){return H.x-D.x}function go(H,D){let K=(function(Me,Ue){let Ge=Ue,st=Me.x,Tt=Me.y,Ft,tr=-1/0;do{if(Tt<=Ge.y&&Tt>=Ge.next.y&&Ge.next.y!==Ge.y){let sa=Ge.x+(Tt-Ge.y)*(Ge.next.x-Ge.x)/(Ge.next.y-Ge.y);if(sa<=st&&sa>tr&&(tr=sa,Ft=Ge.x=Ge.x&&Ge.x>=Ir&&st!==Ge.x&&te(TtFt.x||Ge.x===Ft.x&&de(Ft,Ge)))&&(Ft=Ge,ea=sa)}Ge=Ge.next}while(Ge!==xr);return Ft})(H,D);if(!K)return D;let fe=Dr(K,H);return rl(fe,fe.next),rl(K,K.next)}function de(H,D){return Ve(H.prev,H,D.prev)<0&&Ve(D.next,H,H.next)<0}function Y(H,D,K,fe,Me){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-K)*Me|0)|H<<8))|H<<4))|H<<2))|H<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-fe)*Me|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function me(H){let D=H,K=H;do(D.x=(H-Ge)*(Ue-st)&&(H-Ge)*(fe-st)>=(K-Ge)*(D-st)&&(K-Ge)*(Ue-st)>=(Me-Ge)*(fe-st)}function pe(H,D){return H.next.i!==D.i&&H.prev.i!==D.i&&!(function(K,fe){let Me=K;do{if(Me.i!==K.i&&Me.next.i!==K.i&&Me.i!==fe.i&&Me.next.i!==fe.i&&Ye(Me,Me.next,K,fe))return!0;Me=Me.next}while(Me!==K);return!1})(H,D)&&(dr(H,D)&&dr(D,H)&&(function(K,fe){let Me=K,Ue=!1,Ge=(K.x+fe.x)/2,st=(K.y+fe.y)/2;do Me.y>st!=Me.next.y>st&&Me.next.y!==Me.y&&Ge<(Me.next.x-Me.x)*(st-Me.y)/(Me.next.y-Me.y)+Me.x&&(Ue=!Ue),Me=Me.next;while(Me!==K);return Ue})(H,D)&&(Ve(H.prev,H,D.prev)||Ve(H,D.prev,D))||ke(H,D)&&Ve(H.prev,H,H.next)>0&&Ve(D.prev,D,D.next)>0)}function Ve(H,D,K){return(D.y-H.y)*(K.x-D.x)-(D.x-H.x)*(K.y-D.y)}function ke(H,D){return H.x===D.x&&H.y===D.y}function Ye(H,D,K,fe){let Me=Ot(Ve(H,D,K)),Ue=Ot(Ve(H,D,fe)),Ge=Ot(Ve(K,fe,H)),st=Ot(Ve(K,fe,D));return Me!==Ue&&Ge!==st||!(Me!==0||!vt(H,K,D))||!(Ue!==0||!vt(H,fe,D))||!(Ge!==0||!vt(K,H,fe))||!(st!==0||!vt(K,D,fe))}function vt(H,D,K){return D.x<=Math.max(H.x,K.x)&&D.x>=Math.min(H.x,K.x)&&D.y<=Math.max(H.y,K.y)&&D.y>=Math.min(H.y,K.y)}function Ot(H){return H>0?1:H<0?-1:0}function dr(H,D){return Ve(H.prev,H,H.next)<0?Ve(H,D,H.next)>=0&&Ve(H,H.prev,D)>=0:Ve(H,D,H.prev)<0||Ve(H,H.next,D)<0}function Dr(H,D){let K=At(H.i,H.x,H.y),fe=At(D.i,D.x,D.y),Me=H.next,Ue=D.prev;return H.next=D,D.prev=H,K.next=Me,Me.prev=K,fe.next=K,K.prev=fe,Ue.next=fe,fe.prev=Ue,fe}function ur(H,D,K,fe){let Me=At(H,D,K);return fe?(Me.next=fe.next,Me.prev=fe,fe.next.prev=Me,fe.next=Me):(Me.prev=Me,Me.next=Me),Me}function pt(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function At(H,D,K){return{i:H,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Dt(H,D,K){let fe=K.patternDependencies,Me=!1;for(let Ue of D){let Ge=Ue.paint.get(`${H}-pattern`);Ge.isConstant()||(Me=!0);let st=Ge.constantOr(null);st&&(Me=!0,fe[st.to]=!0,fe[st.from]=!0)}return Me}function er(H,D,K,fe,Me){let Ue=Me.patternDependencies;for(let Ge of D){let st=Ge.paint.get(`${H}-pattern`).value;if(st.kind!=="constant"){let Tt=st.evaluate({zoom:fe-1},K,{},Me.availableImages),Ft=st.evaluate({zoom:fe},K,{},Me.availableImages),tr=st.evaluate({zoom:fe+1},K,{},Me.availableImages);Tt=Tt&&Tt.name?Tt.name:Tt,Ft=Ft&&Ft.name?Ft.name:Ft,tr=tr&&tr.name?tr.name:tr,Ue[Tt]=!0,Ue[Ft]=!0,Ue[tr]=!0,K.patterns[Ge.id]={min:Tt,mid:Ft,max:tr}}}return K}class lr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new il,this.indexArray=new Re,this.indexArray2=new Je,this.programConfigurations=new Is(D.layers,D.zoom),this.segments=new wt,this.segments2=new wt,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,fe){this.hasPattern=Dt("fill",this.layers,K);let Me=this.layers[0].layout.get("fill-sort-key"),Ue=!Me.isConstant(),Ge=[];for(let{feature:st,id:Tt,index:Ft,sourceLayerIndex:tr}of D){let xr=this.layers[0]._featureFilter.needGeometry,Ir=ml(st,xr);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),Ir,fe))continue;let Ur=Ue?Me.evaluate(Ir,{},fe,K.availableImages):void 0,ea={id:Tt,properties:st.properties,type:st.type,sourceLayerIndex:tr,index:Ft,geometry:xr?Ir.geometry:$s(st),patterns:{},sortKey:Ur};Ge.push(ea)}Ue&&Ge.sort((st,Tt)=>st.sortKey-Tt.sortKey);for(let st of Ge){let{geometry:Tt,index:Ft,sourceLayerIndex:tr}=st;if(this.hasPattern){let xr=er("fill",this.layers,st,this.zoom,K);this.patternFeatures.push(xr)}else this.addFeature(st,Tt,Ft,fe,{});K.featureIndex.insert(D[Ft].feature,Tt,Ft,tr,this.index)}}update(D,K,fe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,fe)}addFeatures(D,K,fe){for(let Me of this.patternFeatures)this.addFeature(Me,Me.geometry,Me.index,K,fe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,yl),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,K,fe,Me,Ue){for(let Ge of wu(K,500)){let st=0;for(let Ur of Ge)st+=Ur.length;let Tt=this.segments.prepareSegment(st,this.layoutVertexArray,this.indexArray),Ft=Tt.vertexLength,tr=[],xr=[];for(let Ur of Ge){if(Ur.length===0)continue;Ur!==Ge[0]&&xr.push(tr.length/2);let ea=this.segments2.prepareSegment(Ur.length,this.layoutVertexArray,this.indexArray2),sa=ea.vertexLength;this.layoutVertexArray.emplaceBack(Ur[0].x,Ur[0].y),this.indexArray2.emplaceBack(sa+Ur.length-1,sa),tr.push(Ur[0].x),tr.push(Ur[0].y);for(let Da=1;Da>3}if(Me--,fe===1||fe===2)Ue+=H.readSVarint(),Ge+=H.readSVarint(),fe===1&&(D&&st.push(D),D=[]),D.push(new fa(Ue,Ge));else{if(fe!==7)throw new Error("unknown command "+fe);D&&D.push(D[0].clone())}}return D&&st.push(D),st},Oa.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var D=H.readVarint()+H.pos,K=1,fe=0,Me=0,Ue=0,Ge=1/0,st=-1/0,Tt=1/0,Ft=-1/0;H.pos>3}if(fe--,K===1||K===2)(Me+=H.readSVarint())st&&(st=Me),(Ue+=H.readSVarint())Ft&&(Ft=Ue);else if(K!==7)throw new Error("unknown command "+K)}return[Ge,Tt,st,Ft]},Oa.prototype.toGeoJSON=function(H,D,K){var fe,Me,Ue=this.extent*Math.pow(2,K),Ge=this.extent*H,st=this.extent*D,Tt=this.loadGeometry(),Ft=Oa.types[this.type];function tr(Ur){for(var ea=0;ea>3;Me=Ge===1?fe.readString():Ge===2?fe.readFloat():Ge===3?fe.readDouble():Ge===4?fe.readVarint64():Ge===5?fe.readVarint():Ge===6?fe.readSVarint():Ge===7?fe.readBoolean():null}return Me})(K))}hn.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var D=this._pbf.readVarint()+this._pbf.pos;return new En(this._pbf,D,this.extent,this._keys,this._values)};var Pn=en;function ti(H,D,K){if(H===3){var fe=new Pn(K,K.readVarint()+K.pos);fe.length&&(D[fe.name]=fe)}}Hr.VectorTile=function(H,D){this.layers=H.readFields(ti,{},D)},Hr.VectorTileFeature=ln,Hr.VectorTileLayer=en;let io=Hr.VectorTileFeature.types,Ao=Math.pow(2,13);function ls(H,D,K,fe,Me,Ue,Ge,st){H.emplaceBack(D,K,2*Math.floor(fe*Ao)+Ge,Me*Ao*2,Ue*Ao*2,Math.round(st))}class bo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Sl,this.centroidVertexArray=new Do,this.indexArray=new Re,this.programConfigurations=new Is(D.layers,D.zoom),this.segments=new wt,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,fe){this.features=[],this.hasPattern=Dt("fill-extrusion",this.layers,K);for(let{feature:Me,id:Ue,index:Ge,sourceLayerIndex:st}of D){let Tt=this.layers[0]._featureFilter.needGeometry,Ft=ml(Me,Tt);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),Ft,fe))continue;let tr={id:Ue,sourceLayerIndex:st,index:Ge,geometry:Tt?Ft.geometry:$s(Me),properties:Me.properties,type:Me.type,patterns:{}};this.hasPattern?this.features.push(er("fill-extrusion",this.layers,tr,this.zoom,K)):this.addFeature(tr,tr.geometry,Ge,fe,{}),K.featureIndex.insert(Me,tr.geometry,Ge,st,this.index,!0)}}addFeatures(D,K,fe){for(let Me of this.features){let{geometry:Ue}=Me;this.addFeature(Me,Ue,Me.index,K,fe)}}update(D,K,fe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,fe)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Pr),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Nt.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,K,fe,Me,Ue){for(let Ge of wu(K,500)){let st={x:0,y:0,vertexCount:0},Tt=0;for(let ea of Ge)Tt+=ea.length;let Ft=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let ea of Ge){if(ea.length===0||As(ea))continue;let sa=0;for(let Da=0;Da=1){let Fn=ea[Da-1];if(!ns(qa,Fn)){Ft.vertexLength+4>wt.MAX_VERTEX_ARRAY_LENGTH&&(Ft=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let cn=qa.sub(Fn)._perp()._unit(),Rn=Fn.dist(qa);sa+Rn>32768&&(sa=0),ls(this.layoutVertexArray,qa.x,qa.y,cn.x,cn.y,0,0,sa),ls(this.layoutVertexArray,qa.x,qa.y,cn.x,cn.y,0,1,sa),st.x+=2*qa.x,st.y+=2*qa.y,st.vertexCount+=2,sa+=Rn,ls(this.layoutVertexArray,Fn.x,Fn.y,cn.x,cn.y,0,0,sa),ls(this.layoutVertexArray,Fn.x,Fn.y,cn.x,cn.y,0,1,sa),st.x+=2*Fn.x,st.y+=2*Fn.y,st.vertexCount+=2;let Hn=Ft.vertexLength;this.indexArray.emplaceBack(Hn,Hn+2,Hn+1),this.indexArray.emplaceBack(Hn+1,Hn+2,Hn+3),Ft.vertexLength+=4,Ft.primitiveLength+=2}}}}if(Ft.vertexLength+Tt>wt.MAX_VERTEX_ARRAY_LENGTH&&(Ft=this.segments.prepareSegment(Tt,this.layoutVertexArray,this.indexArray)),io[D.type]!=="Polygon")continue;let tr=[],xr=[],Ir=Ft.vertexLength;for(let ea of Ge)if(ea.length!==0){ea!==Ge[0]&&xr.push(tr.length/2);for(let sa=0;sa$i)||H.y===D.y&&(H.y<0||H.y>$i)}function As(H){return H.every(D=>D.x<0)||H.every(D=>D.x>$i)||H.every(D=>D.y<0)||H.every(D=>D.y>$i)}let Ol;un("FillExtrusionBucket",bo,{omit:["layers","features"]});var lh={get paint(){return Ol=Ol||new Be({"fill-extrusion-opacity":new Ki(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xo(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ki(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ki(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ju(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xo(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xo(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ki(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class uh extends ae{constructor(D){super(D,lh)}createBucket(D){return new bo(D)}queryRadius(){return ui(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,fe,Me,Ue,Ge,st,Tt){let Ft=Mn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ge.angle,st),tr=this.paint.get("fill-extrusion-height").evaluate(K,fe),xr=this.paint.get("fill-extrusion-base").evaluate(K,fe),Ir=(function(ea,sa,Da,qa){let Fn=[];for(let cn of ea){let Rn=[cn.x,cn.y,0,1];ai(Rn,Rn,sa),Fn.push(new i(Rn[0]/Rn[3],Rn[1]/Rn[3]))}return Fn})(Ft,Tt),Ur=(function(ea,sa,Da,qa){let Fn=[],cn=[],Rn=qa[8]*sa,Hn=qa[9]*sa,ki=qa[10]*sa,po=qa[11]*sa,$o=qa[8]*Da,to=qa[9]*Da,Ti=qa[10]*Da,No=qa[11]*Da;for(let So of ea){let wo=[],fi=[];for(let Ho of So){let To=Ho.x,ss=Ho.y,mu=qa[0]*To+qa[4]*ss+qa[12],su=qa[1]*To+qa[5]*ss+qa[13],ef=qa[2]*To+qa[6]*ss+qa[14],_h=qa[3]*To+qa[7]*ss+qa[15],wf=ef+ki,tf=_h+po,Vf=mu+$o,qf=su+to,Gf=ef+Ti,xc=_h+No,rf=new i((mu+Rn)/tf,(su+Hn)/tf);rf.z=wf/tf,wo.push(rf);let If=new i(Vf/xc,qf/xc);If.z=Gf/xc,fi.push(If)}Fn.push(wo),cn.push(fi)}return[Fn,cn]})(Me,xr,tr,Tt);return(function(ea,sa,Da){let qa=1/0;qt(Da,sa)&&(qa=mh(Da,sa[0]));for(let Fn=0;FnK.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(K=>{this.gradients[K.id]={}}),this.layoutVertexArray=new eu,this.layoutVertexArray2=new Fl,this.indexArray=new Re,this.programConfigurations=new Is(D.layers,D.zoom),this.segments=new wt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,fe){this.hasPattern=Dt("line",this.layers,K);let Me=this.layers[0].layout.get("line-sort-key"),Ue=!Me.isConstant(),Ge=[];for(let{feature:st,id:Tt,index:Ft,sourceLayerIndex:tr}of D){let xr=this.layers[0]._featureFilter.needGeometry,Ir=ml(st,xr);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),Ir,fe))continue;let Ur=Ue?Me.evaluate(Ir,{},fe):void 0,ea={id:Tt,properties:st.properties,type:st.type,sourceLayerIndex:tr,index:Ft,geometry:xr?Ir.geometry:$s(st),patterns:{},sortKey:Ur};Ge.push(ea)}Ue&&Ge.sort((st,Tt)=>st.sortKey-Tt.sortKey);for(let st of Ge){let{geometry:Tt,index:Ft,sourceLayerIndex:tr}=st;if(this.hasPattern){let xr=er("line",this.layers,st,this.zoom,K);this.patternFeatures.push(xr)}else this.addFeature(st,Tt,Ft,fe,{});K.featureIndex.insert(D[Ft].feature,Tt,Ft,tr,this.index)}}update(D,K,fe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,fe)}addFeatures(D,K,fe){for(let Me of this.patternFeatures)this.addFeature(Me,Me.geometry,Me.index,K,fe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Mh)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Sh),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,K,fe,Me,Ue){let Ge=this.layers[0].layout,st=Ge.get("line-join").evaluate(D,{}),Tt=Ge.get("line-cap"),Ft=Ge.get("line-miter-limit"),tr=Ge.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(let xr of K)this.addLine(xr,D,st,Tt,Ft,tr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,fe,Ue,Me)}addLine(D,K,fe,Me,Ue,Ge){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let qa=0;qa=2&&D[Tt-1].equals(D[Tt-2]);)Tt--;let Ft=0;for(;Ft0;if(po&&qa>Ft){let No=Ir.dist(Ur);if(No>2*tr){let So=Ir.sub(Ir.sub(Ur)._mult(tr/No)._round());this.updateDistance(Ur,So),this.addCurrentVertex(So,sa,0,0,xr),Ur=So}}let to=Ur&&ea,Ti=to?fe:st?"butt":Me;if(to&&Ti==="round"&&(HnUe&&(Ti="bevel"),Ti==="bevel"&&(Hn>2&&(Ti="flipbevel"),Hn100)Fn=Da.mult(-1);else{let No=Hn*sa.add(Da).mag()/sa.sub(Da).mag();Fn._perp()._mult(No*($o?-1:1))}this.addCurrentVertex(Ir,Fn,0,0,xr),this.addCurrentVertex(Ir,Fn.mult(-1),0,0,xr)}else if(Ti==="bevel"||Ti==="fakeround"){let No=-Math.sqrt(Hn*Hn-1),So=$o?No:0,wo=$o?0:No;if(Ur&&this.addCurrentVertex(Ir,sa,So,wo,xr),Ti==="fakeround"){let fi=Math.round(180*ki/Math.PI/20);for(let Ho=1;Ho2*tr){let So=Ir.add(ea.sub(Ir)._mult(tr/No)._round());this.updateDistance(Ir,So),this.addCurrentVertex(So,Da,0,0,xr),Ir=So}}}}addCurrentVertex(D,K,fe,Me,Ue,Ge=!1){let st=K.y*Me-K.x,Tt=-K.y-K.x*Me;this.addHalfVertex(D,K.x+K.y*fe,K.y-K.x*fe,Ge,!1,fe,Ue),this.addHalfVertex(D,st,Tt,Ge,!0,-Me,Ue),this.distance>ch/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,fe,Me,Ue,Ge))}addHalfVertex({x:D,y:K},fe,Me,Ue,Ge,st,Tt){let Ft=.5*(this.lineClips?this.scaledDistance*(ch-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Ue?1:0),(K<<1)+(Ge?1:0),Math.round(63*fe)+128,Math.round(63*Me)+128,1+(st===0?0:st<0?-1:1)|(63&Ft)<<2,Ft>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let tr=Tt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,tr),Tt.primitiveLength++),Ge?this.e2=tr:this.e1=tr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,K){this.distance+=D.dist(K),this.updateScaledDistance()}}let fh,Rv;un("LineBucket",gh,{omit:["layers","patternFeatures"]});var Qh={get paint(){return Rv=Rv||new Be({"line-opacity":new xo(re.paint_line["line-opacity"]),"line-color":new xo(re.paint_line["line-color"]),"line-translate":new Ki(re.paint_line["line-translate"]),"line-translate-anchor":new Ki(re.paint_line["line-translate-anchor"]),"line-width":new xo(re.paint_line["line-width"]),"line-gap-width":new xo(re.paint_line["line-gap-width"]),"line-offset":new xo(re.paint_line["line-offset"]),"line-blur":new xo(re.paint_line["line-blur"]),"line-dasharray":new Eu(re.paint_line["line-dasharray"]),"line-pattern":new Ju(re.paint_line["line-pattern"]),"line-gradient":new pu(re.paint_line["line-gradient"])})},get layout(){return fh=fh||new Be({"line-cap":new Ki(re.layout_line["line-cap"]),"line-join":new xo(re.layout_line["line-join"]),"line-miter-limit":new Ki(re.layout_line["line-miter-limit"]),"line-round-limit":new Ki(re.layout_line["line-round-limit"]),"line-sort-key":new xo(re.layout_line["line-sort-key"])})}};class qc extends xo{possiblyEvaluate(D,K){return K=new us(Math.floor(K.zoom),{now:K.now,fadeDuration:K.fadeDuration,zoomHistory:K.zoomHistory,transition:K.transition}),super.possiblyEvaluate(D,K)}evaluate(D,K,fe,Me){return K=M({},K,{zoom:Math.floor(K.zoom)}),super.evaluate(D,K,fe,Me)}}let ev;class Dv extends ae{constructor(D){super(D,Qh),this.gradientVersion=0,ev||(ev=new qc(Qh.paint.properties["line-width"].specification),ev.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){let K=this.gradientExpression();this.stepInterpolant=!!(function(fe){return fe._styleExpression!==void 0})(K)&&K._styleExpression.expression instanceof ga,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,K){super.recalculate(D,K),this.paint._values["line-floorwidth"]=ev.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new gh(D)}queryRadius(D){let K=D,fe=uf($a("line-width",this,K),$a("line-gap-width",this,K)),Me=$a("line-offset",this,K);return fe/2+Math.abs(Me)+ui(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,fe,Me,Ue,Ge,st){let Tt=Mn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ge.angle,st),Ft=st/2*uf(this.paint.get("line-width").evaluate(K,fe),this.paint.get("line-gap-width").evaluate(K,fe)),tr=this.paint.get("line-offset").evaluate(K,fe);return tr&&(Me=(function(xr,Ir){let Ur=[];for(let ea=0;ea=3){for(let Da=0;Da0?D+2*H:H}let pv=ct([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rd=ct([{name:"a_projected_pos",components:3,type:"Float32"}],4);ct([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let ad=ct([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ct([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let zv=ct([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),mv=ct([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gv(H,D,K){return H.sections.forEach(fe=>{fe.text=(function(Me,Ue,Ge){let st=Ue.layout.get("text-transform").evaluate(Ge,{});return st==="uppercase"?Me=Me.toLocaleUpperCase():st==="lowercase"&&(Me=Me.toLocaleLowerCase()),Ss.applyArabicShaping&&(Me=Ss.applyArabicShaping(Me)),Me})(fe.text,D,K)}),H}ct([{name:"triangle",components:3,type:"Uint16"}]),ct([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ct([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ct([{type:"Float32",name:"offsetX"}]),ct([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ct([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Cu={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Rl=24,Lf=Xl,Fv=function(H,D,K,fe,Me){var Ue,Ge,st=8*Me-fe-1,Tt=(1<>1,tr=-7,xr=K?Me-1:0,Ir=K?-1:1,Ur=H[D+xr];for(xr+=Ir,Ue=Ur&(1<<-tr)-1,Ur>>=-tr,tr+=st;tr>0;Ue=256*Ue+H[D+xr],xr+=Ir,tr-=8);for(Ge=Ue&(1<<-tr)-1,Ue>>=-tr,tr+=fe;tr>0;Ge=256*Ge+H[D+xr],xr+=Ir,tr-=8);if(Ue===0)Ue=1-Ft;else{if(Ue===Tt)return Ge?NaN:1/0*(Ur?-1:1);Ge+=Math.pow(2,fe),Ue-=Ft}return(Ur?-1:1)*Ge*Math.pow(2,Ue-fe)},nd=function(H,D,K,fe,Me,Ue){var Ge,st,Tt,Ft=8*Ue-Me-1,tr=(1<>1,Ir=Me===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ur=fe?0:Ue-1,ea=fe?1:-1,sa=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(st=isNaN(D)?1:0,Ge=tr):(Ge=Math.floor(Math.log(D)/Math.LN2),D*(Tt=Math.pow(2,-Ge))<1&&(Ge--,Tt*=2),(D+=Ge+xr>=1?Ir/Tt:Ir*Math.pow(2,1-xr))*Tt>=2&&(Ge++,Tt/=2),Ge+xr>=tr?(st=0,Ge=tr):Ge+xr>=1?(st=(D*Tt-1)*Math.pow(2,Me),Ge+=xr):(st=D*Math.pow(2,xr-1)*Math.pow(2,Me),Ge=0));Me>=8;H[K+Ur]=255&st,Ur+=ea,st/=256,Me-=8);for(Ge=Ge<0;H[K+Ur]=255&Ge,Ur+=ea,Ge/=256,Ft-=8);H[K+Ur-ea]|=128*sa};function Xl(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Xl.Varint=0,Xl.Fixed64=1,Xl.Bytes=2,Xl.Fixed32=5;var Zd=4294967296,yv=1/Zd,Hp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function hh(H){return H.type===Xl.Bytes?H.readVarint()+H.pos:H.pos+1}function _v(H,D,K){return K?4294967296*D+(H>>>0):4294967296*(D>>>0)+(H>>>0)}function Wp(H,D,K){var fe=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));K.realloc(fe);for(var Me=K.pos-1;Me>=H;Me--)K.buf[Me+fe]=K.buf[Me]}function Yd(H,D){for(var K=0;K>>8,H[K+2]=D>>>16,H[K+3]=D>>>24}function Bg(H,D){return(H[D]|H[D+1]<<8|H[D+2]<<16)+(H[D+3]<<24)}Xl.prototype={destroy:function(){this.buf=null},readFields:function(H,D,K){for(K=K||this.length;this.pos>3,Ue=this.pos;this.type=7&fe,H(Me,D,this),this.pos===Ue&&this.skip(fe)}return D},readMessage:function(H,D){return this.readFields(H,D,this.readVarint()+this.pos)},readFixed32:function(){var H=Ov(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Bg(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=Ov(this.buf,this.pos)+Ov(this.buf,this.pos+4)*Zd;return this.pos+=8,H},readSFixed64:function(){var H=Ov(this.buf,this.pos)+Bg(this.buf,this.pos+4)*Zd;return this.pos+=8,H},readFloat:function(){var H=Fv(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Fv(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var D,K,fe=this.buf;return D=127&(K=fe[this.pos++]),K<128?D:(D|=(127&(K=fe[this.pos++]))<<7,K<128?D:(D|=(127&(K=fe[this.pos++]))<<14,K<128?D:(D|=(127&(K=fe[this.pos++]))<<21,K<128?D:(function(Me,Ue,Ge){var st,Tt,Ft=Ge.buf;if(st=(112&(Tt=Ft[Ge.pos++]))>>4,Tt<128||(st|=(127&(Tt=Ft[Ge.pos++]))<<3,Tt<128)||(st|=(127&(Tt=Ft[Ge.pos++]))<<10,Tt<128)||(st|=(127&(Tt=Ft[Ge.pos++]))<<17,Tt<128)||(st|=(127&(Tt=Ft[Ge.pos++]))<<24,Tt<128)||(st|=(1&(Tt=Ft[Ge.pos++]))<<31,Tt<128))return _v(Me,st,Ue);throw new Error("Expected varint not more than 10 bytes")})(D|=(15&(K=fe[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,D=this.pos;return this.pos=H,H-D>=12&&Hp?(function(K,fe,Me){return Hp.decode(K.subarray(fe,Me))})(this.buf,D,H):(function(K,fe,Me){for(var Ue="",Ge=fe;Ge239?4:tr>223?3:tr>191?2:1;if(Ge+Ir>Me)break;Ir===1?tr<128&&(xr=tr):Ir===2?(192&(st=K[Ge+1]))==128&&(xr=(31&tr)<<6|63&st)<=127&&(xr=null):Ir===3?(Tt=K[Ge+2],(192&(st=K[Ge+1]))==128&&(192&Tt)==128&&((xr=(15&tr)<<12|(63&st)<<6|63&Tt)<=2047||xr>=55296&&xr<=57343)&&(xr=null)):Ir===4&&(Tt=K[Ge+2],Ft=K[Ge+3],(192&(st=K[Ge+1]))==128&&(192&Tt)==128&&(192&Ft)==128&&((xr=(15&tr)<<18|(63&st)<<12|(63&Tt)<<6|63&Ft)<=65535||xr>=1114112)&&(xr=null)),xr===null?(xr=65533,Ir=1):xr>65535&&(xr-=65536,Ue+=String.fromCharCode(xr>>>10&1023|55296),xr=56320|1023&xr),Ue+=String.fromCharCode(xr),Ge+=Ir}return Ue})(this.buf,D,H)},readBytes:function(){var H=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,H);return this.pos=H,D},readPackedVarint:function(H,D){if(this.type!==Xl.Bytes)return H.push(this.readVarint(D));var K=hh(this);for(H=H||[];this.pos127;);else if(D===Xl.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Xl.Fixed32)this.pos+=4;else{if(D!==Xl.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(H,D){this.writeVarint(H<<3|D)},realloc:function(H){for(var D=this.length||16;D268435455||H<0?(function(D,K){var fe,Me;if(D>=0?(fe=D%4294967296|0,Me=D/4294967296|0):(Me=~(-D/4294967296),4294967295^(fe=~(-D%4294967296))?fe=fe+1|0:(fe=0,Me=Me+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");K.realloc(10),(function(Ue,Ge,st){st.buf[st.pos++]=127&Ue|128,Ue>>>=7,st.buf[st.pos++]=127&Ue|128,Ue>>>=7,st.buf[st.pos++]=127&Ue|128,Ue>>>=7,st.buf[st.pos++]=127&Ue|128,st.buf[st.pos]=127&(Ue>>>=7)})(fe,0,K),(function(Ue,Ge){var st=(7&Ue)<<4;Ge.buf[Ge.pos++]|=st|((Ue>>>=3)?128:0),Ue&&(Ge.buf[Ge.pos++]=127&Ue|((Ue>>>=7)?128:0),Ue&&(Ge.buf[Ge.pos++]=127&Ue|((Ue>>>=7)?128:0),Ue&&(Ge.buf[Ge.pos++]=127&Ue|((Ue>>>=7)?128:0),Ue&&(Ge.buf[Ge.pos++]=127&Ue|((Ue>>>=7)?128:0),Ue&&(Ge.buf[Ge.pos++]=127&Ue)))))})(Me,K)})(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var D=this.pos;this.pos=(function(fe,Me,Ue){for(var Ge,st,Tt=0;Tt55295&&Ge<57344){if(!st){Ge>56319||Tt+1===Me.length?(fe[Ue++]=239,fe[Ue++]=191,fe[Ue++]=189):st=Ge;continue}if(Ge<56320){fe[Ue++]=239,fe[Ue++]=191,fe[Ue++]=189,st=Ge;continue}Ge=st-55296<<10|Ge-56320|65536,st=null}else st&&(fe[Ue++]=239,fe[Ue++]=191,fe[Ue++]=189,st=null);Ge<128?fe[Ue++]=Ge:(Ge<2048?fe[Ue++]=Ge>>6|192:(Ge<65536?fe[Ue++]=Ge>>12|224:(fe[Ue++]=Ge>>18|240,fe[Ue++]=Ge>>12&63|128),fe[Ue++]=Ge>>6&63|128),fe[Ue++]=63&Ge|128)}return Ue})(this.buf,H,this.pos);var K=this.pos-D;K>=128&&Wp(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(H){this.realloc(4),nd(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),nd(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var D=H.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&Wp(K,fe,this),this.pos=K-1,this.writeVarint(fe),this.pos+=fe},writeMessage:function(H,D,K){this.writeTag(H,Xl.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(H,D){D.length&&this.writeMessage(H,Yd,D)},writePackedSVarint:function(H,D){D.length&&this.writeMessage(H,sx,D)},writePackedBoolean:function(H,D){D.length&&this.writeMessage(H,cx,D)},writePackedFloat:function(H,D){D.length&&this.writeMessage(H,lx,D)},writePackedDouble:function(H,D){D.length&&this.writeMessage(H,ux,D)},writePackedFixed32:function(H,D){D.length&&this.writeMessage(H,v5,D)},writePackedSFixed32:function(H,D){D.length&&this.writeMessage(H,fx,D)},writePackedFixed64:function(H,D){D.length&&this.writeMessage(H,hx,D)},writePackedSFixed64:function(H,D){D.length&&this.writeMessage(H,vx,D)},writeBytesField:function(H,D){this.writeTag(H,Xl.Bytes),this.writeBytes(D)},writeFixed32Field:function(H,D){this.writeTag(H,Xl.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(H,D){this.writeTag(H,Xl.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(H,D){this.writeTag(H,Xl.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(H,D){this.writeTag(H,Xl.Fixed64),this.writeSFixed64(D)},writeVarintField:function(H,D){this.writeTag(H,Xl.Varint),this.writeVarint(D)},writeSVarintField:function(H,D){this.writeTag(H,Xl.Varint),this.writeSVarint(D)},writeStringField:function(H,D){this.writeTag(H,Xl.Bytes),this.writeString(D)},writeFloatField:function(H,D){this.writeTag(H,Xl.Fixed32),this.writeFloat(D)},writeDoubleField:function(H,D){this.writeTag(H,Xl.Fixed64),this.writeDouble(D)},writeBooleanField:function(H,D){this.writeVarintField(H,!!D)}};var nm=r(Lf);let im=3;function d5(H,D,K){H===1&&K.readMessage(dx,D)}function dx(H,D,K){if(H===3){let{id:fe,bitmap:Me,width:Ue,height:Ge,left:st,top:Tt,advance:Ft}=K.readMessage(Ng,{});D.push({id:fe,bitmap:new bi({width:Ue+2*im,height:Ge+2*im},Me),metrics:{width:Ue,height:Ge,left:st,top:Tt,advance:Ft}})}}function Ng(H,D,K){H===1?D.id=K.readVarint():H===2?D.bitmap=K.readBytes():H===3?D.width=K.readVarint():H===4?D.height=K.readVarint():H===5?D.left=K.readSVarint():H===6?D.top=K.readSVarint():H===7&&(D.advance=K.readVarint())}let Ug=im;function om(H){let D=0,K=0;for(let Ge of H)D+=Ge.w*Ge.h,K=Math.max(K,Ge.w);H.sort((Ge,st)=>st.h-Ge.h);let fe=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),K),h:1/0}],Me=0,Ue=0;for(let Ge of H)for(let st=fe.length-1;st>=0;st--){let Tt=fe[st];if(!(Ge.w>Tt.w||Ge.h>Tt.h)){if(Ge.x=Tt.x,Ge.y=Tt.y,Ue=Math.max(Ue,Ge.y+Ge.h),Me=Math.max(Me,Ge.x+Ge.w),Ge.w===Tt.w&&Ge.h===Tt.h){let Ft=fe.pop();st=0&&fe>=D&&Yp[this.text.charCodeAt(fe)];fe--)K--;this.text=this.text.substring(D,K),this.sectionIndex=this.sectionIndex.slice(D,K)}substring(D,K){let fe=new id;return fe.text=this.text.substring(D,K),fe.sectionIndex=this.sectionIndex.slice(D,K),fe.sections=this.sections,fe}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,K)=>Math.max(D,this.sections[K].scale),0)}addTextSection(D,K){this.text+=D.text,this.sections.push(Jd.forText(D.scale,D.fontStack||K));let fe=this.sections.length-1;for(let Me=0;Me=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function $d(H,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea){let sa=id.fromFeature(H,Me),Da;xr===e.ah.vertical&&sa.verticalizePunctuation();let{processBidirectionalText:qa,processStyledBidirectionalText:Fn}=Ss;if(qa&&sa.sections.length===1){Da=[];let Hn=qa(sa.toString(),od(sa,Ft,Ue,D,fe,Ur));for(let ki of Hn){let po=new id;po.text=ki,po.sections=sa.sections;for(let $o=0;$o0&&bh>Sc&&(Sc=bh)}else{let $u=po[Dl.fontStack],zc=$u&&$u[gu];if(zc&&zc.rect)hd=zc.rect,uc=zc.metrics;else{let bh=ki[Dl.fontStack],nv=bh&&bh[gu];if(!nv)continue;uc=nv.metrics}ph=(rf-Dl.scale)*Rl}xh?(Hn.verticalizable=!0,cf.push({glyph:gu,imageName:Uh,x:ss,y:mu+ph,vertical:xh,scale:Dl.scale,fontStack:Dl.fontStack,sectionIndex:Lu,metrics:uc,rect:hd}),ss+=Rh*Dl.scale+fi):(cf.push({glyph:gu,imageName:Uh,x:ss,y:mu+ph,vertical:xh,scale:Dl.scale,fontStack:Dl.fontStack,sectionIndex:Lu,metrics:uc,rect:hd}),ss+=uc.advance*Dl.scale+fi)}cf.length!==0&&(su=Math.max(ss-fi,su),xv(cf,0,cf.length-1,_h,Sc)),ss=0;let dh=Ti*rf+Sc;Tf.lineOffset=Math.max(Sc,If),mu+=dh,ef=Math.max(dh,ef),++wf}var tf;let Vf=mu-Qc,{horizontalAlign:qf,verticalAlign:Gf}=Jp(No);(function(xc,rf,If,Tf,cf,Sc,dh,Kf,Dl){let Lu=(rf-If)*cf,gu=0;gu=Sc!==dh?-Kf*Tf-Qc:(-Tf*Dl+.5)*dh;for(let ph of xc)for(let uc of ph.positionedGlyphs)uc.x+=Lu,uc.y+=gu})(Hn.positionedLines,_h,qf,Gf,su,ef,Ti,Vf,to.length),Hn.top+=-Gf*Vf,Hn.bottom=Hn.top+Vf,Hn.left+=-qf*su,Hn.right=Hn.left+su})(Rn,D,K,fe,Da,Ge,st,Tt,xr,Ft,Ir,ea),!(function(Hn){for(let ki of Hn)if(ki.positionedGlyphs.length!==0)return!1;return!0})(cn)&&Rn}let Yp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},px={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},mx={40:!0};function jg(H,D,K,fe,Me,Ue){if(D.imageName){let Ge=fe[D.imageName];return Ge?Ge.displaySize[0]*D.scale*Rl/Ue+Me:0}{let Ge=K[D.fontStack],st=Ge&&Ge[H];return st?st.metrics.advance*D.scale+Me:0}}function Vg(H,D,K,fe){let Me=Math.pow(H-D,2);return fe?H=0,Ft=0;for(let xr=0;xrFt){let tr=Math.ceil(Ue/Ft);Me*=tr/Ge,Ge=tr}return{x1:fe,y1:Me,x2:fe+Ue,y2:Me+Ge}}function Hg(H,D,K,fe,Me,Ue){let Ge=H.image,st;if(Ge.content){let Da=Ge.content,qa=Ge.pixelRatio||1;st=[Da[0]/qa,Da[1]/qa,Ge.displaySize[0]-Da[2]/qa,Ge.displaySize[1]-Da[3]/qa]}let Tt=D.left*Ue,Ft=D.right*Ue,tr,xr,Ir,Ur;K==="width"||K==="both"?(Ur=Me[0]+Tt-fe[3],xr=Me[0]+Ft+fe[1]):(Ur=Me[0]+(Tt+Ft-Ge.displaySize[0])/2,xr=Ur+Ge.displaySize[0]);let ea=D.top*Ue,sa=D.bottom*Ue;return K==="height"||K==="both"?(tr=Me[1]+ea-fe[0],Ir=Me[1]+sa+fe[2]):(tr=Me[1]+(ea+sa-Ge.displaySize[1])/2,Ir=tr+Ge.displaySize[1]),{image:Ge,top:tr,right:xr,bottom:Ir,left:Ur,collisionPadding:st}}let ep=255,Nh=128,bv=ep*Nh;function Wg(H,D){let{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new us(H+1))};if(K.kind==="source")return{kind:"source"};{let{zoomStops:fe,interpolationType:Me}=K,Ue=0;for(;UeGe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=on([]),this.placementViewportMatrix=on([]);let K=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wg(this.zoom,K["text-size"]),this.iconSizeData=Wg(this.zoom,K["icon-size"]);let fe=this.layers[0].layout,Me=fe.get("symbol-sort-key"),Ue=fe.get("symbol-z-order");this.canOverlap=sm(fe,"text-overlap","text-allow-overlap")!=="never"||sm(fe,"icon-overlap","icon-allow-overlap")!=="never"||fe.get("text-ignore-placement")||fe.get("icon-ignore-placement"),this.sortFeaturesByKey=Ue!=="viewport-y"&&!Me.isConstant(),this.sortFeaturesByY=(Ue==="viewport-y"||Ue==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,fe.get("symbol-placement")==="point"&&(this.writingModes=fe.get("text-writing-mode").map(Ge=>e.ah[Ge])),this.stateDependentLayerIds=this.layers.filter(Ge=>Ge.isStateDependent()).map(Ge=>Ge.id),this.sourceID=D.sourceID}createArrays(){this.text=new cm(new Is(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new cm(new Is(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Vo,this.lineVertexArray=new co,this.symbolInstances=new lo,this.textAnchorOffsets=new Zo}calculateGlyphDependencies(D,K,fe,Me,Ue){for(let Ge=0;Ge0)&&(Ge.value.kind!=="constant"||Ge.value.value.length>0),tr=Tt.value.kind!=="constant"||!!Tt.value.value||Object.keys(Tt.parameters).length>0,xr=Ue.get("symbol-sort-key");if(this.features=[],!Ft&&!tr)return;let Ir=K.iconDependencies,Ur=K.glyphDependencies,ea=K.availableImages,sa=new us(this.zoom);for(let{feature:Da,id:qa,index:Fn,sourceLayerIndex:cn}of D){let Rn=Me._featureFilter.needGeometry,Hn=ml(Da,Rn);if(!Me._featureFilter.filter(sa,Hn,fe))continue;let ki,po;if(Rn||(Hn.geometry=$s(Da)),Ft){let to=Me.getValueAndResolveTokens("text-field",Hn,fe,ea),Ti=Jr.factory(to),No=this.hasRTLText=this.hasRTLText||um(Ti);(!No||Ss.getRTLTextPluginStatus()==="unavailable"||No&&Ss.isParsed())&&(ki=gv(Ti,Me,Hn))}if(tr){let to=Me.getValueAndResolveTokens("icon-image",Hn,fe,ea);po=to instanceof ja?to:ja.fromString(to)}if(!ki&&!po)continue;let $o=this.sortFeaturesByKey?xr.evaluate(Hn,{},fe):void 0;if(this.features.push({id:qa,text:ki,icon:po,index:Fn,sourceLayerIndex:cn,geometry:Hn.geometry,properties:Da.properties,type:yx[Da.type],sortKey:$o}),po&&(Ir[po.name]=!0),ki){let to=Ge.evaluate(Hn,{},fe).join(","),Ti=Ue.get("text-rotation-alignment")!=="viewport"&&Ue.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let No of ki.sections)if(No.image)Ir[No.image.name]=!0;else{let So=no(ki.toString()),wo=No.fontStack||to,fi=Ur[wo]=Ur[wo]||{};this.calculateGlyphDependencies(No.text,fi,Ti,this.allowVerticalPlacement,So)}}}Ue.get("symbol-placement")==="line"&&(this.features=(function(Da){let qa={},Fn={},cn=[],Rn=0;function Hn(to){cn.push(Da[to]),Rn++}function ki(to,Ti,No){let So=Fn[to];return delete Fn[to],Fn[Ti]=So,cn[So].geometry[0].pop(),cn[So].geometry[0]=cn[So].geometry[0].concat(No[0]),So}function po(to,Ti,No){let So=qa[Ti];return delete qa[Ti],qa[to]=So,cn[So].geometry[0].shift(),cn[So].geometry[0]=No[0].concat(cn[So].geometry[0]),So}function $o(to,Ti,No){let So=No?Ti[0][Ti[0].length-1]:Ti[0][0];return`${to}:${So.x}:${So.y}`}for(let to=0;toto.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((Da,qa)=>Da.sortKey-qa.sortKey)}update(D,K,fe){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,K,this.layers,fe),this.icon.programConfigurations.updatePaintArrays(D,K,this.layers,fe))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,K){let fe=this.lineVertexArray.length;if(D.segment!==void 0){let Me=D.dist(K[D.segment+1]),Ue=D.dist(K[D.segment]),Ge={};for(let st=D.segment+1;st=0;st--)Ge[st]={x:K[st].x,y:K[st].y,tileUnitDistanceFromAnchor:Ue},st>0&&(Ue+=K[st-1].dist(K[st]));for(let st=0;st0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,K){let fe=D.placedSymbolArray.get(K),Me=fe.vertexStartIndex+4*fe.numGlyphs;for(let Ue=fe.vertexStartIndex;UeMe[st]-Me[Tt]||Ue[Tt]-Ue[st]),Ge}addToSortKeyRanges(D,K){let fe=this.sortKeyRanges[this.sortKeyRanges.length-1];fe&&fe.sortKey===K?fe.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:K,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let K of this.symbolInstanceIndexes){let fe=this.symbolInstances.get(K);this.featureSortOrder.push(fe.featureIndex),[fe.rightJustifiedTextSymbolIndex,fe.centerJustifiedTextSymbolIndex,fe.leftJustifiedTextSymbolIndex].forEach((Me,Ue,Ge)=>{Me>=0&&Ge.indexOf(Me)===Ue&&this.addIndicesForPlacedSymbol(this.text,Me)}),fe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,fe.verticalPlacedTextSymbolIndex),fe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,fe.placedIconSymbolIndex),fe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,fe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let _c,tp;un("SymbolBucket",sd,{omit:["layers","collisionBoxArray","features","compareText"]}),sd.MAX_GLYPHS=65535,sd.addDynamicAttributes=lm;var Qp={get paint(){return tp=tp||new Be({"icon-opacity":new xo(re.paint_symbol["icon-opacity"]),"icon-color":new xo(re.paint_symbol["icon-color"]),"icon-halo-color":new xo(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new xo(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xo(re.paint_symbol["icon-halo-blur"]),"icon-translate":new Ki(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ki(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new xo(re.paint_symbol["text-opacity"]),"text-color":new xo(re.paint_symbol["text-color"],{runtimeType:Bt,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new xo(re.paint_symbol["text-halo-color"]),"text-halo-width":new xo(re.paint_symbol["text-halo-width"]),"text-halo-blur":new xo(re.paint_symbol["text-halo-blur"]),"text-translate":new Ki(re.paint_symbol["text-translate"]),"text-translate-anchor":new Ki(re.paint_symbol["text-translate-anchor"])})},get layout(){return _c=_c||new Be({"symbol-placement":new Ki(re.layout_symbol["symbol-placement"]),"symbol-spacing":new Ki(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ki(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xo(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ki(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ki(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ki(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ki(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ki(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ki(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new xo(re.layout_symbol["icon-size"]),"icon-text-fit":new Ki(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ki(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new xo(re.layout_symbol["icon-image"]),"icon-rotate":new xo(re.layout_symbol["icon-rotate"]),"icon-padding":new xo(re.layout_symbol["icon-padding"]),"icon-keep-upright":new Ki(re.layout_symbol["icon-keep-upright"]),"icon-offset":new xo(re.layout_symbol["icon-offset"]),"icon-anchor":new xo(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ki(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ki(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ki(re.layout_symbol["text-rotation-alignment"]),"text-field":new xo(re.layout_symbol["text-field"]),"text-font":new xo(re.layout_symbol["text-font"]),"text-size":new xo(re.layout_symbol["text-size"]),"text-max-width":new xo(re.layout_symbol["text-max-width"]),"text-line-height":new Ki(re.layout_symbol["text-line-height"]),"text-letter-spacing":new xo(re.layout_symbol["text-letter-spacing"]),"text-justify":new xo(re.layout_symbol["text-justify"]),"text-radial-offset":new xo(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ki(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new xo(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new xo(re.layout_symbol["text-anchor"]),"text-max-angle":new Ki(re.layout_symbol["text-max-angle"]),"text-writing-mode":new Ki(re.layout_symbol["text-writing-mode"]),"text-rotate":new xo(re.layout_symbol["text-rotate"]),"text-padding":new Ki(re.layout_symbol["text-padding"]),"text-keep-upright":new Ki(re.layout_symbol["text-keep-upright"]),"text-transform":new xo(re.layout_symbol["text-transform"]),"text-offset":new xo(re.layout_symbol["text-offset"]),"text-allow-overlap":new Ki(re.layout_symbol["text-allow-overlap"]),"text-overlap":new Ki(re.layout_symbol["text-overlap"]),"text-ignore-placement":new Ki(re.layout_symbol["text-ignore-placement"]),"text-optional":new Ki(re.layout_symbol["text-optional"])})}};class rp{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:nt,this.defaultValue=D}evaluate(D){if(D.formattedSection){let K=this.defaultValue.property.overrides;if(K&&K.hasOverride(D.formattedSection))return K.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}un("FormatSectionOverride",rp,{omit:["defaultValue"]});class Bv extends ae{constructor(D){super(D,Qp)}recalculate(D,K){if(super.recalculate(D,K),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let fe=this.layout.get("text-writing-mode");if(fe){let Me=[];for(let Ue of fe)Me.indexOf(Ue)<0&&Me.push(Ue);this.layout._values["text-writing-mode"]=Me}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,K,fe,Me){let Ue=this.layout.get(D).evaluate(K,{},fe,Me),Ge=this._unevaluatedLayout._values[D];return Ge.isDataDriven()||qu(Ge.value)||!Ue?Ue:(function(st,Tt){return Tt.replace(/{([^{}]+)}/g,(Ft,tr)=>st&&tr in st?String(st[tr]):"")})(K.properties,Ue)}createBucket(D){return new sd(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let D of Qp.paint.overridableProperties){if(!Bv.hasPaintOverride(this.layout,D))continue;let K=this.paint.get(D),fe=new rp(K),Me=new Jl(fe,K.property.specification),Ue=null;Ue=K.value.kind==="constant"||K.value.kind==="source"?new Du("source",Me):new Nl("composite",Me,K.value.zoomStops),this.paint._values[D]=new Hl(K.property,Ue,K.parameters)}}_handleOverridablePaintPropertyUpdate(D,K,fe){return!(!this.layout||K.isDataDriven()||fe.isDataDriven())&&Bv.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,K){let fe=D.get("text-field"),Me=Qp.paint.properties[K],Ue=!1,Ge=st=>{for(let Tt of st)if(Me.overrides&&Me.overrides.hasOverride(Tt))return void(Ue=!0)};if(fe.value.kind==="constant"&&fe.value.value instanceof Jr)Ge(fe.value.value.sections);else if(fe.value.kind==="source"){let st=Ft=>{Ue||(Ft instanceof Kn&&Ma(Ft.value)===Or?Ge(Ft.value.sections):Ft instanceof Jo?Ge(Ft.sections):Ft.eachChild(st))},Tt=fe.value;Tt._styleExpression&&st(Tt._styleExpression.expression)}return Ue}}let Xg;var ap={get paint(){return Xg=Xg||new Be({"background-color":new Ki(re.paint_background["background-color"]),"background-pattern":new Eu(re.paint_background["background-pattern"]),"background-opacity":new Ki(re.paint_background["background-opacity"])})}};class xx extends ae{constructor(D){super(D,ap)}}let fm;var Zg={get paint(){return fm=fm||new Be({"raster-opacity":new Ki(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ki(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ki(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ki(re.paint_raster["raster-brightness-max"]),"raster-saturation":new Ki(re.paint_raster["raster-saturation"]),"raster-contrast":new Ki(re.paint_raster["raster-contrast"]),"raster-resampling":new Ki(re.paint_raster["raster-resampling"]),"raster-fade-duration":new Ki(re.paint_raster["raster-fade-duration"])})}};class np extends ae{constructor(D){super(D,Zg)}}class hm extends ae{constructor(D){super(D,{}),this.onAdd=K=>{this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},this.onRemove=K=>{this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class vm{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let dm=63710088e-1;class tv{constructor(D,K){if(isNaN(D)||isNaN(K))throw new Error(`Invalid LngLat object: (${D}, ${K})`);if(this.lng=+D,this.lat=+K,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new tv(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){let K=Math.PI/180,fe=this.lat*K,Me=D.lat*K,Ue=Math.sin(fe)*Math.sin(Me)+Math.cos(fe)*Math.cos(Me)*Math.cos((D.lng-this.lng)*K);return dm*Math.acos(Math.min(Ue,1))}static convert(D){if(D instanceof tv)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new tv(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new tv(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let ld=2*Math.PI*dm;function Yg(H){return ld*Math.cos(H*Math.PI/180)}function e0(H){return(180+H)/360}function Kg(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function t0(H,D){return H/Yg(D)}function ip(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class op{constructor(D,K,fe=0){this.x=+D,this.y=+K,this.z=+fe}static fromLngLat(D,K=0){let fe=tv.convert(D);return new op(e0(fe.lng),Kg(fe.lat),t0(K,fe.lat))}toLngLat(){return new tv(360*this.x-180,ip(this.y))}toAltitude(){return this.z*Yg(ip(this.y))}meterInMercatorCoordinateUnits(){return 1/ld*(D=ip(this.y),1/Math.cos(D*Math.PI/180));var D}}function Eh(H,D,K){var fe=2*Math.PI*6378137/256/Math.pow(2,K);return[H*fe-2*Math.PI*6378137/2,D*fe-2*Math.PI*6378137/2]}class pm{constructor(D,K,fe){if(!(function(Me,Ue,Ge){return!(Me<0||Me>25||Ge<0||Ge>=Math.pow(2,Me)||Ue<0||Ue>=Math.pow(2,Me))})(D,K,fe))throw new Error(`x=${K}, y=${fe}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=K,this.y=fe,this.key=sp(0,D,D,K,fe)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,K,fe){let Me=(Ge=this.y,st=this.z,Tt=Eh(256*(Ue=this.x),256*(Ge=Math.pow(2,st)-Ge-1),st),Ft=Eh(256*(Ue+1),256*(Ge+1),st),Tt[0]+","+Tt[1]+","+Ft[0]+","+Ft[1]);var Ue,Ge,st,Tt,Ft;let tr=(function(xr,Ir,Ur){let ea,sa="";for(let Da=xr;Da>0;Da--)ea=1<1?"@2x":"").replace(/{quadkey}/g,tr).replace(/{bbox-epsg-3857}/g,Me)}isChildOf(D){let K=this.z-D.z;return K>0&&D.x===this.x>>K&&D.y===this.y>>K}getTilePoint(D){let K=Math.pow(2,this.z);return new i((D.x*K-this.x)*$i,(D.y*K-this.y)*$i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Jg{constructor(D,K){this.wrap=D,this.canonical=K,this.key=sp(D,K.z,K.z,K.x,K.y)}}class yh{constructor(D,K,fe,Me,Ue){if(D= z; overscaledZ = ${D}; z = ${fe}`);this.overscaledZ=D,this.wrap=K,this.canonical=new pm(fe,+Me,+Ue),this.key=sp(K,D,fe,Me,Ue)}clone(){return new yh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let K=this.canonical.z-D;return D>this.canonical.z?new yh(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new yh(D,this.wrap,D,this.canonical.x>>K,this.canonical.y>>K)}calculateScaledKey(D,K){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let fe=this.canonical.z-D;return D>this.canonical.z?sp(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):sp(this.wrap*+K,D,D,this.canonical.x>>fe,this.canonical.y>>fe)}isChildOf(D){if(D.wrap!==this.wrap)return!1;let K=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>K&&D.canonical.y===this.canonical.y>>K}children(D){if(this.overscaledZ>=D)return[new yh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let K=this.canonical.z+1,fe=2*this.canonical.x,Me=2*this.canonical.y;return[new yh(K,this.wrap,K,fe,Me),new yh(K,this.wrap,K,fe+1,Me),new yh(K,this.wrap,K,fe,Me+1),new yh(K,this.wrap,K,fe+1,Me+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=xr),xr=this.dim+1||K<-1||K>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(K+1)*this.stride+(D+1)}unpack(D,K,fe){return D*this.redFactor+K*this.greenFactor+fe*this.blueFactor-this.baseShift}getPixels(){return new Tn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,K,fe){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Me=K*this.dim,Ue=K*this.dim+this.dim,Ge=fe*this.dim,st=fe*this.dim+this.dim;switch(K){case-1:Me=Ue-1;break;case 1:Ue=Me+1}switch(fe){case-1:Ge=st-1;break;case 1:st=Ge+1}let Tt=-K*this.dim,Ft=-fe*this.dim;for(let tr=Ge;tr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class mm{constructor(D,K,fe,Me,Ue){this.type="Feature",this._vectorTileFeature=D,D._z=K,D._x=fe,D._y=Me,this.properties=D.properties,this.id=Ue}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){let D={geometry:this.geometry};for(let K in this)K!=="_geometry"&&K!=="_vectorTileFeature"&&(D[K]=this[K]);return D}}class Nv{constructor(D,K){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new Sn($i,16,0),this.grid3D=new Sn($i,16,0),this.featureIndexArray=new Ls,this.promoteId=K}insert(D,K,fe,Me,Ue,Ge){let st=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(fe,Me,Ue);let Tt=Ge?this.grid3D:this.grid;for(let Ft=0;Ft=0&&xr[3]>=0&&Tt.insert(st,xr[0],xr[1],xr[2],xr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Hr.VectorTile(new nm(this.rawTileData)).layers,this.sourceLayerCoder=new Qg(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,K,fe,Me){this.loadVTLayers();let Ue=D.params||{},Ge=$i/D.tileSize/D.scale,st=Gu(Ue.filter),Tt=D.queryGeometry,Ft=D.queryPadding*Ge,tr=ty(Tt),xr=this.grid.query(tr.minX-Ft,tr.minY-Ft,tr.maxX+Ft,tr.maxY+Ft),Ir=ty(D.cameraQueryGeometry),Ur=this.grid3D.query(Ir.minX-Ft,Ir.minY-Ft,Ir.maxX+Ft,Ir.maxY+Ft,(Da,qa,Fn,cn)=>(function(Rn,Hn,ki,po,$o){for(let Ti of Rn)if(Hn<=Ti.x&&ki<=Ti.y&&po>=Ti.x&&$o>=Ti.y)return!0;let to=[new i(Hn,ki),new i(Hn,$o),new i(po,$o),new i(po,ki)];if(Rn.length>2){for(let Ti of to)if(dn(Rn,Ti))return!0}for(let Ti=0;Ti(cn||(cn=$s(Rn)),Hn.queryIntersectsFeature(Tt,Rn,ki,cn,this.z,D.transform,Ge,D.pixelPosMatrix)))}return ea}loadMatchingFeature(D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr){let Ir=this.bucketLayerIDs[K];if(Ge&&!(function(Da,qa){for(let Fn=0;Fn=0)return!0;return!1})(Ge,Ir))return;let Ur=this.sourceLayerCoder.decode(fe),ea=this.vtLayers[Ur].feature(Me);if(Ue.needGeometry){let Da=ml(ea,!0);if(!Ue.filter(new us(this.tileID.overscaledZ),Da,this.tileID.canonical))return}else if(!Ue.filter(new us(this.tileID.overscaledZ),ea))return;let sa=this.getId(ea,Ur);for(let Da=0;Da{let st=D instanceof Ou?D.get(Ge):null;return st&&st.evaluate?st.evaluate(K,fe,Me):st})}function ty(H){let D=1/0,K=1/0,fe=-1/0,Me=-1/0;for(let Ue of H)D=Math.min(D,Ue.x),K=Math.min(K,Ue.y),fe=Math.max(fe,Ue.x),Me=Math.max(Me,Ue.y);return{minX:D,minY:K,maxX:fe,maxY:Me}}function bx(H,D){return D-H}function ry(H,D,K,fe,Me){let Ue=[];for(let Ge=0;Ge=fe&&xr.x>=fe||(tr.x>=fe?tr=new i(fe,tr.y+(fe-tr.x)/(xr.x-tr.x)*(xr.y-tr.y))._round():xr.x>=fe&&(xr=new i(fe,tr.y+(fe-tr.x)/(xr.x-tr.x)*(xr.y-tr.y))._round()),tr.y>=Me&&xr.y>=Me||(tr.y>=Me?tr=new i(tr.x+(Me-tr.y)/(xr.y-tr.y)*(xr.x-tr.x),Me)._round():xr.y>=Me&&(xr=new i(tr.x+(Me-tr.y)/(xr.y-tr.y)*(xr.x-tr.x),Me)._round()),Tt&&tr.equals(Tt[Tt.length-1])||(Tt=[tr],Ue.push(Tt)),Tt.push(xr)))))}}return Ue}un("FeatureIndex",Nv,{omit:["rawTileData","sourceLayerCoder"]});class rv extends i{constructor(D,K,fe,Me){super(D,K),this.angle=fe,Me!==void 0&&(this.segment=Me)}clone(){return new rv(this.x,this.y,this.angle,this.segment)}}function gm(H,D,K,fe,Me){if(D.segment===void 0||K===0)return!0;let Ue=D,Ge=D.segment+1,st=0;for(;st>-K/2;){if(Ge--,Ge<0)return!1;st-=H[Ge].dist(Ue),Ue=H[Ge]}st+=H[Ge].dist(H[Ge+1]),Ge++;let Tt=[],Ft=0;for(;stfe;)Ft-=Tt.shift().angleDelta;if(Ft>Me)return!1;Ge++,st+=tr.dist(xr)}return!0}function ay(H){let D=0;for(let K=0;KFt){let ea=(Ft-Tt)/Ur,sa=Pi.number(xr.x,Ir.x,ea),Da=Pi.number(xr.y,Ir.y,ea),qa=new rv(sa,Da,Ir.angleTo(xr),tr);return qa._round(),!Ge||gm(H,qa,st,Ge,D)?qa:void 0}Tt+=Ur}}function Tx(H,D,K,fe,Me,Ue,Ge,st,Tt){let Ft=ny(fe,Ue,Ge),tr=iy(fe,Me),xr=tr*Ge,Ir=H[0].x===0||H[0].x===Tt||H[0].y===0||H[0].y===Tt;return D-xr=0&&Rn=0&&Hn=0&&Ir+Ft<=tr){let ki=new rv(Rn,Hn,Fn,ea);ki._round(),fe&&!gm(H,ki,Ue,fe,Me)||Ur.push(ki)}}xr+=qa}return st||Ur.length||Ge||(Ur=oy(H,xr/2,K,fe,Me,Ue,Ge,!0,Tt)),Ur}un("Anchor",rv);let ud=Pf;function sy(H,D,K,fe){let Me=[],Ue=H.image,Ge=Ue.pixelRatio,st=Ue.paddedRect.w-2*ud,Tt=Ue.paddedRect.h-2*ud,Ft={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom},tr=Ue.stretchX||[[0,st]],xr=Ue.stretchY||[[0,Tt]],Ir=(fi,Ho)=>fi+Ho[1]-Ho[0],Ur=tr.reduce(Ir,0),ea=xr.reduce(Ir,0),sa=st-Ur,Da=Tt-ea,qa=0,Fn=Ur,cn=0,Rn=ea,Hn=0,ki=sa,po=0,$o=Da;if(Ue.content&&fe){let fi=Ue.content,Ho=fi[2]-fi[0],To=fi[3]-fi[1];(Ue.textFitWidth||Ue.textFitHeight)&&(Ft=Gg(H)),qa=av(tr,0,fi[0]),cn=av(xr,0,fi[1]),Fn=av(tr,fi[0],fi[2]),Rn=av(xr,fi[1],fi[3]),Hn=fi[0]-qa,po=fi[1]-cn,ki=Ho-Fn,$o=To-Rn}let to=Ft.x1,Ti=Ft.y1,No=Ft.x2-to,So=Ft.y2-Ti,wo=(fi,Ho,To,ss)=>{let mu=r0(fi.stretch-qa,Fn,No,to),su=cd(fi.fixed-Hn,ki,fi.stretch,Ur),ef=r0(Ho.stretch-cn,Rn,So,Ti),_h=cd(Ho.fixed-po,$o,Ho.stretch,ea),wf=r0(To.stretch-qa,Fn,No,to),tf=cd(To.fixed-Hn,ki,To.stretch,Ur),Vf=r0(ss.stretch-cn,Rn,So,Ti),qf=cd(ss.fixed-po,$o,ss.stretch,ea),Gf=new i(mu,ef),xc=new i(wf,ef),rf=new i(wf,Vf),If=new i(mu,Vf),Tf=new i(su/Ge,_h/Ge),cf=new i(tf/Ge,qf/Ge),Sc=D*Math.PI/180;if(Sc){let Dl=Math.sin(Sc),Lu=Math.cos(Sc),gu=[Lu,-Dl,Dl,Lu];Gf._matMult(gu),xc._matMult(gu),If._matMult(gu),rf._matMult(gu)}let dh=fi.stretch+fi.fixed,Kf=Ho.stretch+Ho.fixed;return{tl:Gf,tr:xc,bl:If,br:rf,tex:{x:Ue.paddedRect.x+ud+dh,y:Ue.paddedRect.y+ud+Kf,w:To.stretch+To.fixed-dh,h:ss.stretch+ss.fixed-Kf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tf,pixelOffsetBR:cf,minFontScaleX:ki/Ge/No,minFontScaleY:$o/Ge/So,isSDF:K}};if(fe&&(Ue.stretchX||Ue.stretchY)){let fi=ly(tr,sa,Ur),Ho=ly(xr,Da,ea);for(let To=0;To0&&(sa=Math.max(10,sa),this.circleDiameter=sa)}else{let Ir=!((xr=Ge.image)===null||xr===void 0)&&xr.content&&(Ge.image.textFitWidth||Ge.image.textFitHeight)?Gg(Ge):{x1:Ge.left,y1:Ge.top,x2:Ge.right,y2:Ge.bottom};Ir.y1=Ir.y1*st-Tt[0],Ir.y2=Ir.y2*st+Tt[2],Ir.x1=Ir.x1*st-Tt[3],Ir.x2=Ir.x2*st+Tt[1];let Ur=Ge.collisionPadding;if(Ur&&(Ir.x1-=Ur[0]*st,Ir.y1-=Ur[1]*st,Ir.x2+=Ur[2]*st,Ir.y2+=Ur[3]*st),tr){let ea=new i(Ir.x1,Ir.y1),sa=new i(Ir.x2,Ir.y1),Da=new i(Ir.x1,Ir.y2),qa=new i(Ir.x2,Ir.y2),Fn=tr*Math.PI/180;ea._rotate(Fn),sa._rotate(Fn),Da._rotate(Fn),qa._rotate(Fn),Ir.x1=Math.min(ea.x,sa.x,Da.x,qa.x),Ir.x2=Math.max(ea.x,sa.x,Da.x,qa.x),Ir.y1=Math.min(ea.y,sa.y,Da.y,qa.y),Ir.y2=Math.max(ea.y,sa.y,Da.y,qa.y)}D.emplaceBack(K.x,K.y,Ir.x1,Ir.y1,Ir.x2,Ir.y2,fe,Me,Ue)}this.boxEndIndex=D.length}}class Ih{constructor(D=[],K=(fe,Me)=>feMe?1:0){if(this.data=D,this.length=this.data.length,this.compare=K,this.length>0)for(let fe=(this.length>>1)-1;fe>=0;fe--)this._down(fe)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;let D=this.data[0],K=this.data.pop();return--this.length>0&&(this.data[0]=K,this._down(0)),D}peek(){return this.data[0]}_up(D){let{data:K,compare:fe}=this,Me=K[D];for(;D>0;){let Ue=D-1>>1,Ge=K[Ue];if(fe(Me,Ge)>=0)break;K[D]=Ge,D=Ue}K[D]=Me}_down(D){let{data:K,compare:fe}=this,Me=this.length>>1,Ue=K[D];for(;D=0)break;K[D]=K[Ge],D=Ge}K[D]=Ue}}function Ax(H,D=1,K=!1){let fe=1/0,Me=1/0,Ue=-1/0,Ge=-1/0,st=H[0];for(let Ur=0;UrUe)&&(Ue=ea.x),(!Ur||ea.y>Ge)&&(Ge=ea.y)}let Tt=Math.min(Ue-fe,Ge-Me),Ft=Tt/2,tr=new Ih([],Sx);if(Tt===0)return new i(fe,Me);for(let Ur=fe;Urxr.d||!xr.d)&&(xr=Ur,K&&console.log("found best %d after %d probes",Math.round(1e4*Ur.d)/1e4,Ir)),Ur.max-xr.d<=D||(Ft=Ur.h/2,tr.push(new fd(Ur.p.x-Ft,Ur.p.y-Ft,Ft,H)),tr.push(new fd(Ur.p.x+Ft,Ur.p.y-Ft,Ft,H)),tr.push(new fd(Ur.p.x-Ft,Ur.p.y+Ft,Ft,H)),tr.push(new fd(Ur.p.x+Ft,Ur.p.y+Ft,Ft,H)),Ir+=4)}return K&&(console.log(`num probes: ${Ir}`),console.log(`best distance: ${xr.d}`)),xr.p}function Sx(H,D){return D.max-H.max}function fd(H,D,K,fe){this.p=new i(H,D),this.h=K,this.d=(function(Me,Ue){let Ge=!1,st=1/0;for(let Tt=0;TtMe.y!=ea.y>Me.y&&Me.x<(ea.x-Ur.x)*(Me.y-Ur.y)/(ea.y-Ur.y)+Ur.x&&(Ge=!Ge),st=Math.min(st,ha(Me,Ur,ea))}}return(Ge?1:-1)*Math.sqrt(st)})(this.p,fe),this.max=this.d+this.h*Math.SQRT2}var bf;e.aq=void 0,(bf=e.aq||(e.aq={}))[bf.center=1]="center",bf[bf.left=2]="left",bf[bf.right=3]="right",bf[bf.top=4]="top",bf[bf.bottom=5]="bottom",bf[bf["top-left"]=6]="top-left",bf[bf["top-right"]=7]="top-right",bf[bf["bottom-left"]=8]="bottom-left",bf[bf["bottom-right"]=9]="bottom-right";let Av=7,Uv=Number.POSITIVE_INFINITY;function ym(H,D){return D[1]!==Uv?(function(K,fe,Me){let Ue=0,Ge=0;switch(fe=Math.abs(fe),Me=Math.abs(Me),K){case"top-right":case"top-left":case"top":Ge=Me-Av;break;case"bottom-right":case"bottom-left":case"bottom":Ge=-Me+Av}switch(K){case"top-right":case"bottom-right":case"right":Ue=-fe;break;case"top-left":case"bottom-left":case"left":Ue=fe}return[Ue,Ge]})(H,D[0],D[1]):(function(K,fe){let Me=0,Ue=0;fe<0&&(fe=0);let Ge=fe/Math.SQRT2;switch(K){case"top-right":case"top-left":Ue=Ge-Av;break;case"bottom-right":case"bottom-left":Ue=-Ge+Av;break;case"bottom":Ue=-fe+Av;break;case"top":Ue=fe-Av}switch(K){case"top-right":case"bottom-right":Me=-Ge;break;case"top-left":case"bottom-left":Me=Ge;break;case"left":Me=fe;break;case"right":Me=-fe}return[Me,Ue]})(H,D[0])}function uy(H,D,K){var fe;let Me=H.layout,Ue=(fe=Me.get("text-variable-anchor-offset"))===null||fe===void 0?void 0:fe.evaluate(D,{},K);if(Ue){let st=Ue.values,Tt=[];for(let Ft=0;FtIr*Rl);tr.startsWith("top")?xr[1]-=Av:tr.startsWith("bottom")&&(xr[1]+=Av),Tt[Ft+1]=xr}return new Ga(Tt)}let Ge=Me.get("text-variable-anchor");if(Ge){let st;st=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Me.get("text-radial-offset").evaluate(D,{},K)*Rl,Uv]:Me.get("text-offset").evaluate(D,{},K).map(Ft=>Ft*Rl);let Tt=[];for(let Ft of Ge)Tt.push(Ft,ym(Ft,st));return new Ga(Tt)}return null}function _m(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Mx(H,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr){let xr=Ue.textMaxSize.evaluate(D,{});xr===void 0&&(xr=Ge);let Ir=H.layers[0].layout,Ur=Ir.get("icon-offset").evaluate(D,{},tr),ea=fy(K.horizontal),sa=Ge/24,Da=H.tilePixelRatio*sa,qa=H.tilePixelRatio*xr/24,Fn=H.tilePixelRatio*st,cn=H.tilePixelRatio*Ir.get("symbol-spacing"),Rn=Ir.get("text-padding")*H.tilePixelRatio,Hn=(function(fi,Ho,To,ss=1){let mu=fi.get("icon-padding").evaluate(Ho,{},To),su=mu&&mu.values;return[su[0]*ss,su[1]*ss,su[2]*ss,su[3]*ss]})(Ir,D,tr,H.tilePixelRatio),ki=Ir.get("text-max-angle")/180*Math.PI,po=Ir.get("text-rotation-alignment")!=="viewport"&&Ir.get("symbol-placement")!=="point",$o=Ir.get("icon-rotation-alignment")==="map"&&Ir.get("symbol-placement")!=="point",to=Ir.get("symbol-placement"),Ti=cn/2,No=Ir.get("icon-text-fit"),So;fe&&No!=="none"&&(H.allowVerticalPlacement&&K.vertical&&(So=Hg(fe,K.vertical,No,Ir.get("icon-text-fit-padding"),Ur,sa)),ea&&(fe=Hg(fe,ea,No,Ir.get("icon-text-fit-padding"),Ur,sa)));let wo=(fi,Ho)=>{Ho.x<0||Ho.x>=$i||Ho.y<0||Ho.y>=$i||(function(To,ss,mu,su,ef,_h,wf,tf,Vf,qf,Gf,xc,rf,If,Tf,cf,Sc,dh,Kf,Dl,Lu,gu,ph,uc,hd){let Uh=To.addToLineVertexArray(ss,mu),Rh,xh,$u,zc,bh=0,nv=0,Jf=0,vd=0,Am=-1,o0=-1,jh={},jv=Za("");if(To.allowVerticalPlacement&&su.vertical){let Rf=tf.layout.get("text-rotate").evaluate(Lu,{},uc)+90;$u=new Tv(Vf,ss,qf,Gf,xc,su.vertical,rf,If,Tf,Rf),wf&&(zc=new Tv(Vf,ss,qf,Gf,xc,wf,Sc,dh,Tf,Rf))}if(ef){let Rf=tf.layout.get("icon-rotate").evaluate(Lu,{}),wh=tf.layout.get("icon-text-fit")!=="none",Sv=sy(ef,Rf,ph,wh),Hf=wf?sy(wf,Rf,ph,wh):void 0;xh=new Tv(Vf,ss,qf,Gf,xc,ef,Sc,dh,!1,Rf),bh=4*Sv.length;let Df=To.iconSizeData,Ch=null;Df.kind==="source"?(Ch=[Nh*tf.layout.get("icon-size").evaluate(Lu,{})],Ch[0]>bv&&f(`${To.layerIds[0]}: Value for "icon-size" is >= ${ep}. Reduce your "icon-size".`)):Df.kind==="composite"&&(Ch=[Nh*gu.compositeIconSizes[0].evaluate(Lu,{},uc),Nh*gu.compositeIconSizes[1].evaluate(Lu,{},uc)],(Ch[0]>bv||Ch[1]>bv)&&f(`${To.layerIds[0]}: Value for "icon-size" is >= ${ep}. Reduce your "icon-size".`)),To.addSymbols(To.icon,Sv,Ch,Dl,Kf,Lu,e.ah.none,ss,Uh.lineStartIndex,Uh.lineLength,-1,uc),Am=To.icon.placedSymbolArray.length-1,Hf&&(nv=4*Hf.length,To.addSymbols(To.icon,Hf,Ch,Dl,Kf,Lu,e.ah.vertical,ss,Uh.lineStartIndex,Uh.lineLength,-1,uc),o0=To.icon.placedSymbolArray.length-1)}let ff=Object.keys(su.horizontal);for(let Rf of ff){let wh=su.horizontal[Rf];if(!Rh){jv=Za(wh.text);let Hf=tf.layout.get("text-rotate").evaluate(Lu,{},uc);Rh=new Tv(Vf,ss,qf,Gf,xc,wh,rf,If,Tf,Hf)}let Sv=wh.positionedLines.length===1;if(Jf+=cy(To,ss,wh,_h,tf,Tf,Lu,cf,Uh,su.vertical?e.ah.horizontal:e.ah.horizontalOnly,Sv?ff:[Rf],jh,Am,gu,uc),Sv)break}su.vertical&&(vd+=cy(To,ss,su.vertical,_h,tf,Tf,Lu,cf,Uh,e.ah.vertical,["vertical"],jh,o0,gu,uc));let Cx=Rh?Rh.boxStartIndex:To.collisionBoxArray.length,s0=Rh?Rh.boxEndIndex:To.collisionBoxArray.length,Vh=$u?$u.boxStartIndex:To.collisionBoxArray.length,$f=$u?$u.boxEndIndex:To.collisionBoxArray.length,py=xh?xh.boxStartIndex:To.collisionBoxArray.length,Lx=xh?xh.boxEndIndex:To.collisionBoxArray.length,my=zc?zc.boxStartIndex:To.collisionBoxArray.length,Px=zc?zc.boxEndIndex:To.collisionBoxArray.length,kh=-1,cp=(Rf,wh)=>Rf&&Rf.circleDiameter?Math.max(Rf.circleDiameter,wh):wh;kh=cp(Rh,kh),kh=cp($u,kh),kh=cp(xh,kh),kh=cp(zc,kh);let l0=kh>-1?1:0;l0&&(kh*=hd/Rl),To.glyphOffsetArray.length>=sd.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Lu.sortKey!==void 0&&To.addToSortKeyRanges(To.symbolInstances.length,Lu.sortKey);let Sm=uy(tf,Lu,uc),[Ix,Rx]=(function(Rf,wh){let Sv=Rf.length,Hf=wh?.values;if(Hf?.length>0)for(let Df=0;Df=0?jh.right:-1,jh.center>=0?jh.center:-1,jh.left>=0?jh.left:-1,jh.vertical||-1,Am,o0,jv,Cx,s0,Vh,$f,py,Lx,my,Px,qf,Jf,vd,bh,nv,l0,0,rf,kh,Ix,Rx)})(H,Ho,fi,K,fe,Me,So,H.layers[0],H.collisionBoxArray,D.index,D.sourceLayerIndex,H.index,Da,[Rn,Rn,Rn,Rn],po,Tt,Fn,Hn,$o,Ur,D,Ue,Ft,tr,Ge)};if(to==="line")for(let fi of ry(D.geometry,0,0,$i,$i)){let Ho=Tx(fi,cn,ki,K.vertical||ea,fe,24,qa,H.overscaling,$i);for(let To of Ho)ea&&Ex(H,ea.text,Ti,To)||wo(fi,To)}else if(to==="line-center"){for(let fi of D.geometry)if(fi.length>1){let Ho=wx(fi,ki,K.vertical||ea,fe,24,qa);Ho&&wo(fi,Ho)}}else if(D.type==="Polygon")for(let fi of wu(D.geometry,0)){let Ho=Ax(fi,16);wo(fi[0],new rv(Ho.x,Ho.y,0))}else if(D.type==="LineString")for(let fi of D.geometry)wo(fi,new rv(fi[0].x,fi[0].y,0));else if(D.type==="Point")for(let fi of D.geometry)for(let Ho of fi)wo([Ho],new rv(Ho.x,Ho.y,0))}function cy(H,D,K,fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea){let sa=(function(Fn,cn,Rn,Hn,ki,po,$o,to){let Ti=Hn.layout.get("text-rotate").evaluate(po,{})*Math.PI/180,No=[];for(let So of cn.positionedLines)for(let wo of So.positionedGlyphs){if(!wo.rect)continue;let fi=wo.rect||{},Ho=Ug+1,To=!0,ss=1,mu=0,su=(ki||to)&&wo.vertical,ef=wo.metrics.advance*wo.scale/2;if(to&&cn.verticalizable&&(mu=So.lineOffset/2-(wo.imageName?-(Rl-wo.metrics.width*wo.scale)/2:(wo.scale-1)*Rl)),wo.imageName){let Dl=$o[wo.imageName];To=Dl.sdf,ss=Dl.pixelRatio,Ho=Pf/ss}let _h=ki?[wo.x+ef,wo.y]:[0,0],wf=ki?[0,0]:[wo.x+ef+Rn[0],wo.y+Rn[1]-mu],tf=[0,0];su&&(tf=wf,wf=[0,0]);let Vf=wo.metrics.isDoubleResolution?2:1,qf=(wo.metrics.left-Ho)*wo.scale-ef+wf[0],Gf=(-wo.metrics.top-Ho)*wo.scale+wf[1],xc=qf+fi.w/Vf*wo.scale/ss,rf=Gf+fi.h/Vf*wo.scale/ss,If=new i(qf,Gf),Tf=new i(xc,Gf),cf=new i(qf,rf),Sc=new i(xc,rf);if(su){let Dl=new i(-ef,ef-Qc),Lu=-Math.PI/2,gu=Rl/2-ef,ph=new i(5-Qc-gu,-(wo.imageName?gu:0)),uc=new i(...tf);If._rotateAround(Lu,Dl)._add(ph)._add(uc),Tf._rotateAround(Lu,Dl)._add(ph)._add(uc),cf._rotateAround(Lu,Dl)._add(ph)._add(uc),Sc._rotateAround(Lu,Dl)._add(ph)._add(uc)}if(Ti){let Dl=Math.sin(Ti),Lu=Math.cos(Ti),gu=[Lu,-Dl,Dl,Lu];If._matMult(gu),Tf._matMult(gu),cf._matMult(gu),Sc._matMult(gu)}let dh=new i(0,0),Kf=new i(0,0);No.push({tl:If,tr:Tf,bl:cf,br:Sc,tex:fi,writingMode:cn.writingMode,glyphOffset:_h,sectionIndex:wo.sectionIndex,isSDF:To,pixelOffsetTL:dh,pixelOffsetBR:Kf,minFontScaleX:0,minFontScaleY:0})}return No})(0,K,st,Me,Ue,Ge,fe,H.allowVerticalPlacement),Da=H.textSizeData,qa=null;Da.kind==="source"?(qa=[Nh*Me.layout.get("text-size").evaluate(Ge,{})],qa[0]>bv&&f(`${H.layerIds[0]}: Value for "text-size" is >= ${ep}. Reduce your "text-size".`)):Da.kind==="composite"&&(qa=[Nh*Ur.compositeTextSizes[0].evaluate(Ge,{},ea),Nh*Ur.compositeTextSizes[1].evaluate(Ge,{},ea)],(qa[0]>bv||qa[1]>bv)&&f(`${H.layerIds[0]}: Value for "text-size" is >= ${ep}. Reduce your "text-size".`)),H.addSymbols(H.text,sa,qa,st,Ue,Ge,Ft,D,Tt.lineStartIndex,Tt.lineLength,Ir,ea);for(let Fn of tr)xr[Fn]=H.text.placedSymbolArray.length-1;return 4*sa.length}function fy(H){for(let D in H)return H[D];return null}function Ex(H,D,K,fe){let Me=H.compareText;if(D in Me){let Ue=Me[D];for(let Ge=Ue.length-1;Ge>=0;Ge--)if(fe.dist(Ue[Ge])>4;if(Me!==1)throw new Error(`Got v${Me} data when expected v1.`);let Ue=hy[15&fe];if(!Ue)throw new Error("Unrecognized array type.");let[Ge]=new Uint16Array(D,2,1),[st]=new Uint32Array(D,4,1);return new xm(st,Ge,Ue,D)}constructor(D,K=64,fe=Float64Array,Me){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+K,2),65535),this.ArrayType=fe,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;let Ue=hy.indexOf(this.ArrayType),Ge=2*D*this.ArrayType.BYTES_PER_ELEMENT,st=D*this.IndexArrayType.BYTES_PER_ELEMENT,Tt=(8-st%8)%8;if(Ue<0)throw new Error(`Unexpected typed array class: ${fe}.`);Me&&Me instanceof ArrayBuffer?(this.data=Me,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+st+Tt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Ge+st+Tt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+st+Tt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ue]),new Uint16Array(this.data,2,1)[0]=K,new Uint32Array(this.data,4,1)[0]=D)}add(D,K){let fe=this._pos>>1;return this.ids[fe]=fe,this.coords[this._pos++]=D,this.coords[this._pos++]=K,fe}finish(){let D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return a0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,K,fe,Me){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Ue,coords:Ge,nodeSize:st}=this,Tt=[0,Ue.length-1,0],Ft=[];for(;Tt.length;){let tr=Tt.pop()||0,xr=Tt.pop()||0,Ir=Tt.pop()||0;if(xr-Ir<=st){for(let Da=Ir;Da<=xr;Da++){let qa=Ge[2*Da],Fn=Ge[2*Da+1];qa>=D&&qa<=fe&&Fn>=K&&Fn<=Me&&Ft.push(Ue[Da])}continue}let Ur=Ir+xr>>1,ea=Ge[2*Ur],sa=Ge[2*Ur+1];ea>=D&&ea<=fe&&sa>=K&&sa<=Me&&Ft.push(Ue[Ur]),(tr===0?D<=ea:K<=sa)&&(Tt.push(Ir),Tt.push(Ur-1),Tt.push(1-tr)),(tr===0?fe>=ea:Me>=sa)&&(Tt.push(Ur+1),Tt.push(xr),Tt.push(1-tr))}return Ft}within(D,K,fe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Me,coords:Ue,nodeSize:Ge}=this,st=[0,Me.length-1,0],Tt=[],Ft=fe*fe;for(;st.length;){let tr=st.pop()||0,xr=st.pop()||0,Ir=st.pop()||0;if(xr-Ir<=Ge){for(let Da=Ir;Da<=xr;Da++)dy(Ue[2*Da],Ue[2*Da+1],D,K)<=Ft&&Tt.push(Me[Da]);continue}let Ur=Ir+xr>>1,ea=Ue[2*Ur],sa=Ue[2*Ur+1];dy(ea,sa,D,K)<=Ft&&Tt.push(Me[Ur]),(tr===0?D-fe<=ea:K-fe<=sa)&&(st.push(Ir),st.push(Ur-1),st.push(1-tr)),(tr===0?D+fe>=ea:K+fe>=sa)&&(st.push(Ur+1),st.push(xr),st.push(1-tr))}return Tt}}function a0(H,D,K,fe,Me,Ue){if(Me-fe<=K)return;let Ge=fe+Me>>1;vy(H,D,Ge,fe,Me,Ue),a0(H,D,K,fe,Ge-1,1-Ue),a0(H,D,K,Ge+1,Me,1-Ue)}function vy(H,D,K,fe,Me,Ue){for(;Me>fe;){if(Me-fe>600){let Ft=Me-fe+1,tr=K-fe+1,xr=Math.log(Ft),Ir=.5*Math.exp(2*xr/3),Ur=.5*Math.sqrt(xr*Ir*(Ft-Ir)/Ft)*(tr-Ft/2<0?-1:1);vy(H,D,K,Math.max(fe,Math.floor(K-tr*Ir/Ft+Ur)),Math.min(Me,Math.floor(K+(Ft-tr)*Ir/Ft+Ur)),Ue)}let Ge=D[2*K+Ue],st=fe,Tt=Me;for(lp(H,D,fe,K),D[2*Me+Ue]>Ge&&lp(H,D,fe,Me);stGe;)Tt--}D[2*fe+Ue]===Ge?lp(H,D,fe,Tt):(Tt++,lp(H,D,Tt,Me)),Tt<=K&&(fe=Tt+1),K<=Tt&&(Me=Tt-1)}}function lp(H,D,K,fe){bm(H,K,fe),bm(D,2*K,2*fe),bm(D,2*K+1,2*fe+1)}function bm(H,D,K){let fe=H[D];H[D]=H[K],H[K]=fe}function dy(H,D,K,fe){let Me=H-K,Ue=D-fe;return Me*Me+Ue*Ue}var n0;e.bg=void 0,(n0=e.bg||(e.bg={})).create="create",n0.load="load",n0.fullLoad="fullLoad";let up=null,Gc=[],wm=1e3/60,Tm="loadTime",i0="fullLoadTime",kx={mark(H){performance.mark(H)},frame(H){let D=H;up!=null&&Gc.push(D-up),up=D},clearMetrics(){up=null,Gc=[],performance.clearMeasures(Tm),performance.clearMeasures(i0);for(let H in e.bg)performance.clearMarks(e.bg[H])},getPerformanceMetrics(){performance.measure(Tm,e.bg.create,e.bg.load),performance.measure(i0,e.bg.create,e.bg.fullLoad);let H=performance.getEntriesByName(Tm)[0].duration,D=performance.getEntriesByName(i0)[0].duration,K=Gc.length,fe=1/(Gc.reduce((Ue,Ge)=>Ue+Ge,0)/K/1e3),Me=Gc.filter(Ue=>Ue>wm).reduce((Ue,Ge)=>Ue+(Ge-wm)/wm,0);return{loadTime:H,fullLoadTime:D,fps:fe,percentDroppedFrames:Me/(K+Me)*100,totalFrames:K}}};e.$=class extends gr{},e.A=Wa,e.B=zn,e.C=function(H){if(z==null){let D=H.navigator?H.navigator.userAgent:null;z=!!H.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Ki,e.E=ee,e.F=class{constructor(H,D){this.target=H,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new vm(()=>this.process()),this.subscription=(function(K,fe,Me,Ue){return K.addEventListener(fe,Me,!1),{unsubscribe:()=>{K.removeEventListener(fe,Me,!1)}}})(this.target,"message",K=>this.receive(K)),this.globalScope=L(self)?H:window}registerMessageHandler(H,D){this.messageHandlers[H]=D}sendAsync(H,D){return new Promise((K,fe)=>{let Me=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Me]={resolve:K,reject:fe},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Me];let st={id:Me,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(st)},{once:!0});let Ue=[],Ge=Object.assign(Object.assign({},H),{id:Me,sourceMapId:this.mapId,origin:location.origin,data:Bi(H.data,Ue)});this.target.postMessage(Ge,{transfer:Ue})})}receive(H){let D=H.data,K=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[K];let fe=this.abortControllers[K];return delete this.abortControllers[K],void(fe&&fe.abort())}if(L(self)||D.mustQueue)return this.tasks[K]=D,this.taskQueue.push(K),void this.invoker.trigger();this.processTask(K,D)}}process(){if(this.taskQueue.length===0)return;let H=this.taskQueue.shift(),D=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(H,D)}processTask(H,D){return t(this,void 0,void 0,function*(){if(D.type===""){let Me=this.resolveRejects[H];return delete this.resolveRejects[H],Me?void(D.error?Me.reject(Yi(D.error)):Me.resolve(Yi(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let K=Yi(D.data),fe=new AbortController;this.abortControllers[H]=fe;try{let Me=yield this.messageHandlers[D.type](D.sourceMapId,K,fe);this.completeTask(H,null,Me)}catch(Me){this.completeTask(H,Me)}})}completeTask(H,D,K){let fe=[];delete this.abortControllers[H];let Me={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Bi(D):null,data:Bi(K,fe)};this.target.postMessage(Me,{transfer:fe})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=se,e.H=function(){var H=new Wa(16);return Wa!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},e.I=Xp,e.J=function(H,D,K){var fe,Me,Ue,Ge,st,Tt,Ft,tr,xr,Ir,Ur,ea,sa=K[0],Da=K[1],qa=K[2];return D===H?(H[12]=D[0]*sa+D[4]*Da+D[8]*qa+D[12],H[13]=D[1]*sa+D[5]*Da+D[9]*qa+D[13],H[14]=D[2]*sa+D[6]*Da+D[10]*qa+D[14],H[15]=D[3]*sa+D[7]*Da+D[11]*qa+D[15]):(Me=D[1],Ue=D[2],Ge=D[3],st=D[4],Tt=D[5],Ft=D[6],tr=D[7],xr=D[8],Ir=D[9],Ur=D[10],ea=D[11],H[0]=fe=D[0],H[1]=Me,H[2]=Ue,H[3]=Ge,H[4]=st,H[5]=Tt,H[6]=Ft,H[7]=tr,H[8]=xr,H[9]=Ir,H[10]=Ur,H[11]=ea,H[12]=fe*sa+st*Da+xr*qa+D[12],H[13]=Me*sa+Tt*Da+Ir*qa+D[13],H[14]=Ue*sa+Ft*Da+Ur*qa+D[14],H[15]=Ge*sa+tr*Da+ea*qa+D[15]),H},e.K=function(H,D,K){var fe=K[0],Me=K[1],Ue=K[2];return H[0]=D[0]*fe,H[1]=D[1]*fe,H[2]=D[2]*fe,H[3]=D[3]*fe,H[4]=D[4]*Me,H[5]=D[5]*Me,H[6]=D[6]*Me,H[7]=D[7]*Me,H[8]=D[8]*Ue,H[9]=D[9]*Ue,H[10]=D[10]*Ue,H[11]=D[11]*Ue,H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15],H},e.L=Fa,e.M=function(H,D){let K={};for(let fe=0;fe{let D=window.document.createElement("video");return D.muted=!0,new Promise(K=>{D.onloadstart=()=>{K(D)};for(let fe of H){let Me=window.document.createElement("source");J(fe)||(D.crossOrigin="Anonymous"),Me.src=fe,D.appendChild(Me)}})},e.a4=function(){return y++},e.a5=Yn,e.a6=sd,e.a7=Gu,e.a8=ml,e.a9=mm,e.aA=function(H){if(H.type==="custom")return new hm(H);switch(H.type){case"background":return new xx(H);case"circle":return new Ba(H);case"fill":return new Vt(H);case"fill-extrusion":return new uh(H);case"heatmap":return new wi(H);case"hillshade":return new Zs(H);case"line":return new Dv(H);case"raster":return new np(H);case"symbol":return new Bv(H)}},e.aB=u,e.aC=function(H,D){if(!H)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Te(H.version,D.version))return[{command:"setStyle",args:[D]}];Te(H.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Te(H.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Te(H.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Te(H.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Te(H.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Te(H.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Te(H.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Te(H.light,D.light)||K.push({command:"setLight",args:[D.light]}),Te(H.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Te(H.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Te(H.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});let fe={},Me=[];(function(Ge,st,Tt,Ft){let tr;for(tr in st=st||{},Ge=Ge||{})Object.prototype.hasOwnProperty.call(Ge,tr)&&(Object.prototype.hasOwnProperty.call(st,tr)||He(tr,Tt,Ft));for(tr in st)Object.prototype.hasOwnProperty.call(st,tr)&&(Object.prototype.hasOwnProperty.call(Ge,tr)?Te(Ge[tr],st[tr])||(Ge[tr].type==="geojson"&&st[tr].type==="geojson"&&rt(Ge,st,tr)?Ie(Tt,{command:"setGeoJSONSourceData",args:[tr,st[tr].data]}):et(tr,st,Tt,Ft)):De(tr,st,Tt))})(H.sources,D.sources,Me,fe);let Ue=[];H.layers&&H.layers.forEach(Ge=>{"source"in Ge&&fe[Ge.source]?K.push({command:"removeLayer",args:[Ge.id]}):Ue.push(Ge)}),K=K.concat(Me),(function(Ge,st,Tt){st=st||[];let Ft=(Ge=Ge||[]).map(ot),tr=st.map(ot),xr=Ge.reduce(Ae,{}),Ir=st.reduce(Ae,{}),Ur=Ft.slice(),ea=Object.create(null),sa,Da,qa,Fn,cn;for(let Rn=0,Hn=0;Rn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,fe,Me,Ue)=>{let Ge=Me||Ue;return D[fe]=!Ge||Ge.toLowerCase(),""}),D["max-age"]){let K=parseInt(D["max-age"],10);isNaN(K)?delete D["max-age"]:D["max-age"]=K}return D},e.ab=function(H,D){let K=[];for(let fe in H)fe in D||K.push(fe);return K},e.ac=w,e.ad=function(H,D,K){var fe=Math.sin(K),Me=Math.cos(K),Ue=D[0],Ge=D[1],st=D[2],Tt=D[3],Ft=D[4],tr=D[5],xr=D[6],Ir=D[7];return D!==H&&(H[8]=D[8],H[9]=D[9],H[10]=D[10],H[11]=D[11],H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15]),H[0]=Ue*Me+Ft*fe,H[1]=Ge*Me+tr*fe,H[2]=st*Me+xr*fe,H[3]=Tt*Me+Ir*fe,H[4]=Ft*Me-Ue*fe,H[5]=tr*Me-Ge*fe,H[6]=xr*Me-st*fe,H[7]=Ir*Me-Tt*fe,H},e.ae=function(H){var D=new Wa(16);return D[0]=H[0],D[1]=H[1],D[2]=H[2],D[3]=H[3],D[4]=H[4],D[5]=H[5],D[6]=H[6],D[7]=H[7],D[8]=H[8],D[9]=H[9],D[10]=H[10],D[11]=H[11],D[12]=H[12],D[13]=H[13],D[14]=H[14],D[15]=H[15],D},e.af=ai,e.ag=function(H,D){let K=0,fe=0;if(H.kind==="constant")fe=H.layoutSize;else if(H.kind!=="source"){let{interpolationType:Me,minZoom:Ue,maxZoom:Ge}=H,st=Me?w(Li.interpolationFactor(Me,D,Ue,Ge),0,1):0;H.kind==="camera"?fe=Pi.number(H.minSize,H.maxSize,st):K=st}return{uSizeT:K,uSize:fe}},e.ai=function(H,{uSize:D,uSizeT:K},{lowerSize:fe,upperSize:Me}){return H.kind==="source"?fe/Nh:H.kind==="composite"?Pi.number(fe/Nh,Me/Nh,K):D},e.aj=lm,e.ak=function(H,D,K,fe){let Me=D.y-H.y,Ue=D.x-H.x,Ge=fe.y-K.y,st=fe.x-K.x,Tt=Ge*Ue-st*Me;if(Tt===0)return null;let Ft=(st*(H.y-K.y)-Ge*(H.x-K.x))/Tt;return new i(H.x+Ft*Ue,H.y+Ft*Me)},e.al=ry,e.am=Bu,e.an=on,e.ao=function(H){let D=1/0,K=1/0,fe=-1/0,Me=-1/0;for(let Ue of H)D=Math.min(D,Ue.x),K=Math.min(K,Ue.y),fe=Math.max(fe,Ue.x),Me=Math.max(Me,Ue.y);return[D,K,fe,Me]},e.ap=Rl,e.ar=sm,e.as=function(H,D){var K=D[0],fe=D[1],Me=D[2],Ue=D[3],Ge=D[4],st=D[5],Tt=D[6],Ft=D[7],tr=D[8],xr=D[9],Ir=D[10],Ur=D[11],ea=D[12],sa=D[13],Da=D[14],qa=D[15],Fn=K*st-fe*Ge,cn=K*Tt-Me*Ge,Rn=K*Ft-Ue*Ge,Hn=fe*Tt-Me*st,ki=fe*Ft-Ue*st,po=Me*Ft-Ue*Tt,$o=tr*sa-xr*ea,to=tr*Da-Ir*ea,Ti=tr*qa-Ur*ea,No=xr*Da-Ir*sa,So=xr*qa-Ur*sa,wo=Ir*qa-Ur*Da,fi=Fn*wo-cn*So+Rn*No+Hn*Ti-ki*to+po*$o;return fi?(H[0]=(st*wo-Tt*So+Ft*No)*(fi=1/fi),H[1]=(Me*So-fe*wo-Ue*No)*fi,H[2]=(sa*po-Da*ki+qa*Hn)*fi,H[3]=(Ir*ki-xr*po-Ur*Hn)*fi,H[4]=(Tt*Ti-Ge*wo-Ft*to)*fi,H[5]=(K*wo-Me*Ti+Ue*to)*fi,H[6]=(Da*Rn-ea*po-qa*cn)*fi,H[7]=(tr*po-Ir*Rn+Ur*cn)*fi,H[8]=(Ge*So-st*Ti+Ft*$o)*fi,H[9]=(fe*Ti-K*So-Ue*$o)*fi,H[10]=(ea*ki-sa*Rn+qa*Fn)*fi,H[11]=(xr*Rn-tr*ki-Ur*Fn)*fi,H[12]=(st*to-Ge*No-Tt*$o)*fi,H[13]=(K*No-fe*to+Me*$o)*fi,H[14]=(sa*cn-ea*Hn-Da*Fn)*fi,H[15]=(tr*Hn-xr*cn+Ir*Fn)*fi,H):null},e.at=_m,e.au=Jp,e.av=xm,e.aw=function(){let H={},D=re.$version;for(let K in re.$root){let fe=re.$root[K];if(fe.required){let Me=null;Me=K==="version"?D:fe.type==="array"?[]:{},Me!=null&&(H[K]=Me)}}return H},e.ax=vi,e.ay=q,e.az=function(H){H=H.slice();let D=Object.create(null);for(let K=0;K25||fe<0||fe>=1||K<0||K>=1)},e.bc=function(H,D){return H[0]=D[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=D[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=D[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},e.bd=class extends Zt{},e.be=dm,e.bf=kx,e.bh=he,e.bi=function(H,D){Q.REGISTERED_PROTOCOLS[H]=D},e.bj=function(H){delete Q.REGISTERED_PROTOCOLS[H]},e.bk=function(H,D){let K={};for(let Me=0;Mewo*Rl)}let to=Ge?"center":K.get("text-justify").evaluate(Ft,{},H.canonical),Ti=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Ft,{},H.canonical)*Rl:1/0,No=()=>{H.bucket.allowVerticalPlacement&&no(Rn)&&(ea.vertical=$d(sa,H.glyphMap,H.glyphPositions,H.imagePositions,tr,Ti,Ue,po,"left",ki,qa,e.ah.vertical,!0,Ir,xr))};if(!Ge&&$o){let So=new Set;if(to==="auto")for(let fi=0;fi<$o.values.length;fi+=2)So.add(_m($o.values[fi]));else So.add(to);let wo=!1;for(let fi of So)if(!ea.horizontal[fi])if(wo)ea.horizontal[fi]=ea.horizontal[0];else{let Ho=$d(sa,H.glyphMap,H.glyphPositions,H.imagePositions,tr,Ti,Ue,"center",fi,ki,qa,e.ah.horizontal,!1,Ir,xr);Ho&&(ea.horizontal[fi]=Ho,wo=Ho.positionedLines.length===1)}No()}else{to==="auto"&&(to=_m(po));let So=$d(sa,H.glyphMap,H.glyphPositions,H.imagePositions,tr,Ti,Ue,po,to,ki,qa,e.ah.horizontal,!1,Ir,xr);So&&(ea.horizontal[to]=So),No(),no(Rn)&&Ge&&st&&(ea.vertical=$d(sa,H.glyphMap,H.glyphPositions,H.imagePositions,tr,Ti,Ue,po,to,ki,qa,e.ah.vertical,!1,Ir,xr))}}let Fn=!1;if(Ft.icon&&Ft.icon.name){let Rn=H.imageMap[Ft.icon.name];Rn&&(Da=Qd(H.imagePositions[Ft.icon.name],K.get("icon-offset").evaluate(Ft,{},H.canonical),K.get("icon-anchor").evaluate(Ft,{},H.canonical)),Fn=!!Rn.sdf,H.bucket.sdfIcons===void 0?H.bucket.sdfIcons=Fn:H.bucket.sdfIcons!==Fn&&f("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Rn.pixelRatio!==H.bucket.pixelRatio||K.get("icon-rotate").constantOr(1)!==0)&&(H.bucket.iconsNeedLinear=!0))}let cn=fy(ea.horizontal)||ea.vertical;H.bucket.iconsInText=!!cn&&cn.iconsInText,(cn||Da)&&Mx(H.bucket,Ft,ea,Da,H.imageMap,Me,Ir,Ur,qa,Fn,H.canonical)}H.showCollisionBoxes&&H.bucket.generateCollisionDebugBuffers()},e.bq=gh,e.br=lr,e.bs=bo,e.bt=Hr,e.bu=nm,e.bv=class{constructor(H){this._marks={start:[H.url,"start"].join("#"),end:[H.url,"end"].join("#"),measure:H.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let H=performance.getEntriesByName(this._marks.measure);return H.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),H=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),H}},e.bw=function(H,D,K,fe,Me){return t(this,void 0,void 0,function*(){if(T())try{return yield O(H,D,K,fe,Me)}catch{}return(function(Ue,Ge,st,Tt,Ft){let tr=Ue.width,xr=Ue.height;I&&N||(I=new OffscreenCanvas(tr,xr),N=I.getContext("2d",{willReadFrequently:!0})),I.width=tr,I.height=xr,N.drawImage(Ue,0,0,tr,xr);let Ir=N.getImageData(Ge,st,Tt,Ft);return N.clearRect(0,0,tr,xr),Ir.data})(H,D,K,fe,Me)})},e.bx=$g,e.by=r,e.bz=o,e.c=W,e.d=H=>t(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));let D=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(D)}catch(K){throw new Error(`Could not load image because of ${K.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=H=>new Promise((D,K)=>{let fe=new Image;fe.onload=()=>{D(fe),URL.revokeObjectURL(fe.src),fe.onload=null,window.requestAnimationFrame(()=>{fe.src=B})},fe.onerror=()=>K(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Me=new Blob([new Uint8Array(H)],{type:"image/png"});fe.src=H.byteLength?URL.createObjectURL(Me):B}),e.g=le,e.h=(H,D)=>$(M(H,{type:"json"}),D),e.i=L,e.j=j,e.k=ne,e.l=(H,D)=>$(M(H,{type:"arrayBuffer"}),D),e.m=$,e.n=function(H){return new nm(H).readFields(d5,[])},e.o=bi,e.p=om,e.q=Be,e.r=xn,e.s=J,e.t=wn,e.u=Qa,e.v=re,e.w=f,e.x=function([H,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:H*Math.cos(D)*Math.sin(K),y:H*Math.sin(D)*Math.sin(K),z:H*Math.cos(K)}},e.y=Pi,e.z=us}),A("worker",["./shared"],function(e){"use strict";class t{constructor(Oe){this.keyCache={},Oe&&this.replace(Oe)}replace(Oe){this._layerConfigs={},this._layers={},this.update(Oe,[])}update(Oe,Xe){for(let Ce of Oe){this._layerConfigs[Ce.id]=Ce;let Ne=this._layers[Ce.id]=e.aA(Ce);Ne._featureFilter=e.a7(Ne.filter),this.keyCache[Ce.id]&&delete this.keyCache[Ce.id]}for(let Ce of Xe)delete this.keyCache[Ce],delete this._layerConfigs[Ce],delete this._layers[Ce];this.familiesBySource={};let be=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let Ce of be){let Ne=Ce.map(gt=>this._layers[gt.id]),Ee=Ne[0];if(Ee.visibility==="none")continue;let Se=Ee.source||"",Le=this.familiesBySource[Se];Le||(Le=this.familiesBySource[Se]={});let at=Ee.sourceLayer||"_geojsonTileLayer",dt=Le[at];dt||(dt=Le[at]=[]),dt.push(Ne)}}}class r{constructor(Oe){let Xe={},be=[];for(let Se in Oe){let Le=Oe[Se],at=Xe[Se]={};for(let dt in Le){let gt=Le[+dt];if(!gt||gt.bitmap.width===0||gt.bitmap.height===0)continue;let Ct={x:0,y:0,w:gt.bitmap.width+2,h:gt.bitmap.height+2};be.push(Ct),at[dt]={rect:Ct,metrics:gt.metrics}}}let{w:Ce,h:Ne}=e.p(be),Ee=new e.o({width:Ce||1,height:Ne||1});for(let Se in Oe){let Le=Oe[Se];for(let at in Le){let dt=Le[+at];if(!dt||dt.bitmap.width===0||dt.bitmap.height===0)continue;let gt=Xe[Se][at].rect;e.o.copy(dt.bitmap,Ee,{x:0,y:0},{x:gt.x+1,y:gt.y+1},dt.bitmap)}}this.image=Ee,this.positions=Xe}}e.bl("GlyphAtlas",r);class o{constructor(Oe){this.tileID=new e.S(Oe.tileID.overscaledZ,Oe.tileID.wrap,Oe.tileID.canonical.z,Oe.tileID.canonical.x,Oe.tileID.canonical.y),this.uid=Oe.uid,this.zoom=Oe.zoom,this.pixelRatio=Oe.pixelRatio,this.tileSize=Oe.tileSize,this.source=Oe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Oe.showCollisionBoxes,this.collectResourceTiming=!!Oe.collectResourceTiming,this.returnDependencies=!!Oe.returnDependencies,this.promoteId=Oe.promoteId,this.inFlightDependencies=[]}parse(Oe,Xe,be,Ce){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=Oe,this.collisionBoxArray=new e.a5;let Ne=new e.bm(Object.keys(Oe.layers).sort()),Ee=new e.bn(this.tileID,this.promoteId);Ee.bucketLayerIDs=[];let Se={},Le={featureIndex:Ee,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:be},at=Xe.familiesBySource[this.source];for(let Na in at){let Ta=Oe.layers[Na];if(!Ta)continue;Ta.version===1&&e.w(`Vector tile source "${this.source}" layer "${Na}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let nn=Ne.encode(Na),gn=[];for(let Ht=0;Ht=It.maxzoom||It.visibility!=="none"&&(a(Ht,this.zoom,be),(Se[It.id]=It.createBucket({index:Ee.bucketLayerIDs.length,layers:Ht,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:nn,sourceID:this.source})).populate(gn,Le,this.tileID.canonical),Ee.bucketLayerIDs.push(Ht.map(Gt=>Gt.id)))}}let dt=e.aF(Le.glyphDependencies,Na=>Object.keys(Na).map(Number));this.inFlightDependencies.forEach(Na=>Na?.abort()),this.inFlightDependencies=[];let gt=Promise.resolve({});if(Object.keys(dt).length){let Na=new AbortController;this.inFlightDependencies.push(Na),gt=Ce.sendAsync({type:"GG",data:{stacks:dt,source:this.source,tileID:this.tileID,type:"glyphs"}},Na)}let Ct=Object.keys(Le.iconDependencies),or=Promise.resolve({});if(Ct.length){let Na=new AbortController;this.inFlightDependencies.push(Na),or=Ce.sendAsync({type:"GI",data:{icons:Ct,source:this.source,tileID:this.tileID,type:"icons"}},Na)}let Qt=Object.keys(Le.patternDependencies),Jt=Promise.resolve({});if(Qt.length){let Na=new AbortController;this.inFlightDependencies.push(Na),Jt=Ce.sendAsync({type:"GI",data:{icons:Qt,source:this.source,tileID:this.tileID,type:"patterns"}},Na)}let[Sr,oa,Ea]=yield Promise.all([gt,or,Jt]),Sa=new r(Sr),za=new e.bo(oa,Ea);for(let Na in Se){let Ta=Se[Na];Ta instanceof e.a6?(a(Ta.layers,this.zoom,be),e.bp({bucket:Ta,glyphMap:Sr,glyphPositions:Sa.positions,imageMap:oa,imagePositions:za.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ta.hasPattern&&(Ta instanceof e.bq||Ta instanceof e.br||Ta instanceof e.bs)&&(a(Ta.layers,this.zoom,be),Ta.addFeatures(Le,this.tileID.canonical,za.patternPositions))}return this.status="done",{buckets:Object.values(Se).filter(Na=>!Na.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Sa.image,imageAtlas:za,glyphMap:this.returnDependencies?Sr:null,iconMap:this.returnDependencies?oa:null,glyphPositions:this.returnDependencies?Sa.positions:null}})}}function a(yt,Oe,Xe){let be=new e.z(Oe);for(let Ce of yt)Ce.recalculate(be,Xe)}class i{constructor(Oe,Xe,be){this.actor=Oe,this.layerIndex=Xe,this.availableImages=be,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Oe,Xe){return e._(this,void 0,void 0,function*(){let be=yield e.l(Oe.request,Xe);try{return{vectorTile:new e.bt.VectorTile(new e.bu(be.data)),rawData:be.data,cacheControl:be.cacheControl,expires:be.expires}}catch(Ce){let Ne=new Uint8Array(be.data),Ee=`Unable to parse the tile at ${Oe.request.url}, `;throw Ee+=Ne[0]===31&&Ne[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ce.message}`,new Error(Ee)}})}loadTile(Oe){return e._(this,void 0,void 0,function*(){let Xe=Oe.uid,be=!!(Oe&&Oe.request&&Oe.request.collectResourceTiming)&&new e.bv(Oe.request),Ce=new o(Oe);this.loading[Xe]=Ce;let Ne=new AbortController;Ce.abort=Ne;try{let Ee=yield this.loadVectorTile(Oe,Ne);if(delete this.loading[Xe],!Ee)return null;let Se=Ee.rawData,Le={};Ee.expires&&(Le.expires=Ee.expires),Ee.cacheControl&&(Le.cacheControl=Ee.cacheControl);let at={};if(be){let gt=be.finish();gt&&(at.resourceTiming=JSON.parse(JSON.stringify(gt)))}Ce.vectorTile=Ee.vectorTile;let dt=Ce.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Xe]=Ce,this.fetching[Xe]={rawTileData:Se,cacheControl:Le,resourceTiming:at};try{let gt=yield dt;return e.e({rawTileData:Se.slice(0)},gt,Le,at)}finally{delete this.fetching[Xe]}}catch(Ee){throw delete this.loading[Xe],Ce.status="done",this.loaded[Xe]=Ce,Ee}})}reloadTile(Oe){return e._(this,void 0,void 0,function*(){let Xe=Oe.uid;if(!this.loaded||!this.loaded[Xe])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let be=this.loaded[Xe];if(be.showCollisionBoxes=Oe.showCollisionBoxes,be.status==="parsing"){let Ce=yield be.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor),Ne;if(this.fetching[Xe]){let{rawTileData:Ee,cacheControl:Se,resourceTiming:Le}=this.fetching[Xe];delete this.fetching[Xe],Ne=e.e({rawTileData:Ee.slice(0)},Ce,Se,Le)}else Ne=Ce;return Ne}if(be.status==="done"&&be.vectorTile)return be.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Oe){return e._(this,void 0,void 0,function*(){let Xe=this.loading,be=Oe.uid;Xe&&Xe[be]&&Xe[be].abort&&(Xe[be].abort.abort(),delete Xe[be])})}removeTile(Oe){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Oe.uid]&&delete this.loaded[Oe.uid]})}}class n{constructor(){this.loaded={}}loadTile(Oe){return e._(this,void 0,void 0,function*(){let{uid:Xe,encoding:be,rawImageData:Ce,redFactor:Ne,greenFactor:Ee,blueFactor:Se,baseShift:Le}=Oe,at=Ce.width+2,dt=Ce.height+2,gt=e.b(Ce)?new e.R({width:at,height:dt},yield e.bw(Ce,-1,-1,at,dt)):Ce,Ct=new e.bx(Xe,gt,be,Ne,Ee,Se,Le);return this.loaded=this.loaded||{},this.loaded[Xe]=Ct,Ct})}removeTile(Oe){let Xe=this.loaded,be=Oe.uid;Xe&&Xe[be]&&delete Xe[be]}}function s(yt,Oe){if(yt.length!==0){h(yt[0],Oe);for(var Xe=1;Xe=Math.abs(Se)?Xe-Le+Se:Se-Le+Xe,Xe=Le}Xe+be>=0!=!!Oe&&yt.reverse()}var c=e.by(function yt(Oe,Xe){var be,Ce=Oe&&Oe.type;if(Ce==="FeatureCollection")for(be=0;be>31}function L(yt,Oe){for(var Xe=yt.loadGeometry(),be=yt.type,Ce=0,Ne=0,Ee=Xe.length,Se=0;Seyt},O=Math.fround||(I=new Float32Array(1),yt=>(I[0]=+yt,I[0]));var I;let N=3,U=5,W=6;class Q{constructor(Oe){this.options=Object.assign(Object.create(B),Oe),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Oe){let{log:Xe,minZoom:be,maxZoom:Ce}=this.options;Xe&&console.time("total time");let Ne=`prepare ${Oe.length} points`;Xe&&console.time(Ne),this.points=Oe;let Ee=[];for(let Le=0;Le=be;Le--){let at=+Date.now();Se=this.trees[Le]=this._createTree(this._cluster(Se,Le)),Xe&&console.log("z%d: %d clusters in %dms",Le,Se.numItems,+Date.now()-at)}return Xe&&console.timeEnd("total time"),this}getClusters(Oe,Xe){let be=((Oe[0]+180)%360+360)%360-180,Ce=Math.max(-90,Math.min(90,Oe[1])),Ne=Oe[2]===180?180:((Oe[2]+180)%360+360)%360-180,Ee=Math.max(-90,Math.min(90,Oe[3]));if(Oe[2]-Oe[0]>=360)be=-180,Ne=180;else if(be>Ne){let gt=this.getClusters([be,Ce,180,Ee],Xe),Ct=this.getClusters([-180,Ce,Ne,Ee],Xe);return gt.concat(Ct)}let Se=this.trees[this._limitZoom(Xe)],Le=Se.range(he(be),q(Ee),he(Ne),q(Ce)),at=Se.data,dt=[];for(let gt of Le){let Ct=this.stride*gt;dt.push(at[Ct+U]>1?le(at,Ct,this.clusterProps):this.points[at[Ct+N]])}return dt}getChildren(Oe){let Xe=this._getOriginId(Oe),be=this._getOriginZoom(Oe),Ce="No cluster with the specified id.",Ne=this.trees[be];if(!Ne)throw new Error(Ce);let Ee=Ne.data;if(Xe*this.stride>=Ee.length)throw new Error(Ce);let Se=this.options.radius/(this.options.extent*Math.pow(2,be-1)),Le=Ne.within(Ee[Xe*this.stride],Ee[Xe*this.stride+1],Se),at=[];for(let dt of Le){let gt=dt*this.stride;Ee[gt+4]===Oe&&at.push(Ee[gt+U]>1?le(Ee,gt,this.clusterProps):this.points[Ee[gt+N]])}if(at.length===0)throw new Error(Ce);return at}getLeaves(Oe,Xe,be){let Ce=[];return this._appendLeaves(Ce,Oe,Xe=Xe||10,be=be||0,0),Ce}getTile(Oe,Xe,be){let Ce=this.trees[this._limitZoom(Oe)],Ne=Math.pow(2,Oe),{extent:Ee,radius:Se}=this.options,Le=Se/Ee,at=(be-Le)/Ne,dt=(be+1+Le)/Ne,gt={features:[]};return this._addTileFeatures(Ce.range((Xe-Le)/Ne,at,(Xe+1+Le)/Ne,dt),Ce.data,Xe,be,Ne,gt),Xe===0&&this._addTileFeatures(Ce.range(1-Le/Ne,at,1,dt),Ce.data,Ne,be,Ne,gt),Xe===Ne-1&&this._addTileFeatures(Ce.range(0,at,Le/Ne,dt),Ce.data,-1,be,Ne,gt),gt.features.length?gt:null}getClusterExpansionZoom(Oe){let Xe=this._getOriginZoom(Oe)-1;for(;Xe<=this.options.maxZoom;){let be=this.getChildren(Oe);if(Xe++,be.length!==1)break;Oe=be[0].properties.cluster_id}return Xe}_appendLeaves(Oe,Xe,be,Ce,Ne){let Ee=this.getChildren(Xe);for(let Se of Ee){let Le=Se.properties;if(Le&&Le.cluster?Ne+Le.point_count<=Ce?Ne+=Le.point_count:Ne=this._appendLeaves(Oe,Le.cluster_id,be,Ce,Ne):Ne1,dt,gt,Ct;if(at)dt=se(Xe,Le,this.clusterProps),gt=Xe[Le],Ct=Xe[Le+1];else{let Jt=this.points[Xe[Le+N]];dt=Jt.properties;let[Sr,oa]=Jt.geometry.coordinates;gt=he(Sr),Ct=q(oa)}let or={type:1,geometry:[[Math.round(this.options.extent*(gt*Ne-be)),Math.round(this.options.extent*(Ct*Ne-Ce))]],tags:dt},Qt;Qt=at||this.options.generateId?Xe[Le+N]:this.points[Xe[Le+N]].id,Qt!==void 0&&(or.id=Qt),Ee.features.push(or)}}_limitZoom(Oe){return Math.max(this.options.minZoom,Math.min(Math.floor(+Oe),this.options.maxZoom+1))}_cluster(Oe,Xe){let{radius:be,extent:Ce,reduce:Ne,minPoints:Ee}=this.options,Se=be/(Ce*Math.pow(2,Xe)),Le=Oe.data,at=[],dt=this.stride;for(let gt=0;gtXe&&(Sr+=Le[Ea+U])}if(Sr>Jt&&Sr>=Ee){let oa,Ea=Ct*Jt,Sa=or*Jt,za=-1,Na=((gt/dt|0)<<5)+(Xe+1)+this.points.length;for(let Ta of Qt){let nn=Ta*dt;if(Le[nn+2]<=Xe)continue;Le[nn+2]=Xe;let gn=Le[nn+U];Ea+=Le[nn]*gn,Sa+=Le[nn+1]*gn,Le[nn+4]=Na,Ne&&(oa||(oa=this._map(Le,gt,!0),za=this.clusterProps.length,this.clusterProps.push(oa)),Ne(oa,this._map(Le,nn)))}Le[gt+4]=Na,at.push(Ea/Sr,Sa/Sr,1/0,Na,-1,Sr),Ne&&at.push(za)}else{for(let oa=0;oa1)for(let oa of Qt){let Ea=oa*dt;if(!(Le[Ea+2]<=Xe)){Le[Ea+2]=Xe;for(let Sa=0;Sa>5}_getOriginZoom(Oe){return(Oe-this.points.length)%32}_map(Oe,Xe,be){if(Oe[Xe+U]>1){let Ee=this.clusterProps[Oe[Xe+W]];return be?Object.assign({},Ee):Ee}let Ce=this.points[Oe[Xe+N]].properties,Ne=this.options.map(Ce);return be&&Ne===Ce?Object.assign({},Ne):Ne}}function le(yt,Oe,Xe){return{type:"Feature",id:yt[Oe+N],properties:se(yt,Oe,Xe),geometry:{type:"Point",coordinates:[(be=yt[Oe],360*(be-.5)),$(yt[Oe+1])]}};var be}function se(yt,Oe,Xe){let be=yt[Oe+U],Ce=be>=1e4?`${Math.round(be/1e3)}k`:be>=1e3?Math.round(be/100)/10+"k":be,Ne=yt[Oe+W],Ee=Ne===-1?{}:Object.assign({},Xe[Ne]);return Object.assign(Ee,{cluster:!0,cluster_id:yt[Oe+N],point_count:be,point_count_abbreviated:Ce})}function he(yt){return yt/360+.5}function q(yt){let Oe=Math.sin(yt*Math.PI/180),Xe=.5-.25*Math.log((1+Oe)/(1-Oe))/Math.PI;return Xe<0?0:Xe>1?1:Xe}function $(yt){let Oe=(180-360*yt)*Math.PI/180;return 360*Math.atan(Math.exp(Oe))/Math.PI-90}function J(yt,Oe,Xe,be){let Ce=be,Ne=Oe+(Xe-Oe>>1),Ee,Se=Xe-Oe,Le=yt[Oe],at=yt[Oe+1],dt=yt[Xe],gt=yt[Xe+1];for(let Ct=Oe+3;CtCe)Ee=Ct,Ce=or;else if(or===Ce){let Qt=Math.abs(Ct-Ne);Qtbe&&(Ee-Oe>3&&J(yt,Oe,Ee,be),yt[Ee+2]=Ce,Xe-Ee>3&&J(yt,Ee,Xe,be))}function X(yt,Oe,Xe,be,Ce,Ne){let Ee=Ce-Xe,Se=Ne-be;if(Ee!==0||Se!==0){let Le=((yt-Xe)*Ee+(Oe-be)*Se)/(Ee*Ee+Se*Se);Le>1?(Xe=Ce,be=Ne):Le>0&&(Xe+=Ee*Le,be+=Se*Le)}return Ee=yt-Xe,Se=Oe-be,Ee*Ee+Se*Se}function oe(yt,Oe,Xe,be){let Ce={id:yt??null,type:Oe,geometry:Xe,tags:be,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Oe==="Point"||Oe==="MultiPoint"||Oe==="LineString")ne(Ce,Xe);else if(Oe==="Polygon")ne(Ce,Xe[0]);else if(Oe==="MultiLineString")for(let Ne of Xe)ne(Ce,Ne);else if(Oe==="MultiPolygon")for(let Ne of Xe)ne(Ce,Ne[0]);return Ce}function ne(yt,Oe){for(let Xe=0;Xe0&&(Ee+=be?(Ce*dt-at*Ne)/2:Math.sqrt(Math.pow(at-Ce,2)+Math.pow(dt-Ne,2))),Ce=at,Ne=dt}let Se=Oe.length-3;Oe[2]=1,J(Oe,0,Se,Xe),Oe[Se+2]=1,Oe.size=Math.abs(Ee),Oe.start=0,Oe.end=Oe.size}function ue(yt,Oe,Xe,be){for(let Ce=0;Ce1?1:Xe}function Ie(yt,Oe,Xe,be,Ce,Ne,Ee,Se){if(be/=Oe,Ne>=(Xe/=Oe)&&Ee=be)return null;let Le=[];for(let at of yt){let dt=at.geometry,gt=at.type,Ct=Ce===0?at.minX:at.minY,or=Ce===0?at.maxX:at.maxY;if(Ct>=Xe&&or=be)continue;let Qt=[];if(gt==="Point"||gt==="MultiPoint")De(dt,Qt,Xe,be,Ce);else if(gt==="LineString")He(dt,Qt,Xe,be,Ce,!1,Se.lineMetrics);else if(gt==="MultiLineString")rt(dt,Qt,Xe,be,Ce,!1);else if(gt==="Polygon")rt(dt,Qt,Xe,be,Ce,!0);else if(gt==="MultiPolygon")for(let Jt of dt){let Sr=[];rt(Jt,Sr,Xe,be,Ce,!0),Sr.length&&Qt.push(Sr)}if(Qt.length){if(Se.lineMetrics&>==="LineString"){for(let Jt of Qt)Le.push(oe(at.id,gt,Jt,at.tags));continue}gt!=="LineString"&>!=="MultiLineString"||(Qt.length===1?(gt="LineString",Qt=Qt[0]):gt="MultiLineString"),gt!=="Point"&>!=="MultiPoint"||(gt=Qt.length===3?"Point":"MultiPoint"),Le.push(oe(at.id,gt,Qt,at.tags))}}return Le.length?Le:null}function De(yt,Oe,Xe,be,Ce){for(let Ne=0;Ne=Xe&&Ee<=be&&$e(Oe,yt[Ne],yt[Ne+1],yt[Ne+2])}}function He(yt,Oe,Xe,be,Ce,Ne,Ee){let Se=et(yt),Le=Ce===0?ot:Ae,at,dt,gt=yt.start;for(let Sr=0;SrXe&&(dt=Le(Se,oa,Ea,za,Na,Xe),Ee&&(Se.start=gt+at*dt)):Ta>be?nn=Xe&&(dt=Le(Se,oa,Ea,za,Na,Xe),gn=!0),nn>be&&Ta<=be&&(dt=Le(Se,oa,Ea,za,Na,be),gn=!0),!Ne&&gn&&(Ee&&(Se.end=gt+at*dt),Oe.push(Se),Se=et(yt)),Ee&&(gt+=at)}let Ct=yt.length-3,or=yt[Ct],Qt=yt[Ct+1],Jt=Ce===0?or:Qt;Jt>=Xe&&Jt<=be&&$e(Se,or,Qt,yt[Ct+2]),Ct=Se.length-3,Ne&&Ct>=3&&(Se[Ct]!==Se[0]||Se[Ct+1]!==Se[1])&&$e(Se,Se[0],Se[1],Se[2]),Se.length&&Oe.push(Se)}function et(yt){let Oe=[];return Oe.size=yt.size,Oe.start=yt.start,Oe.end=yt.end,Oe}function rt(yt,Oe,Xe,be,Ce,Ne){for(let Ee of yt)He(Ee,Oe,Xe,be,Ce,Ne,!1)}function $e(yt,Oe,Xe,be){yt.push(Oe,Xe,be)}function ot(yt,Oe,Xe,be,Ce,Ne){let Ee=(Ne-Oe)/(be-Oe);return $e(yt,Ne,Xe+(Ce-Xe)*Ee,1),Ee}function Ae(yt,Oe,Xe,be,Ce,Ne){let Ee=(Ne-Xe)/(Ce-Xe);return $e(yt,Oe+(be-Oe)*Ee,Ne,1),Ee}function ge(yt,Oe){let Xe=[];for(let be=0;be0&&Oe.size<(Ce?Ee:be))return void(Xe.numPoints+=Oe.length/3);let Se=[];for(let Le=0;LeEe)&&(Xe.numSimplified++,Se.push(Oe[Le],Oe[Le+1])),Xe.numPoints++;Ce&&(function(Le,at){let dt=0;for(let gt=0,Ct=Le.length,or=Ct-2;gt0===at)for(let gt=0,Ct=Le.length;gt24)throw new Error("maxZoom should be in the 0-24 range");if(Xe.promoteId&&Xe.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ce=(function(Ne,Ee){let Se=[];if(Ne.type==="FeatureCollection")for(let Le=0;Le1&&console.time("creation"),or=this.tiles[Ct]=nt(Oe,Xe,be,Ce,at),this.tileCoords.push({z:Xe,x:be,y:Ce}),dt)){dt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Xe,be,Ce,or.numFeatures,or.numPoints,or.numSimplified),console.timeEnd("creation"));let gn=`z${Xe}`;this.stats[gn]=(this.stats[gn]||0)+1,this.total++}if(or.source=Oe,Ne==null){if(Xe===at.indexMaxZoom||or.numPoints<=at.indexMaxPoints)continue}else{if(Xe===at.maxZoom||Xe===Ne)continue;if(Ne!=null){let gn=Ne-Xe;if(be!==Ee>>gn||Ce!==Se>>gn)continue}}if(or.source=null,Oe.length===0)continue;dt>1&&console.time("clipping");let Qt=.5*at.buffer/at.extent,Jt=.5-Qt,Sr=.5+Qt,oa=1+Qt,Ea=null,Sa=null,za=null,Na=null,Ta=Ie(Oe,gt,be-Qt,be+Sr,0,or.minX,or.maxX,at),nn=Ie(Oe,gt,be+Jt,be+oa,0,or.minX,or.maxX,at);Oe=null,Ta&&(Ea=Ie(Ta,gt,Ce-Qt,Ce+Sr,1,or.minY,or.maxY,at),Sa=Ie(Ta,gt,Ce+Jt,Ce+oa,1,or.minY,or.maxY,at),Ta=null),nn&&(za=Ie(nn,gt,Ce-Qt,Ce+Sr,1,or.minY,or.maxY,at),Na=Ie(nn,gt,Ce+Jt,Ce+oa,1,or.minY,or.maxY,at),nn=null),dt>1&&console.timeEnd("clipping"),Le.push(Ea||[],Xe+1,2*be,2*Ce),Le.push(Sa||[],Xe+1,2*be,2*Ce+1),Le.push(za||[],Xe+1,2*be+1,2*Ce),Le.push(Na||[],Xe+1,2*be+1,2*Ce+1)}}getTile(Oe,Xe,be){Oe=+Oe,Xe=+Xe,be=+be;let Ce=this.options,{extent:Ne,debug:Ee}=Ce;if(Oe<0||Oe>24)return null;let Se=1<1&&console.log("drilling down to z%d-%d-%d",Oe,Xe,be);let at,dt=Oe,gt=Xe,Ct=be;for(;!at&&dt>0;)dt--,gt>>=1,Ct>>=1,at=this.tiles[jt(dt,gt,Ct)];return at&&at.source?(Ee>1&&(console.log("found parent tile z%d-%d-%d",dt,gt,Ct),console.time("drilling down")),this.splitTile(at.source,dt,gt,Ct,Oe,Xe,be),Ee>1&&console.timeEnd("drilling down"),this.tiles[Le]?ze(this.tiles[Le],Ne):null):null}}function jt(yt,Oe,Xe){return 32*((1<{gt.properties=or;let Qt={};for(let Jt of Ct)Qt[Jt]=Le[Jt].evaluate(dt,gt);return Qt},Ee.reduce=(or,Qt)=>{gt.properties=Qt;for(let Jt of Ct)dt.accumulated=or[Jt],or[Jt]=at[Jt].evaluate(dt,gt)},Ee})(Oe)).load((yield this._pendingData).features):(Ce=yield this._pendingData,new Bt(Ce,Oe.geojsonVtOptions)),this.loaded={};let Ne={};if(be){let Ee=be.finish();Ee&&(Ne.resourceTiming={},Ne.resourceTiming[Oe.source]=JSON.parse(JSON.stringify(Ee)))}return Ne}catch(Ne){if(delete this._pendingRequest,e.bB(Ne))return{abandoned:!0};throw Ne}var Ce})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Oe){let Xe=this.loaded;return Xe&&Xe[Oe.uid]?super.reloadTile(Oe):this.loadTile(Oe)}loadAndProcessGeoJSON(Oe,Xe){return e._(this,void 0,void 0,function*(){let be=yield this.loadGeoJSON(Oe,Xe);if(delete this._pendingRequest,typeof be!="object")throw new Error(`Input data given to '${Oe.source}' is not a valid GeoJSON object.`);if(c(be,!0),Oe.filter){let Ce=e.bC(Oe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(Ee=>`${Ee.key}: ${Ee.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(Ee=>Ce.value.evaluate({zoom:0},Ee))}}return be})}loadGeoJSON(Oe,Xe){return e._(this,void 0,void 0,function*(){let{promoteId:be}=Oe;if(Oe.request){let Ce=yield e.h(Oe.request,Xe);return this._dataUpdateable=pr(Ce.data,be)?Or(Ce.data,be):void 0,Ce.data}if(typeof Oe.data=="string")try{let Ce=JSON.parse(Oe.data);return this._dataUpdateable=pr(Ce,be)?Or(Ce,be):void 0,Ce}catch{throw new Error(`Input data given to '${Oe.source}' is not a valid GeoJSON object.`)}if(!Oe.dataDiff)throw new Error(`Input data given to '${Oe.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Oe.source}`);return(function(Ce,Ne,Ee){var Se,Le,at,dt;if(Ne.removeAll&&Ce.clear(),Ne.remove)for(let gt of Ne.remove)Ce.delete(gt);if(Ne.add)for(let gt of Ne.add){let Ct=_r(gt,Ee);Ct!=null&&Ce.set(Ct,gt)}if(Ne.update)for(let gt of Ne.update){let Ct=Ce.get(gt.id);if(Ct==null)continue;let or=!gt.removeAllProperties&&(((Se=gt.removeProperties)===null||Se===void 0?void 0:Se.length)>0||((Le=gt.addOrUpdateProperties)===null||Le===void 0?void 0:Le.length)>0);if((gt.newGeometry||gt.removeAllProperties||or)&&(Ct=Object.assign({},Ct),Ce.set(gt.id,Ct),or&&(Ct.properties=Object.assign({},Ct.properties))),gt.newGeometry&&(Ct.geometry=gt.newGeometry),gt.removeAllProperties)Ct.properties={};else if(((at=gt.removeProperties)===null||at===void 0?void 0:at.length)>0)for(let Qt of gt.removeProperties)Object.prototype.hasOwnProperty.call(Ct.properties,Qt)&&delete Ct.properties[Qt];if(((dt=gt.addOrUpdateProperties)===null||dt===void 0?void 0:dt.length)>0)for(let{key:Qt,value:Jt}of gt.addOrUpdateProperties)Ct.properties[Qt]=Jt}})(this._dataUpdateable,Oe.dataDiff,be),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Oe){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Oe){return this._geoJSONIndex.getClusterExpansionZoom(Oe.clusterId)}getClusterChildren(Oe){return this._geoJSONIndex.getChildren(Oe.clusterId)}getClusterLeaves(Oe){return this._geoJSONIndex.getLeaves(Oe.clusterId,Oe.limit,Oe.offset)}}class Er{constructor(Oe){this.self=Oe,this.actor=new e.F(Oe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Xe,be)=>{if(this.externalWorkerSourceTypes[Xe])throw new Error(`Worker source with name "${Xe}" already registered.`);this.externalWorkerSourceTypes[Xe]=be},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Xe=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Xe)},this.actor.registerMessageHandler("LDT",(Xe,be)=>this._getDEMWorkerSource(Xe,be.source).loadTile(be)),this.actor.registerMessageHandler("RDT",(Xe,be)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Xe,be.source).removeTile(be)})),this.actor.registerMessageHandler("GCEZ",(Xe,be)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Xe,be.type,be.source).getClusterExpansionZoom(be)})),this.actor.registerMessageHandler("GCC",(Xe,be)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Xe,be.type,be.source).getClusterChildren(be)})),this.actor.registerMessageHandler("GCL",(Xe,be)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Xe,be.type,be.source).getClusterLeaves(be)})),this.actor.registerMessageHandler("LD",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).loadData(be)),this.actor.registerMessageHandler("GD",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).getData()),this.actor.registerMessageHandler("LT",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).loadTile(be)),this.actor.registerMessageHandler("RT",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).reloadTile(be)),this.actor.registerMessageHandler("AT",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).abortTile(be)),this.actor.registerMessageHandler("RMT",(Xe,be)=>this._getWorkerSource(Xe,be.type,be.source).removeTile(be)),this.actor.registerMessageHandler("RS",(Xe,be)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Xe]||!this.workerSources[Xe][be.type]||!this.workerSources[Xe][be.type][be.source])return;let Ce=this.workerSources[Xe][be.type][be.source];delete this.workerSources[Xe][be.type][be.source],Ce.removeSource!==void 0&&Ce.removeSource(be)})),this.actor.registerMessageHandler("RM",Xe=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Xe],delete this.availableImages[Xe],delete this.workerSources[Xe],delete this.demWorkerSources[Xe]})),this.actor.registerMessageHandler("SR",(Xe,be)=>e._(this,void 0,void 0,function*(){this.referrer=be})),this.actor.registerMessageHandler("SRPS",(Xe,be)=>this._syncRTLPluginState(Xe,be)),this.actor.registerMessageHandler("IS",(Xe,be)=>e._(this,void 0,void 0,function*(){this.self.importScripts(be)})),this.actor.registerMessageHandler("SI",(Xe,be)=>this._setImages(Xe,be)),this.actor.registerMessageHandler("UL",(Xe,be)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Xe).update(be.layers,be.removedIds)})),this.actor.registerMessageHandler("SL",(Xe,be)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Xe).replace(be)}))}_setImages(Oe,Xe){return e._(this,void 0,void 0,function*(){this.availableImages[Oe]=Xe;for(let be in this.workerSources[Oe]){let Ce=this.workerSources[Oe][be];for(let Ne in Ce)Ce[Ne].availableImages=Xe}})}_syncRTLPluginState(Oe,Xe){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Xe.pluginStatus!=="loading")return e.bD.setState(Xe),Xe;let be=Xe.pluginURL;if(this.self.importScripts(be),e.bD.isParsed()){let Ce={pluginStatus:"loaded",pluginURL:be};return e.bD.setState(Ce),Ce}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${be}`)})}_getAvailableImages(Oe){let Xe=this.availableImages[Oe];return Xe||(Xe=[]),Xe}_getLayerIndex(Oe){let Xe=this.layerIndexes[Oe];return Xe||(Xe=this.layerIndexes[Oe]=new t),Xe}_getWorkerSource(Oe,Xe,be){if(this.workerSources[Oe]||(this.workerSources[Oe]={}),this.workerSources[Oe][Xe]||(this.workerSources[Oe][Xe]={}),!this.workerSources[Oe][Xe][be]){let Ce={sendAsync:(Ne,Ee)=>(Ne.targetMapId=Oe,this.actor.sendAsync(Ne,Ee))};switch(Xe){case"vector":this.workerSources[Oe][Xe][be]=new i(Ce,this._getLayerIndex(Oe),this._getAvailableImages(Oe));break;case"geojson":this.workerSources[Oe][Xe][be]=new mr(Ce,this._getLayerIndex(Oe),this._getAvailableImages(Oe));break;default:this.workerSources[Oe][Xe][be]=new this.externalWorkerSourceTypes[Xe](Ce,this._getLayerIndex(Oe),this._getAvailableImages(Oe))}}return this.workerSources[Oe][Xe][be]}_getDEMWorkerSource(Oe,Xe){return this.demWorkerSources[Oe]||(this.demWorkerSources[Oe]={}),this.demWorkerSources[Oe][Xe]||(this.demWorkerSources[Oe][Xe]=new n),this.demWorkerSources[Oe][Xe]}}return e.i(self)&&(self.worker=new Er(self)),Er}),A("index",["exports","./shared"],function(e,t){"use strict";var r="4.7.1";let o,a,i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Be=>new Promise((R,ae)=>{let xe=requestAnimationFrame(R);Be.signal.addEventListener("abort",()=>{cancelAnimationFrame(xe),ae(t.c())})}),getImageData(Be,R=0){return this.getImageCanvasContext(Be).getImageData(-R,-R,Be.width+2*R,Be.height+2*R)},getImageCanvasContext(Be){let R=window.document.createElement("canvas"),ae=R.getContext("2d",{willReadFrequently:!0});if(!ae)throw new Error("failed to create canvas 2d context");return R.width=Be.width,R.height=Be.height,ae.drawImage(Be,0,0,Be.width,Be.height),ae},resolveURL:Be=>(o||(o=document.createElement("a")),o.href=Be,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(R){if(!n.docStyle)return R[0];for(let ae=0;ae{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(R){let ae=R.getBoundingClientRect();return{x:ae.width/R.offsetWidth||1,y:ae.height/R.offsetHeight||1,boundingClientRect:ae}}static getPoint(R,ae,xe){let we=ae.boundingClientRect;return new t.P((xe.clientX-we.left)/ae.x-R.clientLeft,(xe.clientY-we.top)/ae.y-R.clientTop)}static mousePos(R,ae){let xe=n.getScale(R);return n.getPoint(R,xe,ae)}static touchPos(R,ae){let xe=[],we=n.getScale(R);for(let Fe=0;Fe{h&&T(h),h=null,p=!0},c.onerror=()=>{m=!0,h=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Be){let R,ae,xe,we;Be.resetRequestQueue=()=>{R=[],ae=0,xe=0,we={}},Be.addThrottleControl=zt=>{let Zt=xe++;return we[Zt]=zt,Zt},Be.removeThrottleControl=zt=>{delete we[zt],ct()},Be.getImage=(zt,Zt,gr=!0)=>new Promise((yr,Gr)=>{s.supported&&(zt.headers||(zt.headers={}),zt.headers.accept="image/webp,*/*"),t.e(zt,{type:"image"}),R.push({abortController:Zt,requestParameters:zt,supportImageRefresh:gr,state:"queued",onError:ta=>{Gr(ta)},onSuccess:ta=>{yr(ta)}}),ct()});let Fe=zt=>t._(this,void 0,void 0,function*(){zt.state="running";let{requestParameters:Zt,supportImageRefresh:gr,onError:yr,onSuccess:Gr,abortController:ta}=zt,qe=gr===!1&&!t.i(self)&&!t.g(Zt.url)&&(!Zt.headers||Object.keys(Zt.headers).reduce((ft,Mt)=>ft&&Mt==="accept",!0));ae++;let Ze=qe?bt(Zt,ta):t.m(Zt,ta);try{let ft=yield Ze;delete zt.abortController,zt.state="completed",ft.data instanceof HTMLImageElement||t.b(ft.data)?Gr(ft):ft.data&&Gr({data:yield(it=ft.data,typeof createImageBitmap=="function"?t.d(it):t.f(it)),cacheControl:ft.cacheControl,expires:ft.expires})}catch(ft){delete zt.abortController,yr(ft)}finally{ae--,ct()}var it}),ct=()=>{let zt=(()=>{for(let Zt of Object.keys(we))if(we[Zt]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Zt=ae;Zt0;Zt++){let gr=R.shift();gr.abortController.signal.aborted?Zt--:Fe(gr)}},bt=(zt,Zt)=>new Promise((gr,yr)=>{let Gr=new Image,ta=zt.url,qe=zt.credentials;qe&&qe==="include"?Gr.crossOrigin="use-credentials":(qe&&qe==="same-origin"||!t.s(ta))&&(Gr.crossOrigin="anonymous"),Zt.signal.addEventListener("abort",()=>{Gr.src="",yr(t.c())}),Gr.fetchPriority="high",Gr.onload=()=>{Gr.onerror=Gr.onload=null,gr({data:Gr})},Gr.onerror=()=>{Gr.onerror=Gr.onload=null,Zt.signal.aborted||yr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Gr.src=ta})})(l||(l={})),l.resetRequestQueue();class _{constructor(R){this._transformRequestFn=R}transformRequest(R,ae){return this._transformRequestFn&&this._transformRequestFn(R,ae)||{url:R}}setTransformRequest(R){this._transformRequestFn=R}}function w(Be){var R=new t.A(3);return R[0]=Be[0],R[1]=Be[1],R[2]=Be[2],R}var S,M=function(Be,R,ae){return Be[0]=R[0]-ae[0],Be[1]=R[1]-ae[1],Be[2]=R[2]-ae[2],Be};S=new t.A(3),t.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var y=function(Be){var R=Be[0],ae=Be[1];return R*R+ae*ae};function b(Be){let R=[];if(typeof Be=="string")R.push({id:"default",url:Be});else if(Be&&Be.length>0){let ae=[];for(let{id:xe,url:we}of Be){let Fe=`${xe}${we}`;ae.indexOf(Fe)===-1&&(ae.push(Fe),R.push({id:xe,url:we}))}}return R}function v(Be,R,ae){let xe=Be.split("?");return xe[0]+=`${R}${ae}`,xe.join("?")}(function(){var Be=new t.A(2);t.A!=Float32Array&&(Be[0]=0,Be[1]=0)})();class u{constructor(R,ae,xe,we){this.context=R,this.format=xe,this.texture=R.gl.createTexture(),this.update(ae,we)}update(R,ae,xe){let{width:we,height:Fe}=R,ct=!(this.size&&this.size[0]===we&&this.size[1]===Fe||xe),{context:bt}=this,{gl:zt}=bt;if(this.useMipmap=!!(ae&&ae.useMipmap),zt.bindTexture(zt.TEXTURE_2D,this.texture),bt.pixelStoreUnpackFlipY.set(!1),bt.pixelStoreUnpack.set(1),bt.pixelStoreUnpackPremultiplyAlpha.set(this.format===zt.RGBA&&(!ae||ae.premultiply!==!1)),ct)this.size=[we,Fe],R instanceof HTMLImageElement||R instanceof HTMLCanvasElement||R instanceof HTMLVideoElement||R instanceof ImageData||t.b(R)?zt.texImage2D(zt.TEXTURE_2D,0,this.format,this.format,zt.UNSIGNED_BYTE,R):zt.texImage2D(zt.TEXTURE_2D,0,this.format,we,Fe,0,this.format,zt.UNSIGNED_BYTE,R.data);else{let{x:Zt,y:gr}=xe||{x:0,y:0};R instanceof HTMLImageElement||R instanceof HTMLCanvasElement||R instanceof HTMLVideoElement||R instanceof ImageData||t.b(R)?zt.texSubImage2D(zt.TEXTURE_2D,0,Zt,gr,zt.RGBA,zt.UNSIGNED_BYTE,R):zt.texSubImage2D(zt.TEXTURE_2D,0,Zt,gr,we,Fe,zt.RGBA,zt.UNSIGNED_BYTE,R.data)}this.useMipmap&&this.isSizePowerOfTwo()&&zt.generateMipmap(zt.TEXTURE_2D)}bind(R,ae,xe){let{context:we}=this,{gl:Fe}=we;Fe.bindTexture(Fe.TEXTURE_2D,this.texture),xe!==Fe.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(xe=Fe.LINEAR),R!==this.filter&&(Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MAG_FILTER,R),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MIN_FILTER,xe||R),this.filter=R),ae!==this.wrap&&(Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_S,ae),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_T,ae),this.wrap=ae)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:R}=this.context;R.deleteTexture(this.texture),this.texture=null}}function g(Be){let{userImage:R}=Be;return!!(R&&R.render&&R.render())&&(Be.data.replace(new Uint8Array(R.data.buffer)),!0)}class f extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(R){if(this.loaded!==R&&(this.loaded=R,R)){for(let{ids:ae,promiseResolve:xe}of this.requestors)xe(this._getImagesForIds(ae));this.requestors=[]}}getImage(R){let ae=this.images[R];if(ae&&!ae.data&&ae.spriteData){let xe=ae.spriteData;ae.data=new t.R({width:xe.width,height:xe.height},xe.context.getImageData(xe.x,xe.y,xe.width,xe.height).data),ae.spriteData=null}return ae}addImage(R,ae){if(this.images[R])throw new Error(`Image id ${R} already exist, use updateImage instead`);this._validate(R,ae)&&(this.images[R]=ae)}_validate(R,ae){let xe=!0,we=ae.data||ae.spriteData;return this._validateStretch(ae.stretchX,we&&we.width)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "stretchX" value`))),xe=!1),this._validateStretch(ae.stretchY,we&&we.height)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "stretchY" value`))),xe=!1),this._validateContent(ae.content,ae)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "content" value`))),xe=!1),xe}_validateStretch(R,ae){if(!R)return!0;let xe=0;for(let we of R){if(we[0]{let we=!0;if(!this.isLoaded())for(let Fe of R)this.images[Fe]||(we=!1);this.isLoaded()||we?ae(this._getImagesForIds(R)):this.requestors.push({ids:R,promiseResolve:ae})})}_getImagesForIds(R){let ae={};for(let xe of R){let we=this.getImage(xe);we||(this.fire(new t.k("styleimagemissing",{id:xe})),we=this.getImage(xe)),we?ae[xe]={data:we.data.clone(),pixelRatio:we.pixelRatio,sdf:we.sdf,version:we.version,stretchX:we.stretchX,stretchY:we.stretchY,content:we.content,textFitWidth:we.textFitWidth,textFitHeight:we.textFitHeight,hasRenderCallback:!!(we.userImage&&we.userImage.render)}:t.w(`Image "${xe}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ae}getPixelSize(){let{width:R,height:ae}=this.atlasImage;return{width:R,height:ae}}getPattern(R){let ae=this.patterns[R],xe=this.getImage(R);if(!xe)return null;if(ae&&ae.position.version===xe.version)return ae.position;if(ae)ae.position.version=xe.version;else{let we={w:xe.data.width+2,h:xe.data.height+2,x:0,y:0},Fe=new t.I(we,xe);this.patterns[R]={bin:we,position:Fe}}return this._updatePatternAtlas(),this.patterns[R].position}bind(R){let ae=R.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(R,this.atlasImage,ae.RGBA),this.atlasTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE)}_updatePatternAtlas(){let R=[];for(let Fe in this.patterns)R.push(this.patterns[Fe].bin);let{w:ae,h:xe}=t.p(R),we=this.atlasImage;we.resize({width:ae||1,height:xe||1});for(let Fe in this.patterns){let{bin:ct}=this.patterns[Fe],bt=ct.x+1,zt=ct.y+1,Zt=this.getImage(Fe).data,gr=Zt.width,yr=Zt.height;t.R.copy(Zt,we,{x:0,y:0},{x:bt,y:zt},{width:gr,height:yr}),t.R.copy(Zt,we,{x:0,y:yr-1},{x:bt,y:zt-1},{width:gr,height:1}),t.R.copy(Zt,we,{x:0,y:0},{x:bt,y:zt+yr},{width:gr,height:1}),t.R.copy(Zt,we,{x:gr-1,y:0},{x:bt-1,y:zt},{width:1,height:yr}),t.R.copy(Zt,we,{x:0,y:0},{x:bt+gr,y:zt},{width:1,height:yr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(R){for(let ae of R){if(this.callbackDispatchedThisFrame[ae])continue;this.callbackDispatchedThisFrame[ae]=!0;let xe=this.getImage(ae);xe||t.w(`Image with ID: "${ae}" was not found`),g(xe)&&this.updateImage(ae,xe)}}}let P=1e20;function L(Be,R,ae,xe,we,Fe,ct,bt,zt){for(let Zt=R;Zt-1);zt++,Fe[zt]=bt,ct[zt]=Zt,ct[zt+1]=P}for(let bt=0,zt=0;bt65535)throw new Error("glyphs > 65535 not supported");if(xe.ranges[Fe])return{stack:R,id:ae,glyph:we};if(!this.url)throw new Error("glyphsUrl is not set");if(!xe.requests[Fe]){let bt=F.loadGlyphRange(R,Fe,this.url,this.requestManager);xe.requests[Fe]=bt}let ct=yield xe.requests[Fe];for(let bt in ct)this._doesCharSupportLocalGlyph(+bt)||(xe.glyphs[+bt]=ct[+bt]);return xe.ranges[Fe]=!0,{stack:R,id:ae,glyph:ct[ae]||null}})}_doesCharSupportLocalGlyph(R){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(R))}_tinySDF(R,ae,xe){let we=this.localIdeographFontFamily;if(!we||!this._doesCharSupportLocalGlyph(xe))return;let Fe=R.tinySDF;if(!Fe){let bt="400";/bold/i.test(ae)?bt="900":/medium/i.test(ae)?bt="500":/light/i.test(ae)&&(bt="200"),Fe=R.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:we,fontWeight:bt})}let ct=Fe.draw(String.fromCharCode(xe));return{id:xe,bitmap:new t.o({width:ct.width||60,height:ct.height||60},ct.data),metrics:{width:ct.glyphWidth/2||24,height:ct.glyphHeight/2||24,left:ct.glyphLeft/2+.5||0,top:ct.glyphTop/2-27.5||-8,advance:ct.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(Be,R,ae,xe){return t._(this,void 0,void 0,function*(){let we=256*R,Fe=we+255,ct=xe.transformRequest(ae.replace("{fontstack}",Be).replace("{range}",`${we}-${Fe}`),"Glyphs"),bt=yield t.l(ct,new AbortController);if(!bt||!bt.data)throw new Error(`Could not load glyph range. range: ${R}, ${we}-${Fe}`);let zt={};for(let Zt of t.n(bt.data))zt[Zt.id]=Zt;return zt})},F.TinySDF=class{constructor({fontSize:Be=24,buffer:R=3,radius:ae=8,cutoff:xe=.25,fontFamily:we="sans-serif",fontWeight:Fe="normal",fontStyle:ct="normal"}={}){this.buffer=R,this.cutoff=xe,this.radius=ae;let bt=this.size=Be+4*R,zt=this._createCanvas(bt),Zt=this.ctx=zt.getContext("2d",{willReadFrequently:!0});Zt.font=`${ct} ${Fe} ${Be}px ${we}`,Zt.textBaseline="alphabetic",Zt.textAlign="left",Zt.fillStyle="black",this.gridOuter=new Float64Array(bt*bt),this.gridInner=new Float64Array(bt*bt),this.f=new Float64Array(bt),this.z=new Float64Array(bt+1),this.v=new Uint16Array(bt)}_createCanvas(Be){let R=document.createElement("canvas");return R.width=R.height=Be,R}draw(Be){let{width:R,actualBoundingBoxAscent:ae,actualBoundingBoxDescent:xe,actualBoundingBoxLeft:we,actualBoundingBoxRight:Fe}=this.ctx.measureText(Be),ct=Math.ceil(ae),bt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Fe-we))),zt=Math.min(this.size-this.buffer,ct+Math.ceil(xe)),Zt=bt+2*this.buffer,gr=zt+2*this.buffer,yr=Math.max(Zt*gr,0),Gr=new Uint8ClampedArray(yr),ta={data:Gr,width:Zt,height:gr,glyphWidth:bt,glyphHeight:zt,glyphTop:ct,glyphLeft:0,glyphAdvance:R};if(bt===0||zt===0)return ta;let{ctx:qe,buffer:Ze,gridInner:it,gridOuter:ft}=this;qe.clearRect(Ze,Ze,bt,zt),qe.fillText(Be,Ze,Ze+ct);let Mt=qe.getImageData(Ze,Ze,bt,zt);ft.fill(P,0,yr),it.fill(0,0,yr);for(let xt=0;xt0?wr*wr:0,it[fr]=wr<0?wr*wr:0}}L(ft,0,0,Zt,gr,Zt,this.f,this.v,this.z),L(it,Ze,Ze,bt,zt,Zt,this.f,this.v,this.z);for(let xt=0;xt1&&(zt=R[++bt]);let gr=Math.abs(Zt-zt.left),yr=Math.abs(Zt-zt.right),Gr=Math.min(gr,yr),ta,qe=Fe/xe*(we+1);if(zt.isDash){let Ze=we-Math.abs(qe);ta=Math.sqrt(Gr*Gr+Ze*Ze)}else ta=we-Math.sqrt(Gr*Gr+qe*qe);this.data[ct+Zt]=Math.max(0,Math.min(255,ta+128))}}}addRegularDash(R){for(let bt=R.length-1;bt>=0;--bt){let zt=R[bt],Zt=R[bt+1];zt.zeroLength?R.splice(bt,1):Zt&&Zt.isDash===zt.isDash&&(Zt.left=zt.left,R.splice(bt,1))}let ae=R[0],xe=R[R.length-1];ae.isDash===xe.isDash&&(ae.left=xe.left-this.width,xe.right=ae.right+this.width);let we=this.width*this.nextRow,Fe=0,ct=R[Fe];for(let bt=0;bt1&&(ct=R[++Fe]);let zt=Math.abs(bt-ct.left),Zt=Math.abs(bt-ct.right),gr=Math.min(zt,Zt);this.data[we+bt]=Math.max(0,Math.min(255,(ct.isDash?gr:-gr)+128))}}addDash(R,ae){let xe=ae?7:0,we=2*xe+1;if(this.nextRow+we>this.height)return t.w("LineAtlas out of space"),null;let Fe=0;for(let bt=0;bt{ae.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Q]}numActive(){return Object.keys(this.active).length}}let se=Math.floor(i.hardwareConcurrency/2),he,q;function $(){return he||(he=new le),he}le.workerCount=t.C(globalThis)?Math.max(Math.min(se,3),1):1;class J{constructor(R,ae){this.workerPool=R,this.actors=[],this.currentActor=0,this.id=ae;let xe=this.workerPool.acquire(ae);for(let we=0;we{ae.remove()}),this.actors=[],R&&this.workerPool.release(this.id)}registerMessageHandler(R,ae){for(let xe of this.actors)xe.registerMessageHandler(R,ae)}}function X(){return q||(q=new J($(),t.G),q.registerMessageHandler("GR",(Be,R,ae)=>t.m(R,ae))),q}function oe(Be,R){let ae=t.H();return t.J(ae,ae,[1,1,0]),t.K(ae,ae,[.5*Be.width,.5*Be.height,1]),t.L(ae,ae,Be.calculatePosMatrix(R.toUnwrapped()))}function ne(Be,R,ae,xe,we,Fe){let ct=(function(yr,Gr,ta){if(yr)for(let qe of yr){let Ze=Gr[qe];if(Ze&&Ze.source===ta&&Ze.type==="fill-extrusion")return!0}else for(let qe in Gr){let Ze=Gr[qe];if(Ze.source===ta&&Ze.type==="fill-extrusion")return!0}return!1})(we&&we.layers,R,Be.id),bt=Fe.maxPitchScaleFactor(),zt=Be.tilesIn(xe,bt,ct);zt.sort(j);let Zt=[];for(let yr of zt)Zt.push({wrappedTileID:yr.tileID.wrapped().key,queryResults:yr.tile.queryRenderedFeatures(R,ae,Be._state,yr.queryGeometry,yr.cameraQueryGeometry,yr.scale,we,Fe,bt,oe(Be.transform,yr.tileID))});let gr=(function(yr){let Gr={},ta={};for(let qe of yr){let Ze=qe.queryResults,it=qe.wrappedTileID,ft=ta[it]=ta[it]||{};for(let Mt in Ze){let xt=Ze[Mt],Pt=ft[Mt]=ft[Mt]||{},ir=Gr[Mt]=Gr[Mt]||[];for(let fr of xt)Pt[fr.featureIndex]||(Pt[fr.featureIndex]=!0,ir.push(fr))}}return Gr})(Zt);for(let yr in gr)gr[yr].forEach(Gr=>{let ta=Gr.feature,qe=Be.getFeatureState(ta.layer["source-layer"],ta.id);ta.source=ta.layer.source,ta.layer["source-layer"]&&(ta.sourceLayer=ta.layer["source-layer"]),ta.state=qe});return gr}function j(Be,R){let ae=Be.tileID,xe=R.tileID;return ae.overscaledZ-xe.overscaledZ||ae.canonical.y-xe.canonical.y||ae.wrap-xe.wrap||ae.canonical.x-xe.canonical.x}function ee(Be,R,ae){return t._(this,void 0,void 0,function*(){let xe=Be;if(Be.url?xe=(yield t.h(R.transformRequest(Be.url,"Source"),ae)).data:yield i.frameAsync(ae),!xe)return null;let we=t.M(t.e(xe,Be),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in xe&&xe.vector_layers&&(we.vectorLayerIds=xe.vector_layers.map(Fe=>Fe.id)),we})}class re{constructor(R,ae){R&&(ae?this.setSouthWest(R).setNorthEast(ae):Array.isArray(R)&&(R.length===4?this.setSouthWest([R[0],R[1]]).setNorthEast([R[2],R[3]]):this.setSouthWest(R[0]).setNorthEast(R[1])))}setNorthEast(R){return this._ne=R instanceof t.N?new t.N(R.lng,R.lat):t.N.convert(R),this}setSouthWest(R){return this._sw=R instanceof t.N?new t.N(R.lng,R.lat):t.N.convert(R),this}extend(R){let ae=this._sw,xe=this._ne,we,Fe;if(R instanceof t.N)we=R,Fe=R;else{if(!(R instanceof re))return Array.isArray(R)?R.length===4||R.every(Array.isArray)?this.extend(re.convert(R)):this.extend(t.N.convert(R)):R&&("lng"in R||"lon"in R)&&"lat"in R?this.extend(t.N.convert(R)):this;if(we=R._sw,Fe=R._ne,!we||!Fe)return this}return ae||xe?(ae.lng=Math.min(we.lng,ae.lng),ae.lat=Math.min(we.lat,ae.lat),xe.lng=Math.max(Fe.lng,xe.lng),xe.lat=Math.max(Fe.lat,xe.lat)):(this._sw=new t.N(we.lng,we.lat),this._ne=new t.N(Fe.lng,Fe.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(R){let{lng:ae,lat:xe}=t.N.convert(R),we=this._sw.lng<=ae&&ae<=this._ne.lng;return this._sw.lng>this._ne.lng&&(we=this._sw.lng>=ae&&ae>=this._ne.lng),this._sw.lat<=xe&&xe<=this._ne.lat&&we}static convert(R){return R instanceof re?R:R&&new re(R)}static fromLngLat(R,ae=0){let xe=360*ae/40075017,we=xe/Math.cos(Math.PI/180*R.lat);return new re(new t.N(R.lng-we,R.lat-xe),new t.N(R.lng+we,R.lat+xe))}adjustAntiMeridian(){let R=new t.N(this._sw.lng,this._sw.lat),ae=new t.N(this._ne.lng,this._ne.lat);return new re(R,R.lng>ae.lng?new t.N(ae.lng+360,ae.lat):ae)}}class ue{constructor(R,ae,xe){this.bounds=re.convert(this.validateBounds(R)),this.minzoom=ae||0,this.maxzoom=xe||24}validateBounds(R){return Array.isArray(R)&&R.length===4?[Math.max(-180,R[0]),Math.max(-90,R[1]),Math.min(180,R[2]),Math.min(90,R[3])]:[-180,-90,180,90]}contains(R){let ae=Math.pow(2,R.z),xe=Math.floor(t.O(this.bounds.getWest())*ae),we=Math.floor(t.Q(this.bounds.getNorth())*ae),Fe=Math.ceil(t.O(this.bounds.getEast())*ae),ct=Math.ceil(t.Q(this.bounds.getSouth())*ae);return R.x>=xe&&R.x=we&&R.y{this._options.tiles=R}),this}setUrl(R){return this.setSourceProperty(()=>{this.url=R,this._options.url=R}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xe={request:this.map._requestManager.transformRequest(ae,"Tile"),uid:R.uid,tileID:R.tileID,zoom:R.tileID.overscaledZ,tileSize:this.tileSize*R.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};xe.request.collectResourceTiming=this._collectResourceTiming;let we="RT";if(R.actor&&R.state!=="expired"){if(R.state==="loading")return new Promise((Fe,ct)=>{R.reloadPromise={resolve:Fe,reject:ct}})}else R.actor=this.dispatcher.getActor(),we="LT";R.abortController=new AbortController;try{let Fe=yield R.actor.sendAsync({type:we,data:xe},R.abortController);if(delete R.abortController,R.aborted)return;this._afterTileLoadWorkerResponse(R,Fe)}catch(Fe){if(delete R.abortController,R.aborted)return;if(Fe&&Fe.status!==404)throw Fe;this._afterTileLoadWorkerResponse(R,null)}})}_afterTileLoadWorkerResponse(R,ae){if(ae&&ae.resourceTiming&&(R.resourceTiming=ae.resourceTiming),ae&&this.map._refreshExpiredTiles&&R.setExpiryData(ae),R.loadVectorData(ae,this.map.painter),R.reloadPromise){let xe=R.reloadPromise;R.reloadPromise=null,this.loadTile(R).then(xe.resolve).catch(xe.reject)}}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController),R.actor&&(yield R.actor.sendAsync({type:"AT",data:{uid:R.uid,type:this.type,source:this.id}}))})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.unloadVectorData(),R.actor&&(yield R.actor.sendAsync({type:"RMT",data:{uid:R.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Te extends t.E{constructor(R,ae,xe,we){super(),this.id=R,this.dispatcher=xe,this.setEventedParent(we),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ae),t.e(this,t.M(ae,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let R=yield ee(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,R&&(t.e(this,R),R.bounds&&(this.tileBounds=new ue(R.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(R){this._tileJSONRequest=null,this.fire(new t.j(R))}})}loaded(){return this._loaded}onAdd(R){this.map=R,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(R){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),R(),this.load()}setTiles(R){return this.setSourceProperty(()=>{this._options.tiles=R}),this}setUrl(R){return this.setSourceProperty(()=>{this.url=R,this._options.url=R}),this}serialize(){return t.e({},this._options)}hasTile(R){return!this.tileBounds||this.tileBounds.contains(R.canonical)}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);R.abortController=new AbortController;try{let xe=yield l.getImage(this.map._requestManager.transformRequest(ae,"Tile"),R.abortController,this.map._refreshExpiredTiles);if(delete R.abortController,R.aborted)return void(R.state="unloaded");if(xe&&xe.data){this.map._refreshExpiredTiles&&xe.cacheControl&&xe.expires&&R.setExpiryData({cacheControl:xe.cacheControl,expires:xe.expires});let we=this.map.painter.context,Fe=we.gl,ct=xe.data;R.texture=this.map.painter.getTileTexture(ct.width),R.texture?R.texture.update(ct,{useMipmap:!0}):(R.texture=new u(we,ct,Fe.RGBA,{useMipmap:!0}),R.texture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST)),R.state="loaded"}}catch(xe){if(delete R.abortController,R.aborted)R.state="unloaded";else if(xe)throw R.state="errored",xe}})}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController)})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.texture&&this.map.painter.saveTileTexture(R.texture)})}hasTransition(){return!1}}class Ie extends Te{constructor(R,ae,xe,we){super(R,ae,xe,we),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ae),this.encoding=ae.encoding||"mapbox",this.redFactor=ae.redFactor,this.greenFactor=ae.greenFactor,this.blueFactor=ae.blueFactor,this.baseShift=ae.baseShift}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xe=this.map._requestManager.transformRequest(ae,"Tile");R.neighboringTiles=this._getNeighboringTiles(R.tileID),R.abortController=new AbortController;try{let we=yield l.getImage(xe,R.abortController,this.map._refreshExpiredTiles);if(delete R.abortController,R.aborted)return void(R.state="unloaded");if(we&&we.data){let Fe=we.data;this.map._refreshExpiredTiles&&we.cacheControl&&we.expires&&R.setExpiryData({cacheControl:we.cacheControl,expires:we.expires});let ct=t.b(Fe)&&t.U()?Fe:yield this.readImageNow(Fe),bt={type:this.type,uid:R.uid,source:this.id,rawImageData:ct,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!R.actor||R.state==="expired"){R.actor=this.dispatcher.getActor();let zt=yield R.actor.sendAsync({type:"LDT",data:bt});R.dem=zt,R.needsHillshadePrepare=!0,R.needsTerrainPrepare=!0,R.state="loaded"}}}catch(we){if(delete R.abortController,R.aborted)R.state="unloaded";else if(we)throw R.state="errored",we}})}readImageNow(R){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){let ae=R.width+2,xe=R.height+2;try{return new t.R({width:ae,height:xe},yield t.W(R,-1,-1,ae,xe))}catch{}}return i.getImageData(R,1)})}_getNeighboringTiles(R){let ae=R.canonical,xe=Math.pow(2,ae.z),we=(ae.x-1+xe)%xe,Fe=ae.x===0?R.wrap-1:R.wrap,ct=(ae.x+1+xe)%xe,bt=ae.x+1===xe?R.wrap+1:R.wrap,zt={};return zt[new t.S(R.overscaledZ,Fe,ae.z,we,ae.y).key]={backfilled:!1},zt[new t.S(R.overscaledZ,bt,ae.z,ct,ae.y).key]={backfilled:!1},ae.y>0&&(zt[new t.S(R.overscaledZ,Fe,ae.z,we,ae.y-1).key]={backfilled:!1},zt[new t.S(R.overscaledZ,R.wrap,ae.z,ae.x,ae.y-1).key]={backfilled:!1},zt[new t.S(R.overscaledZ,bt,ae.z,ct,ae.y-1).key]={backfilled:!1}),ae.y+10&&t.e(Fe,{resourceTiming:we}),this.fire(new t.k("data",Object.assign(Object.assign({},Fe),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Fe),{sourceDataType:"content"})))}catch(xe){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(xe))}})}loaded(){return this._pendingLoads===0}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.actor?"RT":"LT";R.actor=this.actor;let xe={type:this.type,uid:R.uid,tileID:R.tileID,zoom:R.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};R.abortController=new AbortController;let we=yield this.actor.sendAsync({type:ae,data:xe},R.abortController);delete R.abortController,R.unloadVectorData(),R.aborted||R.loadVectorData(we,this.map.painter,ae==="RT")})}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController),R.aborted=!0})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:R.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var He=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class et extends t.E{constructor(R,ae,xe,we){super(),this.id=R,this.dispatcher=xe,this.coordinates=ae.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(we),this.options=ae}load(R){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let ae=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ae&&ae.data&&(this.image=ae.data,R&&(this.coordinates=R),this._finishLoading())}catch(ae){this._request=null,this._loaded=!0,this.fire(new t.j(ae))}})}loaded(){return this._loaded}updateImage(R){return R.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=R.url,this.load(R.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(R){this.map=R,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(R){this.coordinates=R;let ae=R.map(t.Z.fromLngLat);this.tileID=(function(we){let Fe=1/0,ct=1/0,bt=-1/0,zt=-1/0;for(let Gr of we)Fe=Math.min(Fe,Gr.x),ct=Math.min(ct,Gr.y),bt=Math.max(bt,Gr.x),zt=Math.max(zt,Gr.y);let Zt=Math.max(bt-Fe,zt-ct),gr=Math.max(0,Math.floor(-Math.log(Zt)/Math.LN2)),yr=Math.pow(2,gr);return new t.a1(gr,Math.floor((Fe+bt)/2*yr),Math.floor((ct+zt)/2*yr))})(ae),this.minzoom=this.maxzoom=this.tileID.z;let xe=ae.map(we=>this.tileID.getTilePoint(we)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(xe[0].x,xe[0].y,0,0),this._boundsArray.emplaceBack(xe[1].x,xe[1].y,t.X,0),this._boundsArray.emplaceBack(xe[3].x,xe[3].y,0,t.X),this._boundsArray.emplaceBack(xe[2].x,xe[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let R=this.map.painter.context,ae=R.gl;this.boundsBuffer||(this.boundsBuffer=R.createVertexBuffer(this._boundsArray,He.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(R,this.image,ae.RGBA),this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE));let xe=!1;for(let we in this.tiles){let Fe=this.tiles[we];Fe.state!=="loaded"&&(Fe.state="loaded",Fe.texture=this.texture,xe=!0)}xe&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(R){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(R.tileID.canonical)?(this.tiles[String(R.tileID.wrap)]=R,R.buckets={}):R.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class rt extends et{constructor(R,ae,xe,we){super(R,ae,xe,we),this.roundZoom=!0,this.type="video",this.options=ae}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;let R=this.options;this.urls=[];for(let ae of R.urls)this.urls.push(this.map._requestManager.transformRequest(ae,"Source").url);try{let ae=yield t.a3(this.urls);if(this._loaded=!0,!ae)return;this.video=ae,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ae){this.fire(new t.j(ae))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(R){if(this.video){let ae=this.video.seekable;Rae.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ae.start(0)} and ${ae.end(0)}-second mark.`))):this.video.currentTime=R}}getVideo(){return this.video}onAdd(R){this.map||(this.map=R,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let R=this.map.painter.context,ae=R.gl;this.boundsBuffer||(this.boundsBuffer=R.createVertexBuffer(this._boundsArray,He.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE),ae.texSubImage2D(ae.TEXTURE_2D,0,0,0,ae.RGBA,ae.UNSIGNED_BYTE,this.video)):(this.texture=new u(R,this.video,ae.RGBA),this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE));let xe=!1;for(let we in this.tiles){let Fe=this.tiles[we];Fe.state!=="loaded"&&(Fe.state="loaded",Fe.texture=this.texture,xe=!0)}xe&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class $e extends et{constructor(R,ae,xe,we){super(R,ae,xe,we),ae.coordinates?Array.isArray(ae.coordinates)&&ae.coordinates.length===4&&!ae.coordinates.some(Fe=>!Array.isArray(Fe)||Fe.length!==2||Fe.some(ct=>typeof ct!="number"))||this.fire(new t.j(new t.a2(`sources.${R}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${R}`,null,'missing required property "coordinates"'))),ae.animate&&typeof ae.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${R}`,null,'optional "animate" property must be a boolean value'))),ae.canvas?typeof ae.canvas=="string"||ae.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${R}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${R}`,null,'missing required property "canvas"'))),this.options=ae,this.animate=ae.animate===void 0||ae.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(R){this.map=R,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let R=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,R=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,R=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let ae=this.map.painter.context,xe=ae.gl;this.boundsBuffer||(this.boundsBuffer=ae.createVertexBuffer(this._boundsArray,He.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(R||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ae,this.canvas,xe.RGBA,{premultiply:!0});let we=!1;for(let Fe in this.tiles){let ct=this.tiles[Fe];ct.state!=="loaded"&&(ct.state="loaded",ct.texture=this.texture,we=!0)}we&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let R of[this.canvas.width,this.canvas.height])if(isNaN(R)||R<=0)return!0;return!1}}let ot={},Ae=Be=>{switch(Be){case"geojson":return De;case"image":return et;case"raster":return Te;case"raster-dem":return Ie;case"vector":return _e;case"video":return rt;case"canvas":return $e}return ot[Be]},ge="RTLPluginLoaded";class ce extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=X()}_syncState(R){return this.status=R,this.dispatcher.broadcast("SRPS",{pluginStatus:R,pluginURL:this.url}).catch(ae=>{throw this.status="error",ae})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(R){return t._(this,arguments,void 0,function*(ae,xe=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ae),!this.url)throw new Error(`requested url ${ae} is invalid`);if(this.status==="unavailable"){if(!xe)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(ge))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ze=null;function Qe(){return ze||(ze=new ce),ze}class nt{constructor(R,ae){this.timeAdded=0,this.fadeEndTime=0,this.tileID=R,this.uid=t.a4(),this.uses=0,this.tileSize=ae,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(R){let ae=R+this.timeAdded;aeFe.getLayer(Zt)).filter(Boolean);if(zt.length!==0){bt.layers=zt,bt.stateDependentLayerIds&&(bt.stateDependentLayers=bt.stateDependentLayerIds.map(Zt=>zt.filter(gr=>gr.id===Zt)[0]));for(let Zt of zt)ct[Zt.id]=bt}}return ct})(R.buckets,ae.style),this.hasSymbolBuckets=!1;for(let we in this.buckets){let Fe=this.buckets[we];if(Fe instanceof t.a6){if(this.hasSymbolBuckets=!0,!xe)break;Fe.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let we in this.buckets){let Fe=this.buckets[we];if(Fe instanceof t.a6&&Fe.hasRTLText){this.hasRTLText=!0,Qe().lazyLoad();break}}this.queryPadding=0;for(let we in this.buckets){let Fe=this.buckets[we];this.queryPadding=Math.max(this.queryPadding,ae.style.getLayer(we).queryRadius(Fe))}R.imageAtlas&&(this.imageAtlas=R.imageAtlas),R.glyphAtlasImage&&(this.glyphAtlasImage=R.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(let R in this.buckets)this.buckets[R].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(R){return this.buckets[R.id]}upload(R){for(let xe in this.buckets){let we=this.buckets[xe];we.uploadPending()&&we.upload(R)}let ae=R.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(R,this.imageAtlas.image,ae.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(R,this.glyphAtlasImage,ae.ALPHA),this.glyphAtlasImage=null)}prepare(R){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(R,this.imageAtlasTexture)}queryRenderedFeatures(R,ae,xe,we,Fe,ct,bt,zt,Zt,gr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:we,cameraQueryGeometry:Fe,scale:ct,tileSize:this.tileSize,pixelPosMatrix:gr,transform:zt,params:bt,queryPadding:this.queryPadding*Zt},R,ae,xe):{}}querySourceFeatures(R,ae){let xe=this.latestFeatureIndex;if(!xe||!xe.rawTileData)return;let we=xe.loadVTLayers(),Fe=ae&&ae.sourceLayer?ae.sourceLayer:"",ct=we._geojsonTileLayer||we[Fe];if(!ct)return;let bt=t.a7(ae&&ae.filter),{z:zt,x:Zt,y:gr}=this.tileID.canonical,yr={z:zt,x:Zt,y:gr};for(let Gr=0;Grxe)we=!1;else if(ae)if(this.expirationTime{this.remove(R,Fe)},xe)),this.data[we].push(Fe),this.order.push(we),this.order.length>this.max){let ct=this._getAndRemoveByKey(this.order[0]);ct&&this.onRemove(ct)}return this}has(R){return R.wrapped().key in this.data}getAndRemove(R){return this.has(R)?this._getAndRemoveByKey(R.wrapped().key):null}_getAndRemoveByKey(R){let ae=this.data[R].shift();return ae.timeout&&clearTimeout(ae.timeout),this.data[R].length===0&&delete this.data[R],this.order.splice(this.order.indexOf(R),1),ae.value}getByKey(R){let ae=this.data[R];return ae?ae[0].value:null}get(R){return this.has(R)?this.data[R.wrapped().key][0].value:null}remove(R,ae){if(!this.has(R))return this;let xe=R.wrapped().key,we=ae===void 0?0:this.data[xe].indexOf(ae),Fe=this.data[xe][we];return this.data[xe].splice(we,1),Fe.timeout&&clearTimeout(Fe.timeout),this.data[xe].length===0&&delete this.data[xe],this.onRemove(Fe.value),this.order.splice(this.order.indexOf(xe),1),this}setMaxSize(R){for(this.max=R;this.order.length>this.max;){let ae=this._getAndRemoveByKey(this.order[0]);ae&&this.onRemove(ae)}return this}filter(R){let ae=[];for(let xe in this.data)for(let we of this.data[xe])R(we.value)||ae.push(we);for(let xe of ae)this.remove(xe.value.tileID,xe)}}class kt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(R,ae,xe){let we=String(ae);if(this.stateChanges[R]=this.stateChanges[R]||{},this.stateChanges[R][we]=this.stateChanges[R][we]||{},t.e(this.stateChanges[R][we],xe),this.deletedStates[R]===null){this.deletedStates[R]={};for(let Fe in this.state[R])Fe!==we&&(this.deletedStates[R][Fe]=null)}else if(this.deletedStates[R]&&this.deletedStates[R][we]===null){this.deletedStates[R][we]={};for(let Fe in this.state[R][we])xe[Fe]||(this.deletedStates[R][we][Fe]=null)}else for(let Fe in xe)this.deletedStates[R]&&this.deletedStates[R][we]&&this.deletedStates[R][we][Fe]===null&&delete this.deletedStates[R][we][Fe]}removeFeatureState(R,ae,xe){if(this.deletedStates[R]===null)return;let we=String(ae);if(this.deletedStates[R]=this.deletedStates[R]||{},xe&&ae!==void 0)this.deletedStates[R][we]!==null&&(this.deletedStates[R][we]=this.deletedStates[R][we]||{},this.deletedStates[R][we][xe]=null);else if(ae!==void 0)if(this.stateChanges[R]&&this.stateChanges[R][we])for(xe in this.deletedStates[R][we]={},this.stateChanges[R][we])this.deletedStates[R][we][xe]=null;else this.deletedStates[R][we]=null;else this.deletedStates[R]=null}getState(R,ae){let xe=String(ae),we=t.e({},(this.state[R]||{})[xe],(this.stateChanges[R]||{})[xe]);if(this.deletedStates[R]===null)return{};if(this.deletedStates[R]){let Fe=this.deletedStates[R][ae];if(Fe===null)return{};for(let ct in Fe)delete we[ct]}return we}initializeTileState(R,ae){R.setFeatureState(this.state,ae)}coalesceChanges(R,ae){let xe={};for(let we in this.stateChanges){this.state[we]=this.state[we]||{};let Fe={};for(let ct in this.stateChanges[we])this.state[we][ct]||(this.state[we][ct]={}),t.e(this.state[we][ct],this.stateChanges[we][ct]),Fe[ct]=this.state[we][ct];xe[we]=Fe}for(let we in this.deletedStates){this.state[we]=this.state[we]||{};let Fe={};if(this.deletedStates[we]===null)for(let ct in this.state[we])Fe[ct]={},this.state[we][ct]={};else for(let ct in this.deletedStates[we]){if(this.deletedStates[we][ct]===null)this.state[we][ct]={};else for(let bt of Object.keys(this.deletedStates[we][ct]))delete this.state[we][ct][bt];Fe[ct]=this.state[we][ct]}xe[we]=xe[we]||{},t.e(xe[we],Fe)}if(this.stateChanges={},this.deletedStates={},Object.keys(xe).length!==0)for(let we in R)R[we].setFeatureState(xe,ae)}}class Et extends t.E{constructor(R,ae,xe){super(),this.id=R,this.dispatcher=xe,this.on("data",we=>this._dataHandler(we)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((we,Fe,ct,bt)=>{let zt=new(Ae(Fe.type))(we,Fe,ct,bt);if(zt.id!==we)throw new Error(`Expected Source id to be ${we} instead of ${zt.id}`);return zt})(R,ae,xe,this),this._tiles={},this._cache=new Ke(0,we=>this._unloadTile(we)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new kt,this._didEmitContent=!1,this._updated=!1}onAdd(R){this.map=R,this._maxTileCacheSize=R?R._maxTileCacheSize:null,this._maxTileCacheZoomLevels=R?R._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(R)}onRemove(R){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(R)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let R in this._tiles){let ae=this._tiles[R];if(ae.state!=="loaded"&&ae.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let R=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,R&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(R,ae,xe){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(R),this._tileLoaded(R,ae,xe)}catch(we){R.state="errored",we.status!==404?this._source.fire(new t.j(we,{tile:R})):this.update(this.transform,this.terrain)}})}_unloadTile(R){this._source.unloadTile&&this._source.unloadTile(R)}_abortTile(R){this._source.abortTile&&this._source.abortTile(R),this._source.fire(new t.k("dataabort",{tile:R,coord:R.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(R){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let ae in this._tiles){let xe=this._tiles[ae];xe.upload(R),xe.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(R=>R.tileID).sort(Bt).map(R=>R.key)}getRenderableIds(R){let ae=[];for(let xe in this._tiles)this._isIdRenderable(xe,R)&&ae.push(this._tiles[xe]);return R?ae.sort((xe,we)=>{let Fe=xe.tileID,ct=we.tileID,bt=new t.P(Fe.canonical.x,Fe.canonical.y)._rotate(this.transform.angle),zt=new t.P(ct.canonical.x,ct.canonical.y)._rotate(this.transform.angle);return Fe.overscaledZ-ct.overscaledZ||zt.y-bt.y||zt.x-bt.x}).map(xe=>xe.tileID.key):ae.map(xe=>xe.tileID).sort(Bt).map(xe=>xe.key)}hasRenderableParent(R){let ae=this.findLoadedParent(R,0);return!!ae&&this._isIdRenderable(ae.tileID.key)}_isIdRenderable(R,ae){return this._tiles[R]&&this._tiles[R].hasData()&&!this._coveredTiles[R]&&(ae||!this._tiles[R].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let R in this._tiles)this._tiles[R].state!=="errored"&&this._reloadTile(R,"reloading")}}_reloadTile(R,ae){return t._(this,void 0,void 0,function*(){let xe=this._tiles[R];xe&&(xe.state!=="loading"&&(xe.state=ae),yield this._loadTile(xe,R,ae))})}_tileLoaded(R,ae,xe){R.timeAdded=i.now(),xe==="expired"&&(R.refreshedUponExpiration=!0),this._setTileReloadTimer(ae,R),this.getSource().type==="raster-dem"&&R.dem&&this._backfillDEM(R),this._state.initializeTileState(R,this.map?this.map.painter:null),R.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:R,coord:R.tileID}))}_backfillDEM(R){let ae=this.getRenderableIds();for(let we=0;we1||(Math.abs(ct)>1&&(Math.abs(ct+zt)===1?ct+=zt:Math.abs(ct-zt)===1&&(ct-=zt)),Fe.dem&&we.dem&&(we.dem.backfillBorder(Fe.dem,ct,bt),we.neighboringTiles&&we.neighboringTiles[Zt]&&(we.neighboringTiles[Zt].backfilled=!0)))}}getTile(R){return this.getTileByID(R.key)}getTileByID(R){return this._tiles[R]}_retainLoadedChildren(R,ae,xe,we){for(let Fe in this._tiles){let ct=this._tiles[Fe];if(we[Fe]||!ct.hasData()||ct.tileID.overscaledZ<=ae||ct.tileID.overscaledZ>xe)continue;let bt=ct.tileID;for(;ct&&ct.tileID.overscaledZ>ae+1;){let Zt=ct.tileID.scaledTo(ct.tileID.overscaledZ-1);ct=this._tiles[Zt.key],ct&&ct.hasData()&&(bt=Zt)}let zt=bt;for(;zt.overscaledZ>ae;)if(zt=zt.scaledTo(zt.overscaledZ-1),R[zt.key]){we[bt.key]=bt;break}}}findLoadedParent(R,ae){if(R.key in this._loadedParentTiles){let xe=this._loadedParentTiles[R.key];return xe&&xe.tileID.overscaledZ>=ae?xe:null}for(let xe=R.overscaledZ-1;xe>=ae;xe--){let we=R.scaledTo(xe),Fe=this._getLoadedTile(we);if(Fe)return Fe}}findLoadedSibling(R){return this._getLoadedTile(R)}_getLoadedTile(R){let ae=this._tiles[R.key];return ae&&ae.hasData()?ae:this._cache.getByKey(R.wrapped().key)}updateCacheSize(R){let ae=Math.ceil(R.width/this._source.tileSize)+1,xe=Math.ceil(R.height/this._source.tileSize)+1,we=Math.floor(ae*xe*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Fe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,we):we;this._cache.setMaxSize(Fe)}handleWrapJump(R){let ae=Math.round((R-(this._prevLng===void 0?R:this._prevLng))/360);if(this._prevLng=R,ae){let xe={};for(let we in this._tiles){let Fe=this._tiles[we];Fe.tileID=Fe.tileID.unwrapTo(Fe.tileID.wrap+ae),xe[Fe.tileID.key]=Fe}this._tiles=xe;for(let we in this._timers)clearTimeout(this._timers[we]),delete this._timers[we];for(let we in this._tiles)this._setTileReloadTimer(we,this._tiles[we])}}_updateCoveredAndRetainedTiles(R,ae,xe,we,Fe,ct){let bt={},zt={},Zt=Object.keys(R),gr=i.now();for(let yr of Zt){let Gr=R[yr],ta=this._tiles[yr];if(!ta||ta.fadeEndTime!==0&&ta.fadeEndTime<=gr)continue;let qe=this.findLoadedParent(Gr,ae),Ze=this.findLoadedSibling(Gr),it=qe||Ze||null;it&&(this._addTile(it.tileID),bt[it.tileID.key]=it.tileID),zt[yr]=Gr}this._retainLoadedChildren(zt,we,xe,R);for(let yr in bt)R[yr]||(this._coveredTiles[yr]=!0,R[yr]=bt[yr]);if(ct){let yr={},Gr={};for(let ta of Fe)this._tiles[ta.key].hasData()?yr[ta.key]=ta:Gr[ta.key]=ta;for(let ta in Gr){let qe=Gr[ta].children(this._source.maxzoom);this._tiles[qe[0].key]&&this._tiles[qe[1].key]&&this._tiles[qe[2].key]&&this._tiles[qe[3].key]&&(yr[qe[0].key]=R[qe[0].key]=qe[0],yr[qe[1].key]=R[qe[1].key]=qe[1],yr[qe[2].key]=R[qe[2].key]=qe[2],yr[qe[3].key]=R[qe[3].key]=qe[3],delete Gr[ta])}for(let ta in Gr){let qe=Gr[ta],Ze=this.findLoadedParent(qe,this._source.minzoom),it=this.findLoadedSibling(qe),ft=Ze||it||null;if(ft){yr[ft.tileID.key]=R[ft.tileID.key]=ft.tileID;for(let Mt in yr)yr[Mt].isChildOf(ft.tileID)&&delete yr[Mt]}}for(let ta in this._tiles)yr[ta]||(this._coveredTiles[ta]=!0)}}update(R,ae){if(!this._sourceLoaded||this._paused)return;let xe;this.transform=R,this.terrain=ae,this.updateCacheSize(R),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?xe=R.getVisibleUnwrappedCoordinates(this._source.tileID).map(gr=>new t.S(gr.canonical.z,gr.wrap,gr.canonical.z,gr.canonical.x,gr.canonical.y)):(xe=R.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ae}),this._source.hasTile&&(xe=xe.filter(gr=>this._source.hasTile(gr)))):xe=[];let we=R.coveringZoomLevel(this._source),Fe=Math.max(we-Et.maxOverzooming,this._source.minzoom),ct=Math.max(we+Et.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let gr={};for(let yr of xe)if(yr.canonical.z>this._source.minzoom){let Gr=yr.scaledTo(yr.canonical.z-1);gr[Gr.key]=Gr;let ta=yr.scaledTo(Math.max(this._source.minzoom,Math.min(yr.canonical.z,5)));gr[ta.key]=ta}xe=xe.concat(Object.values(gr))}let bt=xe.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,bt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let zt=this._updateRetainedTiles(xe,we);jt(this._source.type)&&this._updateCoveredAndRetainedTiles(zt,Fe,ct,we,xe,ae);for(let gr in zt)this._tiles[gr].clearFadeHold();let Zt=t.ab(this._tiles,zt);for(let gr of Zt){let yr=this._tiles[gr];yr.hasSymbolBuckets&&!yr.holdingForFade()?yr.setHoldDuration(this.map._fadeDuration):yr.hasSymbolBuckets&&!yr.symbolFadeFinished()||this._removeTile(gr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let R in this._tiles)this._tiles[R].holdingForFade()&&this._removeTile(R)}_updateRetainedTiles(R,ae){var xe;let we={},Fe={},ct=Math.max(ae-Et.maxOverzooming,this._source.minzoom),bt=Math.max(ae+Et.maxUnderzooming,this._source.minzoom),zt={};for(let Zt of R){let gr=this._addTile(Zt);we[Zt.key]=Zt,gr.hasData()||aethis._source.maxzoom){let Gr=Zt.children(this._source.maxzoom)[0],ta=this.getTile(Gr);if(ta&&ta.hasData()){we[Gr.key]=Gr;continue}}else{let Gr=Zt.children(this._source.maxzoom);if(we[Gr[0].key]&&we[Gr[1].key]&&we[Gr[2].key]&&we[Gr[3].key])continue}let yr=gr.wasRequested();for(let Gr=Zt.overscaledZ-1;Gr>=ct;--Gr){let ta=Zt.scaledTo(Gr);if(Fe[ta.key])break;if(Fe[ta.key]=!0,gr=this.getTile(ta),!gr&&yr&&(gr=this._addTile(ta)),gr){let qe=gr.hasData();if((qe||!(!((xe=this.map)===null||xe===void 0)&&xe.cancelPendingTileRequestsWhileZooming)||yr)&&(we[ta.key]=ta),yr=gr.wasRequested(),qe)break}}}return we}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let R in this._tiles){let ae=[],xe,we=this._tiles[R].tileID;for(;we.overscaledZ>0;){if(we.key in this._loadedParentTiles){xe=this._loadedParentTiles[we.key];break}ae.push(we.key);let Fe=we.scaledTo(we.overscaledZ-1);if(xe=this._getLoadedTile(Fe),xe)break;we=Fe}for(let Fe of ae)this._loadedParentTiles[Fe]=xe}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let R in this._tiles){let ae=this._tiles[R].tileID,xe=this._getLoadedTile(ae);this._loadedSiblingTiles[ae.key]=xe}}_addTile(R){let ae=this._tiles[R.key];if(ae)return ae;ae=this._cache.getAndRemove(R),ae&&(this._setTileReloadTimer(R.key,ae),ae.tileID=R,this._state.initializeTileState(ae,this.map?this.map.painter:null),this._cacheTimers[R.key]&&(clearTimeout(this._cacheTimers[R.key]),delete this._cacheTimers[R.key],this._setTileReloadTimer(R.key,ae)));let xe=ae;return ae||(ae=new nt(R,this._source.tileSize*R.overscaleFactor()),this._loadTile(ae,R.key,ae.state)),ae.uses++,this._tiles[R.key]=ae,xe||this._source.fire(new t.k("dataloading",{tile:ae,coord:ae.tileID,dataType:"source"})),ae}_setTileReloadTimer(R,ae){R in this._timers&&(clearTimeout(this._timers[R]),delete this._timers[R]);let xe=ae.getExpiryTimeout();xe&&(this._timers[R]=setTimeout(()=>{this._reloadTile(R,"expired"),delete this._timers[R]},xe))}_removeTile(R){let ae=this._tiles[R];ae&&(ae.uses--,delete this._tiles[R],this._timers[R]&&(clearTimeout(this._timers[R]),delete this._timers[R]),ae.uses>0||(ae.hasData()&&ae.state!=="reloading"?this._cache.add(ae.tileID,ae,ae.getExpiryTimeout()):(ae.aborted=!0,this._abortTile(ae),this._unloadTile(ae))))}_dataHandler(R){let ae=R.sourceDataType;R.dataType==="source"&&ae==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&R.dataType==="source"&&ae==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let R in this._tiles)this._removeTile(R);this._cache.reset()}tilesIn(R,ae,xe){let we=[],Fe=this.transform;if(!Fe)return we;let ct=xe?Fe.getCameraQueryGeometry(R):R,bt=R.map(qe=>Fe.pointCoordinate(qe,this.terrain)),zt=ct.map(qe=>Fe.pointCoordinate(qe,this.terrain)),Zt=this.getIds(),gr=1/0,yr=1/0,Gr=-1/0,ta=-1/0;for(let qe of zt)gr=Math.min(gr,qe.x),yr=Math.min(yr,qe.y),Gr=Math.max(Gr,qe.x),ta=Math.max(ta,qe.y);for(let qe=0;qe=0&&xt[1].y+Mt>=0){let Pt=bt.map(fr=>it.getTilePoint(fr)),ir=zt.map(fr=>it.getTilePoint(fr));we.push({tile:Ze,tileID:it,queryGeometry:Pt,cameraQueryGeometry:ir,scale:ft})}}return we}getVisibleCoordinates(R){let ae=this.getRenderableIds(R).map(xe=>this._tiles[xe].tileID);for(let xe of ae)xe.posMatrix=this.transform.calculatePosMatrix(xe.toUnwrapped());return ae}hasTransition(){if(this._source.hasTransition())return!0;if(jt(this._source.type)){let R=i.now();for(let ae in this._tiles)if(this._tiles[ae].fadeEndTime>=R)return!0}return!1}setFeatureState(R,ae,xe){this._state.updateState(R=R||"_geojsonTileLayer",ae,xe)}removeFeatureState(R,ae,xe){this._state.removeFeatureState(R=R||"_geojsonTileLayer",ae,xe)}getFeatureState(R,ae){return this._state.getState(R=R||"_geojsonTileLayer",ae)}setDependencies(R,ae,xe){let we=this._tiles[R];we&&we.setDependencies(ae,xe)}reloadTilesForDependencies(R,ae){for(let xe in this._tiles)this._tiles[xe].hasDependency(R,ae)&&this._reloadTile(xe,"reloading");this._cache.filter(xe=>!xe.hasDependency(R,ae))}}function Bt(Be,R){let ae=Math.abs(2*Be.wrap)-+(Be.wrap<0),xe=Math.abs(2*R.wrap)-+(R.wrap<0);return Be.overscaledZ-R.overscaledZ||xe-ae||R.canonical.y-Be.canonical.y||R.canonical.x-Be.canonical.x}function jt(Be){return Be==="raster"||Be==="image"||Be==="video"}Et.maxOverzooming=10,Et.maxUnderzooming=3;class _r{constructor(R,ae){this.reset(R,ae)}reset(R,ae){this.points=R||[],this._distances=[0];for(let xe=1;xe0?(we-ct)/bt:0;return this.points[Fe].mult(1-zt).add(this.points[ae].mult(zt))}}function pr(Be,R){let ae=!0;return Be==="always"||Be!=="never"&&R!=="never"||(ae=!1),ae}class Or{constructor(R,ae,xe){let we=this.boxCells=[],Fe=this.circleCells=[];this.xCellCount=Math.ceil(R/xe),this.yCellCount=Math.ceil(ae/xe);for(let ct=0;ctthis.width||we<0||ae>this.height)return[];let zt=[];if(R<=0&&ae<=0&&this.width<=xe&&this.height<=we){if(Fe)return[{key:null,x1:R,y1:ae,x2:xe,y2:we}];for(let Zt=0;Zt0}hitTestCircle(R,ae,xe,we,Fe){let ct=R-xe,bt=R+xe,zt=ae-xe,Zt=ae+xe;if(bt<0||ct>this.width||Zt<0||zt>this.height)return!1;let gr=[];return this._forEachCell(ct,zt,bt,Zt,this._queryCellCircle,gr,{hitTest:!0,overlapMode:we,circle:{x:R,y:ae,radius:xe},seenUids:{box:{},circle:{}}},Fe),gr.length>0}_queryCell(R,ae,xe,we,Fe,ct,bt,zt){let{seenUids:Zt,hitTest:gr,overlapMode:yr}=bt,Gr=this.boxCells[Fe];if(Gr!==null){let qe=this.bboxes;for(let Ze of Gr)if(!Zt.box[Ze]){Zt.box[Ze]=!0;let it=4*Ze,ft=this.boxKeys[Ze];if(R<=qe[it+2]&&ae<=qe[it+3]&&xe>=qe[it+0]&&we>=qe[it+1]&&(!zt||zt(ft))&&(!gr||!pr(yr,ft.overlapMode))&&(ct.push({key:ft,x1:qe[it],y1:qe[it+1],x2:qe[it+2],y2:qe[it+3]}),gr))return!0}}let ta=this.circleCells[Fe];if(ta!==null){let qe=this.circles;for(let Ze of ta)if(!Zt.circle[Ze]){Zt.circle[Ze]=!0;let it=3*Ze,ft=this.circleKeys[Ze];if(this._circleAndRectCollide(qe[it],qe[it+1],qe[it+2],R,ae,xe,we)&&(!zt||zt(ft))&&(!gr||!pr(yr,ft.overlapMode))){let Mt=qe[it],xt=qe[it+1],Pt=qe[it+2];if(ct.push({key:ft,x1:Mt-Pt,y1:xt-Pt,x2:Mt+Pt,y2:xt+Pt}),gr)return!0}}}return!1}_queryCellCircle(R,ae,xe,we,Fe,ct,bt,zt){let{circle:Zt,seenUids:gr,overlapMode:yr}=bt,Gr=this.boxCells[Fe];if(Gr!==null){let qe=this.bboxes;for(let Ze of Gr)if(!gr.box[Ze]){gr.box[Ze]=!0;let it=4*Ze,ft=this.boxKeys[Ze];if(this._circleAndRectCollide(Zt.x,Zt.y,Zt.radius,qe[it+0],qe[it+1],qe[it+2],qe[it+3])&&(!zt||zt(ft))&&!pr(yr,ft.overlapMode))return ct.push(!0),!0}}let ta=this.circleCells[Fe];if(ta!==null){let qe=this.circles;for(let Ze of ta)if(!gr.circle[Ze]){gr.circle[Ze]=!0;let it=3*Ze,ft=this.circleKeys[Ze];if(this._circlesCollide(qe[it],qe[it+1],qe[it+2],Zt.x,Zt.y,Zt.radius)&&(!zt||zt(ft))&&!pr(yr,ft.overlapMode))return ct.push(!0),!0}}}_forEachCell(R,ae,xe,we,Fe,ct,bt,zt){let Zt=this._convertToXCellCoord(R),gr=this._convertToYCellCoord(ae),yr=this._convertToXCellCoord(xe),Gr=this._convertToYCellCoord(we);for(let ta=Zt;ta<=yr;ta++)for(let qe=gr;qe<=Gr;qe++)if(Fe.call(this,R,ae,xe,we,this.xCellCount*qe+ta,ct,bt,zt))return}_convertToXCellCoord(R){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(R*this.xScale)))}_convertToYCellCoord(R){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(R*this.yScale)))}_circlesCollide(R,ae,xe,we,Fe,ct){let bt=we-R,zt=Fe-ae,Zt=xe+ct;return Zt*Zt>bt*bt+zt*zt}_circleAndRectCollide(R,ae,xe,we,Fe,ct,bt){let zt=(ct-we)/2,Zt=Math.abs(R-(we+zt));if(Zt>zt+xe)return!1;let gr=(bt-Fe)/2,yr=Math.abs(ae-(Fe+gr));if(yr>gr+xe)return!1;if(Zt<=zt||yr<=gr)return!0;let Gr=Zt-zt,ta=yr-gr;return Gr*Gr+ta*ta<=xe*xe}}function mr(Be,R,ae,xe,we){let Fe=t.H();return R?(t.K(Fe,Fe,[1/we,1/we,1]),ae||t.ad(Fe,Fe,xe.angle)):t.L(Fe,xe.labelPlaneMatrix,Be),Fe}function Er(Be,R,ae,xe,we){if(R){let Fe=t.ae(Be);return t.K(Fe,Fe,[we,we,1]),ae||t.ad(Fe,Fe,-xe.angle),Fe}return xe.glCoordMatrix}function yt(Be,R,ae,xe){let we;xe?(we=[Be,R,xe(Be,R),1],t.af(we,we,ae)):(we=[Be,R,0,1],Jt(we,we,ae));let Fe=we[3];return{point:new t.P(we[0]/Fe,we[1]/Fe),signedDistanceFromCamera:Fe,isOccluded:!1}}function Oe(Be,R){return .5+Be/R*.5}function Xe(Be,R){return Be.x>=-R[0]&&Be.x<=R[0]&&Be.y>=-R[1]&&Be.y<=R[1]}function be(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta,qe){let Ze=xe?Be.textSizeData:Be.iconSizeData,it=t.ag(Ze,ae.transform.zoom),ft=[256/ae.width*2+1,256/ae.height*2+1],Mt=xe?Be.text.dynamicLayoutVertexArray:Be.icon.dynamicLayoutVertexArray;Mt.clear();let xt=Be.lineVertexArray,Pt=xe?Be.text.placedSymbolArray:Be.icon.placedSymbolArray,ir=ae.transform.width/ae.transform.height,fr=!1;for(let wr=0;wrMath.abs(ae.x-R.x)*xe?{useVertical:!0}:(Be===t.ah.vertical?R.yae.x)?{needsFlipping:!0}:null}function Ee(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr){let yr=ae/24,Gr=R.lineOffsetX*yr,ta=R.lineOffsetY*yr,qe;if(R.numGlyphs>1){let Ze=R.glyphStartIndex+R.numGlyphs,it=R.lineStartIndex,ft=R.lineStartIndex+R.lineLength,Mt=Ce(yr,bt,Gr,ta,xe,R,gr,Be);if(!Mt)return{notEnoughRoom:!0};let xt=yt(Mt.first.point.x,Mt.first.point.y,ct,Be.getElevation).point,Pt=yt(Mt.last.point.x,Mt.last.point.y,ct,Be.getElevation).point;if(we&&!xe){let ir=Ne(R.writingMode,xt,Pt,Zt);if(ir)return ir}qe=[Mt.first];for(let ir=R.glyphStartIndex+1;ir0?xt.point:(function(fr,wr,zr,Xr,la,pa){return Se(fr,wr,zr,1,la,pa)})(Be.tileAnchorPoint,Mt,it,0,Fe,Be),ir=Ne(R.writingMode,it,Pt,Zt);if(ir)return ir}let Ze=Ct(yr*bt.getoffsetX(R.glyphStartIndex),Gr,ta,xe,R.segment,R.lineStartIndex,R.lineStartIndex+R.lineLength,Be,gr);if(!Ze||Be.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};qe=[Ze]}for(let Ze of qe)t.aj(zt,Ze.point,Ze.angle);return{}}function Se(Be,R,ae,xe,we,Fe){let ct=Be.add(Be.sub(R)._unit()),bt=we!==void 0?yt(ct.x,ct.y,we,Fe.getElevation).point:at(ct.x,ct.y,Fe).point,zt=ae.sub(bt);return ae.add(zt._mult(xe/zt.mag()))}function Le(Be,R,ae){let xe=R.projectionCache;if(xe.projections[Be])return xe.projections[Be];let we=new t.P(R.lineVertexArray.getx(Be),R.lineVertexArray.gety(Be)),Fe=at(we.x,we.y,R);if(Fe.signedDistanceFromCamera>0)return xe.projections[Be]=Fe.point,xe.anyProjectionOccluded=xe.anyProjectionOccluded||Fe.isOccluded,Fe.point;let ct=Be-ae.direction;return(function(bt,zt,Zt,gr,yr){return Se(bt,zt,Zt,gr,void 0,yr)})(ae.distanceFromAnchor===0?R.tileAnchorPoint:new t.P(R.lineVertexArray.getx(ct),R.lineVertexArray.gety(ct)),we,ae.previousVertex,ae.absOffsetX-ae.distanceFromAnchor+1,R)}function at(Be,R,ae){let xe=Be+ae.translation[0],we=R+ae.translation[1],Fe;return!ae.pitchWithMap&&ae.projection.useSpecialProjectionForSymbols?(Fe=ae.projection.projectTileCoordinates(xe,we,ae.unwrappedTileID,ae.getElevation),Fe.point.x=(.5*Fe.point.x+.5)*ae.width,Fe.point.y=(.5*-Fe.point.y+.5)*ae.height):(Fe=yt(xe,we,ae.labelPlaneMatrix,ae.getElevation),Fe.isOccluded=!1),Fe}function dt(Be,R,ae){return Be._unit()._perp()._mult(R*ae)}function gt(Be,R,ae,xe,we,Fe,ct,bt,zt){if(bt.projectionCache.offsets[Be])return bt.projectionCache.offsets[Be];let Zt=ae.add(R);if(Be+zt.direction=we)return bt.projectionCache.offsets[Be]=Zt,Zt;let gr=Le(Be+zt.direction,bt,zt),yr=dt(gr.sub(ae),ct,zt.direction),Gr=ae.add(yr),ta=gr.add(yr);return bt.projectionCache.offsets[Be]=t.ak(Fe,Zt,Gr,ta)||Zt,bt.projectionCache.offsets[Be]}function Ct(Be,R,ae,xe,we,Fe,ct,bt,zt){let Zt=xe?Be-R:Be+R,gr=Zt>0?1:-1,yr=0;xe&&(gr*=-1,yr=Math.PI),gr<0&&(yr+=Math.PI);let Gr,ta=gr>0?Fe+we:Fe+we+1;bt.projectionCache.cachedAnchorPoint?Gr=bt.projectionCache.cachedAnchorPoint:(Gr=at(bt.tileAnchorPoint.x,bt.tileAnchorPoint.y,bt).point,bt.projectionCache.cachedAnchorPoint=Gr);let qe,Ze,it=Gr,ft=Gr,Mt=0,xt=0,Pt=Math.abs(Zt),ir=[],fr;for(;Mt+xt<=Pt;){if(ta+=gr,ta=ct)return null;Mt+=xt,ft=it,Ze=qe;let Xr={absOffsetX:Pt,direction:gr,distanceFromAnchor:Mt,previousVertex:ft};if(it=Le(ta,bt,Xr),ae===0)ir.push(ft),fr=it.sub(ft);else{let la,pa=it.sub(ft);la=pa.mag()===0?dt(Le(ta+gr,bt,Xr).sub(it),ae,gr):dt(pa,ae,gr),Ze||(Ze=ft.add(la)),qe=gt(ta,la,it,Fe,ct,Ze,ae,bt,Xr),ir.push(Ze),fr=qe.sub(Ze)}xt=fr.mag()}let wr=fr._mult((Pt-Mt)/xt)._add(Ze||ft),zr=yr+Math.atan2(it.y-ft.y,it.x-ft.x);return ir.push(wr),{point:wr,angle:zt?zr:0,path:ir}}let or=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Qt(Be,R){for(let ae=0;ae=1;Ai--)Yn.push(Dn.path[Ai]);for(let Ai=1;Ailo.signedDistanceFromCamera<=0)?[]:Ai.map(lo=>lo.point)}let Di=[];if(Yn.length>0){let Ai=Yn[0].clone(),lo=Yn[0].clone();for(let Vo=1;Vo=pa.x&&lo.x<=ka.x&&Ai.y>=pa.y&&lo.y<=ka.y?[Yn]:lo.xka.x||lo.yka.y?[]:t.al([Yn],pa.x,pa.y,ka.x,ka.y)}for(let Ai of Di){tn.reset(Ai,.25*la);let lo=0;lo=tn.length<=.5*la?1:Math.ceil(tn.paddedLength/di)+1;for(let Vo=0;Voyt(we.x,we.y,xe,ae.getElevation))}queryRenderedSymbols(R){if(R.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let ae=[],xe=1/0,we=1/0,Fe=-1/0,ct=-1/0;for(let gr of R){let yr=new t.P(gr.x+Sr,gr.y+Sr);xe=Math.min(xe,yr.x),we=Math.min(we,yr.y),Fe=Math.max(Fe,yr.x),ct=Math.max(ct,yr.y),ae.push(yr)}let bt=this.grid.query(xe,we,Fe,ct).concat(this.ignoredGrid.query(xe,we,Fe,ct)),zt={},Zt={};for(let gr of bt){let yr=gr.key;if(zt[yr.bucketInstanceId]===void 0&&(zt[yr.bucketInstanceId]={}),zt[yr.bucketInstanceId][yr.featureIndex])continue;let Gr=[new t.P(gr.x1,gr.y1),new t.P(gr.x2,gr.y1),new t.P(gr.x2,gr.y2),new t.P(gr.x1,gr.y2)];t.am(ae,Gr)&&(zt[yr.bucketInstanceId][yr.featureIndex]=!0,Zt[yr.bucketInstanceId]===void 0&&(Zt[yr.bucketInstanceId]=[]),Zt[yr.bucketInstanceId].push(yr.featureIndex))}return Zt}insertCollisionBox(R,ae,xe,we,Fe,ct){(xe?this.ignoredGrid:this.grid).insert({bucketInstanceId:we,featureIndex:Fe,collisionGroupID:ct,overlapMode:ae},R[0],R[1],R[2],R[3])}insertCollisionCircles(R,ae,xe,we,Fe,ct){let bt=xe?this.ignoredGrid:this.grid,zt={bucketInstanceId:we,featureIndex:Fe,collisionGroupID:ct,overlapMode:ae};for(let Zt=0;Zt=this.screenRightBoundary||wethis.screenBottomBoundary}isInsideGrid(R,ae,xe,we){return xe>=0&&R=0&&aethis.projectAndGetPerspectiveRatio(xe,la.x,la.y,we,Zt));zr=Xr.some(la=>!la.isOccluded),wr=Xr.map(la=>la.point)}else zr=!0;return{box:t.ao(wr),allPointsOccluded:!zr}}}function Ea(Be,R,ae){return R*(t.X/(Be.tileSize*Math.pow(2,ae-Be.tileID.overscaledZ)))}class Sa{constructor(R,ae,xe,we){this.opacity=R?Math.max(0,Math.min(1,R.opacity+(R.placed?ae:-ae))):we&&xe?1:0,this.placed=xe}isHidden(){return this.opacity===0&&!this.placed}}class za{constructor(R,ae,xe,we,Fe){this.text=new Sa(R?R.text:null,ae,xe,Fe),this.icon=new Sa(R?R.icon:null,ae,we,Fe)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Na{constructor(R,ae,xe){this.text=R,this.icon=ae,this.skipFade=xe}}class Ta{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class nn{constructor(R,ae,xe,we,Fe){this.bucketInstanceId=R,this.featureIndex=ae,this.sourceLayerIndex=xe,this.bucketIndex=we,this.tileID=Fe}}class gn{constructor(R){this.crossSourceCollisions=R,this.maxGroupID=0,this.collisionGroups={}}get(R){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[R]){let ae=++this.maxGroupID;this.collisionGroups[R]={ID:ae,predicate:xe=>xe.collisionGroupID===ae}}return this.collisionGroups[R]}}function Ht(Be,R,ae,xe,we){let{horizontalAlign:Fe,verticalAlign:ct}=t.au(Be);return new t.P(-(Fe-.5)*R+xe[0]*we,-(ct-.5)*ae+xe[1]*we)}class It{constructor(R,ae,xe,we,Fe,ct){this.transform=R.clone(),this.terrain=xe,this.collisionIndex=new oa(this.transform,ae),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=we,this.retainedQueryData={},this.collisionGroups=new gn(Fe),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ct,ct&&(ct.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(R){let ae=this.terrain;return ae?(xe,we)=>ae.getElevation(R,xe,we):null}getBucketParts(R,ae,xe,we){let Fe=xe.getBucket(ae),ct=xe.latestFeatureIndex;if(!Fe||!ct||ae.id!==Fe.layerIds[0])return;let bt=xe.collisionBoxArray,zt=Fe.layers[0].layout,Zt=Fe.layers[0].paint,gr=Math.pow(2,this.transform.zoom-xe.tileID.overscaledZ),yr=xe.tileSize/t.X,Gr=xe.tileID.toUnwrapped(),ta=this.transform.calculatePosMatrix(Gr),qe=zt.get("text-pitch-alignment")==="map",Ze=zt.get("text-rotation-alignment")==="map",it=Ea(xe,1,this.transform.zoom),ft=this.collisionIndex.mapProjection.translatePosition(this.transform,xe,Zt.get("text-translate"),Zt.get("text-translate-anchor")),Mt=this.collisionIndex.mapProjection.translatePosition(this.transform,xe,Zt.get("icon-translate"),Zt.get("icon-translate-anchor")),xt=mr(ta,qe,Ze,this.transform,it),Pt=null;if(qe){let fr=Er(ta,qe,Ze,this.transform,it);Pt=t.L([],this.transform.labelPlaneMatrix,fr)}this.retainedQueryData[Fe.bucketInstanceId]=new nn(Fe.bucketInstanceId,ct,Fe.sourceLayerIndex,Fe.index,xe.tileID);let ir={bucket:Fe,layout:zt,translationText:ft,translationIcon:Mt,posMatrix:ta,unwrappedTileID:Gr,textLabelPlaneMatrix:xt,labelToScreenMatrix:Pt,scale:gr,textPixelRatio:yr,holdingForFade:xe.holdingForFade(),collisionBoxArray:bt,partiallyEvaluatedTextSize:t.ag(Fe.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Fe.sourceID)};if(we)for(let fr of Fe.sortKeyRanges){let{sortKey:wr,symbolInstanceStart:zr,symbolInstanceEnd:Xr}=fr;R.push({sortKey:wr,symbolInstanceStart:zr,symbolInstanceEnd:Xr,parameters:ir})}else R.push({symbolInstanceStart:0,symbolInstanceEnd:Fe.symbolInstances.length,parameters:ir})}attemptAnchorPlacement(R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta,qe,Ze,it,ft,Mt,xt){let Pt=t.aq[R.textAnchor],ir=[R.textOffset0,R.textOffset1],fr=Ht(Pt,xe,we,ir,Fe),wr=this.collisionIndex.placeCollisionBox(ae,Gr,zt,Zt,gr,bt,ct,it,yr.predicate,xt,fr);if((!Mt||this.collisionIndex.placeCollisionBox(Mt,Gr,zt,Zt,gr,bt,ct,ft,yr.predicate,xt,fr).placeable)&&wr.placeable){let zr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[ta.crossTileID]&&this.prevPlacement.placements[ta.crossTileID]&&this.prevPlacement.placements[ta.crossTileID].text&&(zr=this.prevPlacement.variableOffsets[ta.crossTileID].anchor),ta.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[ta.crossTileID]={textOffset:ir,width:xe,height:we,anchor:Pt,textBoxScale:Fe,prevAnchor:zr},this.markUsedJustification(qe,Pt,ta,Ze),qe.allowVerticalPlacement&&(this.markUsedOrientation(qe,Ze,ta),this.placedOrientations[ta.crossTileID]=Ze),{shift:fr,placedGlyphBoxes:wr}}}placeLayerBucketPart(R,ae,xe){let{bucket:we,layout:Fe,translationText:ct,translationIcon:bt,posMatrix:zt,unwrappedTileID:Zt,textLabelPlaneMatrix:gr,labelToScreenMatrix:yr,textPixelRatio:Gr,holdingForFade:ta,collisionBoxArray:qe,partiallyEvaluatedTextSize:Ze,collisionGroup:it}=R.parameters,ft=Fe.get("text-optional"),Mt=Fe.get("icon-optional"),xt=t.ar(Fe,"text-overlap","text-allow-overlap"),Pt=xt==="always",ir=t.ar(Fe,"icon-overlap","icon-allow-overlap"),fr=ir==="always",wr=Fe.get("text-rotation-alignment")==="map",zr=Fe.get("text-pitch-alignment")==="map",Xr=Fe.get("icon-text-fit")!=="none",la=Fe.get("symbol-z-order")==="viewport-y",pa=Pt&&(fr||!we.hasIconData()||Mt),ka=fr&&(Pt||!we.hasTextData()||ft);!we.collisionArrays&&qe&&we.deserializeCollisionBoxes(qe);let tn=this._getTerrainElevationFunc(this.retainedQueryData[we.bucketInstanceId].tileID),Dn=(In,Yn,di)=>{var Di,Ai;if(ae[In.crossTileID])return;if(ta)return void(this.placements[In.crossTileID]=new Na(!1,!1,!1));let lo=!1,Vo=!1,co=!0,Lo=null,Zo={box:null,placeable:!1,offscreen:null},Os={box:null,placeable:!1,offscreen:null},Ls=null,Do=null,zo=null,il=0,Sl=0,eu=0;Yn.textFeatureIndex?il=Yn.textFeatureIndex:In.useRuntimeCollisionCircles&&(il=In.featureIndex),Yn.verticalTextFeatureIndex&&(Sl=Yn.verticalTextFeatureIndex);let Fl=Yn.textBox;if(Fl){let dl=Je=>{let ht=t.ah.horizontal;if(we.allowVerticalPlacement&&!Je&&this.prevPlacement){let mt=this.prevPlacement.placedOrientations[In.crossTileID];mt&&(this.placedOrientations[In.crossTileID]=mt,ht=mt,this.markUsedOrientation(we,ht,In))}return ht},pl=(Je,ht)=>{if(we.allowVerticalPlacement&&In.numVerticalGlyphVertices>0&&Yn.verticalTextBox){for(let mt of we.writingModes)if(mt===t.ah.vertical?(Zo=ht(),Os=Zo):Zo=Je(),Zo&&Zo.placeable)break}else Zo=Je()},ve=In.textAnchorOffsetStartIndex,Re=In.textAnchorOffsetEndIndex;if(Re===ve){let Je=(ht,mt)=>{let wt=this.collisionIndex.placeCollisionBox(ht,xt,Gr,zt,Zt,zr,wr,ct,it.predicate,tn);return wt&&wt.placeable&&(this.markUsedOrientation(we,mt,In),this.placedOrientations[In.crossTileID]=mt),wt};pl(()=>Je(Fl,t.ah.horizontal),()=>{let ht=Yn.verticalTextBox;return we.allowVerticalPlacement&&In.numVerticalGlyphVertices>0&&ht?Je(ht,t.ah.vertical):{box:null,offscreen:null}}),dl(Zo&&Zo.placeable)}else{let Je=t.aq[(Ai=(Di=this.prevPlacement)===null||Di===void 0?void 0:Di.variableOffsets[In.crossTileID])===null||Ai===void 0?void 0:Ai.anchor],ht=(wt,$t,Rt)=>{let hr=wt.x2-wt.x1,Br=wt.y2-wt.y1,jr=In.textBoxScale,va=Xr&&ir==="never"?$t:null,ua=null,Ha=xt==="never"?1:2,Za="never";Je&&Ha++;for(let ya=0;yaht(Fl,Yn.iconBox,t.ah.horizontal),()=>{let wt=Yn.verticalTextBox;return we.allowVerticalPlacement&&(!Zo||!Zo.placeable)&&In.numVerticalGlyphVertices>0&&wt?ht(wt,Yn.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Zo&&(lo=Zo.placeable,co=Zo.offscreen);let mt=dl(Zo&&Zo.placeable);if(!lo&&this.prevPlacement){let wt=this.prevPlacement.variableOffsets[In.crossTileID];wt&&(this.variableOffsets[In.crossTileID]=wt,this.markUsedJustification(we,wt.anchor,In,mt))}}}if(Ls=Zo,lo=Ls&&Ls.placeable,co=Ls&&Ls.offscreen,In.useRuntimeCollisionCircles){let dl=we.text.placedSymbolArray.get(In.centerJustifiedTextSymbolIndex),pl=t.ai(we.textSizeData,Ze,dl),ve=Fe.get("text-padding");Do=this.collisionIndex.placeCollisionCircles(xt,dl,we.lineVertexArray,we.glyphOffsetArray,pl,zt,Zt,gr,yr,xe,zr,it.predicate,In.collisionCircleDiameter,ve,ct,tn),Do.circles.length&&Do.collisionDetected&&!xe&&t.w("Collisions detected, but collision boxes are not shown"),lo=Pt||Do.circles.length>0&&!Do.collisionDetected,co=co&&Do.offscreen}if(Yn.iconFeatureIndex&&(eu=Yn.iconFeatureIndex),Yn.iconBox){let dl=pl=>this.collisionIndex.placeCollisionBox(pl,ir,Gr,zt,Zt,zr,wr,bt,it.predicate,tn,Xr&&Lo?Lo:void 0);Os&&Os.placeable&&Yn.verticalIconBox?(zo=dl(Yn.verticalIconBox),Vo=zo.placeable):(zo=dl(Yn.iconBox),Vo=zo.placeable),co=co&&zo.offscreen}let Js=ft||In.numHorizontalGlyphVertices===0&&In.numVerticalGlyphVertices===0,Il=Mt||In.numIconVertices===0;Js||Il?Il?Js||(Vo=Vo&&lo):lo=Vo&&lo:Vo=lo=Vo&&lo;let ku=Vo&&zo.placeable;if(lo&&Ls.placeable&&this.collisionIndex.insertCollisionBox(Ls.box,xt,Fe.get("text-ignore-placement"),we.bucketInstanceId,Os&&Os.placeable&&Sl?Sl:il,it.ID),ku&&this.collisionIndex.insertCollisionBox(zo.box,ir,Fe.get("icon-ignore-placement"),we.bucketInstanceId,eu,it.ID),Do&&lo&&this.collisionIndex.insertCollisionCircles(Do.circles,xt,Fe.get("text-ignore-placement"),we.bucketInstanceId,il,it.ID),xe&&this.storeCollisionData(we.bucketInstanceId,di,Yn,Ls,zo,Do),In.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(we.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[In.crossTileID]=new Na(lo||pa,Vo||ka,co||we.justReloaded),ae[In.crossTileID]=!0};if(la){if(R.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let In=we.getSortedSymbolIndexes(this.transform.angle);for(let Yn=In.length-1;Yn>=0;--Yn){let di=In[Yn];Dn(we.symbolInstances.get(di),we.collisionArrays[di],di)}}else for(let In=R.symbolInstanceStart;In=0&&(R.text.placedSymbolArray.get(bt).crossTileID=Fe>=0&&bt!==Fe?0:xe.crossTileID)}markUsedOrientation(R,ae,xe){let we=ae===t.ah.horizontal||ae===t.ah.horizontalOnly?ae:0,Fe=ae===t.ah.vertical?ae:0,ct=[xe.leftJustifiedTextSymbolIndex,xe.centerJustifiedTextSymbolIndex,xe.rightJustifiedTextSymbolIndex];for(let bt of ct)R.text.placedSymbolArray.get(bt).placedOrientation=we;xe.verticalPlacedTextSymbolIndex&&(R.text.placedSymbolArray.get(xe.verticalPlacedTextSymbolIndex).placedOrientation=Fe)}commit(R){this.commitTime=R,this.zoomAtLastRecencyCheck=this.transform.zoom;let ae=this.prevPlacement,xe=!1;this.prevZoomAdjustment=ae?ae.zoomAdjustment(this.transform.zoom):0;let we=ae?ae.symbolFadeChange(R):1,Fe=ae?ae.opacities:{},ct=ae?ae.variableOffsets:{},bt=ae?ae.placedOrientations:{};for(let zt in this.placements){let Zt=this.placements[zt],gr=Fe[zt];gr?(this.opacities[zt]=new za(gr,we,Zt.text,Zt.icon),xe=xe||Zt.text!==gr.text.placed||Zt.icon!==gr.icon.placed):(this.opacities[zt]=new za(null,we,Zt.text,Zt.icon,Zt.skipFade),xe=xe||Zt.text||Zt.icon)}for(let zt in Fe){let Zt=Fe[zt];if(!this.opacities[zt]){let gr=new za(Zt,we,!1,!1);gr.isHidden()||(this.opacities[zt]=gr,xe=xe||Zt.text.placed||Zt.icon.placed)}}for(let zt in ct)this.variableOffsets[zt]||!this.opacities[zt]||this.opacities[zt].isHidden()||(this.variableOffsets[zt]=ct[zt]);for(let zt in bt)this.placedOrientations[zt]||!this.opacities[zt]||this.opacities[zt].isHidden()||(this.placedOrientations[zt]=bt[zt]);if(ae&&ae.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");xe?this.lastPlacementChangeTime=R:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ae?ae.lastPlacementChangeTime:R)}updateLayerOpacities(R,ae){let xe={};for(let we of ae){let Fe=we.getBucket(R);Fe&&we.latestFeatureIndex&&R.id===Fe.layerIds[0]&&this.updateBucketOpacities(Fe,we.tileID,xe,we.collisionBoxArray)}}updateBucketOpacities(R,ae,xe,we){R.hasTextData()&&(R.text.opacityVertexArray.clear(),R.text.hasVisibleVertices=!1),R.hasIconData()&&(R.icon.opacityVertexArray.clear(),R.icon.hasVisibleVertices=!1),R.hasIconCollisionBoxData()&&R.iconCollisionBox.collisionVertexArray.clear(),R.hasTextCollisionBoxData()&&R.textCollisionBox.collisionVertexArray.clear();let Fe=R.layers[0],ct=Fe.layout,bt=new za(null,0,!1,!1,!0),zt=ct.get("text-allow-overlap"),Zt=ct.get("icon-allow-overlap"),gr=Fe._unevaluatedLayout.hasValue("text-variable-anchor")||Fe._unevaluatedLayout.hasValue("text-variable-anchor-offset"),yr=ct.get("text-rotation-alignment")==="map",Gr=ct.get("text-pitch-alignment")==="map",ta=ct.get("icon-text-fit")!=="none",qe=new za(null,0,zt&&(Zt||!R.hasIconData()||ct.get("icon-optional")),Zt&&(zt||!R.hasTextData()||ct.get("text-optional")),!0);!R.collisionArrays&&we&&(R.hasIconCollisionBoxData()||R.hasTextCollisionBoxData())&&R.deserializeCollisionBoxes(we);let Ze=(ft,Mt,xt)=>{for(let Pt=0;Pt0,zr=this.placedOrientations[Mt.crossTileID],Xr=zr===t.ah.vertical,la=zr===t.ah.horizontal||zr===t.ah.horizontalOnly;if(xt>0||Pt>0){let ka=ja(fr.text);Ze(R.text,xt,Xr?Xa:ka),Ze(R.text,Pt,la?Xa:ka);let tn=fr.text.isHidden();[Mt.rightJustifiedTextSymbolIndex,Mt.centerJustifiedTextSymbolIndex,Mt.leftJustifiedTextSymbolIndex].forEach(Yn=>{Yn>=0&&(R.text.placedSymbolArray.get(Yn).hidden=tn||Xr?1:0)}),Mt.verticalPlacedTextSymbolIndex>=0&&(R.text.placedSymbolArray.get(Mt.verticalPlacedTextSymbolIndex).hidden=tn||la?1:0);let Dn=this.variableOffsets[Mt.crossTileID];Dn&&this.markUsedJustification(R,Dn.anchor,Mt,zr);let In=this.placedOrientations[Mt.crossTileID];In&&(this.markUsedJustification(R,"left",Mt,In),this.markUsedOrientation(R,In,Mt))}if(wr){let ka=ja(fr.icon),tn=!(ta&&Mt.verticalPlacedIconSymbolIndex&&Xr);Mt.placedIconSymbolIndex>=0&&(Ze(R.icon,Mt.numIconVertices,tn?ka:Xa),R.icon.placedSymbolArray.get(Mt.placedIconSymbolIndex).hidden=fr.icon.isHidden()),Mt.verticalPlacedIconSymbolIndex>=0&&(Ze(R.icon,Mt.numVerticalIconVertices,tn?Xa:ka),R.icon.placedSymbolArray.get(Mt.verticalPlacedIconSymbolIndex).hidden=fr.icon.isHidden())}let pa=it&&it.has(ft)?it.get(ft):{text:null,icon:null};if(R.hasIconCollisionBoxData()||R.hasTextCollisionBoxData()){let ka=R.collisionArrays[ft];if(ka){let tn=new t.P(0,0);if(ka.textBox||ka.verticalTextBox){let Dn=!0;if(gr){let In=this.variableOffsets[ir];In?(tn=Ht(In.anchor,In.width,In.height,In.textOffset,In.textBoxScale),yr&&tn._rotate(Gr?this.transform.angle:-this.transform.angle)):Dn=!1}if(ka.textBox||ka.verticalTextBox){let In;ka.textBox&&(In=Xr),ka.verticalTextBox&&(In=la),Gt(R.textCollisionBox.collisionVertexArray,fr.text.placed,!Dn||In,pa.text,tn.x,tn.y)}}if(ka.iconBox||ka.verticalIconBox){let Dn=!!(!la&&ka.verticalIconBox),In;ka.iconBox&&(In=Dn),ka.verticalIconBox&&(In=!Dn),Gt(R.iconCollisionBox.collisionVertexArray,fr.icon.placed,In,pa.icon,ta?tn.x:0,ta?tn.y:0)}}}}if(R.sortFeatures(this.transform.angle),this.retainedQueryData[R.bucketInstanceId]&&(this.retainedQueryData[R.bucketInstanceId].featureSortOrder=R.featureSortOrder),R.hasTextData()&&R.text.opacityVertexBuffer&&R.text.opacityVertexBuffer.updateData(R.text.opacityVertexArray),R.hasIconData()&&R.icon.opacityVertexBuffer&&R.icon.opacityVertexBuffer.updateData(R.icon.opacityVertexArray),R.hasIconCollisionBoxData()&&R.iconCollisionBox.collisionVertexBuffer&&R.iconCollisionBox.collisionVertexBuffer.updateData(R.iconCollisionBox.collisionVertexArray),R.hasTextCollisionBoxData()&&R.textCollisionBox.collisionVertexBuffer&&R.textCollisionBox.collisionVertexBuffer.updateData(R.textCollisionBox.collisionVertexArray),R.text.opacityVertexArray.length!==R.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${R.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${R.text.layoutVertexArray.length}) / 4`);if(R.icon.opacityVertexArray.length!==R.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${R.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${R.icon.layoutVertexArray.length}) / 4`);if(R.bucketInstanceId in this.collisionCircleArrays){let ft=this.collisionCircleArrays[R.bucketInstanceId];R.placementInvProjMatrix=ft.invProjMatrix,R.placementViewportMatrix=ft.viewportMatrix,R.collisionCircleArray=ft.circles,delete this.collisionCircleArrays[R.bucketInstanceId]}}symbolFadeChange(R){return this.fadeDuration===0?1:(R-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(R){return Math.max(0,(this.transform.zoom-R)/1.5)}hasTransitions(R){return this.stale||R-this.lastPlacementChangeTimeR}setStale(){this.stale=!0}}function Gt(Be,R,ae,xe,we,Fe){xe&&xe.length!==0||(xe=[0,0,0,0]);let ct=xe[0]-Sr,bt=xe[1]-Sr,zt=xe[2]-Sr,Zt=xe[3]-Sr;Be.emplaceBack(R?1:0,ae?1:0,we||0,Fe||0,ct,bt),Be.emplaceBack(R?1:0,ae?1:0,we||0,Fe||0,zt,bt),Be.emplaceBack(R?1:0,ae?1:0,we||0,Fe||0,zt,Zt),Be.emplaceBack(R?1:0,ae?1:0,we||0,Fe||0,ct,Zt)}let Xt=Math.pow(2,25),Rr=Math.pow(2,24),Yr=Math.pow(2,17),Jr=Math.pow(2,16),ia=Math.pow(2,9),Pa=Math.pow(2,8),Ga=Math.pow(2,1);function ja(Be){if(Be.opacity===0&&!Be.placed)return 0;if(Be.opacity===1&&Be.placed)return 4294967295;let R=Be.placed?1:0,ae=Math.floor(127*Be.opacity);return ae*Xt+R*Rr+ae*Yr+R*Jr+ae*ia+R*Pa+ae*Ga+R}let Xa=0;function sn(){return{isOccluded:(Be,R,ae)=>!1,getPitchedTextCorrection:(Be,R,ae)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Be,R,ae,xe){throw new Error("Not implemented.")},translatePosition:(Be,R,ae,xe)=>(function(we,Fe,ct,bt,zt=!1){if(!ct[0]&&!ct[1])return[0,0];let Zt=zt?bt==="map"?we.angle:0:bt==="viewport"?-we.angle:0;if(Zt){let gr=Math.sin(Zt),yr=Math.cos(Zt);ct=[ct[0]*yr-ct[1]*gr,ct[0]*gr+ct[1]*yr]}return[zt?ct[0]:Ea(Fe,ct[0],we.zoom),zt?ct[1]:Ea(Fe,ct[1],we.zoom)]})(Be,R,ae,xe),getCircleRadiusCorrection:Be=>1}}class Ma{constructor(R){this._sortAcrossTiles=R.layout.get("symbol-z-order")!=="viewport-y"&&!R.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(R,ae,xe,we,Fe){let ct=this._bucketParts;for(;this._currentTileIndexbt.sortKey-zt.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-we>2;for(;this._currentPlacementIndex>=0;){let ct=ae[R[this._currentPlacementIndex]],bt=this.placement.collisionIndex.transform.zoom;if(ct.type==="symbol"&&(!ct.minzoom||ct.minzoom<=bt)&&(!ct.maxzoom||ct.maxzoom>bt)){if(this._inProgressLayer||(this._inProgressLayer=new Ma(ct)),this._inProgressLayer.continuePlacement(xe[ct.source],this.placement,this._showCollisionBoxes,ct,Fe))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(R){return this.placement.commit(R),this.placement}}let Kn=512/t.X/2;class St{constructor(R,ae,xe){this.tileID=R,this.bucketInstanceId=xe,this._symbolsByKey={};let we=new Map;for(let Fe=0;Fe({x:Math.floor(zt.anchorX*Kn),y:Math.floor(zt.anchorY*Kn)})),crossTileIDs:ct.map(zt=>zt.crossTileID)};if(bt.positions.length>128){let zt=new t.av(bt.positions.length,16,Uint16Array);for(let{x:Zt,y:gr}of bt.positions)zt.add(Zt,gr);zt.finish(),delete bt.positions,bt.index=zt}this._symbolsByKey[Fe]=bt}}getScaledCoordinates(R,ae){let{x:xe,y:we,z:Fe}=this.tileID.canonical,{x:ct,y:bt,z:zt}=ae.canonical,Zt=Kn/Math.pow(2,zt-Fe),gr=(bt*t.X+R.anchorY)*Zt,yr=we*t.X*Kn;return{x:Math.floor((ct*t.X+R.anchorX)*Zt-xe*t.X*Kn),y:Math.floor(gr-yr)}}findMatches(R,ae,xe){let we=this.tileID.canonical.zR)}}class lt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class br{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(R){let ae=Math.round((R-this.lng)/360);if(ae!==0)for(let xe in this.indexes){let we=this.indexes[xe],Fe={};for(let ct in we){let bt=we[ct];bt.tileID=bt.tileID.unwrapTo(bt.tileID.wrap+ae),Fe[bt.tileID.key]=bt}this.indexes[xe]=Fe}this.lng=R}addBucket(R,ae,xe){if(this.indexes[R.overscaledZ]&&this.indexes[R.overscaledZ][R.key]){if(this.indexes[R.overscaledZ][R.key].bucketInstanceId===ae.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(R.overscaledZ,this.indexes[R.overscaledZ][R.key])}for(let Fe=0;FeR.overscaledZ)for(let bt in ct){let zt=ct[bt];zt.tileID.isChildOf(R)&&zt.findMatches(ae.symbolInstances,R,we)}else{let bt=ct[R.scaledTo(Number(Fe)).key];bt&&bt.findMatches(ae.symbolInstances,R,we)}}for(let Fe=0;Fe{ae[xe]=!0});for(let xe in this.layerIndexes)ae[xe]||delete this.layerIndexes[xe]}}let Lr=(Be,R)=>t.t(Be,R&&R.filter(ae=>ae.identifier!=="source.canvas")),Tr=t.aw();class Cr extends t.E{constructor(R,ae={}){super(),this._rtlPluginLoaded=()=>{for(let xe in this.sourceCaches){let we=this.sourceCaches[xe].getSource().type;we!=="vector"&&we!=="geojson"||this.sourceCaches[xe].reload()}},this.map=R,this.dispatcher=new J($(),R._getMapId()),this.dispatcher.registerMessageHandler("GG",(xe,we)=>this.getGlyphs(xe,we)),this.dispatcher.registerMessageHandler("GI",(xe,we)=>this.getImages(xe,we)),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new F(R._requestManager,ae.localIdeographFontFamily),this.lineAtlas=new W(256,512),this.crossTileSymbolIndex=new kr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),Qe().on(ge,this._rtlPluginLoaded),this.on("data",xe=>{if(xe.dataType!=="source"||xe.sourceDataType!=="metadata")return;let we=this.sourceCaches[xe.sourceId];if(!we)return;let Fe=we.getSource();if(Fe&&Fe.vectorLayerIds)for(let ct in this._layers){let bt=this._layers[ct];bt.source===Fe.id&&this._validateLayer(bt)}})}loadURL(R,ae={},xe){this.fire(new t.k("dataloading",{dataType:"style"})),ae.validate=typeof ae.validate!="boolean"||ae.validate;let we=this.map._requestManager.transformRequest(R,"Style");this._loadStyleRequest=new AbortController;let Fe=this._loadStyleRequest;t.h(we,this._loadStyleRequest).then(ct=>{this._loadStyleRequest=null,this._load(ct.data,ae,xe)}).catch(ct=>{this._loadStyleRequest=null,ct&&!Fe.signal.aborted&&this.fire(new t.j(ct))})}loadJSON(R,ae={},xe){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ae.validate=ae.validate!==!1,this._load(R,ae,xe)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Tr,{validate:!1})}_load(R,ae,xe){var we;let Fe=ae.transformStyle?ae.transformStyle(xe,R):R;if(!ae.validate||!Lr(this,t.u(Fe))){this._loaded=!0,this.stylesheet=Fe;for(let ct in Fe.sources)this.addSource(ct,Fe.sources[ct],{validate:!1});Fe.sprite?this._loadSprite(Fe.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Fe.glyphs),this._createLayers(),this.light=new I(this.stylesheet.light),this.sky=new U(this.stylesheet.sky),this.map.setTerrain((we=this.stylesheet.terrain)!==null&&we!==void 0?we:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){let R=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",R),this._order=R.map(ae=>ae.id),this._layers={},this._serializedLayers=null;for(let ae of R){let xe=t.aA(ae);xe.setEventedParent(this,{layer:{id:ae.id}}),this._layers[ae.id]=xe}}_loadSprite(R,ae=!1,xe=void 0){let we;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Fe,ct,bt,zt){return t._(this,void 0,void 0,function*(){let Zt=b(Fe),gr=bt>1?"@2x":"",yr={},Gr={};for(let{id:ta,url:qe}of Zt){let Ze=ct.transformRequest(v(qe,gr,".json"),"SpriteJSON");yr[ta]=t.h(Ze,zt);let it=ct.transformRequest(v(qe,gr,".png"),"SpriteImage");Gr[ta]=l.getImage(it,zt)}return yield Promise.all([...Object.values(yr),...Object.values(Gr)]),(function(ta,qe){return t._(this,void 0,void 0,function*(){let Ze={};for(let it in ta){Ze[it]={};let ft=i.getImageCanvasContext((yield qe[it]).data),Mt=(yield ta[it]).data;for(let xt in Mt){let{width:Pt,height:ir,x:fr,y:wr,sdf:zr,pixelRatio:Xr,stretchX:la,stretchY:pa,content:ka,textFitWidth:tn,textFitHeight:Dn}=Mt[xt];Ze[it][xt]={data:null,pixelRatio:Xr,sdf:zr,stretchX:la,stretchY:pa,content:ka,textFitWidth:tn,textFitHeight:Dn,spriteData:{width:Pt,height:ir,x:fr,y:wr,context:ft}}}}return Ze})})(yr,Gr)})})(R,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Fe=>{if(this._spriteRequest=null,Fe)for(let ct in Fe){this._spritesImagesIds[ct]=[];let bt=this._spritesImagesIds[ct]?this._spritesImagesIds[ct].filter(zt=>!(zt in Fe)):[];for(let zt of bt)this.imageManager.removeImage(zt),this._changedImages[zt]=!0;for(let zt in Fe[ct]){let Zt=ct==="default"?zt:`${ct}:${zt}`;this._spritesImagesIds[ct].push(Zt),Zt in this.imageManager.images?this.imageManager.updateImage(Zt,Fe[ct][zt],!1):this.imageManager.addImage(Zt,Fe[ct][zt]),ae&&(this._changedImages[Zt]=!0)}}}).catch(Fe=>{this._spriteRequest=null,we=Fe,this.fire(new t.j(we))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ae&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),xe&&xe(we)})}_unloadSprite(){for(let R of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(R),this._changedImages[R]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(R){let ae=this.sourceCaches[R.source];if(!ae)return;let xe=R.sourceLayer;if(!xe)return;let we=ae.getSource();(we.type==="geojson"||we.vectorLayerIds&&we.vectorLayerIds.indexOf(xe)===-1)&&this.fire(new t.j(new Error(`Source layer "${xe}" does not exist on source "${we.id}" as specified by style layer "${R.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let R in this.sourceCaches)if(!this.sourceCaches[R].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(R,ae=!1){let xe=this._serializedAllLayers();if(!R||R.length===0)return Object.values(ae?t.aB(xe):xe);let we=[];for(let Fe of R)if(xe[Fe]){let ct=ae?t.aB(xe[Fe]):xe[Fe];we.push(ct)}return we}_serializedAllLayers(){let R=this._serializedLayers;if(R)return R;R=this._serializedLayers={};let ae=Object.keys(this._layers);for(let xe of ae){let we=this._layers[xe];we.type!=="custom"&&(R[xe]=we.serialize())}return R}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let R in this.sourceCaches)if(this.sourceCaches[R].hasTransition())return!0;for(let R in this._layers)if(this._layers[R].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(R){if(!this._loaded)return;let ae=this._changed;if(ae){let we=Object.keys(this._updatedLayers),Fe=Object.keys(this._removedLayers);(we.length||Fe.length)&&this._updateWorkerLayers(we,Fe);for(let ct in this._updatedSources){let bt=this._updatedSources[ct];if(bt==="reload")this._reloadSource(ct);else{if(bt!=="clear")throw new Error(`Invalid action ${bt}`);this._clearSource(ct)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let ct in this._updatedPaintProps)this._layers[ct].updateTransitions(R);this.light.updateTransitions(R),this.sky.updateTransitions(R),this._resetUpdates()}let xe={};for(let we in this.sourceCaches){let Fe=this.sourceCaches[we];xe[we]=Fe.used,Fe.used=!1}for(let we of this._order){let Fe=this._layers[we];Fe.recalculate(R,this._availableImages),!Fe.isHidden(R.zoom)&&Fe.source&&(this.sourceCaches[Fe.source].used=!0)}for(let we in xe){let Fe=this.sourceCaches[we];!!xe[we]!=!!Fe.used&&Fe.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:we}))}this.light.recalculate(R),this.sky.recalculate(R),this.z=R.zoom,ae&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let R=Object.keys(this._changedImages);if(R.length){for(let ae in this.sourceCaches)this.sourceCaches[ae].reloadTilesForDependencies(["icons","patterns"],R);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let R in this.sourceCaches)this.sourceCaches[R].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(R,ae){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(R,!1),removedIds:ae})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(R,ae={}){var xe;this._checkLoaded();let we=this.serialize();if(R=ae.transformStyle?ae.transformStyle(we,R):R,((xe=ae.validate)===null||xe===void 0||xe)&&Lr(this,t.u(R)))return!1;(R=t.aB(R)).layers=t.az(R.layers);let Fe=t.aC(we,R),ct=this._getOperationsToPerform(Fe);if(ct.unimplemented.length>0)throw new Error(`Unimplemented: ${ct.unimplemented.join(", ")}.`);if(ct.operations.length===0)return!1;for(let bt of ct.operations)bt();return this.stylesheet=R,this._serializedLayers=null,!0}_getOperationsToPerform(R){let ae=[],xe=[];for(let we of R)switch(we.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ae.push(()=>this.addLayer.apply(this,we.args));break;case"removeLayer":ae.push(()=>this.removeLayer.apply(this,we.args));break;case"setPaintProperty":ae.push(()=>this.setPaintProperty.apply(this,we.args));break;case"setLayoutProperty":ae.push(()=>this.setLayoutProperty.apply(this,we.args));break;case"setFilter":ae.push(()=>this.setFilter.apply(this,we.args));break;case"addSource":ae.push(()=>this.addSource.apply(this,we.args));break;case"removeSource":ae.push(()=>this.removeSource.apply(this,we.args));break;case"setLayerZoomRange":ae.push(()=>this.setLayerZoomRange.apply(this,we.args));break;case"setLight":ae.push(()=>this.setLight.apply(this,we.args));break;case"setGeoJSONSourceData":ae.push(()=>this.setGeoJSONSourceData.apply(this,we.args));break;case"setGlyphs":ae.push(()=>this.setGlyphs.apply(this,we.args));break;case"setSprite":ae.push(()=>this.setSprite.apply(this,we.args));break;case"setSky":ae.push(()=>this.setSky.apply(this,we.args));break;case"setTerrain":ae.push(()=>this.map.setTerrain.apply(this,we.args));break;case"setTransition":ae.push(()=>{});break;default:xe.push(we.command)}return{operations:ae,unimplemented:xe}}addImage(R,ae){if(this.getImage(R))return this.fire(new t.j(new Error(`An image named "${R}" already exists.`)));this.imageManager.addImage(R,ae),this._afterImageUpdated(R)}updateImage(R,ae){this.imageManager.updateImage(R,ae)}getImage(R){return this.imageManager.getImage(R)}removeImage(R){if(!this.getImage(R))return this.fire(new t.j(new Error(`An image named "${R}" does not exist.`)));this.imageManager.removeImage(R),this._afterImageUpdated(R)}_afterImageUpdated(R){this._availableImages=this.imageManager.listImages(),this._changedImages[R]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(R,ae,xe={}){if(this._checkLoaded(),this.sourceCaches[R]!==void 0)throw new Error(`Source "${R}" already exists.`);if(!ae.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ae).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ae.type)>=0&&this._validate(t.u.source,`sources.${R}`,ae,null,xe))return;this.map&&this.map._collectResourceTiming&&(ae.collectResourceTiming=!0);let we=this.sourceCaches[R]=new Et(R,ae,this.dispatcher);we.style=this,we.setEventedParent(this,()=>({isSourceLoaded:we.loaded(),source:we.serialize(),sourceId:R})),we.onAdd(this.map),this._changed=!0}removeSource(R){if(this._checkLoaded(),this.sourceCaches[R]===void 0)throw new Error("There is no source with this ID");for(let xe in this._layers)if(this._layers[xe].source===R)return this.fire(new t.j(new Error(`Source "${R}" cannot be removed while layer "${xe}" is using it.`)));let ae=this.sourceCaches[R];delete this.sourceCaches[R],delete this._updatedSources[R],ae.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:R})),ae.setEventedParent(null),ae.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(R,ae){if(this._checkLoaded(),this.sourceCaches[R]===void 0)throw new Error(`There is no source with this ID=${R}`);let xe=this.sourceCaches[R].getSource();if(xe.type!=="geojson")throw new Error(`geojsonSource.type is ${xe.type}, which is !== 'geojson`);xe.setData(ae),this._changed=!0}getSource(R){return this.sourceCaches[R]&&this.sourceCaches[R].getSource()}addLayer(R,ae,xe={}){this._checkLoaded();let we=R.id;if(this.getLayer(we))return void this.fire(new t.j(new Error(`Layer "${we}" already exists on this map.`)));let Fe;if(R.type==="custom"){if(Lr(this,t.aD(R)))return;Fe=t.aA(R)}else{if("source"in R&&typeof R.source=="object"&&(this.addSource(we,R.source),R=t.aB(R),R=t.e(R,{source:we})),this._validate(t.u.layer,`layers.${we}`,R,{arrayIndex:-1},xe))return;Fe=t.aA(R),this._validateLayer(Fe),Fe.setEventedParent(this,{layer:{id:we}})}let ct=ae?this._order.indexOf(ae):this._order.length;if(ae&&ct===-1)this.fire(new t.j(new Error(`Cannot add layer "${we}" before non-existing layer "${ae}".`)));else{if(this._order.splice(ct,0,we),this._layerOrderChanged=!0,this._layers[we]=Fe,this._removedLayers[we]&&Fe.source&&Fe.type!=="custom"){let bt=this._removedLayers[we];delete this._removedLayers[we],bt.type!==Fe.type?this._updatedSources[Fe.source]="clear":(this._updatedSources[Fe.source]="reload",this.sourceCaches[Fe.source].pause())}this._updateLayer(Fe),Fe.onAdd&&Fe.onAdd(this.map)}}moveLayer(R,ae){if(this._checkLoaded(),this._changed=!0,!this._layers[R])return void this.fire(new t.j(new Error(`The layer '${R}' does not exist in the map's style and cannot be moved.`)));if(R===ae)return;let xe=this._order.indexOf(R);this._order.splice(xe,1);let we=ae?this._order.indexOf(ae):this._order.length;ae&&we===-1?this.fire(new t.j(new Error(`Cannot move layer "${R}" before non-existing layer "${ae}".`))):(this._order.splice(we,0,R),this._layerOrderChanged=!0)}removeLayer(R){this._checkLoaded();let ae=this._layers[R];if(!ae)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${R}".`)));ae.setEventedParent(null);let xe=this._order.indexOf(R);this._order.splice(xe,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[R]=ae,delete this._layers[R],this._serializedLayers&&delete this._serializedLayers[R],delete this._updatedLayers[R],delete this._updatedPaintProps[R],ae.onRemove&&ae.onRemove(this.map)}getLayer(R){return this._layers[R]}getLayersOrder(){return[...this._order]}hasLayer(R){return R in this._layers}setLayerZoomRange(R,ae,xe){this._checkLoaded();let we=this.getLayer(R);we?we.minzoom===ae&&we.maxzoom===xe||(ae!=null&&(we.minzoom=ae),xe!=null&&(we.maxzoom=xe),this._updateLayer(we)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${R}".`)))}setFilter(R,ae,xe={}){this._checkLoaded();let we=this.getLayer(R);if(we){if(!t.aE(we.filter,ae))return ae==null?(we.filter=void 0,void this._updateLayer(we)):void(this._validate(t.u.filter,`layers.${we.id}.filter`,ae,null,xe)||(we.filter=t.aB(ae),this._updateLayer(we)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${R}".`)))}getFilter(R){return t.aB(this.getLayer(R).filter)}setLayoutProperty(R,ae,xe,we={}){this._checkLoaded();let Fe=this.getLayer(R);Fe?t.aE(Fe.getLayoutProperty(ae),xe)||(Fe.setLayoutProperty(ae,xe,we),this._updateLayer(Fe)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${R}".`)))}getLayoutProperty(R,ae){let xe=this.getLayer(R);if(xe)return xe.getLayoutProperty(ae);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${R}".`)))}setPaintProperty(R,ae,xe,we={}){this._checkLoaded();let Fe=this.getLayer(R);Fe?t.aE(Fe.getPaintProperty(ae),xe)||(Fe.setPaintProperty(ae,xe,we)&&this._updateLayer(Fe),this._changed=!0,this._updatedPaintProps[R]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${R}".`)))}getPaintProperty(R,ae){return this.getLayer(R).getPaintProperty(ae)}setFeatureState(R,ae){this._checkLoaded();let xe=R.source,we=R.sourceLayer,Fe=this.sourceCaches[xe];if(Fe===void 0)return void this.fire(new t.j(new Error(`The source '${xe}' does not exist in the map's style.`)));let ct=Fe.getSource().type;ct==="geojson"&&we?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ct!=="vector"||we?(R.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Fe.setFeatureState(we,R.id,ae)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(R,ae){this._checkLoaded();let xe=R.source,we=this.sourceCaches[xe];if(we===void 0)return void this.fire(new t.j(new Error(`The source '${xe}' does not exist in the map's style.`)));let Fe=we.getSource().type,ct=Fe==="vector"?R.sourceLayer:void 0;Fe!=="vector"||ct?ae&&typeof R.id!="string"&&typeof R.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):we.removeFeatureState(ct,R.id,ae):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(R){this._checkLoaded();let ae=R.source,xe=R.sourceLayer,we=this.sourceCaches[ae];if(we!==void 0)return we.getSource().type!=="vector"||xe?(R.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),we.getFeatureState(xe,R.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ae}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let R=t.aF(this.sourceCaches,Fe=>Fe.serialize()),ae=this._serializeByIds(this._order,!0),xe=this.map.getTerrain()||void 0,we=this.stylesheet;return t.aG({version:we.version,name:we.name,metadata:we.metadata,light:we.light,sky:we.sky,center:we.center,zoom:we.zoom,bearing:we.bearing,pitch:we.pitch,sprite:we.sprite,glyphs:we.glyphs,transition:we.transition,sources:R,layers:ae,terrain:xe},Fe=>Fe!==void 0)}_updateLayer(R){this._updatedLayers[R.id]=!0,R.source&&!this._updatedSources[R.source]&&this.sourceCaches[R.source].getSource().type!=="raster"&&(this._updatedSources[R.source]="reload",this.sourceCaches[R.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(R){let ae=ct=>this._layers[ct].type==="fill-extrusion",xe={},we=[];for(let ct=this._order.length-1;ct>=0;ct--){let bt=this._order[ct];if(ae(bt)){xe[bt]=ct;for(let zt of R){let Zt=zt[bt];if(Zt)for(let gr of Zt)we.push(gr)}}}we.sort((ct,bt)=>bt.intersectionZ-ct.intersectionZ);let Fe=[];for(let ct=this._order.length-1;ct>=0;ct--){let bt=this._order[ct];if(ae(bt))for(let zt=we.length-1;zt>=0;zt--){let Zt=we[zt].feature;if(xe[Zt.layer.id]{let zr=ft.featureSortOrder;if(zr){let Xr=zr.indexOf(fr.featureIndex);return zr.indexOf(wr.featureIndex)-Xr}return wr.featureIndex-fr.featureIndex});for(let fr of ir)Pt.push(fr)}}for(let ft in qe)qe[ft].forEach(Mt=>{let xt=Mt.feature,Pt=Zt[bt[ft].source].getFeatureState(xt.layer["source-layer"],xt.id);xt.source=xt.layer.source,xt.layer["source-layer"]&&(xt.sourceLayer=xt.layer["source-layer"]),xt.state=Pt});return qe})(this._layers,ct,this.sourceCaches,R,ae,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Fe)}querySourceFeatures(R,ae){ae&&ae.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ae.filter,null,ae);let xe=this.sourceCaches[R];return xe?(function(we,Fe){let ct=we.getRenderableIds().map(Zt=>we.getTileByID(Zt)),bt=[],zt={};for(let Zt=0;ZtGr.getTileByID(ta)).sort((ta,qe)=>qe.tileID.overscaledZ-ta.tileID.overscaledZ||(ta.tileID.isLessThan(qe.tileID)?-1:1))}let yr=this.crossTileSymbolIndex.addLayer(gr,zt[gr.source],R.center.lng);ct=ct||yr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Fe=Fe||this._layerOrderChanged||xe===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),R.zoom))&&(this.pauseablePlacement=new Xn(R,this.map.terrain,this._order,Fe,ae,xe,we,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,zt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),bt=!0),ct&&this.pauseablePlacement.placement.setStale()),bt||ct)for(let Zt of this._order){let gr=this._layers[Zt];gr.type==="symbol"&&this.placement.updateLayerOpacities(gr,zt[gr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(let R in this.sourceCaches)this.sourceCaches[R].releaseSymbolFadeTiles()}getImages(R,ae){return t._(this,void 0,void 0,function*(){let xe=yield this.imageManager.getImages(ae.icons);this._updateTilesForChangedImages();let we=this.sourceCaches[ae.source];return we&&we.setDependencies(ae.tileID.key,ae.type,ae.icons),xe})}getGlyphs(R,ae){return t._(this,void 0,void 0,function*(){let xe=yield this.glyphManager.getGlyphs(ae.stacks),we=this.sourceCaches[ae.source];return we&&we.setDependencies(ae.tileID.key,ae.type,[""]),xe})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(R,ae={}){this._checkLoaded(),R&&this._validate(t.u.glyphs,"glyphs",R,null,ae)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=R,this.glyphManager.entries={},this.glyphManager.setURL(R))}addSprite(R,ae,xe={},we){this._checkLoaded();let Fe=[{id:R,url:ae}],ct=[...b(this.stylesheet.sprite),...Fe];this._validate(t.u.sprite,"sprite",ct,null,xe)||(this.stylesheet.sprite=ct,this._loadSprite(Fe,!0,we))}removeSprite(R){this._checkLoaded();let ae=b(this.stylesheet.sprite);if(ae.find(xe=>xe.id===R)){if(this._spritesImagesIds[R])for(let xe of this._spritesImagesIds[R])this.imageManager.removeImage(xe),this._changedImages[xe]=!0;ae.splice(ae.findIndex(xe=>xe.id===R),1),this.stylesheet.sprite=ae.length>0?ae:void 0,delete this._spritesImagesIds[R],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${R}" doesn't exists on this map.`)))}getSprite(){return b(this.stylesheet.sprite)}setSprite(R,ae={},xe){this._checkLoaded(),R&&this._validate(t.u.sprite,"sprite",R,null,ae)||(this.stylesheet.sprite=R,R?this._loadSprite(R,!0,xe):(this._unloadSprite(),xe&&xe(null)))}}var Kr=t.Y([{name:"a_pos",type:"Int16",components:2}]);let Nr={prelude:_t(`#ifdef GL_ES +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),MI=Ge({"src/plots/map/styles/arcgis-sat.js"(Z,q){q.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),Qd=Ge({"src/plots/map/constants.js"(Z,q){"use strict";var d=Cd(),x=SI(),S=MI(),E='\xA9 OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:S,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);q.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),Hg=Ge({"src/plots/map/layout_attributes.js"(Z,q){"use strict";var d=ta(),x=Bi().defaultLine,S=ju().attributes,E=bu(),e=gc().textposition,t=Ru().overrideAll,r=ll().templatedArray,o=Qd(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=q.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:S({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),rx=Ge({"src/traces/scattermap/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,texttemplateAttrs:x,templatefallbackAttrs:S}=Tl(),E=hv(),e=Wp(),t=gc(),r=Hg(),o=Cl(),a=Jl(),i=Do().extendFlat,n=Ru().overrideAll,s=Hg(),h=e.line,f=e.marker;q.exports=n({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},f.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},a("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:S()},"calc","nested")}}),DT=Ge({"src/traces/scattermap/constants.js"(Z,q){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];q.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),EI=Ge({"src/traces/scattermap/defaults.js"(Z,q){"use strict";var d=ta(),x=iu(),S=Nh(),E=Xh(),e=Zh(),t=dv(),r=rx(),o=DT().isSupportedFont;q.exports=function(n,s,h,f){function p(y,m){return d.coerce(n,s,r,y,m)}function c(y,m){return d.coerce2(n,s,r,y,m)}var T=a(n,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),x.hasMarkers(s)){S(n,s,h,f,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,h,f,p,{noDash:!0}),p("connectgaps"));var _=c("cluster.maxzoom"),w=c("cluster.step"),A=c("cluster.color",s.marker&&s.marker.color||h),M=c("cluster.size"),g=c("cluster.opacity"),b=_!==!1||w!==!1||A!==!1||M!==!1||g!==!1,v=p("cluster.enabled",b);if(v||x.hasText(s)){var u=f.font.family;e(n,s,f,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}p("fill"),s.fill!=="none"&&t(n,s,h,p),d.coerceSelectionMarkerOpacity(s,p)};function a(i,n,s){var h=s("lon")||[],f=s("lat")||[],p=Math.min(h.length,f.length);return n._length=p,p}}}),zT=Ge({"src/traces/scattermap/format_labels.js"(Z,q){"use strict";var d=Mo();q.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=S.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),FT=Ge({"src/plots/map/convert_text_opts.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var h;return n[0]&&n[1]?h=n.join("-"):n[0]?h=n[0]:n[1]?h=n[1]:h="center",{anchor:h,offset:s}}}}),kI=Ge({"src/traces/scattermap/convert.js"(Z,q){"use strict";var d=Bo(),x=ta(),S=As().BADNUM,E=Zd(),e=wu(),t=zo(),r=z0(),o=iu(),a=DT().isSupportedFont,i=FT(),n=Sh().appendArrayPointValue,s=Il().NEWLINES,h=Il().BR_TAG_ALL;q.exports=function(g,b){var v=b[0].trace,u=v.visible===!0&&v._length!==0,y=v.fill!=="none",m=o.hasLines(v),R=o.hasMarkers(v),L=o.hasText(v),z=R&&v.marker.symbol==="circle",F=R&&v.marker.symbol!=="circle",N=v.cluster&&v.cluster.enabled,O=f("fill"),P=f("line"),U=f("circle"),B=f("symbol"),X={fill:O,line:P,circle:U,symbol:B};if(!u)return X;var $;if((y||m)&&($=E.calcTraceToLineCoords(b)),y&&(O.geojson=E.makePolygon($),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":v.fillcolor})),m&&(P.geojson=E.makeLine($),P.layout.visibility="visible",x.extendFlat(P.paint,{"line-width":v.line.width,"line-color":v.line.color,"line-opacity":v.opacity})),z){var le=p(b);U.geojson=le.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],X.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(v.cluster.color,v.cluster.step),"circle-radius":w(v.cluster.size,v.cluster.step),"circle-opacity":w(v.cluster.opacity,v.cluster.step)}},X.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(v),"text-size":12}}),x.extendFlat(U.paint,{"circle-color":le.mcc,"circle-radius":le.mrc,"circle-opacity":le.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(B.geojson=c(b,g),x.extendFlat(B.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(B.layout,{"icon-size":v.marker.size/10}),"angle"in v.marker&&v.marker.angle!=="auto"&&x.extendFlat(B.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),B.layout["icon-allow-overlap"]=v.marker.allowoverlap,x.extendFlat(B.paint,{"icon-opacity":v.opacity*v.marker.opacity,"icon-color":v.marker.color})),L)){var ce=(v.marker||{}).size,ve=i(v.textposition,ce);x.extendFlat(B.layout,{"text-size":v.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":A(v)}),x.extendFlat(B.paint,{"text-color":v.textfont.color,"text-opacity":v.opacity})}return X};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var g=M[0].trace,b=g.marker,v=g.selectedpoints,u=x.isArrayOrTypedArray(b.color),y=x.isArrayOrTypedArray(b.size),m=x.isArrayOrTypedArray(b.opacity),R;function L(ce){return g.opacity*ce}function z(ce){return ce/2}var F;u&&(e.hasColorscale(g,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var N;y&&(N=r(g));var O;m&&(O=function(ce){var ve=d(ce)?+x.constrain(ce,0,1):0;return L(ve)});var P=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",y[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=b);var L=R.split(", ");return L}}}),CI=Ge({"src/traces/scattermap/plot.js"(Z,q){"use strict";var d=ta(),x=kI(),S=Qd().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,h=this.subplot.getMapLayers(),f=0;f=0;m--){var R=y[m];n.removeLayer(c.layerIds[R])}u||n.removeSource(c.sourceIds.circle)}function _(u){for(var y=E.nonCluster,m=0;m=0;m--){var R=y[m];n.removeLayer(c.layerIds[R]),u||n.removeSource(c.sourceIds[R])}}function A(u){p?l(u):w(u)}function M(u){f?T(u):_(u)}function g(){for(var u=f?E.cluster:E.nonCluster,y=0;y=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},q.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,h=new e(o,i.uid,n,s),f=x(o.gd,a),p=h.below=o.belowLookup["trace-"+i.uid],c,T,l;if(n)for(h.addSource("circle",f.circle,i.cluster),c=0;c=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,g=i-M;function b(N){var O=N.lonlat;if(O[0]===e||_&&T.indexOf(N.i+1)===-1)return 1/0;var P=x.modHalf(O[0],360),U=O[1],B=c.project([P,U]),X=B.x-f.c2p([g,U]),$=B.y-p.c2p([P,n]),le=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(X*X+$*$)-le,1-3/le)}if(d.getClosest(s,b,a),a.index!==!1){var v=s[a.index],u=v.lonlat,y=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(y),R=p.c2p(y),L=v.mrc||1;a.x0=m-L,a.x1=m+L,a.y0=R-L,a.y1=R+L;var z={};z[h.subplot]={_subplot:c};var F=h._module.formatLabels(v,h,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=S(h,v),a.extraText=o(h,v,s[0].t.labels),a.hovertemplate=h.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,h=s.split("+"),f=h.indexOf("all")!==-1,p=h.indexOf("lon")!==-1,c=h.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return f||p&&c?l.push("("+_(T[1])+", "+_(T[0])+")"):p?l.push(n.lon+_(T[0])):c&&l.push(n.lat+_(T[1])),(f||h.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:o}}}),LI=Ge({"src/traces/scattermap/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),PI=Ge({"src/traces/scattermap/select.js"(Z,q){"use strict";var d=ta(),x=iu(),S=As().BADNUM;q.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var J=W,de=0;de<8;de++){var Se=this.sampleCurveX(J)-W;if(Math.abs(Se)Se?Ve=J:st=J,J=.5*(st-Ve)+Ve;return J},solve:function(W,D){return this.sampleCurveY(this.solveCurveX(W,D))}};var h=r(n);let f,p;function c(){return f==null&&(f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),f}function T(){if(p==null&&(p=!1,c())){let D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let de=0;de<25;de++){let Se=4*de;D.fillStyle=`rgb(${Se},${Se+1},${Se+2})`,D.fillRect(de%5,Math.floor(de/5),1,1)}let J=D.getImageData(0,0,5,5).data;for(let de=0;de<100;de++)if(de%4!=3&&J[de]!==de){p=!0;break}}}return p||!1}function l(W,D,J,de){let Se=new h(W,D,J,de);return Fe=>Se.solve(Fe)}let _=l(.25,.1,.25,1);function w(W,D,J){return Math.min(J,Math.max(D,W))}function A(W,D,J){let de=J-D,Se=((W-D)%de+de)%de+D;return Se===D?J:Se}function M(W,...D){for(let J of D)for(let de in J)W[de]=J[de];return W}let g=1;function b(W,D,J){let de={};for(let Se in W)de[Se]=D.call(this,W[Se],Se,W);return de}function v(W,D,J){let de={};for(let Se in W)D.call(this,W[Se],Se,W)&&(de[Se]=W[Se]);return de}function u(W){return Array.isArray(W)?W.map(u):typeof W=="object"&&W?b(W,u):W}let y={};function m(W){y[W]||(typeof console<"u"&&console.warn(W),y[W]=!0)}function R(W,D,J){return(J.y-W.y)*(D.x-W.x)>(D.y-W.y)*(J.x-W.x)}function L(W){return typeof WorkerGlobalScope<"u"&&W!==void 0&&W instanceof WorkerGlobalScope}let z=null;function F(W){return typeof ImageBitmap<"u"&&W instanceof ImageBitmap}let N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(W,D,J,de,Se){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Fe=new VideoFrame(W,{timestamp:0});try{let Ve=Fe?.format;if(!Ve||!Ve.startsWith("BGR")&&!Ve.startsWith("RGB"))throw new Error(`Unrecognized format ${Ve}`);let st=Ve.startsWith("BGR"),bt=new Uint8ClampedArray(de*Se*4);if(yield Fe.copyTo(bt,(function(Dt,Qt,xr,Lr,jr){let $r=4*Math.max(-Qt,0),ia=(Math.max(0,xr)-xr)*Lr*4+$r,Ra=4*Lr,Va=Math.max(0,Qt),On=Math.max(0,xr);return{rect:{x:Va,y:On,width:Math.min(Dt.width,Qt+Lr)-Va,height:Math.min(Dt.height,xr+jr)-On},layout:[{offset:ia,stride:Ra}]}})(W,D,J,de,Se)),st)for(let Dt=0;DtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Y=function(W,D){if(/:\/\//.test(W.url)&&!/^https?:|^file:/.test(W.url)){let de=le(W.url);if(de)return de(W,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:W,targetMapId:ce},D)}if(!(/^file:/.test(J=W.url)||/^file:/.test(G())&&!/^\w+:/.test(J))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(de,Se){return t(this,void 0,void 0,function*(){let Fe=new Request(de.url,{method:de.method||"GET",body:de.body,credentials:de.credentials,headers:de.headers,cache:de.cache,referrer:G(),signal:Se.signal});de.type!=="json"||Fe.headers.has("Accept")||Fe.headers.set("Accept","application/json");let Ve=yield fetch(Fe);if(!Ve.ok){let Dt=yield Ve.blob();throw new ve(Ve.status,Ve.statusText,de.url,Dt)}let st;st=de.type==="arrayBuffer"||de.type==="image"?Ve.arrayBuffer():de.type==="json"?Ve.json():Ve.text();let bt=yield st;if(Se.signal.aborted)throw X();return{data:bt,cacheControl:Ve.headers.get("Cache-Control"),expires:Ve.headers.get("Expires")}})})(W,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:W,mustQueue:!0,targetMapId:ce},D)}var J;return(function(de,Se){return new Promise((Fe,Ve)=>{var st;let bt=new XMLHttpRequest;bt.open(de.method||"GET",de.url,!0),de.type!=="arrayBuffer"&&de.type!=="image"||(bt.responseType="arraybuffer");for(let Dt in de.headers)bt.setRequestHeader(Dt,de.headers[Dt]);de.type==="json"&&(bt.responseType="text",!((st=de.headers)===null||st===void 0)&&st.Accept||bt.setRequestHeader("Accept","application/json")),bt.withCredentials=de.credentials==="include",bt.onerror=()=>{Ve(new Error(bt.statusText))},bt.onload=()=>{if(!Se.signal.aborted)if((bt.status>=200&&bt.status<300||bt.status===0)&&bt.response!==null){let Dt=bt.response;if(de.type==="json")try{Dt=JSON.parse(bt.response)}catch(Qt){return void Ve(Qt)}Fe({data:Dt,cacheControl:bt.getResponseHeader("Cache-Control"),expires:bt.getResponseHeader("Expires")})}else{let Dt=new Blob([bt.response],{type:bt.getResponseHeader("Content-Type")});Ve(new ve(bt.status,bt.statusText,de.url,Dt))}},Se.signal.addEventListener("abort",()=>{bt.abort(),Ve(X())}),bt.send(de.body)})})(W,D)};function ee(W){if(!W||W.indexOf("://")<=0||W.indexOf("data:image/")===0||W.indexOf("blob:")===0)return!0;let D=new URL(W),J=window.location;return D.protocol===J.protocol&&D.host===J.host}function V(W,D,J){J[W]&&J[W].indexOf(D)!==-1||(J[W]=J[W]||[],J[W].push(D))}function se(W,D,J){if(J&&J[W]){let de=J[W].indexOf(D);de!==-1&&J[W].splice(de,1)}}class ae{constructor(D,J={}){M(this,J),this.type=D}}class j extends ae{constructor(D,J={}){super("error",M({error:D},J))}}class Q{on(D,J){return this._listeners=this._listeners||{},V(D,J,this._listeners),this}off(D,J){return se(D,J,this._listeners),se(D,J,this._oneTimeListeners),this}once(D,J){return J?(this._oneTimeListeners=this._oneTimeListeners||{},V(D,J,this._oneTimeListeners),this):new Promise(de=>this.once(D,de))}fire(D,J){typeof D=="string"&&(D=new ae(D,J||{}));let de=D.type;if(this.listens(de)){D.target=this;let Se=this._listeners&&this._listeners[de]?this._listeners[de].slice():[];for(let st of Se)st.call(this,D);let Fe=this._oneTimeListeners&&this._oneTimeListeners[de]?this._oneTimeListeners[de].slice():[];for(let st of Fe)se(de,st,this._oneTimeListeners),st.call(this,D);let Ve=this._eventedParent;Ve&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ve.fire(D))}else D instanceof j&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,J){return this._eventedParent=D,this._eventedParentData=J,this}}var re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let he=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function xe(W,D){let J={};for(let de in W)de!=="ref"&&(J[de]=W[de]);return he.forEach(de=>{de in D&&(J[de]=D[de])}),J}function Te(W,D){if(Array.isArray(W)){if(!Array.isArray(D)||W.length!==D.length)return!1;for(let J=0;J`:W.itemType.kind==="value"?"array":`array<${D}>`}return W.kind}let we=[Qe,Xe,Tt,St,zt,Or,Ut,ze(br),wr,Er,mt];function ke(W,D){if(D.kind==="error")return null;if(W.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!ke(W.itemType,D.itemType))&&(typeof W.N!="number"||W.N===D.N))return null}else{if(W.kind===D.kind)return null;if(W.kind==="value"){for(let J of we)if(!ke(J,D))return null}}return`Expected ${Ze(W)} but found ${Ze(D)} instead.`}function Be(W,D){return D.some(J=>J.kind===W.kind)}function He(W,D){return D.some(J=>J==="null"?W===null:J==="array"?Array.isArray(W):J==="object"?W&&!Array.isArray(W)&&typeof W=="object":J===typeof W)}function nt(W,D){return W.kind==="array"&&D.kind==="array"?W.itemType.kind===D.itemType.kind&&typeof W.N=="number":W.kind===D.kind}let ot=.96422,Ft=.82521,Mt=4/29,Et=6/29,Ot=3*Et*Et,sr=Et*Et*Et,ir=Math.PI/180,ar=180/Math.PI;function Mr(W){return(W%=360)<0&&(W+=360),W}function ma([W,D,J,de]){let Se,Fe,Ve=Aa((.2225045*(W=Ca(W))+.7168786*(D=Ca(D))+.0606169*(J=Ca(J)))/1);W===D&&D===J?Se=Fe=Ve:(Se=Aa((.4360747*W+.3850649*D+.1430804*J)/ot),Fe=Aa((.0139322*W+.0971045*D+.7141733*J)/Ft));let st=116*Ve-16;return[st<0?0:st,500*(Se-Ve),200*(Ve-Fe),de]}function Ca(W){return W<=.04045?W/12.92:Math.pow((W+.055)/1.055,2.4)}function Aa(W){return W>sr?Math.pow(W,1/3):W/Ot+Mt}function Da([W,D,J,de]){let Se=(W+16)/116,Fe=isNaN(D)?Se:Se+D/500,Ve=isNaN(J)?Se:Se-J/200;return Se=1*ba(Se),Fe=ot*ba(Fe),Ve=Ft*ba(Ve),[Ba(3.1338561*Fe-1.6168667*Se-.4906146*Ve),Ba(-.9787684*Fe+1.9161415*Se+.033454*Ve),Ba(.0719453*Fe-.2289914*Se+1.4052427*Ve),de]}function Ba(W){return(W=W<=.00304?12.92*W:1.055*Math.pow(W,1/2.4)-.055)<0?0:W>1?1:W}function ba(W){return W>Et?W*W*W:Ot*(W-Mt)}function rn(W){return parseInt(W.padEnd(2,W),16)/255}function vn(W,D){return Wt(D?W/100:W,0,1)}function Wt(W,D,J){return Math.min(Math.max(D,W),J)}function Lt(W){return!W.some(Number.isNaN)}let Ht={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Xt{constructor(D,J,de,Se=1,Fe=!0){this.r=D,this.g=J,this.b=de,this.a=Se,Fe||(this.r*=Se,this.g*=Se,this.b*=Se,Se||this.overwriteGetter("rgb",[D,J,de,Se]))}static parse(D){if(D instanceof Xt)return D;if(typeof D!="string")return;let J=(function(de){if((de=de.toLowerCase().trim())==="transparent")return[0,0,0,0];let Se=Ht[de];if(Se){let[Ve,st,bt]=Se;return[Ve/255,st/255,bt/255,1]}if(de.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(de)){let Ve=de.length<6?1:2,st=1;return[rn(de.slice(st,st+=Ve)),rn(de.slice(st,st+=Ve)),rn(de.slice(st,st+=Ve)),rn(de.slice(st,st+Ve)||"ff")]}if(de.startsWith("rgb")){let Ve=de.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){let[st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va,On]=Ve,ln=[Qt||" ",jr||" ",Ra].join("");if(ln===" "||ln===" /"||ln===",,"||ln===",,,"){let Rn=[Dt,Lr,ia].join(""),Hn=Rn==="%%%"?100:Rn===""?255:0;if(Hn){let Ci=[Wt(+bt/Hn,0,1),Wt(+xr/Hn,0,1),Wt(+$r/Hn,0,1),Va?vn(+Va,On):1];if(Lt(Ci))return Ci}}return}}let Fe=de.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Fe){let[Ve,st,bt,Dt,Qt,xr,Lr,jr,$r]=Fe,ia=[bt||" ",Qt||" ",Lr].join("");if(ia===" "||ia===" /"||ia===",,"||ia===",,,"){let Ra=[+st,Wt(+Dt,0,100),Wt(+xr,0,100),jr?vn(+jr,$r):1];if(Lt(Ra))return(function([Va,On,ln,Rn]){function Hn(Ci){let ho=(Ci+Va/30)%12,Jo=On*Math.min(ln,1-ln);return ln-Jo*Math.max(-1,Math.min(ho-3,9-ho,1))}return Va=Mr(Va),On/=100,ln/=100,[Hn(0),Hn(8),Hn(4),Rn]})(Ra)}}})(D);return J?new Xt(...J,!1):void 0}get rgb(){let{r:D,g:J,b:de,a:Se}=this,Fe=Se||1/0;return this.overwriteGetter("rgb",[D/Fe,J/Fe,de/Fe,Se])}get hcl(){return this.overwriteGetter("hcl",(function(D){let[J,de,Se,Fe]=ma(D),Ve=Math.sqrt(de*de+Se*Se);return[Math.round(1e4*Ve)?Mr(Math.atan2(Se,de)*ar):NaN,Ve,J,Fe]})(this.rgb))}get lab(){return this.overwriteGetter("lab",ma(this.rgb))}overwriteGetter(D,J){return Object.defineProperty(this,D,{value:J}),J}toString(){let[D,J,de,Se]=this.rgb;return`rgba(${[D,J,de].map(Fe=>Math.round(255*Fe)).join(",")},${Se})`}}Xt.black=new Xt(0,0,0,1),Xt.white=new Xt(1,1,1,1),Xt.transparent=new Xt(0,0,0,0),Xt.red=new Xt(1,0,0,1);class Pr{constructor(D,J,de){this.sensitivity=D?J?"variant":"case":J?"accent":"base",this.locale=de,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,J){return this.collator.compare(D,J)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Yr{constructor(D,J,de,Se,Fe){this.text=D,this.image=J,this.scale=de,this.fontStack=Se,this.textColor=Fe}}class Kr{constructor(D){this.sections=D}static fromString(D){return new Kr([new Yr(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof Kr?D:Kr.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class na{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof na)return D;if(typeof D=="number")return new na([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(let J of D)if(typeof J!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new na(D)}}toString(){return JSON.stringify(this.values)}}let La=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ga{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ga)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let J=0;J=0&&W<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof J=="number"&&J>=0&&J<=255?de===void 0||typeof de=="number"&&de>=0&&de<=1?null:`Invalid rgba value [${[W,D,J,de].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof de=="number"?[W,D,J,de]:[W,D,J]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function an(W){if(W===null||typeof W=="string"||typeof W=="boolean"||typeof W=="number"||W instanceof Xt||W instanceof Pr||W instanceof Kr||W instanceof na||W instanceof Ga||W instanceof Ua)return!0;if(Array.isArray(W)){for(let D of W)if(!an(D))return!1;return!0}if(typeof W=="object"){for(let D in W)if(!an(W[D]))return!1;return!0}return!1}function Sa(W){if(W===null)return Qe;if(typeof W=="string")return Tt;if(typeof W=="boolean")return St;if(typeof W=="number")return Xe;if(W instanceof Xt)return zt;if(W instanceof Pr)return hr;if(W instanceof Kr)return Or;if(W instanceof na)return wr;if(W instanceof Ga)return mt;if(W instanceof Ua)return Er;if(Array.isArray(W)){let D=W.length,J;for(let de of W){let Se=Sa(de);if(J){if(J===Se)continue;J=br;break}J=Se}return ze(J||br,D)}return Ut}function Zn(W){let D=typeof W;return W===null?"":D==="string"||D==="number"||D==="boolean"?String(W):W instanceof Xt||W instanceof Kr||W instanceof na||W instanceof Ga||W instanceof Ua?W.toString():JSON.stringify(W)}class Wn{constructor(D,J){this.type=D,this.value=J}static parse(D,J){if(D.length!==2)return J.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!an(D[1]))return J.error("invalid value");let de=D[1],Se=Sa(de),Fe=J.expectedType;return Se.kind!=="array"||Se.N!==0||!Fe||Fe.kind!=="array"||typeof Fe.N=="number"&&Fe.N!==0||(Se=Fe),new Wn(Se,de)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ti{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}let gt={string:Tt,number:Xe,boolean:St,object:Ut};class it{constructor(D,J){this.type=D,this.args=J}static parse(D,J){if(D.length<2)return J.error("Expected at least one argument.");let de,Se=1,Fe=D[0];if(Fe==="array"){let st,bt;if(D.length>2){let Dt=D[1];if(typeof Dt!="string"||!(Dt in gt)||Dt==="object")return J.error('The item type argument of "array" must be one of string, number, boolean',1);st=gt[Dt],Se++}else st=br;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return J.error('The length argument to "array" must be a positive integer literal',2);bt=D[2],Se++}de=ze(st,bt)}else{if(!gt[Fe])throw new Error(`Types doesn't contain name = ${Fe}`);de=gt[Fe]}let Ve=[];for(;SeD.outputDefined())}}let Rr={"to-boolean":St,"to-color":zt,"to-number":Xe,"to-string":Tt};class Ar{constructor(D,J){this.type=D,this.args=J}static parse(D,J){if(D.length<2)return J.error("Expected at least one argument.");let de=D[0];if(!Rr[de])throw new Error(`Can't parse ${de} as it is not part of the known types`);if((de==="to-boolean"||de==="to-string")&&D.length!==2)return J.error("Expected one argument.");let Se=Rr[de],Fe=[];for(let Ve=1;Ve4?`Invalid rbga value ${JSON.stringify(J)}: expected an array containing either three or four numeric values.`:Xa(J[0],J[1],J[2],J[3]),!de))return new Xt(J[0]/255,J[1]/255,J[2]/255,J[3])}throw new ti(de||`Could not parse color from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"padding":{let J;for(let de of this.args){J=de.evaluate(D);let Se=na.parse(J);if(Se)return Se}throw new ti(`Could not parse padding from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"variableAnchorOffsetCollection":{let J;for(let de of this.args){J=de.evaluate(D);let Se=Ga.parse(J);if(Se)return Se}throw new ti(`Could not parse variableAnchorOffsetCollection from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"number":{let J=null;for(let de of this.args){if(J=de.evaluate(D),J===null)return 0;let Se=Number(J);if(!isNaN(Se))return Se}throw new ti(`Could not convert ${JSON.stringify(J)} to number.`)}case"formatted":return Kr.fromString(Zn(this.args[0].evaluate(D)));case"resolvedImage":return Ua.fromString(Zn(this.args[0].evaluate(D)));default:return Zn(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}let pr=["Unknown","Point","LineString","Polygon"];class kr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?pr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let J=this._parseColorCache[D];return J||(J=this._parseColorCache[D]=Xt.parse(D)),J}}class zr{constructor(D,J,de=[],Se,Fe=new We,Ve=[]){this.registry=D,this.path=de,this.key=de.map(st=>`[${st}]`).join(""),this.scope=Fe,this.errors=Ve,this.expectedType=Se,this._isConstant=J}parse(D,J,de,Se,Fe={}){return J?this.concat(J,de,Se)._parse(D,Fe):this._parse(D,Fe)}_parse(D,J){function de(Se,Fe,Ve){return Ve==="assert"?new it(Fe,[Se]):Ve==="coerce"?new Ar(Fe,[Se]):Se}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Se=D[0];if(typeof Se!="string")return this.error(`Expression name must be a string, but found ${typeof Se} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Fe=this.registry[Se];if(Fe){let Ve=Fe.parse(D,this);if(!Ve)return null;if(this.expectedType){let st=this.expectedType,bt=Ve.type;if(st.kind!=="string"&&st.kind!=="number"&&st.kind!=="boolean"&&st.kind!=="object"&&st.kind!=="array"||bt.kind!=="value")if(st.kind!=="color"&&st.kind!=="formatted"&&st.kind!=="resolvedImage"||bt.kind!=="value"&&bt.kind!=="string")if(st.kind!=="padding"||bt.kind!=="value"&&bt.kind!=="number"&&bt.kind!=="array")if(st.kind!=="variableAnchorOffsetCollection"||bt.kind!=="value"&&bt.kind!=="array"){if(this.checkSubtype(st,bt))return null}else Ve=de(Ve,st,J.typeAnnotation||"coerce");else Ve=de(Ve,st,J.typeAnnotation||"coerce");else Ve=de(Ve,st,J.typeAnnotation||"coerce");else Ve=de(Ve,st,J.typeAnnotation||"assert")}if(!(Ve instanceof Wn)&&Ve.type.kind!=="resolvedImage"&&this._isConstant(Ve)){let st=new kr;try{Ve=new Wn(Ve.type,Ve.evaluate(st))}catch(bt){return this.error(bt.message),null}}return Ve}return this.error(`Unknown expression "${Se}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,J,de){let Se=typeof D=="number"?this.path.concat(D):this.path,Fe=de?this.scope.concat(de):this.scope;return new zr(this.registry,this._isConstant,Se,J||null,Fe,this.errors)}error(D,...J){let de=`${this.key}${J.map(Se=>`[${Se}]`).join("")}`;this.errors.push(new Ee(de,D))}checkSubtype(D,J){let de=ke(D,J);return de&&this.error(de),de}}class Ur{constructor(D,J){this.type=J.type,this.bindings=[].concat(D),this.result=J}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(let J of this.bindings)D(J[1]);D(this.result)}static parse(D,J){if(D.length<4)return J.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);let de=[];for(let Fe=1;Fe=de.length)throw new ti(`Array index out of bounds: ${J} > ${de.length-1}.`);if(J!==Math.floor(J))throw new ti(`Array index must be an integer, but found ${J} instead.`);return de[J]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class fr{constructor(D,J){this.type=St,this.needle=D,this.haystack=J}static parse(D,J){if(D.length!==3)return J.error(`Expected 2 arguments, but found ${D.length-1} instead.`);let de=J.parse(D[1],1,br),Se=J.parse(D[2],2,br);return de&&Se?Be(de.type,[St,Tt,Xe,Qe,br])?new fr(de,Se):J.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ze(de.type)} instead`):null}evaluate(D){let J=this.needle.evaluate(D),de=this.haystack.evaluate(D);if(!de)return!1;if(!He(J,["boolean","string","number","null"]))throw new ti(`Expected first argument to be of type boolean, string, number or null, but found ${Ze(Sa(J))} instead.`);if(!He(de,["string","array"]))throw new ti(`Expected second argument to be of type array or string, but found ${Ze(Sa(de))} instead.`);return de.indexOf(J)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class Ir{constructor(D,J,de){this.type=Xe,this.needle=D,this.haystack=J,this.fromIndex=de}static parse(D,J){if(D.length<=2||D.length>=5)return J.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let de=J.parse(D[1],1,br),Se=J.parse(D[2],2,br);if(!de||!Se)return null;if(!Be(de.type,[St,Tt,Xe,Qe,br]))return J.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ze(de.type)} instead`);if(D.length===4){let Fe=J.parse(D[3],3,Xe);return Fe?new Ir(de,Se,Fe):null}return new Ir(de,Se)}evaluate(D){let J=this.needle.evaluate(D),de=this.haystack.evaluate(D);if(!He(J,["boolean","string","number","null"]))throw new ti(`Expected first argument to be of type boolean, string, number or null, but found ${Ze(Sa(J))} instead.`);let Se;if(this.fromIndex&&(Se=this.fromIndex.evaluate(D)),He(de,["string"])){let Fe=de.indexOf(J,Se);return Fe===-1?-1:[...de.slice(0,Fe)].length}if(He(de,["array"]))return de.indexOf(J,Se);throw new ti(`Expected second argument to be of type array or string, but found ${Ze(Sa(de))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class da{constructor(D,J,de,Se,Fe,Ve){this.inputType=D,this.type=J,this.input=de,this.cases=Se,this.outputs=Fe,this.otherwise=Ve}static parse(D,J){if(D.length<5)return J.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return J.error("Expected an even number of arguments.");let de,Se;J.expectedType&&J.expectedType.kind!=="value"&&(Se=J.expectedType);let Fe={},Ve=[];for(let Dt=2;DtNumber.MAX_SAFE_INTEGER)return Lr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof $r=="number"&&Math.floor($r)!==$r)return Lr.error("Numeric branch labels must be integer values.");if(de){if(Lr.checkSubtype(de,Sa($r)))return null}else de=Sa($r);if(Fe[String($r)]!==void 0)return Lr.error("Branch labels must be unique.");Fe[String($r)]=Ve.length}let jr=J.parse(xr,Dt,Se);if(!jr)return null;Se=Se||jr.type,Ve.push(jr)}let st=J.parse(D[1],1,br);if(!st)return null;let bt=J.parse(D[D.length-1],D.length-1,Se);return bt?st.type.kind!=="value"&&J.concat(1).checkSubtype(de,st.type)?null:new da(de,Se,st,Fe,Ve,bt):null}evaluate(D){let J=this.input.evaluate(D);return(Sa(J)===this.inputType&&this.outputs[this.cases[J]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Ta{constructor(D,J,de){this.type=D,this.branches=J,this.otherwise=de}static parse(D,J){if(D.length<4)return J.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return J.error("Expected an odd number of arguments.");let de;J.expectedType&&J.expectedType.kind!=="value"&&(de=J.expectedType);let Se=[];for(let Ve=1;VeJ.outputDefined())&&this.otherwise.outputDefined()}}class ua{constructor(D,J,de,Se){this.type=D,this.input=J,this.beginIndex=de,this.endIndex=Se}static parse(D,J){if(D.length<=2||D.length>=5)return J.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let de=J.parse(D[1],1,br),Se=J.parse(D[2],2,Xe);if(!de||!Se)return null;if(!Be(de.type,[ze(br),Tt,br]))return J.error(`Expected first argument to be of type array or string, but found ${Ze(de.type)} instead`);if(D.length===4){let Fe=J.parse(D[3],3,Xe);return Fe?new ua(de.type,de,Se,Fe):null}return new ua(de.type,de,Se)}evaluate(D){let J=this.input.evaluate(D),de=this.beginIndex.evaluate(D),Se;if(this.endIndex&&(Se=this.endIndex.evaluate(D)),He(J,["string"]))return[...J].slice(de,Se).join("");if(He(J,["array"]))return J.slice(de,Se);throw new ti(`Expected first argument to be of type array or string, but found ${Ze(Sa(J))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function ra(W,D){let J=W.length-1,de,Se,Fe=0,Ve=J,st=0;for(;Fe<=Ve;)if(st=Math.floor((Fe+Ve)/2),de=W[st],Se=W[st+1],de<=D){if(st===J||DD))throw new ti("Input is not a number.");Ve=st-1}return 0}class ha{constructor(D,J,de){this.type=D,this.input=J,this.labels=[],this.outputs=[];for(let[Se,Fe]of de)this.labels.push(Se),this.outputs.push(Fe)}static parse(D,J){if(D.length-1<4)return J.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return J.error("Expected an even number of arguments.");let de=J.parse(D[1],1,Xe);if(!de)return null;let Se=[],Fe=null;J.expectedType&&J.expectedType.kind!=="value"&&(Fe=J.expectedType);for(let Ve=1;Ve=st)return J.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Dt);let xr=J.parse(bt,Qt,Fe);if(!xr)return null;Fe=Fe||xr.type,Se.push([st,xr])}return new ha(Fe,de,Se)}evaluate(D){let J=this.labels,de=this.outputs;if(J.length===1)return de[0].evaluate(D);let Se=this.input.evaluate(D);if(Se<=J[0])return de[0].evaluate(D);let Fe=J.length;return Se>=J[Fe-1]?de[Fe-1].evaluate(D):de[ra(J,Se)].evaluate(D)}eachChild(D){D(this.input);for(let J of this.outputs)D(J)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function pn(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}var _n=jn;function jn(W,D,J,de){this.cx=3*W,this.bx=3*(J-W)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(de-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=W,this.p1y=D,this.p2x=J,this.p2y=de}jn.prototype={sampleCurveX:function(W){return((this.ax*W+this.bx)*W+this.cx)*W},sampleCurveY:function(W){return((this.ay*W+this.by)*W+this.cy)*W},sampleCurveDerivativeX:function(W){return(3*this.ax*W+2*this.bx)*W+this.cx},solveCurveX:function(W,D){if(D===void 0&&(D=1e-6),W<0)return 0;if(W>1)return 1;for(var J=W,de=0;de<8;de++){var Se=this.sampleCurveX(J)-W;if(Math.abs(Se)Se?Ve=J:st=J,J=.5*(st-Ve)+Ve;return J},solve:function(W,D){return this.sampleCurveY(this.solveCurveX(W,D))}};var li=pn(_n);function yi(W,D,J){return W+J*(D-W)}function gi(W,D,J){return W.map((de,Se)=>yi(de,D[Se],J))}let Si={number:yi,color:function(W,D,J,de="rgb"){switch(de){case"rgb":{let[Se,Fe,Ve,st]=gi(W.rgb,D.rgb,J);return new Xt(Se,Fe,Ve,st,!1)}case"hcl":{let[Se,Fe,Ve,st]=W.hcl,[bt,Dt,Qt,xr]=D.hcl,Lr,jr;if(isNaN(Se)||isNaN(bt))isNaN(Se)?isNaN(bt)?Lr=NaN:(Lr=bt,Ve!==1&&Ve!==0||(jr=Dt)):(Lr=Se,Qt!==1&&Qt!==0||(jr=Fe));else{let On=bt-Se;bt>Se&&On>180?On-=360:bt180&&(On+=360),Lr=Se+J*On}let[$r,ia,Ra,Va]=(function([On,ln,Rn,Hn]){return On=isNaN(On)?0:On*ir,Da([Rn,Math.cos(On)*ln,Math.sin(On)*ln,Hn])})([Lr,jr??yi(Fe,Dt,J),yi(Ve,Qt,J),yi(st,xr,J)]);return new Xt($r,ia,Ra,Va,!1)}case"lab":{let[Se,Fe,Ve,st]=Da(gi(W.lab,D.lab,J));return new Xt(Se,Fe,Ve,st,!1)}}},array:gi,padding:function(W,D,J){return new na(gi(W.values,D.values,J))},variableAnchorOffsetCollection:function(W,D,J){let de=W.values,Se=D.values;if(de.length!==Se.length)throw new ti(`Cannot interpolate values of different length. from: ${W.toString()}, to: ${D.toString()}`);let Fe=[];for(let Ve=0;Vetypeof Qt!="number"||Qt<0||Qt>1))return J.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Se={name:"cubic-bezier",controlPoints:Dt}}}if(D.length-1<4)return J.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return J.error("Expected an even number of arguments.");if(Fe=J.parse(Fe,2,Xe),!Fe)return null;let st=[],bt=null;de==="interpolate-hcl"||de==="interpolate-lab"?bt=zt:J.expectedType&&J.expectedType.kind!=="value"&&(bt=J.expectedType);for(let Dt=0;Dt=Qt)return J.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Lr);let $r=J.parse(xr,jr,bt);if(!$r)return null;bt=bt||$r.type,st.push([Qt,$r])}return nt(bt,Xe)||nt(bt,zt)||nt(bt,wr)||nt(bt,mt)||nt(bt,ze(Xe))?new Gi(bt,de,Se,Fe,st):J.error(`Type ${Ze(bt)} is not interpolatable.`)}evaluate(D){let J=this.labels,de=this.outputs;if(J.length===1)return de[0].evaluate(D);let Se=this.input.evaluate(D);if(Se<=J[0])return de[0].evaluate(D);let Fe=J.length;if(Se>=J[Fe-1])return de[Fe-1].evaluate(D);let Ve=ra(J,Se),st=Gi.interpolationFactor(this.interpolation,Se,J[Ve],J[Ve+1]),bt=de[Ve].evaluate(D),Dt=de[Ve+1].evaluate(D);switch(this.operator){case"interpolate":return Si[this.type.kind](bt,Dt,st);case"interpolate-hcl":return Si.color(bt,Dt,st,"hcl");case"interpolate-lab":return Si.color(bt,Dt,st,"lab")}}eachChild(D){D(this.input);for(let J of this.outputs)D(J)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function io(W,D,J,de){let Se=de-J,Fe=W-J;return Se===0?0:D===1?Fe/Se:(Math.pow(D,Fe)-1)/(Math.pow(D,Se)-1)}class vo{constructor(D,J){this.type=D,this.args=J}static parse(D,J){if(D.length<2)return J.error("Expectected at least one argument.");let de=null,Se=J.expectedType;Se&&Se.kind!=="value"&&(de=Se);let Fe=[];for(let st of D.slice(1)){let bt=J.parse(st,1+Fe.length,de,void 0,{typeAnnotation:"omit"});if(!bt)return null;de=de||bt.type,Fe.push(bt)}if(!de)throw new Error("No output type");let Ve=Se&&Fe.some(st=>ke(Se,st.type));return new vo(Ve?br:de,Fe)}evaluate(D){let J,de=null,Se=0;for(let Fe of this.args)if(Se++,de=Fe.evaluate(D),de&&de instanceof Ua&&!de.available&&(J||(J=de.name),de=null,Se===this.args.length&&(de=J)),de!==null)break;return de}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function ms(W,D){return W==="=="||W==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function pi(W,D,J,de){return de.compare(D,J)===0}function lo(W,D,J){let de=W!=="=="&&W!=="!=";return class Y5{constructor(Fe,Ve,st){this.type=St,this.lhs=Fe,this.rhs=Ve,this.collator=st,this.hasUntypedArgument=Fe.type.kind==="value"||Ve.type.kind==="value"}static parse(Fe,Ve){if(Fe.length!==3&&Fe.length!==4)return Ve.error("Expected two or three arguments.");let st=Fe[0],bt=Ve.parse(Fe[1],1,br);if(!bt)return null;if(!ms(st,bt.type))return Ve.concat(1).error(`"${st}" comparisons are not supported for type '${Ze(bt.type)}'.`);let Dt=Ve.parse(Fe[2],2,br);if(!Dt)return null;if(!ms(st,Dt.type))return Ve.concat(2).error(`"${st}" comparisons are not supported for type '${Ze(Dt.type)}'.`);if(bt.type.kind!==Dt.type.kind&&bt.type.kind!=="value"&&Dt.type.kind!=="value")return Ve.error(`Cannot compare types '${Ze(bt.type)}' and '${Ze(Dt.type)}'.`);de&&(bt.type.kind==="value"&&Dt.type.kind!=="value"?bt=new it(Dt.type,[bt]):bt.type.kind!=="value"&&Dt.type.kind==="value"&&(Dt=new it(bt.type,[Dt])));let Qt=null;if(Fe.length===4){if(bt.type.kind!=="string"&&Dt.type.kind!=="string"&&bt.type.kind!=="value"&&Dt.type.kind!=="value")return Ve.error("Cannot use collator to compare non-string types.");if(Qt=Ve.parse(Fe[3],3,hr),!Qt)return null}return new Y5(bt,Dt,Qt)}evaluate(Fe){let Ve=this.lhs.evaluate(Fe),st=this.rhs.evaluate(Fe);if(de&&this.hasUntypedArgument){let bt=Sa(Ve),Dt=Sa(st);if(bt.kind!==Dt.kind||bt.kind!=="string"&&bt.kind!=="number")throw new ti(`Expected arguments for "${W}" to be (string, string) or (number, number), but found (${bt.kind}, ${Dt.kind}) instead.`)}if(this.collator&&!de&&this.hasUntypedArgument){let bt=Sa(Ve),Dt=Sa(st);if(bt.kind!=="string"||Dt.kind!=="string")return D(Fe,Ve,st)}return this.collator?J(Fe,Ve,st,this.collator.evaluate(Fe)):D(Fe,Ve,st)}eachChild(Fe){Fe(this.lhs),Fe(this.rhs),this.collator&&Fe(this.collator)}outputDefined(){return!0}}}let Ai=lo("==",function(W,D,J){return D===J},pi),Fo=lo("!=",function(W,D,J){return D!==J},function(W,D,J,de){return!pi(0,D,J,de)}),No=lo("<",function(W,D,J){return D",function(W,D,J){return D>J},function(W,D,J,de){return de.compare(D,J)>0}),bo=lo("<=",function(W,D,J){return D<=J},function(W,D,J,de){return de.compare(D,J)<=0}),Hi=lo(">=",function(W,D,J){return D>=J},function(W,D,J,de){return de.compare(D,J)>=0});class Pi{constructor(D,J,de){this.type=hr,this.locale=de,this.caseSensitive=D,this.diacriticSensitive=J}static parse(D,J){if(D.length!==2)return J.error("Expected one argument.");let de=D[1];if(typeof de!="object"||Array.isArray(de))return J.error("Collator options argument must be an object.");let Se=J.parse(de["case-sensitive"]!==void 0&&de["case-sensitive"],1,St);if(!Se)return null;let Fe=J.parse(de["diacritic-sensitive"]!==void 0&&de["diacritic-sensitive"],1,St);if(!Fe)return null;let Ve=null;return de.locale&&(Ve=J.parse(de.locale,1,Tt),!Ve)?null:new Pi(Se,Fe,Ve)}evaluate(D){return new Pr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class ji{constructor(D,J,de,Se,Fe){this.type=Tt,this.number=D,this.locale=J,this.currency=de,this.minFractionDigits=Se,this.maxFractionDigits=Fe}static parse(D,J){if(D.length!==3)return J.error("Expected two arguments.");let de=J.parse(D[1],1,Xe);if(!de)return null;let Se=D[2];if(typeof Se!="object"||Array.isArray(Se))return J.error("NumberFormat options argument must be an object.");let Fe=null;if(Se.locale&&(Fe=J.parse(Se.locale,1,Tt),!Fe))return null;let Ve=null;if(Se.currency&&(Ve=J.parse(Se.currency,1,Tt),!Ve))return null;let st=null;if(Se["min-fraction-digits"]&&(st=J.parse(Se["min-fraction-digits"],1,Xe),!st))return null;let bt=null;return Se["max-fraction-digits"]&&(bt=J.parse(Se["max-fraction-digits"],1,Xe),!bt)?null:new ji(de,Fe,Ve,st,bt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class Uo{constructor(D){this.type=Or,this.sections=D}static parse(D,J){if(D.length<2)return J.error("Expected at least one argument.");let de=D[1];if(!Array.isArray(de)&&typeof de=="object")return J.error("First argument must be an image or text section.");let Se=[],Fe=!1;for(let Ve=1;Ve<=D.length-1;++Ve){let st=D[Ve];if(Fe&&typeof st=="object"&&!Array.isArray(st)){Fe=!1;let bt=null;if(st["font-scale"]&&(bt=J.parse(st["font-scale"],1,Xe),!bt))return null;let Dt=null;if(st["text-font"]&&(Dt=J.parse(st["text-font"],1,ze(Tt)),!Dt))return null;let Qt=null;if(st["text-color"]&&(Qt=J.parse(st["text-color"],1,zt),!Qt))return null;let xr=Se[Se.length-1];xr.scale=bt,xr.font=Dt,xr.textColor=Qt}else{let bt=J.parse(D[Ve],1,br);if(!bt)return null;let Dt=bt.type.kind;if(Dt!=="string"&&Dt!=="value"&&Dt!=="null"&&Dt!=="resolvedImage")return J.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Fe=!0,Se.push({content:bt,scale:null,font:null,textColor:null})}}return new Uo(Se)}evaluate(D){return new Kr(this.sections.map(J=>{let de=J.content.evaluate(D);return Sa(de)===Er?new Yr("",de,null,null,null):new Yr(Zn(de),null,J.scale?J.scale.evaluate(D):null,J.font?J.font.evaluate(D).join(","):null,J.textColor?J.textColor.evaluate(D):null)}))}eachChild(D){for(let J of this.sections)D(J.content),J.scale&&D(J.scale),J.font&&D(J.font),J.textColor&&D(J.textColor)}outputDefined(){return!1}}class Ko{constructor(D){this.type=Er,this.input=D}static parse(D,J){if(D.length!==2)return J.error("Expected two arguments.");let de=J.parse(D[1],1,Tt);return de?new Ko(de):J.error("No image name provided.")}evaluate(D){let J=this.input.evaluate(D),de=Ua.fromString(J);return de&&D.availableImages&&(de.available=D.availableImages.indexOf(J)>-1),de}eachChild(D){D(this.input)}outputDefined(){return!1}}class us{constructor(D){this.type=Xe,this.input=D}static parse(D,J){if(D.length!==2)return J.error(`Expected 1 argument, but found ${D.length-1} instead.`);let de=J.parse(D[1],1);return de?de.type.kind!=="array"&&de.type.kind!=="string"&&de.type.kind!=="value"?J.error(`Expected argument of type string or array, but found ${Ze(de.type)} instead.`):new us(de):null}evaluate(D){let J=this.input.evaluate(D);if(typeof J=="string")return[...J].length;if(Array.isArray(J))return J.length;throw new ti(`Expected value to be of type string or array, but found ${Ze(Sa(J))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}let ko=8192;function zn(W,D){let J=(180+W[0])/360,de=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+W[1]*Math.PI/360)))/360,Se=Math.pow(2,D.z);return[Math.round(J*Se*ko),Math.round(de*Se*ko)]}function _i(W,D){let J=Math.pow(2,D.z);return[(Se=(W[0]/ko+D.x)/J,360*Se-180),(de=(W[1]/ko+D.y)/J,360/Math.PI*Math.atan(Math.exp((180-360*de)*Math.PI/180))-90)];var de,Se}function xs(W,D){W[0]=Math.min(W[0],D[0]),W[1]=Math.min(W[1],D[1]),W[2]=Math.max(W[2],D[0]),W[3]=Math.max(W[3],D[1])}function Qo(W,D){return!(W[0]<=D[0]||W[2]>=D[2]||W[1]<=D[1]||W[3]>=D[3])}function Ii(W,D,J){let de=W[0]-D[0],Se=W[1]-D[1],Fe=W[0]-J[0],Ve=W[1]-J[1];return de*Ve-Fe*Se==0&&de*Fe<=0&&Se*Ve<=0}function gs(W,D,J,de){return(Se=[de[0]-J[0],de[1]-J[1]])[0]*(Fe=[D[0]-W[0],D[1]-W[1]])[1]-Se[1]*Fe[0]!=0&&!(!oo(W,D,J,de)||!oo(J,de,W,D));var Se,Fe}function Zo(W,D,J){for(let de of J)for(let Se=0;Se(Se=W)[1]!=(Ve=st[bt+1])[1]>Se[1]&&Se[0]<(Ve[0]-Fe[0])*(Se[1]-Fe[1])/(Ve[1]-Fe[1])+Fe[0]&&(de=!de)}var Se,Fe,Ve;return de}function zs(W,D){for(let J of D)if(Ss(W,J))return!0;return!1}function ui(W,D){for(let J of W)if(!Ss(J,D))return!1;for(let J=0;J0&&st<0||Ve<0&&st>0}function vs(W,D,J){let de=[];for(let Se=0;SeJ[2]){let Se=.5*de,Fe=W[0]-J[0]>Se?-de:J[0]-W[0]>Se?de:0;Fe===0&&(Fe=W[0]-J[2]>Se?-de:J[2]-W[0]>Se?de:0),W[0]+=Fe}xs(D,W)}function Ts(W,D,J,de){let Se=Math.pow(2,de.z)*ko,Fe=[de.x*ko,de.y*ko],Ve=[];for(let st of W)for(let bt of st){let Dt=[bt.x+Fe[0],bt.y+Fe[1]];Ki(Dt,D,J,Se),Ve.push(Dt)}return Ve}function Ws(W,D,J,de){let Se=Math.pow(2,de.z)*ko,Fe=[de.x*ko,de.y*ko],Ve=[];for(let bt of W){let Dt=[];for(let Qt of bt){let xr=[Qt.x+Fe[0],Qt.y+Fe[1]];xs(D,xr),Dt.push(xr)}Ve.push(Dt)}if(D[2]-D[0]<=Se/2){(st=D)[0]=st[1]=1/0,st[2]=st[3]=-1/0;for(let bt of Ve)for(let Dt of bt)Ki(Dt,D,J,Se)}var st;return Ve}class as{constructor(D,J){this.type=St,this.geojson=D,this.geometries=J}static parse(D,J){if(D.length!==2)return J.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(an(D[1])){let de=D[1];if(de.type==="FeatureCollection"){let Se=[];for(let Fe of de.features){let{type:Ve,coordinates:st}=Fe.geometry;Ve==="Polygon"&&Se.push(st),Ve==="MultiPolygon"&&Se.push(...st)}if(Se.length)return new as(de,{type:"MultiPolygon",coordinates:Se})}else if(de.type==="Feature"){let Se=de.geometry.type;if(Se==="Polygon"||Se==="MultiPolygon")return new as(de,de.geometry)}else if(de.type==="Polygon"||de.type==="MultiPolygon")return new as(de,de)}return J.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(J,de){let Se=[1/0,1/0,-1/0,-1/0],Fe=[1/0,1/0,-1/0,-1/0],Ve=J.canonicalID();if(de.type==="Polygon"){let st=vs(de.coordinates,Fe,Ve),bt=Ts(J.geometry(),Se,Fe,Ve);if(!Qo(Se,Fe))return!1;for(let Dt of bt)if(!Ss(Dt,st))return!1}if(de.type==="MultiPolygon"){let st=Nl(de.coordinates,Fe,Ve),bt=Ts(J.geometry(),Se,Fe,Ve);if(!Qo(Se,Fe))return!1;for(let Dt of bt)if(!zs(Dt,st))return!1}return!0})(D,this.geometries);if(D.geometryType()==="LineString")return(function(J,de){let Se=[1/0,1/0,-1/0,-1/0],Fe=[1/0,1/0,-1/0,-1/0],Ve=J.canonicalID();if(de.type==="Polygon"){let st=vs(de.coordinates,Fe,Ve),bt=Ws(J.geometry(),Se,Fe,Ve);if(!Qo(Se,Fe))return!1;for(let Dt of bt)if(!ui(Dt,st))return!1}if(de.type==="MultiPolygon"){let st=Nl(de.coordinates,Fe,Ve),bt=Ws(J.geometry(),Se,Fe,Ve);if(!Qo(Se,Fe))return!1;for(let Dt of bt)if(!po(Dt,st))return!1}return!0})(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let bs=class{constructor(W=[],D=(J,de)=>Jde?1:0){if(this.data=W,this.length=this.data.length,this.compare=D,this.length>0)for(let J=(this.length>>1)-1;J>=0;J--)this._down(J)}push(W){this.data.push(W),this._up(this.length++)}pop(){if(this.length===0)return;let W=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),W}peek(){return this.data[0]}_up(W){let{data:D,compare:J}=this,de=D[W];for(;W>0;){let Se=W-1>>1,Fe=D[Se];if(J(de,Fe)>=0)break;D[W]=Fe,W=Se}D[W]=de}_down(W){let{data:D,compare:J}=this,de=this.length>>1,Se=D[W];for(;W=0)break;D[W]=D[Fe],W=Fe}D[W]=Se}};function Go(W,D,J,de,Se){ns(W,D,J,de||W.length-1,Se||Rl)}function ns(W,D,J,de,Se){for(;de>J;){if(de-J>600){var Fe=de-J+1,Ve=D-J+1,st=Math.log(Fe),bt=.5*Math.exp(2*st/3),Dt=.5*Math.sqrt(st*bt*(Fe-bt)/Fe)*(Ve-Fe/2<0?-1:1);ns(W,D,Math.max(J,Math.floor(D-Ve*bt/Fe+Dt)),Math.min(de,Math.floor(D+(Fe-Ve)*bt/Fe+Dt)),Se)}var Qt=W[D],xr=J,Lr=de;for(fl(W,J,D),Se(W[de],Qt)>0&&fl(W,J,de);xr0;)Lr--}Se(W[J],Qt)===0?fl(W,J,Lr):fl(W,++Lr,de),Lr<=D&&(J=Lr+1),D<=Lr&&(de=Lr-1)}}function fl(W,D,J){var de=W[D];W[D]=W[J],W[J]=de}function Rl(W,D){return WD?1:0}function Vu(W,D){if(W.length<=1)return[W];let J=[],de,Se;for(let Fe of W){let Ve=Ic(Fe);Ve!==0&&(Fe.area=Math.abs(Ve),Se===void 0&&(Se=Ve<0),Se===Ve<0?(de&&J.push(de),de=[Fe]):de.push(Fe))}if(de&&J.push(de),D>1)for(let Fe=0;Fe1?(Dt=D[bt+1][0],Qt=D[bt+1][1]):jr>0&&(Dt+=xr/this.kx*jr,Qt+=Lr/this.ky*jr)),xr=this.wrap(J[0]-Dt)*this.kx,Lr=(J[1]-Qt)*this.ky;let $r=xr*xr+Lr*Lr;$r180;)D-=360;return D}}function Dl(W,D){return D[0]-W[0]}function il(W){return W[1]-W[0]+1}function Au(W,D){return W[1]>=W[0]&&W[1]W[1])return[null,null];let J=il(W);if(D){if(J===2)return[W,null];let Se=Math.floor(J/2);return[[W[0],W[0]+Se],[W[0]+Se,W[1]]]}if(J===1)return[W,null];let de=Math.floor(J/2)-1;return[[W[0],W[0]+de],[W[0]+de+1,W[1]]]}function Fs(W,D){if(!Au(D,W.length))return[1/0,1/0,-1/0,-1/0];let J=[1/0,1/0,-1/0,-1/0];for(let de=D[0];de<=D[1];++de)xs(J,W[de]);return J}function Xs(W){let D=[1/0,1/0,-1/0,-1/0];for(let J of W)for(let de of J)xs(D,de);return D}function es(W){return W[0]!==-1/0&&W[1]!==-1/0&&W[2]!==1/0&&W[3]!==1/0}function Ms(W,D,J){if(!es(W)||!es(D))return NaN;let de=0,Se=0;return W[2]D[2]&&(de=W[0]-D[2]),W[1]>D[3]&&(Se=W[1]-D[3]),W[3]=de)return de;if(Qo(Se,Fe)){if(Tf(W,D))return 0}else if(Tf(D,W))return 0;let Ve=1/0;for(let st of W)for(let bt=0,Dt=st.length,Qt=Dt-1;bt0;){let bt=Ve.pop();if(bt[0]>=Fe)continue;let Dt=bt[1],Qt=D?50:100;if(il(Dt)<=Qt){if(!Au(Dt,W.length))return NaN;if(D){let xr=Vo(W,Dt,J,de);if(isNaN(xr)||xr===0)return xr;Fe=Math.min(Fe,xr)}else for(let xr=Dt[0];xr<=Dt[1];++xr){let Lr=wf(W[xr],J,de);if(Fe=Math.min(Fe,Lr),Fe===0)return 0}}else{let xr=ou(Dt,D);Vi(Ve,Fe,de,W,st,xr[0]),Vi(Ve,Fe,de,W,st,xr[1])}}return Fe}function vl(W,D,J,de,Se,Fe=1/0){let Ve=Math.min(Fe,Se.distance(W[0],J[0]));if(Ve===0)return Ve;let st=new bs([[0,[0,W.length-1],[0,J.length-1]]],Dl);for(;st.length>0;){let bt=st.pop();if(bt[0]>=Ve)continue;let Dt=bt[1],Qt=bt[2],xr=D?50:100,Lr=de?50:100;if(il(Dt)<=xr&&il(Qt)<=Lr){if(!Au(Dt,W.length)&&Au(Qt,J.length))return NaN;let jr;if(D&&de)jr=cu(W,Dt,J,Qt,Se),Ve=Math.min(Ve,jr);else if(D&&!de){let $r=W.slice(Dt[0],Dt[1]+1);for(let ia=Qt[0];ia<=Qt[1];++ia)if(jr=Su(J[ia],$r,Se),Ve=Math.min(Ve,jr),Ve===0)return Ve}else if(!D&&de){let $r=J.slice(Qt[0],Qt[1]+1);for(let ia=Dt[0];ia<=Dt[1];++ia)if(jr=Su(W[ia],$r,Se),Ve=Math.min(Ve,jr),Ve===0)return Ve}else jr=qs(W,Dt,J,Qt,Se),Ve=Math.min(Ve,jr)}else{let jr=ou(Dt,D),$r=ou(Qt,de);sc(st,Ve,Se,W,J,jr[0],$r[0]),sc(st,Ve,Se,W,J,jr[0],$r[1]),sc(st,Ve,Se,W,J,jr[1],$r[0]),sc(st,Ve,Se,W,J,jr[1],$r[1])}}return Ve}function Rc(W){return W.type==="MultiPolygon"?W.coordinates.map(D=>({type:"Polygon",coordinates:D})):W.type==="MultiLineString"?W.coordinates.map(D=>({type:"LineString",coordinates:D})):W.type==="MultiPoint"?W.coordinates.map(D=>({type:"Point",coordinates:D})):[W]}class qu{constructor(D,J){this.type=Xe,this.geojson=D,this.geometries=J}static parse(D,J){if(D.length!==2)return J.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(an(D[1])){let de=D[1];if(de.type==="FeatureCollection")return new qu(de,de.features.map(Se=>Rc(Se.geometry)).flat());if(de.type==="Feature")return new qu(de,Rc(de.geometry));if("type"in de&&"coordinates"in de)return new qu(de,Rc(de))}return J.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(J,de){let Se=J.geometry(),Fe=Se.flat().map(bt=>_i([bt.x,bt.y],J.canonical));if(Se.length===0)return NaN;let Ve=new oc(Fe[0][1]),st=1/0;for(let bt of de){switch(bt.type){case"Point":st=Math.min(st,vl(Fe,!1,[bt.coordinates],!1,Ve,st));break;case"LineString":st=Math.min(st,vl(Fe,!1,bt.coordinates,!0,Ve,st));break;case"Polygon":st=Math.min(st,fu(Fe,!1,bt.coordinates,Ve,st))}if(st===0)return st}return st})(D,this.geometries);if(D.geometryType()==="LineString")return(function(J,de){let Se=J.geometry(),Fe=Se.flat().map(bt=>_i([bt.x,bt.y],J.canonical));if(Se.length===0)return NaN;let Ve=new oc(Fe[0][1]),st=1/0;for(let bt of de){switch(bt.type){case"Point":st=Math.min(st,vl(Fe,!0,[bt.coordinates],!1,Ve,st));break;case"LineString":st=Math.min(st,vl(Fe,!0,bt.coordinates,!0,Ve,st));break;case"Polygon":st=Math.min(st,fu(Fe,!0,bt.coordinates,Ve,st))}if(st===0)return st}return st})(D,this.geometries);if(D.geometryType()==="Polygon")return(function(J,de){let Se=J.geometry();if(Se.length===0||Se[0].length===0)return NaN;let Fe=Vu(Se,0).map(bt=>bt.map(Dt=>Dt.map(Qt=>_i([Qt.x,Qt.y],J.canonical)))),Ve=new oc(Fe[0][0][0][1]),st=1/0;for(let bt of de)for(let Dt of Fe){switch(bt.type){case"Point":st=Math.min(st,fu([bt.coordinates],!1,Dt,Ve,st));break;case"LineString":st=Math.min(st,fu(bt.coordinates,!0,Dt,Ve,st));break;case"Polygon":st=Math.min(st,ss(Dt,bt.coordinates,Ve,st))}if(st===0)return st}return st})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let yc={"==":Ai,"!=":Fo,">":$o,"<":No,">=":Hi,"<=":bo,array:it,at:qt,boolean:it,case:Ta,coalesce:vo,collator:Pi,format:Uo,image:Ko,in:fr,"index-of":Ir,interpolate:Gi,"interpolate-hcl":Gi,"interpolate-lab":Gi,length:us,let:Ur,literal:Wn,match:da,number:it,"number-format":ji,object:it,slice:ua,step:ha,string:it,"to-boolean":Ar,"to-color":Ar,"to-number":Ar,"to-string":Ar,var:dt,within:as,distance:qu};class Al{constructor(D,J,de,Se){this.name=D,this.type=J,this._evaluate=de,this.args=Se}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,J){let de=D[0],Se=Al.definitions[de];if(!Se)return J.error(`Unknown expression "${de}". If you wanted a literal array, use ["literal", [...]].`,0);let Fe=Array.isArray(Se)?Se[0]:Se.type,Ve=Array.isArray(Se)?[[Se[1],Se[2]]]:Se.overloads,st=Ve.filter(([Dt])=>!Array.isArray(Dt)||Dt.length===D.length-1),bt=null;for(let[Dt,Qt]of st){bt=new zr(J.registry,Uc,J.path,null,J.scope);let xr=[],Lr=!1;for(let jr=1;jr{return Lr=xr,Array.isArray(Lr)?`(${Lr.map(Ze).join(", ")})`:`(${Ze(Lr.type)}...)`;var Lr}).join(" | "),Qt=[];for(let xr=1;xr{J=D?J&&Uc(de):J&&de instanceof Wn}),!!J&&jc(W)&&Dc(W,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function jc(W){if(W instanceof Al&&(W.name==="get"&&W.args.length===1||W.name==="feature-state"||W.name==="has"&&W.args.length===1||W.name==="properties"||W.name==="geometry-type"||W.name==="id"||/^filter-/.test(W.name))||W instanceof as||W instanceof qu)return!1;let D=!0;return W.eachChild(J=>{D&&!jc(J)&&(D=!1)}),D}function hu(W){if(W instanceof Al&&W.name==="feature-state")return!1;let D=!0;return W.eachChild(J=>{D&&!hu(J)&&(D=!1)}),D}function Dc(W,D){if(W instanceof Al&&D.indexOf(W.name)>=0)return!1;let J=!0;return W.eachChild(de=>{J&&!Dc(de,D)&&(J=!1)}),J}function Mu(W){return{result:"success",value:W}}function lc(W){return{result:"error",value:W}}function Sl(W){return W["property-type"]==="data-driven"||W["property-type"]==="cross-faded-data-driven"}function nc(W){return!!W.expression&&W.expression.parameters.indexOf("zoom")>-1}function Gu(W){return!!W.expression&&W.expression.interpolated}function Es(W){return W instanceof Number?"number":W instanceof String?"string":W instanceof Boolean?"boolean":Array.isArray(W)?"array":W===null?"null":typeof W}function zc(W){return typeof W=="object"&&W!==null&&!Array.isArray(W)}function ff(W){return W}function Vc(W,D){let J=D.type==="color",de=W.stops&&typeof W.stops[0][0]=="object",Se=de||!(de||W.property!==void 0),Fe=W.type||(Gu(D)?"exponential":"interval");if(J||D.type==="padding"){let Qt=J?Xt.parse:na.parse;(W=ie({},W)).stops&&(W.stops=W.stops.map(xr=>[xr[0],Qt(xr[1])])),W.default=Qt(W.default?W.default:D.default)}if(W.colorSpace&&(Ve=W.colorSpace)!=="rgb"&&Ve!=="hcl"&&Ve!=="lab")throw new Error(`Unknown color space: "${W.colorSpace}"`);var Ve;let st,bt,Dt;if(Fe==="exponential")st=qc;else if(Fe==="interval")st=$l;else if(Fe==="categorical"){st=Qc,bt=Object.create(null);for(let Qt of W.stops)bt[Qt[0]]=Qt[1];Dt=typeof W.stops[0][0]}else{if(Fe!=="identity")throw new Error(`Unknown function type "${Fe}"`);st=Zs}if(de){let Qt={},xr=[];for(let $r=0;$r$r[0]),evaluate:({zoom:$r},ia)=>qc({stops:Lr,base:W.base},D,$r).evaluate($r,ia)}}if(Se){let Qt=Fe==="exponential"?{name:"exponential",base:W.base!==void 0?W.base:1}:null;return{kind:"camera",interpolationType:Qt,interpolationFactor:Gi.interpolationFactor.bind(void 0,Qt),zoomStops:W.stops.map(xr=>xr[0]),evaluate:({zoom:xr})=>st(W,D,xr,bt,Dt)}}return{kind:"source",evaluate(Qt,xr){let Lr=xr&&xr.properties?xr.properties[W.property]:void 0;return Lr===void 0?uc(W.default,D.default):st(W,D,Lr,bt,Dt)}}}function uc(W,D,J){return W!==void 0?W:D!==void 0?D:J!==void 0?J:void 0}function Qc(W,D,J,de,Se){return uc(typeof J===Se?de[J]:void 0,W.default,D.default)}function $l(W,D,J){if(Es(J)!=="number")return uc(W.default,D.default);let de=W.stops.length;if(de===1||J<=W.stops[0][0])return W.stops[0][1];if(J>=W.stops[de-1][0])return W.stops[de-1][1];let Se=ra(W.stops.map(Fe=>Fe[0]),J);return W.stops[Se][1]}function qc(W,D,J){let de=W.base!==void 0?W.base:1;if(Es(J)!=="number")return uc(W.default,D.default);let Se=W.stops.length;if(Se===1||J<=W.stops[0][0])return W.stops[0][1];if(J>=W.stops[Se-1][0])return W.stops[Se-1][1];let Fe=ra(W.stops.map(Qt=>Qt[0]),J),Ve=(function(Qt,xr,Lr,jr){let $r=jr-Lr,ia=Qt-Lr;return $r===0?0:xr===1?ia/$r:(Math.pow(xr,ia)-1)/(Math.pow(xr,$r)-1)})(J,de,W.stops[Fe][0],W.stops[Fe+1][0]),st=W.stops[Fe][1],bt=W.stops[Fe+1][1],Dt=Si[D.type]||ff;return typeof st.evaluate=="function"?{evaluate(...Qt){let xr=st.evaluate.apply(void 0,Qt),Lr=bt.evaluate.apply(void 0,Qt);if(xr!==void 0&&Lr!==void 0)return Dt(xr,Lr,Ve,W.colorSpace)}}:Dt(st,bt,Ve,W.colorSpace)}function Zs(W,D,J){switch(D.type){case"color":J=Xt.parse(J);break;case"formatted":J=Kr.fromString(J.toString());break;case"resolvedImage":J=Ua.fromString(J.toString());break;case"padding":J=na.parse(J);break;default:Es(J)===D.type||D.type==="enum"&&D.values[J]||(J=void 0)}return uc(J,W.default,D.default)}Al.register(yc,{error:[{kind:"error"},[Tt],(W,[D])=>{throw new ti(D.evaluate(W))}],typeof:[Tt,[br],(W,[D])=>Ze(Sa(D.evaluate(W)))],"to-rgba":[ze(Xe,4),[zt],(W,[D])=>{let[J,de,Se,Fe]=D.evaluate(W).rgb;return[255*J,255*de,255*Se,Fe]}],rgb:[zt,[Xe,Xe,Xe],$c],rgba:[zt,[Xe,Xe,Xe,Xe],$c],has:{type:St,overloads:[[[Tt],(W,[D])=>Nc(D.evaluate(W),W.properties())],[[Tt,Ut],(W,[D,J])=>Nc(D.evaluate(W),J.evaluate(W))]]},get:{type:br,overloads:[[[Tt],(W,[D])=>_c(D.evaluate(W),W.properties())],[[Tt,Ut],(W,[D,J])=>_c(D.evaluate(W),J.evaluate(W))]]},"feature-state":[br,[Tt],(W,[D])=>_c(D.evaluate(W),W.featureState||{})],properties:[Ut,[],W=>W.properties()],"geometry-type":[Tt,[],W=>W.geometryType()],id:[br,[],W=>W.id()],zoom:[Xe,[],W=>W.globals.zoom],"heatmap-density":[Xe,[],W=>W.globals.heatmapDensity||0],"line-progress":[Xe,[],W=>W.globals.lineProgress||0],accumulated:[br,[],W=>W.globals.accumulated===void 0?null:W.globals.accumulated],"+":[Xe,ac(Xe),(W,D)=>{let J=0;for(let de of D)J+=de.evaluate(W);return J}],"*":[Xe,ac(Xe),(W,D)=>{let J=1;for(let de of D)J*=de.evaluate(W);return J}],"-":{type:Xe,overloads:[[[Xe,Xe],(W,[D,J])=>D.evaluate(W)-J.evaluate(W)],[[Xe],(W,[D])=>-D.evaluate(W)]]},"/":[Xe,[Xe,Xe],(W,[D,J])=>D.evaluate(W)/J.evaluate(W)],"%":[Xe,[Xe,Xe],(W,[D,J])=>D.evaluate(W)%J.evaluate(W)],ln2:[Xe,[],()=>Math.LN2],pi:[Xe,[],()=>Math.PI],e:[Xe,[],()=>Math.E],"^":[Xe,[Xe,Xe],(W,[D,J])=>Math.pow(D.evaluate(W),J.evaluate(W))],sqrt:[Xe,[Xe],(W,[D])=>Math.sqrt(D.evaluate(W))],log10:[Xe,[Xe],(W,[D])=>Math.log(D.evaluate(W))/Math.LN10],ln:[Xe,[Xe],(W,[D])=>Math.log(D.evaluate(W))],log2:[Xe,[Xe],(W,[D])=>Math.log(D.evaluate(W))/Math.LN2],sin:[Xe,[Xe],(W,[D])=>Math.sin(D.evaluate(W))],cos:[Xe,[Xe],(W,[D])=>Math.cos(D.evaluate(W))],tan:[Xe,[Xe],(W,[D])=>Math.tan(D.evaluate(W))],asin:[Xe,[Xe],(W,[D])=>Math.asin(D.evaluate(W))],acos:[Xe,[Xe],(W,[D])=>Math.acos(D.evaluate(W))],atan:[Xe,[Xe],(W,[D])=>Math.atan(D.evaluate(W))],min:[Xe,ac(Xe),(W,D)=>Math.min(...D.map(J=>J.evaluate(W)))],max:[Xe,ac(Xe),(W,D)=>Math.max(...D.map(J=>J.evaluate(W)))],abs:[Xe,[Xe],(W,[D])=>Math.abs(D.evaluate(W))],round:[Xe,[Xe],(W,[D])=>{let J=D.evaluate(W);return J<0?-Math.round(-J):Math.round(J)}],floor:[Xe,[Xe],(W,[D])=>Math.floor(D.evaluate(W))],ceil:[Xe,[Xe],(W,[D])=>Math.ceil(D.evaluate(W))],"filter-==":[St,[Tt,br],(W,[D,J])=>W.properties()[D.value]===J.value],"filter-id-==":[St,[br],(W,[D])=>W.id()===D.value],"filter-type-==":[St,[Tt],(W,[D])=>W.geometryType()===D.value],"filter-<":[St,[Tt,br],(W,[D,J])=>{let de=W.properties()[D.value],Se=J.value;return typeof de==typeof Se&&de{let J=W.id(),de=D.value;return typeof J==typeof de&&J":[St,[Tt,br],(W,[D,J])=>{let de=W.properties()[D.value],Se=J.value;return typeof de==typeof Se&&de>Se}],"filter-id->":[St,[br],(W,[D])=>{let J=W.id(),de=D.value;return typeof J==typeof de&&J>de}],"filter-<=":[St,[Tt,br],(W,[D,J])=>{let de=W.properties()[D.value],Se=J.value;return typeof de==typeof Se&&de<=Se}],"filter-id-<=":[St,[br],(W,[D])=>{let J=W.id(),de=D.value;return typeof J==typeof de&&J<=de}],"filter->=":[St,[Tt,br],(W,[D,J])=>{let de=W.properties()[D.value],Se=J.value;return typeof de==typeof Se&&de>=Se}],"filter-id->=":[St,[br],(W,[D])=>{let J=W.id(),de=D.value;return typeof J==typeof de&&J>=de}],"filter-has":[St,[br],(W,[D])=>D.value in W.properties()],"filter-has-id":[St,[],W=>W.id()!==null&&W.id()!==void 0],"filter-type-in":[St,[ze(Tt)],(W,[D])=>D.value.indexOf(W.geometryType())>=0],"filter-id-in":[St,[ze(br)],(W,[D])=>D.value.indexOf(W.id())>=0],"filter-in-small":[St,[Tt,ze(br)],(W,[D,J])=>J.value.indexOf(W.properties()[D.value])>=0],"filter-in-large":[St,[Tt,ze(br)],(W,[D,J])=>(function(de,Se,Fe,Ve){for(;Fe<=Ve;){let st=Fe+Ve>>1;if(Se[st]===de)return!0;Se[st]>de?Ve=st-1:Fe=st+1}return!1})(W.properties()[D.value],J.value,0,J.value.length-1)],all:{type:St,overloads:[[[St,St],(W,[D,J])=>D.evaluate(W)&&J.evaluate(W)],[ac(St),(W,D)=>{for(let J of D)if(!J.evaluate(W))return!1;return!0}]]},any:{type:St,overloads:[[[St,St],(W,[D,J])=>D.evaluate(W)||J.evaluate(W)],[ac(St),(W,D)=>{for(let J of D)if(J.evaluate(W))return!0;return!1}]]},"!":[St,[St],(W,[D])=>!D.evaluate(W)],"is-supported-script":[St,[Tt],(W,[D])=>{let J=W.globals&&W.globals.isSupportedScript;return!J||J(D.evaluate(W))}],upcase:[Tt,[Tt],(W,[D])=>D.evaluate(W).toUpperCase()],downcase:[Tt,[Tt],(W,[D])=>D.evaluate(W).toLowerCase()],concat:[Tt,ac(br),(W,D)=>D.map(J=>Zn(J.evaluate(W))).join("")],"resolved-locale":[Tt,[hr],(W,[D])=>D.evaluate(W).resolvedLocale()]});class Ql{constructor(D,J){var de;this.expression=D,this._warningHistory={},this._evaluator=new kr,this._defaultValue=J?(de=J).type==="color"&&zc(de.default)?new Xt(0,0,0,0):de.type==="color"?Xt.parse(de.default)||null:de.type==="padding"?na.parse(de.default)||null:de.type==="variableAnchorOffsetCollection"?Ga.parse(de.default)||null:de.default===void 0?null:de.default:null,this._enumValues=J&&J.type==="enum"?J.values:null}evaluateWithoutErrorHandling(D,J,de,Se,Fe,Ve){return this._evaluator.globals=D,this._evaluator.feature=J,this._evaluator.featureState=de,this._evaluator.canonical=Se,this._evaluator.availableImages=Fe||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)}evaluate(D,J,de,Se,Fe,Ve){this._evaluator.globals=D,this._evaluator.feature=J||null,this._evaluator.featureState=de||null,this._evaluator.canonical=Se,this._evaluator.availableImages=Fe||null,this._evaluator.formattedSection=Ve||null;try{let st=this.expression.evaluate(this._evaluator);if(st==null||typeof st=="number"&&st!=st)return this._defaultValue;if(this._enumValues&&!(st in this._enumValues))throw new ti(`Expected value to be one of ${Object.keys(this._enumValues).map(bt=>JSON.stringify(bt)).join(", ")}, but found ${JSON.stringify(st)} instead.`);return st}catch(st){return this._warningHistory[st.message]||(this._warningHistory[st.message]=!0,typeof console<"u"&&console.warn(st.message)),this._defaultValue}}}function Hu(W){return Array.isArray(W)&&W.length>0&&typeof W[0]=="string"&&W[0]in yc}function Os(W,D){let J=new zr(yc,Uc,[],D?(function(Se){let Fe={color:zt,string:Tt,number:Xe,enum:Tt,boolean:St,formatted:Or,padding:wr,resolvedImage:Er,variableAnchorOffsetCollection:mt};return Se.type==="array"?ze(Fe[Se.value]||br,Se.length):Fe[Se.type]})(D):void 0),de=J.parse(W,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return de?Mu(new Ql(de,D)):lc(J.errors)}class zu{constructor(D,J){this.kind=D,this._styleExpression=J,this.isStateDependent=D!=="constant"&&!hu(J.expression)}evaluateWithoutErrorHandling(D,J,de,Se,Fe,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,J,de,Se,Fe,Ve)}evaluate(D,J,de,Se,Fe,Ve){return this._styleExpression.evaluate(D,J,de,Se,Fe,Ve)}}class ql{constructor(D,J,de,Se){this.kind=D,this.zoomStops=de,this._styleExpression=J,this.isStateDependent=D!=="camera"&&!hu(J.expression),this.interpolationType=Se}evaluateWithoutErrorHandling(D,J,de,Se,Fe,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,J,de,Se,Fe,Ve)}evaluate(D,J,de,Se,Fe,Ve){return this._styleExpression.evaluate(D,J,de,Se,Fe,Ve)}interpolationFactor(D,J,de){return this.interpolationType?Gi.interpolationFactor(this.interpolationType,D,J,de):0}}function Xl(W,D){let J=Os(W,D);if(J.result==="error")return J;let de=J.value.expression,Se=jc(de);if(!Se&&!Sl(D))return lc([new Ee("","data expressions not supported")]);let Fe=Dc(de,["zoom"]);if(!Fe&&!nc(D))return lc([new Ee("","zoom expressions not supported")]);let Ve=Gc(de);return Ve||Fe?Ve instanceof Ee?lc([Ve]):Ve instanceof Gi&&!Gu(D)?lc([new Ee("",'"interpolate" expressions cannot be used with this property')]):Mu(Ve?new ql(Se?"camera":"composite",J.value,Ve.labels,Ve instanceof Gi?Ve.interpolation:void 0):new zu(Se?"constant":"source",J.value)):lc([new Ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class rl{constructor(D,J){this._parameters=D,this._specification=J,ie(this,Vc(this._parameters,this._specification))}static deserialize(D){return new rl(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function Gc(W){let D=null;if(W instanceof Ur)D=Gc(W.result);else if(W instanceof vo){for(let J of W.args)if(D=Gc(J),D)break}else(W instanceof ha||W instanceof Gi)&&W.input instanceof Al&&W.input.name==="zoom"&&(D=W);return D instanceof Ee||W.eachChild(J=>{let de=Gc(J);de instanceof Ee?D=de:!D&&de?D=new Ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&de&&D!==de&&(D=new Ee("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function ef(W){if(W===!0||W===!1)return!0;if(!Array.isArray(W)||W.length===0)return!1;switch(W[0]){case"has":return W.length>=2&&W[1]!=="$id"&&W[1]!=="$type";case"in":return W.length>=3&&(typeof W[1]!="string"||Array.isArray(W[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return W.length!==3||Array.isArray(W[1])||Array.isArray(W[2]);case"any":case"all":for(let D of W.slice(1))if(!ef(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}let su={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wu(W){if(W==null)return{filter:()=>!0,needGeometry:!1};ef(W)||(W=xc(W));let D=Os(W,su);if(D.result==="error")throw new Error(D.value.map(J=>`${J.key}: ${J.message}`).join(", "));return{filter:(J,de,Se)=>D.value.evaluate(J,de,{},Se),needGeometry:kf(W)}}function Fu(W,D){return WD?1:0}function kf(W){if(!Array.isArray(W))return!1;if(W[0]==="within"||W[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?Mc(W[1],W[2],D):D==="any"?(J=W.slice(1),["any"].concat(J.map(xc))):D==="all"?["all"].concat(W.slice(1).map(xc)):D==="none"?["all"].concat(W.slice(1).map(xc).map(Ll)):D==="in"?lu(W[1],W.slice(2)):D==="!in"?Ll(lu(W[1],W.slice(2))):D==="has"?bc(W[1]):D!=="!has"||Ll(bc(W[1]));var J}function Mc(W,D,J){switch(W){case"$type":return[`filter-type-${J}`,D];case"$id":return[`filter-id-${J}`,D];default:return[`filter-${J}`,W,D]}}function lu(W,D){if(D.length===0)return!1;switch(W){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(J=>typeof J!=typeof D[0])?["filter-in-large",W,["literal",D.sort(Fu)]]:["filter-in-small",W,["literal",D]]}}function bc(W){switch(W){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",W]}}function Ll(W){return["!",W]}function cc(W){let D=typeof W;if(D==="number"||D==="boolean"||D==="string"||W==null)return JSON.stringify(W);if(Array.isArray(W)){let Se="[";for(let Fe of W)Se+=`${cc(Fe)},`;return`${Se}]`}let J=Object.keys(W).sort(),de="{";for(let Se=0;Sede.maximum?[new ue(D,J,`${J} is greater than the maximum value ${de.maximum}`)]:[]}function wc(W){let D=W.valueSpec,J=Bs(W.value.type),de,Se,Fe,Ve={},st=J!=="categorical"&&W.value.property===void 0,bt=!st,Dt=Es(W.value.stops)==="array"&&Es(W.value.stops[0])==="array"&&Es(W.value.stops[0][0])==="object",Qt=eu({key:W.key,value:W.value,valueSpec:W.styleSpec.function,validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec,objectElementValidators:{stops:function(jr){if(J==="identity")return[new ue(jr.key,jr.value,'identity function may not have a "stops" property')];let $r=[],ia=jr.value;return $r=$r.concat(Fc({key:jr.key,value:ia,valueSpec:jr.valueSpec,validateSpec:jr.validateSpec,style:jr.style,styleSpec:jr.styleSpec,arrayElementValidator:xr})),Es(ia)==="array"&&ia.length===0&&$r.push(new ue(jr.key,ia,"array must have at least one stop")),$r},default:function(jr){return jr.validateSpec({key:jr.key,value:jr.value,valueSpec:D,validateSpec:jr.validateSpec,style:jr.style,styleSpec:jr.styleSpec})}}});return J==="identity"&&st&&Qt.push(new ue(W.key,W.value,'missing required property "property"')),J==="identity"||W.value.stops||Qt.push(new ue(W.key,W.value,'missing required property "stops"')),J==="exponential"&&W.valueSpec.expression&&!Gu(W.valueSpec)&&Qt.push(new ue(W.key,W.value,"exponential functions not supported")),W.styleSpec.$version>=8&&(bt&&!Sl(W.valueSpec)?Qt.push(new ue(W.key,W.value,"property functions not supported")):st&&!nc(W.valueSpec)&&Qt.push(new ue(W.key,W.value,"zoom functions not supported"))),J!=="categorical"&&!Dt||W.value.property!==void 0||Qt.push(new ue(W.key,W.value,'"property" property is required')),Qt;function xr(jr){let $r=[],ia=jr.value,Ra=jr.key;if(Es(ia)!=="array")return[new ue(Ra,ia,`array expected, ${Es(ia)} found`)];if(ia.length!==2)return[new ue(Ra,ia,`array length 2 expected, length ${ia.length} found`)];if(Dt){if(Es(ia[0])!=="object")return[new ue(Ra,ia,`object expected, ${Es(ia[0])} found`)];if(ia[0].zoom===void 0)return[new ue(Ra,ia,"object stop key must have zoom")];if(ia[0].value===void 0)return[new ue(Ra,ia,"object stop key must have value")];if(Fe&&Fe>Bs(ia[0].zoom))return[new ue(Ra,ia[0].zoom,"stop zoom values must appear in ascending order")];Bs(ia[0].zoom)!==Fe&&(Fe=Bs(ia[0].zoom),Se=void 0,Ve={}),$r=$r.concat(eu({key:`${Ra}[0]`,value:ia[0],valueSpec:{zoom:{}},validateSpec:jr.validateSpec,style:jr.style,styleSpec:jr.styleSpec,objectElementValidators:{zoom:Gs,value:Lr}}))}else $r=$r.concat(Lr({key:`${Ra}[0]`,value:ia[0],valueSpec:{},validateSpec:jr.validateSpec,style:jr.style,styleSpec:jr.styleSpec},ia));return Hu(Gl(ia[1]))?$r.concat([new ue(`${Ra}[1]`,ia[1],"expressions are not allowed in function stops.")]):$r.concat(jr.validateSpec({key:`${Ra}[1]`,value:ia[1],valueSpec:D,validateSpec:jr.validateSpec,style:jr.style,styleSpec:jr.styleSpec}))}function Lr(jr,$r){let ia=Es(jr.value),Ra=Bs(jr.value),Va=jr.value!==null?jr.value:$r;if(de){if(ia!==de)return[new ue(jr.key,Va,`${ia} stop domain type must match previous stop domain type ${de}`)]}else de=ia;if(ia!=="number"&&ia!=="string"&&ia!=="boolean")return[new ue(jr.key,Va,"stop domain value must be a number, string, or boolean")];if(ia!=="number"&&J!=="categorical"){let On=`number expected, ${ia} found`;return Sl(D)&&J===void 0&&(On+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ue(jr.key,Va,On)]}return J!=="categorical"||ia!=="number"||isFinite(Ra)&&Math.floor(Ra)===Ra?J!=="categorical"&&ia==="number"&&Se!==void 0&&Ranew ue(`${W.key}${de.key}`,W.value,de.message));let J=D.value.expression||D.value._styleExpression.expression;if(W.expressionContext==="property"&&W.propertyKey==="text-font"&&!J.outputDefined())return[new ue(W.key,W.value,`Invalid data expression for "${W.propertyKey}". Output values must be contained as literals within the expression.`)];if(W.expressionContext==="property"&&W.propertyType==="layout"&&!hu(J))return[new ue(W.key,W.value,'"feature-state" data expressions are not supported with layout properties.')];if(W.expressionContext==="filter"&&!hu(J))return[new ue(W.key,W.value,'"feature-state" data expressions are not supported with filters.')];if(W.expressionContext&&W.expressionContext.indexOf("cluster")===0){if(!Dc(J,["zoom","feature-state"]))return[new ue(W.key,W.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(W.expressionContext==="cluster-initial"&&!jc(J))return[new ue(W.key,W.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function vu(W){let D=W.key,J=W.value,de=W.valueSpec,Se=[];return Array.isArray(de.values)?de.values.indexOf(Bs(J))===-1&&Se.push(new ue(D,J,`expected one of [${de.values.join(", ")}], ${JSON.stringify(J)} found`)):Object.keys(de.values).indexOf(Bs(J))===-1&&Se.push(new ue(D,J,`expected one of [${Object.keys(de.values).join(", ")}], ${JSON.stringify(J)} found`)),Se}function kc(W){return ef(Gl(W.value))?Xu(ie({},W,{expressionContext:"filter",valueSpec:{value:"boolean"}})):du(W)}function du(W){let D=W.value,J=W.key;if(Es(D)!=="array")return[new ue(J,D,`array expected, ${Es(D)} found`)];let de=W.styleSpec,Se,Fe=[];if(D.length<1)return[new ue(J,D,"filter array must have at least 1 element")];switch(Fe=Fe.concat(vu({key:`${J}[0]`,value:D[0],valueSpec:de.filter_operator,style:W.style,styleSpec:W.styleSpec})),Bs(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&Bs(D[1])==="$type"&&Fe.push(new ue(J,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Fe.push(new ue(J,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Se=Es(D[1]),Se!=="string"&&Fe.push(new ue(`${J}[1]`,D[1],`string expected, ${Se} found`)));for(let Ve=2;Ve{Dt in J&&D.push(new ue(de,J[Dt],`"${Dt}" is prohibited for ref layers`))}),Se.layers.forEach(Dt=>{Bs(Dt.id)===st&&(bt=Dt)}),bt?bt.ref?D.push(new ue(de,J.ref,"ref cannot reference another ref layer")):Ve=Bs(bt.type):D.push(new ue(de,J.ref,`ref layer "${st}" not found`))}else if(Ve!=="background")if(J.source){let bt=Se.sources&&Se.sources[J.source],Dt=bt&&Bs(bt.type);bt?Dt==="vector"&&Ve==="raster"?D.push(new ue(de,J.source,`layer "${J.id}" requires a raster source`)):Dt!=="raster-dem"&&Ve==="hillshade"?D.push(new ue(de,J.source,`layer "${J.id}" requires a raster-dem source`)):Dt==="raster"&&Ve!=="raster"?D.push(new ue(de,J.source,`layer "${J.id}" requires a vector source`)):Dt!=="vector"||J["source-layer"]?Dt==="raster-dem"&&Ve!=="hillshade"?D.push(new ue(de,J.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ve!=="line"||!J.paint||!J.paint["line-gradient"]||Dt==="geojson"&&bt.lineMetrics||D.push(new ue(de,J,`layer "${J.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new ue(de,J,`layer "${J.id}" must specify a "source-layer"`)):D.push(new ue(de,J.source,`source "${J.source}" not found`))}else D.push(new ue(de,J,'missing required property "source"'));return D=D.concat(eu({key:de,value:J,valueSpec:Fe.layer,style:W.style,styleSpec:W.styleSpec,validateSpec:W.validateSpec,objectElementValidators:{"*":()=>[],type:()=>W.validateSpec({key:`${de}.type`,value:J.type,valueSpec:Fe.layer.type,style:W.style,styleSpec:W.styleSpec,validateSpec:W.validateSpec,object:J,objectKey:"type"}),filter:kc,layout:bt=>eu({layer:J,key:bt.key,value:bt.value,style:bt.style,styleSpec:bt.styleSpec,validateSpec:bt.validateSpec,objectElementValidators:{"*":Dt=>Pl(ie({layerType:Ve},Dt))}}),paint:bt=>eu({layer:J,key:bt.key,value:bt.value,style:bt.style,styleSpec:bt.styleSpec,validateSpec:bt.validateSpec,objectElementValidators:{"*":Dt=>Oc(ie({layerType:Ve},Dt))}})}})),D}function pu(W){let D=W.value,J=W.key,de=Es(D);return de!=="string"?[new ue(J,D,`string expected, ${de} found`)]:[]}let Zu={promoteId:function({key:W,value:D}){if(Es(D)==="string")return pu({key:W,value:D});{let J=[];for(let de in D)J.push(...pu({key:`${W}.${de}`,value:D[de]}));return J}}};function Ou(W){let D=W.value,J=W.key,de=W.styleSpec,Se=W.style,Fe=W.validateSpec;if(!D.type)return[new ue(J,D,'"type" is required')];let Ve=Bs(D.type),st;switch(Ve){case"vector":case"raster":return st=eu({key:J,value:D,valueSpec:de[`source_${Ve.replace("-","_")}`],style:W.style,styleSpec:de,objectElementValidators:Zu,validateSpec:Fe}),st;case"raster-dem":return st=(function(bt){var Dt;let Qt=(Dt=bt.sourceName)!==null&&Dt!==void 0?Dt:"",xr=bt.value,Lr=bt.styleSpec,jr=Lr.source_raster_dem,$r=bt.style,ia=[],Ra=Es(xr);if(xr===void 0)return ia;if(Ra!=="object")return ia.push(new ue("source_raster_dem",xr,`object expected, ${Ra} found`)),ia;let Va=Bs(xr.encoding)==="custom",On=["redFactor","greenFactor","blueFactor","baseShift"],ln=bt.value.encoding?`"${bt.value.encoding}"`:"Default";for(let Rn in xr)!Va&&On.includes(Rn)?ia.push(new ue(Rn,xr[Rn],`In "${Qt}": "${Rn}" is only valid when "encoding" is set to "custom". ${ln} encoding found`)):jr[Rn]?ia=ia.concat(bt.validateSpec({key:Rn,value:xr[Rn],valueSpec:jr[Rn],validateSpec:bt.validateSpec,style:$r,styleSpec:Lr})):ia.push(new ue(Rn,xr[Rn],`unknown property "${Rn}"`));return ia})({sourceName:J,value:D,style:W.style,styleSpec:de,validateSpec:Fe}),st;case"geojson":if(st=eu({key:J,value:D,valueSpec:de.source_geojson,style:Se,styleSpec:de,validateSpec:Fe,objectElementValidators:Zu}),D.cluster)for(let bt in D.clusterProperties){let[Dt,Qt]=D.clusterProperties[bt],xr=typeof Dt=="string"?[Dt,["accumulated"],["get",bt]]:Dt;st.push(...Xu({key:`${J}.${bt}.map`,value:Qt,validateSpec:Fe,expressionContext:"cluster-map"})),st.push(...Xu({key:`${J}.${bt}.reduce`,value:xr,validateSpec:Fe,expressionContext:"cluster-reduce"}))}return st;case"video":return eu({key:J,value:D,valueSpec:de.source_video,style:Se,validateSpec:Fe,styleSpec:de});case"image":return eu({key:J,value:D,valueSpec:de.source_image,style:Se,validateSpec:Fe,styleSpec:de});case"canvas":return[new ue(J,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return vu({key:`${J}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:Se,validateSpec:Fe,styleSpec:de})}}function dl(W){let D=W.value,J=W.styleSpec,de=J.light,Se=W.style,Fe=[],Ve=Es(D);if(D===void 0)return Fe;if(Ve!=="object")return Fe=Fe.concat([new ue("light",D,`object expected, ${Ve} found`)]),Fe;for(let st in D){let bt=st.match(/^(.*)-transition$/);Fe=Fe.concat(bt&&de[bt[1]]&&de[bt[1]].transition?W.validateSpec({key:st,value:D[st],valueSpec:J.transition,validateSpec:W.validateSpec,style:Se,styleSpec:J}):de[st]?W.validateSpec({key:st,value:D[st],valueSpec:de[st],validateSpec:W.validateSpec,style:Se,styleSpec:J}):[new ue(st,D[st],`unknown property "${st}"`)])}return Fe}function Hl(W){let D=W.value,J=W.styleSpec,de=J.sky,Se=W.style,Fe=Es(D);if(D===void 0)return[];if(Fe!=="object")return[new ue("sky",D,`object expected, ${Fe} found`)];let Ve=[];for(let st in D)Ve=Ve.concat(de[st]?W.validateSpec({key:st,value:D[st],valueSpec:de[st],style:Se,styleSpec:J}):[new ue(st,D[st],`unknown property "${st}"`)]);return Ve}function Yu(W){let D=W.value,J=W.styleSpec,de=J.terrain,Se=W.style,Fe=[],Ve=Es(D);if(D===void 0)return Fe;if(Ve!=="object")return Fe=Fe.concat([new ue("terrain",D,`object expected, ${Ve} found`)]),Fe;for(let st in D)Fe=Fe.concat(de[st]?W.validateSpec({key:st,value:D[st],valueSpec:de[st],validateSpec:W.validateSpec,style:Se,styleSpec:J}):[new ue(st,D[st],`unknown property "${st}"`)]);return Fe}function hc(W){let D=[],J=W.value,de=W.key;if(Array.isArray(J)){let Se=[],Fe=[];for(let Ve in J)J[Ve].id&&Se.includes(J[Ve].id)&&D.push(new ue(de,J,`all the sprites' ids must be unique, but ${J[Ve].id} is duplicated`)),Se.push(J[Ve].id),J[Ve].url&&Fe.includes(J[Ve].url)&&D.push(new ue(de,J,`all the sprites' URLs must be unique, but ${J[Ve].url} is duplicated`)),Fe.push(J[Ve].url),D=D.concat(eu({key:`${de}[${Ve}]`,value:J[Ve],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:W.validateSpec}));return D}return pu({key:de,value:J})}let Eu={"*":()=>[],array:Fc,boolean:function(W){let D=W.value,J=W.key,de=Es(D);return de!=="boolean"?[new ue(J,D,`boolean expected, ${de} found`)]:[]},number:Gs,color:function(W){let D=W.key,J=W.value,de=Es(J);return de!=="string"?[new ue(D,J,`color expected, ${de} found`)]:Xt.parse(String(J))?[]:[new ue(D,J,`color expected, "${J}" found`)]},constants:Ec,enum:vu,filter:kc,function:wc,layer:Hc,object:eu,source:Ou,light:dl,sky:Hl,terrain:Yu,projection:function(W){let D=W.value,J=W.styleSpec,de=J.projection,Se=W.style,Fe=Es(D);if(D===void 0)return[];if(Fe!=="object")return[new ue("projection",D,`object expected, ${Fe} found`)];let Ve=[];for(let st in D)Ve=Ve.concat(de[st]?W.validateSpec({key:st,value:D[st],valueSpec:de[st],style:Se,styleSpec:J}):[new ue(st,D[st],`unknown property "${st}"`)]);return Ve},string:pu,formatted:function(W){return pu(W).length===0?[]:Xu(W)},resolvedImage:function(W){return pu(W).length===0?[]:Xu(W)},padding:function(W){let D=W.key,J=W.value;if(Es(J)==="array"){if(J.length<1||J.length>4)return[new ue(D,J,`padding requires 1 to 4 values; ${J.length} values found`)];let de={type:"number"},Se=[];for(let Fe=0;Fe[]}})),W.constants&&(J=J.concat(Ec({key:"constants",value:W.constants,style:W,styleSpec:D,validateSpec:Ku}))),Wr(J)}function Jr(W){return function(D){return W(kl(Vs({},D),{validateSpec:Ku}))}}function Wr(W){return[].concat(W).sort((D,J)=>D.line-J.line)}function xa(W){return function(...D){return Wr(W.apply(this,D))}}mr.source=xa(Jr(Ou)),mr.sprite=xa(Jr(hc)),mr.glyphs=xa(Jr(Yt)),mr.light=xa(Jr(dl)),mr.sky=xa(Jr(Hl)),mr.terrain=xa(Jr(Yu)),mr.layer=xa(Jr(Hc)),mr.filter=xa(Jr(kc)),mr.paintProperty=xa(Jr(Oc)),mr.layoutProperty=xa(Jr(Pl));let $a=mr,xn=$a.light,Fn=$a.sky,Gn=$a.paintProperty,ai=$a.layoutProperty;function wn(W,D){let J=!1;if(D&&D.length)for(let de of D)W.fire(new j(new Error(de.message))),J=!0;return J}class Sn{constructor(D,J,de){let Se=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;let Ve=new Int32Array(this.arrayBuffer);D=Ve[0],this.d=(J=Ve[1])+2*(de=Ve[2]);for(let bt=0;bt=xr[$r+0]&&Se>=xr[$r+1])?(st[jr]=!0,Ve.push(Qt[jr])):st[jr]=!1}}}}_forEachCell(D,J,de,Se,Fe,Ve,st,bt){let Dt=this._convertToCellCoord(D),Qt=this._convertToCellCoord(J),xr=this._convertToCellCoord(de),Lr=this._convertToCellCoord(Se);for(let jr=Dt;jr<=xr;jr++)for(let $r=Qt;$r<=Lr;$r++){let ia=this.d*$r+jr;if((!bt||bt(this._convertFromCellCoord(jr),this._convertFromCellCoord($r),this._convertFromCellCoord(jr+1),this._convertFromCellCoord($r+1)))&&Fe.call(this,D,J,de,Se,ia,Ve,st,bt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let D=this.cells,J=3+this.cells.length+1+1,de=0;for(let Ve=0;Ve=0)continue;let Ve=W[Fe];Se[Fe]=Ln[J].shallow.indexOf(Fe)>=0?Ve:Ui(Ve,D)}W instanceof Error&&(Se.message=W.message)}if(Se.$name)throw new Error("$name property is reserved for worker serialization logic.");return J!=="Object"&&(Se.$name=J),Se}function Ji(W){if(Wi(W))return W;if(Array.isArray(W))return W.map(Ji);if(typeof W!="object")throw new Error("can't deserialize object of type "+typeof W);let D=Ni(W)||"Object";if(!Ln[D])throw new Error(`can't deserialize unregistered class ${D}`);let{klass:J}=Ln[D];if(!J)throw new Error(`can't deserialize unregistered class ${D}`);if(J.deserialize)return J.deserialize(W);let de=Object.create(J.prototype);for(let Se of Object.keys(W)){if(Se==="$name")continue;let Fe=W[Se];de[Se]=Ln[D].shallow.indexOf(Se)>=0?Fe:Ji(Fe)}return de}class hi{constructor(){this.first=!0}update(D,J){let de=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=de,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=de,!0):(this.lastFloorZoom>de?(this.lastIntegerZoom=de+1,this.lastIntegerZoomTime=J):this.lastFloorZoomW>=128&&W<=255,"Hangul Jamo":W=>W>=4352&&W<=4607,Khmer:W=>W>=6016&&W<=6143,"General Punctuation":W=>W>=8192&&W<=8303,"Letterlike Symbols":W=>W>=8448&&W<=8527,"Number Forms":W=>W>=8528&&W<=8591,"Miscellaneous Technical":W=>W>=8960&&W<=9215,"Control Pictures":W=>W>=9216&&W<=9279,"Optical Character Recognition":W=>W>=9280&&W<=9311,"Enclosed Alphanumerics":W=>W>=9312&&W<=9471,"Geometric Shapes":W=>W>=9632&&W<=9727,"Miscellaneous Symbols":W=>W>=9728&&W<=9983,"Miscellaneous Symbols and Arrows":W=>W>=11008&&W<=11263,"Ideographic Description Characters":W=>W>=12272&&W<=12287,"CJK Symbols and Punctuation":W=>W>=12288&&W<=12351,Katakana:W=>W>=12448&&W<=12543,Kanbun:W=>W>=12688&&W<=12703,"CJK Strokes":W=>W>=12736&&W<=12783,"Enclosed CJK Letters and Months":W=>W>=12800&&W<=13055,"CJK Compatibility":W=>W>=13056&&W<=13311,"Yijing Hexagram Symbols":W=>W>=19904&&W<=19967,"Private Use Area":W=>W>=57344&&W<=63743,"Vertical Forms":W=>W>=65040&&W<=65055,"CJK Compatibility Forms":W=>W>=65072&&W<=65103,"Small Form Variants":W=>W>=65104&&W<=65135,"Halfwidth and Fullwidth Forms":W=>W>=65280&&W<=65519};function ao(W){for(let D of W)if(ts(D.charCodeAt(0)))return!0;return!1}function Po(W){for(let D of W)if(!_s(D.charCodeAt(0)))return!1;return!0}function is(W){let D=W.map(J=>{try{return new RegExp(`\\p{sc=${J}}`,"u").source}catch{return null}}).filter(J=>J);return new RegExp(D.join("|"),"u")}let Rs=is(["Arab","Dupl","Mong","Ougr","Syrc"]);function _s(W){return!Rs.test(String.fromCodePoint(W))}let Ps=is(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ts(W){return!(W!==746&&W!==747&&(W<4352||!(Qn["CJK Compatibility Forms"](W)&&!(W>=65097&&W<=65103)||Qn["CJK Compatibility"](W)||Qn["CJK Strokes"](W)||!(!Qn["CJK Symbols and Punctuation"](W)||W>=12296&&W<=12305||W>=12308&&W<=12319||W===12336)||Qn["Enclosed CJK Letters and Months"](W)||Qn["Ideographic Description Characters"](W)||Qn.Kanbun(W)||Qn.Katakana(W)&&W!==12540||!(!Qn["Halfwidth and Fullwidth Forms"](W)||W===65288||W===65289||W===65293||W>=65306&&W<=65310||W===65339||W===65341||W===65343||W>=65371&&W<=65503||W===65507||W>=65512&&W<=65519)||!(!Qn["Small Form Variants"](W)||W>=65112&&W<=65118||W>=65123&&W<=65126)||Qn["Vertical Forms"](W)||Qn["Yijing Hexagram Symbols"](W)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(W))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(W))||Ps.test(String.fromCodePoint(W)))))}function ul(W){return!(ts(W)||(function(D){return!!(Qn["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||Qn["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||Qn["Letterlike Symbols"](D)||Qn["Number Forms"](D)||Qn["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||Qn["Control Pictures"](D)&&D!==9251||Qn["Optical Character Recognition"](D)||Qn["Enclosed Alphanumerics"](D)||Qn["Geometric Shapes"](D)||Qn["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||Qn["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||Qn["CJK Symbols and Punctuation"](D)||Qn.Katakana(D)||Qn["Private Use Area"](D)||Qn["CJK Compatibility Forms"](D)||Qn["Small Form Variants"](D)||Qn["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)})(W))}let Ys=is(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ns(W){return Ys.test(String.fromCodePoint(W))}function ki(W,D){return!(!D&&Ns(W)||W>=2304&&W<=3583||W>=3840&&W<=4255||Qn.Khmer(W))}function go(W){for(let D of W)if(Ns(D.charCodeAt(0)))return!0;return!1}let Cs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(W){this.pluginStatus=W.pluginStatus,this.pluginURL=W.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(W){this.applyArabicShaping=W.applyArabicShaping,this.processBidirectionalText=W.processBidirectionalText,this.processStyledBidirectionalText=W.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class ds{constructor(D,J){this.zoom=D,J?(this.now=J.now,this.fadeDuration=J.fadeDuration,this.zoomHistory=J.zoomHistory,this.transition=J.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new hi,this.transition={})}isSupportedScript(D){return(function(J,de){for(let Se of J)if(!ki(Se.charCodeAt(0),de))return!1;return!0})(D,Cs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let D=this.zoom,J=D-Math.floor(D),de=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:J+(1-J)*de}:{fromScale:.5,toScale:1,t:1-(1-de)*J}}}class zl{constructor(D,J){this.property=D,this.value=J,this.expression=(function(de,Se){if(zc(de))return new rl(de,Se);if(Hu(de)){let Fe=Xl(de,Se);if(Fe.result==="error")throw new Error(Fe.value.map(Ve=>`${Ve.key}: ${Ve.message}`).join(", "));return Fe.value}{let Fe=de;return Se.type==="color"&&typeof de=="string"?Fe=Xt.parse(de):Se.type!=="padding"||typeof de!="number"&&!Array.isArray(de)?Se.type==="variableAnchorOffsetCollection"&&Array.isArray(de)&&(Fe=Ga.parse(de)):Fe=na.parse(de),{kind:"constant",evaluate:()=>Fe}}})(J===void 0?D.specification.default:J,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,J,de){return this.property.possiblyEvaluate(this,D,J,de)}}class tu{constructor(D){this.property=D,this.value=new zl(D,void 0)}transitioned(D,J){return new Ju(this.property,this.value,J,M({},D.transition,this.transition),D.now)}untransitioned(){return new Ju(this.property,this.value,null,{},0)}}class mu{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,J){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new tu(this._values[D].property)),this._values[D].value=new zl(this._values[D].property,J===null?void 0:u(J))}getTransition(D){return u(this._values[D].transition)}setTransition(D,J){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new tu(this._values[D].property)),this._values[D].transition=u(J)||void 0}serialize(){let D={};for(let J of Object.keys(this._values)){let de=this.getValue(J);de!==void 0&&(D[J]=de);let Se=this.getTransition(J);Se!==void 0&&(D[`${J}-transition`]=Se)}return D}transitioned(D,J){let de=new Wl(this._properties);for(let Se of Object.keys(this._values))de._values[Se]=this._values[Se].transitioned(D,J._values[Se]);return de}untransitioned(){let D=new Wl(this._properties);for(let J of Object.keys(this._values))D._values[J]=this._values[J].untransitioned();return D}}class Ju{constructor(D,J,de,Se,Fe){this.property=D,this.value=J,this.begin=Fe+Se.delay||0,this.end=this.begin+Se.duration||0,D.specification.transition&&(Se.delay||Se.duration)&&(this.prior=de)}possiblyEvaluate(D,J,de){let Se=D.now||0,Fe=this.value.possiblyEvaluate(D,J,de),Ve=this.prior;if(Ve){if(Se>this.end)return this.prior=null,Fe;if(this.value.isDataDriven())return this.prior=null,Fe;if(Se=1)return 1;let Dt=bt*bt,Qt=Dt*bt;return 4*(bt<.5?Qt:3*(bt-Dt)+Qt-.75)})(st))}}return Fe}}class Wl{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,J,de){let Se=new Bu(this._properties);for(let Fe of Object.keys(this._values))Se._values[Fe]=this._values[Fe].possiblyEvaluate(D,J,de);return Se}hasTransition(){for(let D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class $u{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,J){this._values[D]=new zl(this._values[D].property,J===null?void 0:u(J))}serialize(){let D={};for(let J of Object.keys(this._values)){let de=this.getValue(J);de!==void 0&&(D[J]=de)}return D}possiblyEvaluate(D,J,de){let Se=new Bu(this._properties);for(let Fe of Object.keys(this._values))Se._values[Fe]=this._values[Fe].possiblyEvaluate(D,J,de);return Se}}class Zl{constructor(D,J,de){this.property=D,this.value=J,this.parameters=de}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,J,de,Se){return this.property.evaluate(this.value,this.parameters,D,J,de,Se)}}class Bu{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class $i{constructor(D){this.specification=D}possiblyEvaluate(D,J){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(J)}interpolate(D,J,de){let Se=Si[this.specification.type];return Se?Se(D,J,de):D}}class _o{constructor(D,J){this.specification=D,this.overrides=J}possiblyEvaluate(D,J,de,Se){return new Zl(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(J,null,{},de,Se)}:D.expression,J)}interpolate(D,J,de){if(D.value.kind!=="constant"||J.value.kind!=="constant")return D;if(D.value.value===void 0||J.value.value===void 0)return new Zl(this,{kind:"constant",value:void 0},D.parameters);let Se=Si[this.specification.type];if(Se){let Fe=Se(D.value.value,J.value.value,de);return new Zl(this,{kind:"constant",value:Fe},D.parameters)}return D}evaluate(D,J,de,Se,Fe,Ve){return D.kind==="constant"?D.value:D.evaluate(J,de,Se,Fe,Ve)}}class Qu extends _o{possiblyEvaluate(D,J,de,Se){if(D.value===void 0)return new Zl(this,{kind:"constant",value:void 0},J);if(D.expression.kind==="constant"){let Fe=D.expression.evaluate(J,null,{},de,Se),Ve=D.property.specification.type==="resolvedImage"&&typeof Fe!="string"?Fe.name:Fe,st=this._calculate(Ve,Ve,Ve,J);return new Zl(this,{kind:"constant",value:st},J)}if(D.expression.kind==="camera"){let Fe=this._calculate(D.expression.evaluate({zoom:J.zoom-1}),D.expression.evaluate({zoom:J.zoom}),D.expression.evaluate({zoom:J.zoom+1}),J);return new Zl(this,{kind:"constant",value:Fe},J)}return new Zl(this,D.expression,J)}evaluate(D,J,de,Se,Fe,Ve){if(D.kind==="source"){let st=D.evaluate(J,de,Se,Fe,Ve);return this._calculate(st,st,st,J)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(J.zoom)-1},de,Se),D.evaluate({zoom:Math.floor(J.zoom)},de,Se),D.evaluate({zoom:Math.floor(J.zoom)+1},de,Se),J):D.value}_calculate(D,J,de,Se){return Se.zoom>Se.zoomHistory.lastIntegerZoom?{from:D,to:J}:{from:de,to:J}}interpolate(D){return D}}class ku{constructor(D){this.specification=D}possiblyEvaluate(D,J,de,Se){if(D.value!==void 0){if(D.expression.kind==="constant"){let Fe=D.expression.evaluate(J,null,{},de,Se);return this._calculate(Fe,Fe,Fe,J)}return this._calculate(D.expression.evaluate(new ds(Math.floor(J.zoom-1),J)),D.expression.evaluate(new ds(Math.floor(J.zoom),J)),D.expression.evaluate(new ds(Math.floor(J.zoom+1),J)),J)}}_calculate(D,J,de,Se){return Se.zoom>Se.zoomHistory.lastIntegerZoom?{from:D,to:J}:{from:de,to:J}}interpolate(D){return D}}class gu{constructor(D){this.specification=D}possiblyEvaluate(D,J,de,Se){return!!D.expression.evaluate(J,null,{},de,Se)}interpolate(){return!1}}class De{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let J in D){let de=D[J];de.specification.overridable&&this.overridableProperties.push(J);let Se=this.defaultPropertyValues[J]=new zl(de,void 0),Fe=this.defaultTransitionablePropertyValues[J]=new tu(de);this.defaultTransitioningPropertyValues[J]=Fe.untransitioned(),this.defaultPossiblyEvaluatedValues[J]=Se.possiblyEvaluate({})}}}sn("DataDrivenProperty",_o),sn("DataConstantProperty",$i),sn("CrossFadedDataDrivenProperty",Qu),sn("CrossFadedProperty",ku),sn("ColorRampProperty",gu);let I="-transition";class ne extends Q{constructor(D,J){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),J.layout&&(this._unevaluatedLayout=new $u(J.layout)),J.paint)){this._transitionablePaint=new mu(J.paint);for(let de in D.paint)this.setPaintProperty(de,D.paint[de],{validate:!1});for(let de in D.layout)this.setLayoutProperty(de,D.layout[de],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Bu(J.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,J,de={}){J!=null&&this._validate(ai,`layers.${this.id}.layout.${D}`,D,J,de)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,J):this.visibility=J)}getPaintProperty(D){return D.endsWith(I)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,J,de={}){if(J!=null&&this._validate(Gn,`layers.${this.id}.paint.${D}`,D,J,de))return!1;if(D.endsWith(I))return this._transitionablePaint.setTransition(D.slice(0,-11),J||void 0),!1;{let Se=this._transitionablePaint._values[D],Fe=Se.property.specification["property-type"]==="cross-faded-data-driven",Ve=Se.value.isDataDriven(),st=Se.value;this._transitionablePaint.setValue(D,J),this._handleSpecialPaintPropertyUpdate(D);let bt=this._transitionablePaint._values[D].value;return bt.isDataDriven()||Ve||Fe||this._handleOverridablePaintPropertyUpdate(D,st,bt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,J,de){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,J){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,J)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,J)}serialize(){let D={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),v(D,(J,de)=>!(J===void 0||de==="layout"&&!Object.keys(J).length||de==="paint"&&!Object.keys(J).length))}_validate(D,J,de,Se,Fe={}){return(!Fe||Fe.validate!==!1)&&wn(this,D.call($a,{key:J,layerType:this.type,objectKey:de,value:Se,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let D in this.paint._values){let J=this.paint.get(D);if(J instanceof Zl&&Sl(J.property.specification)&&(J.value.kind==="source"||J.value.kind==="composite")&&J.value.isStateDependent)return!0}return!1}}let be={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ae{constructor(D,J){this._structArray=D,this._pos1=J*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Re{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,J){return D._trim(),J&&(D.isTransferred=!0,J.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){let J=Object.create(this.prototype);return J.arrayBuffer=D.arrayBuffer,J.length=D.length,J.capacity=D.arrayBuffer.byteLength/J.bytesPerElement,J._refreshViews(),J}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let J=this.uint8;this._refreshViews(),J&&this.uint8.set(J)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ut(W,D=1){let J=0,de=0;return{members:W.map(Se=>{let Fe=be[Se.type].BYTES_PER_ELEMENT,Ve=J=_t(J,Math.max(D,Fe)),st=Se.components||1;return de=Math.max(de,Fe),J+=Fe*st,{name:Se.name,type:Se.type,components:st,offset:Ve}}),size:_t(J,Math.max(de,D)),alignment:D}}function _t(W,D){return Math.ceil(W/D)*D}class Rt extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J){let de=this.length;return this.resize(de+1),this.emplace(de,D,J)}emplace(D,J,de){let Se=2*D;return this.int16[Se+0]=J,this.int16[Se+1]=de,D}}Rt.prototype.bytesPerElement=4,sn("StructArrayLayout2i4",Rt);class Zt extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de){let Se=this.length;return this.resize(Se+1),this.emplace(Se,D,J,de)}emplace(D,J,de,Se){let Fe=3*D;return this.int16[Fe+0]=J,this.int16[Fe+1]=de,this.int16[Fe+2]=Se,D}}Zt.prototype.bytesPerElement=6,sn("StructArrayLayout3i6",Zt);class yr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se){let Fe=this.length;return this.resize(Fe+1),this.emplace(Fe,D,J,de,Se)}emplace(D,J,de,Se,Fe){let Ve=4*D;return this.int16[Ve+0]=J,this.int16[Ve+1]=de,this.int16[Ve+2]=Se,this.int16[Ve+3]=Fe,D}}yr.prototype.bytesPerElement=8,sn("StructArrayLayout4i8",yr);class _r extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve){let st=this.length;return this.resize(st+1),this.emplace(st,D,J,de,Se,Fe,Ve)}emplace(D,J,de,Se,Fe,Ve,st){let bt=6*D;return this.int16[bt+0]=J,this.int16[bt+1]=de,this.int16[bt+2]=Se,this.int16[bt+3]=Fe,this.int16[bt+4]=Ve,this.int16[bt+5]=st,D}}_r.prototype.bytesPerElement=12,sn("StructArrayLayout2i4i12",_r);class Gr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve){let st=this.length;return this.resize(st+1),this.emplace(st,D,J,de,Se,Fe,Ve)}emplace(D,J,de,Se,Fe,Ve,st){let bt=4*D,Dt=8*D;return this.int16[bt+0]=J,this.int16[bt+1]=de,this.uint8[Dt+4]=Se,this.uint8[Dt+5]=Fe,this.uint8[Dt+6]=Ve,this.uint8[Dt+7]=st,D}}Gr.prototype.bytesPerElement=8,sn("StructArrayLayout2i4ub8",Gr);class Qr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J){let de=this.length;return this.resize(de+1),this.emplace(de,D,J)}emplace(D,J,de){let Se=2*D;return this.float32[Se+0]=J,this.float32[Se+1]=de,D}}Qr.prototype.bytesPerElement=8,sn("StructArrayLayout2f8",Qr);class je extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt){let xr=this.length;return this.resize(xr+1),this.emplace(xr,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt)}emplace(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr){let Lr=10*D;return this.uint16[Lr+0]=J,this.uint16[Lr+1]=de,this.uint16[Lr+2]=Se,this.uint16[Lr+3]=Fe,this.uint16[Lr+4]=Ve,this.uint16[Lr+5]=st,this.uint16[Lr+6]=bt,this.uint16[Lr+7]=Dt,this.uint16[Lr+8]=Qt,this.uint16[Lr+9]=xr,D}}je.prototype.bytesPerElement=20,sn("StructArrayLayout10ui20",je);class Ye extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr){let jr=this.length;return this.resize(jr+1),this.emplace(jr,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr)}emplace(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr){let $r=12*D;return this.int16[$r+0]=J,this.int16[$r+1]=de,this.int16[$r+2]=Se,this.int16[$r+3]=Fe,this.uint16[$r+4]=Ve,this.uint16[$r+5]=st,this.uint16[$r+6]=bt,this.uint16[$r+7]=Dt,this.int16[$r+8]=Qt,this.int16[$r+9]=xr,this.int16[$r+10]=Lr,this.int16[$r+11]=jr,D}}Ye.prototype.bytesPerElement=24,sn("StructArrayLayout4i4ui4i24",Ye);class at extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J,de){let Se=this.length;return this.resize(Se+1),this.emplace(Se,D,J,de)}emplace(D,J,de,Se){let Fe=3*D;return this.float32[Fe+0]=J,this.float32[Fe+1]=de,this.float32[Fe+2]=Se,D}}at.prototype.bytesPerElement=12,sn("StructArrayLayout3f12",at);class ct extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){let J=this.length;return this.resize(J+1),this.emplace(J,D)}emplace(D,J){return this.uint32[1*D+0]=J,D}}ct.prototype.bytesPerElement=4,sn("StructArrayLayout1ul4",ct);class At extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve,st,bt,Dt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,D,J,de,Se,Fe,Ve,st,bt,Dt)}emplace(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt){let xr=10*D,Lr=5*D;return this.int16[xr+0]=J,this.int16[xr+1]=de,this.int16[xr+2]=Se,this.int16[xr+3]=Fe,this.int16[xr+4]=Ve,this.int16[xr+5]=st,this.uint32[Lr+3]=bt,this.uint16[xr+8]=Dt,this.uint16[xr+9]=Qt,D}}At.prototype.bytesPerElement=20,sn("StructArrayLayout6i1ul2ui20",At);class yt extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve){let st=this.length;return this.resize(st+1),this.emplace(st,D,J,de,Se,Fe,Ve)}emplace(D,J,de,Se,Fe,Ve,st){let bt=6*D;return this.int16[bt+0]=J,this.int16[bt+1]=de,this.int16[bt+2]=Se,this.int16[bt+3]=Fe,this.int16[bt+4]=Ve,this.int16[bt+5]=st,D}}yt.prototype.bytesPerElement=12,sn("StructArrayLayout2i2i2i12",yt);class Ct extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe){let Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,J,de,Se,Fe)}emplace(D,J,de,Se,Fe,Ve){let st=4*D,bt=8*D;return this.float32[st+0]=J,this.float32[st+1]=de,this.float32[st+2]=Se,this.int16[bt+6]=Fe,this.int16[bt+7]=Ve,D}}Ct.prototype.bytesPerElement=16,sn("StructArrayLayout2f1f2i16",Ct);class nr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve){let st=this.length;return this.resize(st+1),this.emplace(st,D,J,de,Se,Fe,Ve)}emplace(D,J,de,Se,Fe,Ve,st){let bt=16*D,Dt=4*D,Qt=8*D;return this.uint8[bt+0]=J,this.uint8[bt+1]=de,this.float32[Dt+1]=Se,this.float32[Dt+2]=Fe,this.int16[Qt+6]=Ve,this.int16[Qt+7]=st,D}}nr.prototype.bytesPerElement=16,sn("StructArrayLayout2ub2f2i16",nr);class vr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J,de){let Se=this.length;return this.resize(Se+1),this.emplace(Se,D,J,de)}emplace(D,J,de,Se){let Fe=3*D;return this.uint16[Fe+0]=J,this.uint16[Fe+1]=de,this.uint16[Fe+2]=Se,D}}vr.prototype.bytesPerElement=6,sn("StructArrayLayout3ui6",vr);class Tr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va){let On=this.length;return this.resize(On+1),this.emplace(On,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va)}emplace(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va,On){let ln=24*D,Rn=12*D,Hn=48*D;return this.int16[ln+0]=J,this.int16[ln+1]=de,this.uint16[ln+2]=Se,this.uint16[ln+3]=Fe,this.uint32[Rn+2]=Ve,this.uint32[Rn+3]=st,this.uint32[Rn+4]=bt,this.uint16[ln+10]=Dt,this.uint16[ln+11]=Qt,this.uint16[ln+12]=xr,this.float32[Rn+7]=Lr,this.float32[Rn+8]=jr,this.uint8[Hn+36]=$r,this.uint8[Hn+37]=ia,this.uint8[Hn+38]=Ra,this.uint32[Rn+10]=Va,this.int16[ln+22]=On,D}}Tr.prototype.bytesPerElement=48,sn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Tr);class Fr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va,On,ln,Rn,Hn,Ci,ho,Jo,to,Ti,Oo,So){let wo=this.length;return this.resize(wo+1),this.emplace(wo,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va,On,ln,Rn,Hn,Ci,ho,Jo,to,Ti,Oo,So)}emplace(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia,Ra,Va,On,ln,Rn,Hn,Ci,ho,Jo,to,Ti,Oo,So,wo){let ci=32*D,qo=16*D;return this.int16[ci+0]=J,this.int16[ci+1]=de,this.int16[ci+2]=Se,this.int16[ci+3]=Fe,this.int16[ci+4]=Ve,this.int16[ci+5]=st,this.int16[ci+6]=bt,this.int16[ci+7]=Dt,this.uint16[ci+8]=Qt,this.uint16[ci+9]=xr,this.uint16[ci+10]=Lr,this.uint16[ci+11]=jr,this.uint16[ci+12]=$r,this.uint16[ci+13]=ia,this.uint16[ci+14]=Ra,this.uint16[ci+15]=Va,this.uint16[ci+16]=On,this.uint16[ci+17]=ln,this.uint16[ci+18]=Rn,this.uint16[ci+19]=Hn,this.uint16[ci+20]=Ci,this.uint16[ci+21]=ho,this.uint16[ci+22]=Jo,this.uint32[qo+12]=to,this.float32[qo+13]=Ti,this.float32[qo+14]=Oo,this.uint16[ci+30]=So,this.uint16[ci+31]=wo,D}}Fr.prototype.bytesPerElement=64,sn("StructArrayLayout8i15ui1ul2f2ui64",Fr);class Xr extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){let J=this.length;return this.resize(J+1),this.emplace(J,D)}emplace(D,J){return this.float32[1*D+0]=J,D}}Xr.prototype.bytesPerElement=4,sn("StructArrayLayout1f4",Xr);class oa extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J,de){let Se=this.length;return this.resize(Se+1),this.emplace(Se,D,J,de)}emplace(D,J,de,Se){let Fe=3*D;return this.uint16[6*D+0]=J,this.float32[Fe+1]=de,this.float32[Fe+2]=Se,D}}oa.prototype.bytesPerElement=12,sn("StructArrayLayout1ui2f12",oa);class ga extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J,de){let Se=this.length;return this.resize(Se+1),this.emplace(Se,D,J,de)}emplace(D,J,de,Se){let Fe=4*D;return this.uint32[2*D+0]=J,this.uint16[Fe+2]=de,this.uint16[Fe+3]=Se,D}}ga.prototype.bytesPerElement=8,sn("StructArrayLayout1ul2ui8",ga);class Ma extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,J){let de=this.length;return this.resize(de+1),this.emplace(de,D,J)}emplace(D,J,de){let Se=2*D;return this.uint16[Se+0]=J,this.uint16[Se+1]=de,D}}Ma.prototype.bytesPerElement=4,sn("StructArrayLayout2ui4",Ma);class en extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){let J=this.length;return this.resize(J+1),this.emplace(J,D)}emplace(D,J){return this.uint16[1*D+0]=J,D}}en.prototype.bytesPerElement=2,sn("StructArrayLayout1ui2",en);class Dn extends Re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,J,de,Se){let Fe=this.length;return this.resize(Fe+1),this.emplace(Fe,D,J,de,Se)}emplace(D,J,de,Se,Fe){let Ve=4*D;return this.float32[Ve+0]=J,this.float32[Ve+1]=de,this.float32[Ve+2]=Se,this.float32[Ve+3]=Fe,D}}Dn.prototype.bytesPerElement=16,sn("StructArrayLayout4f16",Dn);class In extends Ae{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}In.prototype.size=20;class Kn extends At{get(D){return new In(this,D)}}sn("CollisionBoxArray",Kn);class vi extends Ae{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}vi.prototype.size=48;class zi extends Tr{get(D){return new vi(this,D)}}sn("PlacedSymbolArray",zi);class Mi extends Ae{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Mi.prototype.size=64;class so extends Fr{get(D){return new Mi(this,D)}}sn("SymbolInstanceArray",so);class jo extends Xr{getoffsetX(D){return this.float32[1*D+0]}}sn("GlyphOffsetArray",jo);class uo extends Zt{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}sn("SymbolLineVertexArray",uo);class Co extends Ae{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Co.prototype.size=12;class Xo extends oa{get(D){return new Co(this,D)}}sn("TextAnchorOffsetArray",Xo);class Us extends Ae{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Us.prototype.size=8;class Is extends ga{get(D){return new Us(this,D)}}sn("FeatureIndexArray",Is);class Io extends Rt{}class Ro extends Rt{}class ol extends Rt{}class Ml extends _r{}class ru extends Gr{}class jl extends Qr{}class Qs extends je{}class Fl extends Ye{}class Cu extends at{}class pl extends ct{}class ml extends yt{}class pe extends nr{}class Ie extends vr{}class Je extends Ma{}let ft=ut([{name:"a_pos",components:2,type:"Int16"}],4),{members:pt}=ft;class xt{constructor(D=[]){this.segments=D}prepareSegment(D,J,de,Se){let Fe=this.segments[this.segments.length-1];return D>xt.MAX_VERTEX_ARRAY_LENGTH&&m(`Max vertices per segment is ${xt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Fe||Fe.vertexLength+D>xt.MAX_VERTEX_ARRAY_LENGTH||Fe.sortKey!==Se)&&(Fe={vertexOffset:J.length,primitiveOffset:de.length,vertexLength:0,primitiveLength:0},Se!==void 0&&(Fe.sortKey=Se),this.segments.push(Fe)),Fe}get(){return this.segments}destroy(){for(let D of this.segments)for(let J in D.vaos)D.vaos[J].destroy()}static simpleSegment(D,J,de,Se){return new xt([{vertexOffset:D,primitiveOffset:J,vertexLength:de,primitiveLength:Se,vaos:{},sortKey:0}])}}function Jt(W,D){return 256*(W=w(Math.floor(W),0,255))+w(Math.floor(D),0,255)}xt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,sn("SegmentVector",xt);let Pt=ut([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var dr={exports:{}},Nr={exports:{}};Nr.exports=function(W,D){var J,de,Se,Fe,Ve,st,bt,Dt;for(de=W.length-(J=3&W.length),Se=D,Ve=3432918353,st=461845907,Dt=0;Dt>>16)*Ve&65535)<<16)&4294967295)<<15|bt>>>17))*st+(((bt>>>16)*st&65535)<<16)&4294967295)<<13|Se>>>19))+((5*(Se>>>16)&65535)<<16)&4294967295))+((58964+(Fe>>>16)&65535)<<16);switch(bt=0,J){case 3:bt^=(255&W.charCodeAt(Dt+2))<<16;case 2:bt^=(255&W.charCodeAt(Dt+1))<<8;case 1:Se^=bt=(65535&(bt=(bt=(65535&(bt^=255&W.charCodeAt(Dt)))*Ve+(((bt>>>16)*Ve&65535)<<16)&4294967295)<<15|bt>>>17))*st+(((bt>>>16)*st&65535)<<16)&4294967295}return Se^=W.length,Se=2246822507*(65535&(Se^=Se>>>16))+((2246822507*(Se>>>16)&65535)<<16)&4294967295,Se=3266489909*(65535&(Se^=Se>>>13))+((3266489909*(Se>>>16)&65535)<<16)&4294967295,(Se^=Se>>>16)>>>0};var Vr=Nr.exports,va={exports:{}};va.exports=function(W,D){for(var J,de=W.length,Se=D^de,Fe=0;de>=4;)J=1540483477*(65535&(J=255&W.charCodeAt(Fe)|(255&W.charCodeAt(++Fe))<<8|(255&W.charCodeAt(++Fe))<<16|(255&W.charCodeAt(++Fe))<<24))+((1540483477*(J>>>16)&65535)<<16),Se=1540483477*(65535&Se)+((1540483477*(Se>>>16)&65535)<<16)^(J=1540483477*(65535&(J^=J>>>24))+((1540483477*(J>>>16)&65535)<<16)),de-=4,++Fe;switch(de){case 3:Se^=(255&W.charCodeAt(Fe+2))<<16;case 2:Se^=(255&W.charCodeAt(Fe+1))<<8;case 1:Se=1540483477*(65535&(Se^=255&W.charCodeAt(Fe)))+((1540483477*(Se>>>16)&65535)<<16)}return Se=1540483477*(65535&(Se^=Se>>>13))+((1540483477*(Se>>>16)&65535)<<16),(Se^=Se>>>15)>>>0};var sa=Vr,qa=va.exports;dr.exports=sa,dr.exports.murmur3=sa,dr.exports.murmur2=qa;var Wa=r(dr.exports);class ya{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,J,de,Se){this.ids.push(Ea(D)),this.positions.push(J,de,Se)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let J=Ea(D),de=0,Se=this.ids.length-1;for(;de>1;this.ids[Ve]>=J?Se=Ve:de=Ve+1}let Fe=[];for(;this.ids[de]===J;)Fe.push({index:this.positions[3*de],start:this.positions[3*de+1],end:this.positions[3*de+2]}),de++;return Fe}static serialize(D,J){let de=new Float64Array(D.ids),Se=new Uint32Array(D.positions);return Na(de,Se,0,de.length-1),J&&J.push(de.buffer,Se.buffer),{ids:de,positions:Se}}static deserialize(D){let J=new ya;return J.ids=D.ids,J.positions=D.positions,J.indexed=!0,J}}function Ea(W){let D=+W;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Wa(String(W))}function Na(W,D,J,de){for(;J>1],Fe=J-1,Ve=de+1;for(;;){do Fe++;while(W[Fe]Se);if(Fe>=Ve)break;tn(W,Fe,Ve),tn(D,3*Fe,3*Ve),tn(D,3*Fe+1,3*Ve+1),tn(D,3*Fe+2,3*Ve+2)}Ve-J`u_${Se}`),this.type=de}setUniform(D,J,de){D.set(de.constantOr(this.value))}getBinding(D,J,de){return this.type==="color"?new Xn(D,J):new wa(D,J)}}class qi{constructor(D,J){this.uniformNames=J.map(de=>`u_${de}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,J){this.pixelRatioFrom=J.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=J.tlbr,this.patternTo=D.tlbr}setUniform(D,J,de,Se){let Fe=Se==="u_pattern_to"?this.patternTo:Se==="u_pattern_from"?this.patternFrom:Se==="u_pixel_ratio_to"?this.pixelRatioTo:Se==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Fe&&D.set(Fe)}getBinding(D,J,de){return de.substr(0,9)==="u_pattern"?new Jn(D,J):new wa(D,J)}}class Lo{constructor(D,J,de,Se){this.expression=D,this.type=de,this.maxValue=0,this.paintVertexAttributes=J.map(Fe=>({name:`a_${Fe}`,type:"Float32",components:de==="color"?2:1,offset:0})),this.paintVertexArray=new Se}populatePaintArray(D,J,de,Se,Fe){let Ve=this.paintVertexArray.length,st=this.expression.evaluate(new ds(0),J,{},Se,[],Fe);this.paintVertexArray.resize(D),this._setPaintValue(Ve,D,st)}updatePaintArray(D,J,de,Se){let Fe=this.expression.evaluate({zoom:0},de,Se);this._setPaintValue(D,J,Fe)}_setPaintValue(D,J,de){if(this.type==="color"){let Se=xi(de);for(let Fe=D;Fe`u_${st}_t`),this.type=de,this.useIntegerZoom=Se,this.zoom=Fe,this.maxValue=0,this.paintVertexAttributes=J.map(st=>({name:`a_${st}`,type:"Float32",components:de==="color"?4:2,offset:0})),this.paintVertexArray=new Ve}populatePaintArray(D,J,de,Se,Fe){let Ve=this.expression.evaluate(new ds(this.zoom),J,{},Se,[],Fe),st=this.expression.evaluate(new ds(this.zoom+1),J,{},Se,[],Fe),bt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(bt,D,Ve,st)}updatePaintArray(D,J,de,Se){let Fe=this.expression.evaluate({zoom:this.zoom},de,Se),Ve=this.expression.evaluate({zoom:this.zoom+1},de,Se);this._setPaintValue(D,J,Fe,Ve)}_setPaintValue(D,J,de,Se){if(this.type==="color"){let Fe=xi(de),Ve=xi(Se);for(let st=D;st`#define HAS_UNIFORM_${Se}`))}return D}getBinderAttributes(){let D=[];for(let J in this.binders){let de=this.binders[J];if(de instanceof Lo||de instanceof Xi)for(let Se=0;Se!0){this.programConfigurations={};for(let Se of D)this.programConfigurations[Se.id]=new js(Se,J,de);this.needsUpload=!1,this._featureMap=new ya,this._bufferOffset=0}populatePaintArrays(D,J,de,Se,Fe,Ve){for(let st in this.programConfigurations)this.programConfigurations[st].populatePaintArrays(D,J,Se,Fe,Ve);J.id!==void 0&&this._featureMap.add(J.id,de,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,J,de,Se){for(let Fe of de)this.needsUpload=this.programConfigurations[Fe.id].updatePaintArrays(D,this._featureMap,J,Fe,Se)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(let J in this.programConfigurations)this.programConfigurations[J].upload(D);this.needsUpload=!1}}destroy(){for(let D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Ks(W,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[W]||[W.replace(`${D}-`,"").replace(/-/g,"_")]}function oi(W,D,J){let de={color:{source:Qr,composite:Dn},number:{source:Xr,composite:Qr}},Se=(function(Fe){return{"line-pattern":{source:Qs,composite:Qs},"fill-pattern":{source:Qs,composite:Qs},"fill-extrusion-pattern":{source:Qs,composite:Qs}}[Fe]})(W);return Se&&Se[J]||de[D][J]}sn("ConstantBinder",Fi),sn("CrossFadedConstantBinder",qi),sn("SourceExpressionBinder",Lo),sn("CrossFadedCompositeBinder",Eo),sn("CompositeExpressionBinder",Xi),sn("ProgramConfiguration",js,{omit:["_buffers"]}),sn("ProgramConfigurationSet",Ds);let eo=8192,Ho=Math.pow(2,14)-1,Yo=-Ho-1;function el(W){let D=eo/W.extent,J=W.loadGeometry();for(let de=0;deVe.x+1||btVe.y+1)&&m("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return J}function yl(W,D){return{type:W.type,id:W.id,properties:W.properties,geometry:D?el(W):[]}}function Yl(W,D,J,de,Se){W.emplaceBack(2*D+(de+1)/2,2*J+(Se+1)/2)}class sl{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(J=>J.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Ro,this.indexArray=new Ie,this.segments=new xt,this.programConfigurations=new Ds(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(D,J,de){let Se=this.layers[0],Fe=[],Ve=null,st=!1;Se.type==="circle"&&(Ve=Se.layout.get("circle-sort-key"),st=!Ve.isConstant());for(let{feature:bt,id:Dt,index:Qt,sourceLayerIndex:xr}of D){let Lr=this.layers[0]._featureFilter.needGeometry,jr=yl(bt,Lr);if(!this.layers[0]._featureFilter.filter(new ds(this.zoom),jr,de))continue;let $r=st?Ve.evaluate(jr,{},de):void 0,ia={id:Dt,properties:bt.properties,type:bt.type,sourceLayerIndex:xr,index:Qt,geometry:Lr?jr.geometry:el(bt),patterns:{},sortKey:$r};Fe.push(ia)}st&&Fe.sort((bt,Dt)=>bt.sortKey-Dt.sortKey);for(let bt of Fe){let{geometry:Dt,index:Qt,sourceLayerIndex:xr}=bt,Lr=D[Qt].feature;this.addFeature(bt,Dt,Qt,de),J.featureIndex.insert(Lr,Dt,Qt,xr,this.index)}}update(D,J,de){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,J,this.stateDependentLayers,de)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,pt),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,J,de,Se){for(let Fe of J)for(let Ve of Fe){let st=Ve.x,bt=Ve.y;if(st<0||st>=eo||bt<0||bt>=eo)continue;let Dt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),Qt=Dt.vertexLength;Yl(this.layoutVertexArray,st,bt,-1,-1),Yl(this.layoutVertexArray,st,bt,1,-1),Yl(this.layoutVertexArray,st,bt,1,1),Yl(this.layoutVertexArray,st,bt,-1,1),this.indexArray.emplaceBack(Qt,Qt+1,Qt+2),this.indexArray.emplaceBack(Qt,Qt+3,Qt+2),Dt.vertexLength+=4,Dt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,de,{},Se)}}function Nu(W,D){for(let J=0;J1){if(ea(W,D))return!0;for(let de=0;de1?J:J.sub(D)._mult(Se)._add(D))}function ja(W,D){let J,de,Se,Fe=!1;for(let Ve=0;VeD.y!=Se.y>D.y&&D.x<(Se.x-de.x)*(D.y-de.y)/(Se.y-de.y)+de.x&&(Fe=!Fe)}return Fe}function hn(W,D){let J=!1;for(let de=0,Se=W.length-1;deD.y!=Ve.y>D.y&&D.x<(Ve.x-Fe.x)*(D.y-Fe.y)/(Ve.y-Fe.y)+Fe.x&&(J=!J)}return J}function un(W,D,J){let de=J[0],Se=J[2];if(W.xSe.x&&D.x>Se.x||W.ySe.y&&D.y>Se.y)return!1;let Fe=R(W,D,J[0]);return Fe!==R(W,D,J[1])||Fe!==R(W,D,J[2])||Fe!==R(W,D,J[3])}function Ja(W,D,J){let de=D.paint.get(W).value;return de.kind==="constant"?de.value:J.programConfigurations.get(D.id).getMaxValue(W)}function si(W){return Math.sqrt(W[0]*W[0]+W[1]*W[1])}function Mn(W,D,J,de,Se){if(!D[0]&&!D[1])return W;let Fe=i.convert(D)._mult(Se);J==="viewport"&&Fe._rotate(-de);let Ve=[];for(let st=0;stIa(Ra,ia))})(Dt,bt),jr=xr?Qt*st:Qt;for(let $r of Se)for(let ia of $r){let Ra=xr?ia:Ia(ia,bt),Va=jr,On=ri([],[ia.x,ia.y,0,1],bt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Va*=On[3]/Ve.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Va*=Ve.cameraToCenterDistance/On[3]),tt(Lr,Ra,Va))return!0}return!1}}function Ia(W,D){let J=ri([],[W.x,W.y,0,1],D);return new i(J[0]/J[3],J[1]/J[3])}class Un extends sl{}let An;sn("HeatmapBucket",Un,{omit:["layers"]});var dn={get paint(){return An=An||new De({"heatmap-radius":new _o(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new _o(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new $i(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new gu(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new $i(re.paint_heatmap["heatmap-opacity"])})}};function fn(W,{width:D,height:J},de,Se){if(Se){if(Se instanceof Uint8ClampedArray)Se=new Uint8Array(Se.buffer);else if(Se.length!==D*J*de)throw new RangeError(`mismatched image size. expected: ${Se.length} but got: ${D*J*de}`)}else Se=new Uint8Array(D*J*de);return W.width=D,W.height=J,W.data=Se,W}function Bn(W,{width:D,height:J},de){if(D===W.width&&J===W.height)return;let Se=fn({},{width:D,height:J},de);ii(W,Se,{x:0,y:0},{x:0,y:0},{width:Math.min(W.width,D),height:Math.min(W.height,J)},de),W.width=D,W.height=J,W.data=Se.data}function ii(W,D,J,de,Se,Fe){if(Se.width===0||Se.height===0)return D;if(Se.width>W.width||Se.height>W.height||J.x>W.width-Se.width||J.y>W.height-Se.height)throw new RangeError("out of range source coordinates for image copy");if(Se.width>D.width||Se.height>D.height||de.x>D.width-Se.width||de.y>D.height-Se.height)throw new RangeError("out of range destination coordinates for image copy");let Ve=W.data,st=D.data;if(Ve===st)throw new Error("srcData equals dstData, so image is already copied");for(let bt=0;bt{D[W.evaluationKey]=bt;let Dt=W.expression.evaluate(D);Se.data[Ve+st+0]=Math.floor(255*Dt.r/Dt.a),Se.data[Ve+st+1]=Math.floor(255*Dt.g/Dt.a),Se.data[Ve+st+2]=Math.floor(255*Dt.b/Dt.a),Se.data[Ve+st+3]=Math.floor(255*Dt.a)};if(W.clips)for(let Ve=0,st=0;Ve80*J){st=1/0,bt=1/0;let Qt=-1/0,xr=-1/0;for(let Lr=J;LrQt&&(Qt=jr),$r>xr&&(xr=$r)}Dt=Math.max(Qt-st,xr-bt),Dt=Dt!==0?32767/Dt:0}return El(Fe,Ve,J,st,bt,Dt,0),Ve}function tl(W,D,J,de,Se){let Fe;if(Se===(function(Ve,st,bt,Dt){let Qt=0;for(let xr=st,Lr=bt-Dt;xr0)for(let Ve=D;Ve=D;Ve-=de)Fe=ur(Ve/de|0,W[Ve],W[Ve+1],Fe);return Fe&&Me(Fe,Fe.next)&&(vt(Fe),Fe=Fe.next),Fe}function al(W,D){if(!W)return W;D||(D=W);let J,de=W;do if(J=!1,de.steiner||!Me(de,de.next)&&Ne(de.prev,de,de.next)!==0)de=de.next;else{if(vt(de),de=D=de.prev,de===de.next)break;J=!0}while(J||de!==D);return D}function El(W,D,J,de,Se,Fe,Ve){if(!W)return;!Ve&&Fe&&(function(bt,Dt,Qt,xr){let Lr=bt;do Lr.z===0&&(Lr.z=K(Lr.x,Lr.y,Dt,Qt,xr)),Lr.prevZ=Lr.prev,Lr.nextZ=Lr.next,Lr=Lr.next;while(Lr!==bt);Lr.prevZ.nextZ=null,Lr.prevZ=null,(function(jr){let $r,ia=1;do{let Ra,Va=jr;jr=null;let On=null;for($r=0;Va;){$r++;let ln=Va,Rn=0;for(let Ci=0;Ci0||Hn>0&&ln;)Rn!==0&&(Hn===0||!ln||Va.z<=ln.z)?(Ra=Va,Va=Va.nextZ,Rn--):(Ra=ln,ln=ln.nextZ,Hn--),On?On.nextZ=Ra:jr=Ra,Ra.prevZ=On,On=Ra;Va=ln}On.nextZ=null,ia*=2}while($r>1)})(Lr)})(W,de,Se,Fe);let st=W;for(;W.prev!==W.next;){let bt=W.prev,Dt=W.next;if(Fe?Hs(W,de,Se,Fe):ws(W))D.push(bt.i,W.i,Dt.i),vt(W),W=Dt.next,st=Dt.next;else if((W=Dt)===st){Ve?Ve===1?El(W=$s(al(W),D),D,J,de,Se,Fe,2):Ve===2&&Di(W,D,J,de,Se,Fe):El(al(W),D,J,de,Se,Fe,1);break}}}function ws(W){let D=W.prev,J=W,de=W.next;if(Ne(D,J,de)>=0)return!1;let Se=D.x,Fe=J.x,Ve=de.x,st=D.y,bt=J.y,Dt=de.y,Qt=SeFe?Se>Ve?Se:Ve:Fe>Ve?Fe:Ve,jr=st>bt?st>Dt?st:Dt:bt>Dt?bt:Dt,$r=de.next;for(;$r!==D;){if($r.x>=Qt&&$r.x<=Lr&&$r.y>=xr&&$r.y<=jr&&te(Se,st,Fe,bt,Ve,Dt,$r.x,$r.y)&&Ne($r.prev,$r,$r.next)>=0)return!1;$r=$r.next}return!0}function Hs(W,D,J,de){let Se=W.prev,Fe=W,Ve=W.next;if(Ne(Se,Fe,Ve)>=0)return!1;let st=Se.x,bt=Fe.x,Dt=Ve.x,Qt=Se.y,xr=Fe.y,Lr=Ve.y,jr=stbt?st>Dt?st:Dt:bt>Dt?bt:Dt,Ra=Qt>xr?Qt>Lr?Qt:Lr:xr>Lr?xr:Lr,Va=K(jr,$r,D,J,de),On=K(ia,Ra,D,J,de),ln=W.prevZ,Rn=W.nextZ;for(;ln&&ln.z>=Va&&Rn&&Rn.z<=On;){if(ln.x>=jr&&ln.x<=ia&&ln.y>=$r&&ln.y<=Ra&&ln!==Se&&ln!==Ve&&te(st,Qt,bt,xr,Dt,Lr,ln.x,ln.y)&&Ne(ln.prev,ln,ln.next)>=0||(ln=ln.prevZ,Rn.x>=jr&&Rn.x<=ia&&Rn.y>=$r&&Rn.y<=Ra&&Rn!==Se&&Rn!==Ve&&te(st,Qt,bt,xr,Dt,Lr,Rn.x,Rn.y)&&Ne(Rn.prev,Rn,Rn.next)>=0))return!1;Rn=Rn.nextZ}for(;ln&&ln.z>=Va;){if(ln.x>=jr&&ln.x<=ia&&ln.y>=$r&&ln.y<=Ra&&ln!==Se&&ln!==Ve&&te(st,Qt,bt,xr,Dt,Lr,ln.x,ln.y)&&Ne(ln.prev,ln,ln.next)>=0)return!1;ln=ln.prevZ}for(;Rn&&Rn.z<=On;){if(Rn.x>=jr&&Rn.x<=ia&&Rn.y>=$r&&Rn.y<=Ra&&Rn!==Se&&Rn!==Ve&&te(st,Qt,bt,xr,Dt,Lr,Rn.x,Rn.y)&&Ne(Rn.prev,Rn,Rn.next)>=0)return!1;Rn=Rn.nextZ}return!0}function $s(W,D){let J=W;do{let de=J.prev,Se=J.next.next;!Me(de,Se)&&Ke(de,J,J.next,Se)&&gr(de,Se)&&gr(Se,de)&&(D.push(de.i,J.i,Se.i),vt(J),vt(J.next),J=W=Se),J=J.next}while(J!==W);return al(J)}function Di(W,D,J,de,Se,Fe){let Ve=W;do{let st=Ve.next.next;for(;st!==Ve.prev;){if(Ve.i!==st.i&&ge(Ve,st)){let bt=Dr(Ve,st);return Ve=al(Ve,Ve.next),bt=al(bt,bt.next),El(Ve,D,J,de,Se,Fe,0),void El(bt,D,J,de,Se,Fe,0)}st=st.next}Ve=Ve.next}while(Ve!==W)}function nl(W,D){return W.x-D.x}function mo(W,D){let J=(function(Se,Fe){let Ve=Fe,st=Se.x,bt=Se.y,Dt,Qt=-1/0;do{if(bt<=Ve.y&&bt>=Ve.next.y&&Ve.next.y!==Ve.y){let ia=Ve.x+(bt-Ve.y)*(Ve.next.x-Ve.x)/(Ve.next.y-Ve.y);if(ia<=st&&ia>Qt&&(Qt=ia,Dt=Ve.x=Ve.x&&Ve.x>=Lr&&st!==Ve.x&&te(btDt.x||Ve.x===Dt.x&&me(Dt,Ve)))&&(Dt=Ve,$r=ia)}Ve=Ve.next}while(Ve!==xr);return Dt})(W,D);if(!J)return D;let de=Dr(J,W);return al(de,de.next),al(J,J.next)}function me(W,D){return Ne(W.prev,W,D.prev)<0&&Ne(D.next,W,W.next)<0}function K(W,D,J,de,Se){return(W=1431655765&((W=858993459&((W=252645135&((W=16711935&((W=(W-J)*Se|0)|W<<8))|W<<4))|W<<2))|W<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-de)*Se|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function ye(W){let D=W,J=W;do(D.x=(W-Ve)*(Fe-st)&&(W-Ve)*(de-st)>=(J-Ve)*(D-st)&&(J-Ve)*(Fe-st)>=(Se-Ve)*(de-st)}function ge(W,D){return W.next.i!==D.i&&W.prev.i!==D.i&&!(function(J,de){let Se=J;do{if(Se.i!==J.i&&Se.next.i!==J.i&&Se.i!==de.i&&Se.next.i!==de.i&&Ke(Se,Se.next,J,de))return!0;Se=Se.next}while(Se!==J);return!1})(W,D)&&(gr(W,D)&&gr(D,W)&&(function(J,de){let Se=J,Fe=!1,Ve=(J.x+de.x)/2,st=(J.y+de.y)/2;do Se.y>st!=Se.next.y>st&&Se.next.y!==Se.y&&Ve<(Se.next.x-Se.x)*(st-Se.y)/(Se.next.y-Se.y)+Se.x&&(Fe=!Fe),Se=Se.next;while(Se!==J);return Fe})(W,D)&&(Ne(W.prev,W,D.prev)||Ne(W,D.prev,D))||Me(W,D)&&Ne(W.prev,W,W.next)>0&&Ne(D.prev,D,D.next)>0)}function Ne(W,D,J){return(D.y-W.y)*(J.x-D.x)-(D.x-W.x)*(J.y-D.y)}function Me(W,D){return W.x===D.x&&W.y===D.y}function Ke(W,D,J,de){let Se=Bt(Ne(W,D,J)),Fe=Bt(Ne(W,D,de)),Ve=Bt(Ne(J,de,W)),st=Bt(Ne(J,de,D));return Se!==Fe&&Ve!==st||!(Se!==0||!ht(W,J,D))||!(Fe!==0||!ht(W,de,D))||!(Ve!==0||!ht(J,W,de))||!(st!==0||!ht(J,D,de))}function ht(W,D,J){return D.x<=Math.max(W.x,J.x)&&D.x>=Math.min(W.x,J.x)&&D.y<=Math.max(W.y,J.y)&&D.y>=Math.min(W.y,J.y)}function Bt(W){return W>0?1:W<0?-1:0}function gr(W,D){return Ne(W.prev,W,W.next)<0?Ne(W,D,W.next)>=0&&Ne(W,W.prev,D)>=0:Ne(W,D,W.prev)<0||Ne(W,W.next,D)<0}function Dr(W,D){let J=wt(W.i,W.x,W.y),de=wt(D.i,D.x,D.y),Se=W.next,Fe=D.prev;return W.next=D,D.prev=W,J.next=Se,Se.prev=J,de.next=J,J.prev=de,Fe.next=de,de.prev=Fe,de}function ur(W,D,J,de){let Se=wt(W,D,J);return de?(Se.next=de.next,Se.prev=de,de.next.prev=Se,de.next=Se):(Se.prev=Se,Se.next=Se),Se}function vt(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function wt(W,D,J){return{i:W,x:D,y:J,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function It(W,D,J){let de=J.patternDependencies,Se=!1;for(let Fe of D){let Ve=Fe.paint.get(`${W}-pattern`);Ve.isConstant()||(Se=!0);let st=Ve.constantOr(null);st&&(Se=!0,de[st.to]=!0,de[st.from]=!0)}return Se}function $t(W,D,J,de,Se){let Fe=Se.patternDependencies;for(let Ve of D){let st=Ve.paint.get(`${W}-pattern`).value;if(st.kind!=="constant"){let bt=st.evaluate({zoom:de-1},J,{},Se.availableImages),Dt=st.evaluate({zoom:de},J,{},Se.availableImages),Qt=st.evaluate({zoom:de+1},J,{},Se.availableImages);bt=bt&&bt.name?bt.name:bt,Dt=Dt&&Dt.name?Dt.name:Dt,Qt=Qt&&Qt.name?Qt.name:Qt,Fe[bt]=!0,Fe[Dt]=!0,Fe[Qt]=!0,J.patterns[Ve.id]={min:bt,mid:Dt,max:Qt}}}return J}class lr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(J=>J.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ol,this.indexArray=new Ie,this.indexArray2=new Je,this.programConfigurations=new Ds(D.layers,D.zoom),this.segments=new xt,this.segments2=new xt,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(D,J,de){this.hasPattern=It("fill",this.layers,J);let Se=this.layers[0].layout.get("fill-sort-key"),Fe=!Se.isConstant(),Ve=[];for(let{feature:st,id:bt,index:Dt,sourceLayerIndex:Qt}of D){let xr=this.layers[0]._featureFilter.needGeometry,Lr=yl(st,xr);if(!this.layers[0]._featureFilter.filter(new ds(this.zoom),Lr,de))continue;let jr=Fe?Se.evaluate(Lr,{},de,J.availableImages):void 0,$r={id:bt,properties:st.properties,type:st.type,sourceLayerIndex:Qt,index:Dt,geometry:xr?Lr.geometry:el(st),patterns:{},sortKey:jr};Ve.push($r)}Fe&&Ve.sort((st,bt)=>st.sortKey-bt.sortKey);for(let st of Ve){let{geometry:bt,index:Dt,sourceLayerIndex:Qt}=st;if(this.hasPattern){let xr=$t("fill",this.layers,st,this.zoom,J);this.patternFeatures.push(xr)}else this.addFeature(st,bt,Dt,de,{});J.featureIndex.insert(D[Dt].feature,bt,Dt,Qt,this.index)}}update(D,J,de){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,J,this.stateDependentLayers,de)}addFeatures(D,J,de){for(let Se of this.patternFeatures)this.addFeature(Se,Se.geometry,Se.index,J,de)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,_l),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,J,de,Se,Fe){for(let Ve of Vu(J,500)){let st=0;for(let jr of Ve)st+=jr.length;let bt=this.segments.prepareSegment(st,this.layoutVertexArray,this.indexArray),Dt=bt.vertexLength,Qt=[],xr=[];for(let jr of Ve){if(jr.length===0)continue;jr!==Ve[0]&&xr.push(Qt.length/2);let $r=this.segments2.prepareSegment(jr.length,this.layoutVertexArray,this.indexArray2),ia=$r.vertexLength;this.layoutVertexArray.emplaceBack(jr[0].x,jr[0].y),this.indexArray2.emplaceBack(ia+jr.length-1,ia),Qt.push(jr[0].x),Qt.push(jr[0].y);for(let Ra=1;Ra>3}if(Se--,de===1||de===2)Fe+=W.readSVarint(),Ve+=W.readSVarint(),de===1&&(D&&st.push(D),D=[]),D.push(new ca(Fe,Ve));else{if(de!==7)throw new Error("unknown command "+de);D&&D.push(D[0].clone())}}return D&&st.push(D),st},Fa.prototype.bbox=function(){var W=this._pbf;W.pos=this._geometry;for(var D=W.readVarint()+W.pos,J=1,de=0,Se=0,Fe=0,Ve=1/0,st=-1/0,bt=1/0,Dt=-1/0;W.pos>3}if(de--,J===1||J===2)(Se+=W.readSVarint())st&&(st=Se),(Fe+=W.readSVarint())Dt&&(Dt=Fe);else if(J!==7)throw new Error("unknown command "+J)}return[Ve,bt,st,Dt]},Fa.prototype.toGeoJSON=function(W,D,J){var de,Se,Fe=this.extent*Math.pow(2,J),Ve=this.extent*W,st=this.extent*D,bt=this.loadGeometry(),Dt=Fa.types[this.type];function Qt(jr){for(var $r=0;$r>3;Se=Ve===1?de.readString():Ve===2?de.readFloat():Ve===3?de.readDouble():Ve===4?de.readVarint64():Ve===5?de.readVarint():Ve===6?de.readSVarint():Ve===7?de.readBoolean():null}return Se})(J))}cn.prototype.feature=function(W){if(W<0||W>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[W];var D=this._pbf.readVarint()+this._pbf.pos;return new En(this._pbf,D,this.extent,this._keys,this._values)};var Pn=Qa;function ei(W,D,J){if(W===3){var de=new Pn(J,J.readVarint()+J.pos);de.length&&(D[de.name]=de)}}Hr.VectorTile=function(W,D){this.layers=W.readFields(ei,{},D)},Hr.VectorTileFeature=on,Hr.VectorTileLayer=Qa;let no=Hr.VectorTileFeature.types,Ao=Math.pow(2,13);function fs(W,D,J,de,Se,Fe,Ve,st){W.emplaceBack(D,J,2*Math.floor(de*Ao)+Ve,Se*Ao*2,Fe*Ao*2,Math.round(st))}class xo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(J=>J.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Ml,this.centroidVertexArray=new Io,this.indexArray=new Ie,this.programConfigurations=new Ds(D.layers,D.zoom),this.segments=new xt,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(D,J,de){this.features=[],this.hasPattern=It("fill-extrusion",this.layers,J);for(let{feature:Se,id:Fe,index:Ve,sourceLayerIndex:st}of D){let bt=this.layers[0]._featureFilter.needGeometry,Dt=yl(Se,bt);if(!this.layers[0]._featureFilter.filter(new ds(this.zoom),Dt,de))continue;let Qt={id:Fe,sourceLayerIndex:st,index:Ve,geometry:bt?Dt.geometry:el(Se),properties:Se.properties,type:Se.type,patterns:{}};this.hasPattern?this.features.push($t("fill-extrusion",this.layers,Qt,this.zoom,J)):this.addFeature(Qt,Qt.geometry,Ve,de,{}),J.featureIndex.insert(Se,Qt.geometry,Ve,st,this.index,!0)}}addFeatures(D,J,de){for(let Se of this.features){let{geometry:Fe}=Se;this.addFeature(Se,Fe,Se.index,J,de)}}update(D,J,de){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,J,this.stateDependentLayers,de)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Cr),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Nt.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,J,de,Se,Fe){for(let Ve of Vu(J,500)){let st={x:0,y:0,vertexCount:0},bt=0;for(let $r of Ve)bt+=$r.length;let Dt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let $r of Ve){if($r.length===0||ks($r))continue;let ia=0;for(let Ra=0;Ra<$r.length;Ra++){let Va=$r[Ra];if(Ra>=1){let On=$r[Ra-1];if(!os(Va,On)){Dt.vertexLength+4>xt.MAX_VERTEX_ARRAY_LENGTH&&(Dt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let ln=Va.sub(On)._perp()._unit(),Rn=On.dist(Va);ia+Rn>32768&&(ia=0),fs(this.layoutVertexArray,Va.x,Va.y,ln.x,ln.y,0,0,ia),fs(this.layoutVertexArray,Va.x,Va.y,ln.x,ln.y,0,1,ia),st.x+=2*Va.x,st.y+=2*Va.y,st.vertexCount+=2,ia+=Rn,fs(this.layoutVertexArray,On.x,On.y,ln.x,ln.y,0,0,ia),fs(this.layoutVertexArray,On.x,On.y,ln.x,ln.y,0,1,ia),st.x+=2*On.x,st.y+=2*On.y,st.vertexCount+=2;let Hn=Dt.vertexLength;this.indexArray.emplaceBack(Hn,Hn+2,Hn+1),this.indexArray.emplaceBack(Hn+1,Hn+2,Hn+3),Dt.vertexLength+=4,Dt.primitiveLength+=2}}}}if(Dt.vertexLength+bt>xt.MAX_VERTEX_ARRAY_LENGTH&&(Dt=this.segments.prepareSegment(bt,this.layoutVertexArray,this.indexArray)),no[D.type]!=="Polygon")continue;let Qt=[],xr=[],Lr=Dt.vertexLength;for(let $r of Ve)if($r.length!==0){$r!==Ve[0]&&xr.push(Qt.length/2);for(let ia=0;ia<$r.length;ia++){let Ra=$r[ia];fs(this.layoutVertexArray,Ra.x,Ra.y,0,0,1,1,0),st.x+=Ra.x,st.y+=Ra.y,st.vertexCount+=1,Qt.push(Ra.x),Qt.push(Ra.y)}}let jr=Wo(Qt,xr);for(let $r=0;$reo)||W.y===D.y&&(W.y<0||W.y>eo)}function ks(W){return W.every(D=>D.x<0)||W.every(D=>D.x>eo)||W.every(D=>D.y<0)||W.every(D=>D.y>eo)}let Vl;sn("FillExtrusionBucket",xo,{omit:["layers","features"]});var ch={get paint(){return Vl=Vl||new De({"fill-extrusion-opacity":new $i(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new _o(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new $i(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new $i(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qu(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new _o(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new _o(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new $i(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class fh extends ne{constructor(D){super(D,ch)}createBucket(D){return new xo(D)}queryRadius(){return si(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,J,de,Se,Fe,Ve,st,bt){let Dt=Mn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ve.angle,st),Qt=this.paint.get("fill-extrusion-height").evaluate(J,de),xr=this.paint.get("fill-extrusion-base").evaluate(J,de),Lr=(function($r,ia,Ra,Va){let On=[];for(let ln of $r){let Rn=[ln.x,ln.y,0,1];ri(Rn,Rn,ia),On.push(new i(Rn[0]/Rn[3],Rn[1]/Rn[3]))}return On})(Dt,bt),jr=(function($r,ia,Ra,Va){let On=[],ln=[],Rn=Va[8]*ia,Hn=Va[9]*ia,Ci=Va[10]*ia,ho=Va[11]*ia,Jo=Va[8]*Ra,to=Va[9]*Ra,Ti=Va[10]*Ra,Oo=Va[11]*Ra;for(let So of $r){let wo=[],ci=[];for(let qo of So){let To=qo.x,cs=qo.y,yu=Va[0]*To+Va[4]*cs+Va[12],uu=Va[1]*To+Va[5]*cs+Va[13],rf=Va[2]*To+Va[6]*cs+Va[14],bh=Va[3]*To+Va[7]*cs+Va[15],Sf=rf+Ci,af=bh+ho,Gf=yu+Jo,Hf=uu+to,Wf=rf+Ti,Ac=bh+Oo,nf=new i((yu+Rn)/af,(uu+Hn)/af);nf.z=Sf/af,wo.push(nf);let Df=new i(Gf/Ac,Hf/Ac);Df.z=Wf/Ac,ci.push(Df)}On.push(wo),ln.push(ci)}return[On,ln]})(Se,xr,Qt,bt);return(function($r,ia,Ra){let Va=1/0;Gt(Ra,ia)&&(Va=yh(Ra,ia[0]));for(let On=0;OnJ.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(J=>{this.gradients[J.id]={}}),this.layoutVertexArray=new ru,this.layoutVertexArray2=new jl,this.indexArray=new Ie,this.programConfigurations=new Ds(D.layers,D.zoom),this.segments=new xt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(D,J,de){this.hasPattern=It("line",this.layers,J);let Se=this.layers[0].layout.get("line-sort-key"),Fe=!Se.isConstant(),Ve=[];for(let{feature:st,id:bt,index:Dt,sourceLayerIndex:Qt}of D){let xr=this.layers[0]._featureFilter.needGeometry,Lr=yl(st,xr);if(!this.layers[0]._featureFilter.filter(new ds(this.zoom),Lr,de))continue;let jr=Fe?Se.evaluate(Lr,{},de):void 0,$r={id:bt,properties:st.properties,type:st.type,sourceLayerIndex:Qt,index:Dt,geometry:xr?Lr.geometry:el(st),patterns:{},sortKey:jr};Ve.push($r)}Fe&&Ve.sort((st,bt)=>st.sortKey-bt.sortKey);for(let st of Ve){let{geometry:bt,index:Dt,sourceLayerIndex:Qt}=st;if(this.hasPattern){let xr=$t("line",this.layers,st,this.zoom,J);this.patternFeatures.push(xr)}else this.addFeature(st,bt,Dt,de,{});J.featureIndex.insert(D[Dt].feature,bt,Dt,Qt,this.index)}}update(D,J,de){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,J,this.stateDependentLayers,de)}addFeatures(D,J,de){for(let Se of this.patternFeatures)this.addFeature(Se,Se.geometry,Se.index,J,de)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,kh)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Eh),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,J,de,Se,Fe){let Ve=this.layers[0].layout,st=Ve.get("line-join").evaluate(D,{}),bt=Ve.get("line-cap"),Dt=Ve.get("line-miter-limit"),Qt=Ve.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(let xr of J)this.addLine(xr,D,st,bt,Dt,Qt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,de,Fe,Se)}addLine(D,J,de,Se,Fe,Ve){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Va=0;Va=2&&D[bt-1].equals(D[bt-2]);)bt--;let Dt=0;for(;Dt0;if(ho&&Va>Dt){let Oo=Lr.dist(jr);if(Oo>2*Qt){let So=Lr.sub(Lr.sub(jr)._mult(Qt/Oo)._round());this.updateDistance(jr,So),this.addCurrentVertex(So,ia,0,0,xr),jr=So}}let to=jr&&$r,Ti=to?de:st?"butt":Se;if(to&&Ti==="round"&&(HnFe&&(Ti="bevel"),Ti==="bevel"&&(Hn>2&&(Ti="flipbevel"),Hn100)On=Ra.mult(-1);else{let Oo=Hn*ia.add(Ra).mag()/ia.sub(Ra).mag();On._perp()._mult(Oo*(Jo?-1:1))}this.addCurrentVertex(Lr,On,0,0,xr),this.addCurrentVertex(Lr,On.mult(-1),0,0,xr)}else if(Ti==="bevel"||Ti==="fakeround"){let Oo=-Math.sqrt(Hn*Hn-1),So=Jo?Oo:0,wo=Jo?0:Oo;if(jr&&this.addCurrentVertex(Lr,ia,So,wo,xr),Ti==="fakeround"){let ci=Math.round(180*Ci/Math.PI/20);for(let qo=1;qo2*Qt){let So=Lr.add($r.sub(Lr)._mult(Qt/Oo)._round());this.updateDistance(Lr,So),this.addCurrentVertex(So,Ra,0,0,xr),Lr=So}}}}addCurrentVertex(D,J,de,Se,Fe,Ve=!1){let st=J.y*Se-J.x,bt=-J.y-J.x*Se;this.addHalfVertex(D,J.x+J.y*de,J.y-J.x*de,Ve,!1,de,Fe),this.addHalfVertex(D,st,bt,Ve,!0,-Se,Fe),this.distance>hh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,J,de,Se,Fe,Ve))}addHalfVertex({x:D,y:J},de,Se,Fe,Ve,st,bt){let Dt=.5*(this.lineClips?this.scaledDistance*(hh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Fe?1:0),(J<<1)+(Ve?1:0),Math.round(63*de)+128,Math.round(63*Se)+128,1+(st===0?0:st<0?-1:1)|(63&Dt)<<2,Dt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Qt=bt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Qt),bt.primitiveLength++),Ve?this.e2=Qt:this.e1=Qt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,J){this.distance+=D.dist(J),this.updateScaledDistance()}}let vh,Nv;sn("LineBucket",_h,{omit:["layers","patternFeatures"]});var rv={get paint(){return Nv=Nv||new De({"line-opacity":new _o(re.paint_line["line-opacity"]),"line-color":new _o(re.paint_line["line-color"]),"line-translate":new $i(re.paint_line["line-translate"]),"line-translate-anchor":new $i(re.paint_line["line-translate-anchor"]),"line-width":new _o(re.paint_line["line-width"]),"line-gap-width":new _o(re.paint_line["line-gap-width"]),"line-offset":new _o(re.paint_line["line-offset"]),"line-blur":new _o(re.paint_line["line-blur"]),"line-dasharray":new ku(re.paint_line["line-dasharray"]),"line-pattern":new Qu(re.paint_line["line-pattern"]),"line-gradient":new gu(re.paint_line["line-gradient"])})},get layout(){return vh=vh||new De({"line-cap":new $i(re.layout_line["line-cap"]),"line-join":new _o(re.layout_line["line-join"]),"line-miter-limit":new $i(re.layout_line["line-miter-limit"]),"line-round-limit":new $i(re.layout_line["line-round-limit"]),"line-sort-key":new _o(re.layout_line["line-sort-key"])})}};class Wc extends _o{possiblyEvaluate(D,J){return J=new ds(Math.floor(J.zoom),{now:J.now,fadeDuration:J.fadeDuration,zoomHistory:J.zoomHistory,transition:J.transition}),super.possiblyEvaluate(D,J)}evaluate(D,J,de,Se){return J=M({},J,{zoom:Math.floor(J.zoom)}),super.evaluate(D,J,de,Se)}}let av;class Uv extends ne{constructor(D){super(D,rv),this.gradientVersion=0,av||(av=new Wc(rv.paint.properties["line-width"].specification),av.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){let J=this.gradientExpression();this.stepInterpolant=!!(function(de){return de._styleExpression!==void 0})(J)&&J._styleExpression.expression instanceof ha,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,J){super.recalculate(D,J),this.paint._values["line-floorwidth"]=av.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new _h(D)}queryRadius(D){let J=D,de=vf(Ja("line-width",this,J),Ja("line-gap-width",this,J)),Se=Ja("line-offset",this,J);return de/2+Math.abs(Se)+si(this.paint.get("line-translate"))}queryIntersectsFeature(D,J,de,Se,Fe,Ve,st){let bt=Mn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ve.angle,st),Dt=st/2*vf(this.paint.get("line-width").evaluate(J,de),this.paint.get("line-gap-width").evaluate(J,de)),Qt=this.paint.get("line-offset").evaluate(J,de);return Qt&&(Se=(function(xr,Lr){let jr=[];for(let $r=0;$r=3){for(let Ra=0;Ra0?D+2*W:W}let yv=ut([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ud=ut([{name:"a_projected_pos",components:3,type:"Float32"}],4);ut([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let cd=ut([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ut([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let jv=ut([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),_v=ut([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function xv(W,D,J){return W.sections.forEach(de=>{de.text=(function(Se,Fe,Ve){let st=Fe.layout.get("text-transform").evaluate(Ve,{});return st==="uppercase"?Se=Se.toLocaleUpperCase():st==="lowercase"&&(Se=Se.toLocaleLowerCase()),Cs.applyArabicShaping&&(Se=Cs.applyArabicShaping(Se)),Se})(de.text,D,J)}),W}ut([{name:"triangle",components:3,type:"Uint16"}]),ut([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ut([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ut([{type:"Float32",name:"offsetX"}]),ut([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ut([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Lu={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Ol=24,If=Kl,Vv=function(W,D,J,de,Se){var Fe,Ve,st=8*Se-de-1,bt=(1<>1,Qt=-7,xr=J?Se-1:0,Lr=J?-1:1,jr=W[D+xr];for(xr+=Lr,Fe=jr&(1<<-Qt)-1,jr>>=-Qt,Qt+=st;Qt>0;Fe=256*Fe+W[D+xr],xr+=Lr,Qt-=8);for(Ve=Fe&(1<<-Qt)-1,Fe>>=-Qt,Qt+=de;Qt>0;Ve=256*Ve+W[D+xr],xr+=Lr,Qt-=8);if(Fe===0)Fe=1-Dt;else{if(Fe===bt)return Ve?NaN:1/0*(jr?-1:1);Ve+=Math.pow(2,de),Fe-=Dt}return(jr?-1:1)*Ve*Math.pow(2,Fe-de)},fd=function(W,D,J,de,Se,Fe){var Ve,st,bt,Dt=8*Fe-Se-1,Qt=(1<>1,Lr=Se===23?Math.pow(2,-24)-Math.pow(2,-77):0,jr=de?0:Fe-1,$r=de?1:-1,ia=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(st=isNaN(D)?1:0,Ve=Qt):(Ve=Math.floor(Math.log(D)/Math.LN2),D*(bt=Math.pow(2,-Ve))<1&&(Ve--,bt*=2),(D+=Ve+xr>=1?Lr/bt:Lr*Math.pow(2,1-xr))*bt>=2&&(Ve++,bt/=2),Ve+xr>=Qt?(st=0,Ve=Qt):Ve+xr>=1?(st=(D*bt-1)*Math.pow(2,Se),Ve+=xr):(st=D*Math.pow(2,xr-1)*Math.pow(2,Se),Ve=0));Se>=8;W[J+jr]=255&st,jr+=$r,st/=256,Se-=8);for(Ve=Ve<0;W[J+jr]=255&Ve,jr+=$r,Ve/=256,Dt-=8);W[J+jr-$r]|=128*ia};function Kl(W){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(W)?W:new Uint8Array(W||0),this.pos=0,this.type=0,this.length=this.buf.length}Kl.Varint=0,Kl.Fixed64=1,Kl.Bytes=2,Kl.Fixed32=5;var ep=4294967296,bv=1/ep,Jp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function dh(W){return W.type===Kl.Bytes?W.readVarint()+W.pos:W.pos+1}function wv(W,D,J){return J?4294967296*D+(W>>>0):4294967296*(D>>>0)+(W>>>0)}function $p(W,D,J){var de=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));J.realloc(de);for(var Se=J.pos-1;Se>=W;Se--)J.buf[Se+de]=J.buf[Se]}function tp(W,D){for(var J=0;J>>8,W[J+2]=D>>>16,W[J+3]=D>>>24}function Xg(W,D){return(W[D]|W[D+1]<<8|W[D+2]<<16)+(W[D+3]<<24)}Kl.prototype={destroy:function(){this.buf=null},readFields:function(W,D,J){for(J=J||this.length;this.pos>3,Fe=this.pos;this.type=7&de,W(Se,D,this),this.pos===Fe&&this.skip(de)}return D},readMessage:function(W,D){return this.readFields(W,D,this.readVarint()+this.pos)},readFixed32:function(){var W=qv(this.buf,this.pos);return this.pos+=4,W},readSFixed32:function(){var W=Xg(this.buf,this.pos);return this.pos+=4,W},readFixed64:function(){var W=qv(this.buf,this.pos)+qv(this.buf,this.pos+4)*ep;return this.pos+=8,W},readSFixed64:function(){var W=qv(this.buf,this.pos)+Xg(this.buf,this.pos+4)*ep;return this.pos+=8,W},readFloat:function(){var W=Vv(this.buf,this.pos,!0,23,4);return this.pos+=4,W},readDouble:function(){var W=Vv(this.buf,this.pos,!0,52,8);return this.pos+=8,W},readVarint:function(W){var D,J,de=this.buf;return D=127&(J=de[this.pos++]),J<128?D:(D|=(127&(J=de[this.pos++]))<<7,J<128?D:(D|=(127&(J=de[this.pos++]))<<14,J<128?D:(D|=(127&(J=de[this.pos++]))<<21,J<128?D:(function(Se,Fe,Ve){var st,bt,Dt=Ve.buf;if(st=(112&(bt=Dt[Ve.pos++]))>>4,bt<128||(st|=(127&(bt=Dt[Ve.pos++]))<<3,bt<128)||(st|=(127&(bt=Dt[Ve.pos++]))<<10,bt<128)||(st|=(127&(bt=Dt[Ve.pos++]))<<17,bt<128)||(st|=(127&(bt=Dt[Ve.pos++]))<<24,bt<128)||(st|=(1&(bt=Dt[Ve.pos++]))<<31,bt<128))return wv(Se,st,Fe);throw new Error("Expected varint not more than 10 bytes")})(D|=(15&(J=de[this.pos]))<<28,W,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var W=this.readVarint();return W%2==1?(W+1)/-2:W/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var W=this.readVarint()+this.pos,D=this.pos;return this.pos=W,W-D>=12&&Jp?(function(J,de,Se){return Jp.decode(J.subarray(de,Se))})(this.buf,D,W):(function(J,de,Se){for(var Fe="",Ve=de;Ve239?4:Qt>223?3:Qt>191?2:1;if(Ve+Lr>Se)break;Lr===1?Qt<128&&(xr=Qt):Lr===2?(192&(st=J[Ve+1]))==128&&(xr=(31&Qt)<<6|63&st)<=127&&(xr=null):Lr===3?(bt=J[Ve+2],(192&(st=J[Ve+1]))==128&&(192&bt)==128&&((xr=(15&Qt)<<12|(63&st)<<6|63&bt)<=2047||xr>=55296&&xr<=57343)&&(xr=null)):Lr===4&&(bt=J[Ve+2],Dt=J[Ve+3],(192&(st=J[Ve+1]))==128&&(192&bt)==128&&(192&Dt)==128&&((xr=(15&Qt)<<18|(63&st)<<12|(63&bt)<<6|63&Dt)<=65535||xr>=1114112)&&(xr=null)),xr===null?(xr=65533,Lr=1):xr>65535&&(xr-=65536,Fe+=String.fromCharCode(xr>>>10&1023|55296),xr=56320|1023&xr),Fe+=String.fromCharCode(xr),Ve+=Lr}return Fe})(this.buf,D,W)},readBytes:function(){var W=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,W);return this.pos=W,D},readPackedVarint:function(W,D){if(this.type!==Kl.Bytes)return W.push(this.readVarint(D));var J=dh(this);for(W=W||[];this.pos127;);else if(D===Kl.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Kl.Fixed32)this.pos+=4;else{if(D!==Kl.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(W,D){this.writeVarint(W<<3|D)},realloc:function(W){for(var D=this.length||16;D268435455||W<0?(function(D,J){var de,Se;if(D>=0?(de=D%4294967296|0,Se=D/4294967296|0):(Se=~(-D/4294967296),4294967295^(de=~(-D%4294967296))?de=de+1|0:(de=0,Se=Se+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");J.realloc(10),(function(Fe,Ve,st){st.buf[st.pos++]=127&Fe|128,Fe>>>=7,st.buf[st.pos++]=127&Fe|128,Fe>>>=7,st.buf[st.pos++]=127&Fe|128,Fe>>>=7,st.buf[st.pos++]=127&Fe|128,st.buf[st.pos]=127&(Fe>>>=7)})(de,0,J),(function(Fe,Ve){var st=(7&Fe)<<4;Ve.buf[Ve.pos++]|=st|((Fe>>>=3)?128:0),Fe&&(Ve.buf[Ve.pos++]=127&Fe|((Fe>>>=7)?128:0),Fe&&(Ve.buf[Ve.pos++]=127&Fe|((Fe>>>=7)?128:0),Fe&&(Ve.buf[Ve.pos++]=127&Fe|((Fe>>>=7)?128:0),Fe&&(Ve.buf[Ve.pos++]=127&Fe|((Fe>>>=7)?128:0),Fe&&(Ve.buf[Ve.pos++]=127&Fe)))))})(Se,J)})(W,this):(this.realloc(4),this.buf[this.pos++]=127&W|(W>127?128:0),W<=127||(this.buf[this.pos++]=127&(W>>>=7)|(W>127?128:0),W<=127||(this.buf[this.pos++]=127&(W>>>=7)|(W>127?128:0),W<=127||(this.buf[this.pos++]=W>>>7&127))))},writeSVarint:function(W){this.writeVarint(W<0?2*-W-1:2*W)},writeBoolean:function(W){this.writeVarint(!!W)},writeString:function(W){W=String(W),this.realloc(4*W.length),this.pos++;var D=this.pos;this.pos=(function(de,Se,Fe){for(var Ve,st,bt=0;bt55295&&Ve<57344){if(!st){Ve>56319||bt+1===Se.length?(de[Fe++]=239,de[Fe++]=191,de[Fe++]=189):st=Ve;continue}if(Ve<56320){de[Fe++]=239,de[Fe++]=191,de[Fe++]=189,st=Ve;continue}Ve=st-55296<<10|Ve-56320|65536,st=null}else st&&(de[Fe++]=239,de[Fe++]=191,de[Fe++]=189,st=null);Ve<128?de[Fe++]=Ve:(Ve<2048?de[Fe++]=Ve>>6|192:(Ve<65536?de[Fe++]=Ve>>12|224:(de[Fe++]=Ve>>18|240,de[Fe++]=Ve>>12&63|128),de[Fe++]=Ve>>6&63|128),de[Fe++]=63&Ve|128)}return Fe})(this.buf,W,this.pos);var J=this.pos-D;J>=128&&$p(D,J,this),this.pos=D-1,this.writeVarint(J),this.pos+=J},writeFloat:function(W){this.realloc(4),fd(this.buf,W,this.pos,!0,23,4),this.pos+=4},writeDouble:function(W){this.realloc(8),fd(this.buf,W,this.pos,!0,52,8),this.pos+=8},writeBytes:function(W){var D=W.length;this.writeVarint(D),this.realloc(D);for(var J=0;J=128&&$p(J,de,this),this.pos=J-1,this.writeVarint(de),this.pos+=de},writeMessage:function(W,D,J){this.writeTag(W,Kl.Bytes),this.writeRawMessage(D,J)},writePackedVarint:function(W,D){D.length&&this.writeMessage(W,tp,D)},writePackedSVarint:function(W,D){D.length&&this.writeMessage(W,px,D)},writePackedBoolean:function(W,D){D.length&&this.writeMessage(W,yx,D)},writePackedFloat:function(W,D){D.length&&this.writeMessage(W,mx,D)},writePackedDouble:function(W,D){D.length&&this.writeMessage(W,gx,D)},writePackedFixed32:function(W,D){D.length&&this.writeMessage(W,g5,D)},writePackedSFixed32:function(W,D){D.length&&this.writeMessage(W,_x,D)},writePackedFixed64:function(W,D){D.length&&this.writeMessage(W,xx,D)},writePackedSFixed64:function(W,D){D.length&&this.writeMessage(W,bx,D)},writeBytesField:function(W,D){this.writeTag(W,Kl.Bytes),this.writeBytes(D)},writeFixed32Field:function(W,D){this.writeTag(W,Kl.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(W,D){this.writeTag(W,Kl.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(W,D){this.writeTag(W,Kl.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(W,D){this.writeTag(W,Kl.Fixed64),this.writeSFixed64(D)},writeVarintField:function(W,D){this.writeTag(W,Kl.Varint),this.writeVarint(D)},writeSVarintField:function(W,D){this.writeTag(W,Kl.Varint),this.writeSVarint(D)},writeStringField:function(W,D){this.writeTag(W,Kl.Bytes),this.writeString(D)},writeFloatField:function(W,D){this.writeTag(W,Kl.Fixed32),this.writeFloat(D)},writeDoubleField:function(W,D){this.writeTag(W,Kl.Fixed64),this.writeDouble(D)},writeBooleanField:function(W,D){this.writeVarintField(W,!!D)}};var cm=r(If);let fm=3;function y5(W,D,J){W===1&&J.readMessage(wx,D)}function wx(W,D,J){if(W===3){let{id:de,bitmap:Se,width:Fe,height:Ve,left:st,top:bt,advance:Dt}=J.readMessage(Zg,{});D.push({id:de,bitmap:new bi({width:Fe+2*fm,height:Ve+2*fm},Se),metrics:{width:Fe,height:Ve,left:st,top:bt,advance:Dt}})}}function Zg(W,D,J){W===1?D.id=J.readVarint():W===2?D.bitmap=J.readBytes():W===3?D.width=J.readVarint():W===4?D.height=J.readVarint():W===5?D.left=J.readSVarint():W===6?D.top=J.readSVarint():W===7&&(D.advance=J.readVarint())}let Yg=fm;function hm(W){let D=0,J=0;for(let Ve of W)D+=Ve.w*Ve.h,J=Math.max(J,Ve.w);W.sort((Ve,st)=>st.h-Ve.h);let de=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),J),h:1/0}],Se=0,Fe=0;for(let Ve of W)for(let st=de.length-1;st>=0;st--){let bt=de[st];if(!(Ve.w>bt.w||Ve.h>bt.h)){if(Ve.x=bt.x,Ve.y=bt.y,Fe=Math.max(Fe,Ve.y+Ve.h),Se=Math.max(Se,Ve.x+Ve.w),Ve.w===bt.w&&Ve.h===bt.h){let Dt=de.pop();st=0&&de>=D&&t0[this.text.charCodeAt(de)];de--)J--;this.text=this.text.substring(D,J),this.sectionIndex=this.sectionIndex.slice(D,J)}substring(D,J){let de=new hd;return de.text=this.text.substring(D,J),de.sectionIndex=this.sectionIndex.slice(D,J),de.sections=this.sections,de}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,J)=>Math.max(D,this.sections[J].scale),0)}addTextSection(D,J){this.text+=D.text,this.sections.push(ap.forText(D.scale,D.fontStack||J));let de=this.sections.length-1;for(let Se=0;Se=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function np(W,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r){let ia=hd.fromFeature(W,Se),Ra;xr===e.ah.vertical&&ia.verticalizePunctuation();let{processBidirectionalText:Va,processStyledBidirectionalText:On}=Cs;if(Va&&ia.sections.length===1){Ra=[];let Hn=Va(ia.toString(),vd(ia,Dt,Fe,D,de,jr));for(let Ci of Hn){let ho=new hd;ho.text=Ci,ho.sections=ia.sections;for(let Jo=0;Jo0&&Th>Cc&&(Cc=Th)}else{let ec=ho[Bl.fontStack],Bc=ec&&ec[_u];if(Bc&&Bc.rect)_d=Bc.rect,vc=Bc.metrics;else{let Th=Ci[Bl.fontStack],sv=Th&&Th[_u];if(!sv)continue;vc=sv.metrics}gh=(nf-Bl.scale)*Ol}wh?(Hn.verticalizable=!0,df.push({glyph:_u,imageName:Vh,x:cs,y:yu+gh,vertical:wh,scale:Bl.scale,fontStack:Bl.fontStack,sectionIndex:Pu,metrics:vc,rect:_d}),cs+=zh*Bl.scale+ci):(df.push({glyph:_u,imageName:Vh,x:cs,y:yu+gh,vertical:wh,scale:Bl.scale,fontStack:Bl.fontStack,sectionIndex:Pu,metrics:vc,rect:_d}),cs+=vc.advance*Bl.scale+ci)}df.length!==0&&(uu=Math.max(cs-ci,uu),Tv(df,0,df.length-1,bh,Cc)),cs=0;let mh=Ti*nf+Cc;Mf.lineOffset=Math.max(Cc,Df),yu+=mh,rf=Math.max(mh,rf),++Sf}var af;let Gf=yu-tf,{horizontalAlign:Hf,verticalAlign:Wf}=a0(Oo);(function(Ac,nf,Df,Mf,df,Cc,mh,$f,Bl){let Pu=(nf-Df)*df,_u=0;_u=Cc!==mh?-$f*Mf-tf:(-Mf*Bl+.5)*mh;for(let gh of Ac)for(let vc of gh.positionedGlyphs)vc.x+=Pu,vc.y+=_u})(Hn.positionedLines,bh,Hf,Wf,uu,rf,Ti,Gf,to.length),Hn.top+=-Wf*Gf,Hn.bottom=Hn.top+Gf,Hn.left+=-Hf*uu,Hn.right=Hn.left+uu})(Rn,D,J,de,Ra,Ve,st,bt,xr,Dt,Lr,$r),!(function(Hn){for(let Ci of Hn)if(Ci.positionedGlyphs.length!==0)return!1;return!0})(ln)&&Rn}let t0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Tx={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ax={40:!0};function Kg(W,D,J,de,Se,Fe){if(D.imageName){let Ve=de[D.imageName];return Ve?Ve.displaySize[0]*D.scale*Ol/Fe+Se:0}{let Ve=J[D.fontStack],st=Ve&&Ve[W];return st?st.metrics.advance*D.scale+Se:0}}function Jg(W,D,J,de){let Se=Math.pow(W-D,2);return de?W=0,Dt=0;for(let xr=0;xrDt){let Qt=Math.ceil(Fe/Dt);Se*=Qt/Ve,Ve=Qt}return{x1:de,y1:Se,x2:de+Fe,y2:Se+Ve}}function ey(W,D,J,de,Se,Fe){let Ve=W.image,st;if(Ve.content){let Ra=Ve.content,Va=Ve.pixelRatio||1;st=[Ra[0]/Va,Ra[1]/Va,Ve.displaySize[0]-Ra[2]/Va,Ve.displaySize[1]-Ra[3]/Va]}let bt=D.left*Fe,Dt=D.right*Fe,Qt,xr,Lr,jr;J==="width"||J==="both"?(jr=Se[0]+bt-de[3],xr=Se[0]+Dt+de[1]):(jr=Se[0]+(bt+Dt-Ve.displaySize[0])/2,xr=jr+Ve.displaySize[0]);let $r=D.top*Fe,ia=D.bottom*Fe;return J==="height"||J==="both"?(Qt=Se[1]+$r-de[0],Lr=Se[1]+ia+de[2]):(Qt=Se[1]+($r+ia-Ve.displaySize[1])/2,Lr=Qt+Ve.displaySize[1]),{image:Ve,top:Qt,right:xr,bottom:Lr,left:jr,collisionPadding:st}}let op=255,jh=128,Av=op*jh;function ty(W,D){let{expression:J}=D;if(J.kind==="constant")return{kind:"constant",layoutSize:J.evaluate(new ds(W+1))};if(J.kind==="source")return{kind:"source"};{let{zoomStops:de,interpolationType:Se}=J,Fe=0;for(;FeVe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=nn([]),this.placementViewportMatrix=nn([]);let J=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ty(this.zoom,J["text-size"]),this.iconSizeData=ty(this.zoom,J["icon-size"]);let de=this.layers[0].layout,Se=de.get("symbol-sort-key"),Fe=de.get("symbol-z-order");this.canOverlap=vm(de,"text-overlap","text-allow-overlap")!=="never"||vm(de,"icon-overlap","icon-allow-overlap")!=="never"||de.get("text-ignore-placement")||de.get("icon-ignore-placement"),this.sortFeaturesByKey=Fe!=="viewport-y"&&!Se.isConstant(),this.sortFeaturesByY=(Fe==="viewport-y"||Fe==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,de.get("symbol-placement")==="point"&&(this.writingModes=de.get("text-writing-mode").map(Ve=>e.ah[Ve])),this.stateDependentLayerIds=this.layers.filter(Ve=>Ve.isStateDependent()).map(Ve=>Ve.id),this.sourceID=D.sourceID}createArrays(){this.text=new mm(new Ds(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new mm(new Ds(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new jo,this.lineVertexArray=new uo,this.symbolInstances=new so,this.textAnchorOffsets=new Xo}calculateGlyphDependencies(D,J,de,Se,Fe){for(let Ve=0;Ve0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),Qt=bt.value.kind!=="constant"||!!bt.value.value||Object.keys(bt.parameters).length>0,xr=Fe.get("symbol-sort-key");if(this.features=[],!Dt&&!Qt)return;let Lr=J.iconDependencies,jr=J.glyphDependencies,$r=J.availableImages,ia=new ds(this.zoom);for(let{feature:Ra,id:Va,index:On,sourceLayerIndex:ln}of D){let Rn=Se._featureFilter.needGeometry,Hn=yl(Ra,Rn);if(!Se._featureFilter.filter(ia,Hn,de))continue;let Ci,ho;if(Rn||(Hn.geometry=el(Ra)),Dt){let to=Se.getValueAndResolveTokens("text-field",Hn,de,$r),Ti=Kr.factory(to),Oo=this.hasRTLText=this.hasRTLText||pm(Ti);(!Oo||Cs.getRTLTextPluginStatus()==="unavailable"||Oo&&Cs.isParsed())&&(Ci=xv(Ti,Se,Hn))}if(Qt){let to=Se.getValueAndResolveTokens("icon-image",Hn,de,$r);ho=to instanceof Ua?to:Ua.fromString(to)}if(!Ci&&!ho)continue;let Jo=this.sortFeaturesByKey?xr.evaluate(Hn,{},de):void 0;if(this.features.push({id:Va,text:Ci,icon:ho,index:On,sourceLayerIndex:ln,geometry:Hn.geometry,properties:Ra.properties,type:Mx[Ra.type],sortKey:Jo}),ho&&(Lr[ho.name]=!0),Ci){let to=Ve.evaluate(Hn,{},de).join(","),Ti=Fe.get("text-rotation-alignment")!=="viewport"&&Fe.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let Oo of Ci.sections)if(Oo.image)Lr[Oo.image.name]=!0;else{let So=ao(Ci.toString()),wo=Oo.fontStack||to,ci=jr[wo]=jr[wo]||{};this.calculateGlyphDependencies(Oo.text,ci,Ti,this.allowVerticalPlacement,So)}}}Fe.get("symbol-placement")==="line"&&(this.features=(function(Ra){let Va={},On={},ln=[],Rn=0;function Hn(to){ln.push(Ra[to]),Rn++}function Ci(to,Ti,Oo){let So=On[to];return delete On[to],On[Ti]=So,ln[So].geometry[0].pop(),ln[So].geometry[0]=ln[So].geometry[0].concat(Oo[0]),So}function ho(to,Ti,Oo){let So=Va[Ti];return delete Va[Ti],Va[to]=So,ln[So].geometry[0].shift(),ln[So].geometry[0]=Oo[0].concat(ln[So].geometry[0]),So}function Jo(to,Ti,Oo){let So=Oo?Ti[0][Ti[0].length-1]:Ti[0][0];return`${to}:${So.x}:${So.y}`}for(let to=0;toto.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((Ra,Va)=>Ra.sortKey-Va.sortKey)}update(D,J,de){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,J,this.layers,de),this.icon.programConfigurations.updatePaintArrays(D,J,this.layers,de))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,J){let de=this.lineVertexArray.length;if(D.segment!==void 0){let Se=D.dist(J[D.segment+1]),Fe=D.dist(J[D.segment]),Ve={};for(let st=D.segment+1;st=0;st--)Ve[st]={x:J[st].x,y:J[st].y,tileUnitDistanceFromAnchor:Fe},st>0&&(Fe+=J[st-1].dist(J[st]));for(let st=0;st0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,J){let de=D.placedSymbolArray.get(J),Se=de.vertexStartIndex+4*de.numGlyphs;for(let Fe=de.vertexStartIndex;FeSe[st]-Se[bt]||Fe[bt]-Fe[st]),Ve}addToSortKeyRanges(D,J){let de=this.sortKeyRanges[this.sortKeyRanges.length-1];de&&de.sortKey===J?de.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:J,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let J of this.symbolInstanceIndexes){let de=this.symbolInstances.get(J);this.featureSortOrder.push(de.featureIndex),[de.rightJustifiedTextSymbolIndex,de.centerJustifiedTextSymbolIndex,de.leftJustifiedTextSymbolIndex].forEach((Se,Fe,Ve)=>{Se>=0&&Ve.indexOf(Se)===Fe&&this.addIndicesForPlacedSymbol(this.text,Se)}),de.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,de.verticalPlacedTextSymbolIndex),de.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,de.placedIconSymbolIndex),de.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,de.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Tc,sp;sn("SymbolBucket",dd,{omit:["layers","collisionBoxArray","features","compareText"]}),dd.MAX_GLYPHS=65535,dd.addDynamicAttributes=dm;var i0={get paint(){return sp=sp||new De({"icon-opacity":new _o(re.paint_symbol["icon-opacity"]),"icon-color":new _o(re.paint_symbol["icon-color"]),"icon-halo-color":new _o(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new _o(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new _o(re.paint_symbol["icon-halo-blur"]),"icon-translate":new $i(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new $i(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new _o(re.paint_symbol["text-opacity"]),"text-color":new _o(re.paint_symbol["text-color"],{runtimeType:zt,getOverride:W=>W.textColor,hasOverride:W=>!!W.textColor}),"text-halo-color":new _o(re.paint_symbol["text-halo-color"]),"text-halo-width":new _o(re.paint_symbol["text-halo-width"]),"text-halo-blur":new _o(re.paint_symbol["text-halo-blur"]),"text-translate":new $i(re.paint_symbol["text-translate"]),"text-translate-anchor":new $i(re.paint_symbol["text-translate-anchor"])})},get layout(){return Tc=Tc||new De({"symbol-placement":new $i(re.layout_symbol["symbol-placement"]),"symbol-spacing":new $i(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $i(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new _o(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new $i(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new $i(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new $i(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new $i(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new $i(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $i(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new _o(re.layout_symbol["icon-size"]),"icon-text-fit":new $i(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new $i(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new _o(re.layout_symbol["icon-image"]),"icon-rotate":new _o(re.layout_symbol["icon-rotate"]),"icon-padding":new _o(re.layout_symbol["icon-padding"]),"icon-keep-upright":new $i(re.layout_symbol["icon-keep-upright"]),"icon-offset":new _o(re.layout_symbol["icon-offset"]),"icon-anchor":new _o(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $i(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $i(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $i(re.layout_symbol["text-rotation-alignment"]),"text-field":new _o(re.layout_symbol["text-field"]),"text-font":new _o(re.layout_symbol["text-font"]),"text-size":new _o(re.layout_symbol["text-size"]),"text-max-width":new _o(re.layout_symbol["text-max-width"]),"text-line-height":new $i(re.layout_symbol["text-line-height"]),"text-letter-spacing":new _o(re.layout_symbol["text-letter-spacing"]),"text-justify":new _o(re.layout_symbol["text-justify"]),"text-radial-offset":new _o(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new $i(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new _o(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new _o(re.layout_symbol["text-anchor"]),"text-max-angle":new $i(re.layout_symbol["text-max-angle"]),"text-writing-mode":new $i(re.layout_symbol["text-writing-mode"]),"text-rotate":new _o(re.layout_symbol["text-rotate"]),"text-padding":new $i(re.layout_symbol["text-padding"]),"text-keep-upright":new $i(re.layout_symbol["text-keep-upright"]),"text-transform":new _o(re.layout_symbol["text-transform"]),"text-offset":new _o(re.layout_symbol["text-offset"]),"text-allow-overlap":new $i(re.layout_symbol["text-allow-overlap"]),"text-overlap":new $i(re.layout_symbol["text-overlap"]),"text-ignore-placement":new $i(re.layout_symbol["text-ignore-placement"]),"text-optional":new $i(re.layout_symbol["text-optional"])})}};class lp{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:Qe,this.defaultValue=D}evaluate(D){if(D.formattedSection){let J=this.defaultValue.property.overrides;if(J&&J.hasOverride(D.formattedSection))return J.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}sn("FormatSectionOverride",lp,{omit:["defaultValue"]});class Gv extends ne{constructor(D){super(D,i0)}recalculate(D,J){if(super.recalculate(D,J),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let de=this.layout.get("text-writing-mode");if(de){let Se=[];for(let Fe of de)Se.indexOf(Fe)<0&&Se.push(Fe);this.layout._values["text-writing-mode"]=Se}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,J,de,Se){let Fe=this.layout.get(D).evaluate(J,{},de,Se),Ve=this._unevaluatedLayout._values[D];return Ve.isDataDriven()||Hu(Ve.value)||!Fe?Fe:(function(st,bt){return bt.replace(/{([^{}]+)}/g,(Dt,Qt)=>st&&Qt in st?String(st[Qt]):"")})(J.properties,Fe)}createBucket(D){return new dd(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let D of i0.paint.overridableProperties){if(!Gv.hasPaintOverride(this.layout,D))continue;let J=this.paint.get(D),de=new lp(J),Se=new Ql(de,J.property.specification),Fe=null;Fe=J.value.kind==="constant"||J.value.kind==="source"?new zu("source",Se):new ql("composite",Se,J.value.zoomStops),this.paint._values[D]=new Zl(J.property,Fe,J.parameters)}}_handleOverridablePaintPropertyUpdate(D,J,de){return!(!this.layout||J.isDataDriven()||de.isDataDriven())&&Gv.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,J){let de=D.get("text-field"),Se=i0.paint.properties[J],Fe=!1,Ve=st=>{for(let bt of st)if(Se.overrides&&Se.overrides.hasOverride(bt))return void(Fe=!0)};if(de.value.kind==="constant"&&de.value.value instanceof Kr)Ve(de.value.value.sections);else if(de.value.kind==="source"){let st=Dt=>{Fe||(Dt instanceof Wn&&Sa(Dt.value)===Or?Ve(Dt.value.sections):Dt instanceof Uo?Ve(Dt.sections):Dt.eachChild(st))},bt=de.value;bt._styleExpression&&st(bt._styleExpression.expression)}return Fe}}let ry;var up={get paint(){return ry=ry||new De({"background-color":new $i(re.paint_background["background-color"]),"background-pattern":new ku(re.paint_background["background-pattern"]),"background-opacity":new $i(re.paint_background["background-opacity"])})}};class kx extends ne{constructor(D){super(D,up)}}let gm;var ay={get paint(){return gm=gm||new De({"raster-opacity":new $i(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new $i(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new $i(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new $i(re.paint_raster["raster-brightness-max"]),"raster-saturation":new $i(re.paint_raster["raster-saturation"]),"raster-contrast":new $i(re.paint_raster["raster-contrast"]),"raster-resampling":new $i(re.paint_raster["raster-resampling"]),"raster-fade-duration":new $i(re.paint_raster["raster-fade-duration"])})}};class cp extends ne{constructor(D){super(D,ay)}}class ym extends ne{constructor(D){super(D,{}),this.onAdd=J=>{this.implementation.onAdd&&this.implementation.onAdd(J,J.painter.context.gl)},this.onRemove=J=>{this.implementation.onRemove&&this.implementation.onRemove(J,J.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class _m{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let xm=63710088e-1;class nv{constructor(D,J){if(isNaN(D)||isNaN(J))throw new Error(`Invalid LngLat object: (${D}, ${J})`);if(this.lng=+D,this.lat=+J,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new nv(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){let J=Math.PI/180,de=this.lat*J,Se=D.lat*J,Fe=Math.sin(de)*Math.sin(Se)+Math.cos(de)*Math.cos(Se)*Math.cos((D.lng-this.lng)*J);return xm*Math.acos(Math.min(Fe,1))}static convert(D){if(D instanceof nv)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new nv(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new nv(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let pd=2*Math.PI*xm;function ny(W){return pd*Math.cos(W*Math.PI/180)}function o0(W){return(180+W)/360}function iy(W){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+W*Math.PI/360)))/360}function s0(W,D){return W/ny(D)}function fp(W){return 360/Math.PI*Math.atan(Math.exp((180-360*W)*Math.PI/180))-90}class hp{constructor(D,J,de=0){this.x=+D,this.y=+J,this.z=+de}static fromLngLat(D,J=0){let de=nv.convert(D);return new hp(o0(de.lng),iy(de.lat),s0(J,de.lat))}toLngLat(){return new nv(360*this.x-180,fp(this.y))}toAltitude(){return this.z*ny(fp(this.y))}meterInMercatorCoordinateUnits(){return 1/pd*(D=fp(this.y),1/Math.cos(D*Math.PI/180));var D}}function Ch(W,D,J){var de=2*Math.PI*6378137/256/Math.pow(2,J);return[W*de-2*Math.PI*6378137/2,D*de-2*Math.PI*6378137/2]}class bm{constructor(D,J,de){if(!(function(Se,Fe,Ve){return!(Se<0||Se>25||Ve<0||Ve>=Math.pow(2,Se)||Fe<0||Fe>=Math.pow(2,Se))})(D,J,de))throw new Error(`x=${J}, y=${de}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=J,this.y=de,this.key=vp(0,D,D,J,de)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,J,de){let Se=(Ve=this.y,st=this.z,bt=Ch(256*(Fe=this.x),256*(Ve=Math.pow(2,st)-Ve-1),st),Dt=Ch(256*(Fe+1),256*(Ve+1),st),bt[0]+","+bt[1]+","+Dt[0]+","+Dt[1]);var Fe,Ve,st,bt,Dt;let Qt=(function(xr,Lr,jr){let $r,ia="";for(let Ra=xr;Ra>0;Ra--)$r=1<1?"@2x":"").replace(/{quadkey}/g,Qt).replace(/{bbox-epsg-3857}/g,Se)}isChildOf(D){let J=this.z-D.z;return J>0&&D.x===this.x>>J&&D.y===this.y>>J}getTilePoint(D){let J=Math.pow(2,this.z);return new i((D.x*J-this.x)*eo,(D.y*J-this.y)*eo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class oy{constructor(D,J){this.wrap=D,this.canonical=J,this.key=vp(D,J.z,J.z,J.x,J.y)}}class xh{constructor(D,J,de,Se,Fe){if(D= z; overscaledZ = ${D}; z = ${de}`);this.overscaledZ=D,this.wrap=J,this.canonical=new bm(de,+Se,+Fe),this.key=vp(J,D,de,Se,Fe)}clone(){return new xh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let J=this.canonical.z-D;return D>this.canonical.z?new xh(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xh(D,this.wrap,D,this.canonical.x>>J,this.canonical.y>>J)}calculateScaledKey(D,J){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let de=this.canonical.z-D;return D>this.canonical.z?vp(this.wrap*+J,D,this.canonical.z,this.canonical.x,this.canonical.y):vp(this.wrap*+J,D,D,this.canonical.x>>de,this.canonical.y>>de)}isChildOf(D){if(D.wrap!==this.wrap)return!1;let J=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>J&&D.canonical.y===this.canonical.y>>J}children(D){if(this.overscaledZ>=D)return[new xh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let J=this.canonical.z+1,de=2*this.canonical.x,Se=2*this.canonical.y;return[new xh(J,this.wrap,J,de,Se),new xh(J,this.wrap,J,de+1,Se),new xh(J,this.wrap,J,de,Se+1),new xh(J,this.wrap,J,de+1,Se+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=xr),xr=this.dim+1||J<-1||J>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(J+1)*this.stride+(D+1)}unpack(D,J,de){return D*this.redFactor+J*this.greenFactor+de*this.blueFactor-this.baseShift}getPixels(){return new Tn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,J,de){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Se=J*this.dim,Fe=J*this.dim+this.dim,Ve=de*this.dim,st=de*this.dim+this.dim;switch(J){case-1:Se=Fe-1;break;case 1:Fe=Se+1}switch(de){case-1:Ve=st-1;break;case 1:st=Ve+1}let bt=-J*this.dim,Dt=-de*this.dim;for(let Qt=Ve;Qt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class wm{constructor(D,J,de,Se,Fe){this.type="Feature",this._vectorTileFeature=D,D._z=J,D._x=de,D._y=Se,this.properties=D.properties,this.id=Fe}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){let D={geometry:this.geometry};for(let J in this)J!=="_geometry"&&J!=="_vectorTileFeature"&&(D[J]=this[J]);return D}}class Hv{constructor(D,J){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new Sn(eo,16,0),this.grid3D=new Sn(eo,16,0),this.featureIndexArray=new Is,this.promoteId=J}insert(D,J,de,Se,Fe,Ve){let st=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(de,Se,Fe);let bt=Ve?this.grid3D:this.grid;for(let Dt=0;Dt=0&&xr[3]>=0&&bt.insert(st,xr[0],xr[1],xr[2],xr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Hr.VectorTile(new cm(this.rawTileData)).layers,this.sourceLayerCoder=new ly(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,J,de,Se){this.loadVTLayers();let Fe=D.params||{},Ve=eo/D.tileSize/D.scale,st=Wu(Fe.filter),bt=D.queryGeometry,Dt=D.queryPadding*Ve,Qt=cy(bt),xr=this.grid.query(Qt.minX-Dt,Qt.minY-Dt,Qt.maxX+Dt,Qt.maxY+Dt),Lr=cy(D.cameraQueryGeometry),jr=this.grid3D.query(Lr.minX-Dt,Lr.minY-Dt,Lr.maxX+Dt,Lr.maxY+Dt,(Ra,Va,On,ln)=>(function(Rn,Hn,Ci,ho,Jo){for(let Ti of Rn)if(Hn<=Ti.x&&Ci<=Ti.y&&ho>=Ti.x&&Jo>=Ti.y)return!0;let to=[new i(Hn,Ci),new i(Hn,Jo),new i(ho,Jo),new i(ho,Ci)];if(Rn.length>2){for(let Ti of to)if(hn(Rn,Ti))return!0}for(let Ti=0;Ti(ln||(ln=el(Rn)),Hn.queryIntersectsFeature(bt,Rn,Ci,ln,this.z,D.transform,Ve,D.pixelPosMatrix)))}return $r}loadMatchingFeature(D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr){let Lr=this.bucketLayerIDs[J];if(Ve&&!(function(Ra,Va){for(let On=0;On=0)return!0;return!1})(Ve,Lr))return;let jr=this.sourceLayerCoder.decode(de),$r=this.vtLayers[jr].feature(Se);if(Fe.needGeometry){let Ra=yl($r,!0);if(!Fe.filter(new ds(this.tileID.overscaledZ),Ra,this.tileID.canonical))return}else if(!Fe.filter(new ds(this.tileID.overscaledZ),$r))return;let ia=this.getId($r,jr);for(let Ra=0;Ra{let st=D instanceof Bu?D.get(Ve):null;return st&&st.evaluate?st.evaluate(J,de,Se):st})}function cy(W){let D=1/0,J=1/0,de=-1/0,Se=-1/0;for(let Fe of W)D=Math.min(D,Fe.x),J=Math.min(J,Fe.y),de=Math.max(de,Fe.x),Se=Math.max(Se,Fe.y);return{minX:D,minY:J,maxX:de,maxY:Se}}function Cx(W,D){return D-W}function fy(W,D,J,de,Se){let Fe=[];for(let Ve=0;Ve=de&&xr.x>=de||(Qt.x>=de?Qt=new i(de,Qt.y+(de-Qt.x)/(xr.x-Qt.x)*(xr.y-Qt.y))._round():xr.x>=de&&(xr=new i(de,Qt.y+(de-Qt.x)/(xr.x-Qt.x)*(xr.y-Qt.y))._round()),Qt.y>=Se&&xr.y>=Se||(Qt.y>=Se?Qt=new i(Qt.x+(Se-Qt.y)/(xr.y-Qt.y)*(xr.x-Qt.x),Se)._round():xr.y>=Se&&(xr=new i(Qt.x+(Se-Qt.y)/(xr.y-Qt.y)*(xr.x-Qt.x),Se)._round()),bt&&Qt.equals(bt[bt.length-1])||(bt=[Qt],Fe.push(bt)),bt.push(xr)))))}}return Fe}sn("FeatureIndex",Hv,{omit:["rawTileData","sourceLayerCoder"]});class iv extends i{constructor(D,J,de,Se){super(D,J),this.angle=de,Se!==void 0&&(this.segment=Se)}clone(){return new iv(this.x,this.y,this.angle,this.segment)}}function Tm(W,D,J,de,Se){if(D.segment===void 0||J===0)return!0;let Fe=D,Ve=D.segment+1,st=0;for(;st>-J/2;){if(Ve--,Ve<0)return!1;st-=W[Ve].dist(Fe),Fe=W[Ve]}st+=W[Ve].dist(W[Ve+1]),Ve++;let bt=[],Dt=0;for(;stde;)Dt-=bt.shift().angleDelta;if(Dt>Se)return!1;Ve++,st+=Qt.dist(xr)}return!0}function hy(W){let D=0;for(let J=0;JDt){let $r=(Dt-bt)/jr,ia=Si.number(xr.x,Lr.x,$r),Ra=Si.number(xr.y,Lr.y,$r),Va=new iv(ia,Ra,Lr.angleTo(xr),Qt);return Va._round(),!Ve||Tm(W,Va,st,Ve,D)?Va:void 0}bt+=jr}}function Px(W,D,J,de,Se,Fe,Ve,st,bt){let Dt=vy(de,Fe,Ve),Qt=dy(de,Se),xr=Qt*Ve,Lr=W[0].x===0||W[0].x===bt||W[0].y===0||W[0].y===bt;return D-xr=0&&Rn=0&&Hn=0&&Lr+Dt<=Qt){let Ci=new iv(Rn,Hn,On,$r);Ci._round(),de&&!Tm(W,Ci,Fe,de,Se)||jr.push(Ci)}}xr+=Va}return st||jr.length||Ve||(jr=py(W,xr/2,J,de,Se,Fe,Ve,!0,bt)),jr}sn("Anchor",iv);let md=Rf;function my(W,D,J,de){let Se=[],Fe=W.image,Ve=Fe.pixelRatio,st=Fe.paddedRect.w-2*md,bt=Fe.paddedRect.h-2*md,Dt={x1:W.left,y1:W.top,x2:W.right,y2:W.bottom},Qt=Fe.stretchX||[[0,st]],xr=Fe.stretchY||[[0,bt]],Lr=(ci,qo)=>ci+qo[1]-qo[0],jr=Qt.reduce(Lr,0),$r=xr.reduce(Lr,0),ia=st-jr,Ra=bt-$r,Va=0,On=jr,ln=0,Rn=$r,Hn=0,Ci=ia,ho=0,Jo=Ra;if(Fe.content&&de){let ci=Fe.content,qo=ci[2]-ci[0],To=ci[3]-ci[1];(Fe.textFitWidth||Fe.textFitHeight)&&(Dt=Qg(W)),Va=ov(Qt,0,ci[0]),ln=ov(xr,0,ci[1]),On=ov(Qt,ci[0],ci[2]),Rn=ov(xr,ci[1],ci[3]),Hn=ci[0]-Va,ho=ci[1]-ln,Ci=qo-On,Jo=To-Rn}let to=Dt.x1,Ti=Dt.y1,Oo=Dt.x2-to,So=Dt.y2-Ti,wo=(ci,qo,To,cs)=>{let yu=l0(ci.stretch-Va,On,Oo,to),uu=gd(ci.fixed-Hn,Ci,ci.stretch,jr),rf=l0(qo.stretch-ln,Rn,So,Ti),bh=gd(qo.fixed-ho,Jo,qo.stretch,$r),Sf=l0(To.stretch-Va,On,Oo,to),af=gd(To.fixed-Hn,Ci,To.stretch,jr),Gf=l0(cs.stretch-ln,Rn,So,Ti),Hf=gd(cs.fixed-ho,Jo,cs.stretch,$r),Wf=new i(yu,rf),Ac=new i(Sf,rf),nf=new i(Sf,Gf),Df=new i(yu,Gf),Mf=new i(uu/Ve,bh/Ve),df=new i(af/Ve,Hf/Ve),Cc=D*Math.PI/180;if(Cc){let Bl=Math.sin(Cc),Pu=Math.cos(Cc),_u=[Pu,-Bl,Bl,Pu];Wf._matMult(_u),Ac._matMult(_u),Df._matMult(_u),nf._matMult(_u)}let mh=ci.stretch+ci.fixed,$f=qo.stretch+qo.fixed;return{tl:Wf,tr:Ac,bl:Df,br:nf,tex:{x:Fe.paddedRect.x+md+mh,y:Fe.paddedRect.y+md+$f,w:To.stretch+To.fixed-mh,h:cs.stretch+cs.fixed-$f},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Mf,pixelOffsetBR:df,minFontScaleX:Ci/Ve/Oo,minFontScaleY:Jo/Ve/So,isSDF:J}};if(de&&(Fe.stretchX||Fe.stretchY)){let ci=gy(Qt,ia,jr),qo=gy(xr,Ra,$r);for(let To=0;To0&&(ia=Math.max(10,ia),this.circleDiameter=ia)}else{let Lr=!((xr=Ve.image)===null||xr===void 0)&&xr.content&&(Ve.image.textFitWidth||Ve.image.textFitHeight)?Qg(Ve):{x1:Ve.left,y1:Ve.top,x2:Ve.right,y2:Ve.bottom};Lr.y1=Lr.y1*st-bt[0],Lr.y2=Lr.y2*st+bt[2],Lr.x1=Lr.x1*st-bt[3],Lr.x2=Lr.x2*st+bt[1];let jr=Ve.collisionPadding;if(jr&&(Lr.x1-=jr[0]*st,Lr.y1-=jr[1]*st,Lr.x2+=jr[2]*st,Lr.y2+=jr[3]*st),Qt){let $r=new i(Lr.x1,Lr.y1),ia=new i(Lr.x2,Lr.y1),Ra=new i(Lr.x1,Lr.y2),Va=new i(Lr.x2,Lr.y2),On=Qt*Math.PI/180;$r._rotate(On),ia._rotate(On),Ra._rotate(On),Va._rotate(On),Lr.x1=Math.min($r.x,ia.x,Ra.x,Va.x),Lr.x2=Math.max($r.x,ia.x,Ra.x,Va.x),Lr.y1=Math.min($r.y,ia.y,Ra.y,Va.y),Lr.y2=Math.max($r.y,ia.y,Ra.y,Va.y)}D.emplaceBack(J.x,J.y,Lr.x1,Lr.y1,Lr.x2,Lr.y2,de,Se,Fe)}this.boxEndIndex=D.length}}class Dh{constructor(D=[],J=(de,Se)=>deSe?1:0){if(this.data=D,this.length=this.data.length,this.compare=J,this.length>0)for(let de=(this.length>>1)-1;de>=0;de--)this._down(de)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;let D=this.data[0],J=this.data.pop();return--this.length>0&&(this.data[0]=J,this._down(0)),D}peek(){return this.data[0]}_up(D){let{data:J,compare:de}=this,Se=J[D];for(;D>0;){let Fe=D-1>>1,Ve=J[Fe];if(de(Se,Ve)>=0)break;J[D]=Ve,D=Fe}J[D]=Se}_down(D){let{data:J,compare:de}=this,Se=this.length>>1,Fe=J[D];for(;D=0)break;J[D]=J[Ve],D=Ve}J[D]=Fe}}function Ix(W,D=1,J=!1){let de=1/0,Se=1/0,Fe=-1/0,Ve=-1/0,st=W[0];for(let jr=0;jrFe)&&(Fe=$r.x),(!jr||$r.y>Ve)&&(Ve=$r.y)}let bt=Math.min(Fe-de,Ve-Se),Dt=bt/2,Qt=new Dh([],Rx);if(bt===0)return new i(de,Se);for(let jr=de;jrxr.d||!xr.d)&&(xr=jr,J&&console.log("found best %d after %d probes",Math.round(1e4*jr.d)/1e4,Lr)),jr.max-xr.d<=D||(Dt=jr.h/2,Qt.push(new yd(jr.p.x-Dt,jr.p.y-Dt,Dt,W)),Qt.push(new yd(jr.p.x+Dt,jr.p.y-Dt,Dt,W)),Qt.push(new yd(jr.p.x-Dt,jr.p.y+Dt,Dt,W)),Qt.push(new yd(jr.p.x+Dt,jr.p.y+Dt,Dt,W)),Lr+=4)}return J&&(console.log(`num probes: ${Lr}`),console.log(`best distance: ${xr.d}`)),xr.p}function Rx(W,D){return D.max-W.max}function yd(W,D,J,de){this.p=new i(W,D),this.h=J,this.d=(function(Se,Fe){let Ve=!1,st=1/0;for(let bt=0;btSe.y!=$r.y>Se.y&&Se.x<($r.x-jr.x)*(Se.y-jr.y)/($r.y-jr.y)+jr.x&&(Ve=!Ve),st=Math.min(st,fa(Se,jr,$r))}}return(Ve?1:-1)*Math.sqrt(st)})(this.p,de),this.max=this.d+this.h*Math.SQRT2}var Af;e.aq=void 0,(Af=e.aq||(e.aq={}))[Af.center=1]="center",Af[Af.left=2]="left",Af[Af.right=3]="right",Af[Af.top=4]="top",Af[Af.bottom=5]="bottom",Af[Af["top-left"]=6]="top-left",Af[Af["top-right"]=7]="top-right",Af[Af["bottom-left"]=8]="bottom-left",Af[Af["bottom-right"]=9]="bottom-right";let Ev=7,Wv=Number.POSITIVE_INFINITY;function Am(W,D){return D[1]!==Wv?(function(J,de,Se){let Fe=0,Ve=0;switch(de=Math.abs(de),Se=Math.abs(Se),J){case"top-right":case"top-left":case"top":Ve=Se-Ev;break;case"bottom-right":case"bottom-left":case"bottom":Ve=-Se+Ev}switch(J){case"top-right":case"bottom-right":case"right":Fe=-de;break;case"top-left":case"bottom-left":case"left":Fe=de}return[Fe,Ve]})(W,D[0],D[1]):(function(J,de){let Se=0,Fe=0;de<0&&(de=0);let Ve=de/Math.SQRT2;switch(J){case"top-right":case"top-left":Fe=Ve-Ev;break;case"bottom-right":case"bottom-left":Fe=-Ve+Ev;break;case"bottom":Fe=-de+Ev;break;case"top":Fe=de-Ev}switch(J){case"top-right":case"bottom-right":Se=-Ve;break;case"top-left":case"bottom-left":Se=Ve;break;case"left":Se=de;break;case"right":Se=-de}return[Se,Fe]})(W,D[0])}function yy(W,D,J){var de;let Se=W.layout,Fe=(de=Se.get("text-variable-anchor-offset"))===null||de===void 0?void 0:de.evaluate(D,{},J);if(Fe){let st=Fe.values,bt=[];for(let Dt=0;DtLr*Ol);Qt.startsWith("top")?xr[1]-=Ev:Qt.startsWith("bottom")&&(xr[1]+=Ev),bt[Dt+1]=xr}return new Ga(bt)}let Ve=Se.get("text-variable-anchor");if(Ve){let st;st=W._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Se.get("text-radial-offset").evaluate(D,{},J)*Ol,Wv]:Se.get("text-offset").evaluate(D,{},J).map(Dt=>Dt*Ol);let bt=[];for(let Dt of Ve)bt.push(Dt,Am(Dt,st));return new Ga(bt)}return null}function Sm(W){switch(W){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Dx(W,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt){let xr=Fe.textMaxSize.evaluate(D,{});xr===void 0&&(xr=Ve);let Lr=W.layers[0].layout,jr=Lr.get("icon-offset").evaluate(D,{},Qt),$r=xy(J.horizontal),ia=Ve/24,Ra=W.tilePixelRatio*ia,Va=W.tilePixelRatio*xr/24,On=W.tilePixelRatio*st,ln=W.tilePixelRatio*Lr.get("symbol-spacing"),Rn=Lr.get("text-padding")*W.tilePixelRatio,Hn=(function(ci,qo,To,cs=1){let yu=ci.get("icon-padding").evaluate(qo,{},To),uu=yu&&yu.values;return[uu[0]*cs,uu[1]*cs,uu[2]*cs,uu[3]*cs]})(Lr,D,Qt,W.tilePixelRatio),Ci=Lr.get("text-max-angle")/180*Math.PI,ho=Lr.get("text-rotation-alignment")!=="viewport"&&Lr.get("symbol-placement")!=="point",Jo=Lr.get("icon-rotation-alignment")==="map"&&Lr.get("symbol-placement")!=="point",to=Lr.get("symbol-placement"),Ti=ln/2,Oo=Lr.get("icon-text-fit"),So;de&&Oo!=="none"&&(W.allowVerticalPlacement&&J.vertical&&(So=ey(de,J.vertical,Oo,Lr.get("icon-text-fit-padding"),jr,ia)),$r&&(de=ey(de,$r,Oo,Lr.get("icon-text-fit-padding"),jr,ia)));let wo=(ci,qo)=>{qo.x<0||qo.x>=eo||qo.y<0||qo.y>=eo||(function(To,cs,yu,uu,rf,bh,Sf,af,Gf,Hf,Wf,Ac,nf,Df,Mf,df,Cc,mh,$f,Bl,Pu,_u,gh,vc,_d){let Vh=To.addToLineVertexArray(cs,yu),zh,wh,ec,Bc,Th=0,sv=0,Qf=0,xd=0,Lm=-1,h0=-1,qh={},Xv=Wa("");if(To.allowVerticalPlacement&&uu.vertical){let zf=af.layout.get("text-rotate").evaluate(Pu,{},vc)+90;ec=new Mv(Gf,cs,Hf,Wf,Ac,uu.vertical,nf,Df,Mf,zf),Sf&&(Bc=new Mv(Gf,cs,Hf,Wf,Ac,Sf,Cc,mh,Mf,zf))}if(rf){let zf=af.layout.get("icon-rotate").evaluate(Pu,{}),Ah=af.layout.get("icon-text-fit")!=="none",kv=my(rf,zf,gh,Ah),Xf=Sf?my(Sf,zf,gh,Ah):void 0;wh=new Mv(Gf,cs,Hf,Wf,Ac,rf,Cc,mh,!1,zf),Th=4*kv.length;let Ff=To.iconSizeData,Ph=null;Ff.kind==="source"?(Ph=[jh*af.layout.get("icon-size").evaluate(Pu,{})],Ph[0]>Av&&m(`${To.layerIds[0]}: Value for "icon-size" is >= ${op}. Reduce your "icon-size".`)):Ff.kind==="composite"&&(Ph=[jh*_u.compositeIconSizes[0].evaluate(Pu,{},vc),jh*_u.compositeIconSizes[1].evaluate(Pu,{},vc)],(Ph[0]>Av||Ph[1]>Av)&&m(`${To.layerIds[0]}: Value for "icon-size" is >= ${op}. Reduce your "icon-size".`)),To.addSymbols(To.icon,kv,Ph,Bl,$f,Pu,e.ah.none,cs,Vh.lineStartIndex,Vh.lineLength,-1,vc),Lm=To.icon.placedSymbolArray.length-1,Xf&&(sv=4*Xf.length,To.addSymbols(To.icon,Xf,Ph,Bl,$f,Pu,e.ah.vertical,cs,Vh.lineStartIndex,Vh.lineLength,-1,vc),h0=To.icon.placedSymbolArray.length-1)}let pf=Object.keys(uu.horizontal);for(let zf of pf){let Ah=uu.horizontal[zf];if(!zh){Xv=Wa(Ah.text);let Xf=af.layout.get("text-rotate").evaluate(Pu,{},vc);zh=new Mv(Gf,cs,Hf,Wf,Ac,Ah,nf,Df,Mf,Xf)}let kv=Ah.positionedLines.length===1;if(Qf+=_y(To,cs,Ah,bh,af,Mf,Pu,df,Vh,uu.vertical?e.ah.horizontal:e.ah.horizontalOnly,kv?pf:[zf],qh,Lm,_u,vc),kv)break}uu.vertical&&(xd+=_y(To,cs,uu.vertical,bh,af,Mf,Pu,df,Vh,e.ah.vertical,["vertical"],qh,h0,_u,vc));let Ox=zh?zh.boxStartIndex:To.collisionBoxArray.length,v0=zh?zh.boxEndIndex:To.collisionBoxArray.length,Gh=ec?ec.boxStartIndex:To.collisionBoxArray.length,eh=ec?ec.boxEndIndex:To.collisionBoxArray.length,Ay=wh?wh.boxStartIndex:To.collisionBoxArray.length,Bx=wh?wh.boxEndIndex:To.collisionBoxArray.length,Sy=Bc?Bc.boxStartIndex:To.collisionBoxArray.length,Nx=Bc?Bc.boxEndIndex:To.collisionBoxArray.length,Lh=-1,mp=(zf,Ah)=>zf&&zf.circleDiameter?Math.max(zf.circleDiameter,Ah):Ah;Lh=mp(zh,Lh),Lh=mp(ec,Lh),Lh=mp(wh,Lh),Lh=mp(Bc,Lh);let d0=Lh>-1?1:0;d0&&(Lh*=_d/Ol),To.glyphOffsetArray.length>=dd.MAX_GLYPHS&&m("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Pu.sortKey!==void 0&&To.addToSortKeyRanges(To.symbolInstances.length,Pu.sortKey);let Pm=yy(af,Pu,vc),[Ux,jx]=(function(zf,Ah){let kv=zf.length,Xf=Ah?.values;if(Xf?.length>0)for(let Ff=0;Ff=0?qh.right:-1,qh.center>=0?qh.center:-1,qh.left>=0?qh.left:-1,qh.vertical||-1,Lm,h0,Xv,Ox,v0,Gh,eh,Ay,Bx,Sy,Nx,Hf,Qf,xd,Th,sv,d0,0,nf,Lh,Ux,jx)})(W,qo,ci,J,de,Se,So,W.layers[0],W.collisionBoxArray,D.index,D.sourceLayerIndex,W.index,Ra,[Rn,Rn,Rn,Rn],ho,bt,On,Hn,Jo,jr,D,Fe,Dt,Qt,Ve)};if(to==="line")for(let ci of fy(D.geometry,0,0,eo,eo)){let qo=Px(ci,ln,Ci,J.vertical||$r,de,24,Va,W.overscaling,eo);for(let To of qo)$r&&zx(W,$r.text,Ti,To)||wo(ci,To)}else if(to==="line-center"){for(let ci of D.geometry)if(ci.length>1){let qo=Lx(ci,Ci,J.vertical||$r,de,24,Va);qo&&wo(ci,qo)}}else if(D.type==="Polygon")for(let ci of Vu(D.geometry,0)){let qo=Ix(ci,16);wo(ci[0],new iv(qo.x,qo.y,0))}else if(D.type==="LineString")for(let ci of D.geometry)wo(ci,new iv(ci[0].x,ci[0].y,0));else if(D.type==="Point")for(let ci of D.geometry)for(let qo of ci)wo([qo],new iv(qo.x,qo.y,0))}function _y(W,D,J,de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r){let ia=(function(On,ln,Rn,Hn,Ci,ho,Jo,to){let Ti=Hn.layout.get("text-rotate").evaluate(ho,{})*Math.PI/180,Oo=[];for(let So of ln.positionedLines)for(let wo of So.positionedGlyphs){if(!wo.rect)continue;let ci=wo.rect||{},qo=Yg+1,To=!0,cs=1,yu=0,uu=(Ci||to)&&wo.vertical,rf=wo.metrics.advance*wo.scale/2;if(to&&ln.verticalizable&&(yu=So.lineOffset/2-(wo.imageName?-(Ol-wo.metrics.width*wo.scale)/2:(wo.scale-1)*Ol)),wo.imageName){let Bl=Jo[wo.imageName];To=Bl.sdf,cs=Bl.pixelRatio,qo=Rf/cs}let bh=Ci?[wo.x+rf,wo.y]:[0,0],Sf=Ci?[0,0]:[wo.x+rf+Rn[0],wo.y+Rn[1]-yu],af=[0,0];uu&&(af=Sf,Sf=[0,0]);let Gf=wo.metrics.isDoubleResolution?2:1,Hf=(wo.metrics.left-qo)*wo.scale-rf+Sf[0],Wf=(-wo.metrics.top-qo)*wo.scale+Sf[1],Ac=Hf+ci.w/Gf*wo.scale/cs,nf=Wf+ci.h/Gf*wo.scale/cs,Df=new i(Hf,Wf),Mf=new i(Ac,Wf),df=new i(Hf,nf),Cc=new i(Ac,nf);if(uu){let Bl=new i(-rf,rf-tf),Pu=-Math.PI/2,_u=Ol/2-rf,gh=new i(5-tf-_u,-(wo.imageName?_u:0)),vc=new i(...af);Df._rotateAround(Pu,Bl)._add(gh)._add(vc),Mf._rotateAround(Pu,Bl)._add(gh)._add(vc),df._rotateAround(Pu,Bl)._add(gh)._add(vc),Cc._rotateAround(Pu,Bl)._add(gh)._add(vc)}if(Ti){let Bl=Math.sin(Ti),Pu=Math.cos(Ti),_u=[Pu,-Bl,Bl,Pu];Df._matMult(_u),Mf._matMult(_u),df._matMult(_u),Cc._matMult(_u)}let mh=new i(0,0),$f=new i(0,0);Oo.push({tl:Df,tr:Mf,bl:df,br:Cc,tex:ci,writingMode:ln.writingMode,glyphOffset:bh,sectionIndex:wo.sectionIndex,isSDF:To,pixelOffsetTL:mh,pixelOffsetBR:$f,minFontScaleX:0,minFontScaleY:0})}return Oo})(0,J,st,Se,Fe,Ve,de,W.allowVerticalPlacement),Ra=W.textSizeData,Va=null;Ra.kind==="source"?(Va=[jh*Se.layout.get("text-size").evaluate(Ve,{})],Va[0]>Av&&m(`${W.layerIds[0]}: Value for "text-size" is >= ${op}. Reduce your "text-size".`)):Ra.kind==="composite"&&(Va=[jh*jr.compositeTextSizes[0].evaluate(Ve,{},$r),jh*jr.compositeTextSizes[1].evaluate(Ve,{},$r)],(Va[0]>Av||Va[1]>Av)&&m(`${W.layerIds[0]}: Value for "text-size" is >= ${op}. Reduce your "text-size".`)),W.addSymbols(W.text,ia,Va,st,Fe,Ve,Dt,D,bt.lineStartIndex,bt.lineLength,Lr,$r);for(let On of Qt)xr[On]=W.text.placedSymbolArray.length-1;return 4*ia.length}function xy(W){for(let D in W)return W[D];return null}function zx(W,D,J,de){let Se=W.compareText;if(D in Se){let Fe=Se[D];for(let Ve=Fe.length-1;Ve>=0;Ve--)if(de.dist(Fe[Ve])>4;if(Se!==1)throw new Error(`Got v${Se} data when expected v1.`);let Fe=by[15&de];if(!Fe)throw new Error("Unrecognized array type.");let[Ve]=new Uint16Array(D,2,1),[st]=new Uint32Array(D,4,1);return new Mm(st,Ve,Fe,D)}constructor(D,J=64,de=Float64Array,Se){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+J,2),65535),this.ArrayType=de,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;let Fe=by.indexOf(this.ArrayType),Ve=2*D*this.ArrayType.BYTES_PER_ELEMENT,st=D*this.IndexArrayType.BYTES_PER_ELEMENT,bt=(8-st%8)%8;if(Fe<0)throw new Error(`Unexpected typed array class: ${de}.`);Se&&Se instanceof ArrayBuffer?(this.data=Se,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+st+bt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Ve+st+bt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+st+bt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Fe]),new Uint16Array(this.data,2,1)[0]=J,new Uint32Array(this.data,4,1)[0]=D)}add(D,J){let de=this._pos>>1;return this.ids[de]=de,this.coords[this._pos++]=D,this.coords[this._pos++]=J,de}finish(){let D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return u0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,J,de,Se){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Fe,coords:Ve,nodeSize:st}=this,bt=[0,Fe.length-1,0],Dt=[];for(;bt.length;){let Qt=bt.pop()||0,xr=bt.pop()||0,Lr=bt.pop()||0;if(xr-Lr<=st){for(let Ra=Lr;Ra<=xr;Ra++){let Va=Ve[2*Ra],On=Ve[2*Ra+1];Va>=D&&Va<=de&&On>=J&&On<=Se&&Dt.push(Fe[Ra])}continue}let jr=Lr+xr>>1,$r=Ve[2*jr],ia=Ve[2*jr+1];$r>=D&&$r<=de&&ia>=J&&ia<=Se&&Dt.push(Fe[jr]),(Qt===0?D<=$r:J<=ia)&&(bt.push(Lr),bt.push(jr-1),bt.push(1-Qt)),(Qt===0?de>=$r:Se>=ia)&&(bt.push(jr+1),bt.push(xr),bt.push(1-Qt))}return Dt}within(D,J,de){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Se,coords:Fe,nodeSize:Ve}=this,st=[0,Se.length-1,0],bt=[],Dt=de*de;for(;st.length;){let Qt=st.pop()||0,xr=st.pop()||0,Lr=st.pop()||0;if(xr-Lr<=Ve){for(let Ra=Lr;Ra<=xr;Ra++)Ty(Fe[2*Ra],Fe[2*Ra+1],D,J)<=Dt&&bt.push(Se[Ra]);continue}let jr=Lr+xr>>1,$r=Fe[2*jr],ia=Fe[2*jr+1];Ty($r,ia,D,J)<=Dt&&bt.push(Se[jr]),(Qt===0?D-de<=$r:J-de<=ia)&&(st.push(Lr),st.push(jr-1),st.push(1-Qt)),(Qt===0?D+de>=$r:J+de>=ia)&&(st.push(jr+1),st.push(xr),st.push(1-Qt))}return bt}}function u0(W,D,J,de,Se,Fe){if(Se-de<=J)return;let Ve=de+Se>>1;wy(W,D,Ve,de,Se,Fe),u0(W,D,J,de,Ve-1,1-Fe),u0(W,D,J,Ve+1,Se,1-Fe)}function wy(W,D,J,de,Se,Fe){for(;Se>de;){if(Se-de>600){let Dt=Se-de+1,Qt=J-de+1,xr=Math.log(Dt),Lr=.5*Math.exp(2*xr/3),jr=.5*Math.sqrt(xr*Lr*(Dt-Lr)/Dt)*(Qt-Dt/2<0?-1:1);wy(W,D,J,Math.max(de,Math.floor(J-Qt*Lr/Dt+jr)),Math.min(Se,Math.floor(J+(Dt-Qt)*Lr/Dt+jr)),Fe)}let Ve=D[2*J+Fe],st=de,bt=Se;for(dp(W,D,de,J),D[2*Se+Fe]>Ve&&dp(W,D,de,Se);stVe;)bt--}D[2*de+Fe]===Ve?dp(W,D,de,bt):(bt++,dp(W,D,bt,Se)),bt<=J&&(de=bt+1),J<=bt&&(Se=bt-1)}}function dp(W,D,J,de){Em(W,J,de),Em(D,2*J,2*de),Em(D,2*J+1,2*de+1)}function Em(W,D,J){let de=W[D];W[D]=W[J],W[J]=de}function Ty(W,D,J,de){let Se=W-J,Fe=D-de;return Se*Se+Fe*Fe}var c0;e.bg=void 0,(c0=e.bg||(e.bg={})).create="create",c0.load="load",c0.fullLoad="fullLoad";let pp=null,Xc=[],km=1e3/60,Cm="loadTime",f0="fullLoadTime",Fx={mark(W){performance.mark(W)},frame(W){let D=W;pp!=null&&Xc.push(D-pp),pp=D},clearMetrics(){pp=null,Xc=[],performance.clearMeasures(Cm),performance.clearMeasures(f0);for(let W in e.bg)performance.clearMarks(e.bg[W])},getPerformanceMetrics(){performance.measure(Cm,e.bg.create,e.bg.load),performance.measure(f0,e.bg.create,e.bg.fullLoad);let W=performance.getEntriesByName(Cm)[0].duration,D=performance.getEntriesByName(f0)[0].duration,J=Xc.length,de=1/(Xc.reduce((Fe,Ve)=>Fe+Ve,0)/J/1e3),Se=Xc.filter(Fe=>Fe>km).reduce((Fe,Ve)=>Fe+(Ve-km)/km,0);return{loadTime:W,fullLoadTime:D,fps:de,percentDroppedFrames:Se/(J+Se)*100,totalFrames:J}}};e.$=class extends yr{},e.A=Ha,e.B=Fn,e.C=function(W){if(z==null){let D=W.navigator?W.navigator.userAgent:null;z=!!W.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=$i,e.E=Q,e.F=class{constructor(W,D){this.target=W,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new _m(()=>this.process()),this.subscription=(function(J,de,Se,Fe){return J.addEventListener(de,Se,!1),{unsubscribe:()=>{J.removeEventListener(de,Se,!1)}}})(this.target,"message",J=>this.receive(J)),this.globalScope=L(self)?W:window}registerMessageHandler(W,D){this.messageHandlers[W]=D}sendAsync(W,D){return new Promise((J,de)=>{let Se=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Se]={resolve:J,reject:de},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Se];let st={id:Se,type:"",origin:location.origin,targetMapId:W.targetMapId,sourceMapId:this.mapId};this.target.postMessage(st)},{once:!0});let Fe=[],Ve=Object.assign(Object.assign({},W),{id:Se,sourceMapId:this.mapId,origin:location.origin,data:Ui(W.data,Fe)});this.target.postMessage(Ve,{transfer:Fe})})}receive(W){let D=W.data,J=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[J];let de=this.abortControllers[J];return delete this.abortControllers[J],void(de&&de.abort())}if(L(self)||D.mustQueue)return this.tasks[J]=D,this.taskQueue.push(J),void this.invoker.trigger();this.processTask(J,D)}}process(){if(this.taskQueue.length===0)return;let W=this.taskQueue.shift(),D=this.tasks[W];delete this.tasks[W],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(W,D)}processTask(W,D){return t(this,void 0,void 0,function*(){if(D.type===""){let Se=this.resolveRejects[W];return delete this.resolveRejects[W],Se?void(D.error?Se.reject(Ji(D.error)):Se.resolve(Ji(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(W,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let J=Ji(D.data),de=new AbortController;this.abortControllers[W]=de;try{let Se=yield this.messageHandlers[D.type](D.sourceMapId,J,de);this.completeTask(W,null,Se)}catch(Se){this.completeTask(W,Se)}})}completeTask(W,D,J){let de=[];delete this.abortControllers[W];let Se={id:W,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Ui(D):null,data:Ui(J,de)};this.target.postMessage(Se,{transfer:de})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=ce,e.H=function(){var W=new Ha(16);return Ha!=Float32Array&&(W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[11]=0,W[12]=0,W[13]=0,W[14]=0),W[0]=1,W[5]=1,W[10]=1,W[15]=1,W},e.I=Qp,e.J=function(W,D,J){var de,Se,Fe,Ve,st,bt,Dt,Qt,xr,Lr,jr,$r,ia=J[0],Ra=J[1],Va=J[2];return D===W?(W[12]=D[0]*ia+D[4]*Ra+D[8]*Va+D[12],W[13]=D[1]*ia+D[5]*Ra+D[9]*Va+D[13],W[14]=D[2]*ia+D[6]*Ra+D[10]*Va+D[14],W[15]=D[3]*ia+D[7]*Ra+D[11]*Va+D[15]):(Se=D[1],Fe=D[2],Ve=D[3],st=D[4],bt=D[5],Dt=D[6],Qt=D[7],xr=D[8],Lr=D[9],jr=D[10],$r=D[11],W[0]=de=D[0],W[1]=Se,W[2]=Fe,W[3]=Ve,W[4]=st,W[5]=bt,W[6]=Dt,W[7]=Qt,W[8]=xr,W[9]=Lr,W[10]=jr,W[11]=$r,W[12]=de*ia+st*Ra+xr*Va+D[12],W[13]=Se*ia+bt*Ra+Lr*Va+D[13],W[14]=Fe*ia+Dt*Ra+jr*Va+D[14],W[15]=Ve*ia+Qt*Ra+$r*Va+D[15]),W},e.K=function(W,D,J){var de=J[0],Se=J[1],Fe=J[2];return W[0]=D[0]*de,W[1]=D[1]*de,W[2]=D[2]*de,W[3]=D[3]*de,W[4]=D[4]*Se,W[5]=D[5]*Se,W[6]=D[6]*Se,W[7]=D[7]*Se,W[8]=D[8]*Fe,W[9]=D[9]*Fe,W[10]=D[10]*Fe,W[11]=D[11]*Fe,W[12]=D[12],W[13]=D[13],W[14]=D[14],W[15]=D[15],W},e.L=za,e.M=function(W,D){let J={};for(let de=0;de{let D=window.document.createElement("video");return D.muted=!0,new Promise(J=>{D.onloadstart=()=>{J(D)};for(let de of W){let Se=window.document.createElement("source");ee(de)||(D.crossOrigin="Anonymous"),Se.src=de,D.appendChild(Se)}})},e.a4=function(){return g++},e.a5=Kn,e.a6=dd,e.a7=Wu,e.a8=yl,e.a9=wm,e.aA=function(W){if(W.type==="custom")return new ym(W);switch(W.type){case"background":return new kx(W);case"circle":return new Oa(W);case"fill":return new Vt(W);case"fill-extrusion":return new fh(W);case"heatmap":return new wi(W);case"hillshade":return new Js(W);case"line":return new Uv(W);case"raster":return new cp(W);case"symbol":return new Gv(W)}},e.aB=u,e.aC=function(W,D){if(!W)return[{command:"setStyle",args:[D]}];let J=[];try{if(!Te(W.version,D.version))return[{command:"setStyle",args:[D]}];Te(W.center,D.center)||J.push({command:"setCenter",args:[D.center]}),Te(W.zoom,D.zoom)||J.push({command:"setZoom",args:[D.zoom]}),Te(W.bearing,D.bearing)||J.push({command:"setBearing",args:[D.bearing]}),Te(W.pitch,D.pitch)||J.push({command:"setPitch",args:[D.pitch]}),Te(W.sprite,D.sprite)||J.push({command:"setSprite",args:[D.sprite]}),Te(W.glyphs,D.glyphs)||J.push({command:"setGlyphs",args:[D.glyphs]}),Te(W.transition,D.transition)||J.push({command:"setTransition",args:[D.transition]}),Te(W.light,D.light)||J.push({command:"setLight",args:[D.light]}),Te(W.terrain,D.terrain)||J.push({command:"setTerrain",args:[D.terrain]}),Te(W.sky,D.sky)||J.push({command:"setSky",args:[D.sky]}),Te(W.projection,D.projection)||J.push({command:"setProjection",args:[D.projection]});let de={},Se=[];(function(Ve,st,bt,Dt){let Qt;for(Qt in st=st||{},Ve=Ve||{})Object.prototype.hasOwnProperty.call(Ve,Qt)&&(Object.prototype.hasOwnProperty.call(st,Qt)||qe(Qt,bt,Dt));for(Qt in st)Object.prototype.hasOwnProperty.call(st,Qt)&&(Object.prototype.hasOwnProperty.call(Ve,Qt)?Te(Ve[Qt],st[Qt])||(Ve[Qt].type==="geojson"&&st[Qt].type==="geojson"&&rt(Ve,st,Qt)?Le(bt,{command:"setGeoJSONSourceData",args:[Qt,st[Qt].data]}):et(Qt,st,bt,Dt)):Pe(Qt,st,bt))})(W.sources,D.sources,Se,de);let Fe=[];W.layers&&W.layers.forEach(Ve=>{"source"in Ve&&de[Ve.source]?J.push({command:"removeLayer",args:[Ve.id]}):Fe.push(Ve)}),J=J.concat(Se),(function(Ve,st,bt){st=st||[];let Dt=(Ve=Ve||[]).map(Ue),Qt=st.map(Ue),xr=Ve.reduce(fe,{}),Lr=st.reduce(fe,{}),jr=Dt.slice(),$r=Object.create(null),ia,Ra,Va,On,ln;for(let Rn=0,Hn=0;Rn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(J,de,Se,Fe)=>{let Ve=Se||Fe;return D[de]=!Ve||Ve.toLowerCase(),""}),D["max-age"]){let J=parseInt(D["max-age"],10);isNaN(J)?delete D["max-age"]:D["max-age"]=J}return D},e.ab=function(W,D){let J=[];for(let de in W)de in D||J.push(de);return J},e.ac=w,e.ad=function(W,D,J){var de=Math.sin(J),Se=Math.cos(J),Fe=D[0],Ve=D[1],st=D[2],bt=D[3],Dt=D[4],Qt=D[5],xr=D[6],Lr=D[7];return D!==W&&(W[8]=D[8],W[9]=D[9],W[10]=D[10],W[11]=D[11],W[12]=D[12],W[13]=D[13],W[14]=D[14],W[15]=D[15]),W[0]=Fe*Se+Dt*de,W[1]=Ve*Se+Qt*de,W[2]=st*Se+xr*de,W[3]=bt*Se+Lr*de,W[4]=Dt*Se-Fe*de,W[5]=Qt*Se-Ve*de,W[6]=xr*Se-st*de,W[7]=Lr*Se-bt*de,W},e.ae=function(W){var D=new Ha(16);return D[0]=W[0],D[1]=W[1],D[2]=W[2],D[3]=W[3],D[4]=W[4],D[5]=W[5],D[6]=W[6],D[7]=W[7],D[8]=W[8],D[9]=W[9],D[10]=W[10],D[11]=W[11],D[12]=W[12],D[13]=W[13],D[14]=W[14],D[15]=W[15],D},e.af=ri,e.ag=function(W,D){let J=0,de=0;if(W.kind==="constant")de=W.layoutSize;else if(W.kind!=="source"){let{interpolationType:Se,minZoom:Fe,maxZoom:Ve}=W,st=Se?w(Gi.interpolationFactor(Se,D,Fe,Ve),0,1):0;W.kind==="camera"?de=Si.number(W.minSize,W.maxSize,st):J=st}return{uSizeT:J,uSize:de}},e.ai=function(W,{uSize:D,uSizeT:J},{lowerSize:de,upperSize:Se}){return W.kind==="source"?de/jh:W.kind==="composite"?Si.number(de/jh,Se/jh,J):D},e.aj=dm,e.ak=function(W,D,J,de){let Se=D.y-W.y,Fe=D.x-W.x,Ve=de.y-J.y,st=de.x-J.x,bt=Ve*Fe-st*Se;if(bt===0)return null;let Dt=(st*(W.y-J.y)-Ve*(W.x-J.x))/bt;return new i(W.x+Dt*Fe,W.y+Dt*Se)},e.al=fy,e.am=Nu,e.an=nn,e.ao=function(W){let D=1/0,J=1/0,de=-1/0,Se=-1/0;for(let Fe of W)D=Math.min(D,Fe.x),J=Math.min(J,Fe.y),de=Math.max(de,Fe.x),Se=Math.max(Se,Fe.y);return[D,J,de,Se]},e.ap=Ol,e.ar=vm,e.as=function(W,D){var J=D[0],de=D[1],Se=D[2],Fe=D[3],Ve=D[4],st=D[5],bt=D[6],Dt=D[7],Qt=D[8],xr=D[9],Lr=D[10],jr=D[11],$r=D[12],ia=D[13],Ra=D[14],Va=D[15],On=J*st-de*Ve,ln=J*bt-Se*Ve,Rn=J*Dt-Fe*Ve,Hn=de*bt-Se*st,Ci=de*Dt-Fe*st,ho=Se*Dt-Fe*bt,Jo=Qt*ia-xr*$r,to=Qt*Ra-Lr*$r,Ti=Qt*Va-jr*$r,Oo=xr*Ra-Lr*ia,So=xr*Va-jr*ia,wo=Lr*Va-jr*Ra,ci=On*wo-ln*So+Rn*Oo+Hn*Ti-Ci*to+ho*Jo;return ci?(W[0]=(st*wo-bt*So+Dt*Oo)*(ci=1/ci),W[1]=(Se*So-de*wo-Fe*Oo)*ci,W[2]=(ia*ho-Ra*Ci+Va*Hn)*ci,W[3]=(Lr*Ci-xr*ho-jr*Hn)*ci,W[4]=(bt*Ti-Ve*wo-Dt*to)*ci,W[5]=(J*wo-Se*Ti+Fe*to)*ci,W[6]=(Ra*Rn-$r*ho-Va*ln)*ci,W[7]=(Qt*ho-Lr*Rn+jr*ln)*ci,W[8]=(Ve*So-st*Ti+Dt*Jo)*ci,W[9]=(de*Ti-J*So-Fe*Jo)*ci,W[10]=($r*Ci-ia*Rn+Va*On)*ci,W[11]=(xr*Rn-Qt*Ci-jr*On)*ci,W[12]=(st*to-Ve*Oo-bt*Jo)*ci,W[13]=(J*Oo-de*to+Se*Jo)*ci,W[14]=(ia*ln-$r*Hn-Ra*On)*ci,W[15]=(Qt*Hn-xr*ln+Lr*On)*ci,W):null},e.at=Sm,e.au=a0,e.av=Mm,e.aw=function(){let W={},D=re.$version;for(let J in re.$root){let de=re.$root[J];if(de.required){let Se=null;Se=J==="version"?D:de.type==="array"?[]:{},Se!=null&&(W[J]=Se)}}return W},e.ax=hi,e.ay=G,e.az=function(W){W=W.slice();let D=Object.create(null);for(let J=0;J25||de<0||de>=1||J<0||J>=1)},e.bc=function(W,D){return W[0]=D[0],W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=D[1],W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=D[2],W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},e.bd=class extends Zt{},e.be=xm,e.bf=Fx,e.bh=ve,e.bi=function(W,D){$.REGISTERED_PROTOCOLS[W]=D},e.bj=function(W){delete $.REGISTERED_PROTOCOLS[W]},e.bk=function(W,D){let J={};for(let Se=0;Sewo*Ol)}let to=Ve?"center":J.get("text-justify").evaluate(Dt,{},W.canonical),Ti=J.get("symbol-placement")==="point"?J.get("text-max-width").evaluate(Dt,{},W.canonical)*Ol:1/0,Oo=()=>{W.bucket.allowVerticalPlacement&&ao(Rn)&&($r.vertical=np(ia,W.glyphMap,W.glyphPositions,W.imagePositions,Qt,Ti,Fe,ho,"left",Ci,Va,e.ah.vertical,!0,Lr,xr))};if(!Ve&&Jo){let So=new Set;if(to==="auto")for(let ci=0;cit(void 0,void 0,void 0,function*(){if(W.byteLength===0)return createImageBitmap(new ImageData(1,1));let D=new Blob([new Uint8Array(W)],{type:"image/png"});try{return createImageBitmap(D)}catch(J){throw new Error(`Could not load image because of ${J.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=W=>new Promise((D,J)=>{let de=new Image;de.onload=()=>{D(de),URL.revokeObjectURL(de.src),de.onload=null,window.requestAnimationFrame(()=>{de.src=N})},de.onerror=()=>J(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Se=new Blob([new Uint8Array(W)],{type:"image/png"});de.src=W.byteLength?URL.createObjectURL(Se):N}),e.g=le,e.h=(W,D)=>Y(M(W,{type:"json"}),D),e.i=L,e.j=j,e.k=ae,e.l=(W,D)=>Y(M(W,{type:"arrayBuffer"}),D),e.m=Y,e.n=function(W){return new cm(W).readFields(y5,[])},e.o=bi,e.p=hm,e.q=De,e.r=xn,e.s=ee,e.t=wn,e.u=$a,e.v=re,e.w=m,e.x=function([W,D,J]){return D+=90,D*=Math.PI/180,J*=Math.PI/180,{x:W*Math.cos(D)*Math.sin(J),y:W*Math.sin(D)*Math.sin(J),z:W*Math.cos(J)}},e.y=Si,e.z=ds}),S("worker",["./shared"],function(e){"use strict";class t{constructor(ze){this.keyCache={},ze&&this.replace(ze)}replace(ze){this._layerConfigs={},this._layers={},this.update(ze,[])}update(ze,Ze){for(let ke of ze){this._layerConfigs[ke.id]=ke;let Be=this._layers[ke.id]=e.aA(ke);Be._featureFilter=e.a7(Be.filter),this.keyCache[ke.id]&&delete this.keyCache[ke.id]}for(let ke of Ze)delete this.keyCache[ke],delete this._layerConfigs[ke],delete this._layers[ke];this.familiesBySource={};let we=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let ke of we){let Be=ke.map(Et=>this._layers[Et.id]),He=Be[0];if(He.visibility==="none")continue;let nt=He.source||"",ot=this.familiesBySource[nt];ot||(ot=this.familiesBySource[nt]={});let Ft=He.sourceLayer||"_geojsonTileLayer",Mt=ot[Ft];Mt||(Mt=ot[Ft]=[]),Mt.push(Be)}}}class r{constructor(ze){let Ze={},we=[];for(let nt in ze){let ot=ze[nt],Ft=Ze[nt]={};for(let Mt in ot){let Et=ot[+Mt];if(!Et||Et.bitmap.width===0||Et.bitmap.height===0)continue;let Ot={x:0,y:0,w:Et.bitmap.width+2,h:Et.bitmap.height+2};we.push(Ot),Ft[Mt]={rect:Ot,metrics:Et.metrics}}}let{w:ke,h:Be}=e.p(we),He=new e.o({width:ke||1,height:Be||1});for(let nt in ze){let ot=ze[nt];for(let Ft in ot){let Mt=ot[+Ft];if(!Mt||Mt.bitmap.width===0||Mt.bitmap.height===0)continue;let Et=Ze[nt][Ft].rect;e.o.copy(Mt.bitmap,He,{x:0,y:0},{x:Et.x+1,y:Et.y+1},Mt.bitmap)}}this.image=He,this.positions=Ze}}e.bl("GlyphAtlas",r);class o{constructor(ze){this.tileID=new e.S(ze.tileID.overscaledZ,ze.tileID.wrap,ze.tileID.canonical.z,ze.tileID.canonical.x,ze.tileID.canonical.y),this.uid=ze.uid,this.zoom=ze.zoom,this.pixelRatio=ze.pixelRatio,this.tileSize=ze.tileSize,this.source=ze.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ze.showCollisionBoxes,this.collectResourceTiming=!!ze.collectResourceTiming,this.returnDependencies=!!ze.returnDependencies,this.promoteId=ze.promoteId,this.inFlightDependencies=[]}parse(ze,Ze,we,ke){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=ze,this.collisionBoxArray=new e.a5;let Be=new e.bm(Object.keys(ze.layers).sort()),He=new e.bn(this.tileID,this.promoteId);He.bucketLayerIDs=[];let nt={},ot={featureIndex:He,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:we},Ft=Ze.familiesBySource[this.source];for(let Ba in Ft){let ba=ze.layers[Ba];if(!ba)continue;ba.version===1&&e.w(`Vector tile source "${this.source}" layer "${Ba}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let rn=Be.encode(Ba),vn=[];for(let Wt=0;Wt=Lt.maxzoom||Lt.visibility!=="none"&&(a(Wt,this.zoom,we),(nt[Lt.id]=Lt.createBucket({index:He.bucketLayerIDs.length,layers:Wt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:rn,sourceID:this.source})).populate(vn,ot,this.tileID.canonical),He.bucketLayerIDs.push(Wt.map(Ht=>Ht.id)))}}let Mt=e.aF(ot.glyphDependencies,Ba=>Object.keys(Ba).map(Number));this.inFlightDependencies.forEach(Ba=>Ba?.abort()),this.inFlightDependencies=[];let Et=Promise.resolve({});if(Object.keys(Mt).length){let Ba=new AbortController;this.inFlightDependencies.push(Ba),Et=ke.sendAsync({type:"GG",data:{stacks:Mt,source:this.source,tileID:this.tileID,type:"glyphs"}},Ba)}let Ot=Object.keys(ot.iconDependencies),sr=Promise.resolve({});if(Ot.length){let Ba=new AbortController;this.inFlightDependencies.push(Ba),sr=ke.sendAsync({type:"GI",data:{icons:Ot,source:this.source,tileID:this.tileID,type:"icons"}},Ba)}let ir=Object.keys(ot.patternDependencies),ar=Promise.resolve({});if(ir.length){let Ba=new AbortController;this.inFlightDependencies.push(Ba),ar=ke.sendAsync({type:"GI",data:{icons:ir,source:this.source,tileID:this.tileID,type:"patterns"}},Ba)}let[Mr,ma,Ca]=yield Promise.all([Et,sr,ar]),Aa=new r(Mr),Da=new e.bo(ma,Ca);for(let Ba in nt){let ba=nt[Ba];ba instanceof e.a6?(a(ba.layers,this.zoom,we),e.bp({bucket:ba,glyphMap:Mr,glyphPositions:Aa.positions,imageMap:ma,imagePositions:Da.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ba.hasPattern&&(ba instanceof e.bq||ba instanceof e.br||ba instanceof e.bs)&&(a(ba.layers,this.zoom,we),ba.addFeatures(ot,this.tileID.canonical,Da.patternPositions))}return this.status="done",{buckets:Object.values(nt).filter(Ba=>!Ba.isEmpty()),featureIndex:He,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Aa.image,imageAtlas:Da,glyphMap:this.returnDependencies?Mr:null,iconMap:this.returnDependencies?ma:null,glyphPositions:this.returnDependencies?Aa.positions:null}})}}function a(mt,ze,Ze){let we=new e.z(ze);for(let ke of mt)ke.recalculate(we,Ze)}class i{constructor(ze,Ze,we){this.actor=ze,this.layerIndex=Ze,this.availableImages=we,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(ze,Ze){return e._(this,void 0,void 0,function*(){let we=yield e.l(ze.request,Ze);try{return{vectorTile:new e.bt.VectorTile(new e.bu(we.data)),rawData:we.data,cacheControl:we.cacheControl,expires:we.expires}}catch(ke){let Be=new Uint8Array(we.data),He=`Unable to parse the tile at ${ze.request.url}, `;throw He+=Be[0]===31&&Be[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ke.message}`,new Error(He)}})}loadTile(ze){return e._(this,void 0,void 0,function*(){let Ze=ze.uid,we=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new e.bv(ze.request),ke=new o(ze);this.loading[Ze]=ke;let Be=new AbortController;ke.abort=Be;try{let He=yield this.loadVectorTile(ze,Be);if(delete this.loading[Ze],!He)return null;let nt=He.rawData,ot={};He.expires&&(ot.expires=He.expires),He.cacheControl&&(ot.cacheControl=He.cacheControl);let Ft={};if(we){let Et=we.finish();Et&&(Ft.resourceTiming=JSON.parse(JSON.stringify(Et)))}ke.vectorTile=He.vectorTile;let Mt=ke.parse(He.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ze]=ke,this.fetching[Ze]={rawTileData:nt,cacheControl:ot,resourceTiming:Ft};try{let Et=yield Mt;return e.e({rawTileData:nt.slice(0)},Et,ot,Ft)}finally{delete this.fetching[Ze]}}catch(He){throw delete this.loading[Ze],ke.status="done",this.loaded[Ze]=ke,He}})}reloadTile(ze){return e._(this,void 0,void 0,function*(){let Ze=ze.uid;if(!this.loaded||!this.loaded[Ze])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let we=this.loaded[Ze];if(we.showCollisionBoxes=ze.showCollisionBoxes,we.status==="parsing"){let ke=yield we.parse(we.vectorTile,this.layerIndex,this.availableImages,this.actor),Be;if(this.fetching[Ze]){let{rawTileData:He,cacheControl:nt,resourceTiming:ot}=this.fetching[Ze];delete this.fetching[Ze],Be=e.e({rawTileData:He.slice(0)},ke,nt,ot)}else Be=ke;return Be}if(we.status==="done"&&we.vectorTile)return we.parse(we.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(ze){return e._(this,void 0,void 0,function*(){let Ze=this.loading,we=ze.uid;Ze&&Ze[we]&&Ze[we].abort&&(Ze[we].abort.abort(),delete Ze[we])})}removeTile(ze){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[ze.uid]&&delete this.loaded[ze.uid]})}}class n{constructor(){this.loaded={}}loadTile(ze){return e._(this,void 0,void 0,function*(){let{uid:Ze,encoding:we,rawImageData:ke,redFactor:Be,greenFactor:He,blueFactor:nt,baseShift:ot}=ze,Ft=ke.width+2,Mt=ke.height+2,Et=e.b(ke)?new e.R({width:Ft,height:Mt},yield e.bw(ke,-1,-1,Ft,Mt)):ke,Ot=new e.bx(Ze,Et,we,Be,He,nt,ot);return this.loaded=this.loaded||{},this.loaded[Ze]=Ot,Ot})}removeTile(ze){let Ze=this.loaded,we=ze.uid;Ze&&Ze[we]&&delete Ze[we]}}function s(mt,ze){if(mt.length!==0){h(mt[0],ze);for(var Ze=1;Ze=Math.abs(nt)?Ze-ot+nt:nt-ot+Ze,Ze=ot}Ze+we>=0!=!!ze&&mt.reverse()}var f=e.by(function mt(ze,Ze){var we,ke=ze&&ze.type;if(ke==="FeatureCollection")for(we=0;we>31}function L(mt,ze){for(var Ze=mt.loadGeometry(),we=mt.type,ke=0,Be=0,He=Ze.length,nt=0;ntmt},O=Math.fround||(P=new Float32Array(1),mt=>(P[0]=+mt,P[0]));var P;let U=3,B=5,X=6;class ${constructor(ze){this.options=Object.assign(Object.create(N),ze),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ze){let{log:Ze,minZoom:we,maxZoom:ke}=this.options;Ze&&console.time("total time");let Be=`prepare ${ze.length} points`;Ze&&console.time(Be),this.points=ze;let He=[];for(let ot=0;ot=we;ot--){let Ft=+Date.now();nt=this.trees[ot]=this._createTree(this._cluster(nt,ot)),Ze&&console.log("z%d: %d clusters in %dms",ot,nt.numItems,+Date.now()-Ft)}return Ze&&console.timeEnd("total time"),this}getClusters(ze,Ze){let we=((ze[0]+180)%360+360)%360-180,ke=Math.max(-90,Math.min(90,ze[1])),Be=ze[2]===180?180:((ze[2]+180)%360+360)%360-180,He=Math.max(-90,Math.min(90,ze[3]));if(ze[2]-ze[0]>=360)we=-180,Be=180;else if(we>Be){let Et=this.getClusters([we,ke,180,He],Ze),Ot=this.getClusters([-180,ke,Be,He],Ze);return Et.concat(Ot)}let nt=this.trees[this._limitZoom(Ze)],ot=nt.range(ve(we),G(He),ve(Be),G(ke)),Ft=nt.data,Mt=[];for(let Et of ot){let Ot=this.stride*Et;Mt.push(Ft[Ot+B]>1?le(Ft,Ot,this.clusterProps):this.points[Ft[Ot+U]])}return Mt}getChildren(ze){let Ze=this._getOriginId(ze),we=this._getOriginZoom(ze),ke="No cluster with the specified id.",Be=this.trees[we];if(!Be)throw new Error(ke);let He=Be.data;if(Ze*this.stride>=He.length)throw new Error(ke);let nt=this.options.radius/(this.options.extent*Math.pow(2,we-1)),ot=Be.within(He[Ze*this.stride],He[Ze*this.stride+1],nt),Ft=[];for(let Mt of ot){let Et=Mt*this.stride;He[Et+4]===ze&&Ft.push(He[Et+B]>1?le(He,Et,this.clusterProps):this.points[He[Et+U]])}if(Ft.length===0)throw new Error(ke);return Ft}getLeaves(ze,Ze,we){let ke=[];return this._appendLeaves(ke,ze,Ze=Ze||10,we=we||0,0),ke}getTile(ze,Ze,we){let ke=this.trees[this._limitZoom(ze)],Be=Math.pow(2,ze),{extent:He,radius:nt}=this.options,ot=nt/He,Ft=(we-ot)/Be,Mt=(we+1+ot)/Be,Et={features:[]};return this._addTileFeatures(ke.range((Ze-ot)/Be,Ft,(Ze+1+ot)/Be,Mt),ke.data,Ze,we,Be,Et),Ze===0&&this._addTileFeatures(ke.range(1-ot/Be,Ft,1,Mt),ke.data,Be,we,Be,Et),Ze===Be-1&&this._addTileFeatures(ke.range(0,Ft,ot/Be,Mt),ke.data,-1,we,Be,Et),Et.features.length?Et:null}getClusterExpansionZoom(ze){let Ze=this._getOriginZoom(ze)-1;for(;Ze<=this.options.maxZoom;){let we=this.getChildren(ze);if(Ze++,we.length!==1)break;ze=we[0].properties.cluster_id}return Ze}_appendLeaves(ze,Ze,we,ke,Be){let He=this.getChildren(Ze);for(let nt of He){let ot=nt.properties;if(ot&&ot.cluster?Be+ot.point_count<=ke?Be+=ot.point_count:Be=this._appendLeaves(ze,ot.cluster_id,we,ke,Be):Be1,Mt,Et,Ot;if(Ft)Mt=ce(Ze,ot,this.clusterProps),Et=Ze[ot],Ot=Ze[ot+1];else{let ar=this.points[Ze[ot+U]];Mt=ar.properties;let[Mr,ma]=ar.geometry.coordinates;Et=ve(Mr),Ot=G(ma)}let sr={type:1,geometry:[[Math.round(this.options.extent*(Et*Be-we)),Math.round(this.options.extent*(Ot*Be-ke))]],tags:Mt},ir;ir=Ft||this.options.generateId?Ze[ot+U]:this.points[Ze[ot+U]].id,ir!==void 0&&(sr.id=ir),He.features.push(sr)}}_limitZoom(ze){return Math.max(this.options.minZoom,Math.min(Math.floor(+ze),this.options.maxZoom+1))}_cluster(ze,Ze){let{radius:we,extent:ke,reduce:Be,minPoints:He}=this.options,nt=we/(ke*Math.pow(2,Ze)),ot=ze.data,Ft=[],Mt=this.stride;for(let Et=0;EtZe&&(Mr+=ot[Ca+B])}if(Mr>ar&&Mr>=He){let ma,Ca=Ot*ar,Aa=sr*ar,Da=-1,Ba=((Et/Mt|0)<<5)+(Ze+1)+this.points.length;for(let ba of ir){let rn=ba*Mt;if(ot[rn+2]<=Ze)continue;ot[rn+2]=Ze;let vn=ot[rn+B];Ca+=ot[rn]*vn,Aa+=ot[rn+1]*vn,ot[rn+4]=Ba,Be&&(ma||(ma=this._map(ot,Et,!0),Da=this.clusterProps.length,this.clusterProps.push(ma)),Be(ma,this._map(ot,rn)))}ot[Et+4]=Ba,Ft.push(Ca/Mr,Aa/Mr,1/0,Ba,-1,Mr),Be&&Ft.push(Da)}else{for(let ma=0;ma1)for(let ma of ir){let Ca=ma*Mt;if(!(ot[Ca+2]<=Ze)){ot[Ca+2]=Ze;for(let Aa=0;Aa>5}_getOriginZoom(ze){return(ze-this.points.length)%32}_map(ze,Ze,we){if(ze[Ze+B]>1){let He=this.clusterProps[ze[Ze+X]];return we?Object.assign({},He):He}let ke=this.points[ze[Ze+U]].properties,Be=this.options.map(ke);return we&&Be===ke?Object.assign({},Be):Be}}function le(mt,ze,Ze){return{type:"Feature",id:mt[ze+U],properties:ce(mt,ze,Ze),geometry:{type:"Point",coordinates:[(we=mt[ze],360*(we-.5)),Y(mt[ze+1])]}};var we}function ce(mt,ze,Ze){let we=mt[ze+B],ke=we>=1e4?`${Math.round(we/1e3)}k`:we>=1e3?Math.round(we/100)/10+"k":we,Be=mt[ze+X],He=Be===-1?{}:Object.assign({},Ze[Be]);return Object.assign(He,{cluster:!0,cluster_id:mt[ze+U],point_count:we,point_count_abbreviated:ke})}function ve(mt){return mt/360+.5}function G(mt){let ze=Math.sin(mt*Math.PI/180),Ze=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return Ze<0?0:Ze>1?1:Ze}function Y(mt){let ze=(180-360*mt)*Math.PI/180;return 360*Math.atan(Math.exp(ze))/Math.PI-90}function ee(mt,ze,Ze,we){let ke=we,Be=ze+(Ze-ze>>1),He,nt=Ze-ze,ot=mt[ze],Ft=mt[ze+1],Mt=mt[Ze],Et=mt[Ze+1];for(let Ot=ze+3;Otke)He=Ot,ke=sr;else if(sr===ke){let ir=Math.abs(Ot-Be);irwe&&(He-ze>3&&ee(mt,ze,He,we),mt[He+2]=ke,Ze-He>3&&ee(mt,He,Ze,we))}function V(mt,ze,Ze,we,ke,Be){let He=ke-Ze,nt=Be-we;if(He!==0||nt!==0){let ot=((mt-Ze)*He+(ze-we)*nt)/(He*He+nt*nt);ot>1?(Ze=ke,we=Be):ot>0&&(Ze+=He*ot,we+=nt*ot)}return He=mt-Ze,nt=ze-we,He*He+nt*nt}function se(mt,ze,Ze,we){let ke={id:mt??null,type:ze,geometry:Ze,tags:we,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(ze==="Point"||ze==="MultiPoint"||ze==="LineString")ae(ke,Ze);else if(ze==="Polygon")ae(ke,Ze[0]);else if(ze==="MultiLineString")for(let Be of Ze)ae(ke,Be);else if(ze==="MultiPolygon")for(let Be of Ze)ae(ke,Be[0]);return ke}function ae(mt,ze){for(let Ze=0;Ze0&&(He+=we?(ke*Mt-Ft*Be)/2:Math.sqrt(Math.pow(Ft-ke,2)+Math.pow(Mt-Be,2))),ke=Ft,Be=Mt}let nt=ze.length-3;ze[2]=1,ee(ze,0,nt,Ze),ze[nt+2]=1,ze.size=Math.abs(He),ze.start=0,ze.end=ze.size}function he(mt,ze,Ze,we){for(let ke=0;ke1?1:Ze}function Le(mt,ze,Ze,we,ke,Be,He,nt){if(we/=ze,Be>=(Ze/=ze)&&He=we)return null;let ot=[];for(let Ft of mt){let Mt=Ft.geometry,Et=Ft.type,Ot=ke===0?Ft.minX:Ft.minY,sr=ke===0?Ft.maxX:Ft.maxY;if(Ot>=Ze&&sr=we)continue;let ir=[];if(Et==="Point"||Et==="MultiPoint")Pe(Mt,ir,Ze,we,ke);else if(Et==="LineString")qe(Mt,ir,Ze,we,ke,!1,nt.lineMetrics);else if(Et==="MultiLineString")rt(Mt,ir,Ze,we,ke,!1);else if(Et==="Polygon")rt(Mt,ir,Ze,we,ke,!0);else if(Et==="MultiPolygon")for(let ar of Mt){let Mr=[];rt(ar,Mr,Ze,we,ke,!0),Mr.length&&ir.push(Mr)}if(ir.length){if(nt.lineMetrics&&Et==="LineString"){for(let ar of ir)ot.push(se(Ft.id,Et,ar,Ft.tags));continue}Et!=="LineString"&&Et!=="MultiLineString"||(ir.length===1?(Et="LineString",ir=ir[0]):Et="MultiLineString"),Et!=="Point"&&Et!=="MultiPoint"||(Et=ir.length===3?"Point":"MultiPoint"),ot.push(se(Ft.id,Et,ir,Ft.tags))}}return ot.length?ot:null}function Pe(mt,ze,Ze,we,ke){for(let Be=0;Be=Ze&&He<=we&&$e(ze,mt[Be],mt[Be+1],mt[Be+2])}}function qe(mt,ze,Ze,we,ke,Be,He){let nt=et(mt),ot=ke===0?Ue:fe,Ft,Mt,Et=mt.start;for(let Mr=0;MrZe&&(Mt=ot(nt,ma,Ca,Da,Ba,Ze),He&&(nt.start=Et+Ft*Mt)):ba>we?rn=Ze&&(Mt=ot(nt,ma,Ca,Da,Ba,Ze),vn=!0),rn>we&&ba<=we&&(Mt=ot(nt,ma,Ca,Da,Ba,we),vn=!0),!Be&&vn&&(He&&(nt.end=Et+Ft*Mt),ze.push(nt),nt=et(mt)),He&&(Et+=Ft)}let Ot=mt.length-3,sr=mt[Ot],ir=mt[Ot+1],ar=ke===0?sr:ir;ar>=Ze&&ar<=we&&$e(nt,sr,ir,mt[Ot+2]),Ot=nt.length-3,Be&&Ot>=3&&(nt[Ot]!==nt[0]||nt[Ot+1]!==nt[1])&&$e(nt,nt[0],nt[1],nt[2]),nt.length&&ze.push(nt)}function et(mt){let ze=[];return ze.size=mt.size,ze.start=mt.start,ze.end=mt.end,ze}function rt(mt,ze,Ze,we,ke,Be){for(let He of mt)qe(He,ze,Ze,we,ke,Be,!1)}function $e(mt,ze,Ze,we){mt.push(ze,Ze,we)}function Ue(mt,ze,Ze,we,ke,Be){let He=(Be-ze)/(we-ze);return $e(mt,Be,Ze+(ke-Ze)*He,1),He}function fe(mt,ze,Ze,we,ke,Be){let He=(Be-Ze)/(ke-Ze);return $e(mt,ze+(we-ze)*He,Be,1),He}function ue(mt,ze){let Ze=[];for(let we=0;we0&&ze.size<(ke?He:we))return void(Ze.numPoints+=ze.length/3);let nt=[];for(let ot=0;otHe)&&(Ze.numSimplified++,nt.push(ze[ot],ze[ot+1])),Ze.numPoints++;ke&&(function(ot,Ft){let Mt=0;for(let Et=0,Ot=ot.length,sr=Ot-2;Et0===Ft)for(let Et=0,Ot=ot.length;Et24)throw new Error("maxZoom should be in the 0-24 range");if(Ze.promoteId&&Ze.generateId)throw new Error("promoteId and generateId cannot be used together.");let ke=(function(Be,He){let nt=[];if(Be.type==="FeatureCollection")for(let ot=0;ot1&&console.time("creation"),sr=this.tiles[Ot]=Qe(ze,Ze,we,ke,Ft),this.tileCoords.push({z:Ze,x:we,y:ke}),Mt)){Mt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ze,we,ke,sr.numFeatures,sr.numPoints,sr.numSimplified),console.timeEnd("creation"));let vn=`z${Ze}`;this.stats[vn]=(this.stats[vn]||0)+1,this.total++}if(sr.source=ze,Be==null){if(Ze===Ft.indexMaxZoom||sr.numPoints<=Ft.indexMaxPoints)continue}else{if(Ze===Ft.maxZoom||Ze===Be)continue;if(Be!=null){let vn=Be-Ze;if(we!==He>>vn||ke!==nt>>vn)continue}}if(sr.source=null,ze.length===0)continue;Mt>1&&console.time("clipping");let ir=.5*Ft.buffer/Ft.extent,ar=.5-ir,Mr=.5+ir,ma=1+ir,Ca=null,Aa=null,Da=null,Ba=null,ba=Le(ze,Et,we-ir,we+Mr,0,sr.minX,sr.maxX,Ft),rn=Le(ze,Et,we+ar,we+ma,0,sr.minX,sr.maxX,Ft);ze=null,ba&&(Ca=Le(ba,Et,ke-ir,ke+Mr,1,sr.minY,sr.maxY,Ft),Aa=Le(ba,Et,ke+ar,ke+ma,1,sr.minY,sr.maxY,Ft),ba=null),rn&&(Da=Le(rn,Et,ke-ir,ke+Mr,1,sr.minY,sr.maxY,Ft),Ba=Le(rn,Et,ke+ar,ke+ma,1,sr.minY,sr.maxY,Ft),rn=null),Mt>1&&console.timeEnd("clipping"),ot.push(Ca||[],Ze+1,2*we,2*ke),ot.push(Aa||[],Ze+1,2*we,2*ke+1),ot.push(Da||[],Ze+1,2*we+1,2*ke),ot.push(Ba||[],Ze+1,2*we+1,2*ke+1)}}getTile(ze,Ze,we){ze=+ze,Ze=+Ze,we=+we;let ke=this.options,{extent:Be,debug:He}=ke;if(ze<0||ze>24)return null;let nt=1<1&&console.log("drilling down to z%d-%d-%d",ze,Ze,we);let Ft,Mt=ze,Et=Ze,Ot=we;for(;!Ft&&Mt>0;)Mt--,Et>>=1,Ot>>=1,Ft=this.tiles[Ut(Mt,Et,Ot)];return Ft&&Ft.source?(He>1&&(console.log("found parent tile z%d-%d-%d",Mt,Et,Ot),console.time("drilling down")),this.splitTile(Ft.source,Mt,Et,Ot,ze,Ze,we),He>1&&console.timeEnd("drilling down"),this.tiles[ot]?Ee(this.tiles[ot],Be):null):null}}function Ut(mt,ze,Ze){return 32*((1<{Et.properties=sr;let ir={};for(let ar of Ot)ir[ar]=ot[ar].evaluate(Mt,Et);return ir},He.reduce=(sr,ir)=>{Et.properties=ir;for(let ar of Ot)Mt.accumulated=sr[ar],sr[ar]=Ft[ar].evaluate(Mt,Et)},He})(ze)).load((yield this._pendingData).features):(ke=yield this._pendingData,new zt(ke,ze.geojsonVtOptions)),this.loaded={};let Be={};if(we){let He=we.finish();He&&(Be.resourceTiming={},Be.resourceTiming[ze.source]=JSON.parse(JSON.stringify(He)))}return Be}catch(Be){if(delete this._pendingRequest,e.bB(Be))return{abandoned:!0};throw Be}var ke})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(ze){let Ze=this.loaded;return Ze&&Ze[ze.uid]?super.reloadTile(ze):this.loadTile(ze)}loadAndProcessGeoJSON(ze,Ze){return e._(this,void 0,void 0,function*(){let we=yield this.loadGeoJSON(ze,Ze);if(delete this._pendingRequest,typeof we!="object")throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(f(we,!0),ze.filter){let ke=e.bC(ze.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ke.result==="error")throw new Error(ke.value.map(He=>`${He.key}: ${He.message}`).join(", "));we={type:"FeatureCollection",features:we.features.filter(He=>ke.value.evaluate({zoom:0},He))}}return we})}loadGeoJSON(ze,Ze){return e._(this,void 0,void 0,function*(){let{promoteId:we}=ze;if(ze.request){let ke=yield e.h(ze.request,Ze);return this._dataUpdateable=hr(ke.data,we)?Or(ke.data,we):void 0,ke.data}if(typeof ze.data=="string")try{let ke=JSON.parse(ze.data);return this._dataUpdateable=hr(ke,we)?Or(ke,we):void 0,ke}catch{throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`)}if(!ze.dataDiff)throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${ze.source}`);return(function(ke,Be,He){var nt,ot,Ft,Mt;if(Be.removeAll&&ke.clear(),Be.remove)for(let Et of Be.remove)ke.delete(Et);if(Be.add)for(let Et of Be.add){let Ot=br(Et,He);Ot!=null&&ke.set(Ot,Et)}if(Be.update)for(let Et of Be.update){let Ot=ke.get(Et.id);if(Ot==null)continue;let sr=!Et.removeAllProperties&&(((nt=Et.removeProperties)===null||nt===void 0?void 0:nt.length)>0||((ot=Et.addOrUpdateProperties)===null||ot===void 0?void 0:ot.length)>0);if((Et.newGeometry||Et.removeAllProperties||sr)&&(Ot=Object.assign({},Ot),ke.set(Et.id,Ot),sr&&(Ot.properties=Object.assign({},Ot.properties))),Et.newGeometry&&(Ot.geometry=Et.newGeometry),Et.removeAllProperties)Ot.properties={};else if(((Ft=Et.removeProperties)===null||Ft===void 0?void 0:Ft.length)>0)for(let ir of Et.removeProperties)Object.prototype.hasOwnProperty.call(Ot.properties,ir)&&delete Ot.properties[ir];if(((Mt=Et.addOrUpdateProperties)===null||Mt===void 0?void 0:Mt.length)>0)for(let{key:ir,value:ar}of Et.addOrUpdateProperties)Ot.properties[ir]=ar}})(this._dataUpdateable,ze.dataDiff,we),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(ze){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(ze){return this._geoJSONIndex.getClusterExpansionZoom(ze.clusterId)}getClusterChildren(ze){return this._geoJSONIndex.getChildren(ze.clusterId)}getClusterLeaves(ze){return this._geoJSONIndex.getLeaves(ze.clusterId,ze.limit,ze.offset)}}class Er{constructor(ze){this.self=ze,this.actor=new e.F(ze),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Ze,we)=>{if(this.externalWorkerSourceTypes[Ze])throw new Error(`Worker source with name "${Ze}" already registered.`);this.externalWorkerSourceTypes[Ze]=we},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Ze=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Ze)},this.actor.registerMessageHandler("LDT",(Ze,we)=>this._getDEMWorkerSource(Ze,we.source).loadTile(we)),this.actor.registerMessageHandler("RDT",(Ze,we)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Ze,we.source).removeTile(we)})),this.actor.registerMessageHandler("GCEZ",(Ze,we)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ze,we.type,we.source).getClusterExpansionZoom(we)})),this.actor.registerMessageHandler("GCC",(Ze,we)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ze,we.type,we.source).getClusterChildren(we)})),this.actor.registerMessageHandler("GCL",(Ze,we)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ze,we.type,we.source).getClusterLeaves(we)})),this.actor.registerMessageHandler("LD",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).loadData(we)),this.actor.registerMessageHandler("GD",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).getData()),this.actor.registerMessageHandler("LT",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).loadTile(we)),this.actor.registerMessageHandler("RT",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).reloadTile(we)),this.actor.registerMessageHandler("AT",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).abortTile(we)),this.actor.registerMessageHandler("RMT",(Ze,we)=>this._getWorkerSource(Ze,we.type,we.source).removeTile(we)),this.actor.registerMessageHandler("RS",(Ze,we)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Ze]||!this.workerSources[Ze][we.type]||!this.workerSources[Ze][we.type][we.source])return;let ke=this.workerSources[Ze][we.type][we.source];delete this.workerSources[Ze][we.type][we.source],ke.removeSource!==void 0&&ke.removeSource(we)})),this.actor.registerMessageHandler("RM",Ze=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Ze],delete this.availableImages[Ze],delete this.workerSources[Ze],delete this.demWorkerSources[Ze]})),this.actor.registerMessageHandler("SR",(Ze,we)=>e._(this,void 0,void 0,function*(){this.referrer=we})),this.actor.registerMessageHandler("SRPS",(Ze,we)=>this._syncRTLPluginState(Ze,we)),this.actor.registerMessageHandler("IS",(Ze,we)=>e._(this,void 0,void 0,function*(){this.self.importScripts(we)})),this.actor.registerMessageHandler("SI",(Ze,we)=>this._setImages(Ze,we)),this.actor.registerMessageHandler("UL",(Ze,we)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ze).update(we.layers,we.removedIds)})),this.actor.registerMessageHandler("SL",(Ze,we)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ze).replace(we)}))}_setImages(ze,Ze){return e._(this,void 0,void 0,function*(){this.availableImages[ze]=Ze;for(let we in this.workerSources[ze]){let ke=this.workerSources[ze][we];for(let Be in ke)ke[Be].availableImages=Ze}})}_syncRTLPluginState(ze,Ze){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Ze.pluginStatus!=="loading")return e.bD.setState(Ze),Ze;let we=Ze.pluginURL;if(this.self.importScripts(we),e.bD.isParsed()){let ke={pluginStatus:"loaded",pluginURL:we};return e.bD.setState(ke),ke}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${we}`)})}_getAvailableImages(ze){let Ze=this.availableImages[ze];return Ze||(Ze=[]),Ze}_getLayerIndex(ze){let Ze=this.layerIndexes[ze];return Ze||(Ze=this.layerIndexes[ze]=new t),Ze}_getWorkerSource(ze,Ze,we){if(this.workerSources[ze]||(this.workerSources[ze]={}),this.workerSources[ze][Ze]||(this.workerSources[ze][Ze]={}),!this.workerSources[ze][Ze][we]){let ke={sendAsync:(Be,He)=>(Be.targetMapId=ze,this.actor.sendAsync(Be,He))};switch(Ze){case"vector":this.workerSources[ze][Ze][we]=new i(ke,this._getLayerIndex(ze),this._getAvailableImages(ze));break;case"geojson":this.workerSources[ze][Ze][we]=new wr(ke,this._getLayerIndex(ze),this._getAvailableImages(ze));break;default:this.workerSources[ze][Ze][we]=new this.externalWorkerSourceTypes[Ze](ke,this._getLayerIndex(ze),this._getAvailableImages(ze))}}return this.workerSources[ze][Ze][we]}_getDEMWorkerSource(ze,Ze){return this.demWorkerSources[ze]||(this.demWorkerSources[ze]={}),this.demWorkerSources[ze][Ze]||(this.demWorkerSources[ze][Ze]=new n),this.demWorkerSources[ze][Ze]}}return e.i(self)&&(self.worker=new Er(self)),Er}),S("index",["exports","./shared"],function(e,t){"use strict";var r="4.7.1";let o,a,i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:De=>new Promise((I,ne)=>{let be=requestAnimationFrame(I);De.signal.addEventListener("abort",()=>{cancelAnimationFrame(be),ne(t.c())})}),getImageData(De,I=0){return this.getImageCanvasContext(De).getImageData(-I,-I,De.width+2*I,De.height+2*I)},getImageCanvasContext(De){let I=window.document.createElement("canvas"),ne=I.getContext("2d",{willReadFrequently:!0});if(!ne)throw new Error("failed to create canvas 2d context");return I.width=De.width,I.height=De.height,ne.drawImage(De,0,0,De.width,De.height),ne},resolveURL:De=>(o||(o=document.createElement("a")),o.href=De,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(I){if(!n.docStyle)return I[0];for(let ne=0;ne{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(I){let ne=I.getBoundingClientRect();return{x:ne.width/I.offsetWidth||1,y:ne.height/I.offsetHeight||1,boundingClientRect:ne}}static getPoint(I,ne,be){let Ae=ne.boundingClientRect;return new t.P((be.clientX-Ae.left)/ne.x-I.clientLeft,(be.clientY-Ae.top)/ne.y-I.clientTop)}static mousePos(I,ne){let be=n.getScale(I);return n.getPoint(I,be,ne)}static touchPos(I,ne){let be=[],Ae=n.getScale(I);for(let Re=0;Re{h&&T(h),h=null,c=!0},f.onerror=()=>{p=!0,h=null},f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(De){let I,ne,be,Ae;De.resetRequestQueue=()=>{I=[],ne=0,be=0,Ae={}},De.addThrottleControl=Rt=>{let Zt=be++;return Ae[Zt]=Rt,Zt},De.removeThrottleControl=Rt=>{delete Ae[Rt],ut()},De.getImage=(Rt,Zt,yr=!0)=>new Promise((_r,Gr)=>{s.supported&&(Rt.headers||(Rt.headers={}),Rt.headers.accept="image/webp,*/*"),t.e(Rt,{type:"image"}),I.push({abortController:Zt,requestParameters:Rt,supportImageRefresh:yr,state:"queued",onError:Qr=>{Gr(Qr)},onSuccess:Qr=>{_r(Qr)}}),ut()});let Re=Rt=>t._(this,void 0,void 0,function*(){Rt.state="running";let{requestParameters:Zt,supportImageRefresh:yr,onError:_r,onSuccess:Gr,abortController:Qr}=Rt,je=yr===!1&&!t.i(self)&&!t.g(Zt.url)&&(!Zt.headers||Object.keys(Zt.headers).reduce((ct,At)=>ct&&At==="accept",!0));ne++;let Ye=je?_t(Zt,Qr):t.m(Zt,Qr);try{let ct=yield Ye;delete Rt.abortController,Rt.state="completed",ct.data instanceof HTMLImageElement||t.b(ct.data)?Gr(ct):ct.data&&Gr({data:yield(at=ct.data,typeof createImageBitmap=="function"?t.d(at):t.f(at)),cacheControl:ct.cacheControl,expires:ct.expires})}catch(ct){delete Rt.abortController,_r(ct)}finally{ne--,ut()}var at}),ut=()=>{let Rt=(()=>{for(let Zt of Object.keys(Ae))if(Ae[Zt]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Zt=ne;Zt0;Zt++){let yr=I.shift();yr.abortController.signal.aborted?Zt--:Re(yr)}},_t=(Rt,Zt)=>new Promise((yr,_r)=>{let Gr=new Image,Qr=Rt.url,je=Rt.credentials;je&&je==="include"?Gr.crossOrigin="use-credentials":(je&&je==="same-origin"||!t.s(Qr))&&(Gr.crossOrigin="anonymous"),Zt.signal.addEventListener("abort",()=>{Gr.src="",_r(t.c())}),Gr.fetchPriority="high",Gr.onload=()=>{Gr.onerror=Gr.onload=null,yr({data:Gr})},Gr.onerror=()=>{Gr.onerror=Gr.onload=null,Zt.signal.aborted||_r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Gr.src=Qr})})(l||(l={})),l.resetRequestQueue();class _{constructor(I){this._transformRequestFn=I}transformRequest(I,ne){return this._transformRequestFn&&this._transformRequestFn(I,ne)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function w(De){var I=new t.A(3);return I[0]=De[0],I[1]=De[1],I[2]=De[2],I}var A,M=function(De,I,ne){return De[0]=I[0]-ne[0],De[1]=I[1]-ne[1],De[2]=I[2]-ne[2],De};A=new t.A(3),t.A!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0);var g=function(De){var I=De[0],ne=De[1];return I*I+ne*ne};function b(De){let I=[];if(typeof De=="string")I.push({id:"default",url:De});else if(De&&De.length>0){let ne=[];for(let{id:be,url:Ae}of De){let Re=`${be}${Ae}`;ne.indexOf(Re)===-1&&(ne.push(Re),I.push({id:be,url:Ae}))}}return I}function v(De,I,ne){let be=De.split("?");return be[0]+=`${I}${ne}`,be.join("?")}(function(){var De=new t.A(2);t.A!=Float32Array&&(De[0]=0,De[1]=0)})();class u{constructor(I,ne,be,Ae){this.context=I,this.format=be,this.texture=I.gl.createTexture(),this.update(ne,Ae)}update(I,ne,be){let{width:Ae,height:Re}=I,ut=!(this.size&&this.size[0]===Ae&&this.size[1]===Re||be),{context:_t}=this,{gl:Rt}=_t;if(this.useMipmap=!!(ne&&ne.useMipmap),Rt.bindTexture(Rt.TEXTURE_2D,this.texture),_t.pixelStoreUnpackFlipY.set(!1),_t.pixelStoreUnpack.set(1),_t.pixelStoreUnpackPremultiplyAlpha.set(this.format===Rt.RGBA&&(!ne||ne.premultiply!==!1)),ut)this.size=[Ae,Re],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Rt.texImage2D(Rt.TEXTURE_2D,0,this.format,this.format,Rt.UNSIGNED_BYTE,I):Rt.texImage2D(Rt.TEXTURE_2D,0,this.format,Ae,Re,0,this.format,Rt.UNSIGNED_BYTE,I.data);else{let{x:Zt,y:yr}=be||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Rt.texSubImage2D(Rt.TEXTURE_2D,0,Zt,yr,Rt.RGBA,Rt.UNSIGNED_BYTE,I):Rt.texSubImage2D(Rt.TEXTURE_2D,0,Zt,yr,Ae,Re,Rt.RGBA,Rt.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Rt.generateMipmap(Rt.TEXTURE_2D)}bind(I,ne,be){let{context:Ae}=this,{gl:Re}=Ae;Re.bindTexture(Re.TEXTURE_2D,this.texture),be!==Re.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(be=Re.LINEAR),I!==this.filter&&(Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MAG_FILTER,I),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MIN_FILTER,be||I),this.filter=I),ne!==this.wrap&&(Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_S,ne),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_T,ne),this.wrap=ne)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function y(De){let{userImage:I}=De;return!!(I&&I.render&&I.render())&&(De.data.replace(new Uint8Array(I.data.buffer)),!0)}class m extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(I){if(this.loaded!==I&&(this.loaded=I,I)){for(let{ids:ne,promiseResolve:be}of this.requestors)be(this._getImagesForIds(ne));this.requestors=[]}}getImage(I){let ne=this.images[I];if(ne&&!ne.data&&ne.spriteData){let be=ne.spriteData;ne.data=new t.R({width:be.width,height:be.height},be.context.getImageData(be.x,be.y,be.width,be.height).data),ne.spriteData=null}return ne}addImage(I,ne){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ne)&&(this.images[I]=ne)}_validate(I,ne){let be=!0,Ae=ne.data||ne.spriteData;return this._validateStretch(ne.stretchX,Ae&&Ae.width)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchX" value`))),be=!1),this._validateStretch(ne.stretchY,Ae&&Ae.height)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchY" value`))),be=!1),this._validateContent(ne.content,ne)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "content" value`))),be=!1),be}_validateStretch(I,ne){if(!I)return!0;let be=0;for(let Ae of I){if(Ae[0]{let Ae=!0;if(!this.isLoaded())for(let Re of I)this.images[Re]||(Ae=!1);this.isLoaded()||Ae?ne(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ne})})}_getImagesForIds(I){let ne={};for(let be of I){let Ae=this.getImage(be);Ae||(this.fire(new t.k("styleimagemissing",{id:be})),Ae=this.getImage(be)),Ae?ne[be]={data:Ae.data.clone(),pixelRatio:Ae.pixelRatio,sdf:Ae.sdf,version:Ae.version,stretchX:Ae.stretchX,stretchY:Ae.stretchY,content:Ae.content,textFitWidth:Ae.textFitWidth,textFitHeight:Ae.textFitHeight,hasRenderCallback:!!(Ae.userImage&&Ae.userImage.render)}:t.w(`Image "${be}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ne}getPixelSize(){let{width:I,height:ne}=this.atlasImage;return{width:I,height:ne}}getPattern(I){let ne=this.patterns[I],be=this.getImage(I);if(!be)return null;if(ne&&ne.position.version===be.version)return ne.position;if(ne)ne.position.version=be.version;else{let Ae={w:be.data.width+2,h:be.data.height+2,x:0,y:0},Re=new t.I(Ae,be);this.patterns[I]={bin:Ae,position:Re}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){let ne=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(I,this.atlasImage,ne.RGBA),this.atlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)}_updatePatternAtlas(){let I=[];for(let Re in this.patterns)I.push(this.patterns[Re].bin);let{w:ne,h:be}=t.p(I),Ae=this.atlasImage;Ae.resize({width:ne||1,height:be||1});for(let Re in this.patterns){let{bin:ut}=this.patterns[Re],_t=ut.x+1,Rt=ut.y+1,Zt=this.getImage(Re).data,yr=Zt.width,_r=Zt.height;t.R.copy(Zt,Ae,{x:0,y:0},{x:_t,y:Rt},{width:yr,height:_r}),t.R.copy(Zt,Ae,{x:0,y:_r-1},{x:_t,y:Rt-1},{width:yr,height:1}),t.R.copy(Zt,Ae,{x:0,y:0},{x:_t,y:Rt+_r},{width:yr,height:1}),t.R.copy(Zt,Ae,{x:yr-1,y:0},{x:_t-1,y:Rt},{width:1,height:_r}),t.R.copy(Zt,Ae,{x:0,y:0},{x:_t+yr,y:Rt},{width:1,height:_r})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(let ne of I){if(this.callbackDispatchedThisFrame[ne])continue;this.callbackDispatchedThisFrame[ne]=!0;let be=this.getImage(ne);be||t.w(`Image with ID: "${ne}" was not found`),y(be)&&this.updateImage(ne,be)}}}let R=1e20;function L(De,I,ne,be,Ae,Re,ut,_t,Rt){for(let Zt=I;Zt-1);Rt++,Re[Rt]=_t,ut[Rt]=Zt,ut[Rt+1]=R}for(let _t=0,Rt=0;_t65535)throw new Error("glyphs > 65535 not supported");if(be.ranges[Re])return{stack:I,id:ne,glyph:Ae};if(!this.url)throw new Error("glyphsUrl is not set");if(!be.requests[Re]){let _t=F.loadGlyphRange(I,Re,this.url,this.requestManager);be.requests[Re]=_t}let ut=yield be.requests[Re];for(let _t in ut)this._doesCharSupportLocalGlyph(+_t)||(be.glyphs[+_t]=ut[+_t]);return be.ranges[Re]=!0,{stack:I,id:ne,glyph:ut[ne]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ne,be){let Ae=this.localIdeographFontFamily;if(!Ae||!this._doesCharSupportLocalGlyph(be))return;let Re=I.tinySDF;if(!Re){let _t="400";/bold/i.test(ne)?_t="900":/medium/i.test(ne)?_t="500":/light/i.test(ne)&&(_t="200"),Re=I.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ae,fontWeight:_t})}let ut=Re.draw(String.fromCharCode(be));return{id:be,bitmap:new t.o({width:ut.width||60,height:ut.height||60},ut.data),metrics:{width:ut.glyphWidth/2||24,height:ut.glyphHeight/2||24,left:ut.glyphLeft/2+.5||0,top:ut.glyphTop/2-27.5||-8,advance:ut.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(De,I,ne,be){return t._(this,void 0,void 0,function*(){let Ae=256*I,Re=Ae+255,ut=be.transformRequest(ne.replace("{fontstack}",De).replace("{range}",`${Ae}-${Re}`),"Glyphs"),_t=yield t.l(ut,new AbortController);if(!_t||!_t.data)throw new Error(`Could not load glyph range. range: ${I}, ${Ae}-${Re}`);let Rt={};for(let Zt of t.n(_t.data))Rt[Zt.id]=Zt;return Rt})},F.TinySDF=class{constructor({fontSize:De=24,buffer:I=3,radius:ne=8,cutoff:be=.25,fontFamily:Ae="sans-serif",fontWeight:Re="normal",fontStyle:ut="normal"}={}){this.buffer=I,this.cutoff=be,this.radius=ne;let _t=this.size=De+4*I,Rt=this._createCanvas(_t),Zt=this.ctx=Rt.getContext("2d",{willReadFrequently:!0});Zt.font=`${ut} ${Re} ${De}px ${Ae}`,Zt.textBaseline="alphabetic",Zt.textAlign="left",Zt.fillStyle="black",this.gridOuter=new Float64Array(_t*_t),this.gridInner=new Float64Array(_t*_t),this.f=new Float64Array(_t),this.z=new Float64Array(_t+1),this.v=new Uint16Array(_t)}_createCanvas(De){let I=document.createElement("canvas");return I.width=I.height=De,I}draw(De){let{width:I,actualBoundingBoxAscent:ne,actualBoundingBoxDescent:be,actualBoundingBoxLeft:Ae,actualBoundingBoxRight:Re}=this.ctx.measureText(De),ut=Math.ceil(ne),_t=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Re-Ae))),Rt=Math.min(this.size-this.buffer,ut+Math.ceil(be)),Zt=_t+2*this.buffer,yr=Rt+2*this.buffer,_r=Math.max(Zt*yr,0),Gr=new Uint8ClampedArray(_r),Qr={data:Gr,width:Zt,height:yr,glyphWidth:_t,glyphHeight:Rt,glyphTop:ut,glyphLeft:0,glyphAdvance:I};if(_t===0||Rt===0)return Qr;let{ctx:je,buffer:Ye,gridInner:at,gridOuter:ct}=this;je.clearRect(Ye,Ye,_t,Rt),je.fillText(De,Ye,Ye+ut);let At=je.getImageData(Ye,Ye,_t,Rt);ct.fill(R,0,_r),at.fill(0,0,_r);for(let yt=0;yt0?Tr*Tr:0,at[vr]=Tr<0?Tr*Tr:0}}L(ct,0,0,Zt,yr,Zt,this.f,this.v,this.z),L(at,Ye,Ye,_t,Rt,Zt,this.f,this.v,this.z);for(let yt=0;yt<_r;yt++){let Ct=Math.sqrt(ct[yt])-Math.sqrt(at[yt]);Gr[yt]=Math.round(255-255*(Ct/this.radius+this.cutoff))}return Qr}};class N{constructor(){this.specification=t.v.light.position}possiblyEvaluate(I,ne){return t.x(I.expression.evaluate(ne))}interpolate(I,ne,be){return{x:t.y.number(I.x,ne.x,be),y:t.y.number(I.y,ne.y,be),z:t.y.number(I.z,ne.z,be)}}}let O;class P extends t.E{constructor(I){super(),O=O||new t.q({anchor:new t.D(t.v.light.anchor),position:new N,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(O),this.setLight(I),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(I,ne={}){if(!this._validate(t.r,I,ne))for(let be in I){let Ae=I[be];be.endsWith("-transition")?this._transitionable.setTransition(be.slice(0,-11),Ae):this._transitionable.setValue(be,Ae)}}updateTransitions(I){this._transitioning=this._transitionable.transitioned(I,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(I){this.properties=this._transitioning.possiblyEvaluate(I)}_validate(I,ne,be){return(!be||be.validate!==!1)&&t.t(this,I.call(t.u,{value:ne,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}let U=new t.q({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class B extends t.E{constructor(I){super(),this._transitionable=new t.T(U),this.setSky(I),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(I,ne={}){if(!this._validate(t.B,I,ne)){I||(I={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let be in I){let Ae=I[be];be.endsWith("-transition")?this._transitionable.setTransition(be.slice(0,-11),Ae):this._transitionable.setValue(be,Ae)}}}getSky(){return this._transitionable.serialize()}updateTransitions(I){this._transitioning=this._transitionable.transitioned(I,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(I){this.properties=this._transitioning.possiblyEvaluate(I)}_validate(I,ne,be={}){return be?.validate!==!1&&t.t(this,I.call(t.u,t.e({value:ne,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(I){return I<60?0:I<70?(I-60)/10:1}}class X{constructor(I,ne){this.width=I,this.height=ne,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(I,ne){let be=I.join(",")+String(ne);return this.dashEntry[be]||(this.dashEntry[be]=this.addDash(I,ne)),this.dashEntry[be]}getDashRanges(I,ne,be){let Ae=[],Re=I.length%2==1?-I[I.length-1]*be:0,ut=I[0]*be,_t=!0;Ae.push({left:Re,right:ut,isDash:_t,zeroLength:I[0]===0});let Rt=I[0];for(let Zt=1;Zt1&&(Rt=I[++_t]);let yr=Math.abs(Zt-Rt.left),_r=Math.abs(Zt-Rt.right),Gr=Math.min(yr,_r),Qr,je=Re/be*(Ae+1);if(Rt.isDash){let Ye=Ae-Math.abs(je);Qr=Math.sqrt(Gr*Gr+Ye*Ye)}else Qr=Ae-Math.sqrt(Gr*Gr+je*je);this.data[ut+Zt]=Math.max(0,Math.min(255,Qr+128))}}}addRegularDash(I){for(let _t=I.length-1;_t>=0;--_t){let Rt=I[_t],Zt=I[_t+1];Rt.zeroLength?I.splice(_t,1):Zt&&Zt.isDash===Rt.isDash&&(Zt.left=Rt.left,I.splice(_t,1))}let ne=I[0],be=I[I.length-1];ne.isDash===be.isDash&&(ne.left=be.left-this.width,be.right=ne.right+this.width);let Ae=this.width*this.nextRow,Re=0,ut=I[Re];for(let _t=0;_t1&&(ut=I[++Re]);let Rt=Math.abs(_t-ut.left),Zt=Math.abs(_t-ut.right),yr=Math.min(Rt,Zt);this.data[Ae+_t]=Math.max(0,Math.min(255,(ut.isDash?yr:-yr)+128))}}addDash(I,ne){let be=ne?7:0,Ae=2*be+1;if(this.nextRow+Ae>this.height)return t.w("LineAtlas out of space"),null;let Re=0;for(let _t=0;_t{ne.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[$]}numActive(){return Object.keys(this.active).length}}let ce=Math.floor(i.hardwareConcurrency/2),ve,G;function Y(){return ve||(ve=new le),ve}le.workerCount=t.C(globalThis)?Math.max(Math.min(ce,3),1):1;class ee{constructor(I,ne){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ne;let be=this.workerPool.acquire(ne);for(let Ae=0;Ae{ne.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ne){for(let be of this.actors)be.registerMessageHandler(I,ne)}}function V(){return G||(G=new ee(Y(),t.G),G.registerMessageHandler("GR",(De,I,ne)=>t.m(I,ne))),G}function se(De,I){let ne=t.H();return t.J(ne,ne,[1,1,0]),t.K(ne,ne,[.5*De.width,.5*De.height,1]),t.L(ne,ne,De.calculatePosMatrix(I.toUnwrapped()))}function ae(De,I,ne,be,Ae,Re){let ut=(function(_r,Gr,Qr){if(_r)for(let je of _r){let Ye=Gr[je];if(Ye&&Ye.source===Qr&&Ye.type==="fill-extrusion")return!0}else for(let je in Gr){let Ye=Gr[je];if(Ye.source===Qr&&Ye.type==="fill-extrusion")return!0}return!1})(Ae&&Ae.layers,I,De.id),_t=Re.maxPitchScaleFactor(),Rt=De.tilesIn(be,_t,ut);Rt.sort(j);let Zt=[];for(let _r of Rt)Zt.push({wrappedTileID:_r.tileID.wrapped().key,queryResults:_r.tile.queryRenderedFeatures(I,ne,De._state,_r.queryGeometry,_r.cameraQueryGeometry,_r.scale,Ae,Re,_t,se(De.transform,_r.tileID))});let yr=(function(_r){let Gr={},Qr={};for(let je of _r){let Ye=je.queryResults,at=je.wrappedTileID,ct=Qr[at]=Qr[at]||{};for(let At in Ye){let yt=Ye[At],Ct=ct[At]=ct[At]||{},nr=Gr[At]=Gr[At]||[];for(let vr of yt)Ct[vr.featureIndex]||(Ct[vr.featureIndex]=!0,nr.push(vr))}}return Gr})(Zt);for(let _r in yr)yr[_r].forEach(Gr=>{let Qr=Gr.feature,je=De.getFeatureState(Qr.layer["source-layer"],Qr.id);Qr.source=Qr.layer.source,Qr.layer["source-layer"]&&(Qr.sourceLayer=Qr.layer["source-layer"]),Qr.state=je});return yr}function j(De,I){let ne=De.tileID,be=I.tileID;return ne.overscaledZ-be.overscaledZ||ne.canonical.y-be.canonical.y||ne.wrap-be.wrap||ne.canonical.x-be.canonical.x}function Q(De,I,ne){return t._(this,void 0,void 0,function*(){let be=De;if(De.url?be=(yield t.h(I.transformRequest(De.url,"Source"),ne)).data:yield i.frameAsync(ne),!be)return null;let Ae=t.M(t.e(be,De),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in be&&be.vector_layers&&(Ae.vectorLayerIds=be.vector_layers.map(Re=>Re.id)),Ae})}class re{constructor(I,ne){I&&(ne?this.setSouthWest(I).setNorthEast(ne):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}extend(I){let ne=this._sw,be=this._ne,Ae,Re;if(I instanceof t.N)Ae=I,Re=I;else{if(!(I instanceof re))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(re.convert(I)):this.extend(t.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(t.N.convert(I)):this;if(Ae=I._sw,Re=I._ne,!Ae||!Re)return this}return ne||be?(ne.lng=Math.min(Ae.lng,ne.lng),ne.lat=Math.min(Ae.lat,ne.lat),be.lng=Math.max(Re.lng,be.lng),be.lat=Math.max(Re.lat,be.lat)):(this._sw=new t.N(Ae.lng,Ae.lat),this._ne=new t.N(Re.lng,Re.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(I){let{lng:ne,lat:be}=t.N.convert(I),Ae=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ae=this._sw.lng>=ne&&ne>=this._ne.lng),this._sw.lat<=be&&be<=this._ne.lat&&Ae}static convert(I){return I instanceof re?I:I&&new re(I)}static fromLngLat(I,ne=0){let be=360*ne/40075017,Ae=be/Math.cos(Math.PI/180*I.lat);return new re(new t.N(I.lng-Ae,I.lat-be),new t.N(I.lng+Ae,I.lat+be))}adjustAntiMeridian(){let I=new t.N(this._sw.lng,this._sw.lat),ne=new t.N(this._ne.lng,this._ne.lat);return new re(I,I.lng>ne.lng?new t.N(ne.lng+360,ne.lat):ne)}}class he{constructor(I,ne,be){this.bounds=re.convert(this.validateBounds(I)),this.minzoom=ne||0,this.maxzoom=be||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){let ne=Math.pow(2,I.z),be=Math.floor(t.O(this.bounds.getWest())*ne),Ae=Math.floor(t.Q(this.bounds.getNorth())*ne),Re=Math.ceil(t.O(this.bounds.getEast())*ne),ut=Math.ceil(t.Q(this.bounds.getSouth())*ne);return I.x>=be&&I.x=Ae&&I.y{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(I){return t._(this,void 0,void 0,function*(){let ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),be={request:this.map._requestManager.transformRequest(ne,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};be.request.collectResourceTiming=this._collectResourceTiming;let Ae="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Re,ut)=>{I.reloadPromise={resolve:Re,reject:ut}})}else I.actor=this.dispatcher.getActor(),Ae="LT";I.abortController=new AbortController;try{let Re=yield I.actor.sendAsync({type:Ae,data:be},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Re)}catch(Re){if(delete I.abortController,I.aborted)return;if(Re&&Re.status!==404)throw Re;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ne){if(ne&&ne.resourceTiming&&(I.resourceTiming=ne.resourceTiming),ne&&this.map._refreshExpiredTiles&&I.setExpiryData(ne),I.loadVectorData(ne,this.map.painter),I.reloadPromise){let be=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(be.resolve).catch(be.reject)}}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Te extends t.E{constructor(I,ne,be,Ae){super(),this.id=I,this.dispatcher=be,this.setEventedParent(Ae),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ne),t.e(this,t.M(ne,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let I=yield Q(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(t.e(this,I),I.bounds&&(this.tileBounds=new he(I.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(I){this._tileJSONRequest=null,this.fire(new t.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return t.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return t._(this,void 0,void 0,function*(){let ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{let be=yield l.getImage(this.map._requestManager.transformRequest(ne,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(be&&be.data){this.map._refreshExpiredTiles&&be.cacheControl&&be.expires&&I.setExpiryData({cacheControl:be.cacheControl,expires:be.expires});let Ae=this.map.painter.context,Re=Ae.gl,ut=be.data;I.texture=this.map.painter.getTileTexture(ut.width),I.texture?I.texture.update(ut,{useMipmap:!0}):(I.texture=new u(Ae,ut,Re.RGBA,{useMipmap:!0}),I.texture.bind(Re.LINEAR,Re.CLAMP_TO_EDGE,Re.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(be){if(delete I.abortController,I.aborted)I.state="unloaded";else if(be)throw I.state="errored",be}})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Le extends Te{constructor(I,ne,be,Ae){super(I,ne,be,Ae),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ne),this.encoding=ne.encoding||"mapbox",this.redFactor=ne.redFactor,this.greenFactor=ne.greenFactor,this.blueFactor=ne.blueFactor,this.baseShift=ne.baseShift}loadTile(I){return t._(this,void 0,void 0,function*(){let ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),be=this.map._requestManager.transformRequest(ne,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{let Ae=yield l.getImage(be,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Ae&&Ae.data){let Re=Ae.data;this.map._refreshExpiredTiles&&Ae.cacheControl&&Ae.expires&&I.setExpiryData({cacheControl:Ae.cacheControl,expires:Ae.expires});let ut=t.b(Re)&&t.U()?Re:yield this.readImageNow(Re),_t={type:this.type,uid:I.uid,source:this.id,rawImageData:ut,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();let Rt=yield I.actor.sendAsync({type:"LDT",data:_t});I.dem=Rt,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(Ae){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Ae)throw I.state="errored",Ae}})}readImageNow(I){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){let ne=I.width+2,be=I.height+2;try{return new t.R({width:ne,height:be},yield t.W(I,-1,-1,ne,be))}catch{}}return i.getImageData(I,1)})}_getNeighboringTiles(I){let ne=I.canonical,be=Math.pow(2,ne.z),Ae=(ne.x-1+be)%be,Re=ne.x===0?I.wrap-1:I.wrap,ut=(ne.x+1+be)%be,_t=ne.x+1===be?I.wrap+1:I.wrap,Rt={};return Rt[new t.S(I.overscaledZ,Re,ne.z,Ae,ne.y).key]={backfilled:!1},Rt[new t.S(I.overscaledZ,_t,ne.z,ut,ne.y).key]={backfilled:!1},ne.y>0&&(Rt[new t.S(I.overscaledZ,Re,ne.z,Ae,ne.y-1).key]={backfilled:!1},Rt[new t.S(I.overscaledZ,I.wrap,ne.z,ne.x,ne.y-1).key]={backfilled:!1},Rt[new t.S(I.overscaledZ,_t,ne.z,ut,ne.y-1).key]={backfilled:!1}),ne.y+10&&t.e(Re,{resourceTiming:Ae}),this.fire(new t.k("data",Object.assign(Object.assign({},Re),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Re),{sourceDataType:"content"})))}catch(be){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(be))}})}loaded(){return this._pendingLoads===0}loadTile(I){return t._(this,void 0,void 0,function*(){let ne=I.actor?"RT":"LT";I.actor=this.actor;let be={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;let Ae=yield this.actor.sendAsync({type:ne,data:be},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(Ae,this.map.painter,ne==="RT")})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var qe=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class et extends t.E{constructor(I,ne,be,Ae){super(),this.id=I,this.dispatcher=be,this.coordinates=ne.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ae),this.options=ne}load(I){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let ne=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ne&&ne.data&&(this.image=ne.data,I&&(this.coordinates=I),this._finishLoading())}catch(ne){this._request=null,this._loaded=!0,this.fire(new t.j(ne))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;let ne=I.map(t.Z.fromLngLat);this.tileID=(function(Ae){let Re=1/0,ut=1/0,_t=-1/0,Rt=-1/0;for(let Gr of Ae)Re=Math.min(Re,Gr.x),ut=Math.min(ut,Gr.y),_t=Math.max(_t,Gr.x),Rt=Math.max(Rt,Gr.y);let Zt=Math.max(_t-Re,Rt-ut),yr=Math.max(0,Math.floor(-Math.log(Zt)/Math.LN2)),_r=Math.pow(2,yr);return new t.a1(yr,Math.floor((Re+_t)/2*_r),Math.floor((ut+Rt)/2*_r))})(ne),this.minzoom=this.maxzoom=this.tileID.z;let be=ne.map(Ae=>this.tileID.getTilePoint(Ae)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(be[0].x,be[0].y,0,0),this._boundsArray.emplaceBack(be[1].x,be[1].y,t.X,0),this._boundsArray.emplaceBack(be[3].x,be[3].y,0,t.X),this._boundsArray.emplaceBack(be[2].x,be[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(I,this.image,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let be=!1;for(let Ae in this.tiles){let Re=this.tiles[Ae];Re.state!=="loaded"&&(Re.state="loaded",Re.texture=this.texture,be=!0)}be&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class rt extends et{constructor(I,ne,be,Ae){super(I,ne,be,Ae),this.roundZoom=!0,this.type="video",this.options=ne}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;let I=this.options;this.urls=[];for(let ne of I.urls)this.urls.push(this.map._requestManager.transformRequest(ne,"Source").url);try{let ne=yield t.a3(this.urls);if(this._loaded=!0,!ne)return;this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ne){this.fire(new t.j(ne))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){let ne=this.video.seekable;Ine.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ne.start(0)} and ${ne.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),ne.texSubImage2D(ne.TEXTURE_2D,0,0,0,ne.RGBA,ne.UNSIGNED_BYTE,this.video)):(this.texture=new u(I,this.video,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let be=!1;for(let Ae in this.tiles){let Re=this.tiles[Ae];Re.state!=="loaded"&&(Re.state="loaded",Re.texture=this.texture,be=!0)}be&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class $e extends et{constructor(I,ne,be,Ae){super(I,ne,be,Ae),ne.coordinates?Array.isArray(ne.coordinates)&&ne.coordinates.length===4&&!ne.coordinates.some(Re=>!Array.isArray(Re)||Re.length!==2||Re.some(ut=>typeof ut!="number"))||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ne.animate&&typeof ne.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ne.canvas?typeof ne.canvas=="string"||ne.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "canvas"'))),this.options=ne,this.animate=ne.animate===void 0||ne.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let ne=this.map.painter.context,be=ne.gl;this.boundsBuffer||(this.boundsBuffer=ne.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ne,this.canvas,be.RGBA,{premultiply:!0});let Ae=!1;for(let Re in this.tiles){let ut=this.tiles[Re];ut.state!=="loaded"&&(ut.state="loaded",ut.texture=this.texture,Ae=!0)}Ae&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}let Ue={},fe=De=>{switch(De){case"geojson":return Pe;case"image":return et;case"raster":return Te;case"raster-dem":return Le;case"vector":return xe;case"video":return rt;case"canvas":return $e}return Ue[De]},ue="RTLPluginLoaded";class ie extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ne=>{throw this.status="error",ne})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return t._(this,arguments,void 0,function*(ne,be=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ne),!this.url)throw new Error(`requested url ${ne} is invalid`);if(this.status==="unavailable"){if(!be)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(ue))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ee=null;function We(){return Ee||(Ee=new ie),Ee}class Qe{constructor(I,ne){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=t.a4(),this.uses=0,this.tileSize=ne,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(I){let ne=I+this.timeAdded;neRe.getLayer(Zt)).filter(Boolean);if(Rt.length!==0){_t.layers=Rt,_t.stateDependentLayerIds&&(_t.stateDependentLayers=_t.stateDependentLayerIds.map(Zt=>Rt.filter(yr=>yr.id===Zt)[0]));for(let Zt of Rt)ut[Zt.id]=_t}}return ut})(I.buckets,ne.style),this.hasSymbolBuckets=!1;for(let Ae in this.buckets){let Re=this.buckets[Ae];if(Re instanceof t.a6){if(this.hasSymbolBuckets=!0,!be)break;Re.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Ae in this.buckets){let Re=this.buckets[Ae];if(Re instanceof t.a6&&Re.hasRTLText){this.hasRTLText=!0,We().lazyLoad();break}}this.queryPadding=0;for(let Ae in this.buckets){let Re=this.buckets[Ae];this.queryPadding=Math.max(this.queryPadding,ne.style.getLayer(Ae).queryRadius(Re))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(let I in this.buckets)this.buckets[I].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(I){return this.buckets[I.id]}upload(I){for(let be in this.buckets){let Ae=this.buckets[be];Ae.uploadPending()&&Ae.upload(I)}let ne=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(I,this.imageAtlas.image,ne.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(I,this.glyphAtlasImage,ne.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ae,cameraQueryGeometry:Re,scale:ut,tileSize:this.tileSize,pixelPosMatrix:yr,transform:Rt,params:_t,queryPadding:this.queryPadding*Zt},I,ne,be):{}}querySourceFeatures(I,ne){let be=this.latestFeatureIndex;if(!be||!be.rawTileData)return;let Ae=be.loadVTLayers(),Re=ne&&ne.sourceLayer?ne.sourceLayer:"",ut=Ae._geojsonTileLayer||Ae[Re];if(!ut)return;let _t=t.a7(ne&&ne.filter),{z:Rt,x:Zt,y:yr}=this.tileID.canonical,_r={z:Rt,x:Zt,y:yr};for(let Gr=0;Grbe)Ae=!1;else if(ne)if(this.expirationTime{this.remove(I,Re)},be)),this.data[Ae].push(Re),this.order.push(Ae),this.order.length>this.max){let ut=this._getAndRemoveByKey(this.order[0]);ut&&this.onRemove(ut)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){let ne=this.data[I].shift();return ne.timeout&&clearTimeout(ne.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ne.value}getByKey(I){let ne=this.data[I];return ne?ne[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ne){if(!this.has(I))return this;let be=I.wrapped().key,Ae=ne===void 0?0:this.data[be].indexOf(ne),Re=this.data[be][Ae];return this.data[be].splice(Ae,1),Re.timeout&&clearTimeout(Re.timeout),this.data[be].length===0&&delete this.data[be],this.onRemove(Re.value),this.order.splice(this.order.indexOf(be),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){let ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this}filter(I){let ne=[];for(let be in this.data)for(let Ae of this.data[be])I(Ae.value)||ne.push(Ae);for(let be of ne)this.remove(be.value.tileID,be)}}class Tt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ne,be){let Ae=String(ne);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][Ae]=this.stateChanges[I][Ae]||{},t.e(this.stateChanges[I][Ae],be),this.deletedStates[I]===null){this.deletedStates[I]={};for(let Re in this.state[I])Re!==Ae&&(this.deletedStates[I][Re]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][Ae]===null){this.deletedStates[I][Ae]={};for(let Re in this.state[I][Ae])be[Re]||(this.deletedStates[I][Ae][Re]=null)}else for(let Re in be)this.deletedStates[I]&&this.deletedStates[I][Ae]&&this.deletedStates[I][Ae][Re]===null&&delete this.deletedStates[I][Ae][Re]}removeFeatureState(I,ne,be){if(this.deletedStates[I]===null)return;let Ae=String(ne);if(this.deletedStates[I]=this.deletedStates[I]||{},be&&ne!==void 0)this.deletedStates[I][Ae]!==null&&(this.deletedStates[I][Ae]=this.deletedStates[I][Ae]||{},this.deletedStates[I][Ae][be]=null);else if(ne!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][Ae])for(be in this.deletedStates[I][Ae]={},this.stateChanges[I][Ae])this.deletedStates[I][Ae][be]=null;else this.deletedStates[I][Ae]=null;else this.deletedStates[I]=null}getState(I,ne){let be=String(ne),Ae=t.e({},(this.state[I]||{})[be],(this.stateChanges[I]||{})[be]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){let Re=this.deletedStates[I][ne];if(Re===null)return{};for(let ut in Re)delete Ae[ut]}return Ae}initializeTileState(I,ne){I.setFeatureState(this.state,ne)}coalesceChanges(I,ne){let be={};for(let Ae in this.stateChanges){this.state[Ae]=this.state[Ae]||{};let Re={};for(let ut in this.stateChanges[Ae])this.state[Ae][ut]||(this.state[Ae][ut]={}),t.e(this.state[Ae][ut],this.stateChanges[Ae][ut]),Re[ut]=this.state[Ae][ut];be[Ae]=Re}for(let Ae in this.deletedStates){this.state[Ae]=this.state[Ae]||{};let Re={};if(this.deletedStates[Ae]===null)for(let ut in this.state[Ae])Re[ut]={},this.state[Ae][ut]={};else for(let ut in this.deletedStates[Ae]){if(this.deletedStates[Ae][ut]===null)this.state[Ae][ut]={};else for(let _t of Object.keys(this.deletedStates[Ae][ut]))delete this.state[Ae][ut][_t];Re[ut]=this.state[Ae][ut]}be[Ae]=be[Ae]||{},t.e(be[Ae],Re)}if(this.stateChanges={},this.deletedStates={},Object.keys(be).length!==0)for(let Ae in I)I[Ae].setFeatureState(be,ne)}}class St extends t.E{constructor(I,ne,be){super(),this.id=I,this.dispatcher=be,this.on("data",Ae=>this._dataHandler(Ae)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ae,Re,ut,_t)=>{let Rt=new(fe(Re.type))(Ae,Re,ut,_t);if(Rt.id!==Ae)throw new Error(`Expected Source id to be ${Ae} instead of ${Rt.id}`);return Rt})(I,ne,be,this),this._tiles={},this._cache=new Xe(0,Ae=>this._unloadTile(Ae)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Tt,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let I in this._tiles){let ne=this._tiles[I];if(ne.state!=="loaded"&&ne.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ne,be){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ne,be)}catch(Ae){I.state="errored",Ae.status!==404?this._source.fire(new t.j(Ae,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new t.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let ne in this._tiles){let be=this._tiles[ne];be.upload(I),be.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(zt).map(I=>I.key)}getRenderableIds(I){let ne=[];for(let be in this._tiles)this._isIdRenderable(be,I)&&ne.push(this._tiles[be]);return I?ne.sort((be,Ae)=>{let Re=be.tileID,ut=Ae.tileID,_t=new t.P(Re.canonical.x,Re.canonical.y)._rotate(this.transform.angle),Rt=new t.P(ut.canonical.x,ut.canonical.y)._rotate(this.transform.angle);return Re.overscaledZ-ut.overscaledZ||Rt.y-_t.y||Rt.x-_t.x}).map(be=>be.tileID.key):ne.map(be=>be.tileID).sort(zt).map(be=>be.key)}hasRenderableParent(I){let ne=this.findLoadedParent(I,0);return!!ne&&this._isIdRenderable(ne.tileID.key)}_isIdRenderable(I,ne){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ne||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ne){return t._(this,void 0,void 0,function*(){let be=this._tiles[I];be&&(be.state!=="loading"&&(be.state=ne),yield this._loadTile(be,I,ne))})}_tileLoaded(I,ne,be){I.timeAdded=i.now(),be==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ne,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){let ne=this.getRenderableIds();for(let Ae=0;Ae1||(Math.abs(ut)>1&&(Math.abs(ut+Rt)===1?ut+=Rt:Math.abs(ut-Rt)===1&&(ut-=Rt)),Re.dem&&Ae.dem&&(Ae.dem.backfillBorder(Re.dem,ut,_t),Ae.neighboringTiles&&Ae.neighboringTiles[Zt]&&(Ae.neighboringTiles[Zt].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ne,be,Ae){for(let Re in this._tiles){let ut=this._tiles[Re];if(Ae[Re]||!ut.hasData()||ut.tileID.overscaledZ<=ne||ut.tileID.overscaledZ>be)continue;let _t=ut.tileID;for(;ut&&ut.tileID.overscaledZ>ne+1;){let Zt=ut.tileID.scaledTo(ut.tileID.overscaledZ-1);ut=this._tiles[Zt.key],ut&&ut.hasData()&&(_t=Zt)}let Rt=_t;for(;Rt.overscaledZ>ne;)if(Rt=Rt.scaledTo(Rt.overscaledZ-1),I[Rt.key]){Ae[_t.key]=_t;break}}}findLoadedParent(I,ne){if(I.key in this._loadedParentTiles){let be=this._loadedParentTiles[I.key];return be&&be.tileID.overscaledZ>=ne?be:null}for(let be=I.overscaledZ-1;be>=ne;be--){let Ae=I.scaledTo(be),Re=this._getLoadedTile(Ae);if(Re)return Re}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){let ne=this._tiles[I.key];return ne&&ne.hasData()?ne:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){let ne=Math.ceil(I.width/this._source.tileSize)+1,be=Math.ceil(I.height/this._source.tileSize)+1,Ae=Math.floor(ne*be*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Re=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ae):Ae;this._cache.setMaxSize(Re)}handleWrapJump(I){let ne=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ne){let be={};for(let Ae in this._tiles){let Re=this._tiles[Ae];Re.tileID=Re.tileID.unwrapTo(Re.tileID.wrap+ne),be[Re.tileID.key]=Re}this._tiles=be;for(let Ae in this._timers)clearTimeout(this._timers[Ae]),delete this._timers[Ae];for(let Ae in this._tiles)this._setTileReloadTimer(Ae,this._tiles[Ae])}}_updateCoveredAndRetainedTiles(I,ne,be,Ae,Re,ut){let _t={},Rt={},Zt=Object.keys(I),yr=i.now();for(let _r of Zt){let Gr=I[_r],Qr=this._tiles[_r];if(!Qr||Qr.fadeEndTime!==0&&Qr.fadeEndTime<=yr)continue;let je=this.findLoadedParent(Gr,ne),Ye=this.findLoadedSibling(Gr),at=je||Ye||null;at&&(this._addTile(at.tileID),_t[at.tileID.key]=at.tileID),Rt[_r]=Gr}this._retainLoadedChildren(Rt,Ae,be,I);for(let _r in _t)I[_r]||(this._coveredTiles[_r]=!0,I[_r]=_t[_r]);if(ut){let _r={},Gr={};for(let Qr of Re)this._tiles[Qr.key].hasData()?_r[Qr.key]=Qr:Gr[Qr.key]=Qr;for(let Qr in Gr){let je=Gr[Qr].children(this._source.maxzoom);this._tiles[je[0].key]&&this._tiles[je[1].key]&&this._tiles[je[2].key]&&this._tiles[je[3].key]&&(_r[je[0].key]=I[je[0].key]=je[0],_r[je[1].key]=I[je[1].key]=je[1],_r[je[2].key]=I[je[2].key]=je[2],_r[je[3].key]=I[je[3].key]=je[3],delete Gr[Qr])}for(let Qr in Gr){let je=Gr[Qr],Ye=this.findLoadedParent(je,this._source.minzoom),at=this.findLoadedSibling(je),ct=Ye||at||null;if(ct){_r[ct.tileID.key]=I[ct.tileID.key]=ct.tileID;for(let At in _r)_r[At].isChildOf(ct.tileID)&&delete _r[At]}}for(let Qr in this._tiles)_r[Qr]||(this._coveredTiles[Qr]=!0)}}update(I,ne){if(!this._sourceLoaded||this._paused)return;let be;this.transform=I,this.terrain=ne,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?be=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(yr=>new t.S(yr.canonical.z,yr.wrap,yr.canonical.z,yr.canonical.x,yr.canonical.y)):(be=I.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ne}),this._source.hasTile&&(be=be.filter(yr=>this._source.hasTile(yr)))):be=[];let Ae=I.coveringZoomLevel(this._source),Re=Math.max(Ae-St.maxOverzooming,this._source.minzoom),ut=Math.max(Ae+St.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let yr={};for(let _r of be)if(_r.canonical.z>this._source.minzoom){let Gr=_r.scaledTo(_r.canonical.z-1);yr[Gr.key]=Gr;let Qr=_r.scaledTo(Math.max(this._source.minzoom,Math.min(_r.canonical.z,5)));yr[Qr.key]=Qr}be=be.concat(Object.values(yr))}let _t=be.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,_t&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Rt=this._updateRetainedTiles(be,Ae);Ut(this._source.type)&&this._updateCoveredAndRetainedTiles(Rt,Re,ut,Ae,be,ne);for(let yr in Rt)this._tiles[yr].clearFadeHold();let Zt=t.ab(this._tiles,Rt);for(let yr of Zt){let _r=this._tiles[yr];_r.hasSymbolBuckets&&!_r.holdingForFade()?_r.setHoldDuration(this.map._fadeDuration):_r.hasSymbolBuckets&&!_r.symbolFadeFinished()||this._removeTile(yr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ne){var be;let Ae={},Re={},ut=Math.max(ne-St.maxOverzooming,this._source.minzoom),_t=Math.max(ne+St.maxUnderzooming,this._source.minzoom),Rt={};for(let Zt of I){let yr=this._addTile(Zt);Ae[Zt.key]=Zt,yr.hasData()||nethis._source.maxzoom){let Gr=Zt.children(this._source.maxzoom)[0],Qr=this.getTile(Gr);if(Qr&&Qr.hasData()){Ae[Gr.key]=Gr;continue}}else{let Gr=Zt.children(this._source.maxzoom);if(Ae[Gr[0].key]&&Ae[Gr[1].key]&&Ae[Gr[2].key]&&Ae[Gr[3].key])continue}let _r=yr.wasRequested();for(let Gr=Zt.overscaledZ-1;Gr>=ut;--Gr){let Qr=Zt.scaledTo(Gr);if(Re[Qr.key])break;if(Re[Qr.key]=!0,yr=this.getTile(Qr),!yr&&_r&&(yr=this._addTile(Qr)),yr){let je=yr.hasData();if((je||!(!((be=this.map)===null||be===void 0)&&be.cancelPendingTileRequestsWhileZooming)||_r)&&(Ae[Qr.key]=Qr),_r=yr.wasRequested(),je)break}}}return Ae}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let I in this._tiles){let ne=[],be,Ae=this._tiles[I].tileID;for(;Ae.overscaledZ>0;){if(Ae.key in this._loadedParentTiles){be=this._loadedParentTiles[Ae.key];break}ne.push(Ae.key);let Re=Ae.scaledTo(Ae.overscaledZ-1);if(be=this._getLoadedTile(Re),be)break;Ae=Re}for(let Re of ne)this._loadedParentTiles[Re]=be}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let I in this._tiles){let ne=this._tiles[I].tileID,be=this._getLoadedTile(ne);this._loadedSiblingTiles[ne.key]=be}}_addTile(I){let ne=this._tiles[I.key];if(ne)return ne;ne=this._cache.getAndRemove(I),ne&&(this._setTileReloadTimer(I.key,ne),ne.tileID=I,this._state.initializeTileState(ne,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ne)));let be=ne;return ne||(ne=new Qe(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ne,I.key,ne.state)),ne.uses++,this._tiles[I.key]=ne,be||this._source.fire(new t.k("dataloading",{tile:ne,coord:ne.tileID,dataType:"source"})),ne}_setTileReloadTimer(I,ne){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);let be=ne.getExpiryTimeout();be&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},be))}_removeTile(I){let ne=this._tiles[I];ne&&(ne.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ne.uses>0||(ne.hasData()&&ne.state!=="reloading"?this._cache.add(ne.tileID,ne,ne.getExpiryTimeout()):(ne.aborted=!0,this._abortTile(ne),this._unloadTile(ne))))}_dataHandler(I){let ne=I.sourceDataType;I.dataType==="source"&&ne==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ne==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ne,be){let Ae=[],Re=this.transform;if(!Re)return Ae;let ut=be?Re.getCameraQueryGeometry(I):I,_t=I.map(je=>Re.pointCoordinate(je,this.terrain)),Rt=ut.map(je=>Re.pointCoordinate(je,this.terrain)),Zt=this.getIds(),yr=1/0,_r=1/0,Gr=-1/0,Qr=-1/0;for(let je of Rt)yr=Math.min(yr,je.x),_r=Math.min(_r,je.y),Gr=Math.max(Gr,je.x),Qr=Math.max(Qr,je.y);for(let je=0;je=0&&yt[1].y+At>=0){let Ct=_t.map(vr=>at.getTilePoint(vr)),nr=Rt.map(vr=>at.getTilePoint(vr));Ae.push({tile:Ye,tileID:at,queryGeometry:Ct,cameraQueryGeometry:nr,scale:ct})}}return Ae}getVisibleCoordinates(I){let ne=this.getRenderableIds(I).map(be=>this._tiles[be].tileID);for(let be of ne)be.posMatrix=this.transform.calculatePosMatrix(be.toUnwrapped());return ne}hasTransition(){if(this._source.hasTransition())return!0;if(Ut(this._source.type)){let I=i.now();for(let ne in this._tiles)if(this._tiles[ne].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ne,be){this._state.updateState(I=I||"_geojsonTileLayer",ne,be)}removeFeatureState(I,ne,be){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ne,be)}getFeatureState(I,ne){return this._state.getState(I=I||"_geojsonTileLayer",ne)}setDependencies(I,ne,be){let Ae=this._tiles[I];Ae&&Ae.setDependencies(ne,be)}reloadTilesForDependencies(I,ne){for(let be in this._tiles)this._tiles[be].hasDependency(I,ne)&&this._reloadTile(be,"reloading");this._cache.filter(be=>!be.hasDependency(I,ne))}}function zt(De,I){let ne=Math.abs(2*De.wrap)-+(De.wrap<0),be=Math.abs(2*I.wrap)-+(I.wrap<0);return De.overscaledZ-I.overscaledZ||be-ne||I.canonical.y-De.canonical.y||I.canonical.x-De.canonical.x}function Ut(De){return De==="raster"||De==="image"||De==="video"}St.maxOverzooming=10,St.maxUnderzooming=3;class br{constructor(I,ne){this.reset(I,ne)}reset(I,ne){this.points=I||[],this._distances=[0];for(let be=1;be0?(Ae-ut)/_t:0;return this.points[Re].mult(1-Rt).add(this.points[ne].mult(Rt))}}function hr(De,I){let ne=!0;return De==="always"||De!=="never"&&I!=="never"||(ne=!1),ne}class Or{constructor(I,ne,be){let Ae=this.boxCells=[],Re=this.circleCells=[];this.xCellCount=Math.ceil(I/be),this.yCellCount=Math.ceil(ne/be);for(let ut=0;utthis.width||Ae<0||ne>this.height)return[];let Rt=[];if(I<=0&&ne<=0&&this.width<=be&&this.height<=Ae){if(Re)return[{key:null,x1:I,y1:ne,x2:be,y2:Ae}];for(let Zt=0;Zt0}hitTestCircle(I,ne,be,Ae,Re){let ut=I-be,_t=I+be,Rt=ne-be,Zt=ne+be;if(_t<0||ut>this.width||Zt<0||Rt>this.height)return!1;let yr=[];return this._forEachCell(ut,Rt,_t,Zt,this._queryCellCircle,yr,{hitTest:!0,overlapMode:Ae,circle:{x:I,y:ne,radius:be},seenUids:{box:{},circle:{}}},Re),yr.length>0}_queryCell(I,ne,be,Ae,Re,ut,_t,Rt){let{seenUids:Zt,hitTest:yr,overlapMode:_r}=_t,Gr=this.boxCells[Re];if(Gr!==null){let je=this.bboxes;for(let Ye of Gr)if(!Zt.box[Ye]){Zt.box[Ye]=!0;let at=4*Ye,ct=this.boxKeys[Ye];if(I<=je[at+2]&&ne<=je[at+3]&&be>=je[at+0]&&Ae>=je[at+1]&&(!Rt||Rt(ct))&&(!yr||!hr(_r,ct.overlapMode))&&(ut.push({key:ct,x1:je[at],y1:je[at+1],x2:je[at+2],y2:je[at+3]}),yr))return!0}}let Qr=this.circleCells[Re];if(Qr!==null){let je=this.circles;for(let Ye of Qr)if(!Zt.circle[Ye]){Zt.circle[Ye]=!0;let at=3*Ye,ct=this.circleKeys[Ye];if(this._circleAndRectCollide(je[at],je[at+1],je[at+2],I,ne,be,Ae)&&(!Rt||Rt(ct))&&(!yr||!hr(_r,ct.overlapMode))){let At=je[at],yt=je[at+1],Ct=je[at+2];if(ut.push({key:ct,x1:At-Ct,y1:yt-Ct,x2:At+Ct,y2:yt+Ct}),yr)return!0}}}return!1}_queryCellCircle(I,ne,be,Ae,Re,ut,_t,Rt){let{circle:Zt,seenUids:yr,overlapMode:_r}=_t,Gr=this.boxCells[Re];if(Gr!==null){let je=this.bboxes;for(let Ye of Gr)if(!yr.box[Ye]){yr.box[Ye]=!0;let at=4*Ye,ct=this.boxKeys[Ye];if(this._circleAndRectCollide(Zt.x,Zt.y,Zt.radius,je[at+0],je[at+1],je[at+2],je[at+3])&&(!Rt||Rt(ct))&&!hr(_r,ct.overlapMode))return ut.push(!0),!0}}let Qr=this.circleCells[Re];if(Qr!==null){let je=this.circles;for(let Ye of Qr)if(!yr.circle[Ye]){yr.circle[Ye]=!0;let at=3*Ye,ct=this.circleKeys[Ye];if(this._circlesCollide(je[at],je[at+1],je[at+2],Zt.x,Zt.y,Zt.radius)&&(!Rt||Rt(ct))&&!hr(_r,ct.overlapMode))return ut.push(!0),!0}}}_forEachCell(I,ne,be,Ae,Re,ut,_t,Rt){let Zt=this._convertToXCellCoord(I),yr=this._convertToYCellCoord(ne),_r=this._convertToXCellCoord(be),Gr=this._convertToYCellCoord(Ae);for(let Qr=Zt;Qr<=_r;Qr++)for(let je=yr;je<=Gr;je++)if(Re.call(this,I,ne,be,Ae,this.xCellCount*je+Qr,ut,_t,Rt))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ne,be,Ae,Re,ut){let _t=Ae-I,Rt=Re-ne,Zt=be+ut;return Zt*Zt>_t*_t+Rt*Rt}_circleAndRectCollide(I,ne,be,Ae,Re,ut,_t){let Rt=(ut-Ae)/2,Zt=Math.abs(I-(Ae+Rt));if(Zt>Rt+be)return!1;let yr=(_t-Re)/2,_r=Math.abs(ne-(Re+yr));if(_r>yr+be)return!1;if(Zt<=Rt||_r<=yr)return!0;let Gr=Zt-Rt,Qr=_r-yr;return Gr*Gr+Qr*Qr<=be*be}}function wr(De,I,ne,be,Ae){let Re=t.H();return I?(t.K(Re,Re,[1/Ae,1/Ae,1]),ne||t.ad(Re,Re,be.angle)):t.L(Re,be.labelPlaneMatrix,De),Re}function Er(De,I,ne,be,Ae){if(I){let Re=t.ae(De);return t.K(Re,Re,[Ae,Ae,1]),ne||t.ad(Re,Re,-be.angle),Re}return be.glCoordMatrix}function mt(De,I,ne,be){let Ae;be?(Ae=[De,I,be(De,I),1],t.af(Ae,Ae,ne)):(Ae=[De,I,0,1],ar(Ae,Ae,ne));let Re=Ae[3];return{point:new t.P(Ae[0]/Re,Ae[1]/Re),signedDistanceFromCamera:Re,isOccluded:!1}}function ze(De,I){return .5+De/I*.5}function Ze(De,I){return De.x>=-I[0]&&De.x<=I[0]&&De.y>=-I[1]&&De.y<=I[1]}function we(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr,je){let Ye=be?De.textSizeData:De.iconSizeData,at=t.ag(Ye,ne.transform.zoom),ct=[256/ne.width*2+1,256/ne.height*2+1],At=be?De.text.dynamicLayoutVertexArray:De.icon.dynamicLayoutVertexArray;At.clear();let yt=De.lineVertexArray,Ct=be?De.text.placedSymbolArray:De.icon.placedSymbolArray,nr=ne.transform.width/ne.transform.height,vr=!1;for(let Tr=0;TrMath.abs(ne.x-I.x)*be?{useVertical:!0}:(De===t.ah.vertical?I.yne.x)?{needsFlipping:!0}:null}function He(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr){let _r=ne/24,Gr=I.lineOffsetX*_r,Qr=I.lineOffsetY*_r,je;if(I.numGlyphs>1){let Ye=I.glyphStartIndex+I.numGlyphs,at=I.lineStartIndex,ct=I.lineStartIndex+I.lineLength,At=ke(_r,_t,Gr,Qr,be,I,yr,De);if(!At)return{notEnoughRoom:!0};let yt=mt(At.first.point.x,At.first.point.y,ut,De.getElevation).point,Ct=mt(At.last.point.x,At.last.point.y,ut,De.getElevation).point;if(Ae&&!be){let nr=Be(I.writingMode,yt,Ct,Zt);if(nr)return nr}je=[At.first];for(let nr=I.glyphStartIndex+1;nr0?yt.point:(function(vr,Tr,Fr,Xr,oa,ga){return nt(vr,Tr,Fr,1,oa,ga)})(De.tileAnchorPoint,At,at,0,Re,De),nr=Be(I.writingMode,at,Ct,Zt);if(nr)return nr}let Ye=Ot(_r*_t.getoffsetX(I.glyphStartIndex),Gr,Qr,be,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,De,yr);if(!Ye||De.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};je=[Ye]}for(let Ye of je)t.aj(Rt,Ye.point,Ye.angle);return{}}function nt(De,I,ne,be,Ae,Re){let ut=De.add(De.sub(I)._unit()),_t=Ae!==void 0?mt(ut.x,ut.y,Ae,Re.getElevation).point:Ft(ut.x,ut.y,Re).point,Rt=ne.sub(_t);return ne.add(Rt._mult(be/Rt.mag()))}function ot(De,I,ne){let be=I.projectionCache;if(be.projections[De])return be.projections[De];let Ae=new t.P(I.lineVertexArray.getx(De),I.lineVertexArray.gety(De)),Re=Ft(Ae.x,Ae.y,I);if(Re.signedDistanceFromCamera>0)return be.projections[De]=Re.point,be.anyProjectionOccluded=be.anyProjectionOccluded||Re.isOccluded,Re.point;let ut=De-ne.direction;return(function(_t,Rt,Zt,yr,_r){return nt(_t,Rt,Zt,yr,void 0,_r)})(ne.distanceFromAnchor===0?I.tileAnchorPoint:new t.P(I.lineVertexArray.getx(ut),I.lineVertexArray.gety(ut)),Ae,ne.previousVertex,ne.absOffsetX-ne.distanceFromAnchor+1,I)}function Ft(De,I,ne){let be=De+ne.translation[0],Ae=I+ne.translation[1],Re;return!ne.pitchWithMap&&ne.projection.useSpecialProjectionForSymbols?(Re=ne.projection.projectTileCoordinates(be,Ae,ne.unwrappedTileID,ne.getElevation),Re.point.x=(.5*Re.point.x+.5)*ne.width,Re.point.y=(.5*-Re.point.y+.5)*ne.height):(Re=mt(be,Ae,ne.labelPlaneMatrix,ne.getElevation),Re.isOccluded=!1),Re}function Mt(De,I,ne){return De._unit()._perp()._mult(I*ne)}function Et(De,I,ne,be,Ae,Re,ut,_t,Rt){if(_t.projectionCache.offsets[De])return _t.projectionCache.offsets[De];let Zt=ne.add(I);if(De+Rt.direction=Ae)return _t.projectionCache.offsets[De]=Zt,Zt;let yr=ot(De+Rt.direction,_t,Rt),_r=Mt(yr.sub(ne),ut,Rt.direction),Gr=ne.add(_r),Qr=yr.add(_r);return _t.projectionCache.offsets[De]=t.ak(Re,Zt,Gr,Qr)||Zt,_t.projectionCache.offsets[De]}function Ot(De,I,ne,be,Ae,Re,ut,_t,Rt){let Zt=be?De-I:De+I,yr=Zt>0?1:-1,_r=0;be&&(yr*=-1,_r=Math.PI),yr<0&&(_r+=Math.PI);let Gr,Qr=yr>0?Re+Ae:Re+Ae+1;_t.projectionCache.cachedAnchorPoint?Gr=_t.projectionCache.cachedAnchorPoint:(Gr=Ft(_t.tileAnchorPoint.x,_t.tileAnchorPoint.y,_t).point,_t.projectionCache.cachedAnchorPoint=Gr);let je,Ye,at=Gr,ct=Gr,At=0,yt=0,Ct=Math.abs(Zt),nr=[],vr;for(;At+yt<=Ct;){if(Qr+=yr,Qr=ut)return null;At+=yt,ct=at,Ye=je;let Xr={absOffsetX:Ct,direction:yr,distanceFromAnchor:At,previousVertex:ct};if(at=ot(Qr,_t,Xr),ne===0)nr.push(ct),vr=at.sub(ct);else{let oa,ga=at.sub(ct);oa=ga.mag()===0?Mt(ot(Qr+yr,_t,Xr).sub(at),ne,yr):Mt(ga,ne,yr),Ye||(Ye=ct.add(oa)),je=Et(Qr,oa,at,Re,ut,Ye,ne,_t,Xr),nr.push(Ye),vr=je.sub(Ye)}yt=vr.mag()}let Tr=vr._mult((Ct-At)/yt)._add(Ye||ct),Fr=_r+Math.atan2(at.y-ct.y,at.x-ct.x);return nr.push(Tr),{point:Tr,angle:Rt?Fr:0,path:nr}}let sr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ir(De,I){for(let ne=0;ne=1;Mi--)Kn.push(Dn.path[Mi]);for(let Mi=1;Miso.signedDistanceFromCamera<=0)?[]:Mi.map(so=>so.point)}let zi=[];if(Kn.length>0){let Mi=Kn[0].clone(),so=Kn[0].clone();for(let jo=1;jo=ga.x&&so.x<=Ma.x&&Mi.y>=ga.y&&so.y<=Ma.y?[Kn]:so.xMa.x||so.yMa.y?[]:t.al([Kn],ga.x,ga.y,Ma.x,Ma.y)}for(let Mi of zi){en.reset(Mi,.25*oa);let so=0;so=en.length<=.5*oa?1:Math.ceil(en.paddedLength/vi)+1;for(let jo=0;jomt(Ae.x,Ae.y,be,ne.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let ne=[],be=1/0,Ae=1/0,Re=-1/0,ut=-1/0;for(let yr of I){let _r=new t.P(yr.x+Mr,yr.y+Mr);be=Math.min(be,_r.x),Ae=Math.min(Ae,_r.y),Re=Math.max(Re,_r.x),ut=Math.max(ut,_r.y),ne.push(_r)}let _t=this.grid.query(be,Ae,Re,ut).concat(this.ignoredGrid.query(be,Ae,Re,ut)),Rt={},Zt={};for(let yr of _t){let _r=yr.key;if(Rt[_r.bucketInstanceId]===void 0&&(Rt[_r.bucketInstanceId]={}),Rt[_r.bucketInstanceId][_r.featureIndex])continue;let Gr=[new t.P(yr.x1,yr.y1),new t.P(yr.x2,yr.y1),new t.P(yr.x2,yr.y2),new t.P(yr.x1,yr.y2)];t.am(ne,Gr)&&(Rt[_r.bucketInstanceId][_r.featureIndex]=!0,Zt[_r.bucketInstanceId]===void 0&&(Zt[_r.bucketInstanceId]=[]),Zt[_r.bucketInstanceId].push(_r.featureIndex))}return Zt}insertCollisionBox(I,ne,be,Ae,Re,ut){(be?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ae,featureIndex:Re,collisionGroupID:ut,overlapMode:ne},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ne,be,Ae,Re,ut){let _t=be?this.ignoredGrid:this.grid,Rt={bucketInstanceId:Ae,featureIndex:Re,collisionGroupID:ut,overlapMode:ne};for(let Zt=0;Zt=this.screenRightBoundary||Aethis.screenBottomBoundary}isInsideGrid(I,ne,be,Ae){return be>=0&&I=0&&nethis.projectAndGetPerspectiveRatio(be,oa.x,oa.y,Ae,Zt));Fr=Xr.some(oa=>!oa.isOccluded),Tr=Xr.map(oa=>oa.point)}else Fr=!0;return{box:t.ao(Tr),allPointsOccluded:!Fr}}}function Ca(De,I,ne){return I*(t.X/(De.tileSize*Math.pow(2,ne-De.tileID.overscaledZ)))}class Aa{constructor(I,ne,be,Ae){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ne:-ne))):Ae&&be?1:0,this.placed=be}isHidden(){return this.opacity===0&&!this.placed}}class Da{constructor(I,ne,be,Ae,Re){this.text=new Aa(I?I.text:null,ne,be,Re),this.icon=new Aa(I?I.icon:null,ne,Ae,Re)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ba{constructor(I,ne,be){this.text=I,this.icon=ne,this.skipFade=be}}class ba{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class rn{constructor(I,ne,be,Ae,Re){this.bucketInstanceId=I,this.featureIndex=ne,this.sourceLayerIndex=be,this.bucketIndex=Ae,this.tileID=Re}}class vn{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){let ne=++this.maxGroupID;this.collisionGroups[I]={ID:ne,predicate:be=>be.collisionGroupID===ne}}return this.collisionGroups[I]}}function Wt(De,I,ne,be,Ae){let{horizontalAlign:Re,verticalAlign:ut}=t.au(De);return new t.P(-(Re-.5)*I+be[0]*Ae,-(ut-.5)*ne+be[1]*Ae)}class Lt{constructor(I,ne,be,Ae,Re,ut){this.transform=I.clone(),this.terrain=be,this.collisionIndex=new ma(this.transform,ne),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ae,this.retainedQueryData={},this.collisionGroups=new vn(Re),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ut,ut&&(ut.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){let ne=this.terrain;return ne?(be,Ae)=>ne.getElevation(I,be,Ae):null}getBucketParts(I,ne,be,Ae){let Re=be.getBucket(ne),ut=be.latestFeatureIndex;if(!Re||!ut||ne.id!==Re.layerIds[0])return;let _t=be.collisionBoxArray,Rt=Re.layers[0].layout,Zt=Re.layers[0].paint,yr=Math.pow(2,this.transform.zoom-be.tileID.overscaledZ),_r=be.tileSize/t.X,Gr=be.tileID.toUnwrapped(),Qr=this.transform.calculatePosMatrix(Gr),je=Rt.get("text-pitch-alignment")==="map",Ye=Rt.get("text-rotation-alignment")==="map",at=Ca(be,1,this.transform.zoom),ct=this.collisionIndex.mapProjection.translatePosition(this.transform,be,Zt.get("text-translate"),Zt.get("text-translate-anchor")),At=this.collisionIndex.mapProjection.translatePosition(this.transform,be,Zt.get("icon-translate"),Zt.get("icon-translate-anchor")),yt=wr(Qr,je,Ye,this.transform,at),Ct=null;if(je){let vr=Er(Qr,je,Ye,this.transform,at);Ct=t.L([],this.transform.labelPlaneMatrix,vr)}this.retainedQueryData[Re.bucketInstanceId]=new rn(Re.bucketInstanceId,ut,Re.sourceLayerIndex,Re.index,be.tileID);let nr={bucket:Re,layout:Rt,translationText:ct,translationIcon:At,posMatrix:Qr,unwrappedTileID:Gr,textLabelPlaneMatrix:yt,labelToScreenMatrix:Ct,scale:yr,textPixelRatio:_r,holdingForFade:be.holdingForFade(),collisionBoxArray:_t,partiallyEvaluatedTextSize:t.ag(Re.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Re.sourceID)};if(Ae)for(let vr of Re.sortKeyRanges){let{sortKey:Tr,symbolInstanceStart:Fr,symbolInstanceEnd:Xr}=vr;I.push({sortKey:Tr,symbolInstanceStart:Fr,symbolInstanceEnd:Xr,parameters:nr})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Re.symbolInstances.length,parameters:nr})}attemptAnchorPlacement(I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr,je,Ye,at,ct,At,yt){let Ct=t.aq[I.textAnchor],nr=[I.textOffset0,I.textOffset1],vr=Wt(Ct,be,Ae,nr,Re),Tr=this.collisionIndex.placeCollisionBox(ne,Gr,Rt,Zt,yr,_t,ut,at,_r.predicate,yt,vr);if((!At||this.collisionIndex.placeCollisionBox(At,Gr,Rt,Zt,yr,_t,ut,ct,_r.predicate,yt,vr).placeable)&&Tr.placeable){let Fr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Qr.crossTileID]&&this.prevPlacement.placements[Qr.crossTileID]&&this.prevPlacement.placements[Qr.crossTileID].text&&(Fr=this.prevPlacement.variableOffsets[Qr.crossTileID].anchor),Qr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Qr.crossTileID]={textOffset:nr,width:be,height:Ae,anchor:Ct,textBoxScale:Re,prevAnchor:Fr},this.markUsedJustification(je,Ct,Qr,Ye),je.allowVerticalPlacement&&(this.markUsedOrientation(je,Ye,Qr),this.placedOrientations[Qr.crossTileID]=Ye),{shift:vr,placedGlyphBoxes:Tr}}}placeLayerBucketPart(I,ne,be){let{bucket:Ae,layout:Re,translationText:ut,translationIcon:_t,posMatrix:Rt,unwrappedTileID:Zt,textLabelPlaneMatrix:yr,labelToScreenMatrix:_r,textPixelRatio:Gr,holdingForFade:Qr,collisionBoxArray:je,partiallyEvaluatedTextSize:Ye,collisionGroup:at}=I.parameters,ct=Re.get("text-optional"),At=Re.get("icon-optional"),yt=t.ar(Re,"text-overlap","text-allow-overlap"),Ct=yt==="always",nr=t.ar(Re,"icon-overlap","icon-allow-overlap"),vr=nr==="always",Tr=Re.get("text-rotation-alignment")==="map",Fr=Re.get("text-pitch-alignment")==="map",Xr=Re.get("icon-text-fit")!=="none",oa=Re.get("symbol-z-order")==="viewport-y",ga=Ct&&(vr||!Ae.hasIconData()||At),Ma=vr&&(Ct||!Ae.hasTextData()||ct);!Ae.collisionArrays&&je&&Ae.deserializeCollisionBoxes(je);let en=this._getTerrainElevationFunc(this.retainedQueryData[Ae.bucketInstanceId].tileID),Dn=(In,Kn,vi)=>{var zi,Mi;if(ne[In.crossTileID])return;if(Qr)return void(this.placements[In.crossTileID]=new Ba(!1,!1,!1));let so=!1,jo=!1,uo=!0,Co=null,Xo={box:null,placeable:!1,offscreen:null},Us={box:null,placeable:!1,offscreen:null},Is=null,Io=null,Ro=null,ol=0,Ml=0,ru=0;Kn.textFeatureIndex?ol=Kn.textFeatureIndex:In.useRuntimeCollisionCircles&&(ol=In.featureIndex),Kn.verticalTextFeatureIndex&&(Ml=Kn.verticalTextFeatureIndex);let jl=Kn.textBox;if(jl){let pl=Je=>{let ft=t.ah.horizontal;if(Ae.allowVerticalPlacement&&!Je&&this.prevPlacement){let pt=this.prevPlacement.placedOrientations[In.crossTileID];pt&&(this.placedOrientations[In.crossTileID]=pt,ft=pt,this.markUsedOrientation(Ae,ft,In))}return ft},ml=(Je,ft)=>{if(Ae.allowVerticalPlacement&&In.numVerticalGlyphVertices>0&&Kn.verticalTextBox){for(let pt of Ae.writingModes)if(pt===t.ah.vertical?(Xo=ft(),Us=Xo):Xo=Je(),Xo&&Xo.placeable)break}else Xo=Je()},pe=In.textAnchorOffsetStartIndex,Ie=In.textAnchorOffsetEndIndex;if(Ie===pe){let Je=(ft,pt)=>{let xt=this.collisionIndex.placeCollisionBox(ft,yt,Gr,Rt,Zt,Fr,Tr,ut,at.predicate,en);return xt&&xt.placeable&&(this.markUsedOrientation(Ae,pt,In),this.placedOrientations[In.crossTileID]=pt),xt};ml(()=>Je(jl,t.ah.horizontal),()=>{let ft=Kn.verticalTextBox;return Ae.allowVerticalPlacement&&In.numVerticalGlyphVertices>0&&ft?Je(ft,t.ah.vertical):{box:null,offscreen:null}}),pl(Xo&&Xo.placeable)}else{let Je=t.aq[(Mi=(zi=this.prevPlacement)===null||zi===void 0?void 0:zi.variableOffsets[In.crossTileID])===null||Mi===void 0?void 0:Mi.anchor],ft=(xt,Jt,Pt)=>{let dr=xt.x2-xt.x1,Nr=xt.y2-xt.y1,Vr=In.textBoxScale,va=Xr&&nr==="never"?Jt:null,sa=null,qa=yt==="never"?1:2,Wa="never";Je&&qa++;for(let ya=0;yaft(jl,Kn.iconBox,t.ah.horizontal),()=>{let xt=Kn.verticalTextBox;return Ae.allowVerticalPlacement&&(!Xo||!Xo.placeable)&&In.numVerticalGlyphVertices>0&&xt?ft(xt,Kn.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Xo&&(so=Xo.placeable,uo=Xo.offscreen);let pt=pl(Xo&&Xo.placeable);if(!so&&this.prevPlacement){let xt=this.prevPlacement.variableOffsets[In.crossTileID];xt&&(this.variableOffsets[In.crossTileID]=xt,this.markUsedJustification(Ae,xt.anchor,In,pt))}}}if(Is=Xo,so=Is&&Is.placeable,uo=Is&&Is.offscreen,In.useRuntimeCollisionCircles){let pl=Ae.text.placedSymbolArray.get(In.centerJustifiedTextSymbolIndex),ml=t.ai(Ae.textSizeData,Ye,pl),pe=Re.get("text-padding");Io=this.collisionIndex.placeCollisionCircles(yt,pl,Ae.lineVertexArray,Ae.glyphOffsetArray,ml,Rt,Zt,yr,_r,be,Fr,at.predicate,In.collisionCircleDiameter,pe,ut,en),Io.circles.length&&Io.collisionDetected&&!be&&t.w("Collisions detected, but collision boxes are not shown"),so=Ct||Io.circles.length>0&&!Io.collisionDetected,uo=uo&&Io.offscreen}if(Kn.iconFeatureIndex&&(ru=Kn.iconFeatureIndex),Kn.iconBox){let pl=ml=>this.collisionIndex.placeCollisionBox(ml,nr,Gr,Rt,Zt,Fr,Tr,_t,at.predicate,en,Xr&&Co?Co:void 0);Us&&Us.placeable&&Kn.verticalIconBox?(Ro=pl(Kn.verticalIconBox),jo=Ro.placeable):(Ro=pl(Kn.iconBox),jo=Ro.placeable),uo=uo&&Ro.offscreen}let Qs=ct||In.numHorizontalGlyphVertices===0&&In.numVerticalGlyphVertices===0,Fl=At||In.numIconVertices===0;Qs||Fl?Fl?Qs||(jo=jo&&so):so=jo&&so:jo=so=jo&&so;let Cu=jo&&Ro.placeable;if(so&&Is.placeable&&this.collisionIndex.insertCollisionBox(Is.box,yt,Re.get("text-ignore-placement"),Ae.bucketInstanceId,Us&&Us.placeable&&Ml?Ml:ol,at.ID),Cu&&this.collisionIndex.insertCollisionBox(Ro.box,nr,Re.get("icon-ignore-placement"),Ae.bucketInstanceId,ru,at.ID),Io&&so&&this.collisionIndex.insertCollisionCircles(Io.circles,yt,Re.get("text-ignore-placement"),Ae.bucketInstanceId,ol,at.ID),be&&this.storeCollisionData(Ae.bucketInstanceId,vi,Kn,Is,Ro,Io),In.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ae.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[In.crossTileID]=new Ba(so||ga,jo||Ma,uo||Ae.justReloaded),ne[In.crossTileID]=!0};if(oa){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let In=Ae.getSortedSymbolIndexes(this.transform.angle);for(let Kn=In.length-1;Kn>=0;--Kn){let vi=In[Kn];Dn(Ae.symbolInstances.get(vi),Ae.collisionArrays[vi],vi)}}else for(let In=I.symbolInstanceStart;In=0&&(I.text.placedSymbolArray.get(_t).crossTileID=Re>=0&&_t!==Re?0:be.crossTileID)}markUsedOrientation(I,ne,be){let Ae=ne===t.ah.horizontal||ne===t.ah.horizontalOnly?ne:0,Re=ne===t.ah.vertical?ne:0,ut=[be.leftJustifiedTextSymbolIndex,be.centerJustifiedTextSymbolIndex,be.rightJustifiedTextSymbolIndex];for(let _t of ut)I.text.placedSymbolArray.get(_t).placedOrientation=Ae;be.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(be.verticalPlacedTextSymbolIndex).placedOrientation=Re)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;let ne=this.prevPlacement,be=!1;this.prevZoomAdjustment=ne?ne.zoomAdjustment(this.transform.zoom):0;let Ae=ne?ne.symbolFadeChange(I):1,Re=ne?ne.opacities:{},ut=ne?ne.variableOffsets:{},_t=ne?ne.placedOrientations:{};for(let Rt in this.placements){let Zt=this.placements[Rt],yr=Re[Rt];yr?(this.opacities[Rt]=new Da(yr,Ae,Zt.text,Zt.icon),be=be||Zt.text!==yr.text.placed||Zt.icon!==yr.icon.placed):(this.opacities[Rt]=new Da(null,Ae,Zt.text,Zt.icon,Zt.skipFade),be=be||Zt.text||Zt.icon)}for(let Rt in Re){let Zt=Re[Rt];if(!this.opacities[Rt]){let yr=new Da(Zt,Ae,!1,!1);yr.isHidden()||(this.opacities[Rt]=yr,be=be||Zt.text.placed||Zt.icon.placed)}}for(let Rt in ut)this.variableOffsets[Rt]||!this.opacities[Rt]||this.opacities[Rt].isHidden()||(this.variableOffsets[Rt]=ut[Rt]);for(let Rt in _t)this.placedOrientations[Rt]||!this.opacities[Rt]||this.opacities[Rt].isHidden()||(this.placedOrientations[Rt]=_t[Rt]);if(ne&&ne.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");be?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ne?ne.lastPlacementChangeTime:I)}updateLayerOpacities(I,ne){let be={};for(let Ae of ne){let Re=Ae.getBucket(I);Re&&Ae.latestFeatureIndex&&I.id===Re.layerIds[0]&&this.updateBucketOpacities(Re,Ae.tileID,be,Ae.collisionBoxArray)}}updateBucketOpacities(I,ne,be,Ae){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();let Re=I.layers[0],ut=Re.layout,_t=new Da(null,0,!1,!1,!0),Rt=ut.get("text-allow-overlap"),Zt=ut.get("icon-allow-overlap"),yr=Re._unevaluatedLayout.hasValue("text-variable-anchor")||Re._unevaluatedLayout.hasValue("text-variable-anchor-offset"),_r=ut.get("text-rotation-alignment")==="map",Gr=ut.get("text-pitch-alignment")==="map",Qr=ut.get("icon-text-fit")!=="none",je=new Da(null,0,Rt&&(Zt||!I.hasIconData()||ut.get("icon-optional")),Zt&&(Rt||!I.hasTextData()||ut.get("text-optional")),!0);!I.collisionArrays&&Ae&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(Ae);let Ye=(ct,At,yt)=>{for(let Ct=0;Ct0,Fr=this.placedOrientations[At.crossTileID],Xr=Fr===t.ah.vertical,oa=Fr===t.ah.horizontal||Fr===t.ah.horizontalOnly;if(yt>0||Ct>0){let Ma=Ua(vr.text);Ye(I.text,yt,Xr?Xa:Ma),Ye(I.text,Ct,oa?Xa:Ma);let en=vr.text.isHidden();[At.rightJustifiedTextSymbolIndex,At.centerJustifiedTextSymbolIndex,At.leftJustifiedTextSymbolIndex].forEach(Kn=>{Kn>=0&&(I.text.placedSymbolArray.get(Kn).hidden=en||Xr?1:0)}),At.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(At.verticalPlacedTextSymbolIndex).hidden=en||oa?1:0);let Dn=this.variableOffsets[At.crossTileID];Dn&&this.markUsedJustification(I,Dn.anchor,At,Fr);let In=this.placedOrientations[At.crossTileID];In&&(this.markUsedJustification(I,"left",At,In),this.markUsedOrientation(I,In,At))}if(Tr){let Ma=Ua(vr.icon),en=!(Qr&&At.verticalPlacedIconSymbolIndex&&Xr);At.placedIconSymbolIndex>=0&&(Ye(I.icon,At.numIconVertices,en?Ma:Xa),I.icon.placedSymbolArray.get(At.placedIconSymbolIndex).hidden=vr.icon.isHidden()),At.verticalPlacedIconSymbolIndex>=0&&(Ye(I.icon,At.numVerticalIconVertices,en?Xa:Ma),I.icon.placedSymbolArray.get(At.verticalPlacedIconSymbolIndex).hidden=vr.icon.isHidden())}let ga=at&&at.has(ct)?at.get(ct):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){let Ma=I.collisionArrays[ct];if(Ma){let en=new t.P(0,0);if(Ma.textBox||Ma.verticalTextBox){let Dn=!0;if(yr){let In=this.variableOffsets[nr];In?(en=Wt(In.anchor,In.width,In.height,In.textOffset,In.textBoxScale),_r&&en._rotate(Gr?this.transform.angle:-this.transform.angle)):Dn=!1}if(Ma.textBox||Ma.verticalTextBox){let In;Ma.textBox&&(In=Xr),Ma.verticalTextBox&&(In=oa),Ht(I.textCollisionBox.collisionVertexArray,vr.text.placed,!Dn||In,ga.text,en.x,en.y)}}if(Ma.iconBox||Ma.verticalIconBox){let Dn=!!(!oa&&Ma.verticalIconBox),In;Ma.iconBox&&(In=Dn),Ma.verticalIconBox&&(In=!Dn),Ht(I.iconCollisionBox.collisionVertexArray,vr.icon.placed,In,ga.icon,Qr?en.x:0,Qr?en.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){let ct=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=ct.invProjMatrix,I.placementViewportMatrix=ct.viewportMatrix,I.collisionCircleArray=ct.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTimeI}setStale(){this.stale=!0}}function Ht(De,I,ne,be,Ae,Re){be&&be.length!==0||(be=[0,0,0,0]);let ut=be[0]-Mr,_t=be[1]-Mr,Rt=be[2]-Mr,Zt=be[3]-Mr;De.emplaceBack(I?1:0,ne?1:0,Ae||0,Re||0,ut,_t),De.emplaceBack(I?1:0,ne?1:0,Ae||0,Re||0,Rt,_t),De.emplaceBack(I?1:0,ne?1:0,Ae||0,Re||0,Rt,Zt),De.emplaceBack(I?1:0,ne?1:0,Ae||0,Re||0,ut,Zt)}let Xt=Math.pow(2,25),Pr=Math.pow(2,24),Yr=Math.pow(2,17),Kr=Math.pow(2,16),na=Math.pow(2,9),La=Math.pow(2,8),Ga=Math.pow(2,1);function Ua(De){if(De.opacity===0&&!De.placed)return 0;if(De.opacity===1&&De.placed)return 4294967295;let I=De.placed?1:0,ne=Math.floor(127*De.opacity);return ne*Xt+I*Pr+ne*Yr+I*Kr+ne*na+I*La+ne*Ga+I}let Xa=0;function an(){return{isOccluded:(De,I,ne)=>!1,getPitchedTextCorrection:(De,I,ne)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(De,I,ne,be){throw new Error("Not implemented.")},translatePosition:(De,I,ne,be)=>(function(Ae,Re,ut,_t,Rt=!1){if(!ut[0]&&!ut[1])return[0,0];let Zt=Rt?_t==="map"?Ae.angle:0:_t==="viewport"?-Ae.angle:0;if(Zt){let yr=Math.sin(Zt),_r=Math.cos(Zt);ut=[ut[0]*_r-ut[1]*yr,ut[0]*yr+ut[1]*_r]}return[Rt?ut[0]:Ca(Re,ut[0],Ae.zoom),Rt?ut[1]:Ca(Re,ut[1],Ae.zoom)]})(De,I,ne,be),getCircleRadiusCorrection:De=>1}}class Sa{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ne,be,Ae,Re){let ut=this._bucketParts;for(;this._currentTileIndex_t.sortKey-Rt.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-Ae>2;for(;this._currentPlacementIndex>=0;){let ut=ne[I[this._currentPlacementIndex]],_t=this.placement.collisionIndex.transform.zoom;if(ut.type==="symbol"&&(!ut.minzoom||ut.minzoom<=_t)&&(!ut.maxzoom||ut.maxzoom>_t)){if(this._inProgressLayer||(this._inProgressLayer=new Sa(ut)),this._inProgressLayer.continuePlacement(be[ut.source],this.placement,this._showCollisionBoxes,ut,Re))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}let Wn=512/t.X/2;class ti{constructor(I,ne,be){this.tileID=I,this.bucketInstanceId=be,this._symbolsByKey={};let Ae=new Map;for(let Re=0;Re({x:Math.floor(Rt.anchorX*Wn),y:Math.floor(Rt.anchorY*Wn)})),crossTileIDs:ut.map(Rt=>Rt.crossTileID)};if(_t.positions.length>128){let Rt=new t.av(_t.positions.length,16,Uint16Array);for(let{x:Zt,y:yr}of _t.positions)Rt.add(Zt,yr);Rt.finish(),delete _t.positions,_t.index=Rt}this._symbolsByKey[Re]=_t}}getScaledCoordinates(I,ne){let{x:be,y:Ae,z:Re}=this.tileID.canonical,{x:ut,y:_t,z:Rt}=ne.canonical,Zt=Wn/Math.pow(2,Rt-Re),yr=(_t*t.X+I.anchorY)*Zt,_r=Ae*t.X*Wn;return{x:Math.floor((ut*t.X+I.anchorX)*Zt-be*t.X*Wn),y:Math.floor(yr-_r)}}findMatches(I,ne,be){let Ae=this.tileID.canonical.zI)}}class gt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class it{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){let ne=Math.round((I-this.lng)/360);if(ne!==0)for(let be in this.indexes){let Ae=this.indexes[be],Re={};for(let ut in Ae){let _t=Ae[ut];_t.tileID=_t.tileID.unwrapTo(_t.tileID.wrap+ne),Re[_t.tileID.key]=_t}this.indexes[be]=Re}this.lng=I}addBucket(I,ne,be){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ne.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Re=0;ReI.overscaledZ)for(let _t in ut){let Rt=ut[_t];Rt.tileID.isChildOf(I)&&Rt.findMatches(ne.symbolInstances,I,Ae)}else{let _t=ut[I.scaledTo(Number(Re)).key];_t&&_t.findMatches(ne.symbolInstances,I,Ae)}}for(let Re=0;Re{ne[be]=!0});for(let be in this.layerIndexes)ne[be]||delete this.layerIndexes[be]}}let Ar=(De,I)=>t.t(De,I&&I.filter(ne=>ne.identifier!=="source.canvas")),pr=t.aw();class kr extends t.E{constructor(I,ne={}){super(),this._rtlPluginLoaded=()=>{for(let be in this.sourceCaches){let Ae=this.sourceCaches[be].getSource().type;Ae!=="vector"&&Ae!=="geojson"||this.sourceCaches[be].reload()}},this.map=I,this.dispatcher=new ee(Y(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(be,Ae)=>this.getGlyphs(be,Ae)),this.dispatcher.registerMessageHandler("GI",(be,Ae)=>this.getImages(be,Ae)),this.imageManager=new m,this.imageManager.setEventedParent(this),this.glyphManager=new F(I._requestManager,ne.localIdeographFontFamily),this.lineAtlas=new X(256,512),this.crossTileSymbolIndex=new Rr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),We().on(ue,this._rtlPluginLoaded),this.on("data",be=>{if(be.dataType!=="source"||be.sourceDataType!=="metadata")return;let Ae=this.sourceCaches[be.sourceId];if(!Ae)return;let Re=Ae.getSource();if(Re&&Re.vectorLayerIds)for(let ut in this._layers){let _t=this._layers[ut];_t.source===Re.id&&this._validateLayer(_t)}})}loadURL(I,ne={},be){this.fire(new t.k("dataloading",{dataType:"style"})),ne.validate=typeof ne.validate!="boolean"||ne.validate;let Ae=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;let Re=this._loadStyleRequest;t.h(Ae,this._loadStyleRequest).then(ut=>{this._loadStyleRequest=null,this._load(ut.data,ne,be)}).catch(ut=>{this._loadStyleRequest=null,ut&&!Re.signal.aborted&&this.fire(new t.j(ut))})}loadJSON(I,ne={},be){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ne.validate=ne.validate!==!1,this._load(I,ne,be)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(pr,{validate:!1})}_load(I,ne,be){var Ae;let Re=ne.transformStyle?ne.transformStyle(be,I):I;if(!ne.validate||!Ar(this,t.u(Re))){this._loaded=!0,this.stylesheet=Re;for(let ut in Re.sources)this.addSource(ut,Re.sources[ut],{validate:!1});Re.sprite?this._loadSprite(Re.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Re.glyphs),this._createLayers(),this.light=new P(this.stylesheet.light),this.sky=new B(this.stylesheet.sky),this.map.setTerrain((Ae=this.stylesheet.terrain)!==null&&Ae!==void 0?Ae:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){let I=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ne=>ne.id),this._layers={},this._serializedLayers=null;for(let ne of I){let be=t.aA(ne);be.setEventedParent(this,{layer:{id:ne.id}}),this._layers[ne.id]=be}}_loadSprite(I,ne=!1,be=void 0){let Ae;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Re,ut,_t,Rt){return t._(this,void 0,void 0,function*(){let Zt=b(Re),yr=_t>1?"@2x":"",_r={},Gr={};for(let{id:Qr,url:je}of Zt){let Ye=ut.transformRequest(v(je,yr,".json"),"SpriteJSON");_r[Qr]=t.h(Ye,Rt);let at=ut.transformRequest(v(je,yr,".png"),"SpriteImage");Gr[Qr]=l.getImage(at,Rt)}return yield Promise.all([...Object.values(_r),...Object.values(Gr)]),(function(Qr,je){return t._(this,void 0,void 0,function*(){let Ye={};for(let at in Qr){Ye[at]={};let ct=i.getImageCanvasContext((yield je[at]).data),At=(yield Qr[at]).data;for(let yt in At){let{width:Ct,height:nr,x:vr,y:Tr,sdf:Fr,pixelRatio:Xr,stretchX:oa,stretchY:ga,content:Ma,textFitWidth:en,textFitHeight:Dn}=At[yt];Ye[at][yt]={data:null,pixelRatio:Xr,sdf:Fr,stretchX:oa,stretchY:ga,content:Ma,textFitWidth:en,textFitHeight:Dn,spriteData:{width:Ct,height:nr,x:vr,y:Tr,context:ct}}}}return Ye})})(_r,Gr)})})(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Re=>{if(this._spriteRequest=null,Re)for(let ut in Re){this._spritesImagesIds[ut]=[];let _t=this._spritesImagesIds[ut]?this._spritesImagesIds[ut].filter(Rt=>!(Rt in Re)):[];for(let Rt of _t)this.imageManager.removeImage(Rt),this._changedImages[Rt]=!0;for(let Rt in Re[ut]){let Zt=ut==="default"?Rt:`${ut}:${Rt}`;this._spritesImagesIds[ut].push(Zt),Zt in this.imageManager.images?this.imageManager.updateImage(Zt,Re[ut][Rt],!1):this.imageManager.addImage(Zt,Re[ut][Rt]),ne&&(this._changedImages[Zt]=!0)}}}).catch(Re=>{this._spriteRequest=null,Ae=Re,this.fire(new t.j(Ae))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ne&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),be&&be(Ae)})}_unloadSprite(){for(let I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(I){let ne=this.sourceCaches[I.source];if(!ne)return;let be=I.sourceLayer;if(!be)return;let Ae=ne.getSource();(Ae.type==="geojson"||Ae.vectorLayerIds&&Ae.vectorLayerIds.indexOf(be)===-1)&&this.fire(new t.j(new Error(`Source layer "${be}" does not exist on source "${Ae.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ne=!1){let be=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ne?t.aB(be):be);let Ae=[];for(let Re of I)if(be[Re]){let ut=ne?t.aB(be[Re]):be[Re];Ae.push(ut)}return Ae}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};let ne=Object.keys(this._layers);for(let be of ne){let Ae=this._layers[be];Ae.type!=="custom"&&(I[be]=Ae.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(let I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;let ne=this._changed;if(ne){let Ae=Object.keys(this._updatedLayers),Re=Object.keys(this._removedLayers);(Ae.length||Re.length)&&this._updateWorkerLayers(Ae,Re);for(let ut in this._updatedSources){let _t=this._updatedSources[ut];if(_t==="reload")this._reloadSource(ut);else{if(_t!=="clear")throw new Error(`Invalid action ${_t}`);this._clearSource(ut)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let ut in this._updatedPaintProps)this._layers[ut].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}let be={};for(let Ae in this.sourceCaches){let Re=this.sourceCaches[Ae];be[Ae]=Re.used,Re.used=!1}for(let Ae of this._order){let Re=this._layers[Ae];Re.recalculate(I,this._availableImages),!Re.isHidden(I.zoom)&&Re.source&&(this.sourceCaches[Re.source].used=!0)}for(let Ae in be){let Re=this.sourceCaches[Ae];!!be[Ae]!=!!Re.used&&Re.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ae}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ne&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let I=Object.keys(this._changedImages);if(I.length){for(let ne in this.sourceCaches)this.sourceCaches[ne].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ne){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ne})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ne={}){var be;this._checkLoaded();let Ae=this.serialize();if(I=ne.transformStyle?ne.transformStyle(Ae,I):I,((be=ne.validate)===null||be===void 0||be)&&Ar(this,t.u(I)))return!1;(I=t.aB(I)).layers=t.az(I.layers);let Re=t.aC(Ae,I),ut=this._getOperationsToPerform(Re);if(ut.unimplemented.length>0)throw new Error(`Unimplemented: ${ut.unimplemented.join(", ")}.`);if(ut.operations.length===0)return!1;for(let _t of ut.operations)_t();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){let ne=[],be=[];for(let Ae of I)switch(Ae.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ne.push(()=>this.addLayer.apply(this,Ae.args));break;case"removeLayer":ne.push(()=>this.removeLayer.apply(this,Ae.args));break;case"setPaintProperty":ne.push(()=>this.setPaintProperty.apply(this,Ae.args));break;case"setLayoutProperty":ne.push(()=>this.setLayoutProperty.apply(this,Ae.args));break;case"setFilter":ne.push(()=>this.setFilter.apply(this,Ae.args));break;case"addSource":ne.push(()=>this.addSource.apply(this,Ae.args));break;case"removeSource":ne.push(()=>this.removeSource.apply(this,Ae.args));break;case"setLayerZoomRange":ne.push(()=>this.setLayerZoomRange.apply(this,Ae.args));break;case"setLight":ne.push(()=>this.setLight.apply(this,Ae.args));break;case"setGeoJSONSourceData":ne.push(()=>this.setGeoJSONSourceData.apply(this,Ae.args));break;case"setGlyphs":ne.push(()=>this.setGlyphs.apply(this,Ae.args));break;case"setSprite":ne.push(()=>this.setSprite.apply(this,Ae.args));break;case"setSky":ne.push(()=>this.setSky.apply(this,Ae.args));break;case"setTerrain":ne.push(()=>this.map.setTerrain.apply(this,Ae.args));break;case"setTransition":ne.push(()=>{});break;default:be.push(Ae.command)}return{operations:ne,unimplemented:be}}addImage(I,ne){if(this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ne),this._afterImageUpdated(I)}updateImage(I,ne){this.imageManager.updateImage(I,ne)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(I,ne,be={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ne.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ne).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ne.type)>=0&&this._validate(t.u.source,`sources.${I}`,ne,null,be))return;this.map&&this.map._collectResourceTiming&&(ne.collectResourceTiming=!0);let Ae=this.sourceCaches[I]=new St(I,ne,this.dispatcher);Ae.style=this,Ae.setEventedParent(this,()=>({isSourceLoaded:Ae.loaded(),source:Ae.serialize(),sourceId:I})),Ae.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(let be in this._layers)if(this._layers[be].source===I)return this.fire(new t.j(new Error(`Source "${I}" cannot be removed while layer "${be}" is using it.`)));let ne=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ne.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ne.setEventedParent(null),ne.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ne){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);let be=this.sourceCaches[I].getSource();if(be.type!=="geojson")throw new Error(`geojsonSource.type is ${be.type}, which is !== 'geojson`);be.setData(ne),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ne,be={}){this._checkLoaded();let Ae=I.id;if(this.getLayer(Ae))return void this.fire(new t.j(new Error(`Layer "${Ae}" already exists on this map.`)));let Re;if(I.type==="custom"){if(Ar(this,t.aD(I)))return;Re=t.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(Ae,I.source),I=t.aB(I),I=t.e(I,{source:Ae})),this._validate(t.u.layer,`layers.${Ae}`,I,{arrayIndex:-1},be))return;Re=t.aA(I),this._validateLayer(Re),Re.setEventedParent(this,{layer:{id:Ae}})}let ut=ne?this._order.indexOf(ne):this._order.length;if(ne&&ut===-1)this.fire(new t.j(new Error(`Cannot add layer "${Ae}" before non-existing layer "${ne}".`)));else{if(this._order.splice(ut,0,Ae),this._layerOrderChanged=!0,this._layers[Ae]=Re,this._removedLayers[Ae]&&Re.source&&Re.type!=="custom"){let _t=this._removedLayers[Ae];delete this._removedLayers[Ae],_t.type!==Re.type?this._updatedSources[Re.source]="clear":(this._updatedSources[Re.source]="reload",this.sourceCaches[Re.source].pause())}this._updateLayer(Re),Re.onAdd&&Re.onAdd(this.map)}}moveLayer(I,ne){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new t.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ne)return;let be=this._order.indexOf(I);this._order.splice(be,1);let Ae=ne?this._order.indexOf(ne):this._order.length;ne&&Ae===-1?this.fire(new t.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ne}".`))):(this._order.splice(Ae,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();let ne=this._layers[I];if(!ne)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${I}".`)));ne.setEventedParent(null);let be=this._order.indexOf(I);this._order.splice(be,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ne,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ne.onRemove&&ne.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ne,be){this._checkLoaded();let Ae=this.getLayer(I);Ae?Ae.minzoom===ne&&Ae.maxzoom===be||(ne!=null&&(Ae.minzoom=ne),be!=null&&(Ae.maxzoom=be),this._updateLayer(Ae)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ne,be={}){this._checkLoaded();let Ae=this.getLayer(I);if(Ae){if(!t.aE(Ae.filter,ne))return ne==null?(Ae.filter=void 0,void this._updateLayer(Ae)):void(this._validate(t.u.filter,`layers.${Ae.id}.filter`,ne,null,be)||(Ae.filter=t.aB(ne),this._updateLayer(Ae)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return t.aB(this.getLayer(I).filter)}setLayoutProperty(I,ne,be,Ae={}){this._checkLoaded();let Re=this.getLayer(I);Re?t.aE(Re.getLayoutProperty(ne),be)||(Re.setLayoutProperty(ne,be,Ae),this._updateLayer(Re)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ne){let be=this.getLayer(I);if(be)return be.getLayoutProperty(ne);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ne,be,Ae={}){this._checkLoaded();let Re=this.getLayer(I);Re?t.aE(Re.getPaintProperty(ne),be)||(Re.setPaintProperty(ne,be,Ae)&&this._updateLayer(Re),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ne){return this.getLayer(I).getPaintProperty(ne)}setFeatureState(I,ne){this._checkLoaded();let be=I.source,Ae=I.sourceLayer,Re=this.sourceCaches[be];if(Re===void 0)return void this.fire(new t.j(new Error(`The source '${be}' does not exist in the map's style.`)));let ut=Re.getSource().type;ut==="geojson"&&Ae?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ut!=="vector"||Ae?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Re.setFeatureState(Ae,I.id,ne)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ne){this._checkLoaded();let be=I.source,Ae=this.sourceCaches[be];if(Ae===void 0)return void this.fire(new t.j(new Error(`The source '${be}' does not exist in the map's style.`)));let Re=Ae.getSource().type,ut=Re==="vector"?I.sourceLayer:void 0;Re!=="vector"||ut?ne&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Ae.removeFeatureState(ut,I.id,ne):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();let ne=I.source,be=I.sourceLayer,Ae=this.sourceCaches[ne];if(Ae!==void 0)return Ae.getSource().type!=="vector"||be?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ae.getFeatureState(be,I.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ne}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let I=t.aF(this.sourceCaches,Re=>Re.serialize()),ne=this._serializeByIds(this._order,!0),be=this.map.getTerrain()||void 0,Ae=this.stylesheet;return t.aG({version:Ae.version,name:Ae.name,metadata:Ae.metadata,light:Ae.light,sky:Ae.sky,center:Ae.center,zoom:Ae.zoom,bearing:Ae.bearing,pitch:Ae.pitch,sprite:Ae.sprite,glyphs:Ae.glyphs,transition:Ae.transition,sources:I,layers:ne,terrain:be},Re=>Re!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){let ne=ut=>this._layers[ut].type==="fill-extrusion",be={},Ae=[];for(let ut=this._order.length-1;ut>=0;ut--){let _t=this._order[ut];if(ne(_t)){be[_t]=ut;for(let Rt of I){let Zt=Rt[_t];if(Zt)for(let yr of Zt)Ae.push(yr)}}}Ae.sort((ut,_t)=>_t.intersectionZ-ut.intersectionZ);let Re=[];for(let ut=this._order.length-1;ut>=0;ut--){let _t=this._order[ut];if(ne(_t))for(let Rt=Ae.length-1;Rt>=0;Rt--){let Zt=Ae[Rt].feature;if(be[Zt.layer.id]{let Fr=ct.featureSortOrder;if(Fr){let Xr=Fr.indexOf(vr.featureIndex);return Fr.indexOf(Tr.featureIndex)-Xr}return Tr.featureIndex-vr.featureIndex});for(let vr of nr)Ct.push(vr)}}for(let ct in je)je[ct].forEach(At=>{let yt=At.feature,Ct=Zt[_t[ct].source].getFeatureState(yt.layer["source-layer"],yt.id);yt.source=yt.layer.source,yt.layer["source-layer"]&&(yt.sourceLayer=yt.layer["source-layer"]),yt.state=Ct});return je})(this._layers,ut,this.sourceCaches,I,ne,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Re)}querySourceFeatures(I,ne){ne&&ne.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ne.filter,null,ne);let be=this.sourceCaches[I];return be?(function(Ae,Re){let ut=Ae.getRenderableIds().map(Zt=>Ae.getTileByID(Zt)),_t=[],Rt={};for(let Zt=0;ZtGr.getTileByID(Qr)).sort((Qr,je)=>je.tileID.overscaledZ-Qr.tileID.overscaledZ||(Qr.tileID.isLessThan(je.tileID)?-1:1))}let _r=this.crossTileSymbolIndex.addLayer(yr,Rt[yr.source],I.center.lng);ut=ut||_r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Re=Re||this._layerOrderChanged||be===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),I.zoom))&&(this.pauseablePlacement=new Zn(I,this.map.terrain,this._order,Re,ne,be,Ae,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Rt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),_t=!0),ut&&this.pauseablePlacement.placement.setStale()),_t||ut)for(let Zt of this._order){let yr=this._layers[Zt];yr.type==="symbol"&&this.placement.updateLayerOpacities(yr,Rt[yr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(let I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ne){return t._(this,void 0,void 0,function*(){let be=yield this.imageManager.getImages(ne.icons);this._updateTilesForChangedImages();let Ae=this.sourceCaches[ne.source];return Ae&&Ae.setDependencies(ne.tileID.key,ne.type,ne.icons),be})}getGlyphs(I,ne){return t._(this,void 0,void 0,function*(){let be=yield this.glyphManager.getGlyphs(ne.stacks),Ae=this.sourceCaches[ne.source];return Ae&&Ae.setDependencies(ne.tileID.key,ne.type,[""]),be})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ne={}){this._checkLoaded(),I&&this._validate(t.u.glyphs,"glyphs",I,null,ne)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ne,be={},Ae){this._checkLoaded();let Re=[{id:I,url:ne}],ut=[...b(this.stylesheet.sprite),...Re];this._validate(t.u.sprite,"sprite",ut,null,be)||(this.stylesheet.sprite=ut,this._loadSprite(Re,!0,Ae))}removeSprite(I){this._checkLoaded();let ne=b(this.stylesheet.sprite);if(ne.find(be=>be.id===I)){if(this._spritesImagesIds[I])for(let be of this._spritesImagesIds[I])this.imageManager.removeImage(be),this._changedImages[be]=!0;ne.splice(ne.findIndex(be=>be.id===I),1),this.stylesheet.sprite=ne.length>0?ne:void 0,delete this._spritesImagesIds[I],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${I}" doesn't exists on this map.`)))}getSprite(){return b(this.stylesheet.sprite)}setSprite(I,ne={},be){this._checkLoaded(),I&&this._validate(t.u.sprite,"sprite",I,null,ne)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,be):(this._unloadSprite(),be&&be(null)))}}var zr=t.Y([{name:"a_pos",type:"Int16",components:2}]);let Ur={prelude:dt(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -3266,15 +3266,15 @@ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=frac #else return 0.0; #endif -}`),background:_t(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +}`),background:dt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:_t(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:dt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:_t(`varying vec3 v_data;varying float v_visibility; +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:dt(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur @@ -3310,7 +3310,7 @@ void main(void) { #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:_t("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:_t(`uniform highp float u_intensity;varying vec2 v_extrude; +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:dt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:dt(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { @@ -3327,11 +3327,11 @@ const highp float ZERO=1.0/255.0/16.0; void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:_t(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:dt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:_t("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:_t("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:_t("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:_t(`#pragma mapbox: define highp vec4 color +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:dt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:dt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:dt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:dt(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color @@ -3346,7 +3346,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:_t(`varying vec2 v_pos; +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:dt(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { @@ -3362,7 +3362,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:_t(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:dt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to @@ -3386,7 +3386,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:_t(`#ifdef GL_ES +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:dt(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; @@ -3413,7 +3413,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:_t(`varying vec4 v_color;void main() {gl_FragColor=v_color; +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:dt(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -3435,7 +3435,7 @@ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_off #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:_t(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:dt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -3479,20 +3479,20 @@ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:_t(`#ifdef GL_ES +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:dt(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:_t(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:dt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:_t(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:dt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -3526,7 +3526,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_width2=vec2(outset,inset);}`),lineGradient:_t(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +v_width2=vec2(outset,inset);}`),lineGradient:dt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -3556,7 +3556,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_width2=vec2(outset,inset);}`),linePattern:_t(`#ifdef GL_ES +v_width2=vec2(outset,inset);}`),linePattern:dt(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; @@ -3608,7 +3608,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:_t(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:dt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -3649,11 +3649,11 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:_t(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:dt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:_t(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:dt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -3667,7 +3667,7 @@ void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:_t(`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:dt(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -3698,7 +3698,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:_t(`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:dt(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; @@ -3735,86 +3735,92 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:_t("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:_t("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:_t("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:_t("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function _t(Be,R){let ae=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,xe=R.match(/attribute ([\w]+) ([\w]+)/g),we=Be.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Fe=R.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ct=Fe?Fe.concat(we):we,bt={};return{fragmentSource:Be=Be.replace(ae,(zt,Zt,gr,yr,Gr)=>(bt[Gr]=!0,Zt==="define"?` +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:dt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:dt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:dt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:dt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function dt(De,I){let ne=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,be=I.match(/attribute ([\w]+) ([\w]+)/g),Ae=De.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Re=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ut=Re?Re.concat(Ae):Ae,_t={};return{fragmentSource:De=De.replace(ne,(Rt,Zt,yr,_r,Gr)=>(_t[Gr]=!0,Zt==="define"?` #ifndef HAS_UNIFORM_u_${Gr} -varying ${gr} ${yr} ${Gr}; +varying ${yr} ${_r} ${Gr}; #else -uniform ${gr} ${yr} u_${Gr}; +uniform ${yr} ${_r} u_${Gr}; #endif `:` #ifdef HAS_UNIFORM_u_${Gr} - ${gr} ${yr} ${Gr} = u_${Gr}; + ${yr} ${_r} ${Gr} = u_${Gr}; #endif -`)),vertexSource:R=R.replace(ae,(zt,Zt,gr,yr,Gr)=>{let ta=yr==="float"?"vec2":"vec4",qe=Gr.match(/color/)?"color":ta;return bt[Gr]?Zt==="define"?` +`)),vertexSource:I=I.replace(ne,(Rt,Zt,yr,_r,Gr)=>{let Qr=_r==="float"?"vec2":"vec4",je=Gr.match(/color/)?"color":Qr;return _t[Gr]?Zt==="define"?` #ifndef HAS_UNIFORM_u_${Gr} uniform lowp float u_${Gr}_t; -attribute ${gr} ${ta} a_${Gr}; -varying ${gr} ${yr} ${Gr}; +attribute ${yr} ${Qr} a_${Gr}; +varying ${yr} ${_r} ${Gr}; #else -uniform ${gr} ${yr} u_${Gr}; +uniform ${yr} ${_r} u_${Gr}; #endif -`:qe==="vec4"?` +`:je==="vec4"?` #ifndef HAS_UNIFORM_u_${Gr} ${Gr} = a_${Gr}; #else - ${gr} ${yr} ${Gr} = u_${Gr}; + ${yr} ${_r} ${Gr} = u_${Gr}; #endif `:` #ifndef HAS_UNIFORM_u_${Gr} - ${Gr} = unpack_mix_${qe}(a_${Gr}, u_${Gr}_t); + ${Gr} = unpack_mix_${je}(a_${Gr}, u_${Gr}_t); #else - ${gr} ${yr} ${Gr} = u_${Gr}; + ${yr} ${_r} ${Gr} = u_${Gr}; #endif `:Zt==="define"?` #ifndef HAS_UNIFORM_u_${Gr} uniform lowp float u_${Gr}_t; -attribute ${gr} ${ta} a_${Gr}; +attribute ${yr} ${Qr} a_${Gr}; #else -uniform ${gr} ${yr} u_${Gr}; +uniform ${yr} ${_r} u_${Gr}; #endif -`:qe==="vec4"?` +`:je==="vec4"?` #ifndef HAS_UNIFORM_u_${Gr} - ${gr} ${yr} ${Gr} = a_${Gr}; + ${yr} ${_r} ${Gr} = a_${Gr}; #else - ${gr} ${yr} ${Gr} = u_${Gr}; + ${yr} ${_r} ${Gr} = u_${Gr}; #endif `:` #ifndef HAS_UNIFORM_u_${Gr} - ${gr} ${yr} ${Gr} = unpack_mix_${qe}(a_${Gr}, u_${Gr}_t); + ${yr} ${_r} ${Gr} = unpack_mix_${je}(a_${Gr}, u_${Gr}_t); #else - ${gr} ${yr} ${Gr} = u_${Gr}; -#endif -`}),staticAttributes:xe,staticUniforms:ct}}class Wt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(R,ae,xe,we,Fe,ct,bt,zt,Zt){this.context=R;let gr=this.boundPaintVertexBuffers.length!==we.length;for(let yr=0;!gr&&yr({u_matrix:Be,u_texture:0,u_ele_delta:R,u_fog_matrix:ae,u_fog_color:xe?xe.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:xe?xe.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:xe?xe.calculateFogBlendOpacity(we):0,u_horizon_color:xe?xe.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:xe?xe.properties.get("horizon-fog-blend"):1});function Vr(Be){let R=[];for(let ae=0;ae({u_depth:new t.aH(fr,wr.u_depth),u_terrain:new t.aH(fr,wr.u_terrain),u_terrain_dim:new t.aI(fr,wr.u_terrain_dim),u_terrain_matrix:new t.aJ(fr,wr.u_terrain_matrix),u_terrain_unpack:new t.aK(fr,wr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(fr,wr.u_terrain_exaggeration)}))(R,ir),this.binderUniforms=xe?xe.getUniforms(R,ir):[]}draw(R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta,qe,Ze,it,ft,Mt){let xt=R.gl;if(this.failedToCreate)return;if(R.program.set(this.program),R.setDepthMode(xe),R.setStencilMode(we),R.setColorMode(Fe),R.setCullFace(ct),zt){R.activeTexture.set(xt.TEXTURE2),xt.bindTexture(xt.TEXTURE_2D,zt.depthTexture),R.activeTexture.set(xt.TEXTURE3),xt.bindTexture(xt.TEXTURE_2D,zt.texture);for(let ir in this.terrainUniforms)this.terrainUniforms[ir].set(zt[ir])}for(let ir in this.fixedUniforms)this.fixedUniforms[ir].set(bt[ir]);Ze&&Ze.setUniforms(R,this.binderUniforms,ta,{zoom:qe});let Pt=0;switch(ae){case xt.LINES:Pt=2;break;case xt.TRIANGLES:Pt=3;break;case xt.LINE_STRIP:Pt=1}for(let ir of Gr.get()){let fr=ir.vaos||(ir.vaos={});(fr[Zt]||(fr[Zt]=new Wt)).bind(R,this,gr,Ze?Ze.getPaintVertexBuffers():[],yr,ir.vertexOffset,it,ft,Mt),xt.drawElements(ae,ir.primitiveLength*Pt,xt.UNSIGNED_SHORT,ir.primitiveOffset*Pt*2)}}}function ba(Be,R,ae){let xe=1/Ea(ae,1,R.transform.tileZoom),we=Math.pow(2,ae.tileID.overscaledZ),Fe=ae.tileSize*Math.pow(2,R.transform.tileZoom)/we,ct=Fe*(ae.tileID.canonical.x+ae.tileID.wrap*we),bt=Fe*ae.tileID.canonical.y;return{u_image:0,u_texsize:ae.imageAtlasTexture.size,u_scale:[xe,Be.fromScale,Be.toScale],u_fade:Be.t,u_pixel_coord_upper:[ct>>16,bt>>16],u_pixel_coord_lower:[65535&ct,65535&bt]}}let wa=(Be,R,ae,xe)=>{let we=R.style.light,Fe=we.properties.get("position"),ct=[Fe.x,Fe.y,Fe.z],bt=(function(){var Zt=new t.A(9);return t.A!=Float32Array&&(Zt[1]=0,Zt[2]=0,Zt[3]=0,Zt[5]=0,Zt[6]=0,Zt[7]=0),Zt[0]=1,Zt[4]=1,Zt[8]=1,Zt})();we.properties.get("anchor")==="viewport"&&(function(Zt,gr){var yr=Math.sin(gr),Gr=Math.cos(gr);Zt[0]=Gr,Zt[1]=yr,Zt[2]=0,Zt[3]=-yr,Zt[4]=Gr,Zt[5]=0,Zt[6]=0,Zt[7]=0,Zt[8]=1})(bt,-R.transform.angle),(function(Zt,gr,yr){var Gr=gr[0],ta=gr[1],qe=gr[2];Zt[0]=Gr*yr[0]+ta*yr[3]+qe*yr[6],Zt[1]=Gr*yr[1]+ta*yr[4]+qe*yr[7],Zt[2]=Gr*yr[2]+ta*yr[5]+qe*yr[8]})(ct,ct,bt);let zt=we.properties.get("color");return{u_matrix:Be,u_lightpos:ct,u_lightintensity:we.properties.get("intensity"),u_lightcolor:[zt.r,zt.g,zt.b],u_vertical_gradient:+ae,u_opacity:xe}},$r=(Be,R,ae,xe,we,Fe,ct)=>t.e(wa(Be,R,ae,xe),ba(Fe,R,ct),{u_height_factor:-Math.pow(2,we.overscaledZ)/ct.tileSize/8}),ga=Be=>({u_matrix:Be}),jn=(Be,R,ae,xe)=>t.e(ga(Be),ba(ae,R,xe)),an=(Be,R)=>({u_matrix:Be,u_world:R}),ei=(Be,R,ae,xe,we)=>t.e(jn(Be,R,ae,xe),{u_world:we}),li=(Be,R,ae,xe)=>{let we=Be.transform,Fe,ct;if(xe.paint.get("circle-pitch-alignment")==="map"){let bt=Ea(ae,1,we.zoom);Fe=!0,ct=[bt,bt]}else Fe=!1,ct=we.pixelsToGLUnits;return{u_camera_to_center_distance:we.cameraToCenterDistance,u_scale_with_map:+(xe.paint.get("circle-pitch-scale")==="map"),u_matrix:Be.translatePosMatrix(R.posMatrix,ae,xe.paint.get("circle-translate"),xe.paint.get("circle-translate-anchor")),u_pitch_with_map:+Fe,u_device_pixel_ratio:Be.pixelRatio,u_extrude_scale:ct}},_i=(Be,R,ae)=>({u_matrix:Be,u_inv_matrix:R,u_camera_to_center_distance:ae.cameraToCenterDistance,u_viewport_size:[ae.width,ae.height]}),xi=(Be,R,ae=1)=>({u_matrix:Be,u_color:R,u_overlay:0,u_overlay_scale:ae}),Pi=Be=>({u_matrix:Be}),Li=(Be,R,ae,xe)=>({u_matrix:Be,u_extrude_scale:Ea(R,1,ae),u_intensity:xe}),ri=(Be,R,ae,xe)=>{let we=t.H();t.aP(we,0,Be.width,Be.height,0,0,1);let Fe=Be.context.gl;return{u_matrix:we,u_world:[Fe.drawingBufferWidth,Fe.drawingBufferHeight],u_image:ae,u_color_ramp:xe,u_opacity:R.paint.get("heatmap-opacity")}};function vo(Be,R){let ae=Math.pow(2,R.canonical.z),xe=R.canonical.y;return[new t.Z(0,xe/ae).toLngLat().lat,new t.Z(0,(xe+1)/ae).toLngLat().lat]}let Eo=(Be,R,ae,xe)=>{let we=Be.transform;return{u_matrix:Go(Be,R,ae,xe),u_ratio:1/Ea(R,1,we.zoom),u_device_pixel_ratio:Be.pixelRatio,u_units_to_pixels:[1/we.pixelsToGLUnits[0],1/we.pixelsToGLUnits[1]]}},uo=(Be,R,ae,xe,we)=>t.e(Eo(Be,R,ae,we),{u_image:0,u_image_height:xe}),ao=(Be,R,ae,xe,we)=>{let Fe=Be.transform,ct=Bo(R,Fe);return{u_matrix:Go(Be,R,ae,we),u_texsize:R.imageAtlasTexture.size,u_ratio:1/Ea(R,1,Fe.zoom),u_device_pixel_ratio:Be.pixelRatio,u_image:0,u_scale:[ct,xe.fromScale,xe.toScale],u_fade:xe.t,u_units_to_pixels:[1/Fe.pixelsToGLUnits[0],1/Fe.pixelsToGLUnits[1]]}},mo=(Be,R,ae,xe,we,Fe)=>{let ct=Be.lineAtlas,bt=Bo(R,Be.transform),zt=ae.layout.get("line-cap")==="round",Zt=ct.getDash(xe.from,zt),gr=ct.getDash(xe.to,zt),yr=Zt.width*we.fromScale,Gr=gr.width*we.toScale;return t.e(Eo(Be,R,ae,Fe),{u_patternscale_a:[bt/yr,-Zt.height/2],u_patternscale_b:[bt/Gr,-gr.height/2],u_sdfgamma:ct.width/(256*Math.min(yr,Gr)*Be.pixelRatio)/2,u_image:0,u_tex_y_a:Zt.y,u_tex_y_b:gr.y,u_mix:we.t})};function Bo(Be,R){return 1/Ea(Be,1,R.tileZoom)}function Go(Be,R,ae,xe){return Be.translatePosMatrix(xe?xe.posMatrix:R.tileID.posMatrix,R,ae.paint.get("line-translate"),ae.paint.get("line-translate-anchor"))}let Ko=(Be,R,ae,xe,we)=>{return{u_matrix:Be,u_tl_parent:R,u_scale_parent:ae,u_buffer_scale:1,u_fade_t:xe.mix,u_opacity:xe.opacity*we.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:we.paint.get("raster-brightness-min"),u_brightness_high:we.paint.get("raster-brightness-max"),u_saturation_factor:(ct=we.paint.get("raster-saturation"),ct>0?1-1/(1.001-ct):-ct),u_contrast_factor:(Fe=we.paint.get("raster-contrast"),Fe>0?1/(1-Fe):1+Fe),u_spin_weights:Qi(we.paint.get("raster-hue-rotate"))};var Fe,ct};function Qi(Be){Be*=Math.PI/180;let R=Math.sin(Be),ae=Math.cos(Be);return[(2*ae+1)/3,(-Math.sqrt(3)*R-ae+1)/3,(Math.sqrt(3)*R-ae+1)/3]}let eo=(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta)=>{let qe=ct.transform;return{u_is_size_zoom_constant:+(Be==="constant"||Be==="source"),u_is_size_feature_constant:+(Be==="constant"||Be==="camera"),u_size_t:R?R.uSizeT:0,u_size:R?R.uSize:0,u_camera_to_center_distance:qe.cameraToCenterDistance,u_pitch:qe.pitch/360*2*Math.PI,u_rotate_symbol:+ae,u_aspect_ratio:qe.width/qe.height,u_fade_change:ct.options.fadeDuration?ct.symbolFadeChange:1,u_matrix:bt,u_label_plane_matrix:zt,u_coord_matrix:Zt,u_is_text:+yr,u_pitch_with_map:+xe,u_is_along_line:we,u_is_variable_anchor:Fe,u_texsize:Gr,u_texture:0,u_translation:gr,u_pitched_scale:ta}},Ei=(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta,qe)=>{let Ze=ct.transform;return t.e(eo(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,qe),{u_gamma_scale:xe?Math.cos(Ze._pitch)*Ze.cameraToCenterDistance:1,u_device_pixel_ratio:ct.pixelRatio,u_is_halo:+ta})},Xi=(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,yr,Gr,ta)=>t.e(Ei(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt,gr,!0,yr,!0,ta),{u_texsize_icon:Gr,u_texture_icon:1}),Jo=(Be,R,ae)=>({u_matrix:Be,u_opacity:R,u_color:ae}),ms=(Be,R,ae,xe,we,Fe)=>t.e((function(ct,bt,zt,Zt){let gr=zt.imageManager.getPattern(ct.from.toString()),yr=zt.imageManager.getPattern(ct.to.toString()),{width:Gr,height:ta}=zt.imageManager.getPixelSize(),qe=Math.pow(2,Zt.tileID.overscaledZ),Ze=Zt.tileSize*Math.pow(2,zt.transform.tileZoom)/qe,it=Ze*(Zt.tileID.canonical.x+Zt.tileID.wrap*qe),ft=Ze*Zt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:gr.tl,u_pattern_br_a:gr.br,u_pattern_tl_b:yr.tl,u_pattern_br_b:yr.br,u_texsize:[Gr,ta],u_mix:bt.t,u_pattern_size_a:gr.displaySize,u_pattern_size_b:yr.displaySize,u_scale_a:bt.fromScale,u_scale_b:bt.toScale,u_tile_units_to_pixels:1/Ea(Zt,1,zt.transform.tileZoom),u_pixel_coord_upper:[it>>16,ft>>16],u_pixel_coord_lower:[65535&it,65535&ft]}})(xe,Fe,ae,we),{u_matrix:Be,u_opacity:R}),_s={fillExtrusion:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_lightpos:new t.aN(Be,R.u_lightpos),u_lightintensity:new t.aI(Be,R.u_lightintensity),u_lightcolor:new t.aN(Be,R.u_lightcolor),u_vertical_gradient:new t.aI(Be,R.u_vertical_gradient),u_opacity:new t.aI(Be,R.u_opacity)}),fillExtrusionPattern:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_lightpos:new t.aN(Be,R.u_lightpos),u_lightintensity:new t.aI(Be,R.u_lightintensity),u_lightcolor:new t.aN(Be,R.u_lightcolor),u_vertical_gradient:new t.aI(Be,R.u_vertical_gradient),u_height_factor:new t.aI(Be,R.u_height_factor),u_image:new t.aH(Be,R.u_image),u_texsize:new t.aO(Be,R.u_texsize),u_pixel_coord_upper:new t.aO(Be,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Be,R.u_pixel_coord_lower),u_scale:new t.aN(Be,R.u_scale),u_fade:new t.aI(Be,R.u_fade),u_opacity:new t.aI(Be,R.u_opacity)}),fill:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix)}),fillPattern:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_image:new t.aH(Be,R.u_image),u_texsize:new t.aO(Be,R.u_texsize),u_pixel_coord_upper:new t.aO(Be,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Be,R.u_pixel_coord_lower),u_scale:new t.aN(Be,R.u_scale),u_fade:new t.aI(Be,R.u_fade)}),fillOutline:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_world:new t.aO(Be,R.u_world)}),fillOutlinePattern:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_world:new t.aO(Be,R.u_world),u_image:new t.aH(Be,R.u_image),u_texsize:new t.aO(Be,R.u_texsize),u_pixel_coord_upper:new t.aO(Be,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Be,R.u_pixel_coord_lower),u_scale:new t.aN(Be,R.u_scale),u_fade:new t.aI(Be,R.u_fade)}),circle:(Be,R)=>({u_camera_to_center_distance:new t.aI(Be,R.u_camera_to_center_distance),u_scale_with_map:new t.aH(Be,R.u_scale_with_map),u_pitch_with_map:new t.aH(Be,R.u_pitch_with_map),u_extrude_scale:new t.aO(Be,R.u_extrude_scale),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_matrix:new t.aJ(Be,R.u_matrix)}),collisionBox:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_pixel_extrude_scale:new t.aO(Be,R.u_pixel_extrude_scale)}),collisionCircle:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_inv_matrix:new t.aJ(Be,R.u_inv_matrix),u_camera_to_center_distance:new t.aI(Be,R.u_camera_to_center_distance),u_viewport_size:new t.aO(Be,R.u_viewport_size)}),debug:(Be,R)=>({u_color:new t.aL(Be,R.u_color),u_matrix:new t.aJ(Be,R.u_matrix),u_overlay:new t.aH(Be,R.u_overlay),u_overlay_scale:new t.aI(Be,R.u_overlay_scale)}),clippingMask:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix)}),heatmap:(Be,R)=>({u_extrude_scale:new t.aI(Be,R.u_extrude_scale),u_intensity:new t.aI(Be,R.u_intensity),u_matrix:new t.aJ(Be,R.u_matrix)}),heatmapTexture:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_world:new t.aO(Be,R.u_world),u_image:new t.aH(Be,R.u_image),u_color_ramp:new t.aH(Be,R.u_color_ramp),u_opacity:new t.aI(Be,R.u_opacity)}),hillshade:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_image:new t.aH(Be,R.u_image),u_latrange:new t.aO(Be,R.u_latrange),u_light:new t.aO(Be,R.u_light),u_shadow:new t.aL(Be,R.u_shadow),u_highlight:new t.aL(Be,R.u_highlight),u_accent:new t.aL(Be,R.u_accent)}),hillshadePrepare:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_image:new t.aH(Be,R.u_image),u_dimension:new t.aO(Be,R.u_dimension),u_zoom:new t.aI(Be,R.u_zoom),u_unpack:new t.aK(Be,R.u_unpack)}),line:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_ratio:new t.aI(Be,R.u_ratio),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Be,R.u_units_to_pixels)}),lineGradient:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_ratio:new t.aI(Be,R.u_ratio),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Be,R.u_units_to_pixels),u_image:new t.aH(Be,R.u_image),u_image_height:new t.aI(Be,R.u_image_height)}),linePattern:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_texsize:new t.aO(Be,R.u_texsize),u_ratio:new t.aI(Be,R.u_ratio),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_image:new t.aH(Be,R.u_image),u_units_to_pixels:new t.aO(Be,R.u_units_to_pixels),u_scale:new t.aN(Be,R.u_scale),u_fade:new t.aI(Be,R.u_fade)}),lineSDF:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_ratio:new t.aI(Be,R.u_ratio),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Be,R.u_units_to_pixels),u_patternscale_a:new t.aO(Be,R.u_patternscale_a),u_patternscale_b:new t.aO(Be,R.u_patternscale_b),u_sdfgamma:new t.aI(Be,R.u_sdfgamma),u_image:new t.aH(Be,R.u_image),u_tex_y_a:new t.aI(Be,R.u_tex_y_a),u_tex_y_b:new t.aI(Be,R.u_tex_y_b),u_mix:new t.aI(Be,R.u_mix)}),raster:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_tl_parent:new t.aO(Be,R.u_tl_parent),u_scale_parent:new t.aI(Be,R.u_scale_parent),u_buffer_scale:new t.aI(Be,R.u_buffer_scale),u_fade_t:new t.aI(Be,R.u_fade_t),u_opacity:new t.aI(Be,R.u_opacity),u_image0:new t.aH(Be,R.u_image0),u_image1:new t.aH(Be,R.u_image1),u_brightness_low:new t.aI(Be,R.u_brightness_low),u_brightness_high:new t.aI(Be,R.u_brightness_high),u_saturation_factor:new t.aI(Be,R.u_saturation_factor),u_contrast_factor:new t.aI(Be,R.u_contrast_factor),u_spin_weights:new t.aN(Be,R.u_spin_weights)}),symbolIcon:(Be,R)=>({u_is_size_zoom_constant:new t.aH(Be,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Be,R.u_is_size_feature_constant),u_size_t:new t.aI(Be,R.u_size_t),u_size:new t.aI(Be,R.u_size),u_camera_to_center_distance:new t.aI(Be,R.u_camera_to_center_distance),u_pitch:new t.aI(Be,R.u_pitch),u_rotate_symbol:new t.aH(Be,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Be,R.u_aspect_ratio),u_fade_change:new t.aI(Be,R.u_fade_change),u_matrix:new t.aJ(Be,R.u_matrix),u_label_plane_matrix:new t.aJ(Be,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Be,R.u_coord_matrix),u_is_text:new t.aH(Be,R.u_is_text),u_pitch_with_map:new t.aH(Be,R.u_pitch_with_map),u_is_along_line:new t.aH(Be,R.u_is_along_line),u_is_variable_anchor:new t.aH(Be,R.u_is_variable_anchor),u_texsize:new t.aO(Be,R.u_texsize),u_texture:new t.aH(Be,R.u_texture),u_translation:new t.aO(Be,R.u_translation),u_pitched_scale:new t.aI(Be,R.u_pitched_scale)}),symbolSDF:(Be,R)=>({u_is_size_zoom_constant:new t.aH(Be,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Be,R.u_is_size_feature_constant),u_size_t:new t.aI(Be,R.u_size_t),u_size:new t.aI(Be,R.u_size),u_camera_to_center_distance:new t.aI(Be,R.u_camera_to_center_distance),u_pitch:new t.aI(Be,R.u_pitch),u_rotate_symbol:new t.aH(Be,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Be,R.u_aspect_ratio),u_fade_change:new t.aI(Be,R.u_fade_change),u_matrix:new t.aJ(Be,R.u_matrix),u_label_plane_matrix:new t.aJ(Be,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Be,R.u_coord_matrix),u_is_text:new t.aH(Be,R.u_is_text),u_pitch_with_map:new t.aH(Be,R.u_pitch_with_map),u_is_along_line:new t.aH(Be,R.u_is_along_line),u_is_variable_anchor:new t.aH(Be,R.u_is_variable_anchor),u_texsize:new t.aO(Be,R.u_texsize),u_texture:new t.aH(Be,R.u_texture),u_gamma_scale:new t.aI(Be,R.u_gamma_scale),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_is_halo:new t.aH(Be,R.u_is_halo),u_translation:new t.aO(Be,R.u_translation),u_pitched_scale:new t.aI(Be,R.u_pitched_scale)}),symbolTextAndIcon:(Be,R)=>({u_is_size_zoom_constant:new t.aH(Be,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Be,R.u_is_size_feature_constant),u_size_t:new t.aI(Be,R.u_size_t),u_size:new t.aI(Be,R.u_size),u_camera_to_center_distance:new t.aI(Be,R.u_camera_to_center_distance),u_pitch:new t.aI(Be,R.u_pitch),u_rotate_symbol:new t.aH(Be,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Be,R.u_aspect_ratio),u_fade_change:new t.aI(Be,R.u_fade_change),u_matrix:new t.aJ(Be,R.u_matrix),u_label_plane_matrix:new t.aJ(Be,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Be,R.u_coord_matrix),u_is_text:new t.aH(Be,R.u_is_text),u_pitch_with_map:new t.aH(Be,R.u_pitch_with_map),u_is_along_line:new t.aH(Be,R.u_is_along_line),u_is_variable_anchor:new t.aH(Be,R.u_is_variable_anchor),u_texsize:new t.aO(Be,R.u_texsize),u_texsize_icon:new t.aO(Be,R.u_texsize_icon),u_texture:new t.aH(Be,R.u_texture),u_texture_icon:new t.aH(Be,R.u_texture_icon),u_gamma_scale:new t.aI(Be,R.u_gamma_scale),u_device_pixel_ratio:new t.aI(Be,R.u_device_pixel_ratio),u_is_halo:new t.aH(Be,R.u_is_halo),u_translation:new t.aO(Be,R.u_translation),u_pitched_scale:new t.aI(Be,R.u_pitched_scale)}),background:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_opacity:new t.aI(Be,R.u_opacity),u_color:new t.aL(Be,R.u_color)}),backgroundPattern:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_opacity:new t.aI(Be,R.u_opacity),u_image:new t.aH(Be,R.u_image),u_pattern_tl_a:new t.aO(Be,R.u_pattern_tl_a),u_pattern_br_a:new t.aO(Be,R.u_pattern_br_a),u_pattern_tl_b:new t.aO(Be,R.u_pattern_tl_b),u_pattern_br_b:new t.aO(Be,R.u_pattern_br_b),u_texsize:new t.aO(Be,R.u_texsize),u_mix:new t.aI(Be,R.u_mix),u_pattern_size_a:new t.aO(Be,R.u_pattern_size_a),u_pattern_size_b:new t.aO(Be,R.u_pattern_size_b),u_scale_a:new t.aI(Be,R.u_scale_a),u_scale_b:new t.aI(Be,R.u_scale_b),u_pixel_coord_upper:new t.aO(Be,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Be,R.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Be,R.u_tile_units_to_pixels)}),terrain:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_texture:new t.aH(Be,R.u_texture),u_ele_delta:new t.aI(Be,R.u_ele_delta),u_fog_matrix:new t.aJ(Be,R.u_fog_matrix),u_fog_color:new t.aL(Be,R.u_fog_color),u_fog_ground_blend:new t.aI(Be,R.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Be,R.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Be,R.u_horizon_color),u_horizon_fog_blend:new t.aI(Be,R.u_horizon_fog_blend)}),terrainDepth:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_ele_delta:new t.aI(Be,R.u_ele_delta)}),terrainCoords:(Be,R)=>({u_matrix:new t.aJ(Be,R.u_matrix),u_texture:new t.aH(Be,R.u_texture),u_terrain_coords_id:new t.aI(Be,R.u_terrain_coords_id),u_ele_delta:new t.aI(Be,R.u_ele_delta)}),sky:(Be,R)=>({u_sky_color:new t.aL(Be,R.u_sky_color),u_horizon_color:new t.aL(Be,R.u_horizon_color),u_horizon:new t.aI(Be,R.u_horizon),u_sky_horizon_blend:new t.aI(Be,R.u_sky_horizon_blend)})};class ko{constructor(R,ae,xe){this.context=R;let we=R.gl;this.buffer=we.createBuffer(),this.dynamicDraw=!!xe,this.context.unbindVAO(),R.bindElementBuffer.set(this.buffer),we.bufferData(we.ELEMENT_ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?we.DYNAMIC_DRAW:we.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(R){let ae=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ae.bufferSubData(ae.ELEMENT_ARRAY_BUFFER,0,R.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Nn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class pi{constructor(R,ae,xe,we){this.length=ae.length,this.attributes=xe,this.itemSize=ae.bytesPerElement,this.dynamicDraw=we,this.context=R;let Fe=R.gl;this.buffer=Fe.createBuffer(),R.bindVertexBuffer.set(this.buffer),Fe.bufferData(Fe.ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?Fe.DYNAMIC_DRAW:Fe.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(R){if(R.length!==this.length)throw new Error(`Length of new data is ${R.length}, which doesn't match current length of ${this.length}`);let ae=this.context.gl;this.bind(),ae.bufferSubData(ae.ARRAY_BUFFER,0,R.arrayBuffer)}enableAttributes(R,ae){for(let xe=0;xe0){let fr=t.H();t.aQ(fr,xt.placementInvProjMatrix,Be.transform.glCoordMatrix),t.aQ(fr,fr,xt.placementViewportMatrix),zt.push({circleArray:ir,circleOffset:gr,transform:Mt.posMatrix,invTransform:fr,coord:Mt}),Zt+=ir.length/4,gr=Zt}Pt&&bt.draw(Fe,ct.LINES,qo.disabled,is.disabled,Be.colorModeForRenderPass(),Ui.disabled,{u_matrix:Mt.posMatrix,u_pixel_extrude_scale:[1/(yr=Be.transform).width,1/yr.height]},Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Mt),ae.id,Pt.layoutVertexBuffer,Pt.indexBuffer,Pt.segments,null,Be.transform.zoom,null,null,Pt.collisionVertexBuffer)}var yr;if(!we||!zt.length)return;let Gr=Be.useProgram("collisionCircle"),ta=new t.aR;ta.resize(4*Zt),ta._trim();let qe=0;for(let ft of zt)for(let Mt=0;Mt=0&&(ft[xt.associatedIconIndex]={shiftedAnchor:di,angle:Di})}else Qt(xt.numGlyphs,Ze)}if(Zt){it.clear();let Mt=Be.icon.placedSymbolArray;for(let xt=0;xtBe.style.map.terrain.getElevation(pa,Rt,hr):null,$t=ae.layout.get("text-rotation-alignment")==="map";be(tn,pa.posMatrix,Be,we,Sl,Fl,ft,Zt,$t,Ze,pa.toUnwrapped(),qe.width,qe.height,Js,wt)}let dl=pa.posMatrix,pl=we&&zr||ku,ve=Mt||pl?hl:Sl,Re=eu,Je=Yn&&ae.paint.get(we?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ht;ht=Yn?tn.iconsInText?Xi(di.kind,lo,xt,ft,Mt,pl,Be,dl,ve,Re,Js,co,Ls,la):Ei(di.kind,lo,xt,ft,Mt,pl,Be,dl,ve,Re,Js,we,co,!0,la):eo(di.kind,lo,xt,ft,Mt,pl,Be,dl,ve,Re,Js,we,co,la);let mt={program:Ai,buffers:Dn,uniformValues:ht,atlasTexture:Lo,atlasTextureIcon:Do,atlasInterpolation:Zo,atlasInterpolationIcon:Os,isSDF:Yn,hasHalo:Je};if(ir&&tn.canOverlap){fr=!0;let wt=Dn.segments.get();for(let $t of wt)Xr.push({segments:new t.a0([$t]),sortKey:$t.sortKey,state:mt,terrainData:Vo})}else Xr.push({segments:Dn.segments,sortKey:0,state:mt,terrainData:Vo})}fr&&Xr.sort((pa,ka)=>pa.sortKey-ka.sortKey);for(let pa of Xr){let ka=pa.state;if(Gr.activeTexture.set(ta.TEXTURE0),ka.atlasTexture.bind(ka.atlasInterpolation,ta.CLAMP_TO_EDGE),ka.atlasTextureIcon&&(Gr.activeTexture.set(ta.TEXTURE1),ka.atlasTextureIcon&&ka.atlasTextureIcon.bind(ka.atlasInterpolationIcon,ta.CLAMP_TO_EDGE)),ka.isSDF){let tn=ka.uniformValues;ka.hasHalo&&(tn.u_is_halo=1,Fc(ka.buffers,pa.segments,ae,Be,ka.program,wr,gr,yr,tn,pa.terrainData)),tn.u_is_halo=0}Fc(ka.buffers,pa.segments,ae,Be,ka.program,wr,gr,yr,ka.uniformValues,pa.terrainData)}}function Fc(Be,R,ae,xe,we,Fe,ct,bt,zt,Zt){let gr=xe.context;we.draw(gr,gr.gl.TRIANGLES,Fe,ct,bt,Ui.disabled,zt,Zt,ae.id,Be.layoutVertexBuffer,Be.indexBuffer,R,ae.paint,xe.transform.zoom,Be.programConfigurations.get(ae.id),Be.dynamicLayoutVertexBuffer,Be.opacityVertexBuffer)}function pc(Be,R,ae,xe){let we=Be.context,Fe=we.gl,ct=is.disabled,bt=new Us([Fe.ONE,Fe.ONE],t.aM.transparent,[!0,!0,!0,!0]),zt=R.getBucket(ae);if(!zt)return;let Zt=xe.key,gr=ae.heatmapFbos.get(Zt);gr||(gr=Oc(we,R.tileSize,R.tileSize),ae.heatmapFbos.set(Zt,gr)),we.bindFramebuffer.set(gr.framebuffer),we.viewport.set([0,0,R.tileSize,R.tileSize]),we.clear({color:t.aM.transparent});let yr=zt.programConfigurations.get(ae.id),Gr=Be.useProgram("heatmap",yr),ta=Be.style.map.terrain.getTerrainData(xe);Gr.draw(we,Fe.TRIANGLES,qo.disabled,ct,bt,Ui.disabled,Li(xe.posMatrix,R,Be.transform.zoom,ae.paint.get("heatmap-intensity")),ta,ae.id,zt.layoutVertexBuffer,zt.indexBuffer,zt.segments,ae.paint,Be.transform.zoom,yr)}function tc(Be,R,ae){let xe=Be.context,we=xe.gl;xe.setColorMode(Be.colorModeForRenderPass());let Fe=Bc(xe,R),ct=ae.key,bt=R.heatmapFbos.get(ct);bt&&(xe.activeTexture.set(we.TEXTURE0),we.bindTexture(we.TEXTURE_2D,bt.colorAttachment.get()),xe.activeTexture.set(we.TEXTURE1),Fe.bind(we.LINEAR,we.CLAMP_TO_EDGE),Be.useProgram("heatmapTexture").draw(xe,we.TRIANGLES,qo.disabled,is.disabled,Be.colorModeForRenderPass(),Ui.disabled,ri(Be,R,0,1),null,R.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments,R.paint,Be.transform.zoom),bt.destroy(),R.heatmapFbos.delete(ct))}function Oc(Be,R,ae){var xe,we;let Fe=Be.gl,ct=Fe.createTexture();Fe.bindTexture(Fe.TEXTURE_2D,ct),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_S,Fe.CLAMP_TO_EDGE),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_T,Fe.CLAMP_TO_EDGE),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MIN_FILTER,Fe.LINEAR),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MAG_FILTER,Fe.LINEAR);let bt=(xe=Be.HALF_FLOAT)!==null&&xe!==void 0?xe:Fe.UNSIGNED_BYTE,zt=(we=Be.RGBA16F)!==null&&we!==void 0?we:Fe.RGBA;Fe.texImage2D(Fe.TEXTURE_2D,0,zt,R,ae,0,Fe.RGBA,bt,null);let Zt=Be.createFramebuffer(R,ae,!1,!1);return Zt.colorAttachment.set(ct),Zt}function Bc(Be,R){return R.colorRampTexture||(R.colorRampTexture=new u(Be,R.colorRamp,Be.gl.RGBA)),R.colorRampTexture}function cu(Be,R,ae,xe,we){if(!ae||!xe||!xe.imageAtlas)return;let Fe=xe.imageAtlas.patternPositions,ct=Fe[ae.to.toString()],bt=Fe[ae.from.toString()];if(!ct&&bt&&(ct=bt),!bt&&ct&&(bt=ct),!ct||!bt){let zt=we.getPaintProperty(R);ct=Fe[zt],bt=Fe[zt]}ct&&bt&&Be.setConstantPatternPositions(ct,bt)}function Pc(Be,R,ae,xe,we,Fe,ct){let bt=Be.context.gl,zt="fill-pattern",Zt=ae.paint.get(zt),gr=Zt&&Zt.constantOr(1),yr=ae.getCrossfadeParameters(),Gr,ta,qe,Ze,it;ct?(ta=gr&&!ae.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Gr=bt.LINES):(ta=gr?"fillPattern":"fill",Gr=bt.TRIANGLES);let ft=Zt.constantOr(null);for(let Mt of xe){let xt=R.getTile(Mt);if(gr&&!xt.patternsLoaded())continue;let Pt=xt.getBucket(ae);if(!Pt)continue;let ir=Pt.programConfigurations.get(ae.id),fr=Be.useProgram(ta,ir),wr=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Mt);gr&&(Be.context.activeTexture.set(bt.TEXTURE0),xt.imageAtlasTexture.bind(bt.LINEAR,bt.CLAMP_TO_EDGE),ir.updatePaintBuffers(yr)),cu(ir,zt,ft,xt,ae);let zr=wr?Mt:null,Xr=Be.translatePosMatrix(zr?zr.posMatrix:Mt.posMatrix,xt,ae.paint.get("fill-translate"),ae.paint.get("fill-translate-anchor"));if(ct){Ze=Pt.indexBuffer2,it=Pt.segments2;let la=[bt.drawingBufferWidth,bt.drawingBufferHeight];qe=ta==="fillOutlinePattern"&&gr?ei(Xr,Be,yr,xt,la):an(Xr,la)}else Ze=Pt.indexBuffer,it=Pt.segments,qe=gr?jn(Xr,Be,yr,xt):ga(Xr);fr.draw(Be.context,Gr,we,Be.stencilModeForClipping(Mt),Fe,Ui.disabled,qe,wr,ae.id,Pt.layoutVertexBuffer,Ze,it,ae.paint,Be.transform.zoom,ir)}}function Su(Be,R,ae,xe,we,Fe,ct){let bt=Be.context,zt=bt.gl,Zt="fill-extrusion-pattern",gr=ae.paint.get(Zt),yr=gr.constantOr(1),Gr=ae.getCrossfadeParameters(),ta=ae.paint.get("fill-extrusion-opacity"),qe=gr.constantOr(null);for(let Ze of xe){let it=R.getTile(Ze),ft=it.getBucket(ae);if(!ft)continue;let Mt=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Ze),xt=ft.programConfigurations.get(ae.id),Pt=Be.useProgram(yr?"fillExtrusionPattern":"fillExtrusion",xt);yr&&(Be.context.activeTexture.set(zt.TEXTURE0),it.imageAtlasTexture.bind(zt.LINEAR,zt.CLAMP_TO_EDGE),xt.updatePaintBuffers(Gr)),cu(xt,Zt,qe,it,ae);let ir=Be.translatePosMatrix(Ze.posMatrix,it,ae.paint.get("fill-extrusion-translate"),ae.paint.get("fill-extrusion-translate-anchor")),fr=ae.paint.get("fill-extrusion-vertical-gradient"),wr=yr?$r(ir,Be,fr,ta,Ze,Gr,it):wa(ir,Be,fr,ta);Pt.draw(bt,bt.gl.TRIANGLES,we,Fe,ct,Ui.backCCW,wr,Mt,ae.id,ft.layoutVertexBuffer,ft.indexBuffer,ft.segments,ae.paint,Be.transform.zoom,xt,Be.style.map.terrain&&ft.centroidVertexBuffer)}}function nc(Be,R,ae,xe,we,Fe,ct){let bt=Be.context,zt=bt.gl,Zt=ae.fbo;if(!Zt)return;let gr=Be.useProgram("hillshade"),yr=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(R);bt.activeTexture.set(zt.TEXTURE0),zt.bindTexture(zt.TEXTURE_2D,Zt.colorAttachment.get()),gr.draw(bt,zt.TRIANGLES,we,Fe,ct,Ui.disabled,((Gr,ta,qe,Ze)=>{let it=qe.paint.get("hillshade-shadow-color"),ft=qe.paint.get("hillshade-highlight-color"),Mt=qe.paint.get("hillshade-accent-color"),xt=qe.paint.get("hillshade-illumination-direction")*(Math.PI/180);qe.paint.get("hillshade-illumination-anchor")==="viewport"&&(xt-=Gr.transform.angle);let Pt=!Gr.options.moving;return{u_matrix:Ze?Ze.posMatrix:Gr.transform.calculatePosMatrix(ta.tileID.toUnwrapped(),Pt),u_image:0,u_latrange:vo(0,ta.tileID),u_light:[qe.paint.get("hillshade-exaggeration"),xt],u_shadow:it,u_highlight:ft,u_accent:Mt}})(Be,ae,xe,yr?R:null),yr,xe.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments)}function Al(Be,R,ae,xe,we,Fe){let ct=Be.context,bt=ct.gl,zt=R.dem;if(zt&&zt.data){let Zt=zt.dim,gr=zt.stride,yr=zt.getPixels();if(ct.activeTexture.set(bt.TEXTURE1),ct.pixelStoreUnpackPremultiplyAlpha.set(!1),R.demTexture=R.demTexture||Be.getTileTexture(gr),R.demTexture){let ta=R.demTexture;ta.update(yr,{premultiply:!1}),ta.bind(bt.NEAREST,bt.CLAMP_TO_EDGE)}else R.demTexture=new u(ct,yr,bt.RGBA,{premultiply:!1}),R.demTexture.bind(bt.NEAREST,bt.CLAMP_TO_EDGE);ct.activeTexture.set(bt.TEXTURE0);let Gr=R.fbo;if(!Gr){let ta=new u(ct,{width:Zt,height:Zt,data:null},bt.RGBA);ta.bind(bt.LINEAR,bt.CLAMP_TO_EDGE),Gr=R.fbo=ct.createFramebuffer(Zt,Zt,!0,!1),Gr.colorAttachment.set(ta.texture)}ct.bindFramebuffer.set(Gr.framebuffer),ct.viewport.set([0,0,Zt,Zt]),Be.useProgram("hillshadePrepare").draw(ct,bt.TRIANGLES,xe,we,Fe,Ui.disabled,((ta,qe)=>{let Ze=qe.stride,it=t.H();return t.aP(it,0,t.X,-t.X,0,0,1),t.J(it,it,[0,-t.X,0]),{u_matrix:it,u_image:1,u_dimension:[Ze,Ze],u_zoom:ta.overscaledZ,u_unpack:qe.getUnpackVector()}})(R.tileID,zt),null,ae.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments),R.needsHillshadePrepare=!1}}function rc(Be,R,ae,xe,we,Fe){let ct=xe.paint.get("raster-fade-duration");if(!Fe&&ct>0){let bt=i.now(),zt=(bt-Be.timeAdded)/ct,Zt=R?(bt-R.timeAdded)/ct:-1,gr=ae.getSource(),yr=we.coveringZoomLevel({tileSize:gr.tileSize,roundZoom:gr.roundZoom}),Gr=!R||Math.abs(R.tileID.overscaledZ-yr)>Math.abs(Be.tileID.overscaledZ-yr),ta=Gr&&Be.refreshedUponExpiration?1:t.ac(Gr?zt:1-Zt,0,1);return Be.refreshedUponExpiration&&zt>=1&&(Be.refreshedUponExpiration=!1),R?{opacity:1,mix:1-ta}:{opacity:ta,mix:0}}return{opacity:1,mix:0}}let Vu=new t.aM(1,0,0,1),Ts=new t.aM(0,1,0,1),Ic=new t.aM(0,0,1,1),sf=new t.aM(1,0,1,1),Nc=new t.aM(0,1,1,1);function ic(Be,R,ae,xe){Kl(Be,0,R+ae/2,Be.transform.width,ae,xe)}function Jc(Be,R,ae,xe){Kl(Be,R-ae/2,0,ae,Be.transform.height,xe)}function Kl(Be,R,ae,xe,we,Fe){let ct=Be.context,bt=ct.gl;bt.enable(bt.SCISSOR_TEST),bt.scissor(R*Be.pixelRatio,ae*Be.pixelRatio,xe*Be.pixelRatio,we*Be.pixelRatio),ct.clear({color:Fe}),bt.disable(bt.SCISSOR_TEST)}function Uc(Be,R,ae){let xe=Be.context,we=xe.gl,Fe=ae.posMatrix,ct=Be.useProgram("debug"),bt=qo.disabled,zt=is.disabled,Zt=Be.colorModeForRenderPass(),gr="$debug",yr=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(ae);xe.activeTexture.set(we.TEXTURE0);let Gr=R.getTileByID(ae.key).latestRawTileData,ta=Math.floor((Gr&&Gr.byteLength||0)/1024),qe=R.getTile(ae).tileSize,Ze=512/Math.min(qe,512)*(ae.overscaledZ/Be.transform.zoom)*.5,it=ae.canonical.toString();ae.overscaledZ!==ae.canonical.z&&(it+=` => ${ae.overscaledZ}`),(function(ft,Mt){ft.initDebugOverlayCanvas();let xt=ft.debugOverlayCanvas,Pt=ft.context.gl,ir=ft.debugOverlayCanvas.getContext("2d");ir.clearRect(0,0,xt.width,xt.height),ir.shadowColor="white",ir.shadowBlur=2,ir.lineWidth=1.5,ir.strokeStyle="white",ir.textBaseline="top",ir.font="bold 36px Open Sans, sans-serif",ir.fillText(Mt,5,5),ir.strokeText(Mt,5,5),ft.debugOverlayTexture.update(xt),ft.debugOverlayTexture.bind(Pt.LINEAR,Pt.CLAMP_TO_EDGE)})(Be,`${it} ${ta}kB`),ct.draw(xe,we.TRIANGLES,bt,zt,Us.alphaBlended,Ui.disabled,xi(Fe,t.aM.transparent,Ze),null,gr,Be.debugBuffer,Be.quadTriangleIndexBuffer,Be.debugSegments),ct.draw(xe,we.LINE_STRIP,bt,zt,Zt,Ui.disabled,xi(Fe,t.aM.red),yr,gr,Be.debugBuffer,Be.tileBorderIndexBuffer,Be.debugSegments)}function Hs(Be,R,ae){let xe=Be.context,we=xe.gl,Fe=Be.colorModeForRenderPass(),ct=new qo(we.LEQUAL,qo.ReadWrite,Be.depthRangeFor3D),bt=Be.useProgram("terrain"),zt=R.getTerrainMesh();xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Be.width,Be.height]);for(let Zt of ae){let gr=Be.renderToTexture.getTexture(Zt),yr=R.getTerrainData(Zt.tileID);xe.activeTexture.set(we.TEXTURE0),we.bindTexture(we.TEXTURE_2D,gr.texture);let Gr=Be.transform.calculatePosMatrix(Zt.tileID.toUnwrapped()),ta=R.getMeshFrameDelta(Be.transform.zoom),qe=Be.transform.calculateFogMatrix(Zt.tileID.toUnwrapped()),Ze=Ar(Gr,ta,qe,Be.style.sky,Be.transform.pitch);bt.draw(xe,we.TRIANGLES,ct,is.disabled,Fe,Ui.backCCW,Ze,yr,"terrain",zt.vertexBuffer,zt.indexBuffer,zt.segments)}}class Jl{constructor(R,ae,xe){this.vertexBuffer=R,this.indexBuffer=ae,this.segments=xe}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class qu{constructor(R,ae){this.context=new _f(R),this.transform=ae,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Et.maxUnderzooming+Et.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new kr}resize(R,ae,xe){if(this.width=Math.floor(R*xe),this.height=Math.floor(ae*xe),this.pixelRatio=xe,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let we of this.style._order)this.style._layers[we].resize()}setup(){let R=this.context,ae=new t.aX;ae.emplaceBack(0,0),ae.emplaceBack(t.X,0),ae.emplaceBack(0,t.X),ae.emplaceBack(t.X,t.X),this.tileExtentBuffer=R.createVertexBuffer(ae,Kr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let xe=new t.aX;xe.emplaceBack(0,0),xe.emplaceBack(t.X,0),xe.emplaceBack(0,t.X),xe.emplaceBack(t.X,t.X),this.debugBuffer=R.createVertexBuffer(xe,Kr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);let we=new t.$;we.emplaceBack(0,0,0,0),we.emplaceBack(t.X,0,t.X,0),we.emplaceBack(0,t.X,0,t.X),we.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=R.createVertexBuffer(we,He.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);let Fe=new t.aX;Fe.emplaceBack(0,0),Fe.emplaceBack(1,0),Fe.emplaceBack(0,1),Fe.emplaceBack(1,1),this.viewportBuffer=R.createVertexBuffer(Fe,Kr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);let ct=new t.aZ;ct.emplaceBack(0),ct.emplaceBack(1),ct.emplaceBack(3),ct.emplaceBack(2),ct.emplaceBack(0),this.tileBorderIndexBuffer=R.createIndexBuffer(ct);let bt=new t.aY;bt.emplaceBack(0,1,2),bt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=R.createIndexBuffer(bt);let zt=this.context.gl;this.stencilClearMode=new is({func:zt.ALWAYS,mask:0},0,255,zt.ZERO,zt.ZERO,zt.ZERO)}clearStencil(){let R=this.context,ae=R.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let xe=t.H();t.aP(xe,0,this.width,this.height,0,0,1),t.K(xe,xe,[ae.drawingBufferWidth,ae.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(R,ae.TRIANGLES,qo.disabled,this.stencilClearMode,Us.disabled,Ui.disabled,Pi(xe),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(R,ae){if(this.currentStencilSource===R.source||!R.isTileClipped()||!ae||!ae.length)return;this.currentStencilSource=R.source;let xe=this.context,we=xe.gl;this.nextStencilID+ae.length>256&&this.clearStencil(),xe.setColorMode(Us.disabled),xe.setDepthMode(qo.disabled);let Fe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let ct of ae){let bt=this._tileClippingMaskIDs[ct.key]=this.nextStencilID++,zt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ct);Fe.draw(xe,we.TRIANGLES,qo.disabled,new is({func:we.ALWAYS,mask:0},bt,255,we.KEEP,we.KEEP,we.REPLACE),Us.disabled,Ui.disabled,Pi(ct.posMatrix),zt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let R=this.nextStencilID++,ae=this.context.gl;return new is({func:ae.NOTEQUAL,mask:255},R,255,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilModeForClipping(R){let ae=this.context.gl;return new is({func:ae.EQUAL,mask:255},this._tileClippingMaskIDs[R.key],0,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilConfigForOverlap(R){let ae=this.context.gl,xe=R.sort((ct,bt)=>bt.overscaledZ-ct.overscaledZ),we=xe[xe.length-1].overscaledZ,Fe=xe[0].overscaledZ-we+1;if(Fe>1){this.currentStencilSource=void 0,this.nextStencilID+Fe>256&&this.clearStencil();let ct={};for(let bt=0;bt({u_sky_color:ft.properties.get("sky-color"),u_horizon_color:ft.properties.get("horizon-color"),u_horizon:(Mt.height/2+Mt.getHorizon())*xt,u_sky_horizon_blend:ft.properties.get("sky-horizon-blend")*Mt.height/2*xt}))(Zt,zt.style.map.transform,zt.pixelRatio),ta=new qo(yr.LEQUAL,qo.ReadWrite,[0,1]),qe=is.disabled,Ze=zt.colorModeForRenderPass(),it=zt.useProgram("sky");if(!Zt.mesh){let ft=new t.aX;ft.emplaceBack(-1,-1),ft.emplaceBack(1,-1),ft.emplaceBack(1,1),ft.emplaceBack(-1,1);let Mt=new t.aY;Mt.emplaceBack(0,1,2),Mt.emplaceBack(0,2,3),Zt.mesh=new Jl(gr.createVertexBuffer(ft,Kr.members),gr.createIndexBuffer(Mt),t.a0.simpleSegment(0,0,ft.length,Mt.length))}it.draw(gr,yr.TRIANGLES,ta,qe,Ze,Ui.disabled,Gr,void 0,"sky",Zt.mesh.vertexBuffer,Zt.mesh.indexBuffer,Zt.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=ae.showOverdrawInspector,this.depthRangeFor3D=[0,1-(R._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=xe.length-1;this.currentLayer>=0;this.currentLayer--){let zt=this.style._layers[xe[this.currentLayer]],Zt=we[zt.source],gr=Fe[zt.source];this._renderTileClippingMasks(zt,gr),this.renderLayer(this,Zt,zt,gr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerit.source&&!it.isHidden(gr)?[Zt.sourceCaches[it.source]]:[]),ta=Gr.filter(it=>it.getSource().type==="vector"),qe=Gr.filter(it=>it.getSource().type!=="vector"),Ze=it=>{(!yr||yr.getSource().maxzoomZe(it)),yr||qe.forEach(it=>Ze(it)),yr})(this.style,this.transform.zoom);zt&&(function(Zt,gr,yr){for(let Gr=0;Gr0),we&&(t.b0(ae,xe),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Fe,ct){let bt=Fe.context,zt=bt.gl,Zt=Us.unblended,gr=new qo(zt.LEQUAL,qo.ReadWrite,[0,1]),yr=ct.getTerrainMesh(),Gr=ct.sourceCache.getRenderableTiles(),ta=Fe.useProgram("terrainDepth");bt.bindFramebuffer.set(ct.getFramebuffer("depth").framebuffer),bt.viewport.set([0,0,Fe.width/devicePixelRatio,Fe.height/devicePixelRatio]),bt.clear({color:t.aM.transparent,depth:1});for(let qe of Gr){let Ze=ct.getTerrainData(qe.tileID),it={u_matrix:Fe.transform.calculatePosMatrix(qe.tileID.toUnwrapped()),u_ele_delta:ct.getMeshFrameDelta(Fe.transform.zoom)};ta.draw(bt,zt.TRIANGLES,gr,is.disabled,Zt,Ui.backCCW,it,Ze,"terrain",yr.vertexBuffer,yr.indexBuffer,yr.segments)}bt.bindFramebuffer.set(null),bt.viewport.set([0,0,Fe.width,Fe.height])})(this,this.style.map.terrain),(function(Fe,ct){let bt=Fe.context,zt=bt.gl,Zt=Us.unblended,gr=new qo(zt.LEQUAL,qo.ReadWrite,[0,1]),yr=ct.getTerrainMesh(),Gr=ct.getCoordsTexture(),ta=ct.sourceCache.getRenderableTiles(),qe=Fe.useProgram("terrainCoords");bt.bindFramebuffer.set(ct.getFramebuffer("coords").framebuffer),bt.viewport.set([0,0,Fe.width/devicePixelRatio,Fe.height/devicePixelRatio]),bt.clear({color:t.aM.transparent,depth:1}),ct.coordsIndex=[];for(let Ze of ta){let it=ct.getTerrainData(Ze.tileID);bt.activeTexture.set(zt.TEXTURE0),zt.bindTexture(zt.TEXTURE_2D,Gr.texture);let ft={u_matrix:Fe.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_terrain_coords_id:(255-ct.coordsIndex.length)/255,u_texture:0,u_ele_delta:ct.getMeshFrameDelta(Fe.transform.zoom)};qe.draw(bt,zt.TRIANGLES,gr,is.disabled,Zt,Ui.backCCW,ft,it,"terrain",yr.vertexBuffer,yr.indexBuffer,yr.segments),ct.coordsIndex.push(Ze.tileID.key)}bt.bindFramebuffer.set(null),bt.viewport.set([0,0,Fe.width,Fe.height])})(this,this.style.map.terrain))}renderLayer(R,ae,xe,we){if(!xe.isHidden(this.transform.zoom)&&(xe.type==="background"||xe.type==="custom"||(we||[]).length))switch(this.id=xe.id,xe.type){case"symbol":(function(Fe,ct,bt,zt,Zt){if(Fe.renderPass!=="translucent")return;let gr=is.disabled,yr=Fe.colorModeForRenderPass();(bt._unevaluatedLayout.hasValue("text-variable-anchor")||bt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Gr,ta,qe,Ze,it,ft,Mt,xt,Pt){let ir=ta.transform,fr=sn(),wr=it==="map",zr=ft==="map";for(let Xr of Gr){let la=Ze.getTile(Xr),pa=la.getBucket(qe);if(!pa||!pa.text||!pa.text.segments.get().length)continue;let ka=t.ag(pa.textSizeData,ir.zoom),tn=Ea(la,1,ta.transform.zoom),Dn=mr(Xr.posMatrix,zr,wr,ta.transform,tn),In=qe.layout.get("icon-text-fit")!=="none"&&pa.hasIconData();if(ka){let Yn=Math.pow(2,ir.zoom-la.tileID.overscaledZ),di=ta.style.map.terrain?(Ai,lo)=>ta.style.map.terrain.getElevation(Xr,Ai,lo):null,Di=fr.translatePosition(ir,la,Mt,xt);dc(pa,wr,zr,Pt,ir,Dn,Xr.posMatrix,Yn,ka,In,fr,Di,Xr.toUnwrapped(),di)}}})(zt,Fe,bt,ct,bt.layout.get("text-rotation-alignment"),bt.layout.get("text-pitch-alignment"),bt.paint.get("text-translate"),bt.paint.get("text-translate-anchor"),Zt),bt.paint.get("icon-opacity").constantOr(1)!==0&&Kc(Fe,ct,bt,zt,!1,bt.paint.get("icon-translate"),bt.paint.get("icon-translate-anchor"),bt.layout.get("icon-rotation-alignment"),bt.layout.get("icon-pitch-alignment"),bt.layout.get("icon-keep-upright"),gr,yr),bt.paint.get("text-opacity").constantOr(1)!==0&&Kc(Fe,ct,bt,zt,!0,bt.paint.get("text-translate"),bt.paint.get("text-translate-anchor"),bt.layout.get("text-rotation-alignment"),bt.layout.get("text-pitch-alignment"),bt.layout.get("text-keep-upright"),gr,yr),ct.map.showCollisionBoxes&&(uu(Fe,ct,bt,zt,!0),uu(Fe,ct,bt,zt,!1))})(R,ae,xe,we,this.style.placement.variableOffsets);break;case"circle":(function(Fe,ct,bt,zt){if(Fe.renderPass!=="translucent")return;let Zt=bt.paint.get("circle-opacity"),gr=bt.paint.get("circle-stroke-width"),yr=bt.paint.get("circle-stroke-opacity"),Gr=!bt.layout.get("circle-sort-key").isConstant();if(Zt.constantOr(1)===0&&(gr.constantOr(1)===0||yr.constantOr(1)===0))return;let ta=Fe.context,qe=ta.gl,Ze=Fe.depthModeForSublayer(0,qo.ReadOnly),it=is.disabled,ft=Fe.colorModeForRenderPass(),Mt=[];for(let xt=0;xtxt.sortKey-Pt.sortKey);for(let xt of Mt){let{programConfiguration:Pt,program:ir,layoutVertexBuffer:fr,indexBuffer:wr,uniformValues:zr,terrainData:Xr}=xt.state;ir.draw(ta,qe.TRIANGLES,Ze,it,ft,Ui.disabled,zr,Xr,bt.id,fr,wr,xt.segments,bt.paint,Fe.transform.zoom,Pt)}})(R,ae,xe,we);break;case"heatmap":(function(Fe,ct,bt,zt){if(bt.paint.get("heatmap-opacity")===0)return;let Zt=Fe.context;if(Fe.style.map.terrain){for(let gr of zt){let yr=ct.getTile(gr);ct.hasRenderableParent(gr)||(Fe.renderPass==="offscreen"?pc(Fe,yr,bt,gr):Fe.renderPass==="translucent"&&tc(Fe,bt,gr))}Zt.viewport.set([0,0,Fe.width,Fe.height])}else Fe.renderPass==="offscreen"?(function(gr,yr,Gr,ta){let qe=gr.context,Ze=qe.gl,it=is.disabled,ft=new Us([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Mt,xt,Pt){let ir=Mt.gl;Mt.activeTexture.set(ir.TEXTURE1),Mt.viewport.set([0,0,xt.width/4,xt.height/4]);let fr=Pt.heatmapFbos.get(t.aU);fr?(ir.bindTexture(ir.TEXTURE_2D,fr.colorAttachment.get()),Mt.bindFramebuffer.set(fr.framebuffer)):(fr=Oc(Mt,xt.width/4,xt.height/4),Pt.heatmapFbos.set(t.aU,fr))})(qe,gr,Gr),qe.clear({color:t.aM.transparent});for(let Mt=0;Mt20&&gr.texParameterf(gr.TEXTURE_2D,Zt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Zt.extTextureFilterAnisotropicMax);let pa=Fe.style.map.terrain&&Fe.style.map.terrain.getTerrainData(Mt),ka=pa?Mt:null,tn=ka?ka.posMatrix:Fe.transform.calculatePosMatrix(Mt.toUnwrapped(),ft),Dn=Ko(tn,Xr||[0,0],zr||1,wr,bt);yr instanceof et?Gr.draw(Zt,gr.TRIANGLES,xt,is.disabled,ta,Ui.disabled,Dn,pa,bt.id,yr.boundsBuffer,Fe.quadTriangleIndexBuffer,yr.boundsSegments):Gr.draw(Zt,gr.TRIANGLES,xt,qe[Mt.overscaledZ],ta,Ui.disabled,Dn,pa,bt.id,Fe.rasterBoundsBuffer,Fe.quadTriangleIndexBuffer,Fe.rasterBoundsSegments)}})(R,ae,xe,we);break;case"background":(function(Fe,ct,bt,zt){let Zt=bt.paint.get("background-color"),gr=bt.paint.get("background-opacity");if(gr===0)return;let yr=Fe.context,Gr=yr.gl,ta=Fe.transform,qe=ta.tileSize,Ze=bt.paint.get("background-pattern");if(Fe.isPatternMissing(Ze))return;let it=!Ze&&Zt.a===1&&gr===1&&Fe.opaquePassEnabledForLayer()?"opaque":"translucent";if(Fe.renderPass!==it)return;let ft=is.disabled,Mt=Fe.depthModeForSublayer(0,it==="opaque"?qo.ReadWrite:qo.ReadOnly),xt=Fe.colorModeForRenderPass(),Pt=Fe.useProgram(Ze?"backgroundPattern":"background"),ir=zt||ta.coveringTiles({tileSize:qe,terrain:Fe.style.map.terrain});Ze&&(yr.activeTexture.set(Gr.TEXTURE0),Fe.imageManager.bind(Fe.context));let fr=bt.getCrossfadeParameters();for(let wr of ir){let zr=zt?wr.posMatrix:Fe.transform.calculatePosMatrix(wr.toUnwrapped()),Xr=Ze?ms(zr,gr,Fe,Ze,{tileID:wr,tileSize:qe},fr):Jo(zr,gr,Zt),la=Fe.style.map.terrain&&Fe.style.map.terrain.getTerrainData(wr);Pt.draw(yr,Gr.TRIANGLES,Mt,ft,xt,Ui.disabled,Xr,la,bt.id,Fe.tileExtentBuffer,Fe.quadTriangleIndexBuffer,Fe.tileExtentSegments)}})(R,0,xe,we);break;case"custom":(function(Fe,ct,bt){let zt=Fe.context,Zt=bt.implementation;if(Fe.renderPass==="offscreen"){let gr=Zt.prerender;gr&&(Fe.setCustomLayerDefaults(),zt.setColorMode(Fe.colorModeForRenderPass()),gr.call(Zt,zt.gl,Fe.transform.customLayerMatrix()),zt.setDirty(),Fe.setBaseState())}else if(Fe.renderPass==="translucent"){Fe.setCustomLayerDefaults(),zt.setColorMode(Fe.colorModeForRenderPass()),zt.setStencilMode(is.disabled);let gr=Zt.renderingMode==="3d"?new qo(Fe.context.gl.LEQUAL,qo.ReadWrite,Fe.depthRangeFor3D):Fe.depthModeForSublayer(0,qo.ReadOnly);zt.setDepthMode(gr),Zt.render(zt.gl,Fe.transform.customLayerMatrix(),{farZ:Fe.transform.farZ,nearZ:Fe.transform.nearZ,fov:Fe.transform._fov,modelViewProjectionMatrix:Fe.transform.modelViewProjectionMatrix,projectionMatrix:Fe.transform.projectionMatrix}),zt.setDirty(),Fe.setBaseState(),zt.bindFramebuffer.set(null)}})(R,0,xe)}}translatePosMatrix(R,ae,xe,we,Fe){if(!xe[0]&&!xe[1])return R;let ct=Fe?we==="map"?this.transform.angle:0:we==="viewport"?-this.transform.angle:0;if(ct){let Zt=Math.sin(ct),gr=Math.cos(ct);xe=[xe[0]*gr-xe[1]*Zt,xe[0]*Zt+xe[1]*gr]}let bt=[Fe?xe[0]:Ea(ae,xe[0],this.transform.zoom),Fe?xe[1]:Ea(ae,xe[1],this.transform.zoom),0],zt=new Float32Array(16);return t.J(zt,R,bt),zt}saveTileTexture(R){let ae=this._tileTextures[R.size[0]];ae?ae.push(R):this._tileTextures[R.size[0]]=[R]}getTileTexture(R){let ae=this._tileTextures[R];return ae&&ae.length>0?ae.pop():null}isPatternMissing(R){if(!R)return!1;if(!R.from||!R.to)return!0;let ae=this.imageManager.getPattern(R.from.toString()),xe=this.imageManager.getPattern(R.to.toString());return!ae||!xe}useProgram(R,ae){this.cache=this.cache||{};let xe=R+(ae?ae.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[xe]||(this.cache[xe]=new ma(this.context,Nr[R],ae,_s[R],this._showOverdrawInspector,this.style.map.terrain)),this.cache[xe]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let R=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(R.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:R,drawingBufferHeight:ae}=this.context.gl;return this.width!==R||this.height!==ae}}class Ds{constructor(R,ae){this.points=R,this.planes=ae}static fromInvProjectionMatrix(R,ae,xe){let we=Math.pow(2,xe),Fe=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(bt=>{let zt=1/(bt=t.af([],bt,R))[3]/ae*we;return t.b1(bt,bt,[zt,zt,1/bt[3],zt])}),ct=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(bt=>{let zt=(function(Gr,ta){var qe=ta[0],Ze=ta[1],it=ta[2],ft=qe*qe+Ze*Ze+it*it;return ft>0&&(ft=1/Math.sqrt(ft)),Gr[0]=ta[0]*ft,Gr[1]=ta[1]*ft,Gr[2]=ta[2]*ft,Gr})([],(function(Gr,ta,qe){var Ze=ta[0],it=ta[1],ft=ta[2],Mt=qe[0],xt=qe[1],Pt=qe[2];return Gr[0]=it*Pt-ft*xt,Gr[1]=ft*Mt-Ze*Pt,Gr[2]=Ze*xt-it*Mt,Gr})([],M([],Fe[bt[0]],Fe[bt[1]]),M([],Fe[bt[2]],Fe[bt[1]]))),Zt=-((gr=zt)[0]*(yr=Fe[bt[1]])[0]+gr[1]*yr[1]+gr[2]*yr[2]);var gr,yr;return zt.concat(Zt)});return new Ds(Fe,ct)}}class Du{constructor(R,ae){this.min=R,this.max=ae,this.center=(function(xe,we,Fe){return xe[0]=.5*we[0],xe[1]=.5*we[1],xe[2]=.5*we[2],xe})([],(function(xe,we,Fe){return xe[0]=we[0]+Fe[0],xe[1]=we[1]+Fe[1],xe[2]=we[2]+Fe[2],xe})([],this.min,this.max))}quadrant(R){let ae=[R%2==0,R<2],xe=w(this.min),we=w(this.max);for(let Fe=0;Fe=0&&ct++;if(ct===0)return 0;ct!==ae.length&&(xe=!1)}if(xe)return 2;for(let we=0;we<3;we++){let Fe=Number.MAX_VALUE,ct=-Number.MAX_VALUE;for(let bt=0;btthis.max[we]-this.min[we])return 0}return 1}}class Nl{constructor(R=0,ae=0,xe=0,we=0){if(isNaN(R)||R<0||isNaN(ae)||ae<0||isNaN(xe)||xe<0||isNaN(we)||we<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=R,this.bottom=ae,this.left=xe,this.right=we}interpolate(R,ae,xe){return ae.top!=null&&R.top!=null&&(this.top=t.y.number(R.top,ae.top,xe)),ae.bottom!=null&&R.bottom!=null&&(this.bottom=t.y.number(R.bottom,ae.bottom,xe)),ae.left!=null&&R.left!=null&&(this.left=t.y.number(R.left,ae.left,xe)),ae.right!=null&&R.right!=null&&(this.right=t.y.number(R.right,ae.right,xe)),this}getCenter(R,ae){let xe=t.ac((this.left+R-this.right)/2,0,R),we=t.ac((this.top+ae-this.bottom)/2,0,ae);return new t.P(xe,we)}equals(R){return this.top===R.top&&this.bottom===R.bottom&&this.left===R.left&&this.right===R.right}clone(){return new Nl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Gl=85.051129;class tl{constructor(R,ae,xe,we,Fe){this.tileSize=512,this._renderWorldCopies=Fe===void 0||!!Fe,this._minZoom=R||0,this._maxZoom=ae||22,this._minPitch=xe??0,this._maxPitch=we??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Nl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let R=new tl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return R.apply(this),R}apply(R){this.tileSize=R.tileSize,this.latRange=R.latRange,this.lngRange=R.lngRange,this.width=R.width,this.height=R.height,this._center=R._center,this._elevation=R._elevation,this.minElevationForCurrentTile=R.minElevationForCurrentTile,this.zoom=R.zoom,this.angle=R.angle,this._fov=R._fov,this._pitch=R._pitch,this._unmodified=R._unmodified,this._edgeInsets=R._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(R){this._minZoom!==R&&(this._minZoom=R,this.zoom=Math.max(this.zoom,R))}get maxZoom(){return this._maxZoom}set maxZoom(R){this._maxZoom!==R&&(this._maxZoom=R,this.zoom=Math.min(this.zoom,R))}get minPitch(){return this._minPitch}set minPitch(R){this._minPitch!==R&&(this._minPitch=R,this.pitch=Math.max(this.pitch,R))}get maxPitch(){return this._maxPitch}set maxPitch(R){this._maxPitch!==R&&(this._maxPitch=R,this.pitch=Math.min(this.pitch,R))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(R){R===void 0?R=!0:R===null&&(R=!1),this._renderWorldCopies=R}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(R){let ae=-t.b3(R,-180,180)*Math.PI/180;this.angle!==ae&&(this._unmodified=!1,this.angle=ae,this._calcMatrices(),this.rotationMatrix=(function(){var xe=new t.A(4);return t.A!=Float32Array&&(xe[1]=0,xe[2]=0),xe[0]=1,xe[3]=1,xe})(),(function(xe,we,Fe){var ct=we[0],bt=we[1],zt=we[2],Zt=we[3],gr=Math.sin(Fe),yr=Math.cos(Fe);xe[0]=ct*yr+zt*gr,xe[1]=bt*yr+Zt*gr,xe[2]=ct*-gr+zt*yr,xe[3]=bt*-gr+Zt*yr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(R){let ae=t.ac(R,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ae&&(this._unmodified=!1,this._pitch=ae,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(R){R=Math.max(.01,Math.min(60,R)),this._fov!==R&&(this._unmodified=!1,this._fov=R/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(R){let ae=Math.min(Math.max(R,this.minZoom),this.maxZoom);this._zoom!==ae&&(this._unmodified=!1,this._zoom=ae,this.tileZoom=Math.max(0,Math.floor(ae)),this.scale=this.zoomScale(ae),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(R){R.lat===this._center.lat&&R.lng===this._center.lng||(this._unmodified=!1,this._center=R,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(R){R!==this._elevation&&(this._elevation=R,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(R){this._edgeInsets.equals(R)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,R,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(R){return this._edgeInsets.equals(R)}interpolatePadding(R,ae,xe){this._unmodified=!1,this._edgeInsets.interpolate(R,ae,xe),this._constrain(),this._calcMatrices()}coveringZoomLevel(R){let ae=(R.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/R.tileSize));return Math.max(0,ae)}getVisibleUnwrappedCoordinates(R){let ae=[new t.b4(0,R)];if(this._renderWorldCopies){let xe=this.pointCoordinate(new t.P(0,0)),we=this.pointCoordinate(new t.P(this.width,0)),Fe=this.pointCoordinate(new t.P(this.width,this.height)),ct=this.pointCoordinate(new t.P(0,this.height)),bt=Math.floor(Math.min(xe.x,we.x,Fe.x,ct.x)),zt=Math.floor(Math.max(xe.x,we.x,Fe.x,ct.x)),Zt=1;for(let gr=bt-Zt;gr<=zt+Zt;gr++)gr!==0&&ae.push(new t.b4(gr,R))}return ae}coveringTiles(R){var ae,xe;let we=this.coveringZoomLevel(R),Fe=we;if(R.minzoom!==void 0&&weR.maxzoom&&(we=R.maxzoom);let ct=this.pointCoordinate(this.getCameraPoint()),bt=t.Z.fromLngLat(this.center),zt=Math.pow(2,we),Zt=[zt*ct.x,zt*ct.y,0],gr=[zt*bt.x,zt*bt.y,0],yr=Ds.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,we),Gr=R.minzoom||0;!R.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Gr=we);let ta=R.terrain?2/Math.min(this.tileSize,R.tileSize)*this.tileSize:3,qe=xt=>({aabb:new Du([xt*zt,0,0],[(xt+1)*zt,zt,0]),zoom:0,x:0,y:0,wrap:xt,fullyVisible:!1}),Ze=[],it=[],ft=we,Mt=R.reparseOverscaled?Fe:we;if(this._renderWorldCopies)for(let xt=1;xt<=3;xt++)Ze.push(qe(-xt)),Ze.push(qe(xt));for(Ze.push(qe(0));Ze.length>0;){let xt=Ze.pop(),Pt=xt.x,ir=xt.y,fr=xt.fullyVisible;if(!fr){let pa=xt.aabb.intersects(yr);if(pa===0)continue;fr=pa===2}let wr=R.terrain?Zt:gr,zr=xt.aabb.distanceX(wr),Xr=xt.aabb.distanceY(wr),la=Math.max(Math.abs(zr),Math.abs(Xr));if(xt.zoom===ft||la>ta+(1<=Gr){let pa=ft-xt.zoom,ka=Zt[0]-.5-(Pt<>1),Dn=xt.zoom+1,In=xt.aabb.quadrant(pa);if(R.terrain){let Yn=new t.S(Dn,xt.wrap,Dn,ka,tn),di=R.terrain.getMinMaxElevation(Yn),Di=(ae=di.minElevation)!==null&&ae!==void 0?ae:this.elevation,Ai=(xe=di.maxElevation)!==null&&xe!==void 0?xe:this.elevation;In=new Du([In.min[0],In.min[1],Di],[In.max[0],In.max[1],Ai])}Ze.push({aabb:In,zoom:Dn,x:ka,y:tn,wrap:xt.wrap,fullyVisible:fr})}}return it.sort((xt,Pt)=>xt.distanceSq-Pt.distanceSq).map(xt=>xt.tileID)}resize(R,ae){this.width=R,this.height=ae,this.pixelsToGLUnits=[2/R,-2/ae],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(R){return Math.pow(2,R)}scaleZoom(R){return Math.log(R)/Math.LN2}project(R){let ae=t.ac(R.lat,-85.051129,Gl);return new t.P(t.O(R.lng)*this.worldSize,t.Q(ae)*this.worldSize)}unproject(R){return new t.Z(R.x/this.worldSize,R.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(R){let ae=this.elevation,xe=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,we=this.pointLocation(this.centerPoint,R),Fe=R.getElevationForLngLatZoom(we,this.tileZoom);if(!(this.elevation-Fe))return;let ct=xe+ae-Fe,bt=Math.cos(this._pitch)*this.cameraToCenterDistance/ct/t.b5(1,we.lat),zt=this.scaleZoom(bt/this.tileSize);this._elevation=Fe,this._center=we,this.zoom=zt}setLocationAtPoint(R,ae){let xe=this.pointCoordinate(ae),we=this.pointCoordinate(this.centerPoint),Fe=this.locationCoordinate(R),ct=new t.Z(Fe.x-(xe.x-we.x),Fe.y-(xe.y-we.y));this.center=this.coordinateLocation(ct),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(R,ae){return ae?this.coordinatePoint(this.locationCoordinate(R),ae.getElevationForLngLatZoom(R,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(R))}pointLocation(R,ae){return this.coordinateLocation(this.pointCoordinate(R,ae))}locationCoordinate(R){return t.Z.fromLngLat(R)}coordinateLocation(R){return R&&R.toLngLat()}pointCoordinate(R,ae){if(ae){let Gr=ae.pointCoordinate(R);if(Gr!=null)return Gr}let xe=[R.x,R.y,0,1],we=[R.x,R.y,1,1];t.af(xe,xe,this.pixelMatrixInverse),t.af(we,we,this.pixelMatrixInverse);let Fe=xe[3],ct=we[3],bt=xe[1]/Fe,zt=we[1]/ct,Zt=xe[2]/Fe,gr=we[2]/ct,yr=Zt===gr?0:(0-Zt)/(gr-Zt);return new t.Z(t.y.number(xe[0]/Fe,we[0]/ct,yr)/this.worldSize,t.y.number(bt,zt,yr)/this.worldSize)}coordinatePoint(R,ae=0,xe=this.pixelMatrix){let we=[R.x*this.worldSize,R.y*this.worldSize,ae,1];return t.af(we,we,xe),new t.P(we[0]/we[3],we[1]/we[3])}getBounds(){let R=Math.max(0,this.height/2-this.getHorizon());return new re().extend(this.pointLocation(new t.P(0,R))).extend(this.pointLocation(new t.P(this.width,R))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new re([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(R){R?(this.lngRange=[R.getWest(),R.getEast()],this.latRange=[R.getSouth(),R.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Gl])}calculateTileMatrix(R){let ae=R.canonical,xe=this.worldSize/this.zoomScale(ae.z),we=ae.x+Math.pow(2,ae.z)*R.wrap,Fe=t.an(new Float64Array(16));return t.J(Fe,Fe,[we*xe,ae.y*xe,0]),t.K(Fe,Fe,[xe/t.X,xe/t.X,1]),Fe}calculatePosMatrix(R,ae=!1){let xe=R.key,we=ae?this._alignedPosMatrixCache:this._posMatrixCache;if(we[xe])return we[xe];let Fe=this.calculateTileMatrix(R);return t.L(Fe,ae?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Fe),we[xe]=new Float32Array(Fe),we[xe]}calculateFogMatrix(R){let ae=R.key,xe=this._fogMatrixCache;if(xe[ae])return xe[ae];let we=this.calculateTileMatrix(R);return t.L(we,this.fogMatrix,we),xe[ae]=new Float32Array(we),xe[ae]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(R,ae){ae=t.ac(+ae,this.minZoom,this.maxZoom);let xe={center:new t.N(R.lng,R.lat),zoom:ae},we=this.lngRange;if(!this._renderWorldCopies&&we===null){let xt=179.9999999999;we=[-xt,xt]}let Fe=this.tileSize*this.zoomScale(xe.zoom),ct=0,bt=Fe,zt=0,Zt=Fe,gr=0,yr=0,{x:Gr,y:ta}=this.size;if(this.latRange){let xt=this.latRange;ct=t.Q(xt[1])*Fe,bt=t.Q(xt[0])*Fe,bt-ctbt&&(ft=bt-xt)}if(we){let xt=(zt+Zt)/2,Pt=qe;this._renderWorldCopies&&(Pt=t.b3(qe,xt-Fe/2,xt+Fe/2));let ir=Gr/2;Pt-irZt&&(it=Zt-ir)}if(it!==void 0||ft!==void 0){let xt=new t.P(it??qe,ft??Ze);xe.center=this.unproject.call({worldSize:Fe},xt).wrap()}return xe}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let R=this._unmodified,{center:ae,zoom:xe}=this.getConstrained(this.center,this.zoom);this.center=ae,this.zoom=xe,this._unmodified=R,this._constraining=!1}_calcMatrices(){if(!this.height)return;let R=this.centerOffset,ae=this.point.x,xe=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let we=t.an(new Float64Array(16));t.K(we,we,[this.width/2,-this.height/2,1]),t.J(we,we,[1,-1,0]),this.labelPlaneMatrix=we,we=t.an(new Float64Array(16)),t.K(we,we,[1,-1,1]),t.J(we,we,[-1,-1,0]),t.K(we,we,[2/this.width,2/this.height,1]),this.glCoordMatrix=we;let Fe=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ct=Math.min(this.elevation,this.minElevationForCurrentTile),bt=Fe-ct*this._pixelPerMeter/Math.cos(this._pitch),zt=ct<0?bt:Fe,Zt=Math.PI/2+this._pitch,gr=this._fov*(.5+R.y/this.height),yr=Math.sin(gr)*zt/Math.sin(t.ac(Math.PI-Zt-gr,.01,Math.PI-.01)),Gr=this.getHorizon(),ta=2*Math.atan(Gr/this.cameraToCenterDistance)*(.5+R.y/(2*Gr)),qe=Math.sin(ta)*zt/Math.sin(t.ac(Math.PI-Zt-ta,.01,Math.PI-.01)),Ze=Math.min(yr,qe);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ze+zt),this.nearZ=this.height/50,we=new Float64Array(16),t.b6(we,this._fov,this.width/this.height,this.nearZ,this.farZ),we[8]=2*-R.x/this.width,we[9]=2*R.y/this.height,this.projectionMatrix=t.ae(we),t.K(we,we,[1,-1,1]),t.J(we,we,[0,0,-this.cameraToCenterDistance]),t.b7(we,we,this._pitch),t.ad(we,we,this.angle),t.J(we,we,[-ae,-xe,0]),this.mercatorMatrix=t.K([],we,[this.worldSize,this.worldSize,this.worldSize]),t.K(we,we,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,we),t.J(we,we,[0,0,-this.elevation]),this.modelViewProjectionMatrix=we,this.invModelViewProjectionMatrix=t.as([],we),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Fe,this.farZ),this.fogMatrix[8]=2*-R.x/this.width,this.fogMatrix[9]=2*R.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ae,-xe,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,we);let it=this.width%2/2,ft=this.height%2/2,Mt=Math.cos(this.angle),xt=Math.sin(this.angle),Pt=ae-Math.round(ae)+Mt*it+xt*ft,ir=xe-Math.round(xe)+Mt*ft+xt*it,fr=new Float64Array(we);if(t.J(fr,fr,[Pt>.5?Pt-1:Pt,ir>.5?ir-1:ir,0]),this.alignedModelViewProjectionMatrix=fr,we=t.as(new Float64Array(16),this.pixelMatrix),!we)throw new Error("failed to invert matrix");this.pixelMatrixInverse=we,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let R=this.pointCoordinate(new t.P(0,0)),ae=[R.x*this.worldSize,R.y*this.worldSize,0,1];return t.af(ae,ae,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let R=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,R))}getCameraQueryGeometry(R){let ae=this.getCameraPoint();if(R.length===1)return[R[0],ae];{let xe=ae.x,we=ae.y,Fe=ae.x,ct=ae.y;for(let bt of R)xe=Math.min(xe,bt.x),we=Math.min(we,bt.y),Fe=Math.max(Fe,bt.x),ct=Math.max(ct,bt.y);return[new t.P(xe,we),new t.P(Fe,we),new t.P(Fe,ct),new t.P(xe,ct),new t.P(xe,we)]}}lngLatToCameraDepth(R,ae){let xe=this.locationCoordinate(R),we=[xe.x*this.worldSize,xe.y*this.worldSize,ae,1];return t.af(we,we,this.modelViewProjectionMatrix),we[2]/we[3]}}function jc(Be,R){let ae,xe=!1,we=null,Fe=null,ct=()=>{we=null,xe&&(Be.apply(Fe,ae),we=setTimeout(ct,R),xe=!1)};return(...bt)=>(xe=!0,Fe=this,ae=bt,we||ct(),we)}class $c{constructor(R){this._getCurrentHash=()=>{let ae=window.location.hash.replace("#","");if(this._hashName){let xe;return ae.split("&").map(we=>we.split("=")).forEach(we=>{we[0]===this._hashName&&(xe=we)}),(xe&&xe[1]||"").split("/")}return ae.split("/")},this._onHashChange=()=>{let ae=this._getCurrentHash();if(ae.length>=3&&!ae.some(xe=>isNaN(xe))){let xe=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ae[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ae[2],+ae[1]],zoom:+ae[0],bearing:xe,pitch:+(ae[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let ae=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ae)},this._removeHash=()=>{let ae=this._getCurrentHash();if(ae.length===0)return;let xe=ae.join("/"),we=xe;we.split("&").length>0&&(we=we.split("&")[0]),this._hashName&&(we=`${this._hashName}=${xe}`);let Fe=window.location.hash.replace(we,"");Fe.startsWith("#&")?Fe=Fe.slice(0,1)+Fe.slice(2):Fe==="#"&&(Fe="");let ct=window.location.href.replace(/(#.+)?$/,Fe);ct=ct.replace("&&","&"),window.history.replaceState(window.history.state,null,ct)},this._updateHash=jc(this._updateHashUnthrottled,300),this._hashName=R&&encodeURIComponent(R)}addTo(R){return this._map=R,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(R){let ae=this._map.getCenter(),xe=Math.round(100*this._map.getZoom())/100,we=Math.ceil((xe*Math.LN2+Math.log(512/360/.5))/Math.LN10),Fe=Math.pow(10,we),ct=Math.round(ae.lng*Fe)/Fe,bt=Math.round(ae.lat*Fe)/Fe,zt=this._map.getBearing(),Zt=this._map.getPitch(),gr="";if(gr+=R?`/${ct}/${bt}/${xe}`:`${xe}/${bt}/${ct}`,(zt||Zt)&&(gr+="/"+Math.round(10*zt)/10),Zt&&(gr+=`/${Math.round(Zt)}`),this._hashName){let yr=this._hashName,Gr=!1,ta=window.location.hash.slice(1).split("&").map(qe=>{let Ze=qe.split("=")[0];return Ze===yr?(Gr=!0,`${Ze}=${gr}`):qe}).filter(qe=>qe);return Gr||ta.push(`${yr}=${gr}`),`#${ta.join("&")}`}return`#${gr}`}}let iu={linearity:.3,easing:t.b8(0,0,.3,1)},Gu=t.e({deceleration:2500,maxSpeed:1400},iu),zu=t.e({deceleration:20,maxSpeed:1400},iu),Mf=t.e({deceleration:1e3,maxSpeed:360},iu),mc=t.e({deceleration:1e3,maxSpeed:90},iu);class wc{constructor(R){this._map=R,this.clear()}clear(){this._inertiaBuffer=[]}record(R){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:R})}_drainInertiaBuffer(){let R=this._inertiaBuffer,ae=i.now();for(;R.length>0&&ae-R[0].time>160;)R.shift()}_onMoveEnd(R){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let ae={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Fe}of this._inertiaBuffer)ae.zoom+=Fe.zoomDelta||0,ae.bearing+=Fe.bearingDelta||0,ae.pitch+=Fe.pitchDelta||0,Fe.panDelta&&ae.pan._add(Fe.panDelta),Fe.around&&(ae.around=Fe.around),Fe.pinchAround&&(ae.pinchAround=Fe.pinchAround);let xe=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,we={};if(ae.pan.mag()){let Fe=gc(ae.pan.mag(),xe,t.e({},Gu,R||{}));we.offset=ae.pan.mult(Fe.amount/ae.pan.mag()),we.center=this._map.transform.center,ou(we,Fe)}if(ae.zoom){let Fe=gc(ae.zoom,xe,zu);we.zoom=this._map.transform.zoom+Fe.amount,ou(we,Fe)}if(ae.bearing){let Fe=gc(ae.bearing,xe,Mf);we.bearing=this._map.transform.bearing+t.ac(Fe.amount,-179,179),ou(we,Fe)}if(ae.pitch){let Fe=gc(ae.pitch,xe,mc);we.pitch=this._map.transform.pitch+Fe.amount,ou(we,Fe)}if(we.zoom||we.bearing){let Fe=ae.pinchAround===void 0?ae.around:ae.pinchAround;we.around=Fe?this._map.unproject(Fe):this._map.getCenter()}return this.clear(),t.e(we,{noMoveStart:!0})}}function ou(Be,R){(!Be.duration||Be.durationae.unproject(zt)),bt=Fe.reduce((zt,Zt,gr,yr)=>zt.add(Zt.div(yr.length)),new t.P(0,0));super(R,{points:Fe,point:bt,lngLats:ct,lngLat:ae.unproject(bt),originalEvent:xe}),this._defaultPrevented=!1}}class lf extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(R,ae,xe){super(R,{originalEvent:xe}),this._defaultPrevented=!1}}class Tc{constructor(R,ae){this._map=R,this._clickTolerance=ae.clickTolerance}reset(){delete this._mousedownPos}wheel(R){return this._firePreventable(new lf(R.type,this._map,R))}mousedown(R,ae){return this._mousedownPos=ae,this._firePreventable(new kl(R.type,this._map,R))}mouseup(R){this._map.fire(new kl(R.type,this._map,R))}click(R,ae){this._mousedownPos&&this._mousedownPos.dist(ae)>=this._clickTolerance||this._map.fire(new kl(R.type,this._map,R))}dblclick(R){return this._firePreventable(new kl(R.type,this._map,R))}mouseover(R){this._map.fire(new kl(R.type,this._map,R))}mouseout(R){this._map.fire(new kl(R.type,this._map,R))}touchstart(R){return this._firePreventable(new oc(R.type,this._map,R))}touchmove(R){this._map.fire(new oc(R.type,this._map,R))}touchend(R){this._map.fire(new oc(R.type,this._map,R))}touchcancel(R){this._map.fire(new oc(R.type,this._map,R))}_firePreventable(R){if(this._map.fire(R),R.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class zs{constructor(R){this._map=R}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(R){this._map.fire(new kl(R.type,this._map,R))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(R){this._delayContextMenu?this._contextMenuEvent=R:this._ignoreContextMenu||this._map.fire(new kl(R.type,this._map,R)),this._map.listens("contextmenu")&&R.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ul{constructor(R){this._map=R}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(R){return this.transform.pointLocation(t.P.convert(R),this._map.terrain)}}class $l{constructor(R,ae){this._map=R,this._tr=new Ul(R),this._el=R.getCanvasContainer(),this._container=R.getContainer(),this._clickTolerance=ae.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(R,ae){this.isEnabled()&&R.shiftKey&&R.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ae,this._active=!0)}mousemoveWindow(R,ae){if(!this._active)return;let xe=ae;if(this._lastPos.equals(xe)||!this._box&&xe.dist(this._startPos)Fe.fitScreenCoordinates(xe,we,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",R)}keydown(R){this._active&&R.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",R))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(R,ae){return this._map.fire(new t.k(R,{originalEvent:ae}))}}function Rc(Be,R){if(Be.length!==R.length)throw new Error(`The number of touches and points are not equal - touches ${Be.length}, points ${R.length}`);let ae={};for(let xe=0;xethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=R.timeStamp),xe.length===this.numTouches&&(this.centroid=(function(we){let Fe=new t.P(0,0);for(let ct of we)Fe._add(ct);return Fe.div(we.length)})(ae),this.touches=Rc(xe,ae)))}touchmove(R,ae,xe){if(this.aborted||!this.centroid)return;let we=Rc(xe,ae);for(let Fe in this.touches){let ct=we[Fe];(!ct||ct.dist(this.touches[Fe])>30)&&(this.aborted=!0)}}touchend(R,ae,xe){if((!this.centroid||R.timeStamp-this.startTime>500)&&(this.aborted=!0),xe.length===0){let we=!this.aborted&&this.centroid;if(this.reset(),we)return we}}}class yc{constructor(R){this.singleTap=new Vs(R),this.numTaps=R.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(R,ae,xe){this.singleTap.touchstart(R,ae,xe)}touchmove(R,ae,xe){this.singleTap.touchmove(R,ae,xe)}touchend(R,ae,xe){let we=this.singleTap.touchend(R,ae,xe);if(we){let Fe=R.timeStamp-this.lastTime<500,ct=!this.lastTap||this.lastTap.dist(we)<30;if(Fe&&ct||this.reset(),this.count++,this.lastTime=R.timeStamp,this.lastTap=we,this.count===this.numTaps)return this.reset(),we}}}class Hu{constructor(R){this._tr=new Ul(R),this._zoomIn=new yc({numTouches:1,numTaps:2}),this._zoomOut=new yc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(R,ae,xe){this._zoomIn.touchstart(R,ae,xe),this._zoomOut.touchstart(R,ae,xe)}touchmove(R,ae,xe){this._zoomIn.touchmove(R,ae,xe),this._zoomOut.touchmove(R,ae,xe)}touchend(R,ae,xe){let we=this._zoomIn.touchend(R,ae,xe),Fe=this._zoomOut.touchend(R,ae,xe),ct=this._tr;return we?(this._active=!0,R.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:bt=>bt.easeTo({duration:300,zoom:ct.zoom+1,around:ct.unproject(we)},{originalEvent:R})}):Fe?(this._active=!0,R.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:bt=>bt.easeTo({duration:300,zoom:ct.zoom-1,around:ct.unproject(Fe)},{originalEvent:R})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fu{constructor(R){this._enabled=!!R.enable,this._moveStateManager=R.moveStateManager,this._clickTolerance=R.clickTolerance||1,this._moveFunction=R.move,this._activateOnStart=!!R.activateOnStart,R.assignEvents(this),this.reset()}reset(R){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(R)}_move(...R){let ae=this._moveFunction(...R);if(ae.bearingDelta||ae.pitchDelta||ae.around||ae.panDelta)return this._active=!0,ae}dragStart(R,ae){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(R)&&(this._moveStateManager.startMove(R),this._lastPoint=ae.length?ae[0]:ae,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(R,ae){if(!this.isEnabled())return;let xe=this._lastPoint;if(!xe)return;if(R.preventDefault(),!this._moveStateManager.isValidMoveEvent(R))return void this.reset(R);let we=ae.length?ae[0]:ae;return!this._moved&&we.dist(xe){Be.mousedown=Be.dragStart,Be.mousemoveWindow=Be.dragMove,Be.mouseup=Be.dragEnd,Be.contextmenu=R=>{R.preventDefault()}},Cl=({enable:Be,clickTolerance:R,bearingDegreesPerPixelMoved:ae=.8})=>{let xe=new hu({checkCorrectEvent:we=>n.mouseButton(we)===0&&we.ctrlKey||n.mouseButton(we)===2});return new fu({clickTolerance:R,move:(we,Fe)=>({bearingDelta:(Fe.x-we.x)*ae}),moveStateManager:xe,enable:Be,assignEvents:Dc})},Vc=({enable:Be,clickTolerance:R,pitchDegreesPerPixelMoved:ae=-.5})=>{let xe=new hu({checkCorrectEvent:we=>n.mouseButton(we)===0&&we.ctrlKey||n.mouseButton(we)===2});return new fu({clickTolerance:R,move:(we,Fe)=>({pitchDelta:(Fe.y-we.y)*ae}),moveStateManager:xe,enable:Be,assignEvents:Dc})};class vu{constructor(R,ae){this._clickTolerance=R.clickTolerance||1,this._map=ae,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(R){return R<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(R,ae,xe){return this._calculateTransform(R,ae,xe)}touchmove(R,ae,xe){if(this._active){if(!this._shouldBePrevented(xe.length))return R.preventDefault(),this._calculateTransform(R,ae,xe);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",R)}}touchend(R,ae,xe){this._calculateTransform(R,ae,xe),this._active&&this._shouldBePrevented(xe.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(R,ae,xe){xe.length>0&&(this._active=!0);let we=Rc(xe,ae),Fe=new t.P(0,0),ct=new t.P(0,0),bt=0;for(let Zt in we){let gr=we[Zt],yr=this._touches[Zt];yr&&(Fe._add(gr),ct._add(gr.sub(yr)),bt++,we[Zt]=gr)}if(this._touches=we,this._shouldBePrevented(bt)||!ct.mag())return;let zt=ct.div(bt);return this._sum._add(zt),this._sum.mag()Math.abs(Be.x)}class Zu extends Wu{constructor(R){super(),this._currentTouchCount=0,this._map=R}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(R,ae,xe){super.touchstart(R,ae,xe),this._currentTouchCount=xe.length}_start(R){this._lastPoints=R,Mu(R[0].sub(R[1]))&&(this._valid=!1)}_move(R,ae,xe){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let we=R[0].sub(this._lastPoints[0]),Fe=R[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(we,Fe,xe.timeStamp),this._valid?(this._lastPoints=R,this._active=!0,{pitchDelta:(we.y+Fe.y)/2*-.5}):void 0}gestureBeginsVertically(R,ae,xe){if(this._valid!==void 0)return this._valid;let we=R.mag()>=2,Fe=ae.mag()>=2;if(!we&&!Fe)return;if(!we||!Fe)return this._firstMove===void 0&&(this._firstMove=xe),xe-this._firstMove<100&&void 0;let ct=R.y>0==ae.y>0;return Mu(R)&&Mu(ae)&&ct}}let Yt={panStep:100,bearingStep:15,pitchStep:10};class vr{constructor(R){this._tr=new Ul(R);let ae=Yt;this._panStep=ae.panStep,this._bearingStep=ae.bearingStep,this._pitchStep=ae.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(R){if(R.altKey||R.ctrlKey||R.metaKey)return;let ae=0,xe=0,we=0,Fe=0,ct=0;switch(R.keyCode){case 61:case 107:case 171:case 187:ae=1;break;case 189:case 109:case 173:ae=-1;break;case 37:R.shiftKey?xe=-1:(R.preventDefault(),Fe=-1);break;case 39:R.shiftKey?xe=1:(R.preventDefault(),Fe=1);break;case 38:R.shiftKey?we=1:(R.preventDefault(),ct=-1);break;case 40:R.shiftKey?we=-1:(R.preventDefault(),ct=1);break;default:return}return this._rotationDisabled&&(xe=0,we=0),{cameraAnimation:bt=>{let zt=this._tr;bt.easeTo({duration:300,easeId:"keyboardHandler",easing:Qr,zoom:ae?Math.round(zt.zoom)+ae*(R.shiftKey?2:1):zt.zoom,bearing:zt.bearing+xe*this._bearingStep,pitch:zt.pitch+we*this._pitchStep,offset:[-Fe*this._panStep,-ct*this._panStep],center:zt.center},{originalEvent:R})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Qr(Be){return Be*(2-Be)}let Wr=4.000244140625;class xa{constructor(R,ae){this._onTimeout=xe=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(xe)},this._map=R,this._tr=new Ul(R),this._triggerRenderFrame=ae,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(R){this._defaultZoomRate=R}setWheelZoomRate(R){this._wheelZoomRate=R}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(R){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!R&&R.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(R){return!!this._map.cooperativeGestures.isEnabled()&&!(R.ctrlKey||this._map.cooperativeGestures.isBypassed(R))}wheel(R){if(!this.isEnabled())return;if(this._shouldBePrevented(R))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",R);let ae=R.deltaMode===WheelEvent.DOM_DELTA_LINE?40*R.deltaY:R.deltaY,xe=i.now(),we=xe-(this._lastWheelEventTime||0);this._lastWheelEventTime=xe,ae!==0&&ae%Wr==0?this._type="wheel":ae!==0&&Math.abs(ae)<4?this._type="trackpad":we>400?(this._type=null,this._lastValue=ae,this._timeout=setTimeout(this._onTimeout,40,R)):this._type||(this._type=Math.abs(we*ae)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ae+=this._lastValue)),R.shiftKey&&ae&&(ae/=4),this._type&&(this._lastWheelEvent=R,this._delta-=ae,this._active||this._start(R)),R.preventDefault()}_start(R){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let ae=n.mousePos(this._map.getCanvas(),R),xe=this._tr;this._around=ae.y>xe.transform.height/2-xe.transform.getHorizon()?t.N.convert(this._aroundCenter?xe.center:xe.unproject(ae)):t.N.convert(xe.center),this._aroundPoint=xe.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let R=this._tr.transform;if(this._delta!==0){let zt=this._type==="wheel"&&Math.abs(this._delta)>Wr?this._wheelZoomRate:this._defaultZoomRate,Zt=2/(1+Math.exp(-Math.abs(this._delta*zt)));this._delta<0&&Zt!==0&&(Zt=1/Zt);let gr=typeof this._targetZoom=="number"?R.zoomScale(this._targetZoom):R.scale;this._targetZoom=Math.min(R.maxZoom,Math.max(R.minZoom,R.scaleZoom(gr*Zt))),this._type==="wheel"&&(this._startZoom=R.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let ae=typeof this._targetZoom=="number"?this._targetZoom:R.zoom,xe=this._startZoom,we=this._easing,Fe,ct=!1,bt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&xe&&we&&bt){let zt=Math.min(bt/200,1),Zt=we(zt);Fe=t.y.number(xe,ae,Zt),zt<1?this._frameId||(this._frameId=!0):ct=!0}else Fe=ae,ct=!0;return this._active=!0,ct&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ct,zoomDelta:Fe-R.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(R){let ae=t.b9;if(this._prevEase){let xe=this._prevEase,we=(i.now()-xe.start)/xe.duration,Fe=xe.easing(we+.01)-xe.easing(we),ct=.27/Math.sqrt(Fe*Fe+1e-4)*.01,bt=Math.sqrt(.0729-ct*ct);ae=t.b8(ct,bt,.25,1)}return this._prevEase={start:i.now(),duration:R,easing:ae},ae}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Qa{constructor(R,ae){this._clickZoom=R,this._tapZoom=ae}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class xn{constructor(R){this._tr=new Ul(R),this.reset()}reset(){this._active=!1}dblclick(R,ae){return R.preventDefault(),{cameraAnimation:xe=>{xe.easeTo({duration:300,zoom:this._tr.zoom+(R.shiftKey?-1:1),around:this._tr.unproject(ae)},{originalEvent:R})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zn{constructor(){this._tap=new yc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(R,ae,xe){if(!this._swipePoint)if(this._tapTime){let we=ae[0],Fe=R.timeStamp-this._tapTime<500,ct=this._tapPoint.dist(we)<30;Fe&&ct?xe.length>0&&(this._swipePoint=we,this._swipeTouch=xe[0].identifier):this.reset()}else this._tap.touchstart(R,ae,xe)}touchmove(R,ae,xe){if(this._tapTime){if(this._swipePoint){if(xe[0].identifier!==this._swipeTouch)return;let we=ae[0],Fe=we.y-this._swipePoint.y;return this._swipePoint=we,R.preventDefault(),this._active=!0,{zoomDelta:Fe/128}}}else this._tap.touchmove(R,ae,xe)}touchend(R,ae,xe){if(this._tapTime)this._swipePoint&&xe.length===0&&this.reset();else{let we=this._tap.touchend(R,ae,xe);we&&(this._tapTime=R.timeStamp,this._tapPoint=we)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gn{constructor(R,ae,xe){this._el=R,this._mousePan=ae,this._touchPan=xe}enable(R){this._inertiaOptions=R||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ni{constructor(R,ae,xe){this._pitchWithRotate=R.pitchWithRotate,this._mouseRotate=ae,this._mousePitch=xe}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class wn{constructor(R,ae,xe,we){this._el=R,this._touchZoom=ae,this._touchRotate=xe,this._tapDragZoom=we,this._rotationDisabled=!1,this._enabled=!0}enable(R){this._touchZoom.enable(R),this._rotationDisabled||this._touchRotate.enable(R),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Sn{constructor(R,ae){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=R,this._options=ae,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let R=this._map.getCanvasContainer();R.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",R);let ae=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ae=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let xe=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),we=document.createElement("div");we.className="maplibregl-desktop-message",we.textContent=ae,this._container.appendChild(we);let Fe=document.createElement("div");Fe.className="maplibregl-mobile-message",Fe.textContent=xe,this._container.appendChild(Fe),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(R){return R[this._bypassKey]}notifyGestureBlocked(R,ae){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:R,originalEvent:ae})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Ln=Be=>Be.zoom||Be.drag||Be.pitch||Be.rotate;class un extends t.k{}function mi(Be){return Be.panDelta&&Be.panDelta.mag()||Be.zoomDelta||Be.bearingDelta||Be.pitchDelta}class Oi{constructor(R,ae){this.handleWindowEvent=we=>{this.handleEvent(we,`${we.type}Window`)},this.handleEvent=(we,Fe)=>{if(we.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let ct=we.type==="renderFrame"?void 0:we,bt={needsRenderFrame:!1},zt={},Zt={},gr=we.touches,yr=gr?this._getMapTouches(gr):void 0,Gr=yr?n.touchPos(this._map.getCanvas(),yr):n.mousePos(this._map.getCanvas(),we);for(let{handlerName:Ze,handler:it,allowed:ft}of this._handlers){if(!it.isEnabled())continue;let Mt;this._blockedByActive(Zt,ft,Ze)?it.reset():it[Fe||we.type]&&(Mt=it[Fe||we.type](we,Gr,yr),this.mergeHandlerResult(bt,zt,Mt,Ze,ct),Mt&&Mt.needsRenderFrame&&this._triggerRenderFrame()),(Mt||it.isActive())&&(Zt[Ze]=it)}let ta={};for(let Ze in this._previousActiveHandlers)Zt[Ze]||(ta[Ze]=ct);this._previousActiveHandlers=Zt,(Object.keys(ta).length||mi(bt))&&(this._changes.push([bt,zt,ta]),this._triggerRenderFrame()),(Object.keys(Zt).length||mi(bt))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:qe}=bt;qe&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],qe(this._map))},this._map=R,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new wc(R),this._bearingSnap=ae.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ae);let xe=this._el;this._listeners=[[xe,"touchstart",{passive:!0}],[xe,"touchmove",{passive:!1}],[xe,"touchend",void 0],[xe,"touchcancel",void 0],[xe,"mousedown",void 0],[xe,"mousemove",void 0],[xe,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[xe,"mouseover",void 0],[xe,"mouseout",void 0],[xe,"dblclick",void 0],[xe,"click",void 0],[xe,"keydown",{capture:!1}],[xe,"keyup",void 0],[xe,"wheel",{passive:!1}],[xe,"contextmenu",void 0],[window,"blur",void 0]];for(let[we,Fe,ct]of this._listeners)n.addEventListener(we,Fe,we===document?this.handleWindowEvent:this.handleEvent,ct)}destroy(){for(let[R,ae,xe]of this._listeners)n.removeEventListener(R,ae,R===document?this.handleWindowEvent:this.handleEvent,xe)}_addDefaultHandlers(R){let ae=this._map,xe=ae.getCanvasContainer();this._add("mapEvent",new Tc(ae,R));let we=ae.boxZoom=new $l(ae,R);this._add("boxZoom",we),R.interactive&&R.boxZoom&&we.enable();let Fe=ae.cooperativeGestures=new Sn(ae,R.cooperativeGestures);this._add("cooperativeGestures",Fe),R.cooperativeGestures&&Fe.enable();let ct=new Hu(ae),bt=new xn(ae);ae.doubleClickZoom=new Qa(bt,ct),this._add("tapZoom",ct),this._add("clickZoom",bt),R.interactive&&R.doubleClickZoom&&ae.doubleClickZoom.enable();let zt=new zn;this._add("tapDragZoom",zt);let Zt=ae.touchPitch=new Zu(ae);this._add("touchPitch",Zt),R.interactive&&R.touchPitch&&ae.touchPitch.enable(R.touchPitch);let gr=Cl(R),yr=Vc(R);ae.dragRotate=new ni(R,gr,yr),this._add("mouseRotate",gr,["mousePitch"]),this._add("mousePitch",yr,["mouseRotate"]),R.interactive&&R.dragRotate&&ae.dragRotate.enable();let Gr=(({enable:Mt,clickTolerance:xt})=>{let Pt=new hu({checkCorrectEvent:ir=>n.mouseButton(ir)===0&&!ir.ctrlKey});return new fu({clickTolerance:xt,move:(ir,fr)=>({around:fr,panDelta:fr.sub(ir)}),activateOnStart:!0,moveStateManager:Pt,enable:Mt,assignEvents:Dc})})(R),ta=new vu(R,ae);ae.dragPan=new Gn(xe,Gr,ta),this._add("mousePan",Gr),this._add("touchPan",ta,["touchZoom","touchRotate"]),R.interactive&&R.dragPan&&ae.dragPan.enable(R.dragPan);let qe=new lc,Ze=new jl;ae.touchZoomRotate=new wn(xe,Ze,qe,zt),this._add("touchRotate",qe,["touchPan","touchZoom"]),this._add("touchZoom",Ze,["touchPan","touchRotate"]),R.interactive&&R.touchZoomRotate&&ae.touchZoomRotate.enable(R.touchZoomRotate);let it=ae.scrollZoom=new xa(ae,()=>this._triggerRenderFrame());this._add("scrollZoom",it,["mousePan"]),R.interactive&&R.scrollZoom&&ae.scrollZoom.enable(R.scrollZoom);let ft=ae.keyboard=new vr(ae);this._add("keyboard",ft),R.interactive&&R.keyboard&&ae.keyboard.enable(),this._add("blockableMapEvent",new zs(ae))}_add(R,ae,xe){this._handlers.push({handlerName:R,handler:ae,allowed:xe}),this._handlersById[R]=ae}stop(R){if(!this._updatingCamera){for(let{handler:ae}of this._handlers)ae.reset();this._inertia.clear(),this._fireEvents({},{},R),this._changes=[]}}isActive(){for(let{handler:R}of this._handlers)if(R.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ln(this._eventsInProgress)||this.isZooming()}_blockedByActive(R,ae,xe){for(let we in R)if(we!==xe&&(!ae||ae.indexOf(we)<0))return!0;return!1}_getMapTouches(R){let ae=[];for(let xe of R)this._el.contains(xe.target)&&ae.push(xe);return ae}mergeHandlerResult(R,ae,xe,we,Fe){if(!xe)return;t.e(R,xe);let ct={handlerName:we,originalEvent:xe.originalEvent||Fe};xe.zoomDelta!==void 0&&(ae.zoom=ct),xe.panDelta!==void 0&&(ae.drag=ct),xe.pitchDelta!==void 0&&(ae.pitch=ct),xe.bearingDelta!==void 0&&(ae.rotate=ct)}_applyChanges(){let R={},ae={},xe={};for(let[we,Fe,ct]of this._changes)we.panDelta&&(R.panDelta=(R.panDelta||new t.P(0,0))._add(we.panDelta)),we.zoomDelta&&(R.zoomDelta=(R.zoomDelta||0)+we.zoomDelta),we.bearingDelta&&(R.bearingDelta=(R.bearingDelta||0)+we.bearingDelta),we.pitchDelta&&(R.pitchDelta=(R.pitchDelta||0)+we.pitchDelta),we.around!==void 0&&(R.around=we.around),we.pinchAround!==void 0&&(R.pinchAround=we.pinchAround),we.noInertia&&(R.noInertia=we.noInertia),t.e(ae,Fe),t.e(xe,ct);this._updateMapTransform(R,ae,xe),this._changes=[]}_updateMapTransform(R,ae,xe){let we=this._map,Fe=we._getTransformForUpdate(),ct=we.terrain;if(!(mi(R)||ct&&this._terrainMovement))return this._fireEvents(ae,xe,!0);let{panDelta:bt,zoomDelta:zt,bearingDelta:Zt,pitchDelta:gr,around:yr,pinchAround:Gr}=R;Gr!==void 0&&(yr=Gr),we._stop(!0),yr=yr||we.transform.centerPoint;let ta=Fe.pointLocation(bt?yr.sub(bt):yr);Zt&&(Fe.bearing+=Zt),gr&&(Fe.pitch+=gr),zt&&(Fe.zoom+=zt),ct?this._terrainMovement||!ae.drag&&!ae.zoom?ae.drag&&this._terrainMovement?Fe.center=Fe.pointLocation(Fe.centerPoint.sub(bt)):Fe.setLocationAtPoint(ta,yr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Fe.setLocationAtPoint(ta,yr)):Fe.setLocationAtPoint(ta,yr),we._applyUpdatedTransform(Fe),this._map._update(),R.noInertia||this._inertia.record(R),this._fireEvents(ae,xe,!0)}_fireEvents(R,ae,xe){let we=Ln(this._eventsInProgress),Fe=Ln(R),ct={};for(let yr in R){let{originalEvent:Gr}=R[yr];this._eventsInProgress[yr]||(ct[`${yr}start`]=Gr),this._eventsInProgress[yr]=R[yr]}!we&&Fe&&this._fireEvent("movestart",Fe.originalEvent);for(let yr in ct)this._fireEvent(yr,ct[yr]);Fe&&this._fireEvent("move",Fe.originalEvent);for(let yr in R){let{originalEvent:Gr}=R[yr];this._fireEvent(yr,Gr)}let bt={},zt;for(let yr in this._eventsInProgress){let{handlerName:Gr,originalEvent:ta}=this._eventsInProgress[yr];this._handlersById[Gr].isActive()||(delete this._eventsInProgress[yr],zt=ae[Gr]||ta,bt[`${yr}end`]=zt)}for(let yr in bt)this._fireEvent(yr,bt[yr]);let Zt=Ln(this._eventsInProgress),gr=(we||Fe)&&!Zt;if(gr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let yr=this._map._getTransformForUpdate();yr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(yr)}if(xe&&gr){this._updatingCamera=!0;let yr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Gr=ta=>ta!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new un("renderFrame",{timeStamp:R})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Vi extends t.E{constructor(R,ae){super(),this._renderFrameCallback=()=>{let xe=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(xe)),xe<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=R,this._bearingSnap=ae.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(R,ae){return this.jumpTo({center:R},ae)}panBy(R,ae,xe){return R=t.P.convert(R).mult(-1),this.panTo(this.transform.center,t.e({offset:R},ae),xe)}panTo(R,ae,xe){return this.easeTo(t.e({center:R},ae),xe)}getZoom(){return this.transform.zoom}setZoom(R,ae){return this.jumpTo({zoom:R},ae),this}zoomTo(R,ae,xe){return this.easeTo(t.e({zoom:R},ae),xe)}zoomIn(R,ae){return this.zoomTo(this.getZoom()+1,R,ae),this}zoomOut(R,ae){return this.zoomTo(this.getZoom()-1,R,ae),this}getBearing(){return this.transform.bearing}setBearing(R,ae){return this.jumpTo({bearing:R},ae),this}getPadding(){return this.transform.padding}setPadding(R,ae){return this.jumpTo({padding:R},ae),this}rotateTo(R,ae,xe){return this.easeTo(t.e({bearing:R},ae),xe)}resetNorth(R,ae){return this.rotateTo(0,t.e({duration:1e3},R),ae),this}resetNorthPitch(R,ae){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},R),ae),this}snapToNorth(R,ae){return Math.abs(this.getBearing()){if(this._zooming&&(we.zoom=t.y.number(Fe,it,wr)),this._rotating&&(we.bearing=t.y.number(ct,Zt,wr)),this._pitching&&(we.pitch=t.y.number(bt,gr,wr)),this._padding&&(we.interpolatePadding(zt,yr,wr),ta=we.centerPoint.add(Gr)),this.terrain&&!R.freezeElevation&&this._updateElevation(wr),Pt)we.setLocationAtPoint(Pt,ir);else{let zr=we.zoomScale(we.zoom-Fe),Xr=it>Fe?Math.min(2,xt):Math.max(.5,xt),la=Math.pow(Xr,1-wr),pa=we.unproject(ft.add(Mt.mult(wr*la)).mult(zr));we.setLocationAtPoint(we.renderWorldCopies?pa.wrap():pa,ta)}this._applyUpdatedTransform(we),this._fireMoveEvents(ae)},wr=>{this.terrain&&R.freezeElevation&&this._finalizeElevation(),this._afterEase(ae,wr)},R),this}_prepareEase(R,ae,xe={}){this._moving=!0,ae||xe.moving||this.fire(new t.k("movestart",R)),this._zooming&&!xe.zooming&&this.fire(new t.k("zoomstart",R)),this._rotating&&!xe.rotating&&this.fire(new t.k("rotatestart",R)),this._pitching&&!xe.pitching&&this.fire(new t.k("pitchstart",R))}_prepareElevation(R){this._elevationCenter=R,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(R,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(R){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let ae=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(R<1&&ae!==this._elevationTarget){let xe=this._elevationTarget-this._elevationStart;this._elevationStart+=R*(xe-(ae-(xe*R+this._elevationStart))/(1-R)),this._elevationTarget=ae}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,R)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(R){let ae=R.getCameraPosition(),xe=this.terrain.getElevationForLngLatZoom(ae.lngLat,R.zoom);if(ae.altitudethis._elevateCameraIfInsideTerrain(we)),this.transformCameraUpdate&&ae.push(we=>this.transformCameraUpdate(we)),!ae.length)return;let xe=R.clone();for(let we of ae){let Fe=xe.clone(),{center:ct,zoom:bt,pitch:zt,bearing:Zt,elevation:gr}=we(Fe);ct&&(Fe.center=ct),bt!==void 0&&(Fe.zoom=bt),zt!==void 0&&(Fe.pitch=zt),Zt!==void 0&&(Fe.bearing=Zt),gr!==void 0&&(Fe.elevation=gr),xe.apply(Fe)}this.transform.apply(xe)}_fireMoveEvents(R){this.fire(new t.k("move",R)),this._zooming&&this.fire(new t.k("zoom",R)),this._rotating&&this.fire(new t.k("rotate",R)),this._pitching&&this.fire(new t.k("pitch",R))}_afterEase(R,ae){if(this._easeId&&ae&&this._easeId===ae)return;delete this._easeId;let xe=this._zooming,we=this._rotating,Fe=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,xe&&this.fire(new t.k("zoomend",R)),we&&this.fire(new t.k("rotateend",R)),Fe&&this.fire(new t.k("pitchend",R)),this.fire(new t.k("moveend",R))}flyTo(R,ae){var xe;if(!R.essential&&i.prefersReducedMotion){let Yn=t.M(R,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Yn,ae)}this.stop(),R=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},R);let we=this._getTransformForUpdate(),Fe=we.zoom,ct=we.bearing,bt=we.pitch,zt=we.padding,Zt="bearing"in R?this._normalizeBearing(R.bearing,ct):ct,gr="pitch"in R?+R.pitch:bt,yr="padding"in R?R.padding:we.padding,Gr=t.P.convert(R.offset),ta=we.centerPoint.add(Gr),qe=we.pointLocation(ta),{center:Ze,zoom:it}=we.getConstrained(t.N.convert(R.center||qe),(xe=R.zoom)!==null&&xe!==void 0?xe:Fe);this._normalizeCenter(Ze,we);let ft=we.zoomScale(it-Fe),Mt=we.project(qe),xt=we.project(Ze).sub(Mt),Pt=R.curve,ir=Math.max(we.width,we.height),fr=ir/ft,wr=xt.mag();if("minZoom"in R){let Yn=t.ac(Math.min(R.minZoom,Fe,it),we.minZoom,we.maxZoom),di=ir/we.zoomScale(Yn-Fe);Pt=Math.sqrt(di/wr*2)}let zr=Pt*Pt;function Xr(Yn){let di=(fr*fr-ir*ir+(Yn?-1:1)*zr*zr*wr*wr)/(2*(Yn?fr:ir)*zr*wr);return Math.log(Math.sqrt(di*di+1)-di)}function la(Yn){return(Math.exp(Yn)-Math.exp(-Yn))/2}function pa(Yn){return(Math.exp(Yn)+Math.exp(-Yn))/2}let ka=Xr(!1),tn=function(Yn){return pa(ka)/pa(ka+Pt*Yn)},Dn=function(Yn){return ir*((pa(ka)*(la(di=ka+Pt*Yn)/pa(di))-la(ka))/zr)/wr;var di},In=(Xr(!0)-ka)/Pt;if(Math.abs(wr)<1e-6||!isFinite(In)){if(Math.abs(ir-fr)<1e-6)return this.easeTo(R,ae);let Yn=fr0,tn=di=>Math.exp(Yn*Pt*di)}return R.duration="duration"in R?+R.duration:1e3*In/("screenSpeed"in R?+R.screenSpeed/Pt:+R.speed),R.maxDuration&&R.duration>R.maxDuration&&(R.duration=0),this._zooming=!0,this._rotating=ct!==Zt,this._pitching=gr!==bt,this._padding=!we.isPaddingEqual(yr),this._prepareEase(ae,!1),this.terrain&&this._prepareElevation(Ze),this._ease(Yn=>{let di=Yn*In,Di=1/tn(di);we.zoom=Yn===1?it:Fe+we.scaleZoom(Di),this._rotating&&(we.bearing=t.y.number(ct,Zt,Yn)),this._pitching&&(we.pitch=t.y.number(bt,gr,Yn)),this._padding&&(we.interpolatePadding(zt,yr,Yn),ta=we.centerPoint.add(Gr)),this.terrain&&!R.freezeElevation&&this._updateElevation(Yn);let Ai=Yn===1?Ze:we.unproject(Mt.add(xt.mult(Dn(di))).mult(Di));we.setLocationAtPoint(we.renderWorldCopies?Ai.wrap():Ai,ta),this._applyUpdatedTransform(we),this._fireMoveEvents(ae)},()=>{this.terrain&&R.freezeElevation&&this._finalizeElevation(),this._afterEase(ae)},R),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(R,ae){var xe;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let we=this._onEaseEnd;delete this._onEaseEnd,we.call(this,ae)}return R||(xe=this.handlers)===null||xe===void 0||xe.stop(!1),this}_ease(R,ae,xe){xe.animate===!1||xe.duration===0?(R(1),ae()):(this._easeStart=i.now(),this._easeOptions=xe,this._onEaseFrame=R,this._onEaseEnd=ae,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(R,ae){R=t.b3(R,-180,180);let xe=Math.abs(R-ae);return Math.abs(R-360-ae)180?-360:xe<-180?360:0}queryTerrainElevation(R){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(R),this.transform.tileZoom)-this.transform.elevation:null}}let Bi={compact:!0,customAttribution:'MapLibre'};class Yi{constructor(R=Bi){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ae=>{!ae||ae.sourceDataType!=="metadata"&&ae.sourceDataType!=="visibility"&&ae.dataType!=="style"&&ae.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=R}getDefaultPosition(){return"bottom-right"}onAdd(R){return this._map=R,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(R,ae){let xe=this._map._getUIString(`AttributionControl.${ae}`);R.title=xe,R.setAttribute("aria-label",xe)}_updateAttributions(){if(!this._map.style)return;let R=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?R=R.concat(this.options.customAttribution.map(we=>typeof we!="string"?"":we)):typeof this.options.customAttribution=="string"&&R.push(this.options.customAttribution)),this._map.style.stylesheet){let we=this._map.style.stylesheet;this.styleOwner=we.owner,this.styleId=we.id}let ae=this._map.style.sourceCaches;for(let we in ae){let Fe=ae[we];if(Fe.used||Fe.usedForTerrain){let ct=Fe.getSource();ct.attribution&&R.indexOf(ct.attribution)<0&&R.push(ct.attribution)}}R=R.filter(we=>String(we).trim()),R.sort((we,Fe)=>we.length-Fe.length),R=R.filter((we,Fe)=>{for(let ct=Fe+1;ct=0)return!1;return!0});let xe=R.join(" | ");xe!==this._attribHTML&&(this._attribHTML=xe,R.length?(this._innerContainer.innerHTML=xe,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class vi{constructor(R={}){this._updateCompact=()=>{let ae=this._container.children;if(ae.length){let xe=ae[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&xe.classList.add("maplibregl-compact"):xe.classList.remove("maplibregl-compact")}},this.options=R}getDefaultPosition(){return"bottom-left"}onAdd(R){this._map=R,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");let ae=n.create("a","maplibregl-ctrl-logo");return ae.target="_blank",ae.rel="noopener nofollow",ae.href="https://maplibre.org/",ae.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ae.setAttribute("rel","noopener nofollow"),this._container.appendChild(ae),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Qn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(R){let ae=++this._id;return this._queue.push({callback:R,id:ae,cancelled:!1}),ae}remove(R){let ae=this._currentlyRunning,xe=ae?this._queue.concat(ae):this._queue;for(let we of xe)if(we.id===R)return void(we.cancelled=!0)}run(R=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let ae=this._currentlyRunning=this._queue;this._queue=[];for(let xe of ae)if(!xe.cancelled&&(xe.callback(R),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var no=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Ro extends t.E{constructor(R){super(),this.sourceCache=R,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,R.usedForTerrain=!0,R.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(R,ae){this.sourceCache.update(R,ae),this._renderableTilesKeys=[];let xe={};for(let we of R.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ae}))xe[we.key]=!0,this._renderableTilesKeys.push(we.key),this._tiles[we.key]||(we.posMatrix=new Float64Array(16),t.aP(we.posMatrix,0,t.X,0,t.X,0,1),this._tiles[we.key]=new nt(we,this.tileSize));for(let we in this._tiles)xe[we]||delete this._tiles[we]}freeRtt(R){for(let ae in this._tiles){let xe=this._tiles[ae];(!R||xe.tileID.equals(R)||xe.tileID.isChildOf(R)||R.isChildOf(xe.tileID))&&(xe.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(R=>this.getTileByID(R))}getTileByID(R){return this._tiles[R]}getTerrainCoords(R){let ae={};for(let xe of this._renderableTilesKeys){let we=this._tiles[xe].tileID;if(we.canonical.equals(R.canonical)){let Fe=R.clone();Fe.posMatrix=new Float64Array(16),t.aP(Fe.posMatrix,0,t.X,0,t.X,0,1),ae[xe]=Fe}else if(we.canonical.isChildOf(R.canonical)){let Fe=R.clone();Fe.posMatrix=new Float64Array(16);let ct=we.canonical.z-R.canonical.z,bt=we.canonical.x-(we.canonical.x>>ct<>ct<>ct;t.aP(Fe.posMatrix,0,Zt,0,Zt,0,1),t.J(Fe.posMatrix,Fe.posMatrix,[-bt*Zt,-zt*Zt,0]),ae[xe]=Fe}else if(R.canonical.isChildOf(we.canonical)){let Fe=R.clone();Fe.posMatrix=new Float64Array(16);let ct=R.canonical.z-we.canonical.z,bt=R.canonical.x-(R.canonical.x>>ct<>ct<>ct;t.aP(Fe.posMatrix,0,t.X,0,t.X,0,1),t.J(Fe.posMatrix,Fe.posMatrix,[bt*Zt,zt*Zt,0]),t.K(Fe.posMatrix,Fe.posMatrix,[1/2**ct,1/2**ct,0]),ae[xe]=Fe}}return ae}getSourceTile(R,ae){let xe=this.sourceCache._source,we=R.overscaledZ-this.deltaZoom;if(we>xe.maxzoom&&(we=xe.maxzoom),we=xe.minzoom&&(!Fe||!Fe.dem);)Fe=this.sourceCache.getTileByID(R.scaledTo(we--).key);return Fe}tilesAfterTime(R=Date.now()){return Object.values(this._tiles).filter(ae=>ae.timeAdded>=R)}}class as{constructor(R,ae,xe){this.painter=R,this.sourceCache=new Ro(ae),this.options=xe,this.exaggeration=typeof xe.exaggeration=="number"?xe.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(R,ae,xe,we=t.X){var Fe;if(!(ae>=0&&ae=0&&xeR.canonical.z&&(R.canonical.z>=we?Fe=R.canonical.z-we:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let ct=R.canonical.x-(R.canonical.x>>Fe<>Fe<>8<<4|Fe>>8,ae[ct+3]=0;let xe=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ae.buffer)),we=new u(R,xe,R.gl.RGBA,{premultiply:!1});return we.bind(R.gl.NEAREST,R.gl.CLAMP_TO_EDGE),this._coordsTexture=we,we}pointCoordinate(R){this.painter.maybeDrawDepthAndCoords(!0);let ae=new Uint8Array(4),xe=this.painter.context,we=xe.gl,Fe=Math.round(R.x*this.painter.pixelRatio/devicePixelRatio),ct=Math.round(R.y*this.painter.pixelRatio/devicePixelRatio),bt=Math.round(this.painter.height/devicePixelRatio);xe.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),we.readPixels(Fe,bt-ct-1,1,1,we.RGBA,we.UNSIGNED_BYTE,ae),xe.bindFramebuffer.set(null);let zt=ae[0]+(ae[2]>>4<<8),Zt=ae[1]+((15&ae[2])<<8),gr=this.coordsIndex[255-ae[3]],yr=gr&&this.sourceCache.getTileByID(gr);if(!yr)return null;let Gr=this._coordsTextureSize,ta=(1<R.id!==ae),this._recentlyUsed.push(R.id)}stampObject(R){R.stamp=++this._stamp}getOrCreateFreeObject(){for(let ae of this._recentlyUsed)if(!this._objects[ae].inUse)return this._objects[ae];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let R=this._createObject(this._objects.length);return this._objects.push(R),R}freeObject(R){R.inUse=!1}freeAllObjects(){for(let R of this._objects)this.freeObject(R)}isFull(){return!(this._objects.length!R.inUse)===!1}}let ds={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Cs{constructor(R,ae){this.painter=R,this.terrain=ae,this.pool=new Ps(R.context,30,ae.sourceCache.tileSize*ae.qualityFactor)}destruct(){this.pool.destruct()}getTexture(R){return this.pool.getObjectForId(R.rtt[this._stacks.length-1].id).texture}prepareForRender(R,ae){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=R._order.filter(xe=>!R._layers[xe].isHidden(ae)),this._coordsDescendingInv={};for(let xe in R.sourceCaches){this._coordsDescendingInv[xe]={};let we=R.sourceCaches[xe].getVisibleCoordinates();for(let Fe of we){let ct=this.terrain.sourceCache.getTerrainCoords(Fe);for(let bt in ct)this._coordsDescendingInv[xe][bt]||(this._coordsDescendingInv[xe][bt]=[]),this._coordsDescendingInv[xe][bt].push(ct[bt])}}this._coordsDescendingInvStr={};for(let xe of R._order){let we=R._layers[xe],Fe=we.source;if(ds[we.type]&&!this._coordsDescendingInvStr[Fe]){this._coordsDescendingInvStr[Fe]={};for(let ct in this._coordsDescendingInv[Fe])this._coordsDescendingInvStr[Fe][ct]=this._coordsDescendingInv[Fe][ct].map(bt=>bt.key).sort().join()}}for(let xe of this._renderableTiles)for(let we in this._coordsDescendingInvStr){let Fe=this._coordsDescendingInvStr[we][xe.tileID.key];Fe&&Fe!==xe.rttCoords[we]&&(xe.rtt=[])}}renderLayer(R){if(R.isHidden(this.painter.transform.zoom))return!1;let ae=R.type,xe=this.painter,we=this._renderableLayerIds[this._renderableLayerIds.length-1]===R.id;if(ds[ae]&&(this._prevType&&ds[this._prevType]||this._stacks.push([]),this._prevType=ae,this._stacks[this._stacks.length-1].push(R.id),!we))return!0;if(ds[this._prevType]||ds[ae]&&we){this._prevType=ae;let Fe=this._stacks.length-1,ct=this._stacks[Fe]||[];for(let bt of this._renderableTiles){if(this.pool.isFull()&&(Hs(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(bt),bt.rtt[Fe]){let Zt=this.pool.getObjectForId(bt.rtt[Fe].id);if(Zt.stamp===bt.rtt[Fe].stamp){this.pool.useObject(Zt);continue}}let zt=this.pool.getOrCreateFreeObject();this.pool.useObject(zt),this.pool.stampObject(zt),bt.rtt[Fe]={id:zt.id,stamp:zt.stamp},xe.context.bindFramebuffer.set(zt.fbo.framebuffer),xe.context.clear({color:t.aM.transparent,stencil:0}),xe.currentStencilSource=void 0;for(let Zt=0;Zt{Be.touchstart=Be.dragStart,Be.touchmoveWindow=Be.dragMove,Be.touchend=Be.dragEnd},Mi={showCompass:!0,showZoom:!0,visualizePitch:!1};class yo{constructor(R,ae,xe=!1){this.mousedown=ct=>{this.startMouse(t.e({},ct,{ctrlKey:!0,preventDefault:()=>ct.preventDefault()}),n.mousePos(this.element,ct)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ct=>{this.moveMouse(ct,n.mousePos(this.element,ct))},this.mouseup=ct=>{this.mouseRotate.dragEnd(ct),this.mousePitch&&this.mousePitch.dragEnd(ct),this.offTemp()},this.touchstart=ct=>{ct.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,ct.targetTouches)[0],this.startTouch(ct,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=ct=>{ct.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,ct.targetTouches)[0],this.moveTouch(ct,this._lastPos))},this.touchend=ct=>{ct.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let we=R.dragRotate._mouseRotate.getClickTolerance(),Fe=R.dragRotate._mousePitch.getClickTolerance();this.element=ae,this.mouseRotate=Cl({clickTolerance:we,enable:!0}),this.touchRotate=(({enable:ct,clickTolerance:bt,bearingDegreesPerPixelMoved:zt=.8})=>{let Zt=new sc;return new fu({clickTolerance:bt,move:(gr,yr)=>({bearingDelta:(yr.x-gr.x)*zt}),moveStateManager:Zt,enable:ct,assignEvents:Fs})})({clickTolerance:we,enable:!0}),this.map=R,xe&&(this.mousePitch=Vc({clickTolerance:Fe,enable:!0}),this.touchPitch=(({enable:ct,clickTolerance:bt,pitchDegreesPerPixelMoved:zt=-.5})=>{let Zt=new sc;return new fu({clickTolerance:bt,move:(gr,yr)=>({pitchDelta:(yr.y-gr.y)*zt}),moveStateManager:Zt,enable:ct,assignEvents:Fs})})({clickTolerance:Fe,enable:!0})),n.addEventListener(ae,"mousedown",this.mousedown),n.addEventListener(ae,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ae,"touchcancel",this.reset)}startMouse(R,ae){this.mouseRotate.dragStart(R,ae),this.mousePitch&&this.mousePitch.dragStart(R,ae),n.disableDrag()}startTouch(R,ae){this.touchRotate.dragStart(R,ae),this.touchPitch&&this.touchPitch.dragStart(R,ae),n.disableDrag()}moveMouse(R,ae){let xe=this.map,{bearingDelta:we}=this.mouseRotate.dragMove(R,ae)||{};if(we&&xe.setBearing(xe.getBearing()+we),this.mousePitch){let{pitchDelta:Fe}=this.mousePitch.dragMove(R,ae)||{};Fe&&xe.setPitch(xe.getPitch()+Fe)}}moveTouch(R,ae){let xe=this.map,{bearingDelta:we}=this.touchRotate.dragMove(R,ae)||{};if(we&&xe.setBearing(xe.getBearing()+we),this.touchPitch){let{pitchDelta:Fe}=this.touchPitch.dragMove(R,ae)||{};Fe&&xe.setPitch(xe.getPitch()+Fe)}}off(){let R=this.element;n.removeEventListener(R,"mousedown",this.mousedown),n.removeEventListener(R,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(R,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let Ss;function us(Be,R,ae){let xe=new t.N(Be.lng,Be.lat);if(Be=new t.N(Be.lng,Be.lat),R){let we=new t.N(Be.lng-360,Be.lat),Fe=new t.N(Be.lng+360,Be.lat),ct=ae.locationPoint(Be).distSqr(R);ae.locationPoint(we).distSqr(R)180;){let we=ae.locationPoint(Be);if(we.x>=0&&we.y>=0&&we.x<=ae.width&&we.y<=ae.height)break;Be.lng>ae.center.lng?Be.lng-=360:Be.lng+=360}return Be.lng!==xe.lng&&ae.locationPoint(Be).y>ae.height/2-ae.getHorizon()?Be:xe}let Pl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Ql(Be,R,ae){let xe=Be.classList;for(let we in Pl)xe.remove(`maplibregl-${ae}-anchor-${we}`);xe.add(`maplibregl-${ae}-anchor-${R}`)}class du extends t.E{constructor(R){if(super(),this._onKeyPress=ae=>{let xe=ae.code,we=ae.charCode||ae.keyCode;xe!=="Space"&&xe!=="Enter"&&we!==32&&we!==13||this.togglePopup()},this._onMapClick=ae=>{let xe=ae.originalEvent.target,we=this._element;this._popup&&(xe===we||we.contains(xe))&&this.togglePopup()},this._update=ae=>{var xe;if(!this._map)return;let we=this._map.loaded()&&!this._map.isMoving();(ae?.type==="terrain"||ae?.type==="render"&&!we)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?us(this._lngLat,this._flatPos,this._map.transform):(xe=this._lngLat)===null||xe===void 0?void 0:xe.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Fe="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Fe=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Fe=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ct="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ct="rotateX(0deg)":this._pitchAlignment==="map"&&(ct=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ae&&ae.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${Pl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ct} ${Fe}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ae&&ae.type==="moveend")}).catch(()=>{})},this._onMove=ae=>{if(!this._isDragging){let xe=this._clickTolerance||this._map._clickTolerance;this._isDragging=ae.point.dist(this._pointerdownPos)>=xe}this._isDragging&&(this._pos=ae.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ae=>{this._element.contains(ae.originalEvent.target)&&(ae.preventDefault(),this._positionDelta=ae.point.sub(this._pos).add(this._offset),this._pointerdownPos=ae.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=R&&R.anchor||"center",this._color=R&&R.color||"#3FB1CE",this._scale=R&&R.scale||1,this._draggable=R&&R.draggable||!1,this._clickTolerance=R&&R.clickTolerance||0,this._subpixelPositioning=R&&R.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=R&&R.rotation||0,this._rotationAlignment=R&&R.rotationAlignment||"auto",this._pitchAlignment=R&&R.pitchAlignment&&R.pitchAlignment!=="auto"?R.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(R?.opacity,R?.opacityWhenCovered),R&&R.element)this._element=R.element,this._offset=t.P.convert(R&&R.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");let ae=n.createNS("http://www.w3.org/2000/svg","svg"),xe=41,we=27;ae.setAttributeNS(null,"display","block"),ae.setAttributeNS(null,"height",`${xe}px`),ae.setAttributeNS(null,"width",`${we}px`),ae.setAttributeNS(null,"viewBox",`0 0 ${we} ${xe}`);let Fe=n.createNS("http://www.w3.org/2000/svg","g");Fe.setAttributeNS(null,"stroke","none"),Fe.setAttributeNS(null,"stroke-width","1"),Fe.setAttributeNS(null,"fill","none"),Fe.setAttributeNS(null,"fill-rule","evenodd");let ct=n.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"fill-rule","nonzero");let bt=n.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),bt.setAttributeNS(null,"fill","#000000");let zt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let ft of zt){let Mt=n.createNS("http://www.w3.org/2000/svg","ellipse");Mt.setAttributeNS(null,"opacity","0.04"),Mt.setAttributeNS(null,"cx","10.5"),Mt.setAttributeNS(null,"cy","5.80029008"),Mt.setAttributeNS(null,"rx",ft.rx),Mt.setAttributeNS(null,"ry",ft.ry),bt.appendChild(Mt)}let Zt=n.createNS("http://www.w3.org/2000/svg","g");Zt.setAttributeNS(null,"fill",this._color);let gr=n.createNS("http://www.w3.org/2000/svg","path");gr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Zt.appendChild(gr);let yr=n.createNS("http://www.w3.org/2000/svg","g");yr.setAttributeNS(null,"opacity","0.25"),yr.setAttributeNS(null,"fill","#000000");let Gr=n.createNS("http://www.w3.org/2000/svg","path");Gr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),yr.appendChild(Gr);let ta=n.createNS("http://www.w3.org/2000/svg","g");ta.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ta.setAttributeNS(null,"fill","#FFFFFF");let qe=n.createNS("http://www.w3.org/2000/svg","g");qe.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Ze=n.createNS("http://www.w3.org/2000/svg","circle");Ze.setAttributeNS(null,"fill","#000000"),Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"cx","5.5"),Ze.setAttributeNS(null,"cy","5.5"),Ze.setAttributeNS(null,"r","5.4999962");let it=n.createNS("http://www.w3.org/2000/svg","circle");it.setAttributeNS(null,"fill","#FFFFFF"),it.setAttributeNS(null,"cx","5.5"),it.setAttributeNS(null,"cy","5.5"),it.setAttributeNS(null,"r","5.4999962"),qe.appendChild(Ze),qe.appendChild(it),ct.appendChild(bt),ct.appendChild(Zt),ct.appendChild(yr),ct.appendChild(ta),ct.appendChild(qe),ae.appendChild(ct),ae.setAttributeNS(null,"height",xe*this._scale+"px"),ae.setAttributeNS(null,"width",we*this._scale+"px"),this._element.appendChild(ae),this._offset=t.P.convert(R&&R.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ae=>{ae.preventDefault()}),this._element.addEventListener("mousedown",ae=>{ae.preventDefault()}),Ql(this._element,this._anchor,"marker"),R&&R.className)for(let ae of R.className.split(" "))this._element.classList.add(ae);this._popup=null}addTo(R){return this.remove(),this._map=R,this._element.setAttribute("aria-label",R._getUIString("Marker.Title")),R.getCanvasContainer().appendChild(this._element),R.on("move",this._update),R.on("moveend",this._update),R.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(R){return this._lngLat=t.N.convert(R),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(R){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),R){if(!("offset"in R.options)){let we=Math.abs(13.5)/Math.SQRT2;R.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[we,-1*(38.1-13.5+we)],"bottom-right":[-we,-1*(38.1-13.5+we)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=R,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(R){return this._subpixelPositioning=R,this}getPopup(){return this._popup}togglePopup(){let R=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:R?(R.isOpen()?R.remove():(R.setLngLat(this._lngLat),R.addTo(this._map)),this):this}_updateOpacity(R=!1){var ae,xe;if(!(!((ae=this._map)===null||ae===void 0)&&ae.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(R)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let we=this._map,Fe=we.terrain.depthAtPoint(this._pos),ct=we.terrain.getElevationForLngLatZoom(this._lngLat,we.transform.tileZoom);if(we.transform.lngLatToCameraDepth(this._lngLat,ct)-Fe<.006)return void(this._element.style.opacity=this._opacity);let bt=-this._offset.y/we.transform._pixelPerMeter,zt=Math.sin(we.getPitch()*Math.PI/180)*bt,Zt=we.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),gr=we.transform.lngLatToCameraDepth(this._lngLat,ct+zt)-Zt>.006;!((xe=this._popup)===null||xe===void 0)&&xe.isOpen()&&gr&&this._popup.remove(),this._element.style.opacity=gr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(R){return this._offset=t.P.convert(R),this._update(),this}addClassName(R){this._element.classList.add(R)}removeClassName(R){this._element.classList.remove(R)}toggleClassName(R){return this._element.classList.toggle(R)}setDraggable(R){return this._draggable=!!R,this._map&&(R?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(R){return this._rotation=R||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(R){return this._rotationAlignment=R||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(R){return this._pitchAlignment=R&&R!=="auto"?R:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(R,ae){return R===void 0&&ae===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),R!==void 0&&(this._opacity=R),ae!==void 0&&(this._opacityWhenCovered=ae),this._map&&this._updateOpacity(!0),this}}let Yu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Vl=0,Ku=!1,Hl={maxWidth:100,unit:"metric"};function Ou(Be,R,ae){let xe=ae&&ae.maxWidth||100,we=Be._container.clientHeight/2,Fe=Be.unproject([0,we]),ct=Be.unproject([xe,we]),bt=Fe.distanceTo(ct);if(ae&&ae.unit==="imperial"){let zt=3.2808*bt;zt>5280?Ki(R,xe,zt/5280,Be._getUIString("ScaleControl.Miles")):Ki(R,xe,zt,Be._getUIString("ScaleControl.Feet"))}else ae&&ae.unit==="nautical"?Ki(R,xe,bt/1852,Be._getUIString("ScaleControl.NauticalMiles")):bt>=1e3?Ki(R,xe,bt/1e3,Be._getUIString("ScaleControl.Kilometers")):Ki(R,xe,bt,Be._getUIString("ScaleControl.Meters"))}function Ki(Be,R,ae,xe){let we=(function(Fe){let ct=Math.pow(10,`${Math.floor(Fe)}`.length-1),bt=Fe/ct;return bt=bt>=10?10:bt>=5?5:bt>=3?3:bt>=2?2:bt>=1?1:(function(zt){let Zt=Math.pow(10,Math.ceil(-Math.log(zt)/Math.LN10));return Math.round(zt*Zt)/Zt})(bt),ct*bt})(ae);Be.style.width=R*(we/ae)+"px",Be.innerHTML=`${we} ${xe}`}let xo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Ju=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Eu(Be){if(Be){if(typeof Be=="number"){let R=Math.round(Math.abs(Be)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Be),"top-left":new t.P(R,R),"top-right":new t.P(-R,R),bottom:new t.P(0,-Be),"bottom-left":new t.P(R,-R),"bottom-right":new t.P(-R,-R),left:new t.P(Be,0),right:new t.P(-Be,0)}}if(Be instanceof t.P||Array.isArray(Be)){let R=t.P.convert(Be);return{center:R,top:R,"top-left":R,"top-right":R,bottom:R,"bottom-left":R,"bottom-right":R,left:R,right:R}}return{center:t.P.convert(Be.center||[0,0]),top:t.P.convert(Be.top||[0,0]),"top-left":t.P.convert(Be["top-left"]||[0,0]),"top-right":t.P.convert(Be["top-right"]||[0,0]),bottom:t.P.convert(Be.bottom||[0,0]),"bottom-left":t.P.convert(Be["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Be["bottom-right"]||[0,0]),left:t.P.convert(Be.left||[0,0]),right:t.P.convert(Be.right||[0,0])}}return Eu(new t.P(0,0))}let pu=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Yi,e.BoxZoomHandler=$l,e.CanvasSource=$e,e.CooperativeGesturesHandler=Sn,e.DoubleClickZoomHandler=Qa,e.DragPanHandler=Gn,e.DragRotateHandler=ni,e.EdgeInsets=Nl,e.FullscreenControl=class extends t.E{constructor(Be={}){super(),this._onFullscreenChange=()=>{var R;let ae=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((R=ae?.shadowRoot)===null||R===void 0)&&R.fullscreenElement;)ae=ae.shadowRoot.fullscreenElement;ae===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Be&&Be.container&&(Be.container instanceof HTMLElement?this._container=Be.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Be){return this._map=Be,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Be=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",Be).setAttribute("aria-hidden","true"),Be.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Be=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Be),this._fullscreenButton.title=Be}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=De,e.GeolocateControl=class extends t.E{constructor(Be){super(),this._onSuccess=R=>{if(this._map){if(this._isOutOfMapMaxBounds(R))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",R)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=R,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(R),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(R),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",R)),this._finish()}},this._updateCamera=R=>{let ae=new t.N(R.coords.longitude,R.coords.latitude),xe=R.coords.accuracy,we=this._map.getBearing(),Fe=t.e({bearing:we},this.options.fitBoundsOptions),ct=re.fromLngLat(ae,xe);this._map.fitBounds(ct,Fe,{geolocateSource:!0})},this._updateMarker=R=>{if(R){let ae=new t.N(R.coords.longitude,R.coords.latitude);this._accuracyCircleMarker.setLngLat(ae).addTo(this._map),this._userLocationDotMarker.setLngLat(ae).addTo(this._map),this._accuracy=R.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=R=>{if(this._map){if(this.options.trackUserLocation)if(R.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(R.code===3&&Ku)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",R)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",R=>R.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=R=>{if(this._map){if(R===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}else{let ae=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new du({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new du({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ae=>{ae.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ae.originalEvent&&ae.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},Yu,Be)}onAdd(Be){return this._map=Be,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return t._(this,arguments,void 0,function*(R=!1){if(Ss!==void 0&&!R)return Ss;if(window.navigator.permissions===void 0)return Ss=!!window.navigator.geolocation,Ss;try{Ss=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Ss=!!window.navigator.geolocation}return Ss})})().then(R=>this._finishSetupUI(R)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Vl=0,Ku=!1}_isOutOfMapMaxBounds(Be){let R=this._map.getMaxBounds(),ae=Be.coords;return R&&(ae.longitudeR.getEast()||ae.latitudeR.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Be=this._map.getBounds(),R=Be.getSouthEast(),ae=Be.getNorthEast(),xe=R.distanceTo(ae),we=Math.ceil(this._accuracy/(xe/this._map._container.clientHeight)*2);this._circleElement.style.width=`${we}px`,this._circleElement.style.height=`${we}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Vl--,Ku=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Be;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Vl++,Vl>1?(Be={maximumAge:6e5,timeout:0},Ku=!0):(Be=this.options.positionOptions,Ku=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Be)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=$c,e.ImageSource=et,e.KeyboardHandler=vr,e.LngLatBounds=re,e.LogoControl=vi,e.Map=class extends Vi{constructor(Be){t.bf.mark(t.bg.create);let R=Object.assign(Object.assign({},Ws),Be);if(R.minZoom!=null&&R.maxZoom!=null&&R.minZoom>R.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(R.minPitch!=null&&R.maxPitch!=null&&R.minPitch>R.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(R.minPitch!=null&&R.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(R.maxPitch!=null&&R.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new tl(R.minZoom,R.maxZoom,R.minPitch,R.maxPitch,R.renderWorldCopies),{bearingSnap:R.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Qn,this._controls=[],this._mapId=t.a4(),this._contextLost=ae=>{ae.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ae}))},this._contextRestored=ae=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ae}))},this._onMapScroll=ae=>{if(ae.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=R.interactive,this._maxTileCacheSize=R.maxTileCacheSize,this._maxTileCacheZoomLevels=R.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=R.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=R.preserveDrawingBuffer===!0,this._antialias=R.antialias===!0,this._trackResize=R.trackResize===!0,this._bearingSnap=R.bearingSnap,this._refreshExpiredTiles=R.refreshExpiredTiles===!0,this._fadeDuration=R.fadeDuration,this._crossSourceCollisions=R.crossSourceCollisions===!0,this._collectResourceTiming=R.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},es),R.locale),this._clickTolerance=R.clickTolerance,this._overridePixelRatio=R.pixelRatio,this._maxCanvasSize=R.maxCanvasSize,this.transformCameraUpdate=R.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=R.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new _(R.transformRequest),typeof R.container=="string"){if(this._container=document.getElementById(R.container),!this._container)throw new Error(`Container '${R.container}' not found.`)}else{if(!(R.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=R.container}if(R.maxBounds&&this.setMaxBounds(R.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ae=!1,xe=jc(we=>{this._trackResize&&!this._removed&&(this.resize(we),this.redraw())},50);this._resizeObserver=new ResizeObserver(we=>{ae?xe(we):ae=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Oi(this,R),this._hash=R.hash&&new $c(typeof R.hash=="string"&&R.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:R.center,zoom:R.zoom,bearing:R.bearing,pitch:R.pitch}),R.bounds&&(this.resize(),this.fitBounds(R.bounds,t.e({},R.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=R.localIdeographFontFamily,this._validateStyle=R.validateStyle,R.style&&this.setStyle(R.style,{localIdeographFontFamily:R.localIdeographFontFamily}),R.attributionControl&&this.addControl(new Yi(typeof R.attributionControl=="boolean"?void 0:R.attributionControl)),R.maplibreLogo&&this.addControl(new vi,R.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ae=>{this._update(ae.dataType==="style"),this.fire(new t.k(`${ae.dataType}data`,ae))}),this.on("dataloading",ae=>{this.fire(new t.k(`${ae.dataType}dataloading`,ae))}),this.on("dataabort",ae=>{this.fire(new t.k("sourcedataabort",ae))})}_getMapId(){return this._mapId}addControl(Be,R){if(R===void 0&&(R=Be.getDefaultPosition?Be.getDefaultPosition():"top-right"),!Be||!Be.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let ae=Be.onAdd(this);this._controls.push(Be);let xe=this._controlPositions[R];return R.indexOf("bottom")!==-1?xe.insertBefore(ae,xe.firstChild):xe.appendChild(ae),this}removeControl(Be){if(!Be||!Be.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let R=this._controls.indexOf(Be);return R>-1&&this._controls.splice(R,1),Be.onRemove(this),this}hasControl(Be){return this._controls.indexOf(Be)>-1}calculateCameraOptionsFromTo(Be,R,ae,xe){return xe==null&&this.terrain&&(xe=this.terrain.getElevationForLngLatZoom(ae,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Be,R,ae,xe)}resize(Be){var R;let ae=this._containerDimensions(),xe=ae[0],we=ae[1],Fe=this._getClampedPixelRatio(xe,we);if(this._resizeCanvas(xe,we,Fe),this.painter.resize(xe,we,Fe),this.painter.overLimit()){let bt=this.painter.context.gl;this._maxCanvasSize=[bt.drawingBufferWidth,bt.drawingBufferHeight];let zt=this._getClampedPixelRatio(xe,we);this._resizeCanvas(xe,we,zt),this.painter.resize(xe,we,zt)}this.transform.resize(xe,we),(R=this._requestedCameraState)===null||R===void 0||R.resize(xe,we);let ct=!this._moving;return ct&&(this.stop(),this.fire(new t.k("movestart",Be)).fire(new t.k("move",Be))),this.fire(new t.k("resize",Be)),ct&&this.fire(new t.k("moveend",Be)),this}_getClampedPixelRatio(Be,R){let{0:ae,1:xe}=this._maxCanvasSize,we=this.getPixelRatio(),Fe=Be*we,ct=R*we;return Math.min(Fe>ae?ae/Fe:1,ct>xe?xe/ct:1)*we}getPixelRatio(){var Be;return(Be=this._overridePixelRatio)!==null&&Be!==void 0?Be:devicePixelRatio}setPixelRatio(Be){this._overridePixelRatio=Be,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Be){return this.transform.setMaxBounds(re.convert(Be)),this._update()}setMinZoom(Be){if((Be=Be??-2)>=-2&&Be<=this.transform.maxZoom)return this.transform.minZoom=Be,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Be,this._update(),this.getZoom()>Be&&this.setZoom(Be),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Be){if((Be=Be??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Be>=0&&Be<=this.transform.maxPitch)return this.transform.minPitch=Be,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Be>=this.transform.minPitch)return this.transform.maxPitch=Be,this._update(),this.getPitch()>Be&&this.setPitch(Be),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Be){return this.transform.renderWorldCopies=Be,this._update()}project(Be){return this.transform.locationPoint(t.N.convert(Be),this.style&&this.terrain)}unproject(Be){return this.transform.pointLocation(t.P.convert(Be),this.terrain)}isMoving(){var Be;return this._moving||((Be=this.handlers)===null||Be===void 0?void 0:Be.isMoving())}isZooming(){var Be;return this._zooming||((Be=this.handlers)===null||Be===void 0?void 0:Be.isZooming())}isRotating(){var Be;return this._rotating||((Be=this.handlers)===null||Be===void 0?void 0:Be.isRotating())}_createDelegatedListener(Be,R,ae){if(Be==="mouseenter"||Be==="mouseover"){let xe=!1;return{layers:R,listener:ae,delegates:{mousemove:Fe=>{let ct=R.filter(zt=>this.getLayer(zt)),bt=ct.length!==0?this.queryRenderedFeatures(Fe.point,{layers:ct}):[];bt.length?xe||(xe=!0,ae.call(this,new kl(Be,this,Fe.originalEvent,{features:bt}))):xe=!1},mouseout:()=>{xe=!1}}}}if(Be==="mouseleave"||Be==="mouseout"){let xe=!1;return{layers:R,listener:ae,delegates:{mousemove:ct=>{let bt=R.filter(zt=>this.getLayer(zt));(bt.length!==0?this.queryRenderedFeatures(ct.point,{layers:bt}):[]).length?xe=!0:xe&&(xe=!1,ae.call(this,new kl(Be,this,ct.originalEvent)))},mouseout:ct=>{xe&&(xe=!1,ae.call(this,new kl(Be,this,ct.originalEvent)))}}}}{let xe=we=>{let Fe=R.filter(bt=>this.getLayer(bt)),ct=Fe.length!==0?this.queryRenderedFeatures(we.point,{layers:Fe}):[];ct.length&&(we.features=ct,ae.call(this,we),delete we.features)};return{layers:R,listener:ae,delegates:{[Be]:xe}}}}_saveDelegatedListener(Be,R){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Be]=this._delegatedListeners[Be]||[],this._delegatedListeners[Be].push(R)}_removeDelegatedListener(Be,R,ae){if(!this._delegatedListeners||!this._delegatedListeners[Be])return;let xe=this._delegatedListeners[Be];for(let we=0;weR.includes(ct))){for(let ct in Fe.delegates)this.off(ct,Fe.delegates[ct]);return void xe.splice(we,1)}}}on(Be,R,ae){if(ae===void 0)return super.on(Be,R);let xe=this._createDelegatedListener(Be,typeof R=="string"?[R]:R,ae);this._saveDelegatedListener(Be,xe);for(let we in xe.delegates)this.on(we,xe.delegates[we]);return this}once(Be,R,ae){if(ae===void 0)return super.once(Be,R);let xe=typeof R=="string"?[R]:R,we=this._createDelegatedListener(Be,xe,ae);for(let Fe in we.delegates){let ct=we.delegates[Fe];we.delegates[Fe]=(...bt)=>{this._removeDelegatedListener(Be,xe,ae),ct(...bt)}}this._saveDelegatedListener(Be,we);for(let Fe in we.delegates)this.once(Fe,we.delegates[Fe]);return this}off(Be,R,ae){return ae===void 0?super.off(Be,R):(this._removeDelegatedListener(Be,typeof R=="string"?[R]:R,ae),this)}queryRenderedFeatures(Be,R){if(!this.style)return[];let ae,xe=Be instanceof t.P||Array.isArray(Be),we=xe?Be:[[0,0],[this.transform.width,this.transform.height]];if(R=R||(xe?{}:Be)||{},we instanceof t.P||typeof we[0]=="number")ae=[t.P.convert(we)];else{let Fe=t.P.convert(we[0]),ct=t.P.convert(we[1]);ae=[Fe,new t.P(ct.x,Fe.y),ct,new t.P(Fe.x,ct.y),Fe]}return this.style.queryRenderedFeatures(ae,R,this.transform)}querySourceFeatures(Be,R){return this.style.querySourceFeatures(Be,R)}setStyle(Be,R){return(R=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},R)).diff!==!1&&R.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Be?(this._diffStyle(Be,R),this):(this._localIdeographFontFamily=R.localIdeographFontFamily,this._updateStyle(Be,R))}setTransformRequest(Be){return this._requestManager.setTransformRequest(Be),this}_getUIString(Be){let R=this._locale[Be];if(R==null)throw new Error(`Missing UI string '${Be}'`);return R}_updateStyle(Be,R){if(R.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Be,R));let ae=this.style&&R.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Be)),Be?(this.style=new Cr(this,R||{}),this.style.setEventedParent(this,{style:this.style}),typeof Be=="string"?this.style.loadURL(Be,R,ae):this.style.loadJSON(Be,R,ae),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Cr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Be,R){if(typeof Be=="string"){let ae=this._requestManager.transformRequest(Be,"Style");t.h(ae,new AbortController).then(xe=>{this._updateDiff(xe.data,R)}).catch(xe=>{xe&&this.fire(new t.j(xe))})}else typeof Be=="object"&&this._updateDiff(Be,R)}_updateDiff(Be,R){try{this.style.setState(Be,R)&&this._update(!0)}catch(ae){t.w(`Unable to perform style diff: ${ae.message||ae.error||ae}. Rebuilding the style from scratch.`),this._updateStyle(Be,R)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(Be,R){return this._lazyInitEmptyStyle(),this.style.addSource(Be,R),this._update(!0)}isSourceLoaded(Be){let R=this.style&&this.style.sourceCaches[Be];if(R!==void 0)return R.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Be}'`)))}setTerrain(Be){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Be){let R=this.style.sourceCaches[Be.source];if(!R)throw new Error(`cannot load terrain, because there exists no source with ID: ${Be.source}`);this.terrain===null&&R.reload();for(let ae in this.style._layers){let xe=this.style._layers[ae];xe.type==="hillshade"&&xe.source===Be.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new as(this.painter,R,Be),this.painter.renderToTexture=new Cs(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ae=>{ae.dataType==="style"?this.terrain.sourceCache.freeRtt():ae.dataType==="source"&&ae.tile&&(ae.sourceId!==Be.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ae.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:Be})),this}getTerrain(){var Be,R;return(R=(Be=this.terrain)===null||Be===void 0?void 0:Be.options)!==null&&R!==void 0?R:null}areTilesLoaded(){let Be=this.style&&this.style.sourceCaches;for(let R in Be){let ae=Be[R]._tiles;for(let xe in ae){let we=ae[xe];if(we.state!=="loaded"&&we.state!=="errored")return!1}}return!0}removeSource(Be){return this.style.removeSource(Be),this._update(!0)}getSource(Be){return this.style.getSource(Be)}addImage(Be,R,ae={}){let{pixelRatio:xe=1,sdf:we=!1,stretchX:Fe,stretchY:ct,content:bt,textFitWidth:zt,textFitHeight:Zt}=ae;if(this._lazyInitEmptyStyle(),!(R instanceof HTMLImageElement||t.b(R))){if(R.width===void 0||R.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:gr,height:yr,data:Gr}=R,ta=R;return this.style.addImage(Be,{data:new t.R({width:gr,height:yr},new Uint8Array(Gr)),pixelRatio:xe,stretchX:Fe,stretchY:ct,content:bt,textFitWidth:zt,textFitHeight:Zt,sdf:we,version:0,userImage:ta}),ta.onAdd&&ta.onAdd(this,Be),this}}{let{width:gr,height:yr,data:Gr}=i.getImageData(R);this.style.addImage(Be,{data:new t.R({width:gr,height:yr},Gr),pixelRatio:xe,stretchX:Fe,stretchY:ct,content:bt,textFitWidth:zt,textFitHeight:Zt,sdf:we,version:0})}}updateImage(Be,R){let ae=this.style.getImage(Be);if(!ae)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let xe=R instanceof HTMLImageElement||t.b(R)?i.getImageData(R):R,{width:we,height:Fe,data:ct}=xe;if(we===void 0||Fe===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(we!==ae.data.width||Fe!==ae.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let bt=!(R instanceof HTMLImageElement||t.b(R));return ae.data.replace(ct,bt),this.style.updateImage(Be,ae),this}getImage(Be){return this.style.getImage(Be)}hasImage(Be){return Be?!!this.style.getImage(Be):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Be){this.style.removeImage(Be)}loadImage(Be){return l.getImage(this._requestManager.transformRequest(Be,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Be,R){return this._lazyInitEmptyStyle(),this.style.addLayer(Be,R),this._update(!0)}moveLayer(Be,R){return this.style.moveLayer(Be,R),this._update(!0)}removeLayer(Be){return this.style.removeLayer(Be),this._update(!0)}getLayer(Be){return this.style.getLayer(Be)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Be,R,ae){return this.style.setLayerZoomRange(Be,R,ae),this._update(!0)}setFilter(Be,R,ae={}){return this.style.setFilter(Be,R,ae),this._update(!0)}getFilter(Be){return this.style.getFilter(Be)}setPaintProperty(Be,R,ae,xe={}){return this.style.setPaintProperty(Be,R,ae,xe),this._update(!0)}getPaintProperty(Be,R){return this.style.getPaintProperty(Be,R)}setLayoutProperty(Be,R,ae,xe={}){return this.style.setLayoutProperty(Be,R,ae,xe),this._update(!0)}getLayoutProperty(Be,R){return this.style.getLayoutProperty(Be,R)}setGlyphs(Be,R={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Be,R),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Be,R,ae={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Be,R,ae,xe=>{xe||this._update(!0)}),this}removeSprite(Be){return this._lazyInitEmptyStyle(),this.style.removeSprite(Be),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Be,R={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Be,R,ae=>{ae||this._update(!0)}),this}setLight(Be,R={}){return this._lazyInitEmptyStyle(),this.style.setLight(Be,R),this._update(!0)}getLight(){return this.style.getLight()}setSky(Be){return this._lazyInitEmptyStyle(),this.style.setSky(Be),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Be,R){return this.style.setFeatureState(Be,R),this._update()}removeFeatureState(Be,R){return this.style.removeFeatureState(Be,R),this._update()}getFeatureState(Be){return this.style.getFeatureState(Be)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Be=0,R=0;return this._container&&(Be=this._container.clientWidth||400,R=this._container.clientHeight||300),[Be,R]}_setupContainer(){let Be=this._container;Be.classList.add("maplibregl-map");let R=this._canvasContainer=n.create("div","maplibregl-canvas-container",Be);this._interactive&&R.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",R),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let ae=this._containerDimensions(),xe=this._getClampedPixelRatio(ae[0],ae[1]);this._resizeCanvas(ae[0],ae[1],xe);let we=this._controlContainer=n.create("div","maplibregl-control-container",Be),Fe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ct=>{Fe[ct]=n.create("div",`maplibregl-ctrl-${ct} `,we)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Be,R,ae){this._canvas.width=Math.floor(ae*Be),this._canvas.height=Math.floor(ae*R),this._canvas.style.width=`${Be}px`,this._canvas.style.height=`${R}px`}_setupPainter(){let Be={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},R=null;this._canvas.addEventListener("webglcontextcreationerror",xe=>{R={requestedAttributes:Be},xe&&(R.statusMessage=xe.statusMessage,R.type=xe.type)},{once:!0});let ae=this._canvas.getContext("webgl2",Be)||this._canvas.getContext("webgl",Be);if(!ae){let xe="Failed to initialize WebGL";throw R?(R.message=xe,new Error(JSON.stringify(R))):new Error(xe)}this.painter=new qu(ae,this.transform),s.testSupport(ae)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Be){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Be,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Be){return this._update(),this._renderTaskQueue.add(Be)}_cancelRenderFrame(Be){this._renderTaskQueue.remove(Be)}_render(Be){let R=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Be),this._removed)return;let ae=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let we=this.transform.zoom,Fe=i.now();this.style.zoomHistory.update(we,Fe);let ct=new t.z(we,{now:Fe,fadeDuration:R,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),bt=ct.crossFadingFactor();bt===1&&bt===this._crossFadingFactor||(ae=!0,this._crossFadingFactor=bt),this.style.update(ct)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,R,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:R,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ae)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let xe=this._sourcesDirty||this._styleDirty||this._placementDirty;return xe||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||xe||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Be;this._hash&&this._hash.remove();for(let ae of this._controls)ae.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Be=this._resizeObserver)===null||Be===void 0||Be.disconnect();let R=this.painter.context.gl.getExtension("WEBGL_lose_context");R?.loseContext&&R.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(Be=>{t.bf.frame(Be),this._frameRequest=null,this._render(Be)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Be){this._showTileBoundaries!==Be&&(this._showTileBoundaries=Be,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Be){this._showPadding!==Be&&(this._showPadding=Be,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Be){this._showCollisionBoxes!==Be&&(this._showCollisionBoxes=Be,Be?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Be){this._showOverdrawInspector!==Be&&(this._showOverdrawInspector=Be,this._update())}get repaint(){return!!this._repaint}set repaint(Be){this._repaint!==Be&&(this._repaint=Be,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Be){this._vertices=Be,this._update()}get version(){return ul}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=kl,e.MapTouchEvent=oc,e.MapWheelEvent=lf,e.Marker=du,e.NavigationControl=class{constructor(Be){this._updateZoomButtons=()=>{let R=this._map.getZoom(),ae=R===this._map.getMaxZoom(),xe=R===this._map.getMinZoom();this._zoomInButton.disabled=ae,this._zoomOutButton.disabled=xe,this._zoomInButton.setAttribute("aria-disabled",ae.toString()),this._zoomOutButton.setAttribute("aria-disabled",xe.toString())},this._rotateCompassArrow=()=>{let R=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=R},this._setButtonTitle=(R,ae)=>{let xe=this._map._getUIString(`NavigationControl.${ae}`);R.title=xe,R.setAttribute("aria-label",xe)},this.options=t.e({},Mi,Be),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",R=>R.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",R=>this._map.zoomIn({},{originalEvent:R})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",R=>this._map.zoomOut({},{originalEvent:R})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",R=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:R}):this._map.resetNorth({},{originalEvent:R})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Be){return this._map=Be,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new yo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Be,R){let ae=n.create("button",Be,this._container);return ae.type="button",ae.addEventListener("click",R),ae}},e.Popup=class extends t.E{constructor(Be){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=R=>{this._update(R.point)},this._onMouseMove=R=>{this._update(R.point)},this._onDrag=R=>{this._update(R.point)},this._update=R=>{var ae;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let bt of this.options.className.split(" "))this._container.classList.add(bt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?us(this._lngLat,this._flatPos,this._map.transform):(ae=this._lngLat)===null||ae===void 0?void 0:ae.wrap(),this._trackPointer&&!R)return;let xe=this._flatPos=this._pos=this._trackPointer&&R?R:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&R?R:this._map.transform.locationPoint(this._lngLat));let we=this.options.anchor,Fe=Eu(this.options.offset);if(!we){let bt=this._container.offsetWidth,zt=this._container.offsetHeight,Zt;Zt=xe.y+Fe.bottom.ythis._map.transform.height-zt?["bottom"]:[],xe.xthis._map.transform.width-bt/2&&Zt.push("right"),we=Zt.length===0?"bottom":Zt.join("-")}let ct=xe.add(Fe[we]);this.options.subpixelPositioning||(ct=ct.round()),n.setTransform(this._container,`${Pl[we]} translate(${ct.x}px,${ct.y}px)`),Ql(this._container,we,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(xo),Be)}addTo(Be){return this._map&&this.remove(),this._map=Be,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Be){return this._lngLat=t.N.convert(Be),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Be){return this.setDOMContent(document.createTextNode(Be))}setHTML(Be){let R=document.createDocumentFragment(),ae=document.createElement("body"),xe;for(ae.innerHTML=Be;xe=ae.firstChild,xe;)R.appendChild(xe);return this.setDOMContent(R)}getMaxWidth(){var Be;return(Be=this._container)===null||Be===void 0?void 0:Be.style.maxWidth}setMaxWidth(Be){return this.options.maxWidth=Be,this._update(),this}setDOMContent(Be){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Be),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Be){return this._container&&this._container.classList.add(Be),this}removeClassName(Be){return this._container&&this._container.classList.remove(Be),this}setOffset(Be){return this.options.offset=Be,this._update(),this}toggleClassName(Be){if(this._container)return this._container.classList.toggle(Be)}setSubpixelPositioning(Be){this.options.subpixelPositioning=Be}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Be=this._container.querySelector(Ju);Be&&Be.focus()}},e.RasterDEMTileSource=Ie,e.RasterTileSource=Te,e.ScaleControl=class{constructor(Be){this._onMove=()=>{Ou(this._map,this._container,this.options)},this.setUnit=R=>{this.options.unit=R,Ou(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Hl),Be)}getDefaultPosition(){return"bottom-left"}onAdd(Be){return this._map=Be,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Be.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=xa,e.Style=Cr,e.TerrainControl=class{constructor(Be){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Be}onAdd(Be){return this._map=Be,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Zu,e.TwoFingersTouchRotateHandler=lc,e.TwoFingersTouchZoomHandler=jl,e.TwoFingersTouchZoomRotateHandler=wn,e.VectorTileSource=_e,e.VideoSource=rt,e.addSourceType=(Be,R)=>t._(void 0,void 0,void 0,function*(){if(Ae(Be))throw new Error(`A source type called "${Be}" already exists.`);((ae,xe)=>{ot[ae]=xe})(Be,R)}),e.clearPrewarmedResources=function(){let Be=he;Be&&(Be.isPreloaded()&&Be.numActive()===1?(Be.release(Q),he=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return Qe().getRTLTextPluginStatus()},e.getVersion=function(){return pu},e.getWorkerCount=function(){return le.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Be){return X().broadcast("IS",Be)},e.prewarm=function(){$().acquire(Q)},e.setMaxParallelImageRequests=function(Be){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Be},e.setRTLTextPlugin=function(Be,R){return Qe().setRTLTextPlugin(Be,R)},e.setWorkerCount=function(Be){le.workerCount=Be},e.setWorkerUrl=function(Be){t.a.WORKER_URL=Be}});var E=d;return E})}}),II=We({"src/plots/map/layers.js"(Z,V){"use strict";var d=aa(),x=zl().sanitizeHTML,A=IT(),E=Xd();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var h=i.symbol,c=A(h.textposition,h.iconsize);d.extendFlat(n,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":h.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":h.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,h={type:n},c;return n==="geojson"?c="data":n==="vector"?c=typeof s=="string"?"url":"tiles":n==="raster"?(c="tiles",h.tileSize=256):n==="image"&&(c="url",h.coordinates=i.coordinates),h[c]=s,i.sourceattribution&&(h.attribution=x(i.sourceattribution)),h}V.exports=function(n,s,h){var c=new e(n,s);return c.update(h),c}}}),RI=We({"src/plots/map/map.js"(Z,V){"use strict";var d=PI(),x=aa(),A=qd(),E=Wi(),e=Mo(),t=ih(),r=hc(),o=lv(),a=o.drawMode,i=o.selectMode,n=Ec().prepSelect,s=Ec().clearOutline,h=Ec().clearSelectionsCache,c=Ec().selectOnClick,m=Xd(),p=II();function T(y,b){this.id=b,this.gd=y;var v=y._fullLayout,u=y._context;this.container=v._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=v._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(v),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(y,b,v){var u=this,g;u.map?g=new Promise(function(f,P){u.updateMap(y,b,f,P)}):g=new Promise(function(f,P){u.createMap(y,b,f,P)}),v.push(g)},l.createMap=function(y,b,v,u){var g=this,f=b[g.id],P=g.styleObj=w(f.style),L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=g.map=new d.Map({container:g.div,style:P.style,center:M(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),B={};F.on("styleimagemissing",function(I){var N=I.id;if(!B[N]&&N.includes("-15")){B[N]=!0;var U=new Image(15,15);U.onload=function(){F.addImage(N,U)},U.crossOrigin="Anonymous",U.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),F.setTransformRequest(function(I){return I=I.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:I}}),F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(y,b);var O=[];O.push(new Promise(function(I){F.once("load",I)})),O=O.concat(A.fetchTraceGeoData(y)),Promise.all(O).then(function(){g.fillBelowLookup(y,b),g.updateData(y),g.updateLayout(b),g.resolveOnRender(v)}).catch(u)},l.updateMap=function(y,b,v,u){var g=this,f=g.map,P=b[this.id];g.rejectOnError(u);var L=[],z=w(P.style);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,f.setStyle(z.style),g.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(y)),Promise.all(L).then(function(){g.fillBelowLookup(y,b),g.updateData(y),g.updateLayout(b),g.resolveOnRender(v)}).catch(u)},l.fillBelowLookup=function(y,b){var v=b[this.id],u=v.layers,g,f,P=this.belowLookup={},L=!1;for(g=0;g1)for(g=0;g-1&&c(z.originalEvent,u,[v.xaxis],[v.yaxis],v.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(y){var b=this,v=b.map,u=b.gd;if(b.isStatic)return;function g(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=y.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(g)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:y.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:y[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:P},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),v.off("click",b.onClickInPanHandler),i(f)||a(f)?(v.dragPan.disable(),v.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){n(z,F,B,b.dragOptions,f)},t.init(b.dragOptions)):(v.dragPan.enable(),v.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),v.on("click",b.onClickInPanHandler))},l.updateFramework=function(y){var b=y[this.id].domain,v=y._size,u=this.div.style;u.width=v.w*(b.x[1]-b.x[0])+"px",u.height=v.h*(b.y[1]-b.y[0])+"px",u.left=v.l+b.x[0]*v.w+"px",u.top=v.t+(1-b.y[1])*v.h+"px",this.xaxis._offset=v.l+b.x[0]*v.w,this.xaxis._length=v.w*(b.x[1]-b.x[0]),this.yaxis._offset=v.t+(1-b.y[1])*v.h,this.yaxis._length=v.h*(b.y[1]-b.y[0])},l.updateLayers=function(y){var b=y[this.id],v=b.layers,u=this.layerList,g;if(v.length!==u.length){for(g=0;gv/2){var u=S.split("|").join("
");y.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),b=t.bBox(y.node())}y.attr("transform",d(-3,-b.height+8)),M.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var g=1;b.width+6>v&&(g=v/(b.width+6));var f=[h.l+h.w*p.x[1],h.t+h.h*(1-p.y[0])];M.attr("transform",d(f[0],f[1])+x(g))}},Z.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],h=0;h=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),h=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,h),o[0].trace._glTrace=i,i}}}),NI=We({"src/traces/choroplethmap/index.js"(Z,V){"use strict";V.exports={attributes:RT(),supplyDefaults:OI(),colorbar:Pd(),calc:C_(),plot:BI(),hoverPoints:P_(),eventData:I_(),selectPoints:R_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+p[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var y=E.extractOpts(a),b=y.reversescale?E.flipScale(y.colorscale):y.colorscale,v=b[0][1],u=A.opacity(v)<1?v:A.addOpacity(v,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),HI=We({"src/traces/densitymap/hover.js"(Z,V){"use strict";var d=Mo(),x=Y_().hoverPoints,A=Y_().getExtraText;V.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var h=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),WI=We({"src/traces/densitymap/event_data.js"(Z,V){"use strict";V.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),XI=We({"src/traces/densitymap/index.js"(Z,V){"use strict";V.exports={attributes:zT(),supplyDefaults:jI(),colorbar:Pd(),formatLabels:PT(),calc:VI(),plot:GI(),hoverPoints:HI(),eventData:WI(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;E0;){l=w[w.length-1];var S=x[l];if(r[l]=0&&a[l].push(o[y])}r[l]=M}else{if(e[l]===E[l]){for(var b=[],v=[],u=0,M=_.length-1;M>=0;--M){var g=_[M];if(t[g]=!1,b.push(g),v.push(a[g]),u+=a[g].length,o[g]=s.length,g===l){_.length=M;break}}s.push(b);for(var f=new Array(u),M=0;My&&(y=n.source[_]),n.target[_]>y&&(y=n.target[_]);var b=y+1;a.node._count=b;var v,u=a.node.groups,g={};for(_=0;_0&&e(B,b)&&e(O,b)&&!(g.hasOwnProperty(B)&&g.hasOwnProperty(O)&&g[B]===g[O])){g.hasOwnProperty(O)&&(O=g[O]),g.hasOwnProperty(B)&&(B=g[B]),B=+B,O=+O,p[B]=p[O]=!0;var I="";n.label&&n.label[_]&&(I=n.label[_]);var N=null;I&&T.hasOwnProperty(I)&&(N=T[I]),s.push({pointNumber:_,label:I,color:h?n.color[_]:n.color,hovercolor:c?n.hovercolor[_]:n.hovercolor,customdata:m?n.customdata[_]:n.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=b+u.length,W=E(i.color),Q=E(i.customdata),le=[];for(_=0;_b-1,childrenNodes:[],pointNumber:_,label:se,color:W?i.color[_]:i.color,customdata:Q?i.customdata[_]:i.customdata})}var he=!1;return o(U,z.source,z.target)&&(he=!0),{circular:he,links:s,nodes:le,groups:u,groupLookup:g}}function o(a,i,n){for(var s=x.init2dArray(a,0),h=0;h1})}V.exports=function(i,n){var s=r(n);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),JI=We({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){var v=+this._x.call(null,b),u=+this._y.call(null,b);return A(this.cover(v,u),v,u,b)}function A(b,v,u,g){if(isNaN(v)||isNaN(u))return b;var f,P=b._root,L={data:g},z=b._x0,F=b._y0,B=b._x1,O=b._y1,I,N,U,W,Q,le,se,he;if(!P)return b._root=L,b;for(;P.length;)if((Q=v>=(I=(z+B)/2))?z=I:B=I,(le=u>=(N=(F+O)/2))?F=N:O=N,f=P,!(P=P[se=le<<1|Q]))return f[se]=L,b;if(U=+b._x.call(null,P.data),W=+b._y.call(null,P.data),v===U&&u===W)return L.next=P,f?f[se]=L:b._root=L,b;do f=f?f[se]=new Array(4):b._root=new Array(4),(Q=v>=(I=(z+B)/2))?z=I:B=I,(le=u>=(N=(F+O)/2))?F=N:O=N;while((se=le<<1|Q)===(he=(W>=N)<<1|U>=I));return f[he]=P,f[se]=L,b}function E(b){var v,u,g=b.length,f,P,L=new Array(g),z=new Array(g),F=1/0,B=1/0,O=-1/0,I=-1/0;for(u=0;uO&&(O=f),PI&&(I=P));if(F>O||B>I)return this;for(this.cover(F,B).cover(O,I),u=0;ub||b>=f||g>v||v>=P;)switch(B=(vO||(z=W.y0)>I||(F=W.x1)=se)<<1|b>=le)&&(W=N[N.length-1],N[N.length-1]=N[N.length-1-Q],N[N.length-1-Q]=W)}else{var he=b-+this._x.call(null,U.data),q=v-+this._y.call(null,U.data),$=he*he+q*q;if($=(N=(L+F)/2))?L=N:F=N,(Q=I>=(U=(z+B)/2))?z=U:B=U,v=u,!(u=u[le=Q<<1|W]))return this;if(!u.length)break;(v[le+1&3]||v[le+2&3]||v[le+3&3])&&(g=v,se=le)}for(;u.data!==b;)if(f=u,!(u=u.next))return this;return(P=u.next)&&delete u.next,f?(P?f.next=P:delete f.next,this):v?(P?v[le]=P:delete v[le],(u=v[0]||v[1]||v[2]||v[3])&&u===(v[3]||v[2]||v[1]||v[0])&&!u.length&&(g?g[se]=u:this._root=u),this):(this._root=P,this)}function n(b){for(var v=0,u=b.length;v=p.length)return l!=null&&y.sort(l),_!=null?_(y):y;for(var g=-1,f=y.length,P=p[b++],L,z,F=E(),B,O=v();++gp.length)return y;var v,u=T[b-1];return _!=null&&b>=p.length?v=y.entries():(v=[],y.each(function(g,f){v.push({key:f,values:M(g,b)})})),u!=null?v.sort(function(g,f){return u(g.key,f.key)}):v}return w={object:function(y){return S(y,0,t,r)},map:function(y){return S(y,0,o,a)},entries:function(y){return M(S(y,0,o,a),0)},key:function(y){return p.push(y),w},sortKeys:function(y){return T[p.length-1]=y,w},sortValues:function(y){return l=y,w},rollup:function(y){return _=y,w}}}function t(){return{}}function r(p,T,l){p[T]=l}function o(){return E()}function a(p,T,l){p.set(T,l)}function i(){}var n=E.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(p){return p+="",this[x+p]=p,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(p,T){var l=new i;if(p instanceof i)p.each(function(S){l.add(S)});else if(p){var _=-1,w=p.length;if(T==null)for(;++_=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}E.prototype=A.prototype={constructor:E,on:function(o,a){var i=this._,n=e(o+"",i),s,h=-1,c=n.length;if(arguments.length<2){for(;++h0)for(var i=new Array(s),n=0,s,h;n=0&&b._call.call(null,v),b=b._next;--x}function l(){a=(o=n.now())+i,x=A=0;try{T()}finally{x=0,w(),a=0}}function _(){var b=n.now(),v=b-o;v>e&&(i-=v,o=b)}function w(){for(var b,v=t,u,g=1/0;v;)v._call?(g>v._time&&(g=v._time),b=v,v=v._next):(u=v._next,v._next=null,v=b?b._next=u:t=u);r=b,S(g)}function S(b){if(!x){A&&(A=clearTimeout(A));var v=b-a;v>24?(b<1/0&&(A=setTimeout(l,b-n.now()-i)),E&&(E=clearInterval(E))):(E||(o=n.now(),E=setInterval(_,e)),x=1,s(l))}}function M(b,v,u){var g=new m;return v=v==null?0:+v,g.restart(function(f){g.stop(),b(f+v)},v,u),g}function y(b,v,u){var g=new m,f=v;return v==null?(g.restart(b,v,u),g):(v=+v,u=u==null?h():+u,g.restart(function P(L){L+=f,g.restart(P,f+=v,u),b(L)},v,u),g)}d.interval=y,d.now=h,d.timeout=M,d.timer=p,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),e4=We({"node_modules/d3-force/dist/d3-force.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z,JI(),J_(),$I(),QI()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Z,function(d,x,A,E,e){"use strict";function t(b,v){var u;b==null&&(b=0),v==null&&(v=0);function g(){var f,P=u.length,L,z=0,F=0;for(f=0;fI.index){var ee=N-oe.x-oe.vx,re=U-oe.y-oe.vy,ue=ee*ee+re*re;ueN+j||JU+j||XF.r&&(F.r=F[B].r)}function z(){if(v){var F,B=v.length,O;for(u=new Array(B),F=0;F1?(Q==null?z.remove(W):z.set(W,U(Q)),v):z.get(W)},find:function(W,Q,le){var se=0,he=b.length,q,$,J,X,oe;for(le==null?le=1/0:le*=le,se=0;se1?(B.on(W,Q),v):B.on(W)}}}function w(){var b,v,u,g=r(-30),f,P=1,L=1/0,z=.81;function F(N){var U,W=b.length,Q=x.quadtree(b,m,p).visitAfter(O);for(u=N,U=0;U=L)return;(N.data!==v||N.next)&&(le===0&&(le=o(),q+=le*le),se===0&&(se=o(),q+=se*se),qE)if(!(Math.abs(l*m-p*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var w=i-h,S=n-c,M=m*m+p*p,y=w*w+S*S,b=Math.sqrt(M),v=Math.sqrt(_),u=s*Math.tan((x-Math.acos((M+_-y)/(2*b*v)))/2),g=u/v,f=u/b;Math.abs(g-1)>E&&(this._+="L"+(o+g*T)+","+(a+g*l)),this._+="A"+s+","+s+",0,0,"+ +(l*w>T*S)+","+(this._x1=o+f*m)+","+(this._y1=a+f*p)}},arc:function(o,a,i,n,s,h){o=+o,a=+a,i=+i,h=!!h;var c=i*Math.cos(n),m=i*Math.sin(n),p=o+c,T=a+m,l=1^h,_=h?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+p+","+T:(Math.abs(this._x1-p)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+p+","+T),i&&(_<0&&(_=_%A+A),_>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-c)+","+(a-m)+"A"+i+","+i+",0,1,"+l+","+(this._x1=p)+","+(this._y1=T):_>E&&(this._+="A"+i+","+i+",0,"+ +(_>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),BT=We({"node_modules/d3-shape/dist/d3-shape.js"(Z,V){(function(d,x){typeof Z=="object"&&typeof V<"u"?x(Z,t4()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function A(_t){return function(){return _t}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,h=s/2,c=2*s;function m(_t){return _t>1?0:_t<-1?s:Math.acos(_t)}function p(_t){return _t>=1?h:_t<=-1?-h:Math.asin(_t)}function T(_t){return _t.innerRadius}function l(_t){return _t.outerRadius}function _(_t){return _t.startAngle}function w(_t){return _t.endAngle}function S(_t){return _t&&_t.padAngle}function M(_t,Wt,Ar,Vr,ma,ba,wa,$r){var ga=Ar-_t,jn=Vr-Wt,an=wa-ma,ei=$r-ba,li=ei*ga-an*jn;if(!(li*liJo*Jo+ms*ms&&(Go=Qi,Ko=eo),{cx:Go,cy:Ko,x01:-an,y01:-ei,x11:Go*(ma/ao-1),y11:Ko*(ma/ao-1)}}function b(){var _t=T,Wt=l,Ar=A(0),Vr=null,ma=_,ba=w,wa=S,$r=null;function ga(){var jn,an,ei=+_t.apply(this,arguments),li=+Wt.apply(this,arguments),_i=ma.apply(this,arguments)-h,xi=ba.apply(this,arguments)-h,Pi=E(xi-_i),Li=xi>_i;if($r||($r=jn=x.path()),lin))$r.moveTo(0,0);else if(Pi>c-n)$r.moveTo(li*t(_i),li*a(_i)),$r.arc(0,0,li,_i,xi,!Li),ei>n&&($r.moveTo(ei*t(xi),ei*a(xi)),$r.arc(0,0,ei,xi,_i,Li));else{var ri=_i,vo=xi,Eo=_i,uo=xi,ao=Pi,mo=Pi,Bo=wa.apply(this,arguments)/2,Go=Bo>n&&(Vr?+Vr.apply(this,arguments):i(ei*ei+li*li)),Ko=o(E(li-ei)/2,+Ar.apply(this,arguments)),Qi=Ko,eo=Ko,Ei,Xi;if(Go>n){var Jo=p(Go/ei*a(Bo)),ms=p(Go/li*a(Bo));(ao-=Jo*2)>n?(Jo*=Li?1:-1,Eo+=Jo,uo-=Jo):(ao=0,Eo=uo=(_i+xi)/2),(mo-=ms*2)>n?(ms*=Li?1:-1,ri+=ms,vo-=ms):(mo=0,ri=vo=(_i+xi)/2)}var _s=li*t(ri),ko=li*a(ri),Nn=ei*t(uo),pi=ei*a(uo);if(Ko>n){var gs=li*t(vo),Io=li*a(vo),Zi=ei*t(Eo),ys=ei*a(Eo),rs;if(Pin?eo>n?(Ei=y(Zi,ys,_s,ko,li,eo,Li),Xi=y(gs,Io,Nn,pi,li,eo,Li),$r.moveTo(Ei.cx+Ei.x01,Ei.cy+Ei.y01),eon)||!(ao>n)?$r.lineTo(Nn,pi):Qi>n?(Ei=y(Nn,pi,gs,Io,ei,-Qi,Li),Xi=y(_s,ko,Zi,ys,ei,-Qi,Li),$r.lineTo(Ei.cx+Ei.x01,Ei.cy+Ei.y01),Qi=li;--_i)$r.point(vo[_i],Eo[_i]);$r.lineEnd(),$r.areaEnd()}Li&&(vo[ei]=+_t(Pi,ei,an),Eo[ei]=+Ar(Pi,ei,an),$r.point(Wt?+Wt(Pi,ei,an):vo[ei],Vr?+Vr(Pi,ei,an):Eo[ei]))}if(ri)return $r=null,ri+""||null}function jn(){return P().defined(ma).curve(wa).context(ba)}return ga.x=function(an){return arguments.length?(_t=typeof an=="function"?an:A(+an),Wt=null,ga):_t},ga.x0=function(an){return arguments.length?(_t=typeof an=="function"?an:A(+an),ga):_t},ga.x1=function(an){return arguments.length?(Wt=an==null?null:typeof an=="function"?an:A(+an),ga):Wt},ga.y=function(an){return arguments.length?(Ar=typeof an=="function"?an:A(+an),Vr=null,ga):Ar},ga.y0=function(an){return arguments.length?(Ar=typeof an=="function"?an:A(+an),ga):Ar},ga.y1=function(an){return arguments.length?(Vr=an==null?null:typeof an=="function"?an:A(+an),ga):Vr},ga.lineX0=ga.lineY0=function(){return jn().x(_t).y(Ar)},ga.lineY1=function(){return jn().x(_t).y(Vr)},ga.lineX1=function(){return jn().x(Wt).y(Ar)},ga.defined=function(an){return arguments.length?(ma=typeof an=="function"?an:A(!!an),ga):ma},ga.curve=function(an){return arguments.length?(wa=an,ba!=null&&($r=wa(ba)),ga):wa},ga.context=function(an){return arguments.length?(an==null?ba=$r=null:$r=wa(ba=an),ga):ba},ga}function z(_t,Wt){return Wt<_t?-1:Wt>_t?1:Wt>=_t?0:NaN}function F(_t){return _t}function B(){var _t=F,Wt=z,Ar=null,Vr=A(0),ma=A(c),ba=A(0);function wa($r){var ga,jn=$r.length,an,ei,li=0,_i=new Array(jn),xi=new Array(jn),Pi=+Vr.apply(this,arguments),Li=Math.min(c,Math.max(-c,ma.apply(this,arguments)-Pi)),ri,vo=Math.min(Math.abs(Li)/jn,ba.apply(this,arguments)),Eo=vo*(Li<0?-1:1),uo;for(ga=0;ga0&&(li+=uo);for(Wt!=null?_i.sort(function(ao,mo){return Wt(xi[ao],xi[mo])}):Ar!=null&&_i.sort(function(ao,mo){return Ar($r[ao],$r[mo])}),ga=0,ei=li?(Li-jn*Eo)/li:0;ga0?uo*ei:0)+Eo,xi[an]={data:$r[an],index:ga,value:uo,startAngle:Pi,endAngle:ri,padAngle:vo};return xi}return wa.value=function($r){return arguments.length?(_t=typeof $r=="function"?$r:A(+$r),wa):_t},wa.sortValues=function($r){return arguments.length?(Wt=$r,Ar=null,wa):Wt},wa.sort=function($r){return arguments.length?(Ar=$r,Wt=null,wa):Ar},wa.startAngle=function($r){return arguments.length?(Vr=typeof $r=="function"?$r:A(+$r),wa):Vr},wa.endAngle=function($r){return arguments.length?(ma=typeof $r=="function"?$r:A(+$r),wa):ma},wa.padAngle=function($r){return arguments.length?(ba=typeof $r=="function"?$r:A(+$r),wa):ba},wa}var O=N(u);function I(_t){this._curve=_t}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(_t,Wt){this._curve.point(Wt*Math.sin(_t),Wt*-Math.cos(_t))}};function N(_t){function Wt(Ar){return new I(_t(Ar))}return Wt._curve=_t,Wt}function U(_t){var Wt=_t.curve;return _t.angle=_t.x,delete _t.x,_t.radius=_t.y,delete _t.y,_t.curve=function(Ar){return arguments.length?Wt(N(Ar)):Wt()._curve},_t}function W(){return U(P().curve(O))}function Q(){var _t=L().curve(O),Wt=_t.curve,Ar=_t.lineX0,Vr=_t.lineX1,ma=_t.lineY0,ba=_t.lineY1;return _t.angle=_t.x,delete _t.x,_t.startAngle=_t.x0,delete _t.x0,_t.endAngle=_t.x1,delete _t.x1,_t.radius=_t.y,delete _t.y,_t.innerRadius=_t.y0,delete _t.y0,_t.outerRadius=_t.y1,delete _t.y1,_t.lineStartAngle=function(){return U(Ar())},delete _t.lineX0,_t.lineEndAngle=function(){return U(Vr())},delete _t.lineX1,_t.lineInnerRadius=function(){return U(ma())},delete _t.lineY0,_t.lineOuterRadius=function(){return U(ba())},delete _t.lineY1,_t.curve=function(wa){return arguments.length?Wt(N(wa)):Wt()._curve},_t}function le(_t,Wt){return[(Wt=+Wt)*Math.cos(_t-=Math.PI/2),Wt*Math.sin(_t)]}var se=Array.prototype.slice;function he(_t){return _t.source}function q(_t){return _t.target}function $(_t){var Wt=he,Ar=q,Vr=g,ma=f,ba=null;function wa(){var $r,ga=se.call(arguments),jn=Wt.apply(this,ga),an=Ar.apply(this,ga);if(ba||(ba=$r=x.path()),_t(ba,+Vr.apply(this,(ga[0]=jn,ga)),+ma.apply(this,ga),+Vr.apply(this,(ga[0]=an,ga)),+ma.apply(this,ga)),$r)return ba=null,$r+""||null}return wa.source=function($r){return arguments.length?(Wt=$r,wa):Wt},wa.target=function($r){return arguments.length?(Ar=$r,wa):Ar},wa.x=function($r){return arguments.length?(Vr=typeof $r=="function"?$r:A(+$r),wa):Vr},wa.y=function($r){return arguments.length?(ma=typeof $r=="function"?$r:A(+$r),wa):ma},wa.context=function($r){return arguments.length?(ba=$r??null,wa):ba},wa}function J(_t,Wt,Ar,Vr,ma){_t.moveTo(Wt,Ar),_t.bezierCurveTo(Wt=(Wt+Vr)/2,Ar,Wt,ma,Vr,ma)}function X(_t,Wt,Ar,Vr,ma){_t.moveTo(Wt,Ar),_t.bezierCurveTo(Wt,Ar=(Ar+ma)/2,Vr,Ar,Vr,ma)}function oe(_t,Wt,Ar,Vr,ma){var ba=le(Wt,Ar),wa=le(Wt,Ar=(Ar+ma)/2),$r=le(Vr,Ar),ga=le(Vr,ma);_t.moveTo(ba[0],ba[1]),_t.bezierCurveTo(wa[0],wa[1],$r[0],$r[1],ga[0],ga[1])}function ne(){return $(J)}function j(){return $(X)}function ee(){var _t=$(oe);return _t.angle=_t.x,delete _t.x,_t.radius=_t.y,delete _t.y,_t}var re={draw:function(_t,Wt){var Ar=Math.sqrt(Wt/s);_t.moveTo(Ar,0),_t.arc(0,0,Ar,0,c)}},ue={draw:function(_t,Wt){var Ar=Math.sqrt(Wt/5)/2;_t.moveTo(-3*Ar,-Ar),_t.lineTo(-Ar,-Ar),_t.lineTo(-Ar,-3*Ar),_t.lineTo(Ar,-3*Ar),_t.lineTo(Ar,-Ar),_t.lineTo(3*Ar,-Ar),_t.lineTo(3*Ar,Ar),_t.lineTo(Ar,Ar),_t.lineTo(Ar,3*Ar),_t.lineTo(-Ar,3*Ar),_t.lineTo(-Ar,Ar),_t.lineTo(-3*Ar,Ar),_t.closePath()}},_e=Math.sqrt(1/3),Te=_e*2,Ie={draw:function(_t,Wt){var Ar=Math.sqrt(Wt/Te),Vr=Ar*_e;_t.moveTo(0,-Ar),_t.lineTo(Vr,0),_t.lineTo(0,Ar),_t.lineTo(-Vr,0),_t.closePath()}},De=.8908130915292852,He=Math.sin(s/10)/Math.sin(7*s/10),et=Math.sin(c/10)*He,rt=-Math.cos(c/10)*He,$e={draw:function(_t,Wt){var Ar=Math.sqrt(Wt*De),Vr=et*Ar,ma=rt*Ar;_t.moveTo(0,-Ar),_t.lineTo(Vr,ma);for(var ba=1;ba<5;++ba){var wa=c*ba/5,$r=Math.cos(wa),ga=Math.sin(wa);_t.lineTo(ga*Ar,-$r*Ar),_t.lineTo($r*Vr-ga*ma,ga*Vr+$r*ma)}_t.closePath()}},ot={draw:function(_t,Wt){var Ar=Math.sqrt(Wt),Vr=-Ar/2;_t.rect(Vr,Vr,Ar,Ar)}},Ae=Math.sqrt(3),ge={draw:function(_t,Wt){var Ar=-Math.sqrt(Wt/(Ae*3));_t.moveTo(0,Ar*2),_t.lineTo(-Ae*Ar,-Ar),_t.lineTo(Ae*Ar,-Ar),_t.closePath()}},ce=-.5,ze=Math.sqrt(3)/2,Qe=1/Math.sqrt(12),nt=(Qe/2+1)*3,Ke={draw:function(_t,Wt){var Ar=Math.sqrt(Wt/nt),Vr=Ar/2,ma=Ar*Qe,ba=Vr,wa=Ar*Qe+Ar,$r=-ba,ga=wa;_t.moveTo(Vr,ma),_t.lineTo(ba,wa),_t.lineTo($r,ga),_t.lineTo(ce*Vr-ze*ma,ze*Vr+ce*ma),_t.lineTo(ce*ba-ze*wa,ze*ba+ce*wa),_t.lineTo(ce*$r-ze*ga,ze*$r+ce*ga),_t.lineTo(ce*Vr+ze*ma,ce*ma-ze*Vr),_t.lineTo(ce*ba+ze*wa,ce*wa-ze*ba),_t.lineTo(ce*$r+ze*ga,ce*ga-ze*$r),_t.closePath()}},kt=[re,ue,Ie,ot,$e,ge,Ke];function Et(){var _t=A(re),Wt=A(64),Ar=null;function Vr(){var ma;if(Ar||(Ar=ma=x.path()),_t.apply(this,arguments).draw(Ar,+Wt.apply(this,arguments)),ma)return Ar=null,ma+""||null}return Vr.type=function(ma){return arguments.length?(_t=typeof ma=="function"?ma:A(ma),Vr):_t},Vr.size=function(ma){return arguments.length?(Wt=typeof ma=="function"?ma:A(+ma),Vr):Wt},Vr.context=function(ma){return arguments.length?(Ar=ma??null,Vr):Ar},Vr}function Bt(){}function jt(_t,Wt,Ar){_t._context.bezierCurveTo((2*_t._x0+_t._x1)/3,(2*_t._y0+_t._y1)/3,(_t._x0+2*_t._x1)/3,(_t._y0+2*_t._y1)/3,(_t._x0+4*_t._x1+Wt)/6,(_t._y0+4*_t._y1+Ar)/6)}function _r(_t){this._context=_t}_r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:jt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1,this._line?this._context.lineTo(_t,Wt):this._context.moveTo(_t,Wt);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jt(this,_t,Wt);break}this._x0=this._x1,this._x1=_t,this._y0=this._y1,this._y1=Wt}};function pr(_t){return new _r(_t)}function Or(_t){this._context=_t}Or.prototype={areaStart:Bt,areaEnd:Bt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1,this._x2=_t,this._y2=Wt;break;case 1:this._point=2,this._x3=_t,this._y3=Wt;break;case 2:this._point=3,this._x4=_t,this._y4=Wt,this._context.moveTo((this._x0+4*this._x1+_t)/6,(this._y0+4*this._y1+Wt)/6);break;default:jt(this,_t,Wt);break}this._x0=this._x1,this._x1=_t,this._y0=this._y1,this._y1=Wt}};function mr(_t){return new Or(_t)}function Er(_t){this._context=_t}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Ar=(this._x0+4*this._x1+_t)/6,Vr=(this._y0+4*this._y1+Wt)/6;this._line?this._context.lineTo(Ar,Vr):this._context.moveTo(Ar,Vr);break;case 3:this._point=4;default:jt(this,_t,Wt);break}this._x0=this._x1,this._x1=_t,this._y0=this._y1,this._y1=Wt}};function yt(_t){return new Er(_t)}function Oe(_t,Wt){this._basis=new _r(_t),this._beta=Wt}Oe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var _t=this._x,Wt=this._y,Ar=_t.length-1;if(Ar>0)for(var Vr=_t[0],ma=Wt[0],ba=_t[Ar]-Vr,wa=Wt[Ar]-ma,$r=-1,ga;++$r<=Ar;)ga=$r/Ar,this._basis.point(this._beta*_t[$r]+(1-this._beta)*(Vr+ga*ba),this._beta*Wt[$r]+(1-this._beta)*(ma+ga*wa));this._x=this._y=null,this._basis.lineEnd()},point:function(_t,Wt){this._x.push(+_t),this._y.push(+Wt)}};var Xe=(function _t(Wt){function Ar(Vr){return Wt===1?new _r(Vr):new Oe(Vr,Wt)}return Ar.beta=function(Vr){return _t(+Vr)},Ar})(.85);function be(_t,Wt,Ar){_t._context.bezierCurveTo(_t._x1+_t._k*(_t._x2-_t._x0),_t._y1+_t._k*(_t._y2-_t._y0),_t._x2+_t._k*(_t._x1-Wt),_t._y2+_t._k*(_t._y1-Ar),_t._x2,_t._y2)}function Ce(_t,Wt){this._context=_t,this._k=(1-Wt)/6}Ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:be(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1,this._line?this._context.lineTo(_t,Wt):this._context.moveTo(_t,Wt);break;case 1:this._point=2,this._x1=_t,this._y1=Wt;break;case 2:this._point=3;default:be(this,_t,Wt);break}this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var Ne=(function _t(Wt){function Ar(Vr){return new Ce(Vr,Wt)}return Ar.tension=function(Vr){return _t(+Vr)},Ar})(0);function Ee(_t,Wt){this._context=_t,this._k=(1-Wt)/6}Ee.prototype={areaStart:Bt,areaEnd:Bt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1,this._x3=_t,this._y3=Wt;break;case 1:this._point=2,this._context.moveTo(this._x4=_t,this._y4=Wt);break;case 2:this._point=3,this._x5=_t,this._y5=Wt;break;default:be(this,_t,Wt);break}this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var Se=(function _t(Wt){function Ar(Vr){return new Ee(Vr,Wt)}return Ar.tension=function(Vr){return _t(+Vr)},Ar})(0);function Le(_t,Wt){this._context=_t,this._k=(1-Wt)/6}Le.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:be(this,_t,Wt);break}this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var at=(function _t(Wt){function Ar(Vr){return new Le(Vr,Wt)}return Ar.tension=function(Vr){return _t(+Vr)},Ar})(0);function dt(_t,Wt,Ar){var Vr=_t._x1,ma=_t._y1,ba=_t._x2,wa=_t._y2;if(_t._l01_a>n){var $r=2*_t._l01_2a+3*_t._l01_a*_t._l12_a+_t._l12_2a,ga=3*_t._l01_a*(_t._l01_a+_t._l12_a);Vr=(Vr*$r-_t._x0*_t._l12_2a+_t._x2*_t._l01_2a)/ga,ma=(ma*$r-_t._y0*_t._l12_2a+_t._y2*_t._l01_2a)/ga}if(_t._l23_a>n){var jn=2*_t._l23_2a+3*_t._l23_a*_t._l12_a+_t._l12_2a,an=3*_t._l23_a*(_t._l23_a+_t._l12_a);ba=(ba*jn+_t._x1*_t._l23_2a-Wt*_t._l12_2a)/an,wa=(wa*jn+_t._y1*_t._l23_2a-Ar*_t._l12_2a)/an}_t._context.bezierCurveTo(Vr,ma,ba,wa,_t._x2,_t._y2)}function gt(_t,Wt){this._context=_t,this._alpha=Wt}gt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){if(_t=+_t,Wt=+Wt,this._point){var Ar=this._x2-_t,Vr=this._y2-Wt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Ar*Ar+Vr*Vr,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(_t,Wt):this._context.moveTo(_t,Wt);break;case 1:this._point=2;break;case 2:this._point=3;default:dt(this,_t,Wt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var Ct=(function _t(Wt){function Ar(Vr){return Wt?new gt(Vr,Wt):new Ce(Vr,0)}return Ar.alpha=function(Vr){return _t(+Vr)},Ar})(.5);function or(_t,Wt){this._context=_t,this._alpha=Wt}or.prototype={areaStart:Bt,areaEnd:Bt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(_t,Wt){if(_t=+_t,Wt=+Wt,this._point){var Ar=this._x2-_t,Vr=this._y2-Wt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Ar*Ar+Vr*Vr,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=_t,this._y3=Wt;break;case 1:this._point=2,this._context.moveTo(this._x4=_t,this._y4=Wt);break;case 2:this._point=3,this._x5=_t,this._y5=Wt;break;default:dt(this,_t,Wt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var Qt=(function _t(Wt){function Ar(Vr){return Wt?new or(Vr,Wt):new Ee(Vr,0)}return Ar.alpha=function(Vr){return _t(+Vr)},Ar})(.5);function Jt(_t,Wt){this._context=_t,this._alpha=Wt}Jt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){if(_t=+_t,Wt=+Wt,this._point){var Ar=this._x2-_t,Vr=this._y2-Wt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Ar*Ar+Vr*Vr,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dt(this,_t,Wt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=_t,this._y0=this._y1,this._y1=this._y2,this._y2=Wt}};var Sr=(function _t(Wt){function Ar(Vr){return Wt?new Jt(Vr,Wt):new Le(Vr,0)}return Ar.alpha=function(Vr){return _t(+Vr)},Ar})(.5);function oa(_t){this._context=_t}oa.prototype={areaStart:Bt,areaEnd:Bt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(_t,Wt){_t=+_t,Wt=+Wt,this._point?this._context.lineTo(_t,Wt):(this._point=1,this._context.moveTo(_t,Wt))}};function Ea(_t){return new oa(_t)}function Sa(_t){return _t<0?-1:1}function za(_t,Wt,Ar){var Vr=_t._x1-_t._x0,ma=Wt-_t._x1,ba=(_t._y1-_t._y0)/(Vr||ma<0&&-0),wa=(Ar-_t._y1)/(ma||Vr<0&&-0),$r=(ba*ma+wa*Vr)/(Vr+ma);return(Sa(ba)+Sa(wa))*Math.min(Math.abs(ba),Math.abs(wa),.5*Math.abs($r))||0}function Na(_t,Wt){var Ar=_t._x1-_t._x0;return Ar?(3*(_t._y1-_t._y0)/Ar-Wt)/2:Wt}function Ta(_t,Wt,Ar){var Vr=_t._x0,ma=_t._y0,ba=_t._x1,wa=_t._y1,$r=(ba-Vr)/3;_t._context.bezierCurveTo(Vr+$r,ma+$r*Wt,ba-$r,wa-$r*Ar,ba,wa)}function nn(_t){this._context=_t}nn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ta(this,this._t0,Na(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_t,Wt){var Ar=NaN;if(_t=+_t,Wt=+Wt,!(_t===this._x1&&Wt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(_t,Wt):this._context.moveTo(_t,Wt);break;case 1:this._point=2;break;case 2:this._point=3,Ta(this,Na(this,Ar=za(this,_t,Wt)),Ar);break;default:Ta(this,this._t0,Ar=za(this,_t,Wt));break}this._x0=this._x1,this._x1=_t,this._y0=this._y1,this._y1=Wt,this._t0=Ar}}};function gn(_t){this._context=new Ht(_t)}(gn.prototype=Object.create(nn.prototype)).point=function(_t,Wt){nn.prototype.point.call(this,Wt,_t)};function Ht(_t){this._context=_t}Ht.prototype={moveTo:function(_t,Wt){this._context.moveTo(Wt,_t)},closePath:function(){this._context.closePath()},lineTo:function(_t,Wt){this._context.lineTo(Wt,_t)},bezierCurveTo:function(_t,Wt,Ar,Vr,ma,ba){this._context.bezierCurveTo(Wt,_t,Vr,Ar,ba,ma)}};function It(_t){return new nn(_t)}function Gt(_t){return new gn(_t)}function Xt(_t){this._context=_t}Xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var _t=this._x,Wt=this._y,Ar=_t.length;if(Ar)if(this._line?this._context.lineTo(_t[0],Wt[0]):this._context.moveTo(_t[0],Wt[0]),Ar===2)this._context.lineTo(_t[1],Wt[1]);else for(var Vr=Rr(_t),ma=Rr(Wt),ba=0,wa=1;wa=0;--Wt)ma[Wt]=(wa[Wt]-ma[Wt+1])/ba[Wt];for(ba[Ar-1]=(_t[Ar]+ma[Ar-1])/2,Wt=0;Wt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(_t,Wt){switch(_t=+_t,Wt=+Wt,this._point){case 0:this._point=1,this._line?this._context.lineTo(_t,Wt):this._context.moveTo(_t,Wt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Wt),this._context.lineTo(_t,Wt);else{var Ar=this._x*(1-this._t)+_t*this._t;this._context.lineTo(Ar,this._y),this._context.lineTo(Ar,Wt)}break}}this._x=_t,this._y=Wt}};function ia(_t){return new Jr(_t,.5)}function Pa(_t){return new Jr(_t,0)}function Ga(_t){return new Jr(_t,1)}function ja(_t,Wt){if((wa=_t.length)>1)for(var Ar=1,Vr,ma,ba=_t[Wt[0]],wa,$r=ba.length;Ar=0;)Ar[Wt]=Wt;return Ar}function sn(_t,Wt){return _t[Wt]}function Ma(){var _t=A([]),Wt=Xa,Ar=ja,Vr=sn;function ma(ba){var wa=_t.apply(this,arguments),$r,ga=ba.length,jn=wa.length,an=new Array(jn),ei;for($r=0;$r0){for(var Ar,Vr,ma=0,ba=_t[0].length,wa;ma0)for(var Ar,Vr=0,ma,ba,wa,$r,ga,jn=_t[Wt[0]].length;Vr0?(ma[0]=wa,ma[1]=wa+=ba):ba<0?(ma[1]=$r,ma[0]=$r+=ba):(ma[0]=0,ma[1]=ba)}function St(_t,Wt){if((ma=_t.length)>0){for(var Ar=0,Vr=_t[Wt[0]],ma,ba=Vr.length;Ar0)||!((ba=(ma=_t[Wt[0]]).length)>0))){for(var Ar=0,Vr=1,ma,ba,wa;Vrba&&(ba=ma,Ar=Wt);return Ar}function Lr(_t){var Wt=_t.map(Tr);return Xa(_t).sort(function(Ar,Vr){return Wt[Ar]-Wt[Vr]})}function Tr(_t){for(var Wt=0,Ar=-1,Vr=_t.length,ma;++Ar0;--oe)ee(X*=.99),re(),j(X),re();function ne(){var ue=x.max(J,function(Ie){return Ie.length}),_e=U*(P-g)/(ue-1);z>_e&&(z=_e);var Te=x.min(J,function(Ie){return(P-g-(Ie.length-1)*z)/x.sum(Ie,c)});J.forEach(function(Ie){Ie.forEach(function(De,He){De.y1=(De.y0=He)+De.value*Te})}),$.links.forEach(function(Ie){Ie.width=Ie.value*Te})}function j(ue){J.forEach(function(_e){_e.forEach(function(Te){if(Te.targetLinks.length){var Ie=(x.sum(Te.targetLinks,p)/x.sum(Te.targetLinks,c)-m(Te))*ue;Te.y0+=Ie,Te.y1+=Ie}})})}function ee(ue){J.slice().reverse().forEach(function(_e){_e.forEach(function(Te){if(Te.sourceLinks.length){var Ie=(x.sum(Te.sourceLinks,T)/x.sum(Te.sourceLinks,c)-m(Te))*ue;Te.y0+=Ie,Te.y1+=Ie}})})}function re(){J.forEach(function(ue){var _e,Te,Ie=g,De=ue.length,He;for(ue.sort(h),He=0;He0&&(_e.y0+=Te,_e.y1+=Te),Ie=_e.y1+z;if(Te=Ie-z-P,Te>0)for(Ie=_e.y0-=Te,_e.y1-=Te,He=De-2;He>=0;--He)_e=ue[He],Te=_e.y1+z-Ie,Te>0&&(_e.y0-=Te,_e.y1-=Te),Ie=_e.y0})}}function q($){$.nodes.forEach(function(J){J.sourceLinks.sort(s),J.targetLinks.sort(n)}),$.nodes.forEach(function(J){var X=J.y0,oe=X;J.sourceLinks.forEach(function(ne){ne.y0=X+ne.width/2,X+=ne.width}),J.targetLinks.forEach(function(ne){ne.y1=oe+ne.width/2,oe+=ne.width})})}return W};function y(u){return[u.source.x1,u.y0]}function b(u){return[u.target.x0,u.y1]}var v=function(){return E.linkHorizontal().source(y).target(b)};d.sankey=M,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=v,Object.defineProperty(d,"__esModule",{value:!0})})}}),a4=We({"node_modules/elementary-circuits-directed-graph/johnson.js"(Z,V){var d=OT();V.exports=function(A,E){var e=[],t=[],r=[],o={},a=[],i;function n(S){r[S]=!1,o.hasOwnProperty(S)&&Object.keys(o[S]).forEach(function(M){delete o[S][M],r[M]&&n(M)})}function s(S){var M=!1;t.push(S),r[S]=!0;var y,b;for(y=0;y=S})}function m(S){c(S);for(var M=A,y=d(M),b=y.components.filter(function(z){return z.length>1}),v=1/0,u,g=0;g"u"?"undefined":s(Ce))!=="object"&&(Ce=Xe.source=y(Oe,Ce)),(typeof Ne>"u"?"undefined":s(Ne))!=="object"&&(Ne=Xe.target=y(Oe,Ne)),Ce.sourceLinks.push(Xe),Ne.targetLinks.push(Xe)}),yt}function jt(yt){yt.nodes.forEach(function(Oe){Oe.partOfCycle=!1,Oe.value=Math.max(x.sum(Oe.sourceLinks,p),x.sum(Oe.targetLinks,p)),Oe.sourceLinks.forEach(function(Xe){Xe.circular&&(Oe.partOfCycle=!0,Oe.circularLinkType=Xe.circularLinkType)}),Oe.targetLinks.forEach(function(Xe){Xe.circular&&(Oe.partOfCycle=!0,Oe.circularLinkType=Xe.circularLinkType)})})}function _r(yt){var Oe=0,Xe=0,be=0,Ce=0,Ne=x.max(yt.nodes,function(Ee){return Ee.column});return yt.links.forEach(function(Ee){Ee.circular&&(Ee.circularLinkType=="top"?Oe=Oe+Ee.width:Xe=Xe+Ee.width,Ee.target.column==0&&(Ce=Ce+Ee.width),Ee.source.column==Ne&&(be=be+Ee.width))}),Oe=Oe>0?Oe+v+u:Oe,Xe=Xe>0?Xe+v+u:Xe,be=be>0?be+v+u:be,Ce=Ce>0?Ce+v+u:Ce,{top:Oe,bottom:Xe,left:Ce,right:be}}function pr(yt,Oe){var Xe=x.max(yt.nodes,function(at){return at.column}),be=et-De,Ce=rt-He,Ne=be+Oe.right+Oe.left,Ee=Ce+Oe.top+Oe.bottom,Se=be/Ne,Le=Ce/Ee;return De=De*Se+Oe.left,et=Oe.right==0?et:et*Se,He=He*Le+Oe.top,rt=rt*Le,yt.nodes.forEach(function(at){at.x0=De+at.column*((et-De-$e)/Xe),at.x1=at.x0+$e}),Le}function Or(yt){var Oe,Xe,be;for(Oe=yt.nodes,Xe=[],be=0;Oe.length;++be,Oe=Xe,Xe=[])Oe.forEach(function(Ce){Ce.depth=be,Ce.sourceLinks.forEach(function(Ne){Xe.indexOf(Ne.target)<0&&!Ne.circular&&Xe.push(Ne.target)})});for(Oe=yt.nodes,Xe=[],be=0;Oe.length;++be,Oe=Xe,Xe=[])Oe.forEach(function(Ce){Ce.height=be,Ce.targetLinks.forEach(function(Ne){Xe.indexOf(Ne.source)<0&&!Ne.circular&&Xe.push(Ne.source)})});yt.nodes.forEach(function(Ce){Ce.column=Math.floor(ge.call(null,Ce,be))})}function mr(yt,Oe,Xe){var be=A.nest().key(function(at){return at.column}).sortKeys(x.ascending).entries(yt.nodes).map(function(at){return at.values});Ee(Xe),Le();for(var Ce=1,Ne=Oe;Ne>0;--Ne)Se(Ce*=.99,Xe),Le();function Ee(at){if(Ke){var dt=1/0;be.forEach(function(Qt){var Jt=rt*Ke/(Qt.length+1);dt=Jt0))if(Qt==0&&or==1)Sr=Jt.y1-Jt.y0,Jt.y0=rt/2-Sr/2,Jt.y1=rt/2+Sr/2;else if(Qt==gt-1&&or==1)Sr=Jt.y1-Jt.y0,Jt.y0=rt/2-Sr/2,Jt.y1=rt/2+Sr/2;else{var oa=0,Ea=x.mean(Jt.sourceLinks,_),Sa=x.mean(Jt.targetLinks,l);Ea&&Sa?oa=(Ea+Sa)/2:oa=Ea||Sa;var za=(oa-T(Jt))*at;Jt.y0+=za,Jt.y1+=za}})})}function Le(){be.forEach(function(at){var dt,gt,Ct=He,or=at.length,Qt;for(at.sort(m),Qt=0;Qt0&&(dt.y0+=gt,dt.y1+=gt),Ct=dt.y1+ot;if(gt=Ct-ot-rt,gt>0)for(Ct=dt.y0-=gt,dt.y1-=gt,Qt=or-2;Qt>=0;--Qt)dt=at[Qt],gt=dt.y1+ot-Ct,gt>0&&(dt.y0-=gt,dt.y1-=gt),Ct=dt.y0})}}function Er(yt){yt.nodes.forEach(function(Oe){Oe.sourceLinks.sort(c),Oe.targetLinks.sort(h)}),yt.nodes.forEach(function(Oe){var Xe=Oe.y0,be=Xe,Ce=Oe.y1,Ne=Ce;Oe.sourceLinks.forEach(function(Ee){Ee.circular?(Ee.y0=Ce-Ee.width/2,Ce=Ce-Ee.width):(Ee.y0=Xe+Ee.width/2,Xe+=Ee.width)}),Oe.targetLinks.forEach(function(Ee){Ee.circular?(Ee.y1=Ne-Ee.width/2,Ne=Ne-Ee.width):(Ee.y1=be+Ee.width/2,be+=Ee.width)})})}return Et}function P(De,He,et){var rt=0;if(et===null){for(var $e=[],ot=0;otHe.source.column)}function B(De,He){var et=0;De.sourceLinks.forEach(function($e){et=$e.circular&&!Te($e,He)?et+1:et});var rt=0;return De.targetLinks.forEach(function($e){rt=$e.circular&&!Te($e,He)?rt+1:rt}),et+rt}function O(De){var He=De.source.sourceLinks,et=0;He.forEach(function(ot){et=ot.circular?et+1:et});var rt=De.target.targetLinks,$e=0;return rt.forEach(function(ot){$e=ot.circular?$e+1:$e}),!(et>1||$e>1)}function I(De,He,et){return De.sort(W),De.forEach(function(rt,$e){var ot=0;if(Te(rt,et)&&O(rt))rt.circularPathData.verticalBuffer=ot+rt.width/2;else{var Ae=0;for(Ae;Ae<$e;Ae++)if(F(De[$e],De[Ae])){var ge=De[Ae].circularPathData.verticalBuffer+De[Ae].width/2+He;ot=ge>ot?ge:ot}rt.circularPathData.verticalBuffer=ot+rt.width/2}}),De}function N(De,He,et,rt){var $e=5,ot=x.min(De.links,function(ce){return ce.source.y0});De.links.forEach(function(ce){ce.circular&&(ce.circularPathData={})});var Ae=De.links.filter(function(ce){return ce.circularLinkType=="top"});I(Ae,He,rt);var ge=De.links.filter(function(ce){return ce.circularLinkType=="bottom"});I(ge,He,rt),De.links.forEach(function(ce){if(ce.circular){if(ce.circularPathData.arcRadius=ce.width+u,ce.circularPathData.leftNodeBuffer=$e,ce.circularPathData.rightNodeBuffer=$e,ce.circularPathData.sourceWidth=ce.source.x1-ce.source.x0,ce.circularPathData.sourceX=ce.source.x0+ce.circularPathData.sourceWidth,ce.circularPathData.targetX=ce.target.x0,ce.circularPathData.sourceY=ce.y0,ce.circularPathData.targetY=ce.y1,Te(ce,rt)&&O(ce))ce.circularPathData.leftSmallArcRadius=u+ce.width/2,ce.circularPathData.leftLargeArcRadius=u+ce.width/2,ce.circularPathData.rightSmallArcRadius=u+ce.width/2,ce.circularPathData.rightLargeArcRadius=u+ce.width/2,ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=ce.source.y1+v+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=ce.source.y0-v-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius);else{var ze=ce.source.column,Qe=ce.circularLinkType,nt=De.links.filter(function(Et){return Et.source.column==ze&&Et.circularLinkType==Qe});ce.circularLinkType=="bottom"?nt.sort(le):nt.sort(Q);var Ke=0;nt.forEach(function(Et,Bt){Et.circularLinkID==ce.circularLinkID&&(ce.circularPathData.leftSmallArcRadius=u+ce.width/2+Ke,ce.circularPathData.leftLargeArcRadius=u+ce.width/2+Bt*He+Ke),Ke=Ke+Et.width}),ze=ce.target.column,nt=De.links.filter(function(Et){return Et.target.column==ze&&Et.circularLinkType==Qe}),ce.circularLinkType=="bottom"?nt.sort(he):nt.sort(se),Ke=0,nt.forEach(function(Et,Bt){Et.circularLinkID==ce.circularLinkID&&(ce.circularPathData.rightSmallArcRadius=u+ce.width/2+Ke,ce.circularPathData.rightLargeArcRadius=u+ce.width/2+Bt*He+Ke),Ke=Ke+Et.width}),ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=Math.max(et,ce.source.y1,ce.target.y1)+v+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=ot-v-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius)}ce.circularPathData.leftInnerExtent=ce.circularPathData.sourceX+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightInnerExtent=ce.circularPathData.targetX-ce.circularPathData.rightNodeBuffer,ce.circularPathData.leftFullExtent=ce.circularPathData.sourceX+ce.circularPathData.leftLargeArcRadius+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightFullExtent=ce.circularPathData.targetX-ce.circularPathData.rightLargeArcRadius-ce.circularPathData.rightNodeBuffer}if(ce.circular)ce.path=U(ce);else{var kt=E.linkHorizontal().source(function(Et){var Bt=Et.source.x0+(Et.source.x1-Et.source.x0),jt=Et.y0;return[Bt,jt]}).target(function(Et){var Bt=Et.target.x0,jt=Et.y1;return[Bt,jt]});ce.path=kt(ce)}})}function U(De){var He="";return De.circularLinkType=="top"?He="M"+De.circularPathData.sourceX+" "+De.circularPathData.sourceY+" L"+De.circularPathData.leftInnerExtent+" "+De.circularPathData.sourceY+" A"+De.circularPathData.leftLargeArcRadius+" "+De.circularPathData.leftSmallArcRadius+" 0 0 0 "+De.circularPathData.leftFullExtent+" "+(De.circularPathData.sourceY-De.circularPathData.leftSmallArcRadius)+" L"+De.circularPathData.leftFullExtent+" "+De.circularPathData.verticalLeftInnerExtent+" A"+De.circularPathData.leftLargeArcRadius+" "+De.circularPathData.leftLargeArcRadius+" 0 0 0 "+De.circularPathData.leftInnerExtent+" "+De.circularPathData.verticalFullExtent+" L"+De.circularPathData.rightInnerExtent+" "+De.circularPathData.verticalFullExtent+" A"+De.circularPathData.rightLargeArcRadius+" "+De.circularPathData.rightLargeArcRadius+" 0 0 0 "+De.circularPathData.rightFullExtent+" "+De.circularPathData.verticalRightInnerExtent+" L"+De.circularPathData.rightFullExtent+" "+(De.circularPathData.targetY-De.circularPathData.rightSmallArcRadius)+" A"+De.circularPathData.rightLargeArcRadius+" "+De.circularPathData.rightSmallArcRadius+" 0 0 0 "+De.circularPathData.rightInnerExtent+" "+De.circularPathData.targetY+" L"+De.circularPathData.targetX+" "+De.circularPathData.targetY:He="M"+De.circularPathData.sourceX+" "+De.circularPathData.sourceY+" L"+De.circularPathData.leftInnerExtent+" "+De.circularPathData.sourceY+" A"+De.circularPathData.leftLargeArcRadius+" "+De.circularPathData.leftSmallArcRadius+" 0 0 1 "+De.circularPathData.leftFullExtent+" "+(De.circularPathData.sourceY+De.circularPathData.leftSmallArcRadius)+" L"+De.circularPathData.leftFullExtent+" "+De.circularPathData.verticalLeftInnerExtent+" A"+De.circularPathData.leftLargeArcRadius+" "+De.circularPathData.leftLargeArcRadius+" 0 0 1 "+De.circularPathData.leftInnerExtent+" "+De.circularPathData.verticalFullExtent+" L"+De.circularPathData.rightInnerExtent+" "+De.circularPathData.verticalFullExtent+" A"+De.circularPathData.rightLargeArcRadius+" "+De.circularPathData.rightLargeArcRadius+" 0 0 1 "+De.circularPathData.rightFullExtent+" "+De.circularPathData.verticalRightInnerExtent+" L"+De.circularPathData.rightFullExtent+" "+(De.circularPathData.targetY+De.circularPathData.rightSmallArcRadius)+" A"+De.circularPathData.rightLargeArcRadius+" "+De.circularPathData.rightSmallArcRadius+" 0 0 1 "+De.circularPathData.rightInnerExtent+" "+De.circularPathData.targetY+" L"+De.circularPathData.targetX+" "+De.circularPathData.targetY,He}function W(De,He){return q(De)==q(He)?De.circularLinkType=="bottom"?le(De,He):Q(De,He):q(He)-q(De)}function Q(De,He){return De.y0-He.y0}function le(De,He){return He.y0-De.y0}function se(De,He){return De.y1-He.y1}function he(De,He){return He.y1-De.y1}function q(De){return De.target.column-De.source.column}function $(De){return De.target.x0-De.source.x1}function J(De,He){var et=z(De),rt=$(He)/Math.tan(et),$e=_e(De)=="up"?De.y1+rt:De.y1-rt;return $e}function X(De,He){var et=z(De),rt=$(He)/Math.tan(et),$e=_e(De)=="up"?De.y1-rt:De.y1+rt;return $e}function oe(De,He,et,rt){De.links.forEach(function($e){if(!$e.circular&&$e.target.column-$e.source.column>1){var ot=$e.source.column+1,Ae=$e.target.column-1,ge=1,ce=Ae-ot+1;for(ge=1;ot<=Ae;ot++,ge++)De.nodes.forEach(function(ze){if(ze.column==ot){var Qe=ge/(ce+1),nt=Math.pow(1-Qe,3),Ke=3*Qe*Math.pow(1-Qe,2),kt=3*Math.pow(Qe,2)*(1-Qe),Et=Math.pow(Qe,3),Bt=nt*$e.y0+Ke*$e.y0+kt*$e.y1+Et*$e.y1,jt=Bt-$e.width/2,_r=Bt+$e.width/2,pr;jt>ze.y0&&jtze.y0&&_rze.y1&&j(Or,pr,He,et)})):jtze.y1&&(pr=_r-ze.y0+10,ze=j(ze,pr,He,et),De.nodes.forEach(function(Or){b(Or,rt)==b(ze,rt)||Or.column!=ze.column||Or.y0ze.y1&&j(Or,pr,He,et)}))}})}})}function ne(De,He){return De.y0>He.y0&&De.y0He.y0&&De.y1He.y1}function j(De,He,et,rt){return De.y0+He>=et&&De.y1+He<=rt&&(De.y0=De.y0+He,De.y1=De.y1+He,De.targetLinks.forEach(function($e){$e.y1=$e.y1+He}),De.sourceLinks.forEach(function($e){$e.y0=$e.y0+He})),De}function ee(De,He,et,rt){De.nodes.forEach(function($e){rt&&$e.y+($e.y1-$e.y0)>He&&($e.y=$e.y-($e.y+($e.y1-$e.y0)-He));var ot=De.links.filter(function(ce){return b(ce.source,et)==b($e,et)}),Ae=ot.length;Ae>1&&ot.sort(function(ce,ze){if(!ce.circular&&!ze.circular){if(ce.target.column==ze.target.column)return ce.y1-ze.y1;if(ue(ce,ze)){if(ce.target.column>ze.target.column){var Qe=X(ze,ce);return ce.y1-Qe}if(ze.target.column>ce.target.column){var nt=X(ce,ze);return nt-ze.y1}}else return ce.y1-ze.y1}if(ce.circular&&!ze.circular)return ce.circularLinkType=="top"?-1:1;if(ze.circular&&!ce.circular)return ze.circularLinkType=="top"?1:-1;if(ce.circular&&ze.circular)return ce.circularLinkType===ze.circularLinkType&&ce.circularLinkType=="top"?ce.target.column===ze.target.column?ce.target.y1-ze.target.y1:ze.target.column-ce.target.column:ce.circularLinkType===ze.circularLinkType&&ce.circularLinkType=="bottom"?ce.target.column===ze.target.column?ze.target.y1-ce.target.y1:ce.target.column-ze.target.column:ce.circularLinkType=="top"?-1:1});var ge=$e.y0;ot.forEach(function(ce){ce.y0=ge+ce.width/2,ge=ge+ce.width}),ot.forEach(function(ce,ze){if(ce.circularLinkType=="bottom"){var Qe=ze+1,nt=0;for(Qe;Qe1&&$e.sort(function(ge,ce){if(!ge.circular&&!ce.circular){if(ge.source.column==ce.source.column)return ge.y0-ce.y0;if(ue(ge,ce)){if(ce.source.column0?"up":"down"}function Te(De,He){return b(De.source,He)==b(De.target,He)}function Ie(De,He,et){var rt=De.nodes,$e=De.links,ot=!1,Ae=!1;if($e.forEach(function(Ke){Ke.circularLinkType=="top"?ot=!0:Ke.circularLinkType=="bottom"&&(Ae=!0)}),ot==!1||Ae==!1){var ge=x.min(rt,function(Ke){return Ke.y0}),ce=x.max(rt,function(Ke){return Ke.y1}),ze=ce-ge,Qe=et-He,nt=Qe/ze;rt.forEach(function(Ke){var kt=(Ke.y1-Ke.y0)*nt;Ke.y0=(Ke.y0-ge)*nt,Ke.y1=Ke.y0+kt}),$e.forEach(function(Ke){Ke.y0=(Ke.y0-ge)*nt,Ke.y1=(Ke.y1-ge)*nt,Ke.width=Ke.width*nt})}}d.sankeyCircular=f,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),NT=We({"src/traces/sankey/constants.js"(Z,V){"use strict";V.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),i4=We({"src/traces/sankey/render.js"(Z,V){"use strict";var d=e4(),x=(Bp(),xd(Nd)).interpolateNumber,A=Hi(),E=r4(),e=n4(),t=NT(),r=Af(),o=Fi(),a=Oo(),i=aa(),n=i.strTranslate,s=i.strRotate,h=Iv(),c=h.keyFun,m=h.repeat,p=h.unwrap,T=zl(),l=Wi(),_=gf(),w=_.CAP_SHIFT,S=_.LINE_SPACING,M=3;function y(J,X,oe){var ne=p(X),j=ne.trace,ee=j.domain,re=j.orientation==="h",ue=j.node.pad,_e=j.node.thickness,Te={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[j.node.align],Ie=J.width*(ee.x[1]-ee.x[0]),De=J.height*(ee.y[1]-ee.y[0]),He=ne._nodes,et=ne._links,rt=ne.circular,$e;rt?$e=e.sankeyCircular().circularLinkGap(0):$e=E.sankey(),$e.iterations(t.sankeyIterations).size(re?[Ie,De]:[De,Ie]).nodeWidth(_e).nodePadding(ue).nodeId(function(Or){return Or.pointNumber}).nodeAlign(Te).nodes(He).links(et);var ot=$e();$e.nodePadding()=Oe||(yt=Oe-Er.y0,yt>1e-6&&(Er.y0+=yt,Er.y1+=yt)),Oe=Er.y1+ue})}function Bt(Or){var mr=Or.map(function(Ne,Ee){return{x0:Ne.x0,index:Ee}}).sort(function(Ne,Ee){return Ne.x0-Ee.x0}),Er=[],yt=-1,Oe,Xe=-1/0,be;for(Ae=0;AeXe+_e&&(yt+=1,Oe=Ce.x0),Xe=Ce.x0,Er[yt]||(Er[yt]=[]),Er[yt].push(Ce),be=Oe-Ce.x0,Ce.x0+=be,Ce.x1+=be}return Er}if(j.node.x.length&&j.node.y.length){for(Ae=0;Ae0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(oe="M "+(j.targetX-X)+" "+(j.targetY-ne)+" L "+(j.rightInnerExtent-X)+" "+(j.targetY-ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightSmallArcRadius+ne)+" 0 0 0 "+(j.rightFullExtent-ne-X)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-ne-X)+" "+j.verticalRightInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightInnerExtent-ne-X)+" "+(j.verticalFullExtent+ne)+" L "+(j.rightFullExtent+ne-X-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent+ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent-X-ne-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" L "+(j.leftFullExtent+ne+(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent+ne)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+ne)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ne)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-ne)+" L "+j.sourceX+" "+(j.sourceY-ne)+" L "+j.sourceX+" "+(j.sourceY+ne)+" L "+j.leftInnerExtent+" "+(j.sourceY+ne)+" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent-ne)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ne)+" "+j.verticalLeftInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent-ne-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" L "+(j.rightFullExtent+ne-X+(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+(j.verticalFullExtent+ne)+" L "+(j.rightFullExtent-X-ne)+" "+(j.verticalFullExtent+ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftLargeArcRadius-ne)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-ne)+" L "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightLargeArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent,oe+=" L "+(j.rightFullExtent+ne-X)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightInnerExtent-X)+" "+(j.targetY+ne)+" L "+(j.targetX-X)+" "+(j.targetY+ne)+(X>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),oe}function u(){var J=.5;function X(oe){var ne=oe.linkArrowLength;if(oe.link.circular)return v(oe.link,ne);var j=Math.abs((oe.link.target.x0-oe.link.source.x1)/2);ne>j&&(ne=j);var ee=oe.link.source.x1,re=oe.link.target.x0-ne,ue=x(ee,re),_e=ue(J),Te=ue(1-J),Ie=oe.link.y0-oe.link.width/2,De=oe.link.y0+oe.link.width/2,He=oe.link.y1-oe.link.width/2,et=oe.link.y1+oe.link.width/2,rt="M"+ee+","+Ie,$e="C"+_e+","+Ie+" "+Te+","+He+" "+re+","+He,ot="C"+Te+","+et+" "+_e+","+De+" "+ee+","+De,Ae=ne>0?"L"+(re+ne)+","+(He+oe.link.width/2):"";return Ae+="L"+re+","+et,rt+$e+Ae+ot+"Z"}return X}function g(J,X){var oe=r(X.color),ne=t.nodePadAcross,j=J.nodePad/2;X.dx=X.x1-X.x0,X.dy=X.y1-X.y0;var ee=X.dx,re=Math.max(.5,X.dy),ue="node_"+X.pointNumber;return X.group&&(ue=i.randstr()),X.trace=J.trace,X.curveNumber=J.trace.index,{index:X.pointNumber,key:ue,partOfGroup:X.partOfGroup||!1,group:X.group,traceId:J.key,trace:J.trace,node:X,nodePad:J.nodePad,nodeLineColor:J.nodeLineColor,nodeLineWidth:J.nodeLineWidth,textFont:J.textFont,size:J.horizontal?J.height:J.width,visibleWidth:Math.ceil(ee),visibleHeight:re,zoneX:-ne,zoneY:-j,zoneWidth:ee+2*ne,zoneHeight:re+2*j,labelY:J.horizontal?X.dy/2+1:X.dx/2+1,left:X.originalLayer===1,sizeAcross:J.width,forceLayouts:J.forceLayouts,horizontal:J.horizontal,darkBackground:oe.getBrightness()<=128,tinyColorHue:o.tinyRGB(oe),tinyColorAlpha:oe.getAlpha(),valueFormat:J.valueFormat,valueSuffix:J.valueSuffix,sankey:J.sankey,graph:J.graph,arrangement:J.arrangement,uniqueNodeLabelPathId:[J.guid,J.key,ue].join("_"),interactionState:J.interactionState,figure:J}}function f(J){J.attr("transform",function(X){return n(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function P(J){J.call(f)}function L(J,X){J.call(P),X.attr("d",u())}function z(J){J.attr("width",function(X){return X.node.x1-X.node.x0}).attr("height",function(X){return X.visibleHeight})}function F(J){return J.link.width>1||J.linkLineWidth>0}function B(J){var X=n(J.translateX,J.translateY);return X+(J.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(J,X,oe){J.on(".basic",null).on("mouseover.basic",function(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.hover(this,ne,X),ne.interactionState.hovered=[this,ne])}).on("mousemove.basic",function(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.follow(this,ne),ne.interactionState.hovered=[this,ne])}).on("mouseout.basic",function(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.unhover(this,ne,X),ne.interactionState.hovered=!1)}).on("click.basic",function(ne){ne.interactionState.hovered&&(oe.unhover(this,ne,X),ne.interactionState.hovered=!1),!ne.interactionState.dragInProgress&&!ne.partOfGroup&&oe.select(this,ne,X)})}function I(J,X,oe,ne){var j=A.behavior.drag().origin(function(ee){return{x:ee.node.x0+ee.visibleWidth/2,y:ee.node.y0+ee.visibleHeight/2}}).on("dragstart",function(ee){if(ee.arrangement!=="fixed"&&(i.ensureSingle(ne._fullLayout._infolayer,"g","dragcover",function(ue){ne._fullLayout._dragCover=ue}),i.raiseToTop(this),ee.interactionState.dragInProgress=ee.node,se(ee.node),ee.interactionState.hovered&&(oe.nodeEvents.unhover.apply(0,ee.interactionState.hovered),ee.interactionState.hovered=!1),ee.arrangement==="snap")){var re=ee.traceId+"|"+ee.key;ee.forceLayouts[re]?ee.forceLayouts[re].alpha(1):N(J,re,ee,ne),U(J,X,ee,re,ne)}}).on("drag",function(ee){if(ee.arrangement!=="fixed"){var re=A.event.x,ue=A.event.y;ee.arrangement==="snap"?(ee.node.x0=re-ee.visibleWidth/2,ee.node.x1=re+ee.visibleWidth/2,ee.node.y0=ue-ee.visibleHeight/2,ee.node.y1=ue+ee.visibleHeight/2):(ee.arrangement==="freeform"&&(ee.node.x0=re-ee.visibleWidth/2,ee.node.x1=re+ee.visibleWidth/2),ue=Math.max(0,Math.min(ee.size-ee.visibleHeight/2,ue)),ee.node.y0=ue-ee.visibleHeight/2,ee.node.y1=ue+ee.visibleHeight/2),se(ee.node),ee.arrangement!=="snap"&&(ee.sankey.update(ee.graph),L(J.filter(he(ee)),X))}}).on("dragend",function(ee){if(ee.arrangement!=="fixed"){ee.interactionState.dragInProgress=!1;for(var re=0;re0)window.requestAnimationFrame(ee);else{var _e=oe.node.originalX;oe.node.x0=_e-oe.visibleWidth/2,oe.node.x1=_e+oe.visibleWidth/2,Q(oe,j)}})}function W(J,X,oe,ne){return function(){for(var ee=0,re=0;re0&&ne.forceLayouts[X].alpha(0)}}function Q(J,X){for(var oe=[],ne=[],j=0;j"),color:_(q,"bgcolor")||t.addOpacity(ne.color,1),borderColor:_(q,"bordercolor"),fontFamily:_(q,"font.family"),fontSize:_(q,"font.size"),fontColor:_(q,"font.color"),fontWeight:_(q,"font.weight"),fontStyle:_(q,"font.style"),fontVariant:_(q,"font.variant"),fontTextcase:_(q,"font.textcase"),fontLineposition:_(q,"font.lineposition"),fontShadow:_(q,"font.shadow"),nameLength:_(q,"namelength"),textAlign:_(q,"align"),idealAlign:d.event.x"),color:_(q,"bgcolor")||he.tinyColorHue,borderColor:_(q,"bordercolor"),fontFamily:_(q,"font.family"),fontSize:_(q,"font.size"),fontColor:_(q,"font.color"),fontWeight:_(q,"font.weight"),fontStyle:_(q,"font.style"),fontVariant:_(q,"font.variant"),fontTextcase:_(q,"font.textcase"),fontLineposition:_(q,"font.lineposition"),fontShadow:_(q,"font.shadow"),nameLength:_(q,"namelength"),textAlign:_(q,"align"),idealAlign:"left",hovertemplate:q.hovertemplate,hovertemplateLabels:ee,eventData:[he.node]},{container:y._hoverlayer.node(),outerContainer:y._paper.node(),gd:S});n(_e,.85),s(_e)}}},le=function(se,he,q){S._fullLayout.hovermode!==!1&&(d.select(se).call(p,he,q),he.node.trace.node.hoverinfo!=="skip"&&(he.node.fullData=he.node.trace,S.emit("plotly_unhover",{event:d.event,points:[he.node]})),e.loneUnhover(y._hoverlayer.node()))};E(S,b,M,{width:v.w,height:v.h,margin:{t:v.t,r:v.r,b:v.b,l:v.l}},{linkEvents:{hover:P,follow:I,unhover:N,select:f},nodeEvents:{hover:W,follow:Q,unhover:le,select:U}})}}}),o4=We({"src/traces/sankey/base_plot.js"(Z){"use strict";var V=Iu().overrideAll,d=Ff().getModuleCalcData,x=UT(),A=bd(),E=sv(),e=ih(),t=Ec().prepSelect,r=aa(),o=Wi(),a="sankey";Z.name=a,Z.baseLayoutAttrOverrides=V({hoverlabel:A.hoverlabel},"plot","nested"),Z.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Z.updateFx(n)},Z.clean=function(n,s,h,c){var m=c._has&&c._has(a),p=s._has&&s._has(a);m&&!p&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},Z.updateFx=function(n){for(var s=0;s0}V.exports=function(F,B,O,I){var N=F._fullLayout,U;w(O)&&I&&(U=I()),E.makeTraceGroups(N._indicatorlayer,B,"trace").each(function(W){var Q=W[0],le=Q.trace,se=d.select(this),he=le._hasGauge,q=le._isAngular,$=le._isBullet,J=le.domain,X={w:N._size.w*(J.x[1]-J.x[0]),h:N._size.h*(J.y[1]-J.y[0]),l:N._size.l+N._size.w*J.x[0],r:N._size.r+N._size.w*(1-J.x[1]),t:N._size.t+N._size.h*(1-J.y[1]),b:N._size.b+N._size.h*J.y[0]},oe=X.l+X.w/2,ne=X.t+X.h/2,j=Math.min(X.w/2,X.h),ee=i.innerRadius*j,re,ue,_e,Te=le.align||"center";if(ue=ne,!he)re=X.l+l[Te]*X.w,_e=function(ce){return g(ce,X.w,X.h)};else if(q&&(re=oe,ue=ne+j/2,_e=function(ce){return f(ce,.9*ee)}),$){var Ie=i.bulletPadding,De=1-i.bulletNumberDomainSize+Ie;re=X.l+(De+(1-De)*l[Te])*X.w,_e=function(ce){return g(ce,(i.bulletNumberDomainSize-Ie)*X.w,X.h)}}y(F,se,W,{numbersX:re,numbersY:ue,numbersScaler:_e,transitionOpts:O,onComplete:U});var He,et;he&&(He={range:le.gauge.axis.range,color:le.gauge.bgcolor,line:{color:le.gauge.bordercolor,width:0},thickness:1},et={range:le.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:le.gauge.bordercolor,width:le.gauge.borderwidth},thickness:1});var rt=se.selectAll("g.angular").data(q?W:[]);rt.exit().remove();var $e=se.selectAll("g.angularaxis").data(q?W:[]);$e.exit().remove(),q&&M(F,se,W,{radius:j,innerRadius:ee,gauge:rt,layer:$e,size:X,gaugeBg:He,gaugeOutline:et,transitionOpts:O,onComplete:U});var ot=se.selectAll("g.bullet").data($?W:[]);ot.exit().remove();var Ae=se.selectAll("g.bulletaxis").data($?W:[]);Ae.exit().remove(),$&&S(F,se,W,{gauge:ot,layer:Ae,size:X,gaugeBg:He,gaugeOutline:et,transitionOpts:O,onComplete:U});var ge=se.selectAll("text.title").data(W);ge.exit().remove(),ge.enter().append("text").classed("title",!0),ge.attr("text-anchor",function(){return $?T.right:T[le.title.align]}).text(le.title.text).call(a.font,le.title.font).call(n.convertToTspans,F),ge.attr("transform",function(){var ce=X.l+X.w*l[le.title.align],ze,Qe=i.titlePadding,nt=a.bBox(ge.node());if(he){if(q)if(le.gauge.axis.visible){var Ke=a.bBox($e.node());ze=Ke.top-Qe-nt.bottom}else ze=X.t+X.h/2-j/2-nt.bottom-Qe;$&&(ze=ue-(nt.top+nt.bottom)/2,ce=X.l-i.bulletPadding*X.w)}else ze=le._numbersTop-Qe-nt.bottom;return t(ce,ze)})})};function S(z,F,B,O){var I=B[0].trace,N=O.gauge,U=O.layer,W=O.gaugeBg,Q=O.gaugeOutline,le=O.size,se=I.domain,he=O.transitionOpts,q=O.onComplete,$,J,X,oe,ne;N.enter().append("g").classed("bullet",!0),N.attr("transform",t(le.l,le.t)),U.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),U.selectAll("g.xbulletaxistick,path,text").remove();var j=le.h,ee=I.gauge.bar.thickness*j,re=se.x[0],ue=se.x[0]+(se.x[1]-se.x[0])*(I._hasNumber||I._hasDelta?1-i.bulletNumberDomainSize:1);$=u(z,I.gauge.axis),$._id="xbulletaxis",$.domain=[re,ue],$.setScale(),J=s.calcTicks($),X=s.makeTransTickFn($),oe=s.getTickSigns($)[2],ne=le.t+le.h,$.visible&&(s.drawTicks(z,$,{vals:$.ticks==="inside"?s.clipEnds($,J):J,layer:U,path:s.makeTickPath($,ne,oe),transFn:X}),s.drawLabels(z,$,{vals:J,layer:U,transFn:X,labelFns:s.makeLabelFns($,ne)}));function _e($e){$e.attr("width",function(ot){return Math.max(0,$.c2p(ot.range[1])-$.c2p(ot.range[0]))}).attr("x",function(ot){return $.c2p(ot.range[0])}).attr("y",function(ot){return .5*(1-ot.thickness)*j}).attr("height",function(ot){return ot.thickness*j})}var Te=[W].concat(I.gauge.steps),Ie=N.selectAll("g.bg-bullet").data(Te);Ie.enter().append("g").classed("bg-bullet",!0).append("rect"),Ie.select("rect").call(_e).call(b),Ie.exit().remove();var De=N.selectAll("g.value-bullet").data([I.gauge.bar]);De.enter().append("g").classed("value-bullet",!0).append("rect"),De.select("rect").attr("height",ee).attr("y",(j-ee)/2).call(b),w(he)?De.select("rect").transition().duration(he.duration).ease(he.easing).each("end",function(){q&&q()}).each("interrupt",function(){q&&q()}).attr("width",Math.max(0,$.c2p(Math.min(I.gauge.axis.range[1],B[0].y)))):De.select("rect").attr("width",typeof B[0].y=="number"?Math.max(0,$.c2p(Math.min(I.gauge.axis.range[1],B[0].y))):0),De.exit().remove();var He=B.filter(function(){return I.gauge.threshold.value||I.gauge.threshold.value===0}),et=N.selectAll("g.threshold-bullet").data(He);et.enter().append("g").classed("threshold-bullet",!0).append("line"),et.select("line").attr("x1",$.c2p(I.gauge.threshold.value)).attr("x2",$.c2p(I.gauge.threshold.value)).attr("y1",(1-I.gauge.threshold.thickness)/2*j).attr("y2",(1-(1-I.gauge.threshold.thickness)/2)*j).call(p.stroke,I.gauge.threshold.line.color).style("stroke-width",I.gauge.threshold.line.width),et.exit().remove();var rt=N.selectAll("g.gauge-outline").data([Q]);rt.enter().append("g").classed("gauge-outline",!0).append("rect"),rt.select("rect").call(_e).call(b),rt.exit().remove()}function M(z,F,B,O){var I=B[0].trace,N=O.size,U=O.radius,W=O.innerRadius,Q=O.gaugeBg,le=O.gaugeOutline,se=[N.l+N.w/2,N.t+N.h/2+U/2],he=O.gauge,q=O.layer,$=O.transitionOpts,J=O.onComplete,X=Math.PI/2;function oe(kt){var Et=I.gauge.axis.range[0],Bt=I.gauge.axis.range[1],jt=(kt-Et)/(Bt-Et)*Math.PI-X;return jt<-X?-X:jt>X?X:jt}function ne(kt){return d.svg.arc().innerRadius((W+U)/2-kt/2*(U-W)).outerRadius((W+U)/2+kt/2*(U-W)).startAngle(-X)}function j(kt){kt.attr("d",function(Et){return ne(Et.thickness).startAngle(oe(Et.range[0])).endAngle(oe(Et.range[1]))()})}var ee,re,ue,_e;he.enter().append("g").classed("angular",!0),he.attr("transform",t(se[0],se[1])),q.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),q.selectAll("g.xangularaxistick,path,text").remove(),ee=u(z,I.gauge.axis),ee.type="linear",ee.range=I.gauge.axis.range,ee._id="xangularaxis",ee.ticklabeloverflow="allow",ee.setScale();var Te=function(kt){return(ee.range[0]-kt.x)/(ee.range[1]-ee.range[0])*Math.PI+Math.PI},Ie={},De=s.makeLabelFns(ee,0),He=De.labelStandoff;Ie.xFn=function(kt){var Et=Te(kt);return Math.cos(Et)*He},Ie.yFn=function(kt){var Et=Te(kt),Bt=Math.sin(Et)>0?.2:1;return-Math.sin(Et)*(He+kt.fontSize*Bt)+Math.abs(Math.cos(Et))*(kt.fontSize*o)},Ie.anchorFn=function(kt){var Et=Te(kt),Bt=Math.cos(Et);return Math.abs(Bt)<.1?"middle":Bt>0?"start":"end"},Ie.heightFn=function(kt,Et,Bt){var jt=Te(kt);return-.5*(1+Math.sin(jt))*Bt};var et=function(kt){return t(se[0]+U*Math.cos(kt),se[1]-U*Math.sin(kt))};ue=function(kt){return et(Te(kt))};var rt=function(kt){var Et=Te(kt);return et(Et)+"rotate("+-r(Et)+")"};if(re=s.calcTicks(ee),_e=s.getTickSigns(ee)[2],ee.visible){_e=ee.ticks==="inside"?-1:1;var $e=(ee.linewidth||1)/2;s.drawTicks(z,ee,{vals:re,layer:q,path:"M"+_e*$e+",0h"+_e*ee.ticklen,transFn:rt}),s.drawLabels(z,ee,{vals:re,layer:q,transFn:ue,labelFns:Ie})}var ot=[Q].concat(I.gauge.steps),Ae=he.selectAll("g.bg-arc").data(ot);Ae.enter().append("g").classed("bg-arc",!0).append("path"),Ae.select("path").call(j).call(b),Ae.exit().remove();var ge=ne(I.gauge.bar.thickness),ce=he.selectAll("g.value-arc").data([I.gauge.bar]);ce.enter().append("g").classed("value-arc",!0).append("path");var ze=ce.select("path");w($)?(ze.transition().duration($.duration).ease($.easing).each("end",function(){J&&J()}).each("interrupt",function(){J&&J()}).attrTween("d",v(ge,oe(B[0].lastY),oe(B[0].y))),I._lastValue=B[0].y):ze.attr("d",typeof B[0].y=="number"?ge.endAngle(oe(B[0].y)):"M0,0Z"),ze.call(b),ce.exit().remove(),ot=[];var Qe=I.gauge.threshold.value;(Qe||Qe===0)&&ot.push({range:[Qe,Qe],color:I.gauge.threshold.color,line:{color:I.gauge.threshold.line.color,width:I.gauge.threshold.line.width},thickness:I.gauge.threshold.thickness});var nt=he.selectAll("g.threshold-arc").data(ot);nt.enter().append("g").classed("threshold-arc",!0).append("path"),nt.select("path").call(j).call(b),nt.exit().remove();var Ke=he.selectAll("g.gauge-outline").data([le]);Ke.enter().append("g").classed("gauge-outline",!0).append("path"),Ke.select("path").call(j).call(b),Ke.exit().remove()}function y(z,F,B,O){var I=B[0].trace,N=O.numbersX,U=O.numbersY,W=I.align||"center",Q=T[W],le=O.transitionOpts,se=O.onComplete,he=E.ensureSingle(F,"g","numbers"),q,$,J,X=[];I._hasNumber&&X.push("number"),I._hasDelta&&(X.push("delta"),I.delta.position==="left"&&X.reverse());var oe=he.selectAll("text").data(X);oe.enter().append("text"),oe.attr("text-anchor",function(){return Q}).attr("class",function(et){return et}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),oe.exit().remove();function ne(et,rt,$e,ot){if(et.match("s")&&$e>=0!=ot>=0&&!rt($e).slice(-1).match(_)&&!rt(ot).slice(-1).match(_)){var Ae=et.slice().replace("s","f").replace(/\d+/,function(ce){return parseInt(ce)-1}),ge=u(z,{tickformat:Ae});return function(ce){return Math.abs(ce)<1?s.tickText(ge,ce).text:rt(ce)}}else return rt}function j(){var et=u(z,{tickformat:I.number.valueformat},I._range);et.setScale(),s.prepTicks(et);var rt=function(ce){return s.tickText(et,ce).text},$e=I.number.suffix,ot=I.number.prefix,Ae=he.select("text.number");function ge(){var ce=typeof B[0].y=="number"?ot+rt(B[0].y)+$e:"-";Ae.text(ce).call(a.font,I.number.font).call(n.convertToTspans,z)}return w(le)?Ae.transition().duration(le.duration).ease(le.easing).each("end",function(){ge(),se&&se()}).each("interrupt",function(){ge(),se&&se()}).attrTween("text",function(){var ce=d.select(this),ze=A(B[0].lastY,B[0].y);I._lastValue=B[0].y;var Qe=ne(I.number.valueformat,rt,B[0].lastY,B[0].y);return function(nt){ce.text(ot+Qe(ze(nt))+$e)}}):ge(),q=P(ot+rt(B[0].y)+$e,I.number.font,Q,z),Ae}function ee(){var et=u(z,{tickformat:I.delta.valueformat},I._range);et.setScale(),s.prepTicks(et);var rt=function(nt){return s.tickText(et,nt).text},$e=I.delta.suffix,ot=I.delta.prefix,Ae=function(nt){var Ke=I.delta.relative?nt.relativeDelta:nt.delta;return Ke},ge=function(nt,Ke){return nt===0||typeof nt!="number"||isNaN(nt)?"-":(nt>0?I.delta.increasing.symbol:I.delta.decreasing.symbol)+ot+Ke(nt)+$e},ce=function(nt){return nt.delta>=0?I.delta.increasing.color:I.delta.decreasing.color};I._deltaLastValue===void 0&&(I._deltaLastValue=Ae(B[0]));var ze=he.select("text.delta");ze.call(a.font,I.delta.font).call(p.fill,ce({delta:I._deltaLastValue}));function Qe(){ze.text(ge(Ae(B[0]),rt)).call(p.fill,ce(B[0])).call(n.convertToTspans,z)}return w(le)?ze.transition().duration(le.duration).ease(le.easing).tween("text",function(){var nt=d.select(this),Ke=Ae(B[0]),kt=I._deltaLastValue,Et=ne(I.delta.valueformat,rt,kt,Ke),Bt=A(kt,Ke);return I._deltaLastValue=Ke,function(jt){nt.text(ge(Bt(jt),Et)),nt.call(p.fill,ce({delta:Bt(jt)}))}}).each("end",function(){Qe(),se&&se()}).each("interrupt",function(){Qe(),se&&se()}):Qe(),$=P(ge(Ae(B[0]),rt),I.delta.font,Q,z),ze}var re=I.mode+I.align,ue;if(I._hasDelta&&(ue=ee(),re+=I.delta.position+I.delta.font.size+I.delta.font.family+I.delta.valueformat,re+=I.delta.increasing.symbol+I.delta.decreasing.symbol,J=$),I._hasNumber&&(j(),re+=I.number.font.size+I.number.font.family+I.number.valueformat+I.number.suffix+I.number.prefix,J=q),I._hasDelta&&I._hasNumber){var _e=[(q.left+q.right)/2,(q.top+q.bottom)/2],Te=[($.left+$.right)/2,($.top+$.bottom)/2],Ie,De,He=.75*I.delta.font.size;I.delta.position==="left"&&(Ie=L(I,"deltaPos",0,-1*(q.width*l[I.align]+$.width*(1-l[I.align])+He),re,Math.min),De=_e[1]-Te[1],J={width:q.width+$.width+He,height:Math.max(q.height,$.height),left:$.left+Ie,right:q.right,top:Math.min(q.top,$.top+De),bottom:Math.max(q.bottom,$.bottom+De)}),I.delta.position==="right"&&(Ie=L(I,"deltaPos",0,q.width*(1-l[I.align])+$.width*l[I.align]+He,re,Math.max),De=_e[1]-Te[1],J={width:q.width+$.width+He,height:Math.max(q.height,$.height),left:q.left,right:$.right+Ie,top:Math.min(q.top,$.top+De),bottom:Math.max(q.bottom,$.bottom+De)}),I.delta.position==="bottom"&&(Ie=null,De=$.height,J={width:Math.max(q.width,$.width),height:q.height+$.height,left:Math.min(q.left,$.left),right:Math.max(q.right,$.right),top:q.bottom-q.height,bottom:q.bottom+$.height}),I.delta.position==="top"&&(Ie=null,De=q.top,J={width:Math.max(q.width,$.width),height:q.height+$.height,left:Math.min(q.left,$.left),right:Math.max(q.right,$.right),top:q.bottom-q.height-$.height,bottom:q.bottom}),ue.attr({dx:Ie,dy:De})}(I._hasNumber||I._hasDelta)&&he.attr("transform",function(){var et=O.numbersScaler(J);re+=et[2];var rt=L(I,"numbersScale",1,et[0],re,Math.min),$e;I._scaleNumbers||(rt=1),I._isAngular?$e=U-rt*J.bottom:$e=U-rt*(J.top+J.bottom)/2,I._numbersTop=rt*J.top+$e;var ot=J[W];W==="center"&&(ot=(J.left+J.right)/2);var Ae=N-rt*ot;return Ae=L(I,"numbersTranslate",0,Ae,re,Math.max),t(Ae,$e)+e(rt)})}function b(z){z.each(function(F){p.stroke(d.select(this),F.line.color)}).each(function(F){p.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function v(z,F,B){return function(){var O=x(F,B);return function(I){return z.endAngle(O(I))()}}}function u(z,F,B){var O=z._fullLayout,I=E.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},F),N={type:"linear",_id:"x"+F._id},U={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function W(Q,le){return E.coerce(I,N,m,Q,le)}return h(I,N,W,U,O),c(I,N,W,U),N}function g(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function f(z,F){var B=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/B;return[O,z,F]}function P(z,F,B,O){var I=document.createElementNS("http://www.w3.org/2000/svg","text"),N=d.select(I);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(N.node())}function L(z,F,B,O,I,N){var U="_cache"+F;z[U]&&z[U].key===I||(z[U]={key:I,value:B});var W=E.aggNums(N,null,[z[U].value,O],2);return z[U].value=W,W}}}),d4=We({"src/traces/indicator/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"indicator",basePlotModule:c4(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:jT(),supplyDefaults:f4().supplyDefaults,calc:h4().calc,plot:v4(),meta:{}}}}),p4=We({"lib/indicator.js"(Z,V){"use strict";V.exports=d4()}}),qT=We({"src/traces/table/attributes.js"(Z,V){"use strict";var d=wp(),x=Fo().extendFlat,A=Iu().overrideAll,E=_u(),e=Uu().attributes,t=fc().descriptionOnlyNumbers,r=V.exports=A({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))}},"calc","from-root")}}),m4=We({"src/traces/table/defaults.js"(Z,V){"use strict";var d=aa(),x=qT(),A=Uu().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(h,c){return h-c}),n=a.map(function(h){return i.indexOf(h)}),s=n.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),y4=We({"src/traces/table/data_preparation_helper.js"(Z,V){"use strict";var d=GT(),x=Fo().extendFlat,A=Uo(),E=rh().isTypedArray,e=rh().isArrayOrTypedArray;V.exports=function(m,p){var T=o(p.cells.values),l=function(Q){return Q.slice(p.header.values.length,Q.length)},_=o(p.header.values);_.length&&!_[0].length&&(_[0]=[""],_=o(_));var w=_.concat(l(T).map(function(){return a((_[0]||[""]).length)})),S=p.domain,M=Math.floor(m._fullLayout._size.w*(S.x[1]-S.x[0])),y=Math.floor(m._fullLayout._size.h*(S.y[1]-S.y[0])),b=p.header.values.length?w[0].map(function(){return p.header.height}):[d.emptyHeaderHeight],v=T.length?T[0].map(function(){return p.cells.height}):[],u=b.reduce(r,0),g=y-u,f=g+d.uplift,P=s(v,f),L=s(b,u),z=n(L,[]),F=n(P,z),B={},O=p._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function(Q,le){return le})));var I=w.map(function(Q,le){var se=e(p.columnwidth)?p.columnwidth[Math.min(le,p.columnwidth.length-1)]:p.columnwidth;return A(se)?Number(se):1}),N=I.reduce(r,0);I=I.map(function(Q){return Q/N*M});var U=Math.max(t(p.header.line.width),t(p.cells.line.width)),W={key:p.uid+m._context.staticPlot,translateX:S.x[0]*m._fullLayout._size.w,translateY:m._fullLayout._size.h*(1-S.y[1]),size:m._fullLayout._size,width:M,maxLineWidth:U,height:y,columnOrder:O,groupHeight:y,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},p.cells,{values:T}),headerCells:x({},p.header,{values:w}),gdColumns:w.map(function(Q){return Q[0]}),gdColumnsOriginalOrder:w.map(function(Q){return Q[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:w.map(function(Q,le){var se=B[Q];B[Q]=(se||0)+1;var he=Q+"__"+B[Q];return{key:he,label:Q,specIndex:le,xIndex:O[le],xScale:i,x:void 0,calcdata:void 0,columnWidth:I[le]}})};return W.columns.forEach(function(Q){Q.calcdata=W,Q.x=i(Q)}),W};function t(c){if(e(c)){for(var m=0,p=0;p=m||y===c.length-1)&&(p[l]=w,w.key=M++,w.firstRowIndex=S,w.lastRowIndex=y,w=h(),l+=_,S=y+1,_=0);return p}function h(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),_4=We({"src/traces/table/data_split_helpers.js"(Z){"use strict";var V=Fo().extendFlat;Z.splitToPanels=function(x){var A=[0,0],E=V({},x,{key:"header",type:"header",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:V({},x.calcdata,{cells:x.calcdata.headerCells})}),e=V({},x,{key:"cells1",type:"cells",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=V({},x,{key:"cells2",type:"cells",page:1,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Z.splitToCells=function(x){var A=d(x);return(x.values||[]).slice(A[0],A[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:A[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function d(x){var A=x.rowBlocks[x.page],E=A?A.rows[0].rowIndex:0,e=A?E+A.rows.length:0;return[E,e]}}}),HT=We({"src/traces/table/plot.js"(Z,V){"use strict";var d=GT(),x=Hi(),A=aa(),E=A.numberFormat,e=Iv(),t=Oo(),r=zl(),o=aa().raiseToTop,a=aa().strTranslate,i=aa().cancelTransition,n=y4(),s=_4(),h=Fi();V.exports=function(re,ue){var _e=!re._context.staticPlot,Te=re._fullLayout._paper.selectAll("."+d.cn.table).data(ue.map(function(Ke){var kt=e.unwrap(Ke),Et=kt.trace;return n(re,Et)}),e.keyFun);Te.exit().remove(),Te.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Te.attr("width",function(Ke){return Ke.width+Ke.size.l+Ke.size.r}).attr("height",function(Ke){return Ke.height+Ke.size.t+Ke.size.b}).attr("transform",function(Ke){return a(Ke.translateX,Ke.translateY)});var Ie=Te.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),De=Ie.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(_e){var He="onwheel"in document?"wheel":"mousewheel";De.on("mousemove",function(Ke){Ie.filter(function(kt){return Ke===kt}).call(l,re)}).on(He,function(Ke){if(!Ke.scrollbarState.wheeling){Ke.scrollbarState.wheeling=!0;var kt=Ke.scrollY+x.event.deltaY,Et=Q(re,Ie,null,kt)(Ke);Et||(x.event.stopPropagation(),x.event.preventDefault()),Ke.scrollbarState.wheeling=!1}}).call(l,re,!0)}Ie.attr("transform",function(Ke){return a(Ke.size.l,Ke.size.t)});var et=Ie.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);et.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),et.attr("width",function(Ke){return Ke.width}).attr("height",function(Ke){return Ke.height}),Ie.each(function(Ke){t.setClipUrl(x.select(this),m(re,Ke),re)});var rt=Ie.selectAll("."+d.cn.yColumn).data(function(Ke){return Ke.columns},e.keyFun);rt.enter().append("g").classed(d.cn.yColumn,!0),rt.exit().remove(),rt.attr("transform",function(Ke){return a(Ke.x,0)}),_e&&rt.call(x.behavior.drag().origin(function(Ke){var kt=x.select(this);return B(kt,Ke,-d.uplift),o(this),Ke.calcdata.columnDragInProgress=!0,l(Ie.filter(function(Et){return Ke.calcdata.key===Et.key}),re),Ke}).on("drag",function(Ke){var kt=x.select(this),Et=function(_r){return(Ke===_r?x.event.x:_r.x)+_r.columnWidth/2};Ke.x=Math.max(-d.overdrag,Math.min(Ke.calcdata.width+d.overdrag-Ke.columnWidth,x.event.x));var Bt=T(rt).filter(function(_r){return _r.calcdata.key===Ke.calcdata.key}),jt=Bt.sort(function(_r,pr){return Et(_r)-Et(pr)});jt.forEach(function(_r,pr){_r.xIndex=pr,_r.x=Ke===_r?_r.x:_r.xScale(_r)}),rt.filter(function(_r){return Ke!==_r}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(_r){return a(_r.x,0)}),kt.call(i).attr("transform",a(Ke.x,-d.uplift))}).on("dragend",function(Ke){var kt=x.select(this),Et=Ke.calcdata;Ke.x=Ke.xScale(Ke),Ke.calcdata.columnDragInProgress=!1,B(kt,Ke,0),z(re,Et,Et.columns.map(function(Bt){return Bt.xIndex}))})),rt.each(function(Ke){t.setClipUrl(x.select(this),p(re,Ke),re)});var $e=rt.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);$e.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Ke){return Ke.key}),$e.style("cursor",function(Ke){return Ke.dragHandle?"ew-resize":Ke.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ot=$e.filter(I),Ae=$e.filter(O);_e&&Ae.call(x.behavior.drag().origin(function(Ke){return x.event.stopPropagation(),Ke}).on("drag",Q(re,Ie,-1)).on("dragend",function(){})),_(re,Ie,ot,$e),_(re,Ie,Ae,$e);var ge=Ie.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);ge.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Ke){return m(re,Ke)});var ce=ge.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);ce.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ce.attr("width",function(Ke){return Ke.width+2*d.overdrag}).attr("height",function(Ke){return Ke.height+d.uplift});var ze=rt.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);ze.enter().append("g").classed(d.cn.columnBoundary,!0);var Qe=rt.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);Qe.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),Qe.attr("id",function(Ke){return p(re,Ke)});var nt=Qe.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);nt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),nt.attr("width",function(Ke){return Ke.columnWidth+2*c(Ke)}).attr("height",function(Ke){return Ke.calcdata.height+2*c(Ke)+d.uplift}).attr("x",function(Ke){return-c(Ke)}).attr("y",function(Ke){return-c(Ke)}),W(null,Ae,Ie)};function c(ee){return Math.ceil(ee.calcdata.maxLineWidth/2)}function m(ee,re){return"clip"+ee._fullLayout._uid+"_scrollAreaBottomClip_"+re.key}function p(ee,re){return"clip"+ee._fullLayout._uid+"_columnBoundaryClippath_"+re.calcdata.key+"_"+re.specIndex}function T(ee){return[].concat.apply([],ee.map(function(re){return re})).map(function(re){return re.__data__})}function l(ee,re,ue){function _e(rt){var $e=rt.rowBlocks;return J($e,$e.length-1)+($e.length?X($e[$e.length-1],1/0):1)}var Te=ee.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Te.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Te.each(function(rt){var $e=rt.scrollbarState;$e.totalHeight=_e(rt),$e.scrollableAreaHeight=rt.groupHeight-N(rt),$e.currentlyVisibleHeight=Math.min($e.totalHeight,$e.scrollableAreaHeight),$e.ratio=$e.currentlyVisibleHeight/$e.totalHeight,$e.barLength=Math.max($e.ratio*$e.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),$e.barWiggleRoom=$e.currentlyVisibleHeight-$e.barLength,$e.wiggleRoom=Math.max(0,$e.totalHeight-$e.scrollableAreaHeight),$e.topY=$e.barWiggleRoom===0?0:rt.scrollY/$e.wiggleRoom*$e.barWiggleRoom,$e.bottomY=$e.topY+$e.barLength,$e.dragMultiplier=$e.wiggleRoom/$e.barWiggleRoom}).attr("transform",function(rt){var $e=rt.width+d.scrollbarWidth/2+d.scrollbarOffset;return a($e,N(rt))});var Ie=Te.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);Ie.enter().append("g").classed(d.cn.scrollbar,!0);var De=Ie.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);De.enter().append("g").classed(d.cn.scrollbarSlider,!0),De.attr("transform",function(rt){return a(0,rt.scrollbarState.topY||0)});var He=De.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);He.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),He.attr("y2",function(rt){return rt.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(rt){return rt.columnDragInProgress||!rt.scrollbarState.barWiggleRoom||ue?0:.4}),He.transition().delay(0).duration(0),He.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var et=Ie.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);et.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(rt){var $e=x.event.y,ot=this.getBoundingClientRect(),Ae=rt.scrollbarState,ge=$e-ot.top,ce=x.scale.linear().domain([0,Ae.scrollableAreaHeight]).range([0,Ae.totalHeight]).clamp(!0);Ae.topY<=ge&&ge<=Ae.bottomY||Q(re,ee,null,ce(ge-Ae.barLength/2))(rt)}).call(x.behavior.drag().origin(function(rt){return x.event.stopPropagation(),rt.scrollbarState.scrollbarScrollInProgress=!0,rt}).on("drag",Q(re,ee)).on("dragend",function(){})),et.attr("y2",function(rt){return rt.scrollbarState.scrollableAreaHeight}),re._context.staticPlot&&(He.remove(),et.remove())}function _(ee,re,ue,_e){var Te=w(ue),Ie=S(Te);v(Ie);var De=M(Ie);g(De);var He=b(Ie),et=y(He);u(et),f(et,re,_e,ee),$(Ie)}function w(ee){var re=ee.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return re.enter().append("g").classed(d.cn.columnCells,!0),re.exit().remove(),re}function S(ee){var re=ee.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(ue){return ue.keyWithinBlock});return re.enter().append("g").classed(d.cn.columnCell,!0),re.exit().remove(),re}function M(ee){var re=ee.selectAll("."+d.cn.cellRect).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("rect").classed(d.cn.cellRect,!0),re}function y(ee){var re=ee.selectAll("."+d.cn.cellText).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),re}function b(ee){var re=ee.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),re}function v(ee){ee.each(function(re,ue){var _e=re.calcdata.cells.font,Te=re.column.specIndex,Ie={size:F(_e.size,Te,ue),color:F(_e.color,Te,ue),family:F(_e.family,Te,ue),weight:F(_e.weight,Te,ue),style:F(_e.style,Te,ue),variant:F(_e.variant,Te,ue),textcase:F(_e.textcase,Te,ue),lineposition:F(_e.lineposition,Te,ue),shadow:F(_e.shadow,Te,ue)};re.rowNumber=re.key,re.align=F(re.calcdata.cells.align,Te,ue),re.cellBorderWidth=F(re.calcdata.cells.line.width,Te,ue),re.font=Ie})}function u(ee){ee.each(function(re){t.font(x.select(this),re.font)})}function g(ee){ee.attr("width",function(re){return re.column.columnWidth}).attr("stroke-width",function(re){return re.cellBorderWidth}).each(function(re){var ue=x.select(this);h.stroke(ue,F(re.calcdata.cells.line.color,re.column.specIndex,re.rowNumber)),h.fill(ue,F(re.calcdata.cells.fill.color,re.column.specIndex,re.rowNumber))})}function f(ee,re,ue,_e){ee.text(function(Te){var Ie=Te.column.specIndex,De=Te.rowNumber,He=Te.value,et=typeof He=="string",rt=et&&He.match(/
/i),$e=!et||rt;Te.mayHaveMarkup=et&&He.match(/[<&>]/);var ot=P(He);Te.latex=ot;var Ae=ot?"":F(Te.calcdata.cells.prefix,Ie,De)||"",ge=ot?"":F(Te.calcdata.cells.suffix,Ie,De)||"",ce=ot?null:F(Te.calcdata.cells.format,Ie,De)||null,ze=Ae+(ce?E(ce)(Te.value):Te.value)+ge,Qe;Te.wrappingNeeded=!Te.wrapped&&!$e&&!ot&&(Qe=L(ze)),Te.cellHeightMayIncrease=rt||ot||Te.mayHaveMarkup||(Qe===void 0?L(ze):Qe),Te.needsConvertToTspans=Te.mayHaveMarkup||Te.wrappingNeeded||Te.latex;var nt;if(Te.wrappingNeeded){var Ke=d.wrapSplitCharacter===" "?ze.replace(/Te&&_e.push(Ie),Te+=et}return _e}function W(ee,re,ue){var _e=T(re)[0];if(_e!==void 0){var Te=_e.rowBlocks,Ie=_e.calcdata,De=J(Te,Te.length),He=_e.calcdata.groupHeight-N(_e),et=Ie.scrollY=Math.max(0,Math.min(De-He,Ie.scrollY)),rt=U(Te,et,He);rt.length===1&&(rt[0]===Te.length-1?rt.unshift(rt[0]-1):rt.push(rt[0]+1)),rt[0]%2&&rt.reverse(),re.each(function($e,ot){$e.page=rt[ot],$e.scrollY=et}),re.attr("transform",function($e){var ot=J($e.rowBlocks,$e.page)-$e.scrollY;return a(0,ot)}),ee&&(le(ee,ue,re,rt,_e.prevPages,_e,0),le(ee,ue,re,rt,_e.prevPages,_e,1),l(ue,ee))}}function Q(ee,re,ue,_e){return function(Ie){var De=Ie.calcdata?Ie.calcdata:Ie,He=re.filter(function(ot){return De.key===ot.key}),et=ue||De.scrollbarState.dragMultiplier,rt=De.scrollY;De.scrollY=_e===void 0?De.scrollY+et*x.event.dy:_e;var $e=He.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return W(ee,$e,He),De.scrollY===rt}}function le(ee,re,ue,_e,Te,Ie,De){var He=_e[De]!==Te[De];He&&(clearTimeout(Ie.currentRepaint[De]),Ie.currentRepaint[De]=setTimeout(function(){var et=ue.filter(function(rt,$e){return $e===De&&_e[$e]!==Te[$e]});_(ee,re,et,ue),Te[De]=_e[De]}))}function se(ee,re,ue,_e){return function(){var Ie=x.select(re.parentNode);Ie.each(function(De){var He=De.fragments;Ie.selectAll("tspan.line").each(function(ze,Qe){He[Qe].width=this.getComputedTextLength()});var et=He[He.length-1].width,rt=He.slice(0,-1),$e=[],ot,Ae,ge=0,ce=De.column.columnWidth-2*d.cellPad;for(De.value="";rt.length;)ot=rt.shift(),Ae=ot.width+et,ge+Ae>ce&&(De.value+=$e.join(d.wrapSpacer)+d.lineBreaker,$e=[],ge=0),$e.push(ot.text),ge+=Ae;ge&&(De.value+=$e.join(d.wrapSpacer)),De.wrapped=!0}),Ie.selectAll("tspan.line").remove(),f(Ie.select("."+d.cn.cellText),ue,ee,_e),x.select(re.parentNode.parentNode).call($)}}function he(ee,re,ue,_e,Te){return function(){if(!Te.settledY){var De=x.select(re.parentNode),He=ne(Te),et=Te.key-He.firstRowIndex,rt=He.rows[et].rowHeight,$e=Te.cellHeightMayIncrease?re.parentNode.getBoundingClientRect().height+2*d.cellPad:rt,ot=Math.max($e,rt),Ae=ot-He.rows[et].rowHeight;Ae&&(He.rows[et].rowHeight=ot,ee.selectAll("."+d.cn.columnCell).call($),W(null,ee.filter(O),0),l(ue,_e,!0)),De.attr("transform",function(){var ge=this,ce=ge.parentNode,ze=ce.getBoundingClientRect(),Qe=x.select(ge.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),nt=ge.transform.baseVal.consolidate(),Ke=Qe.top-ze.top+(nt?nt.matrix.f:d.cellPad);return a(q(Te,x.select(ge.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Ke)}),Te.settledY=!0}}}function q(ee,re){switch(ee.align){case"left":return d.cellPad;case"right":return ee.column.columnWidth-(re||0)-d.cellPad;case"center":return(ee.column.columnWidth-(re||0))/2;default:return d.cellPad}}function $(ee){ee.attr("transform",function(re){var ue=re.rowBlocks[0].auxiliaryBlocks.reduce(function(De,He){return De+X(He,1/0)},0),_e=ne(re),Te=X(_e,re.key),Ie=Te+ue;return a(0,Ie)}).selectAll("."+d.cn.cellRect).attr("height",function(re){return j(ne(re),re.key).rowHeight})}function J(ee,re){for(var ue=0,_e=re-1;_e>=0;_e--)ue+=oe(ee[_e]);return ue}function X(ee,re){for(var ue=0,_e=0;_eE.length&&(A=A.slice(0,E.length)):A=[],t=0;t90&&(m-=180,i=-i),{angle:m,flip:i,p:x.c2p(e,A,E),offsetMultplier:n}}}}),C4=We({"src/traces/carpet/plot.js"(Z,V){"use strict";var d=Hi(),x=Oo(),A=WT(),E=XT(),e=k4(),t=zl(),r=aa(),o=r.strRotate,a=r.strTranslate,i=gf();V.exports=function(_,w,S,M){var y=_._context.staticPlot,b=w.xaxis,v=w.yaxis,u=_._fullLayout,g=u._clips;r.makeTraceGroups(M,S,"trace").each(function(f){var P=d.select(this),L=f[0],z=L.trace,F=z.aaxis,B=z.baxis,O=r.ensureSingle(P,"g","minorlayer"),I=r.ensureSingle(P,"g","majorlayer"),N=r.ensureSingle(P,"g","boundarylayer"),U=r.ensureSingle(P,"g","labellayer");P.style("opacity",z.opacity),s(b,v,I,F,"a",F._gridlines,!0,y),s(b,v,I,B,"b",B._gridlines,!0,y),s(b,v,O,F,"a",F._minorgridlines,!0,y),s(b,v,O,B,"b",B._minorgridlines,!0,y),s(b,v,N,F,"a-boundary",F._boundarylines,y),s(b,v,N,B,"b-boundary",B._boundarylines,y);var W=h(_,b,v,z,L,U,F._labels,"a-label"),Q=h(_,b,v,z,L,U,B._labels,"b-label");c(_,U,z,L,b,v,W,Q),n(z,L,g,b,v)})};function n(l,_,w,S,M){var y,b,v,u,g=w.select("#"+l._clipPathId);g.size()||(g=w.append("clipPath").classed("carpetclip",!0));var f=r.ensureSingle(g,"path","carpetboundary"),P=_.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,P.font).text(P.text).call(t.convertToTspans,l),I=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(P.axis.labelpadding*B,I.height*.3)),g=Math.max(g,I.width+P.axis.labelpadding)}),u.exit().remove(),f.maxExtent=g,f}function c(l,_,w,S,M,y,b,v){var u,g,f,P,L=r.aggNums(Math.min,null,w.a),z=r.aggNums(Math.max,null,w.a),F=r.aggNums(Math.min,null,w.b),B=r.aggNums(Math.max,null,w.b);u=.5*(L+z),g=F,f=w.ab2xy(u,g,!0),P=w.dxyda_rough(u,g),b.angle===void 0&&r.extendFlat(b,e(w,M,y,f,w.dxydb_rough(u,g))),T(l,_,w,S,f,P,w.aaxis,M,y,b,"a-title"),u=L,g=.5*(F+B),f=w.ab2xy(u,g,!0),P=w.dxydb_rough(u,g),v.angle===void 0&&r.extendFlat(v,e(w,M,y,f,w.dxyda_rough(u,g))),T(l,_,w,S,f,P,w.baxis,M,y,v,"b-title")}var m=i.LINE_SPACING,p=(1-i.MID_SHIFT)/m+1;function T(l,_,w,S,M,y,b,v,u,g,f){var P=[];b.title.text&&P.push(b.title.text);var L=_.selectAll("text."+f).data(P),z=g.maxExtent;L.enter().append("text").classed(f,!0),L.each(function(){var F=e(w,v,u,M,y);["start","both"].indexOf(b.showticklabels)===-1&&(z=0);var B=b.title.font.size;z+=B+b.title.offset;var O=g.angle+(g.flip<0?180:0),I=(O-F.angle+450)%360,N=I>90&&I<270,U=d.select(this);U.text(b.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+p)*m*B-z),U.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,b.title.font)}),L.exit().remove()}}}),L4=We({"src/traces/carpet/cheater_basis.js"(Z,V){"use strict";var d=aa().isArrayOrTypedArray;V.exports=function(x,A,E){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,h=d(A)?A.length:A,c=d(x)?x:null,m=d(A)?A:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),m&&(o=(m.length-1)/(m[m.length-1]-m[0])/(h-1));var p,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,o=0;o0&&(X=E.dxydi([],W-1,le,0,se),ee.push(he[0]+X[0]/3),re.push(he[1]+X[1]/3),oe=E.dxydi([],W-1,le,1,se),ee.push(J[0]-oe[0]/3),re.push(J[1]-oe[1]/3)),ee.push(J[0]),re.push(J[1]),he=J;else for(W=E.a2i(U),q=Math.floor(Math.max(0,Math.min(F-2,W))),$=W-q,ue.length=F,ue.crossLength=B,ue.xy=function(_e){return E.evalxy([],W,_e)},ue.dxy=function(_e,Te){return E.dxydj([],q,_e,$,Te)},Q=0;Q0&&(ne=E.dxydj([],q,Q-1,$,0),ee.push(he[0]+ne[0]/3),re.push(he[1]+ne[1]/3),j=E.dxydj([],q,Q-1,$,1),ee.push(J[0]-j[0]/3),re.push(J[1]-j[1]/3)),ee.push(J[0]),re.push(J[1]),he=J;return ue.axisLetter=e,ue.axis=M,ue.crossAxis=g,ue.value=U,ue.constvar=t,ue.index=c,ue.x=ee,ue.y=re,ue.smoothing=g.smoothing,ue}function N(U){var W,Q,le,se,he,q=[],$=[],J={};if(J.length=S.length,J.crossLength=u.length,e==="b")for(le=Math.max(0,Math.min(B-2,U)),he=Math.min(1,Math.max(0,U-le)),J.xy=function(X){return E.evalxy([],X,U)},J.dxy=function(X,oe){return E.dxydi([],X,le,oe,he)},W=0;WS.length-1)&&y.push(x(N(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s;cS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],_=S[T],r=0;rS[S.length-1])&&b.push(x(I(p),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&v.push(x(N(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(N(S.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((S[S.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((S[0]-M.tick0)/M.dtick/(1+i))].sort(function(U,W){return U-W}),s=n[0],h=n[1],c=s;c<=h;c++)m=M.tick0+M.dtick*c,y.push(x(I(m),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s-1;cS[S.length-1])&&b.push(x(I(p),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&v.push(x(I(S[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(I(S[S.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),R4=We({"src/traces/carpet/calc_labels.js"(Z,V){"use strict";var d=Mo(),x=Fo().extendFlat;V.exports=function(E,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[h][t],o[s-t]=A[h][t];for(a.push({x:r,y:o,bicubic:i}),t=h,r=[],o=[];t>=0;t--)r[h-t]=x[t][0],o[h-t]=A[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),z4=We({"src/traces/carpet/smooth_fill_2d_array.js"(Z,V){"use strict";var d=aa();V.exports=function(A,E,e){var t,r,o,a=[],i=[],n=A[0].length,s=A.length;function h(Q,le){var se=0,he,q=0;return Q>0&&(he=A[le][Q-1])!==void 0&&(q++,se+=he),Q0&&(he=A[le-1][Q])!==void 0&&(q++,se+=he),le0&&r0&&tu);return d.log("Smoother converged to",g,"after",P,"iterations"),A}}}),F4=We({"src/traces/carpet/constants.js"(Z,V){"use strict";V.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),O4=We({"src/traces/carpet/catmull_rom.js"(Z,V){"use strict";var d=.5;V.exports=function(A,E,e,t){var r=A[0]-E[0],o=A[1]-E[1],a=e[0]-E[0],i=e[1]-E[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),h=(s*s*r-n*n*a)*t,c=(s*s*o-n*n*i)*t,m=s*(n+s)*3,p=n*(n+s)*3;return[[E[0]+(m&&h/m),E[1]+(m&&c/m)],[E[0]-(p&&h/p),E[1]-(p&&c/p)]]}}}),B4=We({"src/traces/carpet/compute_control_points.js"(Z,V){"use strict";var d=O4(),x=aa().ensureArray;function A(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}V.exports=function(e,t,r,o,a,i){var n,s,h,c,m,p,T,l,_,w,S=r[0].length,M=r.length,y=a?3*S-2:S,b=i?3*M-2:M;for(e=x(e,b),t=x(t,b),h=0;hm&&yT&&bp||bl},o.setScale=function(){var y=o._x,b=o._y,v=A(o._xctrl,o._yctrl,y,b,h.smoothing,c.smoothing);o._xctrl=v[0],o._yctrl=v[1],o.evalxy=E([o._xctrl,o._yctrl],n,s,h.smoothing,c.smoothing),o.dxydi=e([o._xctrl,o._yctrl],h.smoothing,c.smoothing),o.dxydj=t([o._xctrl,o._yctrl],h.smoothing,c.smoothing)},o.i2a=function(y){var b=Math.max(0,Math.floor(y[0]),n-2),v=y[0]-b;return(1-v)*a[b]+v*a[b+1]},o.j2b=function(y){var b=Math.max(0,Math.floor(y[1]),n-2),v=y[1]-b;return(1-v)*i[b]+v*i[b+1]},o.ij2ab=function(y){return[o.i2a(y[0]),o.j2b(y[1])]},o.a2i=function(y){var b=Math.max(0,Math.min(x(y,a),n-2)),v=a[b],u=a[b+1];return Math.max(0,Math.min(n-1,b+(y-v)/(u-v)))},o.b2j=function(y){var b=Math.max(0,Math.min(x(y,i),s-2)),v=i[b],u=i[b+1];return Math.max(0,Math.min(s-1,b+(y-v)/(u-v)))},o.ab2ij=function(y){return[o.a2i(y[0]),o.b2j(y[1])]},o.i2c=function(y,b){return o.evalxy([],y,b)},o.ab2xy=function(y,b,v){if(!v&&(ya[n-1]|bi[s-1]))return[!1,!1];var u=o.a2i(y),g=o.b2j(b),f=o.evalxy([],u,g);if(v){var P=0,L=0,z=[],F,B,O,I;ya[n-1]?(F=n-2,B=1,P=(y-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),B=u-F),bi[s-1]?(O=s-2,I=1,L=(b-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(g))),I=g-O),P&&(o.dxydi(z,F,O,B,I),f[0]+=z[0]*P,f[1]+=z[1]*P),L&&(o.dxydj(z,F,O,B,I),f[0]+=z[0]*L,f[1]+=z[1]*L)}return f},o.c2p=function(y,b,v){return[b.c2p(y[0]),v.c2p(y[1])]},o.p2x=function(y,b,v){return[b.p2c(y[0]),v.p2c(y[1])]},o.dadi=function(y){var b=Math.max(0,Math.min(a.length-2,y));return a[b+1]-a[b]},o.dbdj=function(y){var b=Math.max(0,Math.min(i.length-2,y));return i[b+1]-i[b]},o.dxyda=function(y,b,v,u){var g=o.dxydi(null,y,b,v,u),f=o.dadi(y,v);return[g[0]/f,g[1]/f]},o.dxydb=function(y,b,v,u){var g=o.dxydj(null,y,b,v,u),f=o.dbdj(b,u);return[g[0]/f,g[1]/f]},o.dxyda_rough=function(y,b,v){var u=_*(v||.1),g=o.ab2xy(y+u,b,!0),f=o.ab2xy(y-u,b,!0);return[(g[0]-f[0])*.5/u,(g[1]-f[1])*.5/u]},o.dxydb_rough=function(y,b,v){var u=w*(v||.1),g=o.ab2xy(y,b+u,!0),f=o.ab2xy(y,b-u,!0);return[(g[0]-f[0])*.5/u,(g[1]-f[1])*.5/u]},o.dpdx=function(y){return y._m},o.dpdy=function(y){return y._m}}}}),q4=We({"src/traces/carpet/calc.js"(Z,V){"use strict";var d=Mo(),x=aa().isArray1D,A=L4(),E=P4(),e=I4(),t=R4(),r=D4(),o=m1(),a=z4(),i=p1(),n=V4();V.exports=function(h,c){var m=d.getFromId(h,c.xaxis),p=d.getFromId(h,c.yaxis),T=c.aaxis,l=c.baxis,_=c.x,w=c.y,S=[];_&&x(_)&&S.push("x"),w&&x(w)&&S.push("y"),S.length&&i(c,T,l,"a","b",S);var M=c._a=c._a||c.a,y=c._b=c._b||c.b;_=c._x||c.x,w=c._y||c.y;var b={};if(c._cheater){var v=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?y.length:y;_=A(v,u,c.cheaterslope)}c._x=_=o(_),c._y=w=o(w),a(_,M,y),a(w,M,y),n(c),c.setScale();var g=E(_),f=E(w),P=.5*(g[1]-g[0]),L=.5*(g[1]+g[0]),z=.5*(f[1]-f[0]),F=.5*(f[1]+f[0]),B=1.3;return g=[L-P*B,L+P*B],f=[F-z*B,F+z*B],c._extremes[m._id]=d.findExtremes(m,g,{padded:!0}),c._extremes[p._id]=d.findExtremes(p,f,{padded:!0}),e(c,"a","b"),e(c,"b","a"),t(c,T),t(c,l),b.clipsegments=r(c._xctrl,c._yctrl,T,l),b.x=_,b.y=w,b.a=M,b.b=y,[b]}}}),G4=We({"src/traces/carpet/index.js"(Z,V){"use strict";V.exports={attributes:$_(),supplyDefaults:E4(),plot:C4(),calc:q4(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Yc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),H4=We({"lib/carpet.js"(Z,V){"use strict";V.exports=G4()}}),ZT=We({"src/traces/scattercarpet/attributes.js"(Z,V){"use strict";var d=uv(),x=vc(),A=El(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=wl(),r=Zl(),o=Fo().extendFlat,a=x.marker,i=x.line,n=a.line;V.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},x.mode,{dflt:"markers"}),text:o({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},x.hovertext,{}),line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:o({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:o({symbol:a.symbol,opacity:a.opacity,maxdisplayed:a.maxdisplayed,angle:a.angle,angleref:a.angleref,standoff:a.standoff,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,editType:"calc"},r("marker.line")),gradient:a.gradient,editType:"calc"},r("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:o({},A.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:x.zorder}}}),W4=We({"src/traces/scattercarpet/defaults.js"(Z,V){"use strict";var d=aa(),x=Ev(),A=au(),E=Oh(),e=Gh(),t=R0(),r=Hh(),o=fv(),a=ZT();V.exports=function(n,s,h,c){function m(M,y){return d.coerce(n,s,a,M,y)}m("carpet"),s.xaxis="x",s.yaxis="y";var p=m("a"),T=m("b"),l=Math.min(p.length,T.length);if(!l){s.visible=!1;return}s._length=l,m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext");var _=l0?b=M.labelprefix.replace(/ = $/,""):b=M._hovertitle,l.push(b+": "+y.toFixed(3)+M.labelsuffix)}if(!m.hovertemplate){var w=c.hi||m.hoverinfo,S=w.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&_(p.aaxis,c.a),S.indexOf("b")!==-1&&_(p.baxis,c.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(c,m,l),a.extraText=l.join("
")}return o}}}),J4=We({"src/traces/scattercarpet/event_data.js"(Z,V){"use strict";V.exports=function(x,A,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),$4=We({"src/traces/scattercarpet/index.js"(Z,V){"use strict";V.exports={attributes:ZT(),supplyDefaults:W4(),colorbar:Yf(),formatLabels:X4(),calc:Z4(),plot:Y4(),style:Ah().style,styleOnSelect:Ah().styleOnSelect,hoverPoints:K4(),selectPoints:O0(),eventData:J4(),moduleType:"trace",name:"scattercarpet",basePlotModule:Yc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Q4=We({"lib/scattercarpet.js"(Z,V){"use strict";V.exports=$4()}}),YT=We({"src/traces/contourcarpet/attributes.js"(Z,V){"use strict";var d=U0(),x=Jm(),A=Zl(),E=Fo().extendFlat,e=x.contours;V.exports=E({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},A("",{cLetter:"z",autoColorDflt:!1}))}}),KT=We({"src/traces/contourcarpet/defaults.js"(Z,V){"use strict";var d=aa(),x=d1(),A=YT(),E=bw(),e=k1(),t=C1();V.exports=function(o,a,i,n){function s(p,T){return d.coerce(o,a,A,p,T)}function h(p){return d.coerce2(o,a,A,p)}if(s("carpet"),o.a&&o.b){var c=x(o,a,s,n,"a","b");if(!c){a.visible=!1;return}s("text");var m=s("contours.type")==="constraint";m?E(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,h),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),eR=We({"src/traces/contourcarpet/calc.js"(Z,V){"use strict";var d=nh(),x=aa(),A=p1(),E=m1(),e=g1(),t=y1(),r=iw(),o=KT(),a=Q_(),i=hw();V.exports=function(h,c){var m=c._carpetTrace=a(h,c);if(!(!m||!m.visible||m.visible==="legendonly")){if(!c.a||!c.b){var p=h.data[m.index],T=h.data[c.index];T.a||(T.a=p.a),T.b||(T.b=p.b),o(T,c,c._defaultColor,h._fullLayout)}var l=n(h,c);return i(c,c._z),l}};function n(s,h){var c=h._carpetTrace,m=c.aaxis,p=c.baxis,T,l,_,w,S,M,y;m._minDtick=0,p._minDtick=0,x.isArray1D(h.z)&&A(h,m,p,"a","b",["z"]),T=h._a=h._a||h.a,w=h._b=h._b||h.b,T=T?m.makeCalcdata(h,"_a"):[],w=w?p.makeCalcdata(h,"_b"):[],l=h.a0||0,_=h.da||1,S=h.b0||0,M=h.db||1,y=h._z=E(h._z||h.z,h.transpose),h._emptypoints=t(y),e(y,h._emptypoints);var b=x.maxRowLength(y),v=h.xtype==="scaled"?"":T,u=r(h,v,l,_,b,m),g=h.ytype==="scaled"?"":w,f=r(h,g,S,M,y.length,p),P={a:u,b:f,z:y};return h.contours.type==="levels"&&h.contours.coloring!=="none"&&d(s,h,{vals:y,containerStr:"",cLetter:"z"}),[P]}}}),tR=We({"src/traces/carpet/axis_aligned_line.js"(Z,V){"use strict";var d=aa().isArrayOrTypedArray;V.exports=function(x,A,E,e){var t,r,o,a,i,n,s,h,c,m,p,T,l,_=d(E)?"a":"b",w=_==="a"?x.aaxis:x.baxis,S=w.smoothing,M=_==="a"?x.a2i:x.b2j,y=_==="a"?E:e,b=_==="a"?e:E,v=_==="a"?A.a.length:A.b.length,u=_==="a"?A.b.length:A.a.length,g=Math.floor(_==="a"?x.b2j(b):x.a2i(b)),f=_==="a"?function(le){return x.evalxy([],le,g)}:function(le){return x.evalxy([],g,le)};S&&(o=Math.max(0,Math.min(u-2,g)),a=g-o,r=_==="a"?function(le,se){return x.dxydi([],le,o,se,a)}:function(le,se){return x.dxydj([],o,le,a,se)});var P=M(y[0]),L=M(y[1]),z=P0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,I=z>0?Math.min:Math.max,N=z>0?Math.max:Math.min,U=B(P+F),W=O(L-F);s=f(P);var Q=[[s]];for(t=U;t*z=0;ue--)j=N.clipsegments[ue],ee=x([],j.x,P.c2p),re=x([],j.y,L.c2p),ee.reverse(),re.reverse(),_e.push(A(ee,re,j.bicubic));var Te="M"+_e.join("L")+"Z";S(F,N.clipsegments,P,L,se,q),M(O,F,P,L,ne,J,$,I,N,q,Te),p(F,le,v,B,Q,u,I),E.setClipUrl(F,I._clipPathId,v)})};function m(b,v){var u,g,f,P,L,z,F,B,O;for(u=0;ule&&(g.max=le),g.len=g.max-g.min}function l(b,v,u){var g=b.getPointAtLength(v),f=b.getPointAtLength(u),P=f.x-g.x,L=f.y-g.y,z=Math.sqrt(P*P+L*L);return[P/z,L/z]}function _(b){var v=Math.sqrt(b[0]*b[0]+b[1]*b[1]);return[b[0]/v,b[1]/v]}function w(b,v){var u=Math.abs(b[0]*v[0]+b[1]*v[1]),g=Math.sqrt(1-u*u);return g/u}function S(b,v,u,g,f,P){var L,z,F,B,O=e.ensureSingle(b,"g","contourbg"),I=O.selectAll("path").data(P==="fill"&&!f?[0]:[]);I.enter().append("path"),I.exit().remove();var N=[];for(B=0;B=0&&(U=ee,Q=le):Math.abs(N[1]-U[1])=0&&(U=ee,Q=le):e.log("endpt to newendpt is not vert. or horz.",N,U,ee)}if(Q>=0)break;B+=ne(N,U),N=U}if(Q===v.edgepaths.length){e.log("unclosed perimeter path");break}F=Q,I=O.indexOf(F)===-1,I&&(F=O[0],B+=ne(N,U)+"Z",N=null)}for(F=0;Fy):M=z>f,y=z;var F=m(f,P,L,z);F.pos=g,F.yc=(f+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,P],b&&(F.orig_p=s[u]),w&&(F.tx=n.text[u]),S&&(F.htx=n.hovertext[u]),v.push(F)}else v.push({pos:g,empty:!0})}return n._extremes[c._id]=A.findExtremes(c,d.concat(l,T),{padded:!0}),v.length&&(v[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),v}function a(i,n,s){var h=s._minDiff;if(!h){var c=i._fullData,m=[];h=1/0;var p;for(p=0;p"+_.labels[g]+d.hoverLabelText(T,f,l.yhoverformat)):(L=x.extendFlat({},S),L.y0=L.y1=P,L.yLabelVal=f,L.yLabel=_.labels[g]+d.hoverLabelText(T,f,l.yhoverformat),L.name="",w.push(L),v[f]=L)}return w}function n(s,h,c,m){var p=s.cd,T=s.ya,l=p[0].trace,_=p[0].t,w=a(s,h,c,m);if(!w)return[];var S=w.index,M=p[S],y=w.index=M.i,b=M.dir;function v(F){return _.labels[F]+d.hoverLabelText(T,l[F][y],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",g=u.split("+"),f=u==="all",P=f||g.indexOf("y")!==-1,L=f||g.indexOf("text")!==-1,z=P?[v("open"),v("high"),v("low"),v("close")+" "+r[b]]:[];return L&&e(M,l,z),w.extraText=z.join("
"),w.y0=w.y1=T.c2p(M.yc,!0),[w]}V.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),e5=We({"src/traces/ohlc/select.js"(Z,V){"use strict";V.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=E[0].t.bPos||0;if(A===!1)for(o=0;oh?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var _=a.c2l(l)-s;return(T(_)?_:0)+p},a.g2c=function(l){return a.l2c(l+s-p)},a.g2p=function(l){return l*m},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?A(a):a}function r(a,i){return i==="degrees"?E(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,h=a.c2d;a.d2c=function(c,m){return t(s(c),m)},a.c2d=function(c,m){return h(r(c,m))}}a.makeCalcdata=function(c,m){var p=c[m],T=c._length,l,_,w=function(v){return a.d2c(v,c.thetaunit)};if(p)for(l=new Array(T),_=0;_0?v:1/0},M=A(w,S),y=d.mod(M+1,w.length);return[w[M],w[y]]}function m(_){return Math.abs(_)>1e-10?_:0}function p(_,w,S){w=w||0,S=S||0;for(var M=_.length,y=new Array(M),b=0;b0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function A(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,a,i){var n=A(r,x([a,o])),s=n[0],h=n[1],c=A(r,x([i,o])),m=c[0],p=c[1];if(o===0)return["M"+s+","+h,"L"+m+","+p].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+h,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+m+","+p].join(" ")}function t(r,o,a,i){var n=E(r,1/(o+1)),s=A(r,x([o,a])),h=s[0],c=s[1],m=A(r,x([o,i])),p=m[0],T=m[1];if(d(a)!==d(i)){var l=A(r,x([o,0])),_=l[0],w=l[1];return["M"+h+","+c,"A"+n+","+n+" 0 0,"+(0et?(rt=re,$e=re*et,ge=(ue-$e)/X.h/2,ot=[j[0],j[1]],Ae=[ee[0]+ge,ee[1]-ge]):(rt=ue/et,$e=ue,ge=(re-rt)/X.w/2,ot=[j[0]+ge,j[1]-ge],Ae=[ee[0],ee[1]]),$.xLength2=rt,$.yLength2=$e,$.xDomain2=ot,$.yDomain2=Ae;var ce=$.xOffset2=X.l+X.w*ot[0],ze=$.yOffset2=X.t+X.h*(1-Ae[1]),Qe=$.radius=rt/Ie,nt=$.innerRadius=$.getHole(q)*Qe,Ke=$.cx=ce-Qe*Te[0],kt=$.cy=ze+Qe*Te[3],Et=$.cxx=Ke-ce,Bt=$.cyy=kt-ze,jt=oe.side,_r;jt==="counterclockwise"?(_r=jt,jt="top"):jt==="clockwise"&&(_r=jt,jt="bottom"),$.radialAxis=$.mockAxis(he,q,oe,{_id:"x",side:jt,_trueSide:_r,domain:[nt/X.w,Qe/X.w]}),$.angularAxis=$.mockAxis(he,q,ne,{side:"right",domain:[0,Math.PI],autorange:!1}),$.doAutoRange(he,q),$.updateAngularAxis(he,q),$.updateRadialAxis(he,q),$.updateRadialAxisTitle(he,q),$.xaxis=$.mockCartesianAxis(he,q,{_id:"x",domain:ot}),$.yaxis=$.mockCartesianAxis(he,q,{_id:"y",domain:Ae});var pr=$.pathSubplot();$.clipPaths.forTraces.select("path").attr("d",pr).attr("transform",t(Et,Bt)),J.frontplot.attr("transform",t(ce,ze)).call(o.setClipUrl,$._hasClipOnAxisFalse?null:$.clipIds.forTraces,$.gd),J.bg.attr("d",pr).attr("transform",t(Ke,kt)).call(r.fill,q.bgcolor)},U.mockAxis=function(he,q,$,J){var X=E.extendFlat({},$,J);return s(X,q,he),X},U.mockCartesianAxis=function(he,q,$){var J=this,X=J.isSmith,oe=$._id,ne=E.extendFlat({type:"linear"},$);n(ne,he);var j={x:[0,2],y:[1,3]};return ne.setRange=function(){var ee=J.sectorBBox,re=j[oe],ue=J.radialAxis._rl,_e=(ue[1]-ue[0])/(1-J.getHole(q));ne.range=[ee[re[0]]*_e,ee[re[1]]*_e]},ne.isPtWithinRange=oe==="x"&&!X?function(ee){return J.isPtInside(ee)}:function(){return!0},ne.setRange(),ne.setScale(),ne},U.doAutoRange=function(he,q){var $=this,J=$.gd,X=$.radialAxis,oe=$.getRadial(q);h(J,X);var ne=X.range;if(oe.range=ne.slice(),oe._input.range=ne.slice(),X._rl=[X.r2l(ne[0],null,"gregorian"),X.r2l(ne[1],null,"gregorian")],X.minallowed!==void 0){var j=X.r2l(X.minallowed);X._rl[0]>X._rl[1]?X._rl[1]=Math.max(X._rl[1],j):X._rl[0]=Math.max(X._rl[0],j)}if(X.maxallowed!==void 0){var ee=X.r2l(X.maxallowed);X._rl[0]90&&ue<=270&&(_e.tickangle=180);var De=Ie?function(Qe){var nt=z($,f([Qe.x,0]));return t(nt[0]-j,nt[1]-ee)}:function(Qe){return t(_e.l2p(Qe.x)+ne,0)},He=Ie?function(Qe){return L($,Qe.x,-1/0,1/0)}:function(Qe){return $.pathArc(_e.r2p(Qe.x)+ne)},et=W(re);if($.radialTickLayout!==et&&(X["radial-axis"].selectAll(".xtick").remove(),$.radialTickLayout=et),Te){_e.setScale();var rt=0,$e=Ie?(_e.tickvals||[]).filter(function(Qe){return Qe>=0}).map(function(Qe){return i.tickText(_e,Qe,!0,!1)}):i.calcTicks(_e),ot=Ie?$e:i.clipEnds(_e,$e),Ae=i.getTickSigns(_e)[2];Ie&&((_e.ticks==="top"&&_e.side==="bottom"||_e.ticks==="bottom"&&_e.side==="top")&&(Ae=-Ae),_e.ticks==="top"&&_e.side==="top"&&(rt=-_e.ticklen),_e.ticks==="bottom"&&_e.side==="bottom"&&(rt=_e.ticklen)),i.drawTicks(J,_e,{vals:$e,layer:X["radial-axis"],path:i.makeTickPath(_e,0,Ae),transFn:De,crisp:!1}),i.drawGrid(J,_e,{vals:ot,layer:X["radial-grid"],path:He,transFn:E.noop,crisp:!1}),i.drawLabels(J,_e,{vals:$e,layer:X["radial-axis"],transFn:De,labelFns:i.makeLabelFns(_e,rt)})}var ge=$.radialAxisAngle=$.vangles?I(le(O(re.angle),$.vangles)):re.angle,ce=t(j,ee),ze=ce+e(-ge);se(X["radial-axis"],Te&&(re.showticklabels||re.ticks),{transform:ze}),se(X["radial-grid"],Te&&re.showgrid,{transform:Ie?"":ce}),se(X["radial-line"].select("line"),Te&&re.showline,{x1:Ie?-oe:ne,y1:0,x2:oe,y2:0,transform:ze}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},U.updateRadialAxisTitle=function(he,q,$){if(!this.isSmith){var J=this,X=J.gd,oe=J.radius,ne=J.cx,j=J.cy,ee=J.getRadial(q),re=J.id+"title",ue=0;if(ee.title){var _e=o.bBox(J.layers["radial-axis"].node()).height,Te=ee.title.font.size,Ie=ee.side;ue=Ie==="top"?Te:Ie==="counterclockwise"?-(_e+Te*.4):_e+Te*.8}var De=$!==void 0?$:J.radialAxisAngle,He=O(De),et=Math.cos(He),rt=Math.sin(He),$e=ne+oe/2*et+ue*rt,ot=j-oe/2*rt+ue*et;J.layers["radial-axis-title"]=T.draw(X,re,{propContainer:ee,propName:J.id+".radialaxis.title.text",placeholder:F(X,"Click to enter radial axis title"),attributes:{x:$e,y:ot,"text-anchor":"middle"},transform:{rotate:-De}})}},U.updateAngularAxis=function(he,q){var $=this,J=$.gd,X=$.layers,oe=$.radius,ne=$.innerRadius,j=$.cx,ee=$.cy,re=$.getAngular(q),ue=$.angularAxis,_e=$.isSmith;_e||($.fillViewInitialKey("angularaxis.rotation",re.rotation),ue.setGeometry(),ue.setScale());var Te=_e?function(nt){var Ke=z($,f([0,nt.x]));return Math.atan2(Ke[0]-j,Ke[1]-ee)-Math.PI/2}:function(nt){return ue.t2g(nt.x)};ue.type==="linear"&&ue.thetaunit==="radians"&&(ue.tick0=I(ue.tick0),ue.dtick=I(ue.dtick));var Ie=function(nt){return t(j+oe*Math.cos(nt),ee-oe*Math.sin(nt))},De=_e?function(nt){var Ke=z($,f([0,nt.x]));return t(Ke[0],Ke[1])}:function(nt){return Ie(Te(nt))},He=_e?function(nt){var Ke=z($,f([0,nt.x])),kt=Math.atan2(Ke[0]-j,Ke[1]-ee)-Math.PI/2;return t(Ke[0],Ke[1])+e(-I(kt))}:function(nt){var Ke=Te(nt);return Ie(Ke)+e(-I(Ke))},et=_e?function(nt){return P($,nt.x,0,1/0)}:function(nt){var Ke=Te(nt),kt=Math.cos(Ke),Et=Math.sin(Ke);return"M"+[j+ne*kt,ee-ne*Et]+"L"+[j+oe*kt,ee-oe*Et]},rt=i.makeLabelFns(ue,0),$e=rt.labelStandoff,ot={};ot.xFn=function(nt){var Ke=Te(nt);return Math.cos(Ke)*$e},ot.yFn=function(nt){var Ke=Te(nt),kt=Math.sin(Ke)>0?.2:1;return-Math.sin(Ke)*($e+nt.fontSize*kt)+Math.abs(Math.cos(Ke))*(nt.fontSize*b)},ot.anchorFn=function(nt){var Ke=Te(nt),kt=Math.cos(Ke);return Math.abs(kt)<.1?"middle":kt>0?"start":"end"},ot.heightFn=function(nt,Ke,kt){var Et=Te(nt);return-.5*(1+Math.sin(Et))*kt};var Ae=W(re);$.angularTickLayout!==Ae&&(X["angular-axis"].selectAll("."+ue._id+"tick").remove(),$.angularTickLayout=Ae);var ge=_e?[1/0].concat(ue.tickvals||[]).map(function(nt){return i.tickText(ue,nt,!0,!1)}):i.calcTicks(ue);_e&&(ge[0].text="\u221E",ge[0].fontSize*=1.75);var ce;if(q.gridshape==="linear"?(ce=ge.map(Te),E.angleDelta(ce[0],ce[1])<0&&(ce=ce.slice().reverse())):ce=null,$.vangles=ce,ue.type==="category"&&(ge=ge.filter(function(nt){return E.isAngleInsideSector(Te(nt),$.sectorInRad)})),ue.visible){var ze=ue.ticks==="inside"?-1:1,Qe=(ue.linewidth||1)/2;i.drawTicks(J,ue,{vals:ge,layer:X["angular-axis"],path:"M"+ze*Qe+",0h"+ze*ue.ticklen,transFn:He,crisp:!1}),i.drawGrid(J,ue,{vals:ge,layer:X["angular-grid"],path:et,transFn:E.noop,crisp:!1}),i.drawLabels(J,ue,{vals:ge,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:De,labelFns:ot})}se(X["angular-line"].select("path"),re.showline,{d:$.pathSubplot(),transform:t(j,ee)}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},U.updateFx=function(he,q){if(!this.gd._context.staticPlot){var $=!this.isSmith;$&&(this.updateAngularDrag(he),this.updateRadialDrag(he,q,0),this.updateRadialDrag(he,q,1)),this.updateHoverAndMainDrag(he)}},U.updateHoverAndMainDrag=function(he){var q=this,$=q.isSmith,J=q.gd,X=q.layers,oe=he._zoomlayer,ne=v.MINZOOM,j=v.OFFEDGE,ee=q.radius,re=q.innerRadius,ue=q.cx,_e=q.cy,Te=q.cxx,Ie=q.cyy,De=q.sectorInRad,He=q.vangles,et=q.radialAxis,rt=u.clampTiny,$e=u.findXYatLength,ot=u.findEnclosingVertexAngles,Ae=v.cornerHalfWidth,ge=v.cornerLen/2,ce,ze,Qe=c.makeDragger(X,"path","maindrag",he.dragmode===!1?"none":"crosshair");d.select(Qe).attr("d",q.pathSubplot()).attr("transform",t(ue,_e)),Qe.onmousemove=function(Qt){p.hover(J,Qt,q.id),J._fullLayout._lasthover=Qe,J._fullLayout._hoversubplot=q.id},Qe.onmouseout=function(Qt){J._dragging||m.unhover(J,Qt)};var nt={element:Qe,gd:J,subplot:q.id,plotinfo:{id:q.id,xaxis:q.xaxis,yaxis:q.yaxis},xaxes:[q.xaxis],yaxes:[q.yaxis]},Ke,kt,Et,Bt,jt,_r,pr,Or,mr;function Er(Qt,Jt){return Math.sqrt(Qt*Qt+Jt*Jt)}function yt(Qt,Jt){return Er(Qt-Te,Jt-Ie)}function Oe(Qt,Jt){return Math.atan2(Ie-Jt,Qt-Te)}function Xe(Qt,Jt){return[Qt*Math.cos(Jt),Qt*Math.sin(-Jt)]}function be(Qt,Jt){if(Qt===0)return q.pathSector(2*Ae);var Sr=ge/Qt,oa=Jt-Sr,Ea=Jt+Sr,Sa=Math.max(0,Math.min(Qt,ee)),za=Sa-Ae,Na=Sa+Ae;return"M"+Xe(za,oa)+"A"+[za,za]+" 0,0,0 "+Xe(za,Ea)+"L"+Xe(Na,Ea)+"A"+[Na,Na]+" 0,0,1 "+Xe(Na,oa)+"Z"}function Ce(Qt,Jt,Sr){if(Qt===0)return q.pathSector(2*Ae);var oa=Xe(Qt,Jt),Ea=Xe(Qt,Sr),Sa=rt((oa[0]+Ea[0])/2),za=rt((oa[1]+Ea[1])/2),Na,Ta;if(Sa&&za){var nn=za/Sa,gn=-1/nn,Ht=$e(Ae,nn,Sa,za);Na=$e(ge,gn,Ht[0][0],Ht[0][1]),Ta=$e(ge,gn,Ht[1][0],Ht[1][1])}else{var It,Gt;za?(It=ge,Gt=Ae):(It=Ae,Gt=ge),Na=[[Sa-It,za-Gt],[Sa+It,za-Gt]],Ta=[[Sa-It,za+Gt],[Sa+It,za+Gt]]}return"M"+Na.join("L")+"L"+Ta.reverse().join("L")+"Z"}function Ne(){Et=null,Bt=null,jt=q.pathSubplot(),_r=!1;var Qt=J._fullLayout[q.id];pr=x(Qt.bgcolor).getLuminance(),Or=c.makeZoombox(oe,pr,ue,_e,jt),Or.attr("fill-rule","evenodd"),mr=c.makeCorners(oe,ue,_e),w(J)}function Ee(Qt,Jt){return Jt=Math.max(Math.min(Jt,ee),re),Qtne?(Qt-1&&Qt===1&&_(Jt,J,[q.xaxis],[q.yaxis],q.id,nt),Sr.indexOf("event")>-1&&p.click(J,Jt,q.id)}nt.prepFn=function(Qt,Jt,Sr){var oa=J._fullLayout.dragmode,Ea=Qe.getBoundingClientRect();J._fullLayout._calcInverseTransform(J);var Sa=J._fullLayout._invTransform;ce=J._fullLayout._invScaleX,ze=J._fullLayout._invScaleY;var za=E.apply3DTransform(Sa)(Jt-Ea.left,Sr-Ea.top);if(Ke=za[0],kt=za[1],He){var Na=u.findPolygonOffset(ee,De[0],De[1],He);Ke+=Te+Na[0],kt+=Ie+Na[1]}switch(oa){case"zoom":nt.clickFn=or,$||(He?nt.moveFn=dt:nt.moveFn=Le,nt.doneFn=gt,Ne(Qt,Jt,Sr));break;case"select":case"lasso":l(Qt,Jt,Sr,nt,oa);break}},m.init(nt)},U.updateRadialDrag=function(he,q,$){var J=this,X=J.gd,oe=J.layers,ne=J.radius,j=J.innerRadius,ee=J.cx,re=J.cy,ue=J.radialAxis,_e=v.radialDragBoxSize,Te=_e/2;if(!ue.visible)return;var Ie=O(J.radialAxisAngle),De=ue._rl,He=De[0],et=De[1],rt=De[$],$e=.75*(De[1]-De[0])/(1-J.getHole(q))/ne,ot,Ae,ge;$?(ot=ee+(ne+Te)*Math.cos(Ie),Ae=re-(ne+Te)*Math.sin(Ie),ge="radialdrag"):(ot=ee+(j-Te)*Math.cos(Ie),Ae=re-(j-Te)*Math.sin(Ie),ge="radialdrag-inner");var ce=c.makeRectDragger(oe,ge,"crosshair",-Te,-Te,_e,_e),ze={element:ce,gd:X};he.dragmode===!1&&(ze.dragmode=!1),se(d.select(ce),ue.visible&&j0!=($?Ke>He:Ke=90||X>90&&oe>=450?Ie=1:j<=0&&re<=0?Ie=0:Ie=Math.max(j,re),X<=180&&oe>=180||X>180&&oe>=540?ue=-1:ne>=0&&ee>=0?ue=0:ue=Math.min(ne,ee),X<=270&&oe>=270||X>270&&oe>=630?_e=-1:j>=0&&re>=0?_e=0:_e=Math.min(j,re),oe>=360?Te=1:ne<=0&&ee<=0?Te=0:Te=Math.max(ne,ee),[ue,_e,Te,Ie]}function le(he,q){var $=function(X){return E.angleDist(he,X)},J=E.findIndexOfMin(q,$);return q[J]}function se(he,q,$){return q?(he.attr("display",null),he.attr($)):he&&he.attr("display","none"),he}}}),i5=We({"src/plots/polar/layout_attributes.js"(Z,V){"use strict";var d=nf(),x=Of(),A=Uu().attributes,E=aa().extendFlat,e=Iu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,minorloglabels:x.minorloglabels,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var a={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(a,t,r),V.exports={domain:A({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),dR=We({"src/plots/polar/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=Fi(),A=sl(),E=Id(),e=Ff().getSubplotData,t=_p(),r=k0(),o=Md(),a=Ed(),i=Qy(),n=qm(),s=cb(),h=L0(),c=i5(),m=r5(),p=tx(),T=p.axisNames;function l(w,S,M,y){var b=M("bgcolor");y.bgColor=x.combine(b,y.paper_bgcolor);var v=M("sector");M("hole");var u=e(y.fullData,p.name,y.id),g=y.layoutOut,f;function P(_e,Te){return M(f+"."+_e,Te)}for(var L=0;L")}}V.exports={hoverPoints:x,makeHoverPointText:A}}}),gR=We({"src/traces/scatterpolar/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:ax(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Og(),supplyDefaults:nx().supplyDefaults,colorbar:Yf(),formatLabels:ix(),calc:pR(),plot:mR(),style:Ah().style,styleOnSelect:Ah().styleOnSelect,hoverPoints:ox().hoverPoints,selectPoints:O0(),meta:{}}}}),yR=We({"lib/scatterpolar.js"(Z,V){"use strict";V.exports=gR()}}),o5=We({"src/traces/scatterpolargl/attributes.js"(Z,V){"use strict";var d=Og(),{cliponaxis:x,hoveron:A}=d,E=Z5(d,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:a,fillcolor:i,marker:n,textfont:s,textposition:h}=kg();V.exports=x0(_d({},E),{connectgaps:e,fill:a,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:n,textfont:s,textposition:h})}}),_R=We({"src/traces/scatterpolargl/defaults.js"(Z,V){"use strict";var d=aa(),x=au(),A=nx().handleRThetaDefaults,E=Oh(),e=Gh(),t=Hh(),r=fv(),o=Ev().PTS_LINESONLY,a=o5();V.exports=function(n,s,h,c){function m(T,l){return d.coerce(n,s,a,T,l)}var p=A(n,s,c,m);if(!p){s.visible=!1;return}m("thetaunit"),m("mode",p=r&&(y.marker.cluster=_.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=g),y.line&&g.length>1&&t.extendFlat(y.line,e.linePositions(i,l,g)),y.text&&(t.extendFlat(y.text,{positions:g},e.textPosition(i,l,y.text,y.marker)),t.extendFlat(y.textSel,{positions:g},e.textPosition(i,l,y.text,y.markerSel)),t.extendFlat(y.textUnsel,{positions:g},e.textPosition(i,l,y.text,y.markerUnsel))),y.fill&&!m.fill2d&&(m.fill2d=!0),y.marker&&!m.scatter2d&&(m.scatter2d=!0),y.line&&!m.line2d&&(m.line2d=!0),y.text&&!m.glText&&(m.glText=!0),m.lineOptions.push(y.line),m.fillOptions.push(y.fill),m.markerOptions.push(y.marker),m.markerSelectedOptions.push(y.markerSel),m.markerUnselectedOptions.push(y.markerUnsel),m.textOptions.push(y.text),m.textSelectedOptions.push(y.textSel),m.textUnselectedOptions.push(y.textUnsel),m.selectBatch.push([]),m.unselectBatch.push([]),_.x=f,_.y=P,_.rawx=f,_.rawy=P,_.r=S,_.theta=M,_.positions=g,_._scene=m,_.index=m.count,m.count++}}),A(i,n,s)}},V.exports.reglPrecompiled=o}}),SR=We({"src/traces/scatterpolargl/index.js"(Z,V){"use strict";var d=TR();d.plot=AR(),V.exports=d}}),MR=We({"lib/scatterpolargl.js"(Z,V){"use strict";V.exports=SR()}}),s5=We({"src/traces/barpolar/attributes.js"(Z,V){"use strict";var{hovertemplateAttrs:d,templatefallbackAttrs:x}=wl(),A=Fo().extendFlat,E=Og(),e=Cv();V.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:A({},e.base,{}),offset:A({},e.offset,{}),width:A({},e.width,{}),text:A({},e.text,{}),hovertext:A({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:d(),hovertemplatefallback:x(),selected:e.selected,unselected:e.unselected};function t(){var r=A({},e.marker);return delete r.cornerradius,r}}}),l5=We({"src/traces/barpolar/layout_attributes.js"(Z,V){"use strict";V.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),ER=We({"src/traces/barpolar/defaults.js"(Z,V){"use strict";var d=aa(),x=nx().handleRThetaDefaults,A=l1(),E=s5();V.exports=function(t,r,o,a){function i(s,h){return d.coerce(t,r,E,s,h)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),A(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),kR=We({"src/traces/barpolar/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=l5();V.exports=function(A,E,e){var t={},r;function o(n,s){return d.coerce(A[r]||{},E[r],x,n,s)}for(var a=0;a0?(c=s,m=h):(c=h,m=s);var p=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(m,r.vangles)[1],l=[p,(c+m)/2,T];return e.pathPolygonAnnulus(i,n,c,m,l,o,a)}:function(i,n,s,h){return A.pathAnnulus(i,n,s,h,o,a)}}}}),LR=We({"src/traces/barpolar/hover.js"(Z,V){"use strict";var d=hc(),x=aa(),A=B0().getTraceColor,E=x.fillText,e=ox().makeHoverPointText,t=rx().isPtInsidePolygon;V.exports=function(o,a,i){var n=o.cd,s=n[0].trace,h=o.subplot,c=h.radialAxis,m=h.angularAxis,p=h.vangles,T=p?t:x.isPtInsideSector,l=o.maxHoverDistance,_=m._period||2*Math.PI,w=Math.abs(c.g2p(Math.sqrt(a*a+i*i))),S=Math.atan2(i,a);c.range[0]>c.range[1]&&(S+=Math.PI);var M=function(u){return T(w,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],p)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/_)-1+(u.rp1-w)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,M,o),o.index!==!1){var y=o.index,b=n[y];o.x0=o.x1=b.ct[0],o.y0=o.y1=b.ct[1];var v=x.extendFlat({},b,{r:b.s,theta:b.p});return E(b,s,o),e(v,s,h,o),o.hovertemplate=s.hovertemplate,o.color=A(s,b),o.xLabelVal=o.yLabelVal=void 0,b.s<0&&(o.idealAlign="left"),[o]}}}}),PR=We({"src/traces/barpolar/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"barpolar",basePlotModule:ax(),categories:["polar","bar","showLegend"],attributes:s5(),layoutAttributes:l5(),supplyDefaults:ER(),supplyLayoutDefaults:kR(),calc:u5().calc,crossTraceCalc:u5().crossTraceCalc,plot:CR(),colorbar:Yf(),formatLabels:ix(),style:Yh().style,styleOnSelect:Yh().styleOnSelect,hoverPoints:LR(),selectPoints:N0(),meta:{}}}}),IR=We({"lib/barpolar.js"(Z,V){"use strict";V.exports=PR()}}),c5=We({"src/plots/smith/constants.js"(Z,V){"use strict";V.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),f5=We({"src/plots/smith/layout_attributes.js"(Z,V){"use strict";var d=nf(),x=Of(),A=Uu().attributes,E=aa().extendFlat,e=Iu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);V.exports={domain:A({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),RR=We({"src/plots/smith/layout_defaults.js"(Z,V){"use strict";var d=aa(),x=Fi(),A=sl(),E=Id(),e=Ff().getSubplotData,t=Ed(),r=Md(),o=qm(),a=Mv(),i=f5(),n=c5(),s=n.axisNames,h=m(function(p){return d.isTypedArray(p)&&(p=Array.from(p)),p.slice().reverse().map(function(T){return-T}).concat([0]).concat(p)},String);function c(p,T,l,_){var w=l("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var S=e(_.fullData,n.name,_.id),M=_.layoutOut,y;function b(U,W){return l(y+"."+U,W)}for(var v=0;v")}}V.exports={hoverPoints:x,makeHoverPointText:A}}}),UR=We({"src/traces/scattersmith/index.js"(Z,V){"use strict";V.exports={moduleType:"trace",name:"scattersmith",basePlotModule:DR(),categories:["smith","symbols","showLegend","scatter-like"],attributes:h5(),supplyDefaults:zR(),colorbar:Yf(),formatLabels:FR(),calc:OR(),plot:BR(),style:Ah().style,styleOnSelect:Ah().styleOnSelect,hoverPoints:NR().hoverPoints,selectPoints:O0(),meta:{}}}}),jR=We({"lib/scattersmith.js"(Z,V){"use strict";V.exports=UR()}}),sh=We({"node_modules/world-calendars/dist/main.js"(Z,V){var d=of();function x(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var h=i%10;n=(h===0?"":o[h]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function A(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(A.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new A(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+E(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var h=o.year()+(i==="y"?a:0),c=o.monthOfYear()+(i==="m"?a:0),s=o.day(),m=function(l){for(;c_-1+l.minMonth;)h++,c-=_,_=l.monthsInYear(h)};i==="y"?(o.month()!==this.fromMonthOfYear(h,c)&&(c=this.newDate(h,o.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(h)),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,c)))):i==="m"&&(m(this),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,c))));var p=[h,this.fromMonthOfYear(h,c),s];return this._validateLevel--,p}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],h=i<0?-1:1;a=this._add(o,i*s[0]+h*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),h=i==="d"?a:o.day();return(i==="y"||i==="m")&&(h=Math.min(h,this.daysInMonth(n,s))),o.date(n,s,h)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(p>2.5?4716:4715);return T<=0&&T--,this.newDate(T,p,m)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=V.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),VR=We({"node_modules/world-calendars/dist/plus.js"(){var Z=of(),V=sh();Z(V.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),V.local=V.regionalOptions[""],Z(V.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Z(V.baseCalendar.prototype,{UNIX_EPOCH:V.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:V.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(d,x,A){if(typeof d!="string"&&(A=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw V.local.invalidFormat||V.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,A=A||{};for(var E=A.dayNamesShort||this.local.dayNamesShort,e=A.dayNames||this.local.dayNames,t=A.monthNumbers||this.local.monthNumbers,r=A.monthNamesShort||this.local.monthNamesShort,o=A.monthNames||this.local.monthNames,a=A.calculateWeek||this.local.calculateWeek,i=function(S,M){for(var y=1;w+y1},n=function(S,M,y,b){var v=""+M;if(i(S,b))for(;v.length1},_=function(P,L){var z=l(P,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(P)+1],B=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(v).match(B);if(!O)throw(V.local.missingNumberAt||V.regionalOptions[""].missingNumberAt).replace(/\{0\}/,v);return v+=O[0].length,parseInt(O[0],10)},w=this,S=function(){if(typeof o=="function"){l("m");var P=o.call(w,x.substring(v));return v+=P.length,P}return _("m")},M=function(P,L,z,F){for(var B=l(P,F)?z:L,O=0;O-1){h=1,c=m;for(var f=this.daysInMonth(s,h);c>f;f=this.daysInMonth(s,h))h++,c-=f}return n>-1?this.fromJD(n):this.newDate(s,h,c)},determineDate:function(d,x,A,E,e){A&&typeof A!="object"&&(e=E,E=A,A=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&A?A.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),qR=We({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Z=sh(),V=of(),d=Z.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,V(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var h=n.match(E);return h?h[0]:""}var c=this._validateYear(n),m=n.month(),p=""+this.toChineseMonth(c,m);return s&&p.length<2&&(p="0"+p),this.isIntercalaryMonth(c,m)&&(p+="i"),p},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var h=this._validateYear(n),c=n.month(),m=this.toChineseMonth(h,c),p=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][m-1];return this.isIntercalaryMonth(h,c)&&(p="\u95F0"+p),p},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var h=this._validateYear(n),c=n.month(),m=this.toChineseMonth(h,c),p=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][m-1];return this.isIntercalaryMonth(h,c)&&(p="\u95F0"+p),p},parseMonth:function(n,s){n=this._validateYear(n);var h=parseInt(s),c;if(isNaN(h))s[0]==="\u95F0"&&(c=!0,s=s.substring(1)),s[s.length-1]==="\u6708"&&(s=s.substring(0,s.length-1)),h=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(s);else{var m=s[s.length-1];c=m==="i"||m==="I"}var p=this.toMonthIndex(n,h,c);return p},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,h){var c=this.intercalaryMonth(n),m=h&&s!==c;if(m||s<1||s>12)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return c?!h&&s<=c?p=s-1:p=s:p=s-1,p},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var h=this.intercalaryMonth(n),c=h?12:11;if(s<0||s>c)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return h?s>13;return h},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var h=this.intercalaryMonth(n);return!!h&&h===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,h){var c=this._validateYear(n,Z.local.invalidyear),m=o[c-o[0]],p=m>>9&4095,T=m>>5&15,l=m&31,_;_=d.newDate(p,T,l),_.add(4-(_.dayOfWeek()||7),"d");var w=this.toJD(n,s,h)-_.toJD();return 1+Math.floor(w/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var h=r[n-r[0]],c=h>>13,m=c?12:11;if(s>m)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var p=h&1<<12-s?30:29;return p},weekDay:function(n,s,h){return(this.dayOfWeek(n,s,h)||7)<6},toJD:function(n,s,h){var c=this._validate(n,p,h,Z.local.invalidDate);n=this._validateYear(c.year()),s=c.month(),h=c.day();var m=this.isIntercalaryMonth(n,s),p=this.toChineseMonth(n,s),T=i(n,p,h,m);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),h=a(s.year(),s.month(),s.day()),c=this.toMonthIndex(h.year,h.month,h.isIntercalary);return this.newDate(h.year,c,h.day)},fromString:function(n){var s=n.match(A),h=this._validateYear(+s[1]),c=+s[2],m=!!s[3],p=this.toMonthIndex(h,c,m),T=+s[4];return this.newDate(h,p,T)},add:function(n,s,h){var c=n.year(),m=n.month(),p=this.isIntercalaryMonth(c,m),T=this.toChineseMonth(c,m),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,h);if(h==="y"){var _=l.year(),w=l.month(),S=this.isIntercalaryMonth(_,T),M=p&&S?this.toMonthIndex(_,T,!0):this.toMonthIndex(_,T,!1);M!==w&&l.month(M)}return l}});var A=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Z.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,h,c){var m,p;if(typeof n=="object")m=n,p=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var _=typeof h=="number"&&h>=1&&h<=31;if(!_)throw new Error("Solar day outside range 1 - 31");m={year:n,month:s,day:h},p=c||{}}var w=o[m.year-o[0]],S=m.year<<9|m.month<<5|m.day;p.year=S>=w?m.year:m.year-1,w=o[p.year-o[0]];var M=w>>9&4095,y=w>>5&15,b=w&31,v,u=new Date(M,y-1,b),g=new Date(m.year,m.month-1,m.day);v=Math.round((g-u)/(24*3600*1e3));var f=r[p.year-r[0]],P;for(P=0;P<13;P++){var L=f&1<<12-P?30:29;if(v>13;return!z||P=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var _=typeof s=="number"&&s>=1&&s<=12;if(!_)throw new Error("Lunar month outside range 1 - 12");var w=typeof h=="number"&&h>=1&&h<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var S;typeof c=="object"?(S=!1,p=c):(S=!!c,p=m||{}),T={year:n,month:s,day:h,isIntercalary:S}}var M;M=T.day-1;var y=r[T.year-r[0]],b=y>>13,v;b&&(T.month>b||T.isIntercalary)?v=T.month:v=T.month-1;for(var u=0;u>9&4095,L=f>>5&15,z=f&31,F=new Date(P,L-1,z+M);return p.year=F.getFullYear(),p.month=1+F.getMonth(),p.day=F.getDate(),p}}}),GR=We({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Z=sh(),V=of();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Z.calendars.coptic=d}}),HR=We({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Z=sh(),V=of();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),!1},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),13},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),400},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);return(t.day()+1)%8},weekDay:function(A,E,e){var t=this.dayOfWeek(A,E,e);return t>=2&&t<=6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);return A=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(A-1)*400+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(A/400)+1;A-=(E-1)*400,A+=A>15?16:0;var e=Math.floor(A/32)+1,t=A-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Z.calendars.discworld=d}}),WR=We({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Z=sh(),V=of();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Z.calendars.ethiopian=d}}),XR=We({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Z=sh(),V=of();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(A){return A=A<0?A+1:A,x(A*7+1,19)<7},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),this._leapYear(A.year?A.year():A)?13:12},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return A=E.year(),this.toJD(A===-1?1:A+1,7,1)-this.toJD(A,7,1)},daysInMonth:function(A,E){return A.year&&(E=A.month(),A=A.year()),this._validate(A,E,this.minDay,Z.local.invalidMonth),E===12&&this.leapYear(A)||E===8&&x(this.daysInYear(A),10)===5?30:E===9&&x(this.daysInYear(A),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A<=0?A+1:A,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var a=7;a<=this.monthsInYear(A);a++)o+=this.daysInMonth(A,a);for(var a=1;a=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Athis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=A-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(A,E){return A-E*Math.floor(A/E)}Z.calendars.hebrew=d}}),ZR=We({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Z=sh(),V=of();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);return(A.year()*11+14)%30<11},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==5},toJD:function(x,A,E){var e=this._validate(x,A,E,Z.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(A-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var A=Math.floor((30*(x-this.jdEpoch)+10646)/10631);A=A<=0?A-1:A;var E=Math.min(12,Math.ceil((x-29-this.toJD(A,1,1))/29.5)+1),e=x-this.toJD(A,E,1)+1;return this.newDate(A,E,e)}}),Z.calendars.islamic=d}}),YR=We({"node_modules/world-calendars/dist/calendars/julian.js"(){var Z=sh(),V=of();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=A.year()<0?A.year()+1:A.year();return E%4===0},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Z.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x<0&&x++,A<=2&&(x--,A+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(A+1))+E-1524.5},fromJD:function(x){var A=Math.floor(x+.5),E=A+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Z.calendars.julian=d}}),KR=We({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Z=sh(),V=of();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Z.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Z.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Z.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+340,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[A(E+20,20),A(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function A(E,e){return x(E-1,e)+1}Z.calendars.mayan=d}}),JR=We({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Z=sh(),V=of();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar;var x=Z.instance("gregorian");V(d.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(E+1,1,1);)E++;for(var e=A-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Z.calendars.nanakshahi=d}}),$R=We({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Z=sh(),V=of();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);if(x=A.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,A){return x.year&&(A=x.month(),x=x.year()),this._validate(x,A,this.minDay,Z.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[A-1]:this.NEPALI_CALENDAR_DATA[x][A]},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==6},toJD:function(x,A,E){var e=this._validate(x,A,E,Z.local.invalidDate);x=e.year(),A=e.month(),E=e.day();var t=Z.instance(),r=0,o=A,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return A===9?(r+=E-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var A=Z.instance(),E=A.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var A=this.daysPerMonth.slice(0);A.unshift(17);for(var E=x-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=A)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Z.calendars.nepali=d}}),QR=We({"node_modules/world-calendars/dist/calendars/persian.js"(){var Z=sh(),V=of();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}function x(A){var E=A-475;A<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),a=r-Math.floor(r);return o>a}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return x(E.year())},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=0;if(A>0)for(var o=1;o0?A-1:A)*365+r+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A)+.5;var E=475+(A-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,A>this.toJD(e,12,x(e)?30:29)&&(e++,e===0&&e++);var t=A-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=A-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),Z.calendars.persian=d,Z.calendars.jalali=d}}),eD=We({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Z=sh(),V=of(),d=Z.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,V(x.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)},_g2tYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)}}),Z.calendars.taiwan=x}}),tD=We({"node_modules/world-calendars/dist/calendars/thai.js"(){var Z=sh(),V=of(),d=Z.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,V(x.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)},_g2tYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)}}),Z.calendars.thai=x}}),rD=We({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Z=sh(),V=of();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(A,e);return E},daysInMonth:function(A,E){for(var e=this._validate(A,E,this.minDay,Z.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Z.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(A){for(var E=A-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=E-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(A,E,e){var t=Z.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(A=A.year!=null?A.year:A,t=A>=1276&&A<=1500),t},_validate:function(A,E,e,t){var r=Z.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Z.calendars.ummalqura=d;var x=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),aD=We({"src/components/calendars/calendars.js"(Z,V){"use strict";V.exports=sh(),VR(),qR(),GR(),HR(),WR(),XR(),ZR(),YR(),KR(),JR(),$R(),QR(),eD(),tD(),rD()}}),nD=We({"src/components/calendars/index.js"(Z,V){"use strict";var d=aD(),x=aa(),A=bs(),E=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(y,b,v,u){var g={};return g[v]=t,x.coerce(y,b,g,v,u)},o=function(y,b,v,u){for(var g=0;g{this.chartData=this.parseData(Zc),this.updateChart(this.chartData)}),Alpine.effect(()=>{this.$nextTick(()=>{this.updateChart(this.chartData)})}),window.addEventListener("resize",()=>_0.Plots.resize(document.querySelector(this.chartId)))},renderChart(){this.chartLayout.length===0&&this.chartConfig.length===0?_0.react(document.querySelector(this.chartId),this.chartData):_0.react(document.querySelector(this.chartId),this.chartData,this.chartLayout,this.chartConfig)},updateChart(Zc){_0.react(document.querySelector(this.chartId),Zc,this.chartLayout,this.chartConfig)},tryParse(Zc,pp){if(typeof Zc!="string"||!(Zc.startsWith("{")||Zc.startsWith("[")))return Zc;try{return JSON.parse(Zc)}catch{return console.log('unable to parse JSON for key: "'+pp+'" -- already type: '+typeof Zc),Zc}},parseData(Zc){return Zc.map(pp=>{let iv={...pp};for(let zh of Object.keys(pp))Array.isArray(iv[zh])?iv[zh]=iv[zh].map(Cy=>this.tryParse(Cy,zh)):iv[zh]=this.tryParse(iv[zh],zh);return iv})}}}export{e7 as default}; + ${yr} ${_r} ${Gr} = u_${Gr}; +#endif +`}),staticAttributes:be,staticUniforms:ut}}class qt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ne,be,Ae,Re,ut,_t,Rt,Zt){this.context=I;let yr=this.boundPaintVertexBuffers.length!==Ae.length;for(let _r=0;!yr&&_r({u_matrix:De,u_texture:0,u_ele_delta:I,u_fog_matrix:ne,u_fog_color:be?be.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:be?be.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:be?be.calculateFogBlendOpacity(Ae):0,u_horizon_color:be?be.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:be?be.properties.get("horizon-fog-blend"):1});function Ir(De){let I=[];for(let ne=0;ne({u_depth:new t.aH(vr,Tr.u_depth),u_terrain:new t.aH(vr,Tr.u_terrain),u_terrain_dim:new t.aI(vr,Tr.u_terrain_dim),u_terrain_matrix:new t.aJ(vr,Tr.u_terrain_matrix),u_terrain_unpack:new t.aK(vr,Tr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(vr,Tr.u_terrain_exaggeration)}))(I,nr),this.binderUniforms=be?be.getUniforms(I,nr):[]}draw(I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr,je,Ye,at,ct,At){let yt=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(be),I.setStencilMode(Ae),I.setColorMode(Re),I.setCullFace(ut),Rt){I.activeTexture.set(yt.TEXTURE2),yt.bindTexture(yt.TEXTURE_2D,Rt.depthTexture),I.activeTexture.set(yt.TEXTURE3),yt.bindTexture(yt.TEXTURE_2D,Rt.texture);for(let nr in this.terrainUniforms)this.terrainUniforms[nr].set(Rt[nr])}for(let nr in this.fixedUniforms)this.fixedUniforms[nr].set(_t[nr]);Ye&&Ye.setUniforms(I,this.binderUniforms,Qr,{zoom:je});let Ct=0;switch(ne){case yt.LINES:Ct=2;break;case yt.TRIANGLES:Ct=3;break;case yt.LINE_STRIP:Ct=1}for(let nr of Gr.get()){let vr=nr.vaos||(nr.vaos={});(vr[Zt]||(vr[Zt]=new qt)).bind(I,this,yr,Ye?Ye.getPaintVertexBuffers():[],_r,nr.vertexOffset,at,ct,At),yt.drawElements(ne,nr.primitiveLength*Ct,yt.UNSIGNED_SHORT,nr.primitiveOffset*Ct*2)}}}function Ta(De,I,ne){let be=1/Ca(ne,1,I.transform.tileZoom),Ae=Math.pow(2,ne.tileID.overscaledZ),Re=ne.tileSize*Math.pow(2,I.transform.tileZoom)/Ae,ut=Re*(ne.tileID.canonical.x+ne.tileID.wrap*Ae),_t=Re*ne.tileID.canonical.y;return{u_image:0,u_texsize:ne.imageAtlasTexture.size,u_scale:[be,De.fromScale,De.toScale],u_fade:De.t,u_pixel_coord_upper:[ut>>16,_t>>16],u_pixel_coord_lower:[65535&ut,65535&_t]}}let ua=(De,I,ne,be)=>{let Ae=I.style.light,Re=Ae.properties.get("position"),ut=[Re.x,Re.y,Re.z],_t=(function(){var Zt=new t.A(9);return t.A!=Float32Array&&(Zt[1]=0,Zt[2]=0,Zt[3]=0,Zt[5]=0,Zt[6]=0,Zt[7]=0),Zt[0]=1,Zt[4]=1,Zt[8]=1,Zt})();Ae.properties.get("anchor")==="viewport"&&(function(Zt,yr){var _r=Math.sin(yr),Gr=Math.cos(yr);Zt[0]=Gr,Zt[1]=_r,Zt[2]=0,Zt[3]=-_r,Zt[4]=Gr,Zt[5]=0,Zt[6]=0,Zt[7]=0,Zt[8]=1})(_t,-I.transform.angle),(function(Zt,yr,_r){var Gr=yr[0],Qr=yr[1],je=yr[2];Zt[0]=Gr*_r[0]+Qr*_r[3]+je*_r[6],Zt[1]=Gr*_r[1]+Qr*_r[4]+je*_r[7],Zt[2]=Gr*_r[2]+Qr*_r[5]+je*_r[8]})(ut,ut,_t);let Rt=Ae.properties.get("color");return{u_matrix:De,u_lightpos:ut,u_lightintensity:Ae.properties.get("intensity"),u_lightcolor:[Rt.r,Rt.g,Rt.b],u_vertical_gradient:+ne,u_opacity:be}},ra=(De,I,ne,be,Ae,Re,ut)=>t.e(ua(De,I,ne,be),Ta(Re,I,ut),{u_height_factor:-Math.pow(2,Ae.overscaledZ)/ut.tileSize/8}),ha=De=>({u_matrix:De}),pn=(De,I,ne,be)=>t.e(ha(De),Ta(ne,I,be)),_n=(De,I)=>({u_matrix:De,u_world:I}),jn=(De,I,ne,be,Ae)=>t.e(pn(De,I,ne,be),{u_world:Ae}),li=(De,I,ne,be)=>{let Ae=De.transform,Re,ut;if(be.paint.get("circle-pitch-alignment")==="map"){let _t=Ca(ne,1,Ae.zoom);Re=!0,ut=[_t,_t]}else Re=!1,ut=Ae.pixelsToGLUnits;return{u_camera_to_center_distance:Ae.cameraToCenterDistance,u_scale_with_map:+(be.paint.get("circle-pitch-scale")==="map"),u_matrix:De.translatePosMatrix(I.posMatrix,ne,be.paint.get("circle-translate"),be.paint.get("circle-translate-anchor")),u_pitch_with_map:+Re,u_device_pixel_ratio:De.pixelRatio,u_extrude_scale:ut}},yi=(De,I,ne)=>({u_matrix:De,u_inv_matrix:I,u_camera_to_center_distance:ne.cameraToCenterDistance,u_viewport_size:[ne.width,ne.height]}),gi=(De,I,ne=1)=>({u_matrix:De,u_color:I,u_overlay:0,u_overlay_scale:ne}),Si=De=>({u_matrix:De}),Gi=(De,I,ne,be)=>({u_matrix:De,u_extrude_scale:Ca(I,1,ne),u_intensity:be}),io=(De,I,ne,be)=>{let Ae=t.H();t.aP(Ae,0,De.width,De.height,0,0,1);let Re=De.context.gl;return{u_matrix:Ae,u_world:[Re.drawingBufferWidth,Re.drawingBufferHeight],u_image:ne,u_color_ramp:be,u_opacity:I.paint.get("heatmap-opacity")}};function vo(De,I){let ne=Math.pow(2,I.canonical.z),be=I.canonical.y;return[new t.Z(0,be/ne).toLngLat().lat,new t.Z(0,(be+1)/ne).toLngLat().lat]}let ms=(De,I,ne,be)=>{let Ae=De.transform;return{u_matrix:No(De,I,ne,be),u_ratio:1/Ca(I,1,Ae.zoom),u_device_pixel_ratio:De.pixelRatio,u_units_to_pixels:[1/Ae.pixelsToGLUnits[0],1/Ae.pixelsToGLUnits[1]]}},pi=(De,I,ne,be,Ae)=>t.e(ms(De,I,ne,Ae),{u_image:0,u_image_height:be}),lo=(De,I,ne,be,Ae)=>{let Re=De.transform,ut=Fo(I,Re);return{u_matrix:No(De,I,ne,Ae),u_texsize:I.imageAtlasTexture.size,u_ratio:1/Ca(I,1,Re.zoom),u_device_pixel_ratio:De.pixelRatio,u_image:0,u_scale:[ut,be.fromScale,be.toScale],u_fade:be.t,u_units_to_pixels:[1/Re.pixelsToGLUnits[0],1/Re.pixelsToGLUnits[1]]}},Ai=(De,I,ne,be,Ae,Re)=>{let ut=De.lineAtlas,_t=Fo(I,De.transform),Rt=ne.layout.get("line-cap")==="round",Zt=ut.getDash(be.from,Rt),yr=ut.getDash(be.to,Rt),_r=Zt.width*Ae.fromScale,Gr=yr.width*Ae.toScale;return t.e(ms(De,I,ne,Re),{u_patternscale_a:[_t/_r,-Zt.height/2],u_patternscale_b:[_t/Gr,-yr.height/2],u_sdfgamma:ut.width/(256*Math.min(_r,Gr)*De.pixelRatio)/2,u_image:0,u_tex_y_a:Zt.y,u_tex_y_b:yr.y,u_mix:Ae.t})};function Fo(De,I){return 1/Ca(De,1,I.tileZoom)}function No(De,I,ne,be){return De.translatePosMatrix(be?be.posMatrix:I.tileID.posMatrix,I,ne.paint.get("line-translate"),ne.paint.get("line-translate-anchor"))}let $o=(De,I,ne,be,Ae)=>{return{u_matrix:De,u_tl_parent:I,u_scale_parent:ne,u_buffer_scale:1,u_fade_t:be.mix,u_opacity:be.opacity*Ae.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ae.paint.get("raster-brightness-min"),u_brightness_high:Ae.paint.get("raster-brightness-max"),u_saturation_factor:(ut=Ae.paint.get("raster-saturation"),ut>0?1-1/(1.001-ut):-ut),u_contrast_factor:(Re=Ae.paint.get("raster-contrast"),Re>0?1/(1-Re):1+Re),u_spin_weights:bo(Ae.paint.get("raster-hue-rotate"))};var Re,ut};function bo(De){De*=Math.PI/180;let I=Math.sin(De),ne=Math.cos(De);return[(2*ne+1)/3,(-Math.sqrt(3)*I-ne+1)/3,(Math.sqrt(3)*I-ne+1)/3]}let Hi=(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr)=>{let je=ut.transform;return{u_is_size_zoom_constant:+(De==="constant"||De==="source"),u_is_size_feature_constant:+(De==="constant"||De==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:je.cameraToCenterDistance,u_pitch:je.pitch/360*2*Math.PI,u_rotate_symbol:+ne,u_aspect_ratio:je.width/je.height,u_fade_change:ut.options.fadeDuration?ut.symbolFadeChange:1,u_matrix:_t,u_label_plane_matrix:Rt,u_coord_matrix:Zt,u_is_text:+_r,u_pitch_with_map:+be,u_is_along_line:Ae,u_is_variable_anchor:Re,u_texsize:Gr,u_texture:0,u_translation:yr,u_pitched_scale:Qr}},Pi=(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr,je)=>{let Ye=ut.transform;return t.e(Hi(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,je),{u_gamma_scale:be?Math.cos(Ye._pitch)*Ye.cameraToCenterDistance:1,u_device_pixel_ratio:ut.pixelRatio,u_is_halo:+Qr})},ji=(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,_r,Gr,Qr)=>t.e(Pi(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt,yr,!0,_r,!0,Qr),{u_texsize_icon:Gr,u_texture_icon:1}),Uo=(De,I,ne)=>({u_matrix:De,u_opacity:I,u_color:ne}),Ko=(De,I,ne,be,Ae,Re)=>t.e((function(ut,_t,Rt,Zt){let yr=Rt.imageManager.getPattern(ut.from.toString()),_r=Rt.imageManager.getPattern(ut.to.toString()),{width:Gr,height:Qr}=Rt.imageManager.getPixelSize(),je=Math.pow(2,Zt.tileID.overscaledZ),Ye=Zt.tileSize*Math.pow(2,Rt.transform.tileZoom)/je,at=Ye*(Zt.tileID.canonical.x+Zt.tileID.wrap*je),ct=Ye*Zt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:yr.tl,u_pattern_br_a:yr.br,u_pattern_tl_b:_r.tl,u_pattern_br_b:_r.br,u_texsize:[Gr,Qr],u_mix:_t.t,u_pattern_size_a:yr.displaySize,u_pattern_size_b:_r.displaySize,u_scale_a:_t.fromScale,u_scale_b:_t.toScale,u_tile_units_to_pixels:1/Ca(Zt,1,Rt.transform.tileZoom),u_pixel_coord_upper:[at>>16,ct>>16],u_pixel_coord_lower:[65535&at,65535&ct]}})(be,Re,ne,Ae),{u_matrix:De,u_opacity:I}),us={fillExtrusion:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_opacity:new t.aI(De,I.u_opacity)}),fillExtrusionPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_height_factor:new t.aI(De,I.u_height_factor),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade),u_opacity:new t.aI(De,I.u_opacity)}),fill:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),fillPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),fillOutline:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world)}),fillOutlinePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),circle:(De,I)=>({u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_scale_with_map:new t.aH(De,I.u_scale_with_map),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_extrude_scale:new t.aO(De,I.u_extrude_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_matrix:new t.aJ(De,I.u_matrix)}),collisionBox:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_pixel_extrude_scale:new t.aO(De,I.u_pixel_extrude_scale)}),collisionCircle:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_inv_matrix:new t.aJ(De,I.u_inv_matrix),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_viewport_size:new t.aO(De,I.u_viewport_size)}),debug:(De,I)=>({u_color:new t.aL(De,I.u_color),u_matrix:new t.aJ(De,I.u_matrix),u_overlay:new t.aH(De,I.u_overlay),u_overlay_scale:new t.aI(De,I.u_overlay_scale)}),clippingMask:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),heatmap:(De,I)=>({u_extrude_scale:new t.aI(De,I.u_extrude_scale),u_intensity:new t.aI(De,I.u_intensity),u_matrix:new t.aJ(De,I.u_matrix)}),heatmapTexture:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_color_ramp:new t.aH(De,I.u_color_ramp),u_opacity:new t.aI(De,I.u_opacity)}),hillshade:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_latrange:new t.aO(De,I.u_latrange),u_light:new t.aO(De,I.u_light),u_shadow:new t.aL(De,I.u_shadow),u_highlight:new t.aL(De,I.u_highlight),u_accent:new t.aL(De,I.u_accent)}),hillshadePrepare:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_dimension:new t.aO(De,I.u_dimension),u_zoom:new t.aI(De,I.u_zoom),u_unpack:new t.aK(De,I.u_unpack)}),line:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels)}),lineGradient:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_image:new t.aH(De,I.u_image),u_image_height:new t.aI(De,I.u_image_height)}),linePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texsize:new t.aO(De,I.u_texsize),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_image:new t.aH(De,I.u_image),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),lineSDF:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_patternscale_a:new t.aO(De,I.u_patternscale_a),u_patternscale_b:new t.aO(De,I.u_patternscale_b),u_sdfgamma:new t.aI(De,I.u_sdfgamma),u_image:new t.aH(De,I.u_image),u_tex_y_a:new t.aI(De,I.u_tex_y_a),u_tex_y_b:new t.aI(De,I.u_tex_y_b),u_mix:new t.aI(De,I.u_mix)}),raster:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_tl_parent:new t.aO(De,I.u_tl_parent),u_scale_parent:new t.aI(De,I.u_scale_parent),u_buffer_scale:new t.aI(De,I.u_buffer_scale),u_fade_t:new t.aI(De,I.u_fade_t),u_opacity:new t.aI(De,I.u_opacity),u_image0:new t.aH(De,I.u_image0),u_image1:new t.aH(De,I.u_image1),u_brightness_low:new t.aI(De,I.u_brightness_low),u_brightness_high:new t.aI(De,I.u_brightness_high),u_saturation_factor:new t.aI(De,I.u_saturation_factor),u_contrast_factor:new t.aI(De,I.u_contrast_factor),u_spin_weights:new t.aN(De,I.u_spin_weights)}),symbolIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolSDF:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolTextAndIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texsize_icon:new t.aO(De,I.u_texsize_icon),u_texture:new t.aH(De,I.u_texture),u_texture_icon:new t.aH(De,I.u_texture_icon),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),background:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_color:new t.aL(De,I.u_color)}),backgroundPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_image:new t.aH(De,I.u_image),u_pattern_tl_a:new t.aO(De,I.u_pattern_tl_a),u_pattern_br_a:new t.aO(De,I.u_pattern_br_a),u_pattern_tl_b:new t.aO(De,I.u_pattern_tl_b),u_pattern_br_b:new t.aO(De,I.u_pattern_br_b),u_texsize:new t.aO(De,I.u_texsize),u_mix:new t.aI(De,I.u_mix),u_pattern_size_a:new t.aO(De,I.u_pattern_size_a),u_pattern_size_b:new t.aO(De,I.u_pattern_size_b),u_scale_a:new t.aI(De,I.u_scale_a),u_scale_b:new t.aI(De,I.u_scale_b),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(De,I.u_tile_units_to_pixels)}),terrain:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_ele_delta:new t.aI(De,I.u_ele_delta),u_fog_matrix:new t.aJ(De,I.u_fog_matrix),u_fog_color:new t.aL(De,I.u_fog_color),u_fog_ground_blend:new t.aI(De,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(De,I.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon_fog_blend:new t.aI(De,I.u_horizon_fog_blend)}),terrainDepth:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ele_delta:new t.aI(De,I.u_ele_delta)}),terrainCoords:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_terrain_coords_id:new t.aI(De,I.u_terrain_coords_id),u_ele_delta:new t.aI(De,I.u_ele_delta)}),sky:(De,I)=>({u_sky_color:new t.aL(De,I.u_sky_color),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon:new t.aI(De,I.u_horizon),u_sky_horizon_blend:new t.aI(De,I.u_sky_horizon_blend)})};class ko{constructor(I,ne,be){this.context=I;let Ae=I.gl;this.buffer=Ae.createBuffer(),this.dynamicDraw=!!be,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),Ae.bufferData(Ae.ELEMENT_ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Ae.DYNAMIC_DRAW:Ae.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){let ne=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ne.bufferSubData(ne.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let zn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class _i{constructor(I,ne,be,Ae){this.length=ne.length,this.attributes=be,this.itemSize=ne.bytesPerElement,this.dynamicDraw=Ae,this.context=I;let Re=I.gl;this.buffer=Re.createBuffer(),I.bindVertexBuffer.set(this.buffer),Re.bufferData(Re.ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Re.DYNAMIC_DRAW:Re.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);let ne=this.context.gl;this.bind(),ne.bufferSubData(ne.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ne){for(let be=0;be0){let vr=t.H();t.aQ(vr,yt.placementInvProjMatrix,De.transform.glCoordMatrix),t.aQ(vr,vr,yt.placementViewportMatrix),Rt.push({circleArray:nr,circleOffset:yr,transform:At.posMatrix,invTransform:vr,coord:At}),Zt+=nr.length/4,yr=Zt}Ct&&_t.draw(Re,ut.LINES,Vo.disabled,ss.disabled,De.colorModeForRenderPass(),Vi.disabled,{u_matrix:At.posMatrix,u_pixel_extrude_scale:[1/(_r=De.transform).width,1/_r.height]},De.style.map.terrain&&De.style.map.terrain.getTerrainData(At),ne.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,null,De.transform.zoom,null,null,Ct.collisionVertexBuffer)}var _r;if(!Ae||!Rt.length)return;let Gr=De.useProgram("collisionCircle"),Qr=new t.aR;Qr.resize(4*Zt),Qr._trim();let je=0;for(let ct of Rt)for(let At=0;At=0&&(ct[yt.associatedIconIndex]={shiftedAnchor:vi,angle:zi})}else ir(yt.numGlyphs,Ye)}if(Zt){at.clear();let At=De.icon.placedSymbolArray;for(let yt=0;ytDe.style.map.terrain.getElevation(ga,Pt,dr):null,Jt=ne.layout.get("text-rotation-alignment")==="map";we(en,ga.posMatrix,De,Ae,Ml,jl,ct,Zt,Jt,Ye,ga.toUnwrapped(),je.width,je.height,Qs,xt)}let pl=ga.posMatrix,ml=Ae&&Fr||Cu,pe=At||ml?vl:Ml,Ie=ru,Je=Kn&&ne.paint.get(Ae?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ft;ft=Kn?en.iconsInText?ji(vi.kind,so,yt,ct,At,ml,De,pl,pe,Ie,Qs,uo,Is,oa):Pi(vi.kind,so,yt,ct,At,ml,De,pl,pe,Ie,Qs,Ae,uo,!0,oa):Hi(vi.kind,so,yt,ct,At,ml,De,pl,pe,Ie,Qs,Ae,uo,oa);let pt={program:Mi,buffers:Dn,uniformValues:ft,atlasTexture:Co,atlasTextureIcon:Io,atlasInterpolation:Xo,atlasInterpolationIcon:Us,isSDF:Kn,hasHalo:Je};if(nr&&en.canOverlap){vr=!0;let xt=Dn.segments.get();for(let Jt of xt)Xr.push({segments:new t.a0([Jt]),sortKey:Jt.sortKey,state:pt,terrainData:jo})}else Xr.push({segments:Dn.segments,sortKey:0,state:pt,terrainData:jo})}vr&&Xr.sort((ga,Ma)=>ga.sortKey-Ma.sortKey);for(let ga of Xr){let Ma=ga.state;if(Gr.activeTexture.set(Qr.TEXTURE0),Ma.atlasTexture.bind(Ma.atlasInterpolation,Qr.CLAMP_TO_EDGE),Ma.atlasTextureIcon&&(Gr.activeTexture.set(Qr.TEXTURE1),Ma.atlasTextureIcon&&Ma.atlasTextureIcon.bind(Ma.atlasInterpolationIcon,Qr.CLAMP_TO_EDGE)),Ma.isSDF){let en=Ma.uniformValues;Ma.hasHalo&&(en.u_is_halo=1,Nc(Ma.buffers,ga.segments,ne,De,Ma.program,Tr,yr,_r,en,ga.terrainData)),en.u_is_halo=0}Nc(Ma.buffers,ga.segments,ne,De,Ma.program,Tr,yr,_r,Ma.uniformValues,ga.terrainData)}}function Nc(De,I,ne,be,Ae,Re,ut,_t,Rt,Zt){let yr=be.context;Ae.draw(yr,yr.gl.TRIANGLES,Re,ut,_t,Vi.disabled,Rt,Zt,ne.id,De.layoutVertexBuffer,De.indexBuffer,I,ne.paint,be.transform.zoom,De.programConfigurations.get(ne.id),De.dynamicLayoutVertexBuffer,De.opacityVertexBuffer)}function _c(De,I,ne,be){let Ae=De.context,Re=Ae.gl,ut=ss.disabled,_t=new qs([Re.ONE,Re.ONE],t.aM.transparent,[!0,!0,!0,!0]),Rt=I.getBucket(ne);if(!Rt)return;let Zt=be.key,yr=ne.heatmapFbos.get(Zt);yr||(yr=Uc(Ae,I.tileSize,I.tileSize),ne.heatmapFbos.set(Zt,yr)),Ae.bindFramebuffer.set(yr.framebuffer),Ae.viewport.set([0,0,I.tileSize,I.tileSize]),Ae.clear({color:t.aM.transparent});let _r=Rt.programConfigurations.get(ne.id),Gr=De.useProgram("heatmap",_r),Qr=De.style.map.terrain.getTerrainData(be);Gr.draw(Ae,Re.TRIANGLES,Vo.disabled,ut,_t,Vi.disabled,Gi(be.posMatrix,I,De.transform.zoom,ne.paint.get("heatmap-intensity")),Qr,ne.id,Rt.layoutVertexBuffer,Rt.indexBuffer,Rt.segments,ne.paint,De.transform.zoom,_r)}function ac(De,I,ne){let be=De.context,Ae=be.gl;be.setColorMode(De.colorModeForRenderPass());let Re=jc(be,I),ut=ne.key,_t=I.heatmapFbos.get(ut);_t&&(be.activeTexture.set(Ae.TEXTURE0),Ae.bindTexture(Ae.TEXTURE_2D,_t.colorAttachment.get()),be.activeTexture.set(Ae.TEXTURE1),Re.bind(Ae.LINEAR,Ae.CLAMP_TO_EDGE),De.useProgram("heatmapTexture").draw(be,Ae.TRIANGLES,Vo.disabled,ss.disabled,De.colorModeForRenderPass(),Vi.disabled,io(De,I,0,1),null,I.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments,I.paint,De.transform.zoom),_t.destroy(),I.heatmapFbos.delete(ut))}function Uc(De,I,ne){var be,Ae;let Re=De.gl,ut=Re.createTexture();Re.bindTexture(Re.TEXTURE_2D,ut),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_S,Re.CLAMP_TO_EDGE),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_T,Re.CLAMP_TO_EDGE),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MIN_FILTER,Re.LINEAR),Re.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MAG_FILTER,Re.LINEAR);let _t=(be=De.HALF_FLOAT)!==null&&be!==void 0?be:Re.UNSIGNED_BYTE,Rt=(Ae=De.RGBA16F)!==null&&Ae!==void 0?Ae:Re.RGBA;Re.texImage2D(Re.TEXTURE_2D,0,Rt,I,ne,0,Re.RGBA,_t,null);let Zt=De.createFramebuffer(I,ne,!1,!1);return Zt.colorAttachment.set(ut),Zt}function jc(De,I){return I.colorRampTexture||(I.colorRampTexture=new u(De,I.colorRamp,De.gl.RGBA)),I.colorRampTexture}function hu(De,I,ne,be,Ae){if(!ne||!be||!be.imageAtlas)return;let Re=be.imageAtlas.patternPositions,ut=Re[ne.to.toString()],_t=Re[ne.from.toString()];if(!ut&&_t&&(ut=_t),!_t&&ut&&(_t=ut),!ut||!_t){let Rt=Ae.getPaintProperty(I);ut=Re[Rt],_t=Re[Rt]}ut&&_t&&De.setConstantPatternPositions(ut,_t)}function Dc(De,I,ne,be,Ae,Re,ut){let _t=De.context.gl,Rt="fill-pattern",Zt=ne.paint.get(Rt),yr=Zt&&Zt.constantOr(1),_r=ne.getCrossfadeParameters(),Gr,Qr,je,Ye,at;ut?(Qr=yr&&!ne.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Gr=_t.LINES):(Qr=yr?"fillPattern":"fill",Gr=_t.TRIANGLES);let ct=Zt.constantOr(null);for(let At of be){let yt=I.getTile(At);if(yr&&!yt.patternsLoaded())continue;let Ct=yt.getBucket(ne);if(!Ct)continue;let nr=Ct.programConfigurations.get(ne.id),vr=De.useProgram(Qr,nr),Tr=De.style.map.terrain&&De.style.map.terrain.getTerrainData(At);yr&&(De.context.activeTexture.set(_t.TEXTURE0),yt.imageAtlasTexture.bind(_t.LINEAR,_t.CLAMP_TO_EDGE),nr.updatePaintBuffers(_r)),hu(nr,Rt,ct,yt,ne);let Fr=Tr?At:null,Xr=De.translatePosMatrix(Fr?Fr.posMatrix:At.posMatrix,yt,ne.paint.get("fill-translate"),ne.paint.get("fill-translate-anchor"));if(ut){Ye=Ct.indexBuffer2,at=Ct.segments2;let oa=[_t.drawingBufferWidth,_t.drawingBufferHeight];je=Qr==="fillOutlinePattern"&&yr?jn(Xr,De,_r,yt,oa):_n(Xr,oa)}else Ye=Ct.indexBuffer,at=Ct.segments,je=yr?pn(Xr,De,_r,yt):ha(Xr);vr.draw(De.context,Gr,Ae,De.stencilModeForClipping(At),Re,Vi.disabled,je,Tr,ne.id,Ct.layoutVertexBuffer,Ye,at,ne.paint,De.transform.zoom,nr)}}function Mu(De,I,ne,be,Ae,Re,ut){let _t=De.context,Rt=_t.gl,Zt="fill-extrusion-pattern",yr=ne.paint.get(Zt),_r=yr.constantOr(1),Gr=ne.getCrossfadeParameters(),Qr=ne.paint.get("fill-extrusion-opacity"),je=yr.constantOr(null);for(let Ye of be){let at=I.getTile(Ye),ct=at.getBucket(ne);if(!ct)continue;let At=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Ye),yt=ct.programConfigurations.get(ne.id),Ct=De.useProgram(_r?"fillExtrusionPattern":"fillExtrusion",yt);_r&&(De.context.activeTexture.set(Rt.TEXTURE0),at.imageAtlasTexture.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE),yt.updatePaintBuffers(Gr)),hu(yt,Zt,je,at,ne);let nr=De.translatePosMatrix(Ye.posMatrix,at,ne.paint.get("fill-extrusion-translate"),ne.paint.get("fill-extrusion-translate-anchor")),vr=ne.paint.get("fill-extrusion-vertical-gradient"),Tr=_r?ra(nr,De,vr,Qr,Ye,Gr,at):ua(nr,De,vr,Qr);Ct.draw(_t,_t.gl.TRIANGLES,Ae,Re,ut,Vi.backCCW,Tr,At,ne.id,ct.layoutVertexBuffer,ct.indexBuffer,ct.segments,ne.paint,De.transform.zoom,yt,De.style.map.terrain&&ct.centroidVertexBuffer)}}function lc(De,I,ne,be,Ae,Re,ut){let _t=De.context,Rt=_t.gl,Zt=ne.fbo;if(!Zt)return;let yr=De.useProgram("hillshade"),_r=De.style.map.terrain&&De.style.map.terrain.getTerrainData(I);_t.activeTexture.set(Rt.TEXTURE0),Rt.bindTexture(Rt.TEXTURE_2D,Zt.colorAttachment.get()),yr.draw(_t,Rt.TRIANGLES,Ae,Re,ut,Vi.disabled,((Gr,Qr,je,Ye)=>{let at=je.paint.get("hillshade-shadow-color"),ct=je.paint.get("hillshade-highlight-color"),At=je.paint.get("hillshade-accent-color"),yt=je.paint.get("hillshade-illumination-direction")*(Math.PI/180);je.paint.get("hillshade-illumination-anchor")==="viewport"&&(yt-=Gr.transform.angle);let Ct=!Gr.options.moving;return{u_matrix:Ye?Ye.posMatrix:Gr.transform.calculatePosMatrix(Qr.tileID.toUnwrapped(),Ct),u_image:0,u_latrange:vo(0,Qr.tileID),u_light:[je.paint.get("hillshade-exaggeration"),yt],u_shadow:at,u_highlight:ct,u_accent:At}})(De,ne,be,_r?I:null),_r,be.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments)}function Sl(De,I,ne,be,Ae,Re){let ut=De.context,_t=ut.gl,Rt=I.dem;if(Rt&&Rt.data){let Zt=Rt.dim,yr=Rt.stride,_r=Rt.getPixels();if(ut.activeTexture.set(_t.TEXTURE1),ut.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||De.getTileTexture(yr),I.demTexture){let Qr=I.demTexture;Qr.update(_r,{premultiply:!1}),Qr.bind(_t.NEAREST,_t.CLAMP_TO_EDGE)}else I.demTexture=new u(ut,_r,_t.RGBA,{premultiply:!1}),I.demTexture.bind(_t.NEAREST,_t.CLAMP_TO_EDGE);ut.activeTexture.set(_t.TEXTURE0);let Gr=I.fbo;if(!Gr){let Qr=new u(ut,{width:Zt,height:Zt,data:null},_t.RGBA);Qr.bind(_t.LINEAR,_t.CLAMP_TO_EDGE),Gr=I.fbo=ut.createFramebuffer(Zt,Zt,!0,!1),Gr.colorAttachment.set(Qr.texture)}ut.bindFramebuffer.set(Gr.framebuffer),ut.viewport.set([0,0,Zt,Zt]),De.useProgram("hillshadePrepare").draw(ut,_t.TRIANGLES,be,Ae,Re,Vi.disabled,((Qr,je)=>{let Ye=je.stride,at=t.H();return t.aP(at,0,t.X,-t.X,0,0,1),t.J(at,at,[0,-t.X,0]),{u_matrix:at,u_image:1,u_dimension:[Ye,Ye],u_zoom:Qr.overscaledZ,u_unpack:je.getUnpackVector()}})(I.tileID,Rt),null,ne.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function nc(De,I,ne,be,Ae,Re){let ut=be.paint.get("raster-fade-duration");if(!Re&&ut>0){let _t=i.now(),Rt=(_t-De.timeAdded)/ut,Zt=I?(_t-I.timeAdded)/ut:-1,yr=ne.getSource(),_r=Ae.coveringZoomLevel({tileSize:yr.tileSize,roundZoom:yr.roundZoom}),Gr=!I||Math.abs(I.tileID.overscaledZ-_r)>Math.abs(De.tileID.overscaledZ-_r),Qr=Gr&&De.refreshedUponExpiration?1:t.ac(Gr?Rt:1-Zt,0,1);return De.refreshedUponExpiration&&Rt>=1&&(De.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Qr}:{opacity:Qr,mix:0}}return{opacity:1,mix:0}}let Gu=new t.aM(1,0,0,1),Es=new t.aM(0,1,0,1),zc=new t.aM(0,0,1,1),ff=new t.aM(1,0,1,1),Vc=new t.aM(0,1,1,1);function uc(De,I,ne,be){$l(De,0,I+ne/2,De.transform.width,ne,be)}function Qc(De,I,ne,be){$l(De,I-ne/2,0,ne,De.transform.height,be)}function $l(De,I,ne,be,Ae,Re){let ut=De.context,_t=ut.gl;_t.enable(_t.SCISSOR_TEST),_t.scissor(I*De.pixelRatio,ne*De.pixelRatio,be*De.pixelRatio,Ae*De.pixelRatio),ut.clear({color:Re}),_t.disable(_t.SCISSOR_TEST)}function qc(De,I,ne){let be=De.context,Ae=be.gl,Re=ne.posMatrix,ut=De.useProgram("debug"),_t=Vo.disabled,Rt=ss.disabled,Zt=De.colorModeForRenderPass(),yr="$debug",_r=De.style.map.terrain&&De.style.map.terrain.getTerrainData(ne);be.activeTexture.set(Ae.TEXTURE0);let Gr=I.getTileByID(ne.key).latestRawTileData,Qr=Math.floor((Gr&&Gr.byteLength||0)/1024),je=I.getTile(ne).tileSize,Ye=512/Math.min(je,512)*(ne.overscaledZ/De.transform.zoom)*.5,at=ne.canonical.toString();ne.overscaledZ!==ne.canonical.z&&(at+=` => ${ne.overscaledZ}`),(function(ct,At){ct.initDebugOverlayCanvas();let yt=ct.debugOverlayCanvas,Ct=ct.context.gl,nr=ct.debugOverlayCanvas.getContext("2d");nr.clearRect(0,0,yt.width,yt.height),nr.shadowColor="white",nr.shadowBlur=2,nr.lineWidth=1.5,nr.strokeStyle="white",nr.textBaseline="top",nr.font="bold 36px Open Sans, sans-serif",nr.fillText(At,5,5),nr.strokeText(At,5,5),ct.debugOverlayTexture.update(yt),ct.debugOverlayTexture.bind(Ct.LINEAR,Ct.CLAMP_TO_EDGE)})(De,`${at} ${Qr}kB`),ut.draw(be,Ae.TRIANGLES,_t,Rt,qs.alphaBlended,Vi.disabled,gi(Re,t.aM.transparent,Ye),null,yr,De.debugBuffer,De.quadTriangleIndexBuffer,De.debugSegments),ut.draw(be,Ae.LINE_STRIP,_t,Rt,Zt,Vi.disabled,gi(Re,t.aM.red),_r,yr,De.debugBuffer,De.tileBorderIndexBuffer,De.debugSegments)}function Zs(De,I,ne){let be=De.context,Ae=be.gl,Re=De.colorModeForRenderPass(),ut=new Vo(Ae.LEQUAL,Vo.ReadWrite,De.depthRangeFor3D),_t=De.useProgram("terrain"),Rt=I.getTerrainMesh();be.bindFramebuffer.set(null),be.viewport.set([0,0,De.width,De.height]);for(let Zt of ne){let yr=De.renderToTexture.getTexture(Zt),_r=I.getTerrainData(Zt.tileID);be.activeTexture.set(Ae.TEXTURE0),Ae.bindTexture(Ae.TEXTURE_2D,yr.texture);let Gr=De.transform.calculatePosMatrix(Zt.tileID.toUnwrapped()),Qr=I.getMeshFrameDelta(De.transform.zoom),je=De.transform.calculateFogMatrix(Zt.tileID.toUnwrapped()),Ye=fr(Gr,Qr,je,De.style.sky,De.transform.pitch);_t.draw(be,Ae.TRIANGLES,ut,ss.disabled,Re,Vi.backCCW,Ye,_r,"terrain",Rt.vertexBuffer,Rt.indexBuffer,Rt.segments)}}class Ql{constructor(I,ne,be){this.vertexBuffer=I,this.indexBuffer=ne,this.segments=be}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Hu{constructor(I,ne){this.context=new wf(I),this.transform=ne,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Rr}resize(I,ne,be){if(this.width=Math.floor(I*be),this.height=Math.floor(ne*be),this.pixelRatio=be,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Ae of this.style._order)this.style._layers[Ae].resize()}setup(){let I=this.context,ne=new t.aX;ne.emplaceBack(0,0),ne.emplaceBack(t.X,0),ne.emplaceBack(0,t.X),ne.emplaceBack(t.X,t.X),this.tileExtentBuffer=I.createVertexBuffer(ne,zr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let be=new t.aX;be.emplaceBack(0,0),be.emplaceBack(t.X,0),be.emplaceBack(0,t.X),be.emplaceBack(t.X,t.X),this.debugBuffer=I.createVertexBuffer(be,zr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);let Ae=new t.$;Ae.emplaceBack(0,0,0,0),Ae.emplaceBack(t.X,0,t.X,0),Ae.emplaceBack(0,t.X,0,t.X),Ae.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=I.createVertexBuffer(Ae,qe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);let Re=new t.aX;Re.emplaceBack(0,0),Re.emplaceBack(1,0),Re.emplaceBack(0,1),Re.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Re,zr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);let ut=new t.aZ;ut.emplaceBack(0),ut.emplaceBack(1),ut.emplaceBack(3),ut.emplaceBack(2),ut.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(ut);let _t=new t.aY;_t.emplaceBack(0,1,2),_t.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(_t);let Rt=this.context.gl;this.stencilClearMode=new ss({func:Rt.ALWAYS,mask:0},0,255,Rt.ZERO,Rt.ZERO,Rt.ZERO)}clearStencil(){let I=this.context,ne=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let be=t.H();t.aP(be,0,this.width,this.height,0,0,1),t.K(be,be,[ne.drawingBufferWidth,ne.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ne.TRIANGLES,Vo.disabled,this.stencilClearMode,qs.disabled,Vi.disabled,Si(be),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ne){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ne||!ne.length)return;this.currentStencilSource=I.source;let be=this.context,Ae=be.gl;this.nextStencilID+ne.length>256&&this.clearStencil(),be.setColorMode(qs.disabled),be.setDepthMode(Vo.disabled);let Re=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let ut of ne){let _t=this._tileClippingMaskIDs[ut.key]=this.nextStencilID++,Rt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ut);Re.draw(be,Ae.TRIANGLES,Vo.disabled,new ss({func:Ae.ALWAYS,mask:0},_t,255,Ae.KEEP,Ae.KEEP,Ae.REPLACE),qs.disabled,Vi.disabled,Si(ut.posMatrix),Rt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let I=this.nextStencilID++,ne=this.context.gl;return new ss({func:ne.NOTEQUAL,mask:255},I,255,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilModeForClipping(I){let ne=this.context.gl;return new ss({func:ne.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilConfigForOverlap(I){let ne=this.context.gl,be=I.sort((ut,_t)=>_t.overscaledZ-ut.overscaledZ),Ae=be[be.length-1].overscaledZ,Re=be[0].overscaledZ-Ae+1;if(Re>1){this.currentStencilSource=void 0,this.nextStencilID+Re>256&&this.clearStencil();let ut={};for(let _t=0;_t({u_sky_color:ct.properties.get("sky-color"),u_horizon_color:ct.properties.get("horizon-color"),u_horizon:(At.height/2+At.getHorizon())*yt,u_sky_horizon_blend:ct.properties.get("sky-horizon-blend")*At.height/2*yt}))(Zt,Rt.style.map.transform,Rt.pixelRatio),Qr=new Vo(_r.LEQUAL,Vo.ReadWrite,[0,1]),je=ss.disabled,Ye=Rt.colorModeForRenderPass(),at=Rt.useProgram("sky");if(!Zt.mesh){let ct=new t.aX;ct.emplaceBack(-1,-1),ct.emplaceBack(1,-1),ct.emplaceBack(1,1),ct.emplaceBack(-1,1);let At=new t.aY;At.emplaceBack(0,1,2),At.emplaceBack(0,2,3),Zt.mesh=new Ql(yr.createVertexBuffer(ct,zr.members),yr.createIndexBuffer(At),t.a0.simpleSegment(0,0,ct.length,At.length))}at.draw(yr,_r.TRIANGLES,Qr,je,Ye,Vi.disabled,Gr,void 0,"sky",Zt.mesh.vertexBuffer,Zt.mesh.indexBuffer,Zt.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=ne.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=be.length-1;this.currentLayer>=0;this.currentLayer--){let Rt=this.style._layers[be[this.currentLayer]],Zt=Ae[Rt.source],yr=Re[Rt.source];this._renderTileClippingMasks(Rt,yr),this.renderLayer(this,Zt,Rt,yr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerat.source&&!at.isHidden(yr)?[Zt.sourceCaches[at.source]]:[]),Qr=Gr.filter(at=>at.getSource().type==="vector"),je=Gr.filter(at=>at.getSource().type!=="vector"),Ye=at=>{(!_r||_r.getSource().maxzoomYe(at)),_r||je.forEach(at=>Ye(at)),_r})(this.style,this.transform.zoom);Rt&&(function(Zt,yr,_r){for(let Gr=0;Gr<_r.length;Gr++)qc(Zt,yr,_r[Gr])})(this,Rt,Rt.getVisibleCoordinates())}this.options.showPadding&&(function(Rt){let Zt=Rt.transform.padding;uc(Rt,Rt.transform.height-(Zt.top||0),3,Gu),uc(Rt,Zt.bottom||0,3,Es),Qc(Rt,Zt.left||0,3,zc),Qc(Rt,Rt.transform.width-(Zt.right||0),3,ff);let yr=Rt.transform.centerPoint;(function(_r,Gr,Qr,je){$l(_r,Gr-1,Qr-10,2,20,je),$l(_r,Gr-10,Qr-1,20,2,je)})(Rt,yr.x,Rt.transform.height-yr.y,Vc)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(I){if(!this.style||!this.style.map||!this.style.map.terrain)return;let ne=this.terrainFacilitator.matrix,be=this.transform.modelViewProjectionMatrix,Ae=this.terrainFacilitator.dirty;Ae||(Ae=I?!t.a_(ne,be):!t.a$(ne,be)),Ae||(Ae=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),Ae&&(t.b0(ne,be),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Re,ut){let _t=Re.context,Rt=_t.gl,Zt=qs.unblended,yr=new Vo(Rt.LEQUAL,Vo.ReadWrite,[0,1]),_r=ut.getTerrainMesh(),Gr=ut.sourceCache.getRenderableTiles(),Qr=Re.useProgram("terrainDepth");_t.bindFramebuffer.set(ut.getFramebuffer("depth").framebuffer),_t.viewport.set([0,0,Re.width/devicePixelRatio,Re.height/devicePixelRatio]),_t.clear({color:t.aM.transparent,depth:1});for(let je of Gr){let Ye=ut.getTerrainData(je.tileID),at={u_matrix:Re.transform.calculatePosMatrix(je.tileID.toUnwrapped()),u_ele_delta:ut.getMeshFrameDelta(Re.transform.zoom)};Qr.draw(_t,Rt.TRIANGLES,yr,ss.disabled,Zt,Vi.backCCW,at,Ye,"terrain",_r.vertexBuffer,_r.indexBuffer,_r.segments)}_t.bindFramebuffer.set(null),_t.viewport.set([0,0,Re.width,Re.height])})(this,this.style.map.terrain),(function(Re,ut){let _t=Re.context,Rt=_t.gl,Zt=qs.unblended,yr=new Vo(Rt.LEQUAL,Vo.ReadWrite,[0,1]),_r=ut.getTerrainMesh(),Gr=ut.getCoordsTexture(),Qr=ut.sourceCache.getRenderableTiles(),je=Re.useProgram("terrainCoords");_t.bindFramebuffer.set(ut.getFramebuffer("coords").framebuffer),_t.viewport.set([0,0,Re.width/devicePixelRatio,Re.height/devicePixelRatio]),_t.clear({color:t.aM.transparent,depth:1}),ut.coordsIndex=[];for(let Ye of Qr){let at=ut.getTerrainData(Ye.tileID);_t.activeTexture.set(Rt.TEXTURE0),Rt.bindTexture(Rt.TEXTURE_2D,Gr.texture);let ct={u_matrix:Re.transform.calculatePosMatrix(Ye.tileID.toUnwrapped()),u_terrain_coords_id:(255-ut.coordsIndex.length)/255,u_texture:0,u_ele_delta:ut.getMeshFrameDelta(Re.transform.zoom)};je.draw(_t,Rt.TRIANGLES,yr,ss.disabled,Zt,Vi.backCCW,ct,at,"terrain",_r.vertexBuffer,_r.indexBuffer,_r.segments),ut.coordsIndex.push(Ye.tileID.key)}_t.bindFramebuffer.set(null),_t.viewport.set([0,0,Re.width,Re.height])})(this,this.style.map.terrain))}renderLayer(I,ne,be,Ae){if(!be.isHidden(this.transform.zoom)&&(be.type==="background"||be.type==="custom"||(Ae||[]).length))switch(this.id=be.id,be.type){case"symbol":(function(Re,ut,_t,Rt,Zt){if(Re.renderPass!=="translucent")return;let yr=ss.disabled,_r=Re.colorModeForRenderPass();(_t._unevaluatedLayout.hasValue("text-variable-anchor")||_t._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Gr,Qr,je,Ye,at,ct,At,yt,Ct){let nr=Qr.transform,vr=an(),Tr=at==="map",Fr=ct==="map";for(let Xr of Gr){let oa=Ye.getTile(Xr),ga=oa.getBucket(je);if(!ga||!ga.text||!ga.text.segments.get().length)continue;let Ma=t.ag(ga.textSizeData,nr.zoom),en=Ca(oa,1,Qr.transform.zoom),Dn=wr(Xr.posMatrix,Fr,Tr,Qr.transform,en),In=je.layout.get("icon-text-fit")!=="none"&&ga.hasIconData();if(Ma){let Kn=Math.pow(2,nr.zoom-oa.tileID.overscaledZ),vi=Qr.style.map.terrain?(Mi,so)=>Qr.style.map.terrain.getElevation(Xr,Mi,so):null,zi=vr.translatePosition(nr,oa,At,yt);yc(ga,Tr,Fr,Ct,nr,Dn,Xr.posMatrix,Kn,Ma,In,vr,zi,Xr.toUnwrapped(),vi)}}})(Rt,Re,_t,ut,_t.layout.get("text-rotation-alignment"),_t.layout.get("text-pitch-alignment"),_t.paint.get("text-translate"),_t.paint.get("text-translate-anchor"),Zt),_t.paint.get("icon-opacity").constantOr(1)!==0&&$c(Re,ut,_t,Rt,!1,_t.paint.get("icon-translate"),_t.paint.get("icon-translate-anchor"),_t.layout.get("icon-rotation-alignment"),_t.layout.get("icon-pitch-alignment"),_t.layout.get("icon-keep-upright"),yr,_r),_t.paint.get("text-opacity").constantOr(1)!==0&&$c(Re,ut,_t,Rt,!0,_t.paint.get("text-translate"),_t.paint.get("text-translate-anchor"),_t.layout.get("text-rotation-alignment"),_t.layout.get("text-pitch-alignment"),_t.layout.get("text-keep-upright"),yr,_r),ut.map.showCollisionBoxes&&(fu(Re,ut,_t,Rt,!0),fu(Re,ut,_t,Rt,!1))})(I,ne,be,Ae,this.style.placement.variableOffsets);break;case"circle":(function(Re,ut,_t,Rt){if(Re.renderPass!=="translucent")return;let Zt=_t.paint.get("circle-opacity"),yr=_t.paint.get("circle-stroke-width"),_r=_t.paint.get("circle-stroke-opacity"),Gr=!_t.layout.get("circle-sort-key").isConstant();if(Zt.constantOr(1)===0&&(yr.constantOr(1)===0||_r.constantOr(1)===0))return;let Qr=Re.context,je=Qr.gl,Ye=Re.depthModeForSublayer(0,Vo.ReadOnly),at=ss.disabled,ct=Re.colorModeForRenderPass(),At=[];for(let yt=0;ytyt.sortKey-Ct.sortKey);for(let yt of At){let{programConfiguration:Ct,program:nr,layoutVertexBuffer:vr,indexBuffer:Tr,uniformValues:Fr,terrainData:Xr}=yt.state;nr.draw(Qr,je.TRIANGLES,Ye,at,ct,Vi.disabled,Fr,Xr,_t.id,vr,Tr,yt.segments,_t.paint,Re.transform.zoom,Ct)}})(I,ne,be,Ae);break;case"heatmap":(function(Re,ut,_t,Rt){if(_t.paint.get("heatmap-opacity")===0)return;let Zt=Re.context;if(Re.style.map.terrain){for(let yr of Rt){let _r=ut.getTile(yr);ut.hasRenderableParent(yr)||(Re.renderPass==="offscreen"?_c(Re,_r,_t,yr):Re.renderPass==="translucent"&&ac(Re,_t,yr))}Zt.viewport.set([0,0,Re.width,Re.height])}else Re.renderPass==="offscreen"?(function(yr,_r,Gr,Qr){let je=yr.context,Ye=je.gl,at=ss.disabled,ct=new qs([Ye.ONE,Ye.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(At,yt,Ct){let nr=At.gl;At.activeTexture.set(nr.TEXTURE1),At.viewport.set([0,0,yt.width/4,yt.height/4]);let vr=Ct.heatmapFbos.get(t.aU);vr?(nr.bindTexture(nr.TEXTURE_2D,vr.colorAttachment.get()),At.bindFramebuffer.set(vr.framebuffer)):(vr=Uc(At,yt.width/4,yt.height/4),Ct.heatmapFbos.set(t.aU,vr))})(je,yr,Gr),je.clear({color:t.aM.transparent});for(let At=0;At20&&yr.texParameterf(yr.TEXTURE_2D,Zt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Zt.extTextureFilterAnisotropicMax);let ga=Re.style.map.terrain&&Re.style.map.terrain.getTerrainData(At),Ma=ga?At:null,en=Ma?Ma.posMatrix:Re.transform.calculatePosMatrix(At.toUnwrapped(),ct),Dn=$o(en,Xr||[0,0],Fr||1,Tr,_t);_r instanceof et?Gr.draw(Zt,yr.TRIANGLES,yt,ss.disabled,Qr,Vi.disabled,Dn,ga,_t.id,_r.boundsBuffer,Re.quadTriangleIndexBuffer,_r.boundsSegments):Gr.draw(Zt,yr.TRIANGLES,yt,je[At.overscaledZ],Qr,Vi.disabled,Dn,ga,_t.id,Re.rasterBoundsBuffer,Re.quadTriangleIndexBuffer,Re.rasterBoundsSegments)}})(I,ne,be,Ae);break;case"background":(function(Re,ut,_t,Rt){let Zt=_t.paint.get("background-color"),yr=_t.paint.get("background-opacity");if(yr===0)return;let _r=Re.context,Gr=_r.gl,Qr=Re.transform,je=Qr.tileSize,Ye=_t.paint.get("background-pattern");if(Re.isPatternMissing(Ye))return;let at=!Ye&&Zt.a===1&&yr===1&&Re.opaquePassEnabledForLayer()?"opaque":"translucent";if(Re.renderPass!==at)return;let ct=ss.disabled,At=Re.depthModeForSublayer(0,at==="opaque"?Vo.ReadWrite:Vo.ReadOnly),yt=Re.colorModeForRenderPass(),Ct=Re.useProgram(Ye?"backgroundPattern":"background"),nr=Rt||Qr.coveringTiles({tileSize:je,terrain:Re.style.map.terrain});Ye&&(_r.activeTexture.set(Gr.TEXTURE0),Re.imageManager.bind(Re.context));let vr=_t.getCrossfadeParameters();for(let Tr of nr){let Fr=Rt?Tr.posMatrix:Re.transform.calculatePosMatrix(Tr.toUnwrapped()),Xr=Ye?Ko(Fr,yr,Re,Ye,{tileID:Tr,tileSize:je},vr):Uo(Fr,yr,Zt),oa=Re.style.map.terrain&&Re.style.map.terrain.getTerrainData(Tr);Ct.draw(_r,Gr.TRIANGLES,At,ct,yt,Vi.disabled,Xr,oa,_t.id,Re.tileExtentBuffer,Re.quadTriangleIndexBuffer,Re.tileExtentSegments)}})(I,0,be,Ae);break;case"custom":(function(Re,ut,_t){let Rt=Re.context,Zt=_t.implementation;if(Re.renderPass==="offscreen"){let yr=Zt.prerender;yr&&(Re.setCustomLayerDefaults(),Rt.setColorMode(Re.colorModeForRenderPass()),yr.call(Zt,Rt.gl,Re.transform.customLayerMatrix()),Rt.setDirty(),Re.setBaseState())}else if(Re.renderPass==="translucent"){Re.setCustomLayerDefaults(),Rt.setColorMode(Re.colorModeForRenderPass()),Rt.setStencilMode(ss.disabled);let yr=Zt.renderingMode==="3d"?new Vo(Re.context.gl.LEQUAL,Vo.ReadWrite,Re.depthRangeFor3D):Re.depthModeForSublayer(0,Vo.ReadOnly);Rt.setDepthMode(yr),Zt.render(Rt.gl,Re.transform.customLayerMatrix(),{farZ:Re.transform.farZ,nearZ:Re.transform.nearZ,fov:Re.transform._fov,modelViewProjectionMatrix:Re.transform.modelViewProjectionMatrix,projectionMatrix:Re.transform.projectionMatrix}),Rt.setDirty(),Re.setBaseState(),Rt.bindFramebuffer.set(null)}})(I,0,be)}}translatePosMatrix(I,ne,be,Ae,Re){if(!be[0]&&!be[1])return I;let ut=Re?Ae==="map"?this.transform.angle:0:Ae==="viewport"?-this.transform.angle:0;if(ut){let Zt=Math.sin(ut),yr=Math.cos(ut);be=[be[0]*yr-be[1]*Zt,be[0]*Zt+be[1]*yr]}let _t=[Re?be[0]:Ca(ne,be[0],this.transform.zoom),Re?be[1]:Ca(ne,be[1],this.transform.zoom),0],Rt=new Float32Array(16);return t.J(Rt,I,_t),Rt}saveTileTexture(I){let ne=this._tileTextures[I.size[0]];ne?ne.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){let ne=this._tileTextures[I];return ne&&ne.length>0?ne.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;let ne=this.imageManager.getPattern(I.from.toString()),be=this.imageManager.getPattern(I.to.toString());return!ne||!be}useProgram(I,ne){this.cache=this.cache||{};let be=I+(ne?ne.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[be]||(this.cache[be]=new da(this.context,Ur[I],ne,us[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[be]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let I=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(I.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:I,drawingBufferHeight:ne}=this.context.gl;return this.width!==I||this.height!==ne}}class Os{constructor(I,ne){this.points=I,this.planes=ne}static fromInvProjectionMatrix(I,ne,be){let Ae=Math.pow(2,be),Re=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(_t=>{let Rt=1/(_t=t.af([],_t,I))[3]/ne*Ae;return t.b1(_t,_t,[Rt,Rt,1/_t[3],Rt])}),ut=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(_t=>{let Rt=(function(Gr,Qr){var je=Qr[0],Ye=Qr[1],at=Qr[2],ct=je*je+Ye*Ye+at*at;return ct>0&&(ct=1/Math.sqrt(ct)),Gr[0]=Qr[0]*ct,Gr[1]=Qr[1]*ct,Gr[2]=Qr[2]*ct,Gr})([],(function(Gr,Qr,je){var Ye=Qr[0],at=Qr[1],ct=Qr[2],At=je[0],yt=je[1],Ct=je[2];return Gr[0]=at*Ct-ct*yt,Gr[1]=ct*At-Ye*Ct,Gr[2]=Ye*yt-at*At,Gr})([],M([],Re[_t[0]],Re[_t[1]]),M([],Re[_t[2]],Re[_t[1]]))),Zt=-((yr=Rt)[0]*(_r=Re[_t[1]])[0]+yr[1]*_r[1]+yr[2]*_r[2]);var yr,_r;return Rt.concat(Zt)});return new Os(Re,ut)}}class zu{constructor(I,ne){this.min=I,this.max=ne,this.center=(function(be,Ae,Re){return be[0]=.5*Ae[0],be[1]=.5*Ae[1],be[2]=.5*Ae[2],be})([],(function(be,Ae,Re){return be[0]=Ae[0]+Re[0],be[1]=Ae[1]+Re[1],be[2]=Ae[2]+Re[2],be})([],this.min,this.max))}quadrant(I){let ne=[I%2==0,I<2],be=w(this.min),Ae=w(this.max);for(let Re=0;Re=0&&ut++;if(ut===0)return 0;ut!==ne.length&&(be=!1)}if(be)return 2;for(let Ae=0;Ae<3;Ae++){let Re=Number.MAX_VALUE,ut=-Number.MAX_VALUE;for(let _t=0;_tthis.max[Ae]-this.min[Ae])return 0}return 1}}class ql{constructor(I=0,ne=0,be=0,Ae=0){if(isNaN(I)||I<0||isNaN(ne)||ne<0||isNaN(be)||be<0||isNaN(Ae)||Ae<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ne,this.left=be,this.right=Ae}interpolate(I,ne,be){return ne.top!=null&&I.top!=null&&(this.top=t.y.number(I.top,ne.top,be)),ne.bottom!=null&&I.bottom!=null&&(this.bottom=t.y.number(I.bottom,ne.bottom,be)),ne.left!=null&&I.left!=null&&(this.left=t.y.number(I.left,ne.left,be)),ne.right!=null&&I.right!=null&&(this.right=t.y.number(I.right,ne.right,be)),this}getCenter(I,ne){let be=t.ac((this.left+I-this.right)/2,0,I),Ae=t.ac((this.top+ne-this.bottom)/2,0,ne);return new t.P(be,Ae)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new ql(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Xl=85.051129;class rl{constructor(I,ne,be,Ae,Re){this.tileSize=512,this._renderWorldCopies=Re===void 0||!!Re,this._minZoom=I||0,this._maxZoom=ne||22,this._minPitch=be??0,this._maxPitch=Ae??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ql,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let I=new rl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(I){let ne=-t.b3(I,-180,180)*Math.PI/180;this.angle!==ne&&(this._unmodified=!1,this.angle=ne,this._calcMatrices(),this.rotationMatrix=(function(){var be=new t.A(4);return t.A!=Float32Array&&(be[1]=0,be[2]=0),be[0]=1,be[3]=1,be})(),(function(be,Ae,Re){var ut=Ae[0],_t=Ae[1],Rt=Ae[2],Zt=Ae[3],yr=Math.sin(Re),_r=Math.cos(Re);be[0]=ut*_r+Rt*yr,be[1]=_t*_r+Zt*yr,be[2]=ut*-yr+Rt*_r,be[3]=_t*-yr+Zt*_r})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){let ne=t.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ne&&(this._unmodified=!1,this._pitch=ne,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){let ne=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ne&&(this._unmodified=!1,this._zoom=ne,this.tileZoom=Math.max(0,Math.floor(ne)),this.scale=this.zoomScale(ne),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ne,be){this._unmodified=!1,this._edgeInsets.interpolate(I,ne,be),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){let ne=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ne)}getVisibleUnwrappedCoordinates(I){let ne=[new t.b4(0,I)];if(this._renderWorldCopies){let be=this.pointCoordinate(new t.P(0,0)),Ae=this.pointCoordinate(new t.P(this.width,0)),Re=this.pointCoordinate(new t.P(this.width,this.height)),ut=this.pointCoordinate(new t.P(0,this.height)),_t=Math.floor(Math.min(be.x,Ae.x,Re.x,ut.x)),Rt=Math.floor(Math.max(be.x,Ae.x,Re.x,ut.x)),Zt=1;for(let yr=_t-Zt;yr<=Rt+Zt;yr++)yr!==0&&ne.push(new t.b4(yr,I))}return ne}coveringTiles(I){var ne,be;let Ae=this.coveringZoomLevel(I),Re=Ae;if(I.minzoom!==void 0&&AeI.maxzoom&&(Ae=I.maxzoom);let ut=this.pointCoordinate(this.getCameraPoint()),_t=t.Z.fromLngLat(this.center),Rt=Math.pow(2,Ae),Zt=[Rt*ut.x,Rt*ut.y,0],yr=[Rt*_t.x,Rt*_t.y,0],_r=Os.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ae),Gr=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Gr=Ae);let Qr=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,je=yt=>({aabb:new zu([yt*Rt,0,0],[(yt+1)*Rt,Rt,0]),zoom:0,x:0,y:0,wrap:yt,fullyVisible:!1}),Ye=[],at=[],ct=Ae,At=I.reparseOverscaled?Re:Ae;if(this._renderWorldCopies)for(let yt=1;yt<=3;yt++)Ye.push(je(-yt)),Ye.push(je(yt));for(Ye.push(je(0));Ye.length>0;){let yt=Ye.pop(),Ct=yt.x,nr=yt.y,vr=yt.fullyVisible;if(!vr){let ga=yt.aabb.intersects(_r);if(ga===0)continue;vr=ga===2}let Tr=I.terrain?Zt:yr,Fr=yt.aabb.distanceX(Tr),Xr=yt.aabb.distanceY(Tr),oa=Math.max(Math.abs(Fr),Math.abs(Xr));if(yt.zoom===ct||oa>Qr+(1<=Gr){let ga=ct-yt.zoom,Ma=Zt[0]-.5-(Ct<>1),Dn=yt.zoom+1,In=yt.aabb.quadrant(ga);if(I.terrain){let Kn=new t.S(Dn,yt.wrap,Dn,Ma,en),vi=I.terrain.getMinMaxElevation(Kn),zi=(ne=vi.minElevation)!==null&&ne!==void 0?ne:this.elevation,Mi=(be=vi.maxElevation)!==null&&be!==void 0?be:this.elevation;In=new zu([In.min[0],In.min[1],zi],[In.max[0],In.max[1],Mi])}Ye.push({aabb:In,zoom:Dn,x:Ma,y:en,wrap:yt.wrap,fullyVisible:vr})}}return at.sort((yt,Ct)=>yt.distanceSq-Ct.distanceSq).map(yt=>yt.tileID)}resize(I,ne){this.width=I,this.height=ne,this.pixelsToGLUnits=[2/I,-2/ne],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){let ne=t.ac(I.lat,-85.051129,Xl);return new t.P(t.O(I.lng)*this.worldSize,t.Q(ne)*this.worldSize)}unproject(I){return new t.Z(I.x/this.worldSize,I.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(I){let ne=this.elevation,be=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ae=this.pointLocation(this.centerPoint,I),Re=I.getElevationForLngLatZoom(Ae,this.tileZoom);if(!(this.elevation-Re))return;let ut=be+ne-Re,_t=Math.cos(this._pitch)*this.cameraToCenterDistance/ut/t.b5(1,Ae.lat),Rt=this.scaleZoom(_t/this.tileSize);this._elevation=Re,this._center=Ae,this.zoom=Rt}setLocationAtPoint(I,ne){let be=this.pointCoordinate(ne),Ae=this.pointCoordinate(this.centerPoint),Re=this.locationCoordinate(I),ut=new t.Z(Re.x-(be.x-Ae.x),Re.y-(be.y-Ae.y));this.center=this.coordinateLocation(ut),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ne){return ne?this.coordinatePoint(this.locationCoordinate(I),ne.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ne){return this.coordinateLocation(this.pointCoordinate(I,ne))}locationCoordinate(I){return t.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ne){if(ne){let Gr=ne.pointCoordinate(I);if(Gr!=null)return Gr}let be=[I.x,I.y,0,1],Ae=[I.x,I.y,1,1];t.af(be,be,this.pixelMatrixInverse),t.af(Ae,Ae,this.pixelMatrixInverse);let Re=be[3],ut=Ae[3],_t=be[1]/Re,Rt=Ae[1]/ut,Zt=be[2]/Re,yr=Ae[2]/ut,_r=Zt===yr?0:(0-Zt)/(yr-Zt);return new t.Z(t.y.number(be[0]/Re,Ae[0]/ut,_r)/this.worldSize,t.y.number(_t,Rt,_r)/this.worldSize)}coordinatePoint(I,ne=0,be=this.pixelMatrix){let Ae=[I.x*this.worldSize,I.y*this.worldSize,ne,1];return t.af(Ae,Ae,be),new t.P(Ae[0]/Ae[3],Ae[1]/Ae[3])}getBounds(){let I=Math.max(0,this.height/2-this.getHorizon());return new re().extend(this.pointLocation(new t.P(0,I))).extend(this.pointLocation(new t.P(this.width,I))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new re([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Xl])}calculateTileMatrix(I){let ne=I.canonical,be=this.worldSize/this.zoomScale(ne.z),Ae=ne.x+Math.pow(2,ne.z)*I.wrap,Re=t.an(new Float64Array(16));return t.J(Re,Re,[Ae*be,ne.y*be,0]),t.K(Re,Re,[be/t.X,be/t.X,1]),Re}calculatePosMatrix(I,ne=!1){let be=I.key,Ae=ne?this._alignedPosMatrixCache:this._posMatrixCache;if(Ae[be])return Ae[be];let Re=this.calculateTileMatrix(I);return t.L(Re,ne?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Re),Ae[be]=new Float32Array(Re),Ae[be]}calculateFogMatrix(I){let ne=I.key,be=this._fogMatrixCache;if(be[ne])return be[ne];let Ae=this.calculateTileMatrix(I);return t.L(Ae,this.fogMatrix,Ae),be[ne]=new Float32Array(Ae),be[ne]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ne){ne=t.ac(+ne,this.minZoom,this.maxZoom);let be={center:new t.N(I.lng,I.lat),zoom:ne},Ae=this.lngRange;if(!this._renderWorldCopies&&Ae===null){let yt=179.9999999999;Ae=[-yt,yt]}let Re=this.tileSize*this.zoomScale(be.zoom),ut=0,_t=Re,Rt=0,Zt=Re,yr=0,_r=0,{x:Gr,y:Qr}=this.size;if(this.latRange){let yt=this.latRange;ut=t.Q(yt[1])*Re,_t=t.Q(yt[0])*Re,_t-ut_t&&(ct=_t-yt)}if(Ae){let yt=(Rt+Zt)/2,Ct=je;this._renderWorldCopies&&(Ct=t.b3(je,yt-Re/2,yt+Re/2));let nr=Gr/2;Ct-nrZt&&(at=Zt-nr)}if(at!==void 0||ct!==void 0){let yt=new t.P(at??je,ct??Ye);be.center=this.unproject.call({worldSize:Re},yt).wrap()}return be}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let I=this._unmodified,{center:ne,zoom:be}=this.getConstrained(this.center,this.zoom);this.center=ne,this.zoom=be,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;let I=this.centerOffset,ne=this.point.x,be=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Ae=t.an(new Float64Array(16));t.K(Ae,Ae,[this.width/2,-this.height/2,1]),t.J(Ae,Ae,[1,-1,0]),this.labelPlaneMatrix=Ae,Ae=t.an(new Float64Array(16)),t.K(Ae,Ae,[1,-1,1]),t.J(Ae,Ae,[-1,-1,0]),t.K(Ae,Ae,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ae;let Re=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ut=Math.min(this.elevation,this.minElevationForCurrentTile),_t=Re-ut*this._pixelPerMeter/Math.cos(this._pitch),Rt=ut<0?_t:Re,Zt=Math.PI/2+this._pitch,yr=this._fov*(.5+I.y/this.height),_r=Math.sin(yr)*Rt/Math.sin(t.ac(Math.PI-Zt-yr,.01,Math.PI-.01)),Gr=this.getHorizon(),Qr=2*Math.atan(Gr/this.cameraToCenterDistance)*(.5+I.y/(2*Gr)),je=Math.sin(Qr)*Rt/Math.sin(t.ac(Math.PI-Zt-Qr,.01,Math.PI-.01)),Ye=Math.min(_r,je);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ye+Rt),this.nearZ=this.height/50,Ae=new Float64Array(16),t.b6(Ae,this._fov,this.width/this.height,this.nearZ,this.farZ),Ae[8]=2*-I.x/this.width,Ae[9]=2*I.y/this.height,this.projectionMatrix=t.ae(Ae),t.K(Ae,Ae,[1,-1,1]),t.J(Ae,Ae,[0,0,-this.cameraToCenterDistance]),t.b7(Ae,Ae,this._pitch),t.ad(Ae,Ae,this.angle),t.J(Ae,Ae,[-ne,-be,0]),this.mercatorMatrix=t.K([],Ae,[this.worldSize,this.worldSize,this.worldSize]),t.K(Ae,Ae,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Ae),t.J(Ae,Ae,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ae,this.invModelViewProjectionMatrix=t.as([],Ae),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Re,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ne,-be,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Ae);let at=this.width%2/2,ct=this.height%2/2,At=Math.cos(this.angle),yt=Math.sin(this.angle),Ct=ne-Math.round(ne)+At*at+yt*ct,nr=be-Math.round(be)+At*ct+yt*at,vr=new Float64Array(Ae);if(t.J(vr,vr,[Ct>.5?Ct-1:Ct,nr>.5?nr-1:nr,0]),this.alignedModelViewProjectionMatrix=vr,Ae=t.as(new Float64Array(16),this.pixelMatrix),!Ae)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ae,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let I=this.pointCoordinate(new t.P(0,0)),ne=[I.x*this.worldSize,I.y*this.worldSize,0,1];return t.af(ne,ne,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,I))}getCameraQueryGeometry(I){let ne=this.getCameraPoint();if(I.length===1)return[I[0],ne];{let be=ne.x,Ae=ne.y,Re=ne.x,ut=ne.y;for(let _t of I)be=Math.min(be,_t.x),Ae=Math.min(Ae,_t.y),Re=Math.max(Re,_t.x),ut=Math.max(ut,_t.y);return[new t.P(be,Ae),new t.P(Re,Ae),new t.P(Re,ut),new t.P(be,ut),new t.P(be,Ae)]}}lngLatToCameraDepth(I,ne){let be=this.locationCoordinate(I),Ae=[be.x*this.worldSize,be.y*this.worldSize,ne,1];return t.af(Ae,Ae,this.modelViewProjectionMatrix),Ae[2]/Ae[3]}}function Gc(De,I){let ne,be=!1,Ae=null,Re=null,ut=()=>{Ae=null,be&&(De.apply(Re,ne),Ae=setTimeout(ut,I),be=!1)};return(..._t)=>(be=!0,Re=this,ne=_t,Ae||ut(),Ae)}class ef{constructor(I){this._getCurrentHash=()=>{let ne=window.location.hash.replace("#","");if(this._hashName){let be;return ne.split("&").map(Ae=>Ae.split("=")).forEach(Ae=>{Ae[0]===this._hashName&&(be=Ae)}),(be&&be[1]||"").split("/")}return ne.split("/")},this._onHashChange=()=>{let ne=this._getCurrentHash();if(ne.length>=3&&!ne.some(be=>isNaN(be))){let be=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ne[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ne[2],+ne[1]],zoom:+ne[0],bearing:be,pitch:+(ne[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let ne=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ne)},this._removeHash=()=>{let ne=this._getCurrentHash();if(ne.length===0)return;let be=ne.join("/"),Ae=be;Ae.split("&").length>0&&(Ae=Ae.split("&")[0]),this._hashName&&(Ae=`${this._hashName}=${be}`);let Re=window.location.hash.replace(Ae,"");Re.startsWith("#&")?Re=Re.slice(0,1)+Re.slice(2):Re==="#"&&(Re="");let ut=window.location.href.replace(/(#.+)?$/,Re);ut=ut.replace("&&","&"),window.history.replaceState(window.history.state,null,ut)},this._updateHash=Gc(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(I){let ne=this._map.getCenter(),be=Math.round(100*this._map.getZoom())/100,Ae=Math.ceil((be*Math.LN2+Math.log(512/360/.5))/Math.LN10),Re=Math.pow(10,Ae),ut=Math.round(ne.lng*Re)/Re,_t=Math.round(ne.lat*Re)/Re,Rt=this._map.getBearing(),Zt=this._map.getPitch(),yr="";if(yr+=I?`/${ut}/${_t}/${be}`:`${be}/${_t}/${ut}`,(Rt||Zt)&&(yr+="/"+Math.round(10*Rt)/10),Zt&&(yr+=`/${Math.round(Zt)}`),this._hashName){let _r=this._hashName,Gr=!1,Qr=window.location.hash.slice(1).split("&").map(je=>{let Ye=je.split("=")[0];return Ye===_r?(Gr=!0,`${Ye}=${yr}`):je}).filter(je=>je);return Gr||Qr.push(`${_r}=${yr}`),`#${Qr.join("&")}`}return`#${yr}`}}let su={linearity:.3,easing:t.b8(0,0,.3,1)},Wu=t.e({deceleration:2500,maxSpeed:1400},su),Fu=t.e({deceleration:20,maxSpeed:1400},su),kf=t.e({deceleration:1e3,maxSpeed:360},su),xc=t.e({deceleration:1e3,maxSpeed:90},su);class Mc{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:I})}_drainInertiaBuffer(){let I=this._inertiaBuffer,ne=i.now();for(;I.length>0&&ne-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let ne={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Re}of this._inertiaBuffer)ne.zoom+=Re.zoomDelta||0,ne.bearing+=Re.bearingDelta||0,ne.pitch+=Re.pitchDelta||0,Re.panDelta&&ne.pan._add(Re.panDelta),Re.around&&(ne.around=Re.around),Re.pinchAround&&(ne.pinchAround=Re.pinchAround);let be=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ae={};if(ne.pan.mag()){let Re=bc(ne.pan.mag(),be,t.e({},Wu,I||{}));Ae.offset=ne.pan.mult(Re.amount/ne.pan.mag()),Ae.center=this._map.transform.center,lu(Ae,Re)}if(ne.zoom){let Re=bc(ne.zoom,be,Fu);Ae.zoom=this._map.transform.zoom+Re.amount,lu(Ae,Re)}if(ne.bearing){let Re=bc(ne.bearing,be,kf);Ae.bearing=this._map.transform.bearing+t.ac(Re.amount,-179,179),lu(Ae,Re)}if(ne.pitch){let Re=bc(ne.pitch,be,xc);Ae.pitch=this._map.transform.pitch+Re.amount,lu(Ae,Re)}if(Ae.zoom||Ae.bearing){let Re=ne.pinchAround===void 0?ne.around:ne.pinchAround;Ae.around=Re?this._map.unproject(Re):this._map.getCenter()}return this.clear(),t.e(Ae,{noMoveStart:!0})}}function lu(De,I){(!De.duration||De.durationne.unproject(Rt)),_t=Re.reduce((Rt,Zt,yr,_r)=>Rt.add(Zt.div(_r.length)),new t.P(0,0));super(I,{points:Re,point:_t,lngLats:ut,lngLat:ne.unproject(_t),originalEvent:be}),this._defaultPrevented=!1}}class hf extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ne,be){super(I,{originalEvent:be}),this._defaultPrevented=!1}}class Ec{constructor(I,ne){this._map=I,this._clickTolerance=ne.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new hf(I.type,this._map,I))}mousedown(I,ne){return this._mousedownPos=ne,this._firePreventable(new Ll(I.type,this._map,I))}mouseup(I){this._map.fire(new Ll(I.type,this._map,I))}click(I,ne){this._mousedownPos&&this._mousedownPos.dist(ne)>=this._clickTolerance||this._map.fire(new Ll(I.type,this._map,I))}dblclick(I){return this._firePreventable(new Ll(I.type,this._map,I))}mouseover(I){this._map.fire(new Ll(I.type,this._map,I))}mouseout(I){this._map.fire(new Ll(I.type,this._map,I))}touchstart(I){return this._firePreventable(new cc(I.type,this._map,I))}touchmove(I){this._map.fire(new cc(I.type,this._map,I))}touchend(I){this._map.fire(new cc(I.type,this._map,I))}touchcancel(I){this._map.fire(new cc(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bs{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new Ll(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ll("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new Ll(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gl{constructor(I){this._map=I}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(I){return this.transform.pointLocation(t.P.convert(I),this._map.terrain)}}class eu{constructor(I,ne){this._map=I,this._tr=new Gl(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ne.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ne){this.isEnabled()&&I.shiftKey&&I.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ne,this._active=!0)}mousemoveWindow(I,ne){if(!this._active)return;let be=ne;if(this._lastPos.equals(be)||!this._box&&be.dist(this._startPos)Re.fitScreenCoordinates(be,Ae,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(I,ne){return this._map.fire(new t.k(I,{originalEvent:ne}))}}function Fc(De,I){if(De.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${De.length}, points ${I.length}`);let ne={};for(let be=0;bethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),be.length===this.numTouches&&(this.centroid=(function(Ae){let Re=new t.P(0,0);for(let ut of Ae)Re._add(ut);return Re.div(Ae.length)})(ne),this.touches=Fc(be,ne)))}touchmove(I,ne,be){if(this.aborted||!this.centroid)return;let Ae=Fc(be,ne);for(let Re in this.touches){let ut=Ae[Re];(!ut||ut.dist(this.touches[Re])>30)&&(this.aborted=!0)}}touchend(I,ne,be){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),be.length===0){let Ae=!this.aborted&&this.centroid;if(this.reset(),Ae)return Ae}}}class wc{constructor(I){this.singleTap=new Gs(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ne,be){this.singleTap.touchstart(I,ne,be)}touchmove(I,ne,be){this.singleTap.touchmove(I,ne,be)}touchend(I,ne,be){let Ae=this.singleTap.touchend(I,ne,be);if(Ae){let Re=I.timeStamp-this.lastTime<500,ut=!this.lastTap||this.lastTap.dist(Ae)<30;if(Re&&ut||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=Ae,this.count===this.numTaps)return this.reset(),Ae}}}class Xu{constructor(I){this._tr=new Gl(I),this._zoomIn=new wc({numTouches:1,numTaps:2}),this._zoomOut=new wc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ne,be){this._zoomIn.touchstart(I,ne,be),this._zoomOut.touchstart(I,ne,be)}touchmove(I,ne,be){this._zoomIn.touchmove(I,ne,be),this._zoomOut.touchmove(I,ne,be)}touchend(I,ne,be){let Ae=this._zoomIn.touchend(I,ne,be),Re=this._zoomOut.touchend(I,ne,be),ut=this._tr;return Ae?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_t=>_t.easeTo({duration:300,zoom:ut.zoom+1,around:ut.unproject(Ae)},{originalEvent:I})}):Re?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_t=>_t.easeTo({duration:300,zoom:ut.zoom-1,around:ut.unproject(Re)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vu{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){let ne=this._moveFunction(...I);if(ne.bearingDelta||ne.pitchDelta||ne.around||ne.panDelta)return this._active=!0,ne}dragStart(I,ne){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ne.length?ne[0]:ne,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ne){if(!this.isEnabled())return;let be=this._lastPoint;if(!be)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);let Ae=ne.length?ne[0]:ne;return!this._moved&&Ae.dist(be){De.mousedown=De.dragStart,De.mousemoveWindow=De.dragMove,De.mouseup=De.dragEnd,De.contextmenu=I=>{I.preventDefault()}},Pl=({enable:De,clickTolerance:I,bearingDegreesPerPixelMoved:ne=.8})=>{let be=new du({checkCorrectEvent:Ae=>n.mouseButton(Ae)===0&&Ae.ctrlKey||n.mouseButton(Ae)===2});return new vu({clickTolerance:I,move:(Ae,Re)=>({bearingDelta:(Re.x-Ae.x)*ne}),moveStateManager:be,enable:De,assignEvents:Oc})},Hc=({enable:De,clickTolerance:I,pitchDegreesPerPixelMoved:ne=-.5})=>{let be=new du({checkCorrectEvent:Ae=>n.mouseButton(Ae)===0&&Ae.ctrlKey||n.mouseButton(Ae)===2});return new vu({clickTolerance:I,move:(Ae,Re)=>({pitchDelta:(Re.y-Ae.y)*ne}),moveStateManager:be,enable:De,assignEvents:Oc})};class pu{constructor(I,ne){this._clickTolerance=I.clickTolerance||1,this._map=ne,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ne,be){return this._calculateTransform(I,ne,be)}touchmove(I,ne,be){if(this._active){if(!this._shouldBePrevented(be.length))return I.preventDefault(),this._calculateTransform(I,ne,be);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ne,be){this._calculateTransform(I,ne,be),this._active&&this._shouldBePrevented(be.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ne,be){be.length>0&&(this._active=!0);let Ae=Fc(be,ne),Re=new t.P(0,0),ut=new t.P(0,0),_t=0;for(let Zt in Ae){let yr=Ae[Zt],_r=this._touches[Zt];_r&&(Re._add(yr),ut._add(yr.sub(_r)),_t++,Ae[Zt]=yr)}if(this._touches=Ae,this._shouldBePrevented(_t)||!ut.mag())return;let Rt=ut.div(_t);return this._sum._add(Rt),this._sum.mag()Math.abs(De.x)}class Ku extends Zu{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ne,be){super.touchstart(I,ne,be),this._currentTouchCount=be.length}_start(I){this._lastPoints=I,Eu(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ne,be){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Ae=I[0].sub(this._lastPoints[0]),Re=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ae,Re,be.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(Ae.y+Re.y)/2*-.5}):void 0}gestureBeginsVertically(I,ne,be){if(this._valid!==void 0)return this._valid;let Ae=I.mag()>=2,Re=ne.mag()>=2;if(!Ae&&!Re)return;if(!Ae||!Re)return this._firstMove===void 0&&(this._firstMove=be),be-this._firstMove<100&&void 0;let ut=I.y>0==ne.y>0;return Eu(I)&&Eu(ne)&&ut}}let Yt={panStep:100,bearingStep:15,pitchStep:10};class mr{constructor(I){this._tr=new Gl(I);let ne=Yt;this._panStep=ne.panStep,this._bearingStep=ne.bearingStep,this._pitchStep=ne.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ne=0,be=0,Ae=0,Re=0,ut=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ne=1;break;case 189:case 109:case 173:ne=-1;break;case 37:I.shiftKey?be=-1:(I.preventDefault(),Re=-1);break;case 39:I.shiftKey?be=1:(I.preventDefault(),Re=1);break;case 38:I.shiftKey?Ae=1:(I.preventDefault(),ut=-1);break;case 40:I.shiftKey?Ae=-1:(I.preventDefault(),ut=1);break;default:return}return this._rotationDisabled&&(be=0,Ae=0),{cameraAnimation:_t=>{let Rt=this._tr;_t.easeTo({duration:300,easeId:"keyboardHandler",easing:Jr,zoom:ne?Math.round(Rt.zoom)+ne*(I.shiftKey?2:1):Rt.zoom,bearing:Rt.bearing+be*this._bearingStep,pitch:Rt.pitch+Ae*this._pitchStep,offset:[-Re*this._panStep,-ut*this._panStep],center:Rt.center},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Jr(De){return De*(2-De)}let Wr=4.000244140625;class xa{constructor(I,ne){this._onTimeout=be=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(be)},this._map=I,this._tr=new Gl(I),this._triggerRenderFrame=ne,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ne=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY,be=i.now(),Ae=be-(this._lastWheelEventTime||0);this._lastWheelEventTime=be,ne!==0&&ne%Wr==0?this._type="wheel":ne!==0&&Math.abs(ne)<4?this._type="trackpad":Ae>400?(this._type=null,this._lastValue=ne,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(Ae*ne)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ne+=this._lastValue)),I.shiftKey&&ne&&(ne/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ne,this._active||this._start(I)),I.preventDefault()}_start(I){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let ne=n.mousePos(this._map.getCanvas(),I),be=this._tr;this._around=ne.y>be.transform.height/2-be.transform.getHorizon()?t.N.convert(this._aroundCenter?be.center:be.unproject(ne)):t.N.convert(be.center),this._aroundPoint=be.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let I=this._tr.transform;if(this._delta!==0){let Rt=this._type==="wheel"&&Math.abs(this._delta)>Wr?this._wheelZoomRate:this._defaultZoomRate,Zt=2/(1+Math.exp(-Math.abs(this._delta*Rt)));this._delta<0&&Zt!==0&&(Zt=1/Zt);let yr=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(yr*Zt))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let ne=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,be=this._startZoom,Ae=this._easing,Re,ut=!1,_t=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&be&&Ae&&_t){let Rt=Math.min(_t/200,1),Zt=Ae(Rt);Re=t.y.number(be,ne,Zt),Rt<1?this._frameId||(this._frameId=!0):ut=!0}else Re=ne,ut=!0;return this._active=!0,ut&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ut,zoomDelta:Re-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ne=t.b9;if(this._prevEase){let be=this._prevEase,Ae=(i.now()-be.start)/be.duration,Re=be.easing(Ae+.01)-be.easing(Ae),ut=.27/Math.sqrt(Re*Re+1e-4)*.01,_t=Math.sqrt(.0729-ut*ut);ne=t.b8(ut,_t,.25,1)}return this._prevEase={start:i.now(),duration:I,easing:ne},ne}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class $a{constructor(I,ne){this._clickZoom=I,this._tapZoom=ne}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class xn{constructor(I){this._tr=new Gl(I),this.reset()}reset(){this._active=!1}dblclick(I,ne){return I.preventDefault(),{cameraAnimation:be=>{be.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ne)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fn{constructor(){this._tap=new wc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(I,ne,be){if(!this._swipePoint)if(this._tapTime){let Ae=ne[0],Re=I.timeStamp-this._tapTime<500,ut=this._tapPoint.dist(Ae)<30;Re&&ut?be.length>0&&(this._swipePoint=Ae,this._swipeTouch=be[0].identifier):this.reset()}else this._tap.touchstart(I,ne,be)}touchmove(I,ne,be){if(this._tapTime){if(this._swipePoint){if(be[0].identifier!==this._swipeTouch)return;let Ae=ne[0],Re=Ae.y-this._swipePoint.y;return this._swipePoint=Ae,I.preventDefault(),this._active=!0,{zoomDelta:Re/128}}}else this._tap.touchmove(I,ne,be)}touchend(I,ne,be){if(this._tapTime)this._swipePoint&&be.length===0&&this.reset();else{let Ae=this._tap.touchend(I,ne,be);Ae&&(this._tapTime=I.timeStamp,this._tapPoint=Ae)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gn{constructor(I,ne,be){this._el=I,this._mousePan=ne,this._touchPan=be}enable(I){this._inertiaOptions=I||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ai{constructor(I,ne,be){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ne,this._mousePitch=be}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class wn{constructor(I,ne,be,Ae){this._el=I,this._touchZoom=ne,this._touchRotate=be,this._tapDragZoom=Ae,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Sn{constructor(I,ne){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ne,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",I);let ne=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ne=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let be=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ae=document.createElement("div");Ae.className="maplibregl-desktop-message",Ae.textContent=ne,this._container.appendChild(Ae);let Re=document.createElement("div");Re.className="maplibregl-mobile-message",Re.textContent=be,this._container.appendChild(Re),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(I){return I[this._bypassKey]}notifyGestureBlocked(I,ne){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:I,originalEvent:ne})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Ln=De=>De.zoom||De.drag||De.pitch||De.rotate;class sn extends t.k{}function di(De){return De.panDelta&&De.panDelta.mag()||De.zoomDelta||De.bearingDelta||De.pitchDelta}class Ni{constructor(I,ne){this.handleWindowEvent=Ae=>{this.handleEvent(Ae,`${Ae.type}Window`)},this.handleEvent=(Ae,Re)=>{if(Ae.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let ut=Ae.type==="renderFrame"?void 0:Ae,_t={needsRenderFrame:!1},Rt={},Zt={},yr=Ae.touches,_r=yr?this._getMapTouches(yr):void 0,Gr=_r?n.touchPos(this._map.getCanvas(),_r):n.mousePos(this._map.getCanvas(),Ae);for(let{handlerName:Ye,handler:at,allowed:ct}of this._handlers){if(!at.isEnabled())continue;let At;this._blockedByActive(Zt,ct,Ye)?at.reset():at[Re||Ae.type]&&(At=at[Re||Ae.type](Ae,Gr,_r),this.mergeHandlerResult(_t,Rt,At,Ye,ut),At&&At.needsRenderFrame&&this._triggerRenderFrame()),(At||at.isActive())&&(Zt[Ye]=at)}let Qr={};for(let Ye in this._previousActiveHandlers)Zt[Ye]||(Qr[Ye]=ut);this._previousActiveHandlers=Zt,(Object.keys(Qr).length||di(_t))&&(this._changes.push([_t,Rt,Qr]),this._triggerRenderFrame()),(Object.keys(Zt).length||di(_t))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:je}=_t;je&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],je(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Mc(I),this._bearingSnap=ne.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ne);let be=this._el;this._listeners=[[be,"touchstart",{passive:!0}],[be,"touchmove",{passive:!1}],[be,"touchend",void 0],[be,"touchcancel",void 0],[be,"mousedown",void 0],[be,"mousemove",void 0],[be,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[be,"mouseover",void 0],[be,"mouseout",void 0],[be,"dblclick",void 0],[be,"click",void 0],[be,"keydown",{capture:!1}],[be,"keyup",void 0],[be,"wheel",{passive:!1}],[be,"contextmenu",void 0],[window,"blur",void 0]];for(let[Ae,Re,ut]of this._listeners)n.addEventListener(Ae,Re,Ae===document?this.handleWindowEvent:this.handleEvent,ut)}destroy(){for(let[I,ne,be]of this._listeners)n.removeEventListener(I,ne,I===document?this.handleWindowEvent:this.handleEvent,be)}_addDefaultHandlers(I){let ne=this._map,be=ne.getCanvasContainer();this._add("mapEvent",new Ec(ne,I));let Ae=ne.boxZoom=new eu(ne,I);this._add("boxZoom",Ae),I.interactive&&I.boxZoom&&Ae.enable();let Re=ne.cooperativeGestures=new Sn(ne,I.cooperativeGestures);this._add("cooperativeGestures",Re),I.cooperativeGestures&&Re.enable();let ut=new Xu(ne),_t=new xn(ne);ne.doubleClickZoom=new $a(_t,ut),this._add("tapZoom",ut),this._add("clickZoom",_t),I.interactive&&I.doubleClickZoom&&ne.doubleClickZoom.enable();let Rt=new Fn;this._add("tapDragZoom",Rt);let Zt=ne.touchPitch=new Ku(ne);this._add("touchPitch",Zt),I.interactive&&I.touchPitch&&ne.touchPitch.enable(I.touchPitch);let yr=Pl(I),_r=Hc(I);ne.dragRotate=new ai(I,yr,_r),this._add("mouseRotate",yr,["mousePitch"]),this._add("mousePitch",_r,["mouseRotate"]),I.interactive&&I.dragRotate&&ne.dragRotate.enable();let Gr=(({enable:At,clickTolerance:yt})=>{let Ct=new du({checkCorrectEvent:nr=>n.mouseButton(nr)===0&&!nr.ctrlKey});return new vu({clickTolerance:yt,move:(nr,vr)=>({around:vr,panDelta:vr.sub(nr)}),activateOnStart:!0,moveStateManager:Ct,enable:At,assignEvents:Oc})})(I),Qr=new pu(I,ne);ne.dragPan=new Gn(be,Gr,Qr),this._add("mousePan",Gr),this._add("touchPan",Qr,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ne.dragPan.enable(I.dragPan);let je=new hc,Ye=new Hl;ne.touchZoomRotate=new wn(be,Ye,je,Rt),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",Ye,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ne.touchZoomRotate.enable(I.touchZoomRotate);let at=ne.scrollZoom=new xa(ne,()=>this._triggerRenderFrame());this._add("scrollZoom",at,["mousePan"]),I.interactive&&I.scrollZoom&&ne.scrollZoom.enable(I.scrollZoom);let ct=ne.keyboard=new mr(ne);this._add("keyboard",ct),I.interactive&&I.keyboard&&ne.keyboard.enable(),this._add("blockableMapEvent",new Bs(ne))}_add(I,ne,be){this._handlers.push({handlerName:I,handler:ne,allowed:be}),this._handlersById[I]=ne}stop(I){if(!this._updatingCamera){for(let{handler:ne}of this._handlers)ne.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(let{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ln(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ne,be){for(let Ae in I)if(Ae!==be&&(!ne||ne.indexOf(Ae)<0))return!0;return!1}_getMapTouches(I){let ne=[];for(let be of I)this._el.contains(be.target)&&ne.push(be);return ne}mergeHandlerResult(I,ne,be,Ae,Re){if(!be)return;t.e(I,be);let ut={handlerName:Ae,originalEvent:be.originalEvent||Re};be.zoomDelta!==void 0&&(ne.zoom=ut),be.panDelta!==void 0&&(ne.drag=ut),be.pitchDelta!==void 0&&(ne.pitch=ut),be.bearingDelta!==void 0&&(ne.rotate=ut)}_applyChanges(){let I={},ne={},be={};for(let[Ae,Re,ut]of this._changes)Ae.panDelta&&(I.panDelta=(I.panDelta||new t.P(0,0))._add(Ae.panDelta)),Ae.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+Ae.zoomDelta),Ae.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+Ae.bearingDelta),Ae.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+Ae.pitchDelta),Ae.around!==void 0&&(I.around=Ae.around),Ae.pinchAround!==void 0&&(I.pinchAround=Ae.pinchAround),Ae.noInertia&&(I.noInertia=Ae.noInertia),t.e(ne,Re),t.e(be,ut);this._updateMapTransform(I,ne,be),this._changes=[]}_updateMapTransform(I,ne,be){let Ae=this._map,Re=Ae._getTransformForUpdate(),ut=Ae.terrain;if(!(di(I)||ut&&this._terrainMovement))return this._fireEvents(ne,be,!0);let{panDelta:_t,zoomDelta:Rt,bearingDelta:Zt,pitchDelta:yr,around:_r,pinchAround:Gr}=I;Gr!==void 0&&(_r=Gr),Ae._stop(!0),_r=_r||Ae.transform.centerPoint;let Qr=Re.pointLocation(_t?_r.sub(_t):_r);Zt&&(Re.bearing+=Zt),yr&&(Re.pitch+=yr),Rt&&(Re.zoom+=Rt),ut?this._terrainMovement||!ne.drag&&!ne.zoom?ne.drag&&this._terrainMovement?Re.center=Re.pointLocation(Re.centerPoint.sub(_t)):Re.setLocationAtPoint(Qr,_r):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Re.setLocationAtPoint(Qr,_r)):Re.setLocationAtPoint(Qr,_r),Ae._applyUpdatedTransform(Re),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ne,be,!0)}_fireEvents(I,ne,be){let Ae=Ln(this._eventsInProgress),Re=Ln(I),ut={};for(let _r in I){let{originalEvent:Gr}=I[_r];this._eventsInProgress[_r]||(ut[`${_r}start`]=Gr),this._eventsInProgress[_r]=I[_r]}!Ae&&Re&&this._fireEvent("movestart",Re.originalEvent);for(let _r in ut)this._fireEvent(_r,ut[_r]);Re&&this._fireEvent("move",Re.originalEvent);for(let _r in I){let{originalEvent:Gr}=I[_r];this._fireEvent(_r,Gr)}let _t={},Rt;for(let _r in this._eventsInProgress){let{handlerName:Gr,originalEvent:Qr}=this._eventsInProgress[_r];this._handlersById[Gr].isActive()||(delete this._eventsInProgress[_r],Rt=ne[Gr]||Qr,_t[`${_r}end`]=Rt)}for(let _r in _t)this._fireEvent(_r,_t[_r]);let Zt=Ln(this._eventsInProgress),yr=(Ae||Re)&&!Zt;if(yr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let _r=this._map._getTransformForUpdate();_r.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(_r)}if(be&&yr){this._updatingCamera=!0;let _r=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Gr=Qr=>Qr!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new sn("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Wi extends t.E{constructor(I,ne){super(),this._renderFrameCallback=()=>{let be=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(be)),be<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ne.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ne){return this.jumpTo({center:I},ne)}panBy(I,ne,be){return I=t.P.convert(I).mult(-1),this.panTo(this.transform.center,t.e({offset:I},ne),be)}panTo(I,ne,be){return this.easeTo(t.e({center:I},ne),be)}getZoom(){return this.transform.zoom}setZoom(I,ne){return this.jumpTo({zoom:I},ne),this}zoomTo(I,ne,be){return this.easeTo(t.e({zoom:I},ne),be)}zoomIn(I,ne){return this.zoomTo(this.getZoom()+1,I,ne),this}zoomOut(I,ne){return this.zoomTo(this.getZoom()-1,I,ne),this}getBearing(){return this.transform.bearing}setBearing(I,ne){return this.jumpTo({bearing:I},ne),this}getPadding(){return this.transform.padding}setPadding(I,ne){return this.jumpTo({padding:I},ne),this}rotateTo(I,ne,be){return this.easeTo(t.e({bearing:I},ne),be)}resetNorth(I,ne){return this.rotateTo(0,t.e({duration:1e3},I),ne),this}resetNorthPitch(I,ne){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},I),ne),this}snapToNorth(I,ne){return Math.abs(this.getBearing()){if(this._zooming&&(Ae.zoom=t.y.number(Re,at,Tr)),this._rotating&&(Ae.bearing=t.y.number(ut,Zt,Tr)),this._pitching&&(Ae.pitch=t.y.number(_t,yr,Tr)),this._padding&&(Ae.interpolatePadding(Rt,_r,Tr),Qr=Ae.centerPoint.add(Gr)),this.terrain&&!I.freezeElevation&&this._updateElevation(Tr),Ct)Ae.setLocationAtPoint(Ct,nr);else{let Fr=Ae.zoomScale(Ae.zoom-Re),Xr=at>Re?Math.min(2,yt):Math.max(.5,yt),oa=Math.pow(Xr,1-Tr),ga=Ae.unproject(ct.add(At.mult(Tr*oa)).mult(Fr));Ae.setLocationAtPoint(Ae.renderWorldCopies?ga.wrap():ga,Qr)}this._applyUpdatedTransform(Ae),this._fireMoveEvents(ne)},Tr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne,Tr)},I),this}_prepareEase(I,ne,be={}){this._moving=!0,ne||be.moving||this.fire(new t.k("movestart",I)),this._zooming&&!be.zooming&&this.fire(new t.k("zoomstart",I)),this._rotating&&!be.rotating&&this.fire(new t.k("rotatestart",I)),this._pitching&&!be.pitching&&this.fire(new t.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let ne=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ne!==this._elevationTarget){let be=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(be-(ne-(be*I+this._elevationStart))/(1-I)),this._elevationTarget=ne}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,I)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(I){let ne=I.getCameraPosition(),be=this.terrain.getElevationForLngLatZoom(ne.lngLat,I.zoom);if(ne.altitudethis._elevateCameraIfInsideTerrain(Ae)),this.transformCameraUpdate&&ne.push(Ae=>this.transformCameraUpdate(Ae)),!ne.length)return;let be=I.clone();for(let Ae of ne){let Re=be.clone(),{center:ut,zoom:_t,pitch:Rt,bearing:Zt,elevation:yr}=Ae(Re);ut&&(Re.center=ut),_t!==void 0&&(Re.zoom=_t),Rt!==void 0&&(Re.pitch=Rt),Zt!==void 0&&(Re.bearing=Zt),yr!==void 0&&(Re.elevation=yr),be.apply(Re)}this.transform.apply(be)}_fireMoveEvents(I){this.fire(new t.k("move",I)),this._zooming&&this.fire(new t.k("zoom",I)),this._rotating&&this.fire(new t.k("rotate",I)),this._pitching&&this.fire(new t.k("pitch",I))}_afterEase(I,ne){if(this._easeId&&ne&&this._easeId===ne)return;delete this._easeId;let be=this._zooming,Ae=this._rotating,Re=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,be&&this.fire(new t.k("zoomend",I)),Ae&&this.fire(new t.k("rotateend",I)),Re&&this.fire(new t.k("pitchend",I)),this.fire(new t.k("moveend",I))}flyTo(I,ne){var be;if(!I.essential&&i.prefersReducedMotion){let Kn=t.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Kn,ne)}this.stop(),I=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},I);let Ae=this._getTransformForUpdate(),Re=Ae.zoom,ut=Ae.bearing,_t=Ae.pitch,Rt=Ae.padding,Zt="bearing"in I?this._normalizeBearing(I.bearing,ut):ut,yr="pitch"in I?+I.pitch:_t,_r="padding"in I?I.padding:Ae.padding,Gr=t.P.convert(I.offset),Qr=Ae.centerPoint.add(Gr),je=Ae.pointLocation(Qr),{center:Ye,zoom:at}=Ae.getConstrained(t.N.convert(I.center||je),(be=I.zoom)!==null&&be!==void 0?be:Re);this._normalizeCenter(Ye,Ae);let ct=Ae.zoomScale(at-Re),At=Ae.project(je),yt=Ae.project(Ye).sub(At),Ct=I.curve,nr=Math.max(Ae.width,Ae.height),vr=nr/ct,Tr=yt.mag();if("minZoom"in I){let Kn=t.ac(Math.min(I.minZoom,Re,at),Ae.minZoom,Ae.maxZoom),vi=nr/Ae.zoomScale(Kn-Re);Ct=Math.sqrt(vi/Tr*2)}let Fr=Ct*Ct;function Xr(Kn){let vi=(vr*vr-nr*nr+(Kn?-1:1)*Fr*Fr*Tr*Tr)/(2*(Kn?vr:nr)*Fr*Tr);return Math.log(Math.sqrt(vi*vi+1)-vi)}function oa(Kn){return(Math.exp(Kn)-Math.exp(-Kn))/2}function ga(Kn){return(Math.exp(Kn)+Math.exp(-Kn))/2}let Ma=Xr(!1),en=function(Kn){return ga(Ma)/ga(Ma+Ct*Kn)},Dn=function(Kn){return nr*((ga(Ma)*(oa(vi=Ma+Ct*Kn)/ga(vi))-oa(Ma))/Fr)/Tr;var vi},In=(Xr(!0)-Ma)/Ct;if(Math.abs(Tr)<1e-6||!isFinite(In)){if(Math.abs(nr-vr)<1e-6)return this.easeTo(I,ne);let Kn=vr0,en=vi=>Math.exp(Kn*Ct*vi)}return I.duration="duration"in I?+I.duration:1e3*In/("screenSpeed"in I?+I.screenSpeed/Ct:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=ut!==Zt,this._pitching=yr!==_t,this._padding=!Ae.isPaddingEqual(_r),this._prepareEase(ne,!1),this.terrain&&this._prepareElevation(Ye),this._ease(Kn=>{let vi=Kn*In,zi=1/en(vi);Ae.zoom=Kn===1?at:Re+Ae.scaleZoom(zi),this._rotating&&(Ae.bearing=t.y.number(ut,Zt,Kn)),this._pitching&&(Ae.pitch=t.y.number(_t,yr,Kn)),this._padding&&(Ae.interpolatePadding(Rt,_r,Kn),Qr=Ae.centerPoint.add(Gr)),this.terrain&&!I.freezeElevation&&this._updateElevation(Kn);let Mi=Kn===1?Ye:Ae.unproject(At.add(yt.mult(Dn(vi))).mult(zi));Ae.setLocationAtPoint(Ae.renderWorldCopies?Mi.wrap():Mi,Qr),this._applyUpdatedTransform(Ae),this._fireMoveEvents(ne)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ne){var be;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Ae=this._onEaseEnd;delete this._onEaseEnd,Ae.call(this,ne)}return I||(be=this.handlers)===null||be===void 0||be.stop(!1),this}_ease(I,ne,be){be.animate===!1||be.duration===0?(I(1),ne()):(this._easeStart=i.now(),this._easeOptions=be,this._onEaseFrame=I,this._onEaseEnd=ne,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ne){I=t.b3(I,-180,180);let be=Math.abs(I-ne);return Math.abs(I-360-ne)180?-360:be<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}let Ui={compact:!0,customAttribution:'
MapLibre'};class Ji{constructor(I=Ui){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ne=>{!ne||ne.sourceDataType!=="metadata"&&ne.sourceDataType!=="visibility"&&ne.dataType!=="style"&&ne.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(I,ne){let be=this._map._getUIString(`AttributionControl.${ne}`);I.title=be,I.setAttribute("aria-label",be)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(Ae=>typeof Ae!="string"?"":Ae)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){let Ae=this._map.style.stylesheet;this.styleOwner=Ae.owner,this.styleId=Ae.id}let ne=this._map.style.sourceCaches;for(let Ae in ne){let Re=ne[Ae];if(Re.used||Re.usedForTerrain){let ut=Re.getSource();ut.attribution&&I.indexOf(ut.attribution)<0&&I.push(ut.attribution)}}I=I.filter(Ae=>String(Ae).trim()),I.sort((Ae,Re)=>Ae.length-Re.length),I=I.filter((Ae,Re)=>{for(let ut=Re+1;ut=0)return!1;return!0});let be=I.join(" | ");be!==this._attribHTML&&(this._attribHTML=be,I.length?(this._innerContainer.innerHTML=be,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class hi{constructor(I={}){this._updateCompact=()=>{let ne=this._container.children;if(ne.length){let be=ne[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&be.classList.add("maplibregl-compact"):be.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");let ne=n.create("a","maplibregl-ctrl-logo");return ne.target="_blank",ne.rel="noopener nofollow",ne.href="https://maplibre.org/",ne.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ne.setAttribute("rel","noopener nofollow"),this._container.appendChild(ne),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Qn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){let ne=++this._id;return this._queue.push({callback:I,id:ne,cancelled:!1}),ne}remove(I){let ne=this._currentlyRunning,be=ne?this._queue.concat(ne):this._queue;for(let Ae of be)if(Ae.id===I)return void(Ae.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let ne=this._currentlyRunning=this._queue;this._queue=[];for(let be of ne)if(!be.cancelled&&(be.callback(I),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ao=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Po extends t.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ne){this.sourceCache.update(I,ne),this._renderableTilesKeys=[];let be={};for(let Ae of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ne}))be[Ae.key]=!0,this._renderableTilesKeys.push(Ae.key),this._tiles[Ae.key]||(Ae.posMatrix=new Float64Array(16),t.aP(Ae.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Ae.key]=new Qe(Ae,this.tileSize));for(let Ae in this._tiles)be[Ae]||delete this._tiles[Ae]}freeRtt(I){for(let ne in this._tiles){let be=this._tiles[ne];(!I||be.tileID.equals(I)||be.tileID.isChildOf(I)||I.isChildOf(be.tileID))&&(be.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){let ne={};for(let be of this._renderableTilesKeys){let Ae=this._tiles[be].tileID;if(Ae.canonical.equals(I.canonical)){let Re=I.clone();Re.posMatrix=new Float64Array(16),t.aP(Re.posMatrix,0,t.X,0,t.X,0,1),ne[be]=Re}else if(Ae.canonical.isChildOf(I.canonical)){let Re=I.clone();Re.posMatrix=new Float64Array(16);let ut=Ae.canonical.z-I.canonical.z,_t=Ae.canonical.x-(Ae.canonical.x>>ut<>ut<>ut;t.aP(Re.posMatrix,0,Zt,0,Zt,0,1),t.J(Re.posMatrix,Re.posMatrix,[-_t*Zt,-Rt*Zt,0]),ne[be]=Re}else if(I.canonical.isChildOf(Ae.canonical)){let Re=I.clone();Re.posMatrix=new Float64Array(16);let ut=I.canonical.z-Ae.canonical.z,_t=I.canonical.x-(I.canonical.x>>ut<>ut<>ut;t.aP(Re.posMatrix,0,t.X,0,t.X,0,1),t.J(Re.posMatrix,Re.posMatrix,[_t*Zt,Rt*Zt,0]),t.K(Re.posMatrix,Re.posMatrix,[1/2**ut,1/2**ut,0]),ne[be]=Re}}return ne}getSourceTile(I,ne){let be=this.sourceCache._source,Ae=I.overscaledZ-this.deltaZoom;if(Ae>be.maxzoom&&(Ae=be.maxzoom),Ae=be.minzoom&&(!Re||!Re.dem);)Re=this.sourceCache.getTileByID(I.scaledTo(Ae--).key);return Re}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ne=>ne.timeAdded>=I)}}class is{constructor(I,ne,be){this.painter=I,this.sourceCache=new Po(ne),this.options=be,this.exaggeration=typeof be.exaggeration=="number"?be.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ne,be,Ae=t.X){var Re;if(!(ne>=0&&ne=0&&beI.canonical.z&&(I.canonical.z>=Ae?Re=I.canonical.z-Ae:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let ut=I.canonical.x-(I.canonical.x>>Re<>Re<>8<<4|Re>>8,ne[ut+3]=0;let be=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ne.buffer)),Ae=new u(I,be,I.gl.RGBA,{premultiply:!1});return Ae.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=Ae,Ae}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);let ne=new Uint8Array(4),be=this.painter.context,Ae=be.gl,Re=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),ut=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),_t=Math.round(this.painter.height/devicePixelRatio);be.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ae.readPixels(Re,_t-ut-1,1,1,Ae.RGBA,Ae.UNSIGNED_BYTE,ne),be.bindFramebuffer.set(null);let Rt=ne[0]+(ne[2]>>4<<8),Zt=ne[1]+((15&ne[2])<<8),yr=this.coordsIndex[255-ne[3]],_r=yr&&this.sourceCache.getTileByID(yr);if(!_r)return null;let Gr=this._coordsTextureSize,Qr=(1<<_r.tileID.canonical.z)*Gr;return new t.Z((_r.tileID.canonical.x*Gr+Rt)/Qr+_r.tileID.wrap,(_r.tileID.canonical.y*Gr+Zt)/Qr,this.getElevation(_r.tileID,Rt,Zt,Gr))}depthAtPoint(I){let ne=new Uint8Array(4),be=this.painter.context,Ae=be.gl;return be.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),Ae.readPixels(I.x,this.painter.height/devicePixelRatio-I.y-1,1,1,Ae.RGBA,Ae.UNSIGNED_BYTE,ne),be.bindFramebuffer.set(null),(ne[0]/16777216+ne[1]/65536+ne[2]/256+ne[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let I=this.painter.context,ne=new t.bd,be=new t.aY,Ae=this.meshSize,Re=t.X/Ae,ut=Ae*Ae;for(let _r=0;_r<=Ae;_r++)for(let Gr=0;Gr<=Ae;Gr++)ne.emplaceBack(Gr*Re,_r*Re,0);for(let _r=0;_rI.id!==ne),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(let ne of this._recentlyUsed)if(!this._objects[ne].inUse)return this._objects[ne];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(let I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length!I.inUse)===!1}}let _s={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ps{constructor(I,ne){this.painter=I,this.terrain=ne,this.pool=new Rs(I.context,30,ne.sourceCache.tileSize*ne.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ne){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(be=>!I._layers[be].isHidden(ne)),this._coordsDescendingInv={};for(let be in I.sourceCaches){this._coordsDescendingInv[be]={};let Ae=I.sourceCaches[be].getVisibleCoordinates();for(let Re of Ae){let ut=this.terrain.sourceCache.getTerrainCoords(Re);for(let _t in ut)this._coordsDescendingInv[be][_t]||(this._coordsDescendingInv[be][_t]=[]),this._coordsDescendingInv[be][_t].push(ut[_t])}}this._coordsDescendingInvStr={};for(let be of I._order){let Ae=I._layers[be],Re=Ae.source;if(_s[Ae.type]&&!this._coordsDescendingInvStr[Re]){this._coordsDescendingInvStr[Re]={};for(let ut in this._coordsDescendingInv[Re])this._coordsDescendingInvStr[Re][ut]=this._coordsDescendingInv[Re][ut].map(_t=>_t.key).sort().join()}}for(let be of this._renderableTiles)for(let Ae in this._coordsDescendingInvStr){let Re=this._coordsDescendingInvStr[Ae][be.tileID.key];Re&&Re!==be.rttCoords[Ae]&&(be.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;let ne=I.type,be=this.painter,Ae=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(_s[ne]&&(this._prevType&&_s[this._prevType]||this._stacks.push([]),this._prevType=ne,this._stacks[this._stacks.length-1].push(I.id),!Ae))return!0;if(_s[this._prevType]||_s[ne]&&Ae){this._prevType=ne;let Re=this._stacks.length-1,ut=this._stacks[Re]||[];for(let _t of this._renderableTiles){if(this.pool.isFull()&&(Zs(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_t),_t.rtt[Re]){let Zt=this.pool.getObjectForId(_t.rtt[Re].id);if(Zt.stamp===_t.rtt[Re].stamp){this.pool.useObject(Zt);continue}}let Rt=this.pool.getOrCreateFreeObject();this.pool.useObject(Rt),this.pool.stampObject(Rt),_t.rtt[Re]={id:Rt.id,stamp:Rt.stamp},be.context.bindFramebuffer.set(Rt.fbo.framebuffer),be.context.clear({color:t.aM.transparent,stencil:0}),be.currentStencilSource=void 0;for(let Zt=0;Zt{De.touchstart=De.dragStart,De.touchmoveWindow=De.dragMove,De.touchend=De.dragEnd},ki={showCompass:!0,showZoom:!0,visualizePitch:!1};class go{constructor(I,ne,be=!1){this.mousedown=ut=>{this.startMouse(t.e({},ut,{ctrlKey:!0,preventDefault:()=>ut.preventDefault()}),n.mousePos(this.element,ut)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ut=>{this.moveMouse(ut,n.mousePos(this.element,ut))},this.mouseup=ut=>{this.mouseRotate.dragEnd(ut),this.mousePitch&&this.mousePitch.dragEnd(ut),this.offTemp()},this.touchstart=ut=>{ut.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,ut.targetTouches)[0],this.startTouch(ut,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=ut=>{ut.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,ut.targetTouches)[0],this.moveTouch(ut,this._lastPos))},this.touchend=ut=>{ut.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Ae=I.dragRotate._mouseRotate.getClickTolerance(),Re=I.dragRotate._mousePitch.getClickTolerance();this.element=ne,this.mouseRotate=Pl({clickTolerance:Ae,enable:!0}),this.touchRotate=(({enable:ut,clickTolerance:_t,bearingDegreesPerPixelMoved:Rt=.8})=>{let Zt=new fc;return new vu({clickTolerance:_t,move:(yr,_r)=>({bearingDelta:(_r.x-yr.x)*Rt}),moveStateManager:Zt,enable:ut,assignEvents:Ns})})({clickTolerance:Ae,enable:!0}),this.map=I,be&&(this.mousePitch=Hc({clickTolerance:Re,enable:!0}),this.touchPitch=(({enable:ut,clickTolerance:_t,pitchDegreesPerPixelMoved:Rt=-.5})=>{let Zt=new fc;return new vu({clickTolerance:_t,move:(yr,_r)=>({pitchDelta:(_r.y-yr.y)*Rt}),moveStateManager:Zt,enable:ut,assignEvents:Ns})})({clickTolerance:Re,enable:!0})),n.addEventListener(ne,"mousedown",this.mousedown),n.addEventListener(ne,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ne,"touchcancel",this.reset)}startMouse(I,ne){this.mouseRotate.dragStart(I,ne),this.mousePitch&&this.mousePitch.dragStart(I,ne),n.disableDrag()}startTouch(I,ne){this.touchRotate.dragStart(I,ne),this.touchPitch&&this.touchPitch.dragStart(I,ne),n.disableDrag()}moveMouse(I,ne){let be=this.map,{bearingDelta:Ae}=this.mouseRotate.dragMove(I,ne)||{};if(Ae&&be.setBearing(be.getBearing()+Ae),this.mousePitch){let{pitchDelta:Re}=this.mousePitch.dragMove(I,ne)||{};Re&&be.setPitch(be.getPitch()+Re)}}moveTouch(I,ne){let be=this.map,{bearingDelta:Ae}=this.touchRotate.dragMove(I,ne)||{};if(Ae&&be.setBearing(be.getBearing()+Ae),this.touchPitch){let{pitchDelta:Re}=this.touchPitch.dragMove(I,ne)||{};Re&&be.setPitch(be.getPitch()+Re)}}off(){let I=this.element;n.removeEventListener(I,"mousedown",this.mousedown),n.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(I,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let Cs;function ds(De,I,ne){let be=new t.N(De.lng,De.lat);if(De=new t.N(De.lng,De.lat),I){let Ae=new t.N(De.lng-360,De.lat),Re=new t.N(De.lng+360,De.lat),ut=ne.locationPoint(De).distSqr(I);ne.locationPoint(Ae).distSqr(I)180;){let Ae=ne.locationPoint(De);if(Ae.x>=0&&Ae.y>=0&&Ae.x<=ne.width&&Ae.y<=ne.height)break;De.lng>ne.center.lng?De.lng-=360:De.lng+=360}return De.lng!==be.lng&&ne.locationPoint(De).y>ne.height/2-ne.getHorizon()?De:be}let zl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function tu(De,I,ne){let be=De.classList;for(let Ae in zl)be.remove(`maplibregl-${ne}-anchor-${Ae}`);be.add(`maplibregl-${ne}-anchor-${I}`)}class mu extends t.E{constructor(I){if(super(),this._onKeyPress=ne=>{let be=ne.code,Ae=ne.charCode||ne.keyCode;be!=="Space"&&be!=="Enter"&&Ae!==32&&Ae!==13||this.togglePopup()},this._onMapClick=ne=>{let be=ne.originalEvent.target,Ae=this._element;this._popup&&(be===Ae||Ae.contains(be))&&this.togglePopup()},this._update=ne=>{var be;if(!this._map)return;let Ae=this._map.loaded()&&!this._map.isMoving();(ne?.type==="terrain"||ne?.type==="render"&&!Ae)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?ds(this._lngLat,this._flatPos,this._map.transform):(be=this._lngLat)===null||be===void 0?void 0:be.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Re="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Re=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Re=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ut="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ut="rotateX(0deg)":this._pitchAlignment==="map"&&(ut=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ne&&ne.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${zl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ut} ${Re}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ne&&ne.type==="moveend")}).catch(()=>{})},this._onMove=ne=>{if(!this._isDragging){let be=this._clickTolerance||this._map._clickTolerance;this._isDragging=ne.point.dist(this._pointerdownPos)>=be}this._isDragging&&(this._pos=ne.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ne=>{this._element.contains(ne.originalEvent.target)&&(ne.preventDefault(),this._positionDelta=ne.point.sub(this._pos).add(this._offset),this._pointerdownPos=ne.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I?.opacity,I?.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=t.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");let ne=n.createNS("http://www.w3.org/2000/svg","svg"),be=41,Ae=27;ne.setAttributeNS(null,"display","block"),ne.setAttributeNS(null,"height",`${be}px`),ne.setAttributeNS(null,"width",`${Ae}px`),ne.setAttributeNS(null,"viewBox",`0 0 ${Ae} ${be}`);let Re=n.createNS("http://www.w3.org/2000/svg","g");Re.setAttributeNS(null,"stroke","none"),Re.setAttributeNS(null,"stroke-width","1"),Re.setAttributeNS(null,"fill","none"),Re.setAttributeNS(null,"fill-rule","evenodd");let ut=n.createNS("http://www.w3.org/2000/svg","g");ut.setAttributeNS(null,"fill-rule","nonzero");let _t=n.createNS("http://www.w3.org/2000/svg","g");_t.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_t.setAttributeNS(null,"fill","#000000");let Rt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let ct of Rt){let At=n.createNS("http://www.w3.org/2000/svg","ellipse");At.setAttributeNS(null,"opacity","0.04"),At.setAttributeNS(null,"cx","10.5"),At.setAttributeNS(null,"cy","5.80029008"),At.setAttributeNS(null,"rx",ct.rx),At.setAttributeNS(null,"ry",ct.ry),_t.appendChild(At)}let Zt=n.createNS("http://www.w3.org/2000/svg","g");Zt.setAttributeNS(null,"fill",this._color);let yr=n.createNS("http://www.w3.org/2000/svg","path");yr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Zt.appendChild(yr);let _r=n.createNS("http://www.w3.org/2000/svg","g");_r.setAttributeNS(null,"opacity","0.25"),_r.setAttributeNS(null,"fill","#000000");let Gr=n.createNS("http://www.w3.org/2000/svg","path");Gr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),_r.appendChild(Gr);let Qr=n.createNS("http://www.w3.org/2000/svg","g");Qr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Qr.setAttributeNS(null,"fill","#FFFFFF");let je=n.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Ye=n.createNS("http://www.w3.org/2000/svg","circle");Ye.setAttributeNS(null,"fill","#000000"),Ye.setAttributeNS(null,"opacity","0.25"),Ye.setAttributeNS(null,"cx","5.5"),Ye.setAttributeNS(null,"cy","5.5"),Ye.setAttributeNS(null,"r","5.4999962");let at=n.createNS("http://www.w3.org/2000/svg","circle");at.setAttributeNS(null,"fill","#FFFFFF"),at.setAttributeNS(null,"cx","5.5"),at.setAttributeNS(null,"cy","5.5"),at.setAttributeNS(null,"r","5.4999962"),je.appendChild(Ye),je.appendChild(at),ut.appendChild(_t),ut.appendChild(Zt),ut.appendChild(_r),ut.appendChild(Qr),ut.appendChild(je),ne.appendChild(ut),ne.setAttributeNS(null,"height",be*this._scale+"px"),ne.setAttributeNS(null,"width",Ae*this._scale+"px"),this._element.appendChild(ne),this._offset=t.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ne=>{ne.preventDefault()}),this._element.addEventListener("mousedown",ne=>{ne.preventDefault()}),tu(this._element,this._anchor,"marker"),I&&I.className)for(let ne of I.className.split(" "))this._element.classList.add(ne);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=t.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){let Ae=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Ae,-1*(38.1-13.5+Ae)],"bottom-right":[-Ae,-1*(38.1-13.5+Ae)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){let I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ne,be;if(!(!((ne=this._map)===null||ne===void 0)&&ne.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Ae=this._map,Re=Ae.terrain.depthAtPoint(this._pos),ut=Ae.terrain.getElevationForLngLatZoom(this._lngLat,Ae.transform.tileZoom);if(Ae.transform.lngLatToCameraDepth(this._lngLat,ut)-Re<.006)return void(this._element.style.opacity=this._opacity);let _t=-this._offset.y/Ae.transform._pixelPerMeter,Rt=Math.sin(Ae.getPitch()*Math.PI/180)*_t,Zt=Ae.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),yr=Ae.transform.lngLatToCameraDepth(this._lngLat,ut+Rt)-Zt>.006;!((be=this._popup)===null||be===void 0)&&be.isOpen()&&yr&&this._popup.remove(),this._element.style.opacity=yr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=t.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ne){return I===void 0&&ne===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ne!==void 0&&(this._opacityWhenCovered=ne),this._map&&this._updateOpacity(!0),this}}let Ju={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Wl=0,$u=!1,Zl={maxWidth:100,unit:"metric"};function Bu(De,I,ne){let be=ne&&ne.maxWidth||100,Ae=De._container.clientHeight/2,Re=De.unproject([0,Ae]),ut=De.unproject([be,Ae]),_t=Re.distanceTo(ut);if(ne&&ne.unit==="imperial"){let Rt=3.2808*_t;Rt>5280?$i(I,be,Rt/5280,De._getUIString("ScaleControl.Miles")):$i(I,be,Rt,De._getUIString("ScaleControl.Feet"))}else ne&&ne.unit==="nautical"?$i(I,be,_t/1852,De._getUIString("ScaleControl.NauticalMiles")):_t>=1e3?$i(I,be,_t/1e3,De._getUIString("ScaleControl.Kilometers")):$i(I,be,_t,De._getUIString("ScaleControl.Meters"))}function $i(De,I,ne,be){let Ae=(function(Re){let ut=Math.pow(10,`${Math.floor(Re)}`.length-1),_t=Re/ut;return _t=_t>=10?10:_t>=5?5:_t>=3?3:_t>=2?2:_t>=1?1:(function(Rt){let Zt=Math.pow(10,Math.ceil(-Math.log(Rt)/Math.LN10));return Math.round(Rt*Zt)/Zt})(_t),ut*_t})(ne);De.style.width=I*(Ae/ne)+"px",De.innerHTML=`${Ae} ${be}`}let _o={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ku(De){if(De){if(typeof De=="number"){let I=Math.round(Math.abs(De)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,De),"top-left":new t.P(I,I),"top-right":new t.P(-I,I),bottom:new t.P(0,-De),"bottom-left":new t.P(I,-I),"bottom-right":new t.P(-I,-I),left:new t.P(De,0),right:new t.P(-De,0)}}if(De instanceof t.P||Array.isArray(De)){let I=t.P.convert(De);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:t.P.convert(De.center||[0,0]),top:t.P.convert(De.top||[0,0]),"top-left":t.P.convert(De["top-left"]||[0,0]),"top-right":t.P.convert(De["top-right"]||[0,0]),bottom:t.P.convert(De.bottom||[0,0]),"bottom-left":t.P.convert(De["bottom-left"]||[0,0]),"bottom-right":t.P.convert(De["bottom-right"]||[0,0]),left:t.P.convert(De.left||[0,0]),right:t.P.convert(De.right||[0,0])}}return ku(new t.P(0,0))}let gu=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ji,e.BoxZoomHandler=eu,e.CanvasSource=$e,e.CooperativeGesturesHandler=Sn,e.DoubleClickZoomHandler=$a,e.DragPanHandler=Gn,e.DragRotateHandler=ai,e.EdgeInsets=ql,e.FullscreenControl=class extends t.E{constructor(De={}){super(),this._onFullscreenChange=()=>{var I;let ne=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ne?.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ne=ne.shadowRoot.fullscreenElement;ne===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,De&&De.container&&(De.container instanceof HTMLElement?this._container=De.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(De){return this._map=De,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let De=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",De).setAttribute("aria-hidden","true"),De.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let De=this._getTitle();this._fullscreenButton.setAttribute("aria-label",De),this._fullscreenButton.title=De}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Pe,e.GeolocateControl=class extends t.E{constructor(De){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{let ne=new t.N(I.coords.longitude,I.coords.latitude),be=I.coords.accuracy,Ae=this._map.getBearing(),Re=t.e({bearing:Ae},this.options.fitBoundsOptions),ut=re.fromLngLat(ne,be);this._map.fitBounds(ut,Re,{geolocateSource:!0})},this._updateMarker=I=>{if(I){let ne=new t.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ne).addTo(this._map),this._userLocationDotMarker.setLngLat(ne).addTo(this._map),this._accuracy=I.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=I=>{if(this._map){if(this.options.trackUserLocation)if(I.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&$u)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=I=>{if(this._map){if(I===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}else{let ne=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new mu({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new mu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ne=>{ne.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ne.originalEvent&&ne.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},Ju,De)}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return t._(this,arguments,void 0,function*(I=!1){if(Cs!==void 0&&!I)return Cs;if(window.navigator.permissions===void 0)return Cs=!!window.navigator.geolocation,Cs;try{Cs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Cs=!!window.navigator.geolocation}return Cs})})().then(I=>this._finishSetupUI(I)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Wl=0,$u=!1}_isOutOfMapMaxBounds(De){let I=this._map.getMaxBounds(),ne=De.coords;return I&&(ne.longitudeI.getEast()||ne.latitudeI.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let De=this._map.getBounds(),I=De.getSouthEast(),ne=De.getNorthEast(),be=I.distanceTo(ne),Ae=Math.ceil(this._accuracy/(be/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ae}px`,this._circleElement.style.height=`${Ae}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Wl--,$u=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let De;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Wl++,Wl>1?(De={maximumAge:6e5,timeout:0},$u=!0):(De=this.options.positionOptions,$u=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,De)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=ef,e.ImageSource=et,e.KeyboardHandler=mr,e.LngLatBounds=re,e.LogoControl=hi,e.Map=class extends Wi{constructor(De){t.bf.mark(t.bg.create);let I=Object.assign(Object.assign({},Ys),De);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new rl(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Qn,this._controls=[],this._mapId=t.a4(),this._contextLost=ne=>{ne.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ne}))},this._contextRestored=ne=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ne}))},this._onMapScroll=ne=>{if(ne.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ts),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new _(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ne=!1,be=Gc(Ae=>{this._trackResize&&!this._removed&&(this.resize(Ae),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ae=>{ne?be(Ae):ne=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ni(this,I),this._hash=I.hash&&new ef(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,t.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new Ji(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new hi,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ne=>{this._update(ne.dataType==="style"),this.fire(new t.k(`${ne.dataType}data`,ne))}),this.on("dataloading",ne=>{this.fire(new t.k(`${ne.dataType}dataloading`,ne))}),this.on("dataabort",ne=>{this.fire(new t.k("sourcedataabort",ne))})}_getMapId(){return this._mapId}addControl(De,I){if(I===void 0&&(I=De.getDefaultPosition?De.getDefaultPosition():"top-right"),!De||!De.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let ne=De.onAdd(this);this._controls.push(De);let be=this._controlPositions[I];return I.indexOf("bottom")!==-1?be.insertBefore(ne,be.firstChild):be.appendChild(ne),this}removeControl(De){if(!De||!De.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let I=this._controls.indexOf(De);return I>-1&&this._controls.splice(I,1),De.onRemove(this),this}hasControl(De){return this._controls.indexOf(De)>-1}calculateCameraOptionsFromTo(De,I,ne,be){return be==null&&this.terrain&&(be=this.terrain.getElevationForLngLatZoom(ne,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(De,I,ne,be)}resize(De){var I;let ne=this._containerDimensions(),be=ne[0],Ae=ne[1],Re=this._getClampedPixelRatio(be,Ae);if(this._resizeCanvas(be,Ae,Re),this.painter.resize(be,Ae,Re),this.painter.overLimit()){let _t=this.painter.context.gl;this._maxCanvasSize=[_t.drawingBufferWidth,_t.drawingBufferHeight];let Rt=this._getClampedPixelRatio(be,Ae);this._resizeCanvas(be,Ae,Rt),this.painter.resize(be,Ae,Rt)}this.transform.resize(be,Ae),(I=this._requestedCameraState)===null||I===void 0||I.resize(be,Ae);let ut=!this._moving;return ut&&(this.stop(),this.fire(new t.k("movestart",De)).fire(new t.k("move",De))),this.fire(new t.k("resize",De)),ut&&this.fire(new t.k("moveend",De)),this}_getClampedPixelRatio(De,I){let{0:ne,1:be}=this._maxCanvasSize,Ae=this.getPixelRatio(),Re=De*Ae,ut=I*Ae;return Math.min(Re>ne?ne/Re:1,ut>be?be/ut:1)*Ae}getPixelRatio(){var De;return(De=this._overridePixelRatio)!==null&&De!==void 0?De:devicePixelRatio}setPixelRatio(De){this._overridePixelRatio=De,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(De){return this.transform.setMaxBounds(re.convert(De)),this._update()}setMinZoom(De){if((De=De??-2)>=-2&&De<=this.transform.maxZoom)return this.transform.minZoom=De,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=De,this._update(),this.getZoom()>De&&this.setZoom(De),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(De){if((De=De??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(De>=0&&De<=this.transform.maxPitch)return this.transform.minPitch=De,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(De>=this.transform.minPitch)return this.transform.maxPitch=De,this._update(),this.getPitch()>De&&this.setPitch(De),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(De){return this.transform.renderWorldCopies=De,this._update()}project(De){return this.transform.locationPoint(t.N.convert(De),this.style&&this.terrain)}unproject(De){return this.transform.pointLocation(t.P.convert(De),this.terrain)}isMoving(){var De;return this._moving||((De=this.handlers)===null||De===void 0?void 0:De.isMoving())}isZooming(){var De;return this._zooming||((De=this.handlers)===null||De===void 0?void 0:De.isZooming())}isRotating(){var De;return this._rotating||((De=this.handlers)===null||De===void 0?void 0:De.isRotating())}_createDelegatedListener(De,I,ne){if(De==="mouseenter"||De==="mouseover"){let be=!1;return{layers:I,listener:ne,delegates:{mousemove:Re=>{let ut=I.filter(Rt=>this.getLayer(Rt)),_t=ut.length!==0?this.queryRenderedFeatures(Re.point,{layers:ut}):[];_t.length?be||(be=!0,ne.call(this,new Ll(De,this,Re.originalEvent,{features:_t}))):be=!1},mouseout:()=>{be=!1}}}}if(De==="mouseleave"||De==="mouseout"){let be=!1;return{layers:I,listener:ne,delegates:{mousemove:ut=>{let _t=I.filter(Rt=>this.getLayer(Rt));(_t.length!==0?this.queryRenderedFeatures(ut.point,{layers:_t}):[]).length?be=!0:be&&(be=!1,ne.call(this,new Ll(De,this,ut.originalEvent)))},mouseout:ut=>{be&&(be=!1,ne.call(this,new Ll(De,this,ut.originalEvent)))}}}}{let be=Ae=>{let Re=I.filter(_t=>this.getLayer(_t)),ut=Re.length!==0?this.queryRenderedFeatures(Ae.point,{layers:Re}):[];ut.length&&(Ae.features=ut,ne.call(this,Ae),delete Ae.features)};return{layers:I,listener:ne,delegates:{[De]:be}}}}_saveDelegatedListener(De,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[De]=this._delegatedListeners[De]||[],this._delegatedListeners[De].push(I)}_removeDelegatedListener(De,I,ne){if(!this._delegatedListeners||!this._delegatedListeners[De])return;let be=this._delegatedListeners[De];for(let Ae=0;AeI.includes(ut))){for(let ut in Re.delegates)this.off(ut,Re.delegates[ut]);return void be.splice(Ae,1)}}}on(De,I,ne){if(ne===void 0)return super.on(De,I);let be=this._createDelegatedListener(De,typeof I=="string"?[I]:I,ne);this._saveDelegatedListener(De,be);for(let Ae in be.delegates)this.on(Ae,be.delegates[Ae]);return this}once(De,I,ne){if(ne===void 0)return super.once(De,I);let be=typeof I=="string"?[I]:I,Ae=this._createDelegatedListener(De,be,ne);for(let Re in Ae.delegates){let ut=Ae.delegates[Re];Ae.delegates[Re]=(..._t)=>{this._removeDelegatedListener(De,be,ne),ut(..._t)}}this._saveDelegatedListener(De,Ae);for(let Re in Ae.delegates)this.once(Re,Ae.delegates[Re]);return this}off(De,I,ne){return ne===void 0?super.off(De,I):(this._removeDelegatedListener(De,typeof I=="string"?[I]:I,ne),this)}queryRenderedFeatures(De,I){if(!this.style)return[];let ne,be=De instanceof t.P||Array.isArray(De),Ae=be?De:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(be?{}:De)||{},Ae instanceof t.P||typeof Ae[0]=="number")ne=[t.P.convert(Ae)];else{let Re=t.P.convert(Ae[0]),ut=t.P.convert(Ae[1]);ne=[Re,new t.P(ut.x,Re.y),ut,new t.P(Re.x,ut.y),Re]}return this.style.queryRenderedFeatures(ne,I,this.transform)}querySourceFeatures(De,I){return this.style.querySourceFeatures(De,I)}setStyle(De,I){return(I=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&De?(this._diffStyle(De,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(De,I))}setTransformRequest(De){return this._requestManager.setTransformRequest(De),this}_getUIString(De){let I=this._locale[De];if(I==null)throw new Error(`Missing UI string '${De}'`);return I}_updateStyle(De,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(De,I));let ne=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!De)),De?(this.style=new kr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof De=="string"?this.style.loadURL(De,I,ne):this.style.loadJSON(De,I,ne),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new kr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(De,I){if(typeof De=="string"){let ne=this._requestManager.transformRequest(De,"Style");t.h(ne,new AbortController).then(be=>{this._updateDiff(be.data,I)}).catch(be=>{be&&this.fire(new t.j(be))})}else typeof De=="object"&&this._updateDiff(De,I)}_updateDiff(De,I){try{this.style.setState(De,I)&&this._update(!0)}catch(ne){t.w(`Unable to perform style diff: ${ne.message||ne.error||ne}. Rebuilding the style from scratch.`),this._updateStyle(De,I)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(De,I){return this._lazyInitEmptyStyle(),this.style.addSource(De,I),this._update(!0)}isSourceLoaded(De){let I=this.style&&this.style.sourceCaches[De];if(I!==void 0)return I.loaded();this.fire(new t.j(new Error(`There is no source with ID '${De}'`)))}setTerrain(De){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),De){let I=this.style.sourceCaches[De.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${De.source}`);this.terrain===null&&I.reload();for(let ne in this.style._layers){let be=this.style._layers[ne];be.type==="hillshade"&&be.source===De.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new is(this.painter,I,De),this.painter.renderToTexture=new Ps(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ne=>{ne.dataType==="style"?this.terrain.sourceCache.freeRtt():ne.dataType==="source"&&ne.tile&&(ne.sourceId!==De.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ne.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:De})),this}getTerrain(){var De,I;return(I=(De=this.terrain)===null||De===void 0?void 0:De.options)!==null&&I!==void 0?I:null}areTilesLoaded(){let De=this.style&&this.style.sourceCaches;for(let I in De){let ne=De[I]._tiles;for(let be in ne){let Ae=ne[be];if(Ae.state!=="loaded"&&Ae.state!=="errored")return!1}}return!0}removeSource(De){return this.style.removeSource(De),this._update(!0)}getSource(De){return this.style.getSource(De)}addImage(De,I,ne={}){let{pixelRatio:be=1,sdf:Ae=!1,stretchX:Re,stretchY:ut,content:_t,textFitWidth:Rt,textFitHeight:Zt}=ne;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||t.b(I))){if(I.width===void 0||I.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:yr,height:_r,data:Gr}=I,Qr=I;return this.style.addImage(De,{data:new t.R({width:yr,height:_r},new Uint8Array(Gr)),pixelRatio:be,stretchX:Re,stretchY:ut,content:_t,textFitWidth:Rt,textFitHeight:Zt,sdf:Ae,version:0,userImage:Qr}),Qr.onAdd&&Qr.onAdd(this,De),this}}{let{width:yr,height:_r,data:Gr}=i.getImageData(I);this.style.addImage(De,{data:new t.R({width:yr,height:_r},Gr),pixelRatio:be,stretchX:Re,stretchY:ut,content:_t,textFitWidth:Rt,textFitHeight:Zt,sdf:Ae,version:0})}}updateImage(De,I){let ne=this.style.getImage(De);if(!ne)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let be=I instanceof HTMLImageElement||t.b(I)?i.getImageData(I):I,{width:Ae,height:Re,data:ut}=be;if(Ae===void 0||Re===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ae!==ne.data.width||Re!==ne.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let _t=!(I instanceof HTMLImageElement||t.b(I));return ne.data.replace(ut,_t),this.style.updateImage(De,ne),this}getImage(De){return this.style.getImage(De)}hasImage(De){return De?!!this.style.getImage(De):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(De){this.style.removeImage(De)}loadImage(De){return l.getImage(this._requestManager.transformRequest(De,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(De,I){return this._lazyInitEmptyStyle(),this.style.addLayer(De,I),this._update(!0)}moveLayer(De,I){return this.style.moveLayer(De,I),this._update(!0)}removeLayer(De){return this.style.removeLayer(De),this._update(!0)}getLayer(De){return this.style.getLayer(De)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(De,I,ne){return this.style.setLayerZoomRange(De,I,ne),this._update(!0)}setFilter(De,I,ne={}){return this.style.setFilter(De,I,ne),this._update(!0)}getFilter(De){return this.style.getFilter(De)}setPaintProperty(De,I,ne,be={}){return this.style.setPaintProperty(De,I,ne,be),this._update(!0)}getPaintProperty(De,I){return this.style.getPaintProperty(De,I)}setLayoutProperty(De,I,ne,be={}){return this.style.setLayoutProperty(De,I,ne,be),this._update(!0)}getLayoutProperty(De,I){return this.style.getLayoutProperty(De,I)}setGlyphs(De,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(De,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(De,I,ne={}){return this._lazyInitEmptyStyle(),this.style.addSprite(De,I,ne,be=>{be||this._update(!0)}),this}removeSprite(De){return this._lazyInitEmptyStyle(),this.style.removeSprite(De),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(De,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(De,I,ne=>{ne||this._update(!0)}),this}setLight(De,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(De,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(De){return this._lazyInitEmptyStyle(),this.style.setSky(De),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(De,I){return this.style.setFeatureState(De,I),this._update()}removeFeatureState(De,I){return this.style.removeFeatureState(De,I),this._update()}getFeatureState(De){return this.style.getFeatureState(De)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let De=0,I=0;return this._container&&(De=this._container.clientWidth||400,I=this._container.clientHeight||300),[De,I]}_setupContainer(){let De=this._container;De.classList.add("maplibregl-map");let I=this._canvasContainer=n.create("div","maplibregl-canvas-container",De);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",I),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let ne=this._containerDimensions(),be=this._getClampedPixelRatio(ne[0],ne[1]);this._resizeCanvas(ne[0],ne[1],be);let Ae=this._controlContainer=n.create("div","maplibregl-control-container",De),Re=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ut=>{Re[ut]=n.create("div",`maplibregl-ctrl-${ut} `,Ae)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(De,I,ne){this._canvas.width=Math.floor(ne*De),this._canvas.height=Math.floor(ne*I),this._canvas.style.width=`${De}px`,this._canvas.style.height=`${I}px`}_setupPainter(){let De={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},I=null;this._canvas.addEventListener("webglcontextcreationerror",be=>{I={requestedAttributes:De},be&&(I.statusMessage=be.statusMessage,I.type=be.type)},{once:!0});let ne=this._canvas.getContext("webgl2",De)||this._canvas.getContext("webgl",De);if(!ne){let be="Failed to initialize WebGL";throw I?(I.message=be,new Error(JSON.stringify(I))):new Error(be)}this.painter=new Hu(ne,this.transform),s.testSupport(ne)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(De){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||De,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(De){return this._update(),this._renderTaskQueue.add(De)}_cancelRenderFrame(De){this._renderTaskQueue.remove(De)}_render(De){let I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(De),this._removed)return;let ne=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Ae=this.transform.zoom,Re=i.now();this.style.zoomHistory.update(Ae,Re);let ut=new t.z(Ae,{now:Re,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_t=ut.crossFadingFactor();_t===1&&_t===this._crossFadingFactor||(ne=!0,this._crossFadingFactor=_t),this.style.update(ut)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ne)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let be=this._sourcesDirty||this._styleDirty||this._placementDirty;return be||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||be||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var De;this._hash&&this._hash.remove();for(let ne of this._controls)ne.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(De=this._resizeObserver)===null||De===void 0||De.disconnect();let I=this.painter.context.gl.getExtension("WEBGL_lose_context");I?.loseContext&&I.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(De=>{t.bf.frame(De),this._frameRequest=null,this._render(De)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(De){this._showTileBoundaries!==De&&(this._showTileBoundaries=De,this._update())}get showPadding(){return!!this._showPadding}set showPadding(De){this._showPadding!==De&&(this._showPadding=De,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(De){this._showCollisionBoxes!==De&&(this._showCollisionBoxes=De,De?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(De){this._showOverdrawInspector!==De&&(this._showOverdrawInspector=De,this._update())}get repaint(){return!!this._repaint}set repaint(De){this._repaint!==De&&(this._repaint=De,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(De){this._vertices=De,this._update()}get version(){return ul}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Ll,e.MapTouchEvent=cc,e.MapWheelEvent=hf,e.Marker=mu,e.NavigationControl=class{constructor(De){this._updateZoomButtons=()=>{let I=this._map.getZoom(),ne=I===this._map.getMaxZoom(),be=I===this._map.getMinZoom();this._zoomInButton.disabled=ne,this._zoomOutButton.disabled=be,this._zoomInButton.setAttribute("aria-disabled",ne.toString()),this._zoomOutButton.setAttribute("aria-disabled",be.toString())},this._rotateCompassArrow=()=>{let I=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=I},this._setButtonTitle=(I,ne)=>{let be=this._map._getUIString(`NavigationControl.${ne}`);I.title=be,I.setAttribute("aria-label",be)},this.options=t.e({},ki,De),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(De){return this._map=De,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new go(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(De,I){let ne=n.create("button",De,this._container);return ne.type="button",ne.addEventListener("click",I),ne}},e.Popup=class extends t.E{constructor(De){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ne;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let _t of this.options.className.split(" "))this._container.classList.add(_t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?ds(this._lngLat,this._flatPos,this._map.transform):(ne=this._lngLat)===null||ne===void 0?void 0:ne.wrap(),this._trackPointer&&!I)return;let be=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let Ae=this.options.anchor,Re=ku(this.options.offset);if(!Ae){let _t=this._container.offsetWidth,Rt=this._container.offsetHeight,Zt;Zt=be.y+Re.bottom.ythis._map.transform.height-Rt?["bottom"]:[],be.x<_t/2?Zt.push("left"):be.x>this._map.transform.width-_t/2&&Zt.push("right"),Ae=Zt.length===0?"bottom":Zt.join("-")}let ut=be.add(Re[Ae]);this.options.subpixelPositioning||(ut=ut.round()),n.setTransform(this._container,`${zl[Ae]} translate(${ut.x}px,${ut.y}px)`),tu(this._container,Ae,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(_o),De)}addTo(De){return this._map&&this.remove(),this._map=De,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(De){return this._lngLat=t.N.convert(De),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(De){return this.setDOMContent(document.createTextNode(De))}setHTML(De){let I=document.createDocumentFragment(),ne=document.createElement("body"),be;for(ne.innerHTML=De;be=ne.firstChild,be;)I.appendChild(be);return this.setDOMContent(I)}getMaxWidth(){var De;return(De=this._container)===null||De===void 0?void 0:De.style.maxWidth}setMaxWidth(De){return this.options.maxWidth=De,this._update(),this}setDOMContent(De){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(De),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(De){return this._container&&this._container.classList.add(De),this}removeClassName(De){return this._container&&this._container.classList.remove(De),this}setOffset(De){return this.options.offset=De,this._update(),this}toggleClassName(De){if(this._container)return this._container.classList.toggle(De)}setSubpixelPositioning(De){this.options.subpixelPositioning=De}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let De=this._container.querySelector(Qu);De&&De.focus()}},e.RasterDEMTileSource=Le,e.RasterTileSource=Te,e.ScaleControl=class{constructor(De){this._onMove=()=>{Bu(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,Bu(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Zl),De)}getDefaultPosition(){return"bottom-left"}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",De.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=xa,e.Style=kr,e.TerrainControl=class{constructor(De){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=De}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Ku,e.TwoFingersTouchRotateHandler=hc,e.TwoFingersTouchZoomHandler=Hl,e.TwoFingersTouchZoomRotateHandler=wn,e.VectorTileSource=xe,e.VideoSource=rt,e.addSourceType=(De,I)=>t._(void 0,void 0,void 0,function*(){if(fe(De))throw new Error(`A source type called "${De}" already exists.`);((ne,be)=>{Ue[ne]=be})(De,I)}),e.clearPrewarmedResources=function(){let De=ve;De&&(De.isPreloaded()&&De.numActive()===1?(De.release($),ve=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return We().getRTLTextPluginStatus()},e.getVersion=function(){return gu},e.getWorkerCount=function(){return le.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(De){return V().broadcast("IS",De)},e.prewarm=function(){Y().acquire($)},e.setMaxParallelImageRequests=function(De){t.a.MAX_PARALLEL_IMAGE_REQUESTS=De},e.setRTLTextPlugin=function(De,I){return We().setRTLTextPlugin(De,I)},e.setWorkerCount=function(De){le.workerCount=De},e.setWorkerUrl=function(De){t.a.WORKER_URL=De}});var E=d;return E})}}),RI=Ge({"src/plots/map/layers.js"(Z,q){"use strict";var d=ta(),x=Il().sanitizeHTML,S=FT(),E=Qd();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var h=i.symbol,f=S(h.textposition,h.iconsize);d.extendFlat(n,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":h.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":h.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,h={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",h.tileSize=256):n==="image"&&(f="url",h.coordinates=i.coordinates),h[f]=s,i.sourceattribution&&(h.attribution=x(i.sourceattribution)),h}q.exports=function(n,s,h){var f=new e(n,s);return f.update(h),f}}}),DI=Ge({"src/plots/map/map.js"(Z,q){"use strict";var d=II(),x=ta(),S=Yd(),E=Yi(),e=Mo(),t=sh(),r=mc(),o=fv(),a=o.drawMode,i=o.selectMode,n=Pc().prepSelect,s=Pc().clearOutline,h=Pc().clearSelectionsCache,f=Pc().selectOnClick,p=Qd(),c=RI();function T(g,b){this.id=b,this.gd=g;var v=g._fullLayout,u=g._context;this.container=v._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=v._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(v),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(g,b,v){var u=this,y;u.map?y=new Promise(function(m,R){u.updateMap(g,b,m,R)}):y=new Promise(function(m,R){u.createMap(g,b,m,R)}),v.push(y)},l.createMap=function(g,b,v,u){var y=this,m=b[y.id],R=y.styleObj=w(m.style),L=m.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new d.Map({container:y.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),N={};F.on("styleimagemissing",function(P){var U=P.id;if(!N[U]&&U.includes("-15")){N[U]=!0;var B=new Image(15,15);B.onload=function(){F.addImage(U,B)},B.crossOrigin="Anonymous",B.src="https://unpkg.com/maki@2.1.0/icons/"+U+".svg"}}),F.setTransformRequest(function(P){return P=P.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),P=P.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),P=P.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:P}}),F._canvas.style.left="0px",F._canvas.style.top="0px",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var O=[];O.push(new Promise(function(P){F.once("load",P)})),O=O.concat(S.fetchTraceGeoData(g)),Promise.all(O).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.updateMap=function(g,b,v,u){var y=this,m=y.map,R=b[this.id];y.rejectOnError(u);var L=[],z=w(R.style);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,m.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){m.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.fillBelowLookup=function(g,b){var v=b[this.id],u=v.layers,y,m,R=this.belowLookup={},L=!1;for(y=0;y1)for(y=0;y-1&&f(z.originalEvent,u,[v.xaxis],[v.yaxis],v.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,v=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var m=g.dragmode,R;R=function(z,F){if(F.isRect){var N=z.range={};N[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:R},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),v.off("click",b.onClickInPanHandler),i(m)||a(m)?(v.dragPan.disable(),v.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,N){n(z,F,N,b.dragOptions,m)},t.init(b.dragOptions)):(v.dragPan.enable(),v.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),v.on("click",b.onClickInPanHandler))},l.updateFramework=function(g){var b=g[this.id].domain,v=g._size,u=this.div.style;u.width=v.w*(b.x[1]-b.x[0])+"px",u.height=v.h*(b.y[1]-b.y[0])+"px",u.left=v.l+b.x[0]*v.w+"px",u.top=v.t+(1-b.y[1])*v.h+"px",this.xaxis._offset=v.l+b.x[0]*v.w,this.xaxis._length=v.w*(b.x[1]-b.x[0]),this.yaxis._offset=v.t+(1-b.y[1])*v.h,this.yaxis._length=v.h*(b.y[1]-b.y[0])},l.updateLayers=function(g){var b=g[this.id],v=b.layers,u=this.layerList,y;if(v.length!==u.length){for(y=0;yv/2){var u=A.split("|").join("
");g.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),b=t.bBox(g.node())}g.attr("transform",d(-3,-b.height+8)),M.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var y=1;b.width+6>v&&(y=v/(b.width+6));var m=[h.l+h.w*c.x[1],h.t+h.h*(1-c.y[0])];M.attr("transform",d(m[0],m[1])+x(y))}},Z.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],h=0;h=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),h=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,h),o[0].trace._glTrace=i,i}}}),UI=Ge({"src/traces/choroplethmap/index.js"(Z,q){"use strict";q.exports={attributes:OT(),supplyDefaults:BI(),colorbar:Od(),calc:O_(),plot:NI(),hoverPoints:N_(),eventData:U_(),selectPoints:j_(),styleOnSelect:function(d,x){if(x){var S=x[0].trace;S._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var S=x.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+c[f]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:A})}}var g=E.extractOpts(a),b=g.reversescale?E.flipScale(g.colorscale):g.colorscale,v=b[0][1],u=S.opacity(v)<1?v:S.addOpacity(v,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},q.exports=function(t,r){var o=r[0].trace,a=new S(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),WI=Ge({"src/traces/densitymap/hover.js"(Z,q){"use strict";var d=Mo(),x=ax().hoverPoints,S=ax().getExtraText;q.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var h=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return a.extraText=S(n,s,i[0].t.labels),[a]}}}}),XI=Ge({"src/traces/densitymap/event_data.js"(Z,q){"use strict";q.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),ZI=Ge({"src/traces/densitymap/index.js"(Z,q){"use strict";q.exports={attributes:NT(),supplyDefaults:VI(),colorbar:Od(),formatLabels:zT(),calc:qI(),plot:HI(),hoverPoints:WI(),eventData:XI(),getBelow:function(d,x){for(var S=x.getMapLayers(),E=0;E0;){l=w[w.length-1];var A=x[l];if(r[l]=0&&a[l].push(o[g])}r[l]=M}else{if(e[l]===E[l]){for(var b=[],v=[],u=0,M=_.length-1;M>=0;--M){var y=_[M];if(t[y]=!1,b.push(y),v.push(a[y]),u+=a[y].length,o[y]=s.length,y===l){_.length=M;break}}s.push(b);for(var m=new Array(u),M=0;Mg&&(g=n.source[_]),n.target[_]>g&&(g=n.target[_]);var b=g+1;a.node._count=b;var v,u=a.node.groups,y={};for(_=0;_0&&e(N,b)&&e(O,b)&&!(y.hasOwnProperty(N)&&y.hasOwnProperty(O)&&y[N]===y[O])){y.hasOwnProperty(O)&&(O=y[O]),y.hasOwnProperty(N)&&(N=y[N]),N=+N,O=+O,c[N]=c[O]=!0;var P="";n.label&&n.label[_]&&(P=n.label[_]);var U=null;P&&T.hasOwnProperty(P)&&(U=T[P]),s.push({pointNumber:_,label:P,color:h?n.color[_]:n.color,hovercolor:f?n.hovercolor[_]:n.hovercolor,customdata:p?n.customdata[_]:n.customdata,concentrationscale:U,source:N,target:O,value:+F}),z.source.push(N),z.target.push(O)}}var B=b+u.length,X=E(i.color),$=E(i.customdata),le=[];for(_=0;_b-1,childrenNodes:[],pointNumber:_,label:ce,color:X?i.color[_]:i.color,customdata:$?i.customdata[_]:i.customdata})}var ve=!1;return o(B,z.source,z.target)&&(ve=!0),{circular:ve,links:s,nodes:le,groups:u,groupLookup:y}}function o(a,i,n){for(var s=x.init2dArray(a,0),h=0;h1})}q.exports=function(i,n){var s=r(n);return S({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),$I=Ge({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){var v=+this._x.call(null,b),u=+this._y.call(null,b);return S(this.cover(v,u),v,u,b)}function S(b,v,u,y){if(isNaN(v)||isNaN(u))return b;var m,R=b._root,L={data:y},z=b._x0,F=b._y0,N=b._x1,O=b._y1,P,U,B,X,$,le,ce,ve;if(!R)return b._root=L,b;for(;R.length;)if(($=v>=(P=(z+N)/2))?z=P:N=P,(le=u>=(U=(F+O)/2))?F=U:O=U,m=R,!(R=R[ce=le<<1|$]))return m[ce]=L,b;if(B=+b._x.call(null,R.data),X=+b._y.call(null,R.data),v===B&&u===X)return L.next=R,m?m[ce]=L:b._root=L,b;do m=m?m[ce]=new Array(4):b._root=new Array(4),($=v>=(P=(z+N)/2))?z=P:N=P,(le=u>=(U=(F+O)/2))?F=U:O=U;while((ce=le<<1|$)===(ve=(X>=U)<<1|B>=P));return m[ve]=R,m[ce]=L,b}function E(b){var v,u,y=b.length,m,R,L=new Array(y),z=new Array(y),F=1/0,N=1/0,O=-1/0,P=-1/0;for(u=0;uO&&(O=m),RP&&(P=R));if(F>O||N>P)return this;for(this.cover(F,N).cover(O,P),u=0;ub||b>=m||y>v||v>=R;)switch(N=(vO||(z=X.y0)>P||(F=X.x1)=ce)<<1|b>=le)&&(X=U[U.length-1],U[U.length-1]=U[U.length-1-$],U[U.length-1-$]=X)}else{var ve=b-+this._x.call(null,B.data),G=v-+this._y.call(null,B.data),Y=ve*ve+G*G;if(Y=(U=(L+F)/2))?L=U:F=U,($=P>=(B=(z+N)/2))?z=B:N=B,v=u,!(u=u[le=$<<1|X]))return this;if(!u.length)break;(v[le+1&3]||v[le+2&3]||v[le+3&3])&&(y=v,ce=le)}for(;u.data!==b;)if(m=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,m?(R?m.next=R:delete m.next,this):v?(R?v[le]=R:delete v[le],(u=v[0]||v[1]||v[2]||v[3])&&u===(v[3]||v[2]||v[1]||v[0])&&!u.length&&(y?y[ce]=u:this._root=u),this):(this._root=R,this)}function n(b){for(var v=0,u=b.length;v=c.length)return l!=null&&g.sort(l),_!=null?_(g):g;for(var y=-1,m=g.length,R=c[b++],L,z,F=E(),N,O=v();++yc.length)return g;var v,u=T[b-1];return _!=null&&b>=c.length?v=g.entries():(v=[],g.each(function(y,m){v.push({key:m,values:M(y,b)})})),u!=null?v.sort(function(y,m){return u(y.key,m.key)}):v}return w={object:function(g){return A(g,0,t,r)},map:function(g){return A(g,0,o,a)},entries:function(g){return M(A(g,0,o,a),0)},key:function(g){return c.push(g),w},sortKeys:function(g){return T[c.length-1]=g,w},sortValues:function(g){return l=g,w},rollup:function(g){return _=g,w}}}function t(){return{}}function r(c,T,l){c[T]=l}function o(){return E()}function a(c,T,l){c.set(T,l)}function i(){}var n=E.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(c){return c+="",this[x+c]=c,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(c,T){var l=new i;if(c instanceof i)c.each(function(A){l.add(A)});else if(c){var _=-1,w=c.length;if(T==null)for(;++_=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}E.prototype=S.prototype={constructor:E,on:function(o,a){var i=this._,n=e(o+"",i),s,h=-1,f=n.length;if(arguments.length<2){for(;++h0)for(var i=new Array(s),n=0,s,h;n=0&&b._call.call(null,v),b=b._next;--x}function l(){a=(o=n.now())+i,x=S=0;try{T()}finally{x=0,w(),a=0}}function _(){var b=n.now(),v=b-o;v>e&&(i-=v,o=b)}function w(){for(var b,v=t,u,y=1/0;v;)v._call?(y>v._time&&(y=v._time),b=v,v=v._next):(u=v._next,v._next=null,v=b?b._next=u:t=u);r=b,A(y)}function A(b){if(!x){S&&(S=clearTimeout(S));var v=b-a;v>24?(b<1/0&&(S=setTimeout(l,b-n.now()-i)),E&&(E=clearInterval(E))):(E||(o=n.now(),E=setInterval(_,e)),x=1,s(l))}}function M(b,v,u){var y=new p;return v=v==null?0:+v,y.restart(function(m){y.stop(),b(m+v)},v,u),y}function g(b,v,u){var y=new p,m=v;return v==null?(y.restart(b,v,u),y):(v=+v,u=u==null?h():+u,y.restart(function R(L){L+=m,y.restart(R,m+=v,u),b(L)},v,u),y)}d.interval=g,d.now=h,d.timeout=M,d.timer=c,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),t4=Ge({"node_modules/d3-force/dist/d3-force.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,$I(),ix(),QI(),e4()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Z,function(d,x,S,E,e){"use strict";function t(b,v){var u;b==null&&(b=0),v==null&&(v=0);function y(){var m,R=u.length,L,z=0,F=0;for(m=0;mP.index){var Q=U-se.x-se.vx,re=B-se.y-se.vy,he=Q*Q+re*re;heU+j||eeB+j||VF.r&&(F.r=F[N].r)}function z(){if(v){var F,N=v.length,O;for(u=new Array(N),F=0;F1?($==null?z.remove(X):z.set(X,B($)),v):z.get(X)},find:function(X,$,le){var ce=0,ve=b.length,G,Y,ee,V,se;for(le==null?le=1/0:le*=le,ce=0;ce1?(N.on(X,$),v):N.on(X)}}}function w(){var b,v,u,y=r(-30),m,R=1,L=1/0,z=.81;function F(U){var B,X=b.length,$=x.quadtree(b,p,c).visitAfter(O);for(u=U,B=0;B=L)return;(U.data!==v||U.next)&&(le===0&&(le=o(),G+=le*le),ce===0&&(ce=o(),G+=ce*ce),GE)if(!(Math.abs(l*p-c*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var w=i-h,A=n-f,M=p*p+c*c,g=w*w+A*A,b=Math.sqrt(M),v=Math.sqrt(_),u=s*Math.tan((x-Math.acos((M+_-g)/(2*b*v)))/2),y=u/v,m=u/b;Math.abs(y-1)>E&&(this._+="L"+(o+y*T)+","+(a+y*l)),this._+="A"+s+","+s+",0,0,"+ +(l*w>T*A)+","+(this._x1=o+m*p)+","+(this._y1=a+m*c)}},arc:function(o,a,i,n,s,h){o=+o,a=+a,i=+i,h=!!h;var f=i*Math.cos(n),p=i*Math.sin(n),c=o+f,T=a+p,l=1^h,_=h?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+c+","+T:(Math.abs(this._x1-c)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+c+","+T),i&&(_<0&&(_=_%S+S),_>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-f)+","+(a-p)+"A"+i+","+i+",0,1,"+l+","+(this._x1=c)+","+(this._y1=T):_>E&&(this._+="A"+i+","+i+",0,"+ +(_>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),VT=Ge({"node_modules/d3-shape/dist/d3-shape.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,r4()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function S(dt){return function(){return dt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,h=s/2,f=2*s;function p(dt){return dt>1?0:dt<-1?s:Math.acos(dt)}function c(dt){return dt>=1?h:dt<=-1?-h:Math.asin(dt)}function T(dt){return dt.innerRadius}function l(dt){return dt.outerRadius}function _(dt){return dt.startAngle}function w(dt){return dt.endAngle}function A(dt){return dt&&dt.padAngle}function M(dt,qt,fr,Ir,da,Ta,ua,ra){var ha=fr-dt,pn=Ir-qt,_n=ua-da,jn=ra-Ta,li=jn*ha-_n*pn;if(!(li*liUo*Uo+Ko*Ko&&(No=bo,$o=Hi),{cx:No,cy:$o,x01:-_n,y01:-jn,x11:No*(da/lo-1),y11:$o*(da/lo-1)}}function b(){var dt=T,qt=l,fr=S(0),Ir=null,da=_,Ta=w,ua=A,ra=null;function ha(){var pn,_n,jn=+dt.apply(this,arguments),li=+qt.apply(this,arguments),yi=da.apply(this,arguments)-h,gi=Ta.apply(this,arguments)-h,Si=E(gi-yi),Gi=gi>yi;if(ra||(ra=pn=x.path()),lin))ra.moveTo(0,0);else if(Si>f-n)ra.moveTo(li*t(yi),li*a(yi)),ra.arc(0,0,li,yi,gi,!Gi),jn>n&&(ra.moveTo(jn*t(gi),jn*a(gi)),ra.arc(0,0,jn,gi,yi,Gi));else{var io=yi,vo=gi,ms=yi,pi=gi,lo=Si,Ai=Si,Fo=ua.apply(this,arguments)/2,No=Fo>n&&(Ir?+Ir.apply(this,arguments):i(jn*jn+li*li)),$o=o(E(li-jn)/2,+fr.apply(this,arguments)),bo=$o,Hi=$o,Pi,ji;if(No>n){var Uo=c(No/jn*a(Fo)),Ko=c(No/li*a(Fo));(lo-=Uo*2)>n?(Uo*=Gi?1:-1,ms+=Uo,pi-=Uo):(lo=0,ms=pi=(yi+gi)/2),(Ai-=Ko*2)>n?(Ko*=Gi?1:-1,io+=Ko,vo-=Ko):(Ai=0,io=vo=(yi+gi)/2)}var us=li*t(io),ko=li*a(io),zn=jn*t(pi),_i=jn*a(pi);if($o>n){var xs=li*t(vo),Qo=li*a(vo),Ii=jn*t(ms),gs=jn*a(ms),Zo;if(Sin?Hi>n?(Pi=g(Ii,gs,us,ko,li,Hi,Gi),ji=g(xs,Qo,zn,_i,li,Hi,Gi),ra.moveTo(Pi.cx+Pi.x01,Pi.cy+Pi.y01),Hi<$o?ra.arc(Pi.cx,Pi.cy,Hi,e(Pi.y01,Pi.x01),e(ji.y01,ji.x01),!Gi):(ra.arc(Pi.cx,Pi.cy,Hi,e(Pi.y01,Pi.x01),e(Pi.y11,Pi.x11),!Gi),ra.arc(0,0,li,e(Pi.cy+Pi.y11,Pi.cx+Pi.x11),e(ji.cy+ji.y11,ji.cx+ji.x11),!Gi),ra.arc(ji.cx,ji.cy,Hi,e(ji.y11,ji.x11),e(ji.y01,ji.x01),!Gi))):(ra.moveTo(us,ko),ra.arc(0,0,li,io,vo,!Gi)):ra.moveTo(us,ko),!(jn>n)||!(lo>n)?ra.lineTo(zn,_i):bo>n?(Pi=g(zn,_i,xs,Qo,jn,-bo,Gi),ji=g(us,ko,Ii,gs,jn,-bo,Gi),ra.lineTo(Pi.cx+Pi.x01,Pi.cy+Pi.y01),bo<$o?ra.arc(Pi.cx,Pi.cy,bo,e(Pi.y01,Pi.x01),e(ji.y01,ji.x01),!Gi):(ra.arc(Pi.cx,Pi.cy,bo,e(Pi.y01,Pi.x01),e(Pi.y11,Pi.x11),!Gi),ra.arc(0,0,jn,e(Pi.cy+Pi.y11,Pi.cx+Pi.x11),e(ji.cy+ji.y11,ji.cx+ji.x11),Gi),ra.arc(ji.cx,ji.cy,bo,e(ji.y11,ji.x11),e(ji.y01,ji.x01),!Gi))):ra.arc(0,0,jn,pi,ms,Gi)}if(ra.closePath(),pn)return ra=null,pn+""||null}return ha.centroid=function(){var pn=(+dt.apply(this,arguments)+ +qt.apply(this,arguments))/2,_n=(+da.apply(this,arguments)+ +Ta.apply(this,arguments))/2-s/2;return[t(_n)*pn,a(_n)*pn]},ha.innerRadius=function(pn){return arguments.length?(dt=typeof pn=="function"?pn:S(+pn),ha):dt},ha.outerRadius=function(pn){return arguments.length?(qt=typeof pn=="function"?pn:S(+pn),ha):qt},ha.cornerRadius=function(pn){return arguments.length?(fr=typeof pn=="function"?pn:S(+pn),ha):fr},ha.padRadius=function(pn){return arguments.length?(Ir=pn==null?null:typeof pn=="function"?pn:S(+pn),ha):Ir},ha.startAngle=function(pn){return arguments.length?(da=typeof pn=="function"?pn:S(+pn),ha):da},ha.endAngle=function(pn){return arguments.length?(Ta=typeof pn=="function"?pn:S(+pn),ha):Ta},ha.padAngle=function(pn){return arguments.length?(ua=typeof pn=="function"?pn:S(+pn),ha):ua},ha.context=function(pn){return arguments.length?(ra=pn??null,ha):ra},ha}function v(dt){this._context=dt}v.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2;default:this._context.lineTo(dt,qt);break}}};function u(dt){return new v(dt)}function y(dt){return dt[0]}function m(dt){return dt[1]}function R(){var dt=y,qt=m,fr=S(!0),Ir=null,da=u,Ta=null;function ua(ra){var ha,pn=ra.length,_n,jn=!1,li;for(Ir==null&&(Ta=da(li=x.path())),ha=0;ha<=pn;++ha)!(ha=li;--yi)ra.point(vo[yi],ms[yi]);ra.lineEnd(),ra.areaEnd()}Gi&&(vo[jn]=+dt(Si,jn,_n),ms[jn]=+fr(Si,jn,_n),ra.point(qt?+qt(Si,jn,_n):vo[jn],Ir?+Ir(Si,jn,_n):ms[jn]))}if(io)return ra=null,io+""||null}function pn(){return R().defined(da).curve(ua).context(Ta)}return ha.x=function(_n){return arguments.length?(dt=typeof _n=="function"?_n:S(+_n),qt=null,ha):dt},ha.x0=function(_n){return arguments.length?(dt=typeof _n=="function"?_n:S(+_n),ha):dt},ha.x1=function(_n){return arguments.length?(qt=_n==null?null:typeof _n=="function"?_n:S(+_n),ha):qt},ha.y=function(_n){return arguments.length?(fr=typeof _n=="function"?_n:S(+_n),Ir=null,ha):fr},ha.y0=function(_n){return arguments.length?(fr=typeof _n=="function"?_n:S(+_n),ha):fr},ha.y1=function(_n){return arguments.length?(Ir=_n==null?null:typeof _n=="function"?_n:S(+_n),ha):Ir},ha.lineX0=ha.lineY0=function(){return pn().x(dt).y(fr)},ha.lineY1=function(){return pn().x(dt).y(Ir)},ha.lineX1=function(){return pn().x(qt).y(fr)},ha.defined=function(_n){return arguments.length?(da=typeof _n=="function"?_n:S(!!_n),ha):da},ha.curve=function(_n){return arguments.length?(ua=_n,Ta!=null&&(ra=ua(Ta)),ha):ua},ha.context=function(_n){return arguments.length?(_n==null?Ta=ra=null:ra=ua(Ta=_n),ha):Ta},ha}function z(dt,qt){return qtdt?1:qt>=dt?0:NaN}function F(dt){return dt}function N(){var dt=F,qt=z,fr=null,Ir=S(0),da=S(f),Ta=S(0);function ua(ra){var ha,pn=ra.length,_n,jn,li=0,yi=new Array(pn),gi=new Array(pn),Si=+Ir.apply(this,arguments),Gi=Math.min(f,Math.max(-f,da.apply(this,arguments)-Si)),io,vo=Math.min(Math.abs(Gi)/pn,Ta.apply(this,arguments)),ms=vo*(Gi<0?-1:1),pi;for(ha=0;ha0&&(li+=pi);for(qt!=null?yi.sort(function(lo,Ai){return qt(gi[lo],gi[Ai])}):fr!=null&&yi.sort(function(lo,Ai){return fr(ra[lo],ra[Ai])}),ha=0,jn=li?(Gi-pn*ms)/li:0;ha0?pi*jn:0)+ms,gi[_n]={data:ra[_n],index:ha,value:pi,startAngle:Si,endAngle:io,padAngle:vo};return gi}return ua.value=function(ra){return arguments.length?(dt=typeof ra=="function"?ra:S(+ra),ua):dt},ua.sortValues=function(ra){return arguments.length?(qt=ra,fr=null,ua):qt},ua.sort=function(ra){return arguments.length?(fr=ra,qt=null,ua):fr},ua.startAngle=function(ra){return arguments.length?(Ir=typeof ra=="function"?ra:S(+ra),ua):Ir},ua.endAngle=function(ra){return arguments.length?(da=typeof ra=="function"?ra:S(+ra),ua):da},ua.padAngle=function(ra){return arguments.length?(Ta=typeof ra=="function"?ra:S(+ra),ua):Ta},ua}var O=U(u);function P(dt){this._curve=dt}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(dt,qt){this._curve.point(qt*Math.sin(dt),qt*-Math.cos(dt))}};function U(dt){function qt(fr){return new P(dt(fr))}return qt._curve=dt,qt}function B(dt){var qt=dt.curve;return dt.angle=dt.x,delete dt.x,dt.radius=dt.y,delete dt.y,dt.curve=function(fr){return arguments.length?qt(U(fr)):qt()._curve},dt}function X(){return B(R().curve(O))}function $(){var dt=L().curve(O),qt=dt.curve,fr=dt.lineX0,Ir=dt.lineX1,da=dt.lineY0,Ta=dt.lineY1;return dt.angle=dt.x,delete dt.x,dt.startAngle=dt.x0,delete dt.x0,dt.endAngle=dt.x1,delete dt.x1,dt.radius=dt.y,delete dt.y,dt.innerRadius=dt.y0,delete dt.y0,dt.outerRadius=dt.y1,delete dt.y1,dt.lineStartAngle=function(){return B(fr())},delete dt.lineX0,dt.lineEndAngle=function(){return B(Ir())},delete dt.lineX1,dt.lineInnerRadius=function(){return B(da())},delete dt.lineY0,dt.lineOuterRadius=function(){return B(Ta())},delete dt.lineY1,dt.curve=function(ua){return arguments.length?qt(U(ua)):qt()._curve},dt}function le(dt,qt){return[(qt=+qt)*Math.cos(dt-=Math.PI/2),qt*Math.sin(dt)]}var ce=Array.prototype.slice;function ve(dt){return dt.source}function G(dt){return dt.target}function Y(dt){var qt=ve,fr=G,Ir=y,da=m,Ta=null;function ua(){var ra,ha=ce.call(arguments),pn=qt.apply(this,ha),_n=fr.apply(this,ha);if(Ta||(Ta=ra=x.path()),dt(Ta,+Ir.apply(this,(ha[0]=pn,ha)),+da.apply(this,ha),+Ir.apply(this,(ha[0]=_n,ha)),+da.apply(this,ha)),ra)return Ta=null,ra+""||null}return ua.source=function(ra){return arguments.length?(qt=ra,ua):qt},ua.target=function(ra){return arguments.length?(fr=ra,ua):fr},ua.x=function(ra){return arguments.length?(Ir=typeof ra=="function"?ra:S(+ra),ua):Ir},ua.y=function(ra){return arguments.length?(da=typeof ra=="function"?ra:S(+ra),ua):da},ua.context=function(ra){return arguments.length?(Ta=ra??null,ua):Ta},ua}function ee(dt,qt,fr,Ir,da){dt.moveTo(qt,fr),dt.bezierCurveTo(qt=(qt+Ir)/2,fr,qt,da,Ir,da)}function V(dt,qt,fr,Ir,da){dt.moveTo(qt,fr),dt.bezierCurveTo(qt,fr=(fr+da)/2,Ir,fr,Ir,da)}function se(dt,qt,fr,Ir,da){var Ta=le(qt,fr),ua=le(qt,fr=(fr+da)/2),ra=le(Ir,fr),ha=le(Ir,da);dt.moveTo(Ta[0],Ta[1]),dt.bezierCurveTo(ua[0],ua[1],ra[0],ra[1],ha[0],ha[1])}function ae(){return Y(ee)}function j(){return Y(V)}function Q(){var dt=Y(se);return dt.angle=dt.x,delete dt.x,dt.radius=dt.y,delete dt.y,dt}var re={draw:function(dt,qt){var fr=Math.sqrt(qt/s);dt.moveTo(fr,0),dt.arc(0,0,fr,0,f)}},he={draw:function(dt,qt){var fr=Math.sqrt(qt/5)/2;dt.moveTo(-3*fr,-fr),dt.lineTo(-fr,-fr),dt.lineTo(-fr,-3*fr),dt.lineTo(fr,-3*fr),dt.lineTo(fr,-fr),dt.lineTo(3*fr,-fr),dt.lineTo(3*fr,fr),dt.lineTo(fr,fr),dt.lineTo(fr,3*fr),dt.lineTo(-fr,3*fr),dt.lineTo(-fr,fr),dt.lineTo(-3*fr,fr),dt.closePath()}},xe=Math.sqrt(1/3),Te=xe*2,Le={draw:function(dt,qt){var fr=Math.sqrt(qt/Te),Ir=fr*xe;dt.moveTo(0,-fr),dt.lineTo(Ir,0),dt.lineTo(0,fr),dt.lineTo(-Ir,0),dt.closePath()}},Pe=.8908130915292852,qe=Math.sin(s/10)/Math.sin(7*s/10),et=Math.sin(f/10)*qe,rt=-Math.cos(f/10)*qe,$e={draw:function(dt,qt){var fr=Math.sqrt(qt*Pe),Ir=et*fr,da=rt*fr;dt.moveTo(0,-fr),dt.lineTo(Ir,da);for(var Ta=1;Ta<5;++Ta){var ua=f*Ta/5,ra=Math.cos(ua),ha=Math.sin(ua);dt.lineTo(ha*fr,-ra*fr),dt.lineTo(ra*Ir-ha*da,ha*Ir+ra*da)}dt.closePath()}},Ue={draw:function(dt,qt){var fr=Math.sqrt(qt),Ir=-fr/2;dt.rect(Ir,Ir,fr,fr)}},fe=Math.sqrt(3),ue={draw:function(dt,qt){var fr=-Math.sqrt(qt/(fe*3));dt.moveTo(0,fr*2),dt.lineTo(-fe*fr,-fr),dt.lineTo(fe*fr,-fr),dt.closePath()}},ie=-.5,Ee=Math.sqrt(3)/2,We=1/Math.sqrt(12),Qe=(We/2+1)*3,Xe={draw:function(dt,qt){var fr=Math.sqrt(qt/Qe),Ir=fr/2,da=fr*We,Ta=Ir,ua=fr*We+fr,ra=-Ta,ha=ua;dt.moveTo(Ir,da),dt.lineTo(Ta,ua),dt.lineTo(ra,ha),dt.lineTo(ie*Ir-Ee*da,Ee*Ir+ie*da),dt.lineTo(ie*Ta-Ee*ua,Ee*Ta+ie*ua),dt.lineTo(ie*ra-Ee*ha,Ee*ra+ie*ha),dt.lineTo(ie*Ir+Ee*da,ie*da-Ee*Ir),dt.lineTo(ie*Ta+Ee*ua,ie*ua-Ee*Ta),dt.lineTo(ie*ra+Ee*ha,ie*ha-Ee*ra),dt.closePath()}},Tt=[re,he,Le,Ue,$e,ue,Xe];function St(){var dt=S(re),qt=S(64),fr=null;function Ir(){var da;if(fr||(fr=da=x.path()),dt.apply(this,arguments).draw(fr,+qt.apply(this,arguments)),da)return fr=null,da+""||null}return Ir.type=function(da){return arguments.length?(dt=typeof da=="function"?da:S(da),Ir):dt},Ir.size=function(da){return arguments.length?(qt=typeof da=="function"?da:S(+da),Ir):qt},Ir.context=function(da){return arguments.length?(fr=da??null,Ir):fr},Ir}function zt(){}function Ut(dt,qt,fr){dt._context.bezierCurveTo((2*dt._x0+dt._x1)/3,(2*dt._y0+dt._y1)/3,(dt._x0+2*dt._x1)/3,(dt._y0+2*dt._y1)/3,(dt._x0+4*dt._x1+qt)/6,(dt._y0+4*dt._y1+fr)/6)}function br(dt){this._context=dt}br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ut(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ut(this,dt,qt);break}this._x0=this._x1,this._x1=dt,this._y0=this._y1,this._y1=qt}};function hr(dt){return new br(dt)}function Or(dt){this._context=dt}Or.prototype={areaStart:zt,areaEnd:zt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._x2=dt,this._y2=qt;break;case 1:this._point=2,this._x3=dt,this._y3=qt;break;case 2:this._point=3,this._x4=dt,this._y4=qt,this._context.moveTo((this._x0+4*this._x1+dt)/6,(this._y0+4*this._y1+qt)/6);break;default:Ut(this,dt,qt);break}this._x0=this._x1,this._x1=dt,this._y0=this._y1,this._y1=qt}};function wr(dt){return new Or(dt)}function Er(dt){this._context=dt}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var fr=(this._x0+4*this._x1+dt)/6,Ir=(this._y0+4*this._y1+qt)/6;this._line?this._context.lineTo(fr,Ir):this._context.moveTo(fr,Ir);break;case 3:this._point=4;default:Ut(this,dt,qt);break}this._x0=this._x1,this._x1=dt,this._y0=this._y1,this._y1=qt}};function mt(dt){return new Er(dt)}function ze(dt,qt){this._basis=new br(dt),this._beta=qt}ze.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var dt=this._x,qt=this._y,fr=dt.length-1;if(fr>0)for(var Ir=dt[0],da=qt[0],Ta=dt[fr]-Ir,ua=qt[fr]-da,ra=-1,ha;++ra<=fr;)ha=ra/fr,this._basis.point(this._beta*dt[ra]+(1-this._beta)*(Ir+ha*Ta),this._beta*qt[ra]+(1-this._beta)*(da+ha*ua));this._x=this._y=null,this._basis.lineEnd()},point:function(dt,qt){this._x.push(+dt),this._y.push(+qt)}};var Ze=(function dt(qt){function fr(Ir){return qt===1?new br(Ir):new ze(Ir,qt)}return fr.beta=function(Ir){return dt(+Ir)},fr})(.85);function we(dt,qt,fr){dt._context.bezierCurveTo(dt._x1+dt._k*(dt._x2-dt._x0),dt._y1+dt._k*(dt._y2-dt._y0),dt._x2+dt._k*(dt._x1-qt),dt._y2+dt._k*(dt._y1-fr),dt._x2,dt._y2)}function ke(dt,qt){this._context=dt,this._k=(1-qt)/6}ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:we(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2,this._x1=dt,this._y1=qt;break;case 2:this._point=3;default:we(this,dt,qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var Be=(function dt(qt){function fr(Ir){return new ke(Ir,qt)}return fr.tension=function(Ir){return dt(+Ir)},fr})(0);function He(dt,qt){this._context=dt,this._k=(1-qt)/6}He.prototype={areaStart:zt,areaEnd:zt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._x3=dt,this._y3=qt;break;case 1:this._point=2,this._context.moveTo(this._x4=dt,this._y4=qt);break;case 2:this._point=3,this._x5=dt,this._y5=qt;break;default:we(this,dt,qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var nt=(function dt(qt){function fr(Ir){return new He(Ir,qt)}return fr.tension=function(Ir){return dt(+Ir)},fr})(0);function ot(dt,qt){this._context=dt,this._k=(1-qt)/6}ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:we(this,dt,qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var Ft=(function dt(qt){function fr(Ir){return new ot(Ir,qt)}return fr.tension=function(Ir){return dt(+Ir)},fr})(0);function Mt(dt,qt,fr){var Ir=dt._x1,da=dt._y1,Ta=dt._x2,ua=dt._y2;if(dt._l01_a>n){var ra=2*dt._l01_2a+3*dt._l01_a*dt._l12_a+dt._l12_2a,ha=3*dt._l01_a*(dt._l01_a+dt._l12_a);Ir=(Ir*ra-dt._x0*dt._l12_2a+dt._x2*dt._l01_2a)/ha,da=(da*ra-dt._y0*dt._l12_2a+dt._y2*dt._l01_2a)/ha}if(dt._l23_a>n){var pn=2*dt._l23_2a+3*dt._l23_a*dt._l12_a+dt._l12_2a,_n=3*dt._l23_a*(dt._l23_a+dt._l12_a);Ta=(Ta*pn+dt._x1*dt._l23_2a-qt*dt._l12_2a)/_n,ua=(ua*pn+dt._y1*dt._l23_2a-fr*dt._l12_2a)/_n}dt._context.bezierCurveTo(Ir,da,Ta,ua,dt._x2,dt._y2)}function Et(dt,qt){this._context=dt,this._alpha=qt}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){if(dt=+dt,qt=+qt,this._point){var fr=this._x2-dt,Ir=this._y2-qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(fr*fr+Ir*Ir,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2;break;case 2:this._point=3;default:Mt(this,dt,qt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var Ot=(function dt(qt){function fr(Ir){return qt?new Et(Ir,qt):new ke(Ir,0)}return fr.alpha=function(Ir){return dt(+Ir)},fr})(.5);function sr(dt,qt){this._context=dt,this._alpha=qt}sr.prototype={areaStart:zt,areaEnd:zt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(dt,qt){if(dt=+dt,qt=+qt,this._point){var fr=this._x2-dt,Ir=this._y2-qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(fr*fr+Ir*Ir,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=dt,this._y3=qt;break;case 1:this._point=2,this._context.moveTo(this._x4=dt,this._y4=qt);break;case 2:this._point=3,this._x5=dt,this._y5=qt;break;default:Mt(this,dt,qt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var ir=(function dt(qt){function fr(Ir){return qt?new sr(Ir,qt):new He(Ir,0)}return fr.alpha=function(Ir){return dt(+Ir)},fr})(.5);function ar(dt,qt){this._context=dt,this._alpha=qt}ar.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){if(dt=+dt,qt=+qt,this._point){var fr=this._x2-dt,Ir=this._y2-qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(fr*fr+Ir*Ir,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mt(this,dt,qt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=dt,this._y0=this._y1,this._y1=this._y2,this._y2=qt}};var Mr=(function dt(qt){function fr(Ir){return qt?new ar(Ir,qt):new ot(Ir,0)}return fr.alpha=function(Ir){return dt(+Ir)},fr})(.5);function ma(dt){this._context=dt}ma.prototype={areaStart:zt,areaEnd:zt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(dt,qt){dt=+dt,qt=+qt,this._point?this._context.lineTo(dt,qt):(this._point=1,this._context.moveTo(dt,qt))}};function Ca(dt){return new ma(dt)}function Aa(dt){return dt<0?-1:1}function Da(dt,qt,fr){var Ir=dt._x1-dt._x0,da=qt-dt._x1,Ta=(dt._y1-dt._y0)/(Ir||da<0&&-0),ua=(fr-dt._y1)/(da||Ir<0&&-0),ra=(Ta*da+ua*Ir)/(Ir+da);return(Aa(Ta)+Aa(ua))*Math.min(Math.abs(Ta),Math.abs(ua),.5*Math.abs(ra))||0}function Ba(dt,qt){var fr=dt._x1-dt._x0;return fr?(3*(dt._y1-dt._y0)/fr-qt)/2:qt}function ba(dt,qt,fr){var Ir=dt._x0,da=dt._y0,Ta=dt._x1,ua=dt._y1,ra=(Ta-Ir)/3;dt._context.bezierCurveTo(Ir+ra,da+ra*qt,Ta-ra,ua-ra*fr,Ta,ua)}function rn(dt){this._context=dt}rn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ba(this,this._t0,Ba(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(dt,qt){var fr=NaN;if(dt=+dt,qt=+qt,!(dt===this._x1&&qt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2;break;case 2:this._point=3,ba(this,Ba(this,fr=Da(this,dt,qt)),fr);break;default:ba(this,this._t0,fr=Da(this,dt,qt));break}this._x0=this._x1,this._x1=dt,this._y0=this._y1,this._y1=qt,this._t0=fr}}};function vn(dt){this._context=new Wt(dt)}(vn.prototype=Object.create(rn.prototype)).point=function(dt,qt){rn.prototype.point.call(this,qt,dt)};function Wt(dt){this._context=dt}Wt.prototype={moveTo:function(dt,qt){this._context.moveTo(qt,dt)},closePath:function(){this._context.closePath()},lineTo:function(dt,qt){this._context.lineTo(qt,dt)},bezierCurveTo:function(dt,qt,fr,Ir,da,Ta){this._context.bezierCurveTo(qt,dt,Ir,fr,Ta,da)}};function Lt(dt){return new rn(dt)}function Ht(dt){return new vn(dt)}function Xt(dt){this._context=dt}Xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var dt=this._x,qt=this._y,fr=dt.length;if(fr)if(this._line?this._context.lineTo(dt[0],qt[0]):this._context.moveTo(dt[0],qt[0]),fr===2)this._context.lineTo(dt[1],qt[1]);else for(var Ir=Pr(dt),da=Pr(qt),Ta=0,ua=1;ua=0;--qt)da[qt]=(ua[qt]-da[qt+1])/Ta[qt];for(Ta[fr-1]=(dt[fr]+da[fr-1])/2,qt=0;qt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(dt,qt){switch(dt=+dt,qt=+qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(dt,qt):this._context.moveTo(dt,qt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,qt),this._context.lineTo(dt,qt);else{var fr=this._x*(1-this._t)+dt*this._t;this._context.lineTo(fr,this._y),this._context.lineTo(fr,qt)}break}}this._x=dt,this._y=qt}};function na(dt){return new Kr(dt,.5)}function La(dt){return new Kr(dt,0)}function Ga(dt){return new Kr(dt,1)}function Ua(dt,qt){if((ua=dt.length)>1)for(var fr=1,Ir,da,Ta=dt[qt[0]],ua,ra=Ta.length;fr=0;)fr[qt]=qt;return fr}function an(dt,qt){return dt[qt]}function Sa(){var dt=S([]),qt=Xa,fr=Ua,Ir=an;function da(Ta){var ua=dt.apply(this,arguments),ra,ha=Ta.length,pn=ua.length,_n=new Array(pn),jn;for(ra=0;ra0){for(var fr,Ir,da=0,Ta=dt[0].length,ua;da0)for(var fr,Ir=0,da,Ta,ua,ra,ha,pn=dt[qt[0]].length;Ir0?(da[0]=ua,da[1]=ua+=Ta):Ta<0?(da[1]=ra,da[0]=ra+=Ta):(da[0]=0,da[1]=Ta)}function ti(dt,qt){if((da=dt.length)>0){for(var fr=0,Ir=dt[qt[0]],da,Ta=Ir.length;fr0)||!((Ta=(da=dt[qt[0]]).length)>0))){for(var fr=0,Ir=1,da,Ta,ua;IrTa&&(Ta=da,fr=qt);return fr}function Ar(dt){var qt=dt.map(pr);return Xa(dt).sort(function(fr,Ir){return qt[fr]-qt[Ir]})}function pr(dt){for(var qt=0,fr=-1,Ir=dt.length,da;++fr0;--se)Q(V*=.99),re(),j(V),re();function ae(){var he=x.max(ee,function(Le){return Le.length}),xe=B*(R-y)/(he-1);z>xe&&(z=xe);var Te=x.min(ee,function(Le){return(R-y-(Le.length-1)*z)/x.sum(Le,f)});ee.forEach(function(Le){Le.forEach(function(Pe,qe){Pe.y1=(Pe.y0=qe)+Pe.value*Te})}),Y.links.forEach(function(Le){Le.width=Le.value*Te})}function j(he){ee.forEach(function(xe){xe.forEach(function(Te){if(Te.targetLinks.length){var Le=(x.sum(Te.targetLinks,c)/x.sum(Te.targetLinks,f)-p(Te))*he;Te.y0+=Le,Te.y1+=Le}})})}function Q(he){ee.slice().reverse().forEach(function(xe){xe.forEach(function(Te){if(Te.sourceLinks.length){var Le=(x.sum(Te.sourceLinks,T)/x.sum(Te.sourceLinks,f)-p(Te))*he;Te.y0+=Le,Te.y1+=Le}})})}function re(){ee.forEach(function(he){var xe,Te,Le=y,Pe=he.length,qe;for(he.sort(h),qe=0;qe0&&(xe.y0+=Te,xe.y1+=Te),Le=xe.y1+z;if(Te=Le-z-R,Te>0)for(Le=xe.y0-=Te,xe.y1-=Te,qe=Pe-2;qe>=0;--qe)xe=he[qe],Te=xe.y1+z-Le,Te>0&&(xe.y0-=Te,xe.y1-=Te),Le=xe.y0})}}function G(Y){Y.nodes.forEach(function(ee){ee.sourceLinks.sort(s),ee.targetLinks.sort(n)}),Y.nodes.forEach(function(ee){var V=ee.y0,se=V;ee.sourceLinks.forEach(function(ae){ae.y0=V+ae.width/2,V+=ae.width}),ee.targetLinks.forEach(function(ae){ae.y1=se+ae.width/2,se+=ae.width})})}return X};function g(u){return[u.source.x1,u.y0]}function b(u){return[u.target.x0,u.y1]}var v=function(){return E.linkHorizontal().source(g).target(b)};d.sankey=M,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=v,Object.defineProperty(d,"__esModule",{value:!0})})}}),n4=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"(Z,q){var d=jT();q.exports=function(S,E){var e=[],t=[],r=[],o={},a=[],i;function n(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(M){delete o[A][M],r[M]&&n(M)})}function s(A){var M=!1;t.push(A),r[A]=!0;var g,b;for(g=0;g=A})}function p(A){f(A);for(var M=S,g=d(M),b=g.components.filter(function(z){return z.length>1}),v=1/0,u,y=0;y"u"?"undefined":s(ke))!=="object"&&(ke=Ze.source=g(ze,ke)),(typeof Be>"u"?"undefined":s(Be))!=="object"&&(Be=Ze.target=g(ze,Be)),ke.sourceLinks.push(Ze),Be.targetLinks.push(Ze)}),mt}function Ut(mt){mt.nodes.forEach(function(ze){ze.partOfCycle=!1,ze.value=Math.max(x.sum(ze.sourceLinks,c),x.sum(ze.targetLinks,c)),ze.sourceLinks.forEach(function(Ze){Ze.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ze.circularLinkType)}),ze.targetLinks.forEach(function(Ze){Ze.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ze.circularLinkType)})})}function br(mt){var ze=0,Ze=0,we=0,ke=0,Be=x.max(mt.nodes,function(He){return He.column});return mt.links.forEach(function(He){He.circular&&(He.circularLinkType=="top"?ze=ze+He.width:Ze=Ze+He.width,He.target.column==0&&(ke=ke+He.width),He.source.column==Be&&(we=we+He.width))}),ze=ze>0?ze+v+u:ze,Ze=Ze>0?Ze+v+u:Ze,we=we>0?we+v+u:we,ke=ke>0?ke+v+u:ke,{top:ze,bottom:Ze,left:ke,right:we}}function hr(mt,ze){var Ze=x.max(mt.nodes,function(Ft){return Ft.column}),we=et-Pe,ke=rt-qe,Be=we+ze.right+ze.left,He=ke+ze.top+ze.bottom,nt=we/Be,ot=ke/He;return Pe=Pe*nt+ze.left,et=ze.right==0?et:et*nt,qe=qe*ot+ze.top,rt=rt*ot,mt.nodes.forEach(function(Ft){Ft.x0=Pe+Ft.column*((et-Pe-$e)/Ze),Ft.x1=Ft.x0+$e}),ot}function Or(mt){var ze,Ze,we;for(ze=mt.nodes,Ze=[],we=0;ze.length;++we,ze=Ze,Ze=[])ze.forEach(function(ke){ke.depth=we,ke.sourceLinks.forEach(function(Be){Ze.indexOf(Be.target)<0&&!Be.circular&&Ze.push(Be.target)})});for(ze=mt.nodes,Ze=[],we=0;ze.length;++we,ze=Ze,Ze=[])ze.forEach(function(ke){ke.height=we,ke.targetLinks.forEach(function(Be){Ze.indexOf(Be.source)<0&&!Be.circular&&Ze.push(Be.source)})});mt.nodes.forEach(function(ke){ke.column=Math.floor(ue.call(null,ke,we))})}function wr(mt,ze,Ze){var we=S.nest().key(function(Ft){return Ft.column}).sortKeys(x.ascending).entries(mt.nodes).map(function(Ft){return Ft.values});He(Ze),ot();for(var ke=1,Be=ze;Be>0;--Be)nt(ke*=.99,Ze),ot();function He(Ft){if(Xe){var Mt=1/0;we.forEach(function(ir){var ar=rt*Xe/(ir.length+1);Mt=ar0))if(ir==0&&sr==1)Mr=ar.y1-ar.y0,ar.y0=rt/2-Mr/2,ar.y1=rt/2+Mr/2;else if(ir==Et-1&&sr==1)Mr=ar.y1-ar.y0,ar.y0=rt/2-Mr/2,ar.y1=rt/2+Mr/2;else{var ma=0,Ca=x.mean(ar.sourceLinks,_),Aa=x.mean(ar.targetLinks,l);Ca&&Aa?ma=(Ca+Aa)/2:ma=Ca||Aa;var Da=(ma-T(ar))*Ft;ar.y0+=Da,ar.y1+=Da}})})}function ot(){we.forEach(function(Ft){var Mt,Et,Ot=qe,sr=Ft.length,ir;for(Ft.sort(p),ir=0;ir0&&(Mt.y0+=Et,Mt.y1+=Et),Ot=Mt.y1+Ue;if(Et=Ot-Ue-rt,Et>0)for(Ot=Mt.y0-=Et,Mt.y1-=Et,ir=sr-2;ir>=0;--ir)Mt=Ft[ir],Et=Mt.y1+Ue-Ot,Et>0&&(Mt.y0-=Et,Mt.y1-=Et),Ot=Mt.y0})}}function Er(mt){mt.nodes.forEach(function(ze){ze.sourceLinks.sort(f),ze.targetLinks.sort(h)}),mt.nodes.forEach(function(ze){var Ze=ze.y0,we=Ze,ke=ze.y1,Be=ke;ze.sourceLinks.forEach(function(He){He.circular?(He.y0=ke-He.width/2,ke=ke-He.width):(He.y0=Ze+He.width/2,Ze+=He.width)}),ze.targetLinks.forEach(function(He){He.circular?(He.y1=Be-He.width/2,Be=Be-He.width):(He.y1=we+He.width/2,we+=He.width)})})}return St}function R(Pe,qe,et){var rt=0;if(et===null){for(var $e=[],Ue=0;Ueqe.source.column)}function N(Pe,qe){var et=0;Pe.sourceLinks.forEach(function($e){et=$e.circular&&!Te($e,qe)?et+1:et});var rt=0;return Pe.targetLinks.forEach(function($e){rt=$e.circular&&!Te($e,qe)?rt+1:rt}),et+rt}function O(Pe){var qe=Pe.source.sourceLinks,et=0;qe.forEach(function(Ue){et=Ue.circular?et+1:et});var rt=Pe.target.targetLinks,$e=0;return rt.forEach(function(Ue){$e=Ue.circular?$e+1:$e}),!(et>1||$e>1)}function P(Pe,qe,et){return Pe.sort(X),Pe.forEach(function(rt,$e){var Ue=0;if(Te(rt,et)&&O(rt))rt.circularPathData.verticalBuffer=Ue+rt.width/2;else{var fe=0;for(fe;fe<$e;fe++)if(F(Pe[$e],Pe[fe])){var ue=Pe[fe].circularPathData.verticalBuffer+Pe[fe].width/2+qe;Ue=ue>Ue?ue:Ue}rt.circularPathData.verticalBuffer=Ue+rt.width/2}}),Pe}function U(Pe,qe,et,rt){var $e=5,Ue=x.min(Pe.links,function(ie){return ie.source.y0});Pe.links.forEach(function(ie){ie.circular&&(ie.circularPathData={})});var fe=Pe.links.filter(function(ie){return ie.circularLinkType=="top"});P(fe,qe,rt);var ue=Pe.links.filter(function(ie){return ie.circularLinkType=="bottom"});P(ue,qe,rt),Pe.links.forEach(function(ie){if(ie.circular){if(ie.circularPathData.arcRadius=ie.width+u,ie.circularPathData.leftNodeBuffer=$e,ie.circularPathData.rightNodeBuffer=$e,ie.circularPathData.sourceWidth=ie.source.x1-ie.source.x0,ie.circularPathData.sourceX=ie.source.x0+ie.circularPathData.sourceWidth,ie.circularPathData.targetX=ie.target.x0,ie.circularPathData.sourceY=ie.y0,ie.circularPathData.targetY=ie.y1,Te(ie,rt)&&O(ie))ie.circularPathData.leftSmallArcRadius=u+ie.width/2,ie.circularPathData.leftLargeArcRadius=u+ie.width/2,ie.circularPathData.rightSmallArcRadius=u+ie.width/2,ie.circularPathData.rightLargeArcRadius=u+ie.width/2,ie.circularLinkType=="bottom"?(ie.circularPathData.verticalFullExtent=ie.source.y1+v+ie.circularPathData.verticalBuffer,ie.circularPathData.verticalLeftInnerExtent=ie.circularPathData.verticalFullExtent-ie.circularPathData.leftLargeArcRadius,ie.circularPathData.verticalRightInnerExtent=ie.circularPathData.verticalFullExtent-ie.circularPathData.rightLargeArcRadius):(ie.circularPathData.verticalFullExtent=ie.source.y0-v-ie.circularPathData.verticalBuffer,ie.circularPathData.verticalLeftInnerExtent=ie.circularPathData.verticalFullExtent+ie.circularPathData.leftLargeArcRadius,ie.circularPathData.verticalRightInnerExtent=ie.circularPathData.verticalFullExtent+ie.circularPathData.rightLargeArcRadius);else{var Ee=ie.source.column,We=ie.circularLinkType,Qe=Pe.links.filter(function(St){return St.source.column==Ee&&St.circularLinkType==We});ie.circularLinkType=="bottom"?Qe.sort(le):Qe.sort($);var Xe=0;Qe.forEach(function(St,zt){St.circularLinkID==ie.circularLinkID&&(ie.circularPathData.leftSmallArcRadius=u+ie.width/2+Xe,ie.circularPathData.leftLargeArcRadius=u+ie.width/2+zt*qe+Xe),Xe=Xe+St.width}),Ee=ie.target.column,Qe=Pe.links.filter(function(St){return St.target.column==Ee&&St.circularLinkType==We}),ie.circularLinkType=="bottom"?Qe.sort(ve):Qe.sort(ce),Xe=0,Qe.forEach(function(St,zt){St.circularLinkID==ie.circularLinkID&&(ie.circularPathData.rightSmallArcRadius=u+ie.width/2+Xe,ie.circularPathData.rightLargeArcRadius=u+ie.width/2+zt*qe+Xe),Xe=Xe+St.width}),ie.circularLinkType=="bottom"?(ie.circularPathData.verticalFullExtent=Math.max(et,ie.source.y1,ie.target.y1)+v+ie.circularPathData.verticalBuffer,ie.circularPathData.verticalLeftInnerExtent=ie.circularPathData.verticalFullExtent-ie.circularPathData.leftLargeArcRadius,ie.circularPathData.verticalRightInnerExtent=ie.circularPathData.verticalFullExtent-ie.circularPathData.rightLargeArcRadius):(ie.circularPathData.verticalFullExtent=Ue-v-ie.circularPathData.verticalBuffer,ie.circularPathData.verticalLeftInnerExtent=ie.circularPathData.verticalFullExtent+ie.circularPathData.leftLargeArcRadius,ie.circularPathData.verticalRightInnerExtent=ie.circularPathData.verticalFullExtent+ie.circularPathData.rightLargeArcRadius)}ie.circularPathData.leftInnerExtent=ie.circularPathData.sourceX+ie.circularPathData.leftNodeBuffer,ie.circularPathData.rightInnerExtent=ie.circularPathData.targetX-ie.circularPathData.rightNodeBuffer,ie.circularPathData.leftFullExtent=ie.circularPathData.sourceX+ie.circularPathData.leftLargeArcRadius+ie.circularPathData.leftNodeBuffer,ie.circularPathData.rightFullExtent=ie.circularPathData.targetX-ie.circularPathData.rightLargeArcRadius-ie.circularPathData.rightNodeBuffer}if(ie.circular)ie.path=B(ie);else{var Tt=E.linkHorizontal().source(function(St){var zt=St.source.x0+(St.source.x1-St.source.x0),Ut=St.y0;return[zt,Ut]}).target(function(St){var zt=St.target.x0,Ut=St.y1;return[zt,Ut]});ie.path=Tt(ie)}})}function B(Pe){var qe="";return Pe.circularLinkType=="top"?qe="M"+Pe.circularPathData.sourceX+" "+Pe.circularPathData.sourceY+" L"+Pe.circularPathData.leftInnerExtent+" "+Pe.circularPathData.sourceY+" A"+Pe.circularPathData.leftLargeArcRadius+" "+Pe.circularPathData.leftSmallArcRadius+" 0 0 0 "+Pe.circularPathData.leftFullExtent+" "+(Pe.circularPathData.sourceY-Pe.circularPathData.leftSmallArcRadius)+" L"+Pe.circularPathData.leftFullExtent+" "+Pe.circularPathData.verticalLeftInnerExtent+" A"+Pe.circularPathData.leftLargeArcRadius+" "+Pe.circularPathData.leftLargeArcRadius+" 0 0 0 "+Pe.circularPathData.leftInnerExtent+" "+Pe.circularPathData.verticalFullExtent+" L"+Pe.circularPathData.rightInnerExtent+" "+Pe.circularPathData.verticalFullExtent+" A"+Pe.circularPathData.rightLargeArcRadius+" "+Pe.circularPathData.rightLargeArcRadius+" 0 0 0 "+Pe.circularPathData.rightFullExtent+" "+Pe.circularPathData.verticalRightInnerExtent+" L"+Pe.circularPathData.rightFullExtent+" "+(Pe.circularPathData.targetY-Pe.circularPathData.rightSmallArcRadius)+" A"+Pe.circularPathData.rightLargeArcRadius+" "+Pe.circularPathData.rightSmallArcRadius+" 0 0 0 "+Pe.circularPathData.rightInnerExtent+" "+Pe.circularPathData.targetY+" L"+Pe.circularPathData.targetX+" "+Pe.circularPathData.targetY:qe="M"+Pe.circularPathData.sourceX+" "+Pe.circularPathData.sourceY+" L"+Pe.circularPathData.leftInnerExtent+" "+Pe.circularPathData.sourceY+" A"+Pe.circularPathData.leftLargeArcRadius+" "+Pe.circularPathData.leftSmallArcRadius+" 0 0 1 "+Pe.circularPathData.leftFullExtent+" "+(Pe.circularPathData.sourceY+Pe.circularPathData.leftSmallArcRadius)+" L"+Pe.circularPathData.leftFullExtent+" "+Pe.circularPathData.verticalLeftInnerExtent+" A"+Pe.circularPathData.leftLargeArcRadius+" "+Pe.circularPathData.leftLargeArcRadius+" 0 0 1 "+Pe.circularPathData.leftInnerExtent+" "+Pe.circularPathData.verticalFullExtent+" L"+Pe.circularPathData.rightInnerExtent+" "+Pe.circularPathData.verticalFullExtent+" A"+Pe.circularPathData.rightLargeArcRadius+" "+Pe.circularPathData.rightLargeArcRadius+" 0 0 1 "+Pe.circularPathData.rightFullExtent+" "+Pe.circularPathData.verticalRightInnerExtent+" L"+Pe.circularPathData.rightFullExtent+" "+(Pe.circularPathData.targetY+Pe.circularPathData.rightSmallArcRadius)+" A"+Pe.circularPathData.rightLargeArcRadius+" "+Pe.circularPathData.rightSmallArcRadius+" 0 0 1 "+Pe.circularPathData.rightInnerExtent+" "+Pe.circularPathData.targetY+" L"+Pe.circularPathData.targetX+" "+Pe.circularPathData.targetY,qe}function X(Pe,qe){return G(Pe)==G(qe)?Pe.circularLinkType=="bottom"?le(Pe,qe):$(Pe,qe):G(qe)-G(Pe)}function $(Pe,qe){return Pe.y0-qe.y0}function le(Pe,qe){return qe.y0-Pe.y0}function ce(Pe,qe){return Pe.y1-qe.y1}function ve(Pe,qe){return qe.y1-Pe.y1}function G(Pe){return Pe.target.column-Pe.source.column}function Y(Pe){return Pe.target.x0-Pe.source.x1}function ee(Pe,qe){var et=z(Pe),rt=Y(qe)/Math.tan(et),$e=xe(Pe)=="up"?Pe.y1+rt:Pe.y1-rt;return $e}function V(Pe,qe){var et=z(Pe),rt=Y(qe)/Math.tan(et),$e=xe(Pe)=="up"?Pe.y1-rt:Pe.y1+rt;return $e}function se(Pe,qe,et,rt){Pe.links.forEach(function($e){if(!$e.circular&&$e.target.column-$e.source.column>1){var Ue=$e.source.column+1,fe=$e.target.column-1,ue=1,ie=fe-Ue+1;for(ue=1;Ue<=fe;Ue++,ue++)Pe.nodes.forEach(function(Ee){if(Ee.column==Ue){var We=ue/(ie+1),Qe=Math.pow(1-We,3),Xe=3*We*Math.pow(1-We,2),Tt=3*Math.pow(We,2)*(1-We),St=Math.pow(We,3),zt=Qe*$e.y0+Xe*$e.y0+Tt*$e.y1+St*$e.y1,Ut=zt-$e.width/2,br=zt+$e.width/2,hr;Ut>Ee.y0&&UtEe.y0&&brEe.y1&&j(Or,hr,qe,et)})):UtEe.y1&&(hr=br-Ee.y0+10,Ee=j(Ee,hr,qe,et),Pe.nodes.forEach(function(Or){b(Or,rt)==b(Ee,rt)||Or.column!=Ee.column||Or.y0Ee.y1&&j(Or,hr,qe,et)}))}})}})}function ae(Pe,qe){return Pe.y0>qe.y0&&Pe.y0qe.y0&&Pe.y1qe.y1}function j(Pe,qe,et,rt){return Pe.y0+qe>=et&&Pe.y1+qe<=rt&&(Pe.y0=Pe.y0+qe,Pe.y1=Pe.y1+qe,Pe.targetLinks.forEach(function($e){$e.y1=$e.y1+qe}),Pe.sourceLinks.forEach(function($e){$e.y0=$e.y0+qe})),Pe}function Q(Pe,qe,et,rt){Pe.nodes.forEach(function($e){rt&&$e.y+($e.y1-$e.y0)>qe&&($e.y=$e.y-($e.y+($e.y1-$e.y0)-qe));var Ue=Pe.links.filter(function(ie){return b(ie.source,et)==b($e,et)}),fe=Ue.length;fe>1&&Ue.sort(function(ie,Ee){if(!ie.circular&&!Ee.circular){if(ie.target.column==Ee.target.column)return ie.y1-Ee.y1;if(he(ie,Ee)){if(ie.target.column>Ee.target.column){var We=V(Ee,ie);return ie.y1-We}if(Ee.target.column>ie.target.column){var Qe=V(ie,Ee);return Qe-Ee.y1}}else return ie.y1-Ee.y1}if(ie.circular&&!Ee.circular)return ie.circularLinkType=="top"?-1:1;if(Ee.circular&&!ie.circular)return Ee.circularLinkType=="top"?1:-1;if(ie.circular&&Ee.circular)return ie.circularLinkType===Ee.circularLinkType&&ie.circularLinkType=="top"?ie.target.column===Ee.target.column?ie.target.y1-Ee.target.y1:Ee.target.column-ie.target.column:ie.circularLinkType===Ee.circularLinkType&&ie.circularLinkType=="bottom"?ie.target.column===Ee.target.column?Ee.target.y1-ie.target.y1:ie.target.column-Ee.target.column:ie.circularLinkType=="top"?-1:1});var ue=$e.y0;Ue.forEach(function(ie){ie.y0=ue+ie.width/2,ue=ue+ie.width}),Ue.forEach(function(ie,Ee){if(ie.circularLinkType=="bottom"){var We=Ee+1,Qe=0;for(We;We1&&$e.sort(function(ue,ie){if(!ue.circular&&!ie.circular){if(ue.source.column==ie.source.column)return ue.y0-ie.y0;if(he(ue,ie)){if(ie.source.column0?"up":"down"}function Te(Pe,qe){return b(Pe.source,qe)==b(Pe.target,qe)}function Le(Pe,qe,et){var rt=Pe.nodes,$e=Pe.links,Ue=!1,fe=!1;if($e.forEach(function(Xe){Xe.circularLinkType=="top"?Ue=!0:Xe.circularLinkType=="bottom"&&(fe=!0)}),Ue==!1||fe==!1){var ue=x.min(rt,function(Xe){return Xe.y0}),ie=x.max(rt,function(Xe){return Xe.y1}),Ee=ie-ue,We=et-qe,Qe=We/Ee;rt.forEach(function(Xe){var Tt=(Xe.y1-Xe.y0)*Qe;Xe.y0=(Xe.y0-ue)*Qe,Xe.y1=Xe.y0+Tt}),$e.forEach(function(Xe){Xe.y0=(Xe.y0-ue)*Qe,Xe.y1=(Xe.y1-ue)*Qe,Xe.width=Xe.width*Qe})}}d.sankeyCircular=m,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),qT=Ge({"src/traces/sankey/constants.js"(Z,q){"use strict";q.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),o4=Ge({"src/traces/sankey/render.js"(Z,q){"use strict";var d=t4(),x=(Gp(),Pv(Hd)).interpolateNumber,S=Oi(),E=a4(),e=i4(),t=qT(),r=Ef(),o=Bi(),a=zo(),i=ta(),n=i.strTranslate,s=i.strRotate,h=Bv(),f=h.keyFun,p=h.repeat,c=h.unwrap,T=Il(),l=Yi(),_=uf(),w=_.CAP_SHIFT,A=_.LINE_SPACING,M=3;function g(ee,V,se){var ae=c(V),j=ae.trace,Q=j.domain,re=j.orientation==="h",he=j.node.pad,xe=j.node.thickness,Te={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[j.node.align],Le=ee.width*(Q.x[1]-Q.x[0]),Pe=ee.height*(Q.y[1]-Q.y[0]),qe=ae._nodes,et=ae._links,rt=ae.circular,$e;rt?$e=e.sankeyCircular().circularLinkGap(0):$e=E.sankey(),$e.iterations(t.sankeyIterations).size(re?[Le,Pe]:[Pe,Le]).nodeWidth(xe).nodePadding(he).nodeId(function(Or){return Or.pointNumber}).nodeAlign(Te).nodes(qe).links(et);var Ue=$e();$e.nodePadding()=ze||(mt=ze-Er.y0,mt>1e-6&&(Er.y0+=mt,Er.y1+=mt)),ze=Er.y1+he})}function zt(Or){var wr=Or.map(function(Be,He){return{x0:Be.x0,index:He}}).sort(function(Be,He){return Be.x0-He.x0}),Er=[],mt=-1,ze,Ze=-1/0,we;for(fe=0;feZe+xe&&(mt+=1,ze=ke.x0),Ze=ke.x0,Er[mt]||(Er[mt]=[]),Er[mt].push(ke),we=ze-ke.x0,ke.x0+=we,ke.x1+=we}return Er}if(j.node.x.length&&j.node.y.length){for(fe=0;fe0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(se="M "+(j.targetX-V)+" "+(j.targetY-ae)+" L "+(j.rightInnerExtent-V)+" "+(j.targetY-ae)+" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightSmallArcRadius+ae)+" 0 0 0 "+(j.rightFullExtent-ae-V)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-ae-V)+" "+j.verticalRightInnerExtent,Q&&re?se+=" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightLargeArcRadius+ae)+" 0 0 0 "+(j.rightInnerExtent-ae-V)+" "+(j.verticalFullExtent+ae)+" L "+(j.rightFullExtent+ae-V-(j.rightLargeArcRadius-ae))+" "+(j.verticalFullExtent+ae)+" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightLargeArcRadius+ae)+" 0 0 0 "+(j.leftFullExtent+ae)+" "+j.verticalLeftInnerExtent:Q?se+=" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightSmallArcRadius-ae)+" 0 0 1 "+(j.rightFullExtent-V-ae-(j.rightLargeArcRadius-ae))+" "+(j.verticalFullExtent-ae)+" L "+(j.leftFullExtent+ae+(j.rightLargeArcRadius-ae))+" "+(j.verticalFullExtent-ae)+" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightSmallArcRadius-ae)+" 0 0 1 "+(j.leftFullExtent+ae)+" "+j.verticalLeftInnerExtent:se+=" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightLargeArcRadius+ae)+" 0 0 0 "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent+ae)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+ae)+" A "+(j.leftLargeArcRadius+ae)+" "+(j.leftLargeArcRadius+ae)+" 0 0 0 "+(j.leftFullExtent+ae)+" "+j.verticalLeftInnerExtent,se+=" L "+(j.leftFullExtent+ae)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ae)+" "+(j.leftSmallArcRadius+ae)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-ae)+" L "+j.sourceX+" "+(j.sourceY-ae)+" L "+j.sourceX+" "+(j.sourceY+ae)+" L "+j.leftInnerExtent+" "+(j.sourceY+ae)+" A "+(j.leftLargeArcRadius-ae)+" "+(j.leftSmallArcRadius-ae)+" 0 0 1 "+(j.leftFullExtent-ae)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ae)+" "+j.verticalLeftInnerExtent,Q&&re?se+=" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightSmallArcRadius-ae)+" 0 0 1 "+(j.leftFullExtent-ae-(j.rightLargeArcRadius-ae))+" "+(j.verticalFullExtent-ae)+" L "+(j.rightFullExtent+ae-V+(j.rightLargeArcRadius-ae))+" "+(j.verticalFullExtent-ae)+" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightSmallArcRadius-ae)+" 0 0 1 "+(j.rightFullExtent+ae-V)+" "+j.verticalRightInnerExtent:Q?se+=" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightLargeArcRadius+ae)+" 0 0 0 "+(j.leftFullExtent+ae)+" "+(j.verticalFullExtent+ae)+" L "+(j.rightFullExtent-V-ae)+" "+(j.verticalFullExtent+ae)+" A "+(j.rightLargeArcRadius+ae)+" "+(j.rightLargeArcRadius+ae)+" 0 0 0 "+(j.rightFullExtent+ae-V)+" "+j.verticalRightInnerExtent:se+=" A "+(j.leftLargeArcRadius-ae)+" "+(j.leftLargeArcRadius-ae)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-ae)+" L "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent-ae)+" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightLargeArcRadius-ae)+" 0 0 1 "+(j.rightFullExtent+ae-V)+" "+j.verticalRightInnerExtent,se+=" L "+(j.rightFullExtent+ae-V)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ae)+" "+(j.rightSmallArcRadius-ae)+" 0 0 1 "+(j.rightInnerExtent-V)+" "+(j.targetY+ae)+" L "+(j.targetX-V)+" "+(j.targetY+ae)+(V>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),se}function u(){var ee=.5;function V(se){var ae=se.linkArrowLength;if(se.link.circular)return v(se.link,ae);var j=Math.abs((se.link.target.x0-se.link.source.x1)/2);ae>j&&(ae=j);var Q=se.link.source.x1,re=se.link.target.x0-ae,he=x(Q,re),xe=he(ee),Te=he(1-ee),Le=se.link.y0-se.link.width/2,Pe=se.link.y0+se.link.width/2,qe=se.link.y1-se.link.width/2,et=se.link.y1+se.link.width/2,rt="M"+Q+","+Le,$e="C"+xe+","+Le+" "+Te+","+qe+" "+re+","+qe,Ue="C"+Te+","+et+" "+xe+","+Pe+" "+Q+","+Pe,fe=ae>0?"L"+(re+ae)+","+(qe+se.link.width/2):"";return fe+="L"+re+","+et,rt+$e+fe+Ue+"Z"}return V}function y(ee,V){var se=r(V.color),ae=t.nodePadAcross,j=ee.nodePad/2;V.dx=V.x1-V.x0,V.dy=V.y1-V.y0;var Q=V.dx,re=Math.max(.5,V.dy),he="node_"+V.pointNumber;return V.group&&(he=i.randstr()),V.trace=ee.trace,V.curveNumber=ee.trace.index,{index:V.pointNumber,key:he,partOfGroup:V.partOfGroup||!1,group:V.group,traceId:ee.key,trace:ee.trace,node:V,nodePad:ee.nodePad,nodeLineColor:ee.nodeLineColor,nodeLineWidth:ee.nodeLineWidth,textFont:ee.textFont,size:ee.horizontal?ee.height:ee.width,visibleWidth:Math.ceil(Q),visibleHeight:re,zoneX:-ae,zoneY:-j,zoneWidth:Q+2*ae,zoneHeight:re+2*j,labelY:ee.horizontal?V.dy/2+1:V.dx/2+1,left:V.originalLayer===1,sizeAcross:ee.width,forceLayouts:ee.forceLayouts,horizontal:ee.horizontal,darkBackground:se.getBrightness()<=128,tinyColorHue:o.tinyRGB(se),tinyColorAlpha:se.getAlpha(),valueFormat:ee.valueFormat,valueSuffix:ee.valueSuffix,sankey:ee.sankey,graph:ee.graph,arrangement:ee.arrangement,uniqueNodeLabelPathId:[ee.guid,ee.key,he].join("_"),interactionState:ee.interactionState,figure:ee}}function m(ee){ee.attr("transform",function(V){return n(V.node.x0.toFixed(3),V.node.y0.toFixed(3))})}function R(ee){ee.call(m)}function L(ee,V){ee.call(R),V.attr("d",u())}function z(ee){ee.attr("width",function(V){return V.node.x1-V.node.x0}).attr("height",function(V){return V.visibleHeight})}function F(ee){return ee.link.width>1||ee.linkLineWidth>0}function N(ee){var V=n(ee.translateX,ee.translateY);return V+(ee.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(ee,V,se){ee.on(".basic",null).on("mouseover.basic",function(ae){!ae.interactionState.dragInProgress&&!ae.partOfGroup&&(se.hover(this,ae,V),ae.interactionState.hovered=[this,ae])}).on("mousemove.basic",function(ae){!ae.interactionState.dragInProgress&&!ae.partOfGroup&&(se.follow(this,ae),ae.interactionState.hovered=[this,ae])}).on("mouseout.basic",function(ae){!ae.interactionState.dragInProgress&&!ae.partOfGroup&&(se.unhover(this,ae,V),ae.interactionState.hovered=!1)}).on("click.basic",function(ae){ae.interactionState.hovered&&(se.unhover(this,ae,V),ae.interactionState.hovered=!1),!ae.interactionState.dragInProgress&&!ae.partOfGroup&&se.select(this,ae,V)})}function P(ee,V,se,ae){var j=S.behavior.drag().origin(function(Q){return{x:Q.node.x0+Q.visibleWidth/2,y:Q.node.y0+Q.visibleHeight/2}}).on("dragstart",function(Q){if(Q.arrangement!=="fixed"&&(i.ensureSingle(ae._fullLayout._infolayer,"g","dragcover",function(he){ae._fullLayout._dragCover=he}),i.raiseToTop(this),Q.interactionState.dragInProgress=Q.node,ce(Q.node),Q.interactionState.hovered&&(se.nodeEvents.unhover.apply(0,Q.interactionState.hovered),Q.interactionState.hovered=!1),Q.arrangement==="snap")){var re=Q.traceId+"|"+Q.key;Q.forceLayouts[re]?Q.forceLayouts[re].alpha(1):U(ee,re,Q,ae),B(ee,V,Q,re,ae)}}).on("drag",function(Q){if(Q.arrangement!=="fixed"){var re=S.event.x,he=S.event.y;Q.arrangement==="snap"?(Q.node.x0=re-Q.visibleWidth/2,Q.node.x1=re+Q.visibleWidth/2,Q.node.y0=he-Q.visibleHeight/2,Q.node.y1=he+Q.visibleHeight/2):(Q.arrangement==="freeform"&&(Q.node.x0=re-Q.visibleWidth/2,Q.node.x1=re+Q.visibleWidth/2),he=Math.max(0,Math.min(Q.size-Q.visibleHeight/2,he)),Q.node.y0=he-Q.visibleHeight/2,Q.node.y1=he+Q.visibleHeight/2),ce(Q.node),Q.arrangement!=="snap"&&(Q.sankey.update(Q.graph),L(ee.filter(ve(Q)),V))}}).on("dragend",function(Q){if(Q.arrangement!=="fixed"){Q.interactionState.dragInProgress=!1;for(var re=0;re0)window.requestAnimationFrame(Q);else{var xe=se.node.originalX;se.node.x0=xe-se.visibleWidth/2,se.node.x1=xe+se.visibleWidth/2,$(se,j)}})}function X(ee,V,se,ae){return function(){for(var Q=0,re=0;re0&&ae.forceLayouts[V].alpha(0)}}function $(ee,V){for(var se=[],ae=[],j=0;j"),color:_(G,"bgcolor")||t.addOpacity(ae.color,1),borderColor:_(G,"bordercolor"),fontFamily:_(G,"font.family"),fontSize:_(G,"font.size"),fontColor:_(G,"font.color"),fontWeight:_(G,"font.weight"),fontStyle:_(G,"font.style"),fontVariant:_(G,"font.variant"),fontTextcase:_(G,"font.textcase"),fontLineposition:_(G,"font.lineposition"),fontShadow:_(G,"font.shadow"),nameLength:_(G,"namelength"),textAlign:_(G,"align"),idealAlign:d.event.x"),color:_(G,"bgcolor")||ve.tinyColorHue,borderColor:_(G,"bordercolor"),fontFamily:_(G,"font.family"),fontSize:_(G,"font.size"),fontColor:_(G,"font.color"),fontWeight:_(G,"font.weight"),fontStyle:_(G,"font.style"),fontVariant:_(G,"font.variant"),fontTextcase:_(G,"font.textcase"),fontLineposition:_(G,"font.lineposition"),fontShadow:_(G,"font.shadow"),nameLength:_(G,"namelength"),textAlign:_(G,"align"),idealAlign:"left",hovertemplate:G.hovertemplate,hovertemplateLabels:Q,eventData:[ve.node]},{container:g._hoverlayer.node(),outerContainer:g._paper.node(),gd:A});n(xe,.85),s(xe)}}},le=function(ce,ve,G){A._fullLayout.hovermode!==!1&&(d.select(ce).call(c,ve,G),ve.node.trace.node.hoverinfo!=="skip"&&(ve.node.fullData=ve.node.trace,A.emit("plotly_unhover",{event:d.event,points:[ve.node]})),e.loneUnhover(g._hoverlayer.node()))};E(A,b,M,{width:v.w,height:v.h,margin:{t:v.t,r:v.r,b:v.b,l:v.l}},{linkEvents:{hover:R,follow:P,unhover:U,select:m},nodeEvents:{hover:X,follow:$,unhover:le,select:B}})}}}),s4=Ge({"src/traces/sankey/base_plot.js"(Z){"use strict";var q=Ru().overrideAll,d=Bf().getModuleCalcData,x=GT(),S=Md(),E=cv(),e=sh(),t=Pc().prepSelect,r=ta(),o=Yi(),a="sankey";Z.name=a,Z.baseLayoutAttrOverrides=q({hoverlabel:S.hoverlabel},"plot","nested"),Z.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Z.updateFx(n)},Z.clean=function(n,s,h,f){var p=f._has&&f._has(a),c=s._has&&s._has(a);p&&!c&&(f._paperdiv.selectAll(".sankey").remove(),f._paperdiv.selectAll(".bgsankey").remove())},Z.updateFx=function(n){for(var s=0;s0}q.exports=function(F,N,O,P){var U=F._fullLayout,B;w(O)&&P&&(B=P()),E.makeTraceGroups(U._indicatorlayer,N,"trace").each(function(X){var $=X[0],le=$.trace,ce=d.select(this),ve=le._hasGauge,G=le._isAngular,Y=le._isBullet,ee=le.domain,V={w:U._size.w*(ee.x[1]-ee.x[0]),h:U._size.h*(ee.y[1]-ee.y[0]),l:U._size.l+U._size.w*ee.x[0],r:U._size.r+U._size.w*(1-ee.x[1]),t:U._size.t+U._size.h*(1-ee.y[1]),b:U._size.b+U._size.h*ee.y[0]},se=V.l+V.w/2,ae=V.t+V.h/2,j=Math.min(V.w/2,V.h),Q=i.innerRadius*j,re,he,xe,Te=le.align||"center";if(he=ae,!ve)re=V.l+l[Te]*V.w,xe=function(ie){return y(ie,V.w,V.h)};else if(G&&(re=se,he=ae+j/2,xe=function(ie){return m(ie,.9*Q)}),Y){var Le=i.bulletPadding,Pe=1-i.bulletNumberDomainSize+Le;re=V.l+(Pe+(1-Pe)*l[Te])*V.w,xe=function(ie){return y(ie,(i.bulletNumberDomainSize-Le)*V.w,V.h)}}g(F,ce,X,{numbersX:re,numbersY:he,numbersScaler:xe,transitionOpts:O,onComplete:B});var qe,et;ve&&(qe={range:le.gauge.axis.range,color:le.gauge.bgcolor,line:{color:le.gauge.bordercolor,width:0},thickness:1},et={range:le.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:le.gauge.bordercolor,width:le.gauge.borderwidth},thickness:1});var rt=ce.selectAll("g.angular").data(G?X:[]);rt.exit().remove();var $e=ce.selectAll("g.angularaxis").data(G?X:[]);$e.exit().remove(),G&&M(F,ce,X,{radius:j,innerRadius:Q,gauge:rt,layer:$e,size:V,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:B});var Ue=ce.selectAll("g.bullet").data(Y?X:[]);Ue.exit().remove();var fe=ce.selectAll("g.bulletaxis").data(Y?X:[]);fe.exit().remove(),Y&&A(F,ce,X,{gauge:Ue,layer:fe,size:V,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:B});var ue=ce.selectAll("text.title").data(X);ue.exit().remove(),ue.enter().append("text").classed("title",!0),ue.attr("text-anchor",function(){return Y?T.right:T[le.title.align]}).text(le.title.text).call(a.font,le.title.font).call(n.convertToTspans,F),ue.attr("transform",function(){var ie=V.l+V.w*l[le.title.align],Ee,We=i.titlePadding,Qe=a.bBox(ue.node());if(ve){if(G)if(le.gauge.axis.visible){var Xe=a.bBox($e.node());Ee=Xe.top-We-Qe.bottom}else Ee=V.t+V.h/2-j/2-Qe.bottom-We;Y&&(Ee=he-(Qe.top+Qe.bottom)/2,ie=V.l-i.bulletPadding*V.w)}else Ee=le._numbersTop-We-Qe.bottom;return t(ie,Ee)})})};function A(z,F,N,O){var P=N[0].trace,U=O.gauge,B=O.layer,X=O.gaugeBg,$=O.gaugeOutline,le=O.size,ce=P.domain,ve=O.transitionOpts,G=O.onComplete,Y,ee,V,se,ae;U.enter().append("g").classed("bullet",!0),U.attr("transform",t(le.l,le.t)),B.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),B.selectAll("g.xbulletaxistick,path,text").remove();var j=le.h,Q=P.gauge.bar.thickness*j,re=ce.x[0],he=ce.x[0]+(ce.x[1]-ce.x[0])*(P._hasNumber||P._hasDelta?1-i.bulletNumberDomainSize:1);Y=u(z,P.gauge.axis),Y._id="xbulletaxis",Y.domain=[re,he],Y.setScale(),ee=s.calcTicks(Y),V=s.makeTransTickFn(Y),se=s.getTickSigns(Y)[2],ae=le.t+le.h,Y.visible&&(s.drawTicks(z,Y,{vals:Y.ticks==="inside"?s.clipEnds(Y,ee):ee,layer:B,path:s.makeTickPath(Y,ae,se),transFn:V}),s.drawLabels(z,Y,{vals:ee,layer:B,transFn:V,labelFns:s.makeLabelFns(Y,ae)}));function xe($e){$e.attr("width",function(Ue){return Math.max(0,Y.c2p(Ue.range[1])-Y.c2p(Ue.range[0]))}).attr("x",function(Ue){return Y.c2p(Ue.range[0])}).attr("y",function(Ue){return .5*(1-Ue.thickness)*j}).attr("height",function(Ue){return Ue.thickness*j})}var Te=[X].concat(P.gauge.steps),Le=U.selectAll("g.bg-bullet").data(Te);Le.enter().append("g").classed("bg-bullet",!0).append("rect"),Le.select("rect").call(xe).call(b),Le.exit().remove();var Pe=U.selectAll("g.value-bullet").data([P.gauge.bar]);Pe.enter().append("g").classed("value-bullet",!0).append("rect"),Pe.select("rect").attr("height",Q).attr("y",(j-Q)/2).call(b),w(ve)?Pe.select("rect").transition().duration(ve.duration).ease(ve.easing).each("end",function(){G&&G()}).each("interrupt",function(){G&&G()}).attr("width",Math.max(0,Y.c2p(Math.min(P.gauge.axis.range[1],N[0].y)))):Pe.select("rect").attr("width",typeof N[0].y=="number"?Math.max(0,Y.c2p(Math.min(P.gauge.axis.range[1],N[0].y))):0),Pe.exit().remove();var qe=N.filter(function(){return P.gauge.threshold.value||P.gauge.threshold.value===0}),et=U.selectAll("g.threshold-bullet").data(qe);et.enter().append("g").classed("threshold-bullet",!0).append("line"),et.select("line").attr("x1",Y.c2p(P.gauge.threshold.value)).attr("x2",Y.c2p(P.gauge.threshold.value)).attr("y1",(1-P.gauge.threshold.thickness)/2*j).attr("y2",(1-(1-P.gauge.threshold.thickness)/2)*j).call(c.stroke,P.gauge.threshold.line.color).style("stroke-width",P.gauge.threshold.line.width),et.exit().remove();var rt=U.selectAll("g.gauge-outline").data([$]);rt.enter().append("g").classed("gauge-outline",!0).append("rect"),rt.select("rect").call(xe).call(b),rt.exit().remove()}function M(z,F,N,O){var P=N[0].trace,U=O.size,B=O.radius,X=O.innerRadius,$=O.gaugeBg,le=O.gaugeOutline,ce=[U.l+U.w/2,U.t+U.h/2+B/2],ve=O.gauge,G=O.layer,Y=O.transitionOpts,ee=O.onComplete,V=Math.PI/2;function se(Tt){var St=P.gauge.axis.range[0],zt=P.gauge.axis.range[1],Ut=(Tt-St)/(zt-St)*Math.PI-V;return Ut<-V?-V:Ut>V?V:Ut}function ae(Tt){return d.svg.arc().innerRadius((X+B)/2-Tt/2*(B-X)).outerRadius((X+B)/2+Tt/2*(B-X)).startAngle(-V)}function j(Tt){Tt.attr("d",function(St){return ae(St.thickness).startAngle(se(St.range[0])).endAngle(se(St.range[1]))()})}var Q,re,he,xe;ve.enter().append("g").classed("angular",!0),ve.attr("transform",t(ce[0],ce[1])),G.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),G.selectAll("g.xangularaxistick,path,text").remove(),Q=u(z,P.gauge.axis),Q.type="linear",Q.range=P.gauge.axis.range,Q._id="xangularaxis",Q.ticklabeloverflow="allow",Q.setScale();var Te=function(Tt){return(Q.range[0]-Tt.x)/(Q.range[1]-Q.range[0])*Math.PI+Math.PI},Le={},Pe=s.makeLabelFns(Q,0),qe=Pe.labelStandoff;Le.xFn=function(Tt){var St=Te(Tt);return Math.cos(St)*qe},Le.yFn=function(Tt){var St=Te(Tt),zt=Math.sin(St)>0?.2:1;return-Math.sin(St)*(qe+Tt.fontSize*zt)+Math.abs(Math.cos(St))*(Tt.fontSize*o)},Le.anchorFn=function(Tt){var St=Te(Tt),zt=Math.cos(St);return Math.abs(zt)<.1?"middle":zt>0?"start":"end"},Le.heightFn=function(Tt,St,zt){var Ut=Te(Tt);return-.5*(1+Math.sin(Ut))*zt};var et=function(Tt){return t(ce[0]+B*Math.cos(Tt),ce[1]-B*Math.sin(Tt))};he=function(Tt){return et(Te(Tt))};var rt=function(Tt){var St=Te(Tt);return et(St)+"rotate("+-r(St)+")"};if(re=s.calcTicks(Q),xe=s.getTickSigns(Q)[2],Q.visible){xe=Q.ticks==="inside"?-1:1;var $e=(Q.linewidth||1)/2;s.drawTicks(z,Q,{vals:re,layer:G,path:"M"+xe*$e+",0h"+xe*Q.ticklen,transFn:rt}),s.drawLabels(z,Q,{vals:re,layer:G,transFn:he,labelFns:Le})}var Ue=[$].concat(P.gauge.steps),fe=ve.selectAll("g.bg-arc").data(Ue);fe.enter().append("g").classed("bg-arc",!0).append("path"),fe.select("path").call(j).call(b),fe.exit().remove();var ue=ae(P.gauge.bar.thickness),ie=ve.selectAll("g.value-arc").data([P.gauge.bar]);ie.enter().append("g").classed("value-arc",!0).append("path");var Ee=ie.select("path");w(Y)?(Ee.transition().duration(Y.duration).ease(Y.easing).each("end",function(){ee&&ee()}).each("interrupt",function(){ee&&ee()}).attrTween("d",v(ue,se(N[0].lastY),se(N[0].y))),P._lastValue=N[0].y):Ee.attr("d",typeof N[0].y=="number"?ue.endAngle(se(N[0].y)):"M0,0Z"),Ee.call(b),ie.exit().remove(),Ue=[];var We=P.gauge.threshold.value;(We||We===0)&&Ue.push({range:[We,We],color:P.gauge.threshold.color,line:{color:P.gauge.threshold.line.color,width:P.gauge.threshold.line.width},thickness:P.gauge.threshold.thickness});var Qe=ve.selectAll("g.threshold-arc").data(Ue);Qe.enter().append("g").classed("threshold-arc",!0).append("path"),Qe.select("path").call(j).call(b),Qe.exit().remove();var Xe=ve.selectAll("g.gauge-outline").data([le]);Xe.enter().append("g").classed("gauge-outline",!0).append("path"),Xe.select("path").call(j).call(b),Xe.exit().remove()}function g(z,F,N,O){var P=N[0].trace,U=O.numbersX,B=O.numbersY,X=P.align||"center",$=T[X],le=O.transitionOpts,ce=O.onComplete,ve=E.ensureSingle(F,"g","numbers"),G,Y,ee,V=[];P._hasNumber&&V.push("number"),P._hasDelta&&(V.push("delta"),P.delta.position==="left"&&V.reverse());var se=ve.selectAll("text").data(V);se.enter().append("text"),se.attr("text-anchor",function(){return $}).attr("class",function(et){return et}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),se.exit().remove();function ae(et,rt,$e,Ue){if(et.match("s")&&$e>=0!=Ue>=0&&!rt($e).slice(-1).match(_)&&!rt(Ue).slice(-1).match(_)){var fe=et.slice().replace("s","f").replace(/\d+/,function(ie){return parseInt(ie)-1}),ue=u(z,{tickformat:fe});return function(ie){return Math.abs(ie)<1?s.tickText(ue,ie).text:rt(ie)}}else return rt}function j(){var et=u(z,{tickformat:P.number.valueformat},P._range);et.setScale(),s.prepTicks(et);var rt=function(ie){return s.tickText(et,ie).text},$e=P.number.suffix,Ue=P.number.prefix,fe=ve.select("text.number");function ue(){var ie=typeof N[0].y=="number"?Ue+rt(N[0].y)+$e:"-";fe.text(ie).call(a.font,P.number.font).call(n.convertToTspans,z)}return w(le)?fe.transition().duration(le.duration).ease(le.easing).each("end",function(){ue(),ce&&ce()}).each("interrupt",function(){ue(),ce&&ce()}).attrTween("text",function(){var ie=d.select(this),Ee=S(N[0].lastY,N[0].y);P._lastValue=N[0].y;var We=ae(P.number.valueformat,rt,N[0].lastY,N[0].y);return function(Qe){ie.text(Ue+We(Ee(Qe))+$e)}}):ue(),G=R(Ue+rt(N[0].y)+$e,P.number.font,$,z),fe}function Q(){var et=u(z,{tickformat:P.delta.valueformat},P._range);et.setScale(),s.prepTicks(et);var rt=function(Qe){return s.tickText(et,Qe).text},$e=P.delta.suffix,Ue=P.delta.prefix,fe=function(Qe){var Xe=P.delta.relative?Qe.relativeDelta:Qe.delta;return Xe},ue=function(Qe,Xe){return Qe===0||typeof Qe!="number"||isNaN(Qe)?"-":(Qe>0?P.delta.increasing.symbol:P.delta.decreasing.symbol)+Ue+Xe(Qe)+$e},ie=function(Qe){return Qe.delta>=0?P.delta.increasing.color:P.delta.decreasing.color};P._deltaLastValue===void 0&&(P._deltaLastValue=fe(N[0]));var Ee=ve.select("text.delta");Ee.call(a.font,P.delta.font).call(c.fill,ie({delta:P._deltaLastValue}));function We(){Ee.text(ue(fe(N[0]),rt)).call(c.fill,ie(N[0])).call(n.convertToTspans,z)}return w(le)?Ee.transition().duration(le.duration).ease(le.easing).tween("text",function(){var Qe=d.select(this),Xe=fe(N[0]),Tt=P._deltaLastValue,St=ae(P.delta.valueformat,rt,Tt,Xe),zt=S(Tt,Xe);return P._deltaLastValue=Xe,function(Ut){Qe.text(ue(zt(Ut),St)),Qe.call(c.fill,ie({delta:zt(Ut)}))}}).each("end",function(){We(),ce&&ce()}).each("interrupt",function(){We(),ce&&ce()}):We(),Y=R(ue(fe(N[0]),rt),P.delta.font,$,z),Ee}var re=P.mode+P.align,he;if(P._hasDelta&&(he=Q(),re+=P.delta.position+P.delta.font.size+P.delta.font.family+P.delta.valueformat,re+=P.delta.increasing.symbol+P.delta.decreasing.symbol,ee=Y),P._hasNumber&&(j(),re+=P.number.font.size+P.number.font.family+P.number.valueformat+P.number.suffix+P.number.prefix,ee=G),P._hasDelta&&P._hasNumber){var xe=[(G.left+G.right)/2,(G.top+G.bottom)/2],Te=[(Y.left+Y.right)/2,(Y.top+Y.bottom)/2],Le,Pe,qe=.75*P.delta.font.size;P.delta.position==="left"&&(Le=L(P,"deltaPos",0,-1*(G.width*l[P.align]+Y.width*(1-l[P.align])+qe),re,Math.min),Pe=xe[1]-Te[1],ee={width:G.width+Y.width+qe,height:Math.max(G.height,Y.height),left:Y.left+Le,right:G.right,top:Math.min(G.top,Y.top+Pe),bottom:Math.max(G.bottom,Y.bottom+Pe)}),P.delta.position==="right"&&(Le=L(P,"deltaPos",0,G.width*(1-l[P.align])+Y.width*l[P.align]+qe,re,Math.max),Pe=xe[1]-Te[1],ee={width:G.width+Y.width+qe,height:Math.max(G.height,Y.height),left:G.left,right:Y.right+Le,top:Math.min(G.top,Y.top+Pe),bottom:Math.max(G.bottom,Y.bottom+Pe)}),P.delta.position==="bottom"&&(Le=null,Pe=Y.height,ee={width:Math.max(G.width,Y.width),height:G.height+Y.height,left:Math.min(G.left,Y.left),right:Math.max(G.right,Y.right),top:G.bottom-G.height,bottom:G.bottom+Y.height}),P.delta.position==="top"&&(Le=null,Pe=G.top,ee={width:Math.max(G.width,Y.width),height:G.height+Y.height,left:Math.min(G.left,Y.left),right:Math.max(G.right,Y.right),top:G.bottom-G.height-Y.height,bottom:G.bottom}),he.attr({dx:Le,dy:Pe})}(P._hasNumber||P._hasDelta)&&ve.attr("transform",function(){var et=O.numbersScaler(ee);re+=et[2];var rt=L(P,"numbersScale",1,et[0],re,Math.min),$e;P._scaleNumbers||(rt=1),P._isAngular?$e=B-rt*ee.bottom:$e=B-rt*(ee.top+ee.bottom)/2,P._numbersTop=rt*ee.top+$e;var Ue=ee[X];X==="center"&&(Ue=(ee.left+ee.right)/2);var fe=U-rt*Ue;return fe=L(P,"numbersTranslate",0,fe,re,Math.max),t(fe,$e)+e(rt)})}function b(z){z.each(function(F){c.stroke(d.select(this),F.line.color)}).each(function(F){c.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function v(z,F,N){return function(){var O=x(F,N);return function(P){return z.endAngle(O(P))()}}}function u(z,F,N){var O=z._fullLayout,P=E.extendFlat({type:"linear",ticks:"outside",range:N,showline:!0},F),U={type:"linear",_id:"x"+F._id},B={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function X($,le){return E.coerce(P,U,p,$,le)}return h(P,U,X,B,O),f(P,U,X,B),U}function y(z,F,N){var O=Math.min(F/z.width,N/z.height);return[O,z,F+"x"+N]}function m(z,F){var N=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/N;return[O,z,F]}function R(z,F,N,O){var P=document.createElementNS("http://www.w3.org/2000/svg","text"),U=d.select(P);return U.text(z).attr("x",0).attr("y",0).attr("text-anchor",N).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(U.node())}function L(z,F,N,O,P,U){var B="_cache"+F;z[B]&&z[B].key===P||(z[B]={key:P,value:N});var X=E.aggNums(U,null,[z[B].value,O],2);return z[B].value=X,X}}}),p4=Ge({"src/traces/indicator/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"indicator",basePlotModule:f4(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:HT(),supplyDefaults:h4().supplyDefaults,calc:v4().calc,plot:d4(),meta:{}}}}),m4=Ge({"lib/indicator.js"(Z,q){"use strict";q.exports=p4()}}),XT=Ge({"src/traces/table/attributes.js"(Z,q){"use strict";var d=Cp(),x=Do().extendFlat,S=Ru().overrideAll,E=bu(),e=ju().attributes,t=pc().descriptionOnlyNumbers,r=q.exports=S({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))}},"calc","from-root")}}),g4=Ge({"src/traces/table/defaults.js"(Z,q){"use strict";var d=ta(),x=XT(),S=ju().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(h,f){return h-f}),n=a.map(function(h){return i.indexOf(h)}),s=n.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),_4=Ge({"src/traces/table/data_preparation_helper.js"(Z,q){"use strict";var d=ZT(),x=Do().extendFlat,S=Bo(),E=nh().isTypedArray,e=nh().isArrayOrTypedArray;q.exports=function(p,c){var T=o(c.cells.values),l=function($){return $.slice(c.header.values.length,$.length)},_=o(c.header.values);_.length&&!_[0].length&&(_[0]=[""],_=o(_));var w=_.concat(l(T).map(function(){return a((_[0]||[""]).length)})),A=c.domain,M=Math.floor(p._fullLayout._size.w*(A.x[1]-A.x[0])),g=Math.floor(p._fullLayout._size.h*(A.y[1]-A.y[0])),b=c.header.values.length?w[0].map(function(){return c.header.height}):[d.emptyHeaderHeight],v=T.length?T[0].map(function(){return c.cells.height}):[],u=b.reduce(r,0),y=g-u,m=y+d.uplift,R=s(v,m),L=s(b,u),z=n(L,[]),F=n(R,z),N={},O=c._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function($,le){return le})));var P=w.map(function($,le){var ce=e(c.columnwidth)?c.columnwidth[Math.min(le,c.columnwidth.length-1)]:c.columnwidth;return S(ce)?Number(ce):1}),U=P.reduce(r,0);P=P.map(function($){return $/U*M});var B=Math.max(t(c.header.line.width),t(c.cells.line.width)),X={key:c.uid+p._context.staticPlot,translateX:A.x[0]*p._fullLayout._size.w,translateY:p._fullLayout._size.h*(1-A.y[1]),size:p._fullLayout._size,width:M,maxLineWidth:B,height:g,columnOrder:O,groupHeight:g,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},c.cells,{values:T}),headerCells:x({},c.header,{values:w}),gdColumns:w.map(function($){return $[0]}),gdColumnsOriginalOrder:w.map(function($){return $[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:w.map(function($,le){var ce=N[$];N[$]=(ce||0)+1;var ve=$+"__"+N[$];return{key:ve,label:$,specIndex:le,xIndex:O[le],xScale:i,x:void 0,calcdata:void 0,columnWidth:P[le]}})};return X.columns.forEach(function($){$.calcdata=X,$.x=i($)}),X};function t(f){if(e(f)){for(var p=0,c=0;c=p||g===f.length-1)&&(c[l]=w,w.key=M++,w.firstRowIndex=A,w.lastRowIndex=g,w=h(),l+=_,A=g+1,_=0);return c}function h(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),x4=Ge({"src/traces/table/data_split_helpers.js"(Z){"use strict";var q=Do().extendFlat;Z.splitToPanels=function(x){var S=[0,0],E=q({},x,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:q({},x.calcdata,{cells:x.calcdata.headerCells})}),e=q({},x,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=q({},x,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Z.splitToCells=function(x){var S=d(x);return(x.values||[]).slice(S[0],S[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function d(x){var S=x.rowBlocks[x.page],E=S?S.rows[0].rowIndex:0,e=S?E+S.rows.length:0;return[E,e]}}}),YT=Ge({"src/traces/table/plot.js"(Z,q){"use strict";var d=ZT(),x=Oi(),S=ta(),E=S.numberFormat,e=Bv(),t=zo(),r=Il(),o=ta().raiseToTop,a=ta().strTranslate,i=ta().cancelTransition,n=_4(),s=x4(),h=Bi();q.exports=function(re,he){var xe=!re._context.staticPlot,Te=re._fullLayout._paper.selectAll("."+d.cn.table).data(he.map(function(Xe){var Tt=e.unwrap(Xe),St=Tt.trace;return n(re,St)}),e.keyFun);Te.exit().remove(),Te.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Te.attr("width",function(Xe){return Xe.width+Xe.size.l+Xe.size.r}).attr("height",function(Xe){return Xe.height+Xe.size.t+Xe.size.b}).attr("transform",function(Xe){return a(Xe.translateX,Xe.translateY)});var Le=Te.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),Pe=Le.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(xe){var qe="onwheel"in document?"wheel":"mousewheel";Pe.on("mousemove",function(Xe){Le.filter(function(Tt){return Xe===Tt}).call(l,re)}).on(qe,function(Xe){if(!Xe.scrollbarState.wheeling){Xe.scrollbarState.wheeling=!0;var Tt=Xe.scrollY+x.event.deltaY,St=$(re,Le,null,Tt)(Xe);St||(x.event.stopPropagation(),x.event.preventDefault()),Xe.scrollbarState.wheeling=!1}}).call(l,re,!0)}Le.attr("transform",function(Xe){return a(Xe.size.l,Xe.size.t)});var et=Le.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);et.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),et.attr("width",function(Xe){return Xe.width}).attr("height",function(Xe){return Xe.height}),Le.each(function(Xe){t.setClipUrl(x.select(this),p(re,Xe),re)});var rt=Le.selectAll("."+d.cn.yColumn).data(function(Xe){return Xe.columns},e.keyFun);rt.enter().append("g").classed(d.cn.yColumn,!0),rt.exit().remove(),rt.attr("transform",function(Xe){return a(Xe.x,0)}),xe&&rt.call(x.behavior.drag().origin(function(Xe){var Tt=x.select(this);return N(Tt,Xe,-d.uplift),o(this),Xe.calcdata.columnDragInProgress=!0,l(Le.filter(function(St){return Xe.calcdata.key===St.key}),re),Xe}).on("drag",function(Xe){var Tt=x.select(this),St=function(br){return(Xe===br?x.event.x:br.x)+br.columnWidth/2};Xe.x=Math.max(-d.overdrag,Math.min(Xe.calcdata.width+d.overdrag-Xe.columnWidth,x.event.x));var zt=T(rt).filter(function(br){return br.calcdata.key===Xe.calcdata.key}),Ut=zt.sort(function(br,hr){return St(br)-St(hr)});Ut.forEach(function(br,hr){br.xIndex=hr,br.x=Xe===br?br.x:br.xScale(br)}),rt.filter(function(br){return Xe!==br}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(br){return a(br.x,0)}),Tt.call(i).attr("transform",a(Xe.x,-d.uplift))}).on("dragend",function(Xe){var Tt=x.select(this),St=Xe.calcdata;Xe.x=Xe.xScale(Xe),Xe.calcdata.columnDragInProgress=!1,N(Tt,Xe,0),z(re,St,St.columns.map(function(zt){return zt.xIndex}))})),rt.each(function(Xe){t.setClipUrl(x.select(this),c(re,Xe),re)});var $e=rt.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);$e.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Xe){return Xe.key}),$e.style("cursor",function(Xe){return Xe.dragHandle?"ew-resize":Xe.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Ue=$e.filter(P),fe=$e.filter(O);xe&&fe.call(x.behavior.drag().origin(function(Xe){return x.event.stopPropagation(),Xe}).on("drag",$(re,Le,-1)).on("dragend",function(){})),_(re,Le,Ue,$e),_(re,Le,fe,$e);var ue=Le.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);ue.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Xe){return p(re,Xe)});var ie=ue.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);ie.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ie.attr("width",function(Xe){return Xe.width+2*d.overdrag}).attr("height",function(Xe){return Xe.height+d.uplift});var Ee=rt.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);Ee.enter().append("g").classed(d.cn.columnBoundary,!0);var We=rt.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);We.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),We.attr("id",function(Xe){return c(re,Xe)});var Qe=We.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);Qe.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),Qe.attr("width",function(Xe){return Xe.columnWidth+2*f(Xe)}).attr("height",function(Xe){return Xe.calcdata.height+2*f(Xe)+d.uplift}).attr("x",function(Xe){return-f(Xe)}).attr("y",function(Xe){return-f(Xe)}),X(null,fe,Le)};function f(Q){return Math.ceil(Q.calcdata.maxLineWidth/2)}function p(Q,re){return"clip"+Q._fullLayout._uid+"_scrollAreaBottomClip_"+re.key}function c(Q,re){return"clip"+Q._fullLayout._uid+"_columnBoundaryClippath_"+re.calcdata.key+"_"+re.specIndex}function T(Q){return[].concat.apply([],Q.map(function(re){return re})).map(function(re){return re.__data__})}function l(Q,re,he){function xe(rt){var $e=rt.rowBlocks;return ee($e,$e.length-1)+($e.length?V($e[$e.length-1],1/0):1)}var Te=Q.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Te.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Te.each(function(rt){var $e=rt.scrollbarState;$e.totalHeight=xe(rt),$e.scrollableAreaHeight=rt.groupHeight-U(rt),$e.currentlyVisibleHeight=Math.min($e.totalHeight,$e.scrollableAreaHeight),$e.ratio=$e.currentlyVisibleHeight/$e.totalHeight,$e.barLength=Math.max($e.ratio*$e.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),$e.barWiggleRoom=$e.currentlyVisibleHeight-$e.barLength,$e.wiggleRoom=Math.max(0,$e.totalHeight-$e.scrollableAreaHeight),$e.topY=$e.barWiggleRoom===0?0:rt.scrollY/$e.wiggleRoom*$e.barWiggleRoom,$e.bottomY=$e.topY+$e.barLength,$e.dragMultiplier=$e.wiggleRoom/$e.barWiggleRoom}).attr("transform",function(rt){var $e=rt.width+d.scrollbarWidth/2+d.scrollbarOffset;return a($e,U(rt))});var Le=Te.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);Le.enter().append("g").classed(d.cn.scrollbar,!0);var Pe=Le.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);Pe.enter().append("g").classed(d.cn.scrollbarSlider,!0),Pe.attr("transform",function(rt){return a(0,rt.scrollbarState.topY||0)});var qe=Pe.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);qe.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),qe.attr("y2",function(rt){return rt.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(rt){return rt.columnDragInProgress||!rt.scrollbarState.barWiggleRoom||he?0:.4}),qe.transition().delay(0).duration(0),qe.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var et=Le.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);et.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(rt){var $e=x.event.y,Ue=this.getBoundingClientRect(),fe=rt.scrollbarState,ue=$e-Ue.top,ie=x.scale.linear().domain([0,fe.scrollableAreaHeight]).range([0,fe.totalHeight]).clamp(!0);fe.topY<=ue&&ue<=fe.bottomY||$(re,Q,null,ie(ue-fe.barLength/2))(rt)}).call(x.behavior.drag().origin(function(rt){return x.event.stopPropagation(),rt.scrollbarState.scrollbarScrollInProgress=!0,rt}).on("drag",$(re,Q)).on("dragend",function(){})),et.attr("y2",function(rt){return rt.scrollbarState.scrollableAreaHeight}),re._context.staticPlot&&(qe.remove(),et.remove())}function _(Q,re,he,xe){var Te=w(he),Le=A(Te);v(Le);var Pe=M(Le);y(Pe);var qe=b(Le),et=g(qe);u(et),m(et,re,xe,Q),Y(Le)}function w(Q){var re=Q.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return re.enter().append("g").classed(d.cn.columnCells,!0),re.exit().remove(),re}function A(Q){var re=Q.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(he){return he.keyWithinBlock});return re.enter().append("g").classed(d.cn.columnCell,!0),re.exit().remove(),re}function M(Q){var re=Q.selectAll("."+d.cn.cellRect).data(e.repeat,function(he){return he.keyWithinBlock});return re.enter().append("rect").classed(d.cn.cellRect,!0),re}function g(Q){var re=Q.selectAll("."+d.cn.cellText).data(e.repeat,function(he){return he.keyWithinBlock});return re.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),re}function b(Q){var re=Q.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(he){return he.keyWithinBlock});return re.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),re}function v(Q){Q.each(function(re,he){var xe=re.calcdata.cells.font,Te=re.column.specIndex,Le={size:F(xe.size,Te,he),color:F(xe.color,Te,he),family:F(xe.family,Te,he),weight:F(xe.weight,Te,he),style:F(xe.style,Te,he),variant:F(xe.variant,Te,he),textcase:F(xe.textcase,Te,he),lineposition:F(xe.lineposition,Te,he),shadow:F(xe.shadow,Te,he)};re.rowNumber=re.key,re.align=F(re.calcdata.cells.align,Te,he),re.cellBorderWidth=F(re.calcdata.cells.line.width,Te,he),re.font=Le})}function u(Q){Q.each(function(re){t.font(x.select(this),re.font)})}function y(Q){Q.attr("width",function(re){return re.column.columnWidth}).attr("stroke-width",function(re){return re.cellBorderWidth}).each(function(re){var he=x.select(this);h.stroke(he,F(re.calcdata.cells.line.color,re.column.specIndex,re.rowNumber)),h.fill(he,F(re.calcdata.cells.fill.color,re.column.specIndex,re.rowNumber))})}function m(Q,re,he,xe){Q.text(function(Te){var Le=Te.column.specIndex,Pe=Te.rowNumber,qe=Te.value,et=typeof qe=="string",rt=et&&qe.match(/
/i),$e=!et||rt;Te.mayHaveMarkup=et&&qe.match(/[<&>]/);var Ue=R(qe);Te.latex=Ue;var fe=Ue?"":F(Te.calcdata.cells.prefix,Le,Pe)||"",ue=Ue?"":F(Te.calcdata.cells.suffix,Le,Pe)||"",ie=Ue?null:F(Te.calcdata.cells.format,Le,Pe)||null,Ee=fe+(ie?E(ie)(Te.value):Te.value)+ue,We;Te.wrappingNeeded=!Te.wrapped&&!$e&&!Ue&&(We=L(Ee)),Te.cellHeightMayIncrease=rt||Ue||Te.mayHaveMarkup||(We===void 0?L(Ee):We),Te.needsConvertToTspans=Te.mayHaveMarkup||Te.wrappingNeeded||Te.latex;var Qe;if(Te.wrappingNeeded){var Xe=d.wrapSplitCharacter===" "?Ee.replace(/Te&&xe.push(Le),Te+=et}return xe}function X(Q,re,he){var xe=T(re)[0];if(xe!==void 0){var Te=xe.rowBlocks,Le=xe.calcdata,Pe=ee(Te,Te.length),qe=xe.calcdata.groupHeight-U(xe),et=Le.scrollY=Math.max(0,Math.min(Pe-qe,Le.scrollY)),rt=B(Te,et,qe);rt.length===1&&(rt[0]===Te.length-1?rt.unshift(rt[0]-1):rt.push(rt[0]+1)),rt[0]%2&&rt.reverse(),re.each(function($e,Ue){$e.page=rt[Ue],$e.scrollY=et}),re.attr("transform",function($e){var Ue=ee($e.rowBlocks,$e.page)-$e.scrollY;return a(0,Ue)}),Q&&(le(Q,he,re,rt,xe.prevPages,xe,0),le(Q,he,re,rt,xe.prevPages,xe,1),l(he,Q))}}function $(Q,re,he,xe){return function(Le){var Pe=Le.calcdata?Le.calcdata:Le,qe=re.filter(function(Ue){return Pe.key===Ue.key}),et=he||Pe.scrollbarState.dragMultiplier,rt=Pe.scrollY;Pe.scrollY=xe===void 0?Pe.scrollY+et*x.event.dy:xe;var $e=qe.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return X(Q,$e,qe),Pe.scrollY===rt}}function le(Q,re,he,xe,Te,Le,Pe){var qe=xe[Pe]!==Te[Pe];qe&&(clearTimeout(Le.currentRepaint[Pe]),Le.currentRepaint[Pe]=setTimeout(function(){var et=he.filter(function(rt,$e){return $e===Pe&&xe[$e]!==Te[$e]});_(Q,re,et,he),Te[Pe]=xe[Pe]}))}function ce(Q,re,he,xe){return function(){var Le=x.select(re.parentNode);Le.each(function(Pe){var qe=Pe.fragments;Le.selectAll("tspan.line").each(function(Ee,We){qe[We].width=this.getComputedTextLength()});var et=qe[qe.length-1].width,rt=qe.slice(0,-1),$e=[],Ue,fe,ue=0,ie=Pe.column.columnWidth-2*d.cellPad;for(Pe.value="";rt.length;)Ue=rt.shift(),fe=Ue.width+et,ue+fe>ie&&(Pe.value+=$e.join(d.wrapSpacer)+d.lineBreaker,$e=[],ue=0),$e.push(Ue.text),ue+=fe;ue&&(Pe.value+=$e.join(d.wrapSpacer)),Pe.wrapped=!0}),Le.selectAll("tspan.line").remove(),m(Le.select("."+d.cn.cellText),he,Q,xe),x.select(re.parentNode.parentNode).call(Y)}}function ve(Q,re,he,xe,Te){return function(){if(!Te.settledY){var Pe=x.select(re.parentNode),qe=ae(Te),et=Te.key-qe.firstRowIndex,rt=qe.rows[et].rowHeight,$e=Te.cellHeightMayIncrease?re.parentNode.getBoundingClientRect().height+2*d.cellPad:rt,Ue=Math.max($e,rt),fe=Ue-qe.rows[et].rowHeight;fe&&(qe.rows[et].rowHeight=Ue,Q.selectAll("."+d.cn.columnCell).call(Y),X(null,Q.filter(O),0),l(he,xe,!0)),Pe.attr("transform",function(){var ue=this,ie=ue.parentNode,Ee=ie.getBoundingClientRect(),We=x.select(ue.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),Qe=ue.transform.baseVal.consolidate(),Xe=We.top-Ee.top+(Qe?Qe.matrix.f:d.cellPad);return a(G(Te,x.select(ue.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Xe)}),Te.settledY=!0}}}function G(Q,re){switch(Q.align){case"left":return d.cellPad;case"right":return Q.column.columnWidth-(re||0)-d.cellPad;case"center":return(Q.column.columnWidth-(re||0))/2;default:return d.cellPad}}function Y(Q){Q.attr("transform",function(re){var he=re.rowBlocks[0].auxiliaryBlocks.reduce(function(Pe,qe){return Pe+V(qe,1/0)},0),xe=ae(re),Te=V(xe,re.key),Le=Te+he;return a(0,Le)}).selectAll("."+d.cn.cellRect).attr("height",function(re){return j(ae(re),re.key).rowHeight})}function ee(Q,re){for(var he=0,xe=re-1;xe>=0;xe--)he+=se(Q[xe]);return he}function V(Q,re){for(var he=0,xe=0;xeE.length&&(S=S.slice(0,E.length)):S=[],t=0;t90&&(p-=180,i=-i),{angle:p,flip:i,p:x.c2p(e,S,E),offsetMultplier:n}}}}),L4=Ge({"src/traces/carpet/plot.js"(Z,q){"use strict";var d=Oi(),x=zo(),S=KT(),E=JT(),e=C4(),t=Il(),r=ta(),o=r.strRotate,a=r.strTranslate,i=uf();q.exports=function(_,w,A,M){var g=_._context.staticPlot,b=w.xaxis,v=w.yaxis,u=_._fullLayout,y=u._clips;r.makeTraceGroups(M,A,"trace").each(function(m){var R=d.select(this),L=m[0],z=L.trace,F=z.aaxis,N=z.baxis,O=r.ensureSingle(R,"g","minorlayer"),P=r.ensureSingle(R,"g","majorlayer"),U=r.ensureSingle(R,"g","boundarylayer"),B=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(b,v,P,F,"a",F._gridlines,!0,g),s(b,v,P,N,"b",N._gridlines,!0,g),s(b,v,O,F,"a",F._minorgridlines,!0,g),s(b,v,O,N,"b",N._minorgridlines,!0,g),s(b,v,U,F,"a-boundary",F._boundarylines,g),s(b,v,U,N,"b-boundary",N._boundarylines,g);var X=h(_,b,v,z,L,B,F._labels,"a-label"),$=h(_,b,v,z,L,B,N._labels,"b-label");f(_,B,z,L,b,v,X,$),n(z,L,y,b,v)})};function n(l,_,w,A,M){var g,b,v,u,y=w.select("#"+l._clipPathId);y.size()||(y=w.append("clipPath").classed("carpetclip",!0));var m=r.ensureSingle(y,"path","carpetboundary"),R=_.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),P=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(R.axis.labelpadding*N,P.height*.3)),y=Math.max(y,P.width+R.axis.labelpadding)}),u.exit().remove(),m.maxExtent=y,m}function f(l,_,w,A,M,g,b,v){var u,y,m,R,L=r.aggNums(Math.min,null,w.a),z=r.aggNums(Math.max,null,w.a),F=r.aggNums(Math.min,null,w.b),N=r.aggNums(Math.max,null,w.b);u=.5*(L+z),y=F,m=w.ab2xy(u,y,!0),R=w.dxyda_rough(u,y),b.angle===void 0&&r.extendFlat(b,e(w,M,g,m,w.dxydb_rough(u,y))),T(l,_,w,A,m,R,w.aaxis,M,g,b,"a-title"),u=L,y=.5*(F+N),m=w.ab2xy(u,y,!0),R=w.dxydb_rough(u,y),v.angle===void 0&&r.extendFlat(v,e(w,M,g,m,w.dxyda_rough(u,y))),T(l,_,w,A,m,R,w.baxis,M,g,v,"b-title")}var p=i.LINE_SPACING,c=(1-i.MID_SHIFT)/p+1;function T(l,_,w,A,M,g,b,v,u,y,m){var R=[];b.title.text&&R.push(b.title.text);var L=_.selectAll("text."+m).data(R),z=y.maxExtent;L.enter().append("text").classed(m,!0),L.each(function(){var F=e(w,v,u,M,g);["start","both"].indexOf(b.showticklabels)===-1&&(z=0);var N=b.title.font.size;z+=N+b.title.offset;var O=y.angle+(y.flip<0?180:0),P=(O-F.angle+450)%360,U=P>90&&P<270,B=d.select(this);B.text(b.title.text).call(t.convertToTspans,l),U&&(z=(-t.lineCount(B)+c)*p*N-z),B.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,b.title.font)}),L.exit().remove()}}}),P4=Ge({"src/traces/carpet/cheater_basis.js"(Z,q){"use strict";var d=ta().isArrayOrTypedArray;q.exports=function(x,S,E){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,h=d(S)?S.length:S,f=d(x)?x:null,p=d(S)?S:null;f&&(r=(f.length-1)/(f[f.length-1]-f[0])/(s-1)),p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(h-1));var c,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=S.length,o=0;o0&&(V=E.dxydi([],X-1,le,0,ce),Q.push(ve[0]+V[0]/3),re.push(ve[1]+V[1]/3),se=E.dxydi([],X-1,le,1,ce),Q.push(ee[0]-se[0]/3),re.push(ee[1]-se[1]/3)),Q.push(ee[0]),re.push(ee[1]),ve=ee;else for(X=E.a2i(B),G=Math.floor(Math.max(0,Math.min(F-2,X))),Y=X-G,he.length=F,he.crossLength=N,he.xy=function(xe){return E.evalxy([],X,xe)},he.dxy=function(xe,Te){return E.dxydj([],G,xe,Y,Te)},$=0;$0&&(ae=E.dxydj([],G,$-1,Y,0),Q.push(ve[0]+ae[0]/3),re.push(ve[1]+ae[1]/3),j=E.dxydj([],G,$-1,Y,1),Q.push(ee[0]-j[0]/3),re.push(ee[1]-j[1]/3)),Q.push(ee[0]),re.push(ee[1]),ve=ee;return he.axisLetter=e,he.axis=M,he.crossAxis=y,he.value=B,he.constvar=t,he.index=f,he.x=Q,he.y=re,he.smoothing=y.smoothing,he}function U(B){var X,$,le,ce,ve,G=[],Y=[],ee={};if(ee.length=A.length,ee.crossLength=u.length,e==="b")for(le=Math.max(0,Math.min(N-2,B)),ve=Math.min(1,Math.max(0,B-le)),ee.xy=function(V){return E.evalxy([],V,B)},ee.dxy=function(V,se){return E.dxydi([],V,le,se,ve)},X=0;XA.length-1)&&g.push(x(U(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s;fA.length-1)&&!(T<0||T>A.length-1))for(l=A[a],_=A[T],r=0;rA[A.length-1])&&b.push(x(P(c),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&v.push(x(U(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(U(A.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((A[A.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((A[0]-M.tick0)/M.dtick/(1+i))].sort(function(B,X){return B-X}),s=n[0],h=n[1],f=s;f<=h;f++)p=M.tick0+M.dtick*f,g.push(x(P(p),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s-1;fA[A.length-1])&&b.push(x(P(c),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&v.push(x(P(A[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(P(A[A.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),D4=Ge({"src/traces/carpet/calc_labels.js"(Z,q){"use strict";var d=Mo(),x=Do().extendFlat;q.exports=function(E,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[h][t],o[s-t]=S[h][t];for(a.push({x:r,y:o,bicubic:i}),t=h,r=[],o=[];t>=0;t--)r[h-t]=x[t][0],o[h-t]=S[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),F4=Ge({"src/traces/carpet/smooth_fill_2d_array.js"(Z,q){"use strict";var d=ta();q.exports=function(S,E,e){var t,r,o,a=[],i=[],n=S[0].length,s=S.length;function h($,le){var ce=0,ve,G=0;return $>0&&(ve=S[le][$-1])!==void 0&&(G++,ce+=ve),$0&&(ve=S[le-1][$])!==void 0&&(G++,ce+=ve),le0&&r0&&tu);return d.log("Smoother converged to",y,"after",R,"iterations"),S}}}),O4=Ge({"src/traces/carpet/constants.js"(Z,q){"use strict";q.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),B4=Ge({"src/traces/carpet/catmull_rom.js"(Z,q){"use strict";var d=.5;q.exports=function(S,E,e,t){var r=S[0]-E[0],o=S[1]-E[1],a=e[0]-E[0],i=e[1]-E[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),h=(s*s*r-n*n*a)*t,f=(s*s*o-n*n*i)*t,p=s*(n+s)*3,c=n*(n+s)*3;return[[E[0]+(p&&h/p),E[1]+(p&&f/p)],[E[0]-(c&&h/c),E[1]-(c&&f/c)]]}}}),N4=Ge({"src/traces/carpet/compute_control_points.js"(Z,q){"use strict";var d=B4(),x=ta().ensureArray;function S(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}q.exports=function(e,t,r,o,a,i){var n,s,h,f,p,c,T,l,_,w,A=r[0].length,M=r.length,g=a?3*A-2:A,b=i?3*M-2:M;for(e=x(e,b),t=x(t,b),h=0;hp&&gT&&bc||bl},o.setScale=function(){var g=o._x,b=o._y,v=S(o._xctrl,o._yctrl,g,b,h.smoothing,f.smoothing);o._xctrl=v[0],o._yctrl=v[1],o.evalxy=E([o._xctrl,o._yctrl],n,s,h.smoothing,f.smoothing),o.dxydi=e([o._xctrl,o._yctrl],h.smoothing,f.smoothing),o.dxydj=t([o._xctrl,o._yctrl],h.smoothing,f.smoothing)},o.i2a=function(g){var b=Math.max(0,Math.floor(g[0]),n-2),v=g[0]-b;return(1-v)*a[b]+v*a[b+1]},o.j2b=function(g){var b=Math.max(0,Math.floor(g[1]),n-2),v=g[1]-b;return(1-v)*i[b]+v*i[b+1]},o.ij2ab=function(g){return[o.i2a(g[0]),o.j2b(g[1])]},o.a2i=function(g){var b=Math.max(0,Math.min(x(g,a),n-2)),v=a[b],u=a[b+1];return Math.max(0,Math.min(n-1,b+(g-v)/(u-v)))},o.b2j=function(g){var b=Math.max(0,Math.min(x(g,i),s-2)),v=i[b],u=i[b+1];return Math.max(0,Math.min(s-1,b+(g-v)/(u-v)))},o.ab2ij=function(g){return[o.a2i(g[0]),o.b2j(g[1])]},o.i2c=function(g,b){return o.evalxy([],g,b)},o.ab2xy=function(g,b,v){if(!v&&(ga[n-1]|bi[s-1]))return[!1,!1];var u=o.a2i(g),y=o.b2j(b),m=o.evalxy([],u,y);if(v){var R=0,L=0,z=[],F,N,O,P;ga[n-1]?(F=n-2,N=1,R=(g-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),N=u-F),bi[s-1]?(O=s-2,P=1,L=(b-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(y))),P=y-O),R&&(o.dxydi(z,F,O,N,P),m[0]+=z[0]*R,m[1]+=z[1]*R),L&&(o.dxydj(z,F,O,N,P),m[0]+=z[0]*L,m[1]+=z[1]*L)}return m},o.c2p=function(g,b,v){return[b.c2p(g[0]),v.c2p(g[1])]},o.p2x=function(g,b,v){return[b.p2c(g[0]),v.p2c(g[1])]},o.dadi=function(g){var b=Math.max(0,Math.min(a.length-2,g));return a[b+1]-a[b]},o.dbdj=function(g){var b=Math.max(0,Math.min(i.length-2,g));return i[b+1]-i[b]},o.dxyda=function(g,b,v,u){var y=o.dxydi(null,g,b,v,u),m=o.dadi(g,v);return[y[0]/m,y[1]/m]},o.dxydb=function(g,b,v,u){var y=o.dxydj(null,g,b,v,u),m=o.dbdj(b,u);return[y[0]/m,y[1]/m]},o.dxyda_rough=function(g,b,v){var u=_*(v||.1),y=o.ab2xy(g+u,b,!0),m=o.ab2xy(g-u,b,!0);return[(y[0]-m[0])*.5/u,(y[1]-m[1])*.5/u]},o.dxydb_rough=function(g,b,v){var u=w*(v||.1),y=o.ab2xy(g,b+u,!0),m=o.ab2xy(g,b-u,!0);return[(y[0]-m[0])*.5/u,(y[1]-m[1])*.5/u]},o.dpdx=function(g){return g._m},o.dpdy=function(g){return g._m}}}}),G4=Ge({"src/traces/carpet/calc.js"(Z,q){"use strict";var d=Mo(),x=ta().isArray1D,S=P4(),E=I4(),e=R4(),t=D4(),r=z4(),o=A1(),a=F4(),i=T1(),n=q4();q.exports=function(h,f){var p=d.getFromId(h,f.xaxis),c=d.getFromId(h,f.yaxis),T=f.aaxis,l=f.baxis,_=f.x,w=f.y,A=[];_&&x(_)&&A.push("x"),w&&x(w)&&A.push("y"),A.length&&i(f,T,l,"a","b",A);var M=f._a=f._a||f.a,g=f._b=f._b||f.b;_=f._x||f.x,w=f._y||f.y;var b={};if(f._cheater){var v=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?g.length:g;_=S(v,u,f.cheaterslope)}f._x=_=o(_),f._y=w=o(w),a(_,M,g),a(w,M,g),n(f),f.setScale();var y=E(_),m=E(w),R=.5*(y[1]-y[0]),L=.5*(y[1]+y[0]),z=.5*(m[1]-m[0]),F=.5*(m[1]+m[0]),N=1.3;return y=[L-R*N,L+R*N],m=[F-z*N,F+z*N],f._extremes[p._id]=d.findExtremes(p,y,{padded:!0}),f._extremes[c._id]=d.findExtremes(c,m,{padded:!0}),e(f,"a","b"),e(f,"b","a"),t(f,T),t(f,l),b.clipsegments=r(f._xctrl,f._yctrl,T,l),b.x=_,b.y=w,b.a=M,b.b=g,[b]}}}),H4=Ge({"src/traces/carpet/index.js"(Z,q){"use strict";q.exports={attributes:ox(),supplyDefaults:k4(),plot:L4(),calc:G4(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Jc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),W4=Ge({"lib/carpet.js"(Z,q){"use strict";q.exports=H4()}}),$T=Ge({"src/traces/scattercarpet/attributes.js"(Z,q){"use strict";var d=hv(),x=gc(),S=Cl(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Tl(),r=Jl(),o=Do().extendFlat,a=x.marker,i=x.line,n=a.line;q.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},x.mode,{dflt:"markers"}),text:o({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},x.hovertext,{}),line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:o({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:o({symbol:a.symbol,opacity:a.opacity,maxdisplayed:a.maxdisplayed,angle:a.angle,angleref:a.angleref,standoff:a.standoff,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,dash:n.dash,editType:"calc"},r("marker.line")),gradient:a.gradient,editType:"calc"},r("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:x.zorder}}}),X4=Ge({"src/traces/scattercarpet/defaults.js"(Z,q){"use strict";var d=ta(),x=Rv(),S=iu(),E=Nh(),e=Xh(),t=N0(),r=Zh(),o=dv(),a=$T();q.exports=function(n,s,h,f){function p(M,g){return d.coerce(n,s,a,M,g)}p("carpet"),s.xaxis="x",s.yaxis="y";var c=p("a"),T=p("b"),l=Math.min(c.length,T.length);if(!l){s.visible=!1;return}s._length=l,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext");var _=l0?b=M.labelprefix.replace(/ = $/,""):b=M._hovertitle,l.push(b+": "+g.toFixed(3)+M.labelsuffix)}if(!p.hovertemplate){var w=f.hi||p.hoverinfo,A=w.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&_(c.aaxis,f.a),A.indexOf("b")!==-1&&_(c.baxis,f.b),l.push("y: "+a.yLabel),A.indexOf("text")!==-1&&x(f,p,l),a.extraText=l.join("
")}return o}}}),$4=Ge({"src/traces/scattercarpet/event_data.js"(Z,q){"use strict";q.exports=function(x,S,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),Q4=Ge({"src/traces/scattercarpet/index.js"(Z,q){"use strict";q.exports={attributes:$T(),supplyDefaults:X4(),colorbar:Jf(),formatLabels:Z4(),calc:Y4(),plot:K4(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:J4(),selectPoints:q0(),eventData:$4(),moduleType:"trace",name:"scattercarpet",basePlotModule:Jc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),eR=Ge({"lib/scattercarpet.js"(Z,q){"use strict";q.exports=Q4()}}),QT=Ge({"src/traces/contourcarpet/attributes.js"(Z,q){"use strict";var d=W0(),x=og(),S=Jl(),E=Do().extendFlat,e=x.contours;q.exports=E({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),e5=Ge({"src/traces/contourcarpet/defaults.js"(Z,q){"use strict";var d=ta(),x=w1(),S=QT(),E=Sw(),e=F1(),t=O1();q.exports=function(o,a,i,n){function s(c,T){return d.coerce(o,a,S,c,T)}function h(c){return d.coerce2(o,a,S,c)}if(s("carpet"),o.a&&o.b){var f=x(o,a,s,n,"a","b");if(!f){a.visible=!1;return}s("text");var p=s("contours.type")==="constraint";p?E(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,h),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),tR=Ge({"src/traces/contourcarpet/calc.js"(Z,q){"use strict";var d=oh(),x=ta(),S=T1(),E=A1(),e=S1(),t=M1(),r=uw(),o=e5(),a=sx(),i=mw();q.exports=function(h,f){var p=f._carpetTrace=a(h,f);if(!(!p||!p.visible||p.visible==="legendonly")){if(!f.a||!f.b){var c=h.data[p.index],T=h.data[f.index];T.a||(T.a=c.a),T.b||(T.b=c.b),o(T,f,f._defaultColor,h._fullLayout)}var l=n(h,f);return i(f,f._z),l}};function n(s,h){var f=h._carpetTrace,p=f.aaxis,c=f.baxis,T,l,_,w,A,M,g;p._minDtick=0,c._minDtick=0,x.isArray1D(h.z)&&S(h,p,c,"a","b",["z"]),T=h._a=h._a||h.a,w=h._b=h._b||h.b,T=T?p.makeCalcdata(h,"_a"):[],w=w?c.makeCalcdata(h,"_b"):[],l=h.a0||0,_=h.da||1,A=h.b0||0,M=h.db||1,g=h._z=E(h._z||h.z,h.transpose),h._emptypoints=t(g),e(g,h._emptypoints);var b=x.maxRowLength(g),v=h.xtype==="scaled"?"":T,u=r(h,v,l,_,b,p),y=h.ytype==="scaled"?"":w,m=r(h,y,A,M,g.length,c),R={a:u,b:m,z:g};return h.contours.type==="levels"&&h.contours.coloring!=="none"&&d(s,h,{vals:g,containerStr:"",cLetter:"z"}),[R]}}}),rR=Ge({"src/traces/carpet/axis_aligned_line.js"(Z,q){"use strict";var d=ta().isArrayOrTypedArray;q.exports=function(x,S,E,e){var t,r,o,a,i,n,s,h,f,p,c,T,l,_=d(E)?"a":"b",w=_==="a"?x.aaxis:x.baxis,A=w.smoothing,M=_==="a"?x.a2i:x.b2j,g=_==="a"?E:e,b=_==="a"?e:E,v=_==="a"?S.a.length:S.b.length,u=_==="a"?S.b.length:S.a.length,y=Math.floor(_==="a"?x.b2j(b):x.a2i(b)),m=_==="a"?function(le){return x.evalxy([],le,y)}:function(le){return x.evalxy([],y,le)};A&&(o=Math.max(0,Math.min(u-2,y)),a=y-o,r=_==="a"?function(le,ce){return x.dxydi([],le,o,ce,a)}:function(le,ce){return x.dxydj([],o,le,a,ce)});var R=M(g[0]),L=M(g[1]),z=R0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,P=z>0?Math.min:Math.max,U=z>0?Math.max:Math.min,B=N(R+F),X=O(L-F);s=m(R);var $=[[s]];for(t=B;t*z=0;he--)j=U.clipsegments[he],Q=x([],j.x,R.c2p),re=x([],j.y,L.c2p),Q.reverse(),re.reverse(),xe.push(S(Q,re,j.bicubic));var Te="M"+xe.join("L")+"Z";A(F,U.clipsegments,R,L,ce,G),M(O,F,R,L,ae,ee,Y,P,U,G,Te),c(F,le,v,N,$,u,P),E.setClipUrl(F,P._clipPathId,v)})};function p(b,v){var u,y,m,R,L,z,F,N,O;for(u=0;ule&&(y.max=le),y.len=y.max-y.min}function l(b,v,u){var y=b.getPointAtLength(v),m=b.getPointAtLength(u),R=m.x-y.x,L=m.y-y.y,z=Math.sqrt(R*R+L*L);return[R/z,L/z]}function _(b){var v=Math.sqrt(b[0]*b[0]+b[1]*b[1]);return[b[0]/v,b[1]/v]}function w(b,v){var u=Math.abs(b[0]*v[0]+b[1]*v[1]),y=Math.sqrt(1-u*u);return y/u}function A(b,v,u,y,m,R){var L,z,F,N,O=e.ensureSingle(b,"g","contourbg"),P=O.selectAll("path").data(R==="fill"&&!m?[0]:[]);P.enter().append("path"),P.exit().remove();var U=[];for(N=0;N=0&&(B=Q,$=le):Math.abs(U[1]-B[1])=0&&(B=Q,$=le):e.log("endpt to newendpt is not vert. or horz.",U,B,Q)}if($>=0)break;N+=ae(U,B),U=B}if($===v.edgepaths.length){e.log("unclosed perimeter path");break}F=$,P=O.indexOf(F)===-1,P&&(F=O[0],N+=ae(U,B)+"Z",U=null)}for(F=0;Fg):M=z>m,g=z;var F=p(m,R,L,z);F.pos=y,F.yc=(m+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,R],b&&(F.orig_p=s[u]),w&&(F.tx=n.text[u]),A&&(F.htx=n.hovertext[u]),v.push(F)}else v.push({pos:y,empty:!0})}return n._extremes[f._id]=S.findExtremes(f,d.concat(l,T),{padded:!0}),v.length&&(v[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),v}function a(i,n,s){var h=s._minDiff;if(!h){var f=i._fullData,p=[];h=1/0;var c;for(c=0;c"+_.labels[y]+d.hoverLabelText(T,m,l.yhoverformat)):(L=x.extendFlat({},A),L.y0=L.y1=R,L.yLabelVal=m,L.yLabel=_.labels[y]+d.hoverLabelText(T,m,l.yhoverformat),L.name="",w.push(L),v[m]=L)}return w}function n(s,h,f,p){var c=s.cd,T=s.ya,l=c[0].trace,_=c[0].t,w=a(s,h,f,p);if(!w)return[];var A=w.index,M=c[A],g=w.index=M.i,b=M.dir;function v(F){return _.labels[F]+d.hoverLabelText(T,l[F][g],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",y=u.split("+"),m=u==="all",R=m||y.indexOf("y")!==-1,L=m||y.indexOf("text")!==-1,z=R?[v("open"),v("high"),v("low"),v("close")+" "+r[b]]:[];return L&&e(M,l,z),w.extraText=z.join("
"),w.y0=w.y1=T.c2p(M.yc,!0),[w]}q.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),n5=Ge({"src/traces/ohlc/select.js"(Z,q){"use strict";q.exports=function(x,S){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=E[0].t.bPos||0;if(S===!1)for(o=0;oh?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var _=a.c2l(l)-s;return(T(_)?_:0)+c},a.g2c=function(l){return a.l2c(l+s-c)},a.g2p=function(l){return l*p},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?S(a):a}function r(a,i){return i==="degrees"?E(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,h=a.c2d;a.d2c=function(f,p){return t(s(f),p)},a.c2d=function(f,p){return h(r(f,p))}}a.makeCalcdata=function(f,p){var c=f[p],T=f._length,l,_,w=function(v){return a.d2c(v,f.thetaunit)};if(c)for(l=new Array(T),_=0;_0?v:1/0},M=S(w,A),g=d.mod(M+1,w.length);return[w[M],w[g]]}function p(_){return Math.abs(_)>1e-10?_:0}function c(_,w,A){w=w||0,A=A||0;for(var M=_.length,g=new Array(M),b=0;b0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function S(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,a,i){var n=S(r,x([a,o])),s=n[0],h=n[1],f=S(r,x([i,o])),p=f[0],c=f[1];if(o===0)return["M"+s+","+h,"L"+p+","+c].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+h,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+p+","+c].join(" ")}function t(r,o,a,i){var n=E(r,1/(o+1)),s=S(r,x([o,a])),h=s[0],f=s[1],p=S(r,x([o,i])),c=p[0],T=p[1];if(d(a)!==d(i)){var l=S(r,x([o,0])),_=l[0],w=l[1];return["M"+h+","+f,"A"+n+","+n+" 0 0,"+(0et?(rt=re,$e=re*et,ue=(he-$e)/V.h/2,Ue=[j[0],j[1]],fe=[Q[0]+ue,Q[1]-ue]):(rt=he/et,$e=he,ue=(re-rt)/V.w/2,Ue=[j[0]+ue,j[1]-ue],fe=[Q[0],Q[1]]),Y.xLength2=rt,Y.yLength2=$e,Y.xDomain2=Ue,Y.yDomain2=fe;var ie=Y.xOffset2=V.l+V.w*Ue[0],Ee=Y.yOffset2=V.t+V.h*(1-fe[1]),We=Y.radius=rt/Le,Qe=Y.innerRadius=Y.getHole(G)*We,Xe=Y.cx=ie-We*Te[0],Tt=Y.cy=Ee+We*Te[3],St=Y.cxx=Xe-ie,zt=Y.cyy=Tt-Ee,Ut=se.side,br;Ut==="counterclockwise"?(br=Ut,Ut="top"):Ut==="clockwise"&&(br=Ut,Ut="bottom"),Y.radialAxis=Y.mockAxis(ve,G,se,{_id:"x",side:Ut,_trueSide:br,domain:[Qe/V.w,We/V.w]}),Y.angularAxis=Y.mockAxis(ve,G,ae,{side:"right",domain:[0,Math.PI],autorange:!1}),Y.doAutoRange(ve,G),Y.updateAngularAxis(ve,G),Y.updateRadialAxis(ve,G),Y.updateRadialAxisTitle(ve,G),Y.xaxis=Y.mockCartesianAxis(ve,G,{_id:"x",domain:Ue}),Y.yaxis=Y.mockCartesianAxis(ve,G,{_id:"y",domain:fe});var hr=Y.pathSubplot();Y.clipPaths.forTraces.select("path").attr("d",hr).attr("transform",t(St,zt)),ee.frontplot.attr("transform",t(ie,Ee)).call(o.setClipUrl,Y._hasClipOnAxisFalse?null:Y.clipIds.forTraces,Y.gd),ee.bg.attr("d",hr).attr("transform",t(Xe,Tt)).call(r.fill,G.bgcolor)},B.mockAxis=function(ve,G,Y,ee){var V=E.extendFlat({},Y,ee);return s(V,G,ve),V},B.mockCartesianAxis=function(ve,G,Y){var ee=this,V=ee.isSmith,se=Y._id,ae=E.extendFlat({type:"linear"},Y);n(ae,ve);var j={x:[0,2],y:[1,3]};return ae.setRange=function(){var Q=ee.sectorBBox,re=j[se],he=ee.radialAxis._rl,xe=(he[1]-he[0])/(1-ee.getHole(G));ae.range=[Q[re[0]]*xe,Q[re[1]]*xe]},ae.isPtWithinRange=se==="x"&&!V?function(Q){return ee.isPtInside(Q)}:function(){return!0},ae.setRange(),ae.setScale(),ae},B.doAutoRange=function(ve,G){var Y=this,ee=Y.gd,V=Y.radialAxis,se=Y.getRadial(G);h(ee,V);var ae=V.range;if(se.range=ae.slice(),se._input.range=ae.slice(),V._rl=[V.r2l(ae[0],null,"gregorian"),V.r2l(ae[1],null,"gregorian")],V.minallowed!==void 0){var j=V.r2l(V.minallowed);V._rl[0]>V._rl[1]?V._rl[1]=Math.max(V._rl[1],j):V._rl[0]=Math.max(V._rl[0],j)}if(V.maxallowed!==void 0){var Q=V.r2l(V.maxallowed);V._rl[0]90&&he<=270&&(xe.tickangle=180);var Pe=Le?function(We){var Qe=z(Y,m([We.x,0]));return t(Qe[0]-j,Qe[1]-Q)}:function(We){return t(xe.l2p(We.x)+ae,0)},qe=Le?function(We){return L(Y,We.x,-1/0,1/0)}:function(We){return Y.pathArc(xe.r2p(We.x)+ae)},et=X(re);if(Y.radialTickLayout!==et&&(V["radial-axis"].selectAll(".xtick").remove(),Y.radialTickLayout=et),Te){xe.setScale();var rt=0,$e=Le?(xe.tickvals||[]).filter(function(We){return We>=0}).map(function(We){return i.tickText(xe,We,!0,!1)}):i.calcTicks(xe),Ue=Le?$e:i.clipEnds(xe,$e),fe=i.getTickSigns(xe)[2];Le&&((xe.ticks==="top"&&xe.side==="bottom"||xe.ticks==="bottom"&&xe.side==="top")&&(fe=-fe),xe.ticks==="top"&&xe.side==="top"&&(rt=-xe.ticklen),xe.ticks==="bottom"&&xe.side==="bottom"&&(rt=xe.ticklen)),i.drawTicks(ee,xe,{vals:$e,layer:V["radial-axis"],path:i.makeTickPath(xe,0,fe),transFn:Pe,crisp:!1}),i.drawGrid(ee,xe,{vals:Ue,layer:V["radial-grid"],path:qe,transFn:E.noop,crisp:!1}),i.drawLabels(ee,xe,{vals:$e,layer:V["radial-axis"],transFn:Pe,labelFns:i.makeLabelFns(xe,rt)})}var ue=Y.radialAxisAngle=Y.vangles?P(le(O(re.angle),Y.vangles)):re.angle,ie=t(j,Q),Ee=ie+e(-ue);ce(V["radial-axis"],Te&&(re.showticklabels||re.ticks),{transform:Ee}),ce(V["radial-grid"],Te&&re.showgrid,{transform:Le?"":ie}),ce(V["radial-line"].select("line"),Te&&re.showline,{x1:Le?-se:ae,y1:0,x2:se,y2:0,transform:Ee}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},B.updateRadialAxisTitle=function(ve,G,Y){if(!this.isSmith){var ee=this,V=ee.gd,se=ee.radius,ae=ee.cx,j=ee.cy,Q=ee.getRadial(G),re=ee.id+"title",he=0;if(Q.title){var xe=o.bBox(ee.layers["radial-axis"].node()).height,Te=Q.title.font.size,Le=Q.side;he=Le==="top"?Te:Le==="counterclockwise"?-(xe+Te*.4):xe+Te*.8}var Pe=Y!==void 0?Y:ee.radialAxisAngle,qe=O(Pe),et=Math.cos(qe),rt=Math.sin(qe),$e=ae+se/2*et+he*rt,Ue=j-se/2*rt+he*et;ee.layers["radial-axis-title"]=T.draw(V,re,{propContainer:Q,propName:ee.id+".radialaxis.title.text",placeholder:F(V,"Click to enter radial axis title"),attributes:{x:$e,y:Ue,"text-anchor":"middle"},transform:{rotate:-Pe}})}},B.updateAngularAxis=function(ve,G){var Y=this,ee=Y.gd,V=Y.layers,se=Y.radius,ae=Y.innerRadius,j=Y.cx,Q=Y.cy,re=Y.getAngular(G),he=Y.angularAxis,xe=Y.isSmith;xe||(Y.fillViewInitialKey("angularaxis.rotation",re.rotation),he.setGeometry(),he.setScale());var Te=xe?function(Qe){var Xe=z(Y,m([0,Qe.x]));return Math.atan2(Xe[0]-j,Xe[1]-Q)-Math.PI/2}:function(Qe){return he.t2g(Qe.x)};he.type==="linear"&&he.thetaunit==="radians"&&(he.tick0=P(he.tick0),he.dtick=P(he.dtick));var Le=function(Qe){return t(j+se*Math.cos(Qe),Q-se*Math.sin(Qe))},Pe=xe?function(Qe){var Xe=z(Y,m([0,Qe.x]));return t(Xe[0],Xe[1])}:function(Qe){return Le(Te(Qe))},qe=xe?function(Qe){var Xe=z(Y,m([0,Qe.x])),Tt=Math.atan2(Xe[0]-j,Xe[1]-Q)-Math.PI/2;return t(Xe[0],Xe[1])+e(-P(Tt))}:function(Qe){var Xe=Te(Qe);return Le(Xe)+e(-P(Xe))},et=xe?function(Qe){return R(Y,Qe.x,0,1/0)}:function(Qe){var Xe=Te(Qe),Tt=Math.cos(Xe),St=Math.sin(Xe);return"M"+[j+ae*Tt,Q-ae*St]+"L"+[j+se*Tt,Q-se*St]},rt=i.makeLabelFns(he,0),$e=rt.labelStandoff,Ue={};Ue.xFn=function(Qe){var Xe=Te(Qe);return Math.cos(Xe)*$e},Ue.yFn=function(Qe){var Xe=Te(Qe),Tt=Math.sin(Xe)>0?.2:1;return-Math.sin(Xe)*($e+Qe.fontSize*Tt)+Math.abs(Math.cos(Xe))*(Qe.fontSize*b)},Ue.anchorFn=function(Qe){var Xe=Te(Qe),Tt=Math.cos(Xe);return Math.abs(Tt)<.1?"middle":Tt>0?"start":"end"},Ue.heightFn=function(Qe,Xe,Tt){var St=Te(Qe);return-.5*(1+Math.sin(St))*Tt};var fe=X(re);Y.angularTickLayout!==fe&&(V["angular-axis"].selectAll("."+he._id+"tick").remove(),Y.angularTickLayout=fe);var ue=xe?[1/0].concat(he.tickvals||[]).map(function(Qe){return i.tickText(he,Qe,!0,!1)}):i.calcTicks(he);xe&&(ue[0].text="\u221E",ue[0].fontSize*=1.75);var ie;if(G.gridshape==="linear"?(ie=ue.map(Te),E.angleDelta(ie[0],ie[1])<0&&(ie=ie.slice().reverse())):ie=null,Y.vangles=ie,he.type==="category"&&(ue=ue.filter(function(Qe){return E.isAngleInsideSector(Te(Qe),Y.sectorInRad)})),he.visible){var Ee=he.ticks==="inside"?-1:1,We=(he.linewidth||1)/2;i.drawTicks(ee,he,{vals:ue,layer:V["angular-axis"],path:"M"+Ee*We+",0h"+Ee*he.ticklen,transFn:qe,crisp:!1}),i.drawGrid(ee,he,{vals:ue,layer:V["angular-grid"],path:et,transFn:E.noop,crisp:!1}),i.drawLabels(ee,he,{vals:ue,layer:V["angular-axis"],repositionOnUpdate:!0,transFn:Pe,labelFns:Ue})}ce(V["angular-line"].select("path"),re.showline,{d:Y.pathSubplot(),transform:t(j,Q)}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},B.updateFx=function(ve,G){if(!this.gd._context.staticPlot){var Y=!this.isSmith;Y&&(this.updateAngularDrag(ve),this.updateRadialDrag(ve,G,0),this.updateRadialDrag(ve,G,1)),this.updateHoverAndMainDrag(ve)}},B.updateHoverAndMainDrag=function(ve){var G=this,Y=G.isSmith,ee=G.gd,V=G.layers,se=ve._zoomlayer,ae=v.MINZOOM,j=v.OFFEDGE,Q=G.radius,re=G.innerRadius,he=G.cx,xe=G.cy,Te=G.cxx,Le=G.cyy,Pe=G.sectorInRad,qe=G.vangles,et=G.radialAxis,rt=u.clampTiny,$e=u.findXYatLength,Ue=u.findEnclosingVertexAngles,fe=v.cornerHalfWidth,ue=v.cornerLen/2,ie,Ee,We=f.makeDragger(V,"path","maindrag",ve.dragmode===!1?"none":"crosshair");d.select(We).attr("d",G.pathSubplot()).attr("transform",t(he,xe)),We.onmousemove=function(ir){c.hover(ee,ir,G.id),ee._fullLayout._lasthover=We,ee._fullLayout._hoversubplot=G.id},We.onmouseout=function(ir){ee._dragging||p.unhover(ee,ir)};var Qe={element:We,gd:ee,subplot:G.id,plotinfo:{id:G.id,xaxis:G.xaxis,yaxis:G.yaxis},xaxes:[G.xaxis],yaxes:[G.yaxis]},Xe,Tt,St,zt,Ut,br,hr,Or,wr;function Er(ir,ar){return Math.sqrt(ir*ir+ar*ar)}function mt(ir,ar){return Er(ir-Te,ar-Le)}function ze(ir,ar){return Math.atan2(Le-ar,ir-Te)}function Ze(ir,ar){return[ir*Math.cos(ar),ir*Math.sin(-ar)]}function we(ir,ar){if(ir===0)return G.pathSector(2*fe);var Mr=ue/ir,ma=ar-Mr,Ca=ar+Mr,Aa=Math.max(0,Math.min(ir,Q)),Da=Aa-fe,Ba=Aa+fe;return"M"+Ze(Da,ma)+"A"+[Da,Da]+" 0,0,0 "+Ze(Da,Ca)+"L"+Ze(Ba,Ca)+"A"+[Ba,Ba]+" 0,0,1 "+Ze(Ba,ma)+"Z"}function ke(ir,ar,Mr){if(ir===0)return G.pathSector(2*fe);var ma=Ze(ir,ar),Ca=Ze(ir,Mr),Aa=rt((ma[0]+Ca[0])/2),Da=rt((ma[1]+Ca[1])/2),Ba,ba;if(Aa&&Da){var rn=Da/Aa,vn=-1/rn,Wt=$e(fe,rn,Aa,Da);Ba=$e(ue,vn,Wt[0][0],Wt[0][1]),ba=$e(ue,vn,Wt[1][0],Wt[1][1])}else{var Lt,Ht;Da?(Lt=ue,Ht=fe):(Lt=fe,Ht=ue),Ba=[[Aa-Lt,Da-Ht],[Aa+Lt,Da-Ht]],ba=[[Aa-Lt,Da+Ht],[Aa+Lt,Da+Ht]]}return"M"+Ba.join("L")+"L"+ba.reverse().join("L")+"Z"}function Be(){St=null,zt=null,Ut=G.pathSubplot(),br=!1;var ir=ee._fullLayout[G.id];hr=x(ir.bgcolor).getLuminance(),Or=f.makeZoombox(se,hr,he,xe,Ut),Or.attr("fill-rule","evenodd"),wr=f.makeCorners(se,he,xe),w(ee)}function He(ir,ar){return ar=Math.max(Math.min(ar,Q),re),irae?(ir-1&&ir===1&&_(ar,ee,[G.xaxis],[G.yaxis],G.id,Qe),Mr.indexOf("event")>-1&&c.click(ee,ar,G.id)}Qe.prepFn=function(ir,ar,Mr){var ma=ee._fullLayout.dragmode,Ca=We.getBoundingClientRect();ee._fullLayout._calcInverseTransform(ee);var Aa=ee._fullLayout._invTransform;ie=ee._fullLayout._invScaleX,Ee=ee._fullLayout._invScaleY;var Da=E.apply3DTransform(Aa)(ar-Ca.left,Mr-Ca.top);if(Xe=Da[0],Tt=Da[1],qe){var Ba=u.findPolygonOffset(Q,Pe[0],Pe[1],qe);Xe+=Te+Ba[0],Tt+=Le+Ba[1]}switch(ma){case"zoom":Qe.clickFn=sr,Y||(qe?Qe.moveFn=Mt:Qe.moveFn=ot,Qe.doneFn=Et,Be(ir,ar,Mr));break;case"select":case"lasso":l(ir,ar,Mr,Qe,ma);break}},p.init(Qe)},B.updateRadialDrag=function(ve,G,Y){var ee=this,V=ee.gd,se=ee.layers,ae=ee.radius,j=ee.innerRadius,Q=ee.cx,re=ee.cy,he=ee.radialAxis,xe=v.radialDragBoxSize,Te=xe/2;if(!he.visible)return;var Le=O(ee.radialAxisAngle),Pe=he._rl,qe=Pe[0],et=Pe[1],rt=Pe[Y],$e=.75*(Pe[1]-Pe[0])/(1-ee.getHole(G))/ae,Ue,fe,ue;Y?(Ue=Q+(ae+Te)*Math.cos(Le),fe=re-(ae+Te)*Math.sin(Le),ue="radialdrag"):(Ue=Q+(j-Te)*Math.cos(Le),fe=re-(j-Te)*Math.sin(Le),ue="radialdrag-inner");var ie=f.makeRectDragger(se,ue,"crosshair",-Te,-Te,xe,xe),Ee={element:ie,gd:V};ve.dragmode===!1&&(Ee.dragmode=!1),ce(d.select(ie),he.visible&&j0!=(Y?Xe>qe:Xe=90||V>90&&se>=450?Le=1:j<=0&&re<=0?Le=0:Le=Math.max(j,re),V<=180&&se>=180||V>180&&se>=540?he=-1:ae>=0&&Q>=0?he=0:he=Math.min(ae,Q),V<=270&&se>=270||V>270&&se>=630?xe=-1:j>=0&&re>=0?xe=0:xe=Math.min(j,re),se>=360?Te=1:ae<=0&&Q<=0?Te=0:Te=Math.max(ae,Q),[he,xe,Te,Le]}function le(ve,G){var Y=function(V){return E.angleDist(ve,V)},ee=E.findIndexOfMin(G,Y);return G[ee]}function ce(ve,G,Y){return G?(ve.attr("display",null),ve.attr(Y)):ve&&ve.attr("display","none"),ve}}}),u5=Ge({"src/plots/polar/layout_attributes.js"(Z,q){"use strict";var d=sf(),x=Nf(),S=ju().attributes,E=ta().extendFlat,e=Ru().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,minorloglabels:x.minorloglabels,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var a={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(a,t,r),q.exports={domain:S({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),pR=Ge({"src/plots/polar/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Bi(),S=ll(),E=Bd(),e=Bf().getSubplotData,t=Mp(),r=D0(),o=Pd(),a=Id(),i=s1(),n=$m(),s=vb(),h=F0(),f=u5(),p=o5(),c=ux(),T=c.axisNames;function l(w,A,M,g){var b=M("bgcolor");g.bgColor=x.combine(b,g.paper_bgcolor);var v=M("sector");M("hole");var u=e(g.fullData,c.name,g.id),y=g.layoutOut,m;function R(xe,Te){return M(m+"."+xe,Te)}for(var L=0;L")}}q.exports={hoverPoints:x,makeHoverPointText:S}}}),yR=Ge({"src/traces/scatterpolar/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:fx(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Wg(),supplyDefaults:hx().supplyDefaults,colorbar:Jf(),formatLabels:vx(),calc:mR(),plot:gR(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:dx().hoverPoints,selectPoints:q0(),meta:{}}}}),_R=Ge({"lib/scatterpolar.js"(Z,q){"use strict";q.exports=yR()}}),c5=Ge({"src/traces/scatterpolargl/attributes.js"(Z,q){"use strict";var d=Wg(),{cliponaxis:x,hoveron:S}=d,E=ic(d,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:a,fillcolor:i,marker:n,textfont:s,textposition:h}=Og();q.exports=kl(Vs({},E),{connectgaps:e,fill:a,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:n,textfont:s,textposition:h})}}),xR=Ge({"src/traces/scatterpolargl/defaults.js"(Z,q){"use strict";var d=ta(),x=iu(),S=hx().handleRThetaDefaults,E=Nh(),e=Xh(),t=Zh(),r=dv(),o=Rv().PTS_LINESONLY,a=c5();q.exports=function(n,s,h,f){function p(T,l){return d.coerce(n,s,a,T,l)}var c=S(n,s,f,p);if(!c){s.visible=!1;return}p("thetaunit"),p("mode",c=r&&(g.marker.cluster=_.tree),g.marker&&(g.markerSel.positions=g.markerUnsel.positions=g.marker.positions=y),g.line&&y.length>1&&t.extendFlat(g.line,e.linePositions(i,l,y)),g.text&&(t.extendFlat(g.text,{positions:y},e.textPosition(i,l,g.text,g.marker)),t.extendFlat(g.textSel,{positions:y},e.textPosition(i,l,g.text,g.markerSel)),t.extendFlat(g.textUnsel,{positions:y},e.textPosition(i,l,g.text,g.markerUnsel))),g.fill&&!p.fill2d&&(p.fill2d=!0),g.marker&&!p.scatter2d&&(p.scatter2d=!0),g.line&&!p.line2d&&(p.line2d=!0),g.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(g.line),p.fillOptions.push(g.fill),p.markerOptions.push(g.marker),p.markerSelectedOptions.push(g.markerSel),p.markerUnselectedOptions.push(g.markerUnsel),p.textOptions.push(g.text),p.textSelectedOptions.push(g.textSel),p.textUnselectedOptions.push(g.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),_.x=m,_.y=R,_.rawx=m,_.rawy=R,_.r=A,_.theta=M,_.positions=y,_._scene=p,_.index=p.count,p.count++}}),S(i,n,s)}},q.exports.reglPrecompiled=o}}),MR=Ge({"src/traces/scatterpolargl/index.js"(Z,q){"use strict";var d=AR();d.plot=SR(),q.exports=d}}),ER=Ge({"lib/scatterpolargl.js"(Z,q){"use strict";q.exports=MR()}}),f5=Ge({"src/traces/barpolar/attributes.js"(Z,q){"use strict";var{hovertemplateAttrs:d,templatefallbackAttrs:x}=Tl(),S=Do().extendFlat,E=Wg(),e=zv();q.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:d(),hovertemplatefallback:x(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),h5=Ge({"src/traces/barpolar/layout_attributes.js"(Z,q){"use strict";q.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),kR=Ge({"src/traces/barpolar/defaults.js"(Z,q){"use strict";var d=ta(),x=hx().handleRThetaDefaults,S=m1(),E=f5();q.exports=function(t,r,o,a){function i(s,h){return d.coerce(t,r,E,s,h)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),S(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),CR=Ge({"src/traces/barpolar/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=h5();q.exports=function(S,E,e){var t={},r;function o(n,s){return d.coerce(S[r]||{},E[r],x,n,s)}for(var a=0;a0?(f=s,p=h):(f=h,p=s);var c=e.findEnclosingVertexAngles(f,r.vangles)[0],T=e.findEnclosingVertexAngles(p,r.vangles)[1],l=[c,(f+p)/2,T];return e.pathPolygonAnnulus(i,n,f,p,l,o,a)}:function(i,n,s,h){return S.pathAnnulus(i,n,s,h,o,a)}}}}),PR=Ge({"src/traces/barpolar/hover.js"(Z,q){"use strict";var d=mc(),x=ta(),S=G0().getTraceColor,E=x.fillText,e=dx().makeHoverPointText,t=cx().isPtInsidePolygon;q.exports=function(o,a,i){var n=o.cd,s=n[0].trace,h=o.subplot,f=h.radialAxis,p=h.angularAxis,c=h.vangles,T=c?t:x.isPtInsideSector,l=o.maxHoverDistance,_=p._period||2*Math.PI,w=Math.abs(f.g2p(Math.sqrt(a*a+i*i))),A=Math.atan2(i,a);f.range[0]>f.range[1]&&(A+=Math.PI);var M=function(u){return T(w,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],c)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/_)-1+(u.rp1-w)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,M,o),o.index!==!1){var g=o.index,b=n[g];o.x0=o.x1=b.ct[0],o.y0=o.y1=b.ct[1];var v=x.extendFlat({},b,{r:b.s,theta:b.p});return E(b,s,o),e(v,s,h,o),o.hovertemplate=s.hovertemplate,o.color=S(s,b),o.xLabelVal=o.yLabelVal=void 0,b.s<0&&(o.idealAlign="left"),[o]}}}}),IR=Ge({"src/traces/barpolar/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"barpolar",basePlotModule:fx(),categories:["polar","bar","showLegend"],attributes:f5(),layoutAttributes:h5(),supplyDefaults:kR(),supplyLayoutDefaults:CR(),calc:v5().calc,crossTraceCalc:v5().crossTraceCalc,plot:LR(),colorbar:Jf(),formatLabels:vx(),style:$h().style,styleOnSelect:$h().styleOnSelect,hoverPoints:PR(),selectPoints:H0(),meta:{}}}}),RR=Ge({"lib/barpolar.js"(Z,q){"use strict";q.exports=IR()}}),d5=Ge({"src/plots/smith/constants.js"(Z,q){"use strict";q.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),p5=Ge({"src/plots/smith/layout_attributes.js"(Z,q){"use strict";var d=sf(),x=Nf(),S=ju().attributes,E=ta().extendFlat,e=Ru().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);q.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),DR=Ge({"src/plots/smith/layout_defaults.js"(Z,q){"use strict";var d=ta(),x=Bi(),S=ll(),E=Bd(),e=Bf().getSubplotData,t=Id(),r=Pd(),o=$m(),a=Iv(),i=p5(),n=d5(),s=n.axisNames,h=p(function(c){return d.isTypedArray(c)&&(c=Array.from(c)),c.slice().reverse().map(function(T){return-T}).concat([0]).concat(c)},String);function f(c,T,l,_){var w=l("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var A=e(_.fullData,n.name,_.id),M=_.layoutOut,g;function b(B,X){return l(g+"."+B,X)}for(var v=0;v")}}q.exports={hoverPoints:x,makeHoverPointText:S}}}),jR=Ge({"src/traces/scattersmith/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scattersmith",basePlotModule:zR(),categories:["smith","symbols","showLegend","scatter-like"],attributes:m5(),supplyDefaults:FR(),colorbar:Jf(),formatLabels:OR(),calc:BR(),plot:NR(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:UR().hoverPoints,selectPoints:q0(),meta:{}}}}),VR=Ge({"lib/scattersmith.js"(Z,q){"use strict";q.exports=jR()}}),uh=Ge({"node_modules/world-calendars/dist/main.js"(Z,q){var d=cf();function x(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var h=i%10;n=(h===0?"":o[h]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function S(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(S.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new S(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+E(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var h=o.year()+(i==="y"?a:0),f=o.monthOfYear()+(i==="m"?a:0),s=o.day(),p=function(l){for(;f_-1+l.minMonth;)h++,f-=_,_=l.monthsInYear(h)};i==="y"?(o.month()!==this.fromMonthOfYear(h,f)&&(f=this.newDate(h,o.month(),this.minDay).monthOfYear()),f=Math.min(f,this.monthsInYear(h)),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,f)))):i==="m"&&(p(this),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,f))));var c=[h,this.fromMonthOfYear(h,f),s];return this._validateLevel--,c}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],h=i<0?-1:1;a=this._add(o,i*s[0]+h*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),h=i==="d"?a:o.day();return(i==="y"||i==="m")&&(h=Math.min(h,this.daysInMonth(n,s))),o.date(n,s,h)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(c>2.5?4716:4715);return T<=0&&T--,this.newDate(T,c,p)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=q.exports=new x;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),qR=Ge({"node_modules/world-calendars/dist/plus.js"(){var Z=cf(),q=uh();Z(q.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),q.local=q.regionalOptions[""],Z(q.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Z(q.baseCalendar.prototype,{UNIX_EPOCH:q.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:q.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(d,x,S){if(typeof d!="string"&&(S=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw q.local.invalidFormat||q.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,S=S||{};for(var E=S.dayNamesShort||this.local.dayNamesShort,e=S.dayNames||this.local.dayNames,t=S.monthNumbers||this.local.monthNumbers,r=S.monthNamesShort||this.local.monthNamesShort,o=S.monthNames||this.local.monthNames,a=S.calculateWeek||this.local.calculateWeek,i=function(A,M){for(var g=1;w+g1},n=function(A,M,g,b){var v=""+M;if(i(A,b))for(;v.length1},_=function(R,L){var z=l(R,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],N=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(v).match(N);if(!O)throw(q.local.missingNumberAt||q.regionalOptions[""].missingNumberAt).replace(/\{0\}/,v);return v+=O[0].length,parseInt(O[0],10)},w=this,A=function(){if(typeof o=="function"){l("m");var R=o.call(w,x.substring(v));return v+=R.length,R}return _("m")},M=function(R,L,z,F){for(var N=l(R,F)?z:L,O=0;O-1){h=1,f=p;for(var m=this.daysInMonth(s,h);f>m;m=this.daysInMonth(s,h))h++,f-=m}return n>-1?this.fromJD(n):this.newDate(s,h,f)},determineDate:function(d,x,S,E,e){S&&typeof S!="object"&&(e=E,E=S,S=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&S?S.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),GR=Ge({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Z=uh(),q=cf(),d=Z.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var h=n.match(E);return h?h[0]:""}var f=this._validateYear(n),p=n.month(),c=""+this.toChineseMonth(f,p);return s&&c.length<2&&(c="0"+c),this.isIntercalaryMonth(f,p)&&(c+="i"),c},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var h=this._validateYear(n),f=n.month(),p=this.toChineseMonth(h,f),c=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][p-1];return this.isIntercalaryMonth(h,f)&&(c="\u95F0"+c),c},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var h=this._validateYear(n),f=n.month(),p=this.toChineseMonth(h,f),c=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][p-1];return this.isIntercalaryMonth(h,f)&&(c="\u95F0"+c),c},parseMonth:function(n,s){n=this._validateYear(n);var h=parseInt(s),f;if(isNaN(h))s[0]==="\u95F0"&&(f=!0,s=s.substring(1)),s[s.length-1]==="\u6708"&&(s=s.substring(0,s.length-1)),h=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(s);else{var p=s[s.length-1];f=p==="i"||p==="I"}var c=this.toMonthIndex(n,h,f);return c},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,h){var f=this.intercalaryMonth(n),p=h&&s!==f;if(p||s<1||s>12)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var c;return f?!h&&s<=f?c=s-1:c=s:c=s-1,c},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var h=this.intercalaryMonth(n),f=h?12:11;if(s<0||s>f)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return h?s>13;return h},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var h=this.intercalaryMonth(n);return!!h&&h===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,h){var f=this._validateYear(n,Z.local.invalidyear),p=o[f-o[0]],c=p>>9&4095,T=p>>5&15,l=p&31,_;_=d.newDate(c,T,l),_.add(4-(_.dayOfWeek()||7),"d");var w=this.toJD(n,s,h)-_.toJD();return 1+Math.floor(w/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var h=r[n-r[0]],f=h>>13,p=f?12:11;if(s>p)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var c=h&1<<12-s?30:29;return c},weekDay:function(n,s,h){return(this.dayOfWeek(n,s,h)||7)<6},toJD:function(n,s,h){var f=this._validate(n,c,h,Z.local.invalidDate);n=this._validateYear(f.year()),s=f.month(),h=f.day();var p=this.isIntercalaryMonth(n,s),c=this.toChineseMonth(n,s),T=i(n,c,h,p);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),h=a(s.year(),s.month(),s.day()),f=this.toMonthIndex(h.year,h.month,h.isIntercalary);return this.newDate(h.year,f,h.day)},fromString:function(n){var s=n.match(S),h=this._validateYear(+s[1]),f=+s[2],p=!!s[3],c=this.toMonthIndex(h,f,p),T=+s[4];return this.newDate(h,c,T)},add:function(n,s,h){var f=n.year(),p=n.month(),c=this.isIntercalaryMonth(f,p),T=this.toChineseMonth(f,p),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,h);if(h==="y"){var _=l.year(),w=l.month(),A=this.isIntercalaryMonth(_,T),M=c&&A?this.toMonthIndex(_,T,!0):this.toMonthIndex(_,T,!1);M!==w&&l.month(M)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Z.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,h,f){var p,c;if(typeof n=="object")p=n,c=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var _=typeof h=="number"&&h>=1&&h<=31;if(!_)throw new Error("Solar day outside range 1 - 31");p={year:n,month:s,day:h},c=f||{}}var w=o[p.year-o[0]],A=p.year<<9|p.month<<5|p.day;c.year=A>=w?p.year:p.year-1,w=o[c.year-o[0]];var M=w>>9&4095,g=w>>5&15,b=w&31,v,u=new Date(M,g-1,b),y=new Date(p.year,p.month-1,p.day);v=Math.round((y-u)/(24*3600*1e3));var m=r[c.year-r[0]],R;for(R=0;R<13;R++){var L=m&1<<12-R?30:29;if(v>13;return!z||R=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var _=typeof s=="number"&&s>=1&&s<=12;if(!_)throw new Error("Lunar month outside range 1 - 12");var w=typeof h=="number"&&h>=1&&h<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var A;typeof f=="object"?(A=!1,c=f):(A=!!f,c=p||{}),T={year:n,month:s,day:h,isIntercalary:A}}var M;M=T.day-1;var g=r[T.year-r[0]],b=g>>13,v;b&&(T.month>b||T.isIntercalary)?v=T.month:v=T.month-1;for(var u=0;u>9&4095,L=m>>5&15,z=m&31,F=new Date(R,L-1,z+M);return c.year=F.getFullYear(),c.month=1+F.getMonth(),c.day=F.getDate(),c}}}),HR=Ge({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Z=uh(),q=cf();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),Z.calendars.coptic=d}}),WR=Ge({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Z=uh(),q=cf();function d(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(S){return this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear),400},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,E,e){var t=this.dayOfWeek(S,E,e);return t>=2&&t<=6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);return S=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(S/400)+1;S-=(E-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Z.calendars.discworld=d}}),XR=Ge({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Z=uh(),q=cf();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),Z.calendars.ethiopian=d}}),ZR=Ge({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Z=uh(),q=cf();function d(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(S){return S=S<0?S+1:S,x(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear);return S=E.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,E){return S.year&&(E=S.month(),S=S.year()),this._validate(S,E,this.minDay,Z.local.invalidMonth),E===12&&this.leapYear(S)||E===8&&x(this.daysInYear(S),10)===5?30:E===9&&x(this.daysInYear(S),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var a=7;a<=this.monthsInYear(S);a++)o+=this.daysInMonth(S,a);for(var a=1;a=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Sthis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=S-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(S,E){return S-E*Math.floor(S/E)}Z.calendars.hebrew=d}}),YR=Ge({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Z=uh(),q=cf();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(x){var S=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return this.dayOfWeek(x,S,E)!==5},toJD:function(x,S,E){var e=this._validate(x,S,E,Z.local.invalidDate);return x=e.year(),S=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(S-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var S=Math.floor((30*(x-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var E=Math.min(12,Math.ceil((x-29-this.toJD(S,1,1))/29.5)+1),e=x-this.toJD(S,E,1)+1;return this.newDate(S,E,e)}}),Z.calendars.islamic=d}}),KR=Ge({"node_modules/world-calendars/dist/calendars/julian.js"(){var Z=uh(),q=cf();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),E=S.year()<0?S.year()+1:S.year();return E%4===0},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Z.local.invalidDate);return x=e.year(),S=e.month(),E=e.day(),x<0&&x++,S<=2&&(x--,S+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(S+1))+E-1524.5},fromJD:function(x){var S=Math.floor(x+.5),E=S+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Z.calendars.julian=d}}),JR=Ge({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Z=uh(),q=cf();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Z.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Z.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Z.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+340,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[S(E+20,20),S(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Z.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function S(E,e){return x(E-1,e)+1}Z.calendars.mayan=d}}),$R=Ge({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Z=uh(),q=cf();function d(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar;var x=Z.instance("gregorian");q(d.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(E+1,1,1);)E++;for(var e=S-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Z.calendars.nanakshahi=d}}),QR=Ge({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Z=uh(),q=cf();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var S=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);if(x=S.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,S){return x.year&&(S=x.month(),x=x.year()),this._validate(x,S,this.minDay,Z.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[x][S]},weekDay:function(x,S,E){return this.dayOfWeek(x,S,E)!==6},toJD:function(x,S,E){var e=this._validate(x,S,E,Z.local.invalidDate);x=e.year(),S=e.month(),E=e.day();var t=Z.instance(),r=0,o=S,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(S!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return S===9?(r+=E-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var S=Z.instance(),E=S.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var E=x-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=S)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Z.calendars.nepali=d}}),eD=Ge({"node_modules/world-calendars/dist/calendars/persian.js"(){var Z=uh(),q=cf();function d(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function x(S){var E=S-475;S<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),a=r-Math.floor(r);return o>a}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear);return x(E.year())},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=0;if(S>0)for(var o=1;o0?S-1:S)*365+r+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var E=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,S>this.toJD(e,12,x(e)?30:29)&&(e++,e===0&&e++);var t=S-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=S-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),Z.calendars.persian=d,Z.calendars.jalali=d}}),tD=Ge({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Z=uh(),q=cf(),d=Z.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(S){var E=d.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)},_g2tYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)}}),Z.calendars.taiwan=x}}),rD=Ge({"node_modules/world-calendars/dist/calendars/thai.js"(){var Z=uh(),q=cf(),d=Z.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(S){var E=d.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)},_g2tYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)}}),Z.calendars.thai=x}}),aD=Ge({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Z=uh(),q=cf();function d(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Z.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(S,e);return E},daysInMonth:function(S,E){for(var e=this._validate(S,E,this.minDay,Z.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,Z.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var E=S-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=E-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(S,E,e){var t=Z.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,E,e,t){var r=Z.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Z.calendars.ummalqura=d;var x=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),nD=Ge({"src/components/calendars/calendars.js"(Z,q){"use strict";q.exports=uh(),qR(),GR(),HR(),WR(),XR(),ZR(),YR(),KR(),JR(),$R(),QR(),eD(),tD(),rD(),aD()}}),iD=Ge({"src/components/calendars/index.js"(Z,q){"use strict";var d=nD(),x=ta(),S=As(),E=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(g,b,v,u){var y={};return y[v]=t,x.coerce(g,b,y,v,u)},o=function(g,b,v,u){for(var y=0;y{this.chartData=this.parseData(Vs)}),this.streamUrl&&this.setupStream(),Alpine.effect(()=>{this.$nextTick(()=>{this.updateChart(this.chartData)})}),window.addEventListener("resize",()=>lv.Plots.resize(document.querySelector(this.chartId))),Object.keys(this.darkThemeLayout).length>0||Object.keys(this.lightThemeLayout).length>0){let Vs=document.querySelector(this.chartId),kl=hs=>{let Ge=hs?this.darkThemeLayout:this.lightThemeLayout;Object.keys(Ge).length>0&&lv.relayout(Vs,Ge)};new MutationObserver(()=>{kl(document.documentElement.classList.contains("dark"))}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),kl(document.documentElement.classList.contains("dark"))}if(Object.keys(this.plotlyEventListeners).length>0){let Vs=document.querySelector(this.chartId);for(let[kl,ic]of Object.entries(this.plotlyEventListeners))Vs.on(kl,hs=>{let Ge=this.serializePlotlyEvent(kl,hs);this.$wire[ic](Ge),this.$dispatch("plotly:"+kl,Ge)})}},setupStream(){let Vs=document.querySelector(this.chartId),kl=0;this._streamTid=setInterval(()=>{(Vs&&Vs._fullLayout||++kl>100)&&(clearInterval(this._streamTid),Vs&&Vs._fullLayout&&this.startStream(this.streamUrl,this.streamParams))},20)},destroy(){this._evtSource&&this._evtSource.close(),this._streamTid&&clearInterval(this._streamTid)},renderChart(){Object.keys(this.chartLayout).length===0&&Object.keys(this.chartConfig).length===0?lv.react(document.querySelector(this.chartId),this.chartData):lv.react(document.querySelector(this.chartId),this.chartData,this.chartLayout,this.chartConfig)},updateChart(Vs){lv.react(document.querySelector(this.chartId),Vs,this.chartLayout,this.chartConfig)},resetStream(){let Vs=document.querySelector(this.chartId),kl=Object.assign({},Vs.layout||{},this.streamingLayoutPatch);lv.react(Vs,this.chartData,kl)},startStream(Vs,kl){this._evtSource&&(this._evtSource.close(),this._evtSource=null);let ic=document.querySelector(this.chartId);if(!ic||!window.Plotly)return;this.resetStream(),this._showStreamLoader(ic);let hs=0,Ge=0,Jv=this.onStreamMessageScript?new Function("d","el",this.onStreamMessageScript):null,Lv=this.onStreamDoneScript?new Function("d","el",this.onStreamDoneScript):null;this._evtSource=new EventSource(Vs+"?"+new URLSearchParams(kl));let Oh=this._evtSource;Oh.onmessage=Pv=>{if(this._evtSource!==Oh)return;let Wh=JSON.parse(Pv.data);if(Wh.init){hs=Wh.total??0,this._updateStreamProgress(ic,0,hs);return}if(Wh.done){this._evtSource.close(),this._evtSource=null,Lv&&Lv(Wh,ic),this._hideStreamLoader(ic);return}if(Ge++,this._updateStreamProgress(ic,Ge,hs),Jv)Jv(Wh,ic);else{let Uy=new Set(["init","done","total"]),Oi={};for(let wp of Object.keys(Wh))Uy.has(wp)||(Oi[wp]=[[Wh[wp]]]);Object.keys(Oi).length&&lv.extendTraces(ic,Oi,[0])}},Oh.onerror=()=>{this._evtSource===Oh&&(this._evtSource.close(),this._evtSource=null,this._hideStreamLoader(ic))}},_showStreamLoader(Vs){if(!Vs||Vs.querySelector("[data-stream-loader]"))return;let kl=document.createElement("div");kl.setAttribute("data-stream-loader",""),kl.style.cssText="position:absolute;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.75rem",kl.innerHTML=` + Loading data +
+
+
+ + `,Vs.appendChild(kl)},_updateStreamProgress(Vs,kl,ic){let hs=Vs?.querySelector("[data-stream-loader]");if(!hs)return;let Ge=ic>0?kl/ic*100:0;hs.querySelector("[data-progress-bar]").style.width=Ge+"%",hs.querySelector("[data-progress-text]").textContent=`${kl} / ${ic}`},_hideStreamLoader(Vs){Vs?.querySelector("[data-stream-loader]")?.remove()},serializePlotlyEvent(Vs,kl){let ic=new Set(["data","fullData","xaxis","yaxis","zaxis","node","element","_input"]),hs=Ge=>{let Jv={traceName:Ge.data?.name??null};for(let Lv of Object.keys(Ge)){if(ic.has(Lv))continue;let Oh=Ge[Lv];typeof Oh!="function"&&(typeof Oh=="object"&&Oh!==null&&Oh instanceof Node||(Jv[Lv]=Oh??null))}return Jv};return["plotly_click","plotly_hover","plotly_unhover","plotly_doubleclick"].includes(Vs)?{points:(kl?.points??[]).map(hs)}:["plotly_selected","plotly_deselect"].includes(Vs)?{points:(kl?.points??[]).map(hs),range:kl?.range??null,lassoPoints:kl?.lassoPoints??null}:["plotly_legendclick","plotly_legenddoubleclick"].includes(Vs)?{curveNumber:kl?.curveNumber??null,traceName:kl?.data?.name??null}:["plotly_relayout","plotly_restyle","plotly_autosize"].includes(Vs)?kl??{}:{}},tryParse(Vs,kl){if(typeof Vs!="string"||!(Vs.startsWith("{")||Vs.startsWith("[")))return Vs;try{return JSON.parse(Vs)}catch{return console.log('unable to parse JSON for key: "'+kl+'" -- already type: '+typeof Vs),Vs}},parseData(Vs){return Vs.map(kl=>{let ic={...kl};for(let hs of Object.keys(kl))Array.isArray(ic[hs])?ic[hs]=ic[hs].map(Ge=>this.tryParse(Ge,hs)):ic[hs]=this.tryParse(ic[hs],hs);return ic})}}}export{t7 as default}; /*! Bundled license information: plotly.js-dist/plotly.js: - (*! - * pad-left - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT license. - *) - (*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - *) - (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) (*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT *) + (*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + *) + (*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + *) (*! Bundled license information: native-promise-only/lib/npo.src.js: diff --git a/resources/js/index.js b/resources/js/index.js index 5e1db86..c77c68e 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -4,12 +4,30 @@ export default function plotly({ chartLayout, chartConfig, chartId, + streamingLayoutPatch = {}, + darkThemeLayout = {}, + lightThemeLayout = {}, + plotlyEventListeners = {}, + streamUrl = null, + streamParams = {}, + onStreamMessageScript = null, + onStreamDoneScript = null, }) { return { chartData, chartLayout, chartConfig, chartId, + streamingLayoutPatch, + darkThemeLayout, + lightThemeLayout, + plotlyEventListeners, + streamUrl, + streamParams, + onStreamMessageScript, + onStreamDoneScript, + _evtSource: null, + _streamTid: null, init() { this.chartData = this.parseData(chartData); @@ -18,22 +36,74 @@ export default function plotly({ // Re-render if Livewire updates the data this.$wire.on('updateChartData', ({chartData}) => { this.chartData = this.parseData(chartData); - this.updateChart(this.chartData); }) + // HasStreamingSupport: auto-start SSE stream once chart is ready + if (this.streamUrl) { + this.setupStream(); + } + Alpine.effect(() => { this.$nextTick(() => { this.updateChart(this.chartData); }) }) - // Resize chart on window resize window.addEventListener('resize', () => Plotly.Plots.resize( document.querySelector(this.chartId) )); + + // HasChartTheme: watch the dark class and relayout accordingly + if (Object.keys(this.darkThemeLayout).length > 0 || Object.keys(this.lightThemeLayout).length > 0) { + const _themeEl = document.querySelector(this.chartId); + const applyTheme = (isDark) => { + const layout = isDark ? this.darkThemeLayout : this.lightThemeLayout; + if (Object.keys(layout).length > 0) { + Plotly.relayout(_themeEl, layout); + } + }; + const _observer = new MutationObserver(() => { + applyTheme(document.documentElement.classList.contains('dark')); + }); + _observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] }); + applyTheme(document.documentElement.classList.contains('dark')); + } + + // Plotly event → Livewire bridge + if (Object.keys(this.plotlyEventListeners).length > 0) { + const _el = document.querySelector(this.chartId); + for (const [plotlyEvent, wireMethod] of Object.entries(this.plotlyEventListeners)) { + _el.on(plotlyEvent, (data) => { + const payload = this.serializePlotlyEvent(plotlyEvent, data); + + // 1. Call the mapped method on this widget + this.$wire[wireMethod](payload); + // 2. Broadcast so sibling components can react with #[On('plotly:plotly_click')] + this.$dispatch('plotly:' + plotlyEvent, payload); + }); + } + } + }, + setupStream() { + const _streamEl = document.querySelector(this.chartId); + let _streamTries = 0; + + this._streamTid = setInterval(() => { + if ((_streamEl && _streamEl._fullLayout) || ++_streamTries > 100) { + clearInterval(this._streamTid); + if (_streamEl && _streamEl._fullLayout) { + this.startStream(this.streamUrl, this.streamParams); + } + } + }, 20); + }, + destroy() { + // This runs automatically when the component is destroyed + if (this._evtSource) this._evtSource.close(); + if (this._streamTid) clearInterval(this._streamTid); }, renderChart() { - if(this.chartLayout.length === 0 && this.chartConfig.length === 0){ + if(Object.keys(this.chartLayout).length === 0 && Object.keys(this.chartConfig).length === 0){ Plotly.react( document.querySelector(this.chartId), this.chartData @@ -57,6 +127,176 @@ export default function plotly({ this.chartConfig ); }, + /** + * Reset the chart for a new stream, merging streamingLayoutPatch into + * the current live layout so relayout-applied properties (e.g. theme + * template) are not lost when the chart is re-rendered from scratch. + * Uses the original PHP trace templates (this.chartData) so trace styles + * (mode, line, marker) are preserved after each stream reset. + */ + resetStream() { + const el = document.querySelector(this.chartId); + const layout = Object.assign({}, el.layout || {}, this.streamingLayoutPatch); + Plotly.react(el, this.chartData, layout); + }, + /** + * Open an EventSource to `url` with `params` as query-string. + * Handles the init / data / done message protocol, progress overlay, + * and invokes getOnStreamMessageScript / getOnStreamDoneScript overrides. + * + * Message protocol (JSON): + * { init: true, total: N } — stream is starting; N total messages expected + * { done: true } — stream finished + * { ... } — data message; forwarded to onStreamMessageScript + * + * Default data handler (when onStreamMessageScript is null): + * Plotly.extendTraces(el, { x: [[d.x]], y: [[d.y]] }, [0]) + */ + startStream(url, params) { + if (this._evtSource) { this._evtSource.close(); this._evtSource = null; } + + const el = document.querySelector(this.chartId); + if (!el || !window.Plotly) return; + + this.resetStream(); + this._showStreamLoader(el); + + let total = 0, loaded = 0; + const onMsg = this.onStreamMessageScript ? new Function('d', 'el', this.onStreamMessageScript) : null; + const onDone = this.onStreamDoneScript ? new Function('d','el', this.onStreamDoneScript) : null; + + this._evtSource = new EventSource(url + '?' + new URLSearchParams(params)); + + // Capture a reference so stale handlers from a superseded stream can + // detect they belong to a closed source and bail out early. + const source = this._evtSource; + + source.onmessage = (event) => { + if (this._evtSource !== source) return; // stale — a newer stream replaced us + + const d = JSON.parse(event.data); + + if (d.init) { + total = d.total ?? 0; + this._updateStreamProgress(el, 0, total); + return; + } + + if (d.done) { + this._evtSource.close(); this._evtSource = null; + if (onDone) onDone(d,el); + this._hideStreamLoader(el); + return; + } + + loaded++; + this._updateStreamProgress(el, loaded, total); + + if (onMsg) { + onMsg(d, el); + } else { + const PROTOCOL_KEYS = new Set(['init', 'done', 'total']); + const update = {}; + for (const key of Object.keys(d)) { + if (!PROTOCOL_KEYS.has(key)) update[key] = [[d[key]]]; + } + if (Object.keys(update).length) Plotly.extendTraces(el, update, [0]); + } + }; + + source.onerror = () => { + if (this._evtSource !== source) return; // stale + this._evtSource.close(); this._evtSource = null; + this._hideStreamLoader(el); + }; + }, + _showStreamLoader(el) { + if (!el || el.querySelector('[data-stream-loader]')) { return; } + + const ov = document.createElement('div'); + ov.setAttribute('data-stream-loader', ''); + ov.style.cssText = 'position:absolute;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.75rem'; + ov.innerHTML = ` + Loading data +
+
+
+ + `; + el.appendChild(ov); + }, + _updateStreamProgress(el, done, total) { + const ov = el?.querySelector('[data-stream-loader]'); + if (!ov) return; + const pct = total > 0 ? (done / total) * 100 : 0; + ov.querySelector('[data-progress-bar]').style.width = pct + '%'; + ov.querySelector('[data-progress-text]').textContent = `${done} / ${total}`; + }, + _hideStreamLoader(el) { + el?.querySelector('[data-stream-loader]')?.remove(); + }, + /** + * Strip non-serialisable fields (DOM nodes, full trace objects, axis + * definitions) from a Plotly event before forwarding to Livewire. + * + * serializePoint walks all own keys of the point object and drops only the + * known non-serialisable ones, so every chart type (scatter, bar, pie, + * polar, geo, sankey, sunburst, …) forwards its native fields without + * needing an explicit allowlist. traceName is added as a convenience by + * pulling it from the otherwise-skipped `data` trace reference. + * + * Keys always skipped: + * data / fullData — full trace object (large, may contain circular refs) + * xaxis / yaxis / zaxis — axis layout objects (DOM-linked) + * node / element / _input — DOM nodes and internal Plotly fields + * + * Store your record's primary key in the trace's `customdata` field when + * building chart data and retrieve it here as points[0].customdata. + */ + serializePlotlyEvent(event, data) { + const SKIP = new Set(['data', 'fullData', 'xaxis', 'yaxis', 'zaxis', 'node', 'element', '_input']); + const serializePoint = (pt) => { + const result = { traceName: pt.data?.name ?? null }; + for (const key of Object.keys(pt)) { + if (SKIP.has(key)) continue; + const val = pt[key]; + if (typeof val === 'function') continue; + if (typeof val === 'object' && val !== null && val instanceof Node) continue; + result[key] = val ?? null; + } + return result; + }; + + // Point-based events + if (['plotly_click', 'plotly_hover', 'plotly_unhover', 'plotly_doubleclick'].includes(event)) { + return { points: (data?.points ?? []).map(serializePoint) }; + } + + // Selection events add range / lasso info + if (['plotly_selected', 'plotly_deselect'].includes(event)) { + return { + points: (data?.points ?? []).map(serializePoint), + range: data?.range ?? null, + lassoPoints: data?.lassoPoints ?? null, + }; + } + + // Legend events carry the trace index and whether it is now visible + if (['plotly_legendclick', 'plotly_legenddoubleclick'].includes(event)) { + return { + curveNumber: data?.curveNumber ?? null, + traceName: data?.data?.name ?? null, + }; + } + + // Layout / style change events are already plain objects — safe as-is + if (['plotly_relayout', 'plotly_restyle', 'plotly_autosize'].includes(event)) { + return data ?? {}; + } + + // Unknown event: return nothing (avoid serialization errors) + return {}; + }, tryParse(value,key) { if (typeof value !== 'string') return value; @@ -84,4 +324,4 @@ export default function plotly({ }); }, } -} \ No newline at end of file +} diff --git a/resources/views/widgets/components/chart.blade.php b/resources/views/widgets/components/chart.blade.php index 509d5c1..7885a7e 100644 --- a/resources/views/widgets/components/chart.blade.php +++ b/resources/views/widgets/components/chart.blade.php @@ -9,7 +9,22 @@ 'deferLoading', 'readyToLoad', 'beforeContent', + 'onChartReadyScript' => null, + 'chartOverlay' => null, + 'streamingLayoutPatch' => [], + 'darkThemeLayout' => [], + 'lightThemeLayout' => [], + 'plotlyEventListeners' => [], + 'streamUrl' => null, + 'streamParams' => [], + 'onStreamMessageScript' => null, + 'onStreamDoneScript' => null, ]) +@php + $onChartReadyScript = method_exists($this, 'getOnChartReadyScript') ? $this->getOnChartReadyScript() : null; + $onStreamMessageScript = method_exists($this, 'getOnStreamMessageScript') ? $this->getOnStreamMessageScript() : null; + $onStreamDoneScript = method_exists($this, 'getOnStreamDoneScript') ? $this->getOnStreamDoneScript() : null; +@endphp
@if ($readyToLoad)
+ style="position: relative; overflow:hidden;{{ 'height: '.$contentHeight.'px;' }}"> +
+ x-init="$watch('dropdownOpen', value => $wire.dropdownOpen = value)">
+ + @if ($onChartReadyScript) +
+ @endif @else
@if ($loadingIndicator) diff --git a/resources/views/widgets/components/overlay.blade.php b/resources/views/widgets/components/overlay.blade.php new file mode 100644 index 0000000..c0bbeeb --- /dev/null +++ b/resources/views/widgets/components/overlay.blade.php @@ -0,0 +1,2 @@ +@props(['chartOverlay']) +{{ $chartOverlay }} \ No newline at end of file diff --git a/resources/views/widgets/plotly-widget.blade.php b/resources/views/widgets/plotly-widget.blade.php index 25463a6..ed693b1 100644 --- a/resources/views/widgets/plotly-widget.blade.php +++ b/resources/views/widgets/plotly-widget.blade.php @@ -22,8 +22,19 @@ $headerActionsAlignment = method_exists($this, 'getHeaderActionsAlignment') ? $this->getHeaderActionsAlignment() : null; $footerActions = method_exists($this, 'getFooterActions') ? $this->getFooterActions() : []; $footerActionsAlignment = method_exists($this, 'getFooterActionsAlignment') ? $this->getFooterActionsAlignment() : null; + + // New chart hooks + $chartOverlay = method_exists($this, 'getChartOverlay') ? $this->getChartOverlay() : null; + $streamingLayoutPatch = method_exists($this, 'getStreamingLayoutPatch') ? $this->getStreamingLayoutPatch() : []; + $darkThemeLayout = method_exists($this, 'getDarkThemeLayout') ? $this->getDarkThemeLayout() : []; + $lightThemeLayout = method_exists($this, 'getLightThemeLayout') ? $this->getLightThemeLayout() : []; + $plotlyEventListeners = method_exists($this, 'getPlotlyEventListeners') ? $this->getPlotlyEventListeners() : []; + + // HasStreamingSupport + $streamUrl = method_exists($this, 'getStreamUrl') ? $this->getStreamUrl() : null; + $streamParams = method_exists($this, 'getStreamParams') ? $this->getStreamParams() : []; @endphp - + @foreach ($filters as $value => $label) - diff --git a/src/Components/Before.php b/src/Components/Before.php index d37c274..8b223b2 100644 --- a/src/Components/Before.php +++ b/src/Components/Before.php @@ -2,6 +2,7 @@ namespace Asharif88\FilamentPlotly\Components; +use Illuminate\Contracts\View\View; use Illuminate\View\Component; class Before extends Component @@ -13,7 +14,7 @@ public function __construct( /** * Renders the view for the header component. */ - public function render(): \Illuminate\Contracts\View\View + public function render(): View { return view('filament-plotly::widgets.components.before'); } diff --git a/src/Components/Chart.php b/src/Components/Chart.php index 5d53ed7..5fdca2a 100644 --- a/src/Components/Chart.php +++ b/src/Components/Chart.php @@ -2,6 +2,7 @@ namespace Asharif88\FilamentPlotly\Components; +use Illuminate\Contracts\View\View; use Illuminate\View\Component; class Chart extends Component @@ -17,12 +18,18 @@ public function __construct( public $deferLoading, public $readyToLoad, public $beforeContent, + public $onChartReadyScript = null, + public $chartOverlay = null, + public $streamingLayoutPatch = [], + public $darkThemeLayout = [], + public $lightThemeLayout = [], + public $plotlyEventListeners = [], ) {} /** * Renders a view for the chart component. */ - public function render(): \Illuminate\Contracts\View\View + public function render(): View { return view('filament-plotly::widgets.components.chart'); } diff --git a/src/Components/FilterForm.php b/src/Components/FilterForm.php index 3e46cd5..1046abb 100644 --- a/src/Components/FilterForm.php +++ b/src/Components/FilterForm.php @@ -2,6 +2,7 @@ namespace Asharif88\FilamentPlotly\Components; +use Illuminate\Contracts\View\View; use Illuminate\View\Component; class FilterForm extends Component @@ -14,7 +15,7 @@ public function __construct( /** * Renders the view for the filter-form component. */ - public function render(): \Illuminate\Contracts\View\View + public function render(): View { return view('filament-plotly::widgets.components.filter-form'); } diff --git a/src/Components/Header.php b/src/Components/Header.php index 79ea0bd..e1a3a3a 100644 --- a/src/Components/Header.php +++ b/src/Components/Header.php @@ -2,6 +2,7 @@ namespace Asharif88\FilamentPlotly\Components; +use Illuminate\Contracts\View\View; use Illuminate\View\Component; class Header extends Component @@ -18,7 +19,7 @@ public function __construct( /** * Renders the view for the header component. */ - public function render(): \Illuminate\Contracts\View\View + public function render(): View { return view('filament-plotly::widgets.components.header'); } diff --git a/src/Components/Overlay.php b/src/Components/Overlay.php new file mode 100644 index 0000000..b4d2b49 --- /dev/null +++ b/src/Components/Overlay.php @@ -0,0 +1,21 @@ +. + */ + protected function getDarkThemeLayout(): array + { + return []; + } + + /** + * Return Plotly layout properties to apply when the page is in light mode. + * These are merged into the current layout via Plotly.relayout whenever the + * dark class is toggled on . + */ + protected function getLightThemeLayout(): array + { + return []; + } +} diff --git a/src/Concerns/HasStreamingSupport.php b/src/Concerns/HasStreamingSupport.php new file mode 100644 index 0000000..8ee5d21 --- /dev/null +++ b/src/Concerns/HasStreamingSupport.php @@ -0,0 +1,35 @@ +getFiltersSchema()->fill(); } - $this->chartData = $this->getChartData(); - $this->chartConfig = $this->getChartConfig(); - $this->chartLayout = $this->getChartLayout(); - if (! $this->getDeferLoading()) { + $this->chartData = $this->getChartData(); + $this->chartConfig = $this->getChartConfig(); + $this->chartLayout = $this->getChartLayout(); $this->readyToLoad = true; } } - public function on(): void {} - public function render(): View { return view($this->view, []); @@ -82,6 +86,68 @@ protected function getChartLayout(): array return []; } + /** + * Return plain JS to execute once the Plotly chart is fully initialised. + * The chart DOM element is available as `el` inside the script. + * Override in subclasses to replace the tryAttach polling pattern. + */ + protected function getOnChartReadyScript(): ?string + { + return null; + } + + // /** + // * Return HTML/Blade content to render *inside* the chart's wire:ignore + // * container. Useful for overlay loaders and annotation panels that need to + // * sit on top of the chart without absolute-positioning hacks. + // */ + // protected function getChartOverlayContent(): null | string | Htmlable | View + // { + // return null; + // } + + /** + * Return Plotly layout properties to merge before every stream reset + * (Plotly.react call at the start of a new SSE stream). This prevents the + * class of bug where relayout-applied properties are lost when the chart + * is re-rendered with a fresh layout object. + */ + protected function getStreamingLayoutPatch(): array + { + return []; + } + + /** + * Map Plotly JS event names to public methods on this widget. + * + * Each entry fires two things when the Plotly event occurs: + * 1. $wire.method(payload) — calls the mapped method on this widget directly. + * 2. window event "plotly:{event}" — so sibling Livewire components (e.g. a + * table) can react with #[On('plotly:plotly_click')] without coupling to + * this widget. + * + * Only safe, serialisable fields are forwarded (x, y, z, text, customdata, + * curveNumber, pointIndex, traceName). Store your record ID in `customdata` + * when building trace data and read it back here. + * + * Supported events: plotly_click, plotly_hover, plotly_unhover, + * plotly_selected, plotly_deselect, plotly_relayout, plotly_restyle, + * plotly_doubleclick, plotly_legendclick, plotly_legenddoubleclick. + * + * Example: + * return ['plotly_click' => 'onChartClick']; + * + * public function onChartClick(array $data): void + * { + * $recordId = $data['points'][0]['customdata'] ?? null; + * // open slide-over, update table, etc. + * } + */ + protected function getPlotlyEventListeners(): array + { + return []; + } + /** * Return header actions for the widget. Override in your widget to provide actions. * Should return an array of Filament\Actions\Action (and/or ActionGroup) instances.