@file-viewer/renderer-geo 3.3.4 → 3.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export const maplibreWorkerSource = "/*!\nCopyright (c) 2023, MapLibre contributors\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n * Neither the name of MapLibre GL JS nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n-------------------------------------------------------------------------------\n\nContains code from mapbox-gl-js v1.13 and earlier\n\nVersion v1.13 of mapbox-gl-js and earlier are licensed under a BSD-3-Clause license\n\nCopyright (c) 2020, Mapbox\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n* Neither the name of Mapbox GL JS nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n-------------------------------------------------------------------------------\n\nContains code from glfx.js\n\nCopyright (C) 2011 by Evan Wallace\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n--------------------------------------------------------------------------------\n\nContains a portion of d3-color https://github.com/d3/d3-color\n\nCopyright 2010-2016 Mike Bostock\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n* Neither the name of the author nor the names of contributors may be used to\n endorse or promote products derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n(()=>{/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.16.0/LICENSE.txt\n*/var S1=Object.create,vp=Object.defineProperty,A1=Object.getOwnPropertyDescriptor,E1=Object.getOwnPropertyNames,F1=Object.getPrototypeOf,bp=Object.prototype.hasOwnProperty,Sl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports),I1=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(var n=E1(e),a=0,s=n.length,o;a<s;a++)o=n[a],!bp.call(t,o)&&o!==r&&vp(t,o,{get:(l=>e[l]).bind(null,o),enumerable:!(i=A1(e,o))||i.enumerable});return t},T1=(t,e,r)=>(r=t==null?{}:S1(F1(t)),I1(e||!t||!t.__esModule||!bp.call(t,\"default\")?vp(r,\"default\",{value:t,enumerable:!0}):r,t));function B(t,e){this.x=t,this.y=e}B.prototype={clone(){return new B(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t))return new B(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new B(+t.x,+t.y);throw Error(\"Expected [x, y] or {x, y} point format\")};function k1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var ks;function C1(){return ks??(ks=typeof OffscreenCanvas<\"u\"&&!!new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),ks}var qn;function P1(){if(qn==null&&(qn=!1,C1())){let t=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){qn=!0;break}}}return qn||!1}var sh=typeof Float32Array<\"u\"?Float32Array:Array;function M1(){var t=new sh(4);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function B1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=M1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();var xt=8192;function ya(t){return t instanceof Error?t:Error(typeof t==\"string\"?t:String(t))}function z1(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function L1(t,e,r,i){return k1(t,e,r,i)}L1(.25,.1,.25,1);function _e(t,e,r){return Math.min(r,Math.max(e,t))}function V1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Wt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function O1(t){return Math.log(t)/Math.LN2%1==0}function ma(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function R1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function no(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!no(t[r],e[r]))return!1;return!0}if(typeof t==\"object\"&&t&&e!==null){if(typeof e!=\"object\"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!no(t[r],e[r]))return!1;return!0}return t===e}function Ze(t){return Array.isArray(t)?t.map(Ze):typeof t==\"object\"&&t?ma(t,Ze):t}var oh={};function Ct(t){oh[t]||(typeof console<\"u\"&&console.warn(t),oh[t]=!0)}function He(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function Kr(t){return typeof WorkerGlobalScope<\"u\"&&t!==void 0&&t instanceof WorkerGlobalScope}function Al(t){return typeof ImageBitmap<\"u\"&&t instanceof ImageBitmap}function $1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}async function N1(t,e,r,i,n){if(typeof VideoFrame>\"u\")throw Error(\"VideoFrame not supported\");let a=new VideoFrame(t,{timestamp:0});try{let s=a?.format;if(!s||!(s.startsWith(\"BGR\")||s.startsWith(\"RGB\")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith(\"BGR\"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,$1(t,e,r,i,n)),o)for(let u=0;u<l.length;u+=4){let h=l[u];l[u]=l[u+2],l[u+2]=h}return l}finally{a.close()}}var Ei,Fi;function U1(t,e,r,i,n){let a=t.width,s=t.height;(!Ei||!Fi)&&(Ei=new OffscreenCanvas(a,s),Fi=Ei.getContext(\"2d\",{willReadFrequently:!0})),Ei.width=a,Ei.height=s,Fi.drawImage(t,0,0,a,s);let o=Fi.getImageData(e,r,i,n);return Fi.clearRect(0,0,a,s),o.data}async function j1(t,e,r,i,n){if(P1())try{return await N1(t,e,r,i,n)}catch{}return U1(t,e,r,i,n)}function lh(t,e,r,i){return t.addEventListener(e,r,i),{unsubscribe:()=>{t.removeEventListener(e,r,i)}}}function uh(t){return t*Math.PI/180}function hh(t,e,r){r[t]?.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Cs(t,e,r){if(r?.[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var wp=class{constructor(t,e={}){Wt(this,e),this.type=t}},ga=class extends wp{constructor(t,e={}){super(\"error\",Wt({error:t},e))}},q1=class{on(t,e){return this._listeners||(this._listeners={}),hh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Cs(t,e,this._listeners),Cs(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),hh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){let r=typeof t==\"string\"?new wp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let o of n)o.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let o of a)Cs(i,o,this._oneTimeListeners),o.call(this,r);let s=this._eventedParent;s&&(Wt(r,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),s.fire(r))}else r instanceof ga&&console.error(r.error);return this}listens(t){return!!(this._listeners?.[t]?.length||this._oneTimeListeners?.[t]?.length||this._eventedParent?.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},ch=\"AbortError\",El=class extends Error{constructor(t=ch){super(t instanceof Error?t.message:t),this.name=ch,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function _p(t){return t instanceof Error&&t.name===\"AbortError\"}function G1(t){if(t.aborted)throw new El(t.reason)}var ao=class Dp{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let h=s[3+u],c=s[3+u+1];n.push(h===c?null:s.subarray(h,c))}let o=s[3+n.length],l=s[3+n.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let s=0;s<this.d*this.d;s++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;let a=i/r*e;this.min=-a,this.max=e+a}insert(e,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error(\"Cannot insert into a GridIndex created from an ArrayBuffer.\")}_insertCell(e,r,i,n,a,s){this.cells[a].push(s)}query(e,r,i,n,a){let s=this.min,o=this.max;if(e<=s&&r<=s&&o<=i&&o<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(e,r,i,n,this._queryCell,l,{},a),l}}_queryCell(e,r,i,n,a,s,o,l){let u=this.cells[a];if(u!==null){let h=this.keys,c=this.bboxes;for(let p of u)if(o[p]===void 0){let f=p*4;(l?l(c[f+0],c[f+1],c[f+2],c[f+3]):e<=c[f+2]&&r<=c[f+3]&&i>=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s<e.length;s++){let o=e[s];n[3+s]=a,n.set(o,a),a+=o.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(e,r){let i=e.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(e){return new Dp(e.buffer)}},Sp={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\",length:2},centerAltitude:{type:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},roll:{type:\"number\",default:0,units:\"degrees\"},state:{type:\"state\",default:{}},light:{type:\"light\"},sky:{type:\"sky\"},projection:{type:\"projection\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},\"font-faces\":{type:\"fontFaces\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_vector\",\"source_raster\",\"source_raster_dem\",\"source_geojson\",\"source_video\",\"source_image\"],source_vector:{type:{required:!0,type:\"enum\",values:{vector:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},attribution:{type:\"string\"},promoteId:{type:\"promoteId\"},volatile:{type:\"boolean\",default:!1},encoding:{type:\"enum\",values:{mvt:{},mlt:{}},default:\"mvt\"},\"*\":{type:\"*\"}},source_raster:{type:{required:!0,type:\"enum\",values:{raster:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},attribution:{type:\"string\"},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_raster_dem:{type:{required:!0,type:\"enum\",values:{\"raster-dem\":{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},attribution:{type:\"string\"},encoding:{type:\"enum\",values:{terrarium:{},mapbox:{},custom:{}},default:\"mapbox\"},redFactor:{type:\"number\",default:1},blueFactor:{type:\"number\",default:1},greenFactor:{type:\"number\",default:1},baseShift:{type:\"number\",default:0},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:{geojson:{}}},data:{required:!0,type:\"*\"},maxzoom:{type:\"number\",default:18},attribution:{type:\"string\"},buffer:{type:\"number\",default:128,maximum:512,minimum:0},filter:{type:\"filter\"},tolerance:{type:\"number\",default:.375},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:50,minimum:0},clusterMaxZoom:{type:\"number\"},clusterMinPoints:{type:\"number\"},clusterProperties:{type:\"*\"},lineMetrics:{type:\"boolean\",default:!1},generateId:{type:\"boolean\",default:!1},promoteId:{type:\"promoteId\"}},source_video:{type:{required:!0,type:\"enum\",values:{video:{}}},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:{image:{}}},url:{type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},\"fill-extrusion\":{},raster:{},hillshade:{},\"color-relief\":{},background:{}},required:!0},metadata:{type:\"*\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:24},maxzoom:{type:\"number\",minimum:0,maximum:24},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_heatmap\",\"layout_fill-extrusion\",\"layout_symbol\",\"layout_raster\",\"layout_hillshade\",\"layout_color-relief\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_fill:{\"fill-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_circle:{\"circle-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-rounded-corner-distance\":{type:\"number\",default:0,minimum:0,units:\"meters\",\"property-type\":\"constant\"}},layout_line:{\"line-cap\":{type:\"enum\",values:{butt:{},round:{},square:{}},default:\"butt\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-join\":{type:\"enum\",values:{bevel:{},round:{},miter:{}},default:\"miter\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-miter-limit\":{type:\"number\",default:2,requires:[{\"line-join\":\"miter\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-round-limit\":{type:\"number\",default:1.05,requires:[{\"line-join\":\"round\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",values:{point:{},line:{},\"line-center\":{}},default:\"point\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-avoid-edges\":{type:\"boolean\",default:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-z-order\":{type:\"enum\",values:{auto:{},\"viewport-y\":{},source:{}},default:\"auto\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"!\":\"icon-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-optional\":{type:\"boolean\",default:!1,requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-size\":{type:\"number\",default:1,minimum:0,units:\"factor of the original icon size\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-text-fit\":{type:\"enum\",values:{none:{},width:{},height:{},both:{}},default:\"none\",requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",requires:[\"icon-image\",\"text-field\",{\"icon-text-fit\":[\"both\",\"width\",\"height\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-image\":{type:\"resolvedImage\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-padding\":{type:\"padding\",default:[2],units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-keep-upright\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},\"viewport-glyph\":{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-field\":{type:\"formatted\",default:\"\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-font\":{type:\"array\",value:\"string\",default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-line-height\":{type:\"number\",default:1.2,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-letter-spacing\":{type:\"number\",default:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-justify\":{type:\"enum\",values:{auto:{},left:{},center:{},right:{}},default:\"center\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-radial-offset\":{type:\"number\",units:\"ems\",default:0,requires:[\"text-field\"],\"property-type\":\"data-driven\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]}},\"text-variable-anchor\":{type:\"array\",value:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-variable-anchor-offset\":{type:\"variableAnchorOffsetCollection\",requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"text-field\",{\"!\":\"text-variable-anchor\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",requires:[\"text-field\",{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-writing-mode\":{type:\"array\",value:\"enum\",values:{horizontal:{},vertical:{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-keep-upright\":{type:\"boolean\",default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-transform\":{type:\"enum\",values:{none:{},uppercase:{},lowercase:{}},default:\"none\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",length:2,default:[0,0],requires:[\"text-field\",{\"!\":\"text-radial-offset\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"text-field\",{\"!\":\"text-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-optional\":{type:\"boolean\",default:!1,requires:[\"text-field\",\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-height-offset\":{type:\"number\",default:0,units:\"meters\",requires:[{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-height-anchor\":{type:\"enum\",values:{ground:{},absolute:{}},default:\"ground\",requires:[\"symbol-height-offset\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_color-relief\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},filter:{type:\"boolean\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},filter_operator:{type:\"enum\",values:{\"==\":{},\"!=\":{},\">\":{},\">=\":{},\"<\":{},\"<=\":{},in:{},\"!in\":{},all:{},any:{},none:{},has:{},\"!has\":{}}},geometry_type:{type:\"enum\",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:\"expression\"},stops:{type:\"array\",value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:{identity:{},exponential:{},interval:{},categorical:{}},default:\"exponential\"},colorSpace:{type:\"enum\",values:{rgb:{},lab:{},hcl:{}},default:\"rgb\"},default:{type:\"*\",required:!1}},function_stop:{type:\"array\",minimum:0,maximum:24,value:[\"number\",\"color\"],length:2},expression:{type:\"array\",value:\"expression_name\",minimum:1},light:{anchor:{type:\"enum\",default:\"viewport\",values:{map:{},viewport:{}},\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]}},position:{type:\"array\",default:[1.15,210,30],length:3,value:\"number\",\"property-type\":\"data-constant\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]}},color:{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},intensity:{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},sky:{\"sky-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#88C6FC\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-ground-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-fog-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"sky-horizon-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"atmosphere-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},terrain:{source:{type:\"string\",required:!0},exaggeration:{type:\"number\",minimum:0,default:1}},projection:{type:{type:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",default:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-outline-color\":{type:\"color\",transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"}},\"paint_fill-extrusion\":{\"fill-extrusion-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-extrusion-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-extrusion-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-extrusion-height\":{type:\"number\",default:0,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default:0,units:\"meters\",transition:!0,requires:[\"fill-extrusion-height\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-vertical-gradient\":{type:\"boolean\",default:!0,transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_line:{\"line-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-gradient\":{type:\"color\",transition:!1,requires:[{\"!\":\"line-dasharray\"},{\"!\":\"line-pattern\"},{source:\"geojson\",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[\"line-progress\"]},\"property-type\":\"color-ramp\"}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-blur\":{type:\"number\",default:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"circle-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-scale\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-stroke-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"}},paint_heatmap:{\"heatmap-radius\":{type:\"number\",default:30,minimum:1,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-weight\":{type:\"number\",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-intensity\":{type:\"number\",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"heatmap-color\":{type:\"color\",default:[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",.1,\"royalblue\",.3,\"cyan\",.5,\"lime\",.7,\"yellow\",1,\"red\"],transition:!1,expression:{interpolated:!0,parameters:[\"heatmap-density\"]},\"property-type\":\"color-ramp\"},\"heatmap-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"icon-image\",\"icon-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-color\":{type:\"color\",default:\"#000000\",transition:!0,overridable:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"text-field\",\"text-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,transition:!0,units:\"degrees\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-min\":{type:\"number\",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-max\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-resampling\":{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,transition:!1,units:\"milliseconds\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_hillshade:{\"hillshade-illumination-direction\":{type:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-exaggeration\":{type:\"number\",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-shadow-color\":{type:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",default:\"#FFFFFF\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-accent-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"background-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"background-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}},\"property-type\":{\"data-driven\":{type:\"property-type\"},\"cross-faded\":{type:\"property-type\"},\"cross-faded-data-driven\":{type:\"property-type\"},\"color-ramp\":{type:\"property-type\"},\"data-constant\":{type:\"property-type\"},constant:{type:\"property-type\"}},promoteId:{\"*\":{type:\"string\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}},S=Sp,Y1=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"],I=class{constructor(t,e,r,i,n=\"error\"){this.message=(t?`${t}: `:\"\")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},yn={kind:\"null\"},C={kind:\"number\"},X={kind:\"string\"},Q={kind:\"boolean\"},pe={kind:\"color\"},La={kind:\"projectionDefinition\"},fr={kind:\"object\"},H={kind:\"value\"},X1={kind:\"error\"},Va={kind:\"collator\"},mn={kind:\"formatted\"},Oa={kind:\"padding\"},Hi={kind:\"colorArray\"},Ra={kind:\"numberArray\"},gn={kind:\"resolvedImage\"},$a={kind:\"variableAnchorOffsetCollection\"};function Ut(t,e){return{kind:\"array\",itemType:t,N:e}}function yt(t){if(t.kind===\"array\"){let e=yt(t.itemType);return typeof t.N==\"number\"?`array<${e}, ${t.N}>`:t.itemType.kind===\"value\"?\"array\":`array<${e}>`}return t.kind}var W1=[yn,C,X,Q,pe,La,mn,fr,Ut(H),Oa,Ra,Hi,gn,$a];function Ji(t,e){if(e.kind===\"error\")return null;if(t.kind===\"array\"){if(e.kind===\"array\"&&(e.N===0&&e.itemType.kind===\"value\"||!Ji(t.itemType,e.itemType))&&(typeof t.N!=\"number\"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind===\"value\"){for(let r of W1)if(!Ji(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function Fl(t,e){return e.some(r=>r.kind===t.kind)}function dr(t,e){return e.some(r=>r===\"null\"?t===null:r===\"array\"?Array.isArray(t):r===\"object\"?t&&!Array.isArray(t)&&typeof t==\"object\":r===typeof t)}function qe(t,e){return t.kind===\"array\"&&e.kind===\"array\"?t.itemType.kind===e.itemType.kind&&typeof t.N==\"number\":t.kind===e.kind}var Ap=.96422,Ep=.82521,Fp=4/29,so=6/29,Ip=3*so*so,Z1=Math.PI/180,H1=180/Math.PI;function Tp(t){return t%=360,t<0&&(t+=360),t}function kp([t,e,r,i]){t=Ps(t),e=Ps(e),r=Ps(r);let n,a,s=Ms((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Ms((.4360747*t+.3850649*e+.1430804*r)/Ap),a=Ms((.0139322*t+.0971045*e+.7141733*r)/Ep));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Ps(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ms(t){return t>.008856451679035631?t**(1/3):t/Ip+Fp}function Cp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*zs(n),a=Ap*zs(a),s=Ep*zs(s),[Bs(3.1338561*a-1.6168667*n-.4906146*s),Bs(-.9787684*a+1.9161415*n+.033454*s),Bs(.0719453*a-.2289914*n+1.4052427*s),i]}function Bs(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function zs(t){return t>so?t*t*t:Ip*(t-Fp)}function J1(t){let[e,r,i,n]=kp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?Tp(Math.atan2(i,r)*H1):NaN,a,e,n]}function K1([t,e,r,i]){return t=isNaN(t)?0:t*Z1,Cp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function Q1([t,e,r,i]){t=Tp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var tm=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function ji(t,e){return tm(t,e)?t[e]:void 0}function em(t){if(t=t.toLowerCase().trim(),t===\"transparent\")return[0,0,0,0];let e=ji(rm,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[Gn(t.slice(n,n+=i)),Gn(t.slice(n,n+=i)),Gn(t.slice(n,n+=i)),Gn(t.slice(n,n+i)||\"ff\")]}if(t.startsWith(\"rgb\")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||\" \",h||\" \",f].join(\"\");if(m===\" \"||m===\" /\"||m===\",,\"||m===\",,,\"){let g=[s,u,p].join(\"\"),x=g===\"%%%\"?100:g===\"\"?255:0;if(x){let v=[Vr(+a/x,0,1),Vr(+l/x,0,1),Vr(+c/x,0,1),d?ph(+d,y):1];if(fh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||\" \",o||\" \",u].join(\"\");if(p===\" \"||p===\" /\"||p===\",,\"||p===\",,,\"){let f=[+n,Vr(+s,0,100),Vr(+l,0,100),h?ph(+h,c):1];if(fh(f))return Q1(f)}}}function Gn(t){return parseInt(t.padEnd(2,t),16)/255}function ph(t,e){return Vr(e?t/100:t,0,1)}function Vr(t,e,r){return Math.min(Math.max(e,t),r)}function fh(t){return!t.some(Number.isNaN)}var rm={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ke(t,e,r){return t+r*(e-t)}function Qr(t,e,r){return t.map((i,n)=>Ke(i,e[n],r))}function im(t){return t===\"rgb\"||t===\"hcl\"||t===\"lab\"}var Mt,mt=(Mt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter(\"rgb\",[e,r,i,n]))}static parse(e){if(e instanceof Mt)return e;if(typeof e!=\"string\")return;let r=em(e);if(r)return new Mt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter(\"rgb\",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter(\"hcl\",J1(this.rgb))}get lab(){return this.overwriteGetter(\"lab\",kp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(\",\")},${n})`}static interpolate(e,r,i,n=\"rgb\"){switch(n){case\"rgb\":{let[a,s,o,l]=Qr(e.rgb,r.rgb,i);return new Mt(a,s,o,l,!1)}case\"hcl\":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u<a&&a-u>180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=K1([f,d??Ke(s,h,i),Ke(o,c,i),Ke(l,p,i)]);return new Mt(y,m,g,x,!1)}case\"lab\":{let[a,s,o,l]=Cp(Qr(e.lab,r.lab,i));return new Mt(a,s,o,l,!1)}}}},Mt.black=new Mt(0,0,0,1),Mt.white=new Mt(1,1,1,1),Mt.transparent=new Mt(0,0,0,0),Mt.red=new Mt(1,0,0,1),Mt),nm=[\"bottom\",\"center\",\"top\"],oo=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},Le=class la{constructor(e){this.sections=e}static fromString(e){return new la([new oo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof la?e:la.fromString(e)}toString(){return this.sections.length===0?\"\":this.sections.map(e=>e.text).join(\"\")}},Fe=class zi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof zi)return e;if(typeof e==\"number\")return new zi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!=\"number\")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new zi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new zi(Qr(e.values,r.values,i))}},Ie=class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e==\"number\")return new Li([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!=\"number\")return;return new Li(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Li(Qr(e.values,r.values,i))}},oe=class Vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vi)return e;if(typeof e==\"string\"){let i=mt.parse(e);return i?new Vi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!=\"string\")return;let n=mt.parse(i);if(!n)return;r.push(n)}return new Vi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n=\"rgb\"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s<e.values.length;s++)a.push(mt.interpolate(e.values[s],r.values[s],i,n));return new Vi(a)}},ft=class extends Error{constructor(t,e){super(t),this.name=\"RuntimeError\",this.path=e}toJSON(){return this.message}},am=new Set([\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"]),Ae=class ua{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ua)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!=0)){for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];if(typeof i!=\"string\"||!am.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!=\"number\"||typeof n[1]!=\"number\")return}return new ua(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n){let a=e.values,s=r.values;if(a.length!==s.length)throw new ft(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`,n);let o=[];for(let l=0;l<a.length;l+=2){if(a[l]!==s[l])throw new ft(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${s[l]}`,n);o.push(a[l]);let[u,h]=a[l+1],[c,p]=s[l+1];o.push([Ke(u,c,i),Ke(h,p,i)])}return new ua(o)}},Ee=class Pp{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Pp({name:e,available:!1}):null}},wr=class Or{constructor(e,r,i){this.from=e,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(e,r,i){return new Or(e,r,i)}static parse(e){if(e instanceof Or)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]==\"string\"&&typeof e[1]==\"string\"&&typeof e[2]==\"number\")return new Or(e[0],e[1],e[2]);if(typeof e==\"object\"&&typeof e.from==\"string\"&&typeof e.to==\"string\"&&typeof e.transition==\"number\")return new Or(e.from,e.to,e.transition);if(typeof e==\"string\")return new Or(e,e,1)}},Il=class{constructor(t,e,r){this.sensitivity=t?e?\"variant\":\"case\":e?\"accent\":\"base\",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function Mp(t,e,r,i){return typeof t==\"number\"&&t>=0&&t<=255&&typeof e==\"number\"&&e>=0&&e<=255&&typeof r==\"number\"&&r>=0&&r<=255?i===void 0||typeof i==\"number\"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i==\"number\"?[t,e,r,i]:[t,e,r]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ti(t){if(t===null||typeof t==\"string\"||typeof t==\"boolean\"||typeof t==\"number\"||t instanceof wr||t instanceof mt||t instanceof Il||t instanceof Le||t instanceof Fe||t instanceof Ie||t instanceof oe||t instanceof Ae||t instanceof Ee)return!0;if(Array.isArray(t)){for(let e of t)if(!ti(e))return!1;return!0}if(typeof t==\"object\"){for(let e in t)if(!ti(t[e]))return!1;return!0}return!1}function St(t){if(t===null)return yn;if(typeof t==\"string\")return X;if(typeof t==\"boolean\")return Q;if(typeof t==\"number\")return C;if(t instanceof mt)return pe;if(t instanceof wr)return La;if(t instanceof Il)return Va;if(t instanceof Le)return mn;if(t instanceof Fe)return Oa;if(t instanceof Ie)return Ra;if(t instanceof oe)return Hi;if(t instanceof Ae)return $a;if(t instanceof Ee)return gn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=St(i);if(!r)r=n;else{if(r===n)continue;r=H;break}}return Ut(r||H,e)}return fr}function qi(t){let e=typeof t;return t===null?\"\":e===\"string\"||e===\"number\"||e===\"boolean\"?String(t):t instanceof mt||t instanceof wr||t instanceof Le||t instanceof Fe||t instanceof Ie||t instanceof oe||t instanceof Ae||t instanceof Ee?t.toString():JSON.stringify(t)}var ei=class Bp{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ti(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=St(i),a=r.expectedType;return n.kind===\"array\"&&n.N===0&&a&&a.kind===\"array\"&&(typeof a.N!=\"number\"||a.N===0)&&(n=a),new Bp(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},sm=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],zp=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&\"id\"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==\"number\"?sm[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&\"geometry\"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=mt.parse(t),this._parseColorCache.set(t,e)),e}};function Na(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||e<l)return s;n=s+1}else if(o>e)a=s-1;else throw new ft(\"Input is not a number.\",r);return 0}var Tl=class Lp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");let i=r.parse(e[1],1,C);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!==\"value\"&&(a=r.expectedType);for(let s=1;s<e.length;s+=2){let o=s===1?-1/0:e[s],l=e[s+1],u=s,h=s+1;if(typeof o!=\"number\")return r.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return r.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Lp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Na(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function om(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var De=class lo{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name===\"exponential\")a=Ls(r,e.base,i,n);else if(e.name===\"linear\")a=Ls(r,1,i,n);else if(e.name===\"cubic-bezier\"){let s=e.controlPoints;a=om(s[0],s[1],s[2],s[3])(Ls(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error(\"Expected an interpolation type expression.\",1);if(n[0]===\"linear\")n={name:\"linear\"};else if(n[0]===\"exponential\"){let u=n[1];if(typeof u!=\"number\")return r.error(\"Exponential interpolation requires a numeric base.\",1,1);n={name:\"exponential\",base:u}}else if(n[0]===\"cubic-bezier\"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!=\"number\"||h<0||h>1))return r.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);n={name:\"cubic-bezier\",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");if(a=r.parse(a,2,C),!a)return null;let o=[],l=null;(i===\"interpolate-hcl\"||i===\"interpolate-lab\")&&r.expectedType!=Hi?l=pe:r.expectedType&&r.expectedType.kind!==\"value\"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let h=s[u],c=s[u+1],p=u+3,f=u+4;if(typeof h!=\"number\")return r.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(o.length&&o[o.length-1][0]>=h)return r.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!qe(l,C)&&!qe(l,La)&&!qe(l,pe)&&!qe(l,Oa)&&!qe(l,Ra)&&!qe(l,Hi)&&!qe(l,$a)&&!qe(l,Ut(C))?r.error(`Type ${yt(l)} is not interpolatable.`):new lo(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Na(r,n,this.key),o=r[s],l=r[s+1],u=lo.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return Ke(h,c,u);case\"color\":return mt.interpolate(h,c,u);case\"padding\":return Fe.interpolate(h,c,u);case\"colorArray\":return oe.interpolate(h,c,u);case\"numberArray\":return Ie.interpolate(h,c,u);case\"variableAnchorOffsetCollection\":return Ae.interpolate(h,c,u,this.key);case\"array\":return Qr(h,c,u);case\"projectionDefinition\":return wr.interpolate(h,c,u)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return mt.interpolate(h,c,u,\"hcl\");case\"colorArray\":return oe.interpolate(h,c,u,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return mt.interpolate(h,c,u,\"lab\");case\"colorArray\":return oe.interpolate(h,c,u,\"lab\")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Ls(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var mr={color:mt.interpolate,number:Ke,padding:Fe.interpolate,numberArray:Ie.interpolate,colorArray:oe.interpolate,variableAnchorOffsetCollection:Ae.interpolate,array:Qr},Vp=class Op{constructor(e){this.type=mn,this.sections=e}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[1];if(!Array.isArray(i)&&typeof i==\"object\")return r.error(\"First argument must be an image or text section.\");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o==\"object\"&&!Array.isArray(o)){a=!1;let l=null;if(o[\"font-scale\"]&&(l=r.parse(o[\"font-scale\"],1,C),!l))return null;let u=null;if(o[\"text-font\"]&&(u=r.parse(o[\"text-font\"],1,Ut(X)),!u))return null;let h=null;if(o[\"text-color\"]&&(h=r.parse(o[\"text-color\"],1,pe),!h))return null;let c=null;if(o[\"vertical-align\"]){if(typeof o[\"vertical-align\"]==\"string\"&&!nm.includes(o[\"vertical-align\"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o[\"vertical-align\"]}' instead.`);if(c=r.parse(o[\"vertical-align\"],1,X),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,H);if(!l)return null;let u=l.type.kind;if(u!==\"string\"&&u!==\"value\"&&u!==\"null\"&&u!==\"resolvedImage\")return r.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Op(n)}evaluate(e){return new Le(this.sections.map(r=>{let i=r.content.evaluate(e);return St(i)===gn?new oo(\"\",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new oo(qi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(\",\"):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function Rp(t,e,r=0,i=t.length-1,n=lm){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);Rp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(Ii(t,r,e),n(t[i],a)>0&&Ii(t,r,i);s<o;){for(Ii(t,s,o),s++,o--;n(t[s],a)<0;)s++;for(;n(t[o],a)>0;)o--}n(t[r],a)===0?Ii(t,r,o):(o++,Ii(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function Ii(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function lm(t,e){return t<e?-1:+(t>e)}function Ua(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=hm(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a<r.length;a++)r[a].length<=e||(Rp(r[a],e,1,r[a].length-1,um),r[a]=r[a].slice(0,e));return r}function um(t,e){return e.area-t.area}function hm(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var Yn={string:X,number:C,boolean:Q,object:fr},Me=class $p{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=1,n,a=e[0];if(a===\"array\"){let o;if(e.length>2){let u=e[1];if(typeof u!=\"string\"||!(u in Yn)||u===\"object\")return r.error('The item type argument of \"array\" must be one of string, number, boolean',1);o=Yn[u],i++}else o=H;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=\"number\"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to \"array\" must be a positive integer literal',2);l=e[2],i++}n=Ut(o,l)}else{if(!Yn[a])throw Error(`Types doesn't contain name = ${a}`);n=Yn[a]}let s=[];for(;i<e.length;i++){let o=r.parse(e[i],i,H);if(!o)return null;s.push(o)}return new $p(n,s,r.key)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(!Ji(this.type,St(i)))return i;if(r===this.args.length-1)throw new ft(`Expected value to be of type ${yt(this.type)}, but found ${yt(St(i))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},dh={\"to-boolean\":Q,\"to-color\":pe,\"to-number\":C,\"to-string\":X},jr=class Np{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[0];if(!dh[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i===\"to-boolean\"||i===\"to-string\")&&e.length!==2)return r.error(\"Expected one argument.\");let n=dh[i],a=[];for(let s=1;s<e.length;s++){let o=r.parse(e[s],s,H);if(!o)return null;a.push(o)}return new Np(n,a,r.key)}evaluate(e){switch(this.type.kind){case\"boolean\":return!!this.args[0].evaluate(e);case\"color\":{let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof mt)return r;if(typeof r==\"string\"){let a=e.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Mp(r[0],r[1],r[2],r[3]),!i))return new mt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"padding\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Fe.parse(r);if(n)return n}throw new ft(`Could not parse padding from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"numberArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ie.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"colorArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=oe.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"variableAnchorOffsetCollection\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"number\":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case\"formatted\":return Le.fromString(qi(this.args[0].evaluate(e)));case\"resolvedImage\":return Ee.fromString(qi(this.args[0].evaluate(e)));case\"projectionDefinition\":{let r=this.args[0].evaluate(e);if(wr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}default:return qi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Up=class jp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a<e.length-1;a+=2){let s=e[a];if(typeof s!=\"string\")return r.error(`Expected string, but found ${typeof s} instead.`,a);if(/[^a-zA-Z0-9_]/.test(s))return r.error(\"Variable names must contain only alphanumeric characters or '_'.\",a);let o=r.parse(e[a+1],a+1);if(!o)return null;i.push([s,o])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new jp(i,n):null}outputDefined(){return this.result.outputDefined()}},qp=class Gp{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!=\"string\")return r.error(\"'var' expression requires exactly one string literal argument.\");let i=e[1];return r.scope.has(i)?new Gp(i,r.scope.get(i)):r.error(`Unknown variable \"${i}\". Make sure \"${i}\" has been bound in an enclosing \"let\" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},cm=class Yp{constructor(e,r,i,n){this.type=e,this.index=r,this.input=i,this.key=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,C),n=r.parse(e[2],2,Ut(r.expectedType||H));if(!i||!n)return null;let a=n.type;return new Yp(a.itemType,i,n,r.key)}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new ft(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},pm=class Xp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=Q}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);return!i||!n?null:Fl(i.type,[Q,X,C,yn,H])?new Xp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(St(r))} instead.`,this.key);if(!dr(i,[\"string\",\"array\"]))throw new ft(`Expected second argument to be of type array or string, but found ${yt(St(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},fm=class uo{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=C}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);if(!i||!n)return null;if(!Fl(i.type,[Q,X,C,yn,H]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,C);return a?new uo(i,n,r.key,a):null}return new uo(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(St(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),dr(i,[\"string\"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(dr(i,[\"array\"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${yt(St(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},dm=class Wp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error(\"Expected an even number of arguments.\");let i,n;r.expectedType&&r.expectedType.kind!==\"value\"&&(n=r.expectedType);let a={},s=[];for(let u=2;u<e.length-1;u+=2){let h=e[u],c=e[u+1];Array.isArray(h)||(h=[h]);let p=r.concat(u);if(h.length===0)return p.error(\"Expected at least one branch label.\");for(let d of h){if(typeof d!=\"number\"&&typeof d!=\"string\")return p.error(\"Branch labels must be numbers or strings.\");if(typeof d==\"number\"&&Math.abs(d)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d==\"number\"&&Math.floor(d)!==d)return p.error(\"Numeric branch labels must be integer values.\");if(!i)i=St(d);else if(p.checkSubtype(i,St(d)))return null;if(a[String(d)]!==void 0)return p.error(\"Branch labels must be unique.\");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,H);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!==\"value\"&&r.concat(1).checkSubtype(i,o.type)?null:new Wp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(St(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},ym=class Zp{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error(\"Expected an odd number of arguments.\");let i;r.expectedType&&r.expectedType.kind!==\"value\"&&(i=r.expectedType);let n=[];for(let s=1;s<e.length-1;s+=2){let o=r.parse(e[s],s,Q);if(!o)return null;let l=r.parse(e[s+1],s+1,i);if(!l)return null;n.push([o,l]),i||(i=l.type)}let a=r.parse(e[e.length-1],e.length-1,i);if(!a)return null;if(!i)throw Error(\"Can't infer output type\");return new Zp(i,n,a)}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},mm=class ho{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,C);if(!i||!n)return null;if(!Fl(i.type,[Ut(H),X,H]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,C);return a?new ho(i.type,i,n,r.key,a):null}return new ho(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),dr(r,[\"string\"]))return[...r].slice(i,n).join(\"\");if(dr(r,[\"array\"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${yt(St(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},Hp=class co{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=null,n=r.expectedType;n&&n.kind!==\"value\"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:\"omit\"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error(\"No output type\");return n&&a.some(s=>Ji(n,s.type))?new co(H,a):new co(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof Ee&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function yh(t,e){return t===\"==\"||t===\"!=\"?e.kind===\"boolean\"||e.kind===\"string\"||e.kind===\"number\"||e.kind===\"null\"||e.kind===\"value\":e.kind===\"string\"||e.kind===\"number\"||e.kind===\"value\"}function gm(t,e,r){return e===r}function xm(t,e,r){return e!==r}function vm(t,e,r){return e<r}function bm(t,e,r){return e>r}function wm(t,e,r){return e<=r}function _m(t,e,r){return e>=r}function Jp(t,e,r,i){return i.compare(e,r)===0}function Dm(t,e,r,i){return!Jp(t,e,r,i)}function Sm(t,e,r,i){return i.compare(e,r)<0}function Am(t,e,r,i){return i.compare(e,r)>0}function Em(t,e,r,i){return i.compare(e,r)<=0}function Fm(t,e,r,i){return i.compare(e,r)>=0}function ui(t,e,r){let i=t!==\"==\"&&t!==\"!=\";return class Kp{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=Q,this.hasUntypedArgument=a.type.kind===\"value\"||s.type.kind===\"value\"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error(\"Expected two or three arguments.\");let o=a[0],l=s.parse(a[1],1,H);if(!l)return null;if(!yh(o,l.type))return s.concat(1).error(`\"${o}\" comparisons are not supported for type '${yt(l.type)}'.`);let u=s.parse(a[2],2,H);if(!u)return null;if(!yh(o,u.type))return s.concat(2).error(`\"${o}\" comparisons are not supported for type '${yt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(`Cannot compare types '${yt(l.type)}' and '${yt(u.type)}'.`);i&&(l.type.kind===\"value\"&&u.type.kind!==\"value\"?l=new Me(u.type,[l],s.key):l.type.kind!==\"value\"&&u.type.kind===\"value\"&&(u=new Me(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!==\"string\"&&u.type.kind!==\"string\"&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(\"Cannot use collator to compare non-string types.\");if(h=s.parse(a[3],3,Va),!h)return null}return new Kp(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=St(s),u=St(o);if(l.kind!==u.kind||l.kind!==\"string\"&&l.kind!==\"number\")throw new ft(`Expected arguments for \"${t}\" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=St(s),u=St(o);if(l.kind!==\"string\"||u.kind!==\"string\")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var Im=ui(\"==\",gm,Jp),Tm=ui(\"!=\",xm,Dm),km=ui(\"<\",vm,Sm),Cm=ui(\">\",bm,Am),Pm=ui(\"<=\",wm,Em),Mm=ui(\">=\",_m,Fm),Qp=class tf{constructor(e,r,i){this.type=Va,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error(\"Expected one argument.\");let i=e[1];if(typeof i!=\"object\"||Array.isArray(i))return r.error(\"Collator options argument must be an object.\");let n=r.parse(i[\"case-sensitive\"]!==void 0&&i[\"case-sensitive\"],1,Q);if(!n)return null;let a=r.parse(i[\"diacritic-sensitive\"]!==void 0&&i[\"diacritic-sensitive\"],1,Q);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,X),!s)?null:new tf(n,a,s)}evaluate(e){return new Il(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},Bm=class ef{constructor(e,r,i,n,a,s){this.type=X,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,C);if(!i)return null;let n=e[2];if(typeof n!=\"object\"||Array.isArray(n))return r.error(\"NumberFormat options argument must be an object.\");let a=null;if(n.locale&&(a=r.parse(n.locale,1,X),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,X),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,X),!o))return null;if(s&&o)return r.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let l=null;if(n[\"min-fraction-digits\"]&&(l=r.parse(n[\"min-fraction-digits\"],1,C),!l))return null;let u=null;return n[\"max-fraction-digits\"]&&(u=r.parse(n[\"max-fraction-digits\"],1,C),!u)?null:new ef(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},zm=class rf{constructor(e){this.type=gn,this.input=e}static parse(e,r){if(e.length!==2)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,X);return i?new rf(i):r.error(\"No image name provided.\")}evaluate(e){let r=this.input.evaluate(e),i=Ee.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},Lm=class nf{constructor(e,r){this.input=e,this.key=r,this.type=C}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!==\"array\"&&i.type.kind!==\"string\"&&i.type.kind!==\"value\"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new nf(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r==\"string\")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${yt(St(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},Se=8192;function Vm(t,e){let r=Om(t[0]),i=$m(t[1]),n=2**e.z;return[Math.round(r*n*Se),Math.round(i*n*Se)]}function kl(t,e){let r=2**e.z,i=(t[0]/Se+e.x)/r,n=(t[1]/Se+e.y)/r;return[Rm(i),Nm(n)]}function Om(t){return(180+t)/360}function Rm(t){return t*360-180}function $m(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Nm(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function xn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ki(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Um(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function jm(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function ja(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return Xm([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(mh(t,e,r,i)&&mh(r,i,t,e))}function qm(t,e,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(ja(t,e,i[n],i[n+1]))return!0;return!1}function hi(t,e,r=!1){let i=!1;for(let n of e)for(let a=0;a<n.length-1;a++){if(jm(t,n[a],n[a+1]))return r;Um(t,n[a],n[a+1])&&(i=!i)}return i}function Gm(t,e){for(let r of e)if(hi(t,r))return!0;return!1}function af(t,e){for(let r of t)if(!hi(r,e))return!1;for(let r=0;r<t.length-1;++r)if(qm(t[r],t[r+1],e))return!1;return!0}function Ym(t,e){for(let r of e)if(af(t,r))return!0;return!1}function Xm(t,e){return t[0]*e[1]-t[1]*e[0]}function mh(t,e,r,i){let n=t[0]-r[0],a=t[1]-r[1],s=e[0]-r[0],o=e[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],h=n*u-l*a,c=s*u-l*o;return h>0&&c<0||h<0&&c>0}function Cl(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=[];for(let s=0;s<t[n].length;s++){let o=Vm(t[n][s],r);xn(e,o),a.push(o)}i.push(a)}return i}function sf(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=Cl(t[n],e,r);i.push(a)}return i}function of(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}xn(e,t)}function Wm(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function gh(t,e,r,i){let n=2**i.z*Se,a=[i.x*Se,i.y*Se],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];of(u,e,r,n),s.push(u)}return s}function xh(t,e,r,i){let n=2**i.z*Se,a=[i.x*Se,i.y*Se],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];xn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){Wm(e);for(let o of s)for(let l of o)of(l,e,r,n)}return s}function Zm(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Cl(e.coordinates,i,n),s=gh(t.geometry(),r,i,n);if(!Ki(r,i))return!1;for(let o of s)if(!hi(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=sf(e.coordinates,i,n),s=gh(t.geometry(),r,i,n);if(!Ki(r,i))return!1;for(let o of s)if(!Gm(o,a))return!1}return!0}function Hm(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Cl(e.coordinates,i,n),s=xh(t.geometry(),r,i,n);if(!Ki(r,i))return!1;for(let o of s)if(!af(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=sf(e.coordinates,i,n),s=xh(t.geometry(),r,i,n);if(!Ki(r,i))return!1;for(let o of s)if(!Ym(o,a))return!1}return!0}var Pl=class ha{constructor(e,r){this.type=Q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ti(e[1])){let i=e[1];if(i.type===\"FeatureCollection\"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s===\"Polygon\"&&n.push(o),s===\"MultiPolygon\"&&n.push(...o)}if(n.length)return new ha(i,{type:\"MultiPolygon\",coordinates:n})}else if(i.type===\"Feature\"){let n=i.geometry.type;if(n===\"Polygon\"||n===\"MultiPolygon\")return new ha(i,i.geometry)}else if(i.type===\"Polygon\"||i.type===\"MultiPolygon\")return new ha(i,i)}return r.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return Zm(e,this.geometries);if(e.geometryType()===\"LineString\")return Hm(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},lf=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}},vh=Math.PI/180,Ml=class{constructor(t){let e=vh*6378.137*1e3,r=Math.cos(t*vh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],h=this.wrap(t[o+1][0]-l)*this.kx,c=(t[o+1][1]-u)*this.ky,p=0;(h!==0||c!==0)&&(p=(this.wrap(e[0]-l)*this.kx*h+(e[1]-u)*this.ky*c)/(h*h+c*c),p>1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f<r&&(r=f,i=l,n=u,a=o,s=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function uf(t,e){return e[0]-t[0]}function xa(t){return t[1]-t[0]+1}function Ve(t,e){return t[1]>=t[0]&&t[1]<e}function po(t,e){if(t[0]>t[1])return[null,null];let r=xa(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function fo(t,e){if(!Ve(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)xn(r,t[i]);return r}function yo(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)xn(e,i);return e}function bh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Bl(t,e,r){if(!bh(t)||!bh(e))return NaN;let i=0,n=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),r.distance([0,0],[i,n])}function cr(t,e,r){let i=r.pointOnLine(e,t);return r.distance(t,i.point)}function zl(t,e,r,i,n){let a=Math.min(cr(t,[r,i],n),cr(e,[r,i],n)),s=Math.min(cr(r,[t,e],n),cr(i,[t,e],n));return Math.min(a,s)}function Jm(t,e,r,i,n){if(!(Ve(e,t.length)&&Ve(i,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let o=t[s],l=t[s+1];for(let u=i[0];u<i[1];++u){let h=r[u],c=r[u+1];if(ja(o,l,h,c))return 0;a=Math.min(a,zl(o,l,h,c,n))}}return a}function Km(t,e,r,i,n){if(!(Ve(e,t.length)&&Ve(i,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let o=i[0];o<=i[1];++o)if(a=Math.min(a,n.distance(t[s],r[o])),a===0)return a;return a}function Qm(t,e,r){if(hi(t,e,!0))return 0;let i=1/0;for(let n of e){let a=n[0],s=n[n.length-1];if(a!==s&&(i=Math.min(i,cr(t,[s,a],r)),i===0))return i;let o=r.pointOnLine(n,t);if(i=Math.min(i,r.distance(t,o.point)),i===0)return i}return i}function t0(t,e,r,i){if(!Ve(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(hi(t[a],r,!0))return 0;let n=1/0;for(let a=e[0];a<e[1];++a){let s=t[a],o=t[a+1];for(let l of r)for(let u=0,h=l.length,c=h-1;u<h;c=u++){let p=l[c],f=l[u];if(ja(s,o,p,f))return 0;n=Math.min(n,zl(s,o,p,f,i))}}return n}function wh(t,e){for(let r of t)for(let i of r)if(hi(i,e,!0))return!0;return!1}function e0(t,e,r,i=1/0){let n=yo(t),a=yo(e);if(i!==1/0&&Bl(n,a,r)>=i)return i;if(Ki(n,a)){if(wh(t,e))return 0}else if(wh(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l<u;h=l++){let c=o[h],p=o[l];for(let f of e)for(let d=0,y=f.length,m=y-1;d<y;m=d++){let g=f[m],x=f[d];if(ja(c,p,g,x))return 0;s=Math.min(s,zl(c,p,g,x,r))}}return s}function _h(t,e,r,i,n,a){if(!a)return;let s=Bl(fo(i,a),n,r);s<e&&t.push([s,a,[0,0]])}function Xn(t,e,r,i,n,a,s){if(!a||!s)return;let o=Bl(fo(i,a),fo(n,s),r);o<e&&t.push([o,a,s])}function va(t,e,r,i,n=1/0){let a=Math.min(i.distance(t[0],r[0][0]),n);if(a===0)return a;let s=new lf([[0,[0,t.length-1],[0,0]]],uf),o=yo(r);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(xa(u)<=h){if(!Ve(u,t.length))return NaN;if(e){let c=t0(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=Qm(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=po(u,e);_h(s,a,i,t,o,c[0]),_h(s,a,i,t,o,c[1])}}return a}function ba(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new lf([[0,[0,t.length-1],[0,r.length-1]]],uf);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(xa(u)<=c&&xa(h)<=p){if(!Ve(u,t.length)&&Ve(h,r.length))return NaN;let f;if(e&&i)f=Jm(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=cr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=cr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=Km(t,u,r,h,n),s=Math.min(s,f)}else{let f=po(u,e),d=po(h,i);Xn(o,s,n,t,r,f[0],d[0]),Xn(o,s,n,t,r,f[0],d[1]),Xn(o,s,n,t,r,f[1],d[0]),Xn(o,s,n,t,r,f[1],d[1])}}return s}function r0(t,e){let r=t.geometry(),i=r.flat().map(s=>kl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Ml(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,ba(i,!1,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,ba(i,!1,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,va(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function i0(t,e){let r=t.geometry(),i=r.flat().map(s=>kl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Ml(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,ba(i,!0,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,ba(i,!0,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,va(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function n0(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ua(r,0).map(s=>s.map(o=>o.map(l=>kl([l.x,l.y],t.canonical)))),n=new Ml(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case\"Point\":a=Math.min(a,va([s.coordinates],!1,o,n,a));break;case\"LineString\":a=Math.min(a,va(s.coordinates,!0,o,n,a));break;case\"Polygon\":a=Math.min(a,e0(o,s.coordinates,n,a))}if(a===0)return a}return a}function Vs(t){return t.type===\"MultiPolygon\"?t.coordinates.map(e=>({type:\"Polygon\",coordinates:e})):t.type===\"MultiLineString\"?t.coordinates.map(e=>({type:\"LineString\",coordinates:e})):t.type===\"MultiPoint\"?t.coordinates.map(e=>({type:\"Point\",coordinates:e})):[t]}var Ll=class ca{constructor(e,r){this.type=C,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ti(e[1])){let i=e[1];if(i.type===\"FeatureCollection\")return new ca(i,i.features.map(n=>Vs(n.geometry)).flat());if(i.type===\"Feature\")return new ca(i,Vs(i.geometry));if(\"type\"in i&&\"coordinates\"in i)return new ca(i,Vs(i))}return r.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return r0(e,this.geometries);if(e.geometryType()===\"LineString\")return i0(e,this.geometries);if(e.geometryType()===\"Polygon\")return n0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},a0=class hf{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=H;break}this.type=Ut(r??H,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ti(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=St(i);if(n.kind===\"array\"){let a=i,s=r.concat(1),o=[];for(let l=0;l<a.length;l++){let u=s.parse(a[l],l,H);if(!u)return null;o.push(u)}return new hf(o)}return new ei(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Vl=class cf{constructor(e){this.key=e,this.type=H}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error(\"Global state property must be defined.\"):typeof i==\"string\"?new cf(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let r=e.globals?.globalState;return!r||Object.keys(r).length===0?null:ji(r,this.key)??null}eachChild(){}outputDefined(){return!1}},Yr={\"==\":Im,\"!=\":Tm,\">\":Cm,\"<\":km,\">=\":Mm,\"<=\":Pm,array:Me,at:cm,boolean:Me,case:ym,coalesce:Hp,collator:Qp,format:Vp,image:zm,in:pm,\"index-of\":fm,interpolate:De,\"interpolate-hcl\":De,\"interpolate-lab\":De,length:Lm,let:Up,literal:ei,match:dm,number:Me,\"number-format\":Bm,object:Me,semiliteral:a0,slice:mm,step:Tl,string:Me,\"to-boolean\":jr,\"to-color\":jr,\"to-number\":jr,\"to-string\":jr,var:qp,within:Pl,distance:Ll,\"global-state\":Vl},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},s0=class pf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new pf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ff=class df{constructor(e,r,i=[],n,a=new s0,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(\"\"),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e==\"string\"||typeof e==\"boolean\"||typeof e==\"number\")&&(e=[\"literal\",e]);let i=this.key;function n(a,s,o){return o===\"assert\"?new Me(s,[a],i):o===\"coerce\"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let a=e[0];if(typeof a!=\"string\")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind===\"string\"||l.kind===\"number\"||l.kind===\"boolean\"||l.kind===\"object\"||l.kind===\"array\")&&u.kind===\"value\")o=n(o,l,r.typeAnnotation||\"assert\");else if(l.kind===\"projectionDefinition\"&&[\"string\",\"array\",\"value\"].includes(u.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(l.kind)&&[\"value\",\"string\"].includes(u.kind)||[\"padding\",\"numberArray\"].includes(l.kind)&&[\"value\",\"number\",\"array\"].includes(u.kind)||l.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(u.kind)||l.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(u.kind))o=n(o,l,r.typeAnnotation||\"coerce\");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ei)&&o.type.kind!==\"resolvedImage\"&&this._isConstant(o)){let l=new zp;try{o=new ei(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression \"${a}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return e===void 0?this.error(\"'undefined' value invalid. Use null instead.\"):typeof e==\"object\"?this.error('Bare objects invalid. Use [\"literal\", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e==\"number\"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new df(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join(\"\")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=Ji(e,r);return i&&this.error(i),i}},_r=class Oi{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Oi.definitions[i];if(!n)return r.error(`Unknown expression \"${i}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ff(r.registry,wa,r.path,null,r.scope);let c=[],p=!1;for(let f=1;f<e.length;f++){let d=e[f],y=Array.isArray(u)?u[f-1]:u.type,m=l.parse(d,1+c.length,y);if(!m){p=!0;break}c.push(m)}if(!p)if(Array.isArray(u)&&u.length!==c.length)l.error(`Expected ${u.length} arguments, but found ${c.length} instead.`);else{for(let f=0;f<c.length;f++){let d=Array.isArray(u)?u[f]:u.type,y=c[f];l.concat(f+1).checkSubtype(d,y.type)}if(l.errors.length===0)return new Oi(i,a,h,c,r.key)}}if(o.length===1)r.errors.push(...l.errors);else{let u=(o.length?o:s).map(([c])=>l0(c)).join(\" | \"),h=[];for(let c=1;c<e.length;c++){let p=r.parse(e[c],1+h.length);if(!p)return null;h.push(yt(p.type))}r.error(`Expected arguments of type ${u}, but found (${h.join(\", \")}) instead.`)}return null}static register(e,r){Oi.definitions=r;for(let i in r)e[i]=Oi}};function Dh(t,[e,r,i,n],a){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);let s=n?n.evaluate(t):1,o=Mp(e,r,i,s);if(o)throw new ft(o,a);return new mt(e/255,r/255,i/255,s,!1)}function Sh(t,e){return t in e&&e[t]!==void 0}function Os(t,e){let r=e[t];return r===void 0?null:r}function o0(t,e,r,i){for(;r<=i;){let n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function or(t){return{type:t}}_r.register(Yr,{error:[X1,[X],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[X,[H],(t,[e])=>yt(St(e.evaluate(t)))],\"to-rgba\":[Ut(C,4),[pe],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[pe,[C,C,C],Dh],rgba:[pe,[C,C,C,C],Dh],has:{type:Q,overloads:[[[X],(t,[e])=>Sh(e.evaluate(t),t.properties())],[[X,fr],(t,[e,r])=>Sh(e.evaluate(t),r.evaluate(t))]]},get:{type:H,overloads:[[[X],(t,[e])=>Os(e.evaluate(t),t.properties())],[[X,fr],(t,[e,r])=>Os(e.evaluate(t),r.evaluate(t))]]},\"feature-state\":[H,[X],(t,[e])=>Os(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],\"geometry-type\":[X,[],t=>t.geometryType()],id:[H,[],t=>t.id()],zoom:[C,[],t=>t.globals.zoom],\"heatmap-density\":[C,[],t=>t.globals.heatmapDensity||0],elevation:[C,[],t=>t.globals.elevation||0],\"line-progress\":[C,[],t=>t.globals.lineProgress||0],accumulated:[H,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],\"+\":[C,or(C),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],\"*\":[C,or(C),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],\"-\":{type:C,overloads:[[[C,C],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[C],(t,[e])=>-e.evaluate(t)]]},\"/\":[C,[C,C],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],\"%\":[C,[C,C],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[C,[],()=>Math.LN2],pi:[C,[],()=>Math.PI],e:[C,[],()=>Math.E],\"^\":[C,[C,C],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[C,[C],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[C,[C],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[C,[C],(t,[e])=>Math.log(e.evaluate(t))],log2:[C,[C],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[C,[C],(t,[e])=>Math.sin(e.evaluate(t))],cos:[C,[C],(t,[e])=>Math.cos(e.evaluate(t))],tan:[C,[C],(t,[e])=>Math.tan(e.evaluate(t))],asin:[C,[C],(t,[e])=>Math.asin(e.evaluate(t))],acos:[C,[C],(t,[e])=>Math.acos(e.evaluate(t))],atan:[C,[C],(t,[e])=>Math.atan(e.evaluate(t))],min:[C,or(C),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[C,or(C),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[C,[C],(t,[e])=>Math.abs(e.evaluate(t))],round:[C,[C],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[C,[C],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[C,[C],(t,[e])=>Math.ceil(e.evaluate(t))],\"filter-==\":[Q,[X,H],(t,[e,r])=>t.properties()[e.value]===r.value],\"filter-id-==\":[Q,[H],(t,[e])=>t.id()===e.value],\"filter-type-==\":[Q,[X],(t,[e])=>t.geometryType()===e.value],\"filter-<\":[Q,[X,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<n}],\"filter-id-<\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<i}],\"filter->\":[Q,[X,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],\"filter-id->\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],\"filter-<=\":[Q,[X,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],\"filter-id-<=\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],\"filter->=\":[Q,[X,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],\"filter-id->=\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],\"filter-has\":[Q,[H],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],\"filter-has-id\":[Q,[],t=>t.id()!==null&&t.id()!==void 0],\"filter-type-in\":[Q,[Ut(X)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],\"filter-id-in\":[Q,[Ut(H)],(t,[e])=>e.value.indexOf(t.id())>=0],\"filter-in-small\":[Q,[X,Ut(H)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],\"filter-in-large\":[Q,[X,Ut(H)],(t,[e,r])=>o0(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[or(Q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[or(Q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},\"!\":[Q,[Q],(t,[e])=>!e.evaluate(t)],\"is-supported-script\":[Q,[X],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[X,[X],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[X,[X],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[X,or(H),(t,e)=>e.map(r=>qi(r.evaluate(t))).join(\"\")],split:[Ut(X),[X,X],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[X,[Ut(X),X],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],\"resolved-locale\":[X,[Va],(t,[e])=>e.evaluate(t).resolvedLocale()]});function l0(t){return Array.isArray(t)?`(${t.map(yt).join(\", \")})`:`(${yt(t.type)}...)`}function wa(t){if(t instanceof qp)return wa(t.boundExpression);if(t instanceof _r&&t.name===\"error\"||t instanceof Qp||t instanceof Pl||t instanceof Ll||t instanceof Vl)return!1;let e=t instanceof jr||t instanceof Me,r=!0;return t.eachChild(i=>{r&&(r=e?wa(i):i instanceof ei)}),r?qa(t)&&Ga(t,[\"zoom\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"]):!1}function qa(t){if(t instanceof _r&&(t.name===\"get\"&&t.args.length===1||t.name===\"feature-state\"||t.name===\"has\"&&t.args.length===1||t.name===\"properties\"||t.name===\"geometry-type\"||t.name===\"id\"||/^filter-/.test(t.name))||t instanceof Pl||t instanceof Ll)return!1;let e=!0;return t.eachChild(r=>{e&&!qa(r)&&(e=!1)}),e}function Qi(t){if(t instanceof _r&&t.name===\"feature-state\")return!1;let e=!0;return t.eachChild(r=>{e&&!Qi(r)&&(e=!1)}),e}function Ga(t,e){if(t instanceof _r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Ga(i,e)&&(r=!1)}),r}function ri(t){return t[\"property-type\"]===\"data-driven\"||t[\"property-type\"]===\"cross-faded-data-driven\"}function yf(t){return!!t.expression&&t.expression.parameters.indexOf(\"zoom\")>-1}function Ol(t){return!!t.expression&&t.expression.interpolated}var Rl=/^(.*)-transition$/;function tn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function K(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":t===null?\"null\":typeof t}function Ya(t){return typeof t==\"object\"&&!!t&&!Array.isArray(t)&&St(t)===fr}function u0(t){return t}function h0(t){switch(t.type){case\"color\":return mt.parse;case\"padding\":return Fe.parse;case\"numberArray\":return Ie.parse;case\"colorArray\":return oe.parse;default:return null}}function c0(t){switch(t){case\"exponential\":return gf;case\"interval\":return f0;case\"categorical\":return p0;case\"identity\":return d0;default:throw Error(`Unknown function type \"${t}\"`)}}function mf(t,e){let r=t.stops&&typeof t.stops[0][0]==\"object\",i=r||t.property!==void 0,n=r||!i,a=t.type||(Ol(e)?\"exponential\":\"interval\"),s=h0(e);if(s&&(t=tn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!im(t.colorSpace))throw Error(`Unknown color space: \"${t.colorSpace}\"`);let o=c0(a),l,u;if(a===\"categorical\"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;d<t.stops.length;d++){let y=t.stops[d],m=y[0].zoom;h[m]===void 0&&(h[m]={zoom:m,type:t.type,property:t.property,default:t.default,stops:[]},c.push(m)),h[m].stops.push([y[0].value,y[1]])}let p=[];for(let d of c)p.push([h[d].zoom,mf(h[d],e)]);let f={name:\"linear\"};return{kind:\"composite\",interpolationType:f,interpolationFactor:De.interpolationFactor.bind(void 0,f),zoomStops:p.map(d=>d[0]),evaluate({zoom:d},y){return gf({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a===\"exponential\"?{name:\"exponential\",base:t.base===void 0?1:t.base}:null;return{kind:\"camera\",interpolationType:h,interpolationFactor:De.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:\"source\",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?vn(t.default,e.default):o(t,e,p,l,u)}}}function vn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function p0(t,e,r,i,n){return vn(typeof r===n?i[r]:void 0,t.default,e.default)}function f0(t,e,r){if(K(r)!==\"number\")return vn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Na(t.stops.map(a=>a[0]),r,\"\");return t.stops[n][1]}function gf(t,e,r){let i=t.base===void 0?1:t.base;if(K(r)!==\"number\")return vn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Na(t.stops.map(h=>h[0]),r,\"\"),s=y0(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=mr[e.type]||u0;return typeof o.evaluate==\"function\"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function d0(t,e,r){switch(e.type){case\"color\":r=mt.parse(r);break;case\"formatted\":r=Le.fromString(r.toString());break;case\"resolvedImage\":r=Ee.fromString(r.toString());break;case\"padding\":r=Fe.parse(r);break;case\"colorArray\":r=oe.parse(r);break;case\"numberArray\":r=Ie.parse(r);break;default:K(r)!==e.type&&(e.type!==\"enum\"||!e.values[r])&&(r=void 0)}return vn(r,t.default,e.default)}function y0(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function mo(t){return{result:\"success\",value:t}}function Rr(t){return{result:\"error\",value:t}}var $l=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new zp,this._defaultValue=r?Df(r):null,this._enumValues=r&&r.type===\"enum\"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ii(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ii(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s==\"number\"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(\", \")}, but found ${JSON.stringify(s)} instead.`,\"\");return s}catch(s){let o=s instanceof ft?s.path:\"\",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<\"u\"&&console.warn(xf(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function xf(t,e,r,i){return`${t}${e}: ${r}${i==null?\"\":` Falling back to ${String(i)}.`}`}function vf(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. \"layers[3].paint.line-width\".')}function Xa(t){return Array.isArray(t)&&t.length>0&&typeof t[0]==\"string\"&&t[0]in Yr}function gr(t,e,r,i){vf(e);let n=new ff(Yr,wa,[],r?x0(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return a?mo(new $l(a,e,r,i)):Rr(n.errors)}var en=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!==\"constant\"&&!Qi(e.expression),this.globalStateRefs=bn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ii(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ii(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},_a=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!==\"camera\"&&!Qi(e.expression),this.globalStateRefs=bn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ii(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ii(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?De.interpolationFactor(this.interpolationType,t,e,r):0}};function m0(t){return t._styleExpression!==void 0}function bf(t,e,r,i){let n=gr(t,e,r,i);if(n.result===\"error\")return n;let a=n.value.expression,s=qa(a);if(!s&&!ri(r))return Rr([new ve(\"\",\"data expressions not supported\")]);let o=Ga(a,[\"zoom\"]);if(!o&&!yf(r))return Rr([new ve(\"\",\"zoom expressions not supported\")]);let l=pa(a);if(!l&&!o)return Rr([new ve(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if(l instanceof ve)return Rr([l]);if(l instanceof De&&!Ol(r))return Rr([new ve(\"\",'\"interpolate\" expressions cannot be used with this property')]);if(!l)return mo(s?new en(\"constant\",n.value,i):new en(\"source\",n.value,i));let u=l instanceof De?l.interpolation:void 0;return mo(s?new _a(\"camera\",n.value,l.labels,u,i):new _a(\"composite\",n.value,l.labels,u,i))}var wf=class _f{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,vf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Df(i),this._warningHistory={};let n=mf(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<\"u\"&&console.warn(xf(this._rootKey,\"\",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new _f(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function g0(t,e,r,i){if(Ya(t))return new wf(t,e,r);if(Xa(t)){let n=bf(t,e,r,i);if(n.result===\"error\")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(\", \"));return n.value}{let n=t;return r.type===\"color\"&&typeof t==\"string\"?n=mt.parse(t):r.type===\"padding\"&&(typeof t==\"number\"||Array.isArray(t))?n=Fe.parse(t):r.type===\"numberArray\"&&(typeof t==\"number\"||Array.isArray(t))?n=Ie.parse(t):r.type===\"colorArray\"&&(typeof t==\"string\"||Array.isArray(t))?n=oe.parse(t):r.type===\"variableAnchorOffsetCollection\"&&Array.isArray(t)?n=Ae.parse(t):r.type===\"projectionDefinition\"&&typeof t==\"string\"&&(n=wr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>n}}}function pa(t){let e=null;if(t instanceof Up)e=pa(t.result);else if(t instanceof Hp){for(let r of t.args)if(e=pa(r),e)break}else(t instanceof Tl||t instanceof De)&&t.input instanceof _r&&t.input.name===\"zoom\"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=pa(r);i instanceof ve?e=i:!e&&i?e=new ve(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):e&&i&&e!==i&&(e=new ve(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),e}function bn(t,e=new Set){return t instanceof Vl&&e.add(t.key),t.eachChild(r=>{bn(r,e)}),e}function x0(t){let e={color:pe,string:X,number:C,enum:X,boolean:Q,formatted:mn,padding:Oa,numberArray:Ra,colorArray:Hi,projectionDefinition:La,resolvedImage:gn,variableAnchorOffsetCollection:$a};return t.type===\"array\"?Ut(e[t.value]||H,t.length):e[t.type]}function Df(t){if(t.type===\"color\"&&Ya(t.default))return new mt(0,0,0,0);switch(t.type){case\"color\":return mt.parse(t.default)||null;case\"padding\":return Fe.parse(t.default)||null;case\"numberArray\":return Ie.parse(t.default)||null;case\"colorArray\":return oe.parse(t.default)||null;case\"variableAnchorOffsetCollection\":return Ae.parse(t.default)||null;case\"projectionDefinition\":return wr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ii(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function v0(t){let e=!1;for(let r of t){let i=Sf(r);if(i===\"expression\")return\"expression\";i===\"legacy\"&&(e=!0)}return e?\"legacy\":\"neutral\"}function Sf(t){if(typeof t==\"boolean\")return\"neutral\";if(!Array.isArray(t)||t.length===0)return\"legacy\";switch(t[0]){case\"has\":return t.length<2||t[1]===\"$id\"||t[1]===\"$type\"?\"legacy\":t.length===2?\"neutral\":\"expression\";case\"in\":return t.length>=3&&(typeof t[1]!=\"string\"||Array.isArray(t[2]))?\"expression\":\"legacy\";case\"!in\":case\"!has\":return\"legacy\";case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?\"expression\":\"legacy\";case\"none\":return\"legacy\";case\"any\":case\"all\":return v0(t.slice(1));default:return\"expression\"}}function Nl(t){return Sf(t)!==\"legacy\"}function Ah(t){return t===\"$type\"?[\"geometry-type\"]:t===\"$id\"?[\"id\"]:[\"get\",t]}function b0(t){switch(t[0]){case\"==\":case\"!=\":case\"<\":case\"<=\":case\">\":case\">=\":return t.length!==3||typeof t[1]!=\"string\"?null:[t[0],Ah(t[1]),t[2]];case\"in\":case\"!in\":{if(t.length<2||typeof t[1]!=\"string\")return null;let e=[\"in\",Ah(t[1]),[\"literal\",t.slice(2)]];return t[0]===\"!in\"?[\"!\",e]:e}case\"has\":case\"!has\":{if(t.length!==2||typeof t[1]!=\"string\"||t[1]===\"$type\"||t[1]===\"$id\")return null;let e=[\"has\",t[1]];return t[0]===\"!has\"?[\"!\",e]:e}default:return null}}function Af(t){if((t[0]===\"<\"||t[0]===\"<=\"||t[0]===\">\"||t[0]===\">=\")&&t[1]===\"$type\")return`\"$type\" cannot be use with operator \"${t[0]}\"`;let e=b0(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Rs(t,e,r){let i=r[t];return Array.isArray(i)?Nl(i)?Ul(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ul(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case\"all\":case\"any\":case\"none\":for(let r=1;r<t.length;r++){let i=Rs(r,e,t);if(i)return i}break;case\"!\":{let r=Rs(1,e,t);if(r)return r;break}case\"case\":for(let r=1;r<t.length-1;r+=2){let i=Rs(r,e,t);if(i)return i}}return null}function w0(t,e){let r=Ul(t);if(!r||typeof console>\"u\")return;let i=r.path.map(n=>`[${n}]`).join(\"\");console.warn(`${e}${i}: ${Af(r.legacyFilter)}`)}var _0={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function rn(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Nl(t)?w0(t,e):t=Da(t);let i=gr(t,e,_0,r);if(i.result===\"error\")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(\", \"));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:Ef(t),getGlobalStateRefs:()=>bn(i.value.expression)}}function D0(t,e){return t<e?-1:+(t>e)}function Ef(t){if(!Array.isArray(t))return!1;if(t[0]===\"within\"||t[0]===\"distance\")return!0;for(let e=1;e<t.length;e++)if(Ef(t[e]))return!0;return!1}function Da(t){if(!t)return!0;let e=t[0];return t.length<=1?e!==\"any\":e===\"==\"?$s(t[1],t[2],\"==\"):e===\"!=\"?Wn($s(t[1],t[2],\"==\")):e===\"<\"||e===\">\"||e===\"<=\"||e===\">=\"?$s(t[1],t[2],e):e===\"any\"?S0(t.slice(1)):e===\"all\"?[\"all\"].concat(t.slice(1).map(Da)):e===\"none\"?[\"all\"].concat(t.slice(1).map(Da).map(Wn)):e===\"in\"?Eh(t[1],t.slice(2)):e===\"!in\"?Wn(Eh(t[1],t.slice(2))):e===\"has\"?Fh(t[1]):e!==\"!has\"||Wn(Fh(t[1]))}function $s(t,e,r){switch(t){case\"$type\":return[`filter-type-${r}`,e];case\"$id\":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function S0(t){return[\"any\"].concat(t.map(Da))}function Eh(t,e){if(e.length===0)return!1;switch(t){case\"$type\":return[\"filter-type-in\",[\"literal\",e]];case\"$id\":return[\"filter-id-in\",[\"literal\",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?[\"filter-in-large\",t,[\"literal\",e.sort(D0)]]:[\"filter-in-small\",t,[\"literal\",e]]}}function Fh(t){switch(t){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",t]}}function Wn(t){return[\"!\",t]}function go(t){let e=typeof t;if(e===\"number\"||e===\"boolean\"||e===\"string\"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n=\"[\";for(let a of t)n+=`${go(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i=\"{\";for(let n=0;n<r.length;n++)i+=`${JSON.stringify(r[n])}:${go(t[r[n]])},`;return`${i}}`}function A0(t){let e=\"\";for(let r of Y1)e+=`/${go(t[r])}`;return e}function E0(t,e){let r={};for(let n=0;n<t.length;n++){let a=e&&e[t[n].id]||A0(t[n]);e&&(e[t[n].id]=a);let s=r[a];s||(s=r[a]=[]),s.push(t[n])}let i=[];for(let n in r)i.push(r[n]);return i}function Ff(t){let e=t.key,r=t.value;return r?[new I(e,r,\"constants have been deprecated as of v8\")]:[]}function _t(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function xr(t){if(Array.isArray(t))return t.map(xr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=xr(t[r]);return e}return _t(t)}function te(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=K(r);if(u!==\"object\")return[new I(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(\".\")[0],p=ji(i,c)||i[\"*\"],f;if(ji(n,c))f=n[c];else if(ji(i,c)){if(r[h]===void 0)continue;f=o}else if(n[\"*\"])f=n[\"*\"];else if(i[\"*\"])f=o;else{l.push(new I(e,r[h],`unknown property \"${h}\"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new I(e,r,`missing required property \"${h}\"`));return l}function jl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(K(e)!==\"array\")return[new I(s,e,`array expected, ${K(e)} found`)];if(r.length&&e.length!==r.length)return[new I(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),K(r.value)===\"object\"&&(l=r.value);let u=[];for(let h=0;h<e.length;h++)u=u.concat(o({array:e,arrayIndex:h,value:e[h],valueSpec:l,validateSpec:t.validateSpec,style:n,styleSpec:a,key:`${s}[${h}]`}));return u}function Wa(t){let e=t.key,r=t.value,i=t.valueSpec,n=K(r);return n===\"number\"&&r!==r&&(n=\"NaN\"),n===\"number\"?\"minimum\"in i&&r<i.minimum?[new I(e,r,`${r} is less than the minimum value ${i.minimum}`)]:\"maximum\"in i&&r>i.maximum?[new I(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new I(e,r,`number expected, ${n} found`)]}function If(t){let e=t.valueSpec,r=_t(t.value.type),i,n={},a,s,o=r!==\"categorical\"&&t.value.property===void 0,l=!o,u=K(t.value.stops)===\"array\"&&K(t.value.stops[0])===\"array\"&&K(t.value.stops[0][0])===\"object\",h=te({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r===\"identity\"&&o&&h.push(new I(t.key,t.value,'missing required property \"property\"')),r!==\"identity\"&&!t.value.stops&&h.push(new I(t.key,t.value,'missing required property \"stops\"')),r===\"exponential\"&&t.valueSpec.expression&&!Ol(t.valueSpec)&&h.push(new I(t.key,t.value,\"exponential functions not supported\")),t.styleSpec.$version>=8&&(l&&!ri(t.valueSpec)?h.push(new I(t.key,t.value,\"property functions not supported\")):o&&!yf(t.valueSpec)&&h.push(new I(t.key,t.value,\"zoom functions not supported\"))),(r===\"categorical\"||u)&&t.value.property===void 0&&h.push(new I(t.key,t.value,'\"property\" property is required')),h;function c(y){if(r===\"identity\")return[new I(y.key,y.value,'identity function may not have a \"stops\" property')];let m=[],g=y.value;return m=m.concat(jl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),K(g)===\"array\"&&g.length===0&&m.push(new I(y.key,g,\"array must have at least one stop\")),m}function p(y){let m=[],g=y.value,x=y.key;if(K(g)!==\"array\")return[new I(x,g,`array expected, ${K(g)} found`)];if(g.length!==2)return[new I(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(K(g[0])!==\"object\")return[new I(x,g,`object expected, ${K(g[0])} found`)];if(g[0].zoom===void 0)return[new I(x,g,\"object stop key must have zoom\")];if(g[0].value===void 0)return[new I(x,g,\"object stop key must have value\")];if(s&&s>_t(g[0].zoom))return[new I(x,g[0].zoom,\"stop zoom values must appear in ascending order\")];_t(g[0].zoom)!==s&&(s=_t(g[0].zoom),a=void 0,n={}),m=m.concat(te({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Wa,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return Xa(xr(g[1]))?m.concat([new I(`${x}[1]`,g[1],\"expressions are not allowed in function stops.\")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=K(y.value),x=_t(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new I(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!==\"number\"&&g!==\"string\"&&g!==\"boolean\")return[new I(y.key,v,\"stop domain value must be a number, string, or boolean\")];if(g!==\"number\"&&r!==\"categorical\"){let b=`number expected, ${g} found`;return ri(e)&&r===void 0&&(b+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new I(y.key,v,b)]}return r===\"categorical\"&&g===\"number\"&&(!isFinite(x)||Math.floor(x)!==x)?[new I(y.key,v,`integer expected, found ${x}`)]:r!==\"categorical\"&&g===\"number\"&&a!==void 0&&x<a?[new I(y.key,v,\"stop domain values must appear in ascending order\")]:(a=x,r===\"categorical\"&&x in n?[new I(y.key,v,\"stop domain values must be unique\")]:(n[x]=!0,[]))}function d(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function ni(t){let e=(t.expressionContext===\"property\"?bf:gr)(xr(t.value),t.key,t.valueSpec);if(e.result===\"error\")return e.value.map(i=>new I(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext===\"property\"&&t.propertyKey===\"text-font\"&&!r.outputDefined())return[new I(t.key,t.value,`Invalid data expression for \"${t.propertyKey}\". Output values must be contained as literals within the expression.`)];if(t.expressionContext===\"property\"&&t.propertyType===\"layout\"&&!Qi(r))return[new I(t.key,t.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(t.expressionContext===\"filter\"&&!Qi(r))return[new I(t.key,t.value,'\"feature-state\" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf(\"cluster\")===0){if(!Ga(r,[\"zoom\",\"feature-state\"]))return[new I(t.key,t.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(t.expressionContext===\"cluster-initial\"&&!qa(r))return[new I(t.key,t.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function F0(t){let e=t.value,r=t.key,i=K(e);return i===\"boolean\"?[]:[new I(r,e,`boolean expected, ${i} found`)]}function xo(t){let e=t.key,r=t.value,i=K(r);return i===\"string\"?mt.parse(String(r))?[]:[new I(e,r,`color expected, \"${r}\" found`)]:[new I(e,r,`color expected, ${i} found`)]}function nn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(_t(r))===-1&&n.push(new I(e,r,`expected one of [${i.values.join(\", \")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(_t(r))===-1&&n.push(new I(e,r,`expected one of [${Object.keys(i.values).join(\", \")}], ${JSON.stringify(r)} found`)),n}function I0(t,e){let r=t;for(let i of e)r=r[i];return r}function T0(t,e){let r=Ul(e);return r?[new I(`${t.key}${r.path.map(i=>`[${i}]`).join(\"\")}`,I0(t.value,r.path),Af(r.legacyFilter),null,\"warning\")]:[]}function ql(t){let e=xr(t.value);return Nl(e)?[...T0(t,e),...ni(tn({},t,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}}))]:Tf(t)}function Tf(t){let e=t.value,r=t.key;if(K(e)!==\"array\")return[new I(r,e,`array expected, ${K(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new I(r,e,\"filter array must have at least 1 element\")];switch(a=a.concat(nn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),_t(e[0])){case\"<\":case\"<=\":case\">\":case\">=\":e.length>=2&&_t(e[1])===\"$type\"&&a.push(new I(r,e,`\"$type\" cannot be use with operator \"${e[0]}\"`));case\"==\":case\"!=\":e.length!==3&&a.push(new I(r,e,`filter array for operator \"${e[0]}\" must have 3 elements`));case\"in\":case\"!in\":e.length>=2&&(n=K(e[1]),n!==\"string\"&&a.push(new I(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s<e.length;s++)n=K(e[s]),_t(e[1])===\"$type\"?a=a.concat(nn({key:`${r}[${s}]`,value:e[s],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):n!==\"string\"&&n!==\"number\"&&n!==\"boolean\"&&a.push(new I(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${n} found`));break;case\"any\":case\"all\":case\"none\":for(let s=1;s<e.length;s++)a=a.concat(Tf({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case\"has\":case\"!has\":n=K(e[1]),e.length===2?n!==\"string\"&&a.push(new I(`${r}[1]`,e[1],`string expected, ${n} found`)):a.push(new I(r,e,`filter array for \"${e[0]}\" operator must have 2 elements`))}return a}function kf(t,e){let r=t.key,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.value,o=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];let u=o.match(Rl);if(e===\"paint\"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let h=t.valueSpec||l[o];if(!h)return[new I(r,s,`unknown property \"${o}\"`)];let c;if(K(s)===\"string\"&&ri(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new I(r,s,`\"${o}\" does not support interpolation syntax\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(c[1])} }\\`.`)];let p=[];return t.layerType===\"symbol\"&&o===\"text-font\"&&Ya(xr(s))&&_t(s.type)===\"identity\"&&p.push(new I(r,s,'\"text-font\" does not support identity functions')),p.concat(i({key:t.key,value:s,valueSpec:h,style:n,styleSpec:a,expressionContext:\"property\",propertyType:e,propertyKey:o}))}function Cf(t){return kf(t,\"paint\")}function Pf(t){return kf(t,\"layout\")}function Mf(t){let e=[],r=t.value,i=t.key,n=t.style,a=t.styleSpec;if(K(r)!==\"object\")return[new I(i,r,`object expected, ${K(r)} found`)];!r.type&&!r.ref&&e.push(new I(i,r,'either \"type\" or \"ref\" is required'));let s=_t(r.type),o=_t(r.ref);if(r.id){let l=_t(r.id);for(let u=0;u<t.arrayIndex;u++){let h=n.layers[u];_t(h.id)===l&&e.push(new I(i,r.id,`duplicate layer id \"${r.id}\", previously used at line ${h.id.__line__}`))}}if(\"ref\"in r){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(u=>{u in r&&e.push(new I(i,r[u],`\"${u}\" is prohibited for ref layers`))});let l;n.layers.forEach(u=>{_t(u.id)===o&&(l=u)}),l?l.ref?e.push(new I(i,r.ref,\"ref cannot reference another ref layer\")):s=_t(l.type):e.push(new I(i,r.ref,`ref layer \"${o}\" not found`))}else if(s!==\"background\")if(!r.source)e.push(new I(i,r,'missing required property \"source\"'));else{let l=n.sources&&n.sources[r.source],u=l&&_t(l.type);l?u===\"vector\"&&s===\"raster\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a raster source`)):u!==\"raster-dem\"&&s===\"hillshade\"||u!==\"raster-dem\"&&s===\"color-relief\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a raster-dem source`)):u===\"raster\"&&s!==\"raster\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a vector source`)):u===\"vector\"&&!r[\"source-layer\"]?e.push(new I(i,r,`layer \"${r.id}\" must specify a \"source-layer\"`)):u===\"raster-dem\"&&s!==\"hillshade\"&&s!==\"color-relief\"?e.push(new I(i,r.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):s===\"line\"&&r.paint&&r.paint[\"line-gradient\"]&&(u!==\"geojson\"||!l.lineMetrics)&&e.push(new I(i,r,`layer \"${r.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new I(i,r.source,`source \"${r.source}\" not found`))}return s===\"raster\"&&r.paint?.resampling&&r.paint?.[\"raster-resampling\"]&&e.push(new I(i,r.paint,`layer \"${r.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),e=e.concat(te({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{\"*\"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:\"type\"})},filter:ql,layout(l){return te({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Pf(tn({layerType:s},u))}}})},paint(l){return te({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Cf(tn({layerType:s},u))}}})}}})),e}function er(t){let e=t.value,r=t.key,i=K(e);return i===\"string\"?[]:[new I(r,e,`string expected, ${i} found`)]}function k0(t){let e=t.sourceName??\"\",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=K(r);if(r===void 0)return s;if(o!==\"object\")return s.push(new I(\"source_raster_dem\",r,`object expected, ${o} found`)),s;let l=_t(r.encoding)===\"custom\",u=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],h=t.value.encoding?`\"${t.value.encoding}\"`:\"Default\";for(let c in r)!l&&u.includes(c)?s.push(new I(c,r[c],`In \"${e}\": \"${c}\" is only valid when \"encoding\" is set to \"custom\". ${h} encoding found`)):n[c]?s=s.concat(t.validateSpec({key:c,value:r[c],valueSpec:n[c],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new I(c,r[c],`unknown property \"${c}\"`));return s}var Ih={promoteId:C0};function Bf(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new I(r,e,'\"type\" is required')];let s=_t(e.type),o;switch(s){case\"vector\":case\"raster\":return o=te({key:r,value:e,valueSpec:i[`source_${s.replace(\"-\",\"_\")}`],style:t.style,styleSpec:i,objectElementValidators:Ih,validateSpec:a}),o;case\"raster-dem\":return o=k0({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case\"geojson\":if(o=te({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ih}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u;o.push(...ni({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:\"cluster-map\"})),o.push(...ni({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:\"cluster-reduce\"}))}return o;case\"video\":return te({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case\"image\":return te({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case\"canvas\":return[new I(r,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return nn({key:`${r}.type`,value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:n,validateSpec:a,styleSpec:i})}}function C0({key:t,value:e}){if(K(e)===\"string\")return er({key:t,value:e});{let r=[];for(let i in e)r.push(...er({key:`${t}.${i}`,value:e[i]}));return r}}function zf(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new I(\"light\",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Rl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new I(o,e[o],`unknown property \"${o}\"`)])}return a}function Lf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new I(\"sky\",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Rl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new I(o,e[o],`unknown property \"${o}\"`)])}return s}function Vf(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new I(\"terrain\",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new I(o,e[o],`unknown property \"${o}\"`)]);return a}function P0(t){return er(t).length===0?[]:ni(t)}function M0(t){return er(t).length===0?[]:ni(t)}function B0(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1||r.length>4)return[new I(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:\"number\"},n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return Wa({key:e,value:r,valueSpec:{}})}function z0(t){let e=t.key,r=t.value;if(K(r)===\"array\"){let i={type:\"number\"};if(r.length<1)return[new I(e,r,\"array length at least 1 expected, length 0 found\")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return Wa({key:e,value:r,valueSpec:{}})}function L0(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1)return[new I(e,r,\"array length at least 1 expected, length 0 found\")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(xo({key:`${e}[${n}]`,value:r[n],valueSpec:{}}));return i}return xo({key:e,value:r,valueSpec:{}})}function V0(t){let e=t.key,r=t.value,i=K(r),n=t.styleSpec;if(i!==\"array\"||r.length<1||r.length%2!=0)return[new I(e,r,\"variableAnchorOffsetCollection requires a non-empty array of even length\")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(nn({key:`${e}[${s}]`,value:r[s],valueSpec:n.layout_symbol[\"text-anchor\"]})),a=a.concat(jl({key:`${e}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:\"number\"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return a}function Of(t){let e=[],r=t.value,i=t.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&e.push(new I(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&e.push(new I(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),e=e.concat(te({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:\"string\",required:!0},url:{type:\"string\",required:!0}},validateSpec:t.validateSpec}));return e}return er({key:i,value:r})}function O0(t){let e=t.value,r=t.styleSpec,i=r.projection,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new I(\"projection\",e,`object expected, ${a} found`)];let s=[];for(let o in e)s=i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new I(o,e[o],`unknown property \"${o}\"`)]);return s}function R0(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let i=K(r);return i===\"array\"&&!N0(r)&&!$0(r)?[new I(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:[\"array\",\"string\"].includes(i)?[]:[new I(e,r,`projection expected, invalid type \"${i}\" found`)]}function $0(t){return!![\"interpolate\",\"step\",\"literal\"].includes(t[0])}function N0(t){return Array.isArray(t)&&t.length===3&&typeof t[0]==\"string\"&&typeof t[1]==\"string\"&&typeof t[2]==\"number\"}function vo(t){return!!t&&t.constructor===Object}function Rf(t){return vo(t.value)?[]:[new I(t.key,t.value,`object expected, ${K(t.value)} found`)]}var Th=1114111,U0=/^u\\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\\?{1,6}))$/i;function j0(t,e){if(K(e)!==\"string\")return[];let r=`${e}`,i=()=>[new I(t,e,'invalid unicode range, expected a value such as \"U+26\", \"U+0-10FFFF\" or \"U+4??\"')],n=r.match(U0);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Th||u>Th?[new I(t,e,\"unicode range is out of bounds, the maximum code point is U+10FFFF\")]:l>u?[new I(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function $f(t){let e=t.key??\"font-faces\",r=t.value,i=t.validateSpec,n=t.styleSpec??Sp,a=t.style;if(!vo(r))return[new I(e,r,`object expected, ${K(r)} found`)];let s=[];for(let o in r){let l=r[o],u=K(l);if(u===\"string\")s.push(...er({key:`${e}.${o}`,value:l}));else if(u===\"array\"){let h={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[c,p]of l.entries()){let f=`${e}.${o}[${c}]`;s.push(...te({key:f,value:p,valueSpec:h,styleSpec:n,style:a,validateSpec:i}));let d=vo(p)?p[\"unicode-range\"]:void 0;if(K(d)===\"array\")for(let[y,m]of d.entries())s.push(...j0(`${f}.unicode-range[${y}]`,m))}}else s.push(new I(`${e}.${o}`,l,`string or array expected, ${u} found`))}return s}var kh={\"*\"(){return[]},array:jl,boolean:F0,number:Wa,color:xo,constants:Ff,enum:nn,filter:ql,function:If,layer:Mf,object:te,source:Bf,light:zf,sky:Lf,terrain:Vf,projection:O0,projectionDefinition:R0,string:er,formatted:P0,resolvedImage:M0,padding:B0,numberArray:z0,colorArray:L0,variableAnchorOffsetCollection:V0,sprite:Of,state:Rf,fontFaces:$f};function Gi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Gi,r.expression&&Ya(_t(e))?If(t):r.expression&&Xa(xr(e))?ni(t):r.type&&kh[r.type]?kh[r.type](t):te(tn({},t,{valueSpec:r.type?i[r.type]:r}))}function Nf(t){let e=t.value,r=t.key,i=er(t);return i.length||(e.indexOf(\"{fontstack}\")===-1&&i.push(new I(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),e.indexOf(\"{range}\")===-1&&i.push(new I(r,e,'\"glyphs\" url must include a \"{range}\" token'))),i}function Jt(t,e=S){let r=[];return r=r.concat(Gi({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Gi,objectElementValidators:{glyphs:Nf,\"*\"(){return[]}}})),t.constants&&(r=r.concat(Ff({key:\"constants\",value:t.constants,style:t,styleSpec:e,validateSpec:Gi}))),Uf(r)}Jt.source=ne(ie(Bf)),Jt.sprite=ne(ie(Of)),Jt.glyphs=ne(ie(Nf)),Jt.fontFaces=ne(ie($f)),Jt.light=ne(ie(zf)),Jt.sky=ne(ie(Lf)),Jt.terrain=ne(ie(Vf)),Jt.state=ne(ie(Rf)),Jt.layer=ne(ie(Mf)),Jt.filter=ne(ie(ql)),Jt.paintProperty=ne(ie(Cf)),Jt.layoutProperty=ne(ie(Pf));function ie(t){return function(e){return t(Object.assign({},e,{validateSpec:Gi}))}}function Uf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ne(t){return function(...e){return Uf(t.apply(this,e))}}var q0={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"},G0=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t===\"visible\"||t===\"none\"){this._literalValue=t===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=gr(t,this._rootKey,q0,this._globalState);if(e.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(\", \"));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=bn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Y0(t,e,r){return new G0(t,e,r)}var Gl={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function X0(t){return Gl.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf(\"://\"))]}function W0(t,e){Gl.REGISTERED_PROTOCOLS[t]=e}function Z0(t){delete Gl.REGISTERED_PROTOCOLS[t]}var Ch=\"global-dispatcher\",Sa=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function jf(){if(Kr(self))return self.worker?.referrer;if(window.location.protocol===\"blob:\")try{return window.parent.location.href}catch{}return window.location.href}var H0=t=>t.startsWith(\"file:\")||jf()?.startsWith(\"file:\")&&!/^\\w+:/.test(t);async function J0(t,e){let r=new Request(t.url,{method:t.method||\"GET\",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:jf(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type===\"json\"&&!r.headers.has(\"Accept\")&&r.headers.set(\"Accept\",\"application/json\");let i;try{i=await fetch(r)}catch(s){throw _p(s)?s:new Sa(0,ya(s).message,t.url,new Blob)}if(!i.ok){let s=await i.blob();throw new Sa(i.status,i.statusText,t.url,s)}let n;n=t.type===\"arrayBuffer\"||t.type===\"image\"?i.arrayBuffer():t.type===\"json\"?i.json():i.text();let a=await n;return G1(e.signal),{data:a,cacheControl:i.headers.get(\"Cache-Control\"),expires:i.headers.get(\"Expires\"),etag:i.headers.get(\"ETag\")}}function K0(t,e){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(t.method||\"GET\",t.url,!0),(t.type===\"arrayBuffer\"||t.type===\"image\")&&(n.responseType=\"arraybuffer\");for(let a in t.headers)n.setRequestHeader(a,t.headers[a]);t.type===\"json\"&&(n.responseType=\"text\",t.headers?.Accept||n.setRequestHeader(\"Accept\",\"application/json\")),n.withCredentials=t.credentials===\"include\",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(t.type===\"json\")try{a=JSON.parse(n.response)}catch(s){i(s);return}r({data:a,cacheControl:n.getResponseHeader(\"Cache-Control\"),expires:n.getResponseHeader(\"Expires\"),etag:n.getResponseHeader(\"ETag\")})}else{let a=new Blob([n.response],{type:n.getResponseHeader(\"Content-Type\")});i(new Sa(n.status,n.statusText,t.url,a))}},e.signal.addEventListener(\"abort\",()=>{n.abort(),i(new El(e.signal.reason))}),n.send(t.body)})}var Yl=async function(t,e){if(t.url.includes(\"://\")&&!/^https?:|^file:/.test(t.url)){let r=X0(t.url);if(r){let i=await r(t,e);return!i.data&&t.type===\"arrayBuffer\"?Wt(i,{data:new ArrayBuffer(0)}):i}if(Kr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,targetMapId:Ch},e)}if(!H0(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,\"signal\"))return J0(t,e);if(Kr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,mustQueue:!0,targetMapId:Ch},e)}return K0(t,e)},Q0=(t,e)=>Yl(Wt(t,{type:\"json\"}),e),tg=(t,e)=>Yl(Wt(t,{type:\"arrayBuffer\"}),e),Be={};function M(t,e,r={}){if(Be[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,\"_classRegistryKey\",{value:t,writeable:!1}),Be[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}M(\"Object\",Object),M(\"Set\",Set),M(\"TransferableGridIndex\",ao),M(\"Color\",mt),M(\"Error\",Error),M(\"AJAXError\",Sa),M(\"ResolvedImage\",Ee),M(\"StylePropertyFunction\",wf),M(\"StyleExpression\",$l,{omit:[\"_evaluator\"]}),M(\"ZoomDependentExpression\",_a),M(\"ZoomConstantExpression\",en),M(\"CompoundExpression\",_r,{omit:[\"_evaluate\"]});for(let t in Yr)Yr[t]._classRegistryKey||M(`Expression_${t}`,Yr[t]);function qf(t){return t&&typeof ArrayBuffer<\"u\"&&(t instanceof ArrayBuffer||t.constructor?.name===\"ArrayBuffer\")}function Xl(t){let e=t.constructor;return t.$name||e._classRegistryKey}function eg(t){if(typeof t!=\"object\"||!t)return!1;let e=Xl(t);return e&&e!==\"Object\"}function Gf(t){return!eg(t)&&(t==null||typeof t==\"boolean\"||typeof t==\"number\"||typeof t==\"string\"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||qf(t)||Al(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Yi(t,e){if(Gf(t))return(qf(t)||Al(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let a=[];for(let s of t)a.push(Yi(s,e));return a}if(typeof t!=\"object\")throw Error(`can't serialize object of type ${typeof t}`);let r=Xl(t);if(!r)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Be[r])throw Error(`${r} is not registered.`);let{klass:i}=Be[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(n===e?.[e.length-1])throw Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let a in t){if(!t.hasOwnProperty(a)||Be[r].omit.includes(a))continue;let s=t[a];s!==void 0&&(n[a]=Be[r].shallow.includes(a)?s:Yi(s,e))}t instanceof Error&&(n.message=t.message)}if(n.$name)throw Error(\"$name property is reserved for worker serialization logic.\");return r!==\"Object\"&&(n.$name=r),n}function Xi(t){if(Gf(t))return t;if(Array.isArray(t))return t.map(Xi);if(typeof t!=\"object\")throw Error(`can't deserialize object of type ${typeof t}`);let e=Xl(t)||\"Object\";if(!Be[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Be[e];if(!r)throw Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n===\"$name\")continue;let a=t[n];i[n]=Be[e].shallow.includes(n)?a:Xi(a)}return i}var rg=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},ig={once:!0},ng=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new rg(()=>this.process()),this.subscription=lh(this.target,\"message\",r=>this.receive(r),!1),this.globalScope=Kr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?lh(e.signal,\"abort\",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:\"<cancel>\",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new El(e.signal.reason))},ig):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let s=[],o={...t,id:n,sourceMapId:this.mapId,origin:location.origin,data:Yi(t.data,s)};this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=[\"file://\",\"resource://android\",\"null\"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId))if(e.type===\"<cancel>\"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort()}else Kr(self)||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}async processTask(t,e){if(e.type===\"<response>\"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(ya(Xi(e.error))):n.resolve(Xi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Xi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=await this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,ya(n))}}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:\"<response>\",sourceMapId:this.mapId,origin:location.origin,error:e?Yi(e):null,data:Yi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Ph=Jt;new Set(Object.keys(S).filter(t=>t.startsWith(\"source_\")).map(t=>t.slice(7).replaceAll(\"_\",\"-\")));function ag(t,e){let r=!1;for(let i of e)i.severity===\"warning\"?Ct(i.message):(t.fire(new ga(Error(i.message))),r=!0);return r}function sg(t,e,r,i){return i?.validate!==!1&&ag(t,e({styleSpec:S,...r}))}var Mh=class{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}},ot=class{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new Mh,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Mh,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},an=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=g0(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(t){let e=this.getGlobalStateRefs();return t.some(r=>e.has(r))}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},bo=class{constructor(t,e,r){this.property=t,this.value=new an(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new Bh(this.property,this.value,e,Wt({},t.transition,this.transition),t.now)}untransitioned(){return new Bh(this.property,this.value,null,{},0)}},og=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return Ze(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new bo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new an(this._values[t].property,e===null?void 0:Ze(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith(\"-transition\")?this.setTransition(e.slice(0,-11),r):no(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return Ze(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new bo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=Ze(e)||void 0}retainPriorGlobalState(t,e,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(t)&&(n.value=new an(a.property,a.value,this._propertyRootKey(i),e))}}applyGlobalStateChange(t,e,r,i){this.retainPriorGlobalState(t,e,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(t)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new zh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new zh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Bh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(t,e,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),n,z1(s))}}},zh=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let i=new Za(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},lg=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return Ze(this._values[t].value)}setValue(t,e){this._values[t]=new an(this._values[t].property,e===null?void 0:Ze(e),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let i=new Za(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}},se=class{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return this.value.kind===\"constant\"}constantOr(t){return this.value.kind===\"constant\"?this.value.value:t}evaluate(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)}},Za=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function Lh(t){if(Array.isArray(t))return t.length;let e=t?.values;return Array.isArray(e)?e.length:void 0}function Yf(t,e){let r=Lh(t),i=Lh(e);return r!==void 0&&i!==void 0&&r!==i}var O=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e){if(t.isDataDriven())throw Error(\"Value should not be data driven\");return t.expression.evaluate(e)}interpolate(t,e,r){if(Yf(t,e))return Ct(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=mr[i];return n?n(t,e,r):t}},N=class{constructor(t,e,r){this.specification=t,this.name=e,this.overrides=r}possiblyEvaluate(t,e,r,i){return t.expression.kind===\"constant\"||t.expression.kind===\"camera\"?new se(this,{kind:\"constant\",value:t.expression.evaluate(e,null,{},r,i)},e):new se(this,t.expression,e)}interpolate(t,e,r){if(t.value.kind!==\"constant\"||e.value.kind!==\"constant\")return t;if(t.value.value===void 0||e.value.value===void 0)return new se(this,{kind:\"constant\",value:void 0},t.parameters);if(Yf(t.value.value,e.value.value))return Ct(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=mr[i];if(n){let a=n(t.value.value,e.value.value,r);return new se(this,{kind:\"constant\",value:a},t.parameters)}return t}evaluate(t,e,r,i,n,a){return t.kind===\"constant\"?t.value:t.evaluate(e,r,i,n,a)}},sn=class extends N{possiblyEvaluate(t,e,r,i){if(t.value===void 0)return new se(this,{kind:\"constant\",value:void 0},e);if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i),a=t.property.specification.type===\"resolvedImage\"&&typeof n!=\"string\"?n.name:n,s=this._calculate(a,a,a,e);return new se(this,{kind:\"constant\",value:s},e)}if(t.expression.kind===\"camera\"){let n=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new se(this,{kind:\"constant\",value:n},e)}return new se(this,t.expression,e)}evaluate(t,e,r,i,n,a){if(t.kind===\"source\"){let s=t.evaluate(e,r,i,n,a);return this._calculate(s,s,s,e)}return t.kind===\"composite\"?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Xf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new ot(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ot(Math.floor(e.zoom),e)),t.expression.evaluate(new ot(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Ha=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Gt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new an(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new bo(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};M(\"DataDrivenProperty\",N),M(\"DataConstantProperty\",O),M(\"CrossFadedDataDrivenProperty\",sn),M(\"CrossFadedProperty\",Xf),M(\"ColorRampProperty\",Ha);var Vh=\" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?\",Ns=\" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?\",de=class extends q1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Y0(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!==\"custom\"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==\"background\"&&(this.source=t.source,this.sourceLayer=t[\"source-layer\"],this.filter=t.filter,this._featureFilter=rn(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new lg(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new og(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Za(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=rn(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t===\"visibility\")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+Vh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property \"${t}\" on layer type \"${this.type}\" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let e in this._transitionablePaint._values){let r=this._transitionablePaint._values[e].value;for(let i of r.getGlobalStateRefs()){let n=t.get(i)??[];n.push({name:e,value:r.value}),t.set(i,n)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){t===\"visibility\"?(this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility()):this._transitionablePaint?.hasProperty(t)?this.fire(new ga(Error(t+Vh))):e!=null&&this._validate(Ph.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){if(t.endsWith(\"-transition\")){let e=t.slice(0,-11);if(e===\"visibility\"||this._unevaluatedLayout?.hasProperty(e))throw Error(t+Ns);return this._transitionablePaint.getTransition(e)}if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+Ns);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new ga(Error(t+Ns))),!1;if(e!=null&&this._validate(Ph.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(\"-transition\"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let i=this._transitionablePaint._values[t],n=i.property.specification[\"property-type\"]===\"cross-faded-data-driven\",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility===\"none\"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}retainPriorGlobalState(t,e){this._transitionablePaint?.retainPriorGlobalState(t,e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={id:this.id,type:this.type,source:this.source,\"source-layer\":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),R1(t,(e,r)=>e!==void 0&&!(r===\"layout\"&&!Object.keys(e).length)&&!(r===\"paint\"&&!Object.keys(e).length))}_validate(t,e,r,i,n={}){return sg(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof se&&ri(e.property.specification)&&(e.value.kind===\"source\"||e.value.kind===\"composite\")&&e.value.isStateDependent)return!0}return!1}},ug={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},wn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},gt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function At(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=hg(n.type),s=r=Oh(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:Oh(r,Math.max(i,e)),alignment:e}}function hg(t){return ug[t].BYTES_PER_ELEMENT}function Oh(t,e){return Math.ceil(t/e)*e}var on=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};on.prototype.bytesPerElement=4,M(\"StructArrayLayout2i4\",on);var wo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};wo.prototype.bytesPerElement=6,M(\"StructArrayLayout3i6\",wo);var Rh=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Rh.prototype.bytesPerElement=8,M(\"StructArrayLayout4i8\",Rh);var _o=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};_o.prototype.bytesPerElement=12,M(\"StructArrayLayout2i4i12\",_o);var Do=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*5,h=t*10;return this.int16[u+0]=e,this.int16[u+1]=r,this.uint8[h+4]=i,this.uint8[h+5]=n,this.uint8[h+6]=a,this.uint8[h+7]=s,this.int8[h+8]=o,this.int8[h+9]=l,t}};Do.prototype.bytesPerElement=10,M(\"StructArrayLayout2i4ub2b10\",Do);var ln=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};ln.prototype.bytesPerElement=8,M(\"StructArrayLayout2f8\",ln);var So=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};So.prototype.bytesPerElement=20,M(\"StructArrayLayout10ui20\",So);var Ao=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};Ao.prototype.bytesPerElement=16,M(\"StructArrayLayout8ui16\",Ao);var Eo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};Eo.prototype.bytesPerElement=28,M(\"StructArrayLayout4i4ui4i1f28\",Eo);var Fo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};Fo.prototype.bytesPerElement=12,M(\"StructArrayLayout3f12\",Fo);var Io=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};Io.prototype.bytesPerElement=4,M(\"StructArrayLayout1ul4\",Io);var To=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};To.prototype.bytesPerElement=20,M(\"StructArrayLayout6i1ul2ui20\",To);var ko=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};ko.prototype.bytesPerElement=12,M(\"StructArrayLayout2i2i2i12\",ko);var $h=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};$h.prototype.bytesPerElement=16,M(\"StructArrayLayout2f1f2i16\",$h);var Co=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Co.prototype.bytesPerElement=16,M(\"StructArrayLayout2ub2f2i16\",Co);var Po=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};Po.prototype.bytesPerElement=6,M(\"StructArrayLayout3ui6\",Po);var Mo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,_=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[_+36]=f,this.uint8[_+37]=d,this.uint8[_+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};Mo.prototype.bytesPerElement=52,M(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52\",Mo);var Bo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,_,w,D,A,F,L,T,V){let U=this.length;return this.resize(U+1),this.emplace(U,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,_,w,D,A,F,L,T,V)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,_,w,D,A,F,L,T,V,U){let E=t*34,P=t*17;return this.int16[E+0]=e,this.int16[E+1]=r,this.int16[E+2]=i,this.int16[E+3]=n,this.int16[E+4]=a,this.int16[E+5]=s,this.int16[E+6]=o,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=h,this.uint16[E+10]=c,this.uint16[E+11]=p,this.uint16[E+12]=f,this.uint16[E+13]=d,this.uint16[E+14]=y,this.uint16[E+15]=m,this.uint16[E+16]=g,this.uint16[E+17]=x,this.uint16[E+18]=v,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=D,this.uint32[P+12]=A,this.float32[P+13]=F,this.float32[P+14]=L,this.uint16[E+30]=T,this.uint16[E+31]=V,this.float32[P+16]=U,t}};Bo.prototype.bytesPerElement=68,M(\"StructArrayLayout8i15ui1ul2f2ui1f68\",Bo);var Aa=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};Aa.prototype.bytesPerElement=4,M(\"StructArrayLayout1f4\",Aa);var zo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};zo.prototype.bytesPerElement=12,M(\"StructArrayLayout1ui2f12\",zo);var Lo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Lo.prototype.bytesPerElement=8,M(\"StructArrayLayout1ul2ui8\",Lo);var Vo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};Vo.prototype.bytesPerElement=4,M(\"StructArrayLayout2ui4\",Vo);var Nh=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};Nh.prototype.bytesPerElement=2,M(\"StructArrayLayout1ui2\",Nh);var Oo=class extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};Oo.prototype.bytesPerElement=16,M(\"StructArrayLayout4f16\",Oo);var Wf=class extends wn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Wf.prototype.size=20;var Zf=class extends To{get(t){return new Wf(this,t)}};M(\"CollisionBoxArray\",Zf);var Hf=class extends wn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Hf.prototype.size=52;var Jf=class extends Mo{get(t){return new Hf(this,t)}};M(\"PlacedSymbolArray\",Jf);var Kf=class extends wn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};Kf.prototype.size=68;var Qf=class extends Bo{get(t){return new Kf(this,t)}};M(\"SymbolInstanceArray\",Qf);var td=class extends Aa{getoffsetX(t){return this.float32[t*1+0]}};M(\"GlyphOffsetArray\",td);var ed=class extends wo{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};M(\"SymbolLineVertexArray\",ed);var rd=class extends wn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};rd.prototype.size=12;var id=class extends zo{get(t){return new rd(this,t)}};M(\"TextAnchorOffsetArray\",id);var nd=class extends wn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};nd.prototype.size=8;var ad=class extends Lo{get(t){return new nd(this,t)}};M(\"FeatureIndexArray\",ad);var cg=class extends on{},pg=class extends on{},fg=class extends on{},dg=class extends _o{},yg=class extends Do{},mg=class extends ln{},zr=class extends So{},Uh=class extends Ao{},gg=class extends Eo{},xg=class extends Fo{},vg=class extends Io{},jh=class extends ko{},bg=class extends Co{},_n=class extends Po{},Ro=class extends Vo{},$o=At([{name:\"a_pos\",components:2,type:\"Int16\"}],4),wg=$o.members;$o.size,$o.alignment;var re=class $r{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>$r.MAX_VERTEX_ARRAY_LENGTH&&Ct(`Max vertices per segment is ${$r.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${$r.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>$r.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new $r([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};re.MAX_VERTEX_ARRAY_LENGTH=2**16-1,M(\"SegmentVector\",re);function qh(t,e){return t=_e(Math.floor(t),0,255),e=_e(Math.floor(e),0,255),256*t+e}var _g=At([{name:\"a_pattern_from\",components:4,type:\"Uint16\"},{name:\"a_pattern_to\",components:4,type:\"Uint16\"},{name:\"a_pixel_ratio_from\",components:1,type:\"Uint16\"},{name:\"a_pixel_ratio_to\",components:1,type:\"Uint16\"}]),Dg=At([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]),Sg=Sl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p<s;)c=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)|0,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)|0,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)|0,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)|0,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)|0,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)|0,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)|0,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),Ag=Sl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Ea=T1(Sl(((t,e)=>{var r=Sg(),i=Ag();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),sd=class od{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Gh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error(\"Trying to get index, but feature positions are not indexed\");let r=Gh(e),i=0,n=this.ids.length-1;for(;i<n;){let s=i+n>>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return No(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new od;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Gh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Ea.default)(String(t))}function No(t,e,r,i){for(;r<i;){let n=t[r+i>>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]<n);do s--;while(t[s]>n);if(a>=s)break;Zn(t,a,s),Zn(e,3*a,3*s),Zn(e,3*a+1,3*s+1),Zn(e,3*a+2,3*s+2)}s-r<i-s?(No(t,e,r,s),r=s+1):(No(t,e,s+1,i),i=s)}}function Zn(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}M(\"FeaturePositionMap\",sd);var Wl=class{constructor(t,e){this.gl=t.gl,this.location=e}},Zl=class extends Wl{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}},Eg=class extends Wl{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},Fg=class extends Wl{constructor(t,e){super(t,e),this.current=mt.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}};function Uo(t){return[qh(255*t.r,255*t.g),qh(255*t.b,255*t.a)]}var Ri=class{constructor(t,e,r){this.value=t,this.uniformNames=e.map(i=>`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type===\"color\"?new Fg(t,e):new Zl(t,e)}},hr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.dashFrom=null,this.dashTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i===\"u_pattern_to\"?n=this.patternTo:i===\"u_pattern_from\"?n=this.patternFrom:i===\"u_dasharray_to\"?n=this.dashTo:i===\"u_dasharray_from\"?n=this.dashFrom:i===\"u_pixel_ratio_to\"?n=this.pixelRatioTo:i===\"u_pixel_ratio_from\"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith(\"u_pattern\")||r.startsWith(\"u_dasharray_\")?new Eg(t,e):new Zl(t,e)}},Pe=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:\"Float32\",components:r===\"color\"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new ot(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ot(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type===\"color\"){let i=Uo(r);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},he=class{constructor(t,e,r,i,n,a){this.expression=t,this.uniformNames=e.map(s=>`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:\"Float32\",components:r===\"color\"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new ot(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new ot(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ot(this.zoom,n),r,i),s=this.expression.evaluate(new ot(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type===\"color\"){let n=Uo(r),a=Uo(i);for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,n[0],n[1],a[0],a[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=_e(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)}getBinding(t,e,r){return new Zl(t,e)}},Ye=class{constructor(t,e,r,i,n,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,this.getPositionIds(e),r)}updatePaintArray(t,e,r,i,n){this._setPaintValues(t,e,this.getPositionIds(r),n)}_setPaintValues(t,e,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,a,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},ld=class extends Ye{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return _g.members}emplace(t,e,r,i){t.emplace(e,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},ud=class extends Ye{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return Dg.members}emplace(t,e,r,i){t.emplace(e,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},hd=class{constructor(t,e,r){this.binders={},this._buffers=[];let i=[];for(let n in t.paint._values){if(!r(n))continue;let a=t.paint.get(n);if(!(a instanceof se)||!ri(a.property.specification))continue;let s=Ig(n,t.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,h=a.property.specification[\"property-type\"],c=h===\"cross-faded\"||h===\"cross-faded-data-driven\";if(o.kind===\"constant\")this.binders[n]=c?new hr(o.value,s):new Ri(o.value,s,l),i.push(`/u_${n}`);else if(o.kind===\"source\"||c){let p=Yh(n,l,\"source\");this.binders[n]=c?n===\"line-dasharray\"?new ud(o,l,u,e,p,t.id):new ld(o,l,u,e,p,t.id):new Pe(o,s,l,p),i.push(`/a_${n}`)}else{let p=Yh(n,l,\"composite\");this.binders[n]=new he(o,s,l,u,e,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join(\"\")}getMaxValue(t){let e=this.binders[t];return e instanceof Pe||e instanceof he?e.maxValue:0}populatePaintArrays(t,e,r){for(let i in this.binders){let n=this.binders[i];(n instanceof Pe||n instanceof he||n instanceof Ye)&&n.populatePaintArray(t,e,r)}}setConstantPatternPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof hr&&i.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof hr&&i.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,r,i,n){let a=!1;for(let s of t){let o=e.getPositions(s.id);for(let l of o){let u=r.feature(l.index);for(let h in this.binders){let c=this.binders[h];(c instanceof Pe||c instanceof he||c instanceof Ye)&&c.expression.isStateDependent===!0&&(c.expression=i.paint.get(h).value,c.updatePaintArray(l.start,l.end,u,s.state,n),a=!0)}}}return a}defines(){let t=[];for(let e in this.binders){let r=this.binders[e];(r instanceof Ri||r instanceof hr)&&t.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Pe||r instanceof he)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ye){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Ri||r instanceof hr||r instanceof he)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Ri||n instanceof hr||n instanceof he){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ye){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Pe||r instanceof he)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof Pe||r instanceof he||r instanceof Ye)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof Pe||e instanceof he||e instanceof Ye)&&e.destroy()}}},vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new hd(i,e,r);this.needsUpload=!1,this._featureMap=new sd,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function Ig(t,e){return{\"text-opacity\":[\"opacity\"],\"icon-opacity\":[\"opacity\"],\"text-color\":[\"fill_color\"],\"icon-color\":[\"fill_color\"],\"text-halo-color\":[\"halo_color\"],\"icon-halo-color\":[\"halo_color\"],\"text-halo-blur\":[\"halo_blur\"],\"icon-halo-blur\":[\"halo_blur\"],\"text-halo-width\":[\"halo_width\"],\"icon-halo-width\":[\"halo_width\"],\"line-gap-width\":[\"gapwidth\"],\"line-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"line-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-extrusion-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"]}[t]||[t.replace(`${e}-`,\"\").replace(/-/g,\"_\")]}function Tg(t){return{\"line-pattern\":{source:zr,composite:zr},\"fill-pattern\":{source:zr,composite:zr},\"fill-extrusion-pattern\":{source:zr,composite:zr},\"line-dasharray\":{source:Uh,composite:Uh}}[t]}function Yh(t,e,r){let i={color:{source:ln,composite:Oo},number:{source:Aa,composite:ln}};return Tg(t)?.[r]||i[e][r]}M(\"ConstantBinder\",Ri),M(\"CrossFadedConstantBinder\",hr),M(\"SourceExpressionBinder\",Pe),M(\"CrossFadedPatternBinder\",ld),M(\"CrossFadedDasharrayBinder\",ud),M(\"CompositeExpressionBinder\",he),M(\"ProgramConfiguration\",hd,{omit:[\"_buffers\"]}),M(\"ProgramConfigurationSet\",vr);var jo=2**14-1,Xh=-jo-1;function Dr(t){let e=xt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=_e(a,Xh,jo),n.y=_e(s,Xh,jo),(a<n.x||a>n.x+1||s<n.y||s>n.y+1)&&Ct(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return r}function ci(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Dr(t):[]}}var Fa=class qo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new qo;return r.extend(e(new B(this.minX,this.minY))),r.extend(e(new B(this.maxX,this.minY))),r.extend(e(new B(this.minX,this.maxY))),r.extend(e(new B(this.maxX,this.maxY))),r}static fromPoints(e){let r=new qo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};Fa.fromPoints([new B(0,0),new B(xt,xt)]);function Ia(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Wh(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}function Hl(t){return t.x<0||t.x>=8192||t.y<0||t.y>=8192}var Zh=-32768;function kg(t,e,r,i,n){t.emplaceBack(Zh+e*8+i,Zh+r*8+n)}var Jl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new pg,this.indexArray=new _n,this.segments=new re,this.programConfigurations=new vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type===\"heatmap\";if(i.type===\"circle\"){let c=i;a=c.layout.get(\"circle-sort-key\"),s=!a.isConstant(),o||(o=c.paint.get(\"circle-pitch-alignment\")===\"map\")}let l=o?e.subdivisionGranularity.circle:1,u=new ot(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=ci(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Dr(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,wg),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(Hl(l))continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f<s;f++)for(let d=0;d<s;d++)kg(this.layoutVertexArray,u,h,a[d],a[f]);for(let f=0;f<s-1;f++)for(let d=0;d<s-1;d++){let y=p+f*s+d,m=p+(f+1)*s+d;this.indexArray.emplaceBack(y,m+1,y+1),this.indexArray.emplaceBack(y,m,m+1)}c.vertexLength+=s*s,c.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:{},canonical:i})}};M(\"CircleBucket\",Jl,{omit:[\"layers\"]});function Cg(t,e){for(let r of t)if(ai(e,r))return!0;for(let r of e)if(ai(t,r))return!0;return Kl(t,e)}function Ja(t,e,r){return ai(t,e)?!0:Go(e,t,r)}function cd(t,e){if(t.length===1)return Hh(e,t[0]);for(let r of e)for(let i of r)if(ai(t,i))return!0;for(let r of t)if(Hh(e,r))return!0;for(let r of e)if(Kl(t,r))return!0;return!1}function Pg(t,e,r){for(let i of e){if(t.length>=3){for(let n of i)if(ai(t,n))return!0}if(Mg(t,i,r))return!0}return!1}function Mg(t,e,r){if(t.length>1){if(Kl(t,e))return!0;for(let i of e)if(Go(i,t,r))return!0}for(let i of t)if(Go(i,e,r))return!0;return!1}function Kl(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let i=t[r],n=t[r+1];for(let a=0;a<e.length-1;a++){let s=e[a],o=e[a+1];if(Bg(i,n,s,o))return!0}}return!1}function Bg(t,e,r,i){return He(t,r,i)!==He(e,r,i)&&He(t,e,r)!==He(t,e,i)}function Go(t,e,r){let i=r*r;if(e.length===1)return t.distSqr(e[0])<i;for(let n=1;n<e.length;n++){let a=e[n-1],s=e[n];if(pd(t,a,s)<i)return!0}return!1}function pd(t,e,r){let i=e.distSqr(r);if(i===0)return t.distSqr(e);let n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Hh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;o<i.length;l=o++)n=i[o],a=i[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function ai(t,e){let r=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let a=t[i],s=t[n];a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function zg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(e,r),new B(e,n),new B(i,n),new B(i,r)];if(t.length>2){for(let s of a)if(ai(t,s))return!0}for(let s=0;s<t.length-1;s++){let o=t[s],l=t[s+1];if(Lg(o,l,a))return!0}return!1}function Lg(t,e,r){let i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;let a=He(t,e,r[0]);return a!==He(t,e,r[1])||a!==He(t,e,r[2])||a!==He(t,e,r[3])}function Xr(t,e,r){let i=e.paint.get(t).value;return i.kind===\"constant\"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ka(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qa(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=B.convert(e)._mult(n);r===\"viewport\"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function Vg(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r],n=e.at(-1);(r===0||n&&!i.equals(n))&&e.push(i)}return e}function Og(t,e){let r=[];for(let i of t){let n=Vg(i),a=[];for(let s=0;s<n.length;s++){let o=n[s],l=n[s-1],u=n[s+1],h=s===0?new B(0,0):o.sub(l)._unit()._perp(),c=s===n.length-1?new B(0,0):u.sub(o)._unit()._perp(),p=h._add(c)._unit(),f=p.x*c.x+p.y*c.y;f!==0&&p._mult(1/f),a.push(p._mult(e)._add(o))}r.push(a)}return r}function Rg({queryGeometry:t,size:e},r){return Ja(t,r,e)}function $g({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){return Ja(t,a,e*(r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function Ng({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){let s=r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,o=e*(r.cameraToCenterDistance/s);return Ja(t,Ql(a,r,i,n),o)}function Ug({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){return Ja(t,Ql(a,r,i,n),e)}function fd({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a=\"map\",pitchScale:s=\"map\"},o){let l=a===\"map\"?s===\"map\"?Rg:$g:s===\"map\"?Ng:Ug,u={queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n};for(let h of o)for(let c of h)if(l(u,c))return!0;return!1}function Ql(t,e,r,i){let n=e.projectTileCoordinates(t.x,t.y,r,i?.(t.x,t.y)).point;return new B((n.x*.5+.5)*e.width,(-n.y*.5+.5)*e.height)}function jg(t,e,r,i){return t.map(n=>Ql(n,e,r,i))}var Jh,qg=()=>Jh||(Jh=new Gt({\"circle-sort-key\":new N(S.layout_circle[\"circle-sort-key\"],\"circle-sort-key\")})),Kh,Gg=()=>Kh||(Kh=new Gt({\"circle-radius\":new N(S.paint_circle[\"circle-radius\"],\"circle-radius\"),\"circle-color\":new N(S.paint_circle[\"circle-color\"],\"circle-color\"),\"circle-blur\":new N(S.paint_circle[\"circle-blur\"],\"circle-blur\"),\"circle-opacity\":new N(S.paint_circle[\"circle-opacity\"],\"circle-opacity\"),\"circle-translate\":new O(S.paint_circle[\"circle-translate\"],\"circle-translate\"),\"circle-translate-anchor\":new O(S.paint_circle[\"circle-translate-anchor\"],\"circle-translate-anchor\"),\"circle-pitch-scale\":new O(S.paint_circle[\"circle-pitch-scale\"],\"circle-pitch-scale\"),\"circle-pitch-alignment\":new O(S.paint_circle[\"circle-pitch-alignment\"],\"circle-pitch-alignment\"),\"circle-stroke-width\":new N(S.paint_circle[\"circle-stroke-width\"],\"circle-stroke-width\"),\"circle-stroke-color\":new N(S.paint_circle[\"circle-stroke-color\"],\"circle-stroke-color\"),\"circle-stroke-opacity\":new N(S.paint_circle[\"circle-stroke-opacity\"],\"circle-stroke-opacity\")})),Yg={get paint(){return Gg()},get layout(){return qg()}},Xg=class extends de{constructor(t,e){super(t,Yg,e)}createBucket(t){return new Jl(t)}queryRadius(t){let e=t;return Xr(\"circle-radius\",this,e)+Xr(\"circle-stroke-width\",this,e)+Ka(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Qa(t,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-n.bearingInRadians,a),u=this.paint.get(\"circle-radius\").evaluate(e,r)+this.paint.get(\"circle-stroke-width\").evaluate(e,r),h=this.paint.get(\"circle-pitch-scale\"),c=this.paint.get(\"circle-pitch-alignment\"),p,f;return c===\"map\"?(p=l,f=u*a):(p=jg(l,n,s,o),f=u),fd({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},dd=class extends Jl{};M(\"HeatmapBucket\",dd,{omit:[\"layers\"]});var Qh,Wg=()=>Qh||(Qh=new Gt({\"heatmap-radius\":new N(S.paint_heatmap[\"heatmap-radius\"],\"heatmap-radius\"),\"heatmap-weight\":new N(S.paint_heatmap[\"heatmap-weight\"],\"heatmap-weight\"),\"heatmap-intensity\":new O(S.paint_heatmap[\"heatmap-intensity\"],\"heatmap-intensity\"),\"heatmap-color\":new Ha(S.paint_heatmap[\"heatmap-color\"],\"heatmap-color\"),\"heatmap-opacity\":new O(S.paint_heatmap[\"heatmap-opacity\"],\"heatmap-opacity\")})),Zg={get paint(){return Wg()}};function tu(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function yd(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=tu({},{width:e,height:r},i);eu(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function eu(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError(\"out of range source coordinates for image copy\");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError(\"out of range destination coordinates for image copy\");let s=t.data,o=e.data;if(s===o)throw Error(\"srcData equals dstData, so image is already copied\");for(let l=0;l<n.height;l++){let u=((r.y+l)*t.width+r.x)*a,h=((i.y+l)*e.width+i.x)*a;for(let c=0;c<n.width*a;c++)o[h+c]=s[u+c]}return e}var Yo=class md{constructor(e,r){tu(this,e,1,r)}resize(e){yd(this,e,1)}clone(){return new md({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){eu(e,r,i,n,a,1)}},Qt=class gd{constructor(e,r){tu(this,e,4,r)}resize(e){yd(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new gd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){eu(e,r,i,n,a,4)}setPixel(e,r,i){let n=(e*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function Us(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=4){let i=t[r+3];e[r+0]=Math.round(t[r+0]*i/255),e[r+1]=Math.round(t[r+1]*i/255),e[r+2]=Math.round(t[r+2]*i/255),e[r+3]=i}return e}M(\"AlphaImage\",Yo),M(\"RGBAImage\",Qt);function Hg(t){let e={},r=t.resolution||256,i=t.clips?t.clips.length:1,n=t.image||new Qt({width:r,height:i});if(!O1(r))throw Error(`width is not a power of 2 - ${r}`);let a=(s,o,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s<i;++s,o+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let h=l/(r-1),{start:c,end:p}=t.clips[s],f=c*(1-h)+p*h;a(o,u,f)}else for(let s=0,o=0;s<r;s++,o+=4){let l=s/(r-1);a(0,o,l)}return n}var Jg=class extends de{createBucket(t){return new dd(t)}constructor(t,e){super(t,Zg,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t===\"heatmap-color\"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values[\"heatmap-color\"].value.expression;this.colorRamp=Hg({expression:t,evaluationKey:\"heatmapDensity\",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(\"big-fb\")&&this.heatmapFbos.delete(\"big-fb\")}queryRadius(t){return Xr(\"heatmap-radius\",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return fd({queryGeometry:t,size:this.paint.get(\"heatmap-radius\").evaluate(e,r)*a,transform:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return this.paint.get(\"heatmap-opacity\")!==0&&!this.isHidden()}},tc,Kg=()=>tc||(tc=new Gt({\"hillshade-illumination-direction\":new O(S.paint_hillshade[\"hillshade-illumination-direction\"],\"hillshade-illumination-direction\"),\"hillshade-illumination-altitude\":new O(S.paint_hillshade[\"hillshade-illumination-altitude\"],\"hillshade-illumination-altitude\"),\"hillshade-illumination-anchor\":new O(S.paint_hillshade[\"hillshade-illumination-anchor\"],\"hillshade-illumination-anchor\"),\"hillshade-exaggeration\":new O(S.paint_hillshade[\"hillshade-exaggeration\"],\"hillshade-exaggeration\"),\"hillshade-shadow-color\":new O(S.paint_hillshade[\"hillshade-shadow-color\"],\"hillshade-shadow-color\"),\"hillshade-highlight-color\":new O(S.paint_hillshade[\"hillshade-highlight-color\"],\"hillshade-highlight-color\"),\"hillshade-accent-color\":new O(S.paint_hillshade[\"hillshade-accent-color\"],\"hillshade-accent-color\"),\"hillshade-method\":new O(S.paint_hillshade[\"hillshade-method\"],\"hillshade-method\"),resampling:new O(S.paint_hillshade.resampling,\"resampling\")})),Qg={get paint(){return Kg()}},tx=class extends de{constructor(t,e){super(t,Qg,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get(\"hillshade-illumination-direction\").values,e=this.paint.get(\"hillshade-illumination-altitude\").values,r=this.paint.get(\"hillshade-highlight-color\").values,i=this.paint.get(\"hillshade-shadow-color\").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(uh);return{directionRadians:t.map(uh),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}},ec,ex=()=>ec||(ec=new Gt({\"color-relief-opacity\":new O(S[\"paint_color-relief\"][\"color-relief-opacity\"],\"color-relief-opacity\"),\"color-relief-color\":new Ha(S[\"paint_color-relief\"][\"color-relief-color\"],\"color-relief-color\"),resampling:new O(S[\"paint_color-relief\"].resampling,\"resampling\")})),rx={get paint(){return ex()}};function Hn(t){return\"data\"in t}var rc=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){let{width:i,height:n}=t,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!e?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&e?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,i,n),Hn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:h}=t;l&&h&&(h=Us(h)),h&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,h)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Hn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:u,y:h}=r||{x:0,y:0};Hn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,u,h,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,u,h,o))}this.useMipmap&&!(Hn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Us(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Us(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},ze,xd=(ze=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError(\"DEM tiles must be square\");if(i&&![\"mapbox\",\"terrarium\",\"custom\"].includes(i)){Ct(`\"${i}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),ze.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h<l+2;h++){let c=this._idx(0,Math.max(0,Math.min(l-1,h)));(h<0||h>=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;h<l;h++)for(let c=0;c<l;c++){let p=this._idx(h,c)*4,f=this._unpackAtIndex(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let i=this._getByteView(),n=this._idx(e,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(e,r){let i=Math.floor(e),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return vd(e,this.getUnpackVector())}getPixels(){return new Qt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error(\"dem dimension mismatch\");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h<o;h++)for(let c=n;c<a;c++)this.data[this._idx(c,h)]=e.data[this._idx(c+l,h+u)]}_getByteView(){let e=ze.byteViewCache.get(this);return e?.buffer!==this.data.buffer&&(e=new Uint8Array(this.data.buffer),ze.byteViewCache.set(this,e)),e}_unpackAtIndex(e,r){return this.unpack(e[r],e[r+1],e[r+2])}},ze.byteViewCache=new WeakMap,ze);function vd(t,e){let r=e[0],i=e[1],n=e[2],a=e[3],s=[r,i,n].filter(h=>h!==0);if(s.length===0)return{r:0,g:0,b:0};let o=Math.min(...s),l=Math.round((t+a)/o),u=h=>h===0?0:Math.floor(l*o/h)%256;return{r:u(r),g:u(i),b:u(n)}}M(\"DEMData\",xd);var ix=class extends de{constructor(t,e){super(t,rx,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values[\"color-relief-color\"].value.expression;if(r instanceof en&&r._styleExpression.expression instanceof De){this.colorRampExpression=r;let a=r._styleExpression.expression;e.elevationStops=a.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[mt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let i={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let a=0;a<e.elevationStops.length-.5;a+=n)i.elevationStops.push(e.elevationStops[Math.round(a)]),i.colorStops.push(e.colorStops[Math.round(a)]);return Ct(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[\"color-relief-color\"].value.expression}getColorRampTextures(t,e,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(e),n=new Qt({width:i.colorStops.length,height:1}),a=new Qt({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let o=vd(i.elevationStops[s],r);a.setPixel(0,s,new mt(o.r/255,o.g/255,o.b/255,1)),n.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new rc(t,a,t.gl.RGBA),colorTexture:new rc(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},Xo=At([{name:\"a_pos\",components:2,type:\"Int16\"}],4),nx=Xo.members;Xo.size,Xo.alignment;function Ta(t,e,r){let i=r.patternDependencies,n=!1;for(let a of e){let s=a.paint.get(`${t}-pattern`);s.isConstant()||(n=!0);let o=s.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function ru(t,e,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let o of e){let l=o.paint.get(`${t}-pattern`).value;if(l.kind!==\"constant\"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),h=l.evaluate({zoom:a},r,{},n.availableImages),c=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,h=h?.name?h.name:h,c=c?.name?c.name:c,s[u]=!0,s[h]=!0,s[c]=!0,r.patterns[o.id]={min:u,mid:h,max:c}}}return r}var un=new Set,Wo=!1;function ax(t,e,r=2){let i=e&&e.length,n=i?e[0]*r:t.length;un.size&&un.clear();let a=bd(t,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=hx(t,e,a,r)),t.length>80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;p<n;p+=r){let f=t[p],d=t[p+1];f<o&&(o=f),d<l&&(l=d),f>h&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Zo(a,s,o,l,u),s}function bd(t,e,r,i,n){let a=null;if(n===Dx(t,e,r,i)>0)for(let s=e;s<r;s+=i)a=ac(s/i|0,t[s],t[s+1],a);else for(let s=r-i;s>=e;s-=i)a=ac(s/i|0,t[s],t[s+1],a);return a&&hn(a,a.next)&&(pn(a),a=a.next),a}function br(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(un.size===0||!un.has(i))&&(hn(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Wo=!0,pn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Zo(t,e,r,i,n){n&&gx(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?ox(t,r,i,n):sx(t)))e.push(o.i,t.i,l.i),pn(t),t=l,a=l;else if(t=l,t===a){if(Wo=!1,t=br(t),Wo){a=t;continue}if(!s){t=lx(t,e),a=t,s=!0;continue}ux(t,e,r,i,n);break}}}function sx(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&Ca(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function ox(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=Qo(f,d,e,r,i),x=Qo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&Ca(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&Ca(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function lx(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;_d(n,r,r.next,a,!1)&&cn(n,a)&&cn(a,n)&&(e.push(n.i,r.i,a.i),pn(r),pn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?br(r):r}function ux(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&bx(a,s)){let o=Dd(a,s);a=br(a,a.next),o=br(o,o.next),Zo(a,e,r,i,n),Zo(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var Ho=!1;function hx(t,e,r,i){let n=[];for(let a=0,s=e.length;a<s;a++){let o=bd(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i,!1);o===o.next&&un.add(o),n.push(vx(o))}n.sort(cx),fx(t.length/i,e.length),wd(r,r),Ho=!0;for(let a=0;a<n.length;a++)r=px(n[a],r);return Ho=!1,br(r)}function cx(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function px(t,e){let r=yx(t,e);if(!r)return e;let i=Dd(r,t),n=i.next;return wd(r,n.next),br(i,i.next),br(r,r.next)}var wt=new Float64Array,ka=0,Jo=[],Ko=[];function fx(t,e){let r=Math.ceil((t+2*e)/16)+e+2;wt.length<r*4&&(wt=new Float64Array(r*4)),ka=0}function wd(t,e){let r=t;do{let i=ka++;Jo[i]=r;let n=r.x,a=r.y,s=r.x,o=r.y,l=0;do{let h=r.next;r.z=i,h.x<n&&(n=h.x),h.x>s&&(s=h.x),h.y<a&&(a=h.y),h.y>o&&(o=h.y),r=h}while(++l<16&&r!==e);Ko[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function dx(t,e){let r=t.z*4;e.x<wt[r]&&(wt[r]=e.x),e.y<wt[r+1]&&(wt[r+1]=e.y),e.x>wt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function ic(t){let e=Ko[t];for(;e.prev.next!==e;)e=e.next;return Ko[t]=e,e}function nc(t){let e=Jo[t];for(;e.prev.next!==e;)e=e.next;return Jo[t]=e,e}function yx(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(hn(t,r))return r;for(let p=0,f=0;p<ka;p++,f+=4){if(n<wt[f+1]||n>wt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=ic(p);r=nc(p);do{if(r.prev.next===r){if(hn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.x<r.next.x?r:r.next,y===i))return s}}r=r.next}while(r!==d)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(n,l),h=Math.max(n,l),c=1/0;for(let p=0,f=0;p<ka;p++,f+=4){if(wt[f+2]<o||wt[f]>i||wt[f+3]<u||wt[f+1]>h)continue;let d=ic(p);r=nc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Ca(n<l?i:a,n,o,l,n<l?a:i,n,r.x,r.y)){let y=Math.abs(n-r.y)/(i-r.x);(cn(r,t)||r.y===n&&r.next.y===n&&r.next.x>i)&&(y<c||y===c&&(r.x>s.x||r.x===s.x&&mx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function mx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var Kt=[],Nr=[],lr=new Uint32Array,Ti=new Uint32Array,ki=new Uint32Array(256);function gx(t,e,r,i){let n=t,a=0;do n.z=Qo(n.x,n.y,e,r,i),Kt[a++]=n,n=n.next;while(n!==t);xx(a);let s=null;for(let o=0;o<a;o++){let l=Kt[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null,Kt.fill(null,0,a),Nr.fill(null,0,a)}function xx(t){if(t<=32)for(let e=1;e<t;e++){let r=Kt[e],i=r.z,n=e-1;for(;n>=0&&Kt[n].z>i;)Kt[n+1]=Kt[n],n--;Kt[n+1]=r}else{lr.length<t&&(lr=new Uint32Array(t),Ti=new Uint32Array(t),Nr=Array(t));for(let e=0;e<t;e++)lr[e]=Kt[e].z;Jn(t,Kt,lr,Nr,Ti,0),Jn(t,Nr,Ti,Kt,lr,8),Jn(t,Kt,lr,Nr,Ti,16),Jn(t,Nr,Ti,Kt,lr,24)}}function Jn(t,e,r,i,n,a){ki.fill(0);for(let o=0;o<t;o++)ki[r[o]>>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=ki[o];ki[o]=s,s+=l}for(let o=0;o<t;o++){let l=r[o],u=ki[l>>>a&255]++;i[u]=e[o],n[u]=l}}function Qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vx(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function Ca(t,e,r,i,n,a,s,o){return(n-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function bx(t,e){let r=hn(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||cn(t,e)&&cn(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!wx(t,e)&&(r||_x(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function hn(t,e){return t.x===e.x&&t.y===e.y}function _d(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Kn(t,r,e)||s===0&&Kn(t,i,e)||o===0&&Kn(r,t,i)||l===0&&Kn(r,e,i)):!1}function Kn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function wx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n)s=o;else{if(s.i!==t.i&&o.i!==t.i&&s.i!==e.i&&o.i!==e.i&&_d(s,o,t,e))return!0;s=o}}while(s!==t);return!1}function cn(t,e){return Ft(t.prev,t,t.next)<0?Ft(t,e,t.next)>=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function _x(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function Dd(t,e){let r=tl(t.i,t.x,t.y),i=tl(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function ac(t,e,r,i){let n=tl(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function pn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Ho&&dx(t.prev,t.next)}function tl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Dx(t,e,r,i){let n=0;for(let a=e,s=r-i;a<r;a+=i)n+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return n}var $i=class{constructor(t,e){if(e>t)throw Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/e),this._minGranularity,1)}},yr,Sx=(yr=class{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}},yr.noSubdivision=new yr({fill:new $i(0,0),line:new $i(0,0),tile:new $i(0,0),stencil:new $i(0,0),circle:1}),yr);M(\"SubdivisionGranularityExpression\",$i),M(\"SubdivisionGranularitySetting\",Sx);var js=-32768,qs=32767,Ax=class{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=xt/t,this._canonical=e}_getKey(t,e){return t+=32768,e+=32768,t<<16|e}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return Ix(this._vertexBuffer,Fx(t,e));let r=[],i=t.length;for(let n=0;n<i;n+=3){let a=[e[t[n+0]],e[t[n+1]],e[t[n+2]]],s=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],o=1/0,l=1/0,u=-1/0,h=-1/0;for(let y=0;y<3;y++){let m=s[y*2],g=s[y*2+1];o=Math.min(o,m),u=Math.max(u,m),l=Math.min(l,g),h=Math.max(h,g)}if(o===u||l===h)continue;let c=Math.floor(o/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),f=Math.floor(l/this._granularityCellSize),d=Math.ceil(h/this._granularityCellSize);if(c===p&&f===d)r.push(...a);else for(let y=f;y<d;y++){let m=this._scanlineGenerateVertexRingForCellRow(y,s,a);Tx(this._vertexBuffer,m,r)}}return r}_scanlineGenerateVertexRingForCellRow(t,e,r){let i=t*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let o=e[s*2],l=e[s*2+1],u=e[(s+1)*2%6],h=e[((s+1)*2+1)%6],c=e[(s+2)*2%6],p=e[((s+2)*2+1)%6],f=u-o,d=h-l,y=f===0,m=d===0,g=(i-l)/d,x=(n-l)/d,v=Math.min(g,x),b=Math.max(g,x);if(!m&&(v>=1||b<=0)||m&&(l<i||l>n)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let D=o+f*v,A=l+d*v;a.push(this._vertexToIndex(D,A))}let _=o+f*Math.max(v,0),w=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,_,w),!m&&b<1){let D=o+f*b,A=l+d*b;a.push(this._vertexToIndex(D,A))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,w,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e<i:a<s)for(let d=p;d<=f;d++){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}else for(let d=f;d>=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o<g,_=p===0;if(_&&(s===l||s===u))return;if(_||y>=1||m<=0){let D=e-a,A=r-s,F=(l-s)/A,L=(u-s)/A,T=a+D*Math.min(F,L);x=Math.floor(Math.min(T,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(T,o)/this._granularityCellSize)-1,b=o<T}let w=h>0?u:l;if(b)for(let D=x;D<=v;D++){let A=D*this._granularityCellSize;t.push(this._vertexToIndex(A,w))}else for(let D=v;D>=x;D--){let A=D*this._granularityCellSize;t.push(this._vertexToIndex(A,w))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(pr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o<a.length;o++)s.push(a[o-1]),s.push(a[o]);r.push(s)}return r}_ringPathIndices(t,e,r){let i=r.slice(e,e+t.length);return i.length>=2&&Ad(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(e||r)&&this._fillPoles(t,e,r)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){let r=t[e+1];r===-32768&&(t[e+1]=-32767),r===32767&&(t[e+1]=32766)}}_generatePoleQuad(t,e,r,i,n,a){i>n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=xt,a=t.length;for(let s=2;s<a;s+=3){let o=t[s-2],l=t[s-1],u=t[s],h=i[o*2],c=i[o*2+1],p=i[l*2],f=i[l*2+1],d=i[u*2],y=i[u*2+1];e&&(c===0&&f===0&&this._generatePoleQuad(t,o,l,h,p,js),f===0&&y===0&&this._generatePoleQuad(t,l,u,p,d,js),y===0&&c===0&&this._generatePoleQuad(t,u,o,d,h,js)),r&&(c===n&&f===n&&this._generatePoleQuad(t,o,l,h,p,qs),f===n&&y===n&&this._generatePoleQuad(t,l,u,p,d,qs),y===n&&c===n&&this._generatePoleQuad(t,u,o,d,h,qs))}}_initializeVertices(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(this._vertexToIndex(t[r],t[r+1]));return e}subdividePolygonInternal(t,e){if(this._used)throw Error(\"Subdivision: multiple use not allowed.\");this._used=!0;let{flattened:r,holeIndices:i}=Ex(t),n=this._initializeVertices(r),a;try{let o=ax(r,i);a=this._subdivideTrianglesScanline(o,n)}catch(o){console.error(o)}let s=[];return e&&(s=this._generateOutline(t,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=3)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||this._vertexOutsideTileX(t[r+2])||e.push(t[r],t[r+1],t[r+2]);return e}_removeLinesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=2)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||e.push(t[r],t[r+1]);return e}_pointArrayToIndices(t){let e=[];for(let r of t)e.push(this._vertexToIndex(r.x,r.y));return e}};function Sd(t,e,r,i=!0){return new Ax(r,e).subdividePolygonInternal(t,i)}function pr(t,e,r=!1){if(!t||t.length<1||t.length<2)return[];let i=r&&Ad(t);if(e<2)return i?[...t,t[0]]:[...t];let n=Math.floor(xt/e),a=[];a.push(new B(t[0].x,t[0].y));let s=t.length,o=i?s:s-1;for(let l=0;l<o;l++){let u=t[l],h=l<s-1?t[l+1]:t[0],c=u.x,p=u.y,f=h.x,d=h.y,y=c!==f,m=p!==d;if(!y&&!m)continue;let g=f-c,x=d-p,v=Math.abs(g),b=Math.abs(x),_=c,w=p;for(;;){let A=g>0?(Math.floor(_/n)+1)*n:(Math.ceil(_/n)-1)*n,F=x>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,L=Math.abs(_-A),T=Math.abs(w-F),V=Math.abs(_-f),U=Math.abs(w-d),E=y?L/v:1/0,P=m?T/b:1/0;if((V<=L||!y)&&(U<=T||!m))break;if(E<P&&y||!m){_=A,w+=x*E;let z=new B(_,Math.round(w));(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}else{_+=g*P,w=F;let z=new B(Math.round(_),w);(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}}let D=new B(f,d);(a[a.length-1].x!==D.x||a[a.length-1].y!==D.y)&&a.push(D)}return a}function Ad(t){return!t[0].equals(t[t.length-1])}function Ex(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:e}}function Fx(t,e){let r=Array(t.length);for(let i=0;i<t.length;i++)r[i]=e[t[i]];return r}function Ix(t,e){let r=[];for(let i=0;i<e.length;i+=3){let n=e[i],a=e[i+1],s=e[i+2],o=t[n*2],l=t[n*2+1],u=t[a*2],h=t[a*2+1],c=t[s*2],p=t[s*2+1],f=u-o,d=h-l,y=c-o;f*(p-l)-d*y>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function Tx(t,e,r){if(e.length===0)throw Error(\"Subdivision vertex ring is empty.\");let i=0,n=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<n&&(n=u,i=l)}let a=e.length,s=i,o=(s+1)%a;for(;;){let l=s-1>=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(h<p)x=!0;else if(h>p)x=!1;else{let v=g-y,b=-(m-d),_=y<g?1:-1;((h-d)*v+(c-y)*b)*_>((p-d)*v+(f-y)*b)*_&&(x=!0)}if(x){let v=e[l],b=e[s],_=e[o];v!==b&&v!==_&&b!==_&&r.push(_,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],_=e[o];v!==b&&v!==_&&b!==_&&r.push(_,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function Ed(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(u<re.MAX_VERTEX_ARRAY_LENGTH){let c=e.prepareSegment(u,r,i),p=c.vertexLength;for(let y=0;y<a.length;y+=3)i.emplaceBack(p+a[y],p+a[y+1],p+a[y+2]);c.vertexLength+=u,c.primitiveLength+=a.length/3;let f,d;h&&(d=s.prepareSegment(u,r,o),f=d.vertexLength,d.vertexLength+=u);for(let y=0;y<n.length;y+=2)t(n[y],n[y+1]);if(h)for(let y of l){for(let m=1;m<y.length;m+=2)o.emplaceBack(f+y[m-1],f+y[m]);d.primitiveLength+=y.length/2}}else kx(e,r,i,n,a,t),h&&Cx(s,r,o,n,l,t),e.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function Wi(t,e,r,i,n,a,s){if(a){let o=i.count;return r(e[n*2],e[n*2+1]),t[n]=i.count,i.count++,s.vertexLength++,o}return t[n]}function kx(t,e,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),h=u.vertexLength;for(let c=2;c<n.length;c+=3){let p=n[c-2],f=n[c-1],d=n[c],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>re.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Wi(s,i,a,o,p,y,u),b=Wi(s,i,a,o,f,m,u),_=Wi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+_-l),u.primitiveLength++}}function Cx(t,e,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),h=u.vertexLength;for(let c of n)for(let p=1;p<c.length;p+=2){let f=c[p-1],d=c[p],y=s[f]<l,m=s[d]<l,g=+!!y+ +!!m;u.vertexLength+g>re.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Wi(s,i,a,o,f,y,u),v=Wi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var Fd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new fg,this.indexArray=new _n,this.indexArray2=new Ro,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new re,this.segments2=new re,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Ta(\"fill\",this.layers,e);let i=this.layers[0].layout.get(\"fill-sort-key\"),n=!i.isConstant(),a=[],s=new ot(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=ci(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Dr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=ru(\"fill\",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get(\"fill-pattern\").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Ct(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer \"${t}\"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,nx),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ua(e,500)){let o=Sd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;Ed((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};M(\"FillBucket\",Fd,{omit:[\"layers\",\"patternFeatures\"]});var sc,Px=()=>sc||(sc=new Gt({\"fill-sort-key\":new N(S.layout_fill[\"fill-sort-key\"],\"fill-sort-key\")})),oc,Mx=()=>oc||(oc=new Gt({\"fill-antialias\":new O(S.paint_fill[\"fill-antialias\"],\"fill-antialias\"),\"fill-opacity\":new N(S.paint_fill[\"fill-opacity\"],\"fill-opacity\"),\"fill-layer-opacity\":new O(S.paint_fill[\"fill-layer-opacity\"],\"fill-layer-opacity\"),\"fill-color\":new N(S.paint_fill[\"fill-color\"],\"fill-color\"),\"fill-outline-color\":new N(S.paint_fill[\"fill-outline-color\"],\"fill-outline-color\"),\"fill-translate\":new O(S.paint_fill[\"fill-translate\"],\"fill-translate\"),\"fill-translate-anchor\":new O(S.paint_fill[\"fill-translate-anchor\"],\"fill-translate-anchor\"),\"fill-pattern\":new sn(S.paint_fill[\"fill-pattern\"],\"fill-pattern\")})),Bx={get paint(){return Mx()},get layout(){return Px()}},zx=class extends de{constructor(t,e){super(t,Bx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values[\"fill-outline-color\"];r.value.kind===\"constant\"&&r.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(t){return new Fd(t)}queryRadius(){return Ka(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return cd(Qa(t,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},el=At([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),Lx=At([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),Vx=el.members;el.size,el.alignment;var Dn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos<e;){let a=t.readVarint();if(a===8)this.id=t.readVarint();else if(a===18){let s=t.readVarint()+t.pos;for(;t.pos<s;){let o=i[t.readVarint()],l=n[t.readVarint()];this.properties[o]=l}}else a===24?this.type=t.readVarint():(a===34&&(this._geometry=t.pos),t.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=[],i,n=1,a=0,s=0,o=0;for(;t.pos<e;){if(a<=0){let l=t.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos<e;){if(i<=0){let h=t.readVarint();if(r=h&7,i=h>>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:\"Point\",coordinates:p[0]}:{type:\"MultiPoint\",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:\"LineString\",coordinates:c[0]}:{type:\"MultiLineString\",coordinates:c}}else if(this.type===3){let c=Id(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:\"Polygon\",coordinates:p[0]}:{type:\"MultiPolygon\",coordinates:p}}else throw Error(\"unknown feature type\");let h={type:\"Feature\",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Dn.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function Id(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a<e;a++){let s=Ox(t[a]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[a]]):i&&i.push(t[a]))}return i&&r.push(i),r}function Ox(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var Rx=class{constructor(t,e){for(this.version=1,this.name=\"\",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],e===void 0&&(e=t.length);t.pos<e;){let r=t.readVarint();r===10?this.name=t.readString():r===18?(this._features.push(t.pos),t.skip(r)):r===26?this._keys.push(t.readString()):r===34?this._values.push($x(t)):r===40?this.extent=t.readVarint():r===120?this.version=t.readVarint():t.skip(r)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Dn(this._pbf,e,this.extent,this._keys,this._values)}};function $x(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint();e=i===10?t.readString():i===21?t.readFloat():i===25?t.readDouble():i===32?t.readVarint(!0):i===40?t.readVarint():i===48?t.readSVarint():i===56?t.readBoolean():(t.skip(i),null)}if(e==null)throw Error(\"unknown feature value\");return e}var Td=class{constructor(t,e=t.length){let r=Object.create(null);for(;t.pos<e;){let i=t.readVarint();if(i===26){let n=new Rx(t,t.readVarint()+t.pos);n.length&&(r[n.name]=n)}else t.skip(i)}this.layers=r}},kd=63710088e-1,Pa=class Ni{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new Ni(V1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return kd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ni)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ni(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==\"object\"&&e)return new Ni(Number(\"lng\"in e?e.lng:e.lon),Number(e.lat));throw Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]\")}},Gs=6378137,rl={origin:[-Math.PI*Gs,Math.PI*Gs],extentAtZoom0:2*Math.PI*Gs},iu=2*Math.PI*kd;function Cd(t){return iu*Math.cos(t*Math.PI/180)}function Pd(t){return(180+t)/360}function Md(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function il(t,e){return t/Cd(e)}function Bd(t){return t*360-180}function fn(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Nx(t,e){return t*Cd(fn(e))}function zd(t){return 1/Math.cos(t*Math.PI/180)}var Sn=class Ld{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=Pa.convert(e);return new Ld(Pd(i.lng),Md(i.lat),il(r,i.lat))}toLngLat(){return new Pa(Bd(this.x),fn(this.y))}toAltitude(){return Nx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/iu*zd(fn(this.y))}},Ux=new class{constructor(){this.name=\"mercator\",this.wraps=!0,this.tileMatrixSet=rl}worldFromLngLat(t,e,r){return new Sn(Pd(t),Md(e),r===void 0?0:il(r,e))}lngLatFromWorld(t,e){return new Pa(Bd(t),fn(e))}hasLngLat(t,e){return!0}metersPerWorldUnit(t,e){return 1/(1/iu*zd(fn(e)))}worldZFromAltitude(t,e){return il(t,e.lat)}};function jx(t,e,r){let i=1/(1<<r.z);return new Sn(t/xt*i+r.x*i,e/xt*i+r.y*i)}function qx(t,e,r){return jx(t,e,r).toLngLat()}function Gx(t,e){return e<=0||!t||t.length===0?t:t.map(r=>Zx(r,e))}function Yx(t,e){let r=qx(xt/2,xt/2,e),i=Sn.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<e.z)*xt;return t*i*n}var Xx=Math.cos(35*Math.PI/180);function Wx(t){let e=[null];for(let a=1;a<t.length;a++){let s=t[a].sub(t[a-1]),o=!Ia(t[a],t[a-1])&&s.mag()>0;e.push(o?s._perp():null)}let r=t.length-1,i=r>1&&t[0].equals(t[r]),n=[null];for(let a=1;a<=r;a++){let s=e[a];if(!s){n.push(null);continue}let o=i&&a===1?e[r]:e[a-1],l=i&&a===r?e[1]:e[a+1];n.push({start:lc(s,o),end:lc(s,l)})}return n}function lc(t,e){if(!e)return t.unit();let r=t.mag(),i=e.mag();return t.x*e.x+t.y*e.y<Xx*r*i||r>=2*i?t.unit():i>=2*r?e.unit():t.add(e)._unit()}function Zx(t,e){if(!t||t.length<3)return t;let r=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,i=r?t.length-1:t.length;if(i<3)return t;let n=[],a=Ia(t[i-1],t[0]);for(let o=0;o<i;o++){let l=t[(o-1+i)%i],u=t[o],h=t[(o+1)%i],c=Ia(u,h);a||c?n.push(u.clone()):Jx(n,l,u,h,e),a=c}let s=Hx(n);return s.length<3?t:(r&&s.push(s[0].clone()),s)}function Hx(t){let e=[];for(let r of t){let i=r.round(),n=e[e.length-1];(n?.x!==i.x||n?.y!==i.y)&&e.push(i)}for(;e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function Jx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var Ys=8192;function Ci(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*Ys)*2+s,n*Ys*2,a*Ys*2,Math.round(o))}var Vd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new dg,this.centroidVertexArray=new cg,this.indexArray=new _n,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new re,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Ta(\"fill-extrusion\",this.layers,e);let i=new ot(this.zoom),n=this.layers[0],a=n.layout.get(\"fill-extrusion-rounded-corner-distance\"),s=a>0?Yx(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=ci(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:c,index:h,geometry:Gx(o?p.geometry:Dr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(ru(\"fill-extrusion\",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,h,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,h,c,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Lx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ua(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,h=Math.floor(o.x/o.sampleCount),c=Math.floor(o.y/o.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(h,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}processPolygon(t,e,r,i,n){if(i.length<1||Wh(i[0]))return;for(let h of i)h.length!==0&&Kx(t,h);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(e.z),o=Dn.types[r.type]===\"Polygon\";for(let h of i){if(h.length===0||Wh(h))continue;let c=pr(h,s,o);this._generateSideFaces(c,a)}if(!o)return;let l=Sd(i,e,s,!1),u=this.layoutVertexArray;Ed((h,c)=>{Ci(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0,i=this.layers[0].layout.get(\"fill-extrusion-rounded-corner-distance\")>0?Wx(t):null;for(let n=1;n<t.length;n++){let a=t[n],s=t[n-1];if(Ia(a,s)||i&&!i[n])continue;e.segment.vertexLength+4>re.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:o,end:o},h=s.dist(a);r+h>32768&&(r=0),Ci(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),Ci(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=h,Ci(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),Ci(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r);let c=e.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function Kx(t,e){for(let r=0;r<e.length;r++){let i=e[r];(r!==e.length-1||e[0].x!==i.x||e[0].y!==i.y)&&(t.x+=i.x,t.y+=i.y,t.sampleCount++)}}M(\"FillExtrusionBucket\",Vd,{omit:[\"layers\",\"features\"]});var uc,Qx=()=>uc||(uc=new Gt({\"fill-extrusion-rounded-corner-distance\":new O(S[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"],\"fill-extrusion-rounded-corner-distance\")})),hc,t2=()=>hc||(hc=new Gt({\"fill-extrusion-opacity\":new O(S[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"],\"fill-extrusion-opacity\"),\"fill-extrusion-color\":new N(S[\"paint_fill-extrusion\"][\"fill-extrusion-color\"],\"fill-extrusion-color\"),\"fill-extrusion-translate\":new O(S[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"],\"fill-extrusion-translate\"),\"fill-extrusion-translate-anchor\":new O(S[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"],\"fill-extrusion-translate-anchor\"),\"fill-extrusion-pattern\":new sn(S[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"],\"fill-extrusion-pattern\"),\"fill-extrusion-height\":new N(S[\"paint_fill-extrusion\"][\"fill-extrusion-height\"],\"fill-extrusion-height\"),\"fill-extrusion-base\":new N(S[\"paint_fill-extrusion\"][\"fill-extrusion-base\"],\"fill-extrusion-base\"),\"fill-extrusion-vertical-gradient\":new O(S[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"],\"fill-extrusion-vertical-gradient\")})),e2={get paint(){return t2()},get layout(){return Qx()}},r2=class extends de{constructor(t,e){super(t,e2,e)}createBucket(t){return new Vd(t)}queryRadius(){return Ka(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Qa(t,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-n.bearingInRadians,a),l=this.paint.get(\"fill-extrusion-height\").evaluate(e,r),u=this.paint.get(\"fill-extrusion-base\").evaluate(e,r),h=a2(o,s,0),c=n2(i,u,l,s),p=c[0],f=c[1];return i2(p,f,h)}};function Pi(t,e){return t.x*e.x+t.y*e.y}function cc(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r<e.length;r++){let a=e[r],s=t[0],o=n.sub(i),l=a.sub(i),u=s.sub(i),h=Pi(o,o),c=Pi(o,l),p=Pi(l,l),f=Pi(u,o),d=Pi(u,l),y=h*p-c*c,m=(p*f-c*d)/y,g=(h*d-c*f)/y,x=1-m-g,v=i.z*x+n.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let r=1/0;for(let i of e)r=Math.min(r,i.z);return r}}function i2(t,e,r){let i=1/0;cd(r,e)&&(i=cc(r,e[0]));for(let n=0;n<e.length;n++){let a=e[n],s=t[n];for(let o=0;o<a.length-1;o++){let l=a[o],u=a[o+1],h=s[o],c=[l,u,s[o+1],h,l];Cg(r,c)&&(i=Math.min(i,cc(r,c)))}}return i!==1/0&&i}function n2(t,e,r,i){let n=[],a=[],s=i[8]*e,o=i[9]*e,l=i[10]*e,u=i[11]*e,h=i[8]*r,c=i[9]*r,p=i[10]*r,f=i[11]*r;for(let d of t){let y=[],m=[];for(let g of d){let x=g.x,v=g.y,b=i[0]*x+i[4]*v+i[12],_=i[1]*x+i[5]*v+i[13],w=i[2]*x+i[6]*v+i[14],D=i[3]*x+i[7]*v+i[15],A=b+s,F=_+o,L=w+l,T=D+u,V=b+h,U=_+c,E=w+p,P=D+f,z=new B(A/T,F/T);z.z=L/T,y.push(z);let R=new B(V/P,U/P);R.z=E/P,m.push(R)}n.push(y),a.push(m)}return[n,a]}function a2(t,e,r){let i=[];for(let n of t){let a=[n.x,n.y,r,1];B1(a,a,e),i.push(new B(a[0]/a[3],a[1]/a[3]))}return i}function s2(t,e,r,i){let n=[e,r];for(;n.length;)r=n.pop(),e=n.pop(),o2(t,e,r,i,n)}function o2(t,e,r,i,n){let a=i,s=e+(r-e>>1),o=r-e,l,u=t[e],h=t[e+1],c=t[r],p=t[r+1];for(let f=e+3;f<r;f+=3){let d=l2(t[f],t[f+1],u,h,c,p);if(d>a)l=f,a=d;else if(d===a){let y=Math.abs(f-s);y<o&&(l=f,o=y)}}a>i&&(t[l+2]=a,l-e>3&&n.push(e,l),r-l>3&&n.push(l,r))}function l2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function kt(t,e,r,i){let n={type:e,geom:r},a={id:t??null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case\"Point\":case\"MultiPoint\":Mi(a,n.geom);break;case\"LineString\":Mi(a,n.geom.points);break;case\"Polygon\":Mi(a,n.geom[0].points);break;case\"MultiLineString\":for(let s of n.geom)Mi(a,s.points);break;case\"MultiPolygon\":for(let s of n.geom)Mi(a,s[0].points)}return a}function nu(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Mi(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}var u2=class{projectX(t){return t/360+.5}projectY(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}unprojectX(t){return(t-.5)*360}unprojectY(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}},h2=class{projectX(t){return t}projectY(t){return t}unprojectX(t){return t}unprojectY(t){return t}},ts=new u2,c2=new h2;function au(t){return t===\"unitSquare\"?c2:ts}function su(t,e,r){let i=[];switch(t.type){case\"FeatureCollection\":for(let n=0;n<t.features.length;n++)Xs(i,t.features[n],e,r,n);break;case\"Feature\":Xs(i,t,e,r);break;default:Xs(i,{type:\"Feature\",geometry:t,properties:void 0},e,r)}return i}function Xs(t,e,r,i,n){let a=t.length;if(Od(t,e,r,n),!i)return;let s=Rd(e,r,n);s!=null&&(t.length>a?i.delete(s):i.set(s,{...e,id:s}))}function Od(t,e,r,i,n=0){if(!e.geometry)return;if(n>1024)throw Error(\"GeometryCollection nesting exceeds supported depth: 1024\");if(e.geometry.type===\"GeometryCollection\"){p2(t,e,e.geometry,r,i,n+1);return}if(!e.geometry.coordinates?.length)return;let a=Rd(e,r,i),s=(r.tolerance/((1<<r.maxZoom)*r.extent))**2,o=au(r.coordinates);switch(e.geometry.type){case\"Point\":f2(t,a,e.geometry,o,e.properties);return;case\"MultiPoint\":d2(t,a,e.geometry,o,e.properties);return;case\"LineString\":y2(t,a,e.geometry,s,o,e.properties);return;case\"MultiLineString\":m2(t,a,e.geometry,s,o,r,e.properties);return;case\"Polygon\":g2(t,a,e.geometry,s,o,e.properties);return;case\"MultiPolygon\":x2(t,a,e.geometry,s,o,e.properties);return;default:throw Error(\"Input data is not a valid GeoJSON object.\")}}function Rd(t,e,r){return e.promoteId?t.properties?.[e.promoteId]:e.generateId?r||0:t.id}function p2(t,e,r,i,n,a=0){for(let s of r.geometries)Od(t,{id:e.id,type:\"Feature\",geometry:s,properties:e.properties},i,n,a)}function f2(t,e,r,i,n){let a=[];a.push(i.projectX(r.coordinates[0]),i.projectY(r.coordinates[1]),0),t.push(kt(e,\"Point\",a,n))}function d2(t,e,r,i,n){let a=[];for(let s of r.coordinates)a.push(i.projectX(s[0]),i.projectY(s[1]),0);t.push(kt(e,\"MultiPoint\",a,n))}function y2(t,e,r,i,n,a){let s={points:[]};ou(r.coordinates,s,i,!1,n),t.push(kt(e,\"LineString\",s,a))}function m2(t,e,r,i,n,a,s){if(a.lineMetrics)for(let o of r.coordinates){let l={points:[]};ou(o,l,i,!1,n),t.push(kt(e,\"LineString\",l,s))}else{let o=[];lu(r.coordinates,o,i,!1,n),t.push(kt(e,\"MultiLineString\",o,s))}}function g2(t,e,r,i,n,a){let s=[];lu(r.coordinates,s,i,!0,n),t.push(kt(e,\"Polygon\",s,a))}function x2(t,e,r,i,n,a){let s=[];for(let o of r.coordinates){let l=[];lu(o,l,i,!0,n),l.length&&s.push(l)}s.length&&t.push(kt(e,\"MultiPolygon\",s,a))}function ou(t,e,r,i,n){let a,s,o=0;for(let u=0;u<t.length;u++){let h=n.projectX(t[u][0]),c=n.projectY(t[u][1]);e.points.push(h,c,0),u>0&&(o+=i?(a*c-h*s)/2:Math.sqrt((h-a)**2+(c-s)**2)),a=h,s=c}let l=e.points.length-3;e.points[2]=1,r>0&&s2(e.points,0,l,r),e.points[l+2]=1,nu(e),e.size=Math.abs(o),e.start=0,e.end=e.size}function lu(t,e,r,i,n){for(let a=0;a<t.length;a++){let s={points:[]};ou(t[a],s,r,i,n),e.push(s)}}function v2(t,e=ts){return{type:\"FeatureCollection\",features:t.map(r=>Ma(r,e))}}function Ma(t,e=ts){let r={type:\"Feature\",geometry:b2(t,e),properties:t.tags};return t.id!=null&&(r.id=t.id),r}function b2(t,e){let{type:r,geometry:i}=t;switch(r){case\"Point\":return{type:r,coordinates:$d(i[0],i[1],e)};case\"MultiPoint\":return{type:r,coordinates:Qn(i,e)};case\"LineString\":return{type:r,coordinates:Qn(i.points,e)};case\"MultiLineString\":case\"Polygon\":return{type:r,coordinates:i.map(n=>Qn(n.points,e))};case\"MultiPolygon\":return{type:r,coordinates:i.map(n=>n.map(a=>Qn(a.points,e)))}}}function Qn(t,e=ts){let r=[];for(let i=0;i<t.length;i+=3)r.push($d(t[i],t[i+1],e));return r}function $d(t,e,r){return[r.unprojectX(t),r.unprojectY(e)]}function ce(t,e,r,i,n,a,s,o){if(r/=e,i/=e,a>=r&&s<i)return t;if(s<r||a>=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c<i)l.push(u);else if(!(c<r||h>=i))switch(u.type){case\"Point\":case\"MultiPoint\":w2(u,l,r,i,n);continue;case\"LineString\":_2(u,l,r,i,n,o);continue;case\"MultiLineString\":D2(u,l,r,i,n);continue;case\"Polygon\":S2(u,l,r,i,n);continue;case\"MultiPolygon\":A2(u,l,r,i,n);continue}}return l.length?l:null}function w2(t,e,r,i,n){let a=[];if(E2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?\"Point\":\"MultiPoint\";e.push(kt(t.id,s,a,t.tags))}function _2(t,e,r,i,n,a){let s=[];if(Nd(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length)if(a.lineMetrics)for(let o of s)e.push(kt(t.id,\"LineString\",o,t.tags));else s.length>1?e.push(kt(t.id,\"MultiLineString\",s,t.tags)):e.push(kt(t.id,\"LineString\",s[0],t.tags))}function D2(t,e,r,i,n){let a=[];uu(t.geometry,a,r,i,n,!1),a.length&&(a.length===1?e.push(kt(t.id,\"LineString\",a[0],t.tags)):e.push(kt(t.id,\"MultiLineString\",a,t.tags)))}function S2(t,e,r,i,n){let a=[];uu(t.geometry,a,r,i,n,!0),a.length&&e.push(kt(t.id,\"Polygon\",a,t.tags))}function A2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];uu(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(kt(t.id,\"MultiPolygon\",a,t.tags))}function E2(t,e,r,i,n){for(let a=0;a<t.length;a+=3){let s=t[a+n];s>=r&&s<=i&&Wr(e,t[a],t[a+1],t[a+2])}}function Nd(t,e,r,i,n,a,s){let o=pc(t),l=n===0?F2:I2,u=t.start,h,c;for(let g=0;g<t.points.length-3;g+=3){let x=t.points[g],v=t.points[g+1],b=t.points[g+2],_=t.points[g+3],w=t.points[g+4],D=n===0?x:v,A=n===0?_:w,F=!1;s&&(h=Math.sqrt((x-_)**2+(v-w)**2)),D<r?A>=r&&(c=l(o,x,v,_,w,r),s&&(o.start=u+h*c)):D>i?A<=i&&(c=l(o,x,v,_,w,i),s&&(o.start=u+h*c)):Wr(o.points,x,v,b),A<r&&D>=r&&(c=l(o,x,v,_,w,r),F=!0),A>i&&D<=i&&(c=l(o,x,v,_,w,i),F=!0),!a&&F&&(s&&(o.end=u+h*c),e.push(o),o=pc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Wr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Wr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(nu(o),e.push(o))}function pc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function uu(t,e,r,i,n,a){for(let s of t)Nd(s,e,r,i,n,a,!1)}function Wr(t,e,r,i){t.push(e,r,i)}function F2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Wr(t.points,a,r+(n-r)*s,1),s}function I2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Wr(t.points,e+(i-e)*s,a,1),s}function hu(t,e){if(!e.wrap)return t;let r=e.buffer/e.extent,i=t,n=ce(t,1,-1-r,r,0,-1,2,e),a=ce(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=ce(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=fc(n,1).concat(i)),a&&(i=i.concat(fc(a,-1)))),i}function fc(t,e){let r=[];for(let i of t)switch(i.type){case\"Point\":case\"MultiPoint\":{let n=T2(i.geometry,e);r.push(kt(i.id,i.type,n,i.tags));continue}case\"LineString\":{let n=Ws(i.geometry,e);r.push(kt(i.id,i.type,n,i.tags));continue}case\"MultiLineString\":case\"Polygon\":{let n=[];for(let a of i.geometry)n.push(Ws(a,e));r.push(kt(i.id,i.type,n,i.tags));continue}case\"MultiPolygon\":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Ws(o,e));n.push(s)}r.push(kt(i.id,i.type,n,i.tags));continue}}return r}function T2(t,e){let r=[];for(let i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function Ws(t,e){let r={points:[],size:t.size};t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let i=0;i<t.points.length;i+=3)r.points.push(t.points[i]+e,t.points[i+1],t.points[i+2]);return nu(r),r}function k2(t,e,r,i){let n=M2(e,r),a=[];if(n.removeAll&&(a=t,t=[],i?.clear()),n.remove.size||n.add.size){for(let o of n.remove)i?.delete(o);let s=[];for(let o of t)(n.remove.has(o.id)||n.add.has(o.id))&&s.push(o);if(s.length){a=a.concat(s);let o=new Set(s.map(l=>l.id));t=t.filter(l=>!o.has(l.id))}if(n.add.size){let o=su({type:\"FeatureCollection\",features:Array.from(n.add.values())},r,i);o=hu(o,r),a=a.concat(o),t=t.concat(o)}}if(n.update.size){let s=new Map,o=[];for(let l of t)n.update.has(l.id)?s.set(l.id,[...s.get(l.id)||[],l]):o.push(l);for(let[l,u]of n.update){let h=s.get(l);if(!h||h.length===0){if(!i?.has(l))continue;let p=P2(l,u,r,i);a=a.concat(p),o=o.concat(p);continue}let c=C2(h,u,r,i);a=a.concat(h,c),o=o.concat(c)}t=o}return{affected:a,source:t}}function C2(t,e,r,i){let n=!!e.newGeometry,a=jd(e);if(n){let s=t[0],o=a?nl(s.tags,e):s.tags;return Ud(s.id,e.newGeometry,o,r,i)}if(a){let s=[];for(let o of t){let l={...o};l.tags=nl(l.tags,e),s.push(l)}return s}return t}function P2(t,e,r,i){let n=i.get(t),a=jd(e)?nl(n.properties,e):n.properties;return e.newGeometry?Ud(t,e.newGeometry,a,r,i):(i.set(t,{...n,properties:a}),[])}function Ud(t,e,r,i,n){return hu(su({type:\"FeatureCollection\",features:[{type:\"Feature\",id:t,geometry:e,properties:r}]},{...i,promoteId:void 0,generateId:!1},n),i)}function jd(t){return t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0}function nl(t,e){if(e.removeAllProperties)return{};let r={...t||{}};if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function M2(t,e){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(r=>[e.promoteId?r.properties?.[e.promoteId]:r.id,r])),update:new Map(t.update?.map(r=>[r.id,r]))}:{remove:new Set,add:new Map,update:new Map}}var dc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),B2=class qd{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error(\"Data does not appear to be in a KDBush format.\");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=dc[i&15];if(!a)throw Error(\"Unrecognized array type.\");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new qd(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=dc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return al(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)yc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];yc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function al(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Gd(t,e,s,i,n,a),al(t,e,r,i,s-1,1-a),al(t,e,r,s+1,n,1-a)}function Gd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Gd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(Bi(t,e,i,r),e[2*n+a]>s&&Bi(t,e,i,n);o<l;){for(Bi(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?Bi(t,e,i,l):(l++,Bi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Bi(t,e,r,i){Zs(t,r,i),Zs(e,2*r,2*i),Zs(e,2*r+1,2*i+1)}function Zs(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function yc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Yd={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t,coordinates:\"lngLat\",wrap:!0},Ba=1073741824;function qt(t){return(t-.5)*Ba}function si(t){return t/Ba+.5}function mc(t){return Math.abs(qt(t))<2147483647}var z2=class{constructor(t){this.options=gc(t),this.worldCoordinateHelper=au(this.options.coordinates),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let i=r.geometry.type===\"MultiPoint\"?r.geometry.coordinates:[r.geometry.coordinates];for(let[n,a]of i){let[s,o]=[this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(a)];if(!this.options.wrap&&!Hs([s,o]))continue;let l={id:r.id,type:\"Point\",geometry:[s,o],tags:r.properties};e.push(l)}}this.createIndex(e)}initialize(t){let e=[];for(let r of t)if(r.type===\"Point\"){if(!this.options.wrap&&!Hs(r.geometry))continue;e.push(r)}else if(r.type===\"MultiPoint\")for(let i=0;i<r.geometry.length;i+=3){let n=[r.geometry[i],r.geometry[i+1]];(this.options.wrap||Hs(n))&&e.push({id:r.id,type:\"Point\",geometry:n,tags:r.tags})}this.createIndex(e)}updateIndex(t,e,r){this.options=gc({...r.clusterOptions,coordinates:this.options.coordinates,wrap:this.options.wrap}),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;this.trees=Array(i+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],e&&console.time(\"total time\");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=this.stride,s=i+1,o=new Int32Array(t.length*2),l=new Int32Array(t.length*a),u=0;for(let f=0;f<t.length;f++){let d=t[f];if(!d?.geometry||!mc(d.geometry[0])||!mc(d.geometry[1]))continue;o[u*2]=Math.round(qt(d.geometry[0])),o[u*2+1]=Math.round(qt(d.geometry[1]));let y=u*a;l[y+0]=s,l[y+1]=f,l[y+2]=-1,l[y+3]=1,u++}let h=this.trees[i+1]=this.createTree(o,l,u);e&&console.timeEnd(n);let c=new Int32Array(u*2),p=new Int32Array(u*a);for(let f=i;f>=r;f--){let d=Date.now(),y=this.cluster(h,f,c,p);this.isSameAsTree(h,p,y)||(h=this.createTree(c.slice(0,y*2),p.slice(0,y*a),y)),this.trees[f]=h,e&&console.log(\"z%d: %d clusters in %dms\",f,h.numItems,Date.now()-d)}e&&console.timeEnd(\"total time\")}getClusters(t,e){return(this.options.wrap?this.options.coordinates===\"unitSquare\"?this.getClustersAcrossEdge(t,e):this.getClustersInternal(t,e):this.getClustersInWorld(t,e)).map(r=>Ma(r,this.worldCoordinateHelper))}getClustersInWorld(t,e){let r=this.options.coordinates!==\"unitSquare\",i=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[1])):t[1]),n=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[3])):t[3]),a=Math.max(0,this.worldCoordinateHelper.projectX(t[0])),s=Math.min(1,this.worldCoordinateHelper.projectX(t[2]));return a>s?[]:this.getClustersInRange([a,Math.min(i,n),s,Math.max(i,n)],e)}getClustersAcrossEdge([t,e,r,i],n){if(r<t&&(r+=1),r-t>=1)return this.getClustersInRange([0,e,1,i],n);let a=Math.floor(t),s=t-a,o=r-a;return o<=1?this.getClustersInRange([s,e,o,i],n):this.getClustersInRange([s,e,1,i],n).concat(this.getClustersInRange([0,e,o-1,i],n))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let s=this.getClustersInternal([r,i,180,a],e),o=this.getClustersInternal([-180,i,n,a],e);return s.concat(o)}return this.getClustersInRange([this.worldCoordinateHelper.projectX(r),this.worldCoordinateHelper.projectY(a),this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(i)],e)}getClustersInRange([t,e,r,i],n){let a=this.trees[this.limitZoom(n)],s=a.range(qt(t),qt(e),qt(r),qt(i)),o=a.flatCoords,l=a.flatData,u=[];for(let h of s){let c=this.stride*h;u.push(l[c+3]>1?L2(o,h,l,c,this.clusterProps):this.points[l[c+1]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error(\"No cluster with the specified id: \"+t),n=this.trees[r];if(!n)throw i;let a=n.flatCoords,s=n.flatData;if(e>=n.numItems)throw i;let o=this.options.radius/(this.options.extent*2**(r-1))*Ba,l=a[e*2],u=a[e*2+1],h=n.within(l,u,o),c=[];for(let p of h){let f=p*this.stride;s[f+2]===t&&c.push(s[f+3]>1?V2(a,p,s,f,this.clusterProps,this.worldCoordinateHelper):Ma(this.points[s[f+1]],this.worldCoordinateHelper))}if(c.length===0)throw i;return c}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t;if(!this.options.wrap&&(e<0||e>=n||r<0||r>=n))return null;let{extent:a,radius:s}=this.options,o=s/a,l=qt((r-o)/n),u=qt((r+1+o)/n),h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range(qt((e-o)/n),l,qt((e+1+o)/n),u),i,e,r,n,h),this.options.wrap&&e===0&&this.addTileFeatures(i.range(qt(1-o/n),l,qt(1),u),i,n,r,n,h),this.options.wrap&&e===n-1&&this.addTileFeatures(i.range(qt(0),l,qt(o/n),u),i,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o?.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n}createTree(t,e,r){let i=new B2(r,this.options.nodeSize,Int32Array);for(let n=0;n<r;n++)i.add(t[n*2],t[n*2+1]);return i.finish(),i.flatCoords=t,i.flatData=e,i.data=null,i}isSameAsTree(t,e,r){if(r!==t.numItems)return!1;let i=t.flatData;for(let n=1;n<r*this.stride;n+=this.stride)if(e[n]!==i[n])return!1;return!0}addTileFeatures(t,e,r,i,n,a){let s=e.flatCoords,o=e.flatData;for(let l of t){let u=l*this.stride,h=o[u+3]>1,c,p,f;if(h)c=cu(o,u,this.clusterProps),p=si(s[l*2]),f=si(s[l*2+1]);else{let m=this.points[o[u+1]];c=m.tags,[p,f]=m.geometry}let d={type:1,geometry:[[Math.round(this.options.extent*(p*n-r)),Math.round(this.options.extent*(f*n-i))]],tags:c},y;y=h||this.options.generateId?o[u+1]:this.points[o[u+1]].id,y!==void 0&&(d.id=y),a.features.push(d)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e,r,i){let{radius:n,extent:a,reduce:s,minPoints:o,maxZoom:l}=this.options,u=n/(a*2**e)*Ba,h=l+1,c=t.flatCoords,p=t.flatData,f=this.stride,d=new Uint32Array(t.numItems),y=0;for(let m=0;m<t.numItems;m++){let g=m*f;if(p[g+0]<=e)continue;p[g+0]=e;let x=c[m*2],v=c[m*2+1],b=t.withinInto(x,v,u,d),_=p[g+3],w=_;for(let D=0;D<b;D++){let A=d[D]*f;p[A+0]>e&&(w+=p[A+3])}if(w>_&&w>=o){let D=x*_,A=v*_,F,L=-1,T=(m<<5)+(e+1)+this.points.length;for(let U=0;U<b;U++){let E=d[U],P=E*f;if(p[P+0]<=e)continue;p[P+0]=e;let z=p[P+3];D+=c[E*2]*z,A+=c[E*2+1]*z,p[P+2]=T,s&&(F||(F=this.map(p,g,!0),L=this.clusterProps.length,this.clusterProps.push(F)),s(F,this.map(p,P)))}p[g+2]=T,r[y*2]=Math.round(D/w),r[y*2+1]=Math.round(A/w);let V=y*f;i[V+0]=h,i[V+1]=T,i[V+2]=-1,i[V+3]=w,s&&(i[V+4]=L),y++}else{r[y*2]=x,r[y*2+1]=v;for(let D=0;D<f;D++)i[y*f+D]=p[g+D];if(y++,w>1)for(let D=0;D<b;D++){let A=d[D],F=A*f;if(!(p[F+0]<=e)){p[F+0]=e,r[y*2]=c[A*2],r[y*2+1]=c[A*2+1];for(let L=0;L<f;L++)i[y*f+L]=p[F+L];y++}}}}return y}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+3]>1){let a=this.clusterProps[t[e+4]];return r?Object.assign({},a):a}let i=this.points[t[e+1]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function gc(t){let e=Object.assign(Object.create(Yd),t);return e.minZoom=Math.min(e.minZoom,30),e.maxZoom=Math.min(e.maxZoom,30),e}function L2(t,e,r,i,n){return{id:r[i+1],type:\"Point\",tags:cu(r,i,n),geometry:[si(t[e*2]),si(t[e*2+1])]}}function V2(t,e,r,i,n,a){return{type:\"Feature\",id:r[i+1],properties:cu(r,i,n),geometry:{type:\"Point\",coordinates:[a.unprojectX(si(t[e*2])),a.unprojectY(si(t[e*2+1]))]}}}function cu(t,e,r){let i=t[e+3],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+4],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+1],point_count:i,point_count_abbreviated:n})}function Hs(t){return t[0]>=0&&t[0]<=1&&t[1]>=0&&t[1]<=1}var Xd=\"geojsonvt_clip_start\",Wd=\"geojsonvt_clip_end\";function xc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),s={transformed:!1,features:[],source:null,x:r,y:i,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length};for(let o of t)O2(s,o,a,n);return s}function O2(t,e,r,i){switch(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type){case\"Point\":case\"MultiPoint\":R2(t,e);return;case\"LineString\":$2(t,e,r,i);return;case\"MultiLineString\":case\"Polygon\":N2(t,e,r);return;case\"MultiPolygon\":U2(t,e,r);return}}function R2(t,e){let r=[];for(let n=0;n<e.geometry.length;n+=3)r.push(e.geometry[n],e.geometry[n+1]),t.numPoints++,t.numSimplified++;if(!r.length)return;let i={type:1,tags:e.tags||null,geometry:r};e.id!==null&&(i.id=e.id),t.features.push(i)}function $2(t,e,r,i){let n=[];if(pu(n,e.geometry,t,r,!1,!1),!n.length)return;let a=e.tags||null;if(i.lineMetrics){a={};for(let o in e.tags)a[o]=e.tags[o];a[Xd]=e.geometry.start/e.geometry.size,a[Wd]=e.geometry.end/e.geometry.size}let s={type:2,tags:a,geometry:n};e.id!==null&&(s.id=e.id),t.features.push(s)}function N2(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++)pu(i,e.geometry[a],t,r,e.type===\"Polygon\",a===0);if(!i.length)return;let n={type:e.type===\"Polygon\"?3:2,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function U2(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++){let s=e.geometry[a];for(let o=0;o<s.length;o++)pu(i,s[o],t,r,!0,o===0)}if(!i.length)return;let n={type:3,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function pu(t,e,r,i,n,a){let s=i*i;if(i>0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;l<e.points.length;l+=3)(i===0||e.points[l+2]>s)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&j2(o,a),t.push(o)}function j2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i<n;a=i,i+=2)r+=(t[i]-t[a])*(t[i+1]+t[a+1]);if(r>0===e)for(let i=0,n=t.length;i<n/2;i+=2){let a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}function vc(t,e){if(t.transformed)return t;let r=1<<t.z,i=t.x,n=t.y;for(let a of t.features)a.type===1?q2(a,e,r,i,n):G2(a,e,r,i,n);return t.transformed=!0,t}function q2(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l=0;l<s.length;l+=2)o.push(Zd(s[l],s[l+1],e,r,i,n));return a.geometry=o,a}function G2(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l of s){let u=[];for(let h=0;h<l.length;h+=2)u.push(Zd(l[h],l[h+1],e,r,i,n));o.push(u)}return a.geometry=o,a}function Zd(t,e,r,i,n,a){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-a))]}var Y2=class{constructor(t){this.options=t,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(this.clipToWorld(t),0,0,0),this.options.debug&&(t.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}updateIndex(t,e,r){r.debug>1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(e),r.debug>1&&console.timeEnd(\"invalidating\");let[i,n,a]=[0,0,0],s=this.clipToWorld(t),o=xc(s,i,n,a,r);o.source=s;let l=ta(i,n,a);if(this.tiles[l]=o,this.tileCoords.push({z:i,x:n,y:a,id:l}),r.debug){let u=`z${i}`;this.stats[u]=(this.stats[u]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<<t;if(!this.options.wrap&&(e<0||e>=a))return null;e=e+a&a-1;let s=ta(t,e,r);if(this.tiles[s])return vc(this.tiles[s],i);n>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[ta(o,l,u)];return!h?.source||(n>1&&(console.log(\"found parent tile z%d-%d-%d\",o,l,u),console.time(\"drilling down\")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd(\"drilling down\"),!this.tiles[s])?null:vc(this.tiles[s],i)}clipToWorld(t){let{wrap:e,coordinates:r}=this.options;if(e&&r!==\"unitSquare\")return t;let i=this.options.buffer/this.options.extent;return ce(e?t:ce(t,1,-i,1+i,0,-1/0,1/0,this.options)||[],1,-i,1+i,1,-1/0,1/0,this.options)||[]}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<<e,c=ta(e,r,i),p=this.tiles[c];if(!p&&(u>1&&console.time(\"creation\"),p=this.tiles[c]=xc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd(\"creation\"));let D=`z${e}`;this.stats[D]=(this.stats[D]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let D=n-e;if(r!==a>>D||i!==s>>D)continue}}if(p.source=null,!t.length)continue;u>1&&console.time(\"clipping\");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,_=ce(t,h,r-f,r+y,0,p.minX,p.maxX,l),w=ce(t,h,r+d,r+m,0,p.minX,p.maxX,l);_&&(g=ce(_,h,i-f,i+y,1,p.minY,p.maxY,l),x=ce(_,h,i+d,i+m,1,p.minY,p.maxY,l)),w&&(v=ce(w,h,i-f,i+y,1,p.minY,p.maxY,l),b=ce(w,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd(\"clipping\"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<<h.z,p=(h.x-o)/c,f=(h.x+1+o)/c,d=(h.y-o)/c,y=(h.y+1+o)/c;if(n<p||i>=f||s<d||a>=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX<f&&g.maxY>=d&&g.minY<y){m=!0;break}if(m){if(r){r>1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function ta(t,e,r){return((1<<t)*r+e)*32+t}var X2={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Yd,debug:0,coordinates:\"lngLat\",wrap:!0},W2=class{constructor(t,e){e=this.options=Object.assign({},X2,e),this.worldCoordinateHelper=au(e.coordinates);let r=e.debug;if(r&&console.time(\"preprocess data\"),e.maxZoom<0||e.maxZoom>24)throw Error(\"maxZoom should be in the 0-24 range\");if(e.promoteId&&e.generateId)throw Error(\"promoteId and generateId cannot be used together.\");e.updateable&&(this.unlocated=new Map);let i=su(t,e,this.unlocated);r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\")),i=hu(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new z2({...e.clusterOptions,coordinates:e.coordinates,wrap:e.wrap}):new Y2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error(\"to update tile geojson `updateable` option must be set to true\");let{affected:i,source:n}=k2(this.source,t,r,this.unlocated);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(Ma(n,this.worldCoordinateHelper))||(e.push(n),i.add(n.id)));t=t.filter(n=>!i.has(n.id));for(let[n,a]of this.unlocated??[])a.geometry&&!r(a)&&this.unlocated.delete(n);return{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error(\"to retrieve data the `updateable` option must be set to true\");return v2(this.source,this.worldCoordinateHelper)}updateClusterOptions(t,e){let r=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,r==t?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},sl=At([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"},{name:\"a_offset_normal\",components:2,type:\"Int8\"}],2),Z2=sl.members;sl.size,sl.alignment;var ol=At([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),H2=ol.members;ol.size,ol.alignment;var J2=Math.cos(75/2*(Math.PI/180)),Hd=1/2,bc=2**14/Hd,Jd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new yg,this.layoutVertexArray2=new mg,this.indexArray=new _n,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new re,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Ta(\"line\",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get(\"line-sort-key\"),n=!i.isConstant(),a=[],s=new ot(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=ci(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Dr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Ta(\"line\",this.layers,e)?ru(\"line\",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,H2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Z2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,\"geojsonvt_clip_start\")&&Object.hasOwn(t.properties,\"geojsonvt_clip_end\"))return{start:+t.properties[Xd],end:+t.properties[Wd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get(\"line-join\").evaluate(t,{}),u=o.get(\"line-cap\").evaluate(t,{}),h=o.get(\"line-miter-limit\").evaluate(t,{}),c=o.get(\"line-round-limit\").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=pr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v<t.length-1;v++)this.totalDistance+=t[v].dist(t[v+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=Dn.types[e.type]===\"Polygon\",h=t.length;for(;h>=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c<h-1&&t[c].equals(t[c+1]);)c++;if(h-c<(u?3:2))return;r===\"bevel\"&&(n=1.05);let p=this.overscaling<=16?15*xt/(512*this.overscaling):0,f=this.segments.prepareSegment(h*10,this.layoutVertexArray,this.indexArray),d,y,m,g,x;this.e1=this.e2=-1,u&&(d=t[h-2],x=t[c].sub(d)._unit()._perp());for(let v=c;v<h;v++){if(m=v===h-1?u?t[c+1]:void 0:t[v+1],m&&t[v].equals(m))continue;x&&(g=x),d&&(y=d),d=t[v],x=m?m.sub(d)._unit()._perp():g,g||(g=x);let b=g.add(x);(b.x!==0||b.y!==0)&&b._unit();let _=g.x*x.x+g.y*x.y,w=b.x*x.x+b.y*x.y,D=w===0?1/0:1/w,A=2*Math.sqrt(2-2*w),F=w<J2&&y&&m,L=g.x*x.y-g.y*x.x>0,T=b.mult(Math.min(D,2)),V=_e((D-3)/5,0,1);if(F&&v>c){let P=d.dist(y);if(P>2*p){let z=d.sub(d.sub(y)._mult(p/P)._round());this.updateDistance(y,z),this.addCurrentVertex(z,g,0,0,f),y=z}}let U=y&&m,E=U?r:u?\"butt\":i;if(U&&E===\"round\"&&(D<a?E=\"miter\":D<=2&&(E=\"fakeround\")),E===\"miter\"&&D>n&&(E=\"bevel\"),E===\"bevel\"&&(D>2&&(E=\"flipbevel\"),D<n&&(E=\"miter\")),y&&this.updateDistance(y,d),E===\"miter\")b._mult(D),this.addCurrentVertex(d,b,0,0,f,!1,T);else if(E===\"flipbevel\"){if(D>100)b=x.mult(-1);else{let P=D*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(P*(L?-1:1))}this.addCurrentVertex(d,b,0,0,f,!1,T,V),this.addCurrentVertex(d,b.mult(-1),0,0,f,!1,T,V)}else if(E===\"bevel\"||E===\"fakeround\"){let P=-Math.sqrt(D*D-1),z=L?P:0,R=L?0:P;if(y&&this.addCurrentVertex(d,g,z,R,f,!1,T),E===\"fakeround\"){let G=Math.round(A*180/Math.PI/20);for(let rt=1;rt<G;rt++){let lt=rt/G;if(lt!==.5){let it=lt-.5,Pt=1.0904+_*(-3.2452+_*(3.55645-_*1.43519)),le=.848013+_*(-1.06021+_*.215638);lt+=lt*it*(lt-1)*(Pt*it*it+le)}let pt=x.sub(g)._mult(lt)._add(g)._unit()._mult(L?-1:1);this.addHalfVertex(d,pt.x,pt.y,L?-T.x:T.x,L?-T.y:T.y,!1,L,f)}}m&&this.addCurrentVertex(d,x,-z,-R,f,!1,T)}else if(E===\"butt\")this.addCurrentVertex(d,b,0,0,f,!1,T);else if(E===\"square\"){let P=y?1:-1;this.addCurrentVertex(d,b,P,P,f,!1,T)}else E===\"round\"&&(y&&(this.addCurrentVertex(d,g,0,0,f,!1,T,V),this.addCurrentVertex(d,g,1,1,f,!0,T,V)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0,T,V),this.addCurrentVertex(d,x,0,0,f,!1,T,V)));if(F&&v<h-1){let P=d.dist(m);if(P>2*p){let z=d.add(m.sub(d)._mult(p/P)._round());this.updateDistance(d,z),this.addCurrentVertex(z,x,0,0,f),d=z}}}}addCurrentVertex(t,e,r,i,n,a=!1,s=e,o=0){let l=e.x+e.y*r,u=e.y-e.x*r,h=-e.x+e.y*i,c=-e.y-e.x*i,p=s.x+(e.x-s.x)*o,f=s.y+(e.y-s.y)*o;this.addHalfVertex(t,l,u,p,f,a,!1,n),this.addHalfVertex(t,h,c,-p,-f,a,!0,n),this.distance>bc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a,s,o))}addHalfVertex({x:t,y:e},r,i,n,a,s,o,l){let u=(this.lineClips?this.scaledDistance*(bc-1):this.scaledDistance)*Hd;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!s,(e<<1)+ +!!o,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}let h=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,h,this.e2),l.primitiveLength++),o?this.e2=h:this.e1=h}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get(\"line-dasharray\");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get(\"line-dasharray\");if(!a||a.value.kind===\"constant\")continue;let s=n.layout.get(\"line-cap\").evaluate(e,{})===\"round\",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(\",\")},${o.round}`,c=`${l.dasharray.join(\",\")},${l.round}`,p=`${u.dasharray.join(\",\")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};M(\"LineBucket\",Jd,{omit:[\"layers\",\"patternFeatures\"]});var wc,K2=()=>wc||(wc=new Gt({\"line-cap\":new N(S.layout_line[\"line-cap\"],\"line-cap\"),\"line-join\":new N(S.layout_line[\"line-join\"],\"line-join\"),\"line-miter-limit\":new N(S.layout_line[\"line-miter-limit\"],\"line-miter-limit\"),\"line-round-limit\":new N(S.layout_line[\"line-round-limit\"],\"line-round-limit\"),\"line-sort-key\":new N(S.layout_line[\"line-sort-key\"],\"line-sort-key\")})),_c,Q2=()=>_c||(_c=new Gt({\"line-opacity\":new N(S.paint_line[\"line-opacity\"],\"line-opacity\"),\"line-layer-opacity\":new O(S.paint_line[\"line-layer-opacity\"],\"line-layer-opacity\"),\"line-color\":new N(S.paint_line[\"line-color\"],\"line-color\"),\"line-translate\":new O(S.paint_line[\"line-translate\"],\"line-translate\"),\"line-translate-anchor\":new O(S.paint_line[\"line-translate-anchor\"],\"line-translate-anchor\"),\"line-width\":new N(S.paint_line[\"line-width\"],\"line-width\"),\"line-gap-width\":new N(S.paint_line[\"line-gap-width\"],\"line-gap-width\"),\"line-offset\":new N(S.paint_line[\"line-offset\"],\"line-offset\"),\"line-blur\":new N(S.paint_line[\"line-blur\"],\"line-blur\"),\"line-dasharray\":new sn(S.paint_line[\"line-dasharray\"],\"line-dasharray\"),\"line-pattern\":new sn(S.paint_line[\"line-pattern\"],\"line-pattern\"),\"line-gradient\":new Ha(S.paint_line[\"line-gradient\"],\"line-gradient\")})),Dc={get paint(){return Q2()},get layout(){return K2()}},tv=class extends N{possiblyEvaluate(t,e){return e=new ot(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Wt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},ea,ev=class extends de{constructor(t,e){super(t,Dc,e),this.gradientVersion=0,ea||(ea=new tv(Dc.paint.properties[\"line-width\"].specification,\"line-floorwidth\"),ea.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t===\"line-gradient\"){let e=this.gradientExpression();this.stepInterpolant=m0(e)?e._styleExpression.expression instanceof Tl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values[\"line-floorwidth\"]=ea.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,t)}createBucket(t){return new Jd(t)}queryRadius(t){let e=t,r=Sc(Xr(\"line-width\",this,e),Xr(\"line-gap-width\",this,e)),i=Xr(\"line-offset\",this,e);return r/2+Math.abs(i)+Ka(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Qa(t,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-n.bearingInRadians,a),o=a/2*Sc(this.paint.get(\"line-width\").evaluate(e,r),this.paint.get(\"line-gap-width\").evaluate(e,r)),l=this.paint.get(\"line-offset\").evaluate(e,r);return l&&(i=Og(i,l*a)),Pg(s,i,o)}isTileClipped(){return!0}};function Sc(t,e){return e>0?e+2*t:t}var rv=At([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"},{name:\"a_height_offset\",components:1,type:\"Float32\"}],4),iv=At([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);At([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);var nv=At([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);At([{type:\"Int16\",name:\"anchorPointX\"},{type:\"Int16\",name:\"anchorPointY\"},{type:\"Int16\",name:\"x1\"},{type:\"Int16\",name:\"y1\"},{type:\"Int16\",name:\"x2\"},{type:\"Int16\",name:\"y2\"},{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]);var Ac=At([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4);At([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4),At([{name:\"triangle\",components:3,type:\"Uint16\"}]),At([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Uint16\",name:\"glyphStartIndex\"},{type:\"Uint16\",name:\"numGlyphs\"},{type:\"Uint32\",name:\"vertexStartIndex\"},{type:\"Uint32\",name:\"lineStartIndex\"},{type:\"Uint32\",name:\"lineLength\"},{type:\"Uint16\",name:\"segment\"},{type:\"Uint16\",name:\"lowerSize\"},{type:\"Uint16\",name:\"upperSize\"},{type:\"Float32\",name:\"lineOffsetX\"},{type:\"Float32\",name:\"lineOffsetY\"},{type:\"Uint8\",name:\"writingMode\"},{type:\"Uint8\",name:\"placedOrientation\"},{type:\"Uint8\",name:\"hidden\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Int16\",name:\"associatedIconIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),At([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Int16\",name:\"rightJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"centerJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"leftJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedTextSymbolIndex\"},{type:\"Int16\",name:\"placedIconSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedIconSymbolIndex\"},{type:\"Uint16\",name:\"key\"},{type:\"Uint16\",name:\"textBoxStartIndex\"},{type:\"Uint16\",name:\"textBoxEndIndex\"},{type:\"Uint16\",name:\"verticalTextBoxStartIndex\"},{type:\"Uint16\",name:\"verticalTextBoxEndIndex\"},{type:\"Uint16\",name:\"iconBoxStartIndex\"},{type:\"Uint16\",name:\"iconBoxEndIndex\"},{type:\"Uint16\",name:\"verticalIconBoxStartIndex\"},{type:\"Uint16\",name:\"verticalIconBoxEndIndex\"},{type:\"Uint16\",name:\"featureIndex\"},{type:\"Uint16\",name:\"numHorizontalGlyphVertices\"},{type:\"Uint16\",name:\"numVerticalGlyphVertices\"},{type:\"Uint16\",name:\"numIconVertices\"},{type:\"Uint16\",name:\"numVerticalIconVertices\"},{type:\"Uint16\",name:\"useRuntimeCollisionCircles\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Float32\",name:\"textBoxScale\"},{type:\"Float32\",name:\"collisionCircleDiameter\"},{type:\"Uint16\",name:\"textAnchorOffsetStartIndex\"},{type:\"Uint16\",name:\"textAnchorOffsetEndIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),At([{type:\"Float32\",name:\"offsetX\"}]),At([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),At([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var oi=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(oi.isParsed())throw Error(\"RTL text plugin already registered.\");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(t,e){if(this.isParsed())return this.getState();if(t.pluginStatus!==\"loading\")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await e(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:\"loaded\",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function av(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function sv(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function ov(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function An(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function lv(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function uv(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function Ec(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function hv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||/^\\p{gc=Mc}/u.test(e)}var cv={C:\"18g,1;g2,3;4nb,1\",D:\"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f\",R:\"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1\",T:\"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1\"},pv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},fv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},Fc=1604,dv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function yv(t,e,r){let i=0;for(let n of t.split(\";\")){let[a,s]=n.split(\",\").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l<o+s;l++)r.set(l,e);i=o+s}}var Kd=new Map;for(let[t,e]of Object.entries(cv))yv(e,t,Kd);function mv(t){return Kd.get(t)??\"U\"}function gv(t){return t===\"D\"||t===\"L\"||t===\"C\"}function xv(t){return t===\"D\"||t===\"R\"||t===\"C\"}function vv(t,e,r){return t===\"D\"?e&&r?3:e?1:r?2:0:t===\"R\"?+!!e:t===\"L\"?r?2:0:null}function bv(t){return[...t].map(e=>{let r=e.codePointAt(0);return{codePoint:r,type:mv(r),form:null}})}function wv(t){let e=t.filter(r=>r.type!==\"T\");for(let r=0;r<e.length;r++){let i=e[r],n=r>0&&gv(e[r-1].type),a=r+1<e.length&&xv(e[r+1].type);i.form=vv(i.type,n,a)}}function _v(t){let e=!1;for(let r of t)r.type===\"T\"?r.form=e?3:0:e=r.form===2||r.form===3}function Dv(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.codePoint!==Fc){e.push(i);continue}let n=r+1;for(;n<t.length&&t[n].type===\"T\";)n++;let a=t[n],s=a&&fv[String.fromCodePoint(Fc,a.codePoint)];if(!s){e.push(i);continue}let o=i.form===3||i.form===1;e.push({codePoint:s[+!!o],type:\"R\",form:0}),e.push(...t.slice(r+1,n)),r=n}return e}function Sv(t){if(t.form===null)return t.codePoint;let e=pv[t.codePoint];return e&&(e[t.form]||e[0])||t.codePoint}function Av(t){if(!dv.test(t))return t;let e=bv(t);return wv(e),_v(e),Dv(e).map(r=>String.fromCodePoint(Sv(r))).join(\"\")}function Ev(t,e,r){let i=e.layout.get(\"text-transform\").evaluate(r,{});return i===\"uppercase\"?t=t.toLocaleUpperCase():i===\"lowercase\"&&(t=t.toLocaleLowerCase()),(oi.applyArabicShaping??Av)(t)}function Fv(t,e,r){for(let i of t.sections)i.text=Ev(i.text,e,r);return t}function Js(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function Iv(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<e.length;a++)i[a]=e[a];let n=e.length;for(let a=t.first.next;a;a=a.next){let s=a.points;for(let o=1;o<s.length;o++)i[n++]=s[o]}return i}function Ic(t,e,r,i,n){let a=e[r];delete e[r],e[i]=a;let s=t[a];return s.last.next=n.first,s.last=n.last,a}function Tc(t,e,r,i,n){let a=e[i];delete e[i],e[r]=a;let s=t[a];return n.last.next=s.first,s.first=n.first,a}function Tv(t){let e={},r={},i=[];for(let a of t){let s=a.text?a.text.toString():null,o={points:a.geometry[0],next:null},l={feature:a,first:o,last:o};if(!s){i.push(l);continue}let u=Js(s,l),h=Js(s,l,!0);if(u in r&&h in e&&r[u]!==e[h]){let c=Tc(i,e,u,h,l),p=Ic(i,r,u,h,i[c]);delete e[u],delete r[h],r[Js(s,i[p],!0)]=p,i[c].feature.geometry=null}else if(u in r)Ic(i,r,u,h,l);else if(h in e)Tc(i,e,u,h,l);else{let c=i.push(l)-1;e[u]=c,r[h]=c}}let n=[];for(let a of i){let s=a.feature;s.geometry&&(a.first.next&&(s.geometry[0]=Iv(a)),n.push(s))}return n}var Qd=typeof Intl<\"u\"&&\"Segmenter\"in Intl,Ks,Qs;function ll(t){if(!Qd||!uv(t))return[...t];Ks??(Ks=new Intl.Segmenter(void 0,{granularity:\"grapheme\"}));let e=[];for(let{segment:r}of Ks.segment(t)){let i=e.length-1;i>=0&&hv(e[i],r)?e[i]+=r:e.push(r)}return e}function kv(t){let e=new Set;if(Qd){Qs??(Qs=new Intl.Segmenter(void 0,{granularity:\"word\"}));for(let{index:i}of Qs.segment(t))e.add(i);return e}let r=0;for(let i of t.split(/\\b|(?=\\p{Ideo})/u))e.add(r),r+=i.length;return e}function ul(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function dn(t){return/\\s/u.test(String.fromCodePoint(t))}function es(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function hl(t){for(let e of t)if(An(e.codePointAt(0)))return!0;return!1}function Cv(t){for(let e of t)if(!Pv(e.codePointAt(0)))return!1;return!0}function Pv(t){return!av(t)}function li(t){return!(An(t)||lv(t))}function ty(t){return/\\p{sc=Arab}/u.test(String.fromCodePoint(t))}function ey(t){return sv(t)}function ry(t){for(let e of t)if(ey(e.codePointAt(0)))return!0;return!1}var qr={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};function Mv(t){let e=\"\",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!li(s.value.codePointAt(0))||qr[s.value])&&(r.premature||!li(r.value.codePointAt(0))||qr[r.value])&&qr[n.value]?e+=qr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var Bv={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},zv={40:!0};function kc(t,e,r,i,n,a){if(\"fontStack\"in e){let s=r[e.fontStack]?.default,o=s?.[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s?.[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function Cc(t,e,r,i){let n=(t-e)**2;return i?t<e?n/2:n*2:n+Math.abs(r)*r}function Pc(t){return/^\\s+$/u.test(t)}function Lv(t,e,r){let i=0;return(t===10||t===13)&&(i-=1e4),r&&(i+=150),(t===40||t===65288)&&(i+=50),(e===41||e===65289)&&(i+=50),i}function Mc(t,e,r,i,n,a){let s=null,o=Cc(e,r,n,a);for(let l of i){let u=Cc(e-l.x,r,n,a)+l.badness;u<=o&&(s=l,o=u)}return{index:t,x:e,priorBreak:s,badness:o}}function iy(t){return t?iy(t.priorBreak).concat(t.index):[]}var fu=class cl{constructor(e=\"\",r=[],i=[]){this.text=e,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this.cachedGraphemes=null}graphemes(){return this.cachedGraphemes??(this.cachedGraphemes=ll(this.text)),this.cachedGraphemes}static fromFeature(e,r,i,n){let a=new cl;for(let s of e.sections)s.image?a.addImageSection(s):a.addTextSection(s,r);return i&&a.verticalizePunctuation(n),a}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(e={},r){let i=Mv(this.text),n=0;this.cachedGraphemes=this.graphemes().map((a,s)=>{let o=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(s);return r?.[s]!==!1&&\"fontStack\"in l&&e[l.fontStack]?.vertical?.[a]?a:o}),this.text=this.cachedGraphemes.join(\"\")}hasZeroWidthSpaces(){return this.text.includes(\"\\u200B\")}trim(){let e=this.graphemes(),r=0;for(;r<e.length&&Pc(e[r]);)r++;let i=e.length;for(;i>r&&Pc(e[i-1]);)i--;this.text=e.slice(r,i).join(\"\"),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(\"\"),n=this.sectionIndex.slice(e,r);return new cl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if(\"imageName\"in a){let s=e[a.imageName];if(!s)continue;let o=s.displaySize;r=Math.max(r,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(e,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:\"\",a=ll(n+e);this.text+=e,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o<s;o++)this.sectionIndex.push(r)}addTextSection(e,r){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||\"bottom\",fontStack:e.fontStack||r}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let r=e.image?e.image.name:\"\";if(r.length===0){Ct(\"Can't add FormattedSection with an empty image.\");return}let i=this.getNextImageSectionCharCode();i?(this.sections.push({scale:1,verticalAlign:e.verticalAlign||\"bottom\",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)):Ct(\"Reached maximum number of images 6401\")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=this.determineTotalWidth(e,i,n,a);if(e>=0&&s>0&&s<=r&&!/[\\n\\r]/.test(this.text))return[this.length()];let o=[],l=s/Math.max(1,Math.ceil(s/r)),u=this.hasZeroWidthSpaces(),h=this.graphemes(),c=null,p=0,f=0;for(let d=0;d<h.length;d++){let y=h[d];if(d>0){let m=h[d-1].codePointAt(0),g=y.codePointAt(0),x=ov(m),v=Ec(m)&&Ec(g);(Bv[m]||x||\"imageName\"in this.getSection(d-1)||h[d+1]!==void 0&&zv[g]||v&&(c??(c=kv(this.text))).has(f))&&o.push(Mc(d,p,l,o,Lv(m,g,x&&u),!1))}dn(y.codePointAt(0))||(p+=kc(y,this.getSection(d),i,n,e,a)),f+=y.length}return iy(Mc(this.length(),p,l,o,0,!0))}determineTotalWidth(e,r,i,n){let a=0,s=0;for(let o of this.graphemes()){let l=this.getSection(s);a+=kc(o,l,r,i,e,n),s++}return a}};function Vv(){return(function(t){var e={R:\"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73\",EN:\"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9\",ES:\"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2\",ET:\"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj\",AN:\"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u\",CS:\"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b\",B:\"a,3,f+2,2v,690\",S:\"9,2,k\",WS:\"c,k,4f4,1vk+a,u,1j,335\",ON:\"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i\",BN:\"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1\",NSM:\"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n\",AL:\"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d\",LRO:\"6ct\",RLO:\"6cu\",LRE:\"6cq\",RLE:\"6cr\",PDF:\"6cs\",LRI:\"6ee\",RLI:\"6ef\",FSI:\"6eg\",PDI:\"6eh\"},r={},i={};r.L=1,i[1]=\"L\",Object.keys(e).forEach(function($,at){r[$]=1<<at+1,i[r[$]]=$}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|o,u=null;function h(){if(!u){u=new Map;var $=0;for(var at in e)if(e.hasOwnProperty(at))for(var Z=e[at],k=\"\",st=void 0,Y=!1,J=0,q=0;q<=Z.length+1;q+=1){var Nt=Z[q];if(Nt!==\",\"&&q!==Z.length)Nt===\"+\"?(Y=!0,J=$=J+parseInt(k,36),k=\"\"):k+=Nt;else{Y?st=$+parseInt(k,36):(J=$=J+parseInt(k,36),st=$),Y=!1,k=\"\",J=st;for(var vt=$;vt<st+1;vt+=1)u.set(vt,r[at])}}}}function c($){return h(),u.get($.codePointAt(0))||r.L}function p($){return i[c($)]}var f={pairs:\"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1\",canonical:\"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye\"};function d($,at){var Z=0,k=new Map,st=at&&new Map,Y;return $.split(\",\").forEach(function J(q){if(q.indexOf(\"+\")!==-1)for(var Nt=+q;Nt--;)J(Y);else{Y=q;var vt=q.split(\">\"),nt=vt[0],It=vt[1];nt=String.fromCodePoint(Z+=parseInt(nt,36)),It=String.fromCodePoint(Z+=parseInt(It,36)),k.set(nt,It),at&&st.set(It,nt)}}),{map:k,reverseMap:st}}var y,m,g;function x(){if(!y){var $=d(f.pairs,!0),at=$.map,Z=$.reverseMap;y=at,m=Z,g=d(f.canonical,!1).map}}function v($){return x(),y.get($)||null}function b($){return x(),m.get($)||null}function _($){return x(),g.get($)||null}var w=r.L,D=r.R,A=r.EN,F=r.ES,L=r.ET,T=r.AN,V=r.CS,U=r.B,E=r.S,P=r.ON,z=r.BN,R=r.NSM,G=r.AL,rt=r.LRO,lt=r.RLO,pt=r.LRE,it=r.RLE,Pt=r.PDF,le=r.LRI,ye=r.RLI,Oe=r.FSI,Zt=r.PDI;function Er($,at){for(var Z=125,k=new Uint32Array($.length),st=0;st<$.length;st++)k[st]=c($[st]);var Y=new Map;function J(Yt,ue){var Xt=k[Yt];k[Yt]=ue,Y.set(Xt,Y.get(Xt)-1),Xt&s&&Y.set(s,Y.get(s)-1),Y.set(ue,(Y.get(ue)||0)+1),ue&s&&Y.set(s,(Y.get(s)||0)+1)}for(var q=new Uint8Array($.length),Nt=new Map,vt=[],nt=null,It=0;It<$.length;It++)nt||vt.push(nt={start:It,end:$.length-1,level:at===\"rtl\"?1:at===\"ltr\"?0:nh(It,!1)}),k[It]&U&&(nt.end=It,nt=null);for(var yi=it|pt|lt|rt|n|Zt|Pt|U,ar=function(Yt){return Yt+(Yt&1?1:2)},Re=function(Yt){return Yt+(Yt&1?2:1)},$e=0;$e<vt.length;$e++){nt=vt[$e];var ut=[{_level:nt.level,_override:0,_isolate:0}],bt=void 0,Ce=0,Ne=0,ns=0;Y.clear();for(var zt=nt.start;zt<=nt.end;zt++){var Lt=k[zt];if(bt=ut[ut.length-1],Y.set(Lt,(Y.get(Lt)||0)+1),Lt&s&&Y.set(s,(Y.get(s)||0)+1),Lt&yi)if(Lt&(it|pt)){q[zt]=bt._level;var Pu=(Lt===it?Re:ar)(bt._level);Pu<=Z&&!Ce&&!Ne?ut.push({_level:Pu,_override:0,_isolate:0}):Ce||Ne++}else if(Lt&(lt|rt)){q[zt]=bt._level;var Mu=(Lt===lt?Re:ar)(bt._level);Mu<=Z&&!Ce&&!Ne?ut.push({_level:Mu,_override:Lt<?D:w,_isolate:0}):Ce||Ne++}else if(Lt&n){Lt&Oe&&(Lt=nh(zt+1,!0)===1?ye:le),q[zt]=bt._level,bt._override&&J(zt,bt._override);var Bu=(Lt===ye?Re:ar)(bt._level);Bu<=Z&&Ce===0&&Ne===0?(ns++,ut.push({_level:Bu,_override:0,_isolate:1,_isolInitIndex:zt})):Ce++}else if(Lt&Zt){if(Ce>0)Ce--;else if(ns>0){for(Ne=0;!ut[ut.length-1]._isolate;)ut.pop();var as=ut[ut.length-1]._isolInitIndex;as!=null&&(Nt.set(as,zt),Nt.set(zt,as)),ut.pop(),ns--}bt=ut[ut.length-1],q[zt]=bt._level,bt._override&&J(zt,bt._override)}else Lt&Pt?(Ce===0&&(Ne>0?Ne--:!bt._isolate&&ut.length>1&&(ut.pop(),bt=ut[ut.length-1])),q[zt]=bt._level):Lt&U&&(q[zt]=nt.level);else q[zt]=bt._level,bt._override&&Lt!==z&&J(zt,bt._override)}for(var Tr=[],me=null,sr=nt.start;sr<=nt.end;sr++){var ss=k[sr];if(!(ss&o)){var zu=q[sr],Lu=ss&n,x1=ss===Zt;me&&zu===me._level?(me._end=sr,me._endsWithIsolInit=Lu):Tr.push(me={_start:sr,_end:sr,_level:zu,_startsWithPDI:x1,_endsWithIsolInit:Lu})}}for(var os=[],In=0;In<Tr.length;In++){var Tn=Tr[In];if(!Tn._startsWithPDI||Tn._startsWithPDI&&!Nt.has(Tn._start)){for(var ls=[me=Tn],Vu=void 0;me&&me._endsWithIsolInit&&(Vu=Nt.get(me._end))!=null;)for(var kn=In+1;kn<Tr.length;kn++)if(Tr[kn]._start===Vu){ls.push(me=Tr[kn]);break}for(var kr=[],us=0;us<ls.length;us++)for(var Ou=ls[us],hs=Ou._start;hs<=Ou._end;hs++)kr.push(hs);for(var v1=q[kr[0]],Ru=nt.level,Cn=kr[0]-1;Cn>=0;Cn--)if(!(k[Cn]&o)){Ru=q[Cn];break}var cs=kr[kr.length-1],b1=q[cs],$u=nt.level;if(!(k[cs]&n)){for(var Pn=cs+1;Pn<=nt.end;Pn++)if(!(k[Pn]&o)){$u=q[Pn];break}}os.push({_seqIndices:kr,_sosType:Math.max(Ru,v1)%2?D:w,_eosType:Math.max($u,b1)%2?D:w})}}for(var ps=0;ps<os.length;ps++){var fs=os[ps],j=fs._seqIndices,mi=fs._sosType,w1=fs._eosType,Cr=q[j[0]]&1?D:w;if(Y.get(R))for(var Mn=0;Mn<j.length;Mn++){var Nu=j[Mn];if(k[Nu]&R){for(var ds=mi,Bn=Mn-1;Bn>=0;Bn--)if(!(k[j[Bn]]&o)){ds=k[j[Bn]];break}J(Nu,ds&(n|Zt)?P:ds)}}if(Y.get(A))for(var zn=0;zn<j.length;zn++){var Uu=j[zn];if(k[Uu]&A)for(var Ln=zn-1;Ln>=-1;Ln--){var ju=Ln===-1?mi:k[j[Ln]];if(ju&a){ju===G&&J(Uu,T);break}}}if(Y.get(G))for(var ys=0;ys<j.length;ys++){var qu=j[ys];k[qu]&G&&J(qu,D)}if(Y.get(F)||Y.get(V))for(var gi=1;gi<j.length-1;gi++){var ms=j[gi];if(k[ms]&(F|V)){for(var Pr=0,gs=0,xs=gi-1;xs>=0&&(Pr=k[j[xs]],Pr&o);xs--);for(var vs=gi+1;vs<j.length&&(gs=k[j[vs]],gs&o);vs++);Pr===gs&&(k[ms]===F?Pr===A:Pr&(A|T))&&J(ms,Pr)}}if(Y.get(A)){for(var ge=0;ge<j.length;ge++)if(k[j[ge]]&A){for(var Vn=ge-1;Vn>=0&&k[j[Vn]]&(L|o);Vn--)J(j[Vn],A);for(ge++;ge<j.length&&k[j[ge]]&(L|o|A);ge++)k[j[ge]]!==A&&J(j[ge],A)}}if(Y.get(L)||Y.get(F)||Y.get(V))for(var xi=0;xi<j.length;xi++){var Gu=j[xi];if(k[Gu]&(L|F|V)){J(Gu,P);for(var On=xi-1;On>=0&&k[j[On]]&o;On--)J(j[On],P);for(var Rn=xi+1;Rn<j.length&&k[j[Rn]]&o;Rn++)J(j[Rn],P)}}if(Y.get(A))for(var bs=0,Yu=mi;bs<j.length;bs++){var Xu=j[bs],ws=k[Xu];ws&A?Yu===w&&J(Xu,w):ws&a&&(Yu=ws)}if(Y.get(s)){for(var vi=D|A|T,Wu=vi|w,$n=[],Mr=[],Br=0;Br<j.length;Br++)if(k[j[Br]]&s){var bi=$[j[Br]],Zu=void 0;if(v(bi)!==null)if(Mr.length<63)Mr.push({char:bi,seqIndex:Br});else break;else if((Zu=b(bi))!==null)for(var wi=Mr.length-1;wi>=0;wi--){var _s=Mr[wi].char;if(_s===Zu||_s===b(_(bi))||v(_(_s))===bi){$n.push([Mr[wi].seqIndex,Br]),Mr.length=wi;break}}}$n.sort(function(Yt,ue){return Yt[0]-ue[0]});for(var Ds=0;Ds<$n.length;Ds++){for(var Hu=$n[Ds],Nn=Hu[0],Ss=Hu[1],Ju=!1,xe=0,As=Nn+1;As<Ss;As++){var Ku=j[As];if(k[Ku]&Wu){Ju=!0;var Qu=k[Ku]&vi?D:w;if(Qu===Cr){xe=Qu;break}}}if(Ju&&!xe){xe=mi;for(var Es=Nn-1;Es>=0;Es--){var th=j[Es];if(k[th]&Wu){var eh=k[th]&vi?D:w;xe=eh===Cr?Cr:eh;break}}}if(xe){if(k[j[Nn]]=k[j[Ss]]=xe,xe!==Cr){for(var _i=Nn+1;_i<j.length;_i++)if(!(k[j[_i]]&o)){c($[j[_i]])&R&&(k[j[_i]]=xe);break}}if(xe!==Cr){for(var Di=Ss+1;Di<j.length;Di++)if(!(k[j[Di]]&o)){c($[j[Di]])&R&&(k[j[Di]]=xe);break}}}}for(var Ue=0;Ue<j.length;Ue++)if(k[j[Ue]]&s){for(var rh=Ue,Fs=Ue,Is=mi,Si=Ue-1;Si>=0;Si--)if(k[j[Si]]&o)rh=Si;else{Is=k[j[Si]]&vi?D:w;break}for(var ih=w1,Ai=Ue+1;Ai<j.length;Ai++)if(k[j[Ai]]&(s|o))Fs=Ai;else{ih=k[j[Ai]]&vi?D:w;break}for(var Ts=rh;Ts<=Fs;Ts++)k[j[Ts]]=Is===ih?Is:Cr;Ue=Fs}}}for(var Ht=nt.start;Ht<=nt.end;Ht++){var _1=q[Ht],Un=k[Ht];if(_1&1?Un&(w|A|T)&&q[Ht]++:Un&D?q[Ht]++:Un&(T|A)&&(q[Ht]+=2),Un&o&&(q[Ht]=Ht===0?nt.level:q[Ht-1]),Ht===nt.end||c($[Ht])&(E|U))for(var jn=Ht;jn>=0&&c($[jn])&l;jn--)q[jn]=nt.level}}return{levels:q,paragraphs:vt};function nh(Yt,ue){for(var Xt=Yt;Xt<$.length;Xt++){var je=k[Xt];if(je&(D|G))return 1;if(je&(U|w)||ue&&je===Zt)return 0;if(je&n){var ah=D1(Xt);Xt=ah===-1?$.length:ah}}return 0}function D1(Yt){for(var ue=1,Xt=Yt+1;Xt<$.length;Xt++){var je=k[Xt];if(je&U)break;if(je&Zt){if(--ue===0)return Xt}else je&n&&ue++}return-1}}var Fr=\"14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1\",ir;function di(){if(!ir){var $=d(Fr,!0),at=$.map;$.reverseMap.forEach(function(Z,k){at.set(k,Z)}),ir=at}}function Te($){return di(),ir.get($)||null}function $t($,at,Z,k){var st=$.length;Z=Math.max(0,Z==null?0:+Z),k=Math.min(st-1,k==null?st-1:+k);for(var Y=new Map,J=Z;J<=k;J++)if(at[J]&1){var q=Te($[J]);q!==null&&Y.set(J,q)}return Y}function ke($,at,Z,k){var st=$.length;Z=Math.max(0,Z==null?0:+Z),k=Math.min(st-1,k==null?st-1:+k);var Y=[];return at.paragraphs.forEach(function(J){var q=Math.max(Z,J.start),Nt=Math.min(k,J.end);if(q<Nt){for(var vt=at.levels.slice(q,Nt+1),nt=Nt;nt>=q&&c($[nt])&l;nt--)vt[nt]=J.level;for(var It=J.level,yi=1/0,ar=0;ar<vt.length;ar++){var Re=vt[ar];Re>It&&(It=Re),Re<yi&&(yi=Re|1)}for(var $e=It;$e>=yi;$e--)for(var ut=0;ut<vt.length;ut++)if(vt[ut]>=$e){for(var bt=ut;ut+1<vt.length&&vt[ut+1]>=$e;)ut++;ut>bt&&Y.push([bt+q,ut+q])}}}),Y}function nr($,at,Z,k){var st=Ir($,at,Z,k),Y=[].concat($);return st.forEach(function(J,q){Y[q]=(at.levels[J]&1?Te($[J]):null)||$[J]}),Y.join(\"\")}function Ir($,at,Z,k){for(var st=ke($,at,Z,k),Y=[],J=0;J<$.length;J++)Y[J]=J;return st.forEach(function(q){for(var Nt=q[0],vt=q[1],nt=Y.slice(Nt,vt+1),It=nt.length;It--;)Y[vt-It]=nt[It]}),Y}return t.closingToOpeningBracket=b,t.getBidiCharType=c,t.getBidiCharTypeName=p,t.getCanonicalBracket=_,t.getEmbeddingLevels=Er,t.getMirroredCharacter=Te,t.getMirroredCharactersMap=$t,t.getReorderSegments=ke,t.getReorderedIndices=Ir,t.getReorderedString=nr,t.openingToClosingBracket=v,Object.defineProperty(t,\"__esModule\",{value:!0}),t})({})}var du=Vv(),Ov=/[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]/,Rv=new Set([\"WS\",\"FSI\",\"LRI\",\"RLI\",\"PDI\"]),$v=new Set([\"S\",\"B\"]);function Nv(t,e,r,i){let n=[],a=r;for(let s of ll(t.slice(r,i)))n.push({index:a,text:s,level:e[a]}),a+=s.length;return n}function Uv(t,e){let r=!0;for(let i=t.length-1;i>=0;i--){let n=du.getBidiCharTypeName(t[i].text[0]);$v.has(n)?(t[i].level=e,r=!0):r&&Rv.has(n)?t[i].level=e:r=!1}}function jv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=t.slice();for(let a=r;a>=i;a--)for(let s=0;s<n.length;s++){if(n[s].level<a)continue;let o=s;for(;o+1<n.length&&n[o+1].level>=a;)o++;for(let l=s,u=o;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];s=o}return n}function qv(t){return t.level%2==0?t.text:du.getMirroredCharacter(t.text)??t.text}function Gv(t,e){return t.find(r=>e>=r.start&&e<=r.end)?.level??0}function Yv(t,e,r,i,n){let a=Nv(t,e,i,n);Uv(a,r);let s=\"\",o=[];for(let l of jv(a,r)){if(Ov.test(l.text))continue;let u=qv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Xv(t,e){let r=e.filter(a=>a>0&&a<t.length),i=[...new Set([0,...r,t.length])].sort((a,s)=>a-s),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function ny(t,e){let{levels:r,paragraphs:i}=du.getEmbeddingLevels(t);return Xv(t,e.concat(i.map(n=>n.start))).map(([n,a])=>Yv(t,r,Gv(i,n),n,a))}function Wv(t,e){return ny(t,e).map(r=>r.text)}function Zv(t,e,r){return ny(t,r).map(i=>[i.text,i.sourceIndices.map(n=>e[n]??0)])}var pl=4294967296,Bc=1/pl,zc=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf-8\"),ay=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*pl;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*pl;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,Jv(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&zc?zc.decode(this.buf.subarray(e,t)):cb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Hv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){let r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Bc),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Bc),!0),this.pos+=8}writeVarint(t){t=+t||0,t>=0&&t<128?(this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t):t>268435455||t<0?Qv(t,this):(this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=pb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Lc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Lc(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,rb,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,ib,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,sb,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,nb,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,ab,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,ob,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,lb,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,ub,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,hb,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function Jv(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Kv(t,n,e);throw Error(\"Expected varint not more than 10 bytes\")}function Kv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Qv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error(\"Given varint doesn't fit into 10 bytes\");e.realloc(10),tb(r,i,e),eb(i,e)}function tb(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function eb(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Lc(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function rb(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;s<r;s++){let o=t[s];if(o<0||n+10>a)e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;else{for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}}e.pos=n}function ib(t,e){for(let r=0;r<t.length;r++)e.writeSVarint(t[r])}function nb(t,e){for(let r=0;r<t.length;r++)e.writeFloat(t[r])}function ab(t,e){for(let r=0;r<t.length;r++)e.writeDouble(t[r])}function sb(t,e){for(let r=0;r<t.length;r++)e.writeBoolean(t[r])}function ob(t,e){for(let r=0;r<t.length;r++)e.writeFixed32(t[r])}function lb(t,e){for(let r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ub(t,e){for(let r=0;r<t.length;r++)e.writeFixed64(t[r])}function hb(t,e){for(let r=0;r<t.length;r++)e.writeSFixed64(t[r])}function cb(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function pb(t,e,r){for(let i=0,n,a;i<e.length;i++){if(n=e.charCodeAt(i),n>55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function fb(t){return typeof t?.renderWithWebGL==\"function\"}function sy(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o<i.length&&(i[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(i.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:n,h:a,fill:e/(n*a)||0}}var oy=class{constructor(t,{pixelRatio:e,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},ly=class{constructor(t,e){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(t,r,n),this.addImages(e,i,n);let{w:a,h:s}=sy(n),o=new Qt({width:a||1,height:s||1});for(let l in t){let u=t[l];if(u.isWebGLImage)continue;let h=r[l].paddedRect;Qt.copy(u.data,o,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(let l in e){let u=e[l],h=i[l].paddedRect,c=h.x+1,p=h.y+1,f=u.data.width,d=u.data.height;Qt.copy(u.data,o,{x:0,y:0},{x:c,y:p},u.data),Qt.copy(u.data,o,{x:0,y:d-1},{x:c,y:p-1},{width:f,height:1}),Qt.copy(u.data,o,{x:0,y:0},{x:c,y:p+d},{width:f,height:1}),Qt.copy(u.data,o,{x:f-1,y:0},{x:c-1,y:p},{width:1,height:d}),Qt.copy(u.data,o,{x:0,y:0},{x:c+f,y:p},{width:1,height:d})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(t,e,r){for(let i in t){let n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new oy(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(t,e){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){this.patchedUpdateVersion=t.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}}patchUpdatedImage(t,e,r){if(!t||!e||!t.needsFirstWebGLRender&&t.version===e.version)return;t.needsFirstWebGLRender=!1,t.version=e.version;let[i,n]=t.tl,a=e.userImage?.data;if(!fb(a)){r.update(e.data,void 0,{x:i,y:n});return}let{width:s,height:o}=e.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};M(\"ImagePosition\",oy),M(\"ImageAtlas\",ly);var uy=(function(t){return t[t.none=0]=\"none\",t[t.horizontal=1]=\"horizontal\",t[t.vertical=2]=\"vertical\",t[t.horizontalOnly=3]=\"horizontalOnly\",t})(uy||{});function db(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}function yb(t,e){let r=[],i=0;for(let n of e)r.push(t.substring(i,n)),i=n;return i<t.length()&&r.push(t.substring(i,t.length())),r}var Vc=/^\\p{gc=M}$/u;function mb(t){let e=[],r=0;for(;r<t.length;){if(!Vc.test(t[r])){e.push(r),r++;continue}let i=r;for(;i<t.length&&Vc.test(t[i]);)i++;let n=t[i];if(n!==void 0&&ey(n.codePointAt(0))){e.push(i);for(let a=i-1;a>=r;a--)e.push(a);r=i+1}else{for(let a=r;a<i;a++)e.push(a);r=i}}return e}function gb(t){let e=[],r=0;for(let i of t.graphemes())e.push(...Array(i.length).fill(t.sectionIndex[r])),r++;return e}function xb(t,e){let r=e.map(a=>t.toCodeUnitIndex(a)),i=oi.isParsed()?oi:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>Oc(a,t.sections,[...a].map(()=>0))):Wv(t.toString(),r).map(a=>fl([...a],t.sections,[...a].map(()=>0)));let n=gb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>Oc(a,t.sections,s)):Zv(t.text,n,r).map(([a,s])=>{let o=[...a];return fl(o,t.sections,hy(o).map(l=>s[l]??0))})}function fl(t,e,r){let i=new fu(t.join(\"\"),e,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function hy(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function Oc(t,e,r){let i=[...t],n=hy(i),a=mb(i);return fl(a.map(s=>i[s]),e,a.map(s=>r[n[s]]??0))}function ra(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=fu.fromFeature(t,n,c===2,e),m=y.determineLineBreaks(u,a,e,i,f),g=ry(y.text)?xb(y,m):yb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return Db(v,e,r,i,g,s,o,l,c,u,p,d),!db(x)&&v}function cy(t){let e=.5,r=.5;switch(t){case\"right\":case\"top-right\":case\"bottom-right\":e=1;break;case\"left\":case\"top-left\":case\"bottom-left\":e=0}switch(t){case\"bottom\":case\"bottom-right\":case\"bottom-left\":r=1;break;case\"top\":case\"top-right\":case\"top-left\":r=0}return{horizontalAlign:e,verticalAlign:r}}function vb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function py(t){switch(t){case\"top\":return 0;case\"center\":return .5;default:return 1}}function bb(t,e){return t?.rect?t:e?{rect:null,metrics:e.metrics}:null}function fy(t,e,r){return!(t===1||!e&&!An(r)||e&&(dn(r)||ty(r)))}function fa(t){return/\\p{Nd}/u.test(String.fromCodePoint(t))}function dy(t){return/\\p{Lu}/u.test(String.fromCodePoint(t))}function yy(t){let e=t.some(fa)&&t.every(i=>fa(i)||es(i)),r=t.length<=3&&t.every(i=>dy(i)||fa(i));return e||r}function my(t){return(fa(t)||dy(t))&&!ty(t)}function wb(t,e){return e?fy(2,!0,t):!li(t)||my(t)||es(t)}function _b(t,e,r){let i=!1;for(let n=0;n<t.length;n++){if(e[n])continue;let a=qr[t[n]];if(a&&(n===0||e[n-1])&&(n===t.length-1||e[n+1])){if(e[n]=!0,r[n])continue;t[n]=a,i=!0}}return i}function Rc(t,e,r){for(;e>=0&&e<t.length&&dn(t[e]);)e+=r;let i=[];for(;e>=0&&e<t.length&&!An(t[e])&&!dn(t[e]);)i.push(t[e]),e+=r;return!yy(i)&&!i.every(es)&&i.some(li)}function gy(t,e){let r=t.graphemes().slice(),i=r.map(o=>o.codePointAt(0)),n=r.map((o,l)=>{let u=t.getSection(l);return\"fontStack\"in u&&!!e[u.fontStack]?.vertical?.[o]}),a=i.map(An),s=o=>!a[o]&&!dn(i[o])&&!(\"imageName\"in t.getSection(o));for(let o=0;o<i.length;o++){if(!s(o))continue;let l=o;for(;l+1<i.length&&s(l+1);)l++;let u=i.slice(o,l+1),h=yy(u),c=u.every(es),p=c&&(Rc(i,o-1,-1)||Rc(i,l+1,1)),f=!h&&u.some(li);for(let d=o;d<=l;d++)a[d]=h&&my(i[d])||n[d]&&!p&&(c||!f&&!li(i[d]));o=l}if(n.some((o,l)=>o&&!a[l])){let o=t.text;if(t.verticalizePunctuation(e,a),t.text!==o)return gy(t,e)}return _b(r,a,n)&&(t.text=r.join(\"\"),t.cachedGraphemes=r),a}function Db(t,e,r,i,n,a,s,o,l,u,h,c){let p=0,f=0,d=0,y=0,m=o===\"right\"?1:o===\"left\"?0:.5,g=24/c,x=0;for(let _ of n){_.trim();let w=_.getMaxScale(),D={positionedGlyphs:[],lineOffset:0};t.positionedLines[x]=D;let A=D.positionedGlyphs,F=0;if(!_.length()){f+=a,++x;continue}let L=vb(i,_,g),T=l===2&&!h?gy(_,e):null,V=_.graphemes();for(let P=0;P<V.length;P++){let z=_.getSection(P),R=V[P],G=R.codePointAt(0),rt=T?T[P]:fy(l,h,G),lt=\"fontStack\"in z&&ul(R)&&!e[z.fontStack]?.default?.[R]?[...R]:[R];for(let pt of lt){let it={glyph:pt.codePointAt(0),grapheme:pt,imageName:null,x:p,y:f+-17,vertical:rt,scale:1,fontStack:\"\",sectionIndex:_.getSectionIndex(P),metrics:null,rect:null},Pt;if(\"fontStack\"in z){if(Pt=Sb(z,pt,rt,L,e,r),!Pt)continue;it.fontStack=z.fontStack}else{if(t.iconsInText=!0,z.scale*=g,Pt=Ab(z,rt,w,L,i),!Pt)continue;F=Math.max(F,Pt.imageOffset),it.imageName=z.imageName}let{rect:le,metrics:ye,baselineOffset:Oe}=Pt;if(it.y+=Oe,it.scale=z.scale,it.metrics=ye,it.rect=le,A.push(it),!rt)p+=ye.advance*z.scale+u;else{t.verticalizable=!0;let Zt=\"imageName\"in z?ye.advance:24;p+=Zt*z.scale+u}}}if(A.length!==0){let P=p-u;d=Math.max(P,d),Eb(A,0,A.length-1,m)}p=0;let U=(w-1)*24;D.lineOffset=Math.max(F,U);let E=a*w+F;f+=E,y=Math.max(E,y),++x}let{horizontalAlign:v,verticalAlign:b}=cy(s);Fb(t.positionedLines,m,v,b,d,y,a,f,n.length),t.top+=-b*f,t.bottom=t.top+f,t.left+=-v*d,t.right=t.left+d}function Sb(t,e,r,i,n,a){let s=r&&n[t.fontStack]?.vertical?.[e]?\"vertical\":\"default\",o=a[t.fontStack]?.[s]?.[e],l=n[t.fontStack]?.[s]?.[e],u=bb(o,l);if(u===null)return null;let h;if(r)h=i.verticalLineContentWidth-t.scale*24;else{let c=py(t.verticalAlign);h=(i.horizontalLineContentHeight-t.scale*24)*c}return{rect:u.rect,metrics:u.metrics,baselineOffset:h}}function Ab(t,e,r,i,n){let a=n[t.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:e?o[1]:o[0]},u;if(e)u=i.verticalLineContentWidth-o[1]*t.scale;else{let c=py(t.verticalAlign);u=(i.horizontalLineContentHeight-o[1]*t.scale)*c}let h=(e?o[0]:o[1])*t.scale-24*r;return{rect:s,metrics:l,baselineOffset:u,imageOffset:h}}function Eb(t,e,r,i){if(i===0)return;let n=t[r],a=n.metrics.advance*n.scale,s=(t[r].x+a)*i;for(let o=e;o<=r;o++)t[o].x-=s}function Fb(t,e,r,i,n,a,s,o,l){let u=(e-r)*n,h=0;h=a===s?-i*l*s+.5*s:-o*i- -17;for(let c of t)for(let p of c.positionedGlyphs)p.x+=u,p.y+=h}function Ib(t,e,r){let{horizontalAlign:i,verticalAlign:n}=cy(r),a=e[0],s=e[1],o=a-t.displaySize[0]*i,l=o+t.displaySize[0],u=s-t.displaySize[1]*n;return{image:t,top:u,bottom:u+t.displaySize[1],left:o,right:l}}function xy(t){let e=t.left,r=t.top,i=t.right-e,n=t.bottom-r,a=t.image.content[2]-t.image.content[0],s=t.image.content[3]-t.image.content[1],o=t.image.textFitWidth??\"stretchOrShrink\",l=t.image.textFitHeight??\"stretchOrShrink\",u=a/s;if(l===\"proportional\"){if(o===\"stretchOnly\"&&i/n<u||o===\"proportional\"){let h=Math.ceil(n*u);e*=h/i,i=h}}else if(o===\"proportional\"&&l===\"stretchOnly\"&&u!==0&&i/n>u){let h=Math.ceil(i/u);r*=h/n,n=h}return{x1:e,y1:r,x2:e+i,y2:r+n}}function $c(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r===\"width\"||r===\"both\"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r===\"height\"||r===\"both\"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Nc=32640;function Uc(t,e){let{expression:r}=e;if(r.kind===\"constant\")return{kind:\"constant\",layoutSize:r.evaluate(new ot(t+1))};if(r.kind===\"source\")return{kind:\"source\"};if(r.kind===\"composite\"){let{minZoom:i,maxZoom:n}=Tb(r.zoomStops,t);return{kind:\"composite\",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=kb(r),n=r.evaluate(new ot(t+1));return{kind:\"camera\",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Tb(t,e){let r=0;for(;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);let i=r;for(;i<t.length&&t[i]<e+1;)i++;return i=Math.min(t.length-1,i),{minZoom:t[r],maxZoom:t[i]}}function kb(t){return t.zoomStops.map(e=>t.evaluate(new ot(e===-1/0?t.zoomStops[1]-1:e)))}var Zr=class vy extends B{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new vy(this.x,this.y,this.angle,this.segment)}};M(\"Anchor\",Zr);function by(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;o<r/2;){let h=t[s-1],c=t[s],p=t[s+1];if(!p)return!1;let f=h.angleTo(c)-c.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:f}),u+=f;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function wy(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function _y(t,e,r){return t?3/5*e*r:0}function Dy(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Cb(t,e,r,i,n,a){let s=_y(r,n,a),o=Dy(r,i)*a,l=0,u=wy(t)/2;for(let h=0;h<t.length-1;h++){let c=t[h],p=t[h+1],f=c.dist(p);if(l+f>u){let d=(u-l)/f,y=new Zr(mr.number(c.x,p.x,d),mr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||by(t,y,o,s,e)?y:void 0}l+=f}}function Pb(t,e,r,i,n,a,s,o,l){let u=_y(i,a,s),h=Dy(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c<e/4&&(e=c+e/4);let f=a*2;return Sy(t,p?e/2*o%e:(h/2+f)*s*o%e,e,u,r,c,p,!1,l)}function Sy(t,e,r,i,n,a,s,o,l){let u=a/2,h=wy(t),c=0,p=e-r,f=[];for(let d=0;d<t.length-1;d++){let y=t[d],m=t[d+1],g=y.dist(m),x=m.angleTo(y);for(;p+r<c+g;){p+=r;let v=(p-c)/g,b=mr.number(y.x,m.x,v),_=mr.number(y.y,m.y,v);if(b>=0&&b<l&&_>=0&&_<l&&p-u>=0&&p+u<=h){let w=new Zr(b,_,x,d);w._round(),(!i||by(t,w,a,i,n))&&f.push(w)}}c+=g}return!o&&!f.length&&!s&&(f=Sy(t,c/2,r,i,n,a,s,!0,l)),f}function Mb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l<s.length-1;l++){let u=s[l],h=s[l+1];u.x<e&&h.x<e||(u.x<e?u=new B(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round():h.x<e&&(h=new B(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round()),!(u.y<r&&h.y<r)&&(u.y<r?u=new B(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round():h.y<r&&(h=new B(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round()),!(u.x>=i&&h.x>=i)&&(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function Bb(t,e,r,i,n,a){let s=jc(t,e,r,n,0);return s=jc(s,e,i,a,1),s}function jc(t,e,r,i,n){switch(e){case 1:return zb(t,r,i,n);case 2:return qc(t,r,i,n,!1);case 3:return qc(t,r,i,n,!0)}return[]}function zb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function Lb(t,e,r,i,n){let a=i===0?Vb:Ob,s=[],o=[];for(let h=0;h<t.length-1;h++){let c=t[h],p=t[h+1],f=i===0?c.x:c.y,d=i===0?p.x:p.y,y=!1;f<e?d>=e&&s.push(a(c,p,e)):f>r?d<=r&&s.push(a(c,p,r)):s.push(c),d<e&&f>=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function qc(t,e,r,i,n){let a=[];for(let s of t){let o=Lb(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Vb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new B(r,t.y+(e.y-t.y)*i)}function Ob(t,e,r){let i=(r-t.y)/(e.y-t.y);return new B(t.x+(e.x-t.x)*i,r)}function Gc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(E,P)=>E+P[1]-P[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,_=0,w=y,D=0,A=m;if(a.content&&i){let E=a.content,P=E[2]-E[0],z=E[3]-E[1];(a.textFitWidth||a.textFitHeight)&&(u=xy(t)),g=ia(h,0,E[0]),v=ia(c,0,E[1]),x=ia(h,E[0],E[2]),b=ia(c,E[1],E[3]),_=E[0]-g,D=E[1]-v,w=P-x,A=z-b}let F=u.x1,L=u.y1,T=u.x2-F,V=u.y2-L,U=(E,P,z,R)=>{let G=na(E.stretch-g,x,T,F),rt=aa(E.fixed-_,w,E.stretch,f),lt=na(P.stretch-v,b,V,L),pt=aa(P.fixed-D,A,P.stretch,d),it=na(z.stretch-g,x,T,F),Pt=aa(z.fixed-_,w,z.stretch,f),le=na(R.stretch-v,b,V,L),ye=aa(R.fixed-D,A,R.stretch,d),Oe=new B(G,lt),Zt=new B(it,lt),Er=new B(it,le),Fr=new B(G,le),ir=new B(rt/s,pt/s),di=new B(Pt/s,ye/s),Te=e*Math.PI/180;if(Te){let $=Math.sin(Te),at=Math.cos(Te),Z=[at,-$,$,at];Oe._matMult(Z),Zt._matMult(Z),Fr._matMult(Z),Er._matMult(Z)}let $t=E.stretch+E.fixed,ke=z.stretch+z.fixed,nr=P.stretch+P.fixed,Ir=R.stretch+R.fixed;return{tl:Oe,tr:Zt,bl:Fr,br:Er,tex:{x:a.paddedRect.x+1+$t,y:a.paddedRect.y+1+nr,w:ke-$t,h:Ir-nr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ir,pixelOffsetBR:di,minFontScaleX:w/s/T,minFontScaleY:A/s/V,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(U({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let E=Yc(h,y,f),P=Yc(c,m,d);for(let z=0;z<E.length-1;z++){let R=E[z],G=E[z+1];for(let rt=0;rt<P.length-1;rt++){let lt=P[rt],pt=P[rt+1];n.push(U(R,lt,G,pt))}}}return n}function ia(t,e,r){let i=0;for(let n of t)i+=Math.max(e,Math.min(r,n[1]))-Math.max(e,Math.min(r,n[0]));return i}function Yc(t,e,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of t){let s=i[i.length-1];i.push({fixed:n-s.stretch,stretch:s.stretch}),i.push({fixed:n-s.stretch,stretch:s.stretch+(a-n)})}return i.push({fixed:e+1,stretch:r}),i}function na(t,e,r,i){return t/e*r+i}function aa(t,e,r,i){return t-e*r/i}function Rb(t,e,r,i,n,a,s,o){let l=i.layout.get(\"text-rotate\").evaluate(a,{})*Math.PI/180,u=[];for(let h of e.positionedLines)for(let c of h.positionedGlyphs){if(!c.rect)continue;let p=c.rect||{},f=4,d=!0,y=1,m=0,g=(n||o)&&c.vertical,x=c.metrics.advance*c.scale/2;if(o&&e.verticalizable){let R=(c.scale-1)*24,G=(24-c.metrics.width*c.scale)/2;m=h.lineOffset/2-(c.imageName?-G:R)}if(c.imageName){let R=s[c.imageName];d=R.sdf,y=R.pixelRatio,f=1/y}let v=n?[c.x+x,c.y]:[0,0],b=n?[0,0]:[c.x+x+r[0],c.y+r[1]-m],_=[0,0];g&&(_=b,b=[0,0]);let w=c.metrics.isDoubleResolution?2:1,D=(c.metrics.left-f)*c.scale-x+b[0],A=(-c.metrics.top-f)*c.scale+b[1],F=D+p.w/w*c.scale/y,L=A+p.h/w*c.scale/y,T=new B(D,A),V=new B(F,A),U=new B(D,L),E=new B(F,L);if(g){let R=new B(-x,x- -17),G=-Math.PI/2,rt=12-x,lt=c.imageName?rt:0,pt=new B(22-rt,-lt),it=new B(..._);T._rotateAround(G,R)._add(pt)._add(it),V._rotateAround(G,R)._add(pt)._add(it),U._rotateAround(G,R)._add(pt)._add(it),E._rotateAround(G,R)._add(pt)._add(it)}if(l){let R=Math.sin(l),G=Math.cos(l),rt=[G,-R,R,G];T._matMult(rt),V._matMult(rt),U._matMult(rt),E._matMult(rt)}let P=new B(0,0),z=new B(0,0);u.push({tl:T,tr:V,bl:U,br:E,tex:p,writingMode:e.writingMode,glyphOffset:v,sectionIndex:c.sectionIndex,isSDF:d,pixelOffsetTL:P,pixelOffsetBR:z,minFontScaleX:0,minFontScaleY:0})}return u}var sa=class{constructor(t,e,r,i,n,a,s,o,l,u){if(this.boxStartIndex=t.length,l){let h=a.top,c=a.bottom,p=a.collisionPadding;p&&(h-=p[1],c+=p[3]);let f=c-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{let h=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?xy(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};h.y1=h.y1*s-o[0],h.y2=h.y2*s+o[2],h.x1=h.x1*s-o[3],h.x2=h.x2*s+o[1];let c=a.collisionPadding;if(c&&(h.x1-=c[0]*s,h.y1-=c[1]*s,h.x2+=c[2]*s,h.y2+=c[3]*s),u){let p=new B(h.x1,h.y1),f=new B(h.x2,h.y1),d=new B(h.x1,h.y2),y=new B(h.x2,h.y2),m=u*Math.PI/180;p._rotate(m),f._rotate(m),d._rotate(m),y._rotate(m),h.x1=Math.min(p.x,f.x,d.x,y.x),h.x2=Math.max(p.x,f.x,d.x,y.x),h.y1=Math.min(p.y,f.y,d.y,y.y),h.y2=Math.max(p.y,f.y,d.y,y.y)}t.emplaceBack(e.x,e.y,h.x1,h.y1,h.x2,h.y2,r,i,n)}this.boxEndIndex=t.length}},$b=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function Nb(t,e=1){let r=Fa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new $b([],Ub),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;p<l;p+=i)for(let f=o;f<u;f+=i)a.push(new Ur(p+n,f+n,n,t));let h=qb(t),c=h;for(;a.length;){let p=a.pop();(p.d>c.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new Ur(p.p.x-n,p.p.y-n,n,t)),a.push(new Ur(p.p.x+n,p.p.y-n,n,t)),a.push(new Ur(p.p.x-n,p.p.y+n,n,t)),a.push(new Ur(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Ub(t,e){return e.max-t.max}var Ur=class{constructor(t,e,r,i){this.p=new B(t,e),this.h=r,this.d=jb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function jb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,pd(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function qb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o],h=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*h,i+=(l.y+u.y)*h,e+=h*3}return new Ur(r/e,i/e,0,t)}var Gb=(function(t){return t[t.center=1]=\"center\",t[t.left=2]=\"left\",t[t.right=3]=\"right\",t[t.top=4]=\"top\",t[t.bottom=5]=\"bottom\",t[t[\"top-left\"]=6]=\"top-left\",t[t[\"top-right\"]=7]=\"top-right\",t[t[\"bottom-left\"]=8]=\"bottom-left\",t[t[\"bottom-right\"]=9]=\"bottom-right\",t})({}),yu=1/0;function Ay(t,e){function r(n,a){let s=0,o=0;a<0&&(a=0);let l=a/Math.SQRT2;switch(n){case\"top-right\":case\"top-left\":o=l-7;break;case\"bottom-right\":case\"bottom-left\":o=-l+7;break;case\"bottom\":o=-a+7;break;case\"top\":o=a-7}switch(n){case\"top-right\":case\"bottom-right\":s=-l;break;case\"top-left\":case\"bottom-left\":s=l;break;case\"left\":s=a;break;case\"right\":s=-a}return[s,o]}function i(n,a,s){let o=0,l=0;switch(a=Math.abs(a),s=Math.abs(s),n){case\"top-right\":case\"top-left\":case\"top\":l=s-7;break;case\"bottom-right\":case\"bottom-left\":case\"bottom\":l=-s+7}switch(n){case\"top-right\":case\"bottom-right\":case\"right\":o=-a;break;case\"top-left\":case\"bottom-left\":case\"left\":o=a}return[o,l]}return e[1]===yu?r(t,e[0]):i(t,e[0],e[1])}function Ey(t,e,r){let i=t.layout,n=i.get(\"text-variable-anchor-offset\")?.evaluate(e,{},r);if(n){let s=n.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],h=s[l+1].map(c=>c*24);u.startsWith(\"top\")?h[1]-=7:u.startsWith(\"bottom\")&&(h[1]+=7),o[l+1]=h}return new Ae(o)}let a=i.get(\"text-variable-anchor\");if(a){let s;s=t._unevaluatedLayout.getValue(\"text-radial-offset\")===void 0?i.get(\"text-offset\").evaluate(e,{},r).map(l=>l*24):[i.get(\"text-radial-offset\").evaluate(e,{},r)*24,yu];let o=[];for(let l of a)o.push(l,Ay(l,s));return new Ae(o)}return null}function Yb(t){var h;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=xt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n[\"icon-size\"].possiblyEvaluate(new ot(t.bucket.zoom+1),t.canonical),layoutTextSize:n[\"text-size\"].possiblyEvaluate(new ot(t.bucket.zoom+1),t.canonical),textMaxSize:n[\"text-size\"].possiblyEvaluate(new ot(18))};if(t.bucket.textSizeData.kind===\"composite\"){let{minZoom:c,maxZoom:p}=t.bucket.textSizeData;a.compositeTextSizes=[n[\"text-size\"].possiblyEvaluate(new ot(c),t.canonical),n[\"text-size\"].possiblyEvaluate(new ot(p),t.canonical)]}if(t.bucket.iconSizeData.kind===\"composite\"){let{minZoom:c,maxZoom:p}=t.bucket.iconSizeData;a.compositeIconSizes=[n[\"icon-size\"].possiblyEvaluate(new ot(c),t.canonical),n[\"icon-size\"].possiblyEvaluate(new ot(p),t.canonical)]}let s=i.get(\"text-line-height\")*24,o=i.get(\"text-rotation-alignment\")!==\"viewport\"&&i.get(\"symbol-placement\")!==\"point\",l=i.get(\"text-keep-upright\"),u=i.get(\"text-size\");for(let c of t.bucket.features){let p=i.get(\"text-font\").evaluate(c,{},t.canonical).join(\",\"),f=u.evaluate(c,{},t.canonical),d=a.layoutTextSize.evaluate(c,{},t.canonical),y=a.layoutIconSize.evaluate(c,{},t.canonical),m={horizontal:{},vertical:void 0},g=c.text,x=[0,0];if(g){let w=g.toString(),D=i.get(\"text-letter-spacing\").evaluate(c,{},t.canonical)*24,A=Cv(w)?D:0,F=i.get(\"text-anchor\").evaluate(c,{},t.canonical),L=Ey(r,c,t.canonical);if(!L){let E=i.get(\"text-radial-offset\").evaluate(c,{},t.canonical);x=E?Ay(F,[E*24,yu]):i.get(\"text-offset\").evaluate(c,{},t.canonical).map(P=>P*24)}let T=o?\"center\":i.get(\"text-justify\").evaluate(c,{},t.canonical),V=i.get(\"symbol-placement\")===\"point\"?i.get(\"text-max-width\").evaluate(c,{},t.canonical)*24:1/0,U=()=>{t.bucket.allowVerticalPlacement&&hl(w)&&(m.vertical=ra(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,F,\"left\",A,x,2,!0,d,f))};if(!o&&L){let E=new Set;if(T===\"auto\")for(let z=0;z<L.values.length;z+=2)E.add(Xc(L.values[z]));else E.add(T);let P=!1;for(let z of E)if(!m.horizontal[z])if(P)m.horizontal[z]=m.horizontal[0];else{let R=ra(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,\"center\",z,A,x,1,!1,d,f);R&&(m.horizontal[z]=R,P=R.positionedLines.length===1)}U()}else{T===\"auto\"&&(T=Xc(F));let E=ra(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,F,T,A,x,1,!1,d,f);E&&(m.horizontal[T]=E),U(),hl(w)&&o&&l&&(m.vertical=ra(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,F,T,A,x,2,!1,d,f))}}let v,b=!1;if(c.icon?.name){let w=t.imageMap[c.icon.name];w&&(v=Ib(t.imagePositions[c.icon.name],i.get(\"icon-offset\").evaluate(c,{},t.canonical),i.get(\"icon-anchor\").evaluate(c,{},t.canonical)),b=!!w.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=b:t.bucket.sdfIcons!==b&&Ct(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),w.pixelRatio===t.bucket.pixelRatio?i.get(\"icon-rotate\").constantOr(1)!==0&&(t.bucket.iconsNeedLinear=!0):t.bucket.iconsNeedLinear=!0)}let _=Fy(m.horizontal)||m.vertical;(h=t.bucket).iconsInText||(h.iconsInText=_?_.iconsInText:!1),(_||v)&&Xb(t.bucket,c,m,v,t.imageMap,a,d,y,x,b,t.canonical,t.subdivisionGranularity,t.hasPromoteId)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function Xc(t){switch(t){case\"right\":case\"top-right\":case\"bottom-right\":return\"right\";case\"left\":case\"top-left\":case\"bottom-left\":return\"left\"}return\"center\"}function Xb(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=a.textMaxSize.evaluate(e,{});f===void 0&&(f=s);let d=t.layers[0].layout,y=d.get(\"icon-offset\").evaluate(e,{},h),m=Fy(r.horizontal),g=s/24,x=t.tilePixelRatio*g,v=t.tilePixelRatio*f/24,b=t.tilePixelRatio*o,_=t.tilePixelRatio*d.get(\"symbol-spacing\"),w=d.get(\"text-padding\")*t.tilePixelRatio,D=sw(d,e,h,t.tilePixelRatio),A=d.get(\"text-max-angle\")/180*Math.PI,F=d.get(\"text-rotation-alignment\")!==\"viewport\"&&d.get(\"symbol-placement\")!==\"point\",L=d.get(\"icon-rotation-alignment\").constantOr(\"viewport\")===\"map\"&&d.get(\"symbol-placement\")!==\"point\",T=d.get(\"symbol-placement\"),V=_/2,U=d.get(\"icon-text-fit\"),E;i&&U!==\"none\"&&(t.allowVerticalPlacement&&r.vertical&&(E=$c(i,r.vertical,U,d.get(\"icon-text-fit-padding\"),y,g)),m&&(i=$c(i,m,U,d.get(\"icon-text-fit-padding\"),y,g)));let P=h?c.line.getGranularityForZoomLevel(h.z):1,z=(R,G)=>{Hl(G)||Zb(t,G,R,r,i,n,E,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,[w,w,w,w],F,l,b,D,L,y,e,a,u,h,s,p)};if(T===\"line\")for(let R of Mb(e.geometry,0,0,xt,xt)){let G=pr(R,P),rt=Pb(G,_,A,r.vertical||m,i,24,v,t.overscaling,xt);for(let lt of rt){let pt=m;(!pt||!Hb(t,pt.text,V,lt))&&z(G,lt)}}else if(T===\"line-center\"){for(let R of e.geometry)if(R.length>1){let G=pr(R,P),rt=Cb(G,A,r.vertical||m,i,24,v);rt&&z(G,rt)}}else if(e.type===\"Polygon\")for(let R of Ua(e.geometry,0)){let G=Nb(R,16);z(pr(R[0],P,!0),new Zr(G.x,G.y,0))}else if(e.type===\"LineString\")for(let R of e.geometry){let G=pr(R,P);z(G,new Zr(G[0].x,G[0].y,0))}else if(e.type===\"Point\")for(let R of e.geometry)for(let G of R)z([G],new Zr(G.x,G.y,0))}function Wb(t,e){let r=t.length,i=e?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=Gb[i[n]],s=i[n+1];t.emplaceBack(a,s[0],s[1])}return[r,t.length]}function Wc(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y){let m=Rb(e,r,o,n,a,s,i,t.allowVerticalPlacement),g=t.textSizeData,x=null;g.kind===\"source\"?(x=[128*n.layout.get(\"text-size\").evaluate(s,{})],x[0]>32640&&Ct(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):g.kind===\"composite\"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Ct(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function Fy(t){for(let e in t)return t[e];return null}function Zb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,_,w,D,A,F){let L=t.addToLineVertexArray(e,r),T=o.layout.get(\"symbol-height-offset\").evaluate(b,{},D);T>t.maxHeightOffset&&(t.maxHeightOffset=T);let V,U,E,P,z=0,R=0,G=0,rt=0,lt=-1,pt=-1,it={},Pt=(0,Ea.default)(\"\");if(t.allowVerticalPlacement&&i.vertical){let Z=o.layout.get(\"text-rotate\").evaluate(b,{},D)+90,k=i.vertical;E=new sa(l,e,u,h,c,k,p,f,d,Z),s&&(P=new sa(l,e,u,h,c,s,m,g,d,Z))}if(n){let Z=o.layout.get(\"icon-rotate\").evaluate(b,{}),k=o.layout.get(\"icon-text-fit\")!==\"none\",st=Gc(n,Z,w,k),Y=s?Gc(s,Z,w,k):void 0;U=new sa(l,e,u,h,c,n,m,g,!1,Z),z=st.length*4;let J=t.iconSizeData,q=null;J.kind===\"source\"?(q=[128*o.layout.get(\"icon-size\").evaluate(b,{})],q[0]>32640&&Ct(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):J.kind===\"composite\"&&(q=[128*_.compositeIconSizes[0].evaluate(b,{},D),128*_.compositeIconSizes[1].evaluate(b,{},D)],(q[0]>32640||q[1]>32640)&&Ct(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),t.addSymbols(t.icon,st,q,v,x,b,0,e,L.lineStartIndex,L.lineLength,-1,D,T),lt=t.icon.placedSymbolArray.length-1,Y&&(R=Y.length*4,t.addSymbols(t.icon,Y,q,v,x,b,2,e,L.lineStartIndex,L.lineLength,-1,D,T),pt=t.icon.placedSymbolArray.length-1)}let le=Object.keys(i.horizontal);for(let Z of le){let k=i.horizontal[Z];V||(V=(Pt=(0,Ea.default)(k.text),new sa(l,e,u,h,c,k,p,f,d,o.layout.get(\"text-rotate\").evaluate(b,{},D))));let st=k.positionedLines.length===1;if(G+=Wc(t,e,k,a,o,d,b,y,T,L,i.vertical?1:3,st?le:[Z],it,lt,_,D),st)break}i.vertical&&(rt+=Wc(t,e,i.vertical,a,o,d,b,y,T,L,2,[\"vertical\"],it,pt,_,D));let ye=V?V.boxStartIndex:t.collisionBoxArray.length,Oe=V?V.boxEndIndex:t.collisionBoxArray.length,Zt=E?E.boxStartIndex:t.collisionBoxArray.length,Er=E?E.boxEndIndex:t.collisionBoxArray.length,Fr=U?U.boxStartIndex:t.collisionBoxArray.length,ir=U?U.boxEndIndex:t.collisionBoxArray.length,di=P?P.boxStartIndex:t.collisionBoxArray.length,Te=P?P.boxEndIndex:t.collisionBoxArray.length,$t=-1,ke=(Z,k)=>Z?.circleDiameter?Math.max(Z.circleDiameter,k):k;$t=ke(V,$t),$t=ke(E,$t),$t=ke(U,$t),$t=ke(P,$t);let nr=+($t>-1);nr&&($t*=A/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Ct(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Ir=Ey(o,b,D),[$,at]=Wb(t.textAnchorOffsets,Ir);F&&(Pt=Jb(Pt,b)),t.symbolInstances.emplaceBack(e.x,e.y,it.right>=0?it.right:-1,it.center>=0?it.center:-1,it.left>=0?it.left:-1,it.vertical||-1,lt,pt,Pt,ye,Oe,Zt,Er,Fr,ir,di,Te,u,G,rt,z,R,nr,0,p,$t,$,at,T)}function Hb(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])<r)return!0}return n[e].push(i),!1}function Jb(t,e){return e.id==null||e.properties?.cluster?t:(0,Ea.default)(String(e.id),t)}function Zc(t,e,r){let i=\"never\",n=t.get(e);return n?i=n:t.get(r)&&(i=\"always\"),i}var Kb=[{name:\"a_fade_opacity\",components:1,type:\"Uint8\",offset:0}];function oa(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=o?Math.min(Nc,Math.round(o[0])):0,y=o?Math.min(Nc,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(i*32),Math.round(n*32),a,s,(d<<1)+ +!!l,y,u*16,h*16,c*256,p*256,f)}function Qb(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function tw(t){for(let e of t.sections)if(ry(e.text))return!0;return!1}var dl=class{constructor(t){this.layoutVertexArray=new gg,this.indexArray=new _n,this.programConfigurations=t,this.segments=new re,this.dynamicLayoutVertexArray=new xg,this.opacityVertexArray=new vg,this.hasVisibleVertices=!1,this.placedSymbolArray=new Jf}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,rv.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,iv.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Kb,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};M(\"SymbolBuffers\",dl);var yl=class{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new re,this.collisionVertexArray=new bg}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,nv.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};M(\"CollisionBuffers\",yl);var Iy=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Uc(this.zoom,e[\"text-size\"]),this.iconSizeData=Uc(this.zoom,e[\"icon-size\"]);let r=this.layers[0].layout,i=r.get(\"symbol-sort-key\"),n=r.get(\"symbol-z-order\");this.canOverlap=Zc(r,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||Zc(r,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||r.get(\"text-ignore-placement\")||r.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=n!==\"viewport-y\"&&!i.isConstant();let a=n===\"viewport-y\"||n===\"auto\"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get(\"symbol-placement\")===\"point\"&&(this.writingModes=r.get(\"text-writing-mode\").map(s=>uy[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new dl(new vr(this.layers,this.zoom,t=>t.startsWith(\"text\"))),this.icon=new dl(new vr(this.layers,this.zoom,t=>t.startsWith(\"icon\"))),this.glyphOffsetArray=new td,this.lineVertexArray=new ed,this.symbolInstances=new Qf,this.textAnchorOffsets=new id}calculateGlyphDependencies(t,e,r,i){var s;let n=fu.fromFeature(t,r,!1),a=n.graphemes();for(let o=0;o<a.length;o++){let l=n.getSection(o);if(\"imageName\"in l)continue;e[s=l.fontStack]||(e[s]={default:{},vertical:{}});let u=e[l.fontStack],h=a[o],c=i&&wb(h.codePointAt(0),this.allowVerticalPlacement);ul(h)&&(u.default[h]=!0),c&&(u.vertical[h]=!0);for(let p of h){if(u.default[p]=!0,!i)continue;c&&ul(h)&&(u.vertical[p]=!0);let f=qr[p];f&&(u.default[f]=!0)}}}populate(t,e,r){let i=this.layers[0],n=i.layout,a=n.get(\"text-font\"),s=n.get(\"text-field\"),o=n.get(\"icon-image\"),l=(s.value.kind!==\"constant\"||s.value.value instanceof Le&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!==\"constant\"||a.value.value.length>0),u=o.value.kind!==\"constant\"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get(\"symbol-sort-key\"),c=n.get(\"symbol-placement\")===\"point\";if(this.features=[],!l&&!u)return;let p=e.iconDependencies,f=e.glyphDependencies,d=e.availableImages,y=new ot(this.zoom),m=n.get(\"text-keep-upright\");for(let{feature:g,id:x,index:v,sourceLayerIndex:b}of t){let _=i._featureFilter.needGeometry,w=ci(g,_);if(!i._featureFilter.filter(y,w,r)||(_||(w.geometry=Dr(g)),c&&g.type===1&&ew(w.geometry)))continue;let D;if(l){let T=i.getValueAndResolveTokens(\"text-field\",w,r,d),V=Le.factory(T);this.hasRTLText||(this.hasRTLText=tw(V)),D=Fv(V,i,w)}let A;if(u){let T=i.getValueAndResolveTokens(\"icon-image\",w,r,d);A=T instanceof Ee?T:Ee.fromString(T)}if(!D&&!A)continue;let F=this.sortFeaturesByKey?h.evaluate(w,{},r):void 0,L={id:x,text:D,icon:A,index:v,sourceLayerIndex:b,geometry:w.geometry,properties:g.properties,type:Dn.types[g.type],sortKey:F};if(this.features.push(L),A&&(p[A.name]=!0),D){let T=a.evaluate(w,{},r).join(\",\"),V=n.get(\"text-rotation-alignment\")!==\"viewport\"&&n.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=this.writingModes?.includes(2);let U=(V&&m||this.allowVerticalPlacement)&&hl(D.toString());this.calculateGlyphDependencies(D,f,T,U);for(let E of D.sections)E.image&&(p[E.image.name]=!0)}}n.get(\"symbol-placement\")===\"line\"&&(this.features=Tv(this.features)),this.sortFeaturesByKey&&this.features.sort((g,x)=>g.sortKey-x.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Yb({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity,hasPromoteId:t.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s<e.length;s++)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(let s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s<e.length;s++){let o=a[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=t.indexArray,d=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let b=0;b<e.length;b++){let{tl:_,tr:w,bl:D,br:A,tex:F,pixelOffsetTL:L,pixelOffsetBR:T,minFontScaleX:V,minFontScaleY:U,glyphOffset:E,isSDF:P,sectionIndex:z}=e[b],R=y.vertexLength,G=E[1];oa(d,o.x,o.y,_.x,G+_.y,F.x,F.y,r,P,L.x,L.y,V,U,p),oa(d,o.x,o.y,w.x,G+w.y,F.x+F.w,F.y,r,P,T.x,L.y,V,U,p),oa(d,o.x,o.y,D.x,G+D.y,F.x,F.y+F.h,r,P,L.x,T.y,V,U,p),oa(d,o.x,o.y,A.x,G+A.y,F.x+F.w,F.y+F.h,r,P,T.x,T.y,V,U,p),Qb(t.dynamicLayoutVertexArray,o,x),f.emplaceBack(R,R+2,R+1),f.emplaceBack(R+1,R+2,R+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),(b===e.length-1||z!==e[b+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:c,formattedSection:v?.[z]})}t.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,h,p)}_addCollisionDebugVertex(t,e,r,i,n,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,h=n.collisionVertexArray,c=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,c,p,new B(t,e)),this._addCollisionDebugVertex(u,h,a,c,p,new B(r,e)),this._addCollisionDebugVertex(u,h,a,c,p,new B(r,i)),this._addCollisionDebugVertex(u,h,a,c,p,new B(t,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,i){for(let n=t;n<e;n++){let a=this.collisionBoxArray.get(n),s=a.x1,o=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(s,o,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yl(jh,Ac.members,Ro),this.iconCollisionBox=new yl(jh,Ac.members,Ro);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,i,n,a,s,o,l){let u={};for(let h=e;h<r;h++){let c=t.get(h);u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}for(let h=i;h<n;h++){let c=t.get(h);u.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalTextFeatureIndex=c.featureIndex;break}for(let h=a;h<s;h++){let c=t.get(h);u.iconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.iconFeatureIndex=c.featureIndex;break}for(let h=o;h<l;h++){let c=t.get(h);u.verticalIconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalIconFeatureIndex=c.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let e=Math.sin(t),r=Math.cos(t),i=[],n=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let o=this.symbolInstances.get(s);i.push(Math.round(e*o.anchorX+r*o.anchorY)|0),n.push(o.featureIndex)}return a.sort((s,o)=>i[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function ew(t){return t.every(e=>e.every(Hl))}M(\"SymbolBucket\",Iy,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]});function rw(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):\"\")}var Hc,iw=()=>Hc||(Hc=new Gt({\"symbol-placement\":new O(S.layout_symbol[\"symbol-placement\"],\"symbol-placement\"),\"symbol-spacing\":new O(S.layout_symbol[\"symbol-spacing\"],\"symbol-spacing\"),\"symbol-avoid-edges\":new O(S.layout_symbol[\"symbol-avoid-edges\"],\"symbol-avoid-edges\"),\"symbol-sort-key\":new N(S.layout_symbol[\"symbol-sort-key\"],\"symbol-sort-key\"),\"symbol-z-order\":new O(S.layout_symbol[\"symbol-z-order\"],\"symbol-z-order\"),\"icon-allow-overlap\":new O(S.layout_symbol[\"icon-allow-overlap\"],\"icon-allow-overlap\"),\"icon-overlap\":new O(S.layout_symbol[\"icon-overlap\"],\"icon-overlap\"),\"icon-ignore-placement\":new O(S.layout_symbol[\"icon-ignore-placement\"],\"icon-ignore-placement\"),\"icon-optional\":new O(S.layout_symbol[\"icon-optional\"],\"icon-optional\"),\"icon-rotation-alignment\":new N(S.layout_symbol[\"icon-rotation-alignment\"],\"icon-rotation-alignment\"),\"icon-size\":new N(S.layout_symbol[\"icon-size\"],\"icon-size\"),\"icon-text-fit\":new O(S.layout_symbol[\"icon-text-fit\"],\"icon-text-fit\"),\"icon-text-fit-padding\":new O(S.layout_symbol[\"icon-text-fit-padding\"],\"icon-text-fit-padding\"),\"icon-image\":new N(S.layout_symbol[\"icon-image\"],\"icon-image\"),\"icon-rotate\":new N(S.layout_symbol[\"icon-rotate\"],\"icon-rotate\"),\"icon-padding\":new N(S.layout_symbol[\"icon-padding\"],\"icon-padding\"),\"icon-keep-upright\":new O(S.layout_symbol[\"icon-keep-upright\"],\"icon-keep-upright\"),\"icon-offset\":new N(S.layout_symbol[\"icon-offset\"],\"icon-offset\"),\"icon-anchor\":new N(S.layout_symbol[\"icon-anchor\"],\"icon-anchor\"),\"icon-pitch-alignment\":new O(S.layout_symbol[\"icon-pitch-alignment\"],\"icon-pitch-alignment\"),\"text-pitch-alignment\":new O(S.layout_symbol[\"text-pitch-alignment\"],\"text-pitch-alignment\"),\"text-rotation-alignment\":new O(S.layout_symbol[\"text-rotation-alignment\"],\"text-rotation-alignment\"),\"text-field\":new N(S.layout_symbol[\"text-field\"],\"text-field\"),\"text-font\":new N(S.layout_symbol[\"text-font\"],\"text-font\"),\"text-size\":new N(S.layout_symbol[\"text-size\"],\"text-size\"),\"text-max-width\":new N(S.layout_symbol[\"text-max-width\"],\"text-max-width\"),\"text-line-height\":new O(S.layout_symbol[\"text-line-height\"],\"text-line-height\"),\"text-letter-spacing\":new N(S.layout_symbol[\"text-letter-spacing\"],\"text-letter-spacing\"),\"text-justify\":new N(S.layout_symbol[\"text-justify\"],\"text-justify\"),\"text-radial-offset\":new N(S.layout_symbol[\"text-radial-offset\"],\"text-radial-offset\"),\"text-variable-anchor\":new O(S.layout_symbol[\"text-variable-anchor\"],\"text-variable-anchor\"),\"text-variable-anchor-offset\":new N(S.layout_symbol[\"text-variable-anchor-offset\"],\"text-variable-anchor-offset\"),\"text-anchor\":new N(S.layout_symbol[\"text-anchor\"],\"text-anchor\"),\"text-max-angle\":new O(S.layout_symbol[\"text-max-angle\"],\"text-max-angle\"),\"text-writing-mode\":new O(S.layout_symbol[\"text-writing-mode\"],\"text-writing-mode\"),\"text-rotate\":new N(S.layout_symbol[\"text-rotate\"],\"text-rotate\"),\"text-padding\":new O(S.layout_symbol[\"text-padding\"],\"text-padding\"),\"text-keep-upright\":new O(S.layout_symbol[\"text-keep-upright\"],\"text-keep-upright\"),\"text-transform\":new N(S.layout_symbol[\"text-transform\"],\"text-transform\"),\"text-offset\":new N(S.layout_symbol[\"text-offset\"],\"text-offset\"),\"text-allow-overlap\":new O(S.layout_symbol[\"text-allow-overlap\"],\"text-allow-overlap\"),\"text-overlap\":new O(S.layout_symbol[\"text-overlap\"],\"text-overlap\"),\"text-ignore-placement\":new O(S.layout_symbol[\"text-ignore-placement\"],\"text-ignore-placement\"),\"text-optional\":new O(S.layout_symbol[\"text-optional\"],\"text-optional\"),\"symbol-height-offset\":new N(S.layout_symbol[\"symbol-height-offset\"],\"symbol-height-offset\"),\"symbol-height-anchor\":new O(S.layout_symbol[\"symbol-height-anchor\"],\"symbol-height-anchor\")})),Jc,nw=()=>Jc||(Jc=new Gt({\"icon-opacity\":new N(S.paint_symbol[\"icon-opacity\"],\"icon-opacity\"),\"icon-color\":new N(S.paint_symbol[\"icon-color\"],\"icon-color\"),\"icon-halo-color\":new N(S.paint_symbol[\"icon-halo-color\"],\"icon-halo-color\"),\"icon-halo-width\":new N(S.paint_symbol[\"icon-halo-width\"],\"icon-halo-width\"),\"icon-halo-blur\":new N(S.paint_symbol[\"icon-halo-blur\"],\"icon-halo-blur\"),\"icon-translate\":new O(S.paint_symbol[\"icon-translate\"],\"icon-translate\"),\"icon-translate-anchor\":new O(S.paint_symbol[\"icon-translate-anchor\"],\"icon-translate-anchor\"),\"text-opacity\":new N(S.paint_symbol[\"text-opacity\"],\"text-opacity\"),\"text-color\":new N(S.paint_symbol[\"text-color\"],\"text-color\",{runtimeType:pe,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),\"text-halo-color\":new N(S.paint_symbol[\"text-halo-color\"],\"text-halo-color\"),\"text-halo-width\":new N(S.paint_symbol[\"text-halo-width\"],\"text-halo-width\"),\"text-halo-blur\":new N(S.paint_symbol[\"text-halo-blur\"],\"text-halo-blur\"),\"text-translate\":new O(S.paint_symbol[\"text-translate\"],\"text-translate\"),\"text-translate-anchor\":new O(S.paint_symbol[\"text-translate-anchor\"],\"text-translate-anchor\")})),to={get paint(){return nw()},get layout(){return iw()}},Ty=class{constructor(t){if(t.property.overrides===void 0)throw Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=t.property.overrides?t.property.overrides.runtimeType:yn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e?.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};M(\"FormatSectionOverride\",Ty,{omit:[\"defaultValue\"]});var aw=class ml extends de{constructor(e,r){super(e,to,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get(\"icon-rotation-alignment\");if((i.value.kind!==\"constant\"||i.value.value===\"auto\")&&(this.layout._values[\"icon-rotation-alignment\"]=new se(i.property,{kind:\"constant\",value:this.layout.get(\"symbol-placement\")===\"point\"?\"viewport\":\"map\"},i.parameters)),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout.get(\"symbol-placement\")===\"point\"?this.layout._values[\"text-rotation-alignment\"]=\"viewport\":this.layout._values[\"text-rotation-alignment\"]=\"map\"),this.layout.get(\"text-pitch-alignment\")===\"auto\"&&(this.layout._values[\"text-pitch-alignment\"]=this.layout.get(\"text-rotation-alignment\")===\"map\"?\"map\":\"viewport\"),this.layout.get(\"icon-pitch-alignment\")===\"auto\"&&(this.layout._values[\"icon-pitch-alignment\"]=this.layout.get(\"icon-rotation-alignment\").constantOr(\"viewport\")),this.layout.get(\"symbol-placement\")===\"point\"){let n=this.layout.get(\"text-writing-mode\");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values[\"text-writing-mode\"]=a}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!Xa(s.value)&&a?rw(r.properties,a):a}createBucket(e){return new Iy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let e of to.paint.overridableProperties){if(!ml.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new $l(new Ty(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind===\"constant\"||r.value.kind===\"source\"?new en(\"source\",i):new _a(\"composite\",i,r.value.zoomStops),this.paint._values[e]=new se(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ml.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get(\"text-field\"),n=to.paint.properties[r],a=!1,s=o=>{for(let l of o)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind===\"constant\"&&i.value.value instanceof Le)s(i.value.value.sections);else if(i.value.kind===\"source\"||i.value.kind===\"composite\"){let o=u=>{if(!a)if(u instanceof ei&&St(u.value)===mn){let h=u.value;s(h.sections)}else u instanceof Vp?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function sw(t,e,r,i=1){let n=t.get(\"icon-padding\").evaluate(e,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Kc,ow=()=>Kc||(Kc=new Gt({\"background-color\":new O(S.paint_background[\"background-color\"],\"background-color\"),\"background-pattern\":new Xf(S.paint_background[\"background-pattern\"],\"background-pattern\"),\"background-opacity\":new O(S.paint_background[\"background-opacity\"],\"background-opacity\")})),lw={get paint(){return ow()}},uw=class extends de{constructor(t,e){super(t,lw,e)}},Qc,hw=()=>Qc||(Qc=new Gt({\"raster-opacity\":new O(S.paint_raster[\"raster-opacity\"],\"raster-opacity\"),\"raster-hue-rotate\":new O(S.paint_raster[\"raster-hue-rotate\"],\"raster-hue-rotate\"),\"raster-brightness-min\":new O(S.paint_raster[\"raster-brightness-min\"],\"raster-brightness-min\"),\"raster-brightness-max\":new O(S.paint_raster[\"raster-brightness-max\"],\"raster-brightness-max\"),\"raster-saturation\":new O(S.paint_raster[\"raster-saturation\"],\"raster-saturation\"),\"raster-contrast\":new O(S.paint_raster[\"raster-contrast\"],\"raster-contrast\"),resampling:new O(S.paint_raster.resampling,\"resampling\"),\"raster-resampling\":new O(S.paint_raster[\"raster-resampling\"],\"raster-resampling\"),\"raster-fade-duration\":new O(S.paint_raster[\"raster-fade-duration\"],\"raster-fade-duration\")})),cw={get paint(){return hw()}},pw=class extends de{constructor(t,e){super(t,cw,e)}},fw=class extends de{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(\"Custom layers cannot be serialized\")}};function dw(t,e){if(t.type===\"custom\")return new fw(t,e);switch(t.type){case\"background\":return new uw(t,e);case\"circle\":return new Xg(t,e);case\"color-relief\":return new ix(t,e);case\"fill\":return new zx(t,e);case\"fill-extrusion\":return new r2(t,e);case\"heatmap\":return new Jg(t,e);case\"hillshade\":return new tx(t,e);case\"line\":return new ev(t,e);case\"raster\":return new pw(t,e);case\"symbol\":return new aw(t,e)}}var yw=class{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,\"id\"in t&&(typeof t.id==\"string\"?this.id=parseInt(t.id,10):typeof t.id==\"number\"&&!isNaN(t.id)&&(this.id=t.id))}loadGeometry(){let t=[],e=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of e){let i=[];for(let n of r)i.push(new B(n[0],n[1]));t.push(i)}return t}},gl=\"_geojsonTileLayer\",mw=class{constructor(t,e){this.layers={[gl]:this},this.name=gl,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new yw(this.features[t],this.extent)}};function ky(t,e=\"\"){let r=new Hv;return gw(t,r,e),r.finish()}function gw(t,e,r=\"\"){for(let i in t.layers)e.writeMessage(3,(n,a)=>xw(n,a,r),t.layers[i])}function xw(t,e,r=\"\"){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||\"\"),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s<t.length;s++)i.feature=t.feature(s),e.writeMessage(2,vw,i);let n=i.keys;for(let s of n)e.writeStringField(3,s);let a=i.values;for(let s of a)e.writeMessage(4,_w,s)}function vw(t,e){if(!t.feature)return;let r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,bw,t),e.writeVarintField(3,r.type),e.writeMessage(4,ww,r)}function bw(t,e){for(let r in t.feature?.properties){let i=t.feature.properties[r],n=t.keycache[r];if(i==null)continue;n===void 0&&(t.keys.push(r),n=t.keys.length-1,t.keycache[r]=n),e.writeVarint(n),typeof i!=\"string\"&&typeof i!=\"boolean\"&&typeof i!=\"number\"&&(i=t.jsonPrefix+JSON.stringify(i));let a=typeof i+\":\"+i,s=t.valuecache[a];s===void 0&&(t.values.push(i),s=t.values.length-1,t.valuecache[a]=s),e.writeVarint(s)}}function eo(t,e){return(e<<3)+(t&7)}function tp(t){return t<<1^t>>31}function ww(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(eo(1,o));let l=s[s.length-1],u=i===3&&s.length>1&&l.x===s[0].x&&l.y===s[0].y?s.length-1:s.length;for(let h=0;h<u;h++){h===1&&i!==1&&e.writeVarint(eo(2,u-1));let c=s[h].x-n,p=s[h].y-a;e.writeVarint(tp(c)),e.writeVarint(tp(p)),n+=c,a+=p}t.type===3&&e.writeVarint(eo(7,1))}}function _w(t,e){let r=typeof t;r===\"string\"?e.writeStringField(1,t):r===\"boolean\"?e.writeBooleanField(7,t):r===\"number\"&&(t%1==0?t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t):e.writeDoubleField(3,t))}var Cy=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},tr,Dw=(tr=class{constructor(e,r,i,n,a,s){this.type=\"Feature\",this._vectorTileFeature=e,this._x=i,this._y=n,this._z=r,s!==Ux&&tr.worldCoordinateHelpers.set(this,s);for(let o in e.properties)typeof e.properties[o]==\"string\"&&e.properties[o].startsWith(\"__$json__:\")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,i,n,a){if(a){let s=a.lngLatFromWorld((e.x+r)/n,(e.y+i)/n);return[s.lng,s.lat]}return[(e.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+i)*2/n)*Math.PI))-90]}projectLine(e,r,i,n,a){return e.map(s=>this.projectPoint(s,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=tr.worldCoordinateHelpers.get(this),i=e.extent*2**this._z,n=e.extent*this._x,a=e.extent*this._y,s=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let u of s)o.push(u[0]);let l=this.projectLine(o,n,a,i,r);this._geometry=o.length===1?{type:\"Point\",coordinates:l[0]}:{type:\"MultiPoint\",coordinates:l};break}case 2:{let o=s.map(l=>this.projectLine(l,n,a,i,r));this._geometry=o.length===1?{type:\"LineString\",coordinates:o[0]}:{type:\"MultiLineString\",coordinates:o};break}case 3:{let o=Id(s),l=[];for(let u of o)l.push(u.map(h=>this.projectLine(h,n,a,i,r)));this._geometry=l.length===1?{type:\"Polygon\",coordinates:l[0]}:{type:\"MultiPolygon\",coordinates:l};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!==\"_geometry\"&&r!==\"_vectorTileFeature\"&&r!==\"_x\"&&r!==\"_y\"&&r!==\"_z\"&&(e[r]=this[r]);return e}},tr.worldCoordinateHelpers=new WeakMap,tr),Sr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r==\"number\"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},rs=class extends Sr{},mu=class extends rs{getValueFromBuffer(t){return this.dataBuffer[t]}},gu=class extends rs{getValueFromBuffer(t){return this.dataBuffer[t]}},Py=class extends Sr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},xu=class extends Py{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},vu=class extends Sr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},Sw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error(\"Missing layer name\")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let s=this.idVector.getValue(r);s!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let n={coordinates:e[r],type:this.geometryVector.geometryType(r)},a={};for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(r);l!==null&&(a[o]=l)}t.push({id:i,geometry:n,properties:a})}return t}containsMaxSafeIntegerValues(t){return t instanceof mu||t instanceof vu||t instanceof xu||t instanceof gu}},Ui={FEATURE:0,VERTEX:1},et={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},Qe={GEOMETRY:0,STRUCT:1,MAP:2},My={ID:0},By=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}},W;(function(t){t.NONE=\"NONE\",t.DELTA=\"DELTA\",t.COMPONENTWISE_DELTA=\"COMPONENTWISE_DELTA\",t.RLE=\"RLE\",t.MORTON=\"MORTON\"})(W||(W={}));var ee;(function(t){t.NONE=\"NONE\",t.FAST_PFOR=\"FAST_PFOR\",t.VARINT=\"VARINT\"})(ee||(ee={}));var bu=new Uint32Array(33);bu[0]=0;for(let t=1;t<=32;t++)bu[t]=t===32?4294967295:4294967295>>>32-t;var xl=bu,wu=65536;function _u(t,e){return t-t%e}function Aw(t){return _u(t+31,32)}function zy(t){if(!Number.isFinite(t)||t<=0)return wu;let e=_u(Math.floor(t),256);return e===0?256:e}function Ew(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Pw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function zw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Lw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Vw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Ow(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Nw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Uw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function jw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function qw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function Gw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Yw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Xw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function Ww(t,e,r,i,n){let a=xl[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<<p)&a;r[u+c]=m|0,o=d}u+=32,o=0,h<7&&(l=t[s]>>>0)}}var vl=zy(wu),Zw=3*vl/256+vl|0;function Ly(){let t=new Uint8Array(Zw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Hw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:Ly()}}function Jw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Kw(t,e,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let o=0;o<a;o=o+1|0){let l=t[e+o|0]|0,u=o<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length<a)&&(o=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u<s;u=u+1|0)n[l+u|0]=o>>>(u<<3)&255}return n}function Qw(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=Aw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)u3(t,e,u,h,a),e=e+a|0;let c=h-s|0;e=e-(c*a>>>5)|0,r.exceptionSizes[a]=s}return e}function t3(t,e,r,i,n){switch(n){case 1:Rw(t,e,r,i);break;case 2:$w(t,e,r,i);break;case 3:Nw(t,e,r,i);break;case 4:Uw(t,e,r,i);break;case 5:jw(t,e,r,i);break;case 6:qw(t,e,r,i);break;case 7:Gw(t,e,r,i);break;case 8:Yw(t,e,r,i);break;case 16:Xw(t,e,r,i);break;default:Ww(t,e,r,i,n)}return e+(n<<3)|0}function e3(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function r3(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function i3(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=r3(n,a,s,r,i,l);if(s=c,h===1){let m=1<<r;for(let g=0;g<i;g=g+1|0){let x=n[s++];t[x+e|0]|=m}return s}let p=o.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=f[h]|0,y=o.exceptionSizes[h]|0;if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m<i;m=m+1|0){let g=n[s++],x=p[d++]|0;t[g+e|0]|=x<<r}return f[h]=d,s}function n3(t,e,r,i,n,a,s,o,l,u){let h=r|0,c=0;for(let p=0;p<s;p=p+1|0){let f=e3(o,l,c,p);c=f.bytePosIn;let d=f.bitWidth,y=f.exceptionCount,m=a+p*256|0;switch(d){case 0:n.fill(0,m,m+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[m+g|0]=t[h+g|0]|0;h=h+256|0;break;default:h=t3(t,h,n,m,d)}y>0&&(c=i3(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function a3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Kw(t,p,h,a),y=h,m=Qw(t,f,a);return a.dataPointers.fill(0),n3(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function s3(t,e,r,i,n,a){let s=i+_u(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(vl,s-o);l=a3(t,e,l,o,u,a),o=o+u|0}return l}function o3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o<l&&h<c;){let d=t[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<<f,d&128)i[h++]=p|0,p=0,f=0;else if(f+=7,f>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function l3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r??Ly();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=s3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return o3(t,i,o,a,n,l),a}function u3(t,e,r,i,n){switch(n){case 2:Fw(t,e,r,i);return;case 3:Iw(t,e,r,i);return;case 4:Tw(t,e,r,i);return;case 5:kw(t,e,r,i);return;case 6:Cw(t,e,r,i);return;case 7:Pw(t,e,r,i);return;case 8:Mw(t,e,r,i);return;case 9:Bw(t,e,r,i);return;case 10:zw(t,e,r,i);return;case 11:Lw(t,e,r,i);return;case 12:Vw(t,e,r,i);return;case 16:Ow(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=xl[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=xl[n-h]>>>0,f=(c|(l&p)<<h)&a;r[i+u]=f|0,o=n-h}}function h3(t,e,r,i){if(e<0||r<0||e+r>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let o=t.byteOffset+e;if(o&3)for(let l=0;l<n;l++){let u=e+l*4;i[l]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]}else{let l=new Uint32Array(t.buffer,o,n);for(let u=0;u<n;u++)i[u]=Ew(l[u])|0}}if(a){let o=e+n*4,l=r-n*4,u=0;for(let h=0;h<l;h++)u|=t[o+h]<<24-h*8;i[n]=u|0}return s}function Rt(t,e,r){let i=new Uint32Array(r),n=0,a=e.get();for(let s=0;s<i.length;s++){let o=t[a++],l=o&127;o<128||(o=t[a++],l|=(o&127)<<7,o<128||(o=t[a++],l|=(o&127)<<14,o<128||(o=t[a++],l|=(o&127)<<21,o<128||(o=t[a++],l|=(o&15)<<28)))),i[n++]=l}return e.set(a),i}function Du(t,e,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=c3(t,e);return i}function c3(t,e){let r=0n,i=0,n=e.get();for(;n<t.length;){let a=t[n++];if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error(\"Varint too long\")}return e.set(n),r}function p3(t,e,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=f3(t,e);return i}function f3(t,e){let r,i;return i=t[e.get()],e.increment(),r=i&127,i<128||(i=t[e.get()],e.increment(),r|=(i&127)<<7,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<14,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<21,i<128)?r:(i=t[e.get()],r|=(i&15)<<28,d3(r,t,e))}function d3(t,e,r){let i,n;if(n=e[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error(\"Expected varint not more than 10 bytes\")}function y3(t,e,r,i){return m3(t,e,r,i,Hw(r>>>2))}function m3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Jw(n,s);h3(t,a,r,o);let l=l3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function tt(t){return t>>>1^-(t&1)}function Ot(t){return t>>1n^-(t&1n)}function Xe(t){return t%2==1?(t+1)/-2:t/2}function g3(t){let e=new Int32Array(t.length);for(let r=0;r<t.length;r++)e[r]=tt(t[r]);return e}function x3(t){let e=new BigInt64Array(t.length);for(let r=0;r<t.length;r++)e[r]=Ot(t[r]);return e}function v3(t){for(let e=0;e<t.length;e++)t[e]=Xe(t[e])}function bl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function wl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function Vy(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function ep(t){let e=new Int32Array(t.length);e[0]=tt(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-1],e[i+1]=tt(a)+e[i],e[i+2]=tt(s)+e[i+1],e[i+3]=tt(o)+e[i+2]}for(;i!==t.length;++i)e[i]=tt(t[i])+e[i-1];return e}function rp(t){let e=new BigInt64Array(t.length);e[0]=Ot(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=Ot(n)+e[i-1],e[i+1]=Ot(a)+e[i],e[i+2]=Ot(s)+e[i+1],e[i+3]=Ot(o)+e[i+2]}for(;i!==e.length;++i)e[i]=Ot(t[i])+e[i-1];return e}function b3(t){t[0]=Xe(t[0]);let e=t.length/4*4,r=1;if(e>=4)for(;r<e-4;r+=4){let i=t[r],n=t[r+1],a=t[r+2],s=t[r+3];t[r]=Xe(i)+t[r-1],t[r+1]=Xe(n)+t[r],t[r+2]=Xe(a)+t[r+1],t[r+3]=Xe(s)+t[r+2]}for(;r!==t.length;++r)t[r]=Xe(t[r])+t[r-1]}function w3(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Int32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=tt(o),i.fill(o,n,n+s),n+=s}return i}function _3(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];o=Ot(o),i.fill(o,n,n+s),n+=s}return i}function D3(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=Xe(o),i.fill(o,n,n+s),n+=s}return i}function Su(t){let e=t.length/4*4,r=1;if(e>=4)for(let i=t[0];r<e-4;r+=4)i=t[r]+=i,i=t[r+1]+=i,i=t[r+2]+=i,i=t[r+3]+=i;for(;r!==t.length;)t[r]+=t[r-1],++r}function S3(t){let e=0;for(let r=0;r<t.length;r++)t[r]+=e,e=t[r]}function A3(t){if(t.length<2)return new Int32Array(t);let e=new Int32Array(t.length);e[0]=tt(t[0]),e[1]=tt(t[1]);let r=t.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-2],e[i+1]=tt(a)+e[i-1],e[i+2]=tt(s)+e[i],e[i+3]=tt(o)+e[i+1]}for(;i!==t.length;i+=2)e[i]=tt(t[i])+e[i-2],e[i+1]=tt(t[i+1])+e[i-1];return e}function Oy(t,e,r,i){if(t.length<2)return new Int32Array(t);let n=new Int32Array(t.length),a=tt(t[0]),s=tt(t[1]);n[0]=Ge(Math.round(a*e),r,i),n[1]=Ge(Math.round(s*e),r,i);let o=t.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=t[l],h=t[l+1],c=tt(u)+a,p=tt(h)+s;n[l]=Ge(Math.round(c*e),r,i),n[l+1]=Ge(Math.round(p*e),r,i);let f=t[l+2],d=t[l+3];a=tt(f)+c,s=tt(d)+p,n[l+2]=Ge(Math.round(a*e),r,i),n[l+3]=Ge(Math.round(s*e),r,i)}for(;l!==t.length;l+=2)a+=tt(t[l]),s+=tt(t[l+1]),n[l]=Ge(Math.round(a*e),r,i),n[l+1]=Ge(Math.round(s*e),r,i);return n}function Ge(t,e,r){return Math.min(r,Math.max(e,t))}function E3(t){let e=new Int32Array(t.length+1);e[0]=0,e[1]=tt(t[0]);let r=e[1];for(let i=2;i!==e.length;++i){let n=t[i-1],a=tt(n);r+=a,e[i]=e[i-1]+r}return new Uint32Array(e)}function F3(t,e,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];l=tt(l);for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function I3(t,e,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function T3(t,e,r){let i=new Int32Array(r),n=0,a=0;for(let s=0;s<e;s++){let o=t[s],l=t[s+e],u=tt(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function k3(t,e,r){let i=new BigInt64Array(r),n=0,a=0n;for(let s=0;s<e;s++){let o=Number(t[s]),l=t[s+e],u=Ot(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function ip(t){let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0;for(let r=1;r<t.length;r++)e[r]=e[r-1]+tt(t[r])>>>0;return e}function np(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r<t.length;r++)e[r]=BigInt.asUintN(64,e[r-1]+Ot(t[r]));return e}function C3(t){if(t.length<2)return new Uint32Array(t);let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0,e[1]=tt(t[1])>>>0;for(let r=2;r<t.length;r+=2)e[r]=e[r-2]+tt(t[r])>>>0,e[r+1]=e[r-1]+tt(t[r+1])>>>0;return e}function P3(t,e,r,i){let n=Oy(t,e,r,i);return new Uint32Array(n)}function M3(t){return t[1]}function B3(t){return tt(t[1])}function z3(t){if(t.length===2){let e=tt(t[1]);return[e,e]}return[tt(t[2]),tt(t[3])]}function L3(t){return t[1]}function V3(t){return Ot(t[1])}function O3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var Dt;(function(t){t.PRESENT=\"PRESENT\",t.DATA=\"DATA\",t.OFFSET=\"OFFSET\",t.LENGTH=\"LENGTH\"})(Dt||(Dt={}));var jt;(function(t){t.NONE=\"NONE\",t.SINGLE=\"SINGLE\",t.SHARED=\"SHARED\",t.VERTEX=\"VERTEX\",t.MORTON=\"MORTON\",t.FSST=\"FSST\"})(jt||(jt={}));var be;(function(t){t.VERTEX=\"VERTEX\",t.INDEX=\"INDEX\",t.STRING=\"STRING\",t.KEY=\"KEY\"})(be||(be={}));var Et;(function(t){t.VAR_BINARY=\"VAR_BINARY\",t.GEOMETRIES=\"GEOMETRIES\",t.PARTS=\"PARTS\",t.RINGS=\"RINGS\",t.TRIANGLES=\"TRIANGLES\",t.SYMBOL=\"SYMBOL\",t.DICTIONARY=\"DICTIONARY\"})(Et||(Et={}));var R3=[Dt.PRESENT,Dt.DATA,Dt.OFFSET,Dt.LENGTH],ap=[W.NONE,W.DELTA,W.COMPONENTWISE_DELTA,W.RLE,W.MORTON],$3=[ee.NONE,ee.FAST_PFOR,ee.VARINT],N3=[jt.NONE,jt.SINGLE,jt.SHARED,jt.VERTEX,jt.MORTON,jt.FSST],U3=[be.VERTEX,be.INDEX,be.STRING,be.KEY],j3=[Et.VAR_BINARY,Et.GEOMETRIES,Et.PARTS,Et.RINGS,Et.TRIANGLES,Et.SYMBOL,Et.DICTIONARY];function ct(t,e){let r=Y3(t,e);return r.logicalLevelTechnique1===W.MORTON?q3(r,t,e):(W.RLE===r.logicalLevelTechnique1||W.RLE===r.logicalLevelTechnique2)&&ee.NONE!==r.physicalLevelTechnique?G3(r,t,e):r}function q3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function G3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function Y3(t,e){let r=t[e.get()],i=R3[r>>4],n={};switch(i){case Dt.DATA:n={dictionaryType:N3[r&15]};break;case Dt.OFFSET:n={offsetType:U3[r&15]};break;case Dt.LENGTH:n={lengthType:j3[r&15]}}e.increment();let a=t[e.get()],s=ap[a>>5],o=ap[a>>2&7],l=$3[a&3];e.increment();let u=Rt(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ht;(function(t){t[t.FLAT=0]=\"FLAT\",t[t.CONST=1]=\"CONST\",t[t.SEQUENCE=2]=\"SEQUENCE\",t[t.DICTIONARY=3]=\"DICTIONARY\",t[t.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(ht||(ht={}));var fe=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<<i}getInt(t){let e=Math.floor(t/8),r=t%8;return this.values[e]>>r&1}size(){return this._size}getBuffer(){return this.values}};function Ar(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o<i;o++)a[o]=e.get(o)?t[s++]:r;return a}function X3(t,e,r){if(!r)return t;let i=r.size(),n=new fe(t,e),a=new fe(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let o=0;o<i;o++){let l=r.get(o)?n.get(s++):!1;a.set(o,l)}return a.getBuffer()}function Ry(t,e,r){for(let i=0;i<t;i++){let n=ct(e,r);r.add(n.byteLength)}}function pi(t,e,r,i,n){let a=W3(t,Math.ceil(e/8),r,i);return n?X3(a,e,n):a}function W3(t,e,r,i){let n=new Uint8Array(e),a=0,s=i.get()+r;for(;a<e&&!(i.get()>=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u<l&&a<e;u++)n[a++]=t[i.increment()]}}return i.set(s),n}function $y(t,e,r,i){let n=e.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float32Array(s);return e.set(a),i?Ar(o,i,0):o}function Ny(t,e,r,i){let n=e.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float64Array(s);return e.set(a),i?Ar(o,i,0):o}function Z3(t,e,r){let i=e.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(r);for(let o=0;o<r;o++)s[o]=a.getUint32(i+o*Uint32Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}function H3(t,e,r){let i=e.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new BigUint64Array(r);for(let o=0;o<r;o++)s[o]=a.getBigUint64(i+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}var J3=new TextDecoder;function Au(t,e,r){return r-e>=12?J3.decode(t.subarray(e,r)):K3(t,e,r)}function K3(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function za(t,e,r,i,n){return i6(fi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return n6(fi(t,e,r),r,i,n)}function We(t,e,r){return s6(fi(t,e,r),r)}function fi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ee.FAST_PFOR:return y3(t,r.numValues,r.byteLength,e);case ee.VARINT:return Rt(t,e,r.numValues);case ee.NONE:return Z3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function En(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ee.VARINT:return Du(t,e,r.numValues);case ee.NONE:return H3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Q3(t,e,r){let i=fi(t,e,r);return i.length===1?tt(i[0]):B3(i)}function Eu(t,e,r){let i=fi(t,e,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?tt(i[0]):i[0]:M3(i)}function Uy(t,e,r){return z3(fi(t,e,r))}function jy(t,e,r){return O3(Du(t,e,r.numValues))}function qy(t,e,r,i){return Yy(En(t,e,r),r,i)}function Fu(t,e,r,i){return Xy(En(t,e,r),r,i)}function t6(t,e,r,i){let n=e6(t,e,r,!1);return i?Ar(n,i,0):n}function e6(t,e,r,i){if(r.physicalLevelTechnique===ee.VARINT)return a6(p3(t,e,r.numValues),r,i);let n=En(t,e,r),a=i?Yy(n,r):Xy(n,r);return Float64Array.from(a,Number)}function r6(t,e,r){let i=En(t,e,r);return i.length===1?Ot(i[0]):V3(i)}function Gy(t,e,r){let i=En(t,e,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?Ot(i[0]):i[0]:L3(i)}function i6(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let a=e;if(!i)return T3(t,a.runs,a.numRleValues);t=bl(t,a.runs,a.numRleValues),n=ep(t)}else n=ep(t);break;case W.RLE:n=w3(t,e.runs,e.numRleValues);break;case W.MORTON:Su(t),n=new Int32Array(t);break;case W.COMPONENTWISE_DELTA:if(r&&!i)return Oy(t,r.scale,r.min,r.max);n=A3(t);break;case W.NONE:n=g3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Ar(n,i,0):n}function n6(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let a=e;n=ip(bl(t,a.runs,a.numRleValues))}else n=ip(t);break;case W.RLE:n=bl(t,e.runs,e.numRleValues);break;case W.MORTON:Su(t),n=t;break;case W.COMPONENTWISE_DELTA:n=r&&!i?P3(t,r.scale,r.min,r.max):C3(t);break;case W.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Ar(n,i,0):n}function Yy(t,e,r){let i;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let n=e;if(!r)return k3(t,n.runs,n.numRleValues);t=wl(t,n.runs,n.numRleValues),i=rp(t)}else i=rp(t);break;case W.RLE:i=_3(t,e.runs,e.numRleValues);break;case W.NONE:i=x3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Ar(i,r,0n):i}function Xy(t,e,r){let i;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let n=e;i=np(wl(t,n.runs,n.numRleValues))}else i=np(t);break;case W.RLE:i=wl(t,e.runs,e.numRleValues);break;case W.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Ar(i,r,0n):i}function a6(t,e,r){switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let i=e;t=Vy(t,i.runs,i.numRleValues)}return b3(t),t;case W.RLE:return l6(t,e,r);case W.NONE:return r&&v3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function s6(t,e){if(e.logicalLevelTechnique1===W.DELTA&&e.logicalLevelTechnique2===W.NONE)return E3(t);if(e.logicalLevelTechnique1===W.RLE&&e.logicalLevelTechnique2===W.NONE){let r=e;return I3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===W.NONE&&e.logicalLevelTechnique2===W.NONE){S3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===W.DELTA&&e.logicalLevelTechnique2===W.RLE){let r=e,i=F3(t,r.runs,r.numRleValues);return Su(i),new Uint32Array(i)}throw Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")}function is(t,e,r,i,n=\"int32\"){let a=t.logicalLevelTechnique1;if(a===W.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==W.DELTA||t.logicalLevelTechnique2!==W.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof fe?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===ee.VARINT)return o6(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function o6(t,e,r){let i=new By(e.get());if(r===\"int64\"){let a=Du(t,i,4);return a[2]===2n&&a[3]===2n}let n=Rt(t,i,4);return n[2]===2&&n[3]===2}function l6(t,e,r){return r?D3(t,e.runs,e.numRleValues):Vy(t,e.runs,e.numRleValues)}var Wy=class extends rs{getValueFromBuffer(t){return this.dataBuffer[t]}},Zy=class extends Py{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function Iu(t,e,r){return{x:sp(t,e)-r,y:sp(t>>1,e)-r}}function sp(t,e){let r=0;for(let i=0;i<e;i++)r|=(t&1<<2*i)>>i;return r}var Bt;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\",t[t.MULTIPOINT=3]=\"MULTIPOINT\",t[t.MULTILINESTRING=4]=\"MULTILINESTRING\",t[t.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})(Bt||(Bt={}));var op;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\"})(op||(op={}));var rr;(function(t){t[t.MORTON=0]=\"MORTON\",t[t.VEC_2=1]=\"VEC_2\",t[t.VEC_3=2]=\"VEC_3\"})(rr||(rr={}));function u6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g<t.numGeometries;g++){let x=t.geometryType(g);switch(x){case Bt.POINT:{let v,b;if(d)v=m[s++],b=m[s++];else if(t.vertexBufferType===rr.MORTON){let _=m[f[o++]],w=Iu(_,l.numBits,l.coordinateShift);v=w.x,b=w.y}else{let _=f[o++]*2;v=m[_],b=m[_+1]}e[a++]=[[new B(v,b)]],h&&n++,c&&r++,p&&i++}break;case Bt.MULTIPOINT:{let v=h[n]-h[n-1];n++;let b;if(d){b=Array(v);for(let _=0;_<v;_++){let w=m[s++],D=m[s++];b[_]=new B(w,D)}}else b=ur(t.vertexBufferType,m,f,o,v,!1,l),o+=v;e[a++]=b.map(_=>[_]),r+=v,i+=v}break;case Bt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Lr(m,s,v,!1),s+=v*2):(b=ur(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Bt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),_,w=p[i]-p[i-1];if(i++,d){_=Lr(m,s,w,!0),s+=w*2;for(let D=0;D<b.length;D++)w=p[i]-p[i-1],i++,b[D]=Lr(m,s,w,!0),s+=w*2}else{_=ur(t.vertexBufferType,m,f,o,w,!0,l),o+=w;for(let D=0;D<b.length;D++)w=p[i]-p[i-1],i++,b[D]=ur(t.vertexBufferType,m,f,o,w,!0,l),o+=w}e[a++]=[_].concat(b),h&&n++}break;case Bt.MULTILINESTRING:{let v=h[n]-h[n-1];n++;let b=Array(v);for(let _=0;_<v;_++){let w;if(y?(w=p[i]-p[i-1],i++):w=c[r]-c[r-1],r++,d)b[_]=Lr(m,s,w,!1),s+=w*2;else{let D=ur(t.vertexBufferType,m,f,o,w,!1,l);b[_]=D,o+=w}}e[a++]=b}break;case Bt.MULTIPOLYGON:{let v=h[n]-h[n-1];n++;let b=Array(v);for(let _=0;_<v;_++){let w=c[r]-c[r-1];r++;let D,A=Array(w-1),F=p[i]-p[i-1];i++,d?(D=Lr(m,s,F,!0),s+=F*2):(D=ur(t.vertexBufferType,m,f,o,F,!0,l),o+=F);for(let L=0;L<A.length;L++){let T=p[i]-p[i-1];i++,d?(A[L]=Lr(m,s,T,!0),s+=T*2):(A[L]=ur(t.vertexBufferType,m,f,o,T,!0,l),o+=T)}b[_]=[D].concat(A)}e[a++]=b.flat()}break;default:throw Error(`The specified geometry type (${x}) is currently not supported.`)}}return e}function ur(t,e,r,i,n,a,s){return t===rr.MORTON?c6(e,r,i,n,a,s):h6(e,r,i,n,a)}function Lr(t,e,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let s=t[e+a],o=t[e+a+1];n[a/2]=new B(s,o)}return i&&(n[n.length-1]=n[0]),n}function h6(t,e,r,i,n){let a=Array(n?i+1:i);for(let s=0;s<i*2;s+=2){let o=e[r+s/2]*2,l=t[o],u=t[o+1];a[s/2]=new B(l,u)}return n&&(a[a.length-1]=a[0]),a}function c6(t,e,r,i,n,a){let s=Array(n?i+1:i);for(let o=0;o<i;o++){let l=t[e[r+o]],u=Iu(l,a.numBits,a.coordinateShift);s[o]=new B(u.x,u.y)}return n&&(s[s.length-1]=s[0]),s}var Hy=class{constructor(t,e,r,i,n){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[t],i=this.vertexBuffer[r],n=Iu(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return u6(this)}get mortonSettings(){return this._mortonSettings}};function p6(t,e,r,i,n){return new Jy(t,e,rr.VEC_2,r,i,n)}function f6(t,e,r,i,n,a){return new Jy(t,e,rr.MORTON,r,i,n,a)}var Jy=class extends Hy{constructor(t,e,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Bt.POLYGON||this._geometryType===Bt.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function Ky(t,e,r,i){return new Qy(rr.VEC_2,t,e,r,i)}function d6(t,e,r,i,n){return new Qy(rr.MORTON,t,e,r,i,n)}var Qy=class extends Hy{constructor(t,e,r,i,n,a){super(t,r,i,n,a),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===Bt.POLYGON||this.geometryType(t)===Bt.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},t1=class{constructor(t,e,r,i){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error(\"Cannot convert GpuVector to coordinates without topology information\");let t=new Uint32Array(this.numGeometries);for(let e=0;e<this.numGeometries;e++)t[e]=this.geometryType(e);return Ky(t,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function lp(t,e,r,i,n,a){return new y6(t,e,r,i,n,a)}var y6=class extends t1{constructor(t,e,r,i,n,a){super(r,i,n,a),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function up(t,e,r,i,n){return new m6(t,e,r,i,n)}var m6=class extends t1{constructor(t,e,r,i,n){super(e,r,i,n),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function g6(t,e,r,i,n){let a=ct(t,r),s=is(a,i,t,r),o,l,u,h;if(s===ht.CONST){let v=Eu(t,r,a),b,_,w,D;for(let A=0;A<e-1;A++){let F=ct(t,r);switch(F.physicalStreamType){case Dt.LENGTH:switch(F.logicalStreamType.lengthType){case Et.GEOMETRIES:b=We(t,r,F);break;case Et.PARTS:_=We(t,r,F);break;case Et.RINGS:w=We(t,r,F);break;case Et.TRIANGLES:D=We(t,r,F)}break;case Dt.OFFSET:switch(F.logicalStreamType.offsetType){case be.VERTEX:o=Vt(t,r,F);break;case be.INDEX:h=Vt(t,r,F)}break;case Dt.DATA:if(jt.VERTEX===F.logicalStreamType.dictionaryType)l=za(t,r,F,n);else{let L=F;u={numBits:L.numBits,coordinateShift:L.coordinateShift},l=Vt(t,r,F,n)}}}return h?b!==void 0||_!==void 0?lp(i,v,D,h,l,{geometryOffsets:b,partOffsets:_,ringOffsets:w}):lp(i,v,D,h,l):u===void 0?p6(i,v,{geometryOffsets:b,partOffsets:_,ringOffsets:w},o,l):f6(i,v,{geometryOffsets:b,partOffsets:_,ringOffsets:w},o,l,u)}let c=Vt(t,r,a),p,f,d,y;for(let v=0;v<e-1;v++){let b=ct(t,r);switch(b.physicalStreamType){case Dt.LENGTH:switch(b.logicalStreamType.lengthType){case Et.GEOMETRIES:p=Vt(t,r,b);break;case Et.PARTS:f=Vt(t,r,b);break;case Et.RINGS:d=Vt(t,r,b);break;case Et.TRIANGLES:y=We(t,r,b)}break;case Dt.OFFSET:switch(b.logicalStreamType.offsetType){case be.VERTEX:o=Vt(t,r,b);break;case be.INDEX:h=Vt(t,r,b)}break;case Dt.DATA:if(jt.VERTEX===b.logicalStreamType.dictionaryType)l=za(t,r,b,n);else{let _=b;u={numBits:_.numBits,coordinateShift:_.coordinateShift},l=Vt(t,r,b,n)}}}let m,g,x;return p?(m=ro(c,p,2),f&&d?(g=hp(c,m,f,!1),x=v6(c,m,g,d)):f&&(g=x6(c,m,f))):f&&d?(g=ro(c,f,1),x=hp(c,g,d,!0)):f&&(g=ro(c,f,0)),h&&!g?up(c,y,h,l):h?up(c,y,h,l,{geometryOffsets:m,partOffsets:g,ringOffsets:x}):u===void 0?Ky(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l):d6(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l,u)}function ro(t,e,r){let i=new Uint32Array(t.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<t.length;s++)n=i[s+1]=n+(t[s]>r?e[a++]:1);return i}function hp(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<t.length;l++){let u=t[l],h=e[l+1]-e[l];if(u===5||u===2||i&&(u===4||u===1))for(let c=0;c<h;c++)a=n[s++]=a+r[o++];else for(let c=0;c<h;c++)n[s++]=++a}return n}function x6(t,e,r){let i=new Uint32Array(e[e.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<t.length;o++){let l=t[o],u=e[o+1]-e[o];if(l===4||l===1)for(let h=0;h<u;h++)n=i[a++]=n+r[s++];else for(let h=0;h<u;h++)i[a++]=++n}return i}function v6(t,e,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<t.length;u++){let h=t[u],c=e[u+1]-e[u];if(h!==0&&h!==3)for(let p=0;p<c;p++){let f=r[s]-r[s-1];s++;for(let d=0;d<f;d++)a=n[o++]=a+i[l++]}else for(let p=0;p<c;p++)n[o++]=++a,s++}return n}var b6=class extends Sr{constructor(t,e,r){super(t,e.getBuffer(),r),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}},w6=class extends rs{getValueFromBuffer(t){return this.dataBuffer[t]}},e1=class extends Sr{constructor(t,e,r,i){super(t,i?BigInt64Array.of(e):BigUint64Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},Tu=class extends Sr{constructor(t,e,r,i){super(t,r,i),this.offsetBuffer=e}},cp=class extends Tu{constructor(t,e,r,i){super(t,e,r,i??e.length-1)}getValueFromBuffer(t){let e=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return Au(this.dataBuffer,e,r)}},Hr=class extends Tu{constructor(t,e,r,i,n){super(t,r,i,n??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return Au(this.dataBuffer,r,i)}};function _6(t,e){let r=0;for(let i=0;i<e.length;i++){let n=e[i];n===255?(r++,i++):r+=t[n]}return r}function D6(t,e,r){let i=new Uint32Array(e.length);for(let s=1;s<e.length;s++)i[s]=i[s-1]+e[s-1];let n=new Uint8Array(_6(e,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(o===255)s++,n[a++]=r[s];else{let l=e[o],u=i[o];for(;l-- >0;)n[a++]=t[u++]}}return n}var r1=class extends Tu{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s??e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return Au(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),D6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i<t.length;i++){let n=t[i];e[i-1]=n-r,r=n}return e}};function i1(t,e,r,i,n){let a,s,o,l,u,h=n,c,p;for(let f=0;f<i;f++){let d=ct(e,r);switch(d.physicalStreamType){case Dt.PRESENT:{let y=new fe(pi(e,d.numValues,d.byteLength,r),d.numValues);h=n??y;break}case Dt.OFFSET:s=Vt(e,r,d,void 0,h);break;case Dt.LENGTH:{let y=We(e,r,d);Et.DICTIONARY===d.logicalStreamType.lengthType?a=y:Et.SYMBOL===d.logicalStreamType.lengthType?l=y:c=y;break}case Dt.DATA:{let y=e.subarray(r.get(),r.get()+d.byteLength);r.add(d.byteLength);let m=d.logicalStreamType.dictionaryType;jt.FSST===m?u=y:jt.SINGLE===m||jt.SHARED===m?o=y:jt.NONE===m&&(p=y);break}}}return S6(t,u,s,a,o,l,h)??A6(t,o,s,a,h)??E6(t,c,p,s,h)}function S6(t,e,r,i,n,a,s){if(e){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column \"${t}\"`);return new r1(t,r,i,n,a,e,s)}}function A6(t,e,r,i,n){if(e){if(!r||!i)throw Error(`Incomplete dictionary string column \"${t}\"`);return n?new Hr(t,r,i,e,n):new Hr(t,r,i,e)}}function E6(t,e,r,i,n){if(e&&r){if(i)return n?new Hr(t,i,e,r,n):new Hr(t,i,e,r);if(n&&n.size()!==e.length-1){let a=new Uint32Array(n.size()),s=0;for(let o=0;o<n.size();o++)n.get(o)?a[o]=s++:a[o]=0;return new Hr(t,a,e,r,n)}return n?new cp(t,e,r,n):new cp(t,e,r)}}function F6(t,e,r,i){let n,a,s,o,l=!1;for(;!l;){let f=ct(t,e);switch(f.physicalStreamType){case Dt.LENGTH:Et.DICTIONARY===f.logicalStreamType.lengthType?n=We(t,e,f):s=We(t,e,f);break;case Dt.DATA:jt.SINGLE===f.logicalStreamType.dictionaryType||jt.SHARED===f.logicalStreamType.dictionaryType?(a=t.subarray(e.get(),e.get()+f.byteLength),l=!0):o=t.subarray(e.get(),e.get()+f.byteLength),e.add(f.byteLength)}}if(r.type!==\"complexType\")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column \"${r.name}\"`);let u=r.complexType.children,h=[],c=o?{}:void 0,p=0;for(let f of u){let d=Rt(t,e,1)[0];if(d===0)continue;let y=f.name?`${r.name}${f.name}`:r.name;if(i&&!i.has(y)){Ry(d,t,e);continue}if(f.type!==\"scalarField\"||f.scalarField.physicalType!==et.STRING)throw Error(\"Currently only scalar string fields are implemented for a struct.\");if(d>1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ct(t,e);m=new fe(pi(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ct(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column \"${y}\"`);h[p++]=new r1(y,g,n,a,s,o,m,c)}else h[p++]=new Hr(y,g,n,a,m)}return h}var pp=class extends Sr{constructor(t,e,r){super(t,new Uint8Array,r??e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},we;(function(t){t[t.STRING=1]=\"STRING\",t[t.INT32=2]=\"INT32\",t[t.UINT32=4]=\"UINT32\",t[t.INT64=8]=\"INT64\",t[t.UINT64=16]=\"UINT64\",t[t.FLOAT=32]=\"FLOAT\",t[t.DOUBLE=64]=\"DOUBLE\",t[t.PRESENCE=128]=\"PRESENCE\"})(we||(we={}));var Je;(function(t){t[t.FALSE=0]=\"FALSE\",t[t.TRUE=1]=\"TRUE\",t[t.START_MAP=2]=\"START_MAP\",t[t.START_LIST=3]=\"START_LIST\",t[t.COUNT=4]=\"COUNT\"})(Je||(Je={}));function I6(t,e,r,i){let n=T6(r);if(i===0)return n.map(h=>new pp(h,[]));let a=k6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h<n.length;h++){let c=z6(a,h,s,l,u);o.push(new pp(n[h],c.value,c.nullabilityBuffer)),l=c.countsEnd,u=c.valuesEnd}return o}function T6(t){let e=t.type===\"complexType\"?t.complexType.children:void 0;return!e||e.length===0?[t.name]:e.map(r=>t.name+(r.name??\"\"))}function k6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ct(t,e)),a=r-1,s=[];i&we.STRING&&(a-=C6(t,e,s)),a-=P6(t,e,i,s),a-=M6(t,e,i,s);let o,l=0;if(i&we.PRESENCE){let h=B6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ct(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function C6(t,e,r){let i=t[e.get()];e.add(1);let n=i1(\"\",t,e,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function P6(t,e,r,i){let n=0;return r&we.INT32?(Gr(i,za(t,e,ct(t,e))),n++):r&we.INT64&&(Gr(i,qy(t,e,ct(t,e))),n++),r&we.UINT32?(Gr(i,Vt(t,e,ct(t,e))),n++):r&we.UINT64&&(Gr(i,Fu(t,e,ct(t,e))),n++),n}function M6(t,e,r,i){let n=0;return r&we.FLOAT&&(Gr(i,$y(t,e,ct(t,e).numValues)),n++),r&we.DOUBLE&&(Gr(i,Ny(t,e,ct(t,e).numValues)),n++),n}function B6(t,e){let r=ct(t,e);if(r.physicalStreamType!==Dt.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=e.get(),a=new fe(pi(t,i,r.byteLength,e),i);return e.set(n+r.byteLength),{value:a,count:i}}function z6(t,e,r,i,n){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=t,u=e*r,h=r,c;if(o){c=new fe(new Uint8Array(Math.ceil(r/8)),r),h=0;for(let x=0;x<r;x++)o.get(u+x)&&(c.set(x,!0),h++)}let p=i+h;if(p>a.length)throw Error(\"Merged map counts underflow while decoding child streams\");let f=Array(r),d=i,y=n;for(let x=0;x<r;x++){if(o&&!o.get(u+x)){f[x]=null;continue}let v=y+a[d++];if(v>s.length)throw Error(\"Map value stream underflow while decoding feature payload\");let b=L6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x<p;x++)m+=a[x];let g=n+m;if(y!==g)throw Error(\"Unused flattened map values remain after decode\");return{value:f,nullabilityBuffer:c,countsEnd:p,valuesEnd:g}}function L6(t,e,r,i){return r-e===1||t[e]===Je.START_LIST?ku(t,e,r,i):n1(t,e,r,i)}function n1(t,e,r,i){let n=Object.create(null),a=e;for(;a<r;){let s=a1(t[a++],i);if(typeof s!=\"string\")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=ku(t,a,r,i);n[s]=o.value,a=o.nextIndex}return{value:n,nextIndex:a}}function ku(t,e,r,i){if(e>=r)throw Error(\"Unexpected end of map value stream\");let n=t[e];if(n===Je.FALSE)return{value:!1,nextIndex:e+1};if(n===Je.TRUE)return{value:!0,nextIndex:e+1};if(n===Je.START_MAP){let a=fp(t,e,r);return{value:n1(t,e+2,a,i).value,nextIndex:a}}if(n===Je.START_LIST){let a=fp(t,e,r),s=[],o=e+2;for(;o<a;){let l=ku(t,o,a,i);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:a}}return{value:a1(n,i),nextIndex:e+1}}function fp(t,e,r){if(e+1>=r)throw Error(\"Missing length for nested map/list payload\");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error(\"Nested payload exceeds containing payload bounds\");return n}function a1(t,e){let r=t-Je.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Gr(t,e){for(let r of e)t.push(r)}function V6(t,e,r,i,n,a){return r.type===\"scalarType\"?a&&!a.has(r.name)?(Ry(i,t,e),null):O6(i,t,e,n,r.scalarType,r):r.complexType?.physicalType===Qe.MAP?I6(t,e,r,i):i===0?null:F6(t,e,r,a)}function O6(t,e,r,i,n,a){let s;if(t===0)return null;if(a.nullable){let l=ct(e,r),u=l.numValues,h=r.get(),c=pi(e,u,l.byteLength,r);r.set(h+l.byteLength),s=new fe(c,l.numValues)}let o=s??i;switch(n.physicalType){case et.UINT_32:case et.INT_32:return j6(e,r,a,n,o);case et.STRING:{let l=a.nullable?t-1:t;return i1(a.name,e,r,l,s)??null}case et.BOOLEAN:return R6(e,r,a,i,o);case et.UINT_64:case et.INT_64:return U6(e,r,a,o,n);case et.FLOAT:return $6(e,r,a,o);case et.DOUBLE:return N6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function R6(t,e,r,i,n){let a=ct(t,e),s=a.numValues,o=e.get(),l=Fn(n)?n:void 0,u=pi(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new fe(u,s);return new b6(r.name,h,n)}function $6(t,e,r,i){let n=ct(t,e),a=Fn(i)?i:void 0,s=$y(t,e,n.numValues,a);return new w6(r.name,s,i)}function N6(t,e,r,i){let n=ct(t,e),a=Fn(i)?i:void 0,s=Ny(t,e,n.numValues,a);return new gu(r.name,s,i)}function U6(t,e,r,i,n){let a=ct(t,e),s=is(a,i,t,e,\"int64\"),o=n.physicalType===et.INT_64;if(s===ht.FLAT){let u=Fn(i)?i:void 0,h=o?qy(t,e,a,u):Fu(t,e,a,u);return new Wy(r.name,h,i)}if(s===ht.SEQUENCE){let u=jy(t,e,a);return new Zy(r.name,u[0],u[1],a.numRleValues,o)}let l=o?r6(t,e,a):Gy(t,e,a);return new e1(r.name,l,i,o)}function j6(t,e,r,i,n){let a=ct(t,e),s=is(a,n,t,e),o=i.physicalType===et.INT_32;if(s===ht.FLAT){let u=Fn(n)?n:void 0,h=o?za(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new mu(r.name,h,n)}if(s===ht.SEQUENCE){let u=Uy(t,e,a);return new xu(r.name,u[0],u[1],a.numRleValues,o)}let l=o?Q3(t,e,a):Eu(t,e,a);return new vu(r.name,l,n,o)}function Fn(t){return t instanceof fe}var Tt={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function s1(t){switch(t){case Tt.ID:case Tt.ID|Tt.ID_NULLABLE:case Tt.ID|Tt.ID_LONG:case Tt.ID|Tt.ID_LONG|Tt.ID_NULLABLE:return{nullable:(t&Tt.ID_NULLABLE)!==0,columnScope:Ui.FEATURE,type:\"scalarType\",scalarType:{longID:(t&Tt.ID_LONG)!==0,type:\"logicalType\",logicalType:My.ID}};case Tt.GEOMETRY:return{nullable:!1,columnScope:Ui.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Qe.GEOMETRY,children:[]}};case Tt.STRUCT:return{nullable:!1,columnScope:Ui.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Qe.STRUCT,children:[]}};case Tt.MAP:return{nullable:!0,columnScope:Ui.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Qe.MAP,children:[]}};default:return W6(t)}}function q6(t){return t>=Tt.SCALAR_BASE}function o1(t){return t===Tt.STRUCT||t===Tt.MAP}function G6(t){if(t.type===\"scalarType\"){let e=t.scalarType;if(e.type===\"physicalType\")switch(e.physicalType){case et.BOOLEAN:case et.INT_8:case et.UINT_8:case et.INT_32:case et.UINT_32:case et.INT_64:case et.UINT_64:case et.FLOAT:case et.DOUBLE:return!1;case et.STRING:return!0;default:return!1}if(e.type===\"logicalType\")return!1}else if(t.type===\"complexType\"){let e=t.complexType;if(e.type===\"physicalType\")switch(e.physicalType){case Qe.GEOMETRY:case Qe.STRUCT:case Qe.MAP:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",t),!1}function Y6(t){return t.type===\"scalarType\"&&t.scalarType?.type===\"logicalType\"&&t.scalarType.logicalType===My.ID}function X6(t){return t.type===\"complexType\"&&t.complexType?.type===\"physicalType\"&&t.complexType.physicalType===Qe.GEOMETRY}function W6(t){let e;switch(t){case 10:case 11:e=et.BOOLEAN;break;case 12:case 13:e=et.INT_8;break;case 14:case 15:e=et.UINT_8;break;case 16:case 17:e=et.INT_32;break;case 18:case 19:e=et.UINT_32;break;case 20:case 21:e=et.INT_64;break;case 22:case 23:e=et.UINT_64;break;case 24:case 25:e=et.FLOAT;break;case 26:case 27:e=et.DOUBLE;break;case 28:case 29:e=et.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:Ui.FEATURE,type:\"scalarType\",scalarType:{longID:!1,type:\"physicalType\",physicalType:e}}}var Z6=new TextDecoder,dp=\"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)\";function Cu(t,e){let r=Rt(t,e,1)[0];if(r===0)return\"\";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),Z6.decode(a)}function H6(t){let e=t.name,r=t.nullable;return t.type===\"scalarType\"?{type:\"scalarField\",scalarField:t.scalarType,name:e,nullable:r}:{type:\"complexField\",complexField:t.complexType,name:e,nullable:r}}function l1(t,e){let r=Rt(t,e,1)[0]>>>0,i=r>=Tt.SCALAR_BASE?s1(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:Cu(t,e)};if(n.type===\"complexType\"&&o1(r)){let a=n.complexType,s=Rt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o<s;o++)a.children[o]=l1(t,e)}return H6(n)}function J6(t,e){let r=Rt(t,e,1)[0]>>>0,i=s1(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${dp}`);let n;if(q6(r))n=Cu(t,e);else if(r<Tt.GEOMETRY)n=\"id\";else if(r===Tt.GEOMETRY)n=\"geometry\";else throw Error(`Unsupported column type code ${r}. Supported: ${dp}`);let a={...i,name:n};if(a.type===\"complexType\"&&o1(r)){let s=Rt(t,e,1)[0]>>>0,o=a.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=l1(t,e)}return a}function K6(t,e){let r={};r.featureTables=[];let i={};if(i.name=Cu(t,e),i.name.length===0)throw Error(\"Missing layer name\");let n=Rt(t,e,1)[0]>>>0,a=Rt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s<a;s++)i.columns[s]=J6(t,e);return r.featureTables.push(i),[r,n]}function Q6(t,e,r=!0){let i=new By(0),n=[];for(;i.get()<t.length;){let a=Rt(t,i,1)[0]>>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=Rt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=K6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(Y6(m)){let x=null;if(m.nullable){let b=ct(t,i),_=i.get(),w=pi(t,b.numValues,b.byteLength,i);i.set(_+b.byteLength),x=new fe(w,b.numValues)}let v=ct(t,i);d=x?x.size():v.decompressedCount,c=t5(t,m,i,g,v,x??d,r)}else if(X6(m)){let x=Rt(t,i,1)[0];if(d===0){let v=i.get();d=ct(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=g6(t,x,i,d,e)}else{let x=G6(m)?Rt(t,i,1)[0]:1;if(x===0)continue;let v=V6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new Sw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function t5(t,e,r,i,n,a,s=!1){let o=e.scalarType?.longID?et.UINT_64:et.UINT_32,l=typeof a==\"number\"?void 0:a,u=is(n,a,t,r,o===et.UINT_64?\"int64\":\"int32\");if(o===et.UINT_32)switch(u){case ht.FLAT:return new mu(i,Vt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let h=Uy(t,r,n);return new xu(i,h[0],h[1],n.numRleValues,!1)}case ht.CONST:return new vu(i,Eu(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new gu(i,t6(t,r,n,l),a):new Wy(i,Fu(t,r,n,l),a);case ht.SEQUENCE:{let h=jy(t,r,n);return new Zy(i,h[0],h[1],n.numRleValues,!1)}case ht.CONST:return new e1(i,Gy(t,r,n),a,!1)}throw Error(\"Vector type not supported for id column.\")}var io=zy(wu);io/32*4,3*io/256+io|0;var e5=class{constructor(t,e){switch(this._featureData=t,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Bt.POINT:case Bt.MULTIPOINT:this.type=1;break;case Bt.LINESTRING:case Bt.MULTILINESTRING:this.type=2;break;case Bt.POLYGON:case Bt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new B(i.x,i.y));t.push(r)}return t}},r5=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new e5(this.features[t],this.extent)}},u1=class{constructor(t){this.layers={};let e=Q6(new Uint8Array(t));this.layers=e.reduce((r,i)=>({...r,[i.name]:new r5(i)}),{})}},h1=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ao(xt,16,0),this.grid3D=new ao(xt,16,0),this.featureIndexArray=new ad,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding===\"mlt\"?this.vtLayers=new u1(this.rawTileData).layers:this.vtLayers=new Td(new ay(this.rawTileData)).layers,this.sourceLayerCoder=new Cy(this.vtLayers?Object.keys(this.vtLayers).sort():[gl])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=xt/t.tileSize/t.scale,s=rn(n.filter,\"queryRenderedFeatures filter\",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Fa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Fa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>zg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(n5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,t.transform.worldCoordinateHelper,i,(x,v,b)=>(g||(g=Dr(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h,c){let p=this.bucketLayerIDs[e];if(a&&!p.some(m=>a.has(m)))return;let f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){let m=ci(d,!0);if(!n.filter(new ot(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new ot(this.tileID.overscaledZ),d))return;let y=this.getId(d,f);for(let m of p){if(a&&!a.has(m))continue;let g=o[m];if(!g)continue;let x={};y&&h&&(x=h.getState(g.sourceLayer||\"_geojsonTileLayer\",y));let v=Wt({},l[m]);v.paint=yp(v.paint,g.paint,d,x,s),v.layout=yp(v.layout,g.layout,d,x,s);let b=!c||c(d,g,x);if(!b)continue;let _=new Dw(d,this.z,this.x,this.y,y,u);_.layer=v;let w=t[m];w===void 0&&(w=t[m]=[]),w.push({featureIndex:i,feature:_,intersectionZ:b})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=rn(n.filterSpec,\"queryRenderedFeatures symbol filter\",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e,n.worldCoordinateHelper);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;if(this.promoteId){let i=typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[e];r=t.properties[i],typeof r==\"boolean\"&&(r=Number(r)),r===void 0&&t.properties?.cluster&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};M(\"FeatureIndex\",h1,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});function i5(t){return typeof t==\"object\"&&!!t&&\"evaluate\"in t}function yp(t,e,r,i,n){return ma(t,(a,s)=>{let o=e instanceof Za?e.get(s):null;return i5(o)?o.evaluate(r,i,void 0,n):o})}function n5(t,e){return e-t}var a5=class{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(t,e,r){for(let n of t){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=dw(n,r);a._featureFilter=rn(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of e)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource={};let i=E0(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(c=>this._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||\"\",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||\"_geojsonTileLayer\",h=l[u];h||(h=l[u]=[]),h.push(a)}}},c1=class{constructor(t){let e={},r=[];for(let s in t){let o=e[s]={};for(let l in t[s]){let u=t[s][l];o[l]={};for(let h in u){let c=u[h];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p={x:0,y:0,w:c.bitmap.width+2,h:c.bitmap.height+2};r.push(p),o[l][h]={rect:p,metrics:c.metrics}}}}let{w:i,h:n}=sy(r),a=new Yo({width:i||1,height:n||1});for(let s in t)for(let o in t[s]){let l=t[s][o];for(let u in l){let h=l[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c=e[s][o][u].rect;Yo.copy(h.bitmap,a,{x:0,y:0},{x:c.x+1,y:c.y+1},h.bitmap)}}this.image=a,this.positions=e}};M(\"GlyphAtlas\",c1);function s5(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var p1=class{constructor(t,e,r){if(!s5(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Zi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r,i=rl){let n=l5(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r===\"tms\"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?\"@2x\":\"\").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>mp(this.x,this.y,this.z,rl)).replace(/{bbox}/g,()=>mp(this.x,this.y,this.z,i))}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new B((t.x*e-this.x)*xt,(t.y*e-this.y)*xt)}toString(){return`${this.z}/${this.x}/${this.y}`}},o5=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Zi(t,e.z,e.z,e.x,e.y)}},f1=class ae{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new p1(i,+n,+a),this.key=Zi(r,e,i,n,a)}clone(){return new ae(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ae(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ae(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Zi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Zi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ae(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ae(r,this.wrap,r,i,n),new ae(r,this.wrap,r,i+1,n),new ae(r,this.wrap,r,i,n+1),new ae(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new ae(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ae(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new o5(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Sn(e.x-this.wrap,e.y))}normalizeCoordinates(e,r,i=xt){if(e>=0&&e<i&&r>=0&&r<i)return{tileID:this,x:e,y:r};let n=Math.floor(e/i),a=Math.floor(r/i),s=e-n*i,o=r-a*i,l=this.canonical.z,u=1<<l,h=this.canonical.y+a;if(h<0||h>=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ae(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Zi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<<r;return(a*a*t+a*n+i).toString(36)+r.toString(36)+e.toString(36)}function mp(t,e,r,i){let n=2**r,a=i.extentAtZoom0/n,[s,o]=i.origin,l=o-i.extentAtZoom0,u=n-e-1;return`${s+t*a},${l+u*a},${s+(t+1)*a},${l+(u+1)*a}`}function l5(t,e,r){let i=\"\";for(let n=t;n>0;n--){let a=1<<n-1;i+=(e&a?1:0)+(r&a?2:0)}return i}M(\"CanonicalTileID\",p1),M(\"OverscaledTileID\",f1,{omit:[\"terrainRttPosMatrix32f\"]});var d1=class{constructor(t){this.tileID=new f1(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}async parse(t,e,r,i,n){this.data=t,this.collisionBoxArray=new Zf;let a=new Cy(Object.keys(t.layers).sort()),s=new h1(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let A in u){let F=t.layers[A];if(!F)continue;F.version===1&&Ct(`Vector tile source \"${this.source}\" layer \"${A}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let L=a.encode(A),T=[];for(let V=0;V<F.length;V++){let U=F.feature(V),E=s.getId(U,A);T.push({feature:U,id:E,index:V,sourceLayerIndex:L})}for(let V of u[A]){let U=V[0];U.source!==this.source&&Ct(`layer.source = ${U.source} does not equal this.source = ${this.source}`),!U.isHidden(this.zoom,!0)&&(gp(V,this.zoom,r),(o[U.id]=U.createBucket({index:s.bucketLayerIDs.length,layers:V,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:L,sourceID:this.source})).populate(T,l,this.tileID.canonical),s.bucketLayerIDs.push(V.map(E=>E.id)))}}let h=ma(l.glyphDependencies,A=>ma(A,F=>Object.keys(F)));for(let A of this.inFlightDependencies)A?.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let A=new AbortController;this.inFlightDependencies.push(A),c=i.sendAsync({type:\"GG\",data:{stacks:h,source:this.source,tileID:this.tileID,type:\"glyphs\"}},A)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:\"GI\",data:{icons:p,source:this.source,tileID:this.tileID,type:\"icons\"}},A)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let A=new AbortController;this.inFlightDependencies.push(A),y=i.sendAsync({type:\"GI\",data:{icons:d,source:this.source,tileID:this.tileID,type:\"patterns\"}},A)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:\"GDA\",data:{dashes:m}},A)}let[x,v,b,_]=await Promise.all([c,f,y,g]),w=new c1(x),D=new ly(v,b);for(let A in o){let F=o[A];F.hasDependencies&&(gp(F.layers,this.zoom,r),F.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:w.positions,iconMap:v,iconPositions:D.iconPositions,patternMap:b,patternPositions:D.patternPositions,dashPositions:_,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:w.image,imageAtlas:D,dashPositions:_,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?w.positions:null}}};function gp(t,e,r){let i=new ot(e);for(let n of t)n.recalculate(i,r)}var y1=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e?.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},u5=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}},m1=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},h5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new B(e.x,e.y)))}},c5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},p5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function f5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l<t.length;l++){let u=t.feature(l),h=u.loadGeometry();for(let p of h)for(let f of p)f.x=f.x*n-a,f.y=f.y*n-s;let c=Math.max(128,Math.round(128*i/4096));h=Bb(h,u.type,-c,-c,i+c,i+c),h.length!==0&&o.push(new h5(u.type,h,u.properties,u.id,i))}return new c5(o,t.name,i)}var d5=class{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new y1,this.overzoomedTileResultCache=new u5(1e3)}loadVectorTile(t,e){try{return{vectorTile:t.encoding===\"mlt\"?new u1(e):new Td(new ay(e)),rawData:e}}catch(r){let i=new Uint8Array(e),n=i[0]===31&&i[1]===139,a=`Unable to parse the tile at ${t.request.url}, `;throw a+=n?\"please make sure the data is not gzipped and that you have configured the relevant header in the server\":`got error: ${ya(r).message}`,Error(a)}}async loadTile(t){let{uid:e,overzoomParameters:r}=t;r&&(t.request=r.overzoomRequest);let i=this._startRequestTiming(t),n=new d1(t);this.tileState.startLoading(e,n);let a=new AbortController;n.abort=a;try{let s=await tg(t.request,a),o=this.tileState.getLoaded(e);if(t.etag&&t.etag===s.etag&&o?.etag===s.etag)return this.tileState.finishLoading(e),this._getEtagUnmodifiedResult(s,i);let l=this.loadVectorTile(t,s.data);if(this.tileState.finishLoading(e),!l)return null;let{vectorTile:u,rawData:h}=l;r&&({vectorTile:u,rawData:h}=this._getOverzoomTile(t,u));let c=this._getExpiryData(s),p=this._finishRequestTiming(i);n.vectorTile=u,n.etag=s.etag,this.tileState.markLoaded(e,n);let f={rawData:h,cacheControl:c,resourceTiming:p};return this.tileState.setParsing(e,f),await this._parseWorkerTile(n,t)}catch(s){throw this.tileState.finishLoading(e),this.tileState.markLoaded(e,n),s}}_getEtagUnmodifiedResult(t,e){return Wt({etagUnmodified:!0},this._getExpiryData(t),this._finishRequestTiming(e))}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r,o=e.overzoomParameters?\"mvt\":e.encoding;i=Wt({rawTileData:n.slice(0),encoding:o},i,a,s),this.tileState.removeParsing(t.uid)}else t.etag&&(i=Wt(i,{etag:t.etag}));return i}_getExpiryData({expires:t,cacheControl:e,etag:r}){let i={};return t&&(i.expires=t),e&&(i.cacheControl=e),r&&(i.etag=r),i}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new m1(t.request.url)}_finishRequestTiming(t){let e=t?.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){let{tileID:r,source:i,overzoomParameters:n}=t,{maxZoomTileID:a}=n,s=`${a.key}_${r.key}_${t.request?.url}`,o=this.overzoomedTileResultCache.get(s);if(o)return o;let l=new p5,u=this.layerIndex.familiesBySource[i];for(let c in u){let p=e.layers[c];if(!p)continue;let f=f5(p,a,r.canonical);f.length>0&&l.addLayer(f)}let h={vectorTile:l,rawData:ky(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}},y5=class{constructor(){this.loaded={}}async loadTile(t){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=new xd(e,Al(i)?new Qt({width:l,height:u},await j1(i,-2,-2,l,u)):i,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=h,h}removeTile(t){let e=this.loaded,r=t.uid;e?.[r]&&delete e[r]}},xp=class{constructor(t){this.wraps=!1,this._crs=t,this._originX=t.tileMatrixSet.origin[0],this._originY=t.tileMatrixSet.origin[1],this._extent=t.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(t,e,r){let[i,n]=this._crs.projection.forward([t,e]);return new Sn((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(t,e){let r=_e(t,0,1),i=_e(e,0,1),n=this._inverse(t,e)??this._inverse(r,i)??this._inverseTowardCenter(r,i)??this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection \"${this._crs.name}\" has no answer inside its tile matrix set.`);return new Pa(n[0],_e(n[1],-90,90))}hasLngLat(t,e){return this._inverse(t,e)!==null}_inverse(t,e){let r=this._finiteInverse(t,e);if(!r)return null;let i=this._originX+t*this._extent,n=this._originY-e*this._extent,[a,s]=this._crs.projection.forward(r);return Math.hypot(a-i,s-n)<=.001*this._extent?r:null}_finiteInverse(t,e){let r;try{r=this._crs.projection.inverse([this._originX+t*this._extent,this._originY-e*this._extent])}catch{return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(t,e){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(t-.5)*a,.5+(e-.5)*a)?r=a:i=a}return this._inverse(.5+(t-.5)*r,.5+(e-.5)*r)}metersPerWorldUnit(t,e){return this._extent}worldZFromAltitude(t,e){return t/this._extent}get latitudeRange(){return this._latitudeRange??(this._latitudeRange=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)]),this._latitudeRange}_findLatitudeLimit(t){let e=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(e.lng,e.lat);if(!(r>0))return t;let i=Math.sign(t-e.lat);for(let n=e.lat;Math.abs(t-n)>1;n+=i)if(!(this._meridianStretch(e.lng,n+i)<=r))return n;return t}_meridianStretch(t,e){let[r,i]=this._crs.projection.forward([t,e]),[n,a]=this._crs.projection.forward([t,e>=0?e-.01:e+.01]);return Math.hypot(n-r,a-i)}},m5=class{forward(t){return[t[0],t[1]]}inverse(t){return[t[0],t[1]]}},g5=new class{constructor(){this.name=\"identity\",this.projection=new m5,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},_l=null,da=new Map;function x5(t){_l=t,da.clear()}function v5(t){if(!t.definition)return new xp(g5);if(!_l)Ct(\"GeoJSON sources are drawn in the wrong place: no projection handler is set in the workers, see `setProjectionHandler` in the custom CRS guide.\");else return da.has(t.definition)||da.set(t.definition,_l(t.definition)),new xp({name:t.name,definition:t.definition,projection:da.get(t.definition),tileMatrixSet:t.tileMatrixSet})}function Dl(t,e){let r=([s,o,...l])=>{let{x:u,y:h}=e.worldFromLngLat(s,o);return[u,h,...l]},[i,n]=e.latitudeRange;if(i===-90&&n===90)return Jr(t,r);let a=s=>s===i&&i>-90||s===n&&n<90;return Jr(t,r,s=>{let o=!1,l=s.map(p=>p[1]>=i&&p[1]<=n?r(p):(o=!0,p));if(!o)return l;let u=[],h=0,c=NaN;for(let p=0;p<s.length;p++){let[f,d,...y]=s[p],m=_e(d,i,n);if(m===c&&a(m)){let g=Math.ceil(Math.abs(f-h)/10);for(let x=1;x<g;x++)u.push(r([h+(f-h)*x/g,m]))}u.push(m===d?l[p]:r([f,m,...y])),h=f,c=m}return u})}function b5(t,e){return Jr(t,([r,i,...n])=>{let a=e.lngLatFromWorld(r,i);return[a.lng,a.lat,...n]})}function w5(t,e){let r={...t};return t.add&&(r.add=t.add.map(i=>Dl(i,e))),t.update&&(r.update=t.update.map(i=>i.newGeometry?{...i,newGeometry:Dl(i.newGeometry,e)}:i)),r}function Jr(t,e,r=i=>i.map(e)){if(!t||typeof t!=\"object\")return t;switch(t.type){case\"FeatureCollection\":return{...t,features:t.features.map(i=>Jr(i,e,r))};case\"Feature\":return{...t,geometry:t.geometry?Jr(t.geometry,e,r):t.geometry};case\"GeometryCollection\":return{...t,geometries:t.geometries.map(i=>Jr(i,e,r))};case\"Point\":return{...t,coordinates:e(t.coordinates)};case\"MultiPoint\":return{...t,coordinates:t.coordinates.map(e)};case\"LineString\":return{...t,coordinates:r(t.coordinates)};case\"MultiLineString\":case\"Polygon\":return{...t,coordinates:t.coordinates.map(i=>r(i))};case\"MultiPolygon\":return{...t,coordinates:t.coordinates.map(i=>i.map(n=>r(n)))};default:return t}}var _5=class{constructor(t,e,r,i=D5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new y1,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(\"Unable to parse the data into a cluster or geojson\");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new mw(n.features,{version:2,extent:xt});return{vectorTile:a,rawData:ky(a,\"__$json__:\").buffer}}async loadTile(t){let{uid:e}=t,r=new d1(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),await this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Wt({rawTileData:n.slice(0),encoding:\"mvt\"},i),this.tileState.removeParsing(t.uid)}return i}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}async loadData(t){this._pendingRequest?.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return t.request&&(r.data=t.data),this._finishRequestTiming(e,t,r),r}catch(r){if(delete this._pendingRequest,!_p(r))throw r;return{abandoned:!0}}}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new m1(t.request.url)}_finishRequestTiming(t,e,r){let i=t?.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return await this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async loadAndProcessGeoJSON(t,e){if(t.request&&(t.data=(await Q0(t.request,e)).data),this._crsHelper=t.crs?v5(t.crs):void 0,t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source);let r=this._crsHelper?Dl(t.data,this._crsHelper):t.data;this._geoJSONIndex=this._createGeoJSONIndex(r,t,this._crsHelper!==void 0)}else{if(t.dataDiff){this._geoJSONIndex??(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},t,this._crsHelper!==void 0));let r=this._crsHelper?w5(t.dataDiff,this._crsHelper):t.dataDiff;this._geoJSONIndex.updateData(r,this._getFilterPredicate(t.filter,t.source))}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,g1(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}}_filterGeoJSON(t,e,r){if(t.type!==\"FeatureCollection\")return t;let i=this._getFilterPredicate(e,r);return i?{type:\"FeatureCollection\",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!=\"boolean\"&&!t?.length)return;let r=gr(t,`sources.${e}.filter`,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(r.result===\"error\")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(\", \"));return i=>r.value.evaluate({zoom:0},i)}async removeSource(t){this._pendingRequest?.abort()}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._toLngLat(this._geoJSONIndex.getClusterChildren(t.clusterId))}getClusterLeaves(t){return this._toLngLat(this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset))}_toLngLat(t){return this._crsHelper?t.map(e=>b5(e,this._crsHelper)):t}};function D5(t,e,r){return new W2(t,Wt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:g1(e),coordinates:r?\"unitSquare\":\"lngLat\",wrap:!r}))}function g1({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=gr(h,`sources.${r}.clusterProperties.${l}[1]`),p=gr(typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}async function S5(t){if(t.endsWith(\".mjs\")){await import(t);return}let e=await fetch(t,{credentials:\"same-origin\"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=await e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:\"text/javascript\"}));try{await import(i)}finally{URL.revokeObjectURL(i)}}else globalThis.eval(r)}var A5=class{constructor(t){this.self=t,this.actor=new ng(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.importedScripts=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name \"${e}\" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=W0,this.self.removeProtocol=Z0,this.self.registerRTLTextPlugin=e=>{oi.setMethods(e)},this.self.makeRequest=Yl,this.self.setProjectionHandler=x5,this.actor.registerMessageHandler(\"LDT\",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RDT\",async(e,r)=>{this._getDEMWorkerSource(e,r.source).removeTile(r)}),this.actor.registerMessageHandler(\"GCEZ\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)),this.actor.registerMessageHandler(\"GCC\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)),this.actor.registerMessageHandler(\"GCL\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)),this.actor.registerMessageHandler(\"LD\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler(\"LT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler(\"AT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler(\"RMT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler(\"RS\",async(e,r)=>{if(!this.workerSources[e]?.[r.type]?.[r.source])return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)}),this.actor.registerMessageHandler(\"RM\",async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler(\"SR\",async(e,r)=>{this.referrer=r}),this.actor.registerMessageHandler(\"PI\",async()=>{}),this.actor.registerMessageHandler(\"SRPS\",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler(\"IS\",(e,r)=>this._importScript(r)),this.actor.registerMessageHandler(\"SI\",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler(\"UL\",async(e,r)=>{this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler(\"UGS\",async(e,r)=>{let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]}),this.actor.registerMessageHandler(\"SL\",async(e,r)=>{this._getLayerIndex(e).replace(r,this._getGlobalState(e))})}async _importScript(t){let e=this.importedScripts.get(t);if(e)return e;let r=S5(t);this.importedScripts.set(t,r);try{await r}catch(i){throw this.importedScripts.delete(t),i}}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}async _setImages(t,e){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}}async _syncRTLPluginState(t,e){return await oi.syncState(e,r=>this._importScript(r))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new a5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case\"vector\":this.workerSources[t][e][r]=new d5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case\"geojson\":this.workerSources[t][e][r]=new _5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new y5),this.demWorkerSources[t][e]}};Kr(self)&&(self.worker=new A5(self));})();\n";
|
|
1
|
+
export const maplibreWorkerSource = "/*!\nCopyright (c) 2023, MapLibre contributors\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n * Neither the name of MapLibre GL JS nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n-------------------------------------------------------------------------------\n\nContains code from mapbox-gl-js v1.13 and earlier\n\nVersion v1.13 of mapbox-gl-js and earlier are licensed under a BSD-3-Clause license\n\nCopyright (c) 2020, Mapbox\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n* Neither the name of Mapbox GL JS nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n-------------------------------------------------------------------------------\n\nContains code from glfx.js\n\nCopyright (C) 2011 by Evan Wallace\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n--------------------------------------------------------------------------------\n\nContains a portion of d3-color https://github.com/d3/d3-color\n\nCopyright 2010-2016 Mike Bostock\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n* Neither the name of the author nor the names of contributors may be used to\n endorse or promote products derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n(()=>{/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.19.0/LICENSE.txt\n*/var Z0=Object.create,Ef=Object.defineProperty,H0=Object.getOwnPropertyDescriptor,K0=Object.getOwnPropertyNames,J0=Object.getPrototypeOf,Tf=Object.prototype.hasOwnProperty,cu=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports),Q0=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(var n=K0(e),a=0,s=n.length,o;a<s;a++)o=n[a],!Tf.call(t,o)&&o!==r&&Ef(t,o,{get:(l=>e[l]).bind(null,o),enumerable:!(i=H0(e,o))||i.enumerable});return t},tm=(t,e,r)=>(r=t==null?{}:Z0(J0(t)),Q0(e||!t||!t.__esModule||!Tf.call(t,\"default\")?Ef(r,\"default\",{value:t,enumerable:!0}):r,t));function T(t,e){this.x=t,this.y=e}T.prototype={clone(){return new T(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:T},T.convert=function(t){if(t instanceof T)return t;if(Array.isArray(t))return new T(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new T(+t.x,+t.y);throw Error(\"Expected [x, y] or {x, y} point format\")};function em(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)<h)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=c;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-c)<h)break;c>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var ao;function rm(){return ao??(ao=typeof OffscreenCanvas<\"u\"&&!!new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),ao}var ha;function im(){if(ha==null&&(ha=!1,rm())){let t=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){ha=!0;break}}}return ha||!1}var gn=typeof Float32Array<\"u\"?Float32Array:Array;function hu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Oo(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],m=e[13],g=e[14],v=e[15],x=r[0],b=r[1],w=r[2],_=r[3];return t[0]=x*i+b*o+w*h+_*y,t[1]=x*n+b*l+w*p+_*m,t[2]=x*a+b*u+w*f+_*g,t[3]=x*s+b*c+w*d+_*v,x=r[4],b=r[5],w=r[6],_=r[7],t[4]=x*i+b*o+w*h+_*y,t[5]=x*n+b*l+w*p+_*m,t[6]=x*a+b*u+w*f+_*g,t[7]=x*s+b*c+w*d+_*v,x=r[8],b=r[9],w=r[10],_=r[11],t[8]=x*i+b*o+w*h+_*y,t[9]=x*n+b*l+w*p+_*m,t[10]=x*a+b*u+w*f+_*g,t[11]=x*s+b*c+w*d+_*v,x=r[12],b=r[13],w=r[14],_=r[15],t[12]=x*i+b*o+w*h+_*y,t[13]=x*n+b*l+w*p+_*m,t[14]=x*a+b*u+w*f+_*g,t[15]=x*s+b*c+w*d+_*v,t}function nm(t,e,r){var i=r[0],n=r[1],a=r[2],s,o,l,u,c,h,p,f,d,y,m,g;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*a+e[12],t[13]=e[1]*i+e[5]*n+e[9]*a+e[13],t[14]=e[2]*i+e[6]*n+e[10]*a+e[14],t[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(s=e[0],o=e[1],l=e[2],u=e[3],c=e[4],h=e[5],p=e[6],f=e[7],d=e[8],y=e[9],m=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=l,t[3]=u,t[4]=c,t[5]=h,t[6]=p,t[7]=f,t[8]=d,t[9]=y,t[10]=m,t[11]=g,t[12]=s*i+c*n+d*a+e[12],t[13]=o*i+h*n+y*a+e[13],t[14]=l*i+p*n+m*a+e[14],t[15]=u*i+f*n+g*a+e[15]),t}function If(t,e,r){var i=r[0],n=r[1],a=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function am(){var t=new gn(3);return gn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function sm(t){var e=new gn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ls(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function Ca(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function kf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function yr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Cf(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t}function Ce(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function mr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pu(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}function om(t,e,r,i){var n=e[0],a=e[1],s=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=s+i*(r[2]-s),t}var He=kf,Ro=ls;(function(){var t=am();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function lm(){var t=new gn(4);return gn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function um(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function cm(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Ve(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}var hm=um;(function(){var t=lm();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();var rt=8192;function Ra(t){return t instanceof Error?t:Error(typeof t==\"string\"?t:String(t))}function fu(){return new Float64Array(4)}function jt(){return new Float64Array(3)}function Ff(){return new Float64Array(16)}function pm(){let t=new Float32Array(16);return hu(t),t}function $o(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]}function fm(t,e,r){let i=t[0]*r[0]+t[1]*r[1]+t[2]*r[2],n=e[0]*r[0]+e[1]*r[1]+e[2]*r[2];return n===0?null:(-i-r[3])/n}function Jc(t,e){let r=$a(t,360),i=$a(e,360),n=i-r,a=i>r?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a}function $a(t,e){return(t%e+e)%e}function Qc(t,e,r){return t*(1-r)+e*r}function dm(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ym(t,e,r,i){return em(t,e,r,i)}ym(.25,.1,.25,1);function Qt(t,e,r){return Math.min(r,Math.max(e,t))}function ai(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function te(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function mm(t){return Math.log(t)/Math.LN2%1==0}function gm(t){return 2**t}function Na(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function xm(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function No(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!No(t[r],e[r]))return!1;return!0}if(typeof t==\"object\"&&t&&e!==null){if(typeof e!=\"object\"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!No(t[r],e[r]))return!1;return!0}return t===e}function pr(t){return Array.isArray(t)?t.map(pr):typeof t==\"object\"&&t?Na(t,pr):t}var th={};function Pt(t){th[t]||(typeof console<\"u\"&&console.warn(t),th[t]=!0)}function fr(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function mi(t){return typeof WorkerGlobalScope<\"u\"&&t!==void 0&&t instanceof WorkerGlobalScope}function du(t){return typeof ImageBitmap<\"u\"&&t instanceof ImageBitmap}function vm(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),c=Math.min(t.width,e+i),h=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:c-l,height:h-u},layout:[{offset:s,stride:o}]}}async function bm(t,e,r,i,n){if(typeof VideoFrame>\"u\")throw Error(\"VideoFrame not supported\");let a=new VideoFrame(t,{timestamp:0});try{let s=a?.format;if(!s||!(s.startsWith(\"BGR\")||s.startsWith(\"RGB\")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith(\"BGR\"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,vm(t,e,r,i,n)),o)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{a.close()}}var Gi,Xi;function wm(t,e,r,i,n){let a=t.width,s=t.height;Gi&&Xi||(Gi=new OffscreenCanvas(a,s),Xi=Gi.getContext(\"2d\",{willReadFrequently:!0})),Gi.width=a,Gi.height=s,Xi.drawImage(t,0,0,a,s);let o=Xi.getImageData(e,r,i,n);return Xi.clearRect(0,0,a,s),o.data}async function _m(t,e,r,i,n){if(im())try{return await bm(t,e,r,i,n)}catch{}return wm(t,e,r,i,n)}function eh(t,e,r,i){return t.addEventListener(e,r,i),{unsubscribe:()=>{t.removeEventListener(e,r,i)}}}function gi(t){return t*Math.PI/180}function rh(t,e,r){r[t]?.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function so(t,e,r){if(r?.[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var Mf=class{constructor(t,e={}){te(this,e),this.type=t}},Ua=class extends Mf{constructor(t,e={}){super(\"error\",te({error:t},e))}},Dm=class{on(t,e){return this._listeners||(this._listeners={}),rh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return so(t,e,this._listeners),so(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),rh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){let r=typeof t==\"string\"?new Mf(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let o of n)o.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let o of a)so(i,o,this._oneTimeListeners),o.call(this,r);let s=this._eventedParent;s&&(te(r,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),s.fire(r))}else r instanceof Ua&&console.error(r.error);return this}listens(t){return!!(this._listeners?.[t]?.length||this._oneTimeListeners?.[t]?.length||this._eventedParent?.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},ih=\"AbortError\",yu=class extends Error{constructor(t=ih){super(t instanceof Error?t.message:t),this.name=ih,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function Pf(t){return t instanceof Error&&t.name===\"AbortError\"}function Sm(t){if(t.aborted)throw new yu(t.reason)}var Uo=class Bf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let c=s[3+u],h=s[3+u+1];n.push(c===h?null:s.subarray(c,h))}let o=s[3+n.length],l=s[3+n.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let s=0;s<this.d*this.d;s++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;let a=i/r*e;this.min=-a,this.max=e+a}insert(e,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error(\"Cannot insert into a GridIndex created from an ArrayBuffer.\")}_insertCell(e,r,i,n,a,s){this.cells[a].push(s)}query(e,r,i,n,a){let s=this.min,o=this.max;if(e<=s&&r<=s&&o<=i&&o<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(e,r,i,n,this._queryCell,l,{},a),l}}_queryCell(e,r,i,n,a,s,o,l){let u=this.cells[a];if(u!==null){let c=this.keys,h=this.bboxes;for(let p of u)if(o[p]===void 0){let f=p*4;(l?l(h[f+0],h[f+1],h[f+2],h[f+3]):e<=h[f+2]&&r<=h[f+3]&&i>=h[f+0]&&n>=h[f+1])?(o[p]=!0,s.push(c[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=h;f++)for(let d=c;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s<e.length;s++){let o=e[s];n[3+s]=a,n.set(o,a),a+=o.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(e,r){let i=e.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(e){return new Bf(e.buffer)}},Lf={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\",length:2},centerAltitude:{type:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},roll:{type:\"number\",default:0,units:\"degrees\"},state:{type:\"state\",default:{}},light:{type:\"light\"},sky:{type:\"sky\"},projection:{type:\"projection\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},\"font-faces\":{type:\"fontFaces\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_vector\",\"source_raster\",\"source_raster_dem\",\"source_geojson\",\"source_video\",\"source_image\"],source_vector:{type:{required:!0,type:\"enum\",values:{vector:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},sparse:{type:\"boolean\",default:!1},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},attribution:{type:\"string\"},promoteId:{type:\"promoteId\"},volatile:{type:\"boolean\",default:!1},encoding:{type:\"enum\",values:{mvt:{},mlt:{}},default:\"mvt\"},\"*\":{type:\"*\"}},source_raster:{type:{required:!0,type:\"enum\",values:{raster:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},attribution:{type:\"string\"},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_raster_dem:{type:{required:!0,type:\"enum\",values:{\"raster-dem\":{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},attribution:{type:\"string\"},encoding:{type:\"enum\",values:{terrarium:{},mapbox:{},custom:{}},default:\"mapbox\"},redFactor:{type:\"number\",default:1},blueFactor:{type:\"number\",default:1},greenFactor:{type:\"number\",default:1},baseShift:{type:\"number\",default:0},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:{geojson:{}}},data:{required:!0,type:\"*\"},maxzoom:{type:\"number\",default:18},attribution:{type:\"string\"},buffer:{type:\"number\",default:128,maximum:512,minimum:0},filter:{type:\"filter\"},tolerance:{type:\"number\",default:.375},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:50,minimum:0},clusterMaxZoom:{type:\"number\"},clusterMinPoints:{type:\"number\"},clusterProperties:{type:\"*\"},lineMetrics:{type:\"boolean\",default:!1},generateId:{type:\"boolean\",default:!1},promoteId:{type:\"promoteId\"}},source_video:{type:{required:!0,type:\"enum\",values:{video:{}}},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:{image:{}}},url:{type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},\"fill-extrusion\":{},raster:{},hillshade:{},\"color-relief\":{},background:{}},required:!0},metadata:{type:\"*\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:24},maxzoom:{type:\"number\",minimum:0,maximum:24},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_heatmap\",\"layout_fill-extrusion\",\"layout_symbol\",\"layout_raster\",\"layout_hillshade\",\"layout_color-relief\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_fill:{\"fill-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_circle:{\"circle-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-rounded-corner-distance\":{type:\"number\",default:0,minimum:0,units:\"meters\",\"property-type\":\"constant\"}},layout_line:{\"line-cap\":{type:\"enum\",values:{butt:{},round:{},square:{}},default:\"butt\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-join\":{type:\"enum\",values:{bevel:{},round:{},miter:{}},default:\"miter\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-miter-limit\":{type:\"number\",default:2,requires:[{\"line-join\":\"miter\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-round-limit\":{type:\"number\",default:1.05,requires:[{\"line-join\":\"round\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",values:{point:{},line:{},\"line-center\":{}},default:\"point\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-avoid-edges\":{type:\"boolean\",default:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-z-order\":{type:\"enum\",values:{auto:{},\"viewport-y\":{},source:{}},default:\"auto\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"!\":\"icon-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-optional\":{type:\"boolean\",default:!1,requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-size\":{type:\"number\",default:1,minimum:0,units:\"factor of the original icon size\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-text-fit\":{type:\"enum\",values:{none:{},width:{},height:{},both:{}},default:\"none\",requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",requires:[\"icon-image\",\"text-field\",{\"icon-text-fit\":[\"both\",\"width\",\"height\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-image\":{type:\"resolvedImage\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-padding\":{type:\"padding\",default:[2],units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-keep-upright\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},\"viewport-glyph\":{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-field\":{type:\"formatted\",default:\"\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-font\":{type:\"array\",value:\"string\",default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-line-height\":{type:\"number\",default:1.2,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-letter-spacing\":{type:\"number\",default:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-justify\":{type:\"enum\",values:{auto:{},left:{},center:{},right:{}},default:\"center\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-radial-offset\":{type:\"number\",units:\"ems\",default:0,requires:[\"text-field\"],\"property-type\":\"data-driven\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]}},\"text-variable-anchor\":{type:\"array\",value:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-variable-anchor-offset\":{type:\"variableAnchorOffsetCollection\",requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"text-field\",{\"!\":\"text-variable-anchor\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",requires:[\"text-field\",{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-writing-mode\":{type:\"array\",value:\"enum\",values:{horizontal:{},vertical:{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-keep-upright\":{type:\"boolean\",default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-transform\":{type:\"enum\",values:{none:{},uppercase:{},lowercase:{}},default:\"none\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",length:2,default:[0,0],requires:[\"text-field\",{\"!\":\"text-radial-offset\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"text-field\",{\"!\":\"text-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-optional\":{type:\"boolean\",default:!1,requires:[\"text-field\",\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-height-offset\":{type:\"number\",default:0,units:\"meters\",requires:[{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-height-anchor\":{type:\"enum\",values:{ground:{},absolute:{}},default:\"ground\",requires:[\"symbol-height-offset\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_color-relief\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},filter:{type:\"boolean\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},filter_operator:{type:\"enum\",values:{\"==\":{},\"!=\":{},\">\":{},\">=\":{},\"<\":{},\"<=\":{},in:{},\"!in\":{},all:{},any:{},none:{},has:{},\"!has\":{}}},geometry_type:{type:\"enum\",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:\"expression\"},stops:{type:\"array\",value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:{identity:{},exponential:{},interval:{},categorical:{}},default:\"exponential\"},colorSpace:{type:\"enum\",values:{rgb:{},lab:{},hcl:{},oklch:{},oklab:{}},default:\"rgb\"},default:{type:\"*\",required:!1}},function_stop:{type:\"array\",minimum:0,maximum:24,value:[\"number\",\"color\"],length:2},expression:{type:\"array\",value:\"expression_name\",minimum:1},light:{anchor:{type:\"enum\",default:\"viewport\",values:{map:{},viewport:{}},\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]}},position:{type:\"array\",default:[1.15,210,30],length:3,value:\"number\",\"property-type\":\"data-constant\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]}},color:{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},intensity:{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},sky:{\"sky-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#88C6FC\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-ground-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-fog-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"sky-horizon-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"atmosphere-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},terrain:{source:{type:\"string\",required:!0},exaggeration:{type:\"number\",minimum:0,default:1}},projection:{type:{type:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",default:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-outline-color\":{type:\"color\",transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"}},\"paint_fill-extrusion\":{\"fill-extrusion-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-extrusion-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\",\"elevation\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-extrusion-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-extrusion-height\":{type:\"number\",default:0,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default:0,units:\"meters\",transition:!0,requires:[\"fill-extrusion-height\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-vertical-gradient\":{type:\"boolean\",default:!0,transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_line:{\"line-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"line-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-gradient\":{type:\"color\",transition:!1,requires:[{\"!\":\"line-dasharray\"},{\"!\":\"line-pattern\"},{source:\"geojson\",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[\"line-progress\"]},\"property-type\":\"color-ramp\"}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-blur\":{type:\"number\",default:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"circle-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-scale\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-stroke-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"}},paint_heatmap:{\"heatmap-radius\":{type:\"number\",default:30,minimum:1,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-weight\":{type:\"number\",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-intensity\":{type:\"number\",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"heatmap-color\":{type:\"color\",default:[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",.1,\"royalblue\",.3,\"cyan\",.5,\"lime\",.7,\"yellow\",1,\"red\"],transition:!1,expression:{interpolated:!0,parameters:[\"heatmap-density\"]},\"property-type\":\"color-ramp\"},\"heatmap-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"icon-image\",\"icon-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-color\":{type:\"color\",default:\"#000000\",transition:!0,overridable:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"text-field\",\"text-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,transition:!0,units:\"degrees\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-min\":{type:\"number\",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-max\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-resampling\":{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,transition:!1,units:\"milliseconds\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_hillshade:{\"hillshade-illumination-direction\":{type:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-exaggeration\":{type:\"number\",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-shadow-color\":{type:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",default:\"#FFFFFF\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-accent-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"background-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"background-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}},\"property-type\":{\"data-driven\":{type:\"property-type\"},\"cross-faded\":{type:\"property-type\"},\"cross-faded-data-driven\":{type:\"property-type\"},\"color-ramp\":{type:\"property-type\"},\"data-constant\":{type:\"property-type\"},constant:{type:\"property-type\"}},promoteId:{\"*\":{type:\"string\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}},D=Lf,Am=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"],I=class{constructor(t,e,r,i,n=\"error\"){this.message=(t?`${t}: `:\"\")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},Fe=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},Em=class zf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new zf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Vn={kind:\"null\"},P={kind:\"number\"},Y={kind:\"string\"},J={kind:\"boolean\"},De={kind:\"color\"},us={kind:\"projectionDefinition\"},Mr={kind:\"object\"},Z={kind:\"value\"},Tm={kind:\"error\"},cs={kind:\"collator\"},On={kind:\"formatted\"},hs={kind:\"padding\"},xn={kind:\"colorArray\"},ps={kind:\"numberArray\"},Rn={kind:\"resolvedImage\"},fs={kind:\"variableAnchorOffsetCollection\"};function Xt(t,e){return{kind:\"array\",itemType:t,N:e}}function bt(t){if(t.kind===\"array\"){let e=bt(t.itemType);return typeof t.N==\"number\"?`array<${e}, ${t.N}>`:t.itemType.kind===\"value\"?\"array\":`array<${e}>`}return t.kind}var Im=[Vn,P,Y,J,De,us,On,Mr,Xt(Z),hs,ps,xn,Rn,fs];function vn(t,e){if(e.kind===\"error\")return null;if(t.kind===\"array\"){if(e.kind===\"array\"&&(e.N===0&&e.itemType.kind===\"value\"||!vn(t.itemType,e.itemType))&&(typeof t.N!=\"number\"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind===\"value\"){for(let r of Im)if(!vn(r,e))return null}}return`Expected ${bt(t)} but found ${bt(e)} instead.`}function mu(t,e){return e.some(r=>r.kind===t.kind)}function Pr(t,e){return e.some(r=>r===\"null\"?t===null:r===\"array\"?Array.isArray(t):r===\"object\"?t&&!Array.isArray(t)&&typeof t==\"object\":r===typeof t)}function sr(t,e){return t.kind===\"array\"&&e.kind===\"array\"?t.itemType.kind===e.itemType.kind&&typeof t.N==\"number\":t.kind===e.kind}var Vf=.96422,Of=.82521,Rf=4/29,jo=6/29,$f=3*jo*jo,Nf=Math.PI/180,gu=180/Math.PI;function xu(t){return t%=360,t<0&&(t+=360),t}function Uf([t,e,r,i]){t=Be(t),e=Be(e),r=Be(r);let n,a,s=oo((.2225045*t+.7168786*e+.0606169*r)/1);return t===e&&e===r?n=a=s:(n=oo((.4360747*t+.3850649*e+.1430804*r)/Vf),a=oo((.0139322*t+.0971045*e+.7141733*r)/Of)),[116*s-16,500*(n-s),200*(s-a),i]}function Be(t){let e=Math.abs(t);return e<=.04045?t/12.92:Math.sign(t)*((e+.055)/1.055)**2.4}function oo(t){return t>.008856451679035631?t**(1/3):t/$f+Rf}function jf([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*uo(n),a=Vf*uo(a),s=Of*uo(s),[lo(3.1338561*a-1.6168667*n-.4906146*s),lo(-.9787684*a+1.9161415*n+.033454*s),lo(.0719453*a-.2289914*n+1.4052427*s),i]}function lo(t){let e=Math.abs(t);return e<=.00304?12.92*t:Math.sign(t)*(1.055*e**(1/2.4)-.055)}function uo(t){return t>jo?t*t*t:$f*(t-Rf)}function km(t){let[e,r,i,n]=Uf(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?xu(Math.atan2(i,r)*gu):NaN,a,e,n]}function Cm([t,e,r,i]){return t=isNaN(t)?0:t*Nf,jf([r,Math.cos(t)*e,Math.sin(t)*e,i])}function Fm([t,e,r,i]){t=xu(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var qf=[[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],Gf=[[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],Mm=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Pm=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Bm=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Lm=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]];function Le(t,[e,r,i]){return[t[0][0]*e+t[0][1]*r+t[0][2]*i,t[1][0]*e+t[1][1]*r+t[1][2]*i,t[2][0]*e+t[2][1]*r+t[2][2]*i]}function un(t){let e=Math.abs(t);return e>.0031308?Math.sign(t)*(1.055*e**(1/2.4)-.055):12.92*t}function Xf([t,e,r]){let[i,n,a]=Le(Mm,Le(qf,[Be(t),Be(e),Be(r)]));return Le(Pm,[Math.cbrt(i),Math.cbrt(n),Math.cbrt(a)])}function zm(t){let[e,r,i]=Le(Bm,t),[n,a,s]=Le(Gf,Le(Lm,[e*e*e,r*r*r,i*i*i]));return[un(n),un(a),un(s)]}function Vm([t,e,r,i]){let[n,a,s]=Xf([t,e,r]);return[n,a,s,i]}function Om([t,e,r,i]){let[n,a,s]=Xf([t,e,r]),o=Math.sqrt(a*a+s*s);return o<=4e-6?[n,0,NaN,i]:[n,o,xu(Math.atan2(s,a)*gu),i]}function vu([t,e,r,i]){let n=isNaN(r)?0:r*Nf,a=Math.min(e,1e6),[s,o,l]=zm([t,a*Math.cos(n),a*Math.sin(n)]);return[s,o,l,i]}function Yf([t,e,r,i]){return vu([t,Math.hypot(e,r),Math.atan2(r,e)*gu,i])}var Rm=[[608311/1250200,189793/714400,198249/1000160],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],$m=[[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]];function Nm([t,e,r,i]){let[n,a,s]=[t,e,r].map(c=>Be(Math.min(Math.max(c,-1e6),1e6))),[o,l,u]=Le(Gf,Le(Rm,[n,a,s])).map(un);return[o,l,u,i]}function Um([t,e,r,i]){let[n,a,s]=Le($m,Le(qf,[Be(t),Be(e),Be(r)])).map(o=>Math.min(Math.max(un(o),0),1));return[n,a,s,i]}var jm=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function cn(t,e){return jm(t,e)?t[e]:void 0}function qm(t){if(t=t.toLowerCase().trim(),t===\"transparent\")return[0,0,0,0];let e=cn(Wm,t);if(e){let[s,o,l]=e;return[s/255,o/255,l/255,1]}if(t.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let s=t.length<6?1:2,o=1;return[pa(t.slice(o,o+=s)),pa(t.slice(o,o+=s)),pa(t.slice(o,o+=s)),pa(t.slice(o,o+s)||\"ff\")]}if(t.startsWith(\"rgb\")){let s=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(s){let[o,l,u,c,h,p,f,d,y,m,g,v]=s,x=[c||\" \",f||\" \",m].join(\"\");if(x===\" \"||x===\" /\"||x===\",,\"||x===\",,,\"){let b=[u,p,y].join(\"\"),w=b===\"%%%\"?100:b===\"\"?255:0;if(w){let _=[be(+l/w,0,1),be(+h/w,0,1),be(+d/w,0,1),g?ah(+g,v):1];if(sh(_))return _}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[s,o,l,u,c,h,p,f,d]=r,y=[l||\" \",c||\" \",p].join(\"\");if(y===\" \"||y===\" /\"||y===\",,\"||y===\",,,\"){let m=[+o,be(+u,0,100),be(+h,0,100),f?ah(+f,d):1];if(sh(m))return Fm(m)}}let i=t.match(Gm);if(i){let[,s,o,l,u]=i,c=[he(s,1),he(o,.4),he(l,1),u===void 0?1:he(u,1)];if(c.every(Number.isFinite))return vu([be(c[0],0,1),Math.max(c[1],0),c[2]%360,be(c[3],0,1)])}let n=t.match(Xm);if(n){let[,s,o,l,u]=n,c=[he(s,1),he(o,.4),he(l,.4),u===void 0?1:he(u,1)];if(c.every(Number.isFinite))return Yf([be(c[0],0,1),c[1],c[2],be(c[3],0,1)])}let a=t.match(Ym);if(a){let[,s,o,l,u]=a,c=[he(s,1),he(o,1),he(l,1),u===void 0?1:he(u,1)];if(c.every(Number.isFinite))return Nm([c[0],c[1],c[2],be(c[3],0,1)])}}var me=\"[+-]?(?:\\\\d+(?:\\\\.\\\\d+)?|\\\\.\\\\d+)(?:e[+-]?\\\\d+)?\",Gm=RegExp(`^oklch\\\\(\\\\s*(none|${me}%?)\\\\s+(none|${me}%?)\\\\s+(none|${me}(?:deg|grad|rad|turn)?)\\\\s*(?:\\\\/\\\\s*(none|${me}%?)\\\\s*)?\\\\)$`),Xm=RegExp(`^oklab\\\\(\\\\s*(none|${me}%?)\\\\s+(none|${me}%?)\\\\s+(none|${me}%?)\\\\s*(?:\\\\/\\\\s*(none|${me}%?)\\\\s*)?\\\\)$`),Ym=RegExp(`^color\\\\(\\\\s*display-p3\\\\s+(none|${me}%?)\\\\s+(none|${me}%?)\\\\s+(none|${me}%?)\\\\s*(?:\\\\/\\\\s*(none|${me}%?)\\\\s*)?\\\\)$`),nh={deg:1,grad:.9,rad:180/Math.PI,turn:360};function he(t,e){if(t===\"none\")return 0;let[,r,i]=t.match(/^(.+?)(%|[a-z]+)?$/);return i===\"%\"?r/100*e:i?+r%(360/nh[i])*nh[i]:+r}function pa(t){return parseInt(t.padEnd(2,t),16)/255}function ah(t,e){return be(e?t/100:t,0,1)}function be(t,e,r){return Math.min(Math.max(e,t),r)}function sh(t){return!t.some(Number.isNaN)}var Wm={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Gt(t,e,r){return t+r*(e-t)}function xi(t,e,r){return t.map((i,n)=>Gt(i,e[n],r))}function Zm(t){return t===\"rgb\"||t===\"hcl\"||t===\"lab\"||t===\"oklch\"||t===\"oklab\"}var Ct,dt=(Ct=class{constructor(e,r,i,n=1,a=!0){!a&&(Math.min(e,r,i)<0||Math.max(e,r,i)>1)&&(this.overwriteGetter(\"unclippedRgb\",[e,r,i,n]),e=Math.min(Math.max(e,0),1),r=Math.min(Math.max(r,0),1),i=Math.min(Math.max(i,0),1)),this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter(\"rgb\",[e,r,i,n]))}static parse(e){if(e instanceof Ct)return e;if(typeof e!=\"string\")return;let r=qm(e);if(r)return new Ct(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter(\"rgb\",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter(\"hcl\",km(this.unclippedRgb))}get lab(){return this.overwriteGetter(\"lab\",Uf(this.unclippedRgb))}get oklch(){return this.overwriteGetter(\"oklch\",Om(this.unclippedRgb))}get oklab(){return this.overwriteGetter(\"oklab\",Vm(this.unclippedRgb))}get displayP3(){return this.overwriteGetter(\"displayP3\",Um(this.unclippedRgb))}get unclippedRgb(){return this.rgb}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(\",\")},${n})`}static interpolate(e,r,i,n=\"rgb\"){switch(n){case\"rgb\":{let[a,s,o,l]=xi(e.unclippedRgb,r.unclippedRgb,i);return new Ct(a,s,o,l,!1)}case\"hcl\":{let[a,s,o,l]=e.hcl,[u,c,h,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let x=u-a;u>a&&x>180?x-=360:u<a&&a-u>180&&(x+=360),f=a+i*x}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=c)):(f=a,(h===1||h===0)&&(d=s));let[y,m,g,v]=Cm([f,d??Gt(s,c,i),Gt(o,h,i),Gt(l,p,i)]);return new Ct(y,m,g,v,!1)}case\"lab\":{let[a,s,o,l]=jf(xi(e.lab,r.lab,i));return new Ct(a,s,o,l,!1)}case\"oklch\":{let[a,s,o,l]=e.oklch,[u,c,h,p]=r.oklch,f=isNaN(o)?h:o,d=isNaN(h)?o:h;d-f>180?f+=360:d-f<-180&&(d+=360);let y=Gt(l,p,i),m=y===0?1:y,[g,v,x]=vu([Gt(a*l,u*p,i)/m,Gt(s*l,c*p,i)/m,Gt(f,d,i),y]);return new Ct(g,v,x,y,!1)}case\"oklab\":{let[a,s,o,l]=e.oklab,[u,c,h,p]=r.oklab,f=Gt(l,p,i),d=f===0?1:f,[y,m,g]=Yf([Gt(a*l,u*p,i)/d,Gt(s*l,c*p,i)/d,Gt(o*l,h*p,i)/d,f]);return new Ct(y,m,g,f,!1)}}}},Ct.black=new Ct(0,0,0,1),Ct.white=new Ct(1,1,1,1),Ct.transparent=new Ct(0,0,0,0),Ct.red=new Ct(1,0,0,1),Ct),bu=class{constructor(t,e,r){this.sensitivity=t?e?\"variant\":\"case\":e?\"accent\":\"base\",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Hm=[\"bottom\",\"center\",\"top\"],qo=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},Ke=class Fa{constructor(e){this.sections=e}static fromString(e){return new Fa([new qo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Fa?e:Fa.fromString(e)}toString(){return this.sections.length===0?\"\":this.sections.map(e=>e.text).join(\"\")}},$e=class tn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof tn)return e;if(typeof e==\"number\")return new tn([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!=\"number\")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new tn(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new tn(xi(e.values,r.values,i))}},Ne=class en{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof en)return e;if(typeof e==\"number\")return new en([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!=\"number\")return;return new en(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new en(xi(e.values,r.values,i))}},Jt=class rn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rn)return e;if(typeof e==\"string\"){let i=dt.parse(e);return i?new rn([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!=\"string\")return;let n=dt.parse(i);if(!n)return;r.push(n)}return new rn(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n=\"rgb\"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s<e.values.length;s++)a.push(dt.interpolate(e.values[s],r.values[s],i,n));return new rn(a)}},mt=class extends Error{constructor(t,e){super(t),this.name=\"RuntimeError\",this.path=e}toJSON(){return this.message}},Km=new Set([\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"]),Oe=class Ma{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ma)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!=0)){for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];if(typeof i!=\"string\"||!Km.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!=\"number\"||typeof n[1]!=\"number\")return}return new Ma(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n){let a=e.values,s=r.values;if(a.length!==s.length)throw new mt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`,n);let o=[];for(let l=0;l<a.length;l+=2){if(a[l]!==s[l])throw new mt(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${s[l]}`,n);o.push(a[l]);let[u,c]=a[l+1],[h,p]=s[l+1];o.push([Gt(u,h,i),Gt(c,p,i)])}return new Ma(o)}},Re=class Wf{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Wf({name:e,available:!1}):null}},Rr=class ti{constructor(e,r,i){this.from=e,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(e,r,i){return new ti(e,r,i)}static parse(e){if(e instanceof ti)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]==\"string\"&&typeof e[1]==\"string\"&&typeof e[2]==\"number\")return new ti(e[0],e[1],e[2]);if(typeof e==\"object\"&&typeof e.from==\"string\"&&typeof e.to==\"string\"&&typeof e.transition==\"number\")return new ti(e.from,e.to,e.transition);if(typeof e==\"string\")return new ti(e,e,1)}};function Zf(t,e,r,i){return typeof t==\"number\"&&t>=0&&t<=255&&typeof e==\"number\"&&e>=0&&e<=255&&typeof r==\"number\"&&r>=0&&r<=255?i===void 0||typeof i==\"number\"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i==\"number\"?[t,e,r,i]:[t,e,r]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function vi(t){if(t===null||typeof t==\"string\"||typeof t==\"boolean\"||typeof t==\"number\"||t instanceof Rr||t instanceof dt||t instanceof bu||t instanceof Ke||t instanceof $e||t instanceof Ne||t instanceof Jt||t instanceof Oe||t instanceof Re)return!0;if(Array.isArray(t)){for(let e of t)if(!vi(e))return!1;return!0}if(typeof t==\"object\"){for(let e in t)if(!vi(t[e]))return!1;return!0}return!1}function Tt(t){if(t===null)return Vn;if(typeof t==\"string\")return Y;if(typeof t==\"boolean\")return J;if(typeof t==\"number\")return P;if(t instanceof dt)return De;if(t instanceof Rr)return us;if(t instanceof bu)return cs;if(t instanceof Ke)return On;if(t instanceof $e)return hs;if(t instanceof Ne)return ps;if(t instanceof Jt)return xn;if(t instanceof Oe)return fs;if(t instanceof Re)return Rn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=Tt(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Xt(r||Z,e)}return Mr}function hn(t){let e=typeof t;return t===null?\"\":e===\"string\"||e===\"number\"||e===\"boolean\"?String(t):t instanceof dt||t instanceof Rr||t instanceof Ke||t instanceof $e||t instanceof Ne||t instanceof Jt||t instanceof Oe||t instanceof Re?t.toString():JSON.stringify(t)}var bi=class Hf{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!vi(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=Tt(i),a=r.expectedType;return n.kind===\"array\"&&n.N===0&&a&&a.kind===\"array\"&&(typeof a.N!=\"number\"||a.N===0)&&(n=a),new Hf(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},fa={string:Y,number:P,boolean:J,object:Mr},Xe=class Kf{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=1,n,a=e[0];if(a===\"array\"){let o;if(e.length>2){let u=e[1];if(typeof u!=\"string\"||!(u in fa)||u===\"object\")return r.error('The item type argument of \"array\" must be one of string, number, boolean',1);o=fa[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=\"number\"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to \"array\" must be a positive integer literal',2);l=e[2],i++}n=Xt(o,l)}else{if(!fa[a])throw Error(`Types doesn't contain name = ${a}`);n=fa[a]}let s=[];for(;i<e.length;i++){let o=r.parse(e[i],i,Z);if(!o)return null;s.push(o)}return new Kf(n,s,r.key)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(!vn(this.type,Tt(i)))return i;if(r===this.args.length-1)throw new mt(`Expected value to be of type ${bt(this.type)}, but found ${bt(Tt(i))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},oh={\"to-boolean\":J,\"to-color\":De,\"to-number\":P,\"to-string\":Y},si=class Jf{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[0];if(!oh[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i===\"to-boolean\"||i===\"to-string\")&&e.length!==2)return r.error(\"Expected one argument.\");let n=oh[i],a=[];for(let s=1;s<e.length;s++){let o=r.parse(e[s],s,Z);if(!o)return null;a.push(o)}return new Jf(n,a,r.key)}evaluate(e){switch(this.type.kind){case\"boolean\":return!!this.args[0].evaluate(e);case\"color\":{let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof dt)return r;if(typeof r==\"string\"){let a=e.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Zf(r[0],r[1],r[2],r[3]),!i))return new dt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new mt(i||`Could not parse color from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"padding\":{let r;for(let i of this.args){r=i.evaluate(e);let n=$e.parse(r);if(n)return n}throw new mt(`Could not parse padding from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"numberArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ne.parse(r);if(n)return n}throw new mt(`Could not parse numberArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"colorArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Jt.parse(r);if(n)return n}throw new mt(`Could not parse colorArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"variableAnchorOffsetCollection\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Oe.parse(r);if(n)return n}throw new mt(`Could not parse variableAnchorOffsetCollection from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"number\":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new mt(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case\"formatted\":return Ke.fromString(hn(this.args[0].evaluate(e)));case\"resolvedImage\":return Re.fromString(hn(this.args[0].evaluate(e)));case\"projectionDefinition\":{let r=this.args[0].evaluate(e);if(Rr.parse(r))return r;throw new mt(`Could not parse projectionDefinition from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}default:return hn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Jm=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],Qf=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&\"id\"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==\"number\"?Jm[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&\"geometry\"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=dt.parse(t),this._parseColorCache.set(t,e)),e}},td=class ed{constructor(e,r,i=[],n,a=new Em,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(\"\"),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e==\"string\"||typeof e==\"boolean\"||typeof e==\"number\")&&(e=[\"literal\",e]);let i=this.key;function n(a,s,o){return o===\"assert\"?new Xe(s,[a],i):o===\"coerce\"?new si(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let a=e[0];if(typeof a!=\"string\")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind===\"string\"||l.kind===\"number\"||l.kind===\"boolean\"||l.kind===\"object\"||l.kind===\"array\")&&u.kind===\"value\")o=n(o,l,r.typeAnnotation||\"assert\");else if(l.kind===\"projectionDefinition\"&&[\"string\",\"array\",\"value\"].includes(u.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(l.kind)&&[\"value\",\"string\"].includes(u.kind)||[\"padding\",\"numberArray\"].includes(l.kind)&&[\"value\",\"number\",\"array\"].includes(u.kind)||l.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(u.kind)||l.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(u.kind))o=n(o,l,r.typeAnnotation||\"coerce\");else if(this.checkSubtype(l,u))return null}if(!(o instanceof bi)&&o.type.kind!==\"resolvedImage\"&&this._isConstant(o)){let l=new Qf;try{o=new bi(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression \"${a}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return e===void 0?this.error(\"'undefined' value invalid. Use null instead.\"):typeof e==\"object\"?this.error('Bare objects invalid. Use [\"literal\", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e==\"number\"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new ed(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join(\"\")}`;this.errors.push(new Fe(i,e))}checkSubtype(e,r){let i=vn(e,r);return i&&this.error(i),i}},rd=class id{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a<e.length-1;a+=2){let s=e[a];if(typeof s!=\"string\")return r.error(`Expected string, but found ${typeof s} instead.`,a);if(/[^a-zA-Z0-9_]/.test(s))return r.error(\"Variable names must contain only alphanumeric characters or '_'.\",a);let o=r.parse(e[a+1],a+1);if(!o)return null;i.push([s,o])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new id(i,n):null}outputDefined(){return this.result.outputDefined()}},nd=class ad{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!=\"string\")return r.error(\"'var' expression requires exactly one string literal argument.\");let i=e[1];return r.scope.has(i)?new ad(i,r.scope.get(i)):r.error(`Unknown variable \"${i}\". Make sure \"${i}\" has been bound in an enclosing \"let\" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},Qm=class sd{constructor(e,r,i,n){this.type=e,this.index=r,this.input=i,this.key=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,P),n=r.parse(e[2],2,Xt(r.expectedType||Z));if(!i||!n)return null;let a=n.type;return new sd(a.itemType,i,n,r.key)}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new mt(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new mt(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new mt(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},tg=class od{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=J}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:mu(i.type,[J,Y,P,Vn,Z])?new od(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Pr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new mt(`Expected first argument to be of type boolean, string, number or null, but found ${bt(Tt(r))} instead.`,this.key);if(!Pr(i,[\"string\",\"array\"]))throw new mt(`Expected second argument to be of type array or string, but found ${bt(Tt(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},eg=class Go{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=P}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!mu(i.type,[J,Y,P,Vn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,P);return a?new Go(i,n,r.key,a):null}return new Go(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Pr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new mt(`Expected first argument to be of type boolean, string, number or null, but found ${bt(Tt(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Pr(i,[\"string\"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(Pr(i,[\"array\"]))return i.indexOf(r,n);throw new mt(`Expected second argument to be of type array or string, but found ${bt(Tt(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},rg=class ld{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error(\"Expected an even number of arguments.\");let i,n;r.expectedType&&r.expectedType.kind!==\"value\"&&(n=r.expectedType);let a={},s=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],h=e[u+1];Array.isArray(c)||(c=[c]);let p=r.concat(u);if(c.length===0)return p.error(\"Expected at least one branch label.\");for(let d of c){if(typeof d!=\"number\"&&typeof d!=\"string\")return p.error(\"Branch labels must be numbers or strings.\");if(typeof d==\"number\"&&Math.abs(d)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d==\"number\"&&Math.floor(d)!==d)return p.error(\"Numeric branch labels must be integer values.\");if(!i)i=Tt(d);else if(p.checkSubtype(i,Tt(d)))return null;if(a[String(d)]!==void 0)return p.error(\"Branch labels must be unique.\");a[String(d)]=s.length}let f=r.parse(h,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!==\"value\"&&r.concat(1).checkSubtype(i,o.type)?null:new ld(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(Tt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},ig=class ud{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error(\"Expected an odd number of arguments.\");let i;r.expectedType&&r.expectedType.kind!==\"value\"&&(i=r.expectedType);let n=[];for(let s=1;s<e.length-1;s+=2){let o=r.parse(e[s],s,J);if(!o)return null;let l=r.parse(e[s+1],s+1,i);if(!l)return null;n.push([o,l]),i||(i=l.type)}let a=r.parse(e[e.length-1],e.length-1,i);if(!a)return null;if(!i)throw Error(\"Can't infer output type\");return new ud(i,n,a)}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},ng=class Xo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,P);if(!i||!n)return null;if(!mu(i.type,[Xt(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${bt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,P);return a?new Xo(i.type,i,n,r.key,a):null}return new Xo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Pr(r,[\"string\"]))return[...r].slice(i,n).join(\"\");if(Pr(r,[\"array\"]))return r.slice(i,n);throw new mt(`Expected first argument to be of type array or string, but found ${bt(Tt(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function ds(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||e<l)return s;n=s+1}else if(o>e)a=s-1;else throw new mt(\"Input is not a number.\",r);return 0}var wu=class cd{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");let i=r.parse(e[1],1,P);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!==\"value\"&&(a=r.expectedType);for(let s=1;s<e.length;s+=2){let o=s===1?-1/0:e[s],l=e[s+1],u=s,c=s+1;if(typeof o!=\"number\")return r.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return r.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',u);let h=r.parse(l,c,a);if(!h)return null;a||(a=h.type),n.push([o,h])}return new cd(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[ds(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function ag(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)<h)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=c;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-c)<h)break;c>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var ye=class Yo{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name===\"exponential\")a=co(r,e.base,i,n);else if(e.name===\"linear\")a=co(r,1,i,n);else if(e.name===\"cubic-bezier\"){let s=e.controlPoints;a=ag(s[0],s[1],s[2],s[3])(co(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error(\"Expected an interpolation type expression.\",1);if(n[0]===\"linear\")n={name:\"linear\"};else if(n[0]===\"exponential\"){let u=n[1];if(typeof u!=\"number\")return r.error(\"Exponential interpolation requires a numeric base.\",1,1);n={name:\"exponential\",base:u}}else if(n[0]===\"cubic-bezier\"){let u=n.slice(1);if(u.length!==4||u.some(c=>typeof c!=\"number\"||c<0||c>1))return r.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);n={name:\"cubic-bezier\",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");if(a=r.parse(a,2,P),!a)return null;let o=[],l=null;(i===\"interpolate-hcl\"||i===\"interpolate-lab\"||i===\"interpolate-oklch\"||i===\"interpolate-oklab\")&&r.expectedType!=xn?l=De:r.expectedType&&r.expectedType.kind!==\"value\"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let c=s[u],h=s[u+1],p=u+3,f=u+4;if(typeof c!=\"number\")return r.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(o.length&&o[o.length-1][0]>=c)return r.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(h,f,l);if(!d)return null;l||(l=d.type),o.push([c,d])}return!sr(l,P)&&!sr(l,us)&&!sr(l,De)&&!sr(l,hs)&&!sr(l,ps)&&!sr(l,xn)&&!sr(l,fs)&&!sr(l,Xt(P))?r.error(`Type ${bt(l)} is not interpolatable.`):new Yo(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=ds(r,n,this.key),o=r[s],l=r[s+1],u=Yo.interpolationFactor(this.interpolation,n,o,l),c=i[s].evaluate(e),h=i[s+1].evaluate(e);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return Gt(c,h,u);case\"color\":return dt.interpolate(c,h,u);case\"padding\":return $e.interpolate(c,h,u);case\"colorArray\":return Jt.interpolate(c,h,u);case\"numberArray\":return Ne.interpolate(c,h,u);case\"variableAnchorOffsetCollection\":return Oe.interpolate(c,h,u,this.key);case\"array\":return xi(c,h,u);case\"projectionDefinition\":return Rr.interpolate(c,h,u)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return dt.interpolate(c,h,u,\"hcl\");case\"colorArray\":return Jt.interpolate(c,h,u,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return dt.interpolate(c,h,u,\"lab\");case\"colorArray\":return Jt.interpolate(c,h,u,\"lab\")}case\"interpolate-oklch\":switch(this.type.kind){case\"color\":return dt.interpolate(c,h,u,\"oklch\");case\"colorArray\":return Jt.interpolate(c,h,u,\"oklch\")}case\"interpolate-oklab\":switch(this.type.kind){case\"color\":return dt.interpolate(c,h,u,\"oklab\");case\"colorArray\":return Jt.interpolate(c,h,u,\"oklab\")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function co(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var Je={color:dt.interpolate,number:Gt,padding:$e.interpolate,numberArray:Ne.interpolate,colorArray:Jt.interpolate,variableAnchorOffsetCollection:Oe.interpolate,array:xi},hd=class Wo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=null,n=r.expectedType;n&&n.kind!==\"value\"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:\"omit\"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error(\"No output type\");return n&&a.some(s=>vn(n,s.type))?new Wo(Z,a):new Wo(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof Re&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function lh(t,e){return t===\"==\"||t===\"!=\"?e.kind===\"boolean\"||e.kind===\"string\"||e.kind===\"number\"||e.kind===\"null\"||e.kind===\"value\":e.kind===\"string\"||e.kind===\"number\"||e.kind===\"value\"}function sg(t,e,r){return e===r}function og(t,e,r){return e!==r}function lg(t,e,r){return e<r}function ug(t,e,r){return e>r}function cg(t,e,r){return e<=r}function hg(t,e,r){return e>=r}function pd(t,e,r,i){return i.compare(e,r)===0}function pg(t,e,r,i){return!pd(t,e,r,i)}function fg(t,e,r,i){return i.compare(e,r)<0}function dg(t,e,r,i){return i.compare(e,r)>0}function yg(t,e,r,i){return i.compare(e,r)<=0}function mg(t,e,r,i){return i.compare(e,r)>=0}function Ii(t,e,r){let i=t!==\"==\"&&t!==\"!=\";return class fd{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=J,this.hasUntypedArgument=a.type.kind===\"value\"||s.type.kind===\"value\"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error(\"Expected two or three arguments.\");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!lh(o,l.type))return s.concat(1).error(`\"${o}\" comparisons are not supported for type '${bt(l.type)}'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!lh(o,u.type))return s.concat(2).error(`\"${o}\" comparisons are not supported for type '${bt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(`Cannot compare types '${bt(l.type)}' and '${bt(u.type)}'.`);i&&(l.type.kind===\"value\"&&u.type.kind!==\"value\"?l=new Xe(u.type,[l],s.key):l.type.kind!==\"value\"&&u.type.kind===\"value\"&&(u=new Xe(l.type,[u],s.key)));let c=null;if(a.length===4){if(l.type.kind!==\"string\"&&u.type.kind!==\"string\"&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(\"Cannot use collator to compare non-string types.\");if(c=s.parse(a[3],3,cs),!c)return null}return new fd(l,u,s.key,c)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=Tt(s),u=Tt(o);if(l.kind!==u.kind||l.kind!==\"string\"&&l.kind!==\"number\")throw new mt(`Expected arguments for \"${t}\" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=Tt(s),u=Tt(o);if(l.kind!==\"string\"||u.kind!==\"string\")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var gg=Ii(\"==\",sg,pd),xg=Ii(\"!=\",og,pg),vg=Ii(\"<\",lg,fg),bg=Ii(\">\",ug,dg),wg=Ii(\"<=\",cg,yg),_g=Ii(\">=\",hg,mg),dd=class yd{constructor(e,r,i){this.type=cs,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error(\"Expected one argument.\");let i=e[1];if(typeof i!=\"object\"||Array.isArray(i))return r.error(\"Collator options argument must be an object.\");let n=r.parse(i[\"case-sensitive\"]!==void 0&&i[\"case-sensitive\"],1,J);if(!n)return null;let a=r.parse(i[\"diacritic-sensitive\"]!==void 0&&i[\"diacritic-sensitive\"],1,J);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new yd(n,a,s)}evaluate(e){return new bu(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},Dg=class md{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,P);if(!i)return null;let n=e[2];if(typeof n!=\"object\"||Array.isArray(n))return r.error(\"NumberFormat options argument must be an object.\");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let l=null;if(n[\"min-fraction-digits\"]&&(l=r.parse(n[\"min-fraction-digits\"],1,P),!l))return null;let u=null;return n[\"max-fraction-digits\"]&&(u=r.parse(n[\"max-fraction-digits\"],1,P),!u)?null:new md(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},gd=class xd{constructor(e){this.type=On,this.sections=e}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[1];if(!Array.isArray(i)&&typeof i==\"object\")return r.error(\"First argument must be an image or text section.\");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o==\"object\"&&!Array.isArray(o)){a=!1;let l=null;if(o[\"font-scale\"]&&(l=r.parse(o[\"font-scale\"],1,P),!l))return null;let u=null;if(o[\"text-font\"]&&(u=r.parse(o[\"text-font\"],1,Xt(Y)),!u))return null;let c=null;if(o[\"text-color\"]&&(c=r.parse(o[\"text-color\"],1,De),!c))return null;let h=null;if(o[\"vertical-align\"]){if(typeof o[\"vertical-align\"]==\"string\"&&!Hm.includes(o[\"vertical-align\"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o[\"vertical-align\"]}' instead.`);if(h=r.parse(o[\"vertical-align\"],1,Y),!h)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=c,p.verticalAlign=h}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!==\"string\"&&u!==\"value\"&&u!==\"null\"&&u!==\"resolvedImage\")return r.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new xd(n)}evaluate(e){return new Ke(this.sections.map(r=>{let i=r.content.evaluate(e);return Tt(i)===Rn?new qo(\"\",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new qo(hn(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(\",\"):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},Sg=class vd{constructor(e){this.type=Rn,this.input=e}static parse(e,r){if(e.length!==2)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,Y);return i?new vd(i):r.error(\"No image name provided.\")}evaluate(e){let r=this.input.evaluate(e),i=Re.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},Ag=class bd{constructor(e,r){this.input=e,this.key=r,this.type=P}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!==\"array\"&&i.type.kind!==\"string\"&&i.type.kind!==\"value\"?r.error(`Expected argument of type string or array, but found ${bt(i.type)} instead.`):new bd(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r==\"string\")return[...r].length;if(Array.isArray(r))return r.length;throw new mt(`Expected value to be of type string or array, but found ${bt(Tt(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},ze=8192;function Eg(t,e){let r=Tg(t[0]),i=kg(t[1]),n=2**e.z;return[Math.round(r*n*ze),Math.round(i*n*ze)]}function _u(t,e){let r=2**e.z,i=(t[0]/ze+e.x)/r,n=(t[1]/ze+e.y)/r;return[Ig(i),Cg(n)]}function Tg(t){return(180+t)/360}function Ig(t){return t*360-180}function kg(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Cg(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function $n(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function bn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Fg(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Mg(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function ys(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return zg([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(uh(t,e,r,i)&&uh(r,i,t,e))}function Pg(t,e,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(ys(t,e,i[n],i[n+1]))return!0;return!1}function ki(t,e,r=!1){let i=!1;for(let n of e)for(let a=0;a<n.length-1;a++){if(Mg(t,n[a],n[a+1]))return r;Fg(t,n[a],n[a+1])&&(i=!i)}return i}function Bg(t,e){for(let r of e)if(ki(t,r))return!0;return!1}function wd(t,e){for(let r of t)if(!ki(r,e))return!1;for(let r=0;r<t.length-1;++r)if(Pg(t[r],t[r+1],e))return!1;return!0}function Lg(t,e){for(let r of e)if(wd(t,r))return!0;return!1}function zg(t,e){return t[0]*e[1]-t[1]*e[0]}function uh(t,e,r,i){let n=t[0]-r[0],a=t[1]-r[1],s=e[0]-r[0],o=e[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=s*u-l*o;return c>0&&h<0||c<0&&h>0}function Du(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=[];for(let s=0;s<t[n].length;s++){let o=Eg(t[n][s],r);$n(e,o),a.push(o)}i.push(a)}return i}function _d(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=Du(t[n],e,r);i.push(a)}return i}function Dd(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}$n(e,t)}function Vg(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function ch(t,e,r,i){let n=2**i.z*ze,a=[i.x*ze,i.y*ze],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Dd(u,e,r,n),s.push(u)}return s}function hh(t,e,r,i){let n=2**i.z*ze,a=[i.x*ze,i.y*ze],s=[];for(let o of t){let l=[];for(let u of o){let c=[u.x+a[0],u.y+a[1]];$n(e,c),l.push(c)}s.push(l)}if(e[2]-e[0]<=n/2){Vg(e);for(let o of s)for(let l of o)Dd(l,e,r,n)}return s}function Og(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Du(e.coordinates,i,n),s=ch(t.geometry(),r,i,n);if(!bn(r,i))return!1;for(let o of s)if(!ki(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=_d(e.coordinates,i,n),s=ch(t.geometry(),r,i,n);if(!bn(r,i))return!1;for(let o of s)if(!Bg(o,a))return!1}return!0}function Rg(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Du(e.coordinates,i,n),s=hh(t.geometry(),r,i,n);if(!bn(r,i))return!1;for(let o of s)if(!wd(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=_d(e.coordinates,i,n),s=hh(t.geometry(),r,i,n);if(!bn(r,i))return!1;for(let o of s)if(!Lg(o,a))return!1}return!0}var Su=class Pa{constructor(e,r){this.type=J,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(vi(e[1])){let i=e[1];if(i.type===\"FeatureCollection\"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s===\"Polygon\"&&n.push(o),s===\"MultiPolygon\"&&n.push(...o)}if(n.length)return new Pa(i,{type:\"MultiPolygon\",coordinates:n})}else if(i.type===\"Feature\"){let n=i.geometry.type;if(n===\"Polygon\"||n===\"MultiPolygon\")return new Pa(i,i.geometry)}else if(i.type===\"Polygon\"||i.type===\"MultiPolygon\")return new Pa(i,i)}return r.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return Og(e,this.geometries);if(e.geometryType()===\"LineString\")return Rg(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Sd=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function Ad(t,e,r=0,i=t.length-1,n=$g){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);Ad(t,e,Math.max(r,Math.floor(e-u*h/l+p)),Math.min(i,Math.floor(e+(l-u)*h/l+p)),n)}let a=t[e],s=r,o=i;for(Yi(t,r,e),n(t[i],a)>0&&Yi(t,r,i);s<o;){for(Yi(t,s,o),s++,o--;n(t[s],a)<0;)s++;for(;n(t[o],a)>0;)o--}n(t[r],a)===0?Yi(t,r,o):(o++,Yi(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function Yi(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function $g(t,e){return t<e?-1:+(t>e)}function ms(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=Ug(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a<r.length;a++)r[a].length<=e||(Ad(r[a],e,1,r[a].length-1,Ng),r[a]=r[a].slice(0,e));return r}function Ng(t,e){return e.area-t.area}function Ug(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var ph=Math.PI/180,Au=class{constructor(t){let e=ph*6378.137*1e3,r=Math.cos(t*ph),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],c=this.wrap(t[o+1][0]-l)*this.kx,h=(t[o+1][1]-u)*this.ky,p=0;(c!==0||h!==0)&&(p=(this.wrap(e[0]-l)*this.kx*c+(e[1]-u)*this.ky*h)/(c*c+h*h),p>1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=this.wrap(e[0]-l)*this.kx,h=(e[1]-u)*this.ky;let f=c*c+h*h;f<r&&(r=f,i=l,n=u,a=o,s=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function Ed(t,e){return e[0]-t[0]}function ja(t){return t[1]-t[0]+1}function Qe(t,e){return t[1]>=t[0]&&t[1]<e}function Zo(t,e){if(t[0]>t[1])return[null,null];let r=ja(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function Ho(t,e){if(!Qe(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)$n(r,t[i]);return r}function Ko(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)$n(e,i);return e}function fh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Eu(t,e,r){if(!fh(t)||!fh(e))return NaN;let i=0,n=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),r.distance([0,0],[i,n])}function Cr(t,e,r){let i=r.pointOnLine(e,t);return r.distance(t,i.point)}function Tu(t,e,r,i,n){let a=Math.min(Cr(t,[r,i],n),Cr(e,[r,i],n)),s=Math.min(Cr(r,[t,e],n),Cr(i,[t,e],n));return Math.min(a,s)}function jg(t,e,r,i,n){if(!(Qe(e,t.length)&&Qe(i,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let o=t[s],l=t[s+1];for(let u=i[0];u<i[1];++u){let c=r[u],h=r[u+1];if(ys(o,l,c,h))return 0;a=Math.min(a,Tu(o,l,c,h,n))}}return a}function qg(t,e,r,i,n){if(!(Qe(e,t.length)&&Qe(i,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let o=i[0];o<=i[1];++o)if(a=Math.min(a,n.distance(t[s],r[o])),a===0)return a;return a}function Gg(t,e,r){if(ki(t,e,!0))return 0;let i=1/0;for(let n of e){let a=n[0],s=n[n.length-1];if(a!==s&&(i=Math.min(i,Cr(t,[s,a],r)),i===0))return i;let o=r.pointOnLine(n,t);if(i=Math.min(i,r.distance(t,o.point)),i===0)return i}return i}function Xg(t,e,r,i){if(!Qe(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(ki(t[a],r,!0))return 0;let n=1/0;for(let a=e[0];a<e[1];++a){let s=t[a],o=t[a+1];for(let l of r)for(let u=0,c=l.length,h=c-1;u<c;h=u++){let p=l[h],f=l[u];if(ys(s,o,p,f))return 0;n=Math.min(n,Tu(s,o,p,f,i))}}return n}function dh(t,e){for(let r of t)for(let i of r)if(ki(i,e,!0))return!0;return!1}function Yg(t,e,r,i=1/0){let n=Ko(t),a=Ko(e);if(i!==1/0&&Eu(n,a,r)>=i)return i;if(bn(n,a)){if(dh(t,e))return 0}else if(dh(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,c=u-1;l<u;c=l++){let h=o[c],p=o[l];for(let f of e)for(let d=0,y=f.length,m=y-1;d<y;m=d++){let g=f[m],v=f[d];if(ys(h,p,g,v))return 0;s=Math.min(s,Tu(h,p,g,v,r))}}return s}function yh(t,e,r,i,n,a){if(!a)return;let s=Eu(Ho(i,a),n,r);s<e&&t.push([s,a,[0,0]])}function da(t,e,r,i,n,a,s){if(!a||!s)return;let o=Eu(Ho(i,a),Ho(n,s),r);o<e&&t.push([o,a,s])}function qa(t,e,r,i,n=1/0){let a=Math.min(i.distance(t[0],r[0][0]),n);if(a===0)return a;let s=new Sd([[0,[0,t.length-1],[0,0]]],Ed),o=Ko(r);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],c=e?50:100;if(ja(u)<=c){if(!Qe(u,t.length))return NaN;if(e){let h=Xg(t,u,r,i);if(isNaN(h)||h===0)return h;a=Math.min(a,h)}else for(let h=u[0];h<=u[1];++h){let p=Gg(t[h],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let h=Zo(u,e);yh(s,a,i,t,o,h[0]),yh(s,a,i,t,o,h[1])}}return a}function Ga(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Sd([[0,[0,t.length-1],[0,r.length-1]]],Ed);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],c=l[2],h=e?50:100,p=i?50:100;if(ja(u)<=h&&ja(c)<=p){if(!Qe(u,t.length)&&Qe(c,r.length))return NaN;let f;if(e&&i)f=jg(t,u,r,c,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=c[0];y<=c[1];++y)if(f=Cr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(c[0],c[1]+1);for(let y=u[0];y<=u[1];++y)if(f=Cr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=qg(t,u,r,c,n),s=Math.min(s,f)}else{let f=Zo(u,e),d=Zo(c,i);da(o,s,n,t,r,f[0],d[0]),da(o,s,n,t,r,f[0],d[1]),da(o,s,n,t,r,f[1],d[0]),da(o,s,n,t,r,f[1],d[1])}}return s}function Wg(t,e){let r=t.geometry(),i=r.flat().map(s=>_u([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Au(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,Ga(i,!1,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,Ga(i,!1,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,qa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Zg(t,e){let r=t.geometry(),i=r.flat().map(s=>_u([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Au(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,Ga(i,!0,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,Ga(i,!0,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,qa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function Hg(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=ms(r,0).map(s=>s.map(o=>o.map(l=>_u([l.x,l.y],t.canonical)))),n=new Au(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case\"Point\":a=Math.min(a,qa([s.coordinates],!1,o,n,a));break;case\"LineString\":a=Math.min(a,qa(s.coordinates,!0,o,n,a));break;case\"Polygon\":a=Math.min(a,Yg(o,s.coordinates,n,a))}if(a===0)return a}return a}function ho(t){return t.type===\"MultiPolygon\"?t.coordinates.map(e=>({type:\"Polygon\",coordinates:e})):t.type===\"MultiLineString\"?t.coordinates.map(e=>({type:\"LineString\",coordinates:e})):t.type===\"MultiPoint\"?t.coordinates.map(e=>({type:\"Point\",coordinates:e})):[t]}var Iu=class Ba{constructor(e,r){this.type=P,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(vi(e[1])){let i=e[1];if(i.type===\"FeatureCollection\")return new Ba(i,i.features.map(n=>ho(n.geometry)).flat());if(i.type===\"Feature\")return new Ba(i,ho(i.geometry));if(\"type\"in i&&\"coordinates\"in i)return new Ba(i,ho(i))}return r.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return Wg(e,this.geometries);if(e.geometryType()===\"LineString\")return Zg(e,this.geometries);if(e.geometryType()===\"Polygon\")return Hg(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Kg=class Td{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Xt(r??Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!vi(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=Tt(i);if(n.kind===\"array\"){let a=i,s=r.concat(1),o=[];for(let l=0;l<a.length;l++){let u=s.parse(a[l],l,Z);if(!u)return null;o.push(u)}return new Td(o)}return new bi(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},ku=class Id{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error(\"Global state property must be defined.\"):typeof i==\"string\"?new Id(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let r=e.globals?.globalState;return!r||Object.keys(r).length===0?null:cn(r,this.key)??null}eachChild(){}outputDefined(){return!1}},ui={\"==\":gg,\"!=\":xg,\">\":bg,\"<\":vg,\">=\":_g,\"<=\":wg,array:Xe,at:Qm,boolean:Xe,case:ig,coalesce:hd,collator:dd,format:gd,image:Sg,in:tg,\"index-of\":eg,interpolate:ye,\"interpolate-hcl\":ye,\"interpolate-lab\":ye,\"interpolate-oklch\":ye,\"interpolate-oklab\":ye,length:Ag,let:rd,literal:bi,match:rg,number:Xe,\"number-format\":Dg,object:Xe,semiliteral:Kg,slice:ng,step:wu,string:Xe,\"to-boolean\":si,\"to-color\":si,\"to-number\":si,\"to-string\":si,var:nd,within:Su,distance:Iu,\"global-state\":ku},$r=class nn{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=nn.definitions[i];if(!n)return r.error(`Unknown expression \"${i}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of o){l=new td(r.registry,Xa,r.path,null,r.scope);let h=[],p=!1;for(let f=1;f<e.length;f++){let d=e[f],y=Array.isArray(u)?u[f-1]:u.type,m=l.parse(d,1+h.length,y);if(!m){p=!0;break}h.push(m)}if(!p)if(Array.isArray(u)&&u.length!==h.length)l.error(`Expected ${u.length} arguments, but found ${h.length} instead.`);else{for(let f=0;f<h.length;f++){let d=Array.isArray(u)?u[f]:u.type,y=h[f];l.concat(f+1).checkSubtype(d,y.type)}if(l.errors.length===0)return new nn(i,a,c,h,r.key)}}if(o.length===1)r.errors.push(...l.errors);else{let u=(o.length?o:s).map(([h])=>Qg(h)).join(\" | \"),c=[];for(let h=1;h<e.length;h++){let p=r.parse(e[h],1+c.length);if(!p)return null;c.push(bt(p.type))}r.error(`Expected arguments of type ${u}, but found (${c.join(\", \")}) instead.`)}return null}static register(e,r){nn.definitions=r;for(let i in r)e[i]=nn}};function mh(t,[e,r,i,n],a){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);let s=n?n.evaluate(t):1,o=Zf(e,r,i,s);if(o)throw new mt(o,a);return new dt(e/255,r/255,i/255,s,!1)}function gh(t,e){return t in e&&e[t]!==void 0}function po(t,e){let r=e[t];return r===void 0?null:r}function Jg(t,e,r,i){for(;r<=i;){let n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function Er(t){return{type:t}}$r.register(ui,{error:[Tm,[Y],(t,[e],r)=>{throw new mt(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>bt(Tt(e.evaluate(t)))],\"to-rgba\":[Xt(P,4),[De],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[De,[P,P,P],mh],rgba:[De,[P,P,P,P],mh],has:{type:J,overloads:[[[Y],(t,[e])=>gh(e.evaluate(t),t.properties())],[[Y,Mr],(t,[e,r])=>gh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>po(e.evaluate(t),t.properties())],[[Y,Mr],(t,[e,r])=>po(e.evaluate(t),r.evaluate(t))]]},\"feature-state\":[Z,[Y],(t,[e])=>po(e.evaluate(t),t.featureState||{})],properties:[Mr,[],t=>t.properties()],\"geometry-type\":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[P,[],t=>t.globals.zoom],\"heatmap-density\":[P,[],t=>t.globals.heatmapDensity||0],elevation:[P,[],t=>t.globals.elevation||0],\"line-progress\":[P,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],\"+\":[P,Er(P),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],\"*\":[P,Er(P),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],\"-\":{type:P,overloads:[[[P,P],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[P],(t,[e])=>-e.evaluate(t)]]},\"/\":[P,[P,P],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],\"%\":[P,[P,P],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[P,[],()=>Math.LN2],pi:[P,[],()=>Math.PI],e:[P,[],()=>Math.E],\"^\":[P,[P,P],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[P,[P],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[P,[P],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[P,[P],(t,[e])=>Math.log(e.evaluate(t))],log2:[P,[P],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[P,[P],(t,[e])=>Math.sin(e.evaluate(t))],cos:[P,[P],(t,[e])=>Math.cos(e.evaluate(t))],tan:[P,[P],(t,[e])=>Math.tan(e.evaluate(t))],asin:[P,[P],(t,[e])=>Math.asin(e.evaluate(t))],acos:[P,[P],(t,[e])=>Math.acos(e.evaluate(t))],atan:[P,[P],(t,[e])=>Math.atan(e.evaluate(t))],min:[P,Er(P),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[P,Er(P),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[P,[P],(t,[e])=>Math.abs(e.evaluate(t))],round:[P,[P],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[P,[P],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[P,[P],(t,[e])=>Math.ceil(e.evaluate(t))],\"filter-==\":[J,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],\"filter-id-==\":[J,[Z],(t,[e])=>t.id()===e.value],\"filter-type-==\":[J,[Y],(t,[e])=>t.geometryType()===e.value],\"filter-<\":[J,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<n}],\"filter-id-<\":[J,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<i}],\"filter->\":[J,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],\"filter-id->\":[J,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],\"filter-<=\":[J,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],\"filter-id-<=\":[J,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],\"filter->=\":[J,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],\"filter-id->=\":[J,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],\"filter-has\":[J,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],\"filter-has-id\":[J,[],t=>t.id()!==null&&t.id()!==void 0],\"filter-type-in\":[J,[Xt(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],\"filter-id-in\":[J,[Xt(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],\"filter-in-small\":[J,[Y,Xt(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],\"filter-in-large\":[J,[Y,Xt(Z)],(t,[e,r])=>Jg(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:J,overloads:[[[J,J],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Er(J),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:J,overloads:[[[J,J],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Er(J),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},\"!\":[J,[J],(t,[e])=>!e.evaluate(t)],\"is-supported-script\":[J,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,Er(Z),(t,e)=>e.map(r=>hn(r.evaluate(t))).join(\"\")],split:[Xt(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Xt(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],\"resolved-locale\":[Y,[cs],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Qg(t){return Array.isArray(t)?`(${t.map(bt).join(\", \")})`:`(${bt(t.type)}...)`}function Xa(t){if(t instanceof nd)return Xa(t.boundExpression);if(t instanceof $r&&t.name===\"error\"||t instanceof dd||t instanceof Su||t instanceof Iu||t instanceof ku)return!1;let e=t instanceof si||t instanceof Xe,r=!0;return t.eachChild(i=>{r&&(r=e?Xa(i):i instanceof bi)}),r?gs(t)&&xs(t,[\"zoom\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"]):!1}function gs(t){if(t instanceof $r&&(t.name===\"get\"&&t.args.length===1||t.name===\"feature-state\"||t.name===\"has\"&&t.args.length===1||t.name===\"properties\"||t.name===\"geometry-type\"||t.name===\"id\"||/^filter-/.test(t.name))||t instanceof Su||t instanceof Iu)return!1;let e=!0;return t.eachChild(r=>{e&&!gs(r)&&(e=!1)}),e}function wn(t){if(t instanceof $r&&t.name===\"feature-state\")return!1;let e=!0;return t.eachChild(r=>{e&&!wn(r)&&(e=!1)}),e}function xs(t,e){if(t instanceof $r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!xs(i,e)&&(r=!1)}),r}function Jo(t){return{result:\"success\",value:t}}function ei(t){return{result:\"error\",value:t}}function wi(t){return t[\"property-type\"]===\"data-driven\"||t[\"property-type\"]===\"cross-faded-data-driven\"}function kd(t){return!!t.expression&&t.expression.parameters.indexOf(\"zoom\")>-1}function Cu(t){return!!t.expression&&t.expression.interpolated}var Fu=/^(.*)-transition$/;function _n(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function K(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":t===null?\"null\":typeof t}function vs(t){return typeof t==\"object\"&&!!t&&!Array.isArray(t)&&Tt(t)===Mr}function tx(t){return t}function ex(t){switch(t.type){case\"color\":return dt.parse;case\"padding\":return $e.parse;case\"numberArray\":return Ne.parse;case\"colorArray\":return Jt.parse;default:return null}}function rx(t){switch(t){case\"exponential\":return Fd;case\"interval\":return nx;case\"categorical\":return ix;case\"identity\":return ax;default:throw Error(`Unknown function type \"${t}\"`)}}function Cd(t,e){let r=t.stops&&typeof t.stops[0][0]==\"object\",i=r||t.property!==void 0,n=r||!i,a=t.type||(Cu(e)?\"exponential\":\"interval\"),s=ex(e);if(s&&(t=_n({},t),t.stops&&(t.stops=t.stops.map(c=>[c[0],s(c[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Zm(t.colorSpace))throw Error(`Unknown color space: \"${t.colorSpace}\"`);let o=rx(a),l,u;if(a===\"categorical\"){l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}if(r){let c={},h=[];for(let d=0;d<t.stops.length;d++){let y=t.stops[d],m=y[0].zoom;c[m]===void 0&&(c[m]={zoom:m,type:t.type,property:t.property,default:t.default,colorSpace:t.colorSpace,stops:[]},h.push(m)),c[m].stops.push([y[0].value,y[1]])}let p=[];for(let d of h)p.push([c[d].zoom,Cd(c[d],e)]);let f={name:\"linear\"};return{kind:\"composite\",interpolationType:f,interpolationFactor:ye.interpolationFactor.bind(void 0,f),zoomStops:p.map(d=>d[0]),evaluate({zoom:d},y){return Fd({stops:p,base:t.base,colorSpace:t.colorSpace},e,d).evaluate(d,y)}}}if(n){let c=a===\"exponential\"?{name:\"exponential\",base:t.base===void 0?1:t.base}:null;return{kind:\"camera\",interpolationType:c,interpolationFactor:ye.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(h=>h[0]),evaluate:({zoom:h})=>o(t,e,h,l,u)}}return{kind:\"source\",evaluate(c,h){let p=h&&h.properties?h.properties[t.property]:void 0;return p===void 0?Nn(t.default,e.default):o(t,e,p,l,u)}}}function Nn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function ix(t,e,r,i,n){return Nn(typeof r===n?i[r]:void 0,t.default,e.default)}function nx(t,e,r){if(K(r)!==\"number\")return Nn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=ds(t.stops.map(a=>a[0]),r,\"\");return t.stops[n][1]}function Fd(t,e,r){let i=t.base===void 0?1:t.base;if(K(r)!==\"number\")return Nn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=ds(t.stops.map(c=>c[0]),r,\"\"),s=sx(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=Je[e.type]||tx;return typeof o.evaluate==\"function\"?{evaluate(...c){let h=o.evaluate.apply(void 0,c),p=l.evaluate.apply(void 0,c);if(h!==void 0&&p!==void 0)return u(h,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function ax(t,e,r){switch(e.type){case\"color\":r=dt.parse(r);break;case\"formatted\":r=Ke.fromString(r.toString());break;case\"resolvedImage\":r=Re.fromString(r.toString());break;case\"padding\":r=$e.parse(r);break;case\"colorArray\":r=Jt.parse(r);break;case\"numberArray\":r=Ne.parse(r);break;default:K(r)===e.type||e.type===\"enum\"&&e.values[r]||(r=void 0)}return Nn(r,t.default,e.default)}function sx(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var Mu=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Qf,this._defaultValue=r?Vd(r):null,this._enumValues=r&&r.type===\"enum\"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=_i(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=_i(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s==\"number\"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new mt(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(\", \")}, but found ${JSON.stringify(s)} instead.`,\"\");return s}catch(s){let o=s instanceof mt?s.path:\"\",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<\"u\"&&console.warn(Md(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function Md(t,e,r,i){return`${t}${e}: ${r}${i==null?\"\":` Falling back to ${String(i)}.`}`}function Pd(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. \"layers[3].paint.line-width\".')}function bs(t){return Array.isArray(t)&&t.length>0&&typeof t[0]==\"string\"&&t[0]in ui}function Lr(t,e,r,i){Pd(e);let n=new td(ui,Xa,[],r?ux(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return a?Jo(new Mu(a,e,r,i)):ei(n.errors)}var Dn=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!==\"constant\"&&!wn(e.expression),this.globalStateRefs=Un(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=_i(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=_i(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},Ya=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!==\"camera\"&&!wn(e.expression),this.globalStateRefs=Un(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=_i(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=_i(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?ye.interpolationFactor(this.interpolationType,t,e,r):0}};function ox(t){return t._styleExpression!==void 0}function Bd(t,e,r,i){let n=Lr(t,e,r,i);if(n.result===\"error\")return n;let a=n.value.expression,s=gs(a);if(!s&&!wi(r))return ei([new Fe(\"\",\"data expressions not supported\")]);let o=xs(a,[\"zoom\"]);if(!o&&!kd(r))return ei([new Fe(\"\",\"zoom expressions not supported\")]);let l=La(a);if(!l&&!o)return ei([new Fe(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if(l instanceof Fe)return ei([l]);if(l instanceof ye&&!Cu(r))return ei([new Fe(\"\",'\"interpolate\" expressions cannot be used with this property')]);if(!l)return Jo(s?new Dn(\"constant\",n.value,i):new Dn(\"source\",n.value,i));let u=l instanceof ye?l.interpolation:void 0;return Jo(s?new Ya(\"camera\",n.value,l.labels,u,i):new Ya(\"composite\",n.value,l.labels,u,i))}var Ld=class zd{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Pd(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Vd(i),this._warningHistory={};let n=Cd(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<\"u\"&&console.warn(Md(this._rootKey,\"\",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new zd(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function lx(t,e,r,i){if(vs(t))return new Ld(t,e,r);if(bs(t)){let n=Bd(t,e,r,i);if(n.result===\"error\")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(\", \"));return n.value}{let n=t;return r.type===\"color\"&&typeof t==\"string\"?n=dt.parse(t):r.type===\"padding\"&&(typeof t==\"number\"||Array.isArray(t))?n=$e.parse(t):r.type===\"numberArray\"&&(typeof t==\"number\"||Array.isArray(t))?n=Ne.parse(t):r.type===\"colorArray\"&&(typeof t==\"string\"||Array.isArray(t))?n=Jt.parse(t):r.type===\"variableAnchorOffsetCollection\"&&Array.isArray(t)?n=Oe.parse(t):r.type===\"projectionDefinition\"&&typeof t==\"string\"&&(n=Rr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>n}}}function La(t,e=new Map){if(e.has(t))return e.get(t);let r=null;if(t instanceof rd)r=La(t.result,e);else if(t instanceof hd){for(let i of t.args)if(r=La(i,e),r)break}else(t instanceof wu||t instanceof ye)&&t.input instanceof $r&&t.input.name===\"zoom\"&&(r=t);return r instanceof Fe?(e.set(t,r),r):(t.eachChild(i=>{let n=La(i,e);n instanceof Fe?r=n:!r&&n?r=new Fe(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):r&&n&&r!==n&&(r=new Fe(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),e.set(t,r),r)}function Un(t,e=new Set){return t instanceof ku&&e.add(t.key),t.eachChild(r=>{Un(r,e)}),e}function ux(t){let e={color:De,string:Y,number:P,enum:Y,boolean:J,formatted:On,padding:hs,numberArray:ps,colorArray:xn,projectionDefinition:us,resolvedImage:Rn,variableAnchorOffsetCollection:fs};return t.type===\"array\"?Xt(e[t.value]||Z,t.length):e[t.type]}function Vd(t){if(t.type===\"color\"&&vs(t.default))return new dt(0,0,0,0);switch(t.type){case\"color\":return dt.parse(t.default)||null;case\"padding\":return $e.parse(t.default)||null;case\"numberArray\":return Ne.parse(t.default)||null;case\"colorArray\":return Jt.parse(t.default)||null;case\"variableAnchorOffsetCollection\":return Oe.parse(t.default)||null;case\"projectionDefinition\":return Rr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function _i(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function cx(t){let e=!1;for(let r of t){let i=Od(r);if(i===\"expression\")return\"expression\";i===\"legacy\"&&(e=!0)}return e?\"legacy\":\"neutral\"}function Od(t){if(typeof t==\"boolean\")return\"neutral\";if(!Array.isArray(t)||t.length===0)return\"legacy\";switch(t[0]){case\"has\":return t.length<2||t[1]===\"$id\"||t[1]===\"$type\"?\"legacy\":t.length===2?\"neutral\":\"expression\";case\"in\":return t.length>=3&&(typeof t[1]!=\"string\"||Array.isArray(t[2]))?\"expression\":\"legacy\";case\"!in\":case\"!has\":return\"legacy\";case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?\"expression\":\"legacy\";case\"none\":return\"legacy\";case\"any\":case\"all\":return cx(t.slice(1));default:return\"expression\"}}function Pu(t){return Od(t)!==\"legacy\"}function xh(t){return t===\"$type\"?[\"geometry-type\"]:t===\"$id\"?[\"id\"]:[\"get\",t]}function hx(t){switch(t[0]){case\"==\":case\"!=\":case\"<\":case\"<=\":case\">\":case\">=\":return t.length!==3||typeof t[1]!=\"string\"?null:[t[0],xh(t[1]),t[2]];case\"in\":case\"!in\":{if(t.length<2||typeof t[1]!=\"string\")return null;let e=[\"in\",xh(t[1]),[\"literal\",t.slice(2)]];return t[0]===\"!in\"?[\"!\",e]:e}case\"has\":case\"!has\":{if(t.length!==2||typeof t[1]!=\"string\"||t[1]===\"$type\"||t[1]===\"$id\")return null;let e=[\"has\",t[1]];return t[0]===\"!has\"?[\"!\",e]:e}default:return null}}function Rd(t){if((t[0]===\"<\"||t[0]===\"<=\"||t[0]===\">\"||t[0]===\">=\")&&t[1]===\"$type\")return`\"$type\" cannot be use with operator \"${t[0]}\"`;let e=hx(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function fo(t,e,r){let i=r[t];return Array.isArray(i)?Pu(i)?Bu(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Bu(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case\"all\":case\"any\":case\"none\":for(let r=1;r<t.length;r++){let i=fo(r,e,t);if(i)return i}break;case\"!\":{let r=fo(1,e,t);if(r)return r;break}case\"case\":for(let r=1;r<t.length-1;r+=2){let i=fo(r,e,t);if(i)return i}}return null}function px(t,e){let r=Bu(t);if(!r||typeof console>\"u\")return;let i=r.path.map(n=>`[${n}]`).join(\"\");console.warn(`${e}${i}: ${Rd(r.legacyFilter)}`)}var fx={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function Sn(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Pu(t)?px(t,e):t=Wa(t);let i=Lr(t,e,fx,r);if(i.result===\"error\")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(\", \"));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:$d(t),getGlobalStateRefs:()=>Un(i.value.expression)}}function dx(t,e){return t<e?-1:+(t>e)}function $d(t){if(!Array.isArray(t))return!1;if(t[0]===\"within\"||t[0]===\"distance\")return!0;for(let e=1;e<t.length;e++)if($d(t[e]))return!0;return!1}function Wa(t){if(!t)return!0;let e=t[0];return t.length<=1?e!==\"any\":e===\"==\"?yo(t[1],t[2],\"==\"):e===\"!=\"?ya(yo(t[1],t[2],\"==\")):e===\"<\"||e===\">\"||e===\"<=\"||e===\">=\"?yo(t[1],t[2],e):e===\"any\"?yx(t.slice(1)):e===\"all\"?[\"all\"].concat(t.slice(1).map(Wa)):e===\"none\"?[\"all\"].concat(t.slice(1).map(Wa).map(ya)):e===\"in\"?vh(t[1],t.slice(2)):e===\"!in\"?ya(vh(t[1],t.slice(2))):e===\"has\"?bh(t[1]):e!==\"!has\"||ya(bh(t[1]))}function yo(t,e,r){switch(t){case\"$type\":return[`filter-type-${r}`,e];case\"$id\":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function yx(t){return[\"any\"].concat(t.map(Wa))}function vh(t,e){if(e.length===0)return!1;switch(t){case\"$type\":return[\"filter-type-in\",[\"literal\",e]];case\"$id\":return[\"filter-id-in\",[\"literal\",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?[\"filter-in-large\",t,[\"literal\",e.sort(dx)]]:[\"filter-in-small\",t,[\"literal\",e]]}}function bh(t){switch(t){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",t]}}function ya(t){return[\"!\",t]}function Qo(t){let e=typeof t;if(e===\"number\"||e===\"boolean\"||e===\"string\"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n=\"[\";for(let a of t)n+=`${Qo(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i=\"{\";for(let n=0;n<r.length;n++)i+=`${JSON.stringify(r[n])}:${Qo(t[r[n]])},`;return`${i}}`}function mx(t){let e=\"\";for(let r of Am)e+=`/${Qo(t[r])}`;return e}function gx(t,e){let r={};for(let n=0;n<t.length;n++){let a=e&&e[t[n].id]||mx(t[n]);e&&(e[t[n].id]=a);let s=r[a];s||(s=r[a]=[]),s.push(t[n])}let i=[];for(let n in r)i.push(r[n]);return i}function Nd(t){let e=t.key,r=t.value;return r?[new I(e,r,\"constants have been deprecated as of v8\")]:[]}function At(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function zr(t){if(Array.isArray(t))return t.map(zr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=zr(t[r]);return e}return At(t)}function se(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=K(r);if(u!==\"object\")return[new I(e,r,`object expected, ${u} found`)];for(let c in r){let h=c.split(\".\")[0],p=cn(i,h)||i[\"*\"],f;if(cn(n,h))f=n[h];else if(cn(i,h)){if(r[c]===void 0)continue;f=o}else if(n[\"*\"])f=n[\"*\"];else if(i[\"*\"])f=o;else{l.push(new I(e,r[c],`unknown property \"${c}\"`));continue}l=l.concat(f({key:(e&&`${e}.`)+c,value:r[c],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:c,validateSpec:o},r))}for(let c in i)n[c]||i[c].required&&i[c].default===void 0&&r[c]===void 0&&l.push(new I(e,r,`missing required property \"${c}\"`));return l}function Lu(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(K(e)!==\"array\")return[new I(s,e,`array expected, ${K(e)} found`)];if(r.length&&e.length!==r.length)return[new I(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),K(r.value)===\"object\"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(o({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:n,styleSpec:a,key:`${s}[${c}]`}));return u}function ws(t){let e=t.key,r=t.value,i=t.valueSpec,n=K(r);return n===\"number\"&&r!==r&&(n=\"NaN\"),n===\"number\"?\"minimum\"in i&&r<i.minimum?[new I(e,r,`${r} is less than the minimum value ${i.minimum}`)]:\"maximum\"in i&&r>i.maximum?[new I(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new I(e,r,`number expected, ${n} found`)]}function Ud(t){let e=t.valueSpec,r=At(t.value.type),i,n={},a,s,o=r!==\"categorical\"&&t.value.property===void 0,l=!o,u=K(t.value.stops)===\"array\"&&K(t.value.stops[0])===\"array\"&&K(t.value.stops[0][0])===\"object\",c=se({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:h,default:d}});return r===\"identity\"&&o&&c.push(new I(t.key,t.value,'missing required property \"property\"')),r!==\"identity\"&&!t.value.stops&&c.push(new I(t.key,t.value,'missing required property \"stops\"')),r===\"exponential\"&&t.valueSpec.expression&&!Cu(t.valueSpec)&&c.push(new I(t.key,t.value,\"exponential functions not supported\")),t.styleSpec.$version>=8&&(l&&!wi(t.valueSpec)?c.push(new I(t.key,t.value,\"property functions not supported\")):o&&!kd(t.valueSpec)&&c.push(new I(t.key,t.value,\"zoom functions not supported\"))),(r===\"categorical\"||u)&&t.value.property===void 0&&c.push(new I(t.key,t.value,'\"property\" property is required')),c;function h(y){if(r===\"identity\")return[new I(y.key,y.value,'identity function may not have a \"stops\" property')];let m=[],g=y.value;return m=m.concat(Lu({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),K(g)===\"array\"&&g.length===0&&m.push(new I(y.key,g,\"array must have at least one stop\")),m}function p(y){let m=[],g=y.value,v=y.key;if(K(g)!==\"array\")return[new I(v,g,`array expected, ${K(g)} found`)];if(g.length!==2)return[new I(v,g,`array length 2 expected, length ${g.length} found`)];if(u){if(K(g[0])!==\"object\")return[new I(v,g,`object expected, ${K(g[0])} found`)];if(g[0].zoom===void 0)return[new I(v,g,\"object stop key must have zoom\")];if(g[0].value===void 0)return[new I(v,g,\"object stop key must have value\")];if(s&&s>At(g[0].zoom))return[new I(v,g[0].zoom,\"stop zoom values must appear in ascending order\")];At(g[0].zoom)!==s&&(s=At(g[0].zoom),a=void 0,n={}),m=m.concat(se({key:`${v}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:ws,value:f}}))}else m=m.concat(f({key:`${v}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return bs(zr(g[1]))?m.concat([new I(`${v}[1]`,g[1],\"expressions are not allowed in function stops.\")]):m.concat(y.validateSpec({key:`${v}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=K(y.value),v=At(y.value),x=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new I(y.key,x,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!==\"number\"&&g!==\"string\"&&g!==\"boolean\")return[new I(y.key,x,\"stop domain value must be a number, string, or boolean\")];if(g!==\"number\"&&r!==\"categorical\"){let b=`number expected, ${g} found`;return wi(e)&&r===void 0&&(b+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new I(y.key,x,b)]}return r===\"categorical\"&&g===\"number\"&&(!isFinite(v)||Math.floor(v)!==v)?[new I(y.key,x,`integer expected, found ${v}`)]:r!==\"categorical\"&&g===\"number\"&&a!==void 0&&v<a?[new I(y.key,x,\"stop domain values must appear in ascending order\")]:(a=v,r===\"categorical\"&&v in n?[new I(y.key,x,\"stop domain values must be unique\")]:(n[v]=!0,[]))}function d(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function Di(t){let e=(t.expressionContext===\"property\"?Bd:Lr)(zr(t.value),t.key,t.valueSpec);if(e.result===\"error\")return e.value.map(i=>new I(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext===\"property\"&&t.propertyKey===\"text-font\"&&!r.outputDefined())return[new I(t.key,t.value,`Invalid data expression for \"${t.propertyKey}\". Output values must be contained as literals within the expression.`)];if(t.expressionContext===\"property\"&&t.propertyType===\"layout\"&&!wn(r))return[new I(t.key,t.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(t.expressionContext===\"filter\"&&!wn(r))return[new I(t.key,t.value,'\"feature-state\" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf(\"cluster\")===0){if(!xs(r,[\"zoom\",\"feature-state\"]))return[new I(t.key,t.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(t.expressionContext===\"cluster-initial\"&&!gs(r))return[new I(t.key,t.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function xx(t){let e=t.value,r=t.key,i=K(e);return i===\"boolean\"?[]:[new I(r,e,`boolean expected, ${i} found`)]}function tl(t){let e=t.key,r=t.value,i=K(r);return i===\"string\"?dt.parse(String(r))?[]:[new I(e,r,`color expected, \"${r}\" found`)]:[new I(e,r,`color expected, ${i} found`)]}function An(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(At(r))===-1&&n.push(new I(e,r,`expected one of [${i.values.join(\", \")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(At(r))===-1&&n.push(new I(e,r,`expected one of [${Object.keys(i.values).join(\", \")}], ${JSON.stringify(r)} found`)),n}function vx(t,e){let r=t;for(let i of e)r=r[i];return r}function bx(t,e){let r=Bu(e);return r?[new I(`${t.key}${r.path.map(i=>`[${i}]`).join(\"\")}`,vx(t.value,r.path),Rd(r.legacyFilter),null,\"warning\")]:[]}function zu(t){let e=zr(t.value);return Pu(e)?[...bx(t,e),...Di(_n({},t,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}}))]:jd(t)}function jd(t){let e=t.value,r=t.key;if(K(e)!==\"array\")return[new I(r,e,`array expected, ${K(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new I(r,e,\"filter array must have at least 1 element\")];switch(a=a.concat(An({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),At(e[0])){case\"<\":case\"<=\":case\">\":case\">=\":e.length>=2&&At(e[1])===\"$type\"&&a.push(new I(r,e,`\"$type\" cannot be use with operator \"${e[0]}\"`));case\"==\":case\"!=\":e.length!==3&&a.push(new I(r,e,`filter array for operator \"${e[0]}\" must have 3 elements`));case\"in\":case\"!in\":e.length>=2&&(n=K(e[1]),n!==\"string\"&&a.push(new I(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s<e.length;s++)n=K(e[s]),At(e[1])===\"$type\"?a=a.concat(An({key:`${r}[${s}]`,value:e[s],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):n!==\"string\"&&n!==\"number\"&&n!==\"boolean\"&&a.push(new I(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${n} found`));break;case\"any\":case\"all\":case\"none\":for(let s=1;s<e.length;s++)a=a.concat(jd({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case\"has\":case\"!has\":n=K(e[1]),e.length===2?n!==\"string\"&&a.push(new I(`${r}[1]`,e[1],`string expected, ${n} found`)):a.push(new I(r,e,`filter array for \"${e[0]}\" operator must have 2 elements`))}return a}function qd(t,e){let r=t.key,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.value,o=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];let u=o.match(Fu);if(e===\"paint\"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let c=t.valueSpec||l[o];if(!c)return[new I(r,s,`unknown property \"${o}\"`)];let h;if(K(s)===\"string\"&&wi(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(s)))return[new I(r,s,`\"${o}\" does not support interpolation syntax\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(h[1])} }\\`.`)];let p=[];return t.layerType===\"symbol\"&&o===\"text-font\"&&vs(zr(s))&&At(s.type)===\"identity\"&&p.push(new I(r,s,'\"text-font\" does not support identity functions')),p.concat(i({key:t.key,value:s,valueSpec:c,style:n,styleSpec:a,expressionContext:\"property\",propertyType:e,propertyKey:o}))}function Gd(t){return qd(t,\"paint\")}function Xd(t){return qd(t,\"layout\")}function Yd(t){let e=[],r=t.value,i=t.key,n=t.style,a=t.styleSpec;if(K(r)!==\"object\")return[new I(i,r,`object expected, ${K(r)} found`)];!r.type&&!r.ref&&e.push(new I(i,r,'either \"type\" or \"ref\" is required'));let s=At(r.type),o=At(r.ref);if(r.id){let l=At(r.id);for(let u=0;u<t.arrayIndex;u++){let c=n.layers[u];At(c.id)===l&&e.push(new I(i,r.id,`duplicate layer id \"${r.id}\", previously used at line ${c.id.__line__}`))}}if(\"ref\"in r){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(u=>{u in r&&e.push(new I(i,r[u],`\"${u}\" is prohibited for ref layers`))});let l;n.layers.forEach(u=>{At(u.id)===o&&(l=u)}),l?l.ref?e.push(new I(i,r.ref,\"ref cannot reference another ref layer\")):s=At(l.type):e.push(new I(i,r.ref,`ref layer \"${o}\" not found`))}else if(s!==\"background\")if(!r.source)e.push(new I(i,r,'missing required property \"source\"'));else{let l=n.sources&&n.sources[r.source],u=l&&At(l.type);l?u===\"vector\"&&s===\"raster\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a raster source`)):u!==\"raster-dem\"&&s===\"hillshade\"||u!==\"raster-dem\"&&s===\"color-relief\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a raster-dem source`)):u===\"raster\"&&s!==\"raster\"?e.push(new I(i,r.source,`layer \"${r.id}\" requires a vector source`)):u===\"vector\"&&!r[\"source-layer\"]?e.push(new I(i,r,`layer \"${r.id}\" must specify a \"source-layer\"`)):u===\"raster-dem\"&&s!==\"hillshade\"&&s!==\"color-relief\"?e.push(new I(i,r.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):s===\"line\"&&r.paint&&r.paint[\"line-gradient\"]&&(u!==\"geojson\"||!l.lineMetrics)&&e.push(new I(i,r,`layer \"${r.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new I(i,r.source,`source \"${r.source}\" not found`))}return s===\"raster\"&&r.paint?.resampling&&r.paint?.[\"raster-resampling\"]&&e.push(new I(i,r.paint,`layer \"${r.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),e=e.concat(se({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{\"*\"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:\"type\"})},filter:zu,layout(l){return se({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Xd(_n({layerType:s},u))}}})},paint(l){return se({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Gd(_n({layerType:s},u))}}})}}})),e}function vr(t){let e=t.value,r=t.key,i=K(e);return i===\"string\"?[]:[new I(r,e,`string expected, ${i} found`)]}function wx(t){let e=t.sourceName??\"\",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=K(r);if(r===void 0)return s;if(o!==\"object\")return s.push(new I(\"source_raster_dem\",r,`object expected, ${o} found`)),s;let l=At(r.encoding)===\"custom\",u=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],c=t.value.encoding?`\"${t.value.encoding}\"`:\"Default\";for(let h in r)!l&&u.includes(h)?s.push(new I(h,r[h],`In \"${e}\": \"${h}\" is only valid when \"encoding\" is set to \"custom\". ${c} encoding found`)):n[h]?s=s.concat(t.validateSpec({key:h,value:r[h],valueSpec:n[h],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new I(h,r[h],`unknown property \"${h}\"`));return s}var wh={promoteId:_x};function Wd(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new I(r,e,'\"type\" is required')];let s=At(e.type),o;switch(s){case\"vector\":case\"raster\":return o=se({key:r,value:e,valueSpec:i[`source_${s.replace(\"-\",\"_\")}`],style:t.style,styleSpec:i,objectElementValidators:wh,validateSpec:a}),o;case\"raster-dem\":return o=wx({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case\"geojson\":if(o=se({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:wh}),e.cluster)for(let l in e.clusterProperties){let[u,c]=e.clusterProperties[l],h=typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u;o.push(...Di({key:`${r}.${l}.map`,value:c,validateSpec:a,expressionContext:\"cluster-map\"})),o.push(...Di({key:`${r}.${l}.reduce`,value:h,validateSpec:a,expressionContext:\"cluster-reduce\"}))}return o;case\"video\":return se({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case\"image\":return se({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case\"canvas\":return[new I(r,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return An({key:`${r}.type`,value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:n,validateSpec:a,styleSpec:i})}}function _x({key:t,value:e}){if(K(e)===\"string\")return vr({key:t,value:e});{let r=[];for(let i in e)r.push(...vr({key:`${t}.${i}`,value:e[i]}));return r}}function Zd(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new I(\"light\",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Fu);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new I(o,e[o],`unknown property \"${o}\"`)])}return a}function Hd(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new I(\"sky\",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Fu);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new I(o,e[o],`unknown property \"${o}\"`)])}return s}function Kd(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new I(\"terrain\",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new I(o,e[o],`unknown property \"${o}\"`)]);return a}function Dx(t){return vr(t).length===0?[]:Di(t)}function Sx(t){return vr(t).length===0?[]:Di(t)}function Ax(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1||r.length>4)return[new I(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:\"number\"},n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return ws({key:e,value:r,valueSpec:{}})}function Ex(t){let e=t.key,r=t.value;if(K(r)===\"array\"){let i={type:\"number\"};if(r.length<1)return[new I(e,r,\"array length at least 1 expected, length 0 found\")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return ws({key:e,value:r,valueSpec:{}})}function Tx(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1)return[new I(e,r,\"array length at least 1 expected, length 0 found\")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(tl({key:`${e}[${n}]`,value:r[n],valueSpec:{}}));return i}return tl({key:e,value:r,valueSpec:{}})}function Ix(t){let e=t.key,r=t.value,i=K(r),n=t.styleSpec;if(i!==\"array\"||r.length<1||r.length%2!=0)return[new I(e,r,\"variableAnchorOffsetCollection requires a non-empty array of even length\")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(An({key:`${e}[${s}]`,value:r[s],valueSpec:n.layout_symbol[\"text-anchor\"]})),a=a.concat(Lu({key:`${e}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:\"number\"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return a}function Jd(t){let e=[],r=t.value,i=t.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&e.push(new I(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&e.push(new I(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),e=e.concat(se({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:\"string\",required:!0},url:{type:\"string\",required:!0}},validateSpec:t.validateSpec}));return e}return vr({key:i,value:r})}function kx(t){let e=t.value,r=t.styleSpec,i=r.projection,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new I(\"projection\",e,`object expected, ${a} found`)];let s=[];for(let o in e)s=i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new I(o,e[o],`unknown property \"${o}\"`)]);return s}function Cx(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let i=K(r);return i===\"array\"&&!Mx(r)&&!Fx(r)?[new I(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:[\"array\",\"string\"].includes(i)?[]:[new I(e,r,`projection expected, invalid type \"${i}\" found`)]}function Fx(t){return!![\"interpolate\",\"step\",\"literal\"].includes(t[0])}function Mx(t){return Array.isArray(t)&&t.length===3&&typeof t[0]==\"string\"&&typeof t[1]==\"string\"&&typeof t[2]==\"number\"}function el(t){return!!t&&t.constructor===Object}function Qd(t){return el(t.value)?[]:[new I(t.key,t.value,`object expected, ${K(t.value)} found`)]}var _h=1114111,Px=/^u\\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\\?{1,6}))$/i;function Bx(t,e){if(K(e)!==\"string\")return[];let r=`${e}`,i=()=>[new I(t,e,'invalid unicode range, expected a value such as \"U+26\", \"U+0-10FFFF\" or \"U+4??\"')],n=r.match(Px);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>_h||u>_h?[new I(t,e,\"unicode range is out of bounds, the maximum code point is U+10FFFF\")]:l>u?[new I(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function ty(t){let e=t.key??\"font-faces\",r=t.value,i=t.validateSpec,n=t.styleSpec??Lf,a=t.style;if(!el(r))return[new I(e,r,`object expected, ${K(r)} found`)];let s=[];for(let o in r){let l=r[o],u=K(l);if(u===\"string\")s.push(...vr({key:`${e}.${o}`,value:l}));else if(u===\"array\"){let c={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[h,p]of l.entries()){let f=`${e}.${o}[${h}]`;s.push(...se({key:f,value:p,valueSpec:c,styleSpec:n,style:a,validateSpec:i}));let d=el(p)?p[\"unicode-range\"]:void 0;if(K(d)===\"array\")for(let[y,m]of d.entries())s.push(...Bx(`${f}.unicode-range[${y}]`,m))}}else s.push(new I(`${e}.${o}`,l,`string or array expected, ${u} found`))}return s}var Dh={\"*\"(){return[]},array:Lu,boolean:xx,number:ws,color:tl,constants:Nd,enum:An,filter:zu,function:Ud,layer:Yd,object:se,source:Wd,light:Zd,sky:Hd,terrain:Kd,projection:kx,projectionDefinition:Cx,string:vr,formatted:Dx,resolvedImage:Sx,padding:Ax,numberArray:Ex,colorArray:Tx,variableAnchorOffsetCollection:Ix,sprite:Jd,state:Qd,fontFaces:ty};function pn(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=pn,r.expression&&vs(At(e))?Ud(t):r.expression&&bs(zr(e))?Di(t):r.type&&Dh[r.type]?Dh[r.type](t):se(_n({},t,{valueSpec:r.type?i[r.type]:r}))}function ey(t){let e=t.value,r=t.key,i=vr(t);return i.length||(e.indexOf(\"{fontstack}\")===-1&&i.push(new I(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),e.indexOf(\"{range}\")===-1&&i.push(new I(r,e,'\"glyphs\" url must include a \"{range}\" token'))),i}function ie(t,e=D){let r=[];return r=r.concat(pn({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:pn,objectElementValidators:{glyphs:ey,\"*\"(){return[]}}})),t.constants&&(r=r.concat(Nd({key:\"constants\",value:t.constants,style:t,styleSpec:e,validateSpec:pn}))),ry(r)}ie.source=fe(pe(Wd)),ie.sprite=fe(pe(Jd)),ie.glyphs=fe(pe(ey)),ie.fontFaces=fe(pe(ty)),ie.light=fe(pe(Zd)),ie.sky=fe(pe(Hd)),ie.terrain=fe(pe(Kd)),ie.state=fe(pe(Qd)),ie.layer=fe(pe(Yd)),ie.filter=fe(pe(zu)),ie.paintProperty=fe(pe(Gd)),ie.layoutProperty=fe(pe(Xd));function pe(t){return function(e){return t(Object.assign({},e,{validateSpec:pn}))}}function ry(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function fe(t){return function(...e){return ry(t.apply(this,e))}}var Lx={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"},zx=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t===\"visible\"||t===\"none\"){this._literalValue=t===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=Lr(t,this._rootKey,Lx,this._globalState);if(e.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(\", \"));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=Un(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Vx(t,e,r){return new zx(t,e,r)}var Vu={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function Ox(t){return Vu.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf(\"://\"))]}function Rx(t,e){Vu.REGISTERED_PROTOCOLS[t]=e}function $x(t){delete Vu.REGISTERED_PROTOCOLS[t]}var Sh=\"global-dispatcher\",Za=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function iy(){if(mi(self))return self.worker?.referrer;if(window.location.protocol===\"blob:\")try{return window.parent.location.href}catch{}return window.location.href}var Nx=t=>t.startsWith(\"file:\")||iy()?.startsWith(\"file:\")&&!/^\\w+:/.test(t);async function Ux(t,e){let r=new Request(t.url,{method:t.method||\"GET\",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:iy(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type===\"json\"&&!r.headers.has(\"Accept\")&&r.headers.set(\"Accept\",\"application/json\");let i;try{i=await fetch(r)}catch(s){throw Pf(s)?s:new Za(0,Ra(s).message,t.url,new Blob)}if(!i.ok){let s=await i.blob();throw new Za(i.status,i.statusText,t.url,s)}let n;n=t.type===\"arrayBuffer\"||t.type===\"image\"?i.arrayBuffer():t.type===\"json\"?i.json():i.text();let a=await n;return Sm(e.signal),{data:a,cacheControl:i.headers.get(\"Cache-Control\"),expires:i.headers.get(\"Expires\"),etag:i.headers.get(\"ETag\")}}function jx(t,e){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(t.method||\"GET\",t.url,!0),(t.type===\"arrayBuffer\"||t.type===\"image\")&&(n.responseType=\"arraybuffer\");for(let a in t.headers)n.setRequestHeader(a,t.headers[a]);t.type===\"json\"&&(n.responseType=\"text\",t.headers?.Accept||n.setRequestHeader(\"Accept\",\"application/json\")),n.withCredentials=t.credentials===\"include\",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(t.type===\"json\")try{a=JSON.parse(n.response)}catch(s){i(s);return}r({data:a,cacheControl:n.getResponseHeader(\"Cache-Control\"),expires:n.getResponseHeader(\"Expires\"),etag:n.getResponseHeader(\"ETag\")})}else{let a=new Blob([n.response],{type:n.getResponseHeader(\"Content-Type\")});i(new Za(n.status,n.statusText,t.url,a))}},e.signal.addEventListener(\"abort\",()=>{n.abort(),i(new yu(e.signal.reason))}),n.send(t.body)})}var Ou=async function(t,e){if(t.url.includes(\"://\")&&!/^https?:|^file:/.test(t.url)){let r=Ox(t.url);if(r){let i=await r(t,e);return!i.data&&t.type===\"arrayBuffer\"?te(i,{data:new ArrayBuffer(0)}):i}if(mi(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,targetMapId:Sh},e)}if(!Nx(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,\"signal\"))return Ux(t,e);if(mi(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,mustQueue:!0,targetMapId:Sh},e)}return jx(t,e)},qx=(t,e)=>Ou(te(t,{type:\"json\"}),e),Gx=(t,e)=>Ou(te(t,{type:\"arrayBuffer\"}),e),We={};function B(t,e,r={}){if(We[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,\"_classRegistryKey\",{value:t,writeable:!1}),We[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}B(\"Object\",Object),B(\"Set\",Set),B(\"TransferableGridIndex\",Uo),B(\"Color\",dt),B(\"Error\",Error),B(\"AJAXError\",Za),B(\"ResolvedImage\",Re),B(\"StylePropertyFunction\",Ld),B(\"StyleExpression\",Mu,{omit:[\"_evaluator\"]}),B(\"ZoomDependentExpression\",Ya),B(\"ZoomConstantExpression\",Dn),B(\"CompoundExpression\",$r,{omit:[\"_evaluate\"]});for(let t in ui)ui[t]._classRegistryKey||B(`Expression_${t}`,ui[t]);function ny(t){return t&&typeof ArrayBuffer<\"u\"&&(t instanceof ArrayBuffer||t.constructor?.name===\"ArrayBuffer\")}function Ru(t){let e=t.constructor;return t.$name||e._classRegistryKey}function Xx(t){if(typeof t!=\"object\"||!t)return!1;let e=Ru(t);return e&&e!==\"Object\"}function ay(t){return!Xx(t)&&(t==null||typeof t==\"boolean\"||typeof t==\"number\"||typeof t==\"string\"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||ny(t)||du(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function fn(t,e){if(ay(t))return(ny(t)||du(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let a=[];for(let s of t)a.push(fn(s,e));return a}if(typeof t!=\"object\")throw Error(`can't serialize object of type ${typeof t}`);let r=Ru(t);if(!r)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!We[r])throw Error(`${r} is not registered.`);let{klass:i}=We[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(n===e?.[e.length-1])throw Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let a in t){if(!t.hasOwnProperty(a)||We[r].omit.includes(a))continue;let s=t[a];s!==void 0&&(n[a]=We[r].shallow.includes(a)?s:fn(s,e))}t instanceof Error&&(n.message=t.message)}if(n.$name)throw Error(\"$name property is reserved for worker serialization logic.\");return r!==\"Object\"&&(n.$name=r),n}function dn(t){if(ay(t))return t;if(Array.isArray(t))return t.map(dn);if(typeof t!=\"object\")throw Error(`can't deserialize object of type ${typeof t}`);let e=Ru(t)||\"Object\";if(!We[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:r}=We[e];if(!r)throw Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n===\"$name\")continue;let a=t[n];i[n]=We[e].shallow.includes(n)?a:dn(a)}return i}var Yx=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},Wx={once:!0},Zx=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Yx(()=>this.process()),this.subscription=eh(this.target,\"message\",r=>this.receive(r),!1),this.globalScope=mi(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?eh(e.signal,\"abort\",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:\"<cancel>\",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new yu(e.signal.reason))},Wx):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let s=[],o={...t,id:n,sourceMapId:this.mapId,origin:location.origin,data:fn(t.data,s)};this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=[\"file://\",\"resource://android\",\"null\"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId))if(e.type===\"<cancel>\"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort()}else mi(self)||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}async processTask(t,e){if(e.type===\"<response>\"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ra(dn(e.error))):n.resolve(dn(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=dn(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=await this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ra(n))}}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:\"<response>\",sourceMapId:this.mapId,origin:location.origin,error:e?fn(e):null,data:fn(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Ah=ie;new Set(Object.keys(D).filter(t=>t.startsWith(\"source_\")).map(t=>t.slice(7).replaceAll(\"_\",\"-\")));function Hx(t,e){let r=!1;for(let i of e)i.severity===\"warning\"?Pt(i.message):(t.fire(new Ua(Error(i.message))),r=!0);return r}function Kx(t,e,r,i){return i?.validate!==!1&&Hx(t,e({styleSpec:D,...r}))}var Eh=class{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}},ut=class{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new Eh,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Eh,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},En=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=lx(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(t){let e=this.getGlobalStateRefs();return t.some(r=>e.has(r))}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},rl=class{constructor(t,e,r){this.property=t,this.value=new En(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new Th(this.property,this.value,e,te({},t.transition,this.transition),t.now)}untransitioned(){return new Th(this.property,this.value,null,{},0)}},Jx=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return pr(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new rl(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new En(this._values[t].property,e===null?void 0:pr(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith(\"-transition\")?this.setTransition(e.slice(0,-11),r):No(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return pr(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new rl(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=pr(e)||void 0}retainPriorGlobalState(t,e,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(t)&&(n.value=new En(a.property,a.value,this._propertyRootKey(i),e))}}applyGlobalStateChange(t,e,r,i){this.retainPriorGlobalState(t,e,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(t)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new Ih(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Ih(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Th=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(t,e,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),n,dm(s))}}},Ih=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let i=new _s(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Qx=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return pr(this._values[t].value)}setValue(t,e){this._values[t]=new En(this._values[t].property,e===null?void 0:pr(e),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let i=new _s(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}},ge=class{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return this.value.kind===\"constant\"}constantOr(t){return this.value.kind===\"constant\"?this.value.value:t}evaluate(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)}},_s=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function kh(t){if(Array.isArray(t))return t.length;let e=t?.values;return Array.isArray(e)?e.length:void 0}function sy(t,e){let r=kh(t),i=kh(e);return r!==void 0&&i!==void 0&&r!==i}var z=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e){if(t.isDataDriven())throw Error(\"Value should not be data driven\");return t.expression.evaluate(e)}interpolate(t,e,r){if(sy(t,e))return Pt(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=Je[i];return n?n(t,e,r):t}},N=class{constructor(t,e,r){this.specification=t,this.name=e,this.overrides=r}possiblyEvaluate(t,e,r,i){return t.expression.kind===\"constant\"||t.expression.kind===\"camera\"?new ge(this,{kind:\"constant\",value:t.expression.evaluate(e,null,{},r,i)},e):new ge(this,t.expression,e)}interpolate(t,e,r){if(t.value.kind!==\"constant\"||e.value.kind!==\"constant\")return t;if(t.value.value===void 0||e.value.value===void 0)return new ge(this,{kind:\"constant\",value:void 0},t.parameters);if(sy(t.value.value,e.value.value))return Pt(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=Je[i];if(n){let a=n(t.value.value,e.value.value,r);return new ge(this,{kind:\"constant\",value:a},t.parameters)}return t}evaluate(t,e,r,i,n,a){return t.kind===\"constant\"?t.value:t.evaluate(e,r,i,n,a)}},Tn=class extends N{possiblyEvaluate(t,e,r,i){if(t.value===void 0)return new ge(this,{kind:\"constant\",value:void 0},e);if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i),a=t.property.specification.type===\"resolvedImage\"&&typeof n!=\"string\"?n.name:n,s=this._calculate(a,a,a,e);return new ge(this,{kind:\"constant\",value:s},e)}if(t.expression.kind===\"camera\"){let n=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ge(this,{kind:\"constant\",value:n},e)}return new ge(this,t.expression,e)}evaluate(t,e,r,i,n,a){if(t.kind===\"source\"){let s=t.evaluate(e,r,i,n,a);return this._calculate(s,s,s,e)}return t.kind===\"composite\"?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},oy=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new ut(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ut(Math.floor(e.zoom),e)),t.expression.evaluate(new ut(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Ds=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Zt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new En(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new rl(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};B(\"DataDrivenProperty\",N),B(\"DataConstantProperty\",z),B(\"CrossFadedDataDrivenProperty\",Tn),B(\"CrossFadedProperty\",oy),B(\"ColorRampProperty\",Ds);var Ch=\" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?\",mo=\" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?\",Ae=class extends Dm{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Vx(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!==\"custom\"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==\"background\"&&(this.source=t.source,this.sourceLayer=t[\"source-layer\"],this.filter=t.filter,this._featureFilter=Sn(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Qx(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Jx(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _s(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=Sn(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t===\"visibility\")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+Ch);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property \"${t}\" on layer type \"${this.type}\" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let e in this._transitionablePaint._values){let r=this._transitionablePaint._values[e].value;for(let i of r.getGlobalStateRefs()){let n=t.get(i)??[];n.push({name:e,value:r.value}),t.set(i,n)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){t===\"visibility\"?(this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility()):this._transitionablePaint?.hasProperty(t)?this.fire(new Ua(Error(t+Ch))):e!=null&&this._validate(Ah.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){if(t.endsWith(\"-transition\")){let e=t.slice(0,-11);if(e===\"visibility\"||this._unevaluatedLayout?.hasProperty(e))throw Error(t+mo);return this._transitionablePaint.getTransition(e)}if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+mo);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new Ua(Error(t+mo))),!1;if(e!=null&&this._validate(Ah.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(\"-transition\"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let i=this._transitionablePaint._values[t],n=i.property.specification[\"property-type\"]===\"cross-faded-data-driven\",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility===\"none\"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}retainPriorGlobalState(t,e){this._transitionablePaint?.retainPriorGlobalState(t,e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={id:this.id,type:this.type,source:this.source,\"source-layer\":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),xm(t,(e,r)=>e!==void 0&&!(r===\"layout\"&&!Object.keys(e).length)&&!(r===\"paint\"&&!Object.keys(e).length))}_validate(t,e,r,i,n={}){return Kx(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof ge&&wi(e.property.specification)&&(e.value.kind===\"source\"||e.value.kind===\"composite\")&&e.value.isStateDependent)return!0}return!1}},t2={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},jn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},wt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function It(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=e2(n.type),s=r=Fh(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:Fh(r,Math.max(i,e)),alignment:e}}function e2(t){return t2[t].BYTES_PER_ELEMENT}function Fh(t,e){return Math.ceil(t/e)*e}var In=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};In.prototype.bytesPerElement=4,B(\"StructArrayLayout2i4\",In);var il=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};il.prototype.bytesPerElement=6,B(\"StructArrayLayout3i6\",il);var Mh=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Mh.prototype.bytesPerElement=8,B(\"StructArrayLayout4i8\",Mh);var nl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};nl.prototype.bytesPerElement=12,B(\"StructArrayLayout2i4i12\",nl);var al=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*5,c=t*10;return this.int16[u+0]=e,this.int16[u+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=a,this.uint8[c+7]=s,this.int8[c+8]=o,this.int8[c+9]=l,t}};al.prototype.bytesPerElement=10,B(\"StructArrayLayout2i4ub2b10\",al);var kn=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};kn.prototype.bytesPerElement=8,B(\"StructArrayLayout2f8\",kn);var sl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,c){let h=t*10;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}};sl.prototype.bytesPerElement=20,B(\"StructArrayLayout10ui20\",sl);var ol=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};ol.prototype.bytesPerElement=16,B(\"StructArrayLayout8ui16\",ol);var ll=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,c,h,p)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,this.float32[y+6]=f,t}};ll.prototype.bytesPerElement=28,B(\"StructArrayLayout4i4ui4i1f28\",ll);var ul=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};ul.prototype.bytesPerElement=12,B(\"StructArrayLayout3f12\",ul);var cl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};cl.prototype.bytesPerElement=4,B(\"StructArrayLayout1ul4\",cl);var hl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let c=t*10,h=t*5;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=s,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,t}};hl.prototype.bytesPerElement=20,B(\"StructArrayLayout6i1ul2ui20\",hl);var pl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};pl.prototype.bytesPerElement=12,B(\"StructArrayLayout2i2i2i12\",pl);var Ph=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Ph.prototype.bytesPerElement=16,B(\"StructArrayLayout2f1f2i16\",Ph);var fl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};fl.prototype.bytesPerElement=16,B(\"StructArrayLayout2ub2f2i16\",fl);var dl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};dl.prototype.bytesPerElement=6,B(\"StructArrayLayout3ui6\",dl);var yl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g){let v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,v){let x=t*26,b=t*13,w=t*52;return this.int16[x+0]=e,this.int16[x+1]=r,this.uint16[x+2]=i,this.uint16[x+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=c,this.float32[b+7]=h,this.float32[b+8]=p,this.uint8[w+36]=f,this.uint8[w+37]=d,this.uint8[w+38]=y,this.uint32[b+10]=m,this.int16[x+22]=g,this.float32[b+12]=v,t}};yl.prototype.bytesPerElement=52,B(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52\",yl);var ml=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,v,x,b,w,_,S,A,E,R,M,V){let U=this.length;return this.resize(U+1),this.emplace(U,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,v,x,b,w,_,S,A,E,R,M,V)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,v,x,b,w,_,S,A,E,R,M,V,U){let k=t*34,C=t*17;return this.int16[k+0]=e,this.int16[k+1]=r,this.int16[k+2]=i,this.int16[k+3]=n,this.int16[k+4]=a,this.int16[k+5]=s,this.int16[k+6]=o,this.int16[k+7]=l,this.uint16[k+8]=u,this.uint16[k+9]=c,this.uint16[k+10]=h,this.uint16[k+11]=p,this.uint16[k+12]=f,this.uint16[k+13]=d,this.uint16[k+14]=y,this.uint16[k+15]=m,this.uint16[k+16]=g,this.uint16[k+17]=v,this.uint16[k+18]=x,this.uint16[k+19]=b,this.uint16[k+20]=w,this.uint16[k+21]=_,this.uint16[k+22]=S,this.uint32[C+12]=A,this.float32[C+13]=E,this.float32[C+14]=R,this.uint16[k+30]=M,this.uint16[k+31]=V,this.float32[C+16]=U,t}};ml.prototype.bytesPerElement=68,B(\"StructArrayLayout8i15ui1ul2f2ui1f68\",ml);var Ha=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};Ha.prototype.bytesPerElement=4,B(\"StructArrayLayout1f4\",Ha);var gl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};gl.prototype.bytesPerElement=12,B(\"StructArrayLayout1ui2f12\",gl);var xl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};xl.prototype.bytesPerElement=8,B(\"StructArrayLayout1ul2ui8\",xl);var vl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};vl.prototype.bytesPerElement=4,B(\"StructArrayLayout2ui4\",vl);var Bh=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};Bh.prototype.bytesPerElement=2,B(\"StructArrayLayout1ui2\",Bh);var bl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};bl.prototype.bytesPerElement=16,B(\"StructArrayLayout4f16\",bl);var ly=class extends jn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new T(this.anchorPointX,this.anchorPointY)}};ly.prototype.size=20;var uy=class extends hl{get(t){return new ly(this,t)}};B(\"CollisionBoxArray\",uy);var cy=class extends jn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};cy.prototype.size=52;var hy=class extends yl{get(t){return new cy(this,t)}};B(\"PlacedSymbolArray\",hy);var py=class extends jn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};py.prototype.size=68;var fy=class extends ml{get(t){return new py(this,t)}};B(\"SymbolInstanceArray\",fy);var dy=class extends Ha{getoffsetX(t){return this.float32[t*1+0]}};B(\"GlyphOffsetArray\",dy);var yy=class extends il{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};B(\"SymbolLineVertexArray\",yy);var my=class extends jn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};my.prototype.size=12;var gy=class extends gl{get(t){return new my(this,t)}};B(\"TextAnchorOffsetArray\",gy);var xy=class extends jn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};xy.prototype.size=8;var vy=class extends xl{get(t){return new xy(this,t)}};B(\"FeatureIndexArray\",vy);var r2=class extends In{},i2=class extends In{},n2=class extends In{},a2=class extends nl{},s2=class extends al{},o2=class extends kn{},Jr=class extends sl{},Lh=class extends ol{},l2=class extends ll{},u2=class extends ul{},c2=class extends cl{},zh=class extends pl{},h2=class extends fl{},qn=class extends dl{},wl=class extends vl{},_l=It([{name:\"a_pos\",components:2,type:\"Int16\"}],4),p2=_l.members;_l.size,_l.alignment;var le=class ri{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>ri.MAX_VERTEX_ARRAY_LENGTH&&Pt(`Max vertices per segment is ${ri.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${ri.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>ri.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new ri([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};le.MAX_VERTEX_ARRAY_LENGTH=2**16-1,B(\"SegmentVector\",le);function Vh(t,e){return t=Qt(Math.floor(t),0,255),e=Qt(Math.floor(e),0,255),256*t+e}var f2=It([{name:\"a_pattern_from\",components:4,type:\"Uint16\"},{name:\"a_pattern_to\",components:4,type:\"Uint16\"},{name:\"a_pixel_ratio_from\",components:1,type:\"Uint16\"},{name:\"a_pixel_ratio_to\",components:1,type:\"Uint16\"}]),d2=It([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]),y2=cu(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,c=461845907,h,p=0;p<s;)h=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)|0,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(h=0,a){case 3:h^=(i.charCodeAt(p+2)&255)<<16;case 2:h^=(i.charCodeAt(p+1)&255)<<8;case 1:h^=i.charCodeAt(p)&255,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)|0,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)|0,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),m2=cu(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Ka=tm(cu(((t,e)=>{var r=y2(),i=m2();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),by=class wy{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Oh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error(\"Trying to get index, but feature positions are not indexed\");let r=Oh(e),i=0,n=this.ids.length-1;for(;i<n;){let s=i+n>>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Dl(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new wy;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Oh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Ka.default)(String(t))}function Dl(t,e,r,i){let n=!1;for(;r<i;){let a=t[n?r+Math.floor(Math.random()*(i-r)):r+i>>1],s=r-1,o=i+1;for(;;){do s++;while(t[s]<a);do o--;while(t[o]>a);if(s>=o)break;ma(t,s,o),ma(e,3*s,3*o),ma(e,3*s+1,3*o+1),ma(e,3*s+2,3*o+2)}n=Math.min(o-r,i-o)<i-r>>3,o-r<i-o?(Dl(t,e,r,o),r=o+1):(Dl(t,e,o+1,i),i=o)}}function ma(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}B(\"FeaturePositionMap\",by);var $u=class{constructor(t,e){this.gl=t.gl,this.location=e}},Nu=class extends $u{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}},g2=class extends $u{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},x2=class extends $u{constructor(t,e){super(t,e),this.current=dt.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}};function Sl(t){return[Vh(255*t.r,255*t.g),Vh(255*t.b,255*t.a)]}var an=class{constructor(t,e,r){this.value=t,this.uniformNames=e.map(i=>`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type===\"color\"?new x2(t,e):new Nu(t,e)}},kr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.dashFrom=null,this.dashTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i===\"u_pattern_to\"?n=this.patternTo:i===\"u_pattern_from\"?n=this.patternFrom:i===\"u_dasharray_to\"?n=this.dashTo:i===\"u_dasharray_from\"?n=this.dashFrom:i===\"u_pixel_ratio_to\"?n=this.pixelRatioTo:i===\"u_pixel_ratio_from\"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith(\"u_pattern\")||r.startsWith(\"u_dasharray_\")?new g2(t,e):new Nu(t,e)}},qe=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:\"Float32\",components:r===\"color\"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new ut(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ut(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type===\"color\"){let i=Sl(r);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},we=class{constructor(t,e,r,i,n,a){this.expression=t,this.uniformNames=e.map(s=>`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:\"Float32\",components:r===\"color\"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new ut(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new ut(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ut(this.zoom,n),r,i),s=this.expression.evaluate(new ut(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type===\"color\"){let n=Sl(r),a=Sl(i);for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,n[0],n[1],a[0],a[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=Qt(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)}getBinding(t,e,r){return new Nu(t,e)}},ur=class{constructor(t,e,r,i,n,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,this.getPositionIds(e),r)}updatePaintArray(t,e,r,i,n){this._setPaintValues(t,e,this.getPositionIds(r),n)}_setPaintValues(t,e,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,a,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},_y=class extends ur{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return f2.members}emplace(t,e,r,i){t.emplace(e,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},Dy=class extends ur{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return d2.members}emplace(t,e,r,i){t.emplace(e,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},Sy=class{constructor(t,e,r){this.binders={},this._buffers=[];let i=[];for(let n in t.paint._values){if(!r(n))continue;let a=t.paint.get(n);if(!(a instanceof ge)||!wi(a.property.specification))continue;let s=v2(n,t.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification[\"property-type\"],h=c===\"cross-faded\"||c===\"cross-faded-data-driven\";if(o.kind===\"constant\")this.binders[n]=h?new kr(o.value,s):new an(o.value,s,l),i.push(`/u_${n}`);else if(o.kind===\"source\"||h){let p=Rh(n,l,\"source\");this.binders[n]=h?n===\"line-dasharray\"?new Dy(o,l,u,e,p,t.id):new _y(o,l,u,e,p,t.id):new qe(o,s,l,p),i.push(`/a_${n}`)}else{let p=Rh(n,l,\"composite\");this.binders[n]=new we(o,s,l,u,e,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join(\"\")}getMaxValue(t){let e=this.binders[t];return e instanceof qe||e instanceof we?e.maxValue:0}populatePaintArrays(t,e,r){for(let i in this.binders){let n=this.binders[i];(n instanceof qe||n instanceof we||n instanceof ur)&&n.populatePaintArray(t,e,r)}}setConstantPatternPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof kr&&i.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof kr&&i.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,r,i,n){let a=!1;for(let s of t){let o=e.getPositions(s.id);for(let l of o){let u=r.feature(l.index);for(let c in this.binders){let h=this.binders[c];(h instanceof qe||h instanceof we||h instanceof ur)&&h.expression.isStateDependent===!0&&(h.expression=i.paint.get(c).value,h.updatePaintArray(l.start,l.end,u,s.state,n),a=!0)}}}return a}defines(){let t=[];for(let e in this.binders){let r=this.binders[e];(r instanceof an||r instanceof kr)&&t.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof qe||r instanceof we)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof ur){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof an||r instanceof kr||r instanceof we)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof an||n instanceof kr||n instanceof we){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof ur){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof qe||r instanceof we)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof qe||r instanceof we||r instanceof ur)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof qe||e instanceof we||e instanceof ur)&&e.destroy()}}},Vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Sy(i,e,r);this.needsUpload=!1,this._featureMap=new by,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function v2(t,e){return{\"text-opacity\":[\"opacity\"],\"icon-opacity\":[\"opacity\"],\"text-color\":[\"fill_color\"],\"icon-color\":[\"fill_color\"],\"text-halo-color\":[\"halo_color\"],\"icon-halo-color\":[\"halo_color\"],\"text-halo-blur\":[\"halo_blur\"],\"icon-halo-blur\":[\"halo_blur\"],\"text-halo-width\":[\"halo_width\"],\"icon-halo-width\":[\"halo_width\"],\"line-gap-width\":[\"gapwidth\"],\"line-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"line-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-extrusion-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"]}[t]||[t.replace(`${e}-`,\"\").replace(/-/g,\"_\")]}function b2(t){return{\"line-pattern\":{source:Jr,composite:Jr},\"fill-pattern\":{source:Jr,composite:Jr},\"fill-extrusion-pattern\":{source:Jr,composite:Jr},\"line-dasharray\":{source:Lh,composite:Lh}}[t]}function Rh(t,e,r){let i={color:{source:kn,composite:bl},number:{source:Ha,composite:kn}};return b2(t)?.[r]||i[e][r]}B(\"ConstantBinder\",an),B(\"CrossFadedConstantBinder\",kr),B(\"SourceExpressionBinder\",qe),B(\"CrossFadedPatternBinder\",_y),B(\"CrossFadedDasharrayBinder\",Dy),B(\"CompositeExpressionBinder\",we),B(\"ProgramConfiguration\",Sy,{omit:[\"_buffers\"]}),B(\"ProgramConfigurationSet\",Vr);var Al=2**14-1,$h=-Al-1;function Nr(t){let e=rt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Qt(a,$h,Al),n.y=Qt(s,$h,Al),(a<n.x||a>n.x+1||s<n.y||s>n.y+1)&&Pt(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return r}function Ci(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Nr(t):[]}}var Cn=class El{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new El;return r.extend(e(new T(this.minX,this.minY))),r.extend(e(new T(this.maxX,this.minY))),r.extend(e(new T(this.minX,this.maxY))),r.extend(e(new T(this.maxX,this.maxY))),r}static fromPoints(e){let r=new El;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};Cn.fromPoints([new T(0,0),new T(rt,rt)]);function Ja(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Nh(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}function Uu(t){return t.x<0||t.x>=8192||t.y<0||t.y>=8192}var Uh=-32768;function w2(t,e,r,i,n){t.emplaceBack(Uh+e*8+i,Uh+r*8+n)}var ju=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new i2,this.indexArray=new qn,this.segments=new le,this.programConfigurations=new Vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type===\"heatmap\";if(i.type===\"circle\"){let h=i;a=h.layout.get(\"circle-sort-key\"),s=!a.isConstant(),o||(o=h.paint.get(\"circle-pitch-alignment\")===\"map\")}let l=o?e.subdivisionGranularity.circle:1,u=new ut(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:h,id:p,index:f,sourceLayerIndex:d}of t){let y=Ci(h,c);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:h.properties,type:h.type,sourceLayerIndex:d,index:f,geometry:c?y.geometry:Nr(h),patterns:{},sortKey:m};n.push(g)}s&&n.sort((h,p)=>h.sortKey-p.sortKey);for(let h of n){let{geometry:p,index:f,sourceLayerIndex:d}=h,y=t[f].feature;this.addFeature(h,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,p2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,c=l.y;if(Uu(l))continue;let h=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;for(let f=0;f<s;f++)for(let d=0;d<s;d++)w2(this.layoutVertexArray,u,c,a[d],a[f]);for(let f=0;f<s-1;f++)for(let d=0;d<s-1;d++){let y=p+f*s+d,m=p+(f+1)*s+d;this.indexArray.emplaceBack(y,m+1,y+1),this.indexArray.emplaceBack(y,m,m+1)}h.vertexLength+=s*s,h.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:{},canonical:i})}};B(\"CircleBucket\",ju,{omit:[\"layers\"]});function _2(t,e){for(let r of t)if(Si(e,r))return!0;for(let r of e)if(Si(t,r))return!0;return qu(t,e)}function Ss(t,e,r){return Si(t,e)?!0:Tl(e,t,r)}function Ay(t,e){if(t.length===1)return jh(e,t[0]);for(let r of e)for(let i of r)if(Si(t,i))return!0;for(let r of t)if(jh(e,r))return!0;for(let r of e)if(qu(t,r))return!0;return!1}function D2(t,e,r){for(let i of e){if(t.length>=3){for(let n of i)if(Si(t,n))return!0}if(S2(t,i,r))return!0}return!1}function S2(t,e,r){if(t.length>1){if(qu(t,e))return!0;for(let i of e)if(Tl(i,t,r))return!0}for(let i of t)if(Tl(i,e,r))return!0;return!1}function qu(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let i=t[r],n=t[r+1];for(let a=0;a<e.length-1;a++){let s=e[a],o=e[a+1];if(A2(i,n,s,o))return!0}}return!1}function A2(t,e,r,i){return fr(t,r,i)!==fr(e,r,i)&&fr(t,e,r)!==fr(t,e,i)}function Tl(t,e,r){let i=r*r;if(e.length===1)return t.distSqr(e[0])<i;for(let n=1;n<e.length;n++){let a=e[n-1],s=e[n];if(Ey(t,a,s)<i)return!0}return!1}function Ey(t,e,r){let i=e.distSqr(r);if(i===0)return t.distSqr(e);let n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function jh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;o<i.length;l=o++)n=i[o],a=i[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function Si(t,e){let r=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let a=t[i],s=t[n];a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function E2(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new T(e,r),new T(e,n),new T(i,n),new T(i,r)];if(t.length>2){for(let s of a)if(Si(t,s))return!0}for(let s=0;s<t.length-1;s++){let o=t[s],l=t[s+1];if(T2(o,l,a))return!0}return!1}function T2(t,e,r){let i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;let a=fr(t,e,r[0]);return a!==fr(t,e,r[1])||a!==fr(t,e,r[2])||a!==fr(t,e,r[3])}var Ye=63710088e-1,ft=class sn{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new sn(ai(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return Ye*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof sn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new sn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==\"object\"&&e)return new sn(Number(\"lng\"in e?e.lng:e.lon),Number(e.lat));throw Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]\")}},go=6378137,Il={origin:[-Math.PI*go,Math.PI*go],extentAtZoom0:2*Math.PI*go},Gu=2*Math.PI*Ye;function Ty(t){return Gu*Math.cos(t*Math.PI/180)}function Iy(t){return(180+t)/360}function ky(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function kl(t,e){return t/Ty(e)}function Cy(t){return t*360-180}function Fn(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function I2(t,e){return t*Ty(Fn(e))}function Fy(t){return 1/Math.cos(t*Math.PI/180)}var xe=class My{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ft.convert(e);return new My(Iy(i.lng),ky(i.lat),kl(r,i.lat))}toLngLat(){return new ft(Cy(this.x),Fn(this.y))}toAltitude(){return I2(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Gu*Fy(Fn(this.y))}},k2=new class{constructor(){this.name=\"mercator\",this.wraps=!0,this.tileMatrixSet=Il}worldFromLngLat(t,e,r){return new xe(Iy(t),ky(e),r===void 0?0:kl(r,e))}lngLatFromWorld(t,e){return new ft(Cy(t),Fn(e))}hasLngLat(t,e){return!0}metersPerWorldUnit(t,e){return 1/(1/Gu*Fy(Fn(e)))}worldZFromAltitude(t,e){return kl(t,e.lat)}};function C2(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var Py=class{constructor(t,e,r){if(!C2(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=ci(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r,i=Il){let n=F2(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r===\"tms\"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?\"@2x\":\"\").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>qh(this.x,this.y,this.z,Il)).replace(/{bbox}/g,()=>qh(this.x,this.y,this.z,i))}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new T((t.x*e-this.x)*rt,(t.y*e-this.y)*rt)}toString(){return`${this.z}/${this.x}/${this.y}`}},Qa=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=ci(t,e.z,e.z,e.x,e.y)}},As=class de{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Py(i,+n,+a),this.key=ci(r,e,i,n,a)}clone(){return new de(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new de(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new de(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?ci(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):ci(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new de(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new de(r,this.wrap,r,i,n),new de(r,this.wrap,r,i+1,n),new de(r,this.wrap,r,i,n+1),new de(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new de(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new de(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Qa(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new xe(e.x-this.wrap,e.y))}normalizeCoordinates(e,r,i=rt){if(e>=0&&e<i&&r>=0&&r<i)return{tileID:this,x:e,y:r};let n=Math.floor(e/i),a=Math.floor(r/i),s=e-n*i,o=r-a*i,l=this.canonical.z,u=1<<l,c=this.canonical.y+a;if(c<0||c>=u)return null;let h=this.canonical.x+n,p=this.wrap;return h<0?(p-=Math.ceil(-h/u),h=(h%u+u)%u):h>=u&&(p+=Math.floor(h/u),h%=u),{tileID:new de(this.overscaledZ,p,l,h,c),x:s,y:o}}};function ci(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<<r;return(a*a*t+a*n+i).toString(36)+r.toString(36)+e.toString(36)}function qh(t,e,r,i){let n=2**r,a=i.extentAtZoom0/n,[s,o]=i.origin,l=o-i.extentAtZoom0,u=n-e-1;return`${s+t*a},${l+u*a},${s+(t+1)*a},${l+(u+1)*a}`}function F2(t,e,r){let i=\"\";for(let n=t;n>0;n--){let a=1<<n-1;i+=(e&a?1:0)+(r&a?2:0)}return i}B(\"CanonicalTileID\",Py),B(\"OverscaledTileID\",As,{omit:[\"terrainRttPosMatrix32f\"]});var By=class Ge{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof ft?new ft(e.lng,e.lat):ft.convert(e),this}setSouthWest(e){return this._sw=e instanceof ft?new ft(e.lng,e.lat):ft.convert(e),this}extend(e){let r=this._sw,i=this._ne,n,a;if(e instanceof ft)n=e,a=e;else if(e instanceof Ge){if(n=e._sw,a=e._ne,!n||!a)return this}else{if(Array.isArray(e)){if(e.length===4||e.every(Array.isArray)){let s=e;return this.extend(Ge.convert(s))}{let s=e;return this.extend(ft.convert(s))}}return e&&(\"lng\"in e||\"lon\"in e)&&\"lat\"in e?this.extend(ft.convert(e)):this}return!r&&!i?(this._sw=new ft(n.lng,n.lat),this._ne=new ft(a.lng,a.lat)):(r.lng=Math.min(n.lng,r.lng),r.lat=Math.min(n.lat,r.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)),this}getCenter(){return new ft((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new ft(this.getWest(),this.getNorth())}getSouthEast(){return new ft(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:i}=ft.convert(e),n=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),n&&a}intersects(e){if(e=Ge.convert(e),!(e.getNorth()>=this.getSouth()&&e.getSouth()<=this.getNorth()))return!1;let r=Math.abs(this.getEast()-this.getWest()),i=Math.abs(e.getEast()-e.getWest());if(r>=360||i>=360)return!0;let n=ai(this.getWest(),-180,180),a=ai(this.getEast(),-180,180),s=ai(e.getWest(),-180,180),o=ai(e.getEast(),-180,180),l=n>a,u=s>o;return l&&u?!0:l?o>=n||s<=a:u?a>=s||n<=o:s<=a&&o>=n}static convert(e){return e instanceof Ge||!e?e:new Ge(e)}static fromLngLat(e,r=0){let i=360*r/40075017,n=i/Math.cos(Math.PI/180*e.lat);return new Ge(new ft(e.lng-n,e.lat-i),new ft(e.lng+n,e.lat+i))}adjustAntiMeridian(){let e=new ft(this._sw.lng,this._sw.lat),r=new ft(this._ne.lng,this._ne.lat);return e.lng>r.lng?new Ge(e,new ft(r.lng+360,r.lat)):new Ge(e,r)}};function Ly(t,e,r){let i=1/(1<<r.z);return new xe(t/rt*i+r.x*i,e/rt*i+r.y*i)}function zy(t){if(!t)return[0,0,1,1];let e=t.canonical.z>=0?1<<t.canonical.z:2**t.canonical.z;return[t.canonical.x/e,t.canonical.y/e,1/e/rt,1/e/rt]}function M2(t,e,r){return Ly(t,e,r).toLngLat()}function P2(t){return t.cameraToCenterDistance*Math.min(Math.tan(gi(90-t.pitch))*.85,Math.tan(gi(89.25-t.pitch)))}function Cl(t,e){let r=t.canonical,i=e/gm(r.z),n=r.x+2**r.z*t.wrap,a=new Float64Array(16);return hu(a),nm(a,a,[n*i,r.y*i,0]),If(a,a,[i/rt,i/rt,1]),a}function B2(t,e,r,i){let{x:n,y:a,z:s}=L2(e,r),o=i*-n,l=i*-a,u=i*s;return new xe(t.x+o,t.y+l,t.z+u)}function L2(t,e){let r=gi(t),i=gi(e),n=Math.cos(-r),a=Math.sin(r);return{x:a*Math.sin(i),y:-a*Math.cos(i),z:n}}function z2(t,e,r){let i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}function kt(t){return t.projection===\"globe\"?t.globeness>0?t.verticalPerspective:t.mercator:t}function xo(t){return kt(t).projection===\"vertical-perspective\"}function V2(t){let e=Math.tan(t.pitchInRadians)*(t.cameraToCenterDistance||1);return t.centerPoint.add(new T(e*Math.sin(t.rollInRadians),e*Math.cos(t.rollInRadians)))}function Vy(t,e){let r=V2(t);if(e.length===1)return[e[0],r];let{minX:i,minY:n,maxX:a,maxY:s}=Cn.fromPoints(e).extend(r);return[new T(i,n),new T(a,n),new T(a,s),new T(i,s),new T(i,n)]}function O2(t,e=1,r=0,i,n){let a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],s=n?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],o=2**r,l=a.map(p=>R2(p,t,e,o));i&&$2(l,s[0],i,n);let u=s.map(p=>{let f=Ce([],pu([],He([],l[p[0]],l[p[1]]),He([],l[p[2]],l[p[1]]))),d=-mr(f,l[p[1]]);return f.concat(d)}),c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let p of l)for(let f=0;f<3;f++)c[f]=Math.min(c[f],p[f]),h[f]=Math.max(h[f],p[f]);return{points:l,planes:u,aabb:{min:c,max:h}}}function R2(t,e,r,i){let n=Ve([],t,e),a=1/n[3]/r*i;return hm(n,n,[a,a,1/n[3],a])}function $2(t,e,r,i){let n=i?4:0,a=i?0:4,s=0,o=[],l=[];for(let h=0;h<4;h++){let p=He([],t[h+a],t[h+n]),f=ls(p);yr(p,p,1/f),o.push(f),l.push(p)}for(let h=0;h<4;h++){let p=fm(t[h+n],l[h],r);s=p!==null&&p>=0?Math.max(s,p):Math.max(s,o[h])}let u=N2(t,e),c=U2(r,u);if(c!==null){let h=c/mr(l[0],u);s=Math.min(s,h)}for(let h=0;h<4;h++){let p=Math.min(s,o[h]);t[h+a]=[t[h+n][0]+l[h][0]*p,t[h+n][1]+l[h][1]*p,t[h+n][2]+l[h][2]*p,1]}}function N2(t,e){let r=He([],t[e[0]],t[e[1]]),i=He([],t[e[2]],t[e[1]]),n=[0,0,0,0];return Ce(n,pu([],r,i)),n[3]=-mr(n,t[e[0]]),n}function U2(t,e){let r=cm([],t,1/Ro(t)),i=He([],e,yr([],r,mr(e,r))),n=Ro(i);if(n>0){let a=Math.sqrt(1-r[3]*r[3]);return $o(e,Ca([],yr([],r,-r[3]),yr([],i,a/n)))}return null}var Gh=rt*(1-1e-12),Xh={covered:!1,demLoaded:!1,elevation:0};function Oy(t,e,r,i,n){if(i<0||i>=1||!n&&(r<0||r>=1))return Xh;let a=n?Math.floor(r):0,s=r-a;for(let o of t.zooms){let l=1<<o,u=s*l,c=i*l,h=Math.floor(u),p=Math.floor(c),f=`${a}/${o}/${h}/${p}`;if(!t.samplerPerTile.has(f))continue;let d=t.samplerPerTile.get(f);return d?{covered:!0,demLoaded:!0,elevation:d(Math.min((u-h)*rt,Gh),Math.min((c-p)*rt,Gh),rt)*e}:{covered:!0,demLoaded:!1,elevation:0}}return Xh}function Ry(t,e){return t.covered&&e<=t.elevation+1e-6}function $y(t,e,r,i,n){for(let a=0;a<40&&i-r>n;a++){let s=(r+i)/2;e(t,s)?i=s:r=s}return{lo:r,hi:i}}var Yh=new WeakMap;function Fl(t){let e=Yh.get(t);return e||(e={posMatrices:new Map,alignedPosMatrices:new Map,fogMatrices:new Map},Yh.set(t,e)),e}function Wh(t){return P2(t)}function Zh(t,e){return e?t.lngLatFromWorld(e.x,e.y):void 0}function j2(t,e,r,i,n){let a=n.getCoverageIndex();if(!a)return null;let s=t.worldSize,o=i[0]-r[0],l=i[1]-r[1],u=i[2]-r[2],c={index:a,exaggeration:n.exaggeration,near:r,dx:o,dy:l,dz:u,worldSize:s,wraps:e.wraps},h=0,p=1;if(u===0){if(r[2]>a.maxElevation||r[2]<a.minElevation)return null}else{let g=(a.maxElevation-r[2])/u,v=(a.minElevation-r[2])/u;if(h=Math.max(h,Math.min(g,v)),p=Math.min(p,Math.max(g,v)),h>p)return null}let f=Math.hypot(o,l),d=Qt(Math.ceil(f*(p-h)/4),1,512),y=0,m=!ga(c,0);for(let g=0;g<=d;g++){let v=h+(p-h)*g/d;if(!m)m=!ga(c,v);else if(ga(c,v)){let{lo:x,hi:b}=$y(c,ga,y,v,.001/f),w=za(c,x),_=za(c,b),S=r[2]+x*u-w.elevation,A=r[2]+b*u-_.elevation,E=w.covered&&S>A?Qt(x+S*(b-x)/(S-A),x,b):b;return new xe((r[0]+E*o)/s,(r[1]+E*l)/s,za(c,E).elevation)}y=v}return null}function Ml(t,e,r=0){let i=[e.x,e.y,r,1],n=[e.x,e.y,1,1];Ve(i,i,t.pixelMatrixInverse),Ve(n,n,t.pixelMatrixInverse);let a=i[3],s=n[3],o=t.elevation;return{near:[i[0]/a,i[1]/a,i[2]/a+o],far:[n[0]/s,n[1]/s,n[2]/s+o]}}function or(t,e,r){let i=r||0,{near:n,far:a}=Ml(t,e),s=n[2]===a[2]?0:(i+t.elevation-n[2])/(a[2]-n[2]);return new xe(Je.number(n[0],a[0],s)/t.worldSize,Je.number(n[1],a[1],s)/t.worldSize,i)}function Hh(t,e,r=0,i=t.pixelMatrix){let n=Ny(t,e,r,i),a=n[3];return a>0?new T(n[0]/a,n[1]/a):q2(t,n[0],n[1],a)}function Ny(t,e,r,i){let n=[e.x*t.worldSize,e.y*t.worldSize,r,1];return Ve(n,n,i)}function q2(t,e,r,i){let n=t.width/2,a=t.height/2,s=e-n*i,o=r-a*i;s===0&&o===0&&(o=1);let l=n+t.width,u=a+t.height,c=Math.min(s===0?1/0:l/Math.abs(s),o===0?1/0:u/Math.abs(o));return new T(n+s*c,a+o*c)}function vo(t,e,r=!1,i=!1){let n=e.key??ci(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=r?Fl(t).alignedPosMatrices:Fl(t).posMatrices;if(a.has(n)){let l=a.get(n);return i?l.f32:l.f64}let s=Cl(e,t.worldSize);Oo(s,r?t.alignedModelViewProjectionMatrix:t.modelViewProjectionMatrix,s);let o={f64:s,f32:new Float32Array(s)};return a.set(n,o),i?o.f32:o.f64}function za(t,e){return Oy(t.index,t.exaggeration,(t.near[0]+e*t.dx)/t.worldSize,(t.near[1]+e*t.dy)/t.worldSize,t.wraps)}function ga(t,e){return Ry(za(t,e),t.near[2]+e*t.dz)}function Kh({near:t,far:e},r,i,n){let a=e[0]-t[0],s=e[1]-t[1],o=e[2]-t[2];return((r-t[0])*a+(i-t[1])*s+(n-t[2])*o)/(a*a+s*s+o*o)}var G2=class{getVisibleUnwrappedCoordinates(t,e,r){let i=[new Qa(0,r)];if(t.renderWorldCopies&&e.wraps){let n=or(t,new T(0,0)),a=or(t,new T(t.width,0)),s=or(t,new T(t.width,t.height)),o=or(t,new T(0,t.height)),l=Math.floor(Math.min(n.x,a.x,s.x,o.x)),u=Math.floor(Math.max(n.x,a.x,s.x,o.x));for(let c=l-1;c<=u+1;c++)c!==0&&i.push(new Qa(c,r))}return i}getCameraFrustum(t){return O2(t.inverseModelViewProjectionMatrix,t.worldSize)}locationToScreenPoint(t,e,r,i){let n=e.worldFromLngLat(r.lng,r.lat);return i?Hh(t,n,i.getElevationForLngLat(r,t.tileZoom),t.pixelMatrix3D):Hh(t,n)}screenPointToLocation(t,e,r,i){return Zh(e,this.screenPointToMercatorCoordinate(t,e,r,i))}screenPointToLocationAtElevation(t,e,r,i){return Zh(e,or(t,r,i-t.elevation))}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n!=null)return n}return or(t,r)}screenTerrainPointToMercatorCoordinate(t,e,r,i){let{near:n,far:a}=Ml(t,r,-1);return j2(t,e,n,a,i)}getBounds(t,e){let r=Math.max(0,t.height/2-Wh(t));return new By().extend(this.screenPointToLocation(t,e,new T(0,r))).extend(this.screenPointToLocation(t,e,new T(t.width,r))).extend(this.screenPointToLocation(t,e,new T(t.width,t.height))).extend(this.screenPointToLocation(t,e,new T(0,t.height)))}isPointOnMapSurface(t,e,r,i){if(i)return this.screenTerrainPointToMercatorCoordinate(t,e,r,i)!=null;let n=r.y>t.centerPoint.y-Wh(t);if(!n||e.wraps)return n;let a=or(t,r);return e.hasLngLat(a.x,a.y)}calculateFogMatrix(t,e){let r=e.key,i=Fl(t).fogMatrices;if(i.has(r))return i.get(r);let n=Cl(e,t.worldSize);return Oo(n,t.fogMatrix,n),i.set(r,new Float32Array(n)),i.get(r)}maxPitchScaleFactor(t){if(!t.pixelMatrixInverse)return 1;let e=or(t,new T(0,0)),r=[e.x*t.worldSize,e.y*t.worldSize,0,1];return Ve(r,r,t.pixelMatrix)[3]/t.cameraToCenterDistance}getCameraAltitude(t){return Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.pixelsPerMeter+t.elevation}getCameraLngLat(t,e){let r=t.center,i=e.worldZFromAltitude(1,r),n=i*t.worldSize,a=t.cameraToCenterDistance/n,s=B2(e.worldFromLngLat(r.lng,r.lat,t.elevation),t.pitch,t.bearing,a*i);return e.lngLatFromWorld(s.x,s.y)}getProjectionData(t,e){let{overscaledTileID:r,aligned:i,applyTerrainMatrix:n}=e,a=zy(r),s=r?vo(t,r,i,!0):null,o;return o=r?.terrainRttPosMatrix32f&&n?r.terrainRttPosMatrix32f:s||pm(),{mainMatrix:o,tileMercatorCoords:a,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(t,e,r,i,n){if(!i?.getCoverageIndex())return!1;let a=e.worldFromLngLat(r.lng,r.lat);n??(n=i.getElevationForLngLat(r,t.tileZoom));let s=Ny(t,a,n,t.pixelMatrix3D),o=s[3];if(o<=0||s[2]>o)return!0;let l=new T(s[0]/o,s[1]/o),u=this.screenTerrainPointToMercatorCoordinate(t,e,l,i);if(u==null)return!1;let c=Ml(t,l,-1),h=Kh(c,a.x*t.worldSize,a.y*t.worldSize,n);return Kh(c,u.x*t.worldSize,u.y*t.worldSize,u.z)<h*.99}getPixelScale(t){return 1}getCircleRadiusCorrection(t){return 1}getPitchedTextCorrection(t,e,r,i){return 1}transformLightDirection(t,e){return sm(e)}projectTileCoordinates(t,e,r,i,n){let a=vo(t,i),s;n==null?(s=[e,r,0,1],z2(s,s,a)):(s=[e,r,n,1],Ve(s,s,a));let o=s[3];return{point:new T(s[0]/o,s[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}getProjectionDataForCustomLayer(t,e=!0){let r=new As(0,0,0,0,0),i=this.getProjectionData(t,{overscaledTileID:r,applyGlobeMatrix:e}),n=Cl(r,t.worldSize);Oo(n,t.modelViewProjectionMatrix,n);let a=[rt,rt,t.worldSize/t.pixelsPerMeter],s=Ff();return If(s,n,a),{...i,tileMercatorCoords:[0,0,1,1],fallbackMatrix:s,mainMatrix:s}}getFastPathSimpleProjectionMatrix(t,e){return vo(t,e)}getClippingPlane(t){return null}getRayDirectionFromPixel(t,e){throw Error(\"Not implemented.\")}getCameraQueryGeometry(t,e){return Vy(t,e)}};function X2(t,e){return[$a(t*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-e*Math.PI*2))-Math.PI*.5]}function Y2(t,e){let r=Math.cos(e),i=new Float64Array(3);return i[0]=Math.sin(t)*r,i[1]=Math.sin(e),i[2]=Math.cos(t)*r,i}function W2(t,e,r,i,n){let a=1/(1<<n),s=t/rt*a+r*a,o=e/rt*a+i*a,l=$a(s*Math.PI*2+Math.PI,Math.PI*2),u=2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-Math.PI*.5,c=Math.cos(u),h=new Float64Array(3);return h[0]=Math.sin(l)*c,h[1]=Math.sin(u),h[2]=Math.cos(l)*c,h}function Pl(t){return Y2(t.lng*Math.PI/180,t.lat*Math.PI/180)}function ts(t){let e=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){let i=t[0]/r,n=t[2]/r,a=Math.acos(n);return new ft(ai((i>0?a:-a)/Math.PI*180,-180,180),e)}return new ft(0,e)}function Z2(t){let e=jt();return e[0]=t[0]*-t[3],e[1]=t[1]*-t[3],e[2]=t[2]*-t[3],{center:e,radius:Math.sqrt(1-t[3]*t[3])}}function H2(t,e,r){let i=jt();He(i,r,t);let n=jt();return Cf(n,t,i,e/Ro(i)),n}function Jh(t){return Math.cos(Math.min(Math.abs(t),85.051129)*Math.PI/180)}function es(t,e,r=1){let i=mr(t,e),n=r*r,a=jt(),s=jt();yr(s,e,i),He(a,t,s);let o=n-mr(a,a);if(o<0)return null;let l=mr(t,t)-n,u=-i+(i<0?1:-1)*Math.sqrt(o),c=l/u,h=u,p=Math.max(c,h);return p<0?null:{tMin:Math.min(c,h),tMax:p}}function K2(t,e,r,i){let n=t.cameraPosition,a=e-n[0],s=r-n[1],o=i-n[2],l=a*a+s*s+o*o;if(l===0)return!1;let u=Qt(-(n[0]*a+n[1]*s+n[2]*o)/l,0,1),c=n[0]+u*a,h=n[1]+u*s,p=n[2]+u*o;return c*c+h*h+p*p<1}function bo(t,e){let r=fu();return Ve(r,[...e,1],t.modelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],new T((r[0]*.5+.5)*t.width,(-r[1]*.5+.5)*t.height)}function Qh(t,e){return!!es(t.cameraPosition,yn(t,e))}function yn(t,e){let r=fu();r[0]=e.x/t.width*2-1,r[1]=(e.y/t.height*2-1)*-1,r[2]=1,r[3]=1,Ve(r,r,t.inverseModelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3];let i=jt();i[0]=r[0]-t.cameraPosition[0],i[1]=r[1]-t.cameraPosition[1],i[2]=r[2]-t.cameraPosition[2];let n=jt();return Ce(n,i),n}function Uy(t,e){let r=t.clippingPlane;return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=0}function tp(t,e){if(!Uy(t,e))return!1;let r=fu();return Ve(r,[...e,1],t.modelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}function wo(t,e){let r=t.cameraPosition,i=yn(t,e),n=es(r,i);if(n){let c=jt();Ca(c,r,[i[0]*n.tMin,i[1]*n.tMin,i[2]*n.tMin]);let h=jt();return Ce(h,c),ts(h)}let a=t.clippingPlane,s=a[0]*i[0]+a[1]*i[1]+a[2]*i[2],o=-$o(a,r)/s,l=jt();if(o>0)Ca(l,r,[i[0]*o,i[1]*o,i[2]*o]);else{let c=jt();Ca(c,r,[i[0]*2,i[1]*2,i[2]*2]);let h=$o(a,c);He(l,c,[a[0]*h,a[1]*h,a[2]*h])}let u=Z2(a);return ts(H2(u.center,u.radius,l))}function jy(t,e){let r=jt();Cf(r,t.origin,t.direction,e);let i=ls(r),n=jt();yr(n,r,1/i);let a=ts(n),s=xe.fromLngLat(a),o=new xe(s.x,Qt(s.y,0,.999999999)),l=Oy(t.index,t.exaggeration,o.x,o.y,!1),u=Math.abs(a.lat)>85.051129?0:l.elevation;return{sample:{...l,elevation:u},radius:i,mercator:o}}function ep(t,e){let{sample:r,radius:i}=jy(t,e);return Ry(r,(i-1)*Ye)}function rp(t,e){let r=Pl(t);return yr(r,r,1+e/Ye)}function ip(t,e,r){return mr(kf(jt(),r,t),e)}var J2=class{getProjectionData(t,e){let{overscaledTileID:r,applyGlobeMatrix:i}=e,n=zy(r);return{mainMatrix:t.modelViewProjectionMatrix32f,tileMercatorCoords:n,clippingPlane:t.clippingPlane,projectionTransition:+!!i,fallbackMatrix:t.modelViewProjectionMatrix32f,clipAntimeridian:r?.canonical.z===0}}isLocationOccluded(t,e,r,i,n){let a=i?.getCoverageIndex();n??(n=a?i.getElevationForLngLat(r,t.tileZoom):0);let s=rp(r,n);if(!Uy(t,s))return!0;if(!a)return!1;let o=bo(t,s),l=t.cameraPosition,u=yn(t,o),c=ip(l,u,s);if(c<=0)return!0;let h=this.screenTerrainPointToMercatorCoordinate(t,e,o,i);return h!=null&&ip(l,u,rp(h.toLngLat(),h.z))<c*.99}transformLightDirection(t,e){let r=t.center.lng*Math.PI/180,i=t.center.lat*Math.PI/180,n=Math.cos(i),a=[Math.sin(r)*n,Math.sin(i),Math.cos(r)*n],s=[a[2],0,-a[0]],o=[0,0,0];pu(o,s,a),Ce(s,s),Ce(o,o);let l=[s[0]*e[0]+o[0]*e[1]+a[0]*e[2],s[1]*e[0]+o[1]*e[1]+a[1]*e[2],s[2]*e[0]+o[2]*e[1]+a[2]*e[2]],u=[0,0,0];return Ce(u,l),u}getPixelScale(t){return 1/Jh(t.center.lat)}getCircleRadiusCorrection(t){return Jh(t.center.lat)}getPitchedTextCorrection(t,e,r,i){let n=Ly(e,r,i.canonical),a=X2(n.x,n.y);return this.getCircleRadiusCorrection(t)/Math.cos(a[1])}projectTileCoordinates(t,e,r,i,n){let a=i.canonical,s=W2(e,r,a.x,a.y,a.z),o=1+(n??0)/Ye,l=s[0]*o,u=s[1]*o,c=s[2]*o,h=[l,u,c,1];Ve(h,h,t.modelViewProjectionMatrix);let p;if(o<=1){let f=t.clippingPlane;p=f[0]*s[0]+f[1]*s[1]+f[2]*s[2]+f[3]<0}else p=K2(t,l,u,c);return{point:new T(h[0]/h[3],h[1]/h[3]),signedDistanceFromCamera:h[3],isOccluded:p}}calculateFogMatrix(t,e){Pt(\"calculateFogMatrix is not supported on globe projection.\");let r=Ff();return hu(r),r}getVisibleUnwrappedCoordinates(t,e,r){return[new Qa(0,r)]}getCameraFrustum(t){return t.frustum}maxPitchScaleFactor(t){return 1}getCameraAltitude(t){return(ls(t.cameraPosition)-1)*Ye}getCameraLngLat(t,e){let r=jt();return Ce(r,t.cameraPosition),ts(r)}getBounds(t,e){let r=t.width*.5,i=t.height*.5,n=[new T(0,0),new T(r,0),new T(t.width,0),new T(t.width,i),new T(t.width,t.height),new T(r,t.height),new T(0,t.height),new T(0,i)],a=[];for(let p of n)a.push(wo(t,p));let s=0,o=0,l=0,u=0,c=t.center;for(let p of a){let f=Jc(c.lng,p.lng),d=Jc(c.lat,p.lat);f<o&&(o=f),f>s&&(s=f),d<u&&(u=d),d>l&&(l=d)}let h=[c.lng+o,c.lat+u,c.lng+s,c.lat+l];return tp(t,[0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),tp(t,[0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new By(h)}locationToScreenPoint(t,e,r,i){let n=Pl(r);return i&&yr(n,n,1+i.getElevationForLngLat(r,t.tileZoom)/Ye),bo(t,n)}getCameraQueryGeometry(t,e){if(e.length!==1||!Qh(t,e[0]))return Vy(t,e);let r=Pl(wo(t,e[0])),i=Ce(jt(),t.cameraPosition),n=[e[0]];for(let a=1;a<=8;a++){let s=om(jt(),r,i,a/8);n.push(bo(t,Ce(s,s)))}return n}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n)return n}return xe.fromLngLat(wo(t,r))}screenTerrainPointToMercatorCoordinate(t,e,r,i){let n=i.getCoverageIndex();if(!n)return null;let a=t.cameraPosition,s=yn(t,r),o=es(a,s,1+n.maxElevation/Ye);if(!o)return null;let l=es(a,s,1+n.minElevation/Ye),u=Math.max(o.tMin,0),c=l?l.tMin:o.tMax;if(c<=u)return null;let h={index:n,exaggeration:i.exaggeration,origin:a,direction:s},p=0;for(let f=0;f<=256;f++){let d=u+(c-u)*f/256;if(ep(h,d)){let{hi:y}=$y(h,ep,p,d,1e-12),{sample:m,mercator:g}=jy(h,y);return new xe(g.x,g.y,m.elevation)}p=d}return null}screenPointToLocation(t,e,r,i){return this.screenPointToMercatorCoordinate(t,e,r,i)?.toLngLat()}screenPointToLocationAtElevation(t,e,r,i){return this.screenPointToLocation(t,e,r)}isPointOnMapSurface(t,e,r,i){return Qh(t,r)}getProjectionDataForCustomLayer(t,e=!0){let r=this.getProjectionData(t,{overscaledTileID:new As(0,0,0,0,0),applyGlobeMatrix:e});return r.tileMercatorCoords=[0,0,1,1],r}getFastPathSimpleProjectionMatrix(t,e){}getClippingPlane(t){return t.clippingPlane}getRayDirectionFromPixel(t,e){return yn(t,e)}},Q2=class{constructor(t,e){this._mercator=t,this._verticalPerspective=e}_renderedMath(t){return xo(t)?this._verticalPerspective:this._mercator}getProjectionData(t,e){let r=this._mercator.getProjectionData(t.mercator,e),i=this._verticalPerspective.getProjectionData(t.verticalPerspective,e);return{mainMatrix:xo(t)?i.mainMatrix:r.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?t.globeness:0,fallbackMatrix:r.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}getProjectionDataForCustomLayer(t,e=!0){let r=this._mercator.getProjectionDataForCustomLayer(t.mercator,e);if(!xo(t))return r;let i=this._verticalPerspective.getProjectionDataForCustomLayer(t.verticalPerspective,e);return i.fallbackMatrix=r.mainMatrix,i.projectionTransition=t.globeness,i}getFastPathSimpleProjectionMatrix(t,e){return this._renderedMath(t).getFastPathSimpleProjectionMatrix(kt(t),e)}projectTileCoordinates(t,e,r,i,n){return this._renderedMath(t).projectTileCoordinates(kt(t),e,r,i,n)}getPitchedTextCorrection(t,e,r,i){return Qc(this._mercator.getPitchedTextCorrection(t.mercator,e,r,i),this._verticalPerspective.getPitchedTextCorrection(t.verticalPerspective,e,r,i),t.globeness)}getCircleRadiusCorrection(t){return this._renderedMath(t).getCircleRadiusCorrection(kt(t))}getPixelScale(t){return Qc(this._mercator.getPixelScale(t.mercator),this._verticalPerspective.getPixelScale(t.verticalPerspective),t.globeness)}transformLightDirection(t,e){return this._renderedMath(t).transformLightDirection(kt(t),e)}calculateFogMatrix(t,e){return this._renderedMath(t).calculateFogMatrix(kt(t),e)}getVisibleUnwrappedCoordinates(t,e,r){return this._renderedMath(t).getVisibleUnwrappedCoordinates(kt(t),e,r)}getCameraFrustum(t){return this._renderedMath(t).getCameraFrustum(kt(t))}getClippingPlane(t){return this._renderedMath(t).getClippingPlane(kt(t))}maxPitchScaleFactor(t){return this._mercator.maxPitchScaleFactor(t.mercator)}getCameraAltitude(t){return this._renderedMath(t).getCameraAltitude(kt(t))}getCameraLngLat(t,e){return this._renderedMath(t).getCameraLngLat(kt(t),e)}getBounds(t,e){return this._renderedMath(t).getBounds(kt(t),e)}isLocationOccluded(t,e,r,i,n){return this._renderedMath(t).isLocationOccluded(kt(t),e,r,i,n)}locationToScreenPoint(t,e,r,i){return this._renderedMath(t).locationToScreenPoint(kt(t),e,r,i)}screenPointToLocation(t,e,r,i){return this._renderedMath(t).screenPointToLocation(kt(t),e,r,i)}screenPointToLocationAtElevation(t,e,r,i){return this._renderedMath(t).screenPointToLocationAtElevation(kt(t),e,r,i)}screenPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenPointToMercatorCoordinate(kt(t),e,r,i)}screenTerrainPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenTerrainPointToMercatorCoordinate(kt(t),e,r,i)}isPointOnMapSurface(t,e,r,i){return this._renderedMath(t).isPointOnMapSurface(kt(t),e,r,i)}getRayDirectionFromPixel(t,e){return this._verticalPerspective.getRayDirectionFromPixel(t.verticalPerspective,e)}getCameraQueryGeometry(t,e){return this._renderedMath(t).getCameraQueryGeometry(kt(t),e)}},qy=new G2,Gy=new J2,tv=new Q2(qy,Gy);function Es(t){switch(t.projection){case\"mercator\":return qy;case\"vertical-perspective\":return Gy;case\"globe\":return tv}}function hi(t,e,r){let i=e.paint.get(t).value;return i.kind===\"constant\"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ts(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Is(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=T.convert(e)._mult(n);r===\"viewport\"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function ev(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r],n=e.at(-1);(r===0||n&&!i.equals(n))&&e.push(i)}return e}function rv(t,e){let r=[];for(let i of t){let n=ev(i),a=[];for(let s=0;s<n.length;s++){let o=n[s],l=n[s-1],u=n[s+1],c=s===0?new T(0,0):o.sub(l)._unit()._perp(),h=s===n.length-1?new T(0,0):u.sub(o)._unit()._perp(),p=c._add(h)._unit(),f=p.x*h.x+p.y*h.y;f!==0&&p._mult(1/f),a.push(p._mult(e)._add(o))}r.push(a)}return r}function iv({queryGeometry:t,size:e},r){return Ss(t,r,e)}function nv({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){return Ss(t,a,e*(Es(r).projectTileCoordinates(r,a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function av({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){let s=Es(r).projectTileCoordinates(r,a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,o=e*(r.cameraToCenterDistance/s);return Ss(t,Xu(a,r,i,n),o)}function sv({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){return Ss(t,Xu(a,r,i,n),e)}function Xy({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a=\"map\",pitchScale:s=\"map\"},o){let l=a===\"map\"?s===\"map\"?iv:nv:s===\"map\"?av:sv,u={queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n};for(let c of o)for(let h of c)if(l(u,h))return!0;return!1}function Xu(t,e,r,i){let n=Es(e).projectTileCoordinates(e,t.x,t.y,r,i?.(t.x,t.y)).point;return new T((n.x*.5+.5)*e.width,(-n.y*.5+.5)*e.height)}function ov(t,e,r,i){return t.map(n=>Xu(n,e,r,i))}var np,lv=()=>np||(np=new Zt({\"circle-sort-key\":new N(D.layout_circle[\"circle-sort-key\"],\"circle-sort-key\")})),ap,uv=()=>ap||(ap=new Zt({\"circle-radius\":new N(D.paint_circle[\"circle-radius\"],\"circle-radius\"),\"circle-color\":new N(D.paint_circle[\"circle-color\"],\"circle-color\"),\"circle-blur\":new N(D.paint_circle[\"circle-blur\"],\"circle-blur\"),\"circle-opacity\":new N(D.paint_circle[\"circle-opacity\"],\"circle-opacity\"),\"circle-translate\":new z(D.paint_circle[\"circle-translate\"],\"circle-translate\"),\"circle-translate-anchor\":new z(D.paint_circle[\"circle-translate-anchor\"],\"circle-translate-anchor\"),\"circle-pitch-scale\":new z(D.paint_circle[\"circle-pitch-scale\"],\"circle-pitch-scale\"),\"circle-pitch-alignment\":new z(D.paint_circle[\"circle-pitch-alignment\"],\"circle-pitch-alignment\"),\"circle-stroke-width\":new N(D.paint_circle[\"circle-stroke-width\"],\"circle-stroke-width\"),\"circle-stroke-color\":new N(D.paint_circle[\"circle-stroke-color\"],\"circle-stroke-color\"),\"circle-stroke-opacity\":new N(D.paint_circle[\"circle-stroke-opacity\"],\"circle-stroke-opacity\")})),cv={get paint(){return uv()},get layout(){return lv()}},hv=class extends Ae{constructor(t,e){super(t,cv,e)}createBucket(t){return new ju(t)}queryRadius(t){let e=t;return hi(\"circle-radius\",this,e)+hi(\"circle-stroke-width\",this,e)+Ts(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Is(t,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-n.bearingInRadians,a),u=this.paint.get(\"circle-radius\").evaluate(e,r)+this.paint.get(\"circle-stroke-width\").evaluate(e,r),c=this.paint.get(\"circle-pitch-scale\"),h=this.paint.get(\"circle-pitch-alignment\"),p,f;return h===\"map\"?(p=l,f=u*a):(p=ov(l,n,s,o),f=u),Xy({queryGeometry:p,size:f,projectedCamera:n,unwrappedTileID:s,getElevation:o,pitchAlignment:h,pitchScale:c},i)}},Yy=class extends ju{};B(\"HeatmapBucket\",Yy,{omit:[\"layers\"]});var sp,pv=()=>sp||(sp=new Zt({\"heatmap-radius\":new N(D.paint_heatmap[\"heatmap-radius\"],\"heatmap-radius\"),\"heatmap-weight\":new N(D.paint_heatmap[\"heatmap-weight\"],\"heatmap-weight\"),\"heatmap-intensity\":new z(D.paint_heatmap[\"heatmap-intensity\"],\"heatmap-intensity\"),\"heatmap-color\":new Ds(D.paint_heatmap[\"heatmap-color\"],\"heatmap-color\"),\"heatmap-opacity\":new z(D.paint_heatmap[\"heatmap-opacity\"],\"heatmap-opacity\")})),fv={get paint(){return pv()}};function Yu(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function Wy(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Yu({},{width:e,height:r},i);Wu(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function Wu(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError(\"out of range source coordinates for image copy\");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError(\"out of range destination coordinates for image copy\");let s=t.data,o=e.data;if(s===o)throw Error(\"srcData equals dstData, so image is already copied\");for(let l=0;l<n.height;l++){let u=((r.y+l)*t.width+r.x)*a,c=((i.y+l)*e.width+i.x)*a;for(let h=0;h<n.width*a;h++)o[c+h]=s[u+h]}return e}var Bl=class Zy{constructor(e,r){Yu(this,e,1,r)}resize(e){Wy(this,e,1)}clone(){return new Zy({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){Wu(e,r,i,n,a,1)}},ae=class Hy{constructor(e,r){Yu(this,e,4,r)}resize(e){Wy(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Hy({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){Wu(e,r,i,n,a,4)}setPixel(e,r,i){let n=(e*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function _o(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=4){let i=t[r+3];e[r+0]=Math.round(t[r+0]*i/255),e[r+1]=Math.round(t[r+1]*i/255),e[r+2]=Math.round(t[r+2]*i/255),e[r+3]=i}return e}B(\"AlphaImage\",Bl),B(\"RGBAImage\",ae);function dv(t){let e={},r=t.resolution||256,i=t.clips?t.clips.length:1,n=t.image||new ae({width:r,height:i});if(!mm(r))throw Error(`width is not a power of 2 - ${r}`);let a=(s,o,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s<i;++s,o+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:h,end:p}=t.clips[s],f=h*(1-c)+p*c;a(o,u,f)}else for(let s=0,o=0;s<r;s++,o+=4){let l=s/(r-1);a(0,o,l)}return n}var yv=class extends Ae{createBucket(t){return new Yy(t)}constructor(t,e){super(t,fv,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t===\"heatmap-color\"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values[\"heatmap-color\"].value.expression;this.colorRamp=dv({expression:t,evaluationKey:\"heatmapDensity\",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(\"big-fb\")&&this.heatmapFbos.delete(\"big-fb\")}queryRadius(t){return hi(\"heatmap-radius\",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return Xy({queryGeometry:t,size:this.paint.get(\"heatmap-radius\").evaluate(e,r)*a,projectedCamera:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return this.paint.get(\"heatmap-opacity\")!==0&&!this.isHidden()}},op,mv=()=>op||(op=new Zt({\"hillshade-illumination-direction\":new z(D.paint_hillshade[\"hillshade-illumination-direction\"],\"hillshade-illumination-direction\"),\"hillshade-illumination-altitude\":new z(D.paint_hillshade[\"hillshade-illumination-altitude\"],\"hillshade-illumination-altitude\"),\"hillshade-illumination-anchor\":new z(D.paint_hillshade[\"hillshade-illumination-anchor\"],\"hillshade-illumination-anchor\"),\"hillshade-exaggeration\":new z(D.paint_hillshade[\"hillshade-exaggeration\"],\"hillshade-exaggeration\"),\"hillshade-shadow-color\":new z(D.paint_hillshade[\"hillshade-shadow-color\"],\"hillshade-shadow-color\"),\"hillshade-highlight-color\":new z(D.paint_hillshade[\"hillshade-highlight-color\"],\"hillshade-highlight-color\"),\"hillshade-accent-color\":new z(D.paint_hillshade[\"hillshade-accent-color\"],\"hillshade-accent-color\"),\"hillshade-method\":new z(D.paint_hillshade[\"hillshade-method\"],\"hillshade-method\"),resampling:new z(D.paint_hillshade.resampling,\"resampling\")})),gv={get paint(){return mv()}},xv=class extends Ae{constructor(t,e){super(t,gv,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get(\"hillshade-illumination-direction\").values,e=this.paint.get(\"hillshade-illumination-altitude\").values,r=this.paint.get(\"hillshade-highlight-color\").values,i=this.paint.get(\"hillshade-shadow-color\").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(gi);return{directionRadians:t.map(gi),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}},lp,vv=()=>lp||(lp=new Zt({\"color-relief-opacity\":new z(D[\"paint_color-relief\"][\"color-relief-opacity\"],\"color-relief-opacity\"),\"color-relief-color\":new Ds(D[\"paint_color-relief\"][\"color-relief-color\"],\"color-relief-color\"),resampling:new z(D[\"paint_color-relief\"].resampling,\"resampling\")})),bv={get paint(){return vv()}};function xa(t){return\"data\"in t}var up=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){let{width:i,height:n}=t,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!e?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&e?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,i,n),xa(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=_o(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else xa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:u,y:c}=r||{x:0,y:0};xa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,u,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,u,c,o))}this.useMipmap&&!(xa(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=_o(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=_o(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST&&r!==n.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Ze,Ky=(Ze=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError(\"DEM tiles must be square\");if(i&&![\"mapbox\",\"terrarium\",\"custom\"].includes(i)){Pt(`\"${i}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Ze.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let c=-2;c<l+2;c++){let h=this._idx(0,Math.max(0,Math.min(l-1,c)));(c<0||c>=l)&&this.data.copyWithin(this._idx(0,c),h,h+l),this.data.fill(this.data[h],this._idx(-2,c),this._idx(0,c)),this.data.fill(this.data[h+l-1],this._idx(l,c),this._idx(l+1,c)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let c=0;c<l;c++)for(let h=0;h<l;h++){let p=this._idx(c,h)*4,f=this._unpackAtIndex(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let i=this._getByteView(),n=this._idx(e,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(e,r){let i=Math.floor(e),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,c=this._unpackAtIndex(a,s),h=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return c*(1-l)*(1-u)+h*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return Jy(e,this.getUnpackVector())}getPixels(){return new ae({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error(\"dem dimension mismatch\");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let c=s;c<o;c++)for(let h=n;h<a;h++)this.data[this._idx(h,c)]=e.data[this._idx(h+l,c+u)]}_getByteView(){let e=Ze.byteViewCache.get(this);return e?.buffer!==this.data.buffer&&(e=new Uint8Array(this.data.buffer),Ze.byteViewCache.set(this,e)),e}_unpackAtIndex(e,r){return this.unpack(e[r],e[r+1],e[r+2])}},Ze.byteViewCache=new WeakMap,Ze);function Jy(t,e){let r=e[0],i=e[1],n=e[2],a=e[3],s=[r,i,n].filter(c=>c!==0);if(s.length===0)return{r:0,g:0,b:0};let o=Math.min(...s),l=Math.round((t+a)/o),u=c=>c===0?0:Math.floor(l*o/c)%256;return{r:u(r),g:u(i),b:u(n)}}B(\"DEMData\",Ky);var wv=class extends Ae{constructor(t,e){super(t,bv,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values[\"color-relief-color\"].value.expression;if(r instanceof Dn&&r._styleExpression.expression instanceof ye){this.colorRampExpression=r;let a=r._styleExpression.expression;e.elevationStops=a.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[dt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let i={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let a=0;a<e.elevationStops.length-.5;a+=n)i.elevationStops.push(e.elevationStops[Math.round(a)]),i.colorStops.push(e.colorStops[Math.round(a)]);return Pt(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[\"color-relief-color\"].value.expression}getColorRampTextures(t,e,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(e),n=new ae({width:i.colorStops.length,height:1}),a=new ae({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let o=Jy(i.elevationStops[s],r);a.setPixel(0,s,new dt(o.r/255,o.g/255,o.b/255,1)),n.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new up(t,a,t.gl.RGBA),colorTexture:new up(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},Ll=It([{name:\"a_pos\",components:2,type:\"Int16\"}],4),_v=Ll.members;Ll.size,Ll.alignment;function rs(t,e,r){let i=r.patternDependencies,n=!1;for(let a of e){let s=a.paint.get(`${t}-pattern`);s.isConstant()||(n=!0);let o=s.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function Zu(t,e,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let o of e){let l=o.paint.get(`${t}-pattern`).value;if(l.kind!==\"constant\"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),c=l.evaluate({zoom:a},r,{},n.availableImages),h=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,c=c?.name?c.name:c,h=h?.name?h.name:h,s[u]=!0,s[c]=!0,s[h]=!0,r.patterns[o.id]={min:u,mid:c,max:h}}}return r}var Mn=new Set,zl=!1;function Dv(t,e,r=2){let i=e&&e.length,n=i?e[0]*r:t.length;Mn.size&&Mn.clear();let a=Qy(t,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=Iv(t,e,a,r)),t.length>80*r){o=t[0],l=t[1];let c=o,h=l;for(let p=r;p<n;p+=r){let f=t[p],d=t[p+1];f<o&&(o=f),d<l&&(l=d),f>c&&(c=f),d>h&&(h=d)}u=Math.max(c-o,h-l),u=u===0?0:32767/u}return Vl(a,s,o,l,u),s}function Qy(t,e,r,i,n){let a=null;if(n===Nv(t,e,r,i)>0)for(let s=e;s<r;s+=i)a=pp(s/i|0,t[s],t[s+1],a);else for(let s=r-i;s>=e;s-=i)a=pp(s/i|0,t[s],t[s+1],a);return a&&Pn(a,a.next)&&(Ln(a),a=a.next),a}function Or(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(Mn.size===0||!Mn.has(i))&&(Pn(i,i.next)||Mt(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),zl=!0,Ln(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Vl(t,e,r,i,n){n&&Lv(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Mt(o,t,l)<0&&(n?Av(t,r,i,n):Sv(t)))e.push(o.i,t.i,l.i),Ln(t),t=l,a=l;else if(t=l,t===a){if(zl=!1,t=Or(t),zl){a=t;continue}if(!s){t=Ev(t,e),a=t,s=!0;continue}Tv(t,e,r,i,n);break}}}function Sv(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,c=Math.min(n,a,s),h=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&(n!==d.x||o!==d.y)&&ns(n,o,a,l,s,u,d.x,d.y)&&Mt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Av(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,c=n.y,h=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(c,h,p),y=Math.max(o,l,u),m=Math.max(c,h,p),g=Nl(f,d,e,r,i),v=Nl(y,m,e,r,i),x=t.prevZ;for(;x&&x.z>=g;){if(x.x>=f&&x.x<=y&&x.y>=d&&x.y<=m&&x!==s&&(o!==x.x||c!==x.y)&&ns(o,c,l,h,u,p,x.x,x.y)&&Mt(x.prev,x,x.next)>=0)return!1;x=x.prevZ}let b=t.nextZ;for(;b&&b.z<=v;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||c!==b.y)&&ns(o,c,l,h,u,p,b.x,b.y)&&Mt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Ev(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;e1(n,r,r.next,a,!1)&&Bn(n,a)&&Bn(a,n)&&(e.push(n.i,r.i,a.i),Ln(r),Ln(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?Or(r):r}function Tv(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&Ov(a,s)){let o=r1(a,s);a=Or(a,a.next),o=Or(o,o.next),Vl(a,e,r,i,n),Vl(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var Ol=!1;function Iv(t,e,r,i){let n=[];for(let a=0,s=e.length;a<s;a++){let o=Qy(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i,!1);o===o.next&&Mn.add(o),n.push(Vv(o))}n.sort(kv),Fv(t.length/i,e.length),t1(r,r),Ol=!0;for(let a=0;a<n.length;a++)r=Cv(n[a],r);return Ol=!1,Or(r)}function kv(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function Cv(t,e){let r=Pv(t,e);if(!r)return e;let i=r1(r,t),n=i.next;return t1(r,n.next),Or(i,i.next),Or(r,r.next)}var St=new Float64Array,is=0,Rl=[],$l=[];function Fv(t,e){let r=Math.ceil((t+2*e)/16)+e+2;St.length<r*4&&(St=new Float64Array(r*4)),is=0}function t1(t,e){let r=t;do{let i=is++;Rl[i]=r;let n=r.x,a=r.y,s=r.x,o=r.y,l=0;do{let c=r.next;r.z=i,c.x<n&&(n=c.x),c.x>s&&(s=c.x),c.y<a&&(a=c.y),c.y>o&&(o=c.y),r=c}while(++l<16&&r!==e);$l[i]=r;let u=i*4;St[u]=n,St[u+1]=a,St[u+2]=s,St[u+3]=o}while(r!==e)}function Mv(t,e){let r=t.z*4;e.x<St[r]&&(St[r]=e.x),e.y<St[r+1]&&(St[r+1]=e.y),e.x>St[r+2]&&(St[r+2]=e.x),e.y>St[r+3]&&(St[r+3]=e.y)}function cp(t){let e=$l[t];for(;e.prev.next!==e;)e=e.next;return $l[t]=e,e}function hp(t){let e=Rl[t];for(;e.prev.next!==e;)e=e.next;return Rl[t]=e,e}function Pv(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(Pn(t,r))return r;for(let p=0,f=0;p<is;p++,f+=4){if(n<St[f+1]||n>St[f+3]||St[f]>i||St[f+2]<=a)continue;let d=cp(p);r=hp(p);do{if(r.prev.next===r){if(Pn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.x<r.next.x?r:r.next,y===i))return s}}r=r.next}while(r!==d)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(n,l),c=Math.max(n,l),h=1/0;for(let p=0,f=0;p<is;p++,f+=4){if(St[f+2]<o||St[f]>i||St[f+3]<u||St[f+1]>c)continue;let d=cp(p);r=hp(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&ns(n<l?i:a,n,o,l,n<l?a:i,n,r.x,r.y)){let y=Math.abs(n-r.y)/(i-r.x);(Bn(r,t)||r.y===n&&r.next.y===n&&r.next.x>i)&&(y<h||y===h&&(r.x>s.x||r.x===s.x&&Bv(s,r)))&&(s=r,h=y)}r=r.next}while(r!==d)}return s}function Bv(t,e){return Mt(t.prev,t,e.prev)<0&&Mt(e.next,t,t.next)<0}var ne=[],ii=[],Tr=new Uint32Array,Wi=new Uint32Array,Zi=new Uint32Array(256);function Lv(t,e,r,i){let n=t,a=0;do n.z=Nl(n.x,n.y,e,r,i),ne[a++]=n,n=n.next;while(n!==t);zv(a);let s=null;for(let o=0;o<a;o++){let l=ne[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null,ne.fill(null,0,a),ii.fill(null,0,a)}function zv(t){if(t<=32)for(let e=1;e<t;e++){let r=ne[e],i=r.z,n=e-1;for(;n>=0&&ne[n].z>i;)ne[n+1]=ne[n],n--;ne[n+1]=r}else{Tr.length<t&&(Tr=new Uint32Array(t),Wi=new Uint32Array(t),ii=Array(t));for(let e=0;e<t;e++)Tr[e]=ne[e].z;va(t,ne,Tr,ii,Wi,0),va(t,ii,Wi,ne,Tr,8),va(t,ne,Tr,ii,Wi,16),va(t,ii,Wi,ne,Tr,24)}}function va(t,e,r,i,n,a){Zi.fill(0);for(let o=0;o<t;o++)Zi[r[o]>>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Zi[o];Zi[o]=s,s+=l}for(let o=0;o<t;o++){let l=r[o],u=Zi[l>>>a&255]++;i[u]=e[o],n[u]=l}}function Nl(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Vv(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ns(t,e,r,i,n,a,s,o){return(n-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function Ov(t,e){let r=Pn(t,e)&&Mt(t.prev,t,t.next)>0&&Mt(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||Bn(t,e)&&Bn(e,t)&&(Mt(t.prev,t,e.prev)!==0||Mt(t,e.prev,e)!==0))&&!Rv(t,e)&&(r||$v(t,e))}function Mt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Pn(t,e){return t.x===e.x&&t.y===e.y}function e1(t,e,r,i,n=!0){let a=Mt(t,e,r),s=Mt(t,e,i),o=Mt(r,i,t),l=Mt(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&ba(t,r,e)||s===0&&ba(t,i,e)||o===0&&ba(r,t,i)||l===0&&ba(r,e,i)):!1}function ba(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Rv(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n)s=o;else{if(s.i!==t.i&&o.i!==t.i&&s.i!==e.i&&o.i!==e.i&&e1(s,o,t,e))return!0;s=o}}while(s!==t);return!1}function Bn(t,e){return Mt(t.prev,t,t.next)<0?Mt(t,e,t.next)>=0&&Mt(t,t.prev,e)>=0:Mt(t,e,t.prev)<0||Mt(t,t.next,e)<0}function $v(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function r1(t,e){let r=Ul(t.i,t.x,t.y),i=Ul(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function pp(t,e,r,i){let n=Ul(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Ln(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Ol&&Mv(t.prev,t.next)}function Ul(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Nv(t,e,r,i){let n=0;for(let a=e,s=r-i;a<r;a+=i)n+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return n}var on=class{constructor(t,e){if(e>t)throw Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/e),this._minGranularity,1)}},Br,Uv=(Br=class{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}},Br.noSubdivision=new Br({fill:new on(0,0),line:new on(0,0),tile:new on(0,0),stencil:new on(0,0),circle:1}),Br);B(\"SubdivisionGranularityExpression\",on),B(\"SubdivisionGranularitySetting\",Uv);var Do=-32768,So=32767,jv=class{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=rt/t,this._canonical=e}_getKey(t,e){return t+=32768,e+=32768,t<<16|e}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return Xv(this._vertexBuffer,Gv(t,e));let r=[],i=t.length;for(let n=0;n<i;n+=3){let a=[e[t[n+0]],e[t[n+1]],e[t[n+2]]],s=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],o=1/0,l=1/0,u=-1/0,c=-1/0;for(let y=0;y<3;y++){let m=s[y*2],g=s[y*2+1];o=Math.min(o,m),u=Math.max(u,m),l=Math.min(l,g),c=Math.max(c,g)}if(o===u||l===c)continue;let h=Math.floor(o/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),f=Math.floor(l/this._granularityCellSize),d=Math.ceil(c/this._granularityCellSize);if(h===p&&f===d)r.push(...a);else for(let y=f;y<d;y++){let m=this._scanlineGenerateVertexRingForCellRow(y,s,a);Yv(this._vertexBuffer,m,r)}}return r}_scanlineGenerateVertexRingForCellRow(t,e,r){let i=t*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let o=e[s*2],l=e[s*2+1],u=e[(s+1)*2%6],c=e[((s+1)*2+1)%6],h=e[(s+2)*2%6],p=e[((s+2)*2+1)%6],f=u-o,d=c-l,y=f===0,m=d===0,g=(i-l)/d,v=(n-l)/d,x=Math.min(g,v),b=Math.max(g,v);if(!m&&(x>=1||b<=0)||m&&(l<i||l>n)){c>=i&&c<=n&&a.push(r[(s+1)%3]);continue}if(!m&&x>0){let S=o+f*x,A=l+d*x;a.push(this._vertexToIndex(S,A))}let w=o+f*Math.max(x,0),_=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,c,w,_),!m&&b<1){let S=o+f*b,A=l+d*b;a.push(this._vertexToIndex(S,A))}(m||c>=i&&c<=n)&&a.push(r[(s+1)%3]),!m&&(c<=i||c>=n)&&this._generateInterEdgeVertices(a,o,l,u,c,h,p,_,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,c=u?Math.min(e,i):Math.min(a,s),h=u?Math.max(e,i):Math.max(a,s),p=Math.floor(c/this._granularityCellSize)+1,f=Math.ceil(h/this._granularityCellSize)-1;if(u?e<i:a<s)for(let d=p;d<=f;d++){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}else for(let d=f;d>=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let c=n-r,h=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+h*y,v=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,x=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o<g,w=p===0;if(w&&(s===l||s===u))return;if(w||y>=1||m<=0){let S=e-a,A=r-s,E=(l-s)/A,R=(u-s)/A,M=a+S*Math.min(E,R);v=Math.floor(Math.min(M,o)/this._granularityCellSize)+1,x=Math.ceil(Math.max(M,o)/this._granularityCellSize)-1,b=o<M}let _=c>0?u:l;if(b)for(let S=v;S<=x;S++){let A=S*this._granularityCellSize;t.push(this._vertexToIndex(A,_))}else for(let S=x;S>=v;S--){let A=S*this._granularityCellSize;t.push(this._vertexToIndex(A,_))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(Fr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o<a.length;o++)s.push(a[o-1]),s.push(a[o]);r.push(s)}return r}_ringPathIndices(t,e,r){let i=r.slice(e,e+t.length);return i.length>=2&&n1(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(e||r)&&this._fillPoles(t,e,r)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){let r=t[e+1];r===-32768&&(t[e+1]=-32767),r===32767&&(t[e+1]=32766)}}_generatePoleQuad(t,e,r,i,n,a){i>n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=rt,a=t.length;for(let s=2;s<a;s+=3){let o=t[s-2],l=t[s-1],u=t[s],c=i[o*2],h=i[o*2+1],p=i[l*2],f=i[l*2+1],d=i[u*2],y=i[u*2+1];e&&(h===0&&f===0&&this._generatePoleQuad(t,o,l,c,p,Do),f===0&&y===0&&this._generatePoleQuad(t,l,u,p,d,Do),y===0&&h===0&&this._generatePoleQuad(t,u,o,d,c,Do)),r&&(h===n&&f===n&&this._generatePoleQuad(t,o,l,c,p,So),f===n&&y===n&&this._generatePoleQuad(t,l,u,p,d,So),y===n&&h===n&&this._generatePoleQuad(t,u,o,d,c,So))}}_initializeVertices(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(this._vertexToIndex(t[r],t[r+1]));return e}subdividePolygonInternal(t,e){if(this._used)throw Error(\"Subdivision: multiple use not allowed.\");this._used=!0;let{flattened:r,holeIndices:i}=qv(t),n=this._initializeVertices(r),a;try{let o=Dv(r,i);a=this._subdivideTrianglesScanline(o,n)}catch(o){console.error(o)}let s=[];return e&&(s=this._generateOutline(t,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=3)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||this._vertexOutsideTileX(t[r+2])||e.push(t[r],t[r+1],t[r+2]);return e}_removeLinesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=2)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||e.push(t[r],t[r+1]);return e}_pointArrayToIndices(t){let e=[];for(let r of t)e.push(this._vertexToIndex(r.x,r.y));return e}};function i1(t,e,r,i=!0){return new jv(r,e).subdividePolygonInternal(t,i)}function Fr(t,e,r=!1){if(!t||t.length<1||t.length<2)return[];let i=r&&n1(t);if(e<2)return i?[...t,t[0]]:[...t];let n=Math.floor(rt/e),a=[];a.push(new T(t[0].x,t[0].y));let s=t.length,o=i?s:s-1;for(let l=0;l<o;l++){let u=t[l],c=l<s-1?t[l+1]:t[0],h=u.x,p=u.y,f=c.x,d=c.y,y=h!==f,m=p!==d;if(!y&&!m)continue;let g=f-h,v=d-p,x=Math.abs(g),b=Math.abs(v),w=h,_=p;for(;;){let A=g>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,E=v>0?(Math.floor(_/n)+1)*n:(Math.ceil(_/n)-1)*n,R=Math.abs(w-A),M=Math.abs(_-E),V=Math.abs(w-f),U=Math.abs(_-d),k=y?R/x:1/0,C=m?M/b:1/0;if((V<=R||!y)&&(U<=M||!m))break;if(k<C&&y||!m){w=A,_+=v*k;let L=new T(w,Math.round(_));(a[a.length-1].x!==L.x||a[a.length-1].y!==L.y)&&a.push(L)}else{w+=g*C,_=E;let L=new T(Math.round(w),_);(a[a.length-1].x!==L.x||a[a.length-1].y!==L.y)&&a.push(L)}}let S=new T(f,d);(a[a.length-1].x!==S.x||a[a.length-1].y!==S.y)&&a.push(S)}return a}function n1(t){return!t[0].equals(t[t.length-1])}function qv(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:e}}function Gv(t,e){let r=Array(t.length);for(let i=0;i<t.length;i++)r[i]=e[t[i]];return r}function Xv(t,e){let r=[];for(let i=0;i<e.length;i+=3){let n=e[i],a=e[i+1],s=e[i+2],o=t[n*2],l=t[n*2+1],u=t[a*2],c=t[a*2+1],h=t[s*2],p=t[s*2+1],f=u-o,d=c-l,y=h-o;f*(p-l)-d*y>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function Yv(t,e,r){if(e.length===0)throw Error(\"Subdivision vertex ring is empty.\");let i=0,n=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<n&&(n=u,i=l)}let a=e.length,s=i,o=(s+1)%a;for(;;){let l=s-1>=0?s-1:a-1,u=(o+1)%a,c=t[e[l]*2],h=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],v=!1;if(c<p)v=!0;else if(c>p)v=!1;else{let x=g-y,b=-(m-d),w=y<g?1:-1;((c-d)*x+(h-y)*b)*w>((p-d)*x+(f-y)*b)*w&&(v=!0)}if(v){let x=e[l],b=e[s],w=e[o];x!==b&&x!==w&&b!==w&&r.push(w,b,x),s--,s<0&&(s=a-1)}else{let x=e[u],b=e[s],w=e[o];x!==b&&x!==w&&b!==w&&r.push(w,b,x),o++,o>=a&&(o=0)}if(l===u)break}}function a1(t,e,r,i,n,a,s,o,l){let u=n.length/2,c=s&&o&&l;if(u<le.MAX_VERTEX_ARRAY_LENGTH){let h=e.prepareSegment(u,r,i),p=h.vertexLength;for(let y=0;y<a.length;y+=3)i.emplaceBack(p+a[y],p+a[y+1],p+a[y+2]);h.vertexLength+=u,h.primitiveLength+=a.length/3;let f,d;c&&(d=s.prepareSegment(u,r,o),f=d.vertexLength,d.vertexLength+=u);for(let y=0;y<n.length;y+=2)t(n[y],n[y+1]);if(c)for(let y of l){for(let m=1;m<y.length;m+=2)o.emplaceBack(f+y[m-1],f+y[m]);d.primitiveLength+=y.length/2}}else Wv(e,r,i,n,a,t),c&&Zv(s,r,o,n,l,t),e.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function mn(t,e,r,i,n,a,s){if(a){let o=i.count;return r(e[n*2],e[n*2+1]),t[n]=i.count,i.count++,s.vertexLength++,o}return t[n]}function Wv(t,e,r,i,n,a){let s=[];for(let h=0;h<i.length/2;h++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let h=2;h<n.length;h+=3){let p=n[h-2],f=n[h-1],d=n[h],y=s[p]<l,m=s[f]<l,g=s[d]<l,v=+!!y+ +!!m+ +!!g;u.vertexLength+v>le.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,c=0);let x=mn(s,i,a,o,p,y,u),b=mn(s,i,a,o,f,m,u),w=mn(s,i,a,o,d,g,u);r.emplaceBack(c+x-l,c+b-l,c+w-l),u.primitiveLength++}}function Zv(t,e,r,i,n,a){let s=[];for(let h=0;h<i.length/2;h++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let h of n)for(let p=1;p<h.length;p+=2){let f=h[p-1],d=h[p],y=s[f]<l,m=s[d]<l,g=+!!y+ +!!m;u.vertexLength+g>le.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,c=0);let v=mn(s,i,a,o,f,y,u),x=mn(s,i,a,o,d,m,u);r.emplaceBack(c+v-l,c+x-l),u.primitiveLength++}}var s1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new n2,this.indexArray=new qn,this.indexArray2=new wl,this.programConfigurations=new Vr(t.layers,t.zoom),this.segments=new le,this.segments2=new le,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=rs(\"fill\",this.layers,e);let i=this.layers[0].layout.get(\"fill-sort-key\"),n=!i.isConstant(),a=[],s=new ut(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Ci(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Nr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;if(this.hasDependencies){let f=Zu(\"fill\",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,c,r,{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get(\"fill-pattern\").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Pt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer \"${t}\"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_v),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of ms(e,500)){let o=i1(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;a1((u,c)=>{l.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};B(\"FillBucket\",s1,{omit:[\"layers\",\"patternFeatures\"]});var fp,Hv=()=>fp||(fp=new Zt({\"fill-sort-key\":new N(D.layout_fill[\"fill-sort-key\"],\"fill-sort-key\")})),dp,Kv=()=>dp||(dp=new Zt({\"fill-antialias\":new z(D.paint_fill[\"fill-antialias\"],\"fill-antialias\"),\"fill-opacity\":new N(D.paint_fill[\"fill-opacity\"],\"fill-opacity\"),\"fill-layer-opacity\":new z(D.paint_fill[\"fill-layer-opacity\"],\"fill-layer-opacity\"),\"fill-layer-blend\":new z(D.paint_fill[\"fill-layer-blend\"],\"fill-layer-blend\"),\"fill-color\":new N(D.paint_fill[\"fill-color\"],\"fill-color\"),\"fill-outline-color\":new N(D.paint_fill[\"fill-outline-color\"],\"fill-outline-color\"),\"fill-translate\":new z(D.paint_fill[\"fill-translate\"],\"fill-translate\"),\"fill-translate-anchor\":new z(D.paint_fill[\"fill-translate-anchor\"],\"fill-translate-anchor\"),\"fill-pattern\":new Tn(D.paint_fill[\"fill-pattern\"],\"fill-pattern\")})),Jv={get paint(){return Kv()},get layout(){return Hv()}},Qv=class extends Ae{constructor(t,e){super(t,Jv,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values[\"fill-outline-color\"];r.value.kind===\"constant\"&&r.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(t){return new s1(t)}queryRadius(){return Ts(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:t,geometry:e,projectedCamera:r,pixelsToTileUnits:i}){return Ay(Is(t,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},jl=It([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),tb=It([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),eb=jl.members;jl.size,jl.alignment;var Gn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos<e;){let a=t.readVarint();if(a===8)this.id=t.readVarint();else if(a===18){let s=t.readVarint()+t.pos;for(;t.pos<s;){let o=i[t.readVarint()],l=n[t.readVarint()];this.properties[o]=l}}else a===24?this.type=t.readVarint():(a===34&&(this._geometry=t.pos),t.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=[],i,n=1,a=0,s=0,o=0;for(;t.pos<e;){if(a<=0){let l=t.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new T(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new T(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos<e;){if(i<=0){let c=t.readVarint();if(r=c&7,i=c>>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(h){return[(h.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(h.y+a)*2/i)*Math.PI))-90]}function l(h){return h.map(o)}let u;if(this.type===1){let h=[];for(let f of s)h.push(f[0]);let p=l(h);u=h.length===1?{type:\"Point\",coordinates:p[0]}:{type:\"MultiPoint\",coordinates:p}}else if(this.type===2){let h=s.map(l);u=h.length===1?{type:\"LineString\",coordinates:h[0]}:{type:\"MultiLineString\",coordinates:h}}else if(this.type===3){let h=o1(s),p=[];for(let f of h)p.push(f.map(l));u=p.length===1?{type:\"Polygon\",coordinates:p[0]}:{type:\"MultiPolygon\",coordinates:p}}else throw Error(\"unknown feature type\");let c={type:\"Feature\",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}};Gn.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function o1(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a<e;a++){let s=rb(t[a]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[a]]):i&&i.push(t[a]))}return i&&r.push(i),r}function rb(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var ib=class{constructor(t,e){for(this.version=1,this.name=\"\",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],e===void 0&&(e=t.length);t.pos<e;){let r=t.readVarint();r===10?this.name=t.readString():r===18?(this._features.push(t.pos),t.skip(r)):r===26?this._keys.push(t.readString()):r===34?this._values.push(nb(t)):r===40?this.extent=t.readVarint():r===120?this.version=t.readVarint():t.skip(r)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Gn(this._pbf,e,this.extent,this._keys,this._values)}};function nb(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint();e=i===10?t.readString():i===21?t.readFloat():i===25?t.readDouble():i===32?t.readVarint(!0):i===40?t.readVarint():i===48?t.readSVarint():i===56?t.readBoolean():(t.skip(i),null)}if(e==null)throw Error(\"unknown feature value\");return e}var l1=class{constructor(t,e=t.length){let r=Object.create(null);for(;t.pos<e;){let i=t.readVarint();if(i===26){let n=new ib(t,t.readVarint()+t.pos);n.length&&(r[n.name]=n)}else t.skip(i)}this.layers=r}};function ab(t,e){return e<=0||!t||t.length===0?t:t.map(r=>ub(r,e))}function sb(t,e){let r=M2(rt/2,rt/2,e),i=xe.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<e.z)*rt;return t*i*n}var ob=Math.cos(35*Math.PI/180);function lb(t){let e=[null];for(let a=1;a<t.length;a++){let s=t[a].sub(t[a-1]),o=!Ja(t[a],t[a-1])&&s.mag()>0;e.push(o?s._perp():null)}let r=t.length-1,i=r>1&&t[0].equals(t[r]),n=[null];for(let a=1;a<=r;a++){let s=e[a];if(!s){n.push(null);continue}let o=i&&a===1?e[r]:e[a-1],l=i&&a===r?e[1]:e[a+1];n.push({start:yp(s,o),end:yp(s,l)})}return n}function yp(t,e){if(!e)return t.unit();let r=t.mag(),i=e.mag();return t.x*e.x+t.y*e.y<ob*r*i||r>=2*i?t.unit():i>=2*r?e.unit():t.add(e)._unit()}function ub(t,e){if(!t||t.length<3)return t;let r=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,i=r?t.length-1:t.length;if(i<3)return t;let n=[],a=Ja(t[i-1],t[0]);for(let o=0;o<i;o++){let l=t[(o-1+i)%i],u=t[o],c=t[(o+1)%i],h=Ja(u,c);a||h?n.push(u.clone()):hb(n,l,u,c,e),a=h}let s=cb(n);return s.length<3?t:(r&&s.push(s[0].clone()),s)}function cb(t){let e=[];for(let r of t){let i=r.round(),n=e[e.length-1];(n?.x!==i.x||n?.y!==i.y)&&e.push(i)}for(;e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function hb(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let c=.2,h=Math.min(n,o*c,l*c),p=r.add(a.mult(h)),f=r.add(s.mult(h)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(h/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let v=0;v<=g;v++)t.push(p.rotateAround(v/g*m,y))}var Ao=8192;function Hi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*Ao)*2+s,n*Ao*2,a*Ao*2,Math.round(o))}var u1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new a2,this.centroidVertexArray=new r2,this.indexArray=new qn,this.programConfigurations=new Vr(t.layers,t.zoom),this.segments=new le,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=rs(\"fill-extrusion\",this.layers,e);let i=new ut(this.zoom),n=this.layers[0],a=n.layout.get(\"fill-extrusion-rounded-corner-distance\"),s=a>0?sb(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Ci(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:h,index:c,geometry:ab(o?p.geometry:Nr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(Zu(\"fill-extrusion\",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,c,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,c,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,eb),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,tb.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of ms(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,c=Math.floor(o.x/o.sampleCount),h=Math.floor(o.y/o.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(c,h)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}processPolygon(t,e,r,i,n){if(i.length<1||Nh(i[0]))return;for(let c of i)c.length!==0&&pb(t,c);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(e.z),o=Gn.types[r.type]===\"Polygon\";for(let c of i){if(c.length===0||Nh(c))continue;let h=Fr(c,s,o);this._generateSideFaces(h,a)}if(!o)return;let l=i1(i,e,s,!1),u=this.layoutVertexArray;a1((c,h)=>{Hi(u,c,h,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0,i=this.layers[0].layout.get(\"fill-extrusion-rounded-corner-distance\")>0?lb(t):null;for(let n=1;n<t.length;n++){let a=t[n],s=t[n-1];if(Ja(a,s)||i&&!i[n])continue;e.segment.vertexLength+4>le.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:o,end:o},c=s.dist(a);r+c>32768&&(r=0),Hi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),Hi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=c,Hi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),Hi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r);let h=e.segment.vertexLength;this.indexArray.emplaceBack(h,h+2,h+1),this.indexArray.emplaceBack(h+1,h+2,h+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function pb(t,e){for(let r=0;r<e.length;r++){let i=e[r];(r!==e.length-1||e[0].x!==i.x||e[0].y!==i.y)&&(t.x+=i.x,t.y+=i.y,t.sampleCount++)}}B(\"FillExtrusionBucket\",u1,{omit:[\"layers\",\"features\"]});var mp,fb=()=>mp||(mp=new Zt({\"fill-extrusion-rounded-corner-distance\":new z(D[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"],\"fill-extrusion-rounded-corner-distance\")})),gp,db=()=>gp||(gp=new Zt({\"fill-extrusion-opacity\":new z(D[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"],\"fill-extrusion-opacity\"),\"fill-extrusion-color\":new N(D[\"paint_fill-extrusion\"][\"fill-extrusion-color\"],\"fill-extrusion-color\"),\"fill-extrusion-translate\":new z(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"],\"fill-extrusion-translate\"),\"fill-extrusion-translate-anchor\":new z(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"],\"fill-extrusion-translate-anchor\"),\"fill-extrusion-pattern\":new Tn(D[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"],\"fill-extrusion-pattern\"),\"fill-extrusion-height\":new N(D[\"paint_fill-extrusion\"][\"fill-extrusion-height\"],\"fill-extrusion-height\"),\"fill-extrusion-base\":new N(D[\"paint_fill-extrusion\"][\"fill-extrusion-base\"],\"fill-extrusion-base\"),\"fill-extrusion-vertical-gradient\":new z(D[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"],\"fill-extrusion-vertical-gradient\")})),yb={get paint(){return db()},get layout(){return fb()}},mb=class extends Ae{constructor(t,e){super(t,yb,e)}createBucket(t){return new u1(t)}queryRadius(){return Ts(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s}){let o=Is(t,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-n.bearingInRadians,a),l=this.paint.get(\"fill-extrusion-height\").evaluate(e,r),u=this.paint.get(\"fill-extrusion-base\").evaluate(e,r),c=o.map(h=>Eo(h,0,n,s));return gb(i.map(h=>h.map(p=>Eo(p,u,n,s))),i.map(h=>h.map(p=>Eo(p,l,n,s))),c)}};function Eo(t,e,r,i){let{point:n,signedDistanceFromCamera:a}=Es(r).projectTileCoordinates(r,t.x,t.y,i,e),s=n;return s.z=a,s}function Ki(t,e){return t.x*e.x+t.y*e.y}function xp(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r<e.length;r++){let a=e[r],s=t[0],o=n.sub(i),l=a.sub(i),u=s.sub(i),c=Ki(o,o),h=Ki(o,l),p=Ki(l,l),f=Ki(u,o),d=Ki(u,l),y=c*p-h*h,m=(p*f-h*d)/y,g=(c*d-h*f)/y,v=1-m-g,x=i.z*v+n.z*m+a.z*g;if(isFinite(x))return x}return 1/0}{let r=1/0;for(let i of e)r=Math.min(r,i.z);return r}}function gb(t,e,r){let i=1/0;Ay(r,e)&&(i=xp(r,e[0]));for(let n=0;n<e.length;n++){let a=e[n],s=t[n];for(let o=0;o<a.length-1;o++){let l=a[o],u=a[o+1],c=s[o],h=[l,u,s[o+1],c,l];_2(r,h)&&(i=Math.min(i,xp(r,h)))}}return i!==1/0&&i}function xb(t,e,r,i){let n=[e,r];for(;n.length;)r=n.pop(),e=n.pop(),vb(t,e,r,i,n)}function vb(t,e,r,i,n){let a=i,s=e+(r-e>>1),o=r-e,l,u=t[e],c=t[e+1],h=t[r],p=t[r+1];for(let f=e+3;f<r;f+=3){let d=bb(t[f],t[f+1],u,c,h,p);if(d>a)l=f,a=d;else if(d===a){let y=Math.abs(f-s);y<o&&(l=f,o=y)}}a>i&&(t[l+2]=a,l-e>3&&n.push(e,l),r-l>3&&n.push(l,r))}function bb(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function zt(t,e,r,i){let n={type:e,geom:r},a={id:t??null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case\"Point\":case\"MultiPoint\":Ji(a,n.geom);break;case\"LineString\":Ji(a,n.geom.points);break;case\"Polygon\":Ji(a,n.geom[0].points);break;case\"MultiLineString\":for(let s of n.geom)Ji(a,s.points);break;case\"MultiPolygon\":for(let s of n.geom)Ji(a,s[0].points)}return a}function Hu(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Ji(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}var wb=class{projectX(t){return t/360+.5}projectY(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}unprojectX(t){return(t-.5)*360}unprojectY(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}},_b=class{projectX(t){return t}projectY(t){return t}unprojectX(t){return t}unprojectY(t){return t}},ks=new wb,Db=new _b;function Ku(t){return t===\"unitSquare\"?Db:ks}function Ju(t,e,r){let i=[];switch(t.type){case\"FeatureCollection\":for(let n=0;n<t.features.length;n++)To(i,t.features[n],e,r,n);break;case\"Feature\":To(i,t,e,r);break;default:To(i,{type:\"Feature\",geometry:t,properties:void 0},e,r)}return i}function To(t,e,r,i,n){let a=t.length;if(c1(t,e,r,n),!i)return;let s=h1(e,r,n);s!=null&&(t.length>a?i.delete(s):i.set(s,{...e,id:s}))}function c1(t,e,r,i,n=0){if(!e.geometry)return;if(n>1024)throw Error(\"GeometryCollection nesting exceeds supported depth: 1024\");if(e.geometry.type===\"GeometryCollection\"){Sb(t,e,e.geometry,r,i,n+1);return}if(!e.geometry.coordinates?.length)return;let a=h1(e,r,i),s=(r.tolerance/((1<<r.maxZoom)*r.extent))**2,o=Ku(r.coordinates);switch(e.geometry.type){case\"Point\":Ab(t,a,e.geometry,o,e.properties);return;case\"MultiPoint\":Eb(t,a,e.geometry,o,e.properties);return;case\"LineString\":Tb(t,a,e.geometry,s,o,e.properties);return;case\"MultiLineString\":Ib(t,a,e.geometry,s,o,r,e.properties);return;case\"Polygon\":kb(t,a,e.geometry,s,o,e.properties);return;case\"MultiPolygon\":Cb(t,a,e.geometry,s,o,e.properties);return;default:throw Error(\"Input data is not a valid GeoJSON object.\")}}function h1(t,e,r){return e.promoteId?t.properties?.[e.promoteId]:e.generateId?r||0:t.id}function Sb(t,e,r,i,n,a=0){for(let s of r.geometries)c1(t,{id:e.id,type:\"Feature\",geometry:s,properties:e.properties},i,n,a)}function Ab(t,e,r,i,n){let a=[];a.push(i.projectX(r.coordinates[0]),i.projectY(r.coordinates[1]),0),t.push(zt(e,\"Point\",a,n))}function Eb(t,e,r,i,n){let a=[];for(let s of r.coordinates)a.push(i.projectX(s[0]),i.projectY(s[1]),0);t.push(zt(e,\"MultiPoint\",a,n))}function Tb(t,e,r,i,n,a){let s={points:[]};Qu(r.coordinates,s,i,!1,n),t.push(zt(e,\"LineString\",s,a))}function Ib(t,e,r,i,n,a,s){if(a.lineMetrics)for(let o of r.coordinates){let l={points:[]};Qu(o,l,i,!1,n),t.push(zt(e,\"LineString\",l,s))}else{let o=[];tc(r.coordinates,o,i,!1,n),t.push(zt(e,\"MultiLineString\",o,s))}}function kb(t,e,r,i,n,a){let s=[];tc(r.coordinates,s,i,!0,n),t.push(zt(e,\"Polygon\",s,a))}function Cb(t,e,r,i,n,a){let s=[];for(let o of r.coordinates){let l=[];tc(o,l,i,!0,n),l.length&&s.push(l)}s.length&&t.push(zt(e,\"MultiPolygon\",s,a))}function Qu(t,e,r,i,n){let a,s,o=0;for(let u=0;u<t.length;u++){let c=n.projectX(t[u][0]),h=n.projectY(t[u][1]);e.points.push(c,h,0),u>0&&(o+=i?(a*h-c*s)/2:Math.sqrt((c-a)**2+(h-s)**2)),a=c,s=h}let l=e.points.length-3;e.points[2]=1,r>0&&xb(e.points,0,l,r),e.points[l+2]=1,Hu(e),e.size=Math.abs(o),e.start=0,e.end=e.size}function tc(t,e,r,i,n){for(let a=0;a<t.length;a++){let s={points:[]};Qu(t[a],s,r,i,n),e.push(s)}}function Fb(t,e=ks){return{type:\"FeatureCollection\",features:t.map(r=>as(r,e))}}function as(t,e=ks){let r={type:\"Feature\",geometry:Mb(t,e),properties:t.tags};return t.id!=null&&(r.id=t.id),r}function Mb(t,e){let{type:r,geometry:i}=t;switch(r){case\"Point\":return{type:r,coordinates:p1(i[0],i[1],e)};case\"MultiPoint\":return{type:r,coordinates:wa(i,e)};case\"LineString\":return{type:r,coordinates:wa(i.points,e)};case\"MultiLineString\":case\"Polygon\":return{type:r,coordinates:i.map(n=>wa(n.points,e))};case\"MultiPolygon\":return{type:r,coordinates:i.map(n=>n.map(a=>wa(a.points,e)))}}}function wa(t,e=ks){let r=[];for(let i=0;i<t.length;i+=3)r.push(p1(t[i],t[i+1],e));return r}function p1(t,e,r){return[r.unprojectX(t),r.unprojectY(e)]}function _e(t,e,r,i,n,a,s,o){if(r/=e,i/=e,a>=r&&s<i)return t;if(s<r||a>=i)return null;let l=[];for(let u of t){let c=n===0?u.minX:u.minY,h=n===0?u.maxX:u.maxY;if(c>=r&&h<i)l.push(u);else if(!(h<r||c>=i))switch(u.type){case\"MultiPoint\":Pb(u,l,r,i,n);continue;case\"LineString\":Bb(u,l,r,i,n,o);continue;case\"MultiLineString\":Lb(u,l,r,i,n);continue;case\"Polygon\":zb(u,l,r,i,n);continue;case\"MultiPolygon\":Vb(u,l,r,i,n);continue}}return l.length?l:null}function Pb(t,e,r,i,n){let a=[];if(Ob(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?\"Point\":\"MultiPoint\";e.push(zt(t.id,s,a,t.tags))}function Bb(t,e,r,i,n,a){let s=[];if(f1(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length)if(a.lineMetrics)for(let o of s)e.push(zt(t.id,\"LineString\",o,t.tags));else s.length>1?e.push(zt(t.id,\"MultiLineString\",s,t.tags)):e.push(zt(t.id,\"LineString\",s[0],t.tags))}function Lb(t,e,r,i,n){let a=[];ec(t.geometry,a,r,i,n,!1),a.length&&(a.length===1?e.push(zt(t.id,\"LineString\",a[0],t.tags)):e.push(zt(t.id,\"MultiLineString\",a,t.tags)))}function zb(t,e,r,i,n){let a=[];ec(t.geometry,a,r,i,n,!0),a.length&&e.push(zt(t.id,\"Polygon\",a,t.tags))}function Vb(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];ec(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(zt(t.id,\"MultiPolygon\",a,t.tags))}function Ob(t,e,r,i,n){for(let a=0;a<t.length;a+=3){let s=t[a+n];s>=r&&s<=i&&pi(e,t[a],t[a+1],t[a+2])}}function f1(t,e,r,i,n,a,s){let o=vp(t),l=n===0?Rb:$b,u=t.start,c,h;for(let g=0;g<t.points.length-3;g+=3){let v=t.points[g],x=t.points[g+1],b=t.points[g+2],w=t.points[g+3],_=t.points[g+4],S=n===0?v:x,A=n===0?w:_,E=!1;s&&(c=Math.sqrt((v-w)**2+(x-_)**2)),S<r?A>=r&&(h=l(o,v,x,w,_,r),s&&(o.start=u+c*h)):S>i?A<=i&&(h=l(o,v,x,w,_,i),s&&(o.start=u+c*h)):pi(o.points,v,x,b),A<r&&S>=r&&(h=l(o,v,x,w,_,r),E=!0),A>i&&S<=i&&(h=l(o,v,x,w,_,i),E=!0),!a&&E&&(s&&(o.end=u+c*h),e.push(o),o=vp(t)),s&&(u+=c)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&pi(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&pi(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Hu(o),e.push(o))}function vp(t){return{points:[],size:t.size,start:t.start,end:t.end}}function ec(t,e,r,i,n,a){for(let s of t)f1(s,e,r,i,n,a,!1)}function pi(t,e,r,i){t.push(e,r,i)}function Rb(t,e,r,i,n,a){let s=(a-e)/(i-e);return pi(t.points,a,r+(n-r)*s,1),s}function $b(t,e,r,i,n,a){let s=(a-r)/(n-r);return pi(t.points,e+(i-e)*s,a,1),s}function rc(t,e){if(!e.wrap)return t;let r=e.buffer/e.extent,i=t,n=_e(t,1,-1-r,r,0,-1,2,e),a=_e(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=_e(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=bp(n,1).concat(i)),a&&(i=i.concat(bp(a,-1)))),i}function bp(t,e){let r=[];for(let i of t)switch(i.type){case\"Point\":case\"MultiPoint\":{let n=Nb(i.geometry,e);r.push(zt(i.id,i.type,n,i.tags));continue}case\"LineString\":{let n=Io(i.geometry,e);r.push(zt(i.id,i.type,n,i.tags));continue}case\"MultiLineString\":case\"Polygon\":{let n=[];for(let a of i.geometry)n.push(Io(a,e));r.push(zt(i.id,i.type,n,i.tags));continue}case\"MultiPolygon\":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Io(o,e));n.push(s)}r.push(zt(i.id,i.type,n,i.tags));continue}}return r}function Nb(t,e){let r=[];for(let i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function Io(t,e){let r={points:[],size:t.size};t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let i=0;i<t.points.length;i+=3)r.points.push(t.points[i]+e,t.points[i+1],t.points[i+2]);return Hu(r),r}function Ub(t,e,r,i){let n=Gb(e,r),a=[];if(n.removeAll&&(a=t,t=[],i?.clear()),n.remove.size||n.add.size){for(let o of n.remove)i?.delete(o);let s=[];for(let o of t)(n.remove.has(o.id)||n.add.has(o.id))&&s.push(o);if(s.length){a=a.concat(s);let o=new Set(s.map(l=>l.id));t=t.filter(l=>!o.has(l.id))}if(n.add.size){let o=Ju({type:\"FeatureCollection\",features:Array.from(n.add.values())},{...r,generateId:!1},i);o=rc(o,r),a=a.concat(o),t=t.concat(o)}}if(n.update.size){let s=new Map,o=[];for(let l of t)n.update.has(l.id)?s.set(l.id,[...s.get(l.id)||[],l]):o.push(l);for(let[l,u]of n.update){let c=s.get(l);if(!c||c.length===0){if(!i?.has(l))continue;let p=qb(l,u,r,i);a=a.concat(p),o=o.concat(p);continue}let h=jb(c,u,r,i);a=a.concat(c,h),o=o.concat(h)}t=o}return{affected:a,source:t}}function jb(t,e,r,i){let n=!!e.newGeometry,a=y1(e);if(n){let s=t[0],o=a?ql(s.tags,e):s.tags;return d1(s.id,e.newGeometry,o,r,i)}if(a){let s=[];for(let o of t){let l={...o};l.tags=ql(l.tags,e),s.push(l)}return s}return t}function qb(t,e,r,i){let n=i.get(t),a=y1(e)?ql(n.properties,e):n.properties;return e.newGeometry?d1(t,e.newGeometry,a,r,i):(i.set(t,{...n,properties:a}),[])}function d1(t,e,r,i,n){return rc(Ju({type:\"FeatureCollection\",features:[{type:\"Feature\",id:t,geometry:e,properties:r}]},{...i,promoteId:void 0,generateId:!1},n),i)}function y1(t){return t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0}function ql(t,e){if(e.removeAllProperties)return{};let r={...t||{}};if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function Gb(t,e){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(r=>[e.promoteId?r.properties?.[e.promoteId]:r.id,r])),update:new Map(t.update?.map(r=>[r.id,r]))}:{remove:new Set,add:new Map,update:new Map}}var wp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],vt=new Uint32Array(96),Xb=class m1{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error(\"Data does not appear to be in a KDBush format.\");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=wp[i&15];if(!a)throw Error(\"Unrecognized array type.\");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new m1(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=wp.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let c=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(c,8,e),this.coords=new i(c,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+s]),new Uint16Array(c,2,1)[0]=r,new Uint32Array(c,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Gl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;vt[0]=0,vt[1]=a.length-1,vt[2]=0;let l=3,u=[];for(;l>0;){let c=vt[--l],h=vt[--l],p=vt[--l];if(h-p<=o){for(let m=p;m<=h;m++){let g=s[2*m],v=s[2*m+1];g>=e&&g<=i&&v>=r&&v<=n&&u.push(a[m])}continue}let f=p+h>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(c===0?e<=d:r<=y)&&(vt[l++]=p,vt[l++]=f-1,vt[l++]=1-c),(c===0?i>=d:n>=y)&&(vt[l++]=f+1,vt[l++]=h,vt[l++]=1-c)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;vt[0]=0,vt[1]=a.length-1,vt[2]=0;let l=3,u=0,c=i*i;for(;l>0;){let h=vt[--l],p=vt[--l],f=vt[--l];if(p-f<=o){for(let g=f;g<=p;g++)_p(s[2*g],s[2*g+1],e,r)<=c&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];_p(y,m,e,r)<=c&&(n[u++]=a[d]),(h===0?e-i<=y:r-i<=m)&&(vt[l++]=f,vt[l++]=d-1,vt[l++]=1-h),(h===0?e+i>=y:r+i>=m)&&(vt[l++]=d+1,vt[l++]=p,vt[l++]=1-h)}return u}};function Gl(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;g1(t,e,s,i,n,a),Gl(t,e,r,i,s-1,1-a),Gl(t,e,r,s+1,n,1-a)}function g1(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,c=r-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);g1(t,e,r,Math.max(i,Math.floor(r-c*p/u+f)),Math.min(n,Math.floor(r+(u-c)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(Qi(t,e,i,r),e[2*n+a]>s&&Qi(t,e,i,n);o<l;){for(Qi(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?Qi(t,e,i,l):(l++,Qi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Qi(t,e,r,i){ko(t,r,i),ko(e,2*r,2*i),ko(e,2*r+1,2*i+1)}function ko(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function _p(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var x1={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t,coordinates:\"lngLat\",wrap:!0},ss=1073741824;function Wt(t){return(t-.5)*ss}function Ai(t){return t/ss+.5}function Dp(t){return Math.abs(Wt(t))<2147483647}var Yb=class{constructor(t){this.options=Sp(t),this.worldCoordinateHelper=Ku(this.options.coordinates),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let i=r.geometry.type===\"MultiPoint\"?r.geometry.coordinates:[r.geometry.coordinates];for(let[n,a]of i){let[s,o]=[this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(a)];if(!this.options.wrap&&!Co([s,o]))continue;let l={id:r.id,type:\"Point\",geometry:[s,o],tags:r.properties};e.push(l)}}this.createIndex(e)}initialize(t){let e=[];for(let r of t)if(r.type===\"Point\"){if(!this.options.wrap&&!Co(r.geometry))continue;e.push(r)}else if(r.type===\"MultiPoint\")for(let i=0;i<r.geometry.length;i+=3){let n=[r.geometry[i],r.geometry[i+1]];(this.options.wrap||Co(n))&&e.push({id:r.id,type:\"Point\",geometry:n,tags:r.tags})}this.createIndex(e)}updateIndex(t,e,r){this.options=Sp({...r.clusterOptions,coordinates:this.options.coordinates,wrap:this.options.wrap}),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;this.trees=Array(i+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],e&&console.time(\"total time\");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=this.stride,s=i+1,o=new Int32Array(t.length*2),l=new Int32Array(t.length*a),u=0;for(let f=0;f<t.length;f++){let d=t[f];if(!d?.geometry||!Dp(d.geometry[0])||!Dp(d.geometry[1]))continue;o[u*2]=Math.round(Wt(d.geometry[0])),o[u*2+1]=Math.round(Wt(d.geometry[1]));let y=u*a;l[y+0]=s,l[y+1]=f,l[y+2]=-1,l[y+3]=1,u++}let c=this.trees[i+1]=this.createTree(o,l,u);e&&console.timeEnd(n);let h=new Int32Array(u*2),p=new Int32Array(u*a);for(let f=i;f>=r;f--){let d=Date.now(),y=this.cluster(c,f,h,p);this.isSameAsTree(c,p,y)||(c=this.createTree(h.slice(0,y*2),p.slice(0,y*a),y)),this.trees[f]=c,e&&console.log(\"z%d: %d clusters in %dms\",f,c.numItems,Date.now()-d)}e&&console.timeEnd(\"total time\")}getClusters(t,e){return(this.options.wrap?this.options.coordinates===\"unitSquare\"?this.getClustersAcrossEdge(t,e):this.getClustersInternal(t,e):this.getClustersInWorld(t,e)).map(r=>as(r,this.worldCoordinateHelper))}getClustersInWorld(t,e){let r=this.options.coordinates!==\"unitSquare\",i=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[1])):t[1]),n=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[3])):t[3]),a=Math.max(0,this.worldCoordinateHelper.projectX(t[0])),s=Math.min(1,this.worldCoordinateHelper.projectX(t[2]));return a>s?[]:this.getClustersInRange([a,Math.min(i,n),s,Math.max(i,n)],e)}getClustersAcrossEdge([t,e,r,i],n){if(r<t&&(r+=1),r-t>=1)return this.getClustersInRange([0,e,1,i],n);let a=Math.floor(t),s=t-a,o=r-a;return o<=1?this.getClustersInRange([s,e,o,i],n):this.getClustersInRange([s,e,1,i],n).concat(this.getClustersInRange([0,e,o-1,i],n))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let s=this.getClustersInternal([r,i,180,a],e),o=this.getClustersInternal([-180,i,n,a],e);return s.concat(o)}return this.getClustersInRange([this.worldCoordinateHelper.projectX(r),this.worldCoordinateHelper.projectY(a),this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(i)],e)}getClustersInRange([t,e,r,i],n){let a=this.trees[this.limitZoom(n)],s=a.range(Wt(t),Wt(e),Wt(r),Wt(i)),o=a.flatCoords,l=a.flatData,u=[];for(let c of s){let h=this.stride*c;u.push(l[h+3]>1?Wb(o,c,l,h,this.clusterProps):this.points[l[h+1]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error(\"No cluster with the specified id: \"+t),n=this.trees[r];if(!n)throw i;let a=n.flatCoords,s=n.flatData;if(e>=n.numItems)throw i;let o=this.options.radius/(this.options.extent*2**(r-1))*ss,l=a[e*2],u=a[e*2+1],c=n.within(l,u,o),h=[];for(let p of c){let f=p*this.stride;s[f+2]===t&&h.push(s[f+3]>1?Zb(a,p,s,f,this.clusterProps,this.worldCoordinateHelper):as(this.points[s[f+1]],this.worldCoordinateHelper))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t;if(!this.options.wrap&&(e<0||e>=n||r<0||r>=n))return null;let{extent:a,radius:s}=this.options,o=s/a,l=Wt((r-o)/n),u=Wt((r+1+o)/n),c={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range(Wt((e-o)/n),l,Wt((e+1+o)/n),u),i,e,r,n,c),this.options.wrap&&e===0&&this.addTileFeatures(i.range(Wt(1-o/n),l,Wt(1),u),i,n,r,n,c),this.options.wrap&&e===n-1&&this.addTileFeatures(i.range(Wt(0),l,Wt(o/n),u),i,-1,r,n,c),c}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o?.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n}createTree(t,e,r){let i=new Xb(r,this.options.nodeSize,Int32Array);for(let n=0;n<r;n++)i.add(t[n*2],t[n*2+1]);return i.finish(),i.flatCoords=t,i.flatData=e,i.data=null,i}isSameAsTree(t,e,r){if(r!==t.numItems)return!1;let i=t.flatData;for(let n=1;n<r*this.stride;n+=this.stride)if(e[n]!==i[n])return!1;return!0}addTileFeatures(t,e,r,i,n,a){let s=e.flatCoords,o=e.flatData;for(let l of t){let u=l*this.stride,c=o[u+3]>1,h,p,f;if(c)h=ic(o,u,this.clusterProps),p=Ai(s[l*2]),f=Ai(s[l*2+1]);else{let m=this.points[o[u+1]];h=m.tags,[p,f]=m.geometry}let d={type:1,geometry:[[Math.round(this.options.extent*(p*n-r)),Math.round(this.options.extent*(f*n-i))]],tags:h},y;y=c||this.options.generateId?o[u+1]:this.points[o[u+1]].id,y!==void 0&&(d.id=y),a.features.push(d)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e,r,i){let{radius:n,extent:a,reduce:s,minPoints:o,maxZoom:l}=this.options,u=n/(a*2**e)*ss,c=l+1,h=t.flatCoords,p=t.flatData,f=this.stride,d=new Uint32Array(t.numItems),y=0;for(let m=0;m<t.numItems;m++){let g=m*f;if(p[g+0]<=e)continue;p[g+0]=e;let v=h[m*2],x=h[m*2+1],b=t.withinInto(v,x,u,d),w=p[g+3],_=w;for(let S=0;S<b;S++){let A=d[S]*f;p[A+0]>e&&(_+=p[A+3])}if(_>w&&_>=o){let S=v*w,A=x*w,E,R=-1,M=(m<<5)+(e+1)+this.points.length;for(let U=0;U<b;U++){let k=d[U],C=k*f;if(p[C+0]<=e)continue;p[C+0]=e;let L=p[C+3];S+=h[k*2]*L,A+=h[k*2+1]*L,p[C+2]=M,s&&(E||(E=this.map(p,g,!0),R=this.clusterProps.length,this.clusterProps.push(E)),s(E,this.map(p,C)))}p[g+2]=M,r[y*2]=Math.round(S/_),r[y*2+1]=Math.round(A/_);let V=y*f;i[V+0]=c,i[V+1]=M,i[V+2]=-1,i[V+3]=_,s&&(i[V+4]=R),y++}else{r[y*2]=v,r[y*2+1]=x;for(let S=0;S<f;S++)i[y*f+S]=p[g+S];if(y++,_>1)for(let S=0;S<b;S++){let A=d[S],E=A*f;if(!(p[E+0]<=e)){p[E+0]=e,r[y*2]=h[A*2],r[y*2+1]=h[A*2+1];for(let R=0;R<f;R++)i[y*f+R]=p[E+R];y++}}}}return y}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+3]>1){let a=this.clusterProps[t[e+4]];return r?Object.assign({},a):a}let i=this.points[t[e+1]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function Sp(t){let e=Object.assign(Object.create(x1),t);return e.minZoom=Math.min(e.minZoom,30),e.maxZoom=Math.min(e.maxZoom,30),e}function Wb(t,e,r,i,n){return{id:r[i+1],type:\"Point\",tags:ic(r,i,n),geometry:[Ai(t[e*2]),Ai(t[e*2+1])]}}function Zb(t,e,r,i,n,a){return{type:\"Feature\",id:r[i+1],properties:ic(r,i,n),geometry:{type:\"Point\",coordinates:[a.unprojectX(Ai(t[e*2])),a.unprojectY(Ai(t[e*2+1]))]}}}function ic(t,e,r){let i=t[e+3],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+4],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+1],point_count:i,point_count_abbreviated:n})}function Co(t){return t[0]>=0&&t[0]<=1&&t[1]>=0&&t[1]<=1}var v1=\"geojsonvt_clip_start\",b1=\"geojsonvt_clip_end\";function Ap(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),s={transformed:!1,features:[],source:null,x:r,y:i,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length};for(let o of t)Hb(s,o,a,n);return s}function Hb(t,e,r,i){switch(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type){case\"Point\":case\"MultiPoint\":Kb(t,e);return;case\"LineString\":Jb(t,e,r,i);return;case\"MultiLineString\":case\"Polygon\":Qb(t,e,r);return;case\"MultiPolygon\":tw(t,e,r);return}}function Kb(t,e){let r=[];for(let n=0;n<e.geometry.length;n+=3)r.push(e.geometry[n],e.geometry[n+1]),t.numPoints++,t.numSimplified++;if(!r.length)return;let i={type:1,tags:e.tags||null,geometry:r};e.id!==null&&(i.id=e.id),t.features.push(i)}function Jb(t,e,r,i){let n=[];if(nc(n,e.geometry,t,r,!1,!1),!n.length)return;let a=e.tags||null;if(i.lineMetrics){a={};for(let o in e.tags)a[o]=e.tags[o];a[v1]=e.geometry.start/e.geometry.size,a[b1]=e.geometry.end/e.geometry.size}let s={type:2,tags:a,geometry:n};e.id!==null&&(s.id=e.id),t.features.push(s)}function Qb(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++)nc(i,e.geometry[a],t,r,e.type===\"Polygon\",a===0);if(!i.length)return;let n={type:e.type===\"Polygon\"?3:2,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function tw(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++){let s=e.geometry[a];for(let o=0;o<s.length;o++)nc(i,s[o],t,r,!0,o===0)}if(!i.length)return;let n={type:3,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function nc(t,e,r,i,n,a){let s=i*i;if(i>0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;l<e.points.length;l+=3)(i===0||e.points[l+2]>s)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&ew(o,a),t.push(o)}function ew(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i<n;a=i,i+=2)r+=(t[i]-t[a])*(t[i+1]+t[a+1]);if(r>0===e)for(let i=0,n=t.length;i<n/2;i+=2){let a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}function Ep(t,e){if(t.transformed)return t;let r=1<<t.z,i=t.x,n=t.y;for(let a of t.features)a.type===1?rw(a,e,r,i,n):iw(a,e,r,i,n);return t.transformed=!0,t}function rw(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l=0;l<s.length;l+=2)o.push(w1(s[l],s[l+1],e,r,i,n));return a.geometry=o,a}function iw(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l of s){let u=[];for(let c=0;c<l.length;c+=2)u.push(w1(l[c],l[c+1],e,r,i,n));o.push(u)}return a.geometry=o,a}function w1(t,e,r,i,n,a){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-a))]}var nw=class{constructor(t){this.options=t,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(this.clipToWorld(t),0,0,0),this.options.debug&&(t.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}updateIndex(t,e,r){r.debug>1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(e),r.debug>1&&console.timeEnd(\"invalidating\");let[i,n,a]=[0,0,0],s=this.clipToWorld(t),o=Ap(s,i,n,a,r);o.source=s;let l=_a(i,n,a);if(this.tiles[l]=o,this.tileCoords.push({z:i,x:n,y:a,id:l}),r.debug){let u=`z${i}`;this.stats[u]=(this.stats[u]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<<t;if(!this.options.wrap&&(e<0||e>=a))return null;e=e+a&a-1;let s=_a(t,e,r);if(this.tiles[s])return Ep(this.tiles[s],i);n>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);let o=t,l=e,u=r,c;for(;!c&&o>0;)o--,l>>=1,u>>=1,c=this.tiles[_a(o,l,u)];return!c?.source||(n>1&&(console.log(\"found parent tile z%d-%d-%d\",o,l,u),console.time(\"drilling down\")),this.splitTile(c.source,o,l,u,t,e,r),n>1&&console.timeEnd(\"drilling down\"),!this.tiles[s])?null:Ep(this.tiles[s],i)}clipToWorld(t){let{wrap:e,coordinates:r}=this.options;if(e&&r!==\"unitSquare\")return t;let i=this.options.buffer/this.options.extent;return _e(e?t:_e(t,1,-i,1+i,0,-1/0,1/0,this.options)||[],1,-i,1+i,1,-1/0,1/0,this.options)||[]}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let c=1<<e,h=_a(e,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time(\"creation\"),p=this.tiles[h]=Ap(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:h}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd(\"creation\"));let S=`z${e}`;this.stats[S]=(this.stats[S]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let S=n-e;if(r!==a>>S||i!==s>>S)continue}}if(p.source=null,!t.length)continue;u>1&&console.time(\"clipping\");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,v=null,x=null,b=null,w=_e(t,c,r-f,r+y,0,p.minX,p.maxX,l),_=_e(t,c,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=_e(w,c,i-f,i+y,1,p.minY,p.maxY,l),v=_e(w,c,i+d,i+m,1,p.minY,p.maxY,l)),_&&(x=_e(_,c,i-f,i+y,1,p.minY,p.maxY,l),b=_e(_,c,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd(\"clipping\"),o.push(g||[],e+1,r*2,i*2),o.push(v||[],e+1,r*2,i*2+1),o.push(x||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let c=this.tiles[u],h=1<<c.z,p=(c.x-o)/h,f=(c.x+1+o)/h,d=(c.y-o)/h,y=(c.y+1+o)/h;if(n<p||i>=f||s<d||a>=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX<f&&g.maxY>=d&&g.minY<y){m=!0;break}if(m){if(r){r>1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);let g=`z${c.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function _a(t,e,r){return((1<<t)*r+e)*32+t}var aw={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:x1,debug:0,coordinates:\"lngLat\",wrap:!0},sw=class{constructor(t,e){e=this.options=Object.assign({},aw,e),this.worldCoordinateHelper=Ku(e.coordinates);let r=e.debug;if(r&&console.time(\"preprocess data\"),e.maxZoom<0||e.maxZoom>24)throw Error(\"maxZoom should be in the 0-24 range\");if(e.promoteId&&e.generateId)throw Error(\"promoteId and generateId cannot be used together.\");e.updateable&&(this.unlocated=new Map),this.nextId=t.type===\"FeatureCollection\"?t.features.length:1;let i=Ju(t,e,this.unlocated);r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\")),i=rc(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new Yb({...e.clusterOptions,coordinates:e.coordinates,wrap:e.wrap}):new nw(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error(\"to update tile geojson `updateable` option must be set to true\");r.generateId&&t.add&&(t={...t,add:t.add.map(a=>({...a,id:this.nextId++}))});let{affected:i,source:n}=Ub(this.source,t,r,this.unlocated);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(as(n,this.worldCoordinateHelper))||(e.push(n),i.add(n.id)));t=t.filter(n=>!i.has(n.id));for(let[n,a]of this.unlocated??[])a.geometry&&!r(a)&&this.unlocated.delete(n);return{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error(\"to retrieve data the `updateable` option must be set to true\");return Fb(this.source,this.worldCoordinateHelper)}updateClusterOptions(t,e){let r=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,r==t?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Xl=It([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"},{name:\"a_offset_normal\",components:2,type:\"Int8\"}],2),ow=Xl.members;Xl.size,Xl.alignment;var Yl=It([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),lw=Yl.members;Yl.size,Yl.alignment;var uw=Math.cos(75/2*(Math.PI/180)),_1=1/2,Tp=2**14/_1,D1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new s2,this.layoutVertexArray2=new o2,this.indexArray=new qn,this.programConfigurations=new Vr(t.layers,t.zoom),this.segments=new le,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=rs(\"line\",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get(\"line-sort-key\"),n=!i.isConstant(),a=[],s=new ut(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Ci(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Nr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;this.hasDependencies?(rs(\"line\",this.layers,e)?Zu(\"line\",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,c,r,{},{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,lw)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ow),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,\"geojsonvt_clip_start\")&&Object.hasOwn(t.properties,\"geojsonvt_clip_end\"))return{start:+t.properties[v1],end:+t.properties[b1]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get(\"line-join\").evaluate(t,{}),u=o.get(\"line-cap\").evaluate(t,{}),c=o.get(\"line-miter-limit\").evaluate(t,{}),h=o.get(\"line-round-limit\").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,c,h,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=Fr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let x=0;x<t.length-1;x++)this.totalDistance+=t[x].dist(t[x+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=Gn.types[e.type]===\"Polygon\",c=t.length;for(;c>=2&&t[c-1].equals(t[c-2]);)c--;let h=0;for(;h<c-1&&t[h].equals(t[h+1]);)h++;if(c-h<(u?3:2))return;r===\"bevel\"&&(n=1.05);let p=this.overscaling<=16?15*rt/(512*this.overscaling):0,f=this.segments.prepareSegment(c*10,this.layoutVertexArray,this.indexArray),d,y,m,g,v;this.e1=this.e2=-1,u&&(d=t[c-2],v=t[h].sub(d)._unit()._perp());for(let x=h;x<c;x++){if(m=x===c-1?u?t[h+1]:void 0:t[x+1],m&&t[x].equals(m))continue;v&&(g=v),d&&(y=d),d=t[x],v=m?m.sub(d)._unit()._perp():g,g||(g=v);let b=g.add(v);(b.x!==0||b.y!==0)&&b._unit();let w=g.x*v.x+g.y*v.y,_=b.x*v.x+b.y*v.y,S=_===0?1/0:1/_,A=2*Math.sqrt(2-2*_),E=_<uw&&y&&m,R=g.x*v.y-g.y*v.x>0,M=b.mult(Math.min(S,2)),V=Qt((S-3)/5,0,1);if(E&&x>h){let C=d.dist(y);if(C>2*p){let L=d.sub(d.sub(y)._mult(p/C)._round());this.updateDistance(y,L),this.addCurrentVertex(L,g,0,0,f),y=L}}let U=y&&m,k=U?r:u?\"butt\":i;if(U&&k===\"round\"&&(S<a?k=\"miter\":S<=2&&(k=\"fakeround\")),k===\"miter\"&&S>n&&(k=\"bevel\"),k===\"bevel\"&&(S>2&&(k=\"flipbevel\"),S<n&&(k=\"miter\")),y&&this.updateDistance(y,d),k===\"miter\")b._mult(S),this.addCurrentVertex(d,b,0,0,f,!1,M);else if(k===\"flipbevel\"){if(S>100)b=v.mult(-1);else{let C=S*g.add(v).mag()/g.sub(v).mag();b._perp()._mult(C*(R?-1:1))}this.addCurrentVertex(d,b,0,0,f,!1,M,V),this.addCurrentVertex(d,b.mult(-1),0,0,f,!1,M,V)}else if(k===\"bevel\"||k===\"fakeround\"){let C=-Math.sqrt(S*S-1),L=R?C:0,O=R?0:C;if(y&&this.addCurrentVertex(d,g,L,O,f,!1,M),k===\"fakeround\"){let j=Math.round(A*180/Math.PI/20);for(let nt=1;nt<j;nt++){let ot=nt/j;if(ot!==.5){let lt=ot-.5,gt=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),ue=.848013+w*(-1.06021+w*.215638);ot+=ot*lt*(ot-1)*(gt*lt*lt+ue)}let pt=v.sub(g)._mult(ot)._add(g)._unit()._mult(R?-1:1);this.addHalfVertex(d,pt.x,pt.y,R?-M.x:M.x,R?-M.y:M.y,!1,R,f)}}m&&this.addCurrentVertex(d,v,-L,-O,f,!1,M)}else if(k===\"butt\")this.addCurrentVertex(d,b,0,0,f,!1,M);else if(k===\"square\"){let C=y?1:-1;this.addCurrentVertex(d,b,C,C,f,!1,M)}else k===\"round\"&&(y&&(this.addCurrentVertex(d,g,0,0,f,!1,M,V),this.addCurrentVertex(d,g,1,1,f,!0,M,V)),m&&(this.addCurrentVertex(d,v,-1,-1,f,!0,M,V),this.addCurrentVertex(d,v,0,0,f,!1,M,V)));if(E&&x<c-1){let C=d.dist(m);if(C>2*p){let L=d.add(m.sub(d)._mult(p/C)._round());this.updateDistance(d,L),this.addCurrentVertex(L,v,0,0,f),d=L}}}}addCurrentVertex(t,e,r,i,n,a=!1,s=e,o=0){let l=e.x+e.y*r,u=e.y-e.x*r,c=-e.x+e.y*i,h=-e.y-e.x*i,p=s.x+(e.x-s.x)*o,f=s.y+(e.y-s.y)*o;this.addHalfVertex(t,l,u,p,f,a,!1,n),this.addHalfVertex(t,c,h,-p,-f,a,!0,n),this.distance>Tp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a,s,o))}addHalfVertex({x:t,y:e},r,i,n,a,s,o,l){let u=(this.lineClips?this.scaledDistance*(Tp-1):this.scaledDistance)*_1;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!s,(e<<1)+ +!!o,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),l.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get(\"line-dasharray\");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get(\"line-dasharray\");if(!a||a.value.kind===\"constant\")continue;let s=n.layout.get(\"line-cap\").evaluate(e,{})===\"round\",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},c=`${o.dasharray.join(\",\")},${o.round}`,h=`${l.dasharray.join(\",\")},${l.round}`,p=`${u.dasharray.join(\",\")},${u.round}`;i.dashDependencies[c]=o,i.dashDependencies[h]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:c,mid:h,max:p}}}};B(\"LineBucket\",D1,{omit:[\"layers\",\"patternFeatures\"]});var Ip,cw=()=>Ip||(Ip=new Zt({\"line-cap\":new N(D.layout_line[\"line-cap\"],\"line-cap\"),\"line-join\":new N(D.layout_line[\"line-join\"],\"line-join\"),\"line-miter-limit\":new N(D.layout_line[\"line-miter-limit\"],\"line-miter-limit\"),\"line-round-limit\":new N(D.layout_line[\"line-round-limit\"],\"line-round-limit\"),\"line-sort-key\":new N(D.layout_line[\"line-sort-key\"],\"line-sort-key\")})),kp,hw=()=>kp||(kp=new Zt({\"line-opacity\":new N(D.paint_line[\"line-opacity\"],\"line-opacity\"),\"line-layer-opacity\":new z(D.paint_line[\"line-layer-opacity\"],\"line-layer-opacity\"),\"line-layer-blend\":new z(D.paint_line[\"line-layer-blend\"],\"line-layer-blend\"),\"line-color\":new N(D.paint_line[\"line-color\"],\"line-color\"),\"line-translate\":new z(D.paint_line[\"line-translate\"],\"line-translate\"),\"line-translate-anchor\":new z(D.paint_line[\"line-translate-anchor\"],\"line-translate-anchor\"),\"line-width\":new N(D.paint_line[\"line-width\"],\"line-width\"),\"line-gap-width\":new N(D.paint_line[\"line-gap-width\"],\"line-gap-width\"),\"line-offset\":new N(D.paint_line[\"line-offset\"],\"line-offset\"),\"line-blur\":new N(D.paint_line[\"line-blur\"],\"line-blur\"),\"line-dasharray\":new Tn(D.paint_line[\"line-dasharray\"],\"line-dasharray\"),\"line-pattern\":new Tn(D.paint_line[\"line-pattern\"],\"line-pattern\"),\"line-gradient\":new Ds(D.paint_line[\"line-gradient\"],\"line-gradient\")})),Cp={get paint(){return hw()},get layout(){return cw()}},pw=class extends N{possiblyEvaluate(t,e){return e=new ut(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=te({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Da,fw=class extends Ae{constructor(t,e){super(t,Cp,e),this.gradientVersion=0,Da||(Da=new pw(Cp.paint.properties[\"line-width\"].specification,\"line-floorwidth\"),Da.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t===\"line-gradient\"){let e=this.gradientExpression();this.stepInterpolant=ox(e)?e._styleExpression.expression instanceof wu:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values[\"line-floorwidth\"]=Da.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,t)}createBucket(t){return new D1(t)}queryRadius(t){let e=t,r=Fp(hi(\"line-width\",this,e),hi(\"line-gap-width\",this,e)),i=hi(\"line-offset\",this,e);return r/2+Math.abs(i)+Ts(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a}){let s=Is(t,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-n.bearingInRadians,a),o=a/2*Fp(this.paint.get(\"line-width\").evaluate(e,r),this.paint.get(\"line-gap-width\").evaluate(e,r)),l=this.paint.get(\"line-offset\").evaluate(e,r);return l&&(i=rv(i,l*a)),D2(s,i,o)}isTileClipped(){return!0}};function Fp(t,e){return e>0?e+2*t:t}var dw=It([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"},{name:\"a_height_offset\",components:1,type:\"Float32\"}],4),yw=It([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);It([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);var mw=It([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);It([{type:\"Int16\",name:\"anchorPointX\"},{type:\"Int16\",name:\"anchorPointY\"},{type:\"Int16\",name:\"x1\"},{type:\"Int16\",name:\"y1\"},{type:\"Int16\",name:\"x2\"},{type:\"Int16\",name:\"y2\"},{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]);var Mp=It([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4);It([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4),It([{name:\"triangle\",components:3,type:\"Uint16\"}]),It([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Uint16\",name:\"glyphStartIndex\"},{type:\"Uint16\",name:\"numGlyphs\"},{type:\"Uint32\",name:\"vertexStartIndex\"},{type:\"Uint32\",name:\"lineStartIndex\"},{type:\"Uint32\",name:\"lineLength\"},{type:\"Uint16\",name:\"segment\"},{type:\"Uint16\",name:\"lowerSize\"},{type:\"Uint16\",name:\"upperSize\"},{type:\"Float32\",name:\"lineOffsetX\"},{type:\"Float32\",name:\"lineOffsetY\"},{type:\"Uint8\",name:\"writingMode\"},{type:\"Uint8\",name:\"placedOrientation\"},{type:\"Uint8\",name:\"hidden\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Int16\",name:\"associatedIconIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),It([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Int16\",name:\"rightJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"centerJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"leftJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedTextSymbolIndex\"},{type:\"Int16\",name:\"placedIconSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedIconSymbolIndex\"},{type:\"Uint16\",name:\"key\"},{type:\"Uint16\",name:\"textBoxStartIndex\"},{type:\"Uint16\",name:\"textBoxEndIndex\"},{type:\"Uint16\",name:\"verticalTextBoxStartIndex\"},{type:\"Uint16\",name:\"verticalTextBoxEndIndex\"},{type:\"Uint16\",name:\"iconBoxStartIndex\"},{type:\"Uint16\",name:\"iconBoxEndIndex\"},{type:\"Uint16\",name:\"verticalIconBoxStartIndex\"},{type:\"Uint16\",name:\"verticalIconBoxEndIndex\"},{type:\"Uint16\",name:\"featureIndex\"},{type:\"Uint16\",name:\"numHorizontalGlyphVertices\"},{type:\"Uint16\",name:\"numVerticalGlyphVertices\"},{type:\"Uint16\",name:\"numIconVertices\"},{type:\"Uint16\",name:\"numVerticalIconVertices\"},{type:\"Uint16\",name:\"useRuntimeCollisionCircles\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Float32\",name:\"textBoxScale\"},{type:\"Float32\",name:\"collisionCircleDiameter\"},{type:\"Uint16\",name:\"textAnchorOffsetStartIndex\"},{type:\"Uint16\",name:\"textAnchorOffsetEndIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),It([{type:\"Float32\",name:\"offsetX\"}]),It([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),It([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var Ei=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Ei.isParsed())throw Error(\"RTL text plugin already registered.\");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(t,e){if(this.isParsed())return this.getState();if(t.pluginStatus!==\"loading\")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await e(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:\"loaded\",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function gw(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function xw(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function vw(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Xn(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function bw(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function ww(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function Pp(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function _w(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||/^\\p{gc=Mc}/u.test(e)}var Dw={C:\"18g,1;g2,3;4nb,1\",D:\"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f\",R:\"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1\",T:\"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1\"},Sw={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},Aw={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},Bp=1604,Ew=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function Tw(t,e,r){let i=0;for(let n of t.split(\";\")){let[a,s]=n.split(\",\").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l<o+s;l++)r.set(l,e);i=o+s}}var S1=new Map;for(let[t,e]of Object.entries(Dw))Tw(e,t,S1);function Iw(t){return S1.get(t)??\"U\"}function kw(t){return t===\"D\"||t===\"L\"||t===\"C\"}function Cw(t){return t===\"D\"||t===\"R\"||t===\"C\"}function Fw(t,e,r){return t===\"D\"?e&&r?3:e?1:r?2:0:t===\"R\"?+!!e:t===\"L\"?r?2:0:null}function Mw(t){return[...t].map(e=>{let r=e.codePointAt(0);return{codePoint:r,type:Iw(r),form:null}})}function Pw(t){let e=t.filter(r=>r.type!==\"T\");for(let r=0;r<e.length;r++){let i=e[r],n=r>0&&kw(e[r-1].type),a=r+1<e.length&&Cw(e[r+1].type);i.form=Fw(i.type,n,a)}}function Bw(t){let e=!1;for(let r of t)r.type===\"T\"?r.form=e?3:0:e=r.form===2||r.form===3}function Lw(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.codePoint!==Bp){e.push(i);continue}let n=r+1;for(;n<t.length&&t[n].type===\"T\";)n++;let a=t[n],s=a&&Aw[String.fromCodePoint(Bp,a.codePoint)];if(!s){e.push(i);continue}let o=i.form===3||i.form===1;e.push({codePoint:s[+!!o],type:\"R\",form:0}),e.push(...t.slice(r+1,n)),r=n}return e}function zw(t){if(t.form===null)return t.codePoint;let e=Sw[t.codePoint];return e&&(e[t.form]||e[0])||t.codePoint}function Vw(t){if(!Ew.test(t))return t;let e=Mw(t);return Pw(e),Bw(e),Lw(e).map(r=>String.fromCodePoint(zw(r))).join(\"\")}function Ow(t,e,r){let i=e.layout.get(\"text-transform\").evaluate(r,{});return i===\"uppercase\"?t=t.toLocaleUpperCase():i===\"lowercase\"&&(t=t.toLocaleLowerCase()),(Ei.applyArabicShaping??Vw)(t)}function Rw(t,e,r){for(let i of t.sections)i.text=Ow(i.text,e,r);return t}function Fo(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function $w(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<e.length;a++)i[a]=e[a];let n=e.length;for(let a=t.first.next;a;a=a.next){let s=a.points;for(let o=1;o<s.length;o++)i[n++]=s[o]}return i}function Lp(t,e,r,i,n){let a=e[r];delete e[r],e[i]=a;let s=t[a];return s.last.next=n.first,s.last=n.last,a}function zp(t,e,r,i,n){let a=e[i];delete e[i],e[r]=a;let s=t[a];return n.last.next=s.first,s.first=n.first,a}function Nw(t){let e={},r={},i=[];for(let a of t){let s=a.text?a.text.toString():null,o={points:a.geometry[0],next:null},l={feature:a,first:o,last:o};if(!s){i.push(l);continue}let u=Fo(s,l),c=Fo(s,l,!0);if(u in r&&c in e&&r[u]!==e[c]){let h=zp(i,e,u,c,l),p=Lp(i,r,u,c,i[h]);delete e[u],delete r[c],r[Fo(s,i[p],!0)]=p,i[h].feature.geometry=null}else if(u in r)Lp(i,r,u,c,l);else if(c in e)zp(i,e,u,c,l);else{let h=i.push(l)-1;e[u]=h,r[c]=h}}let n=[];for(let a of i){let s=a.feature;s.geometry&&(a.first.next&&(s.geometry[0]=$w(a)),n.push(s))}return n}var A1=typeof Intl<\"u\"&&\"Segmenter\"in Intl,Mo,Po;function Wl(t){if(!A1||!ww(t))return[...t];Mo??(Mo=new Intl.Segmenter(void 0,{granularity:\"grapheme\"}));let e=[];for(let{segment:r}of Mo.segment(t)){let i=e.length-1;i>=0&&_w(e[i],r)?e[i]+=r:e.push(r)}return e}function Uw(t){let e=new Set;if(A1){Po??(Po=new Intl.Segmenter(void 0,{granularity:\"word\"}));for(let{index:i}of Po.segment(t))e.add(i);return e}let r=0;for(let i of t.split(/\\b|(?=\\p{Ideo})/u))e.add(r),r+=i.length;return e}function Zl(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function zn(t){return/\\s/u.test(String.fromCodePoint(t))}function Cs(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function Hl(t){for(let e of t)if(Xn(e.codePointAt(0)))return!0;return!1}function E1(t){for(let e of t)if(!jw(e.codePointAt(0)))return!1;return!0}function jw(t){return!gw(t)}function Ti(t){return!(Xn(t)||bw(t))}function T1(t){return/\\p{sc=Arab}/u.test(String.fromCodePoint(t))}function I1(t){return xw(t)}function k1(t){for(let e of t)if(I1(e.codePointAt(0)))return!0;return!1}var oi={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};function qw(t){let e=\"\",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!Ti(s.value.codePointAt(0))||oi[s.value])&&(r.premature||!Ti(r.value.codePointAt(0))||oi[r.value])&&oi[n.value]?e+=oi[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var Gw={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Xw={40:!0};function Vp(t,e,r,i,n,a){if(\"fontStack\"in e){let s=r[e.fontStack]?.default,o=s?.[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let c=s?.[u];c&&(l+=c.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function Op(t,e,r,i){let n=(t-e)**2;return i?t<e?n/2:n*2:n+Math.abs(r)*r}function Rp(t){return/^\\s+$/u.test(t)}function Yw(t,e,r){let i=0;return(t===10||t===13)&&(i-=1e4),r&&(i+=150),(t===40||t===65288)&&(i+=50),(e===41||e===65289)&&(i+=50),i}function $p(t,e,r,i,n,a){let s=null,o=Op(e,r,n,a);for(let l of i){let u=Op(e-l.x,r,n,a)+l.badness;u<=o&&(s=l,o=u)}return{index:t,x:e,priorBreak:s,badness:o}}function C1(t){return t?C1(t.priorBreak).concat(t.index):[]}var ac=class Kl{constructor(e=\"\",r=[],i=[]){this.text=e,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this.cachedGraphemes=null}graphemes(){return this.cachedGraphemes??(this.cachedGraphemes=Wl(this.text)),this.cachedGraphemes}static fromFeature(e,r,i,n){let a=new Kl;for(let s of e.sections)s.image?a.addImageSection(s):a.addTextSection(s,r);return i&&a.verticalizePunctuation(n),a}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(e={},r){let i=qw(this.text),n=0;this.cachedGraphemes=this.graphemes().map((a,s)=>{let o=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(s);return r?.[s]!==!1&&\"fontStack\"in l&&e[l.fontStack]?.vertical?.[a]?a:o}),this.text=this.cachedGraphemes.join(\"\")}hasZeroWidthSpaces(){return this.text.includes(\"\\u200B\")}trim(){let e=this.graphemes(),r=0;for(;r<e.length&&Rp(e[r]);)r++;let i=e.length;for(;i>r&&Rp(e[i-1]);)i--;this.text=e.slice(r,i).join(\"\"),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(\"\"),n=this.sectionIndex.slice(e,r);return new Kl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if(\"imageName\"in a){let s=e[a.imageName];if(!s)continue;let o=s.displaySize;r=Math.max(r,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(e,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:\"\",a=Wl(n+e);this.text+=e,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o<s;o++)this.sectionIndex.push(r)}addTextSection(e,r){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||\"bottom\",fontStack:e.fontStack||r}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let r=e.image?e.image.name:\"\";if(r.length===0){Pt(\"Can't add FormattedSection with an empty image.\");return}let i=this.getNextImageSectionCharCode();i?(this.sections.push({scale:1,verticalAlign:e.verticalAlign||\"bottom\",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)):Pt(\"Reached maximum number of images 6401\")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=this.determineTotalWidth(e,i,n,a);if(e>=0&&s>0&&s<=r&&!/[\\n\\r]/.test(this.text))return[this.length()];let o=[],l=s/Math.max(1,Math.ceil(s/r)),u=this.hasZeroWidthSpaces(),c=this.graphemes(),h=null,p=0,f=0;for(let d=0;d<c.length;d++){let y=c[d];if(d>0){let m=c[d-1].codePointAt(0),g=y.codePointAt(0),v=vw(m),x=Pp(m)&&Pp(g);(Gw[m]||v||\"imageName\"in this.getSection(d-1)||c[d+1]!==void 0&&Xw[g]||x&&(h??(h=Uw(this.text))).has(f))&&o.push($p(d,p,l,o,Yw(m,g,v&&u),!1))}zn(y.codePointAt(0))||(p+=Vp(y,this.getSection(d),i,n,e,a)),f+=y.length}return C1($p(this.length(),p,l,o,0,!0))}determineTotalWidth(e,r,i,n){let a=0,s=0;for(let o of this.graphemes()){let l=this.getSection(s);a+=Vp(o,l,r,i,e,n),s++}return a}};function Ww(){return(function(t){var e={R:\"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73\",EN:\"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9\",ES:\"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2\",ET:\"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj\",AN:\"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u\",CS:\"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b\",B:\"a,3,f+2,2v,690\",S:\"9,2,k\",WS:\"c,k,4f4,1vk+a,u,1j,335\",ON:\"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i\",BN:\"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1\",NSM:\"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n\",AL:\"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d\",LRO:\"6ct\",RLO:\"6cu\",LRE:\"6cq\",RLE:\"6cr\",PDF:\"6cs\",LRI:\"6ee\",RLI:\"6ef\",FSI:\"6eg\",PDI:\"6eh\"},r={},i={};r.L=1,i[1]=\"L\",Object.keys(e).forEach(function($,st){r[$]=1<<st+1,i[r[$]]=$}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|o,u=null;function c(){if(!u){u=new Map;var $=0;for(var st in e)if(e.hasOwnProperty(st))for(var it=e[st],F=\"\",Q=void 0,G=!1,H=0,X=0;X<=it.length+1;X+=1){var xt=it[X];if(xt!==\",\"&&X!==it.length)xt===\"+\"?(G=!0,H=$=H+parseInt(F,36),F=\"\"):F+=xt;else{G?Q=$+parseInt(F,36):(H=$=H+parseInt(F,36),Q=$),G=!1,F=\"\",H=Q;for(var _t=$;_t<Q+1;_t+=1)u.set(_t,r[st])}}}}function h($){return c(),u.get($.codePointAt(0))||r.L}function p($){return i[h($)]}var f={pairs:\"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1\",canonical:\"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye\"};function d($,st){var it=0,F=new Map,Q=st&&new Map,G;return $.split(\",\").forEach(function H(X){if(X.indexOf(\"+\")!==-1)for(var xt=+X;xt--;)H(G);else{G=X;var _t=X.split(\">\"),at=_t[0],Bt=_t[1];at=String.fromCodePoint(it+=parseInt(at,36)),Bt=String.fromCodePoint(it+=parseInt(Bt,36)),F.set(at,Bt),st&&Q.set(Bt,at)}}),{map:F,reverseMap:Q}}var y,m,g;function v(){if(!y){var $=d(f.pairs,!0),st=$.map,it=$.reverseMap;y=st,m=it,g=d(f.canonical,!1).map}}function x($){return v(),y.get($)||null}function b($){return v(),m.get($)||null}function w($){return v(),g.get($)||null}var _=r.L,S=r.R,A=r.EN,E=r.ES,R=r.ET,M=r.AN,V=r.CS,U=r.B,k=r.S,C=r.ON,L=r.BN,O=r.NSM,j=r.AL,nt=r.LRO,ot=r.RLO,pt=r.LRE,lt=r.RLE,gt=r.PDF,ue=r.LRI,ce=r.RLI,wr=r.FSI,ee=r.PDI;function qr($,st){for(var it=125,F=new Uint32Array($.length),Q=0;Q<$.length;Q++)F[Q]=h($[Q]);var G=new Map;function H(Ht,ve){var Kt=F[Ht];F[Ht]=ve,G.set(Kt,G.get(Kt)-1),Kt&s&&G.set(s,G.get(s)-1),G.set(ve,(G.get(ve)||0)+1),ve&s&&G.set(s,(G.get(s)||0)+1)}for(var X=new Uint8Array($.length),xt=new Map,_t=[],at=null,Bt=0;Bt<$.length;Bt++)at||_t.push(at={start:Bt,end:$.length-1,level:st===\"rtl\"?1:st===\"ltr\"?0:Hc(Bt,!1)}),F[Bt]&U&&(at.end=Bt,at=null);for(var Bi=lt|pt|ot|nt|n|ee|gt|U,Sr=function(Ht){return Ht+(Ht&1?1:2)},er=function(Ht){return Ht+(Ht&1?2:1)},rr=0;rr<_t.length;rr++){at=_t[rr];var ct=[{_level:at.level,_override:0,_isolate:0}],Dt=void 0,je=0,ir=0,Ps=0;G.clear();for(var Rt=at.start;Rt<=at.end;Rt++){var $t=F[Rt];if(Dt=ct[ct.length-1],G.set($t,(G.get($t)||0)+1),$t&s&&G.set(s,(G.get(s)||0)+1),$t&Bi)if($t&(lt|pt)){X[Rt]=Dt._level;var Sc=($t===lt?er:Sr)(Dt._level);Sc<=it&&!je&&!ir?ct.push({_level:Sc,_override:0,_isolate:0}):je||ir++}else if($t&(ot|nt)){X[Rt]=Dt._level;var Ac=($t===ot?er:Sr)(Dt._level);Ac<=it&&!je&&!ir?ct.push({_level:Ac,_override:$t&ot?S:_,_isolate:0}):je||ir++}else if($t&n){$t&wr&&($t=Hc(Rt+1,!0)===1?ce:ue),X[Rt]=Dt._level,Dt._override&&H(Rt,Dt._override);var Ec=($t===ce?er:Sr)(Dt._level);Ec<=it&&je===0&&ir===0?(Ps++,ct.push({_level:Ec,_override:0,_isolate:1,_isolInitIndex:Rt})):je++}else if($t&ee){if(je>0)je--;else if(Ps>0){for(ir=0;!ct[ct.length-1]._isolate;)ct.pop();var Bs=ct[ct.length-1]._isolInitIndex;Bs!=null&&(xt.set(Bs,Rt),xt.set(Rt,Bs)),ct.pop(),Ps--}Dt=ct[ct.length-1],X[Rt]=Dt._level,Dt._override&&H(Rt,Dt._override)}else $t>?(je===0&&(ir>0?ir--:!Dt._isolate&&ct.length>1&&(ct.pop(),Dt=ct[ct.length-1])),X[Rt]=Dt._level):$t&U&&(X[Rt]=at.level);else X[Rt]=Dt._level,Dt._override&&$t!==L&&H(Rt,Dt._override)}for(var Xr=[],Te=null,Ar=at.start;Ar<=at.end;Ar++){var Ls=F[Ar];if(!(Ls&o)){var Tc=X[Ar],Ic=Ls&n,j0=Ls===ee;Te&&Tc===Te._level?(Te._end=Ar,Te._endsWithIsolInit=Ic):Xr.push(Te={_start:Ar,_end:Ar,_level:Tc,_startsWithPDI:j0,_endsWithIsolInit:Ic})}}for(var zs=[],Zn=0;Zn<Xr.length;Zn++){var Hn=Xr[Zn];if(!Hn._startsWithPDI||Hn._startsWithPDI&&!xt.has(Hn._start)){for(var Vs=[Te=Hn],kc=void 0;Te&&Te._endsWithIsolInit&&(kc=xt.get(Te._end))!=null;)for(var Kn=Zn+1;Kn<Xr.length;Kn++)if(Xr[Kn]._start===kc){Vs.push(Te=Xr[Kn]);break}for(var Yr=[],Os=0;Os<Vs.length;Os++)for(var Cc=Vs[Os],Rs=Cc._start;Rs<=Cc._end;Rs++)Yr.push(Rs);for(var q0=X[Yr[0]],Fc=at.level,Jn=Yr[0]-1;Jn>=0;Jn--)if(!(F[Jn]&o)){Fc=X[Jn];break}var $s=Yr[Yr.length-1],G0=X[$s],Mc=at.level;if(!(F[$s]&n)){for(var Qn=$s+1;Qn<=at.end;Qn++)if(!(F[Qn]&o)){Mc=X[Qn];break}}zs.push({_seqIndices:Yr,_sosType:Math.max(Fc,q0)%2?S:_,_eosType:Math.max(Mc,G0)%2?S:_})}}for(var Ns=0;Ns<zs.length;Ns++){var Us=zs[Ns],q=Us._seqIndices,Li=Us._sosType,X0=Us._eosType,Wr=X[q[0]]&1?S:_;if(G.get(O))for(var ta=0;ta<q.length;ta++){var Pc=q[ta];if(F[Pc]&O){for(var js=Li,ea=ta-1;ea>=0;ea--)if(!(F[q[ea]]&o)){js=F[q[ea]];break}H(Pc,js&(n|ee)?C:js)}}if(G.get(A))for(var ra=0;ra<q.length;ra++){var Bc=q[ra];if(F[Bc]&A)for(var ia=ra-1;ia>=-1;ia--){var Lc=ia===-1?Li:F[q[ia]];if(Lc&a){Lc===j&&H(Bc,M);break}}}if(G.get(j))for(var qs=0;qs<q.length;qs++){var zc=q[qs];F[zc]&j&&H(zc,S)}if(G.get(E)||G.get(V))for(var zi=1;zi<q.length-1;zi++){var Gs=q[zi];if(F[Gs]&(E|V)){for(var Zr=0,Xs=0,Ys=zi-1;Ys>=0&&(Zr=F[q[Ys]],Zr&o);Ys--);for(var Ws=zi+1;Ws<q.length&&(Xs=F[q[Ws]],Xs&o);Ws++);Zr===Xs&&(F[Gs]===E?Zr===A:Zr&(A|M))&&H(Gs,Zr)}}if(G.get(A)){for(var Ie=0;Ie<q.length;Ie++)if(F[q[Ie]]&A){for(var na=Ie-1;na>=0&&F[q[na]]&(R|o);na--)H(q[na],A);for(Ie++;Ie<q.length&&F[q[Ie]]&(R|o|A);Ie++)F[q[Ie]]!==A&&H(q[Ie],A)}}if(G.get(R)||G.get(E)||G.get(V))for(var Vi=0;Vi<q.length;Vi++){var Vc=q[Vi];if(F[Vc]&(R|E|V)){H(Vc,C);for(var aa=Vi-1;aa>=0&&F[q[aa]]&o;aa--)H(q[aa],C);for(var sa=Vi+1;sa<q.length&&F[q[sa]]&o;sa++)H(q[sa],C)}}if(G.get(A))for(var Zs=0,Oc=Li;Zs<q.length;Zs++){var Rc=q[Zs],Hs=F[Rc];Hs&A?Oc===_&&H(Rc,_):Hs&a&&(Oc=Hs)}if(G.get(s)){for(var Oi=S|A|M,$c=Oi|_,oa=[],Hr=[],Kr=0;Kr<q.length;Kr++)if(F[q[Kr]]&s){var Ri=$[q[Kr]],Nc=void 0;if(x(Ri)!==null)if(Hr.length<63)Hr.push({char:Ri,seqIndex:Kr});else break;else if((Nc=b(Ri))!==null)for(var $i=Hr.length-1;$i>=0;$i--){var Ks=Hr[$i].char;if(Ks===Nc||Ks===b(w(Ri))||x(w(Ks))===Ri){oa.push([Hr[$i].seqIndex,Kr]),Hr.length=$i;break}}}oa.sort(function(Ht,ve){return Ht[0]-ve[0]});for(var Js=0;Js<oa.length;Js++){for(var Uc=oa[Js],la=Uc[0],Qs=Uc[1],jc=!1,ke=0,to=la+1;to<Qs;to++){var qc=q[to];if(F[qc]&$c){jc=!0;var Gc=F[qc]&Oi?S:_;if(Gc===Wr){ke=Gc;break}}}if(jc&&!ke){ke=Li;for(var eo=la-1;eo>=0;eo--){var Xc=q[eo];if(F[Xc]&$c){var Yc=F[Xc]&Oi?S:_;ke=Yc===Wr?Wr:Yc;break}}}if(ke){if(F[q[la]]=F[q[Qs]]=ke,ke!==Wr){for(var Ni=la+1;Ni<q.length;Ni++)if(!(F[q[Ni]]&o)){h($[q[Ni]])&O&&(F[q[Ni]]=ke);break}}if(ke!==Wr){for(var Ui=Qs+1;Ui<q.length;Ui++)if(!(F[q[Ui]]&o)){h($[q[Ui]])&O&&(F[q[Ui]]=ke);break}}}}for(var nr=0;nr<q.length;nr++)if(F[q[nr]]&s){for(var Wc=nr,ro=nr,io=Li,ji=nr-1;ji>=0;ji--)if(F[q[ji]]&o)Wc=ji;else{io=F[q[ji]]&Oi?S:_;break}for(var Zc=X0,qi=nr+1;qi<q.length;qi++)if(F[q[qi]]&(s|o))ro=qi;else{Zc=F[q[qi]]&Oi?S:_;break}for(var no=Wc;no<=ro;no++)F[q[no]]=io===Zc?io:Wr;nr=ro}}}for(var re=at.start;re<=at.end;re++){var Y0=X[re],ua=F[re];if(Y0&1?ua&(_|A|M)&&X[re]++:ua&S?X[re]++:ua&(M|A)&&(X[re]+=2),ua&o&&(X[re]=re===0?at.level:X[re-1]),re===at.end||h($[re])&(k|U))for(var ca=re;ca>=0&&h($[ca])&l;ca--)X[ca]=at.level}}return{levels:X,paragraphs:_t};function Hc(Ht,ve){for(var Kt=Ht;Kt<$.length;Kt++){var ar=F[Kt];if(ar&(S|j))return 1;if(ar&(U|_)||ve&&ar===ee)return 0;if(ar&n){var Kc=W0(Kt);Kt=Kc===-1?$.length:Kc}}return 0}function W0(Ht){for(var ve=1,Kt=Ht+1;Kt<$.length;Kt++){var ar=F[Kt];if(ar&U)break;if(ar&ee){if(--ve===0)return Kt}else ar&n&&ve++}return-1}}var Gr=\"14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1\",tr;function Ee(){if(!tr){var $=d(Gr,!0),st=$.map;$.reverseMap.forEach(function(it,F){st.set(F,it)}),tr=st}}function _r($){return Ee(),tr.get($)||null}function Pi($,st,it,F){var Q=$.length;it=Math.max(0,it==null?0:+it),F=Math.min(Q-1,F==null?Q-1:+F);for(var G=new Map,H=it;H<=F;H++)if(st[H]&1){var X=_r($[H]);X!==null&&G.set(H,X)}return G}function Vt($,st,it,F){var Q=$.length;it=Math.max(0,it==null?0:+it),F=Math.min(Q-1,F==null?Q-1:+F);var G=[];return st.paragraphs.forEach(function(H){var X=Math.max(it,H.start),xt=Math.min(F,H.end);if(X<xt){for(var _t=st.levels.slice(X,xt+1),at=xt;at>=X&&h($[at])&l;at--)_t[at]=H.level;for(var Bt=H.level,Bi=1/0,Sr=0;Sr<_t.length;Sr++){var er=_t[Sr];er>Bt&&(Bt=er),er<Bi&&(Bi=er|1)}for(var rr=Bt;rr>=Bi;rr--)for(var ct=0;ct<_t.length;ct++)if(_t[ct]>=rr){for(var Dt=ct;ct+1<_t.length&&_t[ct+1]>=rr;)ct++;ct>Dt&&G.push([Dt+X,ct+X])}}}),G}function Ue($,st,it,F){var Q=Dr($,st,it,F),G=[].concat($);return Q.forEach(function(H,X){G[X]=(st.levels[H]&1?_r($[H]):null)||$[H]}),G.join(\"\")}function Dr($,st,it,F){for(var Q=Vt($,st,it,F),G=[],H=0;H<$.length;H++)G[H]=H;return Q.forEach(function(X){for(var xt=X[0],_t=X[1],at=G.slice(xt,_t+1),Bt=at.length;Bt--;)G[_t-Bt]=at[Bt]}),G}return t.closingToOpeningBracket=b,t.getBidiCharType=h,t.getBidiCharTypeName=p,t.getCanonicalBracket=w,t.getEmbeddingLevels=qr,t.getMirroredCharacter=_r,t.getMirroredCharactersMap=Pi,t.getReorderSegments=Vt,t.getReorderedIndices=Dr,t.getReorderedString=Ue,t.openingToClosingBracket=x,Object.defineProperty(t,\"__esModule\",{value:!0}),t})({})}var sc=Ww(),Zw=/[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]/,Hw=new Set([\"WS\",\"FSI\",\"LRI\",\"RLI\",\"PDI\"]),Kw=new Set([\"S\",\"B\"]);function Jw(t,e,r,i){let n=[],a=r;for(let s of Wl(t.slice(r,i)))n.push({index:a,text:s,level:e[a]}),a+=s.length;return n}function Qw(t,e){let r=!0;for(let i=t.length-1;i>=0;i--){let n=sc.getBidiCharTypeName(t[i].text[0]);Kw.has(n)?(t[i].level=e,r=!0):r&&Hw.has(n)?t[i].level=e:r=!1}}function t3(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=t.slice();for(let a=r;a>=i;a--)for(let s=0;s<n.length;s++){if(n[s].level<a)continue;let o=s;for(;o+1<n.length&&n[o+1].level>=a;)o++;for(let l=s,u=o;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];s=o}return n}function e3(t){return t.level%2==0?t.text:sc.getMirroredCharacter(t.text)??t.text}function r3(t,e){return t.find(r=>e>=r.start&&e<=r.end)?.level??0}function i3(t,e,r,i,n){let a=Jw(t,e,i,n);Qw(a,r);let s=\"\",o=[];for(let l of t3(a,r)){if(Zw.test(l.text))continue;let u=e3(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function n3(t,e){let r=e.filter(a=>a>0&&a<t.length),i=[...new Set([0,...r,t.length])].sort((a,s)=>a-s),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function F1(t,e){let{levels:r,paragraphs:i}=sc.getEmbeddingLevels(t);return n3(t,e.concat(i.map(n=>n.start))).map(([n,a])=>i3(t,r,r3(i,n),n,a))}function a3(t,e){return F1(t,e).map(r=>r.text)}function s3(t,e,r){return F1(t,r).map(i=>[i.text,i.sourceIndices.map(n=>e[n]??0)])}var Jl=4294967296,Np=1/Jl,Up=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf-8\"),M1=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Jl;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Jl;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,l3(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Up?Up.decode(this.buf.subarray(e,t)):_3(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},o3=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){let r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Np),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Np),!0),this.pos+=8}writeVarint(t){t=+t||0,t>=0&&t<128?(this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t):t>268435455||t<0?c3(t,this):(this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),t<=127||(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),t<=127||(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=D3(this.buf,t,this.pos);let r=this.pos-e;r>=128&&jp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&jp(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,f3,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,d3,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,g3,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,y3,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,m3,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,x3,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,v3,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,b3,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,w3,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function l3(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return u3(t,n,e);throw Error(\"Expected varint not more than 10 bytes\")}function u3(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function c3(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error(\"Given varint doesn't fit into 10 bytes\");e.realloc(10),h3(r,i,e),p3(i,e)}function h3(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function p3(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function jp(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function f3(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;s<r;s++){let o=t[s];if(o<0||n+10>a)e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;else{for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}}e.pos=n}function d3(t,e){for(let r=0;r<t.length;r++)e.writeSVarint(t[r])}function y3(t,e){for(let r=0;r<t.length;r++)e.writeFloat(t[r])}function m3(t,e){for(let r=0;r<t.length;r++)e.writeDouble(t[r])}function g3(t,e){for(let r=0;r<t.length;r++)e.writeBoolean(t[r])}function x3(t,e){for(let r=0;r<t.length;r++)e.writeFixed32(t[r])}function v3(t,e){for(let r=0;r<t.length;r++)e.writeSFixed32(t[r])}function b3(t,e){for(let r=0;r<t.length;r++)e.writeFixed64(t[r])}function w3(t,e){for(let r=0;r<t.length;r++)e.writeSFixed64(t[r])}function _3(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,c;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],c=t[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function D3(t,e,r){for(let i=0,n,a;i<e.length;i++){if(n=e.charCodeAt(i),n>55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function S3(t){return typeof t?.renderWithWebGL==\"function\"}function P1(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o<i.length&&(i[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(i.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:n,h:a,fill:e/(n*a)||0}}var B1=class{constructor(t,{pixelRatio:e,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},L1=class{constructor(t,e){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(t,r,n),this.addImages(e,i,n);let{w:a,h:s}=P1(n),o=new ae({width:a||1,height:s||1});for(let l in t){let u=t[l];if(u.isWebGLImage)continue;let c=r[l].paddedRect;ae.copy(u.data,o,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(let l in e){let u=e[l],c=i[l].paddedRect,h=c.x+1,p=c.y+1,f=u.data.width,d=u.data.height;ae.copy(u.data,o,{x:0,y:0},{x:h,y:p},u.data),ae.copy(u.data,o,{x:0,y:d-1},{x:h,y:p-1},{width:f,height:1}),ae.copy(u.data,o,{x:0,y:0},{x:h,y:p+d},{width:f,height:1}),ae.copy(u.data,o,{x:f-1,y:0},{x:h-1,y:p},{width:1,height:d}),ae.copy(u.data,o,{x:0,y:0},{x:h+f,y:p},{width:1,height:d})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(t,e,r){for(let i in t){let n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new B1(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(t,e){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){this.patchedUpdateVersion=t.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}}patchUpdatedImage(t,e,r){if(!t||!e||!t.needsFirstWebGLRender&&t.version===e.version)return;t.needsFirstWebGLRender=!1,t.version=e.version;let[i,n]=t.tl,a=e.userImage?.data;if(!S3(a)){r.update(e.data,void 0,{x:i,y:n});return}let{width:s,height:o}=e.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};B(\"ImagePosition\",B1),B(\"ImageAtlas\",L1);var z1=(function(t){return t[t.none=0]=\"none\",t[t.horizontal=1]=\"horizontal\",t[t.vertical=2]=\"vertical\",t[t.horizontalOnly=3]=\"horizontalOnly\",t})(z1||{});function A3(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}function E3(t,e){let r=[],i=0;for(let n of e)r.push(t.substring(i,n)),i=n;return i<t.length()&&r.push(t.substring(i,t.length())),r}var qp=/^\\p{gc=M}$/u;function T3(t){let e=[],r=0;for(;r<t.length;){if(!qp.test(t[r])){e.push(r),r++;continue}let i=r;for(;i<t.length&&qp.test(t[i]);)i++;let n=t[i];if(n!==void 0&&I1(n.codePointAt(0))){e.push(i);for(let a=i-1;a>=r;a--)e.push(a);r=i+1}else{for(let a=r;a<i;a++)e.push(a);r=i}}return e}function I3(t){let e=[],r=0;for(let i of t.graphemes())e.push(...Array(i.length).fill(t.sectionIndex[r])),r++;return e}function k3(t,e){let r=e.map(a=>t.toCodeUnitIndex(a)),i=Ei.isParsed()?Ei:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>Gp(a,t.sections,[...a].map(()=>0))):a3(t.toString(),r).map(a=>Ql([...a],t.sections,[...a].map(()=>0)));let n=I3(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>Gp(a,t.sections,s)):s3(t.text,n,r).map(([a,s])=>{let o=[...a];return Ql(o,t.sections,V1(o).map(l=>s[l]??0))})}function Ql(t,e,r){let i=new ac(t.join(\"\"),e,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function V1(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function Gp(t,e,r){let i=[...t],n=V1(i),a=T3(i);return Ql(a.map(s=>i[s]),e,a.map(s=>r[n[s]]??0))}function Sa(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d){let y=ac.fromFeature(t,n,h===2,e),m=y.determineLineBreaks(u,a,e,i,f),g=k1(y.text)?k3(y,m):E3(y,m),v=[],x={positionedLines:v,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return B3(x,e,r,i,g,s,o,l,h,u,p,d),!A3(v)&&x}function O1(t){let e=.5,r=.5;switch(t){case\"right\":case\"top-right\":case\"bottom-right\":e=1;break;case\"left\":case\"top-left\":case\"bottom-left\":e=0}switch(t){case\"bottom\":case\"bottom-right\":case\"bottom-left\":r=1;break;case\"top\":case\"top-right\":case\"top-left\":r=0}return{horizontalAlign:e,verticalAlign:r}}function C3(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function R1(t){switch(t){case\"top\":return 0;case\"center\":return .5;default:return 1}}function F3(t,e){return t?.rect?t:e?{rect:null,metrics:e.metrics}:null}function $1(t,e,r){return!(t===1||!e&&!Xn(r)||e&&(zn(r)||T1(r)))}function Va(t){return/\\p{Nd}/u.test(String.fromCodePoint(t))}function N1(t){return/\\p{Lu}/u.test(String.fromCodePoint(t))}function U1(t){let e=t.some(Va)&&t.every(i=>Va(i)||Cs(i)),r=t.length<=3&&t.every(i=>N1(i)||Va(i));return e||r}function j1(t){return(Va(t)||N1(t))&&!T1(t)}function M3(t,e){return e?$1(2,!0,t):!Ti(t)||j1(t)||Cs(t)}function P3(t,e,r){let i=!1;for(let n=0;n<t.length;n++){if(e[n])continue;let a=oi[t[n]];if(a&&(n===0||e[n-1])&&(n===t.length-1||e[n+1])){if(e[n]=!0,r[n])continue;t[n]=a,i=!0}}return i}function Xp(t,e,r){for(;e>=0&&e<t.length&&zn(t[e]);)e+=r;let i=[];for(;e>=0&&e<t.length&&!Xn(t[e])&&!zn(t[e]);)i.push(t[e]),e+=r;return!U1(i)&&!i.every(Cs)&&i.some(Ti)}function q1(t,e){let r=t.graphemes().slice(),i=r.map(o=>o.codePointAt(0)),n=r.map((o,l)=>{let u=t.getSection(l);return\"fontStack\"in u&&!!e[u.fontStack]?.vertical?.[o]}),a=i.map(Xn),s=o=>!a[o]&&!zn(i[o])&&!(\"imageName\"in t.getSection(o));for(let o=0;o<i.length;o++){if(!s(o))continue;let l=o;for(;l+1<i.length&&s(l+1);)l++;let u=i.slice(o,l+1),c=U1(u),h=u.every(Cs),p=h&&(Xp(i,o-1,-1)||Xp(i,l+1,1)),f=!c&&u.some(Ti);for(let d=o;d<=l;d++)a[d]=c&&j1(i[d])||n[d]&&!p&&(h||!f&&!Ti(i[d]));o=l}if(n.some((o,l)=>o&&!a[l])){let o=t.text;if(t.verticalizePunctuation(e,a),t.text!==o)return q1(t,e)}return P3(r,a,n)&&(t.text=r.join(\"\"),t.cachedGraphemes=r),a}function B3(t,e,r,i,n,a,s,o,l,u,c,h){let p=0,f=0,d=0,y=0,m=o===\"right\"?1:o===\"left\"?0:.5,g=24/h,v=0;for(let w of n){w.trim();let _=w.getMaxScale(),S={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=S;let A=S.positionedGlyphs,E=0;if(!w.length()){f+=a,++v;continue}let R=C3(i,w,g),M=l===2&&!c?q1(w,e):null,V=w.graphemes();for(let C=0;C<V.length;C++){let L=w.getSection(C),O=V[C],j=O.codePointAt(0),nt=M?M[C]:$1(l,c,j),ot=\"fontStack\"in L&&Zl(O)&&!e[L.fontStack]?.default?.[O]?[...O]:[O];for(let pt of ot){let lt={glyph:pt.codePointAt(0),grapheme:pt,imageName:null,x:p,y:f+-17,vertical:nt,scale:1,fontStack:\"\",sectionIndex:w.getSectionIndex(C),metrics:null,rect:null},gt;if(\"fontStack\"in L){if(gt=L3(L,pt,nt,R,e,r),!gt)continue;lt.fontStack=L.fontStack}else{if(t.iconsInText=!0,L.scale*=g,gt=z3(L,nt,_,R,i),!gt)continue;E=Math.max(E,gt.imageOffset),lt.imageName=L.imageName}let{rect:ue,metrics:ce,baselineOffset:wr}=gt;if(lt.y+=wr,lt.scale=L.scale,lt.metrics=ce,lt.rect=ue,A.push(lt),!nt)p+=ce.advance*L.scale+u;else{t.verticalizable=!0;let ee=\"imageName\"in L?ce.advance:24;p+=ee*L.scale+u}}}if(A.length!==0){let C=p-u;d=Math.max(C,d),V3(A,0,A.length-1,m)}p=0;let U=(_-1)*24;S.lineOffset=Math.max(E,U);let k=a*_+E;f+=k,y=Math.max(k,y),++v}let{horizontalAlign:x,verticalAlign:b}=O1(s);O3(t.positionedLines,m,x,b,d,y,a,f,n.length),t.top+=-b*f,t.bottom=t.top+f,t.left+=-x*d,t.right=t.left+d}function L3(t,e,r,i,n,a){let s=r&&n[t.fontStack]?.vertical?.[e]?\"vertical\":\"default\",o=a[t.fontStack]?.[s]?.[e],l=n[t.fontStack]?.[s]?.[e],u=F3(o,l);if(u===null)return null;let c;if(r)c=i.verticalLineContentWidth-t.scale*24;else{let h=R1(t.verticalAlign);c=(i.horizontalLineContentHeight-t.scale*24)*h}return{rect:u.rect,metrics:u.metrics,baselineOffset:c}}function z3(t,e,r,i,n){let a=n[t.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:e?o[1]:o[0]},u;if(e)u=i.verticalLineContentWidth-o[1]*t.scale;else{let h=R1(t.verticalAlign);u=(i.horizontalLineContentHeight-o[1]*t.scale)*h}let c=(e?o[0]:o[1])*t.scale-24*r;return{rect:s,metrics:l,baselineOffset:u,imageOffset:c}}function V3(t,e,r,i){if(i===0)return;let n=t[r],a=n.metrics.advance*n.scale,s=(t[r].x+a)*i;for(let o=e;o<=r;o++)t[o].x-=s}function O3(t,e,r,i,n,a,s,o,l){let u=(e-r)*n,c=0;c=a===s?-i*l*s+.5*s:-o*i- -17;for(let h of t)for(let p of h.positionedGlyphs)p.x+=u,p.y+=c}function R3(t,e,r){let{horizontalAlign:i,verticalAlign:n}=O1(r),a=e[0],s=e[1],o=a-t.displaySize[0]*i,l=o+t.displaySize[0],u=s-t.displaySize[1]*n;return{image:t,top:u,bottom:u+t.displaySize[1],left:o,right:l}}function G1(t){let e=t.left,r=t.top,i=t.right-e,n=t.bottom-r,a=t.image.content[2]-t.image.content[0],s=t.image.content[3]-t.image.content[1],o=t.image.textFitWidth??\"stretchOrShrink\",l=t.image.textFitHeight??\"stretchOrShrink\",u=a/s;if(l===\"proportional\"){if(o===\"stretchOnly\"&&i/n<u||o===\"proportional\"){let c=Math.ceil(n*u);e*=c/i,i=c}}else if(o===\"proportional\"&&l===\"stretchOnly\"&&u!==0&&i/n>u){let c=Math.ceil(i/u);r*=c/n,n=c}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Yp(t,e,r,i,n,a,s=1){let o=t.image,l;if(o.content){let x=o.content,b=o.pixelRatio||1;l=[x[0]/b,x[1]/b,o.displaySize[0]-x[2]/b,o.displaySize[1]-x[3]/b]}let u=s>0?a/s:a,c=s>0?1/s:1,h=e.left*u,p=e.right*u,f,d,y,m;r===\"width\"||r===\"both\"?(m=n[0]+h-i[3]*c,d=n[0]+p+i[1]*c):(m=n[0]+(h+p-o.displaySize[0])/2,d=m+o.displaySize[0]);let g=e.top*u,v=e.bottom*u;return r===\"height\"||r===\"both\"?(f=n[1]+g-i[0]*c,y=n[1]+v+i[2]*c):(f=n[1]+(g+v-o.displaySize[1])/2,y=f+o.displaySize[1]),{image:o,top:f,right:d,bottom:y,left:m,collisionPadding:l}}var Wp=32640;function Zp(t,e){let{expression:r}=e;if(r.kind===\"constant\")return{kind:\"constant\",layoutSize:r.evaluate(new ut(t+1))};if(r.kind===\"source\")return{kind:\"source\"};if(r.kind===\"composite\"){let{minZoom:i,maxZoom:n}=$3(r.zoomStops,t);return{kind:\"composite\",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=N3(r),n=r.evaluate(new ut(t+1));return{kind:\"camera\",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function $3(t,e){let r=0;for(;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);let i=r;for(;i<t.length&&t[i]<e+1;)i++;return i=Math.min(t.length-1,i),{minZoom:t[r],maxZoom:t[i]}}function N3(t){return t.zoomStops.map(e=>t.evaluate(new ut(e===-1/0?t.zoomStops[1]-1:e)))}var fi=class X1 extends T{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new X1(this.x,this.y,this.angle,this.segment)}};B(\"Anchor\",fi);function Y1(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;o<r/2;){let c=t[s-1],h=t[s],p=t[s+1];if(!p)return!1;let f=c.angleTo(h)-h.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:f}),u+=f;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=h.dist(p)}return!0}function W1(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Z1(t,e,r){return t?3/5*e*r:0}function H1(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function U3(t,e,r,i,n,a){let s=Z1(r,n,a),o=H1(r,i)*a,l=0,u=W1(t)/2;for(let c=0;c<t.length-1;c++){let h=t[c],p=t[c+1],f=h.dist(p);if(l+f>u){let d=(u-l)/f,y=new fi(Je.number(h.x,p.x,d),Je.number(h.y,p.y,d),p.angleTo(h),c);return y._round(),!s||Y1(t,y,o,s,e)?y:void 0}l+=f}}function j3(t,e,r,i,n,a,s,o,l){let u=Z1(i,a,s),c=H1(i,n),h=c*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-h<e/4&&(e=h+e/4);let f=a*2;return K1(t,p?e/2*o%e:(c/2+f)*s*o%e,e,u,r,h,p,!1,l)}function K1(t,e,r,i,n,a,s,o,l){let u=a/2,c=W1(t),h=0,p=e-r,f=[];for(let d=0;d<t.length-1;d++){let y=t[d],m=t[d+1],g=y.dist(m),v=m.angleTo(y);for(;p+r<h+g;){p+=r;let x=(p-h)/g,b=Je.number(y.x,m.x,x),w=Je.number(y.y,m.y,x);if(b>=0&&b<l&&w>=0&&w<l&&p-u>=0&&p+u<=c){let _=new fi(b,w,v,d);_._round(),(!i||Y1(t,_,a,i,n))&&f.push(_)}}h+=g}return o||f.length||s||(f=K1(t,h/2,r,i,n,a,s,!0,l)),f}function q3(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l<s.length-1;l++){let u=s[l],c=s[l+1];u.x<e&&c.x<e||(u.x<e?u=new T(e,u.y+(c.y-u.y)*((e-u.x)/(c.x-u.x)))._round():c.x<e&&(c=new T(e,u.y+(c.y-u.y)*((e-u.x)/(c.x-u.x)))._round()),u.y<r&&c.y<r||(u.y<r?u=new T(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round():c.y<r&&(c=new T(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round()),u.x>=i&&c.x>=i||(u.x>=i?u=new T(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new T(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),u.y>=n&&c.y>=n||(u.y>=n?u=new T(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round():c.y>=n&&(c=new T(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round()),o&&u.equals(o[o.length-1])||(o=[u],a.push(o)),o.push(c)))))}}return a}function G3(t,e,r,i,n,a){let s=Hp(t,e,r,n,0);return s=Hp(s,e,i,a,1),s}function Hp(t,e,r,i,n){switch(e){case 1:return X3(t,r,i,n);case 2:return Kp(t,r,i,n,!1);case 3:return Kp(t,r,i,n,!0)}return[]}function X3(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function Y3(t,e,r,i,n){let a=i===0?W3:Z3,s=[],o=[];for(let c=0;c<t.length-1;c++){let h=t[c],p=t[c+1],f=i===0?h.x:h.y,d=i===0?p.x:p.y,y=!1;f<e?d>=e&&s.push(a(h,p,e)):f>r?d<=r&&s.push(a(h,p,r)):s.push(h),d<e&&f>=e&&(s.push(a(h,p,e)),y=!0),d>r&&f<=r&&(s.push(a(h,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new T(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Kp(t,e,r,i,n){let a=[];for(let s of t){let o=Y3(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function W3(t,e,r){let i=(r-t.x)/(e.x-t.x);return new T(r,t.y+(e.y-t.y)*i)}function Z3(t,e,r){let i=(r-t.y)/(e.y-t.y);return new T(t.x+(e.x-t.x)*i,r)}function Jp(t,e,r,i,n=1){let a=[],s=t.image,o=s.pixelRatio,l=s.paddedRect.w-2,u=s.paddedRect.h-2,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=s.stretchX||[[0,l]],p=s.stretchY||[[0,u]],f=(C,L)=>C+L[1]-L[0],d=h.reduce(f,0),y=p.reduce(f,0),m=l-d,g=u-y,v=0,x=d,b=0,w=y,_=0,S=m,A=0,E=g;if(s.content&&i){let C=s.content,L=C[2]-C[0],O=C[3]-C[1];(s.textFitWidth||s.textFitHeight)&&(c=G1(t)),v=Aa(h,0,C[0]),b=Aa(p,0,C[1]),x=Aa(h,C[0],C[2]),w=Aa(p,C[1],C[3]),_=C[0]-v,A=C[1]-b,S=L-x,E=O-w}let R=c.x1,M=c.y1,V=c.x2-R,U=c.y2-M,k=(C,L,O,j)=>{let nt=Ea(C.stretch-v,x,V,R),ot=Ta(C.fixed-_,S,C.stretch,d),pt=Ea(L.stretch-b,w,U,M),lt=Ta(L.fixed-A,E,L.stretch,y),gt=Ea(O.stretch-v,x,V,R),ue=Ta(O.fixed-_,S,O.stretch,d),ce=Ea(j.stretch-b,w,U,M),wr=Ta(j.fixed-A,E,j.stretch,y),ee=new T(nt,pt),qr=new T(gt,pt),Gr=new T(gt,ce),tr=new T(nt,ce),Ee=n/o,_r=new T(ot*Ee,lt*Ee),Pi=new T(ue*Ee,wr*Ee),Vt=e*Math.PI/180;if(Vt){let it=Math.sin(Vt),F=Math.cos(Vt),Q=[F,-it,it,F];ee._matMult(Q),qr._matMult(Q),tr._matMult(Q),Gr._matMult(Q)}let Ue=C.stretch+C.fixed,Dr=O.stretch+O.fixed,$=L.stretch+L.fixed,st=j.stretch+j.fixed;return{tl:ee,tr:qr,bl:tr,br:Gr,tex:{x:s.paddedRect.x+1+Ue,y:s.paddedRect.y+1+$,w:Dr-Ue,h:st-$},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:_r,pixelOffsetBR:Pi,minFontScaleX:S*Ee/V,minFontScaleY:E*Ee/U,isSDF:r}};if(!i||!s.stretchX&&!s.stretchY)a.push(k({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));else{let C=Qp(h,m,d),L=Qp(p,g,y);for(let O=0;O<C.length-1;O++){let j=C[O],nt=C[O+1];for(let ot=0;ot<L.length-1;ot++){let pt=L[ot],lt=L[ot+1];a.push(k(j,pt,nt,lt))}}}return a}function Aa(t,e,r){let i=0;for(let n of t)i+=Math.max(e,Math.min(r,n[1]))-Math.max(e,Math.min(r,n[0]));return i}function Qp(t,e,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of t){let s=i[i.length-1];i.push({fixed:n-s.stretch,stretch:s.stretch}),i.push({fixed:n-s.stretch,stretch:s.stretch+(a-n)})}return i.push({fixed:e+1,stretch:r}),i}function Ea(t,e,r,i){return t/e*r+i}function Ta(t,e,r,i){return t-e*r/i}function H3(t,e,r,i,n,a,s,o){let l=i.layout.get(\"text-rotate\").evaluate(a,{})*Math.PI/180,u=[];for(let c of e.positionedLines)for(let h of c.positionedGlyphs){if(!h.rect)continue;let p=h.rect||{},f=4,d=!0,y=1,m=0,g=(n||o)&&h.vertical,v=h.metrics.advance*h.scale/2;if(o&&e.verticalizable){let O=(h.scale-1)*24,j=(24-h.metrics.width*h.scale)/2;m=c.lineOffset/2-(h.imageName?-j:O)}if(h.imageName){let O=s[h.imageName];d=O.sdf,y=O.pixelRatio,f=1/y}let x=n?[h.x+v,h.y]:[0,0],b=n?[0,0]:[h.x+v+r[0],h.y+r[1]-m],w=[0,0];g&&(w=b,b=[0,0]);let _=h.metrics.isDoubleResolution?2:1,S=(h.metrics.left-f)*h.scale-v+b[0],A=(-h.metrics.top-f)*h.scale+b[1],E=S+p.w/_*h.scale/y,R=A+p.h/_*h.scale/y,M=new T(S,A),V=new T(E,A),U=new T(S,R),k=new T(E,R);if(g){let O=new T(-v,v- -17),j=-Math.PI/2,nt=12-v,ot=h.imageName?nt:0,pt=new T(22-nt,-ot),lt=new T(...w);M._rotateAround(j,O)._add(pt)._add(lt),V._rotateAround(j,O)._add(pt)._add(lt),U._rotateAround(j,O)._add(pt)._add(lt),k._rotateAround(j,O)._add(pt)._add(lt)}if(l){let O=Math.sin(l),j=Math.cos(l),nt=[j,-O,O,j];M._matMult(nt),V._matMult(nt),U._matMult(nt),k._matMult(nt)}let C=new T(0,0),L=new T(0,0);u.push({tl:M,tr:V,bl:U,br:k,tex:p,writingMode:e.writingMode,glyphOffset:x,sectionIndex:h.sectionIndex,isSDF:d,pixelOffsetTL:C,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}return u}var Ia=class{constructor(t,e,r,i,n,a,s,o,l,u){if(this.boxStartIndex=t.length,l){let c=a.top,h=a.bottom,p=a.collisionPadding;p&&(c-=p[1],h+=p[3]);let f=h-c;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{let c=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?G1(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let h=a.collisionPadding;if(h&&(c.x1-=h[0]*s,c.y1-=h[1]*s,c.x2+=h[2]*s,c.y2+=h[3]*s),u){let p=new T(c.x1,c.y1),f=new T(c.x2,c.y1),d=new T(c.x1,c.y2),y=new T(c.x2,c.y2),m=u*Math.PI/180;p._rotate(m),f._rotate(m),d._rotate(m),y._rotate(m),c.x1=Math.min(p.x,f.x,d.x,y.x),c.x2=Math.max(p.x,f.x,d.x,y.x),c.y1=Math.min(p.y,f.y,d.y,y.y),c.y2=Math.max(p.y,f.y,d.y,y.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},K3=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function J3(t,e=1){let r=Cn.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new K3([],Q3),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new T(s,o);for(let p=s;p<l;p+=i)for(let f=o;f<u;f+=i)a.push(new ni(p+n,f+n,n,t));let c=e6(t),h=c;for(;a.length;){let p=a.pop();(p.d>h.d||!h.d)&&(h=p),p.max-h.d<=e||(n=p.h/2,a.push(new ni(p.p.x-n,p.p.y-n,n,t)),a.push(new ni(p.p.x+n,p.p.y-n,n,t)),a.push(new ni(p.p.x-n,p.p.y+n,n,t)),a.push(new ni(p.p.x+n,p.p.y+n,n,t)))}return c.d>0&&h.d-c.d<=e?c.p:h.p}function Q3(t,e){return e.max-t.max}var ni=class{constructor(t,e,r,i){this.p=new T(t,e),this.h=r,this.d=t6(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function t6(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,Ey(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function e6(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,i+=(l.y+u.y)*c,e+=c*3}return new ni(r/e,i/e,0,t)}var r6=(function(t){return t[t.center=1]=\"center\",t[t.left=2]=\"left\",t[t.right=3]=\"right\",t[t.top=4]=\"top\",t[t.bottom=5]=\"bottom\",t[t[\"top-left\"]=6]=\"top-left\",t[t[\"top-right\"]=7]=\"top-right\",t[t[\"bottom-left\"]=8]=\"bottom-left\",t[t[\"bottom-right\"]=9]=\"bottom-right\",t})({}),oc=1/0;function J1(t,e){function r(n,a){let s=0,o=0;a<0&&(a=0);let l=a/Math.SQRT2;switch(n){case\"top-right\":case\"top-left\":o=l-7;break;case\"bottom-right\":case\"bottom-left\":o=-l+7;break;case\"bottom\":o=-a+7;break;case\"top\":o=a-7}switch(n){case\"top-right\":case\"bottom-right\":s=-l;break;case\"top-left\":case\"bottom-left\":s=l;break;case\"left\":s=a;break;case\"right\":s=-a}return[s,o]}function i(n,a,s){let o=0,l=0;switch(a=Math.abs(a),s=Math.abs(s),n){case\"top-right\":case\"top-left\":case\"top\":l=s-7;break;case\"bottom-right\":case\"bottom-left\":case\"bottom\":l=-s+7}switch(n){case\"top-right\":case\"bottom-right\":case\"right\":o=-a;break;case\"top-left\":case\"bottom-left\":case\"left\":o=a}return[o,l]}return e[1]===oc?r(t,e[0]):i(t,e[0],e[1])}function Q1(t,e,r){let i=t.layout,n=i.get(\"text-variable-anchor-offset\")?.evaluate(e,{},r);if(n){let s=n.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],c=s[l+1].map(h=>h*24);u.startsWith(\"top\")?c[1]-=7:u.startsWith(\"bottom\")&&(c[1]+=7),o[l+1]=c}return new Oe(o)}let a=i.get(\"text-variable-anchor\");if(a){let s;s=t._unevaluatedLayout.getValue(\"text-radial-offset\")===void 0?i.get(\"text-offset\").evaluate(e,{},r).map(l=>l*24):[i.get(\"text-radial-offset\").evaluate(e,{},r)*24,oc];let o=[];for(let l of a)o.push(l,J1(l,s));return new Oe(o)}return null}function i6(t){var c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=rt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n[\"icon-size\"].possiblyEvaluate(new ut(t.bucket.zoom+1),t.canonical),layoutTextSize:n[\"text-size\"].possiblyEvaluate(new ut(t.bucket.zoom+1),t.canonical),textMaxSize:n[\"text-size\"].possiblyEvaluate(new ut(18))};if(t.bucket.textSizeData.kind===\"composite\"){let{minZoom:h,maxZoom:p}=t.bucket.textSizeData;a.compositeTextSizes=[n[\"text-size\"].possiblyEvaluate(new ut(h),t.canonical),n[\"text-size\"].possiblyEvaluate(new ut(p),t.canonical)]}if(t.bucket.iconSizeData.kind===\"composite\"){let{minZoom:h,maxZoom:p}=t.bucket.iconSizeData;a.compositeIconSizes=[n[\"icon-size\"].possiblyEvaluate(new ut(h),t.canonical),n[\"icon-size\"].possiblyEvaluate(new ut(p),t.canonical)]}let s=i.get(\"text-line-height\")*24,o=i.get(\"text-rotation-alignment\")!==\"viewport\"&&i.get(\"symbol-placement\")!==\"point\",l=i.get(\"text-keep-upright\"),u=i.get(\"text-size\");for(let h of t.bucket.features){let p=i.get(\"text-font\").evaluate(h,{},t.canonical).join(\",\"),f=u.evaluate(h,{},t.canonical),d=a.layoutTextSize.evaluate(h,{},t.canonical),y=a.layoutIconSize.evaluate(h,{},t.canonical),m={horizontal:{},vertical:void 0},g=h.text,v=[0,0];if(g){let _=g.toString(),S=i.get(\"text-letter-spacing\").evaluate(h,{},t.canonical)*24,A=E1(_)?S:0,E=i.get(\"text-anchor\").evaluate(h,{},t.canonical),R=Q1(r,h,t.canonical);if(!R){let k=i.get(\"text-radial-offset\").evaluate(h,{},t.canonical);v=k?J1(E,[k*24,oc]):i.get(\"text-offset\").evaluate(h,{},t.canonical).map(C=>C*24)}let M=o?\"center\":i.get(\"text-justify\").evaluate(h,{},t.canonical),V=i.get(\"symbol-placement\")===\"point\"?i.get(\"text-max-width\").evaluate(h,{},t.canonical)*24:1/0,U=()=>{t.bucket.allowVerticalPlacement&&Hl(_)&&(m.vertical=Sa(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,E,\"left\",A,v,2,!0,d,f))};if(!o&&R){let k=new Set;if(M===\"auto\")for(let L=0;L<R.values.length;L+=2)k.add(tf(R.values[L]));else k.add(M);let C=!1;for(let L of k)if(!m.horizontal[L])if(C)m.horizontal[L]=m.horizontal[0];else{let O=Sa(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,\"center\",L,A,v,1,!1,d,f);O&&(m.horizontal[L]=O,C=O.positionedLines.length===1)}U()}else{M===\"auto\"&&(M=tf(E));let k=Sa(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,E,M,A,v,1,!1,d,f);k&&(m.horizontal[M]=k),U(),Hl(_)&&o&&l&&(m.vertical=Sa(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,V,s,E,M,A,v,2,!1,d,f))}}let x,b=!1;if(h.icon?.name){let _=t.imageMap[h.icon.name];_&&(x=R3(t.imagePositions[h.icon.name],i.get(\"icon-offset\").evaluate(h,{},t.canonical),i.get(\"icon-anchor\").evaluate(h,{},t.canonical)),b=!!_.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=b:t.bucket.sdfIcons!==b&&Pt(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),_.pixelRatio===t.bucket.pixelRatio?i.get(\"icon-rotate\").constantOr(1)!==0&&(t.bucket.iconsNeedLinear=!0):t.bucket.iconsNeedLinear=!0)}let w=t0(m.horizontal)||m.vertical;(c=t.bucket).iconsInText||(c.iconsInText=w?w.iconsInText:!1),(w||x)&&n6(t.bucket,h,m,x,t.imageMap,a,d,y,v,b,t.canonical,t.subdivisionGranularity,t.hasPromoteId)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function tf(t){switch(t){case\"right\":case\"top-right\":case\"bottom-right\":return\"right\";case\"left\":case\"top-left\":case\"bottom-left\":return\"left\"}return\"center\"}function n6(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=a.textMaxSize.evaluate(e,{});f===void 0&&(f=s);let d=t.layers[0].layout,y=d.get(\"icon-offset\").evaluate(e,{},c),m=t0(r.horizontal),g=s/24,v=t.tilePixelRatio*g,x=t.tilePixelRatio*f/24,b=t.tilePixelRatio*o,w=t.tilePixelRatio*d.get(\"symbol-spacing\"),_=d.get(\"text-padding\")*t.tilePixelRatio,S=x6(d,e,c,t.tilePixelRatio),A=d.get(\"text-max-angle\")/180*Math.PI,E=d.get(\"text-rotation-alignment\")!==\"viewport\"&&d.get(\"symbol-placement\")!==\"point\",R=d.get(\"icon-rotation-alignment\").constantOr(\"viewport\")===\"map\"&&d.get(\"symbol-placement\")!==\"point\",M=d.get(\"symbol-placement\"),V=w/2,U=d.get(\"icon-text-fit\"),k;i&&U!==\"none\"&&(t.allowVerticalPlacement&&r.vertical&&(k=Yp(i,r.vertical,U,d.get(\"icon-text-fit-padding\"),y,g,o)),m&&(i=Yp(i,m,U,d.get(\"icon-text-fit-padding\"),y,g,o)));let C=c?h.line.getGranularityForZoomLevel(c.z):1,L=(O,j)=>{Uu(j)||s6(t,j,O,r,i,n,k,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,[_,_,_,_],E,l,b,S,R,y,e,a,u,c,s,o,p)};if(M===\"line\")for(let O of q3(e.geometry,0,0,rt,rt)){let j=Fr(O,C),nt=j3(j,w,A,r.vertical||m,i,24,x,t.overscaling,rt);for(let ot of nt){let pt=m;pt&&o6(t,pt.text,V,ot)||L(j,ot)}}else if(M===\"line-center\"){for(let O of e.geometry)if(O.length>1){let j=Fr(O,C),nt=U3(j,A,r.vertical||m,i,24,x);nt&&L(j,nt)}}else if(e.type===\"Polygon\")for(let O of ms(e.geometry,0)){let j=J3(O,16);L(Fr(O[0],C,!0),new fi(j.x,j.y,0))}else if(e.type===\"LineString\")for(let O of e.geometry){let j=Fr(O,C);L(j,new fi(j[0].x,j[0].y,0))}else if(e.type===\"Point\")for(let O of e.geometry)for(let j of O)L([j],new fi(j.x,j.y,0))}function a6(t,e){let r=t.length,i=e?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=r6[i[n]],s=i[n+1];t.emplaceBack(a,s[0],s[1])}return[r,t.length]}function ef(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y){let m=H3(e,r,o,n,a,s,i,t.allowVerticalPlacement),g=t.textSizeData,v=null;g.kind===\"source\"?(v=[128*n.layout.get(\"text-size\").evaluate(s,{})],v[0]>32640&&Pt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):g.kind===\"composite\"&&(v=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(v[0]>32640||v[1]>32640)&&Pt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),t.addSymbols(t.text,m,v,o,a,s,c,e,u.lineStartIndex,u.lineLength,f,y,l);for(let x of h)p[x]=t.text.placedSymbolArray.length-1;return m.length*4}function t0(t){for(let e in t)return t[e];return null}function s6(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,v,x,b,w,_,S,A,E,R){let M=t.addToLineVertexArray(e,r),V=o.layout.get(\"symbol-height-offset\").evaluate(b,{},S);V>t.maxHeightOffset&&(t.maxHeightOffset=V);let U,k,C,L,O=0,j=0,nt=0,ot=0,pt=-1,lt=-1,gt={},ue=(0,Ka.default)(\"\");if(t.allowVerticalPlacement&&i.vertical){let F=o.layout.get(\"text-rotate\").evaluate(b,{},S)+90,Q=i.vertical;C=new Ia(l,e,u,c,h,Q,p,f,d,F),s&&(L=new Ia(l,e,u,c,h,s,m,g,d,F))}if(n){let F=o.layout.get(\"icon-rotate\").evaluate(b,{}),Q=o.layout.get(\"icon-text-fit\")!==\"none\",G=Jp(n,F,_,Q,E),H=s?Jp(s,F,_,Q,E):void 0;k=new Ia(l,e,u,c,h,n,m,g,!1,F),O=G.length*4;let X=t.iconSizeData,xt=null;X.kind===\"source\"?(xt=[128*o.layout.get(\"icon-size\").evaluate(b,{})],xt[0]>32640&&Pt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):X.kind===\"composite\"&&(xt=[128*w.compositeIconSizes[0].evaluate(b,{},S),128*w.compositeIconSizes[1].evaluate(b,{},S)],(xt[0]>32640||xt[1]>32640)&&Pt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),t.addSymbols(t.icon,G,xt,x,v,b,0,e,M.lineStartIndex,M.lineLength,-1,S,V),pt=t.icon.placedSymbolArray.length-1,H&&(j=H.length*4,t.addSymbols(t.icon,H,xt,x,v,b,2,e,M.lineStartIndex,M.lineLength,-1,S,V),lt=t.icon.placedSymbolArray.length-1)}let ce=Object.keys(i.horizontal);for(let F of ce){let Q=i.horizontal[F];U||(U=(ue=(0,Ka.default)(Q.text),new Ia(l,e,u,c,h,Q,p,f,d,o.layout.get(\"text-rotate\").evaluate(b,{},S))));let G=Q.positionedLines.length===1;if(nt+=ef(t,e,Q,a,o,d,b,y,V,M,i.vertical?1:3,G?ce:[F],gt,pt,w,S),G)break}i.vertical&&(ot+=ef(t,e,i.vertical,a,o,d,b,y,V,M,2,[\"vertical\"],gt,lt,w,S));let wr=U?U.boxStartIndex:t.collisionBoxArray.length,ee=U?U.boxEndIndex:t.collisionBoxArray.length,qr=C?C.boxStartIndex:t.collisionBoxArray.length,Gr=C?C.boxEndIndex:t.collisionBoxArray.length,tr=k?k.boxStartIndex:t.collisionBoxArray.length,Ee=k?k.boxEndIndex:t.collisionBoxArray.length,_r=L?L.boxStartIndex:t.collisionBoxArray.length,Pi=L?L.boxEndIndex:t.collisionBoxArray.length,Vt=-1,Ue=(F,Q)=>F?.circleDiameter?Math.max(F.circleDiameter,Q):Q;Vt=Ue(U,Vt),Vt=Ue(C,Vt),Vt=Ue(k,Vt),Vt=Ue(L,Vt);let Dr=+(Vt>-1);Dr&&(Vt*=A/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Pt(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let $=Q1(o,b,S),[st,it]=a6(t.textAnchorOffsets,$);R&&(ue=l6(ue,b)),t.symbolInstances.emplaceBack(e.x,e.y,gt.right>=0?gt.right:-1,gt.center>=0?gt.center:-1,gt.left>=0?gt.left:-1,gt.vertical||-1,pt,lt,ue,wr,ee,qr,Gr,tr,Ee,_r,Pi,u,nt,ot,O,j,Dr,0,p,Vt,st,it,V)}function o6(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])<r)return!0}return n[e].push(i),!1}function l6(t,e){return e.id==null||e.properties?.cluster?t:(0,Ka.default)(String(e.id),t)}function rf(t,e,r){let i=\"never\",n=t.get(e);return n?i=n:t.get(r)&&(i=\"always\"),i}var u6=[{name:\"a_fade_opacity\",components:1,type:\"Uint8\",offset:0}];function ka(t,e,r,i,n,a,s,o,l,u,c,h,p,f){let d=o?Math.min(Wp,Math.round(o[0])):0,y=o?Math.min(Wp,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(i*32),Math.round(n*32),a,s,(d<<1)+ +!!l,y,u*16,c*16,h*256,p*256,f)}function c6(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function h6(t){for(let e of t.sections)if(k1(e.text))return!0;return!1}function p6(t){return t.sections.some(e=>!E1(e.text))}var tu=class{constructor(t){this.layoutVertexArray=new l2,this.indexArray=new qn,this.programConfigurations=t,this.segments=new le,this.dynamicLayoutVertexArray=new u2,this.opacityVertexArray=new c2,this.hasVisibleVertices=!1,this.placedSymbolArray=new hy}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dw.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,yw.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,u6,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};B(\"SymbolBuffers\",tu);var eu=class{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new le,this.collisionVertexArray=new h2}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,mw.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};B(\"CollisionBuffers\",eu);var e0=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.hasCursiveText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zp(this.zoom,e[\"text-size\"]),this.iconSizeData=Zp(this.zoom,e[\"icon-size\"]);let r=this.layers[0].layout,i=r.get(\"symbol-sort-key\"),n=r.get(\"symbol-z-order\");this.canOverlap=rf(r,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||rf(r,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||r.get(\"text-ignore-placement\")||r.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=n!==\"viewport-y\"&&!i.isConstant();let a=n===\"viewport-y\"||n===\"auto\"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get(\"symbol-placement\")===\"point\"&&(this.writingModes=r.get(\"text-writing-mode\").map(s=>z1[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new tu(new Vr(this.layers,this.zoom,t=>t.startsWith(\"text\"))),this.icon=new tu(new Vr(this.layers,this.zoom,t=>t.startsWith(\"icon\"))),this.glyphOffsetArray=new dy,this.lineVertexArray=new yy,this.symbolInstances=new fy,this.textAnchorOffsets=new gy}calculateGlyphDependencies(t,e,r,i){var s;let n=ac.fromFeature(t,r,!1),a=n.graphemes();for(let o=0;o<a.length;o++){let l=n.getSection(o);if(\"imageName\"in l)continue;e[s=l.fontStack]||(e[s]={default:{},vertical:{}});let u=e[l.fontStack],c=a[o],h=i&&M3(c.codePointAt(0),this.allowVerticalPlacement);Zl(c)&&(u.default[c]=!0),h&&(u.vertical[c]=!0);for(let p of c){if(u.default[p]=!0,!i)continue;h&&Zl(c)&&(u.vertical[p]=!0);let f=oi[p];f&&(u.default[f]=!0)}}}populate(t,e,r){let i=this.layers[0],n=i.layout,a=n.get(\"text-font\"),s=n.get(\"text-field\"),o=n.get(\"icon-image\"),l=(s.value.kind!==\"constant\"||s.value.value instanceof Ke&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!==\"constant\"||a.value.value.length>0),u=o.value.kind!==\"constant\"||!!o.value.value||Object.keys(o.parameters).length>0,c=n.get(\"symbol-sort-key\"),h=n.get(\"symbol-placement\")===\"point\";if(this.features=[],!l&&!u)return;let p=e.iconDependencies,f=e.glyphDependencies,d=e.availableImages,y=new ut(this.zoom),m=n.get(\"text-keep-upright\");for(let{feature:g,id:v,index:x,sourceLayerIndex:b}of t){let w=i._featureFilter.needGeometry,_=Ci(g,w);if(!i._featureFilter.filter(y,_,r)||(w||(_.geometry=Nr(g)),h&&g.type===1&&f6(_.geometry)))continue;let S;if(l){let M=i.getValueAndResolveTokens(\"text-field\",_,r,d),V=Ke.factory(M);this.hasRTLText||(this.hasRTLText=h6(V)),this.hasCursiveText||(this.hasCursiveText=p6(V)),S=Rw(V,i,_)}let A;if(u){let M=i.getValueAndResolveTokens(\"icon-image\",_,r,d);A=M instanceof Re?M:Re.fromString(M)}if(!S&&!A)continue;let E=this.sortFeaturesByKey?c.evaluate(_,{},r):void 0,R={id:v,text:S,icon:A,index:x,sourceLayerIndex:b,geometry:_.geometry,properties:g.properties,type:Gn.types[g.type],sortKey:E};if(this.features.push(R),A&&(p[A.name]=!0),S){let M=a.evaluate(_,{},r).join(\",\"),V=n.get(\"text-rotation-alignment\")!==\"viewport\"&&n.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=this.writingModes?.includes(2);let U=(V&&m||this.allowVerticalPlacement)&&Hl(S.toString());this.calculateGlyphDependencies(S,f,M,U);for(let k of S.sections)k.image&&(p[k.image.name]=!0)}}n.get(\"symbol-placement\")===\"line\"&&(this.features=Nw(this.features)),this.sortFeaturesByKey&&this.features.sort((g,v)=>g.sortKey-v.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){i6({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity,hasPromoteId:t.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s<e.length;s++)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(let s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s<e.length;s++){let o=a[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=t.indexArray,d=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,v=this.allowVerticalPlacement&&s===2?Math.PI/2:0,x=a.text&&a.text.sections;for(let b=0;b<e.length;b++){let{tl:w,tr:_,bl:S,br:A,tex:E,pixelOffsetTL:R,pixelOffsetBR:M,minFontScaleX:V,minFontScaleY:U,glyphOffset:k,isSDF:C,sectionIndex:L}=e[b],O=y.vertexLength,j=k[1];ka(d,o.x,o.y,w.x,j+w.y,E.x,E.y,r,C,R.x,R.y,V,U,p),ka(d,o.x,o.y,_.x,j+_.y,E.x+E.w,E.y,r,C,M.x,R.y,V,U,p),ka(d,o.x,o.y,S.x,j+S.y,E.x,E.y+E.h,r,C,R.x,M.y,V,U,p),ka(d,o.x,o.y,A.x,j+A.y,E.x+E.w,E.y+E.h,r,C,M.x,M.y,V,U,p),c6(t.dynamicLayoutVertexArray,o,v),f.emplaceBack(O,O+2,O+1),f.emplaceBack(O+1,O+2,O+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(k[0]),(b===e.length-1||L!==e[b+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:h,formattedSection:x?.[L]})}t.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,c,p)}_addCollisionDebugVertex(t,e,r,i,n,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new T(t,e)),this._addCollisionDebugVertex(u,c,a,h,p,new T(r,e)),this._addCollisionDebugVertex(u,c,a,h,p,new T(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new T(t,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,i){for(let n=t;n<e;n++){let a=this.collisionBoxArray.get(n),s=a.x1,o=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(s,o,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new eu(zh,Mp.members,wl),this.iconCollisionBox=new eu(zh,Mp.members,wl);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,i,n,a,s,o,l){let u={};for(let c=e;c<r;c++){let h=t.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(let c=i;c<n;c++){let h=t.get(c);u.verticalTextBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalTextFeatureIndex=h.featureIndex;break}for(let c=a;c<s;c++){let h=t.get(c);u.iconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.iconFeatureIndex=h.featureIndex;break}for(let c=o;c<l;c++){let h=t.get(c);u.verticalIconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalIconFeatureIndex=h.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let e=Math.sin(t),r=Math.cos(t),i=[],n=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let o=this.symbolInstances.get(s);i.push(Math.round(e*o.anchorX+r*o.anchorY)|0),n.push(o.featureIndex)}return a.sort((s,o)=>i[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function f6(t){return t.every(e=>e.every(Uu))}B(\"SymbolBucket\",e0,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]});function d6(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):\"\")}var nf,y6=()=>nf||(nf=new Zt({\"symbol-placement\":new z(D.layout_symbol[\"symbol-placement\"],\"symbol-placement\"),\"symbol-spacing\":new z(D.layout_symbol[\"symbol-spacing\"],\"symbol-spacing\"),\"symbol-avoid-edges\":new z(D.layout_symbol[\"symbol-avoid-edges\"],\"symbol-avoid-edges\"),\"symbol-sort-key\":new N(D.layout_symbol[\"symbol-sort-key\"],\"symbol-sort-key\"),\"symbol-z-order\":new z(D.layout_symbol[\"symbol-z-order\"],\"symbol-z-order\"),\"icon-allow-overlap\":new z(D.layout_symbol[\"icon-allow-overlap\"],\"icon-allow-overlap\"),\"icon-overlap\":new z(D.layout_symbol[\"icon-overlap\"],\"icon-overlap\"),\"icon-ignore-placement\":new z(D.layout_symbol[\"icon-ignore-placement\"],\"icon-ignore-placement\"),\"icon-optional\":new z(D.layout_symbol[\"icon-optional\"],\"icon-optional\"),\"icon-rotation-alignment\":new N(D.layout_symbol[\"icon-rotation-alignment\"],\"icon-rotation-alignment\"),\"icon-size\":new N(D.layout_symbol[\"icon-size\"],\"icon-size\"),\"icon-text-fit\":new z(D.layout_symbol[\"icon-text-fit\"],\"icon-text-fit\"),\"icon-text-fit-padding\":new z(D.layout_symbol[\"icon-text-fit-padding\"],\"icon-text-fit-padding\"),\"icon-image\":new N(D.layout_symbol[\"icon-image\"],\"icon-image\"),\"icon-rotate\":new N(D.layout_symbol[\"icon-rotate\"],\"icon-rotate\"),\"icon-padding\":new N(D.layout_symbol[\"icon-padding\"],\"icon-padding\"),\"icon-keep-upright\":new z(D.layout_symbol[\"icon-keep-upright\"],\"icon-keep-upright\"),\"icon-offset\":new N(D.layout_symbol[\"icon-offset\"],\"icon-offset\"),\"icon-anchor\":new N(D.layout_symbol[\"icon-anchor\"],\"icon-anchor\"),\"icon-pitch-alignment\":new z(D.layout_symbol[\"icon-pitch-alignment\"],\"icon-pitch-alignment\"),\"text-pitch-alignment\":new z(D.layout_symbol[\"text-pitch-alignment\"],\"text-pitch-alignment\"),\"text-rotation-alignment\":new z(D.layout_symbol[\"text-rotation-alignment\"],\"text-rotation-alignment\"),\"text-field\":new N(D.layout_symbol[\"text-field\"],\"text-field\"),\"text-font\":new N(D.layout_symbol[\"text-font\"],\"text-font\"),\"text-size\":new N(D.layout_symbol[\"text-size\"],\"text-size\"),\"text-max-width\":new N(D.layout_symbol[\"text-max-width\"],\"text-max-width\"),\"text-line-height\":new z(D.layout_symbol[\"text-line-height\"],\"text-line-height\"),\"text-letter-spacing\":new N(D.layout_symbol[\"text-letter-spacing\"],\"text-letter-spacing\"),\"text-justify\":new N(D.layout_symbol[\"text-justify\"],\"text-justify\"),\"text-radial-offset\":new N(D.layout_symbol[\"text-radial-offset\"],\"text-radial-offset\"),\"text-variable-anchor\":new z(D.layout_symbol[\"text-variable-anchor\"],\"text-variable-anchor\"),\"text-variable-anchor-offset\":new N(D.layout_symbol[\"text-variable-anchor-offset\"],\"text-variable-anchor-offset\"),\"text-anchor\":new N(D.layout_symbol[\"text-anchor\"],\"text-anchor\"),\"text-max-angle\":new z(D.layout_symbol[\"text-max-angle\"],\"text-max-angle\"),\"text-writing-mode\":new z(D.layout_symbol[\"text-writing-mode\"],\"text-writing-mode\"),\"text-rotate\":new N(D.layout_symbol[\"text-rotate\"],\"text-rotate\"),\"text-padding\":new z(D.layout_symbol[\"text-padding\"],\"text-padding\"),\"text-keep-upright\":new z(D.layout_symbol[\"text-keep-upright\"],\"text-keep-upright\"),\"text-transform\":new N(D.layout_symbol[\"text-transform\"],\"text-transform\"),\"text-offset\":new N(D.layout_symbol[\"text-offset\"],\"text-offset\"),\"text-allow-overlap\":new z(D.layout_symbol[\"text-allow-overlap\"],\"text-allow-overlap\"),\"text-overlap\":new z(D.layout_symbol[\"text-overlap\"],\"text-overlap\"),\"text-ignore-placement\":new z(D.layout_symbol[\"text-ignore-placement\"],\"text-ignore-placement\"),\"text-optional\":new z(D.layout_symbol[\"text-optional\"],\"text-optional\"),\"symbol-height-offset\":new N(D.layout_symbol[\"symbol-height-offset\"],\"symbol-height-offset\"),\"symbol-height-anchor\":new z(D.layout_symbol[\"symbol-height-anchor\"],\"symbol-height-anchor\")})),af,m6=()=>af||(af=new Zt({\"icon-opacity\":new N(D.paint_symbol[\"icon-opacity\"],\"icon-opacity\"),\"icon-color\":new N(D.paint_symbol[\"icon-color\"],\"icon-color\"),\"icon-halo-color\":new N(D.paint_symbol[\"icon-halo-color\"],\"icon-halo-color\"),\"icon-halo-width\":new N(D.paint_symbol[\"icon-halo-width\"],\"icon-halo-width\"),\"icon-halo-blur\":new N(D.paint_symbol[\"icon-halo-blur\"],\"icon-halo-blur\"),\"icon-translate\":new z(D.paint_symbol[\"icon-translate\"],\"icon-translate\"),\"icon-translate-anchor\":new z(D.paint_symbol[\"icon-translate-anchor\"],\"icon-translate-anchor\"),\"text-opacity\":new N(D.paint_symbol[\"text-opacity\"],\"text-opacity\"),\"text-color\":new N(D.paint_symbol[\"text-color\"],\"text-color\",{runtimeType:De,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),\"text-halo-color\":new N(D.paint_symbol[\"text-halo-color\"],\"text-halo-color\"),\"text-halo-width\":new N(D.paint_symbol[\"text-halo-width\"],\"text-halo-width\"),\"text-halo-blur\":new N(D.paint_symbol[\"text-halo-blur\"],\"text-halo-blur\"),\"text-translate\":new z(D.paint_symbol[\"text-translate\"],\"text-translate\"),\"text-translate-anchor\":new z(D.paint_symbol[\"text-translate-anchor\"],\"text-translate-anchor\")})),Bo={get paint(){return m6()},get layout(){return y6()}},r0=class{constructor(t){if(t.property.overrides===void 0)throw Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=t.property.overrides?t.property.overrides.runtimeType:Vn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e?.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};B(\"FormatSectionOverride\",r0,{omit:[\"defaultValue\"]});var g6=class ru extends Ae{constructor(e,r){super(e,Bo,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get(\"icon-rotation-alignment\");if((i.value.kind!==\"constant\"||i.value.value===\"auto\")&&(this.layout._values[\"icon-rotation-alignment\"]=new ge(i.property,{kind:\"constant\",value:this.layout.get(\"symbol-placement\")===\"point\"?\"viewport\":\"map\"},i.parameters)),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout.get(\"symbol-placement\")===\"point\"?this.layout._values[\"text-rotation-alignment\"]=\"viewport\":this.layout._values[\"text-rotation-alignment\"]=\"map\"),this.layout.get(\"text-pitch-alignment\")===\"auto\"&&(this.layout._values[\"text-pitch-alignment\"]=this.layout.get(\"text-rotation-alignment\")===\"map\"?\"map\":\"viewport\"),this.layout.get(\"icon-pitch-alignment\")===\"auto\"&&(this.layout._values[\"icon-pitch-alignment\"]=this.layout.get(\"icon-rotation-alignment\").constantOr(\"viewport\")),this.layout.get(\"symbol-placement\")===\"point\"){let n=this.layout.get(\"text-writing-mode\");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values[\"text-writing-mode\"]=a}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!bs(s.value)&&a?d6(r.properties,a):a}createBucket(e){return new e0(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let e of Bo.paint.overridableProperties){if(!ru.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Mu(new r0(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind===\"constant\"||r.value.kind===\"source\"?new Dn(\"source\",i):new Ya(\"composite\",i,r.value.zoomStops),this.paint._values[e]=new ge(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ru.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get(\"text-field\"),n=Bo.paint.properties[r],a=!1,s=o=>{for(let l of o)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind===\"constant\"&&i.value.value instanceof Ke)s(i.value.value.sections);else if(i.value.kind===\"source\"||i.value.kind===\"composite\"){let o=u=>{if(!a)if(u instanceof bi&&Tt(u.value)===On){let c=u.value;s(c.sections)}else u instanceof gd?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function x6(t,e,r,i=1){let n=t.get(\"icon-padding\").evaluate(e,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var sf,v6=()=>sf||(sf=new Zt({\"background-color\":new z(D.paint_background[\"background-color\"],\"background-color\"),\"background-pattern\":new oy(D.paint_background[\"background-pattern\"],\"background-pattern\"),\"background-opacity\":new z(D.paint_background[\"background-opacity\"],\"background-opacity\")})),b6={get paint(){return v6()}},w6=class extends Ae{constructor(t,e){super(t,b6,e)}},of,_6=()=>of||(of=new Zt({\"raster-opacity\":new z(D.paint_raster[\"raster-opacity\"],\"raster-opacity\"),\"raster-layer-blend\":new z(D.paint_raster[\"raster-layer-blend\"],\"raster-layer-blend\"),\"raster-hue-rotate\":new z(D.paint_raster[\"raster-hue-rotate\"],\"raster-hue-rotate\"),\"raster-brightness-min\":new z(D.paint_raster[\"raster-brightness-min\"],\"raster-brightness-min\"),\"raster-brightness-max\":new z(D.paint_raster[\"raster-brightness-max\"],\"raster-brightness-max\"),\"raster-saturation\":new z(D.paint_raster[\"raster-saturation\"],\"raster-saturation\"),\"raster-contrast\":new z(D.paint_raster[\"raster-contrast\"],\"raster-contrast\"),resampling:new z(D.paint_raster.resampling,\"resampling\"),\"raster-resampling\":new z(D.paint_raster[\"raster-resampling\"],\"raster-resampling\"),\"raster-fade-duration\":new z(D.paint_raster[\"raster-fade-duration\"],\"raster-fade-duration\")})),D6={get paint(){return _6()}},S6=class extends Ae{constructor(t,e){super(t,D6,e)}},A6=class extends Ae{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(\"Custom layers cannot be serialized\")}};function E6(t,e){if(t.type===\"custom\")return new A6(t,e);switch(t.type){case\"background\":return new w6(t,e);case\"circle\":return new hv(t,e);case\"color-relief\":return new wv(t,e);case\"fill\":return new Qv(t,e);case\"fill-extrusion\":return new mb(t,e);case\"heatmap\":return new yv(t,e);case\"hillshade\":return new xv(t,e);case\"line\":return new fw(t,e);case\"raster\":return new S6(t,e);case\"symbol\":return new g6(t,e)}}var T6=class{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,\"id\"in t&&(typeof t.id==\"string\"?this.id=parseInt(t.id,10):typeof t.id==\"number\"&&!isNaN(t.id)&&(this.id=t.id))}loadGeometry(){let t=[],e=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of e){let i=[];for(let n of r)i.push(new T(n[0],n[1]));t.push(i)}return t}},iu=\"_geojsonTileLayer\",I6=class{constructor(t,e){this.layers={[iu]:this},this.name=iu,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new T6(this.features[t],this.extent)}};function i0(t,e=\"\"){let r=new o3;return k6(t,r,e),r.finish()}function k6(t,e,r=\"\"){for(let i in t.layers)e.writeMessage(3,(n,a)=>C6(n,a,r),t.layers[i])}function C6(t,e,r=\"\"){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||\"\"),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s<t.length;s++)i.feature=t.feature(s),e.writeMessage(2,F6,i);let n=i.keys;for(let s of n)e.writeStringField(3,s);let a=i.values;for(let s of a)e.writeMessage(4,B6,s)}function F6(t,e){if(!t.feature)return;let r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,M6,t),e.writeVarintField(3,r.type),e.writeMessage(4,P6,r)}function M6(t,e){for(let r in t.feature?.properties){let i=t.feature.properties[r],n=t.keycache[r];if(i==null)continue;n===void 0&&(t.keys.push(r),n=t.keys.length-1,t.keycache[r]=n),e.writeVarint(n),typeof i!=\"string\"&&typeof i!=\"boolean\"&&typeof i!=\"number\"&&(i=t.jsonPrefix+JSON.stringify(i));let a=typeof i+\":\"+i,s=t.valuecache[a];s===void 0&&(t.values.push(i),s=t.values.length-1,t.valuecache[a]=s),e.writeVarint(s)}}function Lo(t,e){return(e<<3)+(t&7)}function lf(t){return t<<1^t>>31}function P6(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Lo(1,o));let l=s[s.length-1],u=i===3&&s.length>1&&l.x===s[0].x&&l.y===s[0].y?s.length-1:s.length;for(let c=0;c<u;c++){c===1&&i!==1&&e.writeVarint(Lo(2,u-1));let h=s[c].x-n,p=s[c].y-a;e.writeVarint(lf(h)),e.writeVarint(lf(p)),n+=h,a+=p}t.type===3&&e.writeVarint(Lo(7,1))}}function B6(t,e){let r=typeof t;r===\"string\"?e.writeStringField(1,t):r===\"boolean\"?e.writeBooleanField(7,t):r===\"number\"&&(t%1==0?t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t):e.writeDoubleField(3,t))}var n0=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},xr,L6=(xr=class{constructor(e,r,i,n,a,s){this.type=\"Feature\",this._vectorTileFeature=e,this._x=i,this._y=n,this._z=r,s!==k2&&xr.worldCoordinateHelpers.set(this,s);for(let o in e.properties)typeof e.properties[o]==\"string\"&&e.properties[o].startsWith(\"__$json__:\")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,i,n,a){if(a){let s=a.lngLatFromWorld((e.x+r)/n,(e.y+i)/n);return[s.lng,s.lat]}return[(e.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+i)*2/n)*Math.PI))-90]}projectLine(e,r,i,n,a){return e.map(s=>this.projectPoint(s,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=xr.worldCoordinateHelpers.get(this),i=e.extent*2**this._z,n=e.extent*this._x,a=e.extent*this._y,s=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let u of s)o.push(u[0]);let l=this.projectLine(o,n,a,i,r);this._geometry=o.length===1?{type:\"Point\",coordinates:l[0]}:{type:\"MultiPoint\",coordinates:l};break}case 2:{let o=s.map(l=>this.projectLine(l,n,a,i,r));this._geometry=o.length===1?{type:\"LineString\",coordinates:o[0]}:{type:\"MultiLineString\",coordinates:o};break}case 3:{let o=o1(s),l=[];for(let u of o)l.push(u.map(c=>this.projectLine(c,n,a,i,r)));this._geometry=l.length===1?{type:\"Polygon\",coordinates:l[0]}:{type:\"MultiPolygon\",coordinates:l};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!==\"_geometry\"&&r!==\"_vectorTileFeature\"&&r!==\"_x\"&&r!==\"_y\"&&r!==\"_z\"&&(e[r]=this[r]);return e}},xr.worldCoordinateHelpers=new WeakMap,xr),Ur=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r==\"number\"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Fs=class extends Ur{},lc=class extends Fs{getValueFromBuffer(t){return this.dataBuffer[t]}},uc=class extends Fs{getValueFromBuffer(t){return this.dataBuffer[t]}},a0=class extends Ur{constructor(t,e,r,i){super(t,e,i),this.delta=r}},cc=class extends a0{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},hc=class extends Ur{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},z6=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error(\"Missing layer name\")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let s=this.idVector.getValue(r);s!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let n={coordinates:e[r],type:this.geometryVector.geometryType(r)},a={};for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(r);l!==null&&(a[o]=l)}t.push({id:i,geometry:n,properties:a})}return t}containsMaxSafeIntegerValues(t){return t instanceof lc||t instanceof hc||t instanceof cc||t instanceof uc}},ln={FEATURE:0,VERTEX:1},et={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},gr={GEOMETRY:0,STRUCT:1,MAP:2},s0={ID:0},o0=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}},W;(function(t){t.NONE=\"NONE\",t.DELTA=\"DELTA\",t.COMPONENTWISE_DELTA=\"COMPONENTWISE_DELTA\",t.RLE=\"RLE\",t.MORTON=\"MORTON\"})(W||(W={}));var oe;(function(t){t.NONE=\"NONE\",t.FAST_PFOR=\"FAST_PFOR\",t.VARINT=\"VARINT\"})(oe||(oe={}));var pc=new Uint32Array(33);pc[0]=0;for(let t=1;t<=32;t++)pc[t]=t===32?4294967295:4294967295>>>32-t;var nu=pc,fc=65536;function dc(t,e){return t-t%e}function V6(t){return dc(t+31,32)}function l0(t){if(!Number.isFinite(t)||t<=0)return fc;let e=dc(Math.floor(t),256);return e===0?256:e}function O6(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function R6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function $6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function N6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function U6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function j6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(c&3)<<4)&63,r[n++]=c>>>2&63,r[n++]=c>>>8&63,r[n++]=c>>>14&63,r[n++]=c>>>20&63,r[n]=c>>>26&63}function q6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(c&1)<<6)&127,r[n++]=c>>>1&127,r[n++]=c>>>8&127,r[n++]=c>>>15&127,r[n++]=c>>>22&127,r[n++]=(c>>>29|(h&15)<<3)&127,r[n++]=h>>>4&127,r[n++]=h>>>11&127,r[n++]=h>>>18&127,r[n]=h>>>25&127}function G6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function X6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(c&3)<<7)&511,r[n++]=c>>>2&511,r[n++]=c>>>11&511,r[n++]=c>>>20&511,r[n++]=(c>>>29|(h&63)<<3)&511,r[n++]=h>>>6&511,r[n++]=h>>>15&511,r[n++]=(h>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Y6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=c>>>0&1023,r[n++]=c>>>10&1023,r[n++]=c>>>20&1023,r[n++]=(c>>>30|(h&255)<<2)&1023,r[n++]=h>>>8&1023,r[n++]=h>>>18&1023,r[n++]=(h>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function W6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(c&31)<<6)&2047,r[n++]=c>>>5&2047,r[n++]=c>>>16&2047,r[n++]=(c>>>27|(h&63)<<5)&2047,r[n++]=h>>>6&2047,r[n++]=h>>>17&2047,r[n++]=(h>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Z6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(c&255)<<4)&4095,r[n++]=c>>>8&4095,r[n++]=c>>>20&4095,r[n++]=h>>>0&4095,r[n++]=h>>>12&4095,r[n++]=(h>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function H6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,v=t[e+13]>>>0,x=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function K6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function J6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Q6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function t5(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=c>>>0&15,r[n++]=c>>>4&15,r[n++]=c>>>8&15,r[n++]=c>>>12&15,r[n++]=c>>>16&15,r[n++]=c>>>20&15,r[n++]=c>>>24&15,r[n++]=c>>>28&15}}function e5(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(c&15)<<1)&31,r[n++]=c>>>4&31,r[n++]=c>>>9&31,r[n++]=c>>>14&31,r[n++]=c>>>19&31,r[n++]=c>>>24&31,r[n++]=(c>>>29|(h&3)<<3)&31,r[n++]=h>>>2&31,r[n++]=h>>>7&31,r[n++]=h>>>12&31,r[n++]=h>>>17&31,r[n++]=h>>>22&31,r[n++]=h>>>27&31}}function r5(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=c>>>0&63,r[n++]=c>>>6&63,r[n++]=c>>>12&63,r[n++]=c>>>18&63,r[n++]=c>>>24&63,r[n++]=(c>>>30|(h&15)<<2)&63,r[n++]=h>>>4&63,r[n++]=h>>>10&63,r[n++]=h>>>16&63,r[n++]=h>>>22&63,r[n++]=(h>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function i5(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(c&3)<<5)&127,r[n++]=c>>>2&127,r[n++]=c>>>9&127,r[n++]=c>>>16&127,r[n++]=c>>>23&127,r[n++]=(c>>>30|(h&31)<<2)&127,r[n++]=h>>>5&127,r[n++]=h>>>12&127,r[n++]=h>>>19&127,r[n++]=(h>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function n5(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function a5(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function s5(t,e,r,i,n){let a=nu[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let c=0;c<8;c++){for(let h=0;h<32;h++)if(o+n<=32){let p=l>>>o&a;r[u+h]=p|0,o+=n,o===32&&(o=0,s++,h!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<<p)&a;r[u+h]=m|0,o=d}u+=32,o=0,c<7&&(l=t[s]>>>0)}}var au=l0(fc),o5=3*au/256+au|0;function u0(){let t=new Uint8Array(o5);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function l5(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:u0()}}function u5(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function c5(t,e,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let o=0;o<a;o=o+1|0){let l=t[e+o|0]|0,u=o<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length<a)&&(o=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u<s;u=u+1|0)n[l+u|0]=o>>>(u<<3)&255}return n}function h5(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=V6(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let c=0;for(;c<s;c=c+32|0)w5(t,e,u,c,a),e=e+a|0;let h=c-s|0;e=e-(h*a>>>5)|0,r.exceptionSizes[a]=s}return e}function p5(t,e,r,i,n){switch(n){case 1:K6(t,e,r,i);break;case 2:J6(t,e,r,i);break;case 3:Q6(t,e,r,i);break;case 4:t5(t,e,r,i);break;case 5:e5(t,e,r,i);break;case 6:r5(t,e,r,i);break;case 7:i5(t,e,r,i);break;case 8:n5(t,e,r,i);break;case 16:a5(t,e,r,i);break;default:s5(t,e,r,i,n)}return e+(n<<3)|0}function f5(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function d5(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function y5(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:c,bytePosIn:h}=d5(n,a,s,r,i,l);if(s=h,c===1){let m=1<<r;for(let g=0;g<i;g=g+1|0){let v=n[s++];t[v+e|0]|=m}return s}let p=o.dataToBePacked[c];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${c} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=f[c]|0,y=o.exceptionSizes[c]|0;if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m<i;m=m+1|0){let g=n[s++],v=p[d++]|0;t[g+e|0]|=v<<r}return f[c]=d,s}function m5(t,e,r,i,n,a,s,o,l,u){let c=r|0,h=0;for(let p=0;p<s;p=p+1|0){let f=f5(o,l,h,p);h=f.bytePosIn;let d=f.bitWidth,y=f.exceptionCount,m=a+p*256|0;switch(d){case 0:n.fill(0,m,m+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[m+g|0]=t[c+g|0]|0;c=c+256|0;break;default:c=p5(t,c,n,m,d)}y>0&&(h=y5(n,m,d,y,o,l,h,u,p))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function g5(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,c=t[u]>>>0,h=c+3>>>2,p=u+1,f=p+h;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${h}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=c5(t,p,c,a),y=c,m=h5(t,f,a);return a.dataPointers.fill(0),m5(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function x5(t,e,r,i,n,a){let s=i+dc(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(au,s-o);l=g5(t,e,l,o,u,a),o=o+u|0}return l}function v5(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,c=n,h=n+a,p=0,f=0;for(;o<l&&c<h;){let d=t[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<<f,d&128)i[c++]=p|0,p=0,f=0;else if(f+=7,f>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${c-u}/${a}, inPos=${o}, inEnd=${l})`)}if(c!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function b5(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r??u0();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=x5(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return v5(t,i,o,a,n,l),a}function w5(t,e,r,i,n){switch(n){case 2:R6(t,e,r,i);return;case 3:$6(t,e,r,i);return;case 4:N6(t,e,r,i);return;case 5:U6(t,e,r,i);return;case 6:j6(t,e,r,i);return;case 7:q6(t,e,r,i);return;case 8:G6(t,e,r,i);return;case 9:X6(t,e,r,i);return;case 10:Y6(t,e,r,i);return;case 11:W6(t,e,r,i);return;case 12:Z6(t,e,r,i);return;case 16:H6(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=nu[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let c=l>>>o&a;r[i+u]=c|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let c=32-o,h=l>>>o;s++,l=t[s]>>>0;let p=nu[n-c]>>>0,f=(h|(l&p)<<c)&a;r[i+u]=f|0,o=n-c}}function _5(t,e,r,i){if(e<0||r<0||e+r>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let o=t.byteOffset+e;if(o&3)for(let l=0;l<n;l++){let u=e+l*4;i[l]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]}else{let l=new Uint32Array(t.buffer,o,n);for(let u=0;u<n;u++)i[u]=O6(l[u])|0}}if(a){let o=e+n*4,l=r-n*4,u=0;for(let c=0;c<l;c++)u|=t[o+c]<<24-c*8;i[n]=u|0}return s}function qt(t,e,r){let i=new Uint32Array(r),n=0,a=e.get();for(let s=0;s<i.length;s++){let o=t[a++],l=o&127;o<128||(o=t[a++],l|=(o&127)<<7,o<128||(o=t[a++],l|=(o&127)<<14,o<128||(o=t[a++],l|=(o&127)<<21,o<128||(o=t[a++],l|=(o&15)<<28)))),i[n++]=l}return e.set(a),i}function yc(t,e,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=D5(t,e);return i}function D5(t,e){let r=0n,i=0,n=e.get();for(;n<t.length;){let a=t[n++];if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error(\"Varint too long\")}return e.set(n),r}function S5(t,e,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=A5(t,e);return i}function A5(t,e){let r,i;return i=t[e.get()],e.increment(),r=i&127,i<128||(i=t[e.get()],e.increment(),r|=(i&127)<<7,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<14,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<21,i<128)?r:(i=t[e.get()],r|=(i&15)<<28,E5(r,t,e))}function E5(t,e,r){let i,n;if(n=e[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error(\"Expected varint not more than 10 bytes\")}function T5(t,e,r,i){return I5(t,e,r,i,l5(r>>>2))}function I5(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=u5(n,s);_5(t,a,r,o);let l=b5(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function tt(t){return t>>>1^-(t&1)}function Ut(t){return t>>1n^-(t&1n)}function cr(t){return t%2==1?(t+1)/-2:t/2}function k5(t){let e=new Int32Array(t.length);for(let r=0;r<t.length;r++)e[r]=tt(t[r]);return e}function C5(t){let e=new BigInt64Array(t.length);for(let r=0;r<t.length;r++)e[r]=Ut(t[r]);return e}function F5(t){for(let e=0;e<t.length;e++)t[e]=cr(t[e])}function su(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function ou(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function c0(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function uf(t){let e=new Int32Array(t.length);e[0]=tt(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-1],e[i+1]=tt(a)+e[i],e[i+2]=tt(s)+e[i+1],e[i+3]=tt(o)+e[i+2]}for(;i!==t.length;++i)e[i]=tt(t[i])+e[i-1];return e}function cf(t){let e=new BigInt64Array(t.length);e[0]=Ut(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=Ut(n)+e[i-1],e[i+1]=Ut(a)+e[i],e[i+2]=Ut(s)+e[i+1],e[i+3]=Ut(o)+e[i+2]}for(;i!==e.length;++i)e[i]=Ut(t[i])+e[i-1];return e}function M5(t){t[0]=cr(t[0]);let e=t.length/4*4,r=1;if(e>=4)for(;r<e-4;r+=4){let i=t[r],n=t[r+1],a=t[r+2],s=t[r+3];t[r]=cr(i)+t[r-1],t[r+1]=cr(n)+t[r],t[r+2]=cr(a)+t[r+1],t[r+3]=cr(s)+t[r+2]}for(;r!==t.length;++r)t[r]=cr(t[r])+t[r-1]}function P5(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Int32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=tt(o),i.fill(o,n,n+s),n+=s}return i}function B5(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];o=Ut(o),i.fill(o,n,n+s),n+=s}return i}function L5(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=cr(o),i.fill(o,n,n+s),n+=s}return i}function mc(t){let e=t.length/4*4,r=1;if(e>=4)for(let i=t[0];r<e-4;r+=4)i=t[r]+=i,i=t[r+1]+=i,i=t[r+2]+=i,i=t[r+3]+=i;for(;r!==t.length;)t[r]+=t[r-1],++r}function z5(t){let e=0;for(let r=0;r<t.length;r++)t[r]+=e,e=t[r]}function V5(t){if(t.length<2)return new Int32Array(t);let e=new Int32Array(t.length);e[0]=tt(t[0]),e[1]=tt(t[1]);let r=t.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-2],e[i+1]=tt(a)+e[i-1],e[i+2]=tt(s)+e[i],e[i+3]=tt(o)+e[i+1]}for(;i!==t.length;i+=2)e[i]=tt(t[i])+e[i-2],e[i+1]=tt(t[i+1])+e[i-1];return e}function h0(t,e,r,i){if(t.length<2)return new Int32Array(t);let n=new Int32Array(t.length),a=tt(t[0]),s=tt(t[1]);n[0]=lr(Math.round(a*e),r,i),n[1]=lr(Math.round(s*e),r,i);let o=t.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=t[l],c=t[l+1],h=tt(u)+a,p=tt(c)+s;n[l]=lr(Math.round(h*e),r,i),n[l+1]=lr(Math.round(p*e),r,i);let f=t[l+2],d=t[l+3];a=tt(f)+h,s=tt(d)+p,n[l+2]=lr(Math.round(a*e),r,i),n[l+3]=lr(Math.round(s*e),r,i)}for(;l!==t.length;l+=2)a+=tt(t[l]),s+=tt(t[l+1]),n[l]=lr(Math.round(a*e),r,i),n[l+1]=lr(Math.round(s*e),r,i);return n}function lr(t,e,r){return Math.min(r,Math.max(e,t))}function O5(t){let e=new Int32Array(t.length+1);e[0]=0,e[1]=tt(t[0]);let r=e[1];for(let i=2;i!==e.length;++i){let n=t[i-1],a=tt(n);r+=a,e[i]=e[i-1]+r}return new Uint32Array(e)}function R5(t,e,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];l=tt(l);for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function $5(t,e,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function N5(t,e,r){let i=new Int32Array(r),n=0,a=0;for(let s=0;s<e;s++){let o=t[s],l=t[s+e],u=tt(l);for(let c=0;c<o;c++)a+=u,i[n++]=a}return i}function U5(t,e,r){let i=new BigInt64Array(r),n=0,a=0n;for(let s=0;s<e;s++){let o=Number(t[s]),l=t[s+e],u=Ut(l);for(let c=0;c<o;c++)a+=u,i[n++]=a}return i}function hf(t){let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0;for(let r=1;r<t.length;r++)e[r]=e[r-1]+tt(t[r])>>>0;return e}function pf(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ut(t[0]));for(let r=1;r<t.length;r++)e[r]=BigInt.asUintN(64,e[r-1]+Ut(t[r]));return e}function j5(t){if(t.length<2)return new Uint32Array(t);let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0,e[1]=tt(t[1])>>>0;for(let r=2;r<t.length;r+=2)e[r]=e[r-2]+tt(t[r])>>>0,e[r+1]=e[r-1]+tt(t[r+1])>>>0;return e}function q5(t,e,r,i){let n=h0(t,e,r,i);return new Uint32Array(n)}function G5(t){return t[1]}function X5(t){return tt(t[1])}function Y5(t){if(t.length===2){let e=tt(t[1]);return[e,e]}return[tt(t[2]),tt(t[3])]}function W5(t){return t[1]}function Z5(t){return Ut(t[1])}function H5(t){if(t.length===2){let e=Ut(t[1]);return[e,e]}return[Ut(t[2]),Ut(t[3])]}var Et;(function(t){t.PRESENT=\"PRESENT\",t.DATA=\"DATA\",t.OFFSET=\"OFFSET\",t.LENGTH=\"LENGTH\"})(Et||(Et={}));var Yt;(function(t){t.NONE=\"NONE\",t.SINGLE=\"SINGLE\",t.SHARED=\"SHARED\",t.VERTEX=\"VERTEX\",t.MORTON=\"MORTON\",t.FSST=\"FSST\"})(Yt||(Yt={}));var Me;(function(t){t.VERTEX=\"VERTEX\",t.INDEX=\"INDEX\",t.STRING=\"STRING\",t.KEY=\"KEY\"})(Me||(Me={}));var Ft;(function(t){t.VAR_BINARY=\"VAR_BINARY\",t.GEOMETRIES=\"GEOMETRIES\",t.PARTS=\"PARTS\",t.RINGS=\"RINGS\",t.TRIANGLES=\"TRIANGLES\",t.SYMBOL=\"SYMBOL\",t.DICTIONARY=\"DICTIONARY\"})(Ft||(Ft={}));var K5=[Et.PRESENT,Et.DATA,Et.OFFSET,Et.LENGTH],ff=[W.NONE,W.DELTA,W.COMPONENTWISE_DELTA,W.RLE,W.MORTON],J5=[oe.NONE,oe.FAST_PFOR,oe.VARINT],Q5=[Yt.NONE,Yt.SINGLE,Yt.SHARED,Yt.VERTEX,Yt.MORTON,Yt.FSST],t_=[Me.VERTEX,Me.INDEX,Me.STRING,Me.KEY],e_=[Ft.VAR_BINARY,Ft.GEOMETRIES,Ft.PARTS,Ft.RINGS,Ft.TRIANGLES,Ft.SYMBOL,Ft.DICTIONARY];function yt(t,e){let r=n_(t,e);return r.logicalLevelTechnique1===W.MORTON?r_(r,t,e):(W.RLE===r.logicalLevelTechnique1||W.RLE===r.logicalLevelTechnique2)&&oe.NONE!==r.physicalLevelTechnique?i_(r,t,e):r}function r_(t,e,r){let i=qt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function i_(t,e,r){let i=qt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function n_(t,e){let r=t[e.get()],i=K5[r>>4],n={};switch(i){case Et.DATA:n={dictionaryType:Q5[r&15]};break;case Et.OFFSET:n={offsetType:t_[r&15]};break;case Et.LENGTH:n={lengthType:e_[r&15]}}e.increment();let a=t[e.get()],s=ff[a>>5],o=ff[a>>2&7],l=J5[a&3];e.increment();let u=qt(t,e,2),c=u[0],h=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:c,byteLength:h,decompressedCount:c}}var ht;(function(t){t[t.FLAT=0]=\"FLAT\",t[t.CONST=1]=\"CONST\",t[t.SEQUENCE=2]=\"SEQUENCE\",t[t.DICTIONARY=3]=\"DICTIONARY\",t[t.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(ht||(ht={}));var Se=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<<i}getInt(t){let e=Math.floor(t/8),r=t%8;return this.values[e]>>r&1}size(){return this._size}getBuffer(){return this.values}};function jr(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o<i;o++)a[o]=e.get(o)?t[s++]:r;return a}function a_(t,e,r){if(!r)return t;let i=r.size(),n=new Se(t,e),a=new Se(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let o=0;o<i;o++){let l=r.get(o)?n.get(s++):!1;a.set(o,l)}return a.getBuffer()}function p0(t,e,r){for(let i=0;i<t;i++){let n=yt(e,r);r.add(n.byteLength)}}function Fi(t,e,r,i,n){let a=s_(t,Math.ceil(e/8),r,i);return n?a_(a,e,n):a}function s_(t,e,r,i){let n=new Uint8Array(e),a=0,s=i.get()+r;for(;a<e&&!(i.get()>=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],c=Math.min(a+l,e);n.fill(u,a,c),a=c}else{let l=256-o;for(let u=0;u<l&&a<e;u++)n[a++]=t[i.increment()]}}return i.set(s),n}function f0(t,e,r,i){let n=e.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float32Array(s);return e.set(a),i?jr(o,i,0):o}function d0(t,e,r,i){let n=e.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float64Array(s);return e.set(a),i?jr(o,i,0):o}function o_(t,e,r){let i=e.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(r);for(let o=0;o<r;o++)s[o]=a.getUint32(i+o*Uint32Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}function l_(t,e,r){let i=e.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new BigUint64Array(r);for(let o=0;o<r;o++)s[o]=a.getBigUint64(i+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}var u_=new TextDecoder;function gc(t,e,r){return r-e>=12?u_.decode(t.subarray(e,r)):c_(t,e,r)}function c_(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,c;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],c=t[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function os(t,e,r,i,n){return y_(Mi(t,e,r),r,i,n)}function Nt(t,e,r,i,n){return m_(Mi(t,e,r),r,i,n)}function hr(t,e,r){return x_(Mi(t,e,r),r)}function Mi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case oe.FAST_PFOR:return T5(t,r.numValues,r.byteLength,e);case oe.VARINT:return qt(t,e,r.numValues);case oe.NONE:return o_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Yn(t,e,r){let i=r.physicalLevelTechnique;switch(i){case oe.VARINT:return yc(t,e,r.numValues);case oe.NONE:return l_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function h_(t,e,r){let i=Mi(t,e,r);return i.length===1?tt(i[0]):X5(i)}function xc(t,e,r){let i=Mi(t,e,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?tt(i[0]):i[0]:G5(i)}function y0(t,e,r){return Y5(Mi(t,e,r))}function m0(t,e,r){return H5(yc(t,e,r.numValues))}function g0(t,e,r,i){return v0(Yn(t,e,r),r,i)}function vc(t,e,r,i){return b0(Yn(t,e,r),r,i)}function p_(t,e,r,i){let n=f_(t,e,r,!1);return i?jr(n,i,0):n}function f_(t,e,r,i){if(r.physicalLevelTechnique===oe.VARINT)return g_(S5(t,e,r.numValues),r,i);let n=Yn(t,e,r),a=i?v0(n,r):b0(n,r);return Float64Array.from(a,Number)}function d_(t,e,r){let i=Yn(t,e,r);return i.length===1?Ut(i[0]):Z5(i)}function x0(t,e,r){let i=Yn(t,e,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?Ut(i[0]):i[0]:W5(i)}function y_(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let a=e;if(!i)return N5(t,a.runs,a.numRleValues);t=su(t,a.runs,a.numRleValues),n=uf(t)}else n=uf(t);break;case W.RLE:n=P5(t,e.runs,e.numRleValues);break;case W.MORTON:mc(t),n=new Int32Array(t);break;case W.COMPONENTWISE_DELTA:if(r&&!i)return h0(t,r.scale,r.min,r.max);n=V5(t);break;case W.NONE:n=k5(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?jr(n,i,0):n}function m_(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let a=e;n=hf(su(t,a.runs,a.numRleValues))}else n=hf(t);break;case W.RLE:n=su(t,e.runs,e.numRleValues);break;case W.MORTON:mc(t),n=t;break;case W.COMPONENTWISE_DELTA:n=r&&!i?q5(t,r.scale,r.min,r.max):j5(t);break;case W.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?jr(n,i,0):n}function v0(t,e,r){let i;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let n=e;if(!r)return U5(t,n.runs,n.numRleValues);t=ou(t,n.runs,n.numRleValues),i=cf(t)}else i=cf(t);break;case W.RLE:i=B5(t,e.runs,e.numRleValues);break;case W.NONE:i=C5(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?jr(i,r,0n):i}function b0(t,e,r){let i;switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let n=e;i=pf(ou(t,n.runs,n.numRleValues))}else i=pf(t);break;case W.RLE:i=ou(t,e.runs,e.numRleValues);break;case W.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?jr(i,r,0n):i}function g_(t,e,r){switch(e.logicalLevelTechnique1){case W.DELTA:if(e.logicalLevelTechnique2===W.RLE){let i=e;t=c0(t,i.runs,i.numRleValues)}return M5(t),t;case W.RLE:return b_(t,e,r);case W.NONE:return r&&F5(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function x_(t,e){if(e.logicalLevelTechnique1===W.DELTA&&e.logicalLevelTechnique2===W.NONE)return O5(t);if(e.logicalLevelTechnique1===W.RLE&&e.logicalLevelTechnique2===W.NONE){let r=e;return $5(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===W.NONE&&e.logicalLevelTechnique2===W.NONE){z5(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===W.DELTA&&e.logicalLevelTechnique2===W.RLE){let r=e,i=R5(t,r.runs,r.numRleValues);return mc(i),new Uint32Array(i)}throw Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")}function Ms(t,e,r,i,n=\"int32\"){let a=t.logicalLevelTechnique1;if(a===W.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==W.DELTA||t.logicalLevelTechnique2!==W.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof Se?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===oe.VARINT)return v_(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),c=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),c[2]===2&&c[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function v_(t,e,r){let i=new o0(e.get());if(r===\"int64\"){let a=yc(t,i,4);return a[2]===2n&&a[3]===2n}let n=qt(t,i,4);return n[2]===2&&n[3]===2}function b_(t,e,r){return r?L5(t,e.runs,e.numRleValues):c0(t,e.runs,e.numRleValues)}var w0=class extends Fs{getValueFromBuffer(t){return this.dataBuffer[t]}},_0=class extends a0{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function bc(t,e,r){return{x:df(t,e)-r,y:df(t>>1,e)-r}}function df(t,e){let r=0;for(let i=0;i<e;i++)r|=(t&1<<2*i)>>i;return r}var Ot;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\",t[t.MULTIPOINT=3]=\"MULTIPOINT\",t[t.MULTILINESTRING=4]=\"MULTILINESTRING\",t[t.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})(Ot||(Ot={}));var yf;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\"})(yf||(yf={}));var br;(function(t){t[t.MORTON=0]=\"MORTON\",t[t.VEC_2=1]=\"VEC_2\",t[t.VEC_3=2]=\"VEC_3\"})(br||(br={}));function w_(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,c=u.geometryOffsets,h=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g<t.numGeometries;g++){let v=t.geometryType(g);switch(v){case Ot.POINT:{let x,b;if(d)x=m[s++],b=m[s++];else if(t.vertexBufferType===br.MORTON){let w=m[f[o++]],_=bc(w,l.numBits,l.coordinateShift);x=_.x,b=_.y}else{let w=f[o++]*2;x=m[w],b=m[w+1]}e[a++]=[[new T(x,b)]],c&&n++,h&&r++,p&&i++}break;case Ot.MULTIPOINT:{let x=c[n]-c[n-1];n++;let b;if(d){b=Array(x);for(let w=0;w<x;w++){let _=m[s++],S=m[s++];b[w]=new T(_,S)}}else b=Ir(t.vertexBufferType,m,f,o,x,!1,l),o+=x;e[a++]=b.map(w=>[w]),r+=x,i+=x}break;case Ot.LINESTRING:{let x;y?(x=p[i]-p[i-1],i++):x=h[r]-h[r-1],r++;let b;d?(b=Qr(m,s,x,!1),s+=x*2):(b=Ir(t.vertexBufferType,m,f,o,x,!1,l),o+=x),e[a++]=[b],c&&n++}break;case Ot.POLYGON:{let x=h[r]-h[r-1];r++;let b=Array(x-1),w,_=p[i]-p[i-1];if(i++,d){w=Qr(m,s,_,!0),s+=_*2;for(let S=0;S<b.length;S++)_=p[i]-p[i-1],i++,b[S]=Qr(m,s,_,!0),s+=_*2}else{w=Ir(t.vertexBufferType,m,f,o,_,!0,l),o+=_;for(let S=0;S<b.length;S++)_=p[i]-p[i-1],i++,b[S]=Ir(t.vertexBufferType,m,f,o,_,!0,l),o+=_}e[a++]=[w].concat(b),c&&n++}break;case Ot.MULTILINESTRING:{let x=c[n]-c[n-1];n++;let b=Array(x);for(let w=0;w<x;w++){let _;if(y?(_=p[i]-p[i-1],i++):_=h[r]-h[r-1],r++,d)b[w]=Qr(m,s,_,!1),s+=_*2;else{let S=Ir(t.vertexBufferType,m,f,o,_,!1,l);b[w]=S,o+=_}}e[a++]=b}break;case Ot.MULTIPOLYGON:{let x=c[n]-c[n-1];n++;let b=Array(x);for(let w=0;w<x;w++){let _=h[r]-h[r-1];r++;let S,A=Array(_-1),E=p[i]-p[i-1];i++,d?(S=Qr(m,s,E,!0),s+=E*2):(S=Ir(t.vertexBufferType,m,f,o,E,!0,l),o+=E);for(let R=0;R<A.length;R++){let M=p[i]-p[i-1];i++,d?(A[R]=Qr(m,s,M,!0),s+=M*2):(A[R]=Ir(t.vertexBufferType,m,f,o,M,!0,l),o+=M)}b[w]=[S].concat(A)}e[a++]=b.flat()}break;default:throw Error(`The specified geometry type (${v}) is currently not supported.`)}}return e}function Ir(t,e,r,i,n,a,s){return t===br.MORTON?D_(e,r,i,n,a,s):__(e,r,i,n,a)}function Qr(t,e,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let s=t[e+a],o=t[e+a+1];n[a/2]=new T(s,o)}return i&&(n[n.length-1]=n[0]),n}function __(t,e,r,i,n){let a=Array(n?i+1:i);for(let s=0;s<i*2;s+=2){let o=e[r+s/2]*2,l=t[o],u=t[o+1];a[s/2]=new T(l,u)}return n&&(a[a.length-1]=a[0]),a}function D_(t,e,r,i,n,a){let s=Array(n?i+1:i);for(let o=0;o<i;o++){let l=t[e[r+o]],u=bc(l,a.numBits,a.coordinateShift);s[o]=new T(u.x,u.y)}return n&&(s[s.length-1]=s[0]),s}var D0=class{constructor(t,e,r,i,n){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[t],i=this.vertexBuffer[r],n=bc(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return w_(this)}get mortonSettings(){return this._mortonSettings}};function S_(t,e,r,i,n){return new S0(t,e,br.VEC_2,r,i,n)}function A_(t,e,r,i,n,a){return new S0(t,e,br.MORTON,r,i,n,a)}var S0=class extends D0{constructor(t,e,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Ot.POLYGON||this._geometryType===Ot.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function A0(t,e,r,i){return new E0(br.VEC_2,t,e,r,i)}function E_(t,e,r,i,n){return new E0(br.MORTON,t,e,r,i,n)}var E0=class extends D0{constructor(t,e,r,i,n,a){super(t,r,i,n,a),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===Ot.POLYGON||this.geometryType(t)===Ot.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},T0=class{constructor(t,e,r,i){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error(\"Cannot convert GpuVector to coordinates without topology information\");let t=new Uint32Array(this.numGeometries);for(let e=0;e<this.numGeometries;e++)t[e]=this.geometryType(e);return A0(t,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function mf(t,e,r,i,n,a){return new T_(t,e,r,i,n,a)}var T_=class extends T0{constructor(t,e,r,i,n,a){super(r,i,n,a),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function gf(t,e,r,i,n){return new I_(t,e,r,i,n)}var I_=class extends T0{constructor(t,e,r,i,n){super(e,r,i,n),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function k_(t,e,r,i,n){let a=yt(t,r),s=Ms(a,i,t,r),o,l,u,c;if(s===ht.CONST){let x=xc(t,r,a),b,w,_,S;for(let A=0;A<e-1;A++){let E=yt(t,r);switch(E.physicalStreamType){case Et.LENGTH:switch(E.logicalStreamType.lengthType){case Ft.GEOMETRIES:b=hr(t,r,E);break;case Ft.PARTS:w=hr(t,r,E);break;case Ft.RINGS:_=hr(t,r,E);break;case Ft.TRIANGLES:S=hr(t,r,E)}break;case Et.OFFSET:switch(E.logicalStreamType.offsetType){case Me.VERTEX:o=Nt(t,r,E);break;case Me.INDEX:c=Nt(t,r,E)}break;case Et.DATA:if(Yt.VERTEX===E.logicalStreamType.dictionaryType)l=os(t,r,E,n);else{let R=E;u={numBits:R.numBits,coordinateShift:R.coordinateShift},l=Nt(t,r,E,n)}}}return c?b!==void 0||w!==void 0?mf(i,x,S,c,l,{geometryOffsets:b,partOffsets:w,ringOffsets:_}):mf(i,x,S,c,l):u===void 0?S_(i,x,{geometryOffsets:b,partOffsets:w,ringOffsets:_},o,l):A_(i,x,{geometryOffsets:b,partOffsets:w,ringOffsets:_},o,l,u)}let h=Nt(t,r,a),p,f,d,y;for(let x=0;x<e-1;x++){let b=yt(t,r);switch(b.physicalStreamType){case Et.LENGTH:switch(b.logicalStreamType.lengthType){case Ft.GEOMETRIES:p=Nt(t,r,b);break;case Ft.PARTS:f=Nt(t,r,b);break;case Ft.RINGS:d=Nt(t,r,b);break;case Ft.TRIANGLES:y=hr(t,r,b)}break;case Et.OFFSET:switch(b.logicalStreamType.offsetType){case Me.VERTEX:o=Nt(t,r,b);break;case Me.INDEX:c=Nt(t,r,b)}break;case Et.DATA:if(Yt.VERTEX===b.logicalStreamType.dictionaryType)l=os(t,r,b,n);else{let w=b;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=Nt(t,r,b,n)}}}let m,g,v;return p?(m=zo(h,p,2),f&&d?(g=xf(h,m,f,!1),v=F_(h,m,g,d)):f&&(g=C_(h,m,f))):f&&d?(g=zo(h,f,1),v=xf(h,g,d,!0)):f&&(g=zo(h,f,0)),c&&!g?gf(h,y,c,l):c?gf(h,y,c,l,{geometryOffsets:m,partOffsets:g,ringOffsets:v}):u===void 0?A0(h,{geometryOffsets:m,partOffsets:g,ringOffsets:v},o,l):E_(h,{geometryOffsets:m,partOffsets:g,ringOffsets:v},o,l,u)}function zo(t,e,r){let i=new Uint32Array(t.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<t.length;s++)n=i[s+1]=n+(t[s]>r?e[a++]:1);return i}function xf(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<t.length;l++){let u=t[l],c=e[l+1]-e[l];if(u===5||u===2||i&&(u===4||u===1))for(let h=0;h<c;h++)a=n[s++]=a+r[o++];else for(let h=0;h<c;h++)n[s++]=++a}return n}function C_(t,e,r){let i=new Uint32Array(e[e.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<t.length;o++){let l=t[o],u=e[o+1]-e[o];if(l===4||l===1)for(let c=0;c<u;c++)n=i[a++]=n+r[s++];else for(let c=0;c<u;c++)i[a++]=++n}return i}function F_(t,e,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<t.length;u++){let c=t[u],h=e[u+1]-e[u];if(c!==0&&c!==3)for(let p=0;p<h;p++){let f=r[s]-r[s-1];s++;for(let d=0;d<f;d++)a=n[o++]=a+i[l++]}else for(let p=0;p<h;p++)n[o++]=++a,s++}return n}var M_=class extends Ur{constructor(t,e,r){super(t,e.getBuffer(),r),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}},P_=class extends Fs{getValueFromBuffer(t){return this.dataBuffer[t]}},I0=class extends Ur{constructor(t,e,r,i){super(t,i?BigInt64Array.of(e):BigUint64Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},wc=class extends Ur{constructor(t,e,r,i){super(t,r,i),this.offsetBuffer=e}},vf=class extends wc{constructor(t,e,r,i){super(t,e,r,i??e.length-1)}getValueFromBuffer(t){let e=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return gc(this.dataBuffer,e,r)}},di=class extends wc{constructor(t,e,r,i,n){super(t,r,i,n??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return gc(this.dataBuffer,r,i)}};function B_(t,e){let r=0;for(let i=0;i<e.length;i++){let n=e[i];n===255?(r++,i++):r+=t[n]}return r}function L_(t,e,r){let i=new Uint32Array(e.length);for(let s=1;s<e.length;s++)i[s]=i[s-1]+e[s-1];let n=new Uint8Array(B_(e,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(o===255)s++,n[a++]=r[s];else{let l=e[o],u=i[o];for(;l-- >0;)n[a++]=t[u++]}}return n}var k0=class extends wc{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s??e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return gc(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),L_(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i<t.length;i++){let n=t[i];e[i-1]=n-r,r=n}return e}};function C0(t,e,r,i,n){let a,s,o,l,u,c=n,h,p;for(let f=0;f<i;f++){let d=yt(e,r);switch(d.physicalStreamType){case Et.PRESENT:{let y=new Se(Fi(e,d.numValues,d.byteLength,r),d.numValues);c=n??y;break}case Et.OFFSET:s=Nt(e,r,d,void 0,c);break;case Et.LENGTH:{let y=hr(e,r,d);Ft.DICTIONARY===d.logicalStreamType.lengthType?a=y:Ft.SYMBOL===d.logicalStreamType.lengthType?l=y:h=y;break}case Et.DATA:{let y=e.subarray(r.get(),r.get()+d.byteLength);r.add(d.byteLength);let m=d.logicalStreamType.dictionaryType;Yt.FSST===m?u=y:Yt.SINGLE===m||Yt.SHARED===m?o=y:Yt.NONE===m&&(p=y);break}}}return z_(t,u,s,a,o,l,c)??V_(t,o,s,a,c)??O_(t,h,p,s,c)}function z_(t,e,r,i,n,a,s){if(e){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column \"${t}\"`);return new k0(t,r,i,n,a,e,s)}}function V_(t,e,r,i,n){if(e){if(!r||!i)throw Error(`Incomplete dictionary string column \"${t}\"`);return n?new di(t,r,i,e,n):new di(t,r,i,e)}}function O_(t,e,r,i,n){if(e&&r){if(i)return n?new di(t,i,e,r,n):new di(t,i,e,r);if(n&&n.size()!==e.length-1){let a=new Uint32Array(n.size()),s=0;for(let o=0;o<n.size();o++)n.get(o)?a[o]=s++:a[o]=0;return new di(t,a,e,r,n)}return n?new vf(t,e,r,n):new vf(t,e,r)}}function R_(t,e,r,i){let n,a,s,o,l=!1;for(;!l;){let f=yt(t,e);switch(f.physicalStreamType){case Et.LENGTH:Ft.DICTIONARY===f.logicalStreamType.lengthType?n=hr(t,e,f):s=hr(t,e,f);break;case Et.DATA:Yt.SINGLE===f.logicalStreamType.dictionaryType||Yt.SHARED===f.logicalStreamType.dictionaryType?(a=t.subarray(e.get(),e.get()+f.byteLength),l=!0):o=t.subarray(e.get(),e.get()+f.byteLength),e.add(f.byteLength)}}if(r.type!==\"complexType\")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column \"${r.name}\"`);let u=r.complexType.children,c=[],h=o?{}:void 0,p=0;for(let f of u){let d=qt(t,e,1)[0];if(d===0)continue;let y=f.name?`${r.name}${f.name}`:r.name;if(i&&!i.has(y)){p0(d,t,e);continue}if(f.type!==\"scalarField\"||f.scalarField.physicalType!==et.STRING)throw Error(\"Currently only scalar string fields are implemented for a struct.\");if(d>1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let v=yt(t,e);m=new Se(Fi(t,v.numValues,v.byteLength,e),v.numValues)}let g=Nt(t,e,yt(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column \"${y}\"`);c[p++]=new k0(y,g,n,a,s,o,m,h)}else c[p++]=new di(y,g,n,a,m)}return c}var bf=class extends Ur{constructor(t,e,r){super(t,new Uint8Array,r??e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Pe;(function(t){t[t.STRING=1]=\"STRING\",t[t.INT32=2]=\"INT32\",t[t.UINT32=4]=\"UINT32\",t[t.INT64=8]=\"INT64\",t[t.UINT64=16]=\"UINT64\",t[t.FLOAT=32]=\"FLOAT\",t[t.DOUBLE=64]=\"DOUBLE\",t[t.PRESENCE=128]=\"PRESENCE\"})(Pe||(Pe={}));var dr;(function(t){t[t.FALSE=0]=\"FALSE\",t[t.TRUE=1]=\"TRUE\",t[t.START_MAP=2]=\"START_MAP\",t[t.START_LIST=3]=\"START_LIST\",t[t.COUNT=4]=\"COUNT\"})(dr||(dr={}));function $_(t,e,r,i){let n=N_(r);if(i===0)return n.map(c=>new bf(c,[]));let a=U_(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let c=0;c<n.length;c++){let h=Y_(a,c,s,l,u);o.push(new bf(n[c],h.value,h.nullabilityBuffer)),l=h.countsEnd,u=h.valuesEnd}return o}function N_(t){let e=t.type===\"complexType\"?t.complexType.children:void 0;return!e||e.length===0?[t.name]:e.map(r=>t.name+(r.name??\"\"))}function U_(t,e,r){let i=t[e.get()];e.add(1);let n=Nt(t,e,yt(t,e)),a=r-1,s=[];i&Pe.STRING&&(a-=j_(t,e,s)),a-=q_(t,e,i,s),a-=G_(t,e,i,s);let o,l=0;if(i&Pe.PRESENCE){let c=X_(t,e);o=c.value,l=c.count,a--}let u=new Uint32Array;if(a>0&&(u=Nt(t,e,yt(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function j_(t,e,r){let i=t[e.get()];e.add(1);let n=C0(\"\",t,e,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function q_(t,e,r,i){let n=0;return r&Pe.INT32?(li(i,os(t,e,yt(t,e))),n++):r&Pe.INT64&&(li(i,g0(t,e,yt(t,e))),n++),r&Pe.UINT32?(li(i,Nt(t,e,yt(t,e))),n++):r&Pe.UINT64&&(li(i,vc(t,e,yt(t,e))),n++),n}function G_(t,e,r,i){let n=0;return r&Pe.FLOAT&&(li(i,f0(t,e,yt(t,e).numValues)),n++),r&Pe.DOUBLE&&(li(i,d0(t,e,yt(t,e).numValues)),n++),n}function X_(t,e){let r=yt(t,e);if(r.physicalStreamType!==Et.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=e.get(),a=new Se(Fi(t,i,r.byteLength,e),i);return e.set(n+r.byteLength),{value:a,count:i}}function Y_(t,e,r,i,n){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=t,u=e*r,c=r,h;if(o){h=new Se(new Uint8Array(Math.ceil(r/8)),r),c=0;for(let v=0;v<r;v++)o.get(u+v)&&(h.set(v,!0),c++)}let p=i+c;if(p>a.length)throw Error(\"Merged map counts underflow while decoding child streams\");let f=Array(r),d=i,y=n;for(let v=0;v<r;v++){if(o&&!o.get(u+v)){f[v]=null;continue}let x=y+a[d++];if(x>s.length)throw Error(\"Map value stream underflow while decoding feature payload\");let b=W_(s,y,x,l);f[v]=b.value,y=b.nextIndex}let m=0;for(let v=i;v<p;v++)m+=a[v];let g=n+m;if(y!==g)throw Error(\"Unused flattened map values remain after decode\");return{value:f,nullabilityBuffer:h,countsEnd:p,valuesEnd:g}}function W_(t,e,r,i){return r-e===1||t[e]===dr.START_LIST?_c(t,e,r,i):F0(t,e,r,i)}function F0(t,e,r,i){let n=Object.create(null),a=e;for(;a<r;){let s=M0(t[a++],i);if(typeof s!=\"string\")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=_c(t,a,r,i);n[s]=o.value,a=o.nextIndex}return{value:n,nextIndex:a}}function _c(t,e,r,i){if(e>=r)throw Error(\"Unexpected end of map value stream\");let n=t[e];if(n===dr.FALSE)return{value:!1,nextIndex:e+1};if(n===dr.TRUE)return{value:!0,nextIndex:e+1};if(n===dr.START_MAP){let a=wf(t,e,r);return{value:F0(t,e+2,a,i).value,nextIndex:a}}if(n===dr.START_LIST){let a=wf(t,e,r),s=[],o=e+2;for(;o<a;){let l=_c(t,o,a,i);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:a}}return{value:M0(n,i),nextIndex:e+1}}function wf(t,e,r){if(e+1>=r)throw Error(\"Missing length for nested map/list payload\");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error(\"Nested payload exceeds containing payload bounds\");return n}function M0(t,e){let r=t-dr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function li(t,e){for(let r of e)t.push(r)}function Z_(t,e,r,i,n,a){return r.type===\"scalarType\"?a&&!a.has(r.name)?(p0(i,t,e),null):H_(i,t,e,n,r.scalarType,r):r.complexType?.physicalType===gr.MAP?$_(t,e,r,i):i===0?null:R_(t,e,r,a)}function H_(t,e,r,i,n,a){let s;if(t===0)return null;if(a.nullable){let l=yt(e,r),u=l.numValues,c=r.get(),h=Fi(e,u,l.byteLength,r);r.set(c+l.byteLength),s=new Se(h,l.numValues)}let o=s??i;switch(n.physicalType){case et.UINT_32:case et.INT_32:return eD(e,r,a,n,o);case et.STRING:{let l=a.nullable?t-1:t;return C0(a.name,e,r,l,s)??null}case et.BOOLEAN:return K_(e,r,a,i,o);case et.UINT_64:case et.INT_64:return tD(e,r,a,o,n);case et.FLOAT:return J_(e,r,a,o);case et.DOUBLE:return Q_(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function K_(t,e,r,i,n){let a=yt(t,e),s=a.numValues,o=e.get(),l=Wn(n)?n:void 0,u=Fi(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let c=new Se(u,s);return new M_(r.name,c,n)}function J_(t,e,r,i){let n=yt(t,e),a=Wn(i)?i:void 0,s=f0(t,e,n.numValues,a);return new P_(r.name,s,i)}function Q_(t,e,r,i){let n=yt(t,e),a=Wn(i)?i:void 0,s=d0(t,e,n.numValues,a);return new uc(r.name,s,i)}function tD(t,e,r,i,n){let a=yt(t,e),s=Ms(a,i,t,e,\"int64\"),o=n.physicalType===et.INT_64;if(s===ht.FLAT){let u=Wn(i)?i:void 0,c=o?g0(t,e,a,u):vc(t,e,a,u);return new w0(r.name,c,i)}if(s===ht.SEQUENCE){let u=m0(t,e,a);return new _0(r.name,u[0],u[1],a.numRleValues,o)}let l=o?d_(t,e,a):x0(t,e,a);return new I0(r.name,l,i,o)}function eD(t,e,r,i,n){let a=yt(t,e),s=Ms(a,n,t,e),o=i.physicalType===et.INT_32;if(s===ht.FLAT){let u=Wn(n)?n:void 0,c=o?os(t,e,a,void 0,u):Nt(t,e,a,void 0,u);return new lc(r.name,c,n)}if(s===ht.SEQUENCE){let u=y0(t,e,a);return new cc(r.name,u[0],u[1],a.numRleValues,o)}let l=o?h_(t,e,a):xc(t,e,a);return new hc(r.name,l,n,o)}function Wn(t){return t instanceof Se}var Lt={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function P0(t){switch(t){case Lt.ID:case Lt.ID|Lt.ID_NULLABLE:case Lt.ID|Lt.ID_LONG:case Lt.ID|Lt.ID_LONG|Lt.ID_NULLABLE:return{nullable:(t&Lt.ID_NULLABLE)!==0,columnScope:ln.FEATURE,type:\"scalarType\",scalarType:{longID:(t&Lt.ID_LONG)!==0,type:\"logicalType\",logicalType:s0.ID}};case Lt.GEOMETRY:return{nullable:!1,columnScope:ln.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:gr.GEOMETRY,children:[]}};case Lt.STRUCT:return{nullable:!1,columnScope:ln.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:gr.STRUCT,children:[]}};case Lt.MAP:return{nullable:!0,columnScope:ln.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:gr.MAP,children:[]}};default:return sD(t)}}function rD(t){return t>=Lt.SCALAR_BASE}function B0(t){return t===Lt.STRUCT||t===Lt.MAP}function iD(t){if(t.type===\"scalarType\"){let e=t.scalarType;if(e.type===\"physicalType\")switch(e.physicalType){case et.BOOLEAN:case et.INT_8:case et.UINT_8:case et.INT_32:case et.UINT_32:case et.INT_64:case et.UINT_64:case et.FLOAT:case et.DOUBLE:return!1;case et.STRING:return!0;default:return!1}if(e.type===\"logicalType\")return!1}else if(t.type===\"complexType\"){let e=t.complexType;if(e.type===\"physicalType\")switch(e.physicalType){case gr.GEOMETRY:case gr.STRUCT:case gr.MAP:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",t),!1}function nD(t){return t.type===\"scalarType\"&&t.scalarType?.type===\"logicalType\"&&t.scalarType.logicalType===s0.ID}function aD(t){return t.type===\"complexType\"&&t.complexType?.type===\"physicalType\"&&t.complexType.physicalType===gr.GEOMETRY}function sD(t){let e;switch(t){case 10:case 11:e=et.BOOLEAN;break;case 12:case 13:e=et.INT_8;break;case 14:case 15:e=et.UINT_8;break;case 16:case 17:e=et.INT_32;break;case 18:case 19:e=et.UINT_32;break;case 20:case 21:e=et.INT_64;break;case 22:case 23:e=et.UINT_64;break;case 24:case 25:e=et.FLOAT;break;case 26:case 27:e=et.DOUBLE;break;case 28:case 29:e=et.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:ln.FEATURE,type:\"scalarType\",scalarType:{longID:!1,type:\"physicalType\",physicalType:e}}}var oD=new TextDecoder,_f=\"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)\";function Dc(t,e){let r=qt(t,e,1)[0];if(r===0)return\"\";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),oD.decode(a)}function lD(t){let e=t.name,r=t.nullable;return t.type===\"scalarType\"?{type:\"scalarField\",scalarField:t.scalarType,name:e,nullable:r}:{type:\"complexField\",complexField:t.complexType,name:e,nullable:r}}function L0(t,e){let r=qt(t,e,1)[0]>>>0,i=r>=Lt.SCALAR_BASE?P0(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:Dc(t,e)};if(n.type===\"complexType\"&&B0(r)){let a=n.complexType,s=qt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o<s;o++)a.children[o]=L0(t,e)}return lD(n)}function uD(t,e){let r=qt(t,e,1)[0]>>>0,i=P0(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${_f}`);let n;if(rD(r))n=Dc(t,e);else if(r<Lt.GEOMETRY)n=\"id\";else if(r===Lt.GEOMETRY)n=\"geometry\";else throw Error(`Unsupported column type code ${r}. Supported: ${_f}`);let a={...i,name:n};if(a.type===\"complexType\"&&B0(r)){let s=qt(t,e,1)[0]>>>0,o=a.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=L0(t,e)}return a}function cD(t,e){let r={};r.featureTables=[];let i={};if(i.name=Dc(t,e),i.name.length===0)throw Error(\"Missing layer name\");let n=qt(t,e,1)[0]>>>0,a=qt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s<a;s++)i.columns[s]=uD(t,e);return r.featureTables.push(i),[r,n]}function hD(t,e,r=!0){let i=new o0(0),n=[];for(;i.get()<t.length;){let a=qt(t,i,1)[0]>>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=qt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=cD(t,i),c=l.featureTables[0],h=null,p=null,f=[],d=0;for(let m of c.columns){let g=m.name;if(nD(m)){let v=null;if(m.nullable){let b=yt(t,i),w=i.get(),_=Fi(t,b.numValues,b.byteLength,i);i.set(w+b.byteLength),v=new Se(_,b.numValues)}let x=yt(t,i);d=v?v.size():x.decompressedCount,h=pD(t,m,i,g,x,v??d,r)}else if(aD(m)){let v=qt(t,i,1)[0];if(d===0){let x=i.get();d=yt(t,i).decompressedCount,i.set(x)}e&&(e.scale=e.extent/u),p=k_(t,v,i,d,e)}else{let v=iD(m)?qt(t,i,1)[0]:1;if(v===0)continue;let x=Z_(t,i,m,v,d,void 0);if(x)if(Array.isArray(x))for(let b of x)f.push(b);else f.push(x)}}let y=new z6(c.name,p,h,f,u);n.push(y),i.set(s)}return n}function pD(t,e,r,i,n,a,s=!1){let o=e.scalarType?.longID?et.UINT_64:et.UINT_32,l=typeof a==\"number\"?void 0:a,u=Ms(n,a,t,r,o===et.UINT_64?\"int64\":\"int32\");if(o===et.UINT_32)switch(u){case ht.FLAT:return new lc(i,Nt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let c=y0(t,r,n);return new cc(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new hc(i,xc(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new uc(i,p_(t,r,n,l),a):new w0(i,vc(t,r,n,l),a);case ht.SEQUENCE:{let c=m0(t,r,n);return new _0(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new I0(i,x0(t,r,n),a,!1)}throw Error(\"Vector type not supported for id column.\")}var Vo=l0(fc);Vo/32*4,3*Vo/256+Vo|0;var fD=class{constructor(t,e){switch(this._featureData=t,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Ot.POINT:case Ot.MULTIPOINT:this.type=1;break;case Ot.LINESTRING:case Ot.MULTILINESTRING:this.type=2;break;case Ot.POLYGON:case Ot.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new T(i.x,i.y));t.push(r)}return t}},dD=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new fD(this.features[t],this.extent)}},z0=class{constructor(t){this.layers={};let e=hD(new Uint8Array(t));this.layers=e.reduce((r,i)=>({...r,[i.name]:new dD(i)}),{})}},V0=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Uo(rt,16,0),this.grid3D=new Uo(rt,16,0),this.featureIndexArray=new vy,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let c of l)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding===\"mlt\"?this.vtLayers=new z0(this.rawTileData).layers:this.vtLayers=new l1(new M1(this.rawTileData)).layers,this.sourceLayerCoder=new n0(this.vtLayers?Object.keys(this.vtLayers).sort():[iu])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=rt/t.tileSize/t.scale,s=Sn(n.filter,\"queryRenderedFeatures filter\",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Cn.fromPoints(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=Cn.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(y,m,g,v)=>E2(t.cameraQueryGeometry,y-l,m-l,g+l,v+l));for(let y of p)c.push(y);c.sort(mD);let f={},d;for(let y of c){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,t.worldCoordinateHelper,i,(v,x,b)=>(g||(g=Nr(v)),x.queryIntersectsFeature({queryGeometry:o,feature:v,featureState:b,geometry:g,zoom:this.z,projectedCamera:t.projectedCamera,pixelsToTileUnits:a,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,c,h){let p=this.bucketLayerIDs[e];if(a&&!p.some(m=>a.has(m)))return;let f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){let m=Ci(d,!0);if(!n.filter(new ut(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new ut(this.tileID.overscaledZ),d))return;let y=this.getId(d,f);for(let m of p){if(a&&!a.has(m))continue;let g=o[m];if(!g)continue;let v={};y&&c&&(v=c.getState(g.sourceLayer||\"_geojsonTileLayer\",y));let x=te({},l[m]);x.paint=Df(x.paint,g.paint,d,v,s),x.layout=Df(x.layout,g.layout,d,v,s);let b=!h||h(d,g,v);if(!b)continue;let w=new L6(d,this.z,this.x,this.y,y,u);w.layer=x;let _=t[m];_===void 0&&(_=t[m]=[]),_.push({featureIndex:i,feature:w,intersectionZ:b})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=Sn(n.filterSpec,\"queryRenderedFeatures symbol filter\",n.globalState);for(let c of t)this.loadMatchingFeature(l,r,i,c,u,a,s,o,e,n.worldCoordinateHelper);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;if(this.promoteId){let i=typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[e];r=t.properties[i],typeof r==\"boolean\"&&(r=Number(r)),r===void 0&&t.properties?.cluster&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};B(\"FeatureIndex\",V0,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});function yD(t){return typeof t==\"object\"&&!!t&&\"evaluate\"in t}function Df(t,e,r,i,n){return Na(t,(a,s)=>{let o=e instanceof _s?e.get(s):null;return yD(o)?o.evaluate(r,i,void 0,n):o})}function mD(t,e){return e-t}var gD=class{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(t,e,r){for(let n of t){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=E6(n,r);a._featureFilter=Sn(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of e)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource={};let i=gx(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(h=>this._layers[h.id]),s=a[0];if(s.isHidden())continue;let o=s.source||\"\",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||\"_geojsonTileLayer\",c=l[u];c||(c=l[u]=[]),c.push(a)}}},O0=class{constructor(t){let e={},r=[];for(let s in t){let o=e[s]={};for(let l in t[s]){let u=t[s][l];o[l]={};for(let c in u){let h=u[c];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let p={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(p),o[l][c]={rect:p,metrics:h.metrics}}}}let{w:i,h:n}=P1(r),a=new Bl({width:i||1,height:n||1});for(let s in t)for(let o in t[s]){let l=t[s][o];for(let u in l){let c=l[u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let h=e[s][o][u].rect;Bl.copy(c.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},c.bitmap)}}this.image=a,this.positions=e}};B(\"GlyphAtlas\",O0);var R0=class{constructor(t){this.tileID=new As(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}async parse(t,e,r,i,n){this.data=t,this.collisionBoxArray=new uy;let a=new n0(Object.keys(t.layers).sort()),s=new V0(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let A in u){let E=t.layers[A];if(!E)continue;E.version===1&&Pt(`Vector tile source \"${this.source}\" layer \"${A}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let R=a.encode(A),M=[];for(let V=0;V<E.length;V++){let U=E.feature(V),k=s.getId(U,A);M.push({feature:U,id:k,index:V,sourceLayerIndex:R})}for(let V of u[A]){let U=V[0];U.source!==this.source&&Pt(`layer.source = ${U.source} does not equal this.source = ${this.source}`),U.isHidden(this.zoom,!0)||(Sf(V,this.zoom,r),(o[U.id]=U.createBucket({index:s.bucketLayerIDs.length,layers:V,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:R,sourceID:this.source})).populate(M,l,this.tileID.canonical),s.bucketLayerIDs.push(V.map(k=>k.id)))}}let c=Na(l.glyphDependencies,A=>Na(A,E=>Object.keys(E)));for(let A of this.inFlightDependencies)A?.abort();this.inFlightDependencies=[];let h=Promise.resolve({});if(Object.keys(c).length){let A=new AbortController;this.inFlightDependencies.push(A),h=i.sendAsync({type:\"GG\",data:{stacks:c,source:this.source,tileID:this.tileID,type:\"glyphs\"}},A)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:\"GI\",data:{icons:p,source:this.source,tileID:this.tileID,type:\"icons\"}},A)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let A=new AbortController;this.inFlightDependencies.push(A),y=i.sendAsync({type:\"GI\",data:{icons:d,source:this.source,tileID:this.tileID,type:\"patterns\"}},A)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:\"GDA\",data:{dashes:m}},A)}let[v,x,b,w]=await Promise.all([h,f,y,g]),_=new O0(v),S=new L1(x,b);for(let A in o){let E=o[A];E.hasDependencies&&(Sf(E.layers,this.zoom,r),E.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:v,glyphPositions:_.positions,iconMap:x,iconPositions:S.iconPositions,patternMap:b,patternPositions:S.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:S,dashPositions:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?_.positions:null}}};function Sf(t,e,r){let i=new ut(e);for(let n of t)n.recalculate(i,r)}var $0=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e?.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},xD=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}},N0=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},vD=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new T(e.x,e.y)))}},bD=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},wD=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function _D(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l<t.length;l++){let u=t.feature(l),c=u.loadGeometry();for(let p of c)for(let f of p)f.x=f.x*n-a,f.y=f.y*n-s;let h=Math.max(128,Math.round(128*i/4096));c=G3(c,u.type,-h,-h,i+h,i+h),c.length!==0&&o.push(new vD(u.type,c,u.properties,u.id,i))}return new bD(o,t.name,i)}var DD=class{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new $0,this.overzoomedTileResultCache=new xD(1e3)}loadVectorTile(t,e){try{return{vectorTile:t.encoding===\"mlt\"?new z0(e):new l1(new M1(e)),rawData:e}}catch(r){let i=new Uint8Array(e),n=i[0]===31&&i[1]===139,a=`Unable to parse the tile at ${t.request.url}, `;throw a+=n?\"please make sure the data is not gzipped and that you have configured the relevant header in the server\":`got error: ${Ra(r).message}`,Error(a)}}async loadTile(t){let{uid:e,overzoomParameters:r}=t;r&&(t.request=r.overzoomRequest);let i=this._startRequestTiming(t),n=new R0(t);this.tileState.startLoading(e,n);let a=new AbortController;n.abort=a;try{let s=await Gx(t.request,a),o=this.tileState.getLoaded(e);if(t.etag&&t.etag===s.etag&&o?.etag===s.etag)return this.tileState.finishLoading(e),this._getEtagUnmodifiedResult(s,i);let l=this.loadVectorTile(t,s.data);if(this.tileState.finishLoading(e),!l)return null;let{vectorTile:u,rawData:c}=l;r&&({vectorTile:u,rawData:c}=this._getOverzoomTile(t,u));let h=this._getExpiryData(s),p=this._finishRequestTiming(i);n.vectorTile=u,n.etag=s.etag,this.tileState.markLoaded(e,n);let f={rawData:c,cacheControl:h,resourceTiming:p};return this.tileState.setParsing(e,f),await this._parseWorkerTile(n,t)}catch(s){throw this.tileState.finishLoading(e),this.tileState.markLoaded(e,n),s}}_getEtagUnmodifiedResult(t,e){return te({etagUnmodified:!0},this._getExpiryData(t),this._finishRequestTiming(e))}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r,o=e.overzoomParameters?\"mvt\":e.encoding;i=te({rawTileData:n.slice(0),encoding:o},i,a,s),this.tileState.removeParsing(t.uid)}else t.etag&&(i=te(i,{etag:t.etag}));return i}_getExpiryData({expires:t,cacheControl:e,etag:r}){let i={};return t&&(i.expires=t),e&&(i.cacheControl=e),r&&(i.etag=r),i}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new N0(t.request.url)}_finishRequestTiming(t){let e=t?.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){let{tileID:r,overzoomParameters:i}=t,{maxZoomTileID:n}=i,a=`${n.key}_${r.key}_${t.request?.url}`,s=this.overzoomedTileResultCache.get(a);if(s)return s;let o=new wD;for(let u of Object.values(e.layers)){let c=_D(u,n,r.canonical);c.length>0&&o.addLayer(c)}let l={vectorTile:o,rawData:i0(o).buffer};return this.overzoomedTileResultCache.set(a,l),l}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}},SD=class{constructor(){this.loaded={}}async loadTile(t){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,c=new Ky(e,du(i)?new ae({width:l,height:u},await _m(i,-2,-2,l,u)):i,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c}removeTile(t){let e=this.loaded,r=t.uid;e?.[r]&&delete e[r]}},Af=class{constructor(t){this.wraps=!1,this._crs=t,this._originX=t.tileMatrixSet.origin[0],this._originY=t.tileMatrixSet.origin[1],this._extent=t.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(t,e,r){let[i,n]=this._crs.projection.forward([t,e]);return new xe((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(t,e){let r=Qt(t,0,1),i=Qt(e,0,1),n=this._inverse(t,e)??this._inverse(r,i)??this._inverseTowardCenter(r,i)??this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection \"${this._crs.name}\" has no answer inside its tile matrix set.`);return new ft(n[0],Qt(n[1],-90,90))}hasLngLat(t,e){let r=this._inverse(t,e);return r!==null&&Math.abs(r[1])<=90}_inverse(t,e){let r=this._finiteInverse(t,e);if(!r)return null;let i=this._originX+t*this._extent,n=this._originY-e*this._extent,[a,s]=this._crs.projection.forward(r);return Math.hypot(a-i,s-n)<=.001*this._extent?r:null}_finiteInverse(t,e){let r;try{r=this._crs.projection.inverse([this._originX+t*this._extent,this._originY-e*this._extent])}catch{return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(t,e){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(t-.5)*a,.5+(e-.5)*a)?r=a:i=a}return this._inverse(.5+(t-.5)*r,.5+(e-.5)*r)}metersPerWorldUnit(t,e){return this._extent}worldZFromAltitude(t,e){return t/this._extent}get latitudeRange(){return this._latitudeRange??(this._latitudeRange=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)]),this._latitudeRange}_findLatitudeLimit(t){let e=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(e.lng,e.lat);if(!(r>0))return t;let i=Math.sign(t-e.lat);for(let n=e.lat;Math.abs(t-n)>1;n+=i)if(!(this._meridianStretch(e.lng,n+i)<=r))return n;return t}_meridianStretch(t,e){let[r,i]=this._crs.projection.forward([t,e]),[n,a]=this._crs.projection.forward([t,e>=0?e-.01:e+.01]);return Math.hypot(n-r,a-i)}},AD=class{forward(t){return[t[0],t[1]]}inverse(t){return[t[0],t[1]]}},ED=new class{constructor(){this.name=\"identity\",this.projection=new AD,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},lu=null,Oa=new Map;function TD(t){lu=t,Oa.clear()}function ID(t){if(!t.definition)return new Af(ED);if(!lu)Pt(\"GeoJSON sources are drawn in the wrong place: no projection handler is set in the workers, see `setProjectionHandler` in the custom CRS guide.\");else return Oa.has(t.definition)||Oa.set(t.definition,lu(t.definition)),new Af({name:t.name,definition:t.definition,projection:Oa.get(t.definition),tileMatrixSet:t.tileMatrixSet})}function uu(t,e){let r=([s,o,...l])=>{let{x:u,y:c}=e.worldFromLngLat(s,o);return[u,c,...l]},[i,n]=e.latitudeRange;if(i===-90&&n===90)return yi(t,r);let a=s=>s===i&&i>-90||s===n&&n<90;return yi(t,r,s=>{let o=!1,l=s.map(p=>p[1]>=i&&p[1]<=n?r(p):(o=!0,p));if(!o)return l;let u=[],c=0,h=NaN;for(let p=0;p<s.length;p++){let[f,d,...y]=s[p],m=Qt(d,i,n);if(m===h&&a(m)){let g=Math.ceil(Math.abs(f-c)/10);for(let v=1;v<g;v++)u.push(r([c+(f-c)*v/g,m]))}u.push(m===d?l[p]:r([f,m,...y])),c=f,h=m}return u})}function kD(t,e){return yi(t,([r,i,...n])=>{let a=e.lngLatFromWorld(r,i);return[a.lng,a.lat,...n]})}function CD(t,e){let r={...t};return t.add&&(r.add=t.add.map(i=>uu(i,e))),t.update&&(r.update=t.update.map(i=>i.newGeometry?{...i,newGeometry:uu(i.newGeometry,e)}:i)),r}function yi(t,e,r=i=>i.map(e)){if(!t||typeof t!=\"object\")return t;switch(t.type){case\"FeatureCollection\":return{...t,features:t.features.map(i=>yi(i,e,r))};case\"Feature\":return{...t,geometry:t.geometry?yi(t.geometry,e,r):t.geometry};case\"GeometryCollection\":return{...t,geometries:t.geometries.map(i=>yi(i,e,r))};case\"Point\":return{...t,coordinates:e(t.coordinates)};case\"MultiPoint\":return{...t,coordinates:t.coordinates.map(e)};case\"LineString\":return{...t,coordinates:r(t.coordinates)};case\"MultiLineString\":case\"Polygon\":return{...t,coordinates:t.coordinates.map(i=>r(i))};case\"MultiPolygon\":return{...t,coordinates:t.coordinates.map(i=>i.map(n=>r(n)))};default:return t}}var FD=class{constructor(t,e,r,i=MD){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new $0,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(\"Unable to parse the data into a cluster or geojson\");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new I6(n.features,{version:2,extent:rt});return{vectorTile:a,rawData:i0(a,\"__$json__:\").buffer}}async loadTile(t){let{uid:e}=t,r=new R0(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),await this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=te({rawTileData:n.slice(0),encoding:\"mvt\"},i),this.tileState.removeParsing(t.uid)}return i}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}async loadData(t){this._pendingRequest?.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return t.request&&(r.data=t.data),this._finishRequestTiming(e,t,r),r}catch(r){if(delete this._pendingRequest,!Pf(r))throw r;return{abandoned:!0}}}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new N0(t.request.url)}_finishRequestTiming(t,e,r){let i=t?.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return await this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async loadAndProcessGeoJSON(t,e){if(t.request&&(t.data=(await qx(t.request,e)).data),this._crsHelper=t.crs?ID(t.crs):void 0,t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source);let r=this._crsHelper?uu(t.data,this._crsHelper):t.data;this._geoJSONIndex=this._createGeoJSONIndex(r,t,this._crsHelper!==void 0)}else{if(t.dataDiff){this._geoJSONIndex??(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},t,this._crsHelper!==void 0));let r=this._crsHelper?CD(t.dataDiff,this._crsHelper):t.dataDiff;this._geoJSONIndex.updateData(r,this._getFilterPredicate(t.filter,t.source))}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,U0(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}}_filterGeoJSON(t,e,r){if(t.type!==\"FeatureCollection\")return t;let i=this._getFilterPredicate(e,r);return i?{type:\"FeatureCollection\",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!=\"boolean\"&&!t?.length)return;let r=Lr(t,`sources.${e}.filter`,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(r.result===\"error\")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(\", \"));return i=>r.value.evaluate({zoom:0},i)}async removeSource(t){this._pendingRequest?.abort()}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._toLngLat(this._geoJSONIndex.getClusterChildren(t.clusterId))}getClusterLeaves(t){return this._toLngLat(this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset))}_toLngLat(t){return this._crsHelper?t.map(e=>kD(e,this._crsHelper)):t}};function MD(t,e,r){return new sw(t,te(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:U0(e),coordinates:r?\"unitSquare\":\"lngLat\",wrap:!r}))}function U0({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,c]=e[l],h=Lr(c,`sources.${r}.clusterProperties.${l}[1]`),p=Lr(typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=h.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let c of o)u[c]=i[c].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let c of o)a.accumulated=l[c],l[c]=n[c].evaluate(a,s)},t.clusterOptions}async function PD(t){if(t.endsWith(\".mjs\")){await import(t);return}let e=await fetch(t,{credentials:\"same-origin\"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=await e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:\"text/javascript\"}));try{await import(i)}finally{URL.revokeObjectURL(i)}}else globalThis.eval(r)}var BD=class{constructor(t){this.self=t,this.actor=new Zx(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.importedScripts=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name \"${e}\" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=Rx,this.self.removeProtocol=$x,this.self.registerRTLTextPlugin=e=>{Ei.setMethods(e)},this.self.makeRequest=Ou,this.self.setProjectionHandler=TD,this.actor.registerMessageHandler(\"LDT\",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RDT\",async(e,r)=>{this._getDEMWorkerSource(e,r.source).removeTile(r)}),this.actor.registerMessageHandler(\"GCEZ\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)),this.actor.registerMessageHandler(\"GCC\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)),this.actor.registerMessageHandler(\"GCL\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)),this.actor.registerMessageHandler(\"LD\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler(\"LT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler(\"AT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler(\"RMT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler(\"RS\",async(e,r)=>{if(!this.workerSources[e]?.[r.type]?.[r.source])return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)}),this.actor.registerMessageHandler(\"RM\",async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler(\"SR\",async(e,r)=>{this.referrer=r}),this.actor.registerMessageHandler(\"PI\",async()=>{}),this.actor.registerMessageHandler(\"SRPS\",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler(\"IS\",(e,r)=>this._importScript(r)),this.actor.registerMessageHandler(\"SI\",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler(\"UL\",async(e,r)=>{this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler(\"UGS\",async(e,r)=>{let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]}),this.actor.registerMessageHandler(\"SL\",async(e,r)=>{this._getLayerIndex(e).replace(r,this._getGlobalState(e))})}async _importScript(t){let e=this.importedScripts.get(t);if(e)return e;let r=PD(t);this.importedScripts.set(t,r);try{await r}catch(i){throw this.importedScripts.delete(t),i}}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}async _setImages(t,e){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}}async _syncRTLPluginState(t,e){return await Ei.syncState(e,r=>this._importScript(r))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new gD),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case\"vector\":this.workerSources[t][e][r]=new DD(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case\"geojson\":this.workerSources[t][e][r]=new FD(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new SD),this.demWorkerSources[t][e]}};mi(self)&&(self.worker=new BD(self));})();\n";
|