@deck.gl/carto 9.3.0-alpha.5 → 9.3.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5562,7 +5562,7 @@
5562
5562
  };
5563
5563
 
5564
5564
  // src/layers/schema/carto-properties-tile-loader.ts
5565
- var VERSION = true ? "9.3.0-alpha.5" : "latest";
5565
+ var VERSION = true ? "9.3.0-alpha.6" : "latest";
5566
5566
  var id = "cartoPropertiesTile";
5567
5567
  var DEFAULT_OPTIONS = {
5568
5568
  cartoPropertiesTile: {
@@ -5548,7 +5548,7 @@
5548
5548
  };
5549
5549
 
5550
5550
  // src/layers/schema/carto-raster-tile-loader.ts
5551
- var VERSION = true ? "9.3.0-alpha.5" : "latest";
5551
+ var VERSION = true ? "9.3.0-alpha.6" : "latest";
5552
5552
  var id = "cartoRasterTile";
5553
5553
  var DEFAULT_OPTIONS = {
5554
5554
  cartoRasterTile: {
@@ -5947,7 +5947,7 @@
5947
5947
  }
5948
5948
 
5949
5949
  // src/layers/schema/carto-spatial-tile-loader.ts
5950
- var VERSION = true ? "9.3.0-alpha.5" : "latest";
5950
+ var VERSION = true ? "9.3.0-alpha.6" : "latest";
5951
5951
  var id = "cartoSpatialTile";
5952
5952
  var DEFAULT_OPTIONS = {
5953
5953
  cartoSpatialTile: {
@@ -6167,7 +6167,7 @@
6167
6167
  };
6168
6168
 
6169
6169
  // src/layers/schema/carto-vector-tile-loader.ts
6170
- var VERSION = true ? "9.3.0-alpha.5" : "latest";
6170
+ var VERSION = true ? "9.3.0-alpha.6" : "latest";
6171
6171
  var id = "cartoVectorTile";
6172
6172
  var DEFAULT_OPTIONS = {
6173
6173
  cartoVectorTile: {
package/dist/index.cjs CHANGED
@@ -689,7 +689,7 @@ function binaryToSpatialjson(binary) {
689
689
  }
690
690
 
691
691
  // dist/layers/schema/carto-spatial-tile-loader.js
692
- var VERSION = true ? "9.3.0-alpha.5" : "latest";
692
+ var VERSION = true ? "9.3.0-alpha.6" : "latest";
693
693
  var id = "cartoSpatialTile";
694
694
  var DEFAULT_OPTIONS = {
695
695
  cartoSpatialTile: {
@@ -2052,7 +2052,7 @@ var TileReader3 = class {
2052
2052
  };
2053
2053
 
2054
2054
  // dist/layers/schema/carto-raster-tile-loader.js
2055
- var VERSION2 = true ? "9.3.0-alpha.5" : "latest";
2055
+ var VERSION2 = true ? "9.3.0-alpha.6" : "latest";
2056
2056
  var id2 = "cartoRasterTile";
2057
2057
  var DEFAULT_OPTIONS2 = {
2058
2058
  cartoRasterTile: {
@@ -2165,7 +2165,7 @@ var TileReader4 = class {
2165
2165
  };
2166
2166
 
2167
2167
  // dist/layers/schema/carto-properties-tile-loader.js
2168
- var VERSION3 = true ? "9.3.0-alpha.5" : "latest";
2168
+ var VERSION3 = true ? "9.3.0-alpha.6" : "latest";
2169
2169
  var id3 = "cartoPropertiesTile";
2170
2170
  var DEFAULT_OPTIONS3 = {
2171
2171
  cartoPropertiesTile: {
@@ -2194,7 +2194,7 @@ var carto_properties_tile_loader_default = CartoPropertiesTileLoader;
2194
2194
 
2195
2195
  // dist/layers/schema/carto-vector-tile-loader.js
2196
2196
  var import_earcut = __toESM(require("earcut"), 1);
2197
- var VERSION4 = true ? "9.3.0-alpha.5" : "latest";
2197
+ var VERSION4 = true ? "9.3.0-alpha.6" : "latest";
2198
2198
  var id4 = "cartoVectorTile";
2199
2199
  var DEFAULT_OPTIONS4 = {
2200
2200
  cartoVectorTile: {
@@ -4,7 +4,7 @@
4
4
  import { TileReader } from "./carto-properties-tile.js";
5
5
  import { parsePbf } from "./tile-loader-utils.js";
6
6
  import { getWorkerUrl } from "../../utils.js";
7
- const VERSION = typeof "9.3.0-alpha.5" !== 'undefined' ? "9.3.0-alpha.5" : 'latest';
7
+ const VERSION = typeof "9.3.0-alpha.6" !== 'undefined' ? "9.3.0-alpha.6" : 'latest';
8
8
  const id = 'cartoPropertiesTile';
9
9
  const DEFAULT_OPTIONS = {
10
10
  cartoPropertiesTile: {
@@ -4,7 +4,7 @@
4
4
  import { TileReader } from "./carto-raster-tile.js";
5
5
  import { parsePbf } from "./tile-loader-utils.js";
6
6
  import { getWorkerUrl } from "../../utils.js";
7
- const VERSION = typeof "9.3.0-alpha.5" !== 'undefined' ? "9.3.0-alpha.5" : 'latest';
7
+ const VERSION = typeof "9.3.0-alpha.6" !== 'undefined' ? "9.3.0-alpha.6" : 'latest';
8
8
  const id = 'cartoRasterTile';
9
9
  const DEFAULT_OPTIONS = {
10
10
  cartoRasterTile: {
@@ -5,7 +5,7 @@ import { TileReader } from "./carto-spatial-tile.js";
5
5
  import { parsePbf } from "./tile-loader-utils.js";
6
6
  import { getWorkerUrl } from "../../utils.js";
7
7
  import { binaryToSpatialjson } from "./spatialjson-utils.js";
8
- const VERSION = typeof "9.3.0-alpha.5" !== 'undefined' ? "9.3.0-alpha.5" : 'latest';
8
+ const VERSION = typeof "9.3.0-alpha.6" !== 'undefined' ? "9.3.0-alpha.6" : 'latest';
9
9
  const id = 'cartoSpatialTile';
10
10
  const DEFAULT_OPTIONS = {
11
11
  cartoSpatialTile: {
@@ -5,7 +5,7 @@ import earcut from 'earcut';
5
5
  import { TileReader } from "./carto-tile.js";
6
6
  import { parsePbf } from "./tile-loader-utils.js";
7
7
  import { getWorkerUrl } from "../../utils.js";
8
- const VERSION = typeof "9.3.0-alpha.5" !== 'undefined' ? "9.3.0-alpha.5" : 'latest';
8
+ const VERSION = typeof "9.3.0-alpha.6" !== 'undefined' ? "9.3.0-alpha.6" : 'latest';
9
9
  const id = 'cartoVectorTile';
10
10
  const DEFAULT_OPTIONS = {
11
11
  cartoVectorTile: {
package/dist.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['deck'] = factory();
6
6
  else root['deck'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Ag=Object.create;var Gi=Object.defineProperty;var Pg=Object.getOwnPropertyDescriptor;var Fg=Object.getOwnPropertyNames;var Mg=Object.getPrototypeOf,kg=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ha=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fg(t))!kg.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=Pg(t,i))||n.enumerable});return e},et=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),q=(e,t,r)=>(r=e!=null?Ag(Mg(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),Lg=e=>qi(Gi({},"__esModule",{value:!0}),e);var Mt=X((o3,_l)=>{_l.exports=globalThis.deck});var gt=X((a3,El)=>{El.exports=globalThis.deck});var pn=X((s3,Sl)=>{Sl.exports=globalThis.loaders});var Se=X((h3,Pl)=>{Pl.exports=globalThis.deck});var zl=X((p3,Nl)=>{var Ug=Math.PI/180,qg=180/Math.PI;function kl(e){var t=Fl(e[0]+1,e[2]),r=Fl(e[0],e[2]),n=Ml(e[1]+1,e[2]),i=Ml(e[1],e[2]);return[r,n,t,i]}function Gg(e){var t=kl(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function Fl(e,t){return e/Math.pow(2,t)*360-180}function Ml(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return qg*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Za(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Bl(e){return Ll(Il(e))}function Vg(e,t){for(var r=Bl(e),n=0;n<r.length;n++)if(!Ol(t,r[n]))return!1;return!0}function Ol(e,t){for(var r=0;r<e.length;r++)if(Rl(e[r],t))return!0;return!1}function Rl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function $g(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Hg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Zg(e){var t=Za(e[0],e[1],32),r=Za(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=jg(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function jg(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Ug),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}Nl.exports={tileToGeoJSON:Gg,tileToBBOX:kl,getChildren:Ll,getParent:Il,getSiblings:Bl,hasTile:Ol,hasSiblings:Vg,tilesEqual:Rl,tileToQuadkey:$g,quadkeyToTile:Hg,pointToTile:Za,bboxToTile:Zg,pointToTileFraction:Dl}});var Gl=X(Zi=>{var Pr=zl();Zi.geojson=function(e,t){return{type:"FeatureCollection",features:Wa(e,t).map(Wg)}};function Wg(e){return{type:"Feature",geometry:Pr.tileToGeoJSON(e),properties:{}}}Zi.tiles=Wa;Zi.indexes=function(e,t){return Wa(e,t).map(Pr.tileToQuadkey)};function Wa(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Pr.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Pr.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")ja(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)ja(a,i[r],o);else if(e.type==="Polygon")Ul(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Ul(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ql(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return Yg(a,s,t)}return ql(a,s),s}function Yg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Ul(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];ja(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Kg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function Kg(e,t){return e[1]-t[1]||e[0]-t[0]}function ja(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Pr.pointToTileFraction(t[a][0],t[a][1],r),l=Pr.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),R=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=R,v+=T),e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ql(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Xg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Xg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}});var Yt=X((s5,Xl)=>{Xl.exports=globalThis.h3||{}});var mt=X(pe=>{"use strict";var Cm=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Am(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Am(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Pm={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},Fm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,Pm)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,Fm))};pe.setTyped(Cm)});var zc=X(Br=>{"use strict";var Mm=mt(),km=4,bc=0,yc=1,Lm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var Im=0,Sc=1,Bm=2,Om=3,Rm=258,fs=29,Sn=256,vn=Sn+1+fs,Lr=30,ls=19,Tc=2*vn+1,Kt=15,rs=16,Dm=7,cs=256,Cc=16,Ac=17,Pc=18,as=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ji=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Nm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Fc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],zm=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(zm);Ir(wn);var _n=new Array(Rm-Om+1);Ir(_n);var us=new Array(fs);Ir(us);var eo=new Array(Lr);Ir(eo);function ns(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Mc,kc,Lc;function is(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ic(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>rs-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>rs-e.bi_valid,e.bi_valid+=r-rs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function nt(e,t,r){be(e,r[t*2],r[t*2+1])}function Bc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Um(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function qm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Kt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<Tc;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Oc(e,t,r){var n=new Array(Kt+1),i=0,o,a;for(o=1;o<=Kt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Bc(n[s]++,s))}}function Gm(){var e,t,r,n,i,o=new Array(Kt+1);for(r=0,n=0;n<fs-1;n++)for(us[n]=r,e=0;e<1<<as[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(eo[n]=i,e=0;e<1<<Ji[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(eo[n]=i<<7,e=0;e<1<<Ji[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Kt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Oc(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Bc(e,5);Mc=new ns(bt,as,Sn+1,vn,Kt),kc=new ns(xn,Ji,0,Lr,Kt),Lc=new ns(new Array(0),Nm,0,ls,Dm)}function Rc(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ls;t++)e.bl_tree[t*2]=0;e.dyn_ltree[cs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Dc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Vm(e,t,r,n){Dc(e),n&&(En(e,r),En(e,~r)),Mm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function xc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function os(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&xc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!xc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function vc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?nt(e,i,t):(a=_n[i],nt(e,a+Sn+1,t),s=as[a],s!==0&&(i-=us[a],be(e,i,s)),n--,a=Ic(n),nt(e,a,r),s=Ji[a],s!==0&&(n-=eo[a],be(e,n,s)));while(o<e.last_lit);nt(e,cs,t)}function ss(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=Tc,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)os(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],os(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,os(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qm(e,t),Oc(r,l,e.bl_count)}function wc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[Cc*2]++):s<=10?e.bl_tree[Ac*2]++:e.bl_tree[Pc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function _c(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do nt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(nt(e,o,e.bl_tree),s--),nt(e,Cc,e.bl_tree),be(e,s-3,2)):s<=10?(nt(e,Ac,e.bl_tree),be(e,s-3,3)):(nt(e,Pc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function $m(e){var t;for(wc(e,e.dyn_ltree,e.l_desc.max_code),wc(e,e.dyn_dtree,e.d_desc.max_code),ss(e,e.bl_desc),t=ls-1;t>=3&&e.bl_tree[Fc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Hm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[Fc[i]*2+1],3);_c(e,e.dyn_ltree,t-1),_c(e,e.dyn_dtree,r-1)}function Zm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return bc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return yc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return yc;return bc}var Ec=!1;function jm(e){Ec||(Gm(),Ec=!0),e.l_desc=new is(e.dyn_ltree,Mc),e.d_desc=new is(e.dyn_dtree,kc),e.bl_desc=new is(e.bl_tree,Lc),e.bi_buf=0,e.bi_valid=0,Rc(e)}function Nc(e,t,r,n){be(e,(Im<<1)+(n?1:0),3),Vm(e,t,r,!0)}function Wm(e){be(e,Sc<<1,3),nt(e,cs,bt),Um(e)}function Ym(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Lm&&(e.strm.data_type=Zm(e)),ss(e,e.l_desc),ss(e,e.d_desc),a=$m(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?Nc(e,t,r,n):e.strategy===km||o===i?(be(e,(Sc<<1)+(n?1:0),3),vc(e,bt,xn)):(be(e,(Bm<<1)+(n?1:0),3),Hm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),vc(e,e.dyn_ltree,e.dyn_dtree)),Rc(e),n&&Dc(e)}function Km(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Ic(t)*2]++),e.last_lit===e.lit_bufsize-1}Br._tr_init=jm;Br._tr_stored_block=Nc;Br._tr_flush_block=Ym;Br._tr_tally=Km;Br._tr_align=Wm});var ds=X(($5,Uc)=>{"use strict";function Xm(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Uc.exports=Xm});var hs=X((H5,qc)=>{"use strict";function Qm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Jm=Qm();function e1(e,t,r,n){var i=Jm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}qc.exports=e1});var to=X((Z5,Gc)=>{"use strict";Gc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Xc=X(at=>{"use strict";var ge=mt(),ke=zc(),Zc=ds(),Bt=hs(),t1=to(),er=0,r1=1,n1=3,zt=4,Vc=5,ot=0,$c=1,Le=-2,i1=-3,ps=-5,o1=-1,a1=1,ro=2,s1=3,f1=4,l1=0,c1=2,ao=8,u1=9,d1=15,h1=8,p1=29,g1=256,ms=g1+1+p1,m1=30,b1=19,y1=2*ms+1,x1=15,$=3,Dt=258,qe=Dt+$+1,v1=32,so=42,bs=69,no=73,io=91,oo=103,Xt=113,Cn=666,se=1,An=2,Qt=3,Dr=4,w1=3;function Nt(e,t){return e.msg=t1[t],t}function Hc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Ot(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){ke._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ot(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Zc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Bt(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function jc(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Dt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Dt-(d-n),n=d-Dt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Jt(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=_1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function E1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Jt(e),e.lookahead===0&&t===er)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function gs(e,t){for(var r,n;;){if(e.lookahead<qe){if(Jt(e),e.lookahead<qe&&t===er)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=jc(e,r)),e.match_length>=$)if(n=ke._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Or(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(Jt(e),e.lookahead<qe&&t===er)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=jc(e,r),e.match_length<=5&&(e.strategy===a1||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=ke._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=ke._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=ke._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function S1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Dt){if(Jt(e),e.lookahead<=Dt&&t===er)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Dt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Dt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=ke._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function T1(e,t){for(var r;;){if(e.lookahead===0&&(Jt(e),e.lookahead===0)){if(t===er)return se;break}if(e.match_length=0,r=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function it(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Rr;Rr=[new it(0,0,0,0,E1),new it(4,4,8,4,gs),new it(4,5,16,8,gs),new it(4,6,32,32,gs),new it(4,4,16,16,Or),new it(8,16,32,32,Or),new it(8,16,128,128,Or),new it(8,32,128,256,Or),new it(32,128,258,1024,Or),new it(32,258,258,4096,Or)];function C1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Rr[e.level].max_lazy,e.good_match=Rr[e.level].good_length,e.nice_match=Rr[e.level].nice_length,e.max_chain_length=Rr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function A1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ao,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(y1*2),this.dyn_dtree=new ge.Buf16((2*m1+1)*2),this.bl_tree=new ge.Buf16((2*b1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(x1+1),this.heap=new ge.Buf16(2*ms+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*ms+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Wc(e){var t;return!e||!e.state?Nt(e,Le):(e.total_in=e.total_out=0,e.data_type=c1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?so:Xt,e.adler=t.wrap===2?0:1,t.last_flush=er,ke._tr_init(t),ot)}function Yc(e){var t=Wc(e);return t===ot&&C1(e.state),t}function P1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,ot)}function Kc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===o1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>u1||r!==ao||n<8||n>15||t<0||t>9||o<0||o>f1)return Nt(e,Le);n===8&&(n=9);var s=new A1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Yc(e)}function F1(e,t){return Kc(e,t,ao,d1,h1,l1)}function M1(e,t){var r,n,i,o;if(!e||!e.state||t>Vc||t<0)return e?Nt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==zt)return Nt(e,e.avail_out===0?ps:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===so)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=ro||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Bt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=bs):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=ro||n.level<2?4:0),j(n,w1),n.status=Xt);else{var a=ao+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=ro||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=v1),a+=31-a%31,n.status=Xt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===bs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=io)}else n.status=io;if(n.status===io)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=oo)}else n.status=oo;if(n.status===oo&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ot(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Xt)):n.status=Xt),n.pending!==0){if(Ot(e),e.avail_out===0)return n.last_flush=-1,ot}else if(e.avail_in===0&&Hc(t)<=Hc(r)&&t!==zt)return Nt(e,ps);if(n.status===Cn&&e.avail_in!==0)return Nt(e,ps);if(e.avail_in!==0||n.lookahead!==0||t!==er&&n.status!==Cn){var l=n.strategy===ro?T1(n,t):n.strategy===s1?S1(n,t):Rr[n.level].func(n,t);if((l===Qt||l===Dr)&&(n.status=Cn),l===se||l===Qt)return e.avail_out===0&&(n.last_flush=-1),ot;if(l===An&&(t===r1?ke._tr_align(n):t!==Vc&&(ke._tr_stored_block(n,0,0,!1),t===n1&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ot(e),e.avail_out===0))return n.last_flush=-1,ot}return t!==zt?ot:n.wrap<=0?$c:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Ot(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ot:$c)}function k1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==so&&t!==bs&&t!==no&&t!==io&&t!==oo&&t!==Xt&&t!==Cn?Nt(e,Le):(e.state=null,t===Xt?Nt(e,i1):ot))}function L1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==so||n.lookahead))return Le;for(a===1&&(e.adler=Zc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,Jt(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,Jt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,ot}at.deflateInit=F1;at.deflateInit2=Kc;at.deflateReset=Yc;at.deflateResetKeep=Wc;at.deflateSetHeader=P1;at.deflate=M1;at.deflateEnd=k1;at.deflateSetDictionary=L1;at.deflateInfo="pako deflate (from Nodeca project)"});var ys=X(Nr=>{"use strict";var fo=mt(),Qc=!0,Jc=!0;try{String.fromCharCode.apply(null,[0])}catch{Qc=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Jc=!1}var Pn=new fo.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new fo.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function eu(e,t){if(t<65534&&(e.subarray&&Jc||!e.subarray&&Qc))return String.fromCharCode.apply(null,fo.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return eu(e,e.length)};Nr.binstring2buf=function(e){for(var t=new fo.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return eu(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var xs=X((Y5,tu)=>{"use strict";function I1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}tu.exports=I1});var ou=X(kn=>{"use strict";var Fn=Xc(),Mn=mt(),ws=ys(),_s=to(),B1=xs(),iu=Object.prototype.toString,O1=0,vs=4,zr=0,ru=1,nu=2,R1=-1,D1=0,N1=8;function tr(e){if(!(this instanceof tr))return new tr(e);this.options=Mn.assign({level:R1,method:N1,chunkSize:16384,windowBits:15,memLevel:8,strategy:D1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new B1,this.strm.avail_out=0;var r=Fn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(_s[r]);if(t.header&&Fn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=ws.string2buf(t.dictionary):iu.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Fn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(_s[r]);this._dict_set=!0}}tr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?vs:O1,typeof e=="string"?r.input=ws.string2buf(e):iu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Mn.Buf8(n),r.next_out=0,r.avail_out=n),i=Fn.deflate(r,o),i!==ru&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===vs||o===nu))&&(this.options.to==="string"?this.onData(ws.buf2binstring(Mn.shrinkBuf(r.output,r.next_out))):this.onData(Mn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==ru);return o===vs?(i=Fn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===nu&&(this.onEnd(zr),r.avail_out=0),!0)};tr.prototype.onData=function(e){this.chunks.push(e)};tr.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Es(e,t){var r=new tr(t);if(r.push(e,!0),r.err)throw r.msg||_s[r.err];return r.result}function z1(e,t){return t=t||{},t.raw=!0,Es(e,t)}function U1(e,t){return t=t||{},t.gzip=!0,Es(e,t)}kn.Deflate=tr;kn.deflate=Es;kn.deflateRaw=z1;kn.gzip=U1});var su=X((X5,au)=>{"use strict";var lo=30,q1=12;au.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,R,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,T=n.lencode,_=n.distcode,v=(1<<n.lenbits)-1,M=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=T[g&v];t:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I===0)y[a++]=L&65535;else if(I&16){R=L&65535,I&=15,I&&(x<I&&(g+=b[i++]<<x,x+=8),R+=g&(1<<I)-1,g>>>=I,x-=I),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=_[g&M];r:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I&16){if(N=L&65535,I&=15,x<I&&(g+=b[i++]<<x,x+=8,x<I&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<I)-1,N>f){t.msg="invalid distance too far back",n.mode=lo;break e}if(g>>>=I,x-=I,I=a-s,N>I){if(I=N-I,I>u&&n.sane){t.msg="invalid distance too far back",n.mode=lo;break e}if(p=0,m=h,d===0){if(p+=c-I,I<R){R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}else if(d<I){if(p+=c+d-I,I-=d,I<R){R-=I;do y[a++]=h[p++];while(--I);if(p=0,d<R){I=d,R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}}else if(p+=d-I,I<R){R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}for(;R>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],R-=3;R&&(y[a++]=m[p++],R>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],R-=3;while(R>2);R&&(y[a++]=y[p++],R>1&&(y[a++]=y[p++]))}}else if(I&64){t.msg="invalid distance code",n.mode=lo;break e}else{L=_[(L&65535)+(g&(1<<I)-1)];continue r}break}}else if(I&64)if(I&32){n.mode=q1;break e}else{t.msg="invalid literal/length code",n.mode=lo;break e}else{L=T[(L&65535)+(g&(1<<I)-1)];continue t}break}}while(i<o&&a<l);R=x>>3,i-=R,x-=R<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var pu=X((Q5,hu)=>{"use strict";var fu=mt(),Ur=15,lu=852,cu=592,uu=0,Ss=1,du=2,G1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],V1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],$1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],H1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];hu.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,T=0,_=0,v=0,M=0,L,I,R,N,p,m=null,b=0,y,w=new fu.Buf16(Ur+1),S=new fu.Buf16(Ur+1),P=null,E=0,C,F,A;for(c=0;c<=Ur;c++)w[c]=0;for(u=0;u<i;u++)w[r[n+u]]++;for(g=f,h=Ur;h>=1&&w[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&w[d]===0;d++);for(g<d&&(g=d),_=1,c=1;c<=Ur;c++)if(_<<=1,_-=w[c],_<0)return-1;if(_>0&&(t===uu||h!==1))return-1;for(S[1]=0,c=1;c<Ur;c++)S[c+1]=S[c]+w[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[S[r[n+u]]++]=u);if(t===uu?(m=P=s,y=19):t===Ss?(m=G1,b-=257,P=V1,E-=257,y=256):(m=$1,P=H1,y=-1),M=0,u=0,c=d,p=a,x=g,T=0,R=-1,v=1<<g,N=v-1,t===Ss&&v>lu||t===du&&v>cu)return 1;for(;;){C=c-T,s[u]<y?(F=0,A=s[u]):s[u]>y?(F=P[E+s[u]],A=m[b+s[u]]):(F=32+64,A=0),L=1<<c-T,I=1<<x,d=I;do I-=L,o[p+(M>>T)+I]=C<<24|F<<16|A|0;while(I!==0);for(L=1<<c-1;M&L;)L>>=1;if(L!==0?(M&=L-1,M+=L):M=0,u++,--w[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(M&N)!==R){for(T===0&&(T=g),p+=d,x=c-T,_=1<<x;x+T<h&&(_-=w[x+T],!(_<=0));)x++,_<<=1;if(v+=1<<x,t===Ss&&v>lu||t===du&&v>cu)return 1;R=M&N,o[R]=g<<24|x<<16|p-a|0}}return M!==0&&(o[p+M]=c-T<<24|64<<16|0),l.bits=g,0}});var Yu=X(Ge=>{"use strict";var Ce=mt(),Ms=ds(),st=hs(),Z1=su(),Ln=pu(),j1=0,Uu=1,qu=2,gu=4,W1=5,co=6,rr=0,Y1=1,K1=2,Ie=-2,Gu=-3,ks=-4,X1=-5,mu=8,Vu=1,bu=2,yu=3,xu=4,vu=5,wu=6,_u=7,Eu=8,Su=9,Tu=10,po=11,xt=12,Ts=13,Cu=14,Cs=15,Au=16,Pu=17,Fu=18,Mu=19,uo=20,ho=21,ku=22,Lu=23,Iu=24,Bu=25,Ou=26,As=27,Ru=28,Du=29,Q=30,Ls=31,Q1=32,J1=852,eb=592,tb=15,rb=tb;function Nu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function nb(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ce.Buf16(320),this.work=new Ce.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $u(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Vu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ce.Buf32(J1),t.distcode=t.distdyn=new Ce.Buf32(eb),t.sane=1,t.back=-1,rr)}function Hu(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,$u(e))}function Zu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Hu(e))}function ju(e,t){var r,n;return e?(n=new nb,e.state=n,n.window=null,r=Zu(e,t),r!==rr&&(e.state=null),r):Ie}function ib(e){return ju(e,rb)}var zu=!0,Ps,Fs;function ob(e){if(zu){var t;for(Ps=new Ce.Buf32(512),Fs=new Ce.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Uu,e.lens,0,288,Ps,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(qu,e.lens,0,32,Fs,0,e.work,{bits:5}),zu=!1}e.lencode=Ps,e.lenbits=9,e.distcode=Fs,e.distbits=5}function Wu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ce.Buf8(o.wsize)),n>=o.wsize?(Ce.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Ce.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Ce.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function ab(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,T=0,_,v,M,L,I,R,N,p,m=new Ce.Buf8(4),b,y,w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=Ts),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=rr;e:for(;;)switch(r.mode){case Vu:if(r.wrap===0){r.mode=Ts;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0),f=0,c=0,r.mode=bu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==mu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?Tu:xt,f=0,c=0;break;case bu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==mu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=yu;case yu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=st(r.check,m,4,0)),f=0,c=0,r.mode=xu;case xu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=vu;case vu:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=wu;case wu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ce.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=_u;case _u:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Eu;case Eu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=Su;case Su:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case Tu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=Nu(f),f=0,c=0,r.mode=po;case po:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,K1;e.adler=r.check=1,r.mode=xt;case xt:if(t===W1||t===co)break e;case Ts:if(r.last){f>>>=c&7,c-=c&7,r.mode=As;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=Cu;break;case 1:if(ob(r),r.mode=uo,t===co){f>>>=2,c-=2;break e}break;case 2:r.mode=Pu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case Cu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=Cs,t===co)break e;case Cs:r.mode=Au;case Au:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Ce.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case Pu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=Fu;case Fu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[w[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[w[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(j1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=Mu;case Mu:for(;r.have<r.nlen+r.ndist;){for(;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(M<16)f>>>=_,c-=_,r.lens[r.have++]=M;else{if(M===16){for(y=_+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=_,c-=_,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(M===17){for(y=_+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=_+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Uu,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(qu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=uo,t===co)break e;case uo:r.mode=ho;case ho:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,Z1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(v&&!(v&240)){for(L=_,I=v,R=M;T=r.lencode[R+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,r.length=M,v===0){r.mode=Ou;break}if(v&32){r.back=-1,r.mode=xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=v&15,r.mode=ku;case ku:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Lu;case Lu:for(;T=r.distcode[f&(1<<r.distbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(v&240)){for(L=_,I=v,R=M;T=r.distcode[R+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,v&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=M,r.extra=v&15,r.mode=Iu;case Iu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Bu;case Bu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=ho);break;case Ou:if(l===0)break e;i[a++]=r.length,l--,r.mode=ho;break;case As:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?st(r.check,i,d,a-d):Ms(r.check,i,d,a-d)),d=l,(r.flags?f:Nu(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Ru;case Ru:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Du;case Du:p=Y1;break e;case Q:p=Gu;break e;case Ls:return ks;case Q1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<As||t!==gu))&&Wu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Ls,ks):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?st(r.check,i,d,e.next_out-d):Ms(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===uo||r.mode===Cs?256:0),(u===0&&d===0||t===gu)&&p===rr&&(p=X1),p)}function sb(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,rr}function fb(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,rr)}function lb(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==po)?Ie:n.mode===po&&(i=1,i=Ms(i,t,r,0),i!==n.check)?Gu:(o=Wu(e,t,r,r),o?(n.mode=Ls,ks):(n.havedict=1,rr))}Ge.inflateReset=Hu;Ge.inflateReset2=Zu;Ge.inflateResetKeep=$u;Ge.inflateInit=ib;Ge.inflateInit2=ju;Ge.inflate=ab;Ge.inflateEnd=sb;Ge.inflateGetHeader=fb;Ge.inflateSetDictionary=lb;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Is=X((e7,Ku)=>{"use strict";Ku.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Qu=X((t7,Xu)=>{"use strict";function cb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Xu.exports=cb});var ed=X(Bn=>{"use strict";var qr=Yu(),In=mt(),go=ys(),oe=Is(),Bs=to(),ub=xs(),db=Qu(),Ju=Object.prototype.toString;function nr(e){if(!(this instanceof nr))return new nr(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ub,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(Bs[r]);if(this.header=new db,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=go.string2buf(t.dictionary):Ju.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(Bs[r])}nr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=go.binstring2buf(e):Ju.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=go.utf8border(r.output,r.next_out),l=r.next_out-s,f=go.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};nr.prototype.onData=function(e){this.chunks.push(e)};nr.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Os(e,t){var r=new nr(t);if(r.push(e,!0),r.err)throw r.msg||Bs[r.err];return r.result}function hb(e,t){return t=t||{},t.raw=!0,Os(e,t)}Bn.Inflate=nr;Bn.inflate=Os;Bn.inflateRaw=hb;Bn.ungzip=Os});var nd=X((n7,rd)=>{"use strict";var pb=mt().assign,gb=ou(),mb=ed(),bb=Is(),td={};pb(td,gb,mb,bb);rd.exports=td});var id=X(()=>{});var od=X(Rs=>{Rs.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Rs.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var ud=X((w7,cd)=>{"use strict";cd.exports=W;var bo=od();function W(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}W.Varint=0;W.Fixed64=1;W.Bytes=2;W.Fixed32=5;var Ds=(1<<16)*(1<<16),ad=1/Ds,yb=12,ld=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");W.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=yo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=fd(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=yo(this.buf,this.pos)+yo(this.buf,this.pos+4)*Ds;return this.pos+=8,e},readSFixed64:function(){var e=yo(this.buf,this.pos)+fd(this.buf,this.pos+4)*Ds;return this.pos+=8,e},readFloat:function(){var e=bo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=bo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,xb(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=yb&&ld?Ib(this.buf,t,e):Lb(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==W.Bytes)return e.push(this.readVarint(t));var r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==W.Bytes)return e.push(this.readSVarint());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==W.Bytes)return e.push(this.readBoolean());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==W.Bytes)return e.push(this.readFloat());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==W.Bytes)return e.push(this.readDouble());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===W.Varint)for(;this.buf[this.pos++]>127;);else if(t===W.Bytes)this.pos=this.readVarint()+this.pos;else if(t===W.Fixed32)this.pos+=4;else if(t===W.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*ad),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*ad),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){vb(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=Bb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&sd(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),bo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),bo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&sd(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,W.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Eb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Ab,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Cb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Pb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Fb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Mb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,kb,t)},writeBytesField:function(e,t){this.writeTag(e,W.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,W.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,W.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,W.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function xb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===W.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function vb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),wb(r,n,t),_b(n,t)}function wb(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function _b(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function sd(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Eb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Cb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Pb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Fb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Mb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function kb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function yo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Hr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function fd(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Lb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function Ib(e,t,r){return ld.decode(e.subarray(t,r))}function Bb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var th=X((O4,Hs)=>{"use strict";Hs.exports=Ro;Hs.exports.default=Ro;function Ro(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=Qd(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=gy(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function Qd(e,t,r,n,i){var o,a;if(i===$s(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Xd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Xd(o,e[o],e[o+1],a);return a&&Do(a,a.next)&&(ci(a),a=a.next),a}function cr(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Do(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&vy(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?dy(e,n,i,o):uy(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=hy(cr(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&py(e,t,r,n,i,o):fi(cr(e),t,r,n,i,o,1);break}}}}function uy(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Wr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function dy(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,T=c>u?c>d?c:d:u>d?u:d,_=Gs(h,g,t,r,n),v=Gs(x,T,t,r,n),M=e.prevZ,L=e.nextZ;M&&M.z>=_&&L&&L.z<=v;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Wr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0||(M=M.prevZ,L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Wr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;M&&M.z>=_;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Wr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;L&&L.z<=v;){if(L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Wr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function hy(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Do(i,o)&&Jd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return cr(n)}function py(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ey(a,s)){var l=eh(a,s);a=cr(a,a.next),l=cr(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function gy(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=Qd(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(_y(f));for(i.sort(my),o=0;o<i.length;o++)r=by(i[o],r);return r}function my(e,t){return e.x-t.x}function by(e,t){var r=yy(e,t);if(!r)return t;var n=eh(r,e);return cr(n,n.next),cr(r,r.next)}function yy(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Wr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&xy(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function xy(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function vy(e,t,r,n){var i=e;do i.z===0&&(i.z=Gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,wy(i)}function wy(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Gs(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function _y(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Wr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function Ey(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Sy(e,t)&&(li(e,t)&&li(t,e)&&Ty(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Do(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Do(e,t){return e.x===t.x&&e.y===t.y}function Jd(e,t,r,n){var i=Oo(ee(e,t,r)),o=Oo(ee(e,t,n)),a=Oo(ee(r,n,e)),s=Oo(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Bo(e,r,t)||o===0&&Bo(e,n,t)||a===0&&Bo(r,e,n)||s===0&&Bo(r,t,n))}function Bo(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Oo(e){return e>0?1:e<0?-1:0}function Sy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Jd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function Ty(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function eh(e,t){var r=new Vs(e.i,e.x,e.y),n=new Vs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Xd(e,t,r,n){var i=new Vs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Vs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ro.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs($s(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs($s(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function $s(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Ro.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var fh=X((U4,sh)=>{sh.exports=globalThis.deck});var Ar={};Ha(Ar,{carto:()=>n3});var Ga={};Ha(Ga,{BASEMAP:()=>vg,CARTO_LAYERS:()=>r3,CARTO_SOURCES:()=>Jp,CartoAPIError:()=>Tr,ClusterTileLayer:()=>jn,H3TileLayer:()=>fr,HeatmapTileLayer:()=>ei,LayerFactory:()=>vl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>lr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Bi,VectorTileLayer:()=>Kr,_GOOGLE_BASEMAPS:()=>za,_QuadbinLayer:()=>So,_RasterLayer:()=>Lo,_STYLE_LAYER_GROUPS:()=>gl,_SpatialIndexTileLayer:()=>Zr,_applyLayerGroupFilters:()=>Ua,_fetchStyle:()=>qa,_getStyleUrl:()=>Qe,boundaryQuerySource:()=>il,boundaryTableSource:()=>ol,colorBins:()=>bl,colorCategories:()=>yl,colorContinuous:()=>xl,fetchBasemapProps:()=>Tg,fetchMap:()=>Eg,h3QuerySource:()=>Aa,h3TableSource:()=>Pa,h3TilesetSource:()=>fl,quadbinQuerySource:()=>Ma,quadbinTableSource:()=>ka,quadbinTilesetSource:()=>ll,query:()=>eg,rasterSource:()=>La,vectorQuerySource:()=>Ia,vectorTableSource:()=>Ba,vectorTilesetSource:()=>Oa});var wd=q(Mt(),1),_d=q(gt(),1),Ed=q(pn(),1);function Tl(e,t,r){switch(e.type){case"Point":return Bg(e,t,r);case"LineString":return Ig(e,t,r);case"Polygon":return Cl(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=Vi(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=Cl(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function Ig(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:Vi(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=Vi(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function Bg(e,t,r){let{positions:n}=e,i=Vi(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Vi(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}function Hi(e,t){let r=t?.globalFeatureId;return r!==void 0?Og(e,r):Rg(e,t?.type)}function Og(e,t){let r=Al(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return $i(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return $i(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function Rg(e,t){let r=Al(e,t);return Dg(r)}function Al(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function Dg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push($i(r,n,o)),n=o,i=a)}t.push($i(r,n,r.featureIds.value.length))}return t}function $i(e,t,r){let n=Tl(e,t,r),i=zg(e,t,r),o=Ng(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function Ng(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function zg(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}var Vn=q(Se(),1);var gm=q(Gl(),1);var Wt=Math.PI,rm=Wt/4,v3=Wt/180,Vl=180/Wt,$l=512;function Te(e){let[t,r]=e,n=t/$l*(2*Wt)-Wt,i=2*(Math.atan(Math.exp(r/$l*(2*Wt)-Wt))-rm);return[n*Vl,i*Vl]}var P3=Math.PI/180;var jl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Wl=[0n,1n,2n,4n,8n,16n];function Yl(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function Kl(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Wl[5-o],s=jl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function ji(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Wl[s],f=jl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function mn(e){return e>>52n&0x1fn}function Wi(e){let t=mn(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}var Ki=q(Yt(),1),ec=q(Se(),1);var Ql=q(Se(),1);function Me(e,t){Ql.log.assert(e,t)}function Jl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function kt(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Ka={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Yi(){return{shape:"binary-feature-collection",points:{type:"Point",...Ka},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Ka},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Ka}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function Xa(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Qa(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function tc(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let T=0;T<r-1;T++)if(a==="h3"){let _=(0,Ki.getResolution)(c);c=(0,Ki.cellToParent)(c,Math.max(0,_-1))}else c=Wi(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:T,aggregation:_}of n)_==="any"?l[d][T]=f.properties[T]:l[d][T]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:T,aggregation:_}of n){let v=l[d][T],M=f.properties[T];_==="average"?l[d][T]=(h*v+x*M)/g:_==="count"||_==="sum"?l[d][T]=v+M:_==="max"?l[d][T]=Math.max(v,M):_==="min"&&(l[d][T]=Math.min(v,M))}}return t.set(r,Object.values(l)),!0}function rc(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(ec.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function nc(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function ic(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Yi(),points:yn(t,r,r,{},e)}}var oc=q(gt(),1);var tt=class extends oc._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(Kl).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(ji(t))}getTileZoom({q:t}){return Number(mn(t))}getParentIndex({q:t}){return{q:Wi(t)}}};var sc=q(gt(),1),ie=q(Yt(),1),ac=85.051128;function fc({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,ac),east:r+c,south:Math.max(n-f,-ac),west:e-c}}function lc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(lc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function mm(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return fc({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var bm=2;function Fr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-bm))}var Lt=class extends sc._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Fr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=fc({west:i,north:s,east:a,south:o},f);c=lc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:mm(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var cc=512;function Ja(e){let{x:t,y:r,z:n}=ji(e),i=cc/(1<<n);return[t*i,cc-r*i,i]}function ym(e,t){let[r,n,i]=Ja(e);return[[r,n],[r+t*i,n-t*i]]}function Xi(e,t=1){let[r,n]=ym(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}var vo=q(Yt(),1);var rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},xm=rt.self||rt.window||rt.global||{},vm=rt.window||rt.self||rt.global||{},wm=rt.global||rt.self||rt.window||{},_m=rt.document||{};var Mr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Em=uc&&parseFloat(uc[1])||0;var dc=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer;function es(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function hc(...e){return Sm(e)}function Sm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function ts(e){let t=[];for await(let r of e)t.push(Tm(r));return hc(...t)}function Tm(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return pc(t,r,n)}return pc(e)}function pc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function gc(e){return e&&typeof e=="object"&&e.isBuffer}function It(e){if(gc(e))return e;if(e instanceof ArrayBuffer)return e;if(dc(e))return mc(e);if(ArrayBuffer.isView(e)){let t=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function mc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function kr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Qi=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){es(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return ts(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var ir=q(nd(),1),vt=q(id(),1),mo=class extends Qi{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Mr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await kr(vt.default.gzip)(t):await kr(vt.default.deflate)(t);return It(r)}return this.compressSync(t)}async decompress(t){if(!Mr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await kr(vt.default.gunzip)(t):await kr(vt.default.inflate)(t);return It(r)}return this.decompressSync(t)}compressSync(t){if(!Mr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?ir.default.deflateRaw:ir.default.deflate;return It(i(n,r).buffer)}decompressSync(t){if(!Mr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?ir.default.inflateRaw:ir.default.inflate;return It(i(n,r).buffer)}async*compressBatches(t){let r=this.options?.deflate||{},n=new ir.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new ir.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var On=class extends mo{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function or(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new On().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Rn=class{static read(t,r){return t.readFields(Rn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Rn.read(n,n.readVarint()+n.pos);r[i]=o}}},ar=class{static read(t,r){let{value:n,size:i}=t.readFields(ar._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?or(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},sr=class{static read(t,r){return t.readFields(sr._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&or(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&or(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var dd=q(ud(),1);function Ut(e,t){let r=new dd.default(e);return t.read(r)}function hd(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var gd="9.3.0-alpha.5",md="cartoSpatialTile",Ob={cartoSpatialTile:{scheme:"quadbin",workerUrl:kt(md,gd)}},Rb={name:"CARTO Spatial Tile",version:gd,id:md,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>pd(e,t),parseSync:pd,worker:!0,options:Ob};function pd(e,t){if(!e)return null;let r=Ut(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return hd({cells:n,scheme:i})}var xo=Rb;var bd=q(Se(),1),yd=q(Se(),1);function He(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=He(e[i],o,r+1):n[i]=o)}return n}function xd(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?bd.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],T=a.value[g];d.fill(c[T],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ae={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,yd._deepEqual)(e,t,2),async:!0};(0,Ed.registerLoaders)([xo]);function vd(e){if(e===Lt)return"h3";if(e===tt)return"quadbin";throw new Error("Invalid tileset class")}var Sd={data:Ae,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,vo.cellToLatLng)(e);return[r,t]}return Xi(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends _d.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=vd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=vd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=rc(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=tc(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=nc(l,s),g=ic(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(_=>_.id),T=g?.points?.properties?.map(_=>_.id);return(0,Vn._deepEqual)(x,T,1)}};return new wd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=Hi(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,vo.getResolution)(n.id),o=Fr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=Sd;var Hn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:tt;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Hn.layerName="ClusterTileLayer";Hn.defaultProps=Sd;var jn=Hn;var Ad=q(Se(),1),Ns=q(gt(),1);var Td=q(pn(),1);var Cd=q(gt(),1);(0,Td.registerLoaders)([xo]);function Db(e){return e!=null&&e!==""}var Nb={tileSize:512},Wn=class extends Cd.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!Db(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Wn.layerName="SpatialIndexTileLayer";Wn.defaultProps=Nb;var Zr=Wn;var zb=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Ns.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Ub={data:Ae,tileSize:512},Yn=class extends Ad.CompositeLayer{initializeState(){Ns.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Fr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Fr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Zr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:zb,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Yn.layerName="H3TileLayer";Yn.defaultProps=Ub;var fr=Yn;var Co=q(Yt(),1),Ao=q(Se(),1),kd=q(Mt(),1);var qb=`layout(std140) uniform heatmapUniforms {
7
+ "use strict";var __exports__=(()=>{var Ag=Object.create;var Gi=Object.defineProperty;var Pg=Object.getOwnPropertyDescriptor;var Fg=Object.getOwnPropertyNames;var Mg=Object.getPrototypeOf,kg=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ha=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fg(t))!kg.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=Pg(t,i))||n.enumerable});return e},et=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),q=(e,t,r)=>(r=e!=null?Ag(Mg(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),Lg=e=>qi(Gi({},"__esModule",{value:!0}),e);var Mt=X((o3,_l)=>{_l.exports=globalThis.deck});var gt=X((a3,El)=>{El.exports=globalThis.deck});var pn=X((s3,Sl)=>{Sl.exports=globalThis.loaders});var Se=X((h3,Pl)=>{Pl.exports=globalThis.deck});var zl=X((p3,Nl)=>{var Ug=Math.PI/180,qg=180/Math.PI;function kl(e){var t=Fl(e[0]+1,e[2]),r=Fl(e[0],e[2]),n=Ml(e[1]+1,e[2]),i=Ml(e[1],e[2]);return[r,n,t,i]}function Gg(e){var t=kl(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function Fl(e,t){return e/Math.pow(2,t)*360-180}function Ml(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return qg*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Za(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Bl(e){return Ll(Il(e))}function Vg(e,t){for(var r=Bl(e),n=0;n<r.length;n++)if(!Ol(t,r[n]))return!1;return!0}function Ol(e,t){for(var r=0;r<e.length;r++)if(Rl(e[r],t))return!0;return!1}function Rl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function $g(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Hg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Zg(e){var t=Za(e[0],e[1],32),r=Za(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=jg(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function jg(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Ug),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}Nl.exports={tileToGeoJSON:Gg,tileToBBOX:kl,getChildren:Ll,getParent:Il,getSiblings:Bl,hasTile:Ol,hasSiblings:Vg,tilesEqual:Rl,tileToQuadkey:$g,quadkeyToTile:Hg,pointToTile:Za,bboxToTile:Zg,pointToTileFraction:Dl}});var Gl=X(Zi=>{var Pr=zl();Zi.geojson=function(e,t){return{type:"FeatureCollection",features:Wa(e,t).map(Wg)}};function Wg(e){return{type:"Feature",geometry:Pr.tileToGeoJSON(e),properties:{}}}Zi.tiles=Wa;Zi.indexes=function(e,t){return Wa(e,t).map(Pr.tileToQuadkey)};function Wa(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Pr.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Pr.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")ja(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)ja(a,i[r],o);else if(e.type==="Polygon")Ul(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Ul(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ql(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return Yg(a,s,t)}return ql(a,s),s}function Yg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Ul(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];ja(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Kg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function Kg(e,t){return e[1]-t[1]||e[0]-t[0]}function ja(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Pr.pointToTileFraction(t[a][0],t[a][1],r),l=Pr.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),R=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=R,v+=T),e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ql(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Xg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Xg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}});var Yt=X((s5,Xl)=>{Xl.exports=globalThis.h3||{}});var mt=X(pe=>{"use strict";var Cm=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Am(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Am(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Pm={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},Fm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,Pm)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,Fm))};pe.setTyped(Cm)});var zc=X(Br=>{"use strict";var Mm=mt(),km=4,bc=0,yc=1,Lm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var Im=0,Sc=1,Bm=2,Om=3,Rm=258,fs=29,Sn=256,vn=Sn+1+fs,Lr=30,ls=19,Tc=2*vn+1,Kt=15,rs=16,Dm=7,cs=256,Cc=16,Ac=17,Pc=18,as=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ji=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Nm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Fc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],zm=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(zm);Ir(wn);var _n=new Array(Rm-Om+1);Ir(_n);var us=new Array(fs);Ir(us);var eo=new Array(Lr);Ir(eo);function ns(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Mc,kc,Lc;function is(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ic(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>rs-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>rs-e.bi_valid,e.bi_valid+=r-rs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function nt(e,t,r){be(e,r[t*2],r[t*2+1])}function Bc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Um(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function qm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Kt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<Tc;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Oc(e,t,r){var n=new Array(Kt+1),i=0,o,a;for(o=1;o<=Kt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Bc(n[s]++,s))}}function Gm(){var e,t,r,n,i,o=new Array(Kt+1);for(r=0,n=0;n<fs-1;n++)for(us[n]=r,e=0;e<1<<as[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(eo[n]=i,e=0;e<1<<Ji[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(eo[n]=i<<7,e=0;e<1<<Ji[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Kt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Oc(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Bc(e,5);Mc=new ns(bt,as,Sn+1,vn,Kt),kc=new ns(xn,Ji,0,Lr,Kt),Lc=new ns(new Array(0),Nm,0,ls,Dm)}function Rc(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ls;t++)e.bl_tree[t*2]=0;e.dyn_ltree[cs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Dc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Vm(e,t,r,n){Dc(e),n&&(En(e,r),En(e,~r)),Mm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function xc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function os(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&xc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!xc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function vc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?nt(e,i,t):(a=_n[i],nt(e,a+Sn+1,t),s=as[a],s!==0&&(i-=us[a],be(e,i,s)),n--,a=Ic(n),nt(e,a,r),s=Ji[a],s!==0&&(n-=eo[a],be(e,n,s)));while(o<e.last_lit);nt(e,cs,t)}function ss(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=Tc,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)os(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],os(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,os(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qm(e,t),Oc(r,l,e.bl_count)}function wc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[Cc*2]++):s<=10?e.bl_tree[Ac*2]++:e.bl_tree[Pc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function _c(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do nt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(nt(e,o,e.bl_tree),s--),nt(e,Cc,e.bl_tree),be(e,s-3,2)):s<=10?(nt(e,Ac,e.bl_tree),be(e,s-3,3)):(nt(e,Pc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function $m(e){var t;for(wc(e,e.dyn_ltree,e.l_desc.max_code),wc(e,e.dyn_dtree,e.d_desc.max_code),ss(e,e.bl_desc),t=ls-1;t>=3&&e.bl_tree[Fc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Hm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[Fc[i]*2+1],3);_c(e,e.dyn_ltree,t-1),_c(e,e.dyn_dtree,r-1)}function Zm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return bc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return yc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return yc;return bc}var Ec=!1;function jm(e){Ec||(Gm(),Ec=!0),e.l_desc=new is(e.dyn_ltree,Mc),e.d_desc=new is(e.dyn_dtree,kc),e.bl_desc=new is(e.bl_tree,Lc),e.bi_buf=0,e.bi_valid=0,Rc(e)}function Nc(e,t,r,n){be(e,(Im<<1)+(n?1:0),3),Vm(e,t,r,!0)}function Wm(e){be(e,Sc<<1,3),nt(e,cs,bt),Um(e)}function Ym(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Lm&&(e.strm.data_type=Zm(e)),ss(e,e.l_desc),ss(e,e.d_desc),a=$m(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?Nc(e,t,r,n):e.strategy===km||o===i?(be(e,(Sc<<1)+(n?1:0),3),vc(e,bt,xn)):(be(e,(Bm<<1)+(n?1:0),3),Hm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),vc(e,e.dyn_ltree,e.dyn_dtree)),Rc(e),n&&Dc(e)}function Km(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Ic(t)*2]++),e.last_lit===e.lit_bufsize-1}Br._tr_init=jm;Br._tr_stored_block=Nc;Br._tr_flush_block=Ym;Br._tr_tally=Km;Br._tr_align=Wm});var ds=X(($5,Uc)=>{"use strict";function Xm(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Uc.exports=Xm});var hs=X((H5,qc)=>{"use strict";function Qm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Jm=Qm();function e1(e,t,r,n){var i=Jm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}qc.exports=e1});var to=X((Z5,Gc)=>{"use strict";Gc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Xc=X(at=>{"use strict";var ge=mt(),ke=zc(),Zc=ds(),Bt=hs(),t1=to(),er=0,r1=1,n1=3,zt=4,Vc=5,ot=0,$c=1,Le=-2,i1=-3,ps=-5,o1=-1,a1=1,ro=2,s1=3,f1=4,l1=0,c1=2,ao=8,u1=9,d1=15,h1=8,p1=29,g1=256,ms=g1+1+p1,m1=30,b1=19,y1=2*ms+1,x1=15,$=3,Dt=258,qe=Dt+$+1,v1=32,so=42,bs=69,no=73,io=91,oo=103,Xt=113,Cn=666,se=1,An=2,Qt=3,Dr=4,w1=3;function Nt(e,t){return e.msg=t1[t],t}function Hc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Ot(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){ke._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ot(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Zc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Bt(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function jc(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Dt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Dt-(d-n),n=d-Dt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Jt(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=_1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function E1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Jt(e),e.lookahead===0&&t===er)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function gs(e,t){for(var r,n;;){if(e.lookahead<qe){if(Jt(e),e.lookahead<qe&&t===er)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=jc(e,r)),e.match_length>=$)if(n=ke._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Or(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(Jt(e),e.lookahead<qe&&t===er)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=jc(e,r),e.match_length<=5&&(e.strategy===a1||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=ke._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=ke._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=ke._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function S1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Dt){if(Jt(e),e.lookahead<=Dt&&t===er)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Dt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Dt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=ke._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function T1(e,t){for(var r;;){if(e.lookahead===0&&(Jt(e),e.lookahead===0)){if(t===er)return se;break}if(e.match_length=0,r=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Qt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function it(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Rr;Rr=[new it(0,0,0,0,E1),new it(4,4,8,4,gs),new it(4,5,16,8,gs),new it(4,6,32,32,gs),new it(4,4,16,16,Or),new it(8,16,32,32,Or),new it(8,16,128,128,Or),new it(8,32,128,256,Or),new it(32,128,258,1024,Or),new it(32,258,258,4096,Or)];function C1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Rr[e.level].max_lazy,e.good_match=Rr[e.level].good_length,e.nice_match=Rr[e.level].nice_length,e.max_chain_length=Rr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function A1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ao,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(y1*2),this.dyn_dtree=new ge.Buf16((2*m1+1)*2),this.bl_tree=new ge.Buf16((2*b1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(x1+1),this.heap=new ge.Buf16(2*ms+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*ms+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Wc(e){var t;return!e||!e.state?Nt(e,Le):(e.total_in=e.total_out=0,e.data_type=c1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?so:Xt,e.adler=t.wrap===2?0:1,t.last_flush=er,ke._tr_init(t),ot)}function Yc(e){var t=Wc(e);return t===ot&&C1(e.state),t}function P1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,ot)}function Kc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===o1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>u1||r!==ao||n<8||n>15||t<0||t>9||o<0||o>f1)return Nt(e,Le);n===8&&(n=9);var s=new A1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Yc(e)}function F1(e,t){return Kc(e,t,ao,d1,h1,l1)}function M1(e,t){var r,n,i,o;if(!e||!e.state||t>Vc||t<0)return e?Nt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==zt)return Nt(e,e.avail_out===0?ps:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===so)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=ro||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Bt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=bs):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=ro||n.level<2?4:0),j(n,w1),n.status=Xt);else{var a=ao+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=ro||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=v1),a+=31-a%31,n.status=Xt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===bs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=io)}else n.status=io;if(n.status===io)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=oo)}else n.status=oo;if(n.status===oo&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ot(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Xt)):n.status=Xt),n.pending!==0){if(Ot(e),e.avail_out===0)return n.last_flush=-1,ot}else if(e.avail_in===0&&Hc(t)<=Hc(r)&&t!==zt)return Nt(e,ps);if(n.status===Cn&&e.avail_in!==0)return Nt(e,ps);if(e.avail_in!==0||n.lookahead!==0||t!==er&&n.status!==Cn){var l=n.strategy===ro?T1(n,t):n.strategy===s1?S1(n,t):Rr[n.level].func(n,t);if((l===Qt||l===Dr)&&(n.status=Cn),l===se||l===Qt)return e.avail_out===0&&(n.last_flush=-1),ot;if(l===An&&(t===r1?ke._tr_align(n):t!==Vc&&(ke._tr_stored_block(n,0,0,!1),t===n1&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ot(e),e.avail_out===0))return n.last_flush=-1,ot}return t!==zt?ot:n.wrap<=0?$c:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Ot(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ot:$c)}function k1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==so&&t!==bs&&t!==no&&t!==io&&t!==oo&&t!==Xt&&t!==Cn?Nt(e,Le):(e.state=null,t===Xt?Nt(e,i1):ot))}function L1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==so||n.lookahead))return Le;for(a===1&&(e.adler=Zc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,Jt(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,Jt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,ot}at.deflateInit=F1;at.deflateInit2=Kc;at.deflateReset=Yc;at.deflateResetKeep=Wc;at.deflateSetHeader=P1;at.deflate=M1;at.deflateEnd=k1;at.deflateSetDictionary=L1;at.deflateInfo="pako deflate (from Nodeca project)"});var ys=X(Nr=>{"use strict";var fo=mt(),Qc=!0,Jc=!0;try{String.fromCharCode.apply(null,[0])}catch{Qc=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Jc=!1}var Pn=new fo.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new fo.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function eu(e,t){if(t<65534&&(e.subarray&&Jc||!e.subarray&&Qc))return String.fromCharCode.apply(null,fo.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return eu(e,e.length)};Nr.binstring2buf=function(e){for(var t=new fo.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return eu(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var xs=X((Y5,tu)=>{"use strict";function I1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}tu.exports=I1});var ou=X(kn=>{"use strict";var Fn=Xc(),Mn=mt(),ws=ys(),_s=to(),B1=xs(),iu=Object.prototype.toString,O1=0,vs=4,zr=0,ru=1,nu=2,R1=-1,D1=0,N1=8;function tr(e){if(!(this instanceof tr))return new tr(e);this.options=Mn.assign({level:R1,method:N1,chunkSize:16384,windowBits:15,memLevel:8,strategy:D1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new B1,this.strm.avail_out=0;var r=Fn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(_s[r]);if(t.header&&Fn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=ws.string2buf(t.dictionary):iu.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Fn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(_s[r]);this._dict_set=!0}}tr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?vs:O1,typeof e=="string"?r.input=ws.string2buf(e):iu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Mn.Buf8(n),r.next_out=0,r.avail_out=n),i=Fn.deflate(r,o),i!==ru&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===vs||o===nu))&&(this.options.to==="string"?this.onData(ws.buf2binstring(Mn.shrinkBuf(r.output,r.next_out))):this.onData(Mn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==ru);return o===vs?(i=Fn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===nu&&(this.onEnd(zr),r.avail_out=0),!0)};tr.prototype.onData=function(e){this.chunks.push(e)};tr.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Es(e,t){var r=new tr(t);if(r.push(e,!0),r.err)throw r.msg||_s[r.err];return r.result}function z1(e,t){return t=t||{},t.raw=!0,Es(e,t)}function U1(e,t){return t=t||{},t.gzip=!0,Es(e,t)}kn.Deflate=tr;kn.deflate=Es;kn.deflateRaw=z1;kn.gzip=U1});var su=X((X5,au)=>{"use strict";var lo=30,q1=12;au.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,R,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,T=n.lencode,_=n.distcode,v=(1<<n.lenbits)-1,M=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=T[g&v];t:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I===0)y[a++]=L&65535;else if(I&16){R=L&65535,I&=15,I&&(x<I&&(g+=b[i++]<<x,x+=8),R+=g&(1<<I)-1,g>>>=I,x-=I),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=_[g&M];r:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I&16){if(N=L&65535,I&=15,x<I&&(g+=b[i++]<<x,x+=8,x<I&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<I)-1,N>f){t.msg="invalid distance too far back",n.mode=lo;break e}if(g>>>=I,x-=I,I=a-s,N>I){if(I=N-I,I>u&&n.sane){t.msg="invalid distance too far back",n.mode=lo;break e}if(p=0,m=h,d===0){if(p+=c-I,I<R){R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}else if(d<I){if(p+=c+d-I,I-=d,I<R){R-=I;do y[a++]=h[p++];while(--I);if(p=0,d<R){I=d,R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}}else if(p+=d-I,I<R){R-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}for(;R>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],R-=3;R&&(y[a++]=m[p++],R>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],R-=3;while(R>2);R&&(y[a++]=y[p++],R>1&&(y[a++]=y[p++]))}}else if(I&64){t.msg="invalid distance code",n.mode=lo;break e}else{L=_[(L&65535)+(g&(1<<I)-1)];continue r}break}}else if(I&64)if(I&32){n.mode=q1;break e}else{t.msg="invalid literal/length code",n.mode=lo;break e}else{L=T[(L&65535)+(g&(1<<I)-1)];continue t}break}}while(i<o&&a<l);R=x>>3,i-=R,x-=R<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var pu=X((Q5,hu)=>{"use strict";var fu=mt(),Ur=15,lu=852,cu=592,uu=0,Ss=1,du=2,G1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],V1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],$1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],H1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];hu.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,T=0,_=0,v=0,M=0,L,I,R,N,p,m=null,b=0,y,w=new fu.Buf16(Ur+1),S=new fu.Buf16(Ur+1),P=null,E=0,C,F,A;for(c=0;c<=Ur;c++)w[c]=0;for(u=0;u<i;u++)w[r[n+u]]++;for(g=f,h=Ur;h>=1&&w[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&w[d]===0;d++);for(g<d&&(g=d),_=1,c=1;c<=Ur;c++)if(_<<=1,_-=w[c],_<0)return-1;if(_>0&&(t===uu||h!==1))return-1;for(S[1]=0,c=1;c<Ur;c++)S[c+1]=S[c]+w[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[S[r[n+u]]++]=u);if(t===uu?(m=P=s,y=19):t===Ss?(m=G1,b-=257,P=V1,E-=257,y=256):(m=$1,P=H1,y=-1),M=0,u=0,c=d,p=a,x=g,T=0,R=-1,v=1<<g,N=v-1,t===Ss&&v>lu||t===du&&v>cu)return 1;for(;;){C=c-T,s[u]<y?(F=0,A=s[u]):s[u]>y?(F=P[E+s[u]],A=m[b+s[u]]):(F=32+64,A=0),L=1<<c-T,I=1<<x,d=I;do I-=L,o[p+(M>>T)+I]=C<<24|F<<16|A|0;while(I!==0);for(L=1<<c-1;M&L;)L>>=1;if(L!==0?(M&=L-1,M+=L):M=0,u++,--w[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(M&N)!==R){for(T===0&&(T=g),p+=d,x=c-T,_=1<<x;x+T<h&&(_-=w[x+T],!(_<=0));)x++,_<<=1;if(v+=1<<x,t===Ss&&v>lu||t===du&&v>cu)return 1;R=M&N,o[R]=g<<24|x<<16|p-a|0}}return M!==0&&(o[p+M]=c-T<<24|64<<16|0),l.bits=g,0}});var Yu=X(Ge=>{"use strict";var Ce=mt(),Ms=ds(),st=hs(),Z1=su(),Ln=pu(),j1=0,Uu=1,qu=2,gu=4,W1=5,co=6,rr=0,Y1=1,K1=2,Ie=-2,Gu=-3,ks=-4,X1=-5,mu=8,Vu=1,bu=2,yu=3,xu=4,vu=5,wu=6,_u=7,Eu=8,Su=9,Tu=10,po=11,xt=12,Ts=13,Cu=14,Cs=15,Au=16,Pu=17,Fu=18,Mu=19,uo=20,ho=21,ku=22,Lu=23,Iu=24,Bu=25,Ou=26,As=27,Ru=28,Du=29,Q=30,Ls=31,Q1=32,J1=852,eb=592,tb=15,rb=tb;function Nu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function nb(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ce.Buf16(320),this.work=new Ce.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $u(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Vu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ce.Buf32(J1),t.distcode=t.distdyn=new Ce.Buf32(eb),t.sane=1,t.back=-1,rr)}function Hu(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,$u(e))}function Zu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Hu(e))}function ju(e,t){var r,n;return e?(n=new nb,e.state=n,n.window=null,r=Zu(e,t),r!==rr&&(e.state=null),r):Ie}function ib(e){return ju(e,rb)}var zu=!0,Ps,Fs;function ob(e){if(zu){var t;for(Ps=new Ce.Buf32(512),Fs=new Ce.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Uu,e.lens,0,288,Ps,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(qu,e.lens,0,32,Fs,0,e.work,{bits:5}),zu=!1}e.lencode=Ps,e.lenbits=9,e.distcode=Fs,e.distbits=5}function Wu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ce.Buf8(o.wsize)),n>=o.wsize?(Ce.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Ce.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Ce.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function ab(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,T=0,_,v,M,L,I,R,N,p,m=new Ce.Buf8(4),b,y,w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=Ts),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=rr;e:for(;;)switch(r.mode){case Vu:if(r.wrap===0){r.mode=Ts;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0),f=0,c=0,r.mode=bu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==mu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?Tu:xt,f=0,c=0;break;case bu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==mu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=yu;case yu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=st(r.check,m,4,0)),f=0,c=0,r.mode=xu;case xu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=vu;case vu:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=wu;case wu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ce.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=_u;case _u:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Eu;case Eu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=Su;case Su:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case Tu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=Nu(f),f=0,c=0,r.mode=po;case po:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,K1;e.adler=r.check=1,r.mode=xt;case xt:if(t===W1||t===co)break e;case Ts:if(r.last){f>>>=c&7,c-=c&7,r.mode=As;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=Cu;break;case 1:if(ob(r),r.mode=uo,t===co){f>>>=2,c-=2;break e}break;case 2:r.mode=Pu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case Cu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=Cs,t===co)break e;case Cs:r.mode=Au;case Au:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Ce.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case Pu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=Fu;case Fu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[w[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[w[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(j1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=Mu;case Mu:for(;r.have<r.nlen+r.ndist;){for(;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(M<16)f>>>=_,c-=_,r.lens[r.have++]=M;else{if(M===16){for(y=_+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=_,c-=_,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(M===17){for(y=_+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=_+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Uu,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(qu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=uo,t===co)break e;case uo:r.mode=ho;case ho:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,Z1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(v&&!(v&240)){for(L=_,I=v,R=M;T=r.lencode[R+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,r.length=M,v===0){r.mode=Ou;break}if(v&32){r.back=-1,r.mode=xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=v&15,r.mode=ku;case ku:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Lu;case Lu:for(;T=r.distcode[f&(1<<r.distbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(v&240)){for(L=_,I=v,R=M;T=r.distcode[R+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,v&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=M,r.extra=v&15,r.mode=Iu;case Iu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Bu;case Bu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=ho);break;case Ou:if(l===0)break e;i[a++]=r.length,l--,r.mode=ho;break;case As:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?st(r.check,i,d,a-d):Ms(r.check,i,d,a-d)),d=l,(r.flags?f:Nu(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Ru;case Ru:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Du;case Du:p=Y1;break e;case Q:p=Gu;break e;case Ls:return ks;case Q1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<As||t!==gu))&&Wu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Ls,ks):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?st(r.check,i,d,e.next_out-d):Ms(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===uo||r.mode===Cs?256:0),(u===0&&d===0||t===gu)&&p===rr&&(p=X1),p)}function sb(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,rr}function fb(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,rr)}function lb(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==po)?Ie:n.mode===po&&(i=1,i=Ms(i,t,r,0),i!==n.check)?Gu:(o=Wu(e,t,r,r),o?(n.mode=Ls,ks):(n.havedict=1,rr))}Ge.inflateReset=Hu;Ge.inflateReset2=Zu;Ge.inflateResetKeep=$u;Ge.inflateInit=ib;Ge.inflateInit2=ju;Ge.inflate=ab;Ge.inflateEnd=sb;Ge.inflateGetHeader=fb;Ge.inflateSetDictionary=lb;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Is=X((e7,Ku)=>{"use strict";Ku.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Qu=X((t7,Xu)=>{"use strict";function cb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Xu.exports=cb});var ed=X(Bn=>{"use strict";var qr=Yu(),In=mt(),go=ys(),oe=Is(),Bs=to(),ub=xs(),db=Qu(),Ju=Object.prototype.toString;function nr(e){if(!(this instanceof nr))return new nr(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ub,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(Bs[r]);if(this.header=new db,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=go.string2buf(t.dictionary):Ju.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(Bs[r])}nr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=go.binstring2buf(e):Ju.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=go.utf8border(r.output,r.next_out),l=r.next_out-s,f=go.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};nr.prototype.onData=function(e){this.chunks.push(e)};nr.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Os(e,t){var r=new nr(t);if(r.push(e,!0),r.err)throw r.msg||Bs[r.err];return r.result}function hb(e,t){return t=t||{},t.raw=!0,Os(e,t)}Bn.Inflate=nr;Bn.inflate=Os;Bn.inflateRaw=hb;Bn.ungzip=Os});var nd=X((n7,rd)=>{"use strict";var pb=mt().assign,gb=ou(),mb=ed(),bb=Is(),td={};pb(td,gb,mb,bb);rd.exports=td});var id=X(()=>{});var od=X(Rs=>{Rs.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Rs.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var ud=X((w7,cd)=>{"use strict";cd.exports=W;var bo=od();function W(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}W.Varint=0;W.Fixed64=1;W.Bytes=2;W.Fixed32=5;var Ds=(1<<16)*(1<<16),ad=1/Ds,yb=12,ld=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");W.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=yo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=fd(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=yo(this.buf,this.pos)+yo(this.buf,this.pos+4)*Ds;return this.pos+=8,e},readSFixed64:function(){var e=yo(this.buf,this.pos)+fd(this.buf,this.pos+4)*Ds;return this.pos+=8,e},readFloat:function(){var e=bo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=bo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,xb(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=yb&&ld?Ib(this.buf,t,e):Lb(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==W.Bytes)return e.push(this.readVarint(t));var r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==W.Bytes)return e.push(this.readSVarint());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==W.Bytes)return e.push(this.readBoolean());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==W.Bytes)return e.push(this.readFloat());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==W.Bytes)return e.push(this.readDouble());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===W.Varint)for(;this.buf[this.pos++]>127;);else if(t===W.Bytes)this.pos=this.readVarint()+this.pos;else if(t===W.Fixed32)this.pos+=4;else if(t===W.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*ad),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*ad),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){vb(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=Bb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&sd(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),bo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),bo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&sd(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,W.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Eb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Ab,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Cb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Pb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Fb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Mb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,kb,t)},writeBytesField:function(e,t){this.writeTag(e,W.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,W.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,W.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,W.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function xb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===W.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function vb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),wb(r,n,t),_b(n,t)}function wb(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function _b(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function sd(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Eb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Cb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Pb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Fb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Mb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function kb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function yo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Hr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function fd(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Lb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function Ib(e,t,r){return ld.decode(e.subarray(t,r))}function Bb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var th=X((O4,Hs)=>{"use strict";Hs.exports=Ro;Hs.exports.default=Ro;function Ro(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=Qd(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=gy(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function Qd(e,t,r,n,i){var o,a;if(i===$s(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Xd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Xd(o,e[o],e[o+1],a);return a&&Do(a,a.next)&&(ci(a),a=a.next),a}function cr(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Do(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&vy(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?dy(e,n,i,o):uy(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=hy(cr(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&py(e,t,r,n,i,o):fi(cr(e),t,r,n,i,o,1);break}}}}function uy(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Wr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function dy(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,T=c>u?c>d?c:d:u>d?u:d,_=Gs(h,g,t,r,n),v=Gs(x,T,t,r,n),M=e.prevZ,L=e.nextZ;M&&M.z>=_&&L&&L.z<=v;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Wr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0||(M=M.prevZ,L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Wr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;M&&M.z>=_;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Wr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;L&&L.z<=v;){if(L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Wr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function hy(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Do(i,o)&&Jd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return cr(n)}function py(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ey(a,s)){var l=eh(a,s);a=cr(a,a.next),l=cr(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function gy(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=Qd(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(_y(f));for(i.sort(my),o=0;o<i.length;o++)r=by(i[o],r);return r}function my(e,t){return e.x-t.x}function by(e,t){var r=yy(e,t);if(!r)return t;var n=eh(r,e);return cr(n,n.next),cr(r,r.next)}function yy(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Wr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&xy(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function xy(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function vy(e,t,r,n){var i=e;do i.z===0&&(i.z=Gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,wy(i)}function wy(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Gs(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function _y(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Wr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function Ey(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Sy(e,t)&&(li(e,t)&&li(t,e)&&Ty(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Do(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Do(e,t){return e.x===t.x&&e.y===t.y}function Jd(e,t,r,n){var i=Oo(ee(e,t,r)),o=Oo(ee(e,t,n)),a=Oo(ee(r,n,e)),s=Oo(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Bo(e,r,t)||o===0&&Bo(e,n,t)||a===0&&Bo(r,e,n)||s===0&&Bo(r,t,n))}function Bo(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Oo(e){return e>0?1:e<0?-1:0}function Sy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Jd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function Ty(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function eh(e,t){var r=new Vs(e.i,e.x,e.y),n=new Vs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Xd(e,t,r,n){var i=new Vs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Vs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ro.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs($s(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs($s(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function $s(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Ro.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var fh=X((U4,sh)=>{sh.exports=globalThis.deck});var Ar={};Ha(Ar,{carto:()=>n3});var Ga={};Ha(Ga,{BASEMAP:()=>vg,CARTO_LAYERS:()=>r3,CARTO_SOURCES:()=>Jp,CartoAPIError:()=>Tr,ClusterTileLayer:()=>jn,H3TileLayer:()=>fr,HeatmapTileLayer:()=>ei,LayerFactory:()=>vl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>lr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Bi,VectorTileLayer:()=>Kr,_GOOGLE_BASEMAPS:()=>za,_QuadbinLayer:()=>So,_RasterLayer:()=>Lo,_STYLE_LAYER_GROUPS:()=>gl,_SpatialIndexTileLayer:()=>Zr,_applyLayerGroupFilters:()=>Ua,_fetchStyle:()=>qa,_getStyleUrl:()=>Qe,boundaryQuerySource:()=>il,boundaryTableSource:()=>ol,colorBins:()=>bl,colorCategories:()=>yl,colorContinuous:()=>xl,fetchBasemapProps:()=>Tg,fetchMap:()=>Eg,h3QuerySource:()=>Aa,h3TableSource:()=>Pa,h3TilesetSource:()=>fl,quadbinQuerySource:()=>Ma,quadbinTableSource:()=>ka,quadbinTilesetSource:()=>ll,query:()=>eg,rasterSource:()=>La,vectorQuerySource:()=>Ia,vectorTableSource:()=>Ba,vectorTilesetSource:()=>Oa});var wd=q(Mt(),1),_d=q(gt(),1),Ed=q(pn(),1);function Tl(e,t,r){switch(e.type){case"Point":return Bg(e,t,r);case"LineString":return Ig(e,t,r);case"Polygon":return Cl(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=Vi(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=Cl(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function Ig(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:Vi(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=Vi(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function Bg(e,t,r){let{positions:n}=e,i=Vi(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Vi(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}function Hi(e,t){let r=t?.globalFeatureId;return r!==void 0?Og(e,r):Rg(e,t?.type)}function Og(e,t){let r=Al(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return $i(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return $i(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function Rg(e,t){let r=Al(e,t);return Dg(r)}function Al(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function Dg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push($i(r,n,o)),n=o,i=a)}t.push($i(r,n,r.featureIds.value.length))}return t}function $i(e,t,r){let n=Tl(e,t,r),i=zg(e,t,r),o=Ng(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function Ng(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function zg(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}var Vn=q(Se(),1);var gm=q(Gl(),1);var Wt=Math.PI,rm=Wt/4,v3=Wt/180,Vl=180/Wt,$l=512;function Te(e){let[t,r]=e,n=t/$l*(2*Wt)-Wt,i=2*(Math.atan(Math.exp(r/$l*(2*Wt)-Wt))-rm);return[n*Vl,i*Vl]}var P3=Math.PI/180;var jl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Wl=[0n,1n,2n,4n,8n,16n];function Yl(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function Kl(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Wl[5-o],s=jl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function ji(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Wl[s],f=jl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function mn(e){return e>>52n&0x1fn}function Wi(e){let t=mn(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}var Ki=q(Yt(),1),ec=q(Se(),1);var Ql=q(Se(),1);function Me(e,t){Ql.log.assert(e,t)}function Jl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function kt(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Ka={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Yi(){return{shape:"binary-feature-collection",points:{type:"Point",...Ka},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Ka},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Ka}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function Xa(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Qa(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function tc(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let T=0;T<r-1;T++)if(a==="h3"){let _=(0,Ki.getResolution)(c);c=(0,Ki.cellToParent)(c,Math.max(0,_-1))}else c=Wi(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:T,aggregation:_}of n)_==="any"?l[d][T]=f.properties[T]:l[d][T]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:T,aggregation:_}of n){let v=l[d][T],M=f.properties[T];_==="average"?l[d][T]=(h*v+x*M)/g:_==="count"||_==="sum"?l[d][T]=v+M:_==="max"?l[d][T]=Math.max(v,M):_==="min"&&(l[d][T]=Math.min(v,M))}}return t.set(r,Object.values(l)),!0}function rc(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(ec.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function nc(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function ic(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Yi(),points:yn(t,r,r,{},e)}}var oc=q(gt(),1);var tt=class extends oc._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(Kl).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(ji(t))}getTileZoom({q:t}){return Number(mn(t))}getParentIndex({q:t}){return{q:Wi(t)}}};var sc=q(gt(),1),ie=q(Yt(),1),ac=85.051128;function fc({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,ac),east:r+c,south:Math.max(n-f,-ac),west:e-c}}function lc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(lc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function mm(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return fc({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var bm=2;function Fr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-bm))}var Lt=class extends sc._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Fr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=fc({west:i,north:s,east:a,south:o},f);c=lc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:mm(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var cc=512;function Ja(e){let{x:t,y:r,z:n}=ji(e),i=cc/(1<<n);return[t*i,cc-r*i,i]}function ym(e,t){let[r,n,i]=Ja(e);return[[r,n],[r+t*i,n-t*i]]}function Xi(e,t=1){let[r,n]=ym(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}var vo=q(Yt(),1);var rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},xm=rt.self||rt.window||rt.global||{},vm=rt.window||rt.self||rt.global||{},wm=rt.global||rt.self||rt.window||{},_m=rt.document||{};var Mr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Em=uc&&parseFloat(uc[1])||0;var dc=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer;function es(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function hc(...e){return Sm(e)}function Sm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function ts(e){let t=[];for await(let r of e)t.push(Tm(r));return hc(...t)}function Tm(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return pc(t,r,n)}return pc(e)}function pc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function gc(e){return e&&typeof e=="object"&&e.isBuffer}function It(e){if(gc(e))return e;if(e instanceof ArrayBuffer)return e;if(dc(e))return mc(e);if(ArrayBuffer.isView(e)){let t=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function mc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function kr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Qi=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){es(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return ts(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var ir=q(nd(),1),vt=q(id(),1),mo=class extends Qi{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Mr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await kr(vt.default.gzip)(t):await kr(vt.default.deflate)(t);return It(r)}return this.compressSync(t)}async decompress(t){if(!Mr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await kr(vt.default.gunzip)(t):await kr(vt.default.inflate)(t);return It(r)}return this.decompressSync(t)}compressSync(t){if(!Mr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?ir.default.deflateRaw:ir.default.deflate;return It(i(n,r).buffer)}decompressSync(t){if(!Mr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?ir.default.inflateRaw:ir.default.inflate;return It(i(n,r).buffer)}async*compressBatches(t){let r=this.options?.deflate||{},n=new ir.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new ir.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var On=class extends mo{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function or(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new On().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Rn=class{static read(t,r){return t.readFields(Rn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Rn.read(n,n.readVarint()+n.pos);r[i]=o}}},ar=class{static read(t,r){let{value:n,size:i}=t.readFields(ar._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?or(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},sr=class{static read(t,r){return t.readFields(sr._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&or(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=ar.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(sr.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&or(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var dd=q(ud(),1);function Ut(e,t){let r=new dd.default(e);return t.read(r)}function hd(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var gd="9.3.0-alpha.6",md="cartoSpatialTile",Ob={cartoSpatialTile:{scheme:"quadbin",workerUrl:kt(md,gd)}},Rb={name:"CARTO Spatial Tile",version:gd,id:md,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>pd(e,t),parseSync:pd,worker:!0,options:Ob};function pd(e,t){if(!e)return null;let r=Ut(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return hd({cells:n,scheme:i})}var xo=Rb;var bd=q(Se(),1),yd=q(Se(),1);function He(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=He(e[i],o,r+1):n[i]=o)}return n}function xd(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?bd.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],T=a.value[g];d.fill(c[T],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ae={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,yd._deepEqual)(e,t,2),async:!0};(0,Ed.registerLoaders)([xo]);function vd(e){if(e===Lt)return"h3";if(e===tt)return"quadbin";throw new Error("Invalid tileset class")}var Sd={data:Ae,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,vo.cellToLatLng)(e);return[r,t]}return Xi(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends _d.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=vd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=vd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=rc(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=tc(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=nc(l,s),g=ic(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(_=>_.id),T=g?.points?.properties?.map(_=>_.id);return(0,Vn._deepEqual)(x,T,1)}};return new wd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=Hi(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,vo.getResolution)(n.id),o=Fr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=Sd;var Hn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:tt;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Hn.layerName="ClusterTileLayer";Hn.defaultProps=Sd;var jn=Hn;var Ad=q(Se(),1),Ns=q(gt(),1);var Td=q(pn(),1);var Cd=q(gt(),1);(0,Td.registerLoaders)([xo]);function Db(e){return e!=null&&e!==""}var Nb={tileSize:512},Wn=class extends Cd.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!Db(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Wn.layerName="SpatialIndexTileLayer";Wn.defaultProps=Nb;var Zr=Wn;var zb=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Ns.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Ub={data:Ae,tileSize:512},Yn=class extends Ad.CompositeLayer{initializeState(){Ns.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Fr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Fr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Zr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:zb,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Yn.layerName="H3TileLayer";Yn.defaultProps=Ub;var fr=Yn;var Co=q(Yt(),1),Ao=q(Se(),1),kd=q(Mt(),1);var qb=`layout(std140) uniform heatmapUniforms {
8
8
  vec2 colorDomain;
9
9
  vec2 delta;
10
10
  float intensity;
@@ -166,7 +166,7 @@ vColor = vec4(color.rgb, color.a * layer.opacity);
166
166
  }
167
167
  DECKGL_FILTER_COLOR(vColor, geometry);
168
168
  }
169
- `;var ry={...qs.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},ko=class extends Eo(qs.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:Nd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};ko.layerName="RasterColumnLayer";function ny(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends zd.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a||t.length===0)return null;let l=t.blockSize??0,[f,c,u]=Ja(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",ko),{highlightedObjectIndex:x,highlightColor:T}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:ny,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:T})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Jl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=ry;var Lo=ii;var Hd=q(gt(),1);var Zd=q(pn(),1);var iy={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=iy[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=qt;or(i,n,r.data,{compression:o})}}},qt=class{static read(t,r){return t.readFields(qt._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var qd="9.3.0-alpha.5",Gd="cartoRasterTile",oy={cartoRasterTile:{metadata:null,workerUrl:kt(Gd,qd)}},ay={name:"CARTO Raster Tile",version:qd,id:Gd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Ud(e,t),parseSync:Ud,worker:!0,options:oy};function Ud(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;qt.compression=r.compression;let n=Ut(e,qt),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Vd=ay;(0,Zd.registerLoaders)([Vd]);var sy=e=>{let t=e.tile?.index?.q;return t?new Lo(e,{tileIndex:t}):null},fy={data:Ae,refinementStrategy:"no-overlap",tileSize:512},Io=class extends Kn(Hd.TileLayer,Pd){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}};Io.layerName="PostProcessTileLayer";var ai=class extends $d.CompositeLayer{getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",Io),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:tt,renderSubLayers:sy,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=fy;var si=ai;var dh=q(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Wd="9.3.0-alpha.5",Yd="cartoPropertiesTile",ly={cartoPropertiesTile:{workerUrl:kt(Yd,Wd)}},cy={name:"CARTO Properties Tile",version:Wd,id:Yd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>jd(e,t),parseSync:jd,options:ly};function jd(e,t){return e?Ut(e,jr):null}var Kd=cy;var nh=q(th(),1);var ih="9.3.0-alpha.5",oh="cartoVectorTile",Cy={cartoVectorTile:{workerUrl:kt(oh,ih)}},Ay={name:"CARTO Vector Tile",version:ih,id:oh,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>rh(e,t),parseSync:rh,worker:!0,options:Cy};function Py(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,nh.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function Fy(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,Py(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function rh(e,t){if(!e)return null;let r=Ut(e,Gr);return r.polygons&&!r.polygons.triangles&&Fy(r.polygons),r}var ah=Ay;var No=q(fh(),1),Yr=q(gt(),1),hh=q(Mt(),1);function lh(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=Oy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=Xa(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=Ry(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Qa(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function ch(e,t,r){let{west:n,south:i,east:o,north:a}=t,l=(o-n)*(a-i)*1e-4,f=[],c=[],u=[],d=[],h=Xa(e.polygonIndices.value.length-1,e.numericProps),g=0,x=0,{extruded:T}=r;for(let _=0;_<e.polygonIndices.value.length-1;_++){let v=e.polygonIndices.value[_],M=e.polygonIndices.value[_+1];if(My(e,_)<l)continue;let L=Iy(e,_),I=-1,R=[0,0],N=!1;for(;x<e.triangles.value.length;){let m=e.triangles.value[x];if(m>=M)break;if(N){x+=3;continue}let b=e.triangles.value[x+1],y=e.triangles.value[x+2],w=e.positions.value.subarray(m*e.positions.size,m*e.positions.size+e.positions.size),S=e.positions.value.subarray(b*e.positions.size,b*e.positions.size+e.positions.size),P=e.positions.value.subarray(y*e.positions.size,y*e.positions.size+e.positions.size);if(Ly(L,w,S,P))N=!0;else{let E=uh(w,S,P);E>I&&(I=E,R=[(w[0]+S[0]+P[0])/3,(w[1]+S[1]+P[1])/3])}x+=3}let p=N?L:R;if(ky(p,t)){f.push(...p);let m=e.featureIds.value[v];if(T){let b=r.getElevation(void 0,{data:e,index:m});f.push(b*r.elevationScale)}c.push(e.properties[m]),u.push(g),d.push(e.globalFeatureIds.value[v]),Qa(e.numericProps,h,v,g),g++}}return e.numericProps&&Object.keys(h).forEach(_=>{h[_].value=h[_].value.slice(0,g)}),yn(f,u,d,h,c,T?3:2)}function My(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=uh(h,g,x),f+=3}return l}function ky([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function Ly(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function uh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function Iy(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function By(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function Oy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=By(e,a);return o}function Ry(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,dh.registerLoaders)([Kd,ah]);var Dy={west:0,east:1,south:0,north:1},Ny={...Yr.MVTLayer.defaultProps,autoLabels:!1,data:Ae,dataComparator:Ae.equal,tileSize:512},ui=class extends Yr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Yr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Yr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?xd(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new No.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt){let o={...t,_subLayerProps:{...t._subLayerProps,...i}};n.push(super.renderSubLayers(o))}else{let{west:o,south:a,east:s,north:l}=r,f=[new No.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new hh.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Yi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=lh(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=ch(t.data.polygons,this.state.mvt?Dy:r,t)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=(t||[]).flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=Ny;var Kr=ui;var zy=Math.PI/180,Uy=180/Math.PI;function xh(e){var t=ph(e[0]+1,e[2]),r=ph(e[0],e[2]),n=gh(e[1]+1,e[2]),i=gh(e[1],e[2]);return[r,n,t,i]}function qy(e){var t=xh(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function ph(e,t){return e/Math.pow(2,t)*360-180}function gh(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Uy*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Zs(e,t,r){var n=Th(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function vh(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function wh(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function _h(e){return vh(wh(e))}function Gy(e,t){for(var r=_h(e),n=0;n<r.length;n++)if(!Eh(t,r[n]))return!1;return!0}function Eh(e,t){for(var r=0;r<e.length;r++)if(Sh(e[r],t))return!0;return!1}function Sh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Vy(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function $y(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Hy(e){var t=Zs(e[0],e[1],32),r=Zs(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=Zy(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function Zy(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Th(e,t,r){var n=Math.sin(t*zy),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var zo={tileToGeoJSON:qy,tileToBBOX:xh,getChildren:vh,getParent:wh,getSiblings:_h,hasTile:Eh,hasSiblings:Gy,tilesEqual:Sh,tileToQuadkey:Vy,quadkeyToTile:$y,pointToTile:Zs,bboxToTile:Hy,pointToTileFraction:Th},jy=Wy;function Wy(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[zo.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=zo.pointToTile(i[r][0],i[r][1],o),a[Ze(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")js(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)js(a,i[r],o);else if(e.type==="Polygon")mh(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)mh(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(bh(a,s),r=0;r<l;r++){var f=s[r];a[Ze(f[0],f[1],f[2])]=!0}return Yy(a,s,t)}return bh(a,s),s}function Yy(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ze(l[0]+1,l[1],i),c=Ze(l[0],l[1]+1,i),u=Ze(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ze(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ze(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ze(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function mh(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];js(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Ky),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ze(d,u,n);e[h]||t.push([d,u,n])}}}function Ky(e,t){return e[1]-t[1]||e[0]-t[0]}function js(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=zo.pointToTileFraction(t[a][0],t[a][1],r),l=zo.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),R=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ze(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=R,v+=T),e[Ze(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function bh(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Xy(+r[n]))}function Ze(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Xy(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Ch=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Ah=[0n,1n,2n,4n,8n,16n],yh=512;function Qy(e){let{x:t,y:r,z:n}=Ys(e),i=yh/(1<<n);return[t*i,yh-r*i,i]}function Jy(e,t){let[r,n,i]=Qy(e);return[[r,n],[r+t*i,n-t*i]]}function ex(e,t=1){let[r,n]=Jy(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}function Ws(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Ah[5-o],s=Ch[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Ys(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Ah[s],f=Ch[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function Uo(e){return e>>52n&0x1fn}function Ph(e,t){let r=Number(t);return jy(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>Ws({x:n,y:i,z:o}))}function Fh(e){let t=ex(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Hf=q(Yt(),1);var Up=q(Yt(),1);var Ks=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},Xs=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},k=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+k.version}static addUnaryOp(t){return k.max_unop_len=Math.max(t.length,k.max_unop_len),k.unary_ops[t]=1,k}static addBinaryOp(t,r,n){return k.max_binop_len=Math.max(t.length,k.max_binop_len),k.binary_ops[t]=r,n?k.right_associative.add(t):k.right_associative.delete(t),k}static addIdentifierChar(t){return k.additional_identifier_chars.add(t),k}static addLiteral(t,r){return k.literals[t]=r,k}static removeUnaryOp(t){return delete k.unary_ops[t],t.length===k.max_unop_len&&(k.max_unop_len=k.getMaxKeyLen(k.unary_ops)),k}static removeAllUnaryOps(){return k.unary_ops={},k.max_unop_len=0,k}static removeIdentifierChar(t){return k.additional_identifier_chars.delete(t),k}static removeBinaryOp(t){return delete k.binary_ops[t],t.length===k.max_binop_len&&(k.max_binop_len=k.getMaxKeyLen(k.binary_ops)),k.right_associative.delete(t),k}static removeAllBinaryOps(){return k.binary_ops={},k.max_binop_len=0,k}static removeLiteral(t){return delete k.literals[t],k}static removeAllLiterals(){return k.literals={},k}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new k(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return k.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!k.binary_ops[String.fromCharCode(t)]||k.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return k.isIdentifierStart(t)||k.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(k.hooks[t]){let n={context:this,node:r};return k.hooks.run(t,n),n.node}return r}searchHook(t){if(k.hooks[t]){let r={context:this};return k.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===k.SPACE_CODE||t===k.TAB_CODE||t===k.LF_CODE||t===k.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:k.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===k.SEMCOL_CODE||n===k.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,k.max_binop_len),r=t.length;for(;r>0;){if(k.binary_ops.hasOwnProperty(t)&&(!k.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!k.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:k.binaryPrecedence(r),right_a:k.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=k.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:k.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:k.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:k.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,k.isDecimalDigit(t)||t===k.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===k.SQUOTE_CODE||t===k.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===k.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,k.max_unop_len),n=r.length;n>0;){if(k.unary_ops.hasOwnProperty(r)&&(!k.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!k.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:k.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}k.isIdentifierStart(t)?(i=this.gobbleIdentifier(),k.literals.hasOwnProperty(i.name)?i={type:k.LITERAL,value:k.literals[i.name],raw:i.name}:i.name===k.this_str&&(i={type:k.THIS_EXP})):t===k.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===k.PERIOD_CODE||r===k.OBRACK_CODE||r===k.OPAREN_CODE||r===k.QUMARK_CODE;){let n;if(r===k.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==k.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===k.OBRACK_CODE?(t={type:k.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==k.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===k.OPAREN_CODE?t={type:k.CALL_EXP,arguments:this.gobbleArguments(k.CPAREN_CODE),callee:t}:(r===k.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:k.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===k.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);k.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,k.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===k.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===k.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:k.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
169
+ `;var ry={...qs.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},ko=class extends Eo(qs.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:Nd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};ko.layerName="RasterColumnLayer";function ny(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends zd.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a||t.length===0)return null;let l=t.blockSize??0,[f,c,u]=Ja(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",ko),{highlightedObjectIndex:x,highlightColor:T}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:ny,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:T})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Jl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=ry;var Lo=ii;var Hd=q(gt(),1);var Zd=q(pn(),1);var iy={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=iy[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=qt;or(i,n,r.data,{compression:o})}}},qt=class{static read(t,r){return t.readFields(qt._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var qd="9.3.0-alpha.6",Gd="cartoRasterTile",oy={cartoRasterTile:{metadata:null,workerUrl:kt(Gd,qd)}},ay={name:"CARTO Raster Tile",version:qd,id:Gd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Ud(e,t),parseSync:Ud,worker:!0,options:oy};function Ud(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;qt.compression=r.compression;let n=Ut(e,qt),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Vd=ay;(0,Zd.registerLoaders)([Vd]);var sy=e=>{let t=e.tile?.index?.q;return t?new Lo(e,{tileIndex:t}):null},fy={data:Ae,refinementStrategy:"no-overlap",tileSize:512},Io=class extends Kn(Hd.TileLayer,Pd){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}};Io.layerName="PostProcessTileLayer";var ai=class extends $d.CompositeLayer{getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",Io),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:tt,renderSubLayers:sy,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=fy;var si=ai;var dh=q(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Wd="9.3.0-alpha.6",Yd="cartoPropertiesTile",ly={cartoPropertiesTile:{workerUrl:kt(Yd,Wd)}},cy={name:"CARTO Properties Tile",version:Wd,id:Yd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>jd(e,t),parseSync:jd,options:ly};function jd(e,t){return e?Ut(e,jr):null}var Kd=cy;var nh=q(th(),1);var ih="9.3.0-alpha.6",oh="cartoVectorTile",Cy={cartoVectorTile:{workerUrl:kt(oh,ih)}},Ay={name:"CARTO Vector Tile",version:ih,id:oh,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>rh(e,t),parseSync:rh,worker:!0,options:Cy};function Py(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,nh.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function Fy(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,Py(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function rh(e,t){if(!e)return null;let r=Ut(e,Gr);return r.polygons&&!r.polygons.triangles&&Fy(r.polygons),r}var ah=Ay;var No=q(fh(),1),Yr=q(gt(),1),hh=q(Mt(),1);function lh(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=Oy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=Xa(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=Ry(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Qa(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function ch(e,t,r){let{west:n,south:i,east:o,north:a}=t,l=(o-n)*(a-i)*1e-4,f=[],c=[],u=[],d=[],h=Xa(e.polygonIndices.value.length-1,e.numericProps),g=0,x=0,{extruded:T}=r;for(let _=0;_<e.polygonIndices.value.length-1;_++){let v=e.polygonIndices.value[_],M=e.polygonIndices.value[_+1];if(My(e,_)<l)continue;let L=Iy(e,_),I=-1,R=[0,0],N=!1;for(;x<e.triangles.value.length;){let m=e.triangles.value[x];if(m>=M)break;if(N){x+=3;continue}let b=e.triangles.value[x+1],y=e.triangles.value[x+2],w=e.positions.value.subarray(m*e.positions.size,m*e.positions.size+e.positions.size),S=e.positions.value.subarray(b*e.positions.size,b*e.positions.size+e.positions.size),P=e.positions.value.subarray(y*e.positions.size,y*e.positions.size+e.positions.size);if(Ly(L,w,S,P))N=!0;else{let E=uh(w,S,P);E>I&&(I=E,R=[(w[0]+S[0]+P[0])/3,(w[1]+S[1]+P[1])/3])}x+=3}let p=N?L:R;if(ky(p,t)){f.push(...p);let m=e.featureIds.value[v];if(T){let b=r.getElevation(void 0,{data:e,index:m});f.push(b*r.elevationScale)}c.push(e.properties[m]),u.push(g),d.push(e.globalFeatureIds.value[v]),Qa(e.numericProps,h,v,g),g++}}return e.numericProps&&Object.keys(h).forEach(_=>{h[_].value=h[_].value.slice(0,g)}),yn(f,u,d,h,c,T?3:2)}function My(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=uh(h,g,x),f+=3}return l}function ky([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function Ly(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function uh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function Iy(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function By(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function Oy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=By(e,a);return o}function Ry(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,dh.registerLoaders)([Kd,ah]);var Dy={west:0,east:1,south:0,north:1},Ny={...Yr.MVTLayer.defaultProps,autoLabels:!1,data:Ae,dataComparator:Ae.equal,tileSize:512},ui=class extends Yr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Yr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Yr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?xd(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new No.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt){let o={...t,_subLayerProps:{...t._subLayerProps,...i}};n.push(super.renderSubLayers(o))}else{let{west:o,south:a,east:s,north:l}=r,f=[new No.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new hh.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Yi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=lh(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=ch(t.data.polygons,this.state.mvt?Dy:r,t)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=(t||[]).flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=Ny;var Kr=ui;var zy=Math.PI/180,Uy=180/Math.PI;function xh(e){var t=ph(e[0]+1,e[2]),r=ph(e[0],e[2]),n=gh(e[1]+1,e[2]),i=gh(e[1],e[2]);return[r,n,t,i]}function qy(e){var t=xh(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function ph(e,t){return e/Math.pow(2,t)*360-180}function gh(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Uy*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Zs(e,t,r){var n=Th(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function vh(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function wh(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function _h(e){return vh(wh(e))}function Gy(e,t){for(var r=_h(e),n=0;n<r.length;n++)if(!Eh(t,r[n]))return!1;return!0}function Eh(e,t){for(var r=0;r<e.length;r++)if(Sh(e[r],t))return!0;return!1}function Sh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Vy(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function $y(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Hy(e){var t=Zs(e[0],e[1],32),r=Zs(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=Zy(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function Zy(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Th(e,t,r){var n=Math.sin(t*zy),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var zo={tileToGeoJSON:qy,tileToBBOX:xh,getChildren:vh,getParent:wh,getSiblings:_h,hasTile:Eh,hasSiblings:Gy,tilesEqual:Sh,tileToQuadkey:Vy,quadkeyToTile:$y,pointToTile:Zs,bboxToTile:Hy,pointToTileFraction:Th},jy=Wy;function Wy(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[zo.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=zo.pointToTile(i[r][0],i[r][1],o),a[Ze(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")js(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)js(a,i[r],o);else if(e.type==="Polygon")mh(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)mh(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(bh(a,s),r=0;r<l;r++){var f=s[r];a[Ze(f[0],f[1],f[2])]=!0}return Yy(a,s,t)}return bh(a,s),s}function Yy(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ze(l[0]+1,l[1],i),c=Ze(l[0],l[1]+1,i),u=Ze(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ze(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ze(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ze(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function mh(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];js(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Ky),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ze(d,u,n);e[h]||t.push([d,u,n])}}}function Ky(e,t){return e[1]-t[1]||e[0]-t[0]}function js(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=zo.pointToTileFraction(t[a][0],t[a][1],r),l=zo.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),R=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ze(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=R,v+=T),e[Ze(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function bh(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Xy(+r[n]))}function Ze(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Xy(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Ch=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Ah=[0n,1n,2n,4n,8n,16n],yh=512;function Qy(e){let{x:t,y:r,z:n}=Ys(e),i=yh/(1<<n);return[t*i,yh-r*i,i]}function Jy(e,t){let[r,n,i]=Qy(e);return[[r,n],[r+t*i,n-t*i]]}function ex(e,t=1){let[r,n]=Jy(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}function Ws(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Ah[5-o],s=Ch[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Ys(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Ah[s],f=Ch[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function Uo(e){return e>>52n&0x1fn}function Ph(e,t){let r=Number(t);return jy(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>Ws({x:n,y:i,z:o}))}function Fh(e){let t=ex(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Hf=q(Yt(),1);var Up=q(Yt(),1);var Ks=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},Xs=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},k=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+k.version}static addUnaryOp(t){return k.max_unop_len=Math.max(t.length,k.max_unop_len),k.unary_ops[t]=1,k}static addBinaryOp(t,r,n){return k.max_binop_len=Math.max(t.length,k.max_binop_len),k.binary_ops[t]=r,n?k.right_associative.add(t):k.right_associative.delete(t),k}static addIdentifierChar(t){return k.additional_identifier_chars.add(t),k}static addLiteral(t,r){return k.literals[t]=r,k}static removeUnaryOp(t){return delete k.unary_ops[t],t.length===k.max_unop_len&&(k.max_unop_len=k.getMaxKeyLen(k.unary_ops)),k}static removeAllUnaryOps(){return k.unary_ops={},k.max_unop_len=0,k}static removeIdentifierChar(t){return k.additional_identifier_chars.delete(t),k}static removeBinaryOp(t){return delete k.binary_ops[t],t.length===k.max_binop_len&&(k.max_binop_len=k.getMaxKeyLen(k.binary_ops)),k.right_associative.delete(t),k}static removeAllBinaryOps(){return k.binary_ops={},k.max_binop_len=0,k}static removeLiteral(t){return delete k.literals[t],k}static removeAllLiterals(){return k.literals={},k}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new k(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return k.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!k.binary_ops[String.fromCharCode(t)]||k.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return k.isIdentifierStart(t)||k.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(k.hooks[t]){let n={context:this,node:r};return k.hooks.run(t,n),n.node}return r}searchHook(t){if(k.hooks[t]){let r={context:this};return k.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===k.SPACE_CODE||t===k.TAB_CODE||t===k.LF_CODE||t===k.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:k.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===k.SEMCOL_CODE||n===k.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,k.max_binop_len),r=t.length;for(;r>0;){if(k.binary_ops.hasOwnProperty(t)&&(!k.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!k.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:k.binaryPrecedence(r),right_a:k.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=k.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:k.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:k.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:k.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,k.isDecimalDigit(t)||t===k.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===k.SQUOTE_CODE||t===k.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===k.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,k.max_unop_len),n=r.length;n>0;){if(k.unary_ops.hasOwnProperty(r)&&(!k.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!k.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:k.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}k.isIdentifierStart(t)?(i=this.gobbleIdentifier(),k.literals.hasOwnProperty(i.name)?i={type:k.LITERAL,value:k.literals[i.name],raw:i.name}:i.name===k.this_str&&(i={type:k.THIS_EXP})):t===k.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===k.PERIOD_CODE||r===k.OBRACK_CODE||r===k.OPAREN_CODE||r===k.QUMARK_CODE;){let n;if(r===k.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==k.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===k.OBRACK_CODE?(t={type:k.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==k.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===k.OPAREN_CODE?t={type:k.CALL_EXP,arguments:this.gobbleArguments(k.CPAREN_CODE),callee:t}:(r===k.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:k.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===k.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));k.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);k.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,k.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===k.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===k.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:k.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
170
170
  `;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return i||this.throwError('Unclosed quote after "'+t+'"'),{type:k.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(k.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,k.isIdentifierPart(t));)this.index++;return{type:k.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){let r=[],n=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){n=!0,this.index++,t===k.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===k.COMMA_CODE){if(this.index++,i++,i!==r.length){if(t===k.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===k.CBRACK_CODE)for(let a=r.length;a<i;a++)r.push(null)}}else if(r.length!==i&&i!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===k.COMPOUND)&&this.throwError("Expected comma"),r.push(a)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(k.CPAREN_CODE);if(this.code===k.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:k.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:k.ARRAY_EXP,elements:this.gobbleArguments(k.CBRACK_CODE)}}},tx=new Ks;Object.assign(k,{hooks:tx,plugins:new Xs(k),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});k.max_unop_len=k.getMaxKeyLen(k.unary_ops);k.max_binop_len=k.getMaxKeyLen(k.binary_ops);var Xr=e=>new k(e).parse(),rx=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(k).filter(e=>!rx.includes(e)&&Xr[e]===void 0).forEach(e=>{Xr[e]=k[e]});Xr.Jsep=k;var nx="ConditionalExpression",ix={name:"ternary",init(e){e.hooks.add("after-expression",function(r){if(r.node&&this.code===e.QUMARK_CODE){this.index++;let n=r.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),r.node={type:nx,test:n,consequent:i,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let a=n;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;r.node.test=a.right,a.right=r.node,r.node=n}}else this.throwError("Expected :")}})}};Xr.plugins.register(ix);function ft(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Qs(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qo(e){let t,r,n;e.length!==2?(t=ft,r=(s,l)=>ft(e(s),l),n=(s,l)=>e(s)-l):(t=e===ft||e===Qs?e:ox,r=e,n=e);function i(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<0?f=u+1:c=u}while(f<c)}return f}function o(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<=0?f=u+1:c=u}while(f<c)}return f}function a(s,l,f=0,c=s.length){let u=i(s,l,f,c-1);return u>f&&n(s[u-1],l)>-n(s[u],l)?u-1:u}return{left:i,center:a,right:o}}function ox(){return 0}function di(e){return e===null?NaN:+e}var Mh=qo(ft),kh=Mh.right,ax=Mh.left,sx=qo(di).center,_t=kh;var Qr=class extends Map{constructor(t,r=cx){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(Lh(this,t))}has(t){return super.has(Lh(this,t))}set(t,r){return super.set(fx(this,t),r)}delete(t){return super.delete(lx(this,t))}};function Lh({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function fx({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function lx({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function cx(e){return e!==null&&typeof e=="object"?e.valueOf():e}var ux=Math.sqrt(50),dx=Math.sqrt(10),hx=Math.sqrt(2);function Go(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),a=o>=ux?10:o>=dx?5:o>=hx?2:1,s,l,f;return i<0?(f=Math.pow(10,-i)/a,s=Math.round(e*f),l=Math.round(t*f),s/f<e&&++s,l/f>t&&--l,f=-f):(f=Math.pow(10,i)*a,s=Math.round(e/f),l=Math.round(t/f),s*f<e&&++s,l*f>t&&--l),l<s&&.5<=r&&r<2?Go(e,t,r*2):[s,l,f]}function ur(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,o,a]=n?Go(t,e,r):Go(e,t,r);if(!(o>=i))return[];let s=o-i+1,l=new Array(s);if(n)if(a<0)for(let f=0;f<s;++f)l[f]=(o-f)/-a;else for(let f=0;f<s;++f)l[f]=(o-f)*a;else if(a<0)for(let f=0;f<s;++f)l[f]=(i+f)/-a;else for(let f=0;f<s;++f)l[f]=(i+f)*a;return l}function hi(e,t,r){return t=+t,e=+e,r=+r,Go(e,t,r)[2]}function Js(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?hi(t,e,r):hi(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function ef(e,t,r=di){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),a=+r(e[o],o,e),s=+r(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Vo(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n<i;)o[n]=e+n*r;return o}function ue(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var tf=Symbol("implicit");function dr(){var e=new Qr,t=[],r=[],n=tf;function i(o){let a=e.get(o);if(a===void 0){if(n!==tf)return n;e.set(o,a=t.push(o)-1)}return r[a%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qr;for(let a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return dr(t,r).unknown(n)},ue.apply(i,arguments),i}function $o(){var e=dr().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,a,s=!1,l=0,f=0,c=.5;delete e.unknown;function u(){var d=t().length,h=i<n,g=h?i:n,x=h?n:i;o=(x-g)/Math.max(1,d-l+f*2),s&&(o=Math.floor(o)),g+=(x-g-o*(d-l))*c,a=o*(1-l),s&&(g=Math.round(g),a=Math.round(a));var T=Vo(d).map(function(_){return g+o*_});return r(h?T.reverse():T)}return e.domain=function(d){return arguments.length?(t(d),u()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,u()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,u()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(d){return arguments.length?(s=!!d,u()):s},e.padding=function(d){return arguments.length?(l=Math.min(1,f=+d),u()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),u()):l},e.paddingOuter=function(d){return arguments.length?(f=+d,u()):f},e.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),u()):c},e.copy=function(){return $o(t(),[n,i]).round(s).paddingInner(l).paddingOuter(f).align(c)},ue.apply(u(),arguments)}function Ih(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Ih(t())},e}function rf(){return Ih($o.apply(null,arguments).paddingInner(1))}function Ho(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function nf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function mi(){}var pi=.7,Wo=1/pi,Jr="\\s*([+-]?\\d+)\\s*",gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",px=/^#([0-9a-f]{3,8})$/,gx=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),mx=new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`),bx=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${gi}\\)$`),yx=new RegExp(`^rgba\\(${lt},${lt},${lt},${gi}\\)$`),xx=new RegExp(`^hsl\\(${gi},${lt},${lt}\\)$`),vx=new RegExp(`^hsla\\(${gi},${lt},${lt},${gi}\\)$`),Bh={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};Ho(mi,Gt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Oh,formatHex:Oh,formatHex8:wx,formatHsl:_x,formatRgb:Rh,toString:Rh});function Oh(){return this.rgb().formatHex()}function wx(){return this.rgb().formatHex8()}function _x(){return Gh(this).formatHsl()}function Rh(){return this.rgb().formatRgb()}function Gt(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=px.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Dh(t):r===3?new xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Zo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Zo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gx.exec(e))?new xe(t[1],t[2],t[3],1):(t=mx.exec(e))?new xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bx.exec(e))?Zo(t[1],t[2],t[3],t[4]):(t=yx.exec(e))?Zo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xx.exec(e))?Uh(t[1],t[2]/100,t[3]/100,1):(t=vx.exec(e))?Uh(t[1],t[2]/100,t[3]/100,t[4]):Bh.hasOwnProperty(e)?Dh(Bh[e]):e==="transparent"?new xe(NaN,NaN,NaN,0):null}function Dh(e){return new xe(e>>16&255,e>>8&255,e&255,1)}function Zo(e,t,r,n){return n<=0&&(e=t=r=NaN),new xe(e,t,r,n)}function Ex(e){return e instanceof mi||(e=Gt(e)),e?(e=e.rgb(),new xe(e.r,e.g,e.b,e.opacity)):new xe}function en(e,t,r,n){return arguments.length===1?Ex(e):new xe(e,t,r,n??1)}function xe(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ho(xe,en,nf(mi,{brighter(e){return e=e==null?Wo:Math.pow(Wo,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xe(pr(this.r),pr(this.g),pr(this.b),Yo(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:Nh,formatHex:Nh,formatHex8:Sx,formatRgb:zh,toString:zh}));function Nh(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}`}function Sx(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}${hr((isNaN(this.opacity)?1:this.opacity)*255)}`}function zh(){let e=Yo(this.opacity);return`${e===1?"rgb(":"rgba("}${pr(this.r)}, ${pr(this.g)}, ${pr(this.b)}${e===1?")":`, ${e})`}`}function Yo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hr(e){return e=pr(e),(e<16?"0":"")+e.toString(16)}function Uh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new je(e,t,r,n)}function Gh(e){if(e instanceof je)return new je(e.h,e.s,e.l,e.opacity);if(e instanceof mi||(e=Gt(e)),!e)return new je;if(e instanceof je)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(r-n)/s+(r<n)*6:r===o?a=(n-t)/s+2:a=(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new je(a,s,l,e.opacity)}function Vh(e,t,r,n){return arguments.length===1?Gh(e):new je(e,t,r,n??1)}function je(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ho(je,Vh,nf(mi,{brighter(e){return e=e==null?Wo:Math.pow(Wo,e),new je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new je(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new xe(of(e>=240?e-240:e+120,i,n),of(e,i,n),of(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new je(qh(this.h),jo(this.s),jo(this.l),Yo(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 e=Yo(this.opacity);return`${e===1?"hsl(":"hsla("}${qh(this.h)}, ${jo(this.s)*100}%, ${jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qh(e){return e=(e||0)%360,e<0?e+360:e}function jo(e){return Math.max(0,Math.min(1,e||0))}function of(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function af(e,t,r,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*r+(1+3*e+3*o-3*a)*n+a*i)/6}function $h(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<t-1?e[n+2]:2*o-i;return af((r-n/t)*t,a,i,o,s)}}function Hh(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return af((r-n/t)*t,i,o,a,s)}}var bi=e=>()=>e;function Tx(e,t){return function(r){return e+r*t}}function Cx(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Zh(e){return(e=+e)==1?Ko:function(t,r){return r-t?Cx(t,r,e):bi(isNaN(t)?r:t)}}function Ko(e,t){var r=t-e;return r?Tx(e,r):bi(isNaN(e)?t:e)}var sf=function e(t){var r=Zh(t);function n(i,o){var a=r((i=en(i)).r,(o=en(o)).r),s=r(i.g,o.g),l=r(i.b,o.b),f=Ko(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=f(c),i+""}}return n.gamma=e,n}(1);function jh(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),a,s;for(a=0;a<r;++a)s=en(t[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=o(l),s+""}}}var Y9=jh($h),K9=jh(Hh);function Wh(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=e[i]*(1-o)+t[i]*o;return n}}function Yh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kh(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),a;for(a=0;a<n;++a)i[a]=gr(e[a],t[a]);for(;a<r;++a)o[a]=t[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}function Xh(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Vt(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Qh(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=gr(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ff=new RegExp(lf.source,"g");function Ax(e){return function(){return e}}function Px(e){return function(t){return e(t)+""}}function Jh(e,t){var r=lf.lastIndex=ff.lastIndex=0,n,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(n=lf.exec(e))&&(i=ff.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Vt(n,i)})),r=ff.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Px(l[0].x):Ax(t):(t=l.length,function(f){for(var c=0,u;c<t;++c)s[(u=l[c]).i]=u.x(f);return s.join("")})}function gr(e,t){var r=typeof t,n;return t==null||r==="boolean"?bi(t):(r==="number"?Vt:r==="string"?(n=Gt(t))?(t=n,sf):Jh:t instanceof Gt?sf:t instanceof Date?Xh:Yh(t)?Wh:Array.isArray(t)?Kh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Qh:Vt)(e,t)}function cf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function uf(e){return function(){return e}}function df(e){return+e}var e0=[0,1];function We(e){return e}function hf(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:uf(isNaN(t)?NaN:.5)}function Fx(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Mx(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=hf(i,n),o=r(a,o)):(n=hf(n,i),o=r(o,a)),function(s){return o(n(s))}}function kx(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=hf(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(s){var l=_t(e,s,1,n)-1;return o[l](i[l](s))}}function tn(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function yi(){var e=e0,t=e0,r=gr,n,i,o,a=We,s,l,f;function c(){var d=Math.min(e.length,t.length);return a!==We&&(a=Fx(e[0],e[d-1])),s=d>2?kx:Mx,l=f=null,u}function u(d){return d==null||isNaN(d=+d)?o:(l||(l=s(e.map(n),t,r)))(n(a(d)))}return u.invert=function(d){return a(i((f||(f=s(t,e.map(n),Vt)))(d)))},u.domain=function(d){return arguments.length?(e=Array.from(d,df),c()):e.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),r=cf,c()},u.clamp=function(d){return arguments.length?(a=d?!0:We,c()):a!==We},u.interpolate=function(d){return arguments.length?(r=d,c()):r},u.unknown=function(d){return arguments.length?(o=d,u):o},function(d,h){return n=d,i=h,c()}}function pf(){return yi()(We,We)}function t0(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function mr(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ct(e){return e=mr(Math.abs(e)),e?e[1]:NaN}function r0(e,t){return function(r,n){for(var i=r.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function n0(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Lx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ut(e){if(!(t=Lx.exec(e)))throw new Error("invalid format: "+e);var t;return new Xo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ut.prototype=Xo.prototype;function Xo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Xo.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 i0(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var gf;function o0(e,t){var r=mr(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(gf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+mr(e,Math.max(0,t+o-1))[0]}function mf(e,t){var r=mr(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var bf={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:t0,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>mf(e*100,t),r:mf,s:o0,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function yf(e){return e}var a0=Array.prototype.map,s0=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function f0(e){var t=e.grouping===void 0||e.thousands===void 0?yf:r0(a0.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?yf:n0(a0.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function f(u){u=ut(u);var d=u.fill,h=u.align,g=u.sign,x=u.symbol,T=u.zero,_=u.width,v=u.comma,M=u.precision,L=u.trim,I=u.type;I==="n"?(v=!0,I="g"):bf[I]||(M===void 0&&(M=12),L=!0,I="g"),(T||d==="0"&&h==="=")&&(T=!0,d="0",h="=");var R=x==="$"?r:x==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",N=x==="$"?n:/[%p]/.test(I)?a:"",p=bf[I],m=/[defgprs%]/.test(I);M=M===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function b(y){var w=R,S=N,P,E,C;if(I==="c")S=p(y)+S,y="";else{y=+y;var F=y<0||1/y<0;if(y=isNaN(y)?l:p(Math.abs(y),M),L&&(y=i0(y)),F&&+y==0&&g!=="+"&&(F=!1),w=(F?g==="("?g:s:g==="-"||g==="("?"":g)+w,S=(I==="s"?s0[8+gf/3]:"")+S+(F&&g==="("?")":""),m){for(P=-1,E=y.length;++P<E;)if(C=y.charCodeAt(P),48>C||C>57){S=(C===46?i+y.slice(P+1):y.slice(P))+S,y=y.slice(0,P);break}}}v&&!T&&(y=t(y,1/0));var A=w.length+y.length+S.length,B=A<_?new Array(_-A+1).join(d):"";switch(v&&T&&(y=t(B+y,B.length?_-S.length:1/0),B=""),h){case"<":y=w+y+S+B;break;case"=":y=w+B+y+S;break;case"^":y=B.slice(0,A=B.length>>1)+w+y+S+B.slice(A);break;default:y=B+w+y+S;break}return o(y)}return b.toString=function(){return u+""},b}function c(u,d){var h=f((u=ut(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(ct(d)/3)))*3,x=Math.pow(10,-g),T=s0[8+g/3];return function(_){return h(x*_)+T}}return{format:f,formatPrefix:c}}var Qo,Et,Jo;xf({thousands:",",grouping:[3],currency:["$",""]});function xf(e){return Qo=f0(e),Et=Qo.format,Jo=Qo.formatPrefix,Qo}function vf(e){return Math.max(0,-ct(Math.abs(e)))}function wf(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ct(t)/3)))*3-ct(Math.abs(e)))}function _f(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ct(t)-ct(e))+1}function Ef(e,t,r,n){var i=Js(e,t,r),o;switch(n=ut(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=wf(i,a))&&(n.precision=o),Jo(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=_f(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=vf(i))&&(n.precision=o-(n.type==="%")*2);break}}return Et(n)}function xi(e){var t=e.domain;return e.ticks=function(r){var n=t();return ur(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ef(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,a=n[i],s=n[o],l,f,c=10;for(s<a&&(f=a,a=s,s=f,f=i,i=o,o=f);c-- >0;){if(f=hi(a,s,r),f===l)return n[i]=a,n[o]=s,t(n);if(f>0)a=Math.floor(a/f)*f,s=Math.ceil(s/f)*f;else if(f<0)a=Math.ceil(a*f)/f,s=Math.floor(s*f)/f;else break;l=f}return e},e}function br(){var e=pf();return e.copy=function(){return tn(e,br())},ue.apply(e,arguments),xi(e)}function Sf(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],a;return o<i&&(a=r,r=n,n=a,a=i,i=o,o=a),e[r]=t.floor(i),e[n]=t.ceil(o),e}function l0(e){return Math.log(e)}function c0(e){return Math.exp(e)}function Ix(e){return-Math.log(-e)}function Bx(e){return-Math.exp(-e)}function Ox(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Rx(e){return e===10?Ox:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Dx(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function u0(e){return(t,r)=>-e(-t,r)}function Nx(e){let t=e(l0,c0),r=t.domain,n=10,i,o;function a(){return i=Dx(n),o=Rx(n),r()[0]<0?(i=u0(i),o=u0(o),e(Ix,Bx)):e(l0,c0),t}return t.base=function(s){return arguments.length?(n=+s,a()):n},t.domain=function(s){return arguments.length?(r(s),a()):r()},t.ticks=s=>{let l=r(),f=l[0],c=l[l.length-1],u=c<f;u&&([f,c]=[c,f]);let d=i(f),h=i(c),g,x,T=s==null?10:+s,_=[];if(!(n%1)&&h-d<T){if(d=Math.floor(d),h=Math.ceil(h),f>0){for(;d<=h;++d)for(g=1;g<n;++g)if(x=d<0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;_.push(x)}}else for(;d<=h;++d)for(g=n-1;g>=1;--g)if(x=d>0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;_.push(x)}_.length*2<T&&(_=ur(f,c,T))}else _=ur(d,h,Math.min(h-d,T)).map(o);return u?_.reverse():_},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=ut(l)).precision==null&&(l.trim=!0),l=Et(l)),s===1/0)return l;let f=Math.max(1,n*s/t.ticks().length);return c=>{let u=c/o(Math.round(i(c)));return u*n<n-.5&&(u*=n),u<=f?l(c):""}},t.nice=()=>r(Sf(r(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function vi(){let e=Nx(yi()).domain([1,10]);return e.copy=()=>tn(e,vi()).base(e.base()),ue.apply(e,arguments),e}function d0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function zx(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ux(e){return e<0?-e*e:e*e}function qx(e){var t=e(We,We),r=1;function n(){return r===1?e(We,We):r===.5?e(zx,Ux):e(d0(r),d0(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},xi(t)}function ea(){var e=qx(yi());return e.copy=function(){return tn(e,ea()).exponent(e.exponent())},ue.apply(e,arguments),e}function Tf(){return ea.apply(null,arguments).exponent(.5)}function wi(){var e=[],t=[],r=[],n;function i(){var a=0,s=Math.max(1,t.length);for(r=new Array(s-1);++a<s;)r[a-1]=ef(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?n:t[_t(r,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ft),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return wi().domain(e).range(t).unknown(n)},ue.apply(o,arguments)}function _i(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[_t(n,l,0,r)]:o}function s(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(r=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var f=i.indexOf(l);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return n.slice()},a.copy=function(){return _i().domain([e,t]).range(i).unknown(o)},ue.apply(xi(a),arguments)}function yr(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[_t(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return yr().domain(e).range(t).unknown(r)},ue.apply(i,arguments)}var B6={},Gx=Object.create,Yf=Object.defineProperty,Vx=Object.getOwnPropertyDescriptor,ap=Object.getOwnPropertyNames,$x=Object.getPrototypeOf,Hx=Object.prototype.hasOwnProperty,Zx=(e,t,r)=>t in e?Yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jx=(e,t)=>function(){return t||(0,e[ap(e)[0]])((t={exports:{}}).exports,t),t.exports},Wx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ap(t))!Hx.call(e,i)&&i!==r&&Yf(e,i,{get:()=>t[i],enumerable:!(n=Vx(t,i))||n.enumerable});return e},Yx=(e,t,r)=>(r=e!=null?Gx($x(e)):{},Wx(t||!e||!e.__esModule?Yf(r,"default",{value:e,enumerable:!0}):r,e)),D=(e,t,r)=>Zx(e,typeof t!="symbol"?t+"":t,r),Kx=jx({"node_modules/thenby/thenBy.module.js"(e,t){"use strict";t.exports=function(){function r(a){return a}function n(a){return typeof a=="string"?a.toLowerCase():a}function i(a,s){if(s=typeof s=="object"?s:{direction:s},typeof a!="function"){var l=a;a=function(h){return h[l]?h[l]:""}}if(a.length===1){var f=a,c=s.ignoreCase?n:r,u=s.cmp||function(h,g){return h<g?-1:h>g?1:0};a=function(h,g){return u(c(f(h)),c(f(g)))}}let d={"-1":"",desc:""};return s.direction in d?function(h,g){return-a(h,g)}:a}function o(a,s){var l=typeof this=="function"&&!this.firstBy?this:!1,f=i(a,s),c=l?function(u,d){return l(u,d)||f(u,d)}:f;return c.thenBy=o,c}return o.firstBy=o,o}()}}),Xx="deck-gl-carto";function Di(){return Xx}var Kf=(e=>(e.IN="in",e.BETWEEN="between",e.CLOSED_OPEN="closed_open",e.TIME="time",e.STRING_SEARCH="stringSearch",e))(Kf||{}),sp=(e=>(e.V1="v1",e.V2="v2",e.V3="v3",e))(sp||{}),Xf="https://gcp-us-east1.api.carto.com";var fp=(e=>(e.H3="h3",e.QUADBIN="quadbin",e))(fp||{});var Qx=Object.freeze({h3:["h3","hex","h3id","hex_id","h3hex"],quadbin:["quadbin"]}),De={Count:"count",Avg:"avg",Min:"min",Max:"max",Sum:"sum",Custom:"custom"};function lp(e){return e.map(t=>t[0]===void 0||t[0]===null?[Number.MIN_SAFE_INTEGER,t[1]]:t[1]===void 0||t[1]===null?[t[0],Number.MAX_SAFE_INTEGER]:t)}var Jx={in:ev,between:cp,time:tv,closed_open:rv,stringSearch:nv};function ev(e,t){return e.includes(t)}function cp(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<=o};return lp(e).some(r)}function tv(e,t){let r=new Date(t).getTime();if(isFinite(r))return cp(e,r);throw new Error("Column used to filter by time isn't well formatted.")}function rv(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<o};return lp(e).some(r)}function nv(e,t,r={}){let n=h0(t,r),i=r.useRegExp?e:e.map(a=>{let s=av(h0(a,r));return r.mustStart&&(s=`^${s}`),r.mustEnd&&(s=`${s}$`),s}),o=new RegExp(i.join("|"),r.caseSensitive?"g":"gi");return!!n.match(o)}var iv=/[.*+?^${}()|[\]\\]/g,ov=/\p{Diacritic}/gu;function av(e){return e.replace(iv,"\\$&")}function h0(e,t){let r=String(e);return t.keepSpecialCharacters||(r=r.normalize("NFD").replace(ov,"")),r}var sv={and:"every",or:"some"};function fv(e,t,r,n){let i=sv[n];return e[i](o=>{let a=t[o],s=Object.keys(a);return!r||r[o]===null||r[o]===void 0?!1:s.every(l=>{let f=Jx[l];if(!f)throw new Error(`"${l}" filter is not implemented.`);return f(a[l].values,r[o],a[l].params)})})}function lv({filters:e={},type:t="boolean",filtersLogicalOperator:r="and"}){let n=Object.keys(e);return n.length?i=>{let o=i.properties||i,a=fv(n,e,o,r);return t==="number"?Number(a):a}:()=>t==="number"?1:!0}function cv(e,t,r){return Object.keys(t).length?e.filter(lv({filters:t,filtersLogicalOperator:r})):e}var Y=11102230246251565e-32,de=134217729,uv=(3+8*Y)*Y;function Cf(e,t,r,n,i){let o,a,s,l,f=t[0],c=n[0],u=0,d=0;c>f==c>-f?(o=f,f=t[++u]):(o=c,c=n[++d]);let h=0;if(u<e&&d<r)for(c>f==c>-f?(a=f+o,s=o-(a-f),f=t[++u]):(a=c+o,s=o-(a-c),c=n[++d]),o=a,s!==0&&(i[h++]=s);u<e&&d<r;)c>f==c>-f?(a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d]),o=a,s!==0&&(i[h++]=s);for(;u<e;)a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u],o=a,s!==0&&(i[h++]=s);for(;d<r;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d],o=a,s!==0&&(i[h++]=s);return(o!==0||h===0)&&(i[h++]=o),h}function dv(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function O(e){return new Float64Array(e)}var hv=(3+16*Y)*Y,pv=(2+12*Y)*Y,gv=(9+64*Y)*Y*Y,rn=O(4),p0=O(8),g0=O(12),m0=O(16),me=O(4);function mv(e,t,r,n,i,o,a){let s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,R,N,p,m=e-i,b=r-i,y=t-o,w=n-o;L=m*w,d=de*m,h=d-(d-m),g=m-h,d=de*w,x=d-(d-w),T=w-x,I=g*T-(L-h*x-g*x-h*T),R=y*b,d=de*y,h=d-(d-y),g=y-h,d=de*b,x=d-(d-b),T=b-x,N=g*T-(R-h*x-g*x-h*T),_=I-N,u=I-_,rn[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-R,u=M-_,rn[1]=M-(_+u)+(u-R),p=v+_,u=p-v,rn[2]=v-(p-u)+(_-u),rn[3]=p;let S=dv(4,rn),P=pv*a;if(S>=P||-S>=P||(u=e-m,s=e-(m+u)+(u-i),u=r-b,f=r-(b+u)+(u-i),u=t-y,l=t-(y+u)+(u-o),u=n-w,c=n-(w+u)+(u-o),s===0&&l===0&&f===0&&c===0)||(P=gv*a+uv*Math.abs(S),S+=m*c+w*s-(y*f+b*l),S>=P||-S>=P))return S;L=s*w,d=de*s,h=d-(d-s),g=s-h,d=de*w,x=d-(d-w),T=w-x,I=g*T-(L-h*x-g*x-h*T),R=l*b,d=de*l,h=d-(d-l),g=l-h,d=de*b,x=d-(d-b),T=b-x,N=g*T-(R-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-R,u=M-_,me[1]=M-(_+u)+(u-R),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let E=Cf(4,rn,4,me,p0);L=m*c,d=de*m,h=d-(d-m),g=m-h,d=de*c,x=d-(d-c),T=c-x,I=g*T-(L-h*x-g*x-h*T),R=y*f,d=de*y,h=d-(d-y),g=y-h,d=de*f,x=d-(d-f),T=f-x,N=g*T-(R-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-R,u=M-_,me[1]=M-(_+u)+(u-R),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let C=Cf(E,p0,4,me,g0);L=s*c,d=de*s,h=d-(d-s),g=s-h,d=de*c,x=d-(d-c),T=c-x,I=g*T-(L-h*x-g*x-h*T),R=l*f,d=de*l,h=d-(d-l),g=l-h,d=de*f,x=d-(d-f),T=f-x,N=g*T-(R-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-R,u=M-_,me[1]=M-(_+u)+(u-R),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let F=Cf(C,g0,4,me,m0);return m0[F-1]}function bv(e,t,r,n,i,o){let a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s,f=Math.abs(a+s);return Math.abs(l)>=hv*f?l:-mv(e,t,r,n,i,o,f)}var QS=(7+56*Y)*Y,JS=(3+28*Y)*Y,eT=(26+288*Y)*Y*Y,tT=O(4),rT=O(4),nT=O(4),iT=O(4),oT=O(4),aT=O(4),sT=O(4),fT=O(4),lT=O(4),cT=O(8),uT=O(8),dT=O(8),hT=O(4),pT=O(8),gT=O(8),mT=O(8),bT=O(12),yT=O(192),xT=O(192),vT=(10+96*Y)*Y,wT=(4+48*Y)*Y,_T=(44+576*Y)*Y*Y,ET=O(4),ST=O(4),TT=O(4),CT=O(4),AT=O(4),PT=O(4),FT=O(4),MT=O(4),kT=O(8),LT=O(8),IT=O(8),BT=O(8),OT=O(8),RT=O(8),DT=O(8),NT=O(8),zT=O(8),UT=O(4),qT=O(4),GT=O(4),VT=O(8),$T=O(16),HT=O(16),ZT=O(16),jT=O(32),WT=O(32),YT=O(48),KT=O(64),XT=O(1152),QT=O(1152),JT=(16+224*Y)*Y,eC=(5+72*Y)*Y,tC=(71+1408*Y)*Y*Y,rC=O(4),nC=O(4),iC=O(4),oC=O(4),aC=O(4),sC=O(4),fC=O(4),lC=O(4),cC=O(4),uC=O(4),dC=O(24),hC=O(24),pC=O(24),gC=O(24),mC=O(24),bC=O(24),yC=O(24),xC=O(24),vC=O(24),wC=O(24),_C=O(1152),EC=O(1152),SC=O(1152),TC=O(1152),CC=O(1152),AC=O(2304),PC=O(2304),FC=O(3456),MC=O(5760),kC=O(8),LC=O(8),IC=O(8),BC=O(16),OC=O(24),RC=O(48),DC=O(48),NC=O(96),zC=O(192),UC=O(384),qC=O(384),GC=O(384),VC=O(768),$C=O(96),HC=O(96),ZC=O(96),jC=O(1152);function yv(e,t){var r,n,i=0,o,a,s,l,f,c,u,d=e[0],h=e[1],g=t.length;for(r=0;r<g;r++){n=0;var x=t[r],T=x.length-1;if(c=x[0],c[0]!==x[T][0]&&c[1]!==x[T][1])throw new Error("First and last coordinates in a ring must be the same");for(a=c[0]-d,s=c[1]-h,n;n<T;n++){if(u=x[n+1],l=u[0]-d,f=u[1]-h,s===0&&f===0){if(l<=0&&a>=0||a<=0&&l>=0)return 0}else if(f>=0&&s<=0||f<=0&&s>=0){if(o=bv(a,l,s,f,0,0),o===0)return 0;(o>0&&f>0&&s<=0||o<0&&f<=0&&s>0)&&i++}c=u,s=f,a=l}}return i%2!==0}var Pe=63710088e-1,WC={centimeters:Pe*100,centimetres:Pe*100,degrees:360/(2*Math.PI),feet:Pe*3.28084,inches:Pe*39.37,kilometers:Pe/1e3,kilometres:Pe/1e3,meters:Pe,metres:Pe,miles:Pe/1609.344,millimeters:Pe*1e3,millimetres:Pe*1e3,nauticalmiles:Pe/1852,radians:1,yards:Pe*1.0936};function _e(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function xv(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b0(e[0])||!b0(e[1]))throw new Error("coordinates must contain numbers");return _e({type:"Point",coordinates:e},t,r)}function Qf(e,t,r={}){for(let i of e){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return _e({type:"Polygon",coordinates:e},t,r)}function up(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return _e({type:"LineString",coordinates:e},t,r)}function Li(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function dp(e,t,r={}){return _e({type:"MultiLineString",coordinates:e},t,r)}function hp(e,t,r={}){return _e({type:"MultiPolygon",coordinates:e},t,r)}function b0(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function pp(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Mi(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Pt(e){return e.type==="Feature"?e.geometry:e}function vv(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function Ne(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");let n=pp(e),i=Pt(t),o=i.type,a=t.bbox,s=i.coordinates;if(a&&wv(n,a)===!1)return!1;o==="Polygon"&&(s=[s]);let l=!1;for(var f=0;f<s.length;++f){let c=yv(n,s[f]);if(c===0)return!r.ignoreBoundary;c&&(l=!0)}return l}function wv(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}var gp=class{constructor(e=[],t=_v){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let o=(e<<1)+1,a=t[o],s=o+1;if(s<this.length&&r(t[s],a)<0&&(o=s,a=t[s]),r(a,i)>=0)break;t[e]=a,e=o}t[e]=i}};function _v(e,t){return e<t?-1:e>t?1:0}function mp(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function Ev(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}var y0=class{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}};function Sv(e,t){if(e.type==="FeatureCollection"){let r=e.features;for(let n=0;n<r.length;n++)x0(r[n],t)}else x0(e,t)}var ta=0,ra=0,na=0;function x0(e,t){let r=e.type==="Feature"?e.geometry:e,n=r.coordinates;(r.type==="Polygon"||r.type==="MultiLineString")&&(n=[n]),r.type==="LineString"&&(n=[[n]]);for(let i=0;i<n.length;i++)for(let o=0;o<n[i].length;o++){let a=n[i][o][0],s=null;ra=ra+1;for(let l=0;l<n[i][o].length-1;l++){s=n[i][o][l+1];let f=new y0(a,ta,ra,na),c=new y0(s,ta,ra,na+1);f.otherEvent=c,c.otherEvent=f,mp(f,c)>0?(c.isLeftEndpoint=!0,f.isLeftEndpoint=!1):(f.isLeftEndpoint=!0,c.isLeftEndpoint=!1),t.push(f),t.push(c),a=s,na=na+1}}ta=ta+1}var Tv=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function Cv(e,t){if(e===null||t===null||e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;let r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,i=e.rightSweepEvent.p.x,o=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,s=t.leftSweepEvent.p.y,l=t.rightSweepEvent.p.x,f=t.rightSweepEvent.p.y,c=(f-s)*(i-r)-(l-a)*(o-n),u=(l-a)*(n-s)-(f-s)*(r-a),d=(i-r)*(n-s)-(o-n)*(r-a);if(c===0)return u===0&&d===0,!1;let h=u/c,g=d/c;if(h>=0&&h<=1&&g>=0&&g<=1){let x=r+h*(i-r),T=n+h*(o-n);return[x,T]}return!1}function Av(e,t){t=t||!1;let r=[],n=new gp([],Ev);for(;e.length;){let i=e.pop();if(i.isLeftEndpoint){let o=new Tv(i);for(let a=0;a<n.data.length;a++){let s=n.data[a];if(t&&s.leftSweepEvent.featureId===i.featureId)continue;let l=Cv(o,s);l!==!1&&r.push(l)}n.push(o)}else i.isLeftEndpoint===!1&&n.pop()}return r}function Pv(e,t){let r=new gp([],mp);return Sv(e,r),Av(r,t)}var Fv=Pv,Mv=Fv;function Jf(e,t,r={}){let{removeDuplicates:n=!0,ignoreSelfIntersections:i=!0}=r,o=[];e.type==="FeatureCollection"?o=o.concat(e.features):e.type==="Feature"?o.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&o.push(_e(e)),t.type==="FeatureCollection"?o=o.concat(t.features):t.type==="Feature"?o.push(t):(t.type==="LineString"||t.type==="Polygon"||t.type==="MultiLineString"||t.type==="MultiPolygon")&&o.push(_e(t));let a=Mv(Li(o),i),s=[];if(n){let l={};a.forEach(f=>{let c=f.join(",");l[c]||(l[c]=!0,s.push(f))})}else s=a;return Li(s.map(l=>xv(l)))}function bp(e,t,r){if(e!==null)for(var n,i,o,a,s,l,f,c=0,u=0,d,h=e.type,g=h==="FeatureCollection",x=h==="Feature",T=g?e.features.length:1,_=0;_<T;_++){f=g?e.features[_].geometry:x?e.geometry:e,d=f?f.type==="GeometryCollection":!1,s=d?f.geometries.length:1;for(var v=0;v<s;v++){var M=0,L=0;if(a=d?f.geometries[v]:f,a!==null){l=a.coordinates;var I=a.type;switch(c=r&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(t(l,u,_,M,L)===!1)return!1;u++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],u,_,M,L)===!1)return!1;u++,I==="MultiPoint"&&M++}I==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(t(l[n][i],u,_,M,L)===!1)return!1;u++}I==="MultiLineString"&&M++,I==="Polygon"&&L++}I==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(L=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(t(l[n][i][o],u,_,M,L)===!1)return!1;u++}L++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(bp(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function yp(e,t){var r,n,i,o,a,s,l,f,c,u,d=0,h=e.type==="FeatureCollection",g=e.type==="Feature",x=h?e.features.length:1;for(r=0;r<x;r++){for(s=h?e.features[r].geometry:g?e.geometry:e,f=h?e.features[r].properties:g?e.properties:{},c=h?e.features[r].bbox:g?e.bbox:void 0,u=h?e.features[r].id:g?e.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(o=l?s.geometries[i]:s,o===null){if(t(null,d,f,c,u)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,f,c,u)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,f,c,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function da(e,t){yp(e,function(r,n,i,o,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return t(_e(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var f=0;f<r.coordinates.length;f++){var c=r.coordinates[f],u={type:l,coordinates:c};if(t(_e(u,i),n,f)===!1)return!1}})}function Rf(e,t={}){let r=Pt(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return kv(r,t);case"MultiPolygon":return Lv(r,t);default:throw new Error("invalid poly")}}function kv(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return xp(n,i)}function Lv(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},o=[];return n.forEach(a=>{o.push(xp(a,i))}),Li(o)}function xp(e,t){return e.length>1?dp(e,t):up(e[0],t)}function Iv(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return da(e,i=>{da(t,o=>{if(n===!1)return!1;n=Bv(i.geometry,o.geometry,r)})}),n}function Bv(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return!Nv(e.coordinates,t.coordinates);case"LineString":return!v0(t,e);case"Polygon":return!Ne(e,t)}break;case"LineString":switch(t.type){case"Point":return!v0(e,t);case"LineString":return!Ov(e,t,r);case"Polygon":return!w0(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!Ne(t,e);case"LineString":return!w0(e,t,r);case"Polygon":return!Rv(t,e,r)}}return!1}function v0(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(Dv(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function Ov(e,t,r){return Jf(e,t,{ignoreSelfIntersections:r}).features.length>0}function w0(e,t,r){for(let i of t.coordinates)if(Ne(i,e))return!0;return Jf(t,Rf(e),{ignoreSelfIntersections:r}).features.length>0}function Rv(e,t,r){for(let i of e.coordinates[0])if(Ne(i,t))return!0;for(let i of t.coordinates[0])if(Ne(i,e))return!0;return Jf(Rf(e),Rf(t),{ignoreSelfIntersections:r}).features.length>0}function Dv(e,t,r){let n=r[0]-e[0],i=r[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return n*a-i*o!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}function Nv(e,t){return e[0]===t[0]&&e[1]===t[1]}function zv(e,t,{ignoreSelfIntersections:r=!0}={}){let n=!1;return da(e,i=>{da(t,o=>{if(n===!0)return!0;n=!Iv(i.geometry,o.geometry,{ignoreSelfIntersections:r})})}),n}var vp=zv;function Uv({geojson:e,spatialFilter:t,uniqueIdProperty:r}){let n=0,i=new Map;if(!t)return[];for(let o of e.features){let a=r?o.properties[r]:++n;!i.has(a)&&vp(t,o)&&i.set(a,o.properties)}return Array.from(i.values())}var YC=1/Math.PI*180,KC=1/180*Math.PI,qv={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...qv}};var XC=globalThis.mathgl.config;function Gv(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Df(e,t,r){return Gv(e)?e.map((n,i)=>Df(n,t[i],r)):r*t+(1-r)*e}function _0(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Xe=Math.PI,wp=Xe/4,E0=Xe/180,S0=180/Xe,ha=512;function Nf(e){let[t,r]=e;_0(Number.isFinite(t)),_0(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=t*E0,i=r*E0,o=ha*(n+Xe)/(2*Xe),a=ha*(Xe+Math.log(Math.tan(wp+i*.5)))/(2*Xe);return[o,a]}function Vv(e){let[t,r]=e,n=t/ha*(2*Xe)-Xe,i=2*(Math.atan(Math.exp(r/ha*(2*Xe)-Xe))-wp);return[n*S0,i*S0]}var QC=Math.PI/180,$v={Point:_p,MultiPoint:Zv,LineString:Ep,MultiLineString:jv,Polygon:Sp,MultiPolygon:Wv};function Hv(e,t){let[r,n,i,o]=t,a=Nf([r,o]),s=Nf([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=$v[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function _p([e,t],[r,n]){let i=Df(r[0],n[0],e),o=Df(r[1],n[1],t);return Vv([i,o])}function el(e,t){return e.map(r=>_p(r,t))}function Zv(e,t){return el(e,t)}function Ep(e,t){return el(e,t)}function jv(e,t){return e.map(r=>Ep(r,t))}function Sp(e,t){return e.map(r=>el(r,t))}function Wv(e,t){return e.map(r=>Sp(r,t))}function Yv(e,t={}){let r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");let a=[r,n];return Qf([[a,[i,n],[i,o],[r,o],a]],t.properties,{bbox:e,id:t.id})}var Kv=Yv;function pa(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return bp(e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}function ga(e,t,r={}){let n=pp(e),i=Mi(t);for(let o=0;o<i.length-1;o++){let a=!1;if(r.ignoreEndVertices&&(o===0&&(a="start"),o===i.length-2&&(a="end"),o===0&&o+1===i.length-1&&(a="both")),Xv(i[o],i[o+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function Xv(e,t,r,n,i){let o=r[0],a=r[1],s=e[0],l=e[1],f=t[0],c=t[1],u=r[0]-s,d=r[1]-l,h=f-s,g=c-l,x=u*g-d*h;if(i!==null){if(Math.abs(x)>i)return!1}else if(x!==0)return!1;if(Math.abs(h)===Math.abs(g)&&Math.abs(h)===0)return n?!1:r[0]===e[0]&&r[1]===e[1];if(n){if(n==="start")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<=f:f<=o&&o<s:g>0?l<a&&a<=c:c<=a&&a<l;if(n==="end")return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<f:f<o&&o<=s:g>0?l<=a&&a<c:c<a&&a<=l;if(n==="both")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<f:f<o&&o<s:g>0?l<a&&a<c:c<a&&a<l}else return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<=f:f<=o&&o<=s:g>0?l<=a&&a<=c:c<=a&&a<=l;return!1}function Qv(e,t){var r=Pt(e),n=Pt(t),i=r.type,o=n.type;switch(i){case"Point":switch(o){case"MultiPoint":return Jv(r,n);case"LineString":return ga(r,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ne(r,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return e2(r,n);case"LineString":return t2(r,n);case"Polygon":case"MultiPolygon":return r2(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return n2(r,n);case"Polygon":case"MultiPolygon":return i2(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return o2(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Jv(e,t){var r,n=!1;for(r=0;r<t.coordinates.length;r++)if(Cp(t.coordinates[r],e.coordinates)){n=!0;break}return n}function e2(e,t){for(var r=0;r<e.coordinates.length;r++){for(var n=!1,i=0;i<t.coordinates.length;i++)Cp(e.coordinates[r],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function t2(e,t){for(var r=!1,n=0;n<e.coordinates.length;n++){if(!ga(e.coordinates[n],t))return!1;r||(r=ga(e.coordinates[n],t,{ignoreEndVertices:!0}))}return r}function r2(e,t){for(var r=!0,n=!1,i=!1,o=0;o<e.coordinates.length;o++){if(i=Ne(e.coordinates[o],t),!i){r=!1;break}n||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0}))}return r&&i}function n2(e,t){for(var r=0;r<e.coordinates.length;r++)if(!ga(e.coordinates[r],t))return!1;return!0}function i2(e,t){var r=pa(t),n=pa(e);if(!Tp(r,n))return!1;for(var i=!1,o=0;o<e.coordinates.length;o++){if(!Ne(e.coordinates[o],t))return!1;if(i||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0})),!i&&o<e.coordinates.length-1){var a=a2(e.coordinates[o],e.coordinates[o+1]);i=Ne(a,t,{ignoreBoundary:!0})}}return i}function o2(e,t){var r=pa(e),n=pa(t);if(!Tp(n,r))return!1;for(var i=0;i<e.coordinates[0].length;i++)if(!Ne(e.coordinates[0][i],t))return!1;return!0}function Tp(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function Cp(e,t){return e[0]===t[0]&&e[1]===t[1]}function a2(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var Ap=Qv,s2=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Af=Math.ceil,Oe=Math.floor,ve="[BigNumber Error] ",T0=ve+"Number primitive has more than 15 significant digits: ",Ye=1e14,G=14,Pf=9007199254740991,Ff=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],$t=1e7,fe=1e9;function Pp(e){var t,r,n,i=v.prototype={constructor:v,toString:null,valueOf:null},o=new v(1),a=20,s=4,l=-7,f=21,c=-1e7,u=1e7,d=!1,h=1,g=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",_=!0;function v(p,m){var b,y,w,S,P,E,C,F,A=this;if(!(A instanceof v))return new v(p,m);if(m==null){if(p&&p._isBigNumber===!0){A.s=p.s,!p.c||p.e>u?A.c=A.e=null:p.e<c?A.c=[A.e=0]:(A.e=p.e,A.c=p.c.slice());return}if((E=typeof p=="number")&&p*0==0){if(A.s=1/p<0?(p=-p,-1):1,p===~~p){for(S=0,P=p;P>=10;P/=10,S++);S>u?A.c=A.e=null:(A.e=S,A.c=[p]);return}F=String(p)}else{if(!s2.test(F=String(p)))return n(A,F,E);A.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(S=F.indexOf("."))>-1&&(F=F.replace(".","")),(P=F.search(/e/i))>0?(S<0&&(S=P),S+=+F.slice(P+1),F=F.substring(0,P)):S<0&&(S=F.length)}else{if(te(m,2,T.length,"Base"),m==10&&_)return A=new v(p),R(A,a+A.e+1,s);if(F=String(p),E=typeof p=="number"){if(p*0!=0)return n(A,F,E,m);if(A.s=1/p<0?(F=F.slice(1),-1):1,v.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(T0+p)}else A.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(b=T.slice(0,m),S=P=0,C=F.length;P<C;P++)if(b.indexOf(y=F.charAt(P))<0){if(y=="."){if(P>S){S=C;continue}}else if(!w&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){w=!0,P=-1,S=0;continue}return n(A,String(p),E,m)}E=!1,F=r(F,m,10,A.s),(S=F.indexOf("."))>-1?F=F.replace(".",""):S=F.length}for(P=0;F.charCodeAt(P)===48;P++);for(C=F.length;F.charCodeAt(--C)===48;);if(F=F.slice(P,++C)){if(C-=P,E&&v.DEBUG&&C>15&&(p>Pf||p!==Oe(p)))throw Error(T0+A.s*p);if((S=S-P-1)>u)A.c=A.e=null;else if(S<c)A.c=[A.e=0];else{if(A.e=S,A.c=[],P=(S+1)%G,S<0&&(P+=G),P<C){for(P&&A.c.push(+F.slice(0,P)),C-=G;P<C;)A.c.push(+F.slice(P,P+=G));P=G-(F=F.slice(P)).length}else P-=C;for(;P--;F+="0");A.c.push(+F)}}else A.c=[A.e=0]}v.clone=Pp,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(p){var m,b;if(p!=null)if(typeof p=="object"){if(p.hasOwnProperty(m="DECIMAL_PLACES")&&(b=p[m],te(b,0,fe,m),a=b),p.hasOwnProperty(m="ROUNDING_MODE")&&(b=p[m],te(b,0,8,m),s=b),p.hasOwnProperty(m="EXPONENTIAL_AT")&&(b=p[m],b&&b.pop?(te(b[0],-fe,0,m),te(b[1],0,fe,m),l=b[0],f=b[1]):(te(b,-fe,fe,m),l=-(f=b<0?-b:b))),p.hasOwnProperty(m="RANGE"))if(b=p[m],b&&b.pop)te(b[0],-fe,-1,m),te(b[1],1,fe,m),c=b[0],u=b[1];else if(te(b,-fe,fe,m),b)c=-(u=b<0?-b:b);else throw Error(ve+m+" cannot be zero: "+b);if(p.hasOwnProperty(m="CRYPTO"))if(b=p[m],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))d=b;else throw d=!b,Error(ve+"crypto unavailable");else d=b;else throw Error(ve+m+" not true or false: "+b);if(p.hasOwnProperty(m="MODULO_MODE")&&(b=p[m],te(b,0,9,m),h=b),p.hasOwnProperty(m="POW_PRECISION")&&(b=p[m],te(b,0,fe,m),g=b),p.hasOwnProperty(m="FORMAT"))if(b=p[m],typeof b=="object")x=b;else throw Error(ve+m+" not an object: "+b);if(p.hasOwnProperty(m="ALPHABET"))if(b=p[m],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))_=b.slice(0,10)=="0123456789",T=b;else throw Error(ve+m+" invalid: "+b)}else throw Error(ve+"Object expected: "+p);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,f],RANGE:[c,u],CRYPTO:d,MODULO_MODE:h,POW_PRECISION:g,FORMAT:x,ALPHABET:T}},v.isBigNumber=function(p){if(!p||p._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var m,b,y=p.c,w=p.e,S=p.s;e:if({}.toString.call(y)=="[object Array]"){if((S===1||S===-1)&&w>=-fe&&w<=fe&&w===Oe(w)){if(y[0]===0){if(w===0&&y.length===1)return!0;break e}if(m=(w+1)%G,m<1&&(m+=G),String(y[0]).length==m){for(m=0;m<y.length;m++)if(b=y[m],b<0||b>=Ye||b!==Oe(b))break e;if(b!==0)return!0}}}else if(y===null&&w===null&&(S===null||S===1||S===-1))return!0;throw Error(ve+"Invalid BigNumber: "+p)},v.maximum=v.max=function(){return L(arguments,-1)},v.minimum=v.min=function(){return L(arguments,1)},v.random=function(){var p=9007199254740992,m=Math.random()*p&2097151?function(){return Oe(Math.random()*p)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var y,w,S,P,E,C=0,F=[],A=new v(o);if(b==null?b=a:te(b,0,fe),P=Af(b/G),d)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(P*=2));C<P;)E=y[C]*131072+(y[C+1]>>>11),E>=9e15?(w=crypto.getRandomValues(new Uint32Array(2)),y[C]=w[0],y[C+1]=w[1]):(F.push(E%1e14),C+=2);C=P/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(P*=7);C<P;)E=(y[C]&31)*281474976710656+y[C+1]*1099511627776+y[C+2]*4294967296+y[C+3]*16777216+(y[C+4]<<16)+(y[C+5]<<8)+y[C+6],E>=9e15?crypto.randomBytes(7).copy(y,C):(F.push(E%1e14),C+=7);C=P/7}else throw d=!1,Error(ve+"crypto unavailable");if(!d)for(;C<P;)E=m(),E<9e15&&(F[C++]=E%1e14);for(P=F[--C],b%=G,P&&b&&(E=Ff[G-b],F[C]=Oe(P/E)*E);F[C]===0;F.pop(),C--);if(C<0)F=[S=0];else{for(S=-1;F[0]===0;F.splice(0,1),S-=G);for(C=1,E=F[0];E>=10;E/=10,C++);C<G&&(S-=G-C)}return A.e=S,A.c=F,A}}(),v.sum=function(){for(var p=1,m=arguments,b=new v(m[0]);p<m.length;)b=b.plus(m[p++]);return b},r=function(){var p="0123456789";function m(b,y,w,S){for(var P,E=[0],C,F=0,A=b.length;F<A;){for(C=E.length;C--;E[C]*=y);for(E[0]+=S.indexOf(b.charAt(F++)),P=0;P<E.length;P++)E[P]>w-1&&(E[P+1]==null&&(E[P+1]=0),E[P+1]+=E[P]/w|0,E[P]%=w)}return E.reverse()}return function(b,y,w,S,P){var E,C,F,A,B,z,U,Z,re=b.indexOf("."),ae=a,H=s;for(re>=0&&(A=g,g=0,b=b.replace(".",""),Z=new v(y),z=Z.pow(b.length-re),g=A,Z.c=m(St(Be(z.c),z.e,"0"),10,w,p),Z.e=Z.c.length),U=m(b,y,w,P?(E=T,p):(E=p,T)),F=A=U.length;U[--A]==0;U.pop());if(!U[0])return E.charAt(0);if(re<0?--F:(z.c=U,z.e=F,z.s=S,z=t(z,Z,ae,H,w),U=z.c,B=z.r,F=z.e),C=F+ae+1,re=U[C],A=w/2,B=B||C<0||U[C+1]!=null,B=H<4?(re!=null||B)&&(H==0||H==(z.s<0?3:2)):re>A||re==A&&(H==4||B||H==6&&U[C-1]&1||H==(z.s<0?8:7)),C<1||!U[0])b=B?St(E.charAt(1),-ae,E.charAt(0)):E.charAt(0);else{if(U.length=C,B)for(--w;++U[--C]>w;)U[C]=0,C||(++F,U=[1].concat(U));for(A=U.length;!U[--A];);for(re=0,b="";re<=A;b+=E.charAt(U[re++]));b=St(b,F,E.charAt(0))}return b}}(),t=function(){function p(y,w,S){var P,E,C,F,A=0,B=y.length,z=w%$t,U=w/$t|0;for(y=y.slice();B--;)C=y[B]%$t,F=y[B]/$t|0,P=U*C+F*z,E=z*C+P%$t*$t+A,A=(E/S|0)+(P/$t|0)+U*F,y[B]=E%S;return A&&(y=[A].concat(y)),y}function m(y,w,S,P){var E,C;if(S!=P)C=S>P?1:-1;else for(E=C=0;E<S;E++)if(y[E]!=w[E]){C=y[E]>w[E]?1:-1;break}return C}function b(y,w,S,P){for(var E=0;S--;)y[S]-=E,E=y[S]<w[S]?1:0,y[S]=E*P+y[S]-w[S];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,w,S,P,E){var C,F,A,B,z,U,Z,re,ae,H,K,ce,Ui,Va,$a,Je,hn,Fe=y.s==w.s?1:-1,he=y.c,ne=w.c;if(!he||!he[0]||!ne||!ne[0])return new v(!y.s||!w.s||(he?ne&&he[0]==ne[0]:!ne)?NaN:he&&he[0]==0||!ne?Fe*0:Fe/0);for(re=new v(Fe),ae=re.c=[],F=y.e-w.e,Fe=S+F+1,E||(E=Ye,F=Re(y.e/G)-Re(w.e/G),Fe=Fe/G|0),A=0;ne[A]==(he[A]||0);A++);if(ne[A]>(he[A]||0)&&F--,Fe<0)ae.push(1),B=!0;else{for(Va=he.length,Je=ne.length,A=0,Fe+=2,z=Oe(E/(ne[0]+1)),z>1&&(ne=p(ne,z,E),he=p(he,z,E),Je=ne.length,Va=he.length),Ui=Je,H=he.slice(0,Je),K=H.length;K<Je;H[K++]=0);hn=ne.slice(),hn=[0].concat(hn),$a=ne[0],ne[1]>=E/2&&$a++;do{if(z=0,C=m(ne,H,Je,K),C<0){if(ce=H[0],Je!=K&&(ce=ce*E+(H[1]||0)),z=Oe(ce/$a),z>1)for(z>=E&&(z=E-1),U=p(ne,z,E),Z=U.length,K=H.length;m(U,H,Z,K)==1;)z--,b(U,Je<Z?hn:ne,Z,E),Z=U.length,C=1;else z==0&&(C=z=1),U=ne.slice(),Z=U.length;if(Z<K&&(U=[0].concat(U)),b(H,U,K,E),K=H.length,C==-1)for(;m(ne,H,Je,K)<1;)z++,b(H,Je<K?hn:ne,K,E),K=H.length}else C===0&&(z++,H=[0]);ae[A++]=z,H[0]?H[K++]=he[Ui]||0:(H=[he[Ui]],K=1)}while((Ui++<Va||H[0]!=null)&&Fe--);B=H[0]!=null,ae[0]||ae.splice(0,1)}if(E==Ye){for(A=1,Fe=ae[0];Fe>=10;Fe/=10,A++);R(re,S+(re.e=A+F*G-1)+1,P,B)}else re.e=F,re.r=+B;return re}}();function M(p,m,b,y){var w,S,P,E,C;if(b==null?b=s:te(b,0,8),!p.c)return p.toString();if(w=p.c[0],P=p.e,m==null)C=Be(p.c),C=y==1||y==2&&(P<=l||P>=f)?oa(C,P):St(C,P,"0");else if(p=R(new v(p),m,b),S=p.e,C=Be(p.c),E=C.length,y==1||y==2&&(m<=S||S<=l)){for(;E<m;C+="0",E++);C=oa(C,S)}else if(m-=P,C=St(C,S,"0"),S+1>E){if(--m>0)for(C+=".";m--;C+="0");}else if(m+=S-E,m>0)for(S+1==E&&(C+=".");m--;C+="0");return p.s<0&&w?"-"+C:C}function L(p,m){for(var b,y,w=1,S=new v(p[0]);w<p.length;w++)y=new v(p[w]),(!y.s||(b=xr(S,y))===m||b===0&&S.s===m)&&(S=y);return S}function I(p,m,b){for(var y=1,w=m.length;!m[--w];m.pop());for(w=m[0];w>=10;w/=10,y++);return(b=y+b*G-1)>u?p.c=p.e=null:b<c?p.c=[p.e=0]:(p.e=b,p.c=m),p}n=function(){var p=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,b=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,w=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(S,P,E,C){var F,A=E?P:P.replace(w,"");if(y.test(A))S.s=isNaN(A)?null:A<0?-1:1;else{if(!E&&(A=A.replace(p,function(B,z,U){return F=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!C||C==F?z:B}),C&&(F=C,A=A.replace(m,"$1").replace(b,"0.$1")),P!=A))return new v(A,F);if(v.DEBUG)throw Error(ve+"Not a"+(C?" base "+C:"")+" number: "+P);S.s=null}S.c=S.e=null}}();function R(p,m,b,y){var w,S,P,E,C,F,A,B=p.c,z=Ff;if(B){e:{for(w=1,E=B[0];E>=10;E/=10,w++);if(S=m-w,S<0)S+=G,P=m,C=B[F=0],A=Oe(C/z[w-P-1]%10);else if(F=Af((S+1)/G),F>=B.length)if(y){for(;B.length<=F;B.push(0));C=A=0,w=1,S%=G,P=S-G+1}else break e;else{for(C=E=B[F],w=1;E>=10;E/=10,w++);S%=G,P=S-G+w,A=P<0?0:Oe(C/z[w-P-1]%10)}if(y=y||m<0||B[F+1]!=null||(P<0?C:C%z[w-P-1]),y=b<4?(A||y)&&(b==0||b==(p.s<0?3:2)):A>5||A==5&&(b==4||y||b==6&&(S>0?P>0?C/z[w-P]:0:B[F-1])%10&1||b==(p.s<0?8:7)),m<1||!B[0])return B.length=0,y?(m-=p.e+1,B[0]=z[(G-m%G)%G],p.e=-m||0):B[0]=p.e=0,p;if(S==0?(B.length=F,E=1,F--):(B.length=F+1,E=z[G-S],B[F]=P>0?Oe(C/z[w-P]%z[P])*E:0),y)for(;;)if(F==0){for(S=1,P=B[0];P>=10;P/=10,S++);for(P=B[0]+=E,E=1;P>=10;P/=10,E++);S!=E&&(p.e++,B[0]==Ye&&(B[0]=1));break}else{if(B[F]+=E,B[F]!=Ye)break;B[F--]=0,E=1}for(S=B.length;B[--S]===0;B.pop());}p.e>u?p.c=p.e=null:p.e<c&&(p.c=[p.e=0])}return p}function N(p){var m,b=p.e;return b===null?p.toString():(m=Be(p.c),m=b<=l||b>=f?oa(m,b):St(m,b,"0"),p.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var p=new v(this);return p.s<0&&(p.s=1),p},i.comparedTo=function(p,m){return xr(this,new v(p,m))},i.decimalPlaces=i.dp=function(p,m){var b,y,w,S=this;if(p!=null)return te(p,0,fe),m==null?m=s:te(m,0,8),R(new v(S),p+S.e+1,m);if(!(b=S.c))return null;if(y=((w=b.length-1)-Re(this.e/G))*G,w=b[w])for(;w%10==0;w/=10,y--);return y<0&&(y=0),y},i.dividedBy=i.div=function(p,m){return t(this,new v(p,m),a,s)},i.dividedToIntegerBy=i.idiv=function(p,m){return t(this,new v(p,m),0,1)},i.exponentiatedBy=i.pow=function(p,m){var b,y,w,S,P,E,C,F,A,B=this;if(p=new v(p),p.c&&!p.isInteger())throw Error(ve+"Exponent not an integer: "+N(p));if(m!=null&&(m=new v(m)),E=p.e>14,!B.c||!B.c[0]||B.c[0]==1&&!B.e&&B.c.length==1||!p.c||!p.c[0])return A=new v(Math.pow(+N(B),E?p.s*(2-ia(p)):+N(p))),m?A.mod(m):A;if(C=p.s<0,m){if(m.c?!m.c[0]:!m.s)return new v(NaN);y=!C&&B.isInteger()&&m.isInteger(),y&&(B=B.mod(m))}else{if(p.e>9&&(B.e>0||B.e<-1||(B.e==0?B.c[0]>1||E&&B.c[1]>=24e7:B.c[0]<8e13||E&&B.c[0]<=9999975e7)))return S=B.s<0&&ia(p)?-0:0,B.e>-1&&(S=1/S),new v(C?1/S:S);g&&(S=Af(g/G+2))}for(E?(b=new v(.5),C&&(p.s=1),F=ia(p)):(w=Math.abs(+N(p)),F=w%2),A=new v(o);;){if(F){if(A=A.times(B),!A.c)break;S?A.c.length>S&&(A.c.length=S):y&&(A=A.mod(m))}if(w){if(w=Oe(w/2),w===0)break;F=w%2}else if(p=p.times(b),R(p,p.e+1,1),p.e>14)F=ia(p);else{if(w=+N(p),w===0)break;F=w%2}B=B.times(B),S?B.c&&B.c.length>S&&(B.c.length=S):y&&(B=B.mod(m))}return y?A:(C&&(A=o.div(A)),m?A.mod(m):S?R(A,g,s,P):A)},i.integerValue=function(p){var m=new v(this);return p==null?p=s:te(p,0,8),R(m,m.e+1,p)},i.isEqualTo=i.eq=function(p,m){return xr(this,new v(p,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(p,m){return xr(this,new v(p,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(p,m){return(m=xr(this,new v(p,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Re(this.e/G)>this.c.length-2},i.isLessThan=i.lt=function(p,m){return xr(this,new v(p,m))<0},i.isLessThanOrEqualTo=i.lte=function(p,m){return(m=xr(this,new v(p,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(p,m){var b,y,w,S,P=this,E=P.s;if(p=new v(p,m),m=p.s,!E||!m)return new v(NaN);if(E!=m)return p.s=-m,P.plus(p);var C=P.e/G,F=p.e/G,A=P.c,B=p.c;if(!C||!F){if(!A||!B)return A?(p.s=-m,p):new v(B?P:NaN);if(!A[0]||!B[0])return B[0]?(p.s=-m,p):new v(A[0]?P:s==3?-0:0)}if(C=Re(C),F=Re(F),A=A.slice(),E=C-F){for((S=E<0)?(E=-E,w=A):(F=C,w=B),w.reverse(),m=E;m--;w.push(0));w.reverse()}else for(y=(S=(E=A.length)<(m=B.length))?E:m,E=m=0;m<y;m++)if(A[m]!=B[m]){S=A[m]<B[m];break}if(S&&(w=A,A=B,B=w,p.s=-p.s),m=(y=B.length)-(b=A.length),m>0)for(;m--;A[b++]=0);for(m=Ye-1;y>E;){if(A[--y]<B[y]){for(b=y;b&&!A[--b];A[b]=m);--A[b],A[y]+=Ye}A[y]-=B[y]}for(;A[0]==0;A.splice(0,1),--F);return A[0]?I(p,A,F):(p.s=s==3?-1:1,p.c=[p.e=0],p)},i.modulo=i.mod=function(p,m){var b,y,w=this;return p=new v(p,m),!w.c||!p.s||p.c&&!p.c[0]?new v(NaN):!p.c||w.c&&!w.c[0]?new v(w):(h==9?(y=p.s,p.s=1,b=t(w,p,0,3),p.s=y,b.s*=y):b=t(w,p,0,h),p=w.minus(b.times(p)),!p.c[0]&&h==1&&(p.s=w.s),p)},i.multipliedBy=i.times=function(p,m){var b,y,w,S,P,E,C,F,A,B,z,U,Z,re,ae,H=this,K=H.c,ce=(p=new v(p,m)).c;if(!K||!ce||!K[0]||!ce[0])return!H.s||!p.s||K&&!K[0]&&!ce||ce&&!ce[0]&&!K?p.c=p.e=p.s=null:(p.s*=H.s,!K||!ce?p.c=p.e=null:(p.c=[0],p.e=0)),p;for(y=Re(H.e/G)+Re(p.e/G),p.s*=H.s,C=K.length,B=ce.length,C<B&&(Z=K,K=ce,ce=Z,w=C,C=B,B=w),w=C+B,Z=[];w--;Z.push(0));for(re=Ye,ae=$t,w=B;--w>=0;){for(b=0,z=ce[w]%ae,U=ce[w]/ae|0,P=C,S=w+P;S>w;)F=K[--P]%ae,A=K[P]/ae|0,E=U*F+A*z,F=z*F+E%ae*ae+Z[S]+b,b=(F/re|0)+(E/ae|0)+U*A,Z[S--]=F%re;Z[S]=b}return b?++y:Z.splice(0,1),I(p,Z,y)},i.negated=function(){var p=new v(this);return p.s=-p.s||null,p},i.plus=function(p,m){var b,y=this,w=y.s;if(p=new v(p,m),m=p.s,!w||!m)return new v(NaN);if(w!=m)return p.s=-m,y.minus(p);var S=y.e/G,P=p.e/G,E=y.c,C=p.c;if(!S||!P){if(!E||!C)return new v(w/0);if(!E[0]||!C[0])return C[0]?p:new v(E[0]?y:w*0)}if(S=Re(S),P=Re(P),E=E.slice(),w=S-P){for(w>0?(P=S,b=C):(w=-w,b=E),b.reverse();w--;b.push(0));b.reverse()}for(w=E.length,m=C.length,w-m<0&&(b=C,C=E,E=b,m=w),w=0;m;)w=(E[--m]=E[m]+C[m]+w)/Ye|0,E[m]=Ye===E[m]?0:E[m]%Ye;return w&&(E=[w].concat(E),++P),I(p,E,P)},i.precision=i.sd=function(p,m){var b,y,w,S=this;if(p!=null&&p!==!!p)return te(p,1,fe),m==null?m=s:te(m,0,8),R(new v(S),p,m);if(!(b=S.c))return null;if(w=b.length-1,y=w*G+1,w=b[w]){for(;w%10==0;w/=10,y--);for(w=b[0];w>=10;w/=10,y++);}return p&&S.e+1>y&&(y=S.e+1),y},i.shiftedBy=function(p){return te(p,-Pf,Pf),this.times("1e"+p)},i.squareRoot=i.sqrt=function(){var p,m,b,y,w,S=this,P=S.c,E=S.s,C=S.e,F=a+4,A=new v("0.5");if(E!==1||!P||!P[0])return new v(!E||E<0&&(!P||P[0])?NaN:P?S:1/0);if(E=Math.sqrt(+N(S)),E==0||E==1/0?(m=Be(P),(m.length+C)%2==0&&(m+="0"),E=Math.sqrt(+m),C=Re((C+1)/2)-(C<0||C%2),E==1/0?m="5e"+C:(m=E.toExponential(),m=m.slice(0,m.indexOf("e")+1)+C),b=new v(m)):b=new v(E+""),b.c[0]){for(C=b.e,E=C+F,E<3&&(E=0);;)if(w=b,b=A.times(w.plus(t(S,w,F,1))),Be(w.c).slice(0,E)===(m=Be(b.c)).slice(0,E))if(b.e<C&&--E,m=m.slice(E-3,E+1),m=="9999"||!y&&m=="4999"){if(!y&&(R(w,w.e+a+2,0),w.times(w).eq(S))){b=w;break}F+=4,E+=4,y=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(R(b,b.e+a+2,1),p=!b.times(b).eq(S));break}}return R(b,b.e+a+1,s,p)},i.toExponential=function(p,m){return p!=null&&(te(p,0,fe),p++),M(this,p,m,1)},i.toFixed=function(p,m){return p!=null&&(te(p,0,fe),p=p+this.e+1),M(this,p,m)},i.toFormat=function(p,m,b){var y,w=this;if(b==null)p!=null&&m&&typeof m=="object"?(b=m,m=null):p&&typeof p=="object"?(b=p,p=m=null):b=x;else if(typeof b!="object")throw Error(ve+"Argument not an object: "+b);if(y=w.toFixed(p,m),w.c){var S,P=y.split("."),E=+b.groupSize,C=+b.secondaryGroupSize,F=b.groupSeparator||"",A=P[0],B=P[1],z=w.s<0,U=z?A.slice(1):A,Z=U.length;if(C&&(S=E,E=C,C=S,Z-=S),E>0&&Z>0){for(S=Z%E||E,A=U.substr(0,S);S<Z;S+=E)A+=F+U.substr(S,E);C>0&&(A+=F+U.slice(S)),z&&(A="-"+A)}y=B?A+(b.decimalSeparator||"")+((C=+b.fractionGroupSize)?B.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):B):A}return(b.prefix||"")+y+(b.suffix||"")},i.toFraction=function(p){var m,b,y,w,S,P,E,C,F,A,B,z,U=this,Z=U.c;if(p!=null&&(E=new v(p),!E.isInteger()&&(E.c||E.s!==1)||E.lt(o)))throw Error(ve+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+N(E));if(!Z)return new v(U);for(m=new v(o),F=b=new v(o),y=C=new v(o),z=Be(Z),S=m.e=z.length-U.e-1,m.c[0]=Ff[(P=S%G)<0?G+P:P],p=!p||E.comparedTo(m)>0?S>0?m:F:E,P=u,u=1/0,E=new v(z),C.c[0]=0;A=t(E,m,0,1),w=b.plus(A.times(y)),w.comparedTo(p)!=1;)b=y,y=w,F=C.plus(A.times(w=F)),C=w,m=E.minus(A.times(w=m)),E=w;return w=t(p.minus(b),y,0,1),C=C.plus(w.times(F)),b=b.plus(w.times(y)),C.s=F.s=U.s,S=S*2,B=t(F,y,S,s).minus(U).abs().comparedTo(t(C,b,S,s).minus(U).abs())<1?[F,y]:[C,b],u=P,B},i.toNumber=function(){return+N(this)},i.toPrecision=function(p,m){return p!=null&&te(p,1,fe),M(this,p,m,2)},i.toString=function(p){var m,b=this,y=b.s,w=b.e;return w===null?y?(m="Infinity",y<0&&(m="-"+m)):m="NaN":(p==null?m=w<=l||w>=f?oa(Be(b.c),w):St(Be(b.c),w,"0"):p===10&&_?(b=R(new v(b),a+w+1,s),m=St(Be(b.c),b.e,"0")):(te(p,2,T.length,"Base"),m=r(St(Be(b.c),w,"0"),10,p,y,!0)),y<0&&b.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return N(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&v.set(e),v}function Re(e){var t=e|0;return e>0||e===t?t:t-1}function Be(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=G-t.length;r--;t="0"+t);o+=t}for(i=o.length;o.charCodeAt(--i)===48;);return o.slice(0,i+1||1)}function xr(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=l==f,!i||!o)return n?0:!i^r?1:-1;if(!n)return l>f^r?1:-1;for(s=(l=i.length)<(f=o.length)?l:f,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return l==f?0:l>f^r?1:-1}function te(e,t,r,n){if(e<t||e>r||e!==Oe(e))throw Error(ve+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ia(e){var t=e.c.length-1;return Re(e.e/G)==t&&e.c[t]%2!=0}function oa(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function St(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var f2=Pp(),ht=f2,l2=class{constructor(e){D(this,"key"),D(this,"left",null),D(this,"right",null),this.key=e}},Ei=class extends l2{constructor(e){super(e)}},c2=class{constructor(){D(this,"size",0),D(this,"modificationCount",0),D(this,"splayCount",0)}splay(e){let t=this.root;if(t==null)return this.compare(e,e),-1;let r=null,n=null,i=null,o=null,a=t,s=this.compare,l;for(;;)if(l=s(a.key,e),l>0){let f=a.left;if(f==null||(l=s(f.key,e),l>0&&(a.left=f.right,f.right=a,a=f,f=a.left,f==null)))break;r==null?n=a:r.left=a,r=a,a=f}else if(l<0){let f=a.right;if(f==null||(l=s(f.key,e),l<0&&(a.right=f.left,f.left=a,a=f,f=a.right,f==null)))break;i==null?o=a:i.right=a,i=a,a=f}else break;return i!=null&&(i.right=a.left,a.left=o),r!=null&&(r.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),l}splayMin(e){let t=e,r=t.left;for(;r!=null;){let n=r;t.left=n.right,n.right=t,t=n,r=t.left}return t}splayMax(e){let t=e,r=t.right;for(;r!=null;){let n=r;t.right=n.left,n.left=t,t=n,r=t.right}return t}_delete(e){if(this.root==null||this.splay(e)!=0)return null;let r=this.root,n=r,i=r.left;if(this.size--,i==null)this.root=r.right;else{let o=r.right;r=this.splayMax(i),r.right=o,this.root=r}return this.modificationCount++,n}addNewRoot(e,t){this.size++,this.modificationCount++;let r=this.root;if(r==null){this.root=e;return}t<0?(e.left=r,e.right=r.right,r.right=null):(e.right=r,e.left=r.left,r.left=null),this.root=e}_first(){let e=this.root;return e==null?null:(this.root=this.splayMin(e),this.root)}_last(){let e=this.root;return e==null?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&this.splay(e)==0}defaultCompare(){return(e,t)=>e<t?-1:e>t?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}},C0,A0,ma=class Ci extends c2{constructor(t,r){super(),D(this,"root",null),D(this,"compare"),D(this,"validKey"),D(this,C0,"[object Set]"),this.compare=t??this.defaultCompare(),this.validKey=r??(n=>n!=null&&n!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(let r of t)this.delete(r)}forEach(t){let r=this[Symbol.iterator](),n;for(;n=r.next(),!n.done;)t(n.value,n.value,this)}add(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this}addAndReturn(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this.root.key}addAll(t){for(let r of t)this.add(r)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let n=this.root.left;if(n==null)return null;let i=n.right;for(;i!=null;)n=i,i=n.right;return n.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let n=this.root.right;if(n==null)return null;let i=n.left;for(;i!=null;)n=i,i=n.left;return n.key}retainAll(t){let r=new Ci(this.compare,this.validKey),n=this.modificationCount;for(let i of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(i)&&this.splay(i)==0&&r.add(this.root.key)}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)&&r.add(n);return r}difference(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)||r.add(n);return r}union(t){let r=this.clone();return r.addAll(t),r}clone(){let t=new Ci(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function r(i,o){let a,s;do{if(a=i.left,s=i.right,a!=null){let l=new Ei(a.key);o.left=l,r(a,l)}if(s!=null){let l=new Ei(s.key);o.right=l,i=s,o=l}}while(s!=null)}let n=new Ei(t.key);return r(t,n),n}toSet(){return this.clone()}entries(){return new d2(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(A0=Symbol.iterator,C0=Symbol.toStringTag,A0)](){return new u2(this.wrap())}},Fp=class{constructor(e){D(this,"tree"),D(this,"path",new Array),D(this,"modificationCount",null),D(this,"splayCount"),this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;e!=null;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let r=this.tree.getRoot();for(;r!=null;)this.path.push(r),r=r.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(t!=null){for(;t!=null;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}},u2=class extends Fp{getValue(e){return e.key}},d2=class extends Fp{getValue(e){return[e.key,e.key]}},Mp=e=>()=>e,zf=e=>{let t=e?(r,n)=>n.minus(r).abs().isLessThanOrEqualTo(e):Mp(!1);return(r,n)=>t(r,n)?0:r.comparedTo(n)};function h2(e){let t=e?(r,n,i,o,a)=>r.exponentiatedBy(2).isLessThanOrEqualTo(o.minus(n).exponentiatedBy(2).plus(a.minus(i).exponentiatedBy(2)).times(e)):Mp(!1);return(r,n,i)=>{let o=r.x,a=r.y,s=i.x,l=i.y,f=a.minus(l).times(n.x.minus(s)).minus(o.minus(s).times(n.y.minus(l)));return t(f,o,a,s,l)?0:f.comparedTo(0)}}var p2=e=>e,g2=e=>{if(e){let t=new ma(zf(e)),r=new ma(zf(e)),n=(o,a)=>a.addAndReturn(o),i=o=>({x:n(o.x,t),y:n(o.y,r)});return i({x:new ht(0),y:new ht(0)}),i}return p2},Uf=e=>({set:t=>{Ft=Uf(t)},reset:()=>Uf(e),compare:zf(e),snap:g2(e),orient:h2(e)}),Ft=Uf(),Si=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),qf=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;let r=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x,i=e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y,o=e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:o}}},ca=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),kp=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),ba=e=>kp(e,e).sqrt(),m2=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return ca(i,n).div(ba(i)).div(ba(n))},b2=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return kp(i,n).div(ba(i)).div(ba(n))},P0=(e,t,r)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(r.minus(e.y))),y:r},F0=(e,t,r)=>t.x.isZero()?null:{x:r,y:e.y.plus(t.y.div(t.x).times(r.minus(e.x)))},y2=(e,t,r,n)=>{if(t.x.isZero())return F0(r,n,e.x);if(n.x.isZero())return F0(e,t,r.x);if(t.y.isZero())return P0(r,n,e.y);if(n.y.isZero())return P0(e,t,r.y);let i=ca(t,n);if(i.isZero())return null;let o={x:r.x.minus(e.x),y:r.y.minus(e.y)},a=ca(o,t).div(i),s=ca(o,n).div(i),l=e.x.plus(s.times(t.x)),f=r.x.plus(a.times(n.x)),c=e.y.plus(s.times(t.y)),u=r.y.plus(a.times(n.y)),d=l.plus(f).div(2),h=c.plus(u).div(2);return{x:d,y:h}},dt=class Lp{constructor(t,r){D(this,"point"),D(this,"isLeft"),D(this,"segment"),D(this,"otherSE"),D(this,"consumedBy"),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}static compare(t,r){let n=Lp.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:ya.compare(t.segment,r.segment))}static comparePoints(t,r){return t.x.isLessThan(r.x)?-1:t.x.isGreaterThan(r.x)?1:t.y.isLessThan(r.y)?-1:t.y.isGreaterThan(r.y)?1:0}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let r=t.point.events;for(let n=0,i=r.length;n<i;n++){let o=r[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let r=0;r<t;r++){let n=this.point.events[r];if(n.segment.consumedBy===void 0)for(let i=r+1;i<t;i++){let o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){let t=[];for(let r=0,n=this.point.events.length;r<n;r++){let i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){let r=new Map,n=i=>{let o=i.otherSE;r.set(i,{sine:m2(this.point,t.point,o.point),cosine:b2(this.point,t.point,o.point)})};return(i,o)=>{r.has(i)||n(i),r.has(o)||n(o);let{sine:a,cosine:s}=r.get(i),{sine:l,cosine:f}=r.get(o);return a.isGreaterThanOrEqualTo(0)&&l.isGreaterThanOrEqualTo(0)?s.isLessThan(f)?1:s.isGreaterThan(f)?-1:0:a.isLessThan(0)&&l.isLessThan(0)?s.isLessThan(f)?-1:s.isGreaterThan(f)?1:0:l.isLessThan(a)?-1:l.isGreaterThan(a)?1:0}}},x2=class Gf{constructor(t){D(this,"events"),D(this,"poly"),D(this,"_isExteriorRing"),D(this,"_enclosingRing"),this.events=t;for(let r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}static factory(t){let r=[];for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o.isInResult()||o.ringOut)continue;let a=null,s=o.leftSE,l=o.rightSE,f=[s],c=s.point,u=[];for(;a=s,s=l,f.push(s),s.point!==c;)for(;;){let d=s.getAvailableLinkedEvents();if(d.length===0){let x=f[0].point,T=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${T.x}, ${T.y}].`)}if(d.length===1){l=d[0].otherSE;break}let h=null;for(let x=0,T=u.length;x<T;x++)if(u[x].point===s.point){h=x;break}if(h!==null){let x=u.splice(h)[0],T=f.splice(x.index);T.unshift(T[0].otherSE),r.push(new Gf(T.reverse()));continue}u.push({index:f.length,point:s.point});let g=s.getLeftmostComparator(a);l=d.sort(g)[0].otherSE;break}r.push(new Gf(f))}return r}getGeom(){let t=this.events[0].point,r=[t];for(let f=1,c=this.events.length-1;f<c;f++){let u=this.events[f].point,d=this.events[f+1].point;Ft.orient(u,t,d)!==0&&(r.push(u),t=u)}if(r.length===1)return null;let n=r[0],i=r[1];Ft.orient(n,t,i)===0&&r.shift(),r.push(r[0]);let o=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:r.length-1,s=this.isExteriorRing()?r.length:-1,l=[];for(let f=a;f!=s;f+=o)l.push([r[f].x.toNumber(),r[f].y.toNumber()]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){let a=this.events[i];dt.compare(t,a)>0&&(t=a)}let r=t.segment.prevInResult(),n=r?r.prevInResult():null;for(;;){if(!r)return null;if(!n)return r.ringOut;if(n.ringOut!==r.ringOut)return n.ringOut?.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut?.enclosingRing();r=n.prevInResult(),n=r?r.prevInResult():null}}},M0=class{constructor(e){D(this,"exteriorRing"),D(this,"interiorRings"),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=this.exteriorRing.getGeom();if(e===null)return null;let t=[e];for(let r=0,n=this.interiorRings.length;r<n;r++){let i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}},v2=class{constructor(e){D(this,"rings"),D(this,"polys"),this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getGeom();n!==null&&e.push(n)}return e}_composePolys(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(!i.poly)if(i.isExteriorRing())t.push(new M0(i));else{let o=i.enclosingRing();o?.poly||t.push(new M0(o)),o?.poly?.addInterior(i)}}return t}},w2=class{constructor(e,t=ya.compare){D(this,"queue"),D(this,"tree"),D(this,"segments"),this.queue=e,this.tree=new ma(t),this.segments=[]}process(e){let t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.delete(e.otherSE):this.tree.delete(t),r;e.isLeft&&this.tree.add(t);let n=t,i=t;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do i=this.tree.firstAfter(i);while(i!=null&&i.consumedBy!=null);if(e.isLeft){let o=null;if(n){let s=n.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(o=s),!n.isAnEndpoint(s))){let l=this._splitSafely(n,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}let a=null;if(i){let s=i.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(a=s),!i.isAnEndpoint(s))){let l=this._splitSafely(i,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}if(o!==null||a!==null){let s=null;o===null?s=a:a===null?s=o:s=dt.comparePoints(o,a)<=0?o:a,this.queue.delete(t.rightSE),r.push(t.rightSE);let l=t.split(s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}r.length>0?(this.tree.delete(t),r.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&i){let o=n.getIntersection(i);if(o!==null){if(!n.isAnEndpoint(o)){let a=this._splitSafely(n,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}if(!i.isAnEndpoint(o)){let a=this._splitSafely(i,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}}}this.tree.delete(t)}return r}_splitSafely(e,t){this.tree.delete(e);let r=e.rightSE;this.queue.delete(r);let n=e.split(t);return n.push(r),e.consumedBy===void 0&&this.tree.add(e),n}},_2=class{constructor(){D(this,"type"),D(this,"numMultiPolys")}run(e,t,r){Ai.type=e;let n=[new L0(t,!0)];for(let f=0,c=r.length;f<c;f++)n.push(new L0(r[f],!1));if(Ai.numMultiPolys=n.length,Ai.type==="difference"){let f=n[0],c=1;for(;c<n.length;)qf(n[c].bbox,f.bbox)!==null?c++:n.splice(c,1)}if(Ai.type==="intersection")for(let f=0,c=n.length;f<c;f++){let u=n[f];for(let d=f+1,h=n.length;d<h;d++)if(qf(u.bbox,n[d].bbox)===null)return[]}let i=new ma(dt.compare);for(let f=0,c=n.length;f<c;f++){let u=n[f].getSweepEvents();for(let d=0,h=u.length;d<h;d++)i.add(u[d])}let o=new w2(i),a=null;for(i.size!=0&&(a=i.first(),i.delete(a));a;){let f=o.process(a);for(let c=0,u=f.length;c<u;c++){let d=f[c];d.consumedBy===void 0&&i.add(d)}i.size!=0?(a=i.first(),i.delete(a)):a=null}Ft.reset();let s=x2.factory(o.segments);return new v2(s).getGeom()}},Ai=new _2,Vf=Ai,E2=0,ya=class ua{constructor(t,r,n,i){D(this,"id"),D(this,"leftSE"),D(this,"rightSE"),D(this,"rings"),D(this,"windings"),D(this,"ringOut"),D(this,"consumedBy"),D(this,"prev"),D(this,"_prevInResult"),D(this,"_beforeState"),D(this,"_afterState"),D(this,"_isInResult"),this.id=++E2,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}static compare(t,r){let n=t.leftSE.point.x,i=r.leftSE.point.x,o=t.rightSE.point.x,a=r.rightSE.point.x;if(a.isLessThan(n))return 1;if(o.isLessThan(i))return-1;let s=t.leftSE.point.y,l=r.leftSE.point.y,f=t.rightSE.point.y,c=r.rightSE.point.y;if(n.isLessThan(i)){if(l.isLessThan(s)&&l.isLessThan(f))return 1;if(l.isGreaterThan(s)&&l.isGreaterThan(f))return-1;let u=t.comparePoint(r.leftSE.point);if(u<0)return 1;if(u>0)return-1;let d=r.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n.isGreaterThan(i)){if(s.isLessThan(l)&&s.isLessThan(c))return-1;if(s.isGreaterThan(l)&&s.isGreaterThan(c))return 1;let u=r.comparePoint(t.leftSE.point);if(u!==0)return u;let d=t.comparePoint(r.rightSE.point);return d<0?1:d>0?-1:1}if(s.isLessThan(l))return-1;if(s.isGreaterThan(l))return 1;if(o.isLessThan(a)){let u=r.comparePoint(t.rightSE.point);if(u!==0)return u}if(o.isGreaterThan(a)){let u=t.comparePoint(r.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(!o.eq(a)){let u=f.minus(s),d=o.minus(n),h=c.minus(l),g=a.minus(i);if(u.isGreaterThan(d)&&h.isLessThan(g))return 1;if(u.isLessThan(d)&&h.isGreaterThan(g))return-1}return o.isGreaterThan(a)?1:o.isLessThan(a)||f.isLessThan(c)?-1:f.isGreaterThan(c)?1:t.id<r.id?-1:t.id>r.id?1:0}static fromRing(t,r,n){let i,o,a,s=dt.comparePoints(t,r);if(s<0)i=t,o=r,a=1;else if(s>0)i=r,o=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let l=new dt(i,!0),f=new dt(o,!1);return new ua(l,f,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(r)?t:r},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(r)?t:r}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return Ft.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let r=this.bbox(),n=t.bbox(),i=qf(r,n);if(i===null)return null;let o=this.leftSE.point,a=this.rightSE.point,s=t.leftSE.point,l=t.rightSE.point,f=Si(r,s)&&this.comparePoint(s)===0,c=Si(n,o)&&t.comparePoint(o)===0,u=Si(r,l)&&this.comparePoint(l)===0,d=Si(n,a)&&t.comparePoint(a)===0;if(c&&f)return d&&!u?a:!d&&u?l:null;if(c)return u&&o.x.eq(l.x)&&o.y.eq(l.y)?null:o;if(f)return d&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(d&&u)return null;if(d)return a;if(u)return l;let h=y2(o,this.vector(),s,t.vector());return h===null||!Si(i,h)?null:Ft.snap(h)}split(t){let r=[],n=t.events!==void 0,i=new dt(t,!0),o=new dt(t,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(i);let s=new ua(i,a,this.rings.slice(),this.windings.slice());return dt.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),dt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;let i=ua.compare(r,n);if(i!==0){if(i>0){let o=r;r=n,n=o}if(r.prev===n){let o=r;r=n,n=o}for(let o=0,a=n.rings.length;o<a;o++){let s=n.rings[o],l=n.windings[o],f=r.rings.indexOf(s);f===-1?(r.rings.push(s),r.windings.push(l)):r.windings[f]+=l}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let f=this.rings[s],c=this.windings[s],u=r.indexOf(f);u===-1?(r.push(f),n.push(c)):n[u]+=c}let o=[],a=[];for(let s=0,l=r.length;s<l;s++){if(n[s]===0)continue;let f=r[s],c=f.poly;if(a.indexOf(c)===-1)if(f.isExterior)o.push(c);else{a.indexOf(c)===-1&&a.push(c);let u=o.indexOf(f.poly);u!==-1&&o.splice(u,1)}}for(let s=0,l=o.length;s<l;s++){let f=o[s].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(Vf.type){case"union":{let n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<r.length?(n=t.length,i=r.length):(n=r.length,i=t.length),this._isInResult=i===Vf.numMultiPolys&&n<i;break}case"xor":{let n=Math.abs(t.length-r.length);this._isInResult=n%2===1;break}case"difference":{let n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(r);break}}return this._isInResult}},k0=class{constructor(e,t,r){if(D(this,"poly"),D(this,"isExterior"),D(this,"segments"),D(this,"bbox"),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=Ft.snap({x:new ht(e[0][0]),y:new ht(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let i=n;for(let o=1,a=e.length;o<a;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let s=Ft.snap({x:new ht(e[o][0]),y:new ht(e[o][1])});s.x.eq(i.x)&&s.y.eq(i.y)||(this.segments.push(ya.fromRing(i,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),i=s)}(!n.x.eq(i.x)||!n.y.eq(i.y))&&this.segments.push(ya.fromRing(i,n,this))}getSweepEvents(){let e=[];for(let t=0,r=this.segments.length;t<r;t++){let n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}},S2=class{constructor(e,t){if(D(this,"multiPoly"),D(this,"exteriorRing"),D(this,"interiorRings"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new k0(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,n=e.length;r<n;r++){let i=new k0(e[r],this,!1);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){let n=this.interiorRings[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}},L0=class{constructor(e,t){if(D(this,"isSubject"),D(this,"polys"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:new ht(Number.POSITIVE_INFINITY),y:new ht(Number.POSITIVE_INFINITY)},ur:{x:new ht(Number.NEGATIVE_INFINITY),y:new ht(Number.NEGATIVE_INFINITY)}};for(let r=0,n=e.length;r<n;r++){let i=new S2(e[r],this);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}getSweepEvents(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}};var T2=(e,...t)=>Vf.run("intersection",e,t),JC=Ft.set;function C2(e,t={}){let r=[];if(yp(e,i=>{r.push(i.coordinates)}),r.length<2)throw new Error("Must specify at least 2 geometries");let n=T2(r[0],...r.slice(1));return n.length===0?null:n.length===1?Qf(n[0],t.properties):hp(n,t.properties)}var Ip=C2,A2={Point:Bp,MultiPoint:F2,LineString:Op,MultiLineString:M2,Polygon:Rp,MultiPolygon:k2};function P2(e,t){let[r,n,i,o]=t,a=$f([r,o]),s=$f([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=A2[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function Bp([e,t],[r,n]){let i=I0(r[0],n[0],e),o=I0(r[1],n[1],t);return[i,o]}function tl(e,t){return e.map(r=>Bp($f(r),t))}function F2(e,t){return tl(e,t)}function Op(e,t){return tl(e,t)}function M2(e,t){return e.map(r=>Op(r,t))}function Rp(e,t){return e.map(r=>tl(r,t))}function k2(e,t){return e.map(r=>Rp(r,t))}function $f(e){return Nf(e)}function I0(e,t,r){return(r-e)/(t-e)}function L2(e,t,r){var n=e.length,i=on(e[0],t),o=[],a,s,l;let f,c;for(r||(r=[]),a=1;a<n;a++){for(f=e[a-1],c=e[a],s=l=on(c,t);;)if(i|s){if(i&s)break;i?(f=Zf(f,c,i,t),i=on(f,t)):(c=Zf(f,c,s,t),s=on(c,t))}else{o.push(f),s!==l?(o.push(c),a<n-1&&(r.push(o),o=[])):a===n-1&&o.push(c);break}i=l}return o.length&&r.push(o),r}function I2(e,t){var r,n,i,o,a,s,l;for(n=1;n<=8;n*=2){for(r=[],i=e[e.length-1],o=!(on(i,t)&n),a=0;a<e.length;a++)s=e[a],l=!(on(s,t)&n),l!==o&&r.push(Zf(i,s,n,t)),l&&r.push(s),i=s,o=l;if(e=r,!e.length)break}return r}function Zf(e,t,r,n){return r&8?[e[0]+(t[0]-e[0])*(n[3]-e[1])/(t[1]-e[1]),n[3]]:r&4?[e[0]+(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1]),n[1]]:r&2?[n[2],e[1]+(t[1]-e[1])*(n[2]-e[0])/(t[0]-e[0])]:r&1?[n[0],e[1]+(t[1]-e[1])*(n[0]-e[0])/(t[0]-e[0])]:null}function on(e,t){var r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}function B2(e,t){let r=Pt(e),n=r.type,i=e.type==="Feature"?e.properties:{},o=r.coordinates;switch(n){case"LineString":case"MultiLineString":{let a=[];return n==="LineString"&&(o=[o]),o.forEach(s=>{L2(s,t,a)}),a.length===1?up(a[0],i):dp(a,i)}case"Polygon":return Qf(B0(o,t),i);case"MultiPolygon":return hp(o.map(a=>B0(a,t)),i);default:throw new Error("geometry "+n+" not supported")}}function B0(e,t){let r=[];for(let n of e){let i=I2(n,t);i.length>0&&((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1])&&i.push(i[0]),i.length>=4&&r.push(i))}return r}var O0=B2;function O2(e,t,r){let n=Kv(e);if(!r||Ap(n,r))return!0;let i=Ip(Li([n,_e(r)]));return i?t==="mvt"?P2(i.geometry,e):i.geometry:!1}function R2(e,t,r){return Dp(e,t,r)}function Dp(e,t,r){let n=Fh(e);if(!r||Ap(n,r))return!0;let i=Ip(Li([_e(n),_e(r)]));if(!i)return!1;let o=Ph(i.geometry,t);return new Set(o)}var D2=[-180,-90,0,90],N2=[0,-90,180,90];function z2(e,t){if(!t)return!0;let r=_e(t),n=(0,Hf.polygonToCells)(O0(r,D2).geometry.coordinates,e,!0),i=(0,Hf.polygonToCells)(O0(r,N2).geometry.coordinates,e,!0);return new Set(n.concat(i))}var U2="__geomValue";function q2({tiles:e,tileFormat:t,spatialFilter:r,uniqueIdProperty:n,options:i}){let o=new Map;for(let a of e){if(a.isVisible===!1||!a.data)continue;let s=[a.bbox.west,a.bbox.south,a.bbox.east,a.bbox.north],l=O2(s,t,r);if(l===!1)continue;let f=l===!0?void 0:l;kf({map:o,spatialFilter:f,data:a.data.points,type:"Point",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),kf({map:o,spatialFilter:f,data:a.data.lines,type:"LineString",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),kf({map:o,spatialFilter:f,data:a.data.polygons,type:"Polygon",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i})}return Array.from(o.values())}function Np({map:e,data:t,startIndex:r,endIndex:n,type:i,bbox:o,tileFormat:a,uniqueIdProperty:s,storeGeometry:l,spatialFilter:f}){let c=$2(t,r),u=Z2(c,s,e);if(!u||e.has(u))return;let d=null;if(l||f){let{positions:g}=t,x=W2(r,n,g);d=j2(x,i)}if(d&&f&&!vp(d,f))return;let h=H2(c);l&&d&&(h[U2]=a==="mvt"?Hv(d,o):d),e.set(u,h)}function G2({map:e,data:t,spatialFilter:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){let l=zp(t,n),f=s?.storeGeometry||!1;for(let c=0;c<l.length-1;c++){let u=l[c],d=l[c+1];Np({map:e,data:t,startIndex:u,endIndex:d,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,storeGeometry:f,spatialFilter:r})}}function zp(e,t){let r;switch(t){case"Polygon":r=e.primitivePolygonIndices;break;case"LineString":r=e.pathIndices;break;case"Point":r=K2(e);break;default:throw new Error(`Unsupported geometry type: ${t}`)}return r.value}function V2(e,t){return e.featureIds.value[t]}function $2(e,t){let r=V2(e,t),{properties:n,numericProps:i,fields:o}=e,a={uniqueId:o?.[r]?.id,properties:n[r],numericProps:{}};for(let s in i)a.numericProps[s]=i[s].value[t];return a}function H2(e){let{properties:t,numericProps:r}=e;return Object.assign({},t,r)}function Z2(e,t,r){if(t)return Mf(e,t);if(e.uniqueId)return e.uniqueId;let n=r.size+1;return Mf(e,"cartodb_id")||Mf(e,"geoid")||n}function Mf(e,t){let{properties:r,numericProps:n}=e;return n[t]||r[t]}function j2(e,t){switch(t){case"Polygon":return{type:"Polygon",coordinates:[e]};case"LineString":return{type:"LineString",coordinates:e};case"Point":return{type:"Point",coordinates:e[0]};default:throw new Error("Invalid geometry type")}}function W2(e,t,r){let n=[];for(let i=e;i<t;i++)n.push(Array.from(r.value.subarray(i*r.size,(i+1)*r.size)));return n}function kf({map:e,spatialFilter:t,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){r?.properties.length&&(t?G2({map:e,data:r,spatialFilter:t,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}):Y2({map:e,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}))}function Y2({map:e,data:t,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,options:a}){let s=zp(t,r),l=a?.storeGeometry||!1;for(let f=0;f<s.length-1;f++){let c=s[f],u=s[f+1];Np({map:e,data:t,startIndex:c,endIndex:u,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,storeGeometry:l})}}function K2(e){let t=e.featureIds.value,r=t[t.length-1],n=t.constructor,i={value:new n(t.length+1),size:1};return i.value.set(t),i.value.set([r+1],t.length),i}function X2({tiles:e,spatialFilter:t,spatialDataColumn:r,spatialDataType:n}){let i=new Map,o=ew(n),a=J2(e,o),s=r||o;if(!a)return[];let l;o==="h3"&&(l=z2(a,t));for(let f of e)if(!(f.isVisible===!1||!f.data)){if(o==="quadbin"){let c=Q2(f,o);l=Dp(c,a,t)}l&&f.data.forEach(c=>{(l===!0||l.has(c.id))&&i.set(c.id,{...c.properties,[s]:c.id})})}return Array.from(i.values())}function Q2(e,t){return t==="quadbin"?e.index.q:e.id}function J2(e,t){let r=e.find(n=>n.data?.length)?.data;if(r){if(t==="quadbin")return Number(Uo(r[0].id));if(t==="h3")return(0,Up.getResolution)(r[0].id)}}function ew(e){switch(e){case"h3":return"h3";case"quadbin":return"quadbin";default:throw new Error("Unexpected spatial data type")}}var tw="3.4",Sr="geom",qp=7e3,fn=.5,rw=1,rl=4,nl=6,Gp="__aggregationValue",nw=`1 AS ${Gp}`;function iw({tiles:e,...t}){let r={};for(let s of t.rasterMetadata.bands)r[s.name]={...s,nodata:Number(s.nodata)};if(e=e.filter(aw),e.length===0)return[];let n=Uo(e[0].index.q),i=e[0].data.blockSize,o=n+BigInt(Math.log2(i)),a=new Map;for(let s of e){let l=s.index.q,f=R2(l,o,t.spatialFilter);if(f===!1)continue;let c=sw(l,o);for(let u=0;u<c.length;u++){if(f!==!0&&!f.has(c[u]))continue;let d={},h=!1;for(let g in s.data.cells.numericProps){let x=s.data.cells.numericProps[g].value[u],T=r[g];fw(x,T.nodata)&&(d[g]=s.data.cells.numericProps[g].value[u],h=!0)}h&&a.set(c[u],d)}}return Array.from(a.values())}function ow(e){return!!e.data?.cells}function aw(e){return!!(e.isVisible&&e.data?.cells?.numericProps)}function sw(e,t){let r=Ys(e),n=Number(t),i=2**(n-r.z),o=r.x*i,a=r.y*i,s=[];for(let l=0,f=i**2;l<f;l++){let c=o+l%i,u=a+Math.floor(l/i);s.push(Ws({x:c,y:u,z:n}))}return s}function fw(e,t){return Number.isNaN(e)?!1:t!==e}var nA=new Set(Object.values(Kf));function At(e){return Array.isArray(e)?e.map(t=>At(t)):typeof e!="object"?e:Object.entries(e).reduce((t,[r,n])=>(t[r.toLowerCase()]=typeof n=="object"&&n?At(n):n,t),{})}function J(e,t){if(!e)throw new Error(t)}var Vp=class Pi extends Error{constructor(t){super(`${Pi.NAME}: ${t}`),this.name=Pi.NAME}static is(t){return t instanceof Pi||t.message?.includes(Pi.NAME)}};D(Vp,"NAME","InvalidColumnError");var jf=Vp;function lw(e){for(let t in e)return!1;return!0}var cw=e=>e!==null&&typeof e=="object",$p=e=>cw(e)&&e.constructor==={}.constructor;function uw(e,...t){for(let r of t)for(let n in r)r[n]!==void 0&&(e[n]=r[n]);return e}function _a(e,t,r){let n=r.find(i=>i.name===t);return n&&n.type==="geometry"?"geo":e}function dw({tiles:e,spatialFilter:t,uniqueIdProperty:r,tileFormat:n,spatialDataColumn:i=Sr,spatialDataType:o,rasterMetadata:a,storeGeometry:s=!1}){return o==="geo"?q2({tiles:e,tileFormat:n,spatialFilter:t,uniqueIdProperty:r,options:{storeGeometry:s}}):e.some(ow)?(J(a,"Missing raster metadata"),iw({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o,rasterMetadata:a})):X2({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o})}var Tr=class extends Error{constructor(e,t,r,n){let i="Failed to connect";r&&(i="Server returned: ",r.status===400?i+="Bad request":r.status===401||r.status===403?i+="Unauthorized access":r.status===404?i+="Not found":i+="Error",i+=` (${r.status}):`),i+=` ${e.message||e}`;let o=`${t.requestType} API request failed`;o+=`
171
171
  ${i}`;for(let a of Object.keys(t))a!=="requestType"&&(o+=`
172
172
  ${hw(a)}: ${t[a]}`);o+=`
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.3.0-alpha.5",
6
+ "version": "9.3.0-alpha.6",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -43,14 +43,14 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@carto/api-client": "^0.5.19",
46
- "@loaders.gl/compression": "^4.4.0-alpha.18",
47
- "@loaders.gl/gis": "^4.4.0-alpha.18",
48
- "@loaders.gl/loader-utils": "^4.4.0-alpha.18",
49
- "@loaders.gl/mvt": "^4.4.0-alpha.18",
50
- "@loaders.gl/schema": "^4.4.0-alpha.18",
51
- "@loaders.gl/tiles": "^4.4.0-alpha.18",
52
- "@luma.gl/core": "^9.3.0-alpha.10",
53
- "@luma.gl/shadertools": "^9.3.0-alpha.10",
46
+ "@loaders.gl/compression": "^4.4.1",
47
+ "@loaders.gl/gis": "^4.4.1",
48
+ "@loaders.gl/loader-utils": "^4.4.1",
49
+ "@loaders.gl/mvt": "^4.4.1",
50
+ "@loaders.gl/schema": "^4.4.1",
51
+ "@loaders.gl/tiles": "^4.4.1",
52
+ "@luma.gl/core": "^9.3.2",
53
+ "@luma.gl/shadertools": "^9.3.2",
54
54
  "@math.gl/web-mercator": "^4.1.0",
55
55
  "@types/d3-array": "^3.0.2",
56
56
  "@types/d3-color": "^1.4.2",
@@ -72,8 +72,8 @@
72
72
  "@deck.gl/extensions": "~9.3.0-alpha.1",
73
73
  "@deck.gl/geo-layers": "~9.3.0-alpha.1",
74
74
  "@deck.gl/layers": "~9.3.0-alpha.1",
75
- "@loaders.gl/core": "^4.4.0-alpha.18",
76
- "@luma.gl/core": "~9.3.0-alpha.10"
75
+ "@loaders.gl/core": "^4.4.1",
76
+ "@luma.gl/core": "~9.3.2"
77
77
  },
78
- "gitHead": "c3ad1cee357af674cc31df37979d61325baf9d7a"
78
+ "gitHead": "6aff0d4eccd01a06a388ab1c07042a94daa3eb31"
79
79
  }