@emuanalytics/flow-rdf-core 1.1.2 → 1.1.4

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.
Files changed (45) hide show
  1. package/dist/bundle/flow-rdf-core.umd.js +15 -0
  2. package/dist/bundle/flow-rdf-core.umd.js.map +1 -0
  3. package/dist/cjs/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  4. package/dist/cjs/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  5. package/dist/cjs/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  6. package/dist/cjs/lib/utils/type-checks.d.ts +1 -1
  7. package/dist/cjs/lib/utils/type-checks.d.ts.map +1 -1
  8. package/dist/cjs/lib/utils/type-checks.js +3 -2
  9. package/dist/cjs/lib/utils/type-checks.js.map +1 -1
  10. package/dist/cjs/umd.d.ts +4 -0
  11. package/dist/cjs/umd.d.ts.map +1 -0
  12. package/dist/cjs/umd.js +33 -0
  13. package/dist/cjs/umd.js.map +1 -0
  14. package/dist/esm/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  15. package/dist/esm/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  16. package/dist/esm/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  17. package/dist/esm/lib/utils/type-checks.d.ts +1 -1
  18. package/dist/esm/lib/utils/type-checks.d.ts.map +1 -1
  19. package/dist/esm/lib/utils/type-checks.js +2 -1
  20. package/dist/esm/lib/utils/type-checks.js.map +1 -1
  21. package/dist/esm/umd.d.ts +4 -0
  22. package/dist/esm/umd.d.ts.map +1 -0
  23. package/dist/esm/umd.js +4 -0
  24. package/dist/esm/umd.js.map +1 -0
  25. package/dist/esm5/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  26. package/dist/esm5/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  27. package/dist/esm5/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  28. package/dist/esm5/lib/utils/type-checks.d.ts +1 -1
  29. package/dist/esm5/lib/utils/type-checks.d.ts.map +1 -1
  30. package/dist/esm5/lib/utils/type-checks.js +2 -1
  31. package/dist/esm5/lib/utils/type-checks.js.map +1 -1
  32. package/dist/esm5/umd.d.ts +4 -0
  33. package/dist/esm5/umd.d.ts.map +1 -0
  34. package/dist/esm5/umd.js +4 -0
  35. package/dist/esm5/umd.js.map +1 -0
  36. package/dist/types/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  37. package/dist/types/lib/utils/type-checks.d.ts +1 -1
  38. package/dist/types/lib/utils/type-checks.d.ts.map +1 -1
  39. package/dist/types/umd.d.ts +4 -0
  40. package/dist/types/umd.d.ts.map +1 -0
  41. package/package.json +21 -5
  42. package/dist/bundle/flow-rdf-core.js +0 -42592
  43. package/dist/bundle/flow-rdf-core.js.map +0 -7
  44. package/dist/bundle/flow-rdf-core.min.js +0 -635
  45. package/dist/bundle/flow-rdf-core.min.js.map +0 -7
@@ -1,635 +0,0 @@
1
- var z1=Object.create;var of=Object.defineProperty;var O1=Object.getOwnPropertyDescriptor;var D1=Object.getOwnPropertyNames;var F1=Object.getPrototypeOf,R1=Object.prototype.hasOwnProperty;var L1=(o,r,n)=>r in o?of(o,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[r]=n;var Wt=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var B1=(o,r,n,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of D1(r))!R1.call(o,p)&&p!==n&&of(o,p,{get:()=>r[p],enumerable:!(u=O1(r,p))||u.enumerable});return o};var Yn=(o,r,n)=>(n=o!=null?z1(F1(o)):{},B1(r||!o||!o.__esModule?of(n,"default",{value:o,enumerable:!0}):n,o));var Ai=(o,r,n)=>(L1(o,typeof r!="symbol"?r+"":r,n),n);var Ff=Wt((lc,Df)=>{(function(o,r){typeof lc=="object"&&typeof Df=="object"?Df.exports=r():typeof define=="function"&&define.amd?define([],r):typeof lc=="object"?lc.Parsimmon=r():o.Parsimmon=r()})(typeof self<"u"?self:lc,function(){return function(o){var r={};function n(u){if(r[u])return r[u].exports;var p=r[u]={i:u,l:!1,exports:{}};return o[u].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=o,n.c=r,n.d=function(u,p,a){n.o(u,p)||Object.defineProperty(u,p,{configurable:!1,enumerable:!0,get:a})},n.r=function(u){Object.defineProperty(u,"__esModule",{value:!0})},n.n=function(u){var p=u&&u.__esModule?function(){return u.default}:function(){return u};return n.d(p,"a",p),p},n.o=function(u,p){return Object.prototype.hasOwnProperty.call(u,p)},n.p="",n(n.s=0)}([function(o,r,n){"use strict";function u(U){if(!(this instanceof u))return new u(U);this._=U}var p=u.prototype;function a(U,H){for(var he=0;he<U;he++)H(he)}function x(U,H,he){return function(ke,we){a(we.length,function(Ne){ke(we[Ne],Ne,we)})}(function(ke,we,Ne){H=U(H,ke,we,Ne)},he),H}function C(U,H){return x(function(he,ke,we,Ne){return he.concat([U(ke,we,Ne)])},[],H)}function D(U,H){var he={v:0,buf:H};return a(U,function(){var ke;he={v:he.v<<1|(ke=he.buf,ke[0]>>7),buf:function(we){var Ne=x(function(Le,Tt,Pt,lr){return Le.concat(Pt===lr.length-1?Buffer.from([Tt,0]).readUInt16BE(0):lr.readUInt16BE(Pt))},[],we);return Buffer.from(C(function(Le){return(Le<<1&65535)>>8},Ne))}(he.buf)}}),he}function R(){return typeof Buffer<"u"}function I(){if(!R())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function ee(U){I();var H=x(function(Ne,Le){return Ne+Le},0,U);if(H%8!=0)throw new Error("The bits ["+U.join(", ")+"] add up to "+H+" which is not an even number of bytes; the total should be divisible by 8");var he,ke=H/8,we=(he=function(Ne){return Ne>48},x(function(Ne,Le){return Ne||(he(Le)?Le:Ne)},null,U));if(we)throw new Error(we+" bit range requested exceeds 48 bit (6 byte) Number max.");return new u(function(Ne,Le){var Tt=ke+Le;return Tt>Ne.length?je(Le,ke.toString()+" bytes"):Pe(Tt,x(function(Pt,lr){var At=D(lr,Pt.buf);return{coll:Pt.coll.concat(At.v),buf:At.buf}},{coll:[],buf:Ne.slice(Le,Tt)},U).coll)})}function le(U,H){return new u(function(he,ke){return I(),ke+H>he.length?je(ke,H+" bytes for "+U):Pe(ke+H,he.slice(ke,ke+H))})}function _e(U,H){if(typeof(he=H)!="number"||Math.floor(he)!==he||H<0||H>6)throw new Error(U+" requires integer length in range [0, 6].");var he}function $e(U){return _e("uintBE",U),le("uintBE("+U+")",U).map(function(H){return H.readUIntBE(0,U)})}function Oe(U){return _e("uintLE",U),le("uintLE("+U+")",U).map(function(H){return H.readUIntLE(0,U)})}function De(U){return _e("intBE",U),le("intBE("+U+")",U).map(function(H){return H.readIntBE(0,U)})}function fe(U){return _e("intLE",U),le("intLE("+U+")",U).map(function(H){return H.readIntLE(0,U)})}function ve(U){return U instanceof u}function Ie(U){return{}.toString.call(U)==="[object Array]"}function We(U){return R()&&Buffer.isBuffer(U)}function Pe(U,H){return{status:!0,index:U,value:H,furthest:-1,expected:[]}}function je(U,H){return Ie(H)||(H=[H]),{status:!1,index:-1,value:null,furthest:U,expected:H}}function Bt(U,H){if(!H||U.furthest>H.furthest)return U;var he=U.furthest===H.furthest?function(ke,we){if(function(){if(u._supportsSet!==void 0)return u._supportsSet;var ai=typeof Set<"u";return u._supportsSet=ai,ai}()&&Array.from){for(var Ne=new Set(ke),Le=0;Le<we.length;Le++)Ne.add(we[Le]);var Tt=Array.from(Ne);return Tt.sort(),Tt}for(var Pt={},lr=0;lr<ke.length;lr++)Pt[ke[lr]]=!0;for(var At=0;At<we.length;At++)Pt[we[At]]=!0;var fi=[];for(var Rr in Pt)({}).hasOwnProperty.call(Pt,Rr)&&fi.push(Rr);return fi.sort(),fi}(U.expected,H.expected):H.expected;return{status:U.status,index:U.index,value:U.value,furthest:H.furthest,expected:he}}var vt={};function Qt(U,H){if(We(U))return{offset:H,line:-1,column:-1};U in vt||(vt[U]={});for(var he=vt[U],ke=0,we=0,Ne=0,Le=H;Le>=0;){if(Le in he){ke=he[Le].line,Ne===0&&(Ne=he[Le].lineStart);break}(U.charAt(Le)===`
2
- `||U.charAt(Le)==="\r"&&U.charAt(Le+1)!==`
3
- `)&&(we++,Ne===0&&(Ne=Le+1)),Le--}var Tt=ke+we,Pt=H-Ne;return he[H]={line:Tt,lineStart:Ne},{offset:H,line:Tt+1,column:Pt+1}}function tr(U){if(!ve(U))throw new Error("not a parser: "+U)}function Br(U,H){return typeof U=="string"?U.charAt(H):U[H]}function wr(U){if(typeof U!="number")throw new Error("not a number: "+U)}function It(U){if(typeof U!="function")throw new Error("not a function: "+U)}function st(U){if(typeof U!="string")throw new Error("not a string: "+U)}var Or=2,Er=3,ye=8,Fe=5*ye,Ue=4*ye,Be=" ";function He(U,H){return new Array(H+1).join(U)}function ut(U,H,he){var ke=H-U.length;return ke<=0?U:He(he,ke)+U}function lt(U,H,he,ke){return{from:U-H>0?U-H:0,to:U+he>ke?ke:U+he}}function yt(U,H){var he,ke,we,Ne,Le,Tt=H.index,Pt=Tt.offset,lr=1;if(Pt===U.length)return"Got the end of the input";if(We(U)){var At=Pt-Pt%ye,fi=Pt-At,Rr=lt(At,Fe,Ue+ye,U.length),ai=C(function(br){return C(function(q){return ut(q.toString(16),2,"0")},br)},function(br,q){var k=br.length,O=[],V=0;if(k<=q)return[br.slice()];for(var $=0;$<k;$++)O[V]||O.push([]),O[V].push(br[$]),($+1)%q==0&&V++;return O}(U.slice(Rr.from,Rr.to).toJSON().data,ye));Ne=function(br){return br.from===0&&br.to===1?{from:br.from,to:br.to}:{from:br.from/ye,to:Math.floor(br.to/ye)}}(Rr),ke=At/ye,he=3*fi,fi>=4&&(he+=1),lr=2,we=C(function(br){return br.length<=4?br.join(" "):br.slice(0,4).join(" ")+" "+br.slice(4).join(" ")},ai),(Le=(8*(Ne.to>0?Ne.to-1:Ne.to)).toString(16).length)<2&&(Le=2)}else{var Mi=U.split(/\r\n|[\n\r\u2028\u2029]/);he=Tt.column-1,ke=Tt.line-1,Ne=lt(ke,Or,Er,Mi.length),we=Mi.slice(Ne.from,Ne.to),Le=Ne.to.toString().length}var uo=ke-Ne.from;return We(U)&&(Le=(8*(Ne.to>0?Ne.to-1:Ne.to)).toString(16).length)<2&&(Le=2),x(function(br,q,k){var O,V=k===uo,$=V?"> ":Be;return O=We(U)?ut((8*(Ne.from+k)).toString(16),Le,"0"):ut((Ne.from+k+1).toString(),Le," "),[].concat(br,[$+O+" | "+q],V?[Be+He(" ",Le)+" | "+ut("",he," ")+He("^",lr)]:[])},[],we).join(`
4
- `)}function wt(U,H){return[`
5
- `,"-- PARSING FAILED "+He("-",50),`
6
-
7
- `,yt(U,H),`
8
-
9
- `,(he=H.expected,he.length===1?`Expected:
10
-
11
- `+he[0]:`Expected one of the following:
12
-
13
- `+he.join(", ")),`
14
- `].join("");var he}function Nt(U){return U.flags!==void 0?U.flags:[U.global?"g":"",U.ignoreCase?"i":"",U.multiline?"m":"",U.unicode?"u":"",U.sticky?"y":""].join("")}function Dt(){for(var U=[].slice.call(arguments),H=U.length,he=0;he<H;he+=1)tr(U[he]);return u(function(ke,we){for(var Ne,Le=new Array(H),Tt=0;Tt<H;Tt+=1){if(!(Ne=Bt(U[Tt]._(ke,we),Ne)).status)return Ne;Le[Tt]=Ne.value,we=Ne.index}return Bt(Pe(we,Le),Ne)})}function nr(){var U=[].slice.call(arguments);if(U.length===0)throw new Error("seqMap needs at least one argument");var H=U.pop();return It(H),Dt.apply(null,U).map(function(he){return H.apply(null,he)})}function or(){var U=[].slice.call(arguments),H=U.length;if(H===0)return Kr("zero alternates");for(var he=0;he<H;he+=1)tr(U[he]);return u(function(ke,we){for(var Ne,Le=0;Le<U.length;Le+=1)if((Ne=Bt(U[Le]._(ke,we),Ne)).status)return Ne;return Ne})}function Dr(U,H){return er(U,H).or(Nr([]))}function er(U,H){return tr(U),tr(H),nr(U,H.then(U).many(),function(he,ke){return[he].concat(ke)})}function Fr(U){st(U);var H="'"+U+"'";return u(function(he,ke){var we=ke+U.length,Ne=he.slice(ke,we);return Ne===U?Pe(we,Ne):je(ke,H)})}function hr(U,H){(function(we){if(!(we instanceof RegExp))throw new Error("not a regexp: "+we);for(var Ne=Nt(we),Le=0;Le<Ne.length;Le++){var Tt=Ne.charAt(Le);if(Tt!=="i"&&Tt!=="m"&&Tt!=="u"&&Tt!=="s")throw new Error('unsupported regexp flag "'+Tt+'": '+we)}})(U),arguments.length>=2?wr(H):H=0;var he=function(we){return RegExp("^(?:"+we.source+")",Nt(we))}(U),ke=""+U;return u(function(we,Ne){var Le=he.exec(we.slice(Ne));if(Le){if(0<=H&&H<=Le.length){var Tt=Le[0],Pt=Le[H];return Pe(Ne+Tt.length,Pt)}return je(Ne,"valid match group (0 to "+Le.length+") in "+ke)}return je(Ne,ke)})}function Nr(U){return u(function(H,he){return Pe(he,U)})}function Kr(U){return u(function(H,he){return je(he,U)})}function Pi(U){if(ve(U))return u(function(H,he){var ke=U._(H,he);return ke.index=he,ke.value="",ke});if(typeof U=="string")return Pi(Fr(U));if(U instanceof RegExp)return Pi(hr(U));throw new Error("not a string, regexp, or parser: "+U)}function qt(U){return tr(U),u(function(H,he){var ke=U._(H,he),we=H.slice(he,ke.index);return ke.status?je(he,'not "'+we+'"'):Pe(he,null)})}function wi(U){return It(U),u(function(H,he){var ke=Br(H,he);return he<H.length&&U(ke)?Pe(he+1,ke):je(he,"a character/byte matching "+U)})}function un(U,H){arguments.length<2&&(H=U,U=void 0);var he=u(function(ke,we){return he._=H()._,he._(ke,we)});return U?he.desc(U):he}function Ji(){return Kr("fantasy-land/empty")}p.parse=function(U){if(typeof U!="string"&&!We(U))throw new Error(".parse must be called with a string or Buffer as its argument");var H,he=this.skip(kn)._(U,0);return H=he.status?{status:!0,value:he.value}:{status:!1,index:Qt(U,he.furthest),expected:he.expected},delete vt[U],H},p.tryParse=function(U){var H=this.parse(U);if(H.status)return H.value;var he=wt(U,H),ke=new Error(he);throw ke.type="ParsimmonError",ke.result=H,ke},p.assert=function(U,H){return this.chain(function(he){return U(he)?Nr(he):Kr(H)})},p.or=function(U){return or(this,U)},p.trim=function(U){return this.wrap(U,U)},p.wrap=function(U,H){return nr(U,this,H,function(he,ke){return ke})},p.thru=function(U){return U(this)},p.then=function(U){return tr(U),Dt(this,U).map(function(H){return H[1]})},p.many=function(){var U=this;return u(function(H,he){for(var ke=[],we=void 0;;){if(!(we=Bt(U._(H,he),we)).status)return Bt(Pe(he,ke),we);if(he===we.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");he=we.index,ke.push(we.value)}})},p.tieWith=function(U){return st(U),this.map(function(H){if(function(we){if(!Ie(we))throw new Error("not an array: "+we)}(H),H.length){st(H[0]);for(var he=H[0],ke=1;ke<H.length;ke++)st(H[ke]),he+=U+H[ke];return he}return""})},p.tie=function(){return this.tieWith("")},p.times=function(U,H){var he=this;return arguments.length<2&&(H=U),wr(U),wr(H),u(function(ke,we){for(var Ne=[],Le=void 0,Tt=void 0,Pt=0;Pt<U;Pt+=1){if(Tt=Bt(Le=he._(ke,we),Tt),!Le.status)return Tt;we=Le.index,Ne.push(Le.value)}for(;Pt<H&&(Tt=Bt(Le=he._(ke,we),Tt),Le.status);Pt+=1)we=Le.index,Ne.push(Le.value);return Bt(Pe(we,Ne),Tt)})},p.result=function(U){return this.map(function(){return U})},p.atMost=function(U){return this.times(0,U)},p.atLeast=function(U){return nr(this.times(U),this.many(),function(H,he){return H.concat(he)})},p.map=function(U){It(U);var H=this;return u(function(he,ke){var we=H._(he,ke);return we.status?Bt(Pe(we.index,U(we.value)),we):we})},p.contramap=function(U){It(U);var H=this;return u(function(he,ke){var we=H.parse(U(he.slice(ke)));return we.status?Pe(ke+he.length,we.value):we})},p.promap=function(U,H){return It(U),It(H),this.contramap(U).map(H)},p.skip=function(U){return Dt(this,U).map(function(H){return H[0]})},p.mark=function(){return nr(cn,this,cn,function(U,H,he){return{start:U,value:H,end:he}})},p.node=function(U){return nr(cn,this,cn,function(H,he,ke){return{name:U,value:he,start:H,end:ke}})},p.sepBy=function(U){return Dr(this,U)},p.sepBy1=function(U){return er(this,U)},p.lookahead=function(U){return this.skip(Pi(U))},p.notFollowedBy=function(U){return this.skip(qt(U))},p.desc=function(U){Ie(U)||(U=[U]);var H=this;return u(function(he,ke){var we=H._(he,ke);return we.status||(we.expected=U),we})},p.fallback=function(U){return this.or(Nr(U))},p.ap=function(U){return nr(U,this,function(H,he){return H(he)})},p.chain=function(U){var H=this;return u(function(he,ke){var we=H._(he,ke);return we.status?Bt(U(we.value)._(he,we.index),we):we})},p.concat=p.or,p.empty=Ji,p.of=Nr,p["fantasy-land/ap"]=p.ap,p["fantasy-land/chain"]=p.chain,p["fantasy-land/concat"]=p.concat,p["fantasy-land/empty"]=p.empty,p["fantasy-land/of"]=p.of,p["fantasy-land/map"]=p.map;var cn=u(function(U,H){return Pe(H,Qt(U,H))}),hn=u(function(U,H){return H>=U.length?je(H,"any character/byte"):Pe(H+1,Br(U,H))}),pn=u(function(U,H){return Pe(U.length,U.slice(H))}),kn=u(function(U,H){return H<U.length?je(H,"EOF"):Pe(H,null)}),dn=hr(/[0-9]/).desc("a digit"),Se=hr(/[0-9]*/).desc("optional digits"),Ge=hr(/[a-z]/i).desc("a letter"),qn=hr(/[a-z]*/i).desc("optional letters"),Ni=hr(/\s*/).desc("optional whitespace"),Zt=hr(/\s+/).desc("whitespace"),Ei=Fr("\r"),pi=Fr(`
15
- `),di=Fr(`\r
16
- `),fn=or(di,pi,Ei).desc("newline"),qe=or(fn,kn);u.all=pn,u.alt=or,u.any=hn,u.cr=Ei,u.createLanguage=function(U){var H={};for(var he in U)({}).hasOwnProperty.call(U,he)&&function(ke){H[ke]=un(function(){return U[ke](H)})}(he);return H},u.crlf=di,u.custom=function(U){return u(U(Pe,je))},u.digit=dn,u.digits=Se,u.empty=Ji,u.end=qe,u.eof=kn,u.fail=Kr,u.formatError=wt,u.index=cn,u.isParser=ve,u.lazy=un,u.letter=Ge,u.letters=qn,u.lf=pi,u.lookahead=Pi,u.makeFailure=je,u.makeSuccess=Pe,u.newline=fn,u.noneOf=function(U){return wi(function(H){return U.indexOf(H)<0}).desc("none of '"+U+"'")},u.notFollowedBy=qt,u.of=Nr,u.oneOf=function(U){for(var H=U.split(""),he=0;he<H.length;he++)H[he]="'"+H[he]+"'";return wi(function(ke){return U.indexOf(ke)>=0}).desc(H)},u.optWhitespace=Ni,u.Parser=u,u.range=function(U,H){return wi(function(he){return U<=he&&he<=H}).desc(U+"-"+H)},u.regex=hr,u.regexp=hr,u.sepBy=Dr,u.sepBy1=er,u.seq=Dt,u.seqMap=nr,u.seqObj=function(){for(var U,H={},he=0,ke=(U=arguments,Array.prototype.slice.call(U)),we=ke.length,Ne=0;Ne<we;Ne+=1){var Le=ke[Ne];if(!ve(Le)){if(Ie(Le)&&Le.length===2&&typeof Le[0]=="string"&&ve(Le[1])){var Tt=Le[0];if(Object.prototype.hasOwnProperty.call(H,Tt))throw new Error("seqObj: duplicate key "+Tt);H[Tt]=!0,he++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(he===0)throw new Error("seqObj expects at least one named parser, found zero");return u(function(Pt,lr){for(var At,fi={},Rr=0;Rr<we;Rr+=1){var ai,Mi;if(Ie(ke[Rr])?(ai=ke[Rr][0],Mi=ke[Rr][1]):(ai=null,Mi=ke[Rr]),!(At=Bt(Mi._(Pt,lr),At)).status)return At;ai&&(fi[ai]=At.value),lr=At.index}return Bt(Pe(lr,fi),At)})},u.string=Fr,u.succeed=Nr,u.takeWhile=function(U){return It(U),u(function(H,he){for(var ke=he;ke<H.length&&U(Br(H,ke));)ke++;return Pe(ke,H.slice(he,ke))})},u.test=wi,u.whitespace=Zt,u["fantasy-land/empty"]=Ji,u["fantasy-land/of"]=Nr,u.Binary={bitSeq:ee,bitSeqObj:function(U){I();var H={},he=0,ke=C(function(Ne){if(Ie(Ne)){var Le=Ne;if(Le.length!==2)throw new Error("["+Le.join(", ")+"] should be length 2, got length "+Le.length);if(st(Le[0]),wr(Le[1]),Object.prototype.hasOwnProperty.call(H,Le[0]))throw new Error("duplicate key in bitSeqObj: "+Le[0]);return H[Le[0]]=!0,he++,Le}return wr(Ne),[null,Ne]},U);if(he<1)throw new Error("bitSeqObj expects at least one named pair, got ["+U.join(", ")+"]");var we=C(function(Ne){return Ne[0]},ke);return ee(C(function(Ne){return Ne[1]},ke)).map(function(Ne){return x(function(Le,Tt){return Tt[0]!==null&&(Le[Tt[0]]=Tt[1]),Le},{},C(function(Le,Tt){return[Le,Ne[Tt]]},we))})},byte:function(U){if(I(),wr(U),U>255)throw new Error("Value specified to byte constructor ("+U+"=0x"+U.toString(16)+") is larger in value than a single byte.");var H=(U>15?"0x":"0x0")+U.toString(16);return u(function(he,ke){var we=Br(he,ke);return we===U?Pe(ke+1,we):je(ke,H)})},buffer:function(U){return le("buffer",U).map(function(H){return Buffer.from(H)})},encodedString:function(U,H){return le("string",H).map(function(he){return he.toString(U)})},uintBE:$e,uint8BE:$e(1),uint16BE:$e(2),uint32BE:$e(4),uintLE:Oe,uint8LE:Oe(1),uint16LE:Oe(2),uint32LE:Oe(4),intBE:De,int8BE:De(1),int16BE:De(2),int32BE:De(4),intLE:fe,int8LE:fe(1),int16LE:fe(2),int32LE:fe(4),floatBE:le("floatBE",4).map(function(U){return U.readFloatBE(0)}),floatLE:le("floatLE",4).map(function(U){return U.readFloatLE(0)}),doubleBE:le("doubleBE",8).map(function(U){return U.readDoubleBE(0)}),doubleLE:le("doubleLE",8).map(function(U){return U.readDoubleLE(0)})},o.exports=u}])})});var K_=Wt((HC,Z_)=>{var El=1e3,Sl=El*60,Tl=Sl*60,fa=Tl*24,xS=fa*7,wS=fa*365.25;Z_.exports=function(o,r){r=r||{};var n=typeof o;if(n==="string"&&o.length>0)return ES(o);if(n==="number"&&isFinite(o))return r.long?TS(o):SS(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function ES(o){if(o=String(o),!(o.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!!r){var n=parseFloat(r[1]),u=(r[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return n*wS;case"weeks":case"week":case"w":return n*xS;case"days":case"day":case"d":return n*fa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Tl;case"minutes":case"minute":case"mins":case"min":case"m":return n*Sl;case"seconds":case"second":case"secs":case"sec":case"s":return n*El;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function SS(o){var r=Math.abs(o);return r>=fa?Math.round(o/fa)+"d":r>=Tl?Math.round(o/Tl)+"h":r>=Sl?Math.round(o/Sl)+"m":r>=El?Math.round(o/El)+"s":o+"ms"}function TS(o){var r=Math.abs(o);return r>=fa?zp(o,r,fa,"day"):r>=Tl?zp(o,r,Tl,"hour"):r>=Sl?zp(o,r,Sl,"minute"):r>=El?zp(o,r,El,"second"):o+" ms"}function zp(o,r,n,u){var p=r>=n*1.5;return Math.round(o/n)+" "+u+(p?"s":"")}});var X_=Wt((JC,W_)=>{function CS(o){n.debug=n,n.default=n,n.coerce=D,n.disable=a,n.enable=p,n.enabled=x,n.humanize=K_(),n.destroy=R,Object.keys(o).forEach(I=>{n[I]=o[I]}),n.names=[],n.skips=[],n.formatters={};function r(I){let ee=0;for(let le=0;le<I.length;le++)ee=(ee<<5)-ee+I.charCodeAt(le),ee|=0;return n.colors[Math.abs(ee)%n.colors.length]}n.selectColor=r;function n(I){let ee,le=null,_e,$e;function Oe(...De){if(!Oe.enabled)return;let fe=Oe,ve=Number(new Date),Ie=ve-(ee||ve);fe.diff=Ie,fe.prev=ee,fe.curr=ve,ee=ve,De[0]=n.coerce(De[0]),typeof De[0]!="string"&&De.unshift("%O");let We=0;De[0]=De[0].replace(/%([a-zA-Z%])/g,(je,Bt)=>{if(je==="%%")return"%";We++;let vt=n.formatters[Bt];if(typeof vt=="function"){let Qt=De[We];je=vt.call(fe,Qt),De.splice(We,1),We--}return je}),n.formatArgs.call(fe,De),(fe.log||n.log).apply(fe,De)}return Oe.namespace=I,Oe.useColors=n.useColors(),Oe.color=n.selectColor(I),Oe.extend=u,Oe.destroy=n.destroy,Object.defineProperty(Oe,"enabled",{enumerable:!0,configurable:!1,get:()=>le!==null?le:(_e!==n.namespaces&&(_e=n.namespaces,$e=n.enabled(I)),$e),set:De=>{le=De}}),typeof n.init=="function"&&n.init(Oe),Oe}function u(I,ee){let le=n(this.namespace+(typeof ee>"u"?":":ee)+I);return le.log=this.log,le}function p(I){n.save(I),n.namespaces=I,n.names=[],n.skips=[];let ee,le=(typeof I=="string"?I:"").split(/[\s,]+/),_e=le.length;for(ee=0;ee<_e;ee++)!le[ee]||(I=le[ee].replace(/\*/g,".*?"),I[0]==="-"?n.skips.push(new RegExp("^"+I.slice(1)+"$")):n.names.push(new RegExp("^"+I+"$")))}function a(){let I=[...n.names.map(C),...n.skips.map(C).map(ee=>"-"+ee)].join(",");return n.enable(""),I}function x(I){if(I[I.length-1]==="*")return!0;let ee,le;for(ee=0,le=n.skips.length;ee<le;ee++)if(n.skips[ee].test(I))return!1;for(ee=0,le=n.names.length;ee<le;ee++)if(n.names[ee].test(I))return!0;return!1}function C(I){return I.toString().substring(2,I.toString().length-2).replace(/\.\*\?$/,"*")}function D(I){return I instanceof Error?I.stack||I.message:I}function R(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}W_.exports=CS});var Cl=Wt((Cn,Op)=>{Cn.formatArgs=kS;Cn.save=IS;Cn.load=PS;Cn.useColors=AS;Cn.storage=MS();Cn.destroy=(()=>{let o=!1;return()=>{o||(o=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Cn.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function AS(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function kS(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+Op.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;o.splice(1,0,r,"color: inherit");let n=0,u=0;o[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(n++,p==="%c"&&(u=n))}),o.splice(u,0,r)}Cn.log=console.debug||console.log||(()=>{});function IS(o){try{o?Cn.storage.setItem("debug",o):Cn.storage.removeItem("debug")}catch{}}function PS(){let o;try{o=Cn.storage.getItem("debug")}catch{}return!o&&typeof process<"u"&&"env"in process&&(o=process.env.DEBUG),o}function MS(){try{return localStorage}catch{}}Op.exports=X_()(Cn);var{formatters:zS}=Op.exports;zS.j=function(o){try{return JSON.stringify(o)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var J_=Wt((YC,hm)=>{"use strict";var OS=Object.prototype.hasOwnProperty,Hi="~";function Ac(){}Object.create&&(Ac.prototype=Object.create(null),new Ac().__proto__||(Hi=!1));function DS(o,r,n){this.fn=o,this.context=r,this.once=n||!1}function H_(o,r,n,u,p){if(typeof n!="function")throw new TypeError("The listener must be a function");var a=new DS(n,u||o,p),x=Hi?Hi+r:r;return o._events[x]?o._events[x].fn?o._events[x]=[o._events[x],a]:o._events[x].push(a):(o._events[x]=a,o._eventsCount++),o}function Dp(o,r){--o._eventsCount===0?o._events=new Ac:delete o._events[r]}function Bi(){this._events=new Ac,this._eventsCount=0}Bi.prototype.eventNames=function(){var r=[],n,u;if(this._eventsCount===0)return r;for(u in n=this._events)OS.call(n,u)&&r.push(Hi?u.slice(1):u);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r};Bi.prototype.listeners=function(r){var n=Hi?Hi+r:r,u=this._events[n];if(!u)return[];if(u.fn)return[u.fn];for(var p=0,a=u.length,x=new Array(a);p<a;p++)x[p]=u[p].fn;return x};Bi.prototype.listenerCount=function(r){var n=Hi?Hi+r:r,u=this._events[n];return u?u.fn?1:u.length:0};Bi.prototype.emit=function(r,n,u,p,a,x){var C=Hi?Hi+r:r;if(!this._events[C])return!1;var D=this._events[C],R=arguments.length,I,ee;if(D.fn){switch(D.once&&this.removeListener(r,D.fn,void 0,!0),R){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,n),!0;case 3:return D.fn.call(D.context,n,u),!0;case 4:return D.fn.call(D.context,n,u,p),!0;case 5:return D.fn.call(D.context,n,u,p,a),!0;case 6:return D.fn.call(D.context,n,u,p,a,x),!0}for(ee=1,I=new Array(R-1);ee<R;ee++)I[ee-1]=arguments[ee];D.fn.apply(D.context,I)}else{var le=D.length,_e;for(ee=0;ee<le;ee++)switch(D[ee].once&&this.removeListener(r,D[ee].fn,void 0,!0),R){case 1:D[ee].fn.call(D[ee].context);break;case 2:D[ee].fn.call(D[ee].context,n);break;case 3:D[ee].fn.call(D[ee].context,n,u);break;case 4:D[ee].fn.call(D[ee].context,n,u,p);break;default:if(!I)for(_e=1,I=new Array(R-1);_e<R;_e++)I[_e-1]=arguments[_e];D[ee].fn.apply(D[ee].context,I)}}return!0};Bi.prototype.on=function(r,n,u){return H_(this,r,n,u,!1)};Bi.prototype.once=function(r,n,u){return H_(this,r,n,u,!0)};Bi.prototype.removeListener=function(r,n,u,p){var a=Hi?Hi+r:r;if(!this._events[a])return this;if(!n)return Dp(this,a),this;var x=this._events[a];if(x.fn)x.fn===n&&(!p||x.once)&&(!u||x.context===u)&&Dp(this,a);else{for(var C=0,D=[],R=x.length;C<R;C++)(x[C].fn!==n||p&&!x[C].once||u&&x[C].context!==u)&&D.push(x[C]);D.length?this._events[a]=D.length===1?D[0]:D:Dp(this,a)}return this};Bi.prototype.removeAllListeners=function(r){var n;return r?(n=Hi?Hi+r:r,this._events[n]&&Dp(this,n)):(this._events=new Ac,this._eventsCount=0),this};Bi.prototype.off=Bi.prototype.removeListener;Bi.prototype.addListener=Bi.prototype.on;Bi.prefixed=Hi;Bi.EventEmitter=Bi;typeof hm<"u"&&(hm.exports=Bi)});var Q_=Wt((pm,dm)=>{(function(o,r){typeof pm=="object"&&typeof dm<"u"?dm.exports=r():typeof define=="function"&&define.amd?define(r):(o=typeof globalThis<"u"?globalThis:o||self,o.maplibregl=r())})(pm,function(){"use strict";var o,r,n;function u(a,x){if(!o)o=x;else if(!r)r=x;else{var C="var sharedChunk = {}; ("+o+")(sharedChunk); ("+r+")(sharedChunk);",D={};o(D),n=x(D),typeof window<"u"&&(n.workerUrl=window.URL.createObjectURL(new Blob([C],{type:"text/javascript"})))}}u(["exports"],function(a){"use strict";var x=C;function C(i,e,s,c){this.cx=3*i,this.bx=3*(s-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(c-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=s,this.p2y=c}function D(i,e,s,c){let f=new x(i,e,s,c);return function(y){return f.solve(y)}}C.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var s=i,c=0;c<8;c++){var f=this.sampleCurveX(s)-i;if(Math.abs(f)<e)return s;var y=this.sampleCurveDerivativeX(s);if(Math.abs(y)<1e-6)break;s-=f/y}var _=0,b=1;for(s=i,c=0;c<20&&(f=this.sampleCurveX(s),!(Math.abs(f-i)<e));c++)i>f?_=s:b=s,s=.5*(b-_)+_;return s},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};let R=D(.25,.1,.25,1);function I(i,e,s){return Math.min(s,Math.max(e,i))}function ee(i,e,s){let c=s-e,f=((i-e)%c+c)%c+e;return f===e?s:f}function le(i,...e){for(let s of e)for(let c in s)i[c]=s[c];return i}let _e=1;function $e(i,e){i.forEach(s=>{e[s]&&(e[s]=e[s].bind(e))})}function Oe(i,e,s){let c={};for(let f in i)c[f]=e.call(s||this,i[f],f,i);return c}function De(i,e,s){let c={};for(let f in i)e.call(s||this,i[f],f,i)&&(c[f]=i[f]);return c}function fe(i){return Array.isArray(i)?i.map(fe):typeof i=="object"&&i?Oe(i,fe):i}let ve={};function Ie(i){ve[i]||(typeof console<"u"&&console.warn(i),ve[i]=!0)}function We(i,e,s){return(s.y-i.y)*(e.x-i.x)>(e.y-i.y)*(s.x-i.x)}function Pe(i){let e=0;for(let s,c,f=0,y=i.length,_=y-1;f<y;_=f++)s=i[f],c=i[_],e+=(c.x-s.x)*(s.y+c.y);return e}function je(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Bt(i){let e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(s,c,f,y)=>{let _=f||y;return e[c]=!_||_.toLowerCase(),""}),e["max-age"]){let s=parseInt(e["max-age"],10);isNaN(s)?delete e["max-age"]:e["max-age"]=s}return e}let vt,Qt,tr=null;function Br(i){if(tr==null){let e=i.navigator?i.navigator.userAgent:null;tr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return tr}function wr(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}let It={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){let e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){let s=window.document.createElement("canvas"),c=s.getContext("2d");if(!c)throw new Error("failed to create canvas 2d context");return s.width=i.width,s.height=i.height,c.drawImage(i,0,0,i.width,i.height),c.getImageData(-e,-e,i.width+2*e,i.height+2*e)},resolveURL:i=>(vt||(vt=document.createElement("a")),vt.href=i,vt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Qt==null&&(Qt=matchMedia("(prefers-reduced-motion: reduce)")),Qt.matches)}};var st=Or;function Or(i,e){this.x=i,this.y=e}Or.prototype={clone:function(){return new Or(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,s=i.y-this.y;return e*e+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),s=Math.sin(i),c=s*this.x+e*this.y;return this.x=e*this.x-s*this.y,this.y=c,this},_rotateAround:function(i,e){var s=Math.cos(i),c=Math.sin(i),f=e.y+c*(this.x-e.x)+s*(this.y-e.y);return this.x=e.x+s*(this.x-e.x)-c*(this.y-e.y),this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Or.convert=function(i){return i instanceof Or?i:Array.isArray(i)?new Or(i[0],i[1]):i};let Er={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},ye="mapbox-tiles",Fe,Ue,Be=500,He=50;function ut(){typeof caches>"u"||Fe||(Fe=caches.open(ye))}let lt=1/0,yt={supported:!1,testSupport:function(i){!Dt&&Nt&&(nr?or(i):wt=i)}},wt,Nt,Dt=!1,nr=!1;function or(i){let e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,Nt),i.isContextLost())return;yt.supported=!0}catch{}i.deleteTexture(e),Dt=!0}typeof document<"u"&&(Nt=document.createElement("img"),Nt.onload=function(){wt&&or(wt),wt=null,nr=!0},Nt.onerror=function(){Dt=!0,wt=null},Nt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let Dr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Dr);class er extends Error{constructor(e,s,c,f){super(`AJAXError: ${s} (${e}): ${c}`),this.status=e,this.statusText=s,this.url=c,this.body=f}}let Fr=je()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function hr(i,e){let s=new AbortController,c=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:Fr(),signal:s.signal}),f=!1,y=!1;return i.type==="json"&&c.headers.set("Accept","application/json"),((_,b,w)=>{if(y)return;let T=Date.now();fetch(c).then(P=>P.ok?((z,L,N)=>{(i.type==="arrayBuffer"?z.arrayBuffer():i.type==="json"?z.json():z.text()).then(j=>{y||(L&&N&&function(J,X,ae){if(ut(),!Fe)return;let me={status:X.status,statusText:X.statusText,headers:new Headers};X.headers.forEach((pe,Ae)=>me.headers.set(Ae,pe));let se=Bt(X.headers.get("Cache-Control")||"");se["no-store"]||(se["max-age"]&&me.headers.set("Expires",new Date(ae+1e3*se["max-age"]).toUTCString()),new Date(me.headers.get("Expires")).getTime()-ae<42e4||function(pe,Ae){if(Ue===void 0)try{new Response(new ReadableStream),Ue=!0}catch{Ue=!1}Ue?Ae(pe.body):pe.blob().then(Ae)}(X,pe=>{let Ae=new Response(pe,me);ut(),Fe&&Fe.then(Ce=>Ce.put(function(ot){let ht=ot.indexOf("?");return ht<0?ot:ot.slice(0,ht)}(J.url),Ae)).catch(Ce=>Ie(Ce.message))}))}(c,L,N),f=!0,e(null,j,z.headers.get("Cache-Control"),z.headers.get("Expires")))}).catch(j=>{y||e(new Error(j.message))})})(P,null,T):P.blob().then(z=>e(new er(P.status,P.statusText,i.url,z)))).catch(P=>{P.code!==20&&e(new Error(P.message))})})(),{cancel:()=>{y=!0,f||s.abort()}}}let Nr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(je()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!je()){let c=i.url.substring(0,i.url.indexOf("://"));return(Er.REGISTERED_PROTOCOLS[c]||hr)(i,e)}}if(!(/^file:/.test(s=i.url)||/^file:/.test(Fr())&&!/^\w+:/.test(s))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return hr(i,e);if(je()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var s;return function(c,f){let y=new XMLHttpRequest;y.open(c.method||"GET",c.url,!0),c.type==="arrayBuffer"&&(y.responseType="arraybuffer");for(let _ in c.headers)y.setRequestHeader(_,c.headers[_]);return c.type==="json"&&(y.responseType="text",y.setRequestHeader("Accept","application/json")),y.withCredentials=c.credentials==="include",y.onerror=()=>{f(new Error(y.statusText))},y.onload=()=>{if((y.status>=200&&y.status<300||y.status===0)&&y.response!==null){let _=y.response;if(c.type==="json")try{_=JSON.parse(y.response)}catch(b){return f(b)}f(null,_,y.getResponseHeader("Cache-Control"),y.getResponseHeader("Expires"))}else{let _=new Blob([y.response],{type:y.getResponseHeader("Content-Type")});f(new er(y.status,y.statusText,c.url,_))}},y.send(c.body),{cancel:()=>y.abort()}}(i,e)},Kr=function(i,e){return Nr(le(i,{type:"arrayBuffer"}),e)};function Pi(i){let e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}let qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",wi,un;wi=[],un=0;let Ji=function(i,e){if(yt.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),un>=Er.MAX_PARALLEL_IMAGE_REQUESTS){let y={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return wi.push(y),y}un++;let s=!1,c=()=>{if(!s)for(s=!0,un--;wi.length&&un<Er.MAX_PARALLEL_IMAGE_REQUESTS;){let y=wi.shift(),{requestParameters:_,callback:b,cancelled:w}=y;w||(y.cancel=Ji(_,b).cancel)}},f=Kr(i,(y,_,b,w)=>{c(),y?e(y):_&&function(T,P){typeof createImageBitmap=="function"?function(z,L){let N=new Blob([new Uint8Array(z)],{type:"image/png"});createImageBitmap(N).then(j=>{L(null,j)}).catch(j=>{L(new Error(`Could not load image because of ${j.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(T,P):function(z,L){let N=new Image;N.onload=()=>{L(null,N),URL.revokeObjectURL(N.src),N.onload=null,window.requestAnimationFrame(()=>{N.src=qt})},N.onerror=()=>L(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let j=new Blob([new Uint8Array(z)],{type:"image/png"});N.src=z.byteLength?URL.createObjectURL(j):qt}(T,P)}(_,(T,P)=>{T!=null?e(T):P!=null&&e(null,P,{cacheControl:b,expires:w})})});return{cancel:()=>{f.cancel(),c()}}};function cn(i,e,s){s[i]&&s[i].indexOf(e)!==-1||(s[i]=s[i]||[],s[i].push(e))}function hn(i,e,s){if(s&&s[i]){let c=s[i].indexOf(e);c!==-1&&s[i].splice(c,1)}}class pn{constructor(e,s={}){le(this,s),this.type=e}}class kn extends pn{constructor(e,s={}){super("error",le({error:e},s))}}class dn{on(e,s){return this._listeners=this._listeners||{},cn(e,s,this._listeners),this}off(e,s){return hn(e,s,this._listeners),hn(e,s,this._oneTimeListeners),this}once(e,s){return this._oneTimeListeners=this._oneTimeListeners||{},cn(e,s,this._oneTimeListeners),this}fire(e,s){typeof e=="string"&&(e=new pn(e,s||{}));let c=e.type;if(this.listens(c)){e.target=this;let f=this._listeners&&this._listeners[c]?this._listeners[c].slice():[];for(let b of f)b.call(this,e);let y=this._oneTimeListeners&&this._oneTimeListeners[c]?this._oneTimeListeners[c].slice():[];for(let b of y)hn(c,b,this._oneTimeListeners),b.call(this,e);let _=this._eventedParent;_&&(le(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof kn&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,s){return this._eventedParent=e,this._eventedParentData=s,this}}var Se={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Ge{constructor(e,s,c,f){this.message=(e?`${e}: `:"")+c,f&&(this.identifier=f),s!=null&&s.__line__&&(this.line=s.__line__)}}function qn(i){let e=i.value;return e?[new Ge(i.key,e,"constants have been deprecated as of v8")]:[]}function Ni(i,...e){for(let s of e)for(let c in s)i[c]=s[c];return i}function Zt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Ei(i){if(Array.isArray(i))return i.map(Ei);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){let e={};for(let s in i)e[s]=Ei(i[s]);return e}return Zt(i)}class pi extends Error{constructor(e,s){super(s),this.message=s,this.key=e}}class di{constructor(e,s=[]){this.parent=e,this.bindings={};for(let[c,f]of s)this.bindings[c]=f}concat(e){return new di(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let fn={kind:"null"},qe={kind:"number"},U={kind:"string"},H={kind:"boolean"},he={kind:"color"},ke={kind:"object"},we={kind:"value"},Ne={kind:"collator"},Le={kind:"formatted"},Tt={kind:"padding"},Pt={kind:"resolvedImage"};function lr(i,e){return{kind:"array",itemType:i,N:e}}function At(i){if(i.kind==="array"){let e=At(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}let fi=[fn,qe,U,H,he,Le,ke,lr(we),Tt,Pt];function Rr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Rr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(let s of fi)if(!Rr(s,e))return null}}return`Expected ${At(i)} but found ${At(e)} instead.`}function ai(i,e){return e.some(s=>s.kind===i.kind)}function Mi(i,e){return e.some(s=>s==="null"?i===null:s==="array"?Array.isArray(i):s==="object"?i&&!Array.isArray(i)&&typeof i=="object":s===typeof i)}var uo,br={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function q(i){return(i=Math.round(i))<0?0:i>255?255:i}function k(i){return q(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function O(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function V(i,e,s){return s<0?s+=1:s>1&&(s-=1),6*s<1?i+(e-i)*s*6:2*s<1?e:3*s<2?i+(e-i)*(2/3-s)*6:i}try{uo={}.parseCSSColor=function(i){var e,s=i.replace(/ /g,"").toLowerCase();if(s in br)return br[s].slice();if(s[0]==="#")return s.length===4?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:s.length===7&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var c=s.indexOf("("),f=s.indexOf(")");if(c!==-1&&f+1===s.length){var y=s.substr(0,c),_=s.substr(c+1,f-(c+1)).split(","),b=1;switch(y){case"rgba":if(_.length!==4)return null;b=O(_.pop());case"rgb":return _.length!==3?null:[k(_[0]),k(_[1]),k(_[2]),b];case"hsla":if(_.length!==4)return null;b=O(_.pop());case"hsl":if(_.length!==3)return null;var w=(parseFloat(_[0])%360+360)%360/360,T=O(_[1]),P=O(_[2]),z=P<=.5?P*(T+1):P+T-P*T,L=2*P-z;return[q(255*V(L,z,w+1/3)),q(255*V(L,z,w)),q(255*V(L,z,w-1/3)),b];default:return null}}return null}}catch{}class ${constructor(e,s,c,f=1){this.r=e,this.g=s,this.b=c,this.a=f}static parse(e){if(!e)return;if(e instanceof $)return e;if(typeof e!="string")return;let s=uo(e);return s?new $(s[0]/255*s[3],s[1]/255*s[3],s[2]/255*s[3],s[3]):void 0}toString(){let[e,s,c,f]=this.toArray();return`rgba(${Math.round(e)},${Math.round(s)},${Math.round(c)},${f})`}toArray(){let{r:e,g:s,b:c,a:f}=this;return f===0?[0,0,0,0]:[255*e/f,255*s/f,255*c/f,f]}}$.black=new $(0,0,0,1),$.white=new $(1,1,1,1),$.transparent=new $(0,0,0,0),$.red=new $(1,0,0,1);class Y{constructor(e,s,c){this.sensitivity=e?s?"variant":"case":s?"accent":"base",this.locale=c,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,s){return this.collator.compare(e,s)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ie{constructor(e,s,c,f,y){this.text=e,this.image=s,this.scale=c,this.fontStack=f,this.textColor=y}}class te{constructor(e){this.sections=e}static fromString(e){return new te([new ie(e,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 te?e:te.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Q{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Q)return e;if(typeof e=="number")return new Q([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let s of e)if(typeof s!="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 Q(e)}}toString(){return JSON.stringify(this.values)}}class ne{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ne({name:e,available:!1}):null}}function be(i,e,s,c){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof s=="number"&&s>=0&&s<=255?c===void 0||typeof c=="number"&&c>=0&&c<=1?null:`Invalid rgba value [${[i,e,s,c].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof c=="number"?[i,e,s,c]:[i,e,s]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Me(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof $||i instanceof Y||i instanceof te||i instanceof Q||i instanceof ne)return!0;if(Array.isArray(i)){for(let e of i)if(!Me(e))return!1;return!0}if(typeof i=="object"){for(let e in i)if(!Me(i[e]))return!1;return!0}return!1}function ge(i){if(i===null)return fn;if(typeof i=="string")return U;if(typeof i=="boolean")return H;if(typeof i=="number")return qe;if(i instanceof $)return he;if(i instanceof Y)return Ne;if(i instanceof te)return Le;if(i instanceof Q)return Tt;if(i instanceof ne)return Pt;if(Array.isArray(i)){let e=i.length,s;for(let c of i){let f=ge(c);if(s){if(s===f)continue;s=we;break}s=f}return lr(s||we,e)}return ke}function ct(i){let e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof $||i instanceof te||i instanceof Q||i instanceof ne?i.toString():JSON.stringify(i)}class dt{constructor(e,s){this.type=e,this.value=s}static parse(e,s){if(e.length!==2)return s.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Me(e[1]))return s.error("invalid value");let c=e[1],f=ge(c),y=s.expectedType;return f.kind!=="array"||f.N!==0||!y||y.kind!=="array"||typeof y.N=="number"&&y.N!==0||(f=y),new dt(f,c)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class et{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}let bt={string:U,number:qe,boolean:H,object:ke};class St{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let c,f=1,y=e[0];if(y==="array"){let b,w;if(e.length>2){let T=e[1];if(typeof T!="string"||!(T in bt)||T==="object")return s.error('The item type argument of "array" must be one of string, number, boolean',1);b=bt[T],f++}else b=we;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return s.error('The length argument to "array" must be a positive integer literal',2);w=e[2],f++}c=lr(b,w)}else{if(!bt[y])throw new Error(`Types doesn't contain name = ${y}`);c=bt[y]}let _=[];for(;f<e.length;f++){let b=s.parse(e[f],f,we);if(!b)return null;_.push(b)}return new St(c,_)}evaluate(e){for(let s=0;s<this.args.length;s++){let c=this.args[s].evaluate(e);if(!Rr(this.type,ge(c)))return c;if(s===this.args.length-1)throw new et(`Expected value to be of type ${At(this.type)}, but found ${At(ge(c))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let Ht={"to-boolean":H,"to-color":he,"to-number":qe,"to-string":U};class Ct{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let c=e[0];if(!Ht[c])throw new Error(`Can't parse ${c} as it is not part of the known types`);if((c==="to-boolean"||c==="to-string")&&e.length!==2)return s.error("Expected one argument.");let f=Ht[c],y=[];for(let _=1;_<e.length;_++){let b=s.parse(e[_],_,we);if(!b)return null;y.push(b)}return new Ct(f,y)}evaluate(e){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(e));if(this.type.kind==="color"){let s,c;for(let f of this.args){if(s=f.evaluate(e),c=null,s instanceof $)return s;if(typeof s=="string"){let y=e.parseColor(s);if(y)return y}else if(Array.isArray(s)&&(c=s.length<3||s.length>4?`Invalid rbga value ${JSON.stringify(s)}: expected an array containing either three or four numeric values.`:be(s[0],s[1],s[2],s[3]),!c))return new $(s[0]/255,s[1]/255,s[2]/255,s[3])}throw new et(c||`Could not parse color from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}if(this.type.kind==="padding"){let s;for(let c of this.args){s=c.evaluate(e);let f=Q.parse(s);if(f)return f}throw new et(`Could not parse padding from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}if(this.type.kind==="number"){let s=null;for(let c of this.args){if(s=c.evaluate(e),s===null)return 0;let f=Number(s);if(!isNaN(f))return f}throw new et(`Could not convert ${JSON.stringify(s)} to number.`)}return this.type.kind==="formatted"?te.fromString(ct(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ne.fromString(ct(this.args[0].evaluate(e))):ct(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let Ft=["Unknown","Point","LineString","Polygon"];class Jt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ft[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(e){let s=this._parseColorCache[e];return s||(s=this._parseColorCache[e]=$.parse(e)),s}}class mr{constructor(e,s,c,f){this.name=e,this.type=s,this._evaluate=c,this.args=f}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,s){let c=e[0],f=mr.definitions[c];if(!f)return s.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0);let y=Array.isArray(f)?f[0]:f.type,_=Array.isArray(f)?[[f[1],f[2]]]:f.overloads,b=_.filter(([T])=>!Array.isArray(T)||T.length===e.length-1),w=null;for(let[T,P]of b){w=new Jo(s.registry,s.path,null,s.scope);let z=[],L=!1;for(let N=1;N<e.length;N++){let j=e[N],J=Array.isArray(T)?T[N-1]:T.type,X=w.parse(j,1+z.length,J);if(!X){L=!0;break}z.push(X)}if(!L)if(Array.isArray(T)&&T.length!==z.length)w.error(`Expected ${T.length} arguments, but found ${z.length} instead.`);else{for(let N=0;N<z.length;N++){let j=Array.isArray(T)?T[N]:T.type,J=z[N];w.concat(N+1).checkSubtype(j,J.type)}if(w.errors.length===0)return new mr(c,y,P,z)}}if(b.length===1)s.errors.push(...w.errors);else{let T=(b.length?b:_).map(([z])=>{return L=z,Array.isArray(L)?`(${L.map(At).join(", ")})`:`(${At(L.type)}...)`;var L}).join(" | "),P=[];for(let z=1;z<e.length;z++){let L=s.parse(e[z],1+P.length);if(!L)return null;P.push(At(L.type))}s.error(`Expected arguments of type ${T}, but found (${P.join(", ")}) instead.`)}return null}static register(e,s){mr.definitions=s;for(let c in s)e[c]=mr}}class Qr{constructor(e,s,c){this.type=Ne,this.locale=c,this.caseSensitive=e,this.diacriticSensitive=s}static parse(e,s){if(e.length!==2)return s.error("Expected one argument.");let c=e[1];if(typeof c!="object"||Array.isArray(c))return s.error("Collator options argument must be an object.");let f=s.parse(c["case-sensitive"]!==void 0&&c["case-sensitive"],1,H);if(!f)return null;let y=s.parse(c["diacritic-sensitive"]!==void 0&&c["diacritic-sensitive"],1,H);if(!y)return null;let _=null;return c.locale&&(_=s.parse(c.locale,1,U),!_)?null:new Qr(f,y,_)}evaluate(e){return new Y(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}}let Cr=8192;function mi(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function Xo(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Is(i,e){let s=(180+i[0])/360,c=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,f=Math.pow(2,e.z);return[Math.round(s*f*Cr),Math.round(c*f*Cr)]}function yr(i,e,s){let c=i[0]-e[0],f=i[1]-e[1],y=i[0]-s[0],_=i[1]-s[1];return c*_-y*f==0&&c*y<=0&&f*_<=0}function Ll(i,e){let s=!1;for(let _=0,b=e.length;_<b;_++){let w=e[_];for(let T=0,P=w.length;T<P-1;T++){if(yr(i,w[T],w[T+1]))return!1;(f=w[T])[1]>(c=i)[1]!=(y=w[T+1])[1]>c[1]&&c[0]<(y[0]-f[0])*(c[1]-f[1])/(y[1]-f[1])+f[0]&&(s=!s)}}var c,f,y;return s}function Bl(i,e){for(let s=0;s<e.length;s++)if(Ll(i,e[s]))return!0;return!1}function zc(i,e,s,c){let f=c[0]-s[0],y=c[1]-s[1],_=(i[0]-s[0])*y-f*(i[1]-s[1]),b=(e[0]-s[0])*y-f*(e[1]-s[1]);return _>0&&b<0||_<0&&b>0}function Oc(i,e,s){for(let T of s)for(let P=0;P<T.length-1;++P)if((b=[(_=T[P+1])[0]-(y=T[P])[0],_[1]-y[1]])[0]*(w=[(f=e)[0]-(c=i)[0],f[1]-c[1]])[1]-b[1]*w[0]!=0&&zc(c,f,y,_)&&zc(y,_,c,f))return!0;var c,f,y,_,b,w;return!1}function Nl(i,e){for(let s=0;s<i.length;++s)if(!Ll(i[s],e))return!1;for(let s=0;s<i.length-1;++s)if(Oc(i[s],i[s+1],e))return!1;return!0}function ed(i,e){for(let s=0;s<e.length;s++)if(Nl(i,e[s]))return!0;return!1}function ga(i,e,s){let c=[];for(let f=0;f<i.length;f++){let y=[];for(let _=0;_<i[f].length;_++){let b=Is(i[f][_],s);mi(e,b),y.push(b)}c.push(y)}return c}function jl(i,e,s){let c=[];for(let f=0;f<i.length;f++){let y=ga(i[f],e,s);c.push(y)}return c}function Dc(i,e,s,c){if(i[0]<s[0]||i[0]>s[2]){let f=.5*c,y=i[0]-s[0]>f?-c:s[0]-i[0]>f?c:0;y===0&&(y=i[0]-s[2]>f?-c:s[2]-i[0]>f?c:0),i[0]+=y}mi(e,i)}function Fc(i,e,s,c){let f=Math.pow(2,c.z)*Cr,y=[c.x*Cr,c.y*Cr],_=[];for(let b of i)for(let w of b){let T=[w.x+y[0],w.y+y[1]];Dc(T,e,s,f),_.push(T)}return _}function Rc(i,e,s,c){let f=Math.pow(2,c.z)*Cr,y=[c.x*Cr,c.y*Cr],_=[];for(let w of i){let T=[];for(let P of w){let z=[P.x+y[0],P.y+y[1]];mi(e,z),T.push(z)}_.push(T)}if(e[2]-e[0]<=f/2){(b=e)[0]=b[1]=1/0,b[2]=b[3]=-1/0;for(let w of _)for(let T of w)Dc(T,e,s,f)}var b;return _}class ko{constructor(e,s){this.type=H,this.geojson=e,this.geometries=s}static parse(e,s){if(e.length!==2)return s.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Me(e[1])){let c=e[1];if(c.type==="FeatureCollection")for(let f=0;f<c.features.length;++f){let y=c.features[f].geometry.type;if(y==="Polygon"||y==="MultiPolygon")return new ko(c,c.features[f].geometry)}else if(c.type==="Feature"){let f=c.geometry.type;if(f==="Polygon"||f==="MultiPolygon")return new ko(c,c.geometry)}else if(c.type==="Polygon"||c.type==="MultiPolygon")return new ko(c,c)}return s.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 function(s,c){let f=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],_=s.canonicalID();if(c.type==="Polygon"){let b=ga(c.coordinates,y,_),w=Fc(s.geometry(),f,y,_);if(!Xo(f,y))return!1;for(let T of w)if(!Ll(T,b))return!1}if(c.type==="MultiPolygon"){let b=jl(c.coordinates,y,_),w=Fc(s.geometry(),f,y,_);if(!Xo(f,y))return!1;for(let T of w)if(!Bl(T,b))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(s,c){let f=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],_=s.canonicalID();if(c.type==="Polygon"){let b=ga(c.coordinates,y,_),w=Rc(s.geometry(),f,y,_);if(!Xo(f,y))return!1;for(let T of w)if(!Nl(T,b))return!1}if(c.type==="MultiPolygon"){let b=jl(c.coordinates,y,_),w=Rc(s.geometry(),f,y,_);if(!Xo(f,y))return!1;for(let T of w)if(!ed(T,b))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function Ps(i){if(i instanceof mr&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof ko)return!1;let e=!0;return i.eachChild(s=>{e&&!Ps(s)&&(e=!1)}),e}function Ho(i){if(i instanceof mr&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(s=>{e&&!Ho(s)&&(e=!1)}),e}function _a(i,e){if(i instanceof mr&&e.indexOf(i.name)>=0)return!1;let s=!0;return i.eachChild(c=>{s&&!_a(c,e)&&(s=!1)}),s}class va{constructor(e,s){this.type=s.type,this.name=e,this.boundExpression=s}static parse(e,s){if(e.length!==2||typeof e[1]!="string")return s.error("'var' expression requires exactly one string literal argument.");let c=e[1];return s.scope.has(c)?new va(c,s.scope.get(c)):s.error(`Unknown variable "${c}". Make sure "${c}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Jo{constructor(e,s=[],c,f=new di,y=[]){this.registry=e,this.path=s,this.key=s.map(_=>`[${_}]`).join(""),this.scope=f,this.errors=y,this.expectedType=c}parse(e,s,c,f,y={}){return s?this.concat(s,c,f)._parse(e,y):this._parse(e,y)}_parse(e,s){function c(f,y,_){return _==="assert"?new St(y,[f]):_==="coerce"?new Ct(y,[f]):f}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),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 f=e[0];if(typeof f!="string")return this.error(`Expression name must be a string, but found ${typeof f} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let y=this.registry[f];if(y){let _=y.parse(e,this);if(!_)return null;if(this.expectedType){let b=this.expectedType,w=_.type;if(b.kind!=="string"&&b.kind!=="number"&&b.kind!=="boolean"&&b.kind!=="object"&&b.kind!=="array"||w.kind!=="value")if(b.kind!=="color"&&b.kind!=="formatted"&&b.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string")if(b.kind!=="padding"||w.kind!=="value"&&w.kind!=="number"&&w.kind!=="array"){if(this.checkSubtype(b,w))return null}else _=c(_,b,s.typeAnnotation||"coerce");else _=c(_,b,s.typeAnnotation||"coerce");else _=c(_,b,s.typeAnnotation||"assert")}if(!(_ instanceof dt)&&_.type.kind!=="resolvedImage"&&Vl(_)){let b=new Jt;try{_=new dt(_.type,_.evaluate(b))}catch(w){return this.error(w.message),null}}return _}return this.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,s,c){let f=typeof e=="number"?this.path.concat(e):this.path,y=c?this.scope.concat(c):this.scope;return new Jo(this.registry,f,s||null,y,this.errors)}error(e,...s){let c=`${this.key}${s.map(f=>`[${f}]`).join("")}`;this.errors.push(new pi(c,e))}checkSubtype(e,s){let c=Rr(e,s);return c&&this.error(c),c}}function Vl(i){if(i instanceof va)return Vl(i.boundExpression);if(i instanceof mr&&i.name==="error"||i instanceof Qr||i instanceof ko)return!1;let e=i instanceof Ct||i instanceof St,s=!0;return i.eachChild(c=>{s=e?s&&Vl(c):s&&c instanceof dt}),!!s&&Ps(i)&&_a(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ba(i,e){let s=i.length-1,c,f,y=0,_=s,b=0;for(;y<=_;)if(b=Math.floor((y+_)/2),c=i[b],f=i[b+1],c<=e){if(b===s||e<f)return b;y=b+1}else{if(!(c>e))throw new et("Input is not a number.");_=b-1}return 0}class Ms{constructor(e,s,c){this.type=e,this.input=s,this.labels=[],this.outputs=[];for(let[f,y]of c)this.labels.push(f),this.outputs.push(y)}static parse(e,s){if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");let c=s.parse(e[1],1,qe);if(!c)return null;let f=[],y=null;s.expectedType&&s.expectedType.kind!=="value"&&(y=s.expectedType);for(let _=1;_<e.length;_+=2){let b=_===1?-1/0:e[_],w=e[_+1],T=_,P=_+1;if(typeof b!="number")return s.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(f.length&&f[f.length-1][0]>=b)return s.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);let z=s.parse(w,P,y);if(!z)return null;y=y||z.type,f.push([b,z])}return new Ms(y,c,f)}evaluate(e){let s=this.labels,c=this.outputs;if(s.length===1)return c[0].evaluate(e);let f=this.input.evaluate(e);if(f<=s[0])return c[0].evaluate(e);let y=s.length;return f>=s[y-1]?c[y-1].evaluate(e):c[ba(s,f)].evaluate(e)}eachChild(e){e(this.input);for(let s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ar(i,e,s){return i*(1-s)+e*s}var zs=Object.freeze({__proto__:null,number:Ar,color:function(i,e,s){return new $(Ar(i.r,e.r,s),Ar(i.g,e.g,s),Ar(i.b,e.b,s),Ar(i.a,e.a,s))},array:function(i,e,s){return i.map((c,f)=>Ar(c,e[f],s))},padding:function(i,e,s){let c=i.values,f=e.values;return new Q([Ar(c[0],f[0],s),Ar(c[1],f[1],s),Ar(c[2],f[2],s),Ar(c[3],f[3],s)])}});let Lc=.95047,Bc=1.08883,Ul=4/29,xa=6/29,Nc=3*xa*xa,td=Math.PI/180,rd=180/Math.PI;function $l(i){return i>.008856451679035631?Math.pow(i,1/3):i/Nc+Ul}function ql(i){return i>xa?i*i*i:Nc*(i-Ul)}function Gl(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function Zl(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function rr(i){let e=Zl(i.r),s=Zl(i.g),c=Zl(i.b),f=$l((.4124564*e+.3575761*s+.1804375*c)/Lc),y=$l((.2126729*e+.7151522*s+.072175*c)/1);return{l:116*y-16,a:500*(f-y),b:200*(y-$l((.0193339*e+.119192*s+.9503041*c)/Bc)),alpha:i.a}}function jc(i){let e=(i.l+16)/116,s=isNaN(i.a)?e:e+i.a/500,c=isNaN(i.b)?e:e-i.b/200;return e=1*ql(e),s=Lc*ql(s),c=Bc*ql(c),new $(Gl(3.2404542*s-1.5371385*e-.4985314*c),Gl(-.969266*s+1.8760108*e+.041556*c),Gl(.0556434*s-.2040259*e+1.0572252*c),i.alpha)}function id(i,e,s){let c=e-i;return i+s*(c>180||c<-180?c-360*Math.round(c/360):c)}let Os={forward:rr,reverse:jc,interpolate:function(i,e,s){return{l:Ar(i.l,e.l,s),a:Ar(i.a,e.a,s),b:Ar(i.b,e.b,s),alpha:Ar(i.alpha,e.alpha,s)}}},Ds={forward:function(i){let{l:e,a:s,b:c}=rr(i),f=Math.atan2(c,s)*rd;return{h:f<0?f+360:f,c:Math.sqrt(s*s+c*c),l:e,alpha:i.a}},reverse:function(i){let e=i.h*td,s=i.c;return jc({l:i.l,a:Math.cos(e)*s,b:Math.sin(e)*s,alpha:i.alpha})},interpolate:function(i,e,s){return{h:id(i.h,e.h,s),c:Ar(i.c,e.c,s),l:Ar(i.l,e.l,s),alpha:Ar(i.alpha,e.alpha,s)}}};var Vc=Object.freeze({__proto__:null,lab:Os,hcl:Ds});class ji{constructor(e,s,c,f,y){this.type=e,this.operator=s,this.interpolation=c,this.input=f,this.labels=[],this.outputs=[];for(let[_,b]of y)this.labels.push(_),this.outputs.push(b)}static interpolationFactor(e,s,c,f){let y=0;if(e.name==="exponential")y=Kl(s,e.base,c,f);else if(e.name==="linear")y=Kl(s,1,c,f);else if(e.name==="cubic-bezier"){let _=e.controlPoints;y=new x(_[0],_[1],_[2],_[3]).solve(Kl(s,1,c,f))}return y}static parse(e,s){let[c,f,y,..._]=e;if(!Array.isArray(f)||f.length===0)return s.error("Expected an interpolation type expression.",1);if(f[0]==="linear")f={name:"linear"};else if(f[0]==="exponential"){let T=f[1];if(typeof T!="number")return s.error("Exponential interpolation requires a numeric base.",1,1);f={name:"exponential",base:T}}else{if(f[0]!=="cubic-bezier")return s.error(`Unknown interpolation type ${String(f[0])}`,1,0);{let T=f.slice(1);if(T.length!==4||T.some(P=>typeof P!="number"||P<0||P>1))return s.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);f={name:"cubic-bezier",controlPoints:T}}}if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");if(y=s.parse(y,2,qe),!y)return null;let b=[],w=null;c==="interpolate-hcl"||c==="interpolate-lab"?w=he:s.expectedType&&s.expectedType.kind!=="value"&&(w=s.expectedType);for(let T=0;T<_.length;T+=2){let P=_[T],z=_[T+1],L=T+3,N=T+4;if(typeof P!="number")return s.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',L);if(b.length&&b[b.length-1][0]>=P)return s.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',L);let j=s.parse(z,N,w);if(!j)return null;w=w||j.type,b.push([P,j])}return w.kind==="number"||w.kind==="color"||w.kind==="padding"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new ji(w,c,f,y,b):s.error(`Type ${At(w)} is not interpolatable.`)}evaluate(e){let s=this.labels,c=this.outputs;if(s.length===1)return c[0].evaluate(e);let f=this.input.evaluate(e);if(f<=s[0])return c[0].evaluate(e);let y=s.length;if(f>=s[y-1])return c[y-1].evaluate(e);let _=ba(s,f),b=ji.interpolationFactor(this.interpolation,f,s[_],s[_+1]),w=c[_].evaluate(e),T=c[_+1].evaluate(e);return this.operator==="interpolate"?zs[this.type.kind.toLowerCase()](w,T,b):this.operator==="interpolate-hcl"?Ds.reverse(Ds.interpolate(Ds.forward(w),Ds.forward(T),b)):Os.reverse(Os.interpolate(Os.forward(w),Os.forward(T),b))}eachChild(e){e(this.input);for(let s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Kl(i,e,s,c){let f=c-s,y=i-s;return f===0?0:e===1?y/f:(Math.pow(e,y)-1)/(Math.pow(e,f)-1)}class wa{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expectected at least one argument.");let c=null,f=s.expectedType;f&&f.kind!=="value"&&(c=f);let y=[];for(let b of e.slice(1)){let w=s.parse(b,1+y.length,c,void 0,{typeAnnotation:"omit"});if(!w)return null;c=c||w.type,y.push(w)}if(!c)throw new Error("No output type");let _=f&&y.some(b=>Rr(f,b.type));return new wa(_?we:c,y)}evaluate(e){let s,c=null,f=0;for(let y of this.args)if(f++,c=y.evaluate(e),c&&c instanceof ne&&!c.available&&(s||(s=c.name),c=null,f===this.args.length&&(c=s)),c!==null)break;return c}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ea{constructor(e,s){this.type=s.type,this.bindings=[].concat(e),this.result=s}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let s of this.bindings)e(s[1]);e(this.result)}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let c=[];for(let y=1;y<e.length-1;y+=2){let _=e[y];if(typeof _!="string")return s.error(`Expected string, but found ${typeof _} instead.`,y);if(/[^a-zA-Z0-9_]/.test(_))return s.error("Variable names must contain only alphanumeric characters or '_'.",y);let b=s.parse(e[y+1],y+1);if(!b)return null;c.push([_,b])}let f=s.parse(e[e.length-1],e.length-1,s.expectedType,c);return f?new Ea(c,f):null}outputDefined(){return this.result.outputDefined()}}class Wl{constructor(e,s,c){this.type=e,this.index=s,this.input=c}static parse(e,s){if(e.length!==3)return s.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let c=s.parse(e[1],1,qe),f=s.parse(e[2],2,lr(s.expectedType||we));return c&&f?new Wl(f.type.itemType,c,f):null}evaluate(e){let s=this.index.evaluate(e),c=this.input.evaluate(e);if(s<0)throw new et(`Array index out of bounds: ${s} < 0.`);if(s>=c.length)throw new et(`Array index out of bounds: ${s} > ${c.length-1}.`);if(s!==Math.floor(s))throw new et(`Array index must be an integer, but found ${s} instead.`);return c[s]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Xl{constructor(e,s){this.type=H,this.needle=e,this.haystack=s}static parse(e,s){if(e.length!==3)return s.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let c=s.parse(e[1],1,we),f=s.parse(e[2],2,we);return c&&f?ai(c.type,[H,U,qe,fn,we])?new Xl(c,f):s.error(`Expected first argument to be of type boolean, string, number or null, but found ${At(c.type)} instead`):null}evaluate(e){let s=this.needle.evaluate(e),c=this.haystack.evaluate(e);if(!c)return!1;if(!Mi(s,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${At(ge(s))} instead.`);if(!Mi(c,["string","array"]))throw new et(`Expected second argument to be of type array or string, but found ${At(ge(c))} instead.`);return c.indexOf(s)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Sa{constructor(e,s,c){this.type=qe,this.needle=e,this.haystack=s,this.fromIndex=c}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let c=s.parse(e[1],1,we),f=s.parse(e[2],2,we);if(!c||!f)return null;if(!ai(c.type,[H,U,qe,fn,we]))return s.error(`Expected first argument to be of type boolean, string, number or null, but found ${At(c.type)} instead`);if(e.length===4){let y=s.parse(e[3],3,qe);return y?new Sa(c,f,y):null}return new Sa(c,f)}evaluate(e){let s=this.needle.evaluate(e),c=this.haystack.evaluate(e);if(!Mi(s,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${At(ge(s))} instead.`);if(!Mi(c,["string","array"]))throw new et(`Expected second argument to be of type array or string, but found ${At(ge(c))} instead.`);if(this.fromIndex){let f=this.fromIndex.evaluate(e);return c.indexOf(s,f)}return c.indexOf(s)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Hl{constructor(e,s,c,f,y,_){this.inputType=e,this.type=s,this.input=c,this.cases=f,this.outputs=y,this.otherwise=_}static parse(e,s){if(e.length<5)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return s.error("Expected an even number of arguments.");let c,f;s.expectedType&&s.expectedType.kind!=="value"&&(f=s.expectedType);let y={},_=[];for(let T=2;T<e.length-1;T+=2){let P=e[T],z=e[T+1];Array.isArray(P)||(P=[P]);let L=s.concat(T);if(P.length===0)return L.error("Expected at least one branch label.");for(let j of P){if(typeof j!="number"&&typeof j!="string")return L.error("Branch labels must be numbers or strings.");if(typeof j=="number"&&Math.abs(j)>Number.MAX_SAFE_INTEGER)return L.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof j=="number"&&Math.floor(j)!==j)return L.error("Numeric branch labels must be integer values.");if(c){if(L.checkSubtype(c,ge(j)))return null}else c=ge(j);if(y[String(j)]!==void 0)return L.error("Branch labels must be unique.");y[String(j)]=_.length}let N=s.parse(z,T,f);if(!N)return null;f=f||N.type,_.push(N)}let b=s.parse(e[1],1,we);if(!b)return null;let w=s.parse(e[e.length-1],e.length-1,f);return w?b.type.kind!=="value"&&s.concat(1).checkSubtype(c,b.type)?null:new Hl(c,f,b,y,_,w):null}evaluate(e){let s=this.input.evaluate(e);return(ge(s)===this.inputType&&this.outputs[this.cases[s]]||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()}}class Jl{constructor(e,s,c){this.type=e,this.branches=s,this.otherwise=c}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return s.error("Expected an odd number of arguments.");let c;s.expectedType&&s.expectedType.kind!=="value"&&(c=s.expectedType);let f=[];for(let _=1;_<e.length-1;_+=2){let b=s.parse(e[_],_,H);if(!b)return null;let w=s.parse(e[_+1],_+1,c);if(!w)return null;f.push([b,w]),c=c||w.type}let y=s.parse(e[e.length-1],e.length-1,c);if(!y)return null;if(!c)throw new Error("Can't infer output type");return new Jl(c,f,y)}evaluate(e){for(let[s,c]of this.branches)if(s.evaluate(e))return c.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[s,c]of this.branches)e(s),e(c);e(this.otherwise)}outputDefined(){return this.branches.every(([e,s])=>s.outputDefined())&&this.otherwise.outputDefined()}}class Ta{constructor(e,s,c,f){this.type=e,this.input=s,this.beginIndex=c,this.endIndex=f}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let c=s.parse(e[1],1,we),f=s.parse(e[2],2,qe);if(!c||!f)return null;if(!ai(c.type,[lr(we),U,we]))return s.error(`Expected first argument to be of type array or string, but found ${At(c.type)} instead`);if(e.length===4){let y=s.parse(e[3],3,qe);return y?new Ta(c.type,c,f,y):null}return new Ta(c.type,c,f)}evaluate(e){let s=this.input.evaluate(e),c=this.beginIndex.evaluate(e);if(!Mi(s,["string","array"]))throw new et(`Expected first argument to be of type array or string, but found ${At(ge(s))} instead.`);if(this.endIndex){let f=this.endIndex.evaluate(e);return s.slice(c,f)}return s.slice(c)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Uc(i,e){return i==="=="||i==="!="?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 $c(i,e,s,c){return c.compare(e,s)===0}function Yo(i,e,s){let c=i!=="=="&&i!=="!=";return class Y_{constructor(y,_,b){this.type=H,this.lhs=y,this.rhs=_,this.collator=b,this.hasUntypedArgument=y.type.kind==="value"||_.type.kind==="value"}static parse(y,_){if(y.length!==3&&y.length!==4)return _.error("Expected two or three arguments.");let b=y[0],w=_.parse(y[1],1,we);if(!w)return null;if(!Uc(b,w.type))return _.concat(1).error(`"${b}" comparisons are not supported for type '${At(w.type)}'.`);let T=_.parse(y[2],2,we);if(!T)return null;if(!Uc(b,T.type))return _.concat(2).error(`"${b}" comparisons are not supported for type '${At(T.type)}'.`);if(w.type.kind!==T.type.kind&&w.type.kind!=="value"&&T.type.kind!=="value")return _.error(`Cannot compare types '${At(w.type)}' and '${At(T.type)}'.`);c&&(w.type.kind==="value"&&T.type.kind!=="value"?w=new St(T.type,[w]):w.type.kind!=="value"&&T.type.kind==="value"&&(T=new St(w.type,[T])));let P=null;if(y.length===4){if(w.type.kind!=="string"&&T.type.kind!=="string"&&w.type.kind!=="value"&&T.type.kind!=="value")return _.error("Cannot use collator to compare non-string types.");if(P=_.parse(y[3],3,Ne),!P)return null}return new Y_(w,T,P)}evaluate(y){let _=this.lhs.evaluate(y),b=this.rhs.evaluate(y);if(c&&this.hasUntypedArgument){let w=ge(_),T=ge(b);if(w.kind!==T.kind||w.kind!=="string"&&w.kind!=="number")throw new et(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${w.kind}, ${T.kind}) instead.`)}if(this.collator&&!c&&this.hasUntypedArgument){let w=ge(_),T=ge(b);if(w.kind!=="string"||T.kind!=="string")return e(y,_,b)}return this.collator?s(y,_,b,this.collator.evaluate(y)):e(y,_,b)}eachChild(y){y(this.lhs),y(this.rhs),this.collator&&y(this.collator)}outputDefined(){return!0}}}let nd=Yo("==",function(i,e,s){return e===s},$c),od=Yo("!=",function(i,e,s){return e!==s},function(i,e,s,c){return!$c(0,e,s,c)}),sd=Yo("<",function(i,e,s){return e<s},function(i,e,s,c){return c.compare(e,s)<0}),ad=Yo(">",function(i,e,s){return e>s},function(i,e,s,c){return c.compare(e,s)>0}),ld=Yo("<=",function(i,e,s){return e<=s},function(i,e,s,c){return c.compare(e,s)<=0}),ud=Yo(">=",function(i,e,s){return e>=s},function(i,e,s,c){return c.compare(e,s)>=0});class Yl{constructor(e,s,c,f,y){this.type=U,this.number=e,this.locale=s,this.currency=c,this.minFractionDigits=f,this.maxFractionDigits=y}static parse(e,s){if(e.length!==3)return s.error("Expected two arguments.");let c=s.parse(e[1],1,qe);if(!c)return null;let f=e[2];if(typeof f!="object"||Array.isArray(f))return s.error("NumberFormat options argument must be an object.");let y=null;if(f.locale&&(y=s.parse(f.locale,1,U),!y))return null;let _=null;if(f.currency&&(_=s.parse(f.currency,1,U),!_))return null;let b=null;if(f["min-fraction-digits"]&&(b=s.parse(f["min-fraction-digits"],1,qe),!b))return null;let w=null;return f["max-fraction-digits"]&&(w=s.parse(f["max-fraction-digits"],1,qe),!w)?null:new Yl(c,y,_,b,w)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ca{constructor(e){this.type=Le,this.sections=e}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let c=e[1];if(!Array.isArray(c)&&typeof c=="object")return s.error("First argument must be an image or text section.");let f=[],y=!1;for(let _=1;_<=e.length-1;++_){let b=e[_];if(y&&typeof b=="object"&&!Array.isArray(b)){y=!1;let w=null;if(b["font-scale"]&&(w=s.parse(b["font-scale"],1,qe),!w))return null;let T=null;if(b["text-font"]&&(T=s.parse(b["text-font"],1,lr(U)),!T))return null;let P=null;if(b["text-color"]&&(P=s.parse(b["text-color"],1,he),!P))return null;let z=f[f.length-1];z.scale=w,z.font=T,z.textColor=P}else{let w=s.parse(e[_],1,we);if(!w)return null;let T=w.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return s.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");y=!0,f.push({content:w,scale:null,font:null,textColor:null})}}return new Ca(f)}evaluate(e){return new te(this.sections.map(s=>{let c=s.content.evaluate(e);return ge(c)===Pt?new ie("",c,null,null,null):new ie(ct(c),null,s.scale?s.scale.evaluate(e):null,s.font?s.font.evaluate(e).join(","):null,s.textColor?s.textColor.evaluate(e):null)}))}eachChild(e){for(let s of this.sections)e(s.content),s.scale&&e(s.scale),s.font&&e(s.font),s.textColor&&e(s.textColor)}outputDefined(){return!1}}class Ql{constructor(e){this.type=Pt,this.input=e}static parse(e,s){if(e.length!==2)return s.error("Expected two arguments.");let c=s.parse(e[1],1,U);return c?new Ql(c):s.error("No image name provided.")}evaluate(e){let s=this.input.evaluate(e),c=ne.fromString(s);return c&&e.availableImages&&(c.available=e.availableImages.indexOf(s)>-1),c}eachChild(e){e(this.input)}outputDefined(){return!1}}class eu{constructor(e){this.type=qe,this.input=e}static parse(e,s){if(e.length!==2)return s.error(`Expected 1 argument, but found ${e.length-1} instead.`);let c=s.parse(e[1],1);return c?c.type.kind!=="array"&&c.type.kind!=="string"&&c.type.kind!=="value"?s.error(`Expected argument of type string or array, but found ${At(c.type)} instead.`):new eu(c):null}evaluate(e){let s=this.input.evaluate(e);if(typeof s=="string"||Array.isArray(s))return s.length;throw new et(`Expected value to be of type string or array, but found ${At(ge(s))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Qo={"==":nd,"!=":od,">":ad,"<":sd,">=":ud,"<=":ld,array:St,at:Wl,boolean:St,case:Jl,coalesce:wa,collator:Qr,format:Ca,image:Ql,in:Xl,"index-of":Sa,interpolate:ji,"interpolate-hcl":ji,"interpolate-lab":ji,length:eu,let:Ea,literal:dt,match:Hl,number:St,"number-format":Yl,object:St,slice:Ta,step:Ms,string:St,"to-boolean":Ct,"to-color":Ct,"to-number":Ct,"to-string":Ct,var:va,within:ko};function qc(i,[e,s,c,f]){e=e.evaluate(i),s=s.evaluate(i),c=c.evaluate(i);let y=f?f.evaluate(i):1,_=be(e,s,c,y);if(_)throw new et(_);return new $(e/255*y,s/255*y,c/255*y,y)}function Gc(i,e){return i in e}function Aa(i,e){let s=e[i];return s===void 0?null:s}function Io(i){return{type:i}}function Zc(i){return{result:"success",value:i}}function es(i){return{result:"error",value:i}}function Sr(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Kc(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Gt(i){return!!i.expression&&i.expression.interpolated}function ir(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function xr(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function kr(i){return i}function Fs(i,e){let s=e.type==="color",c=i.stops&&typeof i.stops[0][0]=="object",f=c||!(c||i.property!==void 0),y=i.type||(Gt(e)?"exponential":"interval");if(s||e.type==="padding"){let T=s?$.parse:Q.parse;(i=Ni({},i)).stops&&(i.stops=i.stops.map(P=>[P[0],T(P[1])])),i.default=T(i.default?i.default:e.default)}if(i.colorSpace&&i.colorSpace!=="rgb"&&!Vc[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let _,b,w;if(y==="exponential")_=Wc;else if(y==="interval")_=hd;else if(y==="categorical"){_=cd,b=Object.create(null);for(let T of i.stops)b[T[0]]=T[1];w=typeof i.stops[0][0]}else{if(y!=="identity")throw new Error(`Unknown function type "${y}"`);_=pd}if(c){let T={},P=[];for(let N=0;N<i.stops.length;N++){let j=i.stops[N],J=j[0].zoom;T[J]===void 0&&(T[J]={zoom:J,type:i.type,property:i.property,default:i.default,stops:[]},P.push(J)),T[J].stops.push([j[0].value,j[1]])}let z=[];for(let N of P)z.push([T[N].zoom,Fs(T[N],e)]);let L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:ji.interpolationFactor.bind(void 0,L),zoomStops:z.map(N=>N[0]),evaluate:({zoom:N},j)=>Wc({stops:z,base:i.base},e,N).evaluate(N,j)}}if(f){let T=y==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:ji.interpolationFactor.bind(void 0,T),zoomStops:i.stops.map(P=>P[0]),evaluate:({zoom:P})=>_(i,e,P,b,w)}}return{kind:"source",evaluate(T,P){let z=P&&P.properties?P.properties[i.property]:void 0;return z===void 0?ts(i.default,e.default):_(i,e,z,b,w)}}}function ts(i,e,s){return i!==void 0?i:e!==void 0?e:s!==void 0?s:void 0}function cd(i,e,s,c,f){return ts(typeof s===f?c[s]:void 0,i.default,e.default)}function hd(i,e,s){if(ir(s)!=="number")return ts(i.default,e.default);let c=i.stops.length;if(c===1||s<=i.stops[0][0])return i.stops[0][1];if(s>=i.stops[c-1][0])return i.stops[c-1][1];let f=ba(i.stops.map(y=>y[0]),s);return i.stops[f][1]}function Wc(i,e,s){let c=i.base!==void 0?i.base:1;if(ir(s)!=="number")return ts(i.default,e.default);let f=i.stops.length;if(f===1||s<=i.stops[0][0])return i.stops[0][1];if(s>=i.stops[f-1][0])return i.stops[f-1][1];let y=ba(i.stops.map(P=>P[0]),s),_=function(P,z,L,N){let j=N-L,J=P-L;return j===0?0:z===1?J/j:(Math.pow(z,J)-1)/(Math.pow(z,j)-1)}(s,c,i.stops[y][0],i.stops[y+1][0]),b=i.stops[y][1],w=i.stops[y+1][1],T=zs[e.type]||kr;if(i.colorSpace&&i.colorSpace!=="rgb"){let P=Vc[i.colorSpace];T=(z,L)=>P.reverse(P.interpolate(P.forward(z),P.forward(L),_))}return typeof b.evaluate=="function"?{evaluate(...P){let z=b.evaluate.apply(void 0,P),L=w.evaluate.apply(void 0,P);if(z!==void 0&&L!==void 0)return T(z,L,_)}}:T(b,w,_)}function pd(i,e,s){switch(e.type){case"color":s=$.parse(s);break;case"formatted":s=te.fromString(s.toString());break;case"resolvedImage":s=ne.fromString(s.toString());break;case"padding":s=Q.parse(s);break;default:ir(s)===e.type||e.type==="enum"&&e.values[s]||(s=void 0)}return ts(s,i.default,e.default)}mr.register(Qo,{error:[{kind:"error"},[U],(i,[e])=>{throw new et(e.evaluate(i))}],typeof:[U,[we],(i,[e])=>At(ge(e.evaluate(i)))],"to-rgba":[lr(qe,4),[he],(i,[e])=>e.evaluate(i).toArray()],rgb:[he,[qe,qe,qe],qc],rgba:[he,[qe,qe,qe,qe],qc],has:{type:H,overloads:[[[U],(i,[e])=>Gc(e.evaluate(i),i.properties())],[[U,ke],(i,[e,s])=>Gc(e.evaluate(i),s.evaluate(i))]]},get:{type:we,overloads:[[[U],(i,[e])=>Aa(e.evaluate(i),i.properties())],[[U,ke],(i,[e,s])=>Aa(e.evaluate(i),s.evaluate(i))]]},"feature-state":[we,[U],(i,[e])=>Aa(e.evaluate(i),i.featureState||{})],properties:[ke,[],i=>i.properties()],"geometry-type":[U,[],i=>i.geometryType()],id:[we,[],i=>i.id()],zoom:[qe,[],i=>i.globals.zoom],"heatmap-density":[qe,[],i=>i.globals.heatmapDensity||0],"line-progress":[qe,[],i=>i.globals.lineProgress||0],accumulated:[we,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[qe,Io(qe),(i,e)=>{let s=0;for(let c of e)s+=c.evaluate(i);return s}],"*":[qe,Io(qe),(i,e)=>{let s=1;for(let c of e)s*=c.evaluate(i);return s}],"-":{type:qe,overloads:[[[qe,qe],(i,[e,s])=>e.evaluate(i)-s.evaluate(i)],[[qe],(i,[e])=>-e.evaluate(i)]]},"/":[qe,[qe,qe],(i,[e,s])=>e.evaluate(i)/s.evaluate(i)],"%":[qe,[qe,qe],(i,[e,s])=>e.evaluate(i)%s.evaluate(i)],ln2:[qe,[],()=>Math.LN2],pi:[qe,[],()=>Math.PI],e:[qe,[],()=>Math.E],"^":[qe,[qe,qe],(i,[e,s])=>Math.pow(e.evaluate(i),s.evaluate(i))],sqrt:[qe,[qe],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[qe,[qe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[qe,[qe],(i,[e])=>Math.log(e.evaluate(i))],log2:[qe,[qe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[qe,[qe],(i,[e])=>Math.sin(e.evaluate(i))],cos:[qe,[qe],(i,[e])=>Math.cos(e.evaluate(i))],tan:[qe,[qe],(i,[e])=>Math.tan(e.evaluate(i))],asin:[qe,[qe],(i,[e])=>Math.asin(e.evaluate(i))],acos:[qe,[qe],(i,[e])=>Math.acos(e.evaluate(i))],atan:[qe,[qe],(i,[e])=>Math.atan(e.evaluate(i))],min:[qe,Io(qe),(i,e)=>Math.min(...e.map(s=>s.evaluate(i)))],max:[qe,Io(qe),(i,e)=>Math.max(...e.map(s=>s.evaluate(i)))],abs:[qe,[qe],(i,[e])=>Math.abs(e.evaluate(i))],round:[qe,[qe],(i,[e])=>{let s=e.evaluate(i);return s<0?-Math.round(-s):Math.round(s)}],floor:[qe,[qe],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[qe,[qe],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[H,[U,we],(i,[e,s])=>i.properties()[e.value]===s.value],"filter-id-==":[H,[we],(i,[e])=>i.id()===e.value],"filter-type-==":[H,[U],(i,[e])=>i.geometryType()===e.value],"filter-<":[H,[U,we],(i,[e,s])=>{let c=i.properties()[e.value],f=s.value;return typeof c==typeof f&&c<f}],"filter-id-<":[H,[we],(i,[e])=>{let s=i.id(),c=e.value;return typeof s==typeof c&&s<c}],"filter->":[H,[U,we],(i,[e,s])=>{let c=i.properties()[e.value],f=s.value;return typeof c==typeof f&&c>f}],"filter-id->":[H,[we],(i,[e])=>{let s=i.id(),c=e.value;return typeof s==typeof c&&s>c}],"filter-<=":[H,[U,we],(i,[e,s])=>{let c=i.properties()[e.value],f=s.value;return typeof c==typeof f&&c<=f}],"filter-id-<=":[H,[we],(i,[e])=>{let s=i.id(),c=e.value;return typeof s==typeof c&&s<=c}],"filter->=":[H,[U,we],(i,[e,s])=>{let c=i.properties()[e.value],f=s.value;return typeof c==typeof f&&c>=f}],"filter-id->=":[H,[we],(i,[e])=>{let s=i.id(),c=e.value;return typeof s==typeof c&&s>=c}],"filter-has":[H,[we],(i,[e])=>e.value in i.properties()],"filter-has-id":[H,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[H,[lr(U)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[H,[lr(we)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[H,[U,lr(we)],(i,[e,s])=>s.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[H,[U,lr(we)],(i,[e,s])=>function(c,f,y,_){for(;y<=_;){let b=y+_>>1;if(f[b]===c)return!0;f[b]>c?_=b-1:y=b+1}return!1}(i.properties()[e.value],s.value,0,s.value.length-1)],all:{type:H,overloads:[[[H,H],(i,[e,s])=>e.evaluate(i)&&s.evaluate(i)],[Io(H),(i,e)=>{for(let s of e)if(!s.evaluate(i))return!1;return!0}]]},any:{type:H,overloads:[[[H,H],(i,[e,s])=>e.evaluate(i)||s.evaluate(i)],[Io(H),(i,e)=>{for(let s of e)if(s.evaluate(i))return!0;return!1}]]},"!":[H,[H],(i,[e])=>!e.evaluate(i)],"is-supported-script":[H,[U],(i,[e])=>{let s=i.globals&&i.globals.isSupportedScript;return!s||s(e.evaluate(i))}],upcase:[U,[U],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[U,[U],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[U,Io(we),(i,e)=>e.map(s=>ct(s.evaluate(i))).join("")],"resolved-locale":[U,[Ne],(i,[e])=>e.evaluate(i).resolvedLocale()]});class ka{constructor(e,s){this.expression=e,this._warningHistory={},this._evaluator=new Jt,this._defaultValue=s?function(c){return c.type==="color"&&xr(c.default)?new $(0,0,0,0):c.type==="color"?$.parse(c.default)||null:c.type==="padding"?Q.parse(c.default)||null:c.default===void 0?null:c.default}(s):null,this._enumValues=s&&s.type==="enum"?s.values:null}evaluateWithoutErrorHandling(e,s,c,f,y,_){return this._evaluator.globals=e,this._evaluator.feature=s,this._evaluator.featureState=c,this._evaluator.canonical=f,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=_,this.expression.evaluate(this._evaluator)}evaluate(e,s,c,f,y,_){this._evaluator.globals=e,this._evaluator.feature=s||null,this._evaluator.featureState=c||null,this._evaluator.canonical=f,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=_||null;try{let b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new et(`Expected value to be one of ${Object.keys(this._enumValues).map(w=>JSON.stringify(w)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Rs(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Qo}function Ls(i,e){let s=new Jo(Qo,[],e?function(f){let y={color:he,string:U,number:qe,enum:U,boolean:H,formatted:Le,padding:Tt,resolvedImage:Pt};return f.type==="array"?lr(y[f.value]||we,f.length):y[f.type]}(e):void 0),c=s.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return c?Zc(new ka(c,e)):es(s.errors)}class Bs{constructor(e,s){this.kind=e,this._styleExpression=s,this.isStateDependent=e!=="constant"&&!Ho(s.expression)}evaluateWithoutErrorHandling(e,s,c,f,y,_){return this._styleExpression.evaluateWithoutErrorHandling(e,s,c,f,y,_)}evaluate(e,s,c,f,y,_){return this._styleExpression.evaluate(e,s,c,f,y,_)}}class tu{constructor(e,s,c,f){this.kind=e,this.zoomStops=c,this._styleExpression=s,this.isStateDependent=e!=="camera"&&!Ho(s.expression),this.interpolationType=f}evaluateWithoutErrorHandling(e,s,c,f,y,_){return this._styleExpression.evaluateWithoutErrorHandling(e,s,c,f,y,_)}evaluate(e,s,c,f,y,_){return this._styleExpression.evaluate(e,s,c,f,y,_)}interpolationFactor(e,s,c){return this.interpolationType?ji.interpolationFactor(this.interpolationType,e,s,c):0}}function Xc(i,e){let s=Ls(i,e);if(s.result==="error")return s;let c=s.value.expression,f=Ps(c);if(!f&&!Sr(e))return es([new pi("","data expressions not supported")]);let y=_a(c,["zoom"]);if(!y&&!Kc(e))return es([new pi("","zoom expressions not supported")]);let _=Pa(c);return _||y?_ instanceof pi?es([_]):_ instanceof ji&&!Gt(e)?es([new pi("",'"interpolate" expressions cannot be used with this property')]):Zc(_?new tu(f?"camera":"composite",s.value,_.labels,_ instanceof ji?_.interpolation:void 0):new Bs(f?"constant":"source",s.value)):es([new pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ia{constructor(e,s){this._parameters=e,this._specification=s,Ni(this,Fs(this._parameters,this._specification))}static deserialize(e){return new Ia(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Pa(i){let e=null;if(i instanceof Ea)e=Pa(i.result);else if(i instanceof wa){for(let s of i.args)if(e=Pa(s),e)break}else(i instanceof Ms||i instanceof ji)&&i.input instanceof mr&&i.input.name==="zoom"&&(e=i);return e instanceof pi||i.eachChild(s=>{let c=Pa(s);c instanceof pi?e=c:!e&&c?e=new pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&c&&e!==c&&(e=new pi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function mn(i){let e=i.key,s=i.value,c=i.valueSpec||{},f=i.objectElementValidators||{},y=i.style,_=i.styleSpec,b=[],w=ir(s);if(w!=="object")return[new Ge(e,s,`object expected, ${w} found`)];for(let T in s){let P=T.split(".")[0],z=c[P]||c["*"],L;if(f[P])L=f[P];else if(c[P])L=Ui;else if(f["*"])L=f["*"];else{if(!c["*"]){b.push(new Ge(e,s[T],`unknown property "${T}"`));continue}L=Ui}b=b.concat(L({key:(e&&`${e}.`)+T,value:s[T],valueSpec:z,style:y,styleSpec:_,object:s,objectKey:T},s))}for(let T in c)f[T]||c[T].required&&c[T].default===void 0&&s[T]===void 0&&b.push(new Ge(e,s,`missing required property "${T}"`));return b}function Hc(i){let e=i.value,s=i.valueSpec,c=i.style,f=i.styleSpec,y=i.key,_=i.arrayElementValidator||Ui;if(ir(e)!=="array")return[new Ge(y,e,`array expected, ${ir(e)} found`)];if(s.length&&e.length!==s.length)return[new Ge(y,e,`array length ${s.length} expected, length ${e.length} found`)];if(s["min-length"]&&e.length<s["min-length"])return[new Ge(y,e,`array length at least ${s["min-length"]} expected, length ${e.length} found`)];let b={type:s.value,values:s.values};f.$version<7&&(b.function=s.function),ir(s.value)==="object"&&(b=s.value);let w=[];for(let T=0;T<e.length;T++)w=w.concat(_({array:e,arrayIndex:T,value:e[T],valueSpec:b,style:c,styleSpec:f,key:`${y}[${T}]`}));return w}function ru(i){let e=i.key,s=i.value,c=i.valueSpec,f=ir(s);return f==="number"&&s!=s&&(f="NaN"),f!=="number"?[new Ge(e,s,`number expected, ${f} found`)]:"minimum"in c&&s<c.minimum?[new Ge(e,s,`${s} is less than the minimum value ${c.minimum}`)]:"maximum"in c&&s>c.maximum?[new Ge(e,s,`${s} is greater than the maximum value ${c.maximum}`)]:[]}function Jc(i){let e=i.valueSpec,s=Zt(i.value.type),c,f,y,_={},b=s!=="categorical"&&i.value.property===void 0,w=!b,T=ir(i.value.stops)==="array"&&ir(i.value.stops[0])==="array"&&ir(i.value.stops[0][0])==="object",P=mn({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(N){if(s==="identity")return[new Ge(N.key,N.value,'identity function may not have a "stops" property')];let j=[],J=N.value;return j=j.concat(Hc({key:N.key,value:J,valueSpec:N.valueSpec,style:N.style,styleSpec:N.styleSpec,arrayElementValidator:z})),ir(J)==="array"&&J.length===0&&j.push(new Ge(N.key,J,"array must have at least one stop")),j},default:function(N){return Ui({key:N.key,value:N.value,valueSpec:e,style:N.style,styleSpec:N.styleSpec})}}});return s==="identity"&&b&&P.push(new Ge(i.key,i.value,'missing required property "property"')),s==="identity"||i.value.stops||P.push(new Ge(i.key,i.value,'missing required property "stops"')),s==="exponential"&&i.valueSpec.expression&&!Gt(i.valueSpec)&&P.push(new Ge(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(w&&!Sr(i.valueSpec)?P.push(new Ge(i.key,i.value,"property functions not supported")):b&&!Kc(i.valueSpec)&&P.push(new Ge(i.key,i.value,"zoom functions not supported"))),s!=="categorical"&&!T||i.value.property!==void 0||P.push(new Ge(i.key,i.value,'"property" property is required')),P;function z(N){let j=[],J=N.value,X=N.key;if(ir(J)!=="array")return[new Ge(X,J,`array expected, ${ir(J)} found`)];if(J.length!==2)return[new Ge(X,J,`array length 2 expected, length ${J.length} found`)];if(T){if(ir(J[0])!=="object")return[new Ge(X,J,`object expected, ${ir(J[0])} found`)];if(J[0].zoom===void 0)return[new Ge(X,J,"object stop key must have zoom")];if(J[0].value===void 0)return[new Ge(X,J,"object stop key must have value")];if(y&&y>Zt(J[0].zoom))return[new Ge(X,J[0].zoom,"stop zoom values must appear in ascending order")];Zt(J[0].zoom)!==y&&(y=Zt(J[0].zoom),f=void 0,_={}),j=j.concat(mn({key:`${X}[0]`,value:J[0],valueSpec:{zoom:{}},style:N.style,styleSpec:N.styleSpec,objectElementValidators:{zoom:ru,value:L}}))}else j=j.concat(L({key:`${X}[0]`,value:J[0],valueSpec:{},style:N.style,styleSpec:N.styleSpec},J));return Rs(Ei(J[1]))?j.concat([new Ge(`${X}[1]`,J[1],"expressions are not allowed in function stops.")]):j.concat(Ui({key:`${X}[1]`,value:J[1],valueSpec:e,style:N.style,styleSpec:N.styleSpec}))}function L(N,j){let J=ir(N.value),X=Zt(N.value),ae=N.value!==null?N.value:j;if(c){if(J!==c)return[new Ge(N.key,ae,`${J} stop domain type must match previous stop domain type ${c}`)]}else c=J;if(J!=="number"&&J!=="string"&&J!=="boolean")return[new Ge(N.key,ae,"stop domain value must be a number, string, or boolean")];if(J!=="number"&&s!=="categorical"){let me=`number expected, ${J} found`;return Sr(e)&&s===void 0&&(me+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ge(N.key,ae,me)]}return s!=="categorical"||J!=="number"||isFinite(X)&&Math.floor(X)===X?s!=="categorical"&&J==="number"&&f!==void 0&&X<f?[new Ge(N.key,ae,"stop domain values must appear in ascending order")]:(f=X,s==="categorical"&&X in _?[new Ge(N.key,ae,"stop domain values must be unique")]:(_[X]=!0,[])):[new Ge(N.key,ae,`integer expected, found ${X}`)]}}function Po(i){let e=(i.expressionContext==="property"?Xc:Ls)(Ei(i.value),i.valueSpec);if(e.result==="error")return e.value.map(c=>new Ge(`${i.key}${c.key}`,i.value,c.message));let s=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!s.outputDefined())return[new Ge(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Ho(s))return[new Ge(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Ho(s))return[new Ge(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!_a(s,["zoom","feature-state"]))return[new Ge(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Ps(s))return[new Ge(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ns(i){let e=i.key,s=i.value,c=i.valueSpec,f=[];return Array.isArray(c.values)?c.values.indexOf(Zt(s))===-1&&f.push(new Ge(e,s,`expected one of [${c.values.join(", ")}], ${JSON.stringify(s)} found`)):Object.keys(c.values).indexOf(Zt(s))===-1&&f.push(new Ge(e,s,`expected one of [${Object.keys(c.values).join(", ")}], ${JSON.stringify(s)} found`)),f}function rs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(let e of i.slice(1))if(!rs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let dd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ma(i){if(i==null)return{filter:()=>!0,needGeometry:!1};rs(i)||(i=js(i));let e=Ls(i,dd);if(e.result==="error")throw new Error(e.value.map(s=>`${s.key}: ${s.message}`).join(", "));return{filter:(s,c,f)=>e.value.evaluate(s,c,{},f),needGeometry:Qc(i)}}function Yc(i,e){return i<e?-1:i>e?1:0}function Qc(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Qc(i[e]))return!0;return!1}function js(i){if(!i)return!0;let e=i[0];return i.length<=1?e!=="any":e==="=="?iu(i[1],i[2],"=="):e==="!="?is(iu(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?iu(i[1],i[2],e):e==="any"?(s=i.slice(1),["any"].concat(s.map(js))):e==="all"?["all"].concat(i.slice(1).map(js)):e==="none"?["all"].concat(i.slice(1).map(js).map(is)):e==="in"?za(i[1],i.slice(2)):e==="!in"?is(za(i[1],i.slice(2))):e==="has"?Vs(i[1]):e==="!has"?is(Vs(i[1])):e!=="within"||i;var s}function iu(i,e,s){switch(i){case"$type":return[`filter-type-${s}`,e];case"$id":return[`filter-id-${s}`,e];default:return[`filter-${s}`,i,e]}}function za(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(s=>typeof s!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Yc)]]:["filter-in-small",i,["literal",e]]}}function Vs(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function is(i){return["!",i]}function Us(i){return rs(Ei(i.value))?Po(Ni({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):eh(i)}function eh(i){let e=i.value,s=i.key;if(ir(e)!=="array")return[new Ge(s,e,`array expected, ${ir(e)} found`)];let c=i.styleSpec,f,y=[];if(e.length<1)return[new Ge(s,e,"filter array must have at least 1 element")];switch(y=y.concat(Ns({key:`${s}[0]`,value:e[0],valueSpec:c.filter_operator,style:i.style,styleSpec:i.styleSpec})),Zt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Zt(e[1])==="$type"&&y.push(new Ge(s,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&y.push(new Ge(s,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(f=ir(e[1]),f!=="string"&&y.push(new Ge(`${s}[1]`,e[1],`string expected, ${f} found`)));for(let _=2;_<e.length;_++)f=ir(e[_]),Zt(e[1])==="$type"?y=y.concat(Ns({key:`${s}[${_}]`,value:e[_],valueSpec:c.geometry_type,style:i.style,styleSpec:i.styleSpec})):f!=="string"&&f!=="number"&&f!=="boolean"&&y.push(new Ge(`${s}[${_}]`,e[_],`string, number, or boolean expected, ${f} found`));break;case"any":case"all":case"none":for(let _=1;_<e.length;_++)y=y.concat(eh({key:`${s}[${_}]`,value:e[_],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":f=ir(e[1]),e.length!==2?y.push(new Ge(s,e,`filter array for "${e[0]}" operator must have 2 elements`)):f!=="string"&&y.push(new Ge(`${s}[1]`,e[1],`string expected, ${f} found`));break;case"within":f=ir(e[1]),e.length!==2?y.push(new Ge(s,e,`filter array for "${e[0]}" operator must have 2 elements`)):f!=="object"&&y.push(new Ge(`${s}[1]`,e[1],`object expected, ${f} found`))}return y}function $s(i,e){let s=i.key,c=i.style,f=i.styleSpec,y=i.value,_=i.objectKey,b=f[`${e}_${i.layerType}`];if(!b)return[];let w=_.match(/^(.*)-transition$/);if(e==="paint"&&w&&b[w[1]]&&b[w[1]].transition)return Ui({key:s,value:y,valueSpec:f.transition,style:c,styleSpec:f});let T=i.valueSpec||b[_];if(!T)return[new Ge(s,y,`unknown property "${_}"`)];let P;if(ir(y)==="string"&&Sr(T)&&!T.tokens&&(P=/^{([^}]+)}$/.exec(y)))return[new Ge(s,y,`"${_}" does not support interpolation syntax
17
- Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(P[1])} }\`.`)];let z=[];return i.layerType==="symbol"&&(_==="text-field"&&c&&!c.glyphs&&z.push(new Ge(s,y,'use of "text-field" requires a style "glyphs" property')),_==="text-font"&&xr(Ei(y))&&Zt(y.type)==="identity"&&z.push(new Ge(s,y,'"text-font" does not support identity functions'))),z.concat(Ui({key:i.key,value:y,valueSpec:T,style:c,styleSpec:f,expressionContext:"property",propertyType:e,propertyKey:_}))}function th(i){return $s(i,"paint")}function rh(i){return $s(i,"layout")}function ih(i){let e=[],s=i.value,c=i.key,f=i.style,y=i.styleSpec;s.type||s.ref||e.push(new Ge(c,s,'either "type" or "ref" is required'));let _=Zt(s.type),b=Zt(s.ref);if(s.id){let w=Zt(s.id);for(let T=0;T<i.arrayIndex;T++){let P=f.layers[T];Zt(P.id)===w&&e.push(new Ge(c,s.id,`duplicate layer id "${s.id}", previously used at line ${P.id.__line__}`))}}if("ref"in s){let w;["type","source","source-layer","filter","layout"].forEach(T=>{T in s&&e.push(new Ge(c,s[T],`"${T}" is prohibited for ref layers`))}),f.layers.forEach(T=>{Zt(T.id)===b&&(w=T)}),w?w.ref?e.push(new Ge(c,s.ref,"ref cannot reference another ref layer")):_=Zt(w.type):e.push(new Ge(c,s.ref,`ref layer "${b}" not found`))}else if(_!=="background")if(s.source){let w=f.sources&&f.sources[s.source],T=w&&Zt(w.type);w?T==="vector"&&_==="raster"?e.push(new Ge(c,s.source,`layer "${s.id}" requires a raster source`)):T==="raster"&&_!=="raster"?e.push(new Ge(c,s.source,`layer "${s.id}" requires a vector source`)):T!=="vector"||s["source-layer"]?T==="raster-dem"&&_!=="hillshade"?e.push(new Ge(c,s.source,"raster-dem source can only be used with layer type 'hillshade'.")):_!=="line"||!s.paint||!s.paint["line-gradient"]||T==="geojson"&&w.lineMetrics||e.push(new Ge(c,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ge(c,s,`layer "${s.id}" must specify a "source-layer"`)):e.push(new Ge(c,s.source,`source "${s.source}" not found`))}else e.push(new Ge(c,s,'missing required property "source"'));return e=e.concat(mn({key:c,value:s,valueSpec:y.layer,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Ui({key:`${c}.type`,value:s.type,valueSpec:y.layer.type,style:i.style,styleSpec:i.styleSpec,object:s,objectKey:"type"}),filter:Us,layout:w=>mn({layer:s,key:w.key,value:w.value,style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":T=>rh(Ni({layerType:_},T))}}),paint:w=>mn({layer:s,key:w.key,value:w.value,style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":T=>th(Ni({layerType:_},T))}})}})),e}function ns(i){let e=i.value,s=i.key,c=ir(e);return c!=="string"?[new Ge(s,e,`string expected, ${c} found`)]:[]}let nh={promoteId:function({key:i,value:e}){if(ir(e)==="string")return ns({key:i,value:e});{let s=[];for(let c in e)s.push(...ns({key:`${i}.${c}`,value:e[c]}));return s}}};function qs(i){let e=i.value,s=i.key,c=i.styleSpec,f=i.style;if(!e.type)return[new Ge(s,e,'"type" is required')];let y=Zt(e.type),_;switch(y){case"vector":case"raster":case"raster-dem":return _=mn({key:s,value:e,valueSpec:c[`source_${y.replace("-","_")}`],style:i.style,styleSpec:c,objectElementValidators:nh}),_;case"geojson":if(_=mn({key:s,value:e,valueSpec:c.source_geojson,style:f,styleSpec:c,objectElementValidators:nh}),e.cluster)for(let b in e.clusterProperties){let[w,T]=e.clusterProperties[b],P=typeof w=="string"?[w,["accumulated"],["get",b]]:w;_.push(...Po({key:`${s}.${b}.map`,value:T,expressionContext:"cluster-map"})),_.push(...Po({key:`${s}.${b}.reduce`,value:P,expressionContext:"cluster-reduce"}))}return _;case"video":return mn({key:s,value:e,valueSpec:c.source_video,style:f,styleSpec:c});case"image":return mn({key:s,value:e,valueSpec:c.source_image,style:f,styleSpec:c});case"canvas":return[new Ge(s,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ns({key:`${s}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:f,styleSpec:c})}}function Gs(i){let e=i.value,s=i.styleSpec,c=s.light,f=i.style,y=[],_=ir(e);if(e===void 0)return y;if(_!=="object")return y=y.concat([new Ge("light",e,`object expected, ${_} found`)]),y;for(let b in e){let w=b.match(/^(.*)-transition$/);y=y.concat(w&&c[w[1]]&&c[w[1]].transition?Ui({key:b,value:e[b],valueSpec:s.transition,style:f,styleSpec:s}):c[b]?Ui({key:b,value:e[b],valueSpec:c[b],style:f,styleSpec:s}):[new Ge(b,e[b],`unknown property "${b}"`)])}return y}function Vi(i){let e=i.value,s=i.styleSpec,c=s.terrain,f=i.style,y=[],_=ir(e);if(e===void 0)return y;if(_!=="object")return y=y.concat([new Ge("terrain",e,`object expected, ${_} found`)]),y;for(let b in e)y=y.concat(c[b]?Ui({key:b,value:e[b],valueSpec:c[b],style:f,styleSpec:s}):[new Ge(b,e[b],`unknown property "${b}"`)]);return y}let Zs={"*":()=>[],array:Hc,boolean:function(i){let e=i.value,s=i.key,c=ir(e);return c!=="boolean"?[new Ge(s,e,`boolean expected, ${c} found`)]:[]},number:ru,color:function(i){let e=i.key,s=i.value,c=ir(s);return c!=="string"?[new Ge(e,s,`color expected, ${c} found`)]:uo(s)===null?[new Ge(e,s,`color expected, "${s}" found`)]:[]},constants:qn,enum:Ns,filter:Us,function:Jc,layer:ih,object:mn,source:qs,light:Gs,terrain:Vi,string:ns,formatted:function(i){return ns(i).length===0?[]:Po(i)},resolvedImage:function(i){return ns(i).length===0?[]:Po(i)},padding:function(i){let e=i.key,s=i.value;if(ir(s)==="array"){if(s.length<1||s.length>4)return[new Ge(e,s,`padding requires 1 to 4 values; ${s.length} values found`)];let c={type:"number"},f=[];for(let y=0;y<s.length;y++)f=f.concat(Ui({key:`${e}[${y}]`,value:s[y],valueSpec:c}));return f}return ru({key:e,value:s,valueSpec:{}})}};function Ui(i){let e=i.value,s=i.valueSpec,c=i.styleSpec;return s.expression&&xr(Zt(e))?Jc(i):s.expression&&Rs(Ei(e))?Po(i):s.type&&Zs[s.type]?Zs[s.type](i):mn(Ni({},i,{valueSpec:s.type?c[s.type]:s}))}function fd(i){let e=i.value,s=i.key,c=ns(i);return c.length||(e.indexOf("{fontstack}")===-1&&c.push(new Ge(s,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&c.push(new Ge(s,e,'"glyphs" url must include a "{range}" token'))),c}function co(i,e=Se){let s=[];return s=s.concat(Ui({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,objectElementValidators:{glyphs:fd,"*":()=>[]}})),i.constants&&(s=s.concat(qn({key:"constants",value:i.constants,style:i,styleSpec:e}))),oh(s)}function oh(i){return[].concat(i).sort((e,s)=>e.line-s.line)}function Gn(i){return function(...e){return oh(i.apply(this,e))}}co.source=Gn(qs),co.light=Gn(Gs),co.terrain=Gn(Vi),co.layer=Gn(ih),co.filter=Gn(Us),co.paintProperty=Gn(th),co.layoutProperty=Gn(rh);let Ks=co,nu=Ks.light,md=Ks.paintProperty,yd=Ks.layoutProperty;function Oa(i,e){let s=!1;if(e&&e.length)for(let c of e)i.fire(new kn(new Error(c.message))),s=!0;return s}class Ws{constructor(e,s,c){let f=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let _=new Int32Array(this.arrayBuffer);e=_[0],this.d=(s=_[1])+2*(c=_[2]);for(let w=0;w<this.d*this.d;w++){let T=_[3+w],P=_[3+w+1];f.push(T===P?null:_.subarray(T,P))}let b=_[3+f.length+1];this.keys=_.subarray(_[3+f.length],b),this.bboxes=_.subarray(b),this.insert=this._insertReadonly}else{this.d=s+2*c;for(let _=0;_<this.d*this.d;_++)f.push([]);this.keys=[],this.bboxes=[]}this.n=s,this.extent=e,this.padding=c,this.scale=s/e,this.uid=0;let y=c/s*e;this.min=-y,this.max=e+y}insert(e,s,c,f,y){this._forEachCell(s,c,f,y,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(s),this.bboxes.push(c),this.bboxes.push(f),this.bboxes.push(y)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,s,c,f,y,_){this.cells[y].push(_)}query(e,s,c,f,y){let _=this.min,b=this.max;if(e<=_&&s<=_&&b<=c&&b<=f&&!y)return Array.prototype.slice.call(this.keys);{let w=[];return this._forEachCell(e,s,c,f,this._queryCell,w,{},y),w}}_queryCell(e,s,c,f,y,_,b,w){let T=this.cells[y];if(T!==null){let P=this.keys,z=this.bboxes;for(let L=0;L<T.length;L++){let N=T[L];if(b[N]===void 0){let j=4*N;(w?w(z[j+0],z[j+1],z[j+2],z[j+3]):e<=z[j+2]&&s<=z[j+3]&&c>=z[j+0]&&f>=z[j+1])?(b[N]=!0,_.push(P[N])):b[N]=!1}}}}_forEachCell(e,s,c,f,y,_,b,w){let T=this._convertToCellCoord(e),P=this._convertToCellCoord(s),z=this._convertToCellCoord(c),L=this._convertToCellCoord(f);for(let N=T;N<=z;N++)for(let j=P;j<=L;j++){let J=this.d*j+N;if((!w||w(this._convertFromCellCoord(N),this._convertFromCellCoord(j),this._convertFromCellCoord(N+1),this._convertFromCellCoord(j+1)))&&y.call(this,e,s,c,f,J,_,b,w))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,s=3+this.cells.length+1+1,c=0;for(let _=0;_<this.cells.length;_++)c+=this.cells[_].length;let f=new Int32Array(s+c+this.keys.length+this.bboxes.length);f[0]=this.extent,f[1]=this.n,f[2]=this.padding;let y=s;for(let _=0;_<e.length;_++){let b=e[_];f[3+_]=y,f.set(b,y),y+=b.length}return f[3+e.length]=y,f.set(this.keys,y),y+=this.keys.length,f[3+e.length+1]=y,f.set(this.bboxes,y),y+=this.bboxes.length,f.buffer}static serialize(e,s){let c=e.toArrayBuffer();return s&&s.push(c),{buffer:c}}static deserialize(e){return new Ws(e.buffer)}}let Zn={};function at(i,e,s={}){if(Zn[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),Zn[i]={klass:e,omit:s.omit||[],shallow:s.shallow||[]}}at("Object",Object),at("TransferableGridIndex",Ws),at("Color",$),at("Error",Error),at("AJAXError",er),at("ResolvedImage",ne),at("StylePropertyFunction",Ia),at("StyleExpression",ka,{omit:["_evaluator"]}),at("ZoomDependentExpression",tu),at("ZoomConstantExpression",Bs),at("CompoundExpression",mr,{omit:["_evaluate"]});for(let i in Qo)Qo[i]._classRegistryKey||at(`Expression_${i}`,Qo[i]);function sh(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Mo(i,e){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(sh(i)||wr(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){let s=i;return e&&e.push(s.buffer),s}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){let s=[];for(let c of i)s.push(Mo(c,e));return s}if(typeof i=="object"){let s=i.constructor,c=s._classRegistryKey;if(!c)throw new Error("can't serialize object of unregistered class");if(!Zn[c])throw new Error(`${c} is not registered.`);let f=s.serialize?s.serialize(i,e):{};if(s.serialize){if(e&&f===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let y in i){if(!i.hasOwnProperty(y)||Zn[c].omit.indexOf(y)>=0)continue;let _=i[y];f[y]=Zn[c].shallow.indexOf(y)>=0?_:Mo(_,e)}i instanceof Error&&(f.message=i.message)}if(f.$name)throw new Error("$name property is reserved for worker serialization logic.");return c!=="Object"&&(f.$name=c),f}throw new Error("can't serialize object of type "+typeof i)}function ho(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||sh(i)||wr(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(ho);if(typeof i=="object"){let e=i.$name||"Object";if(!Zn[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:s}=Zn[e];if(!s)throw new Error(`can't deserialize unregistered class ${e}`);if(s.deserialize)return s.deserialize(i);let c=Object.create(s.prototype);for(let f of Object.keys(i)){if(f==="$name")continue;let y=i[f];c[f]=Zn[e].shallow.indexOf(f)>=0?y:ho(y)}return c}throw new Error("can't deserialize object of type "+typeof i)}class ou{constructor(){this.first=!0}update(e,s){let c=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=c,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=c,!0):(this.lastFloorZoom>c?(this.lastIntegerZoom=c+1,this.lastIntegerZoomTime=s):this.lastFloorZoom<c&&(this.lastIntegerZoom=c,this.lastIntegerZoomTime=s),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=c,!0))}}let Je={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Da(i){for(let e of i)if(au(e.charCodeAt(0)))return!0;return!1}function gd(i){for(let e of i)if(!su(e.charCodeAt(0)))return!1;return!0}function su(i){return!(Je.Arabic(i)||Je["Arabic Supplement"](i)||Je["Arabic Extended-A"](i)||Je["Arabic Presentation Forms-A"](i)||Je["Arabic Presentation Forms-B"](i))}function au(i){return!(i!==746&&i!==747&&(i<4352||!(Je["Bopomofo Extended"](i)||Je.Bopomofo(i)||Je["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Je["CJK Compatibility Ideographs"](i)||Je["CJK Compatibility"](i)||Je["CJK Radicals Supplement"](i)||Je["CJK Strokes"](i)||!(!Je["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Je["CJK Unified Ideographs Extension A"](i)||Je["CJK Unified Ideographs"](i)||Je["Enclosed CJK Letters and Months"](i)||Je["Hangul Compatibility Jamo"](i)||Je["Hangul Jamo Extended-A"](i)||Je["Hangul Jamo Extended-B"](i)||Je["Hangul Jamo"](i)||Je["Hangul Syllables"](i)||Je.Hiragana(i)||Je["Ideographic Description Characters"](i)||Je.Kanbun(i)||Je["Kangxi Radicals"](i)||Je["Katakana Phonetic Extensions"](i)||Je.Katakana(i)&&i!==12540||!(!Je["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Je["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Je["Unified Canadian Aboriginal Syllabics"](i)||Je["Unified Canadian Aboriginal Syllabics Extended"](i)||Je["Vertical Forms"](i)||Je["Yijing Hexagram Symbols"](i)||Je["Yi Syllables"](i)||Je["Yi Radicals"](i))))}function ah(i){return!(au(i)||function(e){return!!(Je["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Je["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Je["Letterlike Symbols"](e)||Je["Number Forms"](e)||Je["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Je["Control Pictures"](e)&&e!==9251||Je["Optical Character Recognition"](e)||Je["Enclosed Alphanumerics"](e)||Je["Geometric Shapes"](e)||Je["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Je["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Je["CJK Symbols and Punctuation"](e)||Je.Katakana(e)||Je["Private Use Area"](e)||Je["CJK Compatibility Forms"](e)||Je["Small Form Variants"](e)||Je["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function lh(i){return i>=1424&&i<=2303||Je["Arabic Presentation Forms-A"](i)||Je["Arabic Presentation Forms-B"](i)}function _d(i,e){return!(!e&&lh(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Je.Khmer(i))}function uh(i){for(let e of i)if(lh(e.charCodeAt(0)))return!0;return!1}let lu="deferred",uu="loading",cu="loaded",hu=null,zi="unavailable",po=null,ch=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(zi="error"),hu&&hu(i)};function os(){pu.fire(new pn("pluginStateChange",{pluginStatus:zi,pluginURL:po}))}let pu=new dn,Xs=function(){return zi},hh=function(){if(zi!==lu||!po)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");zi=uu,os(),po&&Kr({url:po},i=>{i?ch(i):(zi=cu,os())})},Yi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>zi===cu||Yi.applyArabicShaping!=null,isLoading:()=>zi===uu,setState(i){if(!je())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");zi=i.pluginStatus,po=i.pluginURL},isParsed(){if(!je())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Yi.applyArabicShaping!=null&&Yi.processBidirectionalText!=null&&Yi.processStyledBidirectionalText!=null},getPluginURL(){if(!je())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return po}};class Ir{constructor(e,s){this.zoom=e,s?(this.now=s.now,this.fadeDuration=s.fadeDuration,this.zoomHistory=s.zoomHistory,this.transition=s.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ou,this.transition={})}isSupportedScript(e){return function(s,c){for(let f of s)if(!_d(f.charCodeAt(0),c))return!1;return!0}(e,Yi.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,s=e-Math.floor(e),c=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:s+(1-s)*c}:{fromScale:.5,toScale:1,t:1-(1-c)*s}}}class Hs{constructor(e,s){this.property=e,this.value=s,this.expression=function(c,f){if(xr(c))return new Ia(c,f);if(Rs(c)){let y=Xc(c,f);if(y.result==="error")throw new Error(y.value.map(_=>`${_.key}: ${_.message}`).join(", "));return y.value}{let y=c;return f.type==="color"&&typeof c=="string"?y=$.parse(c):f.type!=="padding"||typeof c!="number"&&!Array.isArray(c)||(y=Q.parse(c)),{kind:"constant",evaluate:()=>y}}}(s===void 0?e.specification.default:s,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,s,c){return this.property.possiblyEvaluate(this,e,s,c)}}class Fa{constructor(e){this.property=e,this.value=new Hs(e,void 0)}transitioned(e,s){return new dh(this.property,this.value,s,le({},e.transition,this.transition),e.now)}untransitioned(){return new dh(this.property,this.value,null,{},0)}}class ph{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return fe(this._values[e].value.value)}setValue(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fa(this._values[e].property)),this._values[e].value=new Hs(this._values[e].property,s===null?void 0:fe(s))}getTransition(e){return fe(this._values[e].transition)}setTransition(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fa(this._values[e].property)),this._values[e].transition=fe(s)||void 0}serialize(){let e={};for(let s of Object.keys(this._values)){let c=this.getValue(s);c!==void 0&&(e[s]=c);let f=this.getTransition(s);f!==void 0&&(e[`${s}-transition`]=f)}return e}transitioned(e,s){let c=new fh(this._properties);for(let f of Object.keys(this._values))c._values[f]=this._values[f].transitioned(e,s._values[f]);return c}untransitioned(){let e=new fh(this._properties);for(let s of Object.keys(this._values))e._values[s]=this._values[s].untransitioned();return e}}class dh{constructor(e,s,c,f,y){this.property=e,this.value=s,this.begin=y+f.delay||0,this.end=this.begin+f.duration||0,e.specification.transition&&(f.delay||f.duration)&&(this.prior=c)}possiblyEvaluate(e,s,c){let f=e.now||0,y=this.value.possiblyEvaluate(e,s,c),_=this.prior;if(_){if(f>this.end)return this.prior=null,y;if(this.value.isDataDriven())return this.prior=null,y;if(f<this.begin)return _.possiblyEvaluate(e,s,c);{let b=(f-this.begin)/(this.end-this.begin);return this.property.interpolate(_.possiblyEvaluate(e,s,c),y,function(w){if(w<=0)return 0;if(w>=1)return 1;let T=w*w,P=T*w;return 4*(w<.5?P:3*(w-T)+P-.75)}(b))}}return y}}class fh{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,s,c){let f=new Js(this._properties);for(let y of Object.keys(this._values))f._values[y]=this._values[y].possiblyEvaluate(e,s,c);return f}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class vd{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return fe(this._values[e].value)}setValue(e,s){this._values[e]=new Hs(this._values[e].property,s===null?void 0:fe(s))}serialize(){let e={};for(let s of Object.keys(this._values)){let c=this.getValue(s);c!==void 0&&(e[s]=c)}return e}possiblyEvaluate(e,s,c){let f=new Js(this._properties);for(let y of Object.keys(this._values))f._values[y]=this._values[y].possiblyEvaluate(e,s,c);return f}}class In{constructor(e,s,c){this.property=e,this.value=s,this.parameters=c}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,s,c,f){return this.property.evaluate(this.value,this.parameters,e,s,c,f)}}class Js{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class ft{constructor(e){this.specification=e}possiblyEvaluate(e,s){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(s)}interpolate(e,s,c){let f=zs[this.specification.type];return f?f(e,s,c):e}}class xt{constructor(e,s){this.specification=e,this.overrides=s}possiblyEvaluate(e,s,c,f){return new In(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(s,null,{},c,f)}:e.expression,s)}interpolate(e,s,c){if(e.value.kind!=="constant"||s.value.kind!=="constant")return e;if(e.value.value===void 0||s.value.value===void 0)return new In(this,{kind:"constant",value:void 0},e.parameters);let f=zs[this.specification.type];return f?new In(this,{kind:"constant",value:f(e.value.value,s.value.value,c)},e.parameters):e}evaluate(e,s,c,f,y,_){return e.kind==="constant"?e.value:e.evaluate(s,c,f,y,_)}}class ss extends xt{possiblyEvaluate(e,s,c,f){if(e.value===void 0)return new In(this,{kind:"constant",value:void 0},s);if(e.expression.kind==="constant"){let y=e.expression.evaluate(s,null,{},c,f),_=e.property.specification.type==="resolvedImage"&&typeof y!="string"?y.name:y,b=this._calculate(_,_,_,s);return new In(this,{kind:"constant",value:b},s)}if(e.expression.kind==="camera"){let y=this._calculate(e.expression.evaluate({zoom:s.zoom-1}),e.expression.evaluate({zoom:s.zoom}),e.expression.evaluate({zoom:s.zoom+1}),s);return new In(this,{kind:"constant",value:y},s)}return new In(this,e.expression,s)}evaluate(e,s,c,f,y,_){if(e.kind==="source"){let b=e.evaluate(s,c,f,y,_);return this._calculate(b,b,b,s)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(s.zoom)-1},c,f),e.evaluate({zoom:Math.floor(s.zoom)},c,f),e.evaluate({zoom:Math.floor(s.zoom)+1},c,f),s):e.value}_calculate(e,s,c,f){return f.zoom>f.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:c,to:s}}interpolate(e){return e}}class du{constructor(e){this.specification=e}possiblyEvaluate(e,s,c,f){if(e.value!==void 0){if(e.expression.kind==="constant"){let y=e.expression.evaluate(s,null,{},c,f);return this._calculate(y,y,y,s)}return this._calculate(e.expression.evaluate(new Ir(Math.floor(s.zoom-1),s)),e.expression.evaluate(new Ir(Math.floor(s.zoom),s)),e.expression.evaluate(new Ir(Math.floor(s.zoom+1),s)),s)}}_calculate(e,s,c,f){return f.zoom>f.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:c,to:s}}interpolate(e){return e}}class fo{constructor(e){this.specification=e}possiblyEvaluate(e,s,c,f){return!!e.expression.evaluate(s,null,{},c,f)}interpolate(){return!1}}class li{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let s in e){let c=e[s];c.specification.overridable&&this.overridableProperties.push(s);let f=this.defaultPropertyValues[s]=new Hs(c,void 0),y=this.defaultTransitionablePropertyValues[s]=new Fa(c);this.defaultTransitioningPropertyValues[s]=y.untransitioned(),this.defaultPossiblyEvaluatedValues[s]=f.possiblyEvaluate({})}}}at("DataDrivenProperty",xt),at("DataConstantProperty",ft),at("CrossFadedDataDrivenProperty",ss),at("CrossFadedProperty",du),at("ColorRampProperty",fo);let mo="-transition";class Pn extends dn{constructor(e,s){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),s.layout&&(this._unevaluatedLayout=new vd(s.layout)),s.paint)){this._transitionablePaint=new ph(s.paint);for(let c in e.paint)this.setPaintProperty(c,e.paint[c],{validate:!1});for(let c in e.layout)this.setLayoutProperty(c,e.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Js(s.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,s,c={}){s!=null&&this._validate(yd,`layers.${this.id}.layout.${e}`,e,s,c)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,s):this.visibility=s)}getPaintProperty(e){return e.endsWith(mo)?this._transitionablePaint.getTransition(e.slice(0,-mo.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,s,c={}){if(s!=null&&this._validate(md,`layers.${this.id}.paint.${e}`,e,s,c))return!1;if(e.endsWith(mo))return this._transitionablePaint.setTransition(e.slice(0,-mo.length),s||void 0),!1;{let f=this._transitionablePaint._values[e],y=f.property.specification["property-type"]==="cross-faded-data-driven",_=f.value.isDataDriven(),b=f.value;this._transitionablePaint.setValue(e,s),this._handleSpecialPaintPropertyUpdate(e);let w=this._transitionablePaint._values[e].value;return w.isDataDriven()||_||y||this._handleOverridablePaintPropertyUpdate(e,b,w)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,s,c){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,s){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,s)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,s)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),De(e,(s,c)=>!(s===void 0||c==="layout"&&!Object.keys(s).length||c==="paint"&&!Object.keys(s).length))}_validate(e,s,c,f,y={}){return(!y||y.validate!==!1)&&Oa(this,e.call(Ks,{key:s,layerType:this.type,objectKey:c,value:f,styleSpec:Se,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let s=this.paint.get(e);if(s instanceof In&&Sr(s.property.specification)&&(s.value.kind==="source"||s.value.kind==="composite")&&s.value.isStateDependent)return!0}return!1}}let mh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class yo{constructor(e,s){this._structArray=e,this._pos1=s*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class jr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,s){return e._trim(),s&&(e.isTransferred=!0,s.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let s=Object.create(this.prototype);return s.arrayBuffer=e.arrayBuffer,s.length=e.length,s.capacity=e.arrayBuffer.byteLength/s.bytesPerElement,s._refreshViews(),s}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let s=this.uint8;this._refreshViews(),s&&this.uint8.set(s)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function qr(i,e=1){let s=0,c=0;return{members:i.map(f=>{let y=mh[f.type].BYTES_PER_ELEMENT,_=s=fu(s,Math.max(e,y)),b=f.components||1;return c=Math.max(c,y),s+=y*b,{name:f.name,type:f.type,components:b,offset:_}}),size:fu(s,Math.max(c,e)),alignment:e}}function fu(i,e){return Math.ceil(i/e)*e}class zo extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s){let c=this.length;return this.resize(c+1),this.emplace(c,e,s)}emplace(e,s,c){let f=2*e;return this.int16[f+0]=s,this.int16[f+1]=c,e}}zo.prototype.bytesPerElement=4,at("StructArrayLayout2i4",zo);class d extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c,f){let y=this.length;return this.resize(y+1),this.emplace(y,e,s,c,f)}emplace(e,s,c,f,y){let _=4*e;return this.int16[_+0]=s,this.int16[_+1]=c,this.int16[_+2]=f,this.int16[_+3]=y,e}}d.prototype.bytesPerElement=8,at("StructArrayLayout4i8",d);class t extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y,_){let b=this.length;return this.resize(b+1),this.emplace(b,e,s,c,f,y,_)}emplace(e,s,c,f,y,_,b){let w=6*e;return this.int16[w+0]=s,this.int16[w+1]=c,this.int16[w+2]=f,this.int16[w+3]=y,this.int16[w+4]=_,this.int16[w+5]=b,e}}t.prototype.bytesPerElement=12,at("StructArrayLayout2i4i12",t);class l extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y,_){let b=this.length;return this.resize(b+1),this.emplace(b,e,s,c,f,y,_)}emplace(e,s,c,f,y,_,b){let w=4*e,T=8*e;return this.int16[w+0]=s,this.int16[w+1]=c,this.uint8[T+4]=f,this.uint8[T+5]=y,this.uint8[T+6]=_,this.uint8[T+7]=b,e}}l.prototype.bytesPerElement=8,at("StructArrayLayout2i4ub8",l);class h extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s){let c=this.length;return this.resize(c+1),this.emplace(c,e,s)}emplace(e,s,c){let f=2*e;return this.float32[f+0]=s,this.float32[f+1]=c,e}}h.prototype.bytesPerElement=8,at("StructArrayLayout2f8",h);class m extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y,_,b,w,T,P){let z=this.length;return this.resize(z+1),this.emplace(z,e,s,c,f,y,_,b,w,T,P)}emplace(e,s,c,f,y,_,b,w,T,P,z){let L=10*e;return this.uint16[L+0]=s,this.uint16[L+1]=c,this.uint16[L+2]=f,this.uint16[L+3]=y,this.uint16[L+4]=_,this.uint16[L+5]=b,this.uint16[L+6]=w,this.uint16[L+7]=T,this.uint16[L+8]=P,this.uint16[L+9]=z,e}}m.prototype.bytesPerElement=20,at("StructArrayLayout10ui20",m);class g extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y,_,b,w,T,P,z,L){let N=this.length;return this.resize(N+1),this.emplace(N,e,s,c,f,y,_,b,w,T,P,z,L)}emplace(e,s,c,f,y,_,b,w,T,P,z,L,N){let j=12*e;return this.int16[j+0]=s,this.int16[j+1]=c,this.int16[j+2]=f,this.int16[j+3]=y,this.uint16[j+4]=_,this.uint16[j+5]=b,this.uint16[j+6]=w,this.uint16[j+7]=T,this.int16[j+8]=P,this.int16[j+9]=z,this.int16[j+10]=L,this.int16[j+11]=N,e}}g.prototype.bytesPerElement=24,at("StructArrayLayout4i4ui4i24",g);class v extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,c){let f=this.length;return this.resize(f+1),this.emplace(f,e,s,c)}emplace(e,s,c,f){let y=3*e;return this.float32[y+0]=s,this.float32[y+1]=c,this.float32[y+2]=f,e}}v.prototype.bytesPerElement=12,at("StructArrayLayout3f12",v);class E extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint32[1*e+0]=s,e}}E.prototype.bytesPerElement=4,at("StructArrayLayout1ul4",E);class S extends jr{_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(e,s,c,f,y,_,b,w,T){let P=this.length;return this.resize(P+1),this.emplace(P,e,s,c,f,y,_,b,w,T)}emplace(e,s,c,f,y,_,b,w,T,P){let z=10*e,L=5*e;return this.int16[z+0]=s,this.int16[z+1]=c,this.int16[z+2]=f,this.int16[z+3]=y,this.int16[z+4]=_,this.int16[z+5]=b,this.uint32[L+3]=w,this.uint16[z+8]=T,this.uint16[z+9]=P,e}}S.prototype.bytesPerElement=20,at("StructArrayLayout6i1ul2ui20",S);class A extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y,_){let b=this.length;return this.resize(b+1),this.emplace(b,e,s,c,f,y,_)}emplace(e,s,c,f,y,_,b){let w=6*e;return this.int16[w+0]=s,this.int16[w+1]=c,this.int16[w+2]=f,this.int16[w+3]=y,this.int16[w+4]=_,this.int16[w+5]=b,e}}A.prototype.bytesPerElement=12,at("StructArrayLayout2i2i2i12",A);class M extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c,f,y){let _=this.length;return this.resize(_+1),this.emplace(_,e,s,c,f,y)}emplace(e,s,c,f,y,_){let b=4*e,w=8*e;return this.float32[b+0]=s,this.float32[b+1]=c,this.float32[b+2]=f,this.int16[w+6]=y,this.int16[w+7]=_,e}}M.prototype.bytesPerElement=16,at("StructArrayLayout2f1f2i16",M);class F extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,c,f){let y=this.length;return this.resize(y+1),this.emplace(y,e,s,c,f)}emplace(e,s,c,f,y){let _=12*e,b=3*e;return this.uint8[_+0]=s,this.uint8[_+1]=c,this.float32[b+1]=f,this.float32[b+2]=y,e}}F.prototype.bytesPerElement=12,at("StructArrayLayout2ub2f12",F);class B extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,c){let f=this.length;return this.resize(f+1),this.emplace(f,e,s,c)}emplace(e,s,c,f){let y=3*e;return this.uint16[y+0]=s,this.uint16[y+1]=c,this.uint16[y+2]=f,e}}B.prototype.bytesPerElement=6,at("StructArrayLayout3ui6",B);class K extends jr{_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(e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae){let me=this.length;return this.resize(me+1),this.emplace(me,e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae)}emplace(e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae,me){let se=24*e,pe=12*e,Ae=48*e;return this.int16[se+0]=s,this.int16[se+1]=c,this.uint16[se+2]=f,this.uint16[se+3]=y,this.uint32[pe+2]=_,this.uint32[pe+3]=b,this.uint32[pe+4]=w,this.uint16[se+10]=T,this.uint16[se+11]=P,this.uint16[se+12]=z,this.float32[pe+7]=L,this.float32[pe+8]=N,this.uint8[Ae+36]=j,this.uint8[Ae+37]=J,this.uint8[Ae+38]=X,this.uint32[pe+10]=ae,this.int16[se+22]=me,e}}K.prototype.bytesPerElement=48,at("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",K);class G extends jr{_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(e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae,me,se,pe,Ae,Ce,ot,ht,Ye,Ke,Ve,Qe){let Xe=this.length;return this.resize(Xe+1),this.emplace(Xe,e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae,me,se,pe,Ae,Ce,ot,ht,Ye,Ke,Ve,Qe)}emplace(e,s,c,f,y,_,b,w,T,P,z,L,N,j,J,X,ae,me,se,pe,Ae,Ce,ot,ht,Ye,Ke,Ve,Qe,Xe){let Re=34*e,_t=17*e;return this.int16[Re+0]=s,this.int16[Re+1]=c,this.int16[Re+2]=f,this.int16[Re+3]=y,this.int16[Re+4]=_,this.int16[Re+5]=b,this.int16[Re+6]=w,this.int16[Re+7]=T,this.uint16[Re+8]=P,this.uint16[Re+9]=z,this.uint16[Re+10]=L,this.uint16[Re+11]=N,this.uint16[Re+12]=j,this.uint16[Re+13]=J,this.uint16[Re+14]=X,this.uint16[Re+15]=ae,this.uint16[Re+16]=me,this.uint16[Re+17]=se,this.uint16[Re+18]=pe,this.uint16[Re+19]=Ae,this.uint16[Re+20]=Ce,this.uint16[Re+21]=ot,this.uint16[Re+22]=ht,this.uint32[_t+12]=Ye,this.float32[_t+13]=Ke,this.float32[_t+14]=Ve,this.float32[_t+15]=Qe,this.float32[_t+16]=Xe,e}}G.prototype.bytesPerElement=68,at("StructArrayLayout8i15ui1ul4f68",G);class Z extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.float32[1*e+0]=s,e}}Z.prototype.bytesPerElement=4,at("StructArrayLayout1f4",Z);class re extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,c){let f=this.length;return this.resize(f+1),this.emplace(f,e,s,c)}emplace(e,s,c,f){let y=3*e;return this.int16[y+0]=s,this.int16[y+1]=c,this.int16[y+2]=f,e}}re.prototype.bytesPerElement=6,at("StructArrayLayout3i6",re);class oe extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,c){let f=this.length;return this.resize(f+1),this.emplace(f,e,s,c)}emplace(e,s,c,f){let y=4*e;return this.uint32[2*e+0]=s,this.uint16[y+2]=c,this.uint16[y+3]=f,e}}oe.prototype.bytesPerElement=8,at("StructArrayLayout1ul2ui8",oe);class ue extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s){let c=this.length;return this.resize(c+1),this.emplace(c,e,s)}emplace(e,s,c){let f=2*e;return this.uint16[f+0]=s,this.uint16[f+1]=c,e}}ue.prototype.bytesPerElement=4,at("StructArrayLayout2ui4",ue);class W extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint16[1*e+0]=s,e}}W.prototype.bytesPerElement=2,at("StructArrayLayout1ui2",W);class de extends jr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,c,f){let y=this.length;return this.resize(y+1),this.emplace(y,e,s,c,f)}emplace(e,s,c,f,y){let _=4*e;return this.float32[_+0]=s,this.float32[_+1]=c,this.float32[_+2]=f,this.float32[_+3]=y,e}}de.prototype.bytesPerElement=16,at("StructArrayLayout4f16",de);class ce extends yo{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 st(this.anchorPointX,this.anchorPointY)}}ce.prototype.size=20;class Ee extends S{get(e){return new ce(this,e)}}at("CollisionBoxArray",Ee);class Te extends yo{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Te.prototype.size=48;class ze extends K{get(e){return new Te(this,e)}}at("PlacedSymbolArray",ze);class xe extends yo{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(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}xe.prototype.size=68;class rt extends G{get(e){return new xe(this,e)}}at("SymbolInstanceArray",rt);class Ze extends Z{getoffsetX(e){return this.float32[1*e+0]}}at("GlyphOffsetArray",Ze);class nt extends re{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}at("SymbolLineVertexArray",nt);class Mt extends yo{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]}}Mt.prototype.size=8;class Rt extends oe{get(e){return new Mt(this,e)}}at("FeatureIndexArray",Rt);class gt extends zo{}class ur extends zo{}class cr extends zo{}class Kt extends t{}class Yt extends l{}class pr extends h{}class ei extends m{}class Mn extends g{}class yn extends v{}class zn extends E{}class go extends A{}class Qi extends F{}class Oi extends B{}class Kn extends ue{}let Ra=qr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Wr}=Ra;class jt{constructor(e=[]){this.segments=e}prepareSegment(e,s,c,f){let y=this.segments[this.segments.length-1];return e>jt.MAX_VERTEX_ARRAY_LENGTH&&Ie(`Max vertices per segment is ${jt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!y||y.vertexLength+e>jt.MAX_VERTEX_ARRAY_LENGTH||y.sortKey!==f)&&(y={vertexOffset:s.length,primitiveOffset:c.length,vertexLength:0,primitiveLength:0},f!==void 0&&(y.sortKey=f),this.segments.push(y)),y}get(){return this.segments}destroy(){for(let e of this.segments)for(let s in e.vaos)e.vaos[s].destroy()}static simpleSegment(e,s,c,f){return new jt([{vertexOffset:e,primitiveOffset:s,vertexLength:c,primitiveLength:f,vaos:{},sortKey:0}])}}function sr(i,e){return 256*(i=I(Math.floor(i),0,255))+I(Math.floor(e),0,255)}jt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,at("SegmentVector",jt);let ti=qr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ri={exports:{}},Pr={exports:{}};Pr.exports=function(i,e){var s,c,f,y,_,b,w,T;for(c=i.length-(s=3&i.length),f=e,_=3432918353,b=461845907,T=0;T<c;)w=255&i.charCodeAt(T)|(255&i.charCodeAt(++T))<<8|(255&i.charCodeAt(++T))<<16|(255&i.charCodeAt(++T))<<24,++T,f=27492+(65535&(y=5*(65535&(f=(f^=w=(65535&(w=(w=(65535&w)*_+(((w>>>16)*_&65535)<<16)&4294967295)<<15|w>>>17))*b+(((w>>>16)*b&65535)<<16)&4294967295)<<13|f>>>19))+((5*(f>>>16)&65535)<<16)&4294967295))+((58964+(y>>>16)&65535)<<16);switch(w=0,s){case 3:w^=(255&i.charCodeAt(T+2))<<16;case 2:w^=(255&i.charCodeAt(T+1))<<8;case 1:f^=w=(65535&(w=(w=(65535&(w^=255&i.charCodeAt(T)))*_+(((w>>>16)*_&65535)<<16)&4294967295)<<15|w>>>17))*b+(((w>>>16)*b&65535)<<16)&4294967295}return f^=i.length,f=2246822507*(65535&(f^=f>>>16))+((2246822507*(f>>>16)&65535)<<16)&4294967295,f=3266489909*(65535&(f^=f>>>13))+((3266489909*(f>>>16)&65535)<<16)&4294967295,(f^=f>>>16)>>>0};var en={exports:{}};en.exports=function(i,e){for(var s,c=i.length,f=e^c,y=0;c>=4;)s=1540483477*(65535&(s=255&i.charCodeAt(y)|(255&i.charCodeAt(++y))<<8|(255&i.charCodeAt(++y))<<16|(255&i.charCodeAt(++y))<<24))+((1540483477*(s>>>16)&65535)<<16),f=1540483477*(65535&f)+((1540483477*(f>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),c-=4,++y;switch(c){case 3:f^=(255&i.charCodeAt(y+2))<<16;case 2:f^=(255&i.charCodeAt(y+1))<<8;case 1:f=1540483477*(65535&(f^=255&i.charCodeAt(y)))+((1540483477*(f>>>16)&65535)<<16)}return f=1540483477*(65535&(f^=f>>>13))+((1540483477*(f>>>16)&65535)<<16),(f^=f>>>15)>>>0};var Oo=Pr.exports,mu=en.exports;ri.exports=Oo,ri.exports.murmur3=Oo,ri.exports.murmur2=mu;class as{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,s,c,f){this.ids.push(yh(e)),this.positions.push(s,c,f)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let s=yh(e),c=0,f=this.ids.length-1;for(;c<f;){let _=c+f>>1;this.ids[_]>=s?f=_:c=_+1}let y=[];for(;this.ids[c]===s;)y.push({index:this.positions[3*c],start:this.positions[3*c+1],end:this.positions[3*c+2]}),c++;return y}static serialize(e,s){let c=new Float64Array(e.ids),f=new Uint32Array(e.positions);return yu(c,f,0,c.length-1),s&&s.push(c.buffer,f.buffer),{ids:c,positions:f}}static deserialize(e){let s=new as;return s.ids=e.ids,s.positions=e.positions,s.indexed=!0,s}}function yh(i){let e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ri.exports(String(i))}function yu(i,e,s,c){for(;s<c;){let f=i[s+c>>1],y=s-1,_=c+1;for(;;){do y++;while(i[y]<f);do _--;while(i[_]>f);if(y>=_)break;_o(i,y,_),_o(e,3*y,3*_),_o(e,3*y+1,3*_+1),_o(e,3*y+2,3*_+2)}_-s<c-_?(yu(i,e,s,_),s=_+1):(yu(i,e,_+1,c),c=_)}}function _o(i,e,s){let c=i[e];i[e]=i[s],i[s]=c}at("FeaturePositionMap",as);class Do{constructor(e,s){this.gl=e.gl,this.location=s}}class Fo extends Do{constructor(e,s){super(e,s),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class La extends Do{constructor(e,s){super(e,s),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class $m extends Do{constructor(e,s){super(e,s),this.current=$.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let qb=new Float32Array(16);function bd(i){return[sr(255*i.r,255*i.g),sr(255*i.b,255*i.a)]}class gu{constructor(e,s,c){this.value=e,this.uniformNames=s.map(f=>`u_${f}`),this.type=c}setUniform(e,s,c){e.set(c.constantOr(this.value))}getBinding(e,s,c){return this.type==="color"?new $m(e,s):new Fo(e,s)}}class Ba{constructor(e,s){this.uniformNames=s.map(c=>`u_${c}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,s){this.pixelRatioFrom=s.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=s.tlbr,this.patternTo=e.tlbr}setUniform(e,s,c,f){let y=f==="u_pattern_to"?this.patternTo:f==="u_pattern_from"?this.patternFrom:f==="u_pixel_ratio_to"?this.pixelRatioTo:f==="u_pixel_ratio_from"?this.pixelRatioFrom:null;y&&e.set(y)}getBinding(e,s,c){return c.substr(0,9)==="u_pattern"?new La(e,s):new Fo(e,s)}}class Ro{constructor(e,s,c,f){this.expression=e,this.type=c,this.maxValue=0,this.paintVertexAttributes=s.map(y=>({name:`a_${y}`,type:"Float32",components:c==="color"?2:1,offset:0})),this.paintVertexArray=new f}populatePaintArray(e,s,c,f,y){let _=this.paintVertexArray.length,b=this.expression.evaluate(new Ir(0),s,{},f,[],y);this.paintVertexArray.resize(e),this._setPaintValue(_,e,b)}updatePaintArray(e,s,c,f){let y=this.expression.evaluate({zoom:0},c,f);this._setPaintValue(e,s,y)}_setPaintValue(e,s,c){if(this.type==="color"){let f=bd(c);for(let y=e;y<s;y++)this.paintVertexArray.emplace(y,f[0],f[1])}else{for(let f=e;f<s;f++)this.paintVertexArray.emplace(f,c);this.maxValue=Math.max(this.maxValue,Math.abs(c))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Wn{constructor(e,s,c,f,y,_){this.expression=e,this.uniformNames=s.map(b=>`u_${b}_t`),this.type=c,this.useIntegerZoom=f,this.zoom=y,this.maxValue=0,this.paintVertexAttributes=s.map(b=>({name:`a_${b}`,type:"Float32",components:c==="color"?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(e,s,c,f,y){let _=this.expression.evaluate(new Ir(this.zoom),s,{},f,[],y),b=this.expression.evaluate(new Ir(this.zoom+1),s,{},f,[],y),w=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(w,e,_,b)}updatePaintArray(e,s,c,f){let y=this.expression.evaluate({zoom:this.zoom},c,f),_=this.expression.evaluate({zoom:this.zoom+1},c,f);this._setPaintValue(e,s,y,_)}_setPaintValue(e,s,c,f){if(this.type==="color"){let y=bd(c),_=bd(f);for(let b=e;b<s;b++)this.paintVertexArray.emplace(b,y[0],y[1],_[0],_[1])}else{for(let y=e;y<s;y++)this.paintVertexArray.emplace(y,c,f);this.maxValue=Math.max(this.maxValue,Math.abs(c),Math.abs(f))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,s){let c=this.useIntegerZoom?Math.floor(s.zoom):s.zoom,f=I(this.expression.interpolationFactor(c,this.zoom,this.zoom+1),0,1);e.set(f)}getBinding(e,s,c){return new Fo(e,s)}}class ls{constructor(e,s,c,f,y,_){this.expression=e,this.type=s,this.useIntegerZoom=c,this.zoom=f,this.layerId=_,this.zoomInPaintVertexArray=new y,this.zoomOutPaintVertexArray=new y}populatePaintArray(e,s,c){let f=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(f,e,s.patterns&&s.patterns[this.layerId],c)}updatePaintArray(e,s,c,f,y){this._setPaintValues(e,s,c.patterns&&c.patterns[this.layerId],y)}_setPaintValues(e,s,c,f){if(!f||!c)return;let{min:y,mid:_,max:b}=c,w=f[y],T=f[_],P=f[b];if(w&&T&&P)for(let z=e;z<s;z++)this.zoomInPaintVertexArray.emplace(z,T.tl[0],T.tl[1],T.br[0],T.br[1],w.tl[0],w.tl[1],w.br[0],w.br[1],T.pixelRatio,w.pixelRatio),this.zoomOutPaintVertexArray.emplace(z,T.tl[0],T.tl[1],T.br[0],T.br[1],P.tl[0],P.tl[1],P.br[0],P.br[1],T.pixelRatio,P.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,ti.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ti.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class qm{constructor(e,s,c){this.binders={},this._buffers=[];let f=[];for(let y in e.paint._values){if(!c(y))continue;let _=e.paint.get(y);if(!(_ instanceof In&&Sr(_.property.specification)))continue;let b=Gb(y,e.type),w=_.value,T=_.property.specification.type,P=_.property.useIntegerZoom,z=_.property.specification["property-type"],L=z==="cross-faded"||z==="cross-faded-data-driven";if(w.kind==="constant")this.binders[y]=L?new Ba(w.value,b):new gu(w.value,b,T),f.push(`/u_${y}`);else if(w.kind==="source"||L){let N=Gm(y,T,"source");this.binders[y]=L?new ls(w,T,P,s,N,e.id):new Ro(w,b,T,N),f.push(`/a_${y}`)}else{let N=Gm(y,T,"composite");this.binders[y]=new Wn(w,b,T,P,s,N),f.push(`/z_${y}`)}}this.cacheKey=f.sort().join("")}getMaxValue(e){let s=this.binders[e];return s instanceof Ro||s instanceof Wn?s.maxValue:0}populatePaintArrays(e,s,c,f,y){for(let _ in this.binders){let b=this.binders[_];(b instanceof Ro||b instanceof Wn||b instanceof ls)&&b.populatePaintArray(e,s,c,f,y)}}setConstantPatternPositions(e,s){for(let c in this.binders){let f=this.binders[c];f instanceof Ba&&f.setConstantPatternPositions(e,s)}}updatePaintArrays(e,s,c,f,y){let _=!1;for(let b in e){let w=s.getPositions(b);for(let T of w){let P=c.feature(T.index);for(let z in this.binders){let L=this.binders[z];if((L instanceof Ro||L instanceof Wn||L instanceof ls)&&L.expression.isStateDependent===!0){let N=f.paint.get(z);L.expression=N.value,L.updatePaintArray(T.start,T.end,P,e[b],y),_=!0}}}}return _}defines(){let e=[];for(let s in this.binders){let c=this.binders[s];(c instanceof gu||c instanceof Ba)&&e.push(...c.uniformNames.map(f=>`#define HAS_UNIFORM_${f}`))}return e}getBinderAttributes(){let e=[];for(let s in this.binders){let c=this.binders[s];if(c instanceof Ro||c instanceof Wn)for(let f=0;f<c.paintVertexAttributes.length;f++)e.push(c.paintVertexAttributes[f].name);else if(c instanceof ls)for(let f=0;f<ti.members.length;f++)e.push(ti.members[f].name)}return e}getBinderUniforms(){let e=[];for(let s in this.binders){let c=this.binders[s];if(c instanceof gu||c instanceof Ba||c instanceof Wn)for(let f of c.uniformNames)e.push(f)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,s){let c=[];for(let f in this.binders){let y=this.binders[f];if(y instanceof gu||y instanceof Ba||y instanceof Wn){for(let _ of y.uniformNames)if(s[_]){let b=y.getBinding(e,s[_],_);c.push({name:_,property:f,binding:b})}}}return c}setUniforms(e,s,c,f){for(let{name:y,property:_,binding:b}of s)this.binders[_].setUniform(b,f,c.get(_),y)}updatePaintBuffers(e){this._buffers=[];for(let s in this.binders){let c=this.binders[s];if(e&&c instanceof ls){let f=e.fromScale===2?c.zoomInPaintVertexBuffer:c.zoomOutPaintVertexBuffer;f&&this._buffers.push(f)}else(c instanceof Ro||c instanceof Wn)&&c.paintVertexBuffer&&this._buffers.push(c.paintVertexBuffer)}}upload(e){for(let s in this.binders){let c=this.binders[s];(c instanceof Ro||c instanceof Wn||c instanceof ls)&&c.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let s=this.binders[e];(s instanceof Ro||s instanceof Wn||s instanceof ls)&&s.destroy()}}}class Ys{constructor(e,s,c=()=>!0){this.programConfigurations={};for(let f of e)this.programConfigurations[f.id]=new qm(f,s,c);this.needsUpload=!1,this._featureMap=new as,this._bufferOffset=0}populatePaintArrays(e,s,c,f,y,_){for(let b in this.programConfigurations)this.programConfigurations[b].populatePaintArrays(e,s,f,y,_);s.id!==void 0&&this._featureMap.add(s.id,c,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,s,c,f){for(let y of c)this.needsUpload=this.programConfigurations[y.id].updatePaintArrays(e,this._featureMap,s,y,f)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let s in this.programConfigurations)this.programConfigurations[s].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Gb(i,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-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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Gm(i,e,s){let c={color:{source:h,composite:de},number:{source:Z,composite:h}},f=function(y){return{"line-pattern":{source:ei,composite:ei},"fill-pattern":{source:ei,composite:ei},"fill-extrusion-pattern":{source:ei,composite:ei}}[y]}(i);return f&&f[s]||c[e][s]}at("ConstantBinder",gu),at("CrossFadedConstantBinder",Ba),at("SourceExpressionBinder",Ro),at("CrossFadedCompositeBinder",ls),at("CompositeExpressionBinder",Wn),at("ProgramConfiguration",qm,{omit:["_buffers"]}),at("ProgramConfigurationSet",Ys);var Xr=8192;let xd=Math.pow(2,14)-1,Zm=-xd-1;function Qs(i){let e=Xr/i.extent,s=i.loadGeometry();for(let c=0;c<s.length;c++){let f=s[c];for(let y=0;y<f.length;y++){let _=f[y],b=Math.round(_.x*e),w=Math.round(_.y*e);_.x=I(b,Zm,xd),_.y=I(w,Zm,xd),(b<_.x||b>_.x+1||w<_.y||w>_.y+1)&&Ie("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return s}function ea(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Qs(i):[]}}function gh(i,e,s,c,f){i.emplaceBack(2*e+(c+1)/2,2*s+(f+1)/2)}class wd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ur,this.indexArray=new Oi,this.segments=new jt,this.programConfigurations=new Ys(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,c){let f=this.layers[0],y=[],_=null,b=!1;f.type==="circle"&&(_=f.layout.get("circle-sort-key"),b=!_.isConstant());for(let{feature:w,id:T,index:P,sourceLayerIndex:z}of e){let L=this.layers[0]._featureFilter.needGeometry,N=ea(w,L);if(!this.layers[0]._featureFilter.filter(new Ir(this.zoom),N,c))continue;let j=b?_.evaluate(N,{},c):void 0,J={id:T,properties:w.properties,type:w.type,sourceLayerIndex:z,index:P,geometry:L?N.geometry:Qs(w),patterns:{},sortKey:j};y.push(J)}b&&y.sort((w,T)=>w.sortKey-T.sortKey);for(let w of y){let{geometry:T,index:P,sourceLayerIndex:z}=w,L=e[P].feature;this.addFeature(w,T,P,c),s.featureIndex.insert(L,T,P,z,this.index)}}update(e,s,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,c)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Wr),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,s,c,f){for(let y of s)for(let _ of y){let b=_.x,w=_.y;if(b<0||b>=Xr||w<0||w>=Xr)continue;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),P=T.vertexLength;gh(this.layoutVertexArray,b,w,-1,-1),gh(this.layoutVertexArray,b,w,1,-1),gh(this.layoutVertexArray,b,w,1,1),gh(this.layoutVertexArray,b,w,-1,1),this.indexArray.emplaceBack(P,P+1,P+2),this.indexArray.emplaceBack(P,P+3,P+2),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,{},f)}}function Km(i,e){for(let s=0;s<i.length;s++)if(Na(e,i[s]))return!0;for(let s=0;s<e.length;s++)if(Na(i,e[s]))return!0;return!!Ed(i,e)}function Zb(i,e,s){return!!Na(i,e)||!!Sd(e,i,s)}function Wm(i,e){if(i.length===1)return Hm(e,i[0]);for(let s=0;s<e.length;s++){let c=e[s];for(let f=0;f<c.length;f++)if(Na(i,c[f]))return!0}for(let s=0;s<i.length;s++)if(Hm(e,i[s]))return!0;for(let s=0;s<e.length;s++)if(Ed(i,e[s]))return!0;return!1}function Kb(i,e,s){if(i.length>1){if(Ed(i,e))return!0;for(let c=0;c<e.length;c++)if(Sd(e[c],i,s))return!0}for(let c=0;c<i.length;c++)if(Sd(i[c],e,s))return!0;return!1}function Ed(i,e){if(i.length===0||e.length===0)return!1;for(let s=0;s<i.length-1;s++){let c=i[s],f=i[s+1];for(let y=0;y<e.length-1;y++)if(Wb(c,f,e[y],e[y+1]))return!0}return!1}function Wb(i,e,s,c){return We(i,s,c)!==We(e,s,c)&&We(i,e,s)!==We(i,e,c)}function Sd(i,e,s){let c=s*s;if(e.length===1)return i.distSqr(e[0])<c;for(let f=1;f<e.length;f++)if(Xm(i,e[f-1],e[f])<c)return!0;return!1}function Xm(i,e,s){let c=e.distSqr(s);if(c===0)return i.distSqr(e);let f=((i.x-e.x)*(s.x-e.x)+(i.y-e.y)*(s.y-e.y))/c;return i.distSqr(f<0?e:f>1?s:s.sub(e)._mult(f)._add(e))}function Hm(i,e){let s,c,f,y=!1;for(let _=0;_<i.length;_++){s=i[_];for(let b=0,w=s.length-1;b<s.length;w=b++)c=s[b],f=s[w],c.y>e.y!=f.y>e.y&&e.x<(f.x-c.x)*(e.y-c.y)/(f.y-c.y)+c.x&&(y=!y)}return y}function Na(i,e){let s=!1;for(let c=0,f=i.length-1;c<i.length;f=c++){let y=i[c],_=i[f];y.y>e.y!=_.y>e.y&&e.x<(_.x-y.x)*(e.y-y.y)/(_.y-y.y)+y.x&&(s=!s)}return s}function Xb(i,e,s){let c=s[0],f=s[2];if(i.x<c.x&&e.x<c.x||i.x>f.x&&e.x>f.x||i.y<c.y&&e.y<c.y||i.y>f.y&&e.y>f.y)return!1;let y=We(i,e,s[0]);return y!==We(i,e,s[1])||y!==We(i,e,s[2])||y!==We(i,e,s[3])}function _u(i,e,s){let c=e.paint.get(i).value;return c.kind==="constant"?c.value:s.programConfigurations.get(e.id).getMaxValue(i)}function _h(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function vh(i,e,s,c,f){if(!e[0]&&!e[1])return i;let y=st.convert(e)._mult(f);s==="viewport"&&y._rotate(-c);let _=[];for(let b=0;b<i.length;b++)_.push(i[b].sub(y));return _}at("CircleBucket",wd,{omit:["layers"]});let Hb=new li({"circle-sort-key":new xt(Se.layout_circle["circle-sort-key"])});var Jb={paint:new li({"circle-radius":new xt(Se.paint_circle["circle-radius"]),"circle-color":new xt(Se.paint_circle["circle-color"]),"circle-blur":new xt(Se.paint_circle["circle-blur"]),"circle-opacity":new xt(Se.paint_circle["circle-opacity"]),"circle-translate":new ft(Se.paint_circle["circle-translate"]),"circle-translate-anchor":new ft(Se.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ft(Se.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ft(Se.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new xt(Se.paint_circle["circle-stroke-width"]),"circle-stroke-color":new xt(Se.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new xt(Se.paint_circle["circle-stroke-opacity"])}),layout:Hb},Di=1e-6,Fi=typeof Float32Array<"u"?Float32Array:Array;function Jm(){var i=new Fi(9);return Fi!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function Td(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Ym(i,e,s){var c=e[0],f=e[1],y=e[2],_=e[3],b=e[4],w=e[5],T=e[6],P=e[7],z=e[8],L=e[9],N=e[10],j=e[11],J=e[12],X=e[13],ae=e[14],me=e[15],se=s[0],pe=s[1],Ae=s[2],Ce=s[3];return i[0]=se*c+pe*b+Ae*z+Ce*J,i[1]=se*f+pe*w+Ae*L+Ce*X,i[2]=se*y+pe*T+Ae*N+Ce*ae,i[3]=se*_+pe*P+Ae*j+Ce*me,i[4]=(se=s[4])*c+(pe=s[5])*b+(Ae=s[6])*z+(Ce=s[7])*J,i[5]=se*f+pe*w+Ae*L+Ce*X,i[6]=se*y+pe*T+Ae*N+Ce*ae,i[7]=se*_+pe*P+Ae*j+Ce*me,i[8]=(se=s[8])*c+(pe=s[9])*b+(Ae=s[10])*z+(Ce=s[11])*J,i[9]=se*f+pe*w+Ae*L+Ce*X,i[10]=se*y+pe*T+Ae*N+Ce*ae,i[11]=se*_+pe*P+Ae*j+Ce*me,i[12]=(se=s[12])*c+(pe=s[13])*b+(Ae=s[14])*z+(Ce=s[15])*J,i[13]=se*f+pe*w+Ae*L+Ce*X,i[14]=se*y+pe*T+Ae*N+Ce*ae,i[15]=se*_+pe*P+Ae*j+Ce*me,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var vu,Yb=Ym;function Qm(){var i=new Fi(3);return Fi!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function ey(i,e,s){var c=new Fi(3);return c[0]=i,c[1]=e,c[2]=s,c}function bh(i,e,s){var c=e[0],f=e[1],y=e[2],_=e[3];return i[0]=s[0]*c+s[4]*f+s[8]*y+s[12]*_,i[1]=s[1]*c+s[5]*f+s[9]*y+s[13]*_,i[2]=s[2]*c+s[6]*f+s[10]*y+s[14]*_,i[3]=s[3]*c+s[7]*f+s[11]*y+s[15]*_,i}function ty(){var i=new Fi(4);return Fi!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function ry(i,e){let s=bh([],[i.x,i.y,0,1],e);return new st(s[0]/s[3],s[1]/s[3])}Qm(),vu=new Fi(4),Fi!=Float32Array&&(vu[0]=0,vu[1]=0,vu[2]=0,vu[3]=0),Qm(),ey(1,0,0),ey(0,1,0),ty(),ty(),Jm(),function(){var i;i=new Fi(2),Fi!=Float32Array&&(i[0]=0,i[1]=0)}();class iy extends wd{}at("HeatmapBucket",iy,{omit:["layers"]});var Qb={paint:new li({"heatmap-radius":new xt(Se.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xt(Se.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ft(Se.paint_heatmap["heatmap-intensity"]),"heatmap-color":new fo(Se.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ft(Se.paint_heatmap["heatmap-opacity"])})};function Cd(i,{width:e,height:s},c,f){if(f){if(f instanceof Uint8ClampedArray)f=new Uint8Array(f.buffer);else if(f.length!==e*s*c)throw new RangeError(`mismatched image size. expected: ${f.length} but got: ${e*s*c}`)}else f=new Uint8Array(e*s*c);return i.width=e,i.height=s,i.data=f,i}function ny(i,{width:e,height:s},c){if(e===i.width&&s===i.height)return;let f=Cd({},{width:e,height:s},c);Ad(i,f,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,s)},c),i.width=e,i.height=s,i.data=f.data}function Ad(i,e,s,c,f,y){if(f.width===0||f.height===0)return e;if(f.width>i.width||f.height>i.height||s.x>i.width-f.width||s.y>i.height-f.height)throw new RangeError("out of range source coordinates for image copy");if(f.width>e.width||f.height>e.height||c.x>e.width-f.width||c.y>e.height-f.height)throw new RangeError("out of range destination coordinates for image copy");let _=i.data,b=e.data;if(_===b)throw new Error("srcData equals dstData, so image is already copied");for(let w=0;w<f.height;w++){let T=((s.y+w)*i.width+s.x)*y,P=((c.y+w)*e.width+c.x)*y;for(let z=0;z<f.width*y;z++)b[P+z]=_[T+z]}return e}class bu{constructor(e,s){Cd(this,e,1,s)}resize(e){ny(this,e,1)}clone(){return new bu({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,s,c,f,y){Ad(e,s,c,f,y,1)}}class gn{constructor(e,s){Cd(this,e,4,s)}resize(e){ny(this,e,4)}replace(e,s){s?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new gn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,s,c,f,y){Ad(e,s,c,f,y,4)}}function oy(i){let e={},s=i.resolution||256,c=i.clips?i.clips.length:1,f=i.image||new gn({width:s,height:c});if(Math.log(s)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${s}`);let y=(_,b,w)=>{e[i.evaluationKey]=w;let T=i.expression.evaluate(e);f.data[_+b+0]=Math.floor(255*T.r/T.a),f.data[_+b+1]=Math.floor(255*T.g/T.a),f.data[_+b+2]=Math.floor(255*T.b/T.a),f.data[_+b+3]=Math.floor(255*T.a)};if(i.clips)for(let _=0,b=0;_<c;++_,b+=4*s)for(let w=0,T=0;w<s;w++,T+=4){let P=w/(s-1),{start:z,end:L}=i.clips[_];y(b,T,z*(1-P)+L*P)}else for(let _=0,b=0;_<s;_++,b+=4)y(0,b,_/(s-1));return f}at("AlphaImage",bu),at("RGBAImage",gn);var ex={paint:new li({"hillshade-illumination-direction":new ft(Se.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ft(Se.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ft(Se.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ft(Se.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ft(Se.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ft(Se.paint_hillshade["hillshade-accent-color"])})};let tx=qr([{name:"a_pos",components:2,type:"Int16"}],4),{members:rx}=tx;var xh={exports:{}};function wh(i,e,s){s=s||2;var c,f,y,_,b,w,T,P=e&&e.length,z=P?e[0]*s:i.length,L=sy(i,0,z,s,!0),N=[];if(!L||L.next===L.prev)return N;if(P&&(L=function(J,X,ae,me){var se,pe,Ae,Ce=[];for(se=0,pe=X.length;se<pe;se++)(Ae=sy(J,X[se]*me,se<pe-1?X[se+1]*me:J.length,me,!1))===Ae.next&&(Ae.steiner=!0),Ce.push(cx(Ae));for(Ce.sort(ax),se=0;se<Ce.length;se++)ae=lx(Ce[se],ae);return ae}(i,e,L,s)),i.length>80*s){c=y=i[0],f=_=i[1];for(var j=s;j<z;j+=s)(b=i[j])<c&&(c=b),(w=i[j+1])<f&&(f=w),b>y&&(y=b),w>_&&(_=w);T=(T=Math.max(y-c,_-f))!==0?32767/T:0}return xu(L,N,s,c,f,T,0),N}function sy(i,e,s,c,f){var y,_;if(f===Pd(i,e,s,c)>0)for(y=e;y<s;y+=c)_=uy(y,i[y],i[y+1],_);else for(y=s-c;y>=e;y-=c)_=uy(y,i[y],i[y+1],_);return _&&Eh(_,_.next)&&(Eu(_),_=_.next),_}function ta(i,e){if(!i)return i;e||(e=i);var s,c=i;do if(s=!1,c.steiner||!Eh(c,c.next)&&$r(c.prev,c,c.next)!==0)c=c.next;else{if(Eu(c),(c=e=c.prev)===c.next)break;s=!0}while(s||c!==e);return e}function xu(i,e,s,c,f,y,_){if(i){!_&&y&&function(P,z,L,N){var j=P;do j.z===0&&(j.z=kd(j.x,j.y,z,L,N)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==P);j.prevZ.nextZ=null,j.prevZ=null,function(J){var X,ae,me,se,pe,Ae,Ce,ot,ht=1;do{for(ae=J,J=null,pe=null,Ae=0;ae;){for(Ae++,me=ae,Ce=0,X=0;X<ht&&(Ce++,me=me.nextZ);X++);for(ot=ht;Ce>0||ot>0&&me;)Ce!==0&&(ot===0||!me||ae.z<=me.z)?(se=ae,ae=ae.nextZ,Ce--):(se=me,me=me.nextZ,ot--),pe?pe.nextZ=se:J=se,se.prevZ=pe,pe=se;ae=me}pe.nextZ=null,ht*=2}while(Ae>1)}(j)}(i,c,f,y);for(var b,w,T=i;i.prev!==i.next;)if(b=i.prev,w=i.next,y?nx(i,c,f,y):ix(i))e.push(b.i/s|0),e.push(i.i/s|0),e.push(w.i/s|0),Eu(i),i=w.next,T=w.next;else if((i=w)===T){_?_===1?xu(i=ox(ta(i),e,s),e,s,c,f,y,2):_===2&&sx(i,e,s,c,f,y):xu(ta(i),e,s,c,f,y,1);break}}}function ix(i){var e=i.prev,s=i,c=i.next;if($r(e,s,c)>=0)return!1;for(var f=e.x,y=s.x,_=c.x,b=e.y,w=s.y,T=c.y,P=f<y?f<_?f:_:y<_?y:_,z=b<w?b<T?b:T:w<T?w:T,L=f>y?f>_?f:_:y>_?y:_,N=b>w?b>T?b:T:w>T?w:T,j=c.next;j!==e;){if(j.x>=P&&j.x<=L&&j.y>=z&&j.y<=N&&ja(f,b,y,w,_,T,j.x,j.y)&&$r(j.prev,j,j.next)>=0)return!1;j=j.next}return!0}function nx(i,e,s,c){var f=i.prev,y=i,_=i.next;if($r(f,y,_)>=0)return!1;for(var b=f.x,w=y.x,T=_.x,P=f.y,z=y.y,L=_.y,N=b<w?b<T?b:T:w<T?w:T,j=P<z?P<L?P:L:z<L?z:L,J=b>w?b>T?b:T:w>T?w:T,X=P>z?P>L?P:L:z>L?z:L,ae=kd(N,j,e,s,c),me=kd(J,X,e,s,c),se=i.prevZ,pe=i.nextZ;se&&se.z>=ae&&pe&&pe.z<=me;){if(se.x>=N&&se.x<=J&&se.y>=j&&se.y<=X&&se!==f&&se!==_&&ja(b,P,w,z,T,L,se.x,se.y)&&$r(se.prev,se,se.next)>=0||(se=se.prevZ,pe.x>=N&&pe.x<=J&&pe.y>=j&&pe.y<=X&&pe!==f&&pe!==_&&ja(b,P,w,z,T,L,pe.x,pe.y)&&$r(pe.prev,pe,pe.next)>=0))return!1;pe=pe.nextZ}for(;se&&se.z>=ae;){if(se.x>=N&&se.x<=J&&se.y>=j&&se.y<=X&&se!==f&&se!==_&&ja(b,P,w,z,T,L,se.x,se.y)&&$r(se.prev,se,se.next)>=0)return!1;se=se.prevZ}for(;pe&&pe.z<=me;){if(pe.x>=N&&pe.x<=J&&pe.y>=j&&pe.y<=X&&pe!==f&&pe!==_&&ja(b,P,w,z,T,L,pe.x,pe.y)&&$r(pe.prev,pe,pe.next)>=0)return!1;pe=pe.nextZ}return!0}function ox(i,e,s){var c=i;do{var f=c.prev,y=c.next.next;!Eh(f,y)&&ay(f,c,c.next,y)&&wu(f,y)&&wu(y,f)&&(e.push(f.i/s|0),e.push(c.i/s|0),e.push(y.i/s|0),Eu(c),Eu(c.next),c=i=y),c=c.next}while(c!==i);return ta(c)}function sx(i,e,s,c,f,y){var _=i;do{for(var b=_.next.next;b!==_.prev;){if(_.i!==b.i&&hx(_,b)){var w=ly(_,b);return _=ta(_,_.next),w=ta(w,w.next),xu(_,e,s,c,f,y,0),void xu(w,e,s,c,f,y,0)}b=b.next}_=_.next}while(_!==i)}function ax(i,e){return i.x-e.x}function lx(i,e){var s=function(f,y){var _,b=y,w=f.x,T=f.y,P=-1/0;do{if(T<=b.y&&T>=b.next.y&&b.next.y!==b.y){var z=b.x+(T-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(z<=w&&z>P&&(P=z,_=b.x<b.next.x?b:b.next,z===w))return _}b=b.next}while(b!==y);if(!_)return null;var L,N=_,j=_.x,J=_.y,X=1/0;b=_;do w>=b.x&&b.x>=j&&w!==b.x&&ja(T<J?w:P,T,j,J,T<J?P:w,T,b.x,b.y)&&(L=Math.abs(T-b.y)/(w-b.x),wu(b,f)&&(L<X||L===X&&(b.x>_.x||b.x===_.x&&ux(_,b)))&&(_=b,X=L)),b=b.next;while(b!==N);return _}(i,e);if(!s)return e;var c=ly(s,i);return ta(c,c.next),ta(s,s.next)}function ux(i,e){return $r(i.prev,i,e.prev)<0&&$r(e.next,i,i.next)<0}function kd(i,e,s,c,f){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-s)*f|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-c)*f|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function cx(i){var e=i,s=i;do(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next;while(e!==i);return s}function ja(i,e,s,c,f,y,_,b){return(f-_)*(e-b)>=(i-_)*(y-b)&&(i-_)*(c-b)>=(s-_)*(e-b)&&(s-_)*(y-b)>=(f-_)*(c-b)}function hx(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(s,c){var f=s;do{if(f.i!==s.i&&f.next.i!==s.i&&f.i!==c.i&&f.next.i!==c.i&&ay(f,f.next,s,c))return!0;f=f.next}while(f!==s);return!1}(i,e)&&(wu(i,e)&&wu(e,i)&&function(s,c){var f=s,y=!1,_=(s.x+c.x)/2,b=(s.y+c.y)/2;do f.y>b!=f.next.y>b&&f.next.y!==f.y&&_<(f.next.x-f.x)*(b-f.y)/(f.next.y-f.y)+f.x&&(y=!y),f=f.next;while(f!==s);return y}(i,e)&&($r(i.prev,i,e.prev)||$r(i,e.prev,e))||Eh(i,e)&&$r(i.prev,i,i.next)>0&&$r(e.prev,e,e.next)>0)}function $r(i,e,s){return(e.y-i.y)*(s.x-e.x)-(e.x-i.x)*(s.y-e.y)}function Eh(i,e){return i.x===e.x&&i.y===e.y}function ay(i,e,s,c){var f=Th($r(i,e,s)),y=Th($r(i,e,c)),_=Th($r(s,c,i)),b=Th($r(s,c,e));return f!==y&&_!==b||!(f!==0||!Sh(i,s,e))||!(y!==0||!Sh(i,c,e))||!(_!==0||!Sh(s,i,c))||!(b!==0||!Sh(s,e,c))}function Sh(i,e,s){return e.x<=Math.max(i.x,s.x)&&e.x>=Math.min(i.x,s.x)&&e.y<=Math.max(i.y,s.y)&&e.y>=Math.min(i.y,s.y)}function Th(i){return i>0?1:i<0?-1:0}function wu(i,e){return $r(i.prev,i,i.next)<0?$r(i,e,i.next)>=0&&$r(i,i.prev,e)>=0:$r(i,e,i.prev)<0||$r(i,i.next,e)<0}function ly(i,e){var s=new Id(i.i,i.x,i.y),c=new Id(e.i,e.x,e.y),f=i.next,y=e.prev;return i.next=e,e.prev=i,s.next=f,f.prev=s,c.next=s,s.prev=c,y.next=c,c.prev=y,c}function uy(i,e,s,c){var f=new Id(i,e,s);return c?(f.next=c.next,f.prev=c,c.next.prev=f,c.next=f):(f.prev=f,f.next=f),f}function Eu(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Id(i,e,s){this.i=i,this.x=e,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Pd(i,e,s,c){for(var f=0,y=e,_=s-c;y<s;y+=c)f+=(i[_]-i[y])*(i[y+1]+i[_+1]),_=y;return f}function px(i,e,s,c,f){cy(i,e,s||0,c||i.length-1,f||dx)}function cy(i,e,s,c,f){for(;c>s;){if(c-s>600){var y=c-s+1,_=e-s+1,b=Math.log(y),w=.5*Math.exp(2*b/3),T=.5*Math.sqrt(b*w*(y-w)/y)*(_-y/2<0?-1:1);cy(i,e,Math.max(s,Math.floor(e-_*w/y+T)),Math.min(c,Math.floor(e+(y-_)*w/y+T)),f)}var P=i[e],z=s,L=c;for(Su(i,s,e),f(i[c],P)>0&&Su(i,s,c);z<L;){for(Su(i,z,L),z++,L--;f(i[z],P)<0;)z++;for(;f(i[L],P)>0;)L--}f(i[s],P)===0?Su(i,s,L):Su(i,++L,c),L<=e&&(s=L+1),e<=L&&(c=L-1)}}function Su(i,e,s){var c=i[e];i[e]=i[s],i[s]=c}function dx(i,e){return i<e?-1:i>e?1:0}function Md(i,e){let s=i.length;if(s<=1)return[i];let c=[],f,y;for(let _=0;_<s;_++){let b=Pe(i[_]);b!==0&&(i[_].area=Math.abs(b),y===void 0&&(y=b<0),y===b<0?(f&&c.push(f),f=[i[_]]):f.push(i[_]))}if(f&&c.push(f),e>1)for(let _=0;_<c.length;_++)c[_].length<=e||(px(c[_],e,1,c[_].length-1,fx),c[_]=c[_].slice(0,e));return c}function fx(i,e){return e.area-i.area}function zd(i,e,s){let c=s.patternDependencies,f=!1;for(let y of e){let _=y.paint.get(`${i}-pattern`);_.isConstant()||(f=!0);let b=_.constantOr(null);b&&(f=!0,c[b.to]=!0,c[b.from]=!0)}return f}function Od(i,e,s,c,f){let y=f.patternDependencies;for(let _ of e){let b=_.paint.get(`${i}-pattern`).value;if(b.kind!=="constant"){let w=b.evaluate({zoom:c-1},s,{},f.availableImages),T=b.evaluate({zoom:c},s,{},f.availableImages),P=b.evaluate({zoom:c+1},s,{},f.availableImages);w=w&&w.name?w.name:w,T=T&&T.name?T.name:T,P=P&&P.name?P.name:P,y[w]=!0,y[T]=!0,y[P]=!0,s.patterns[_.id]={min:w,mid:T,max:P}}}return s}xh.exports=wh,xh.exports.default=wh,wh.deviation=function(i,e,s,c){var f=e&&e.length,y=Math.abs(Pd(i,0,f?e[0]*s:i.length,s));if(f)for(var _=0,b=e.length;_<b;_++)y-=Math.abs(Pd(i,e[_]*s,_<b-1?e[_+1]*s:i.length,s));var w=0;for(_=0;_<c.length;_+=3){var T=c[_]*s,P=c[_+1]*s,z=c[_+2]*s;w+=Math.abs((i[T]-i[z])*(i[P+1]-i[T+1])-(i[T]-i[P])*(i[z+1]-i[T+1]))}return y===0&&w===0?0:Math.abs((w-y)/y)},wh.flatten=function(i){for(var e=i[0][0].length,s={vertices:[],holes:[],dimensions:e},c=0,f=0;f<i.length;f++){for(var y=0;y<i[f].length;y++)for(var _=0;_<e;_++)s.vertices.push(i[f][y][_]);f>0&&s.holes.push(c+=i[f-1].length)}return s};class Dd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new cr,this.indexArray=new Oi,this.indexArray2=new Kn,this.programConfigurations=new Ys(e.layers,e.zoom),this.segments=new jt,this.segments2=new jt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,c){this.hasPattern=zd("fill",this.layers,s);let f=this.layers[0].layout.get("fill-sort-key"),y=!f.isConstant(),_=[];for(let{feature:b,id:w,index:T,sourceLayerIndex:P}of e){let z=this.layers[0]._featureFilter.needGeometry,L=ea(b,z);if(!this.layers[0]._featureFilter.filter(new Ir(this.zoom),L,c))continue;let N=y?f.evaluate(L,{},c,s.availableImages):void 0,j={id:w,properties:b.properties,type:b.type,sourceLayerIndex:P,index:T,geometry:z?L.geometry:Qs(b),patterns:{},sortKey:N};_.push(j)}y&&_.sort((b,w)=>b.sortKey-w.sortKey);for(let b of _){let{geometry:w,index:T,sourceLayerIndex:P}=b;if(this.hasPattern){let z=Od("fill",this.layers,b,this.zoom,s);this.patternFeatures.push(z)}else this.addFeature(b,w,T,c,{});s.featureIndex.insert(e[T].feature,w,T,P,this.index)}}update(e,s,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,c)}addFeatures(e,s,c){for(let f of this.patternFeatures)this.addFeature(f,f.geometry,f.index,s,c)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,s,c,f,y){for(let _ of Md(s,500)){let b=0;for(let N of _)b+=N.length;let w=this.segments.prepareSegment(b,this.layoutVertexArray,this.indexArray),T=w.vertexLength,P=[],z=[];for(let N of _){if(N.length===0)continue;N!==_[0]&&z.push(P.length/2);let j=this.segments2.prepareSegment(N.length,this.layoutVertexArray,this.indexArray2),J=j.vertexLength;this.layoutVertexArray.emplaceBack(N[0].x,N[0].y),this.indexArray2.emplaceBack(J+N.length-1,J),P.push(N[0].x),P.push(N[0].y);for(let X=1;X<N.length;X++)this.layoutVertexArray.emplaceBack(N[X].x,N[X].y),this.indexArray2.emplaceBack(J+X-1,J+X),P.push(N[X].x),P.push(N[X].y);j.vertexLength+=N.length,j.primitiveLength+=N.length}let L=xh.exports(P,z);for(let N=0;N<L.length;N+=3)this.indexArray.emplaceBack(T+L[N],T+L[N+1],T+L[N+2]);w.vertexLength+=b,w.primitiveLength+=L.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,y,f)}}at("FillBucket",Dd,{omit:["layers","patternFeatures"]});let mx=new li({"fill-sort-key":new xt(Se.layout_fill["fill-sort-key"])});var yx={paint:new li({"fill-antialias":new ft(Se.paint_fill["fill-antialias"]),"fill-opacity":new xt(Se.paint_fill["fill-opacity"]),"fill-color":new xt(Se.paint_fill["fill-color"]),"fill-outline-color":new xt(Se.paint_fill["fill-outline-color"]),"fill-translate":new ft(Se.paint_fill["fill-translate"]),"fill-translate-anchor":new ft(Se.paint_fill["fill-translate-anchor"]),"fill-pattern":new ss(Se.paint_fill["fill-pattern"])}),layout:mx};let gx=qr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),_x=qr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:vx}=gx;var us={},bx=st,hy=Va;function Va(i,e,s,c,f){this.properties={},this.extent=s,this.type=0,this._pbf=i,this._geometry=-1,this._keys=c,this._values=f,i.readFields(xx,this,e)}function xx(i,e,s){i==1?e.id=s.readVarint():i==2?function(c,f){for(var y=c.readVarint()+c.pos;c.pos<y;){var _=f._keys[c.readVarint()],b=f._values[c.readVarint()];f.properties[_]=b}}(s,e):i==3?e.type=s.readVarint():i==4&&(e._geometry=s.pos)}function wx(i){for(var e,s,c=0,f=0,y=i.length,_=y-1;f<y;_=f++)c+=((s=i[_]).x-(e=i[f]).x)*(e.y+s.y);return c}Va.types=["Unknown","Point","LineString","Polygon"],Va.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,s=i.readVarint()+i.pos,c=1,f=0,y=0,_=0,b=[];i.pos<s;){if(f<=0){var w=i.readVarint();c=7&w,f=w>>3}if(f--,c===1||c===2)y+=i.readSVarint(),_+=i.readSVarint(),c===1&&(e&&b.push(e),e=[]),e.push(new bx(y,_));else{if(c!==7)throw new Error("unknown command "+c);e&&e.push(e[0].clone())}}return e&&b.push(e),b},Va.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,s=1,c=0,f=0,y=0,_=1/0,b=-1/0,w=1/0,T=-1/0;i.pos<e;){if(c<=0){var P=i.readVarint();s=7&P,c=P>>3}if(c--,s===1||s===2)(f+=i.readSVarint())<_&&(_=f),f>b&&(b=f),(y+=i.readSVarint())<w&&(w=y),y>T&&(T=y);else if(s!==7)throw new Error("unknown command "+s)}return[_,w,b,T]},Va.prototype.toGeoJSON=function(i,e,s){var c,f,y=this.extent*Math.pow(2,s),_=this.extent*i,b=this.extent*e,w=this.loadGeometry(),T=Va.types[this.type];function P(N){for(var j=0;j<N.length;j++){var J=N[j];N[j]=[360*(J.x+_)/y-180,360/Math.PI*Math.atan(Math.exp((180-360*(J.y+b)/y)*Math.PI/180))-90]}}switch(this.type){case 1:var z=[];for(c=0;c<w.length;c++)z[c]=w[c][0];P(w=z);break;case 2:for(c=0;c<w.length;c++)P(w[c]);break;case 3:for(w=function(N){var j=N.length;if(j<=1)return[N];for(var J,X,ae=[],me=0;me<j;me++){var se=wx(N[me]);se!==0&&(X===void 0&&(X=se<0),X===se<0?(J&&ae.push(J),J=[N[me]]):J.push(N[me]))}return J&&ae.push(J),ae}(w),c=0;c<w.length;c++)for(f=0;f<w[c].length;f++)P(w[c][f])}w.length===1?w=w[0]:T="Multi"+T;var L={type:"Feature",geometry:{type:T,coordinates:w},properties:this.properties};return"id"in this&&(L.id=this.id),L};var Ex=hy,py=dy;function dy(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(Sx,this,e),this.length=this._features.length}function Sx(i,e,s){i===15?e.version=s.readVarint():i===1?e.name=s.readString():i===5?e.extent=s.readVarint():i===2?e._features.push(s.pos):i===3?e._keys.push(s.readString()):i===4&&e._values.push(function(c){for(var f=null,y=c.readVarint()+c.pos;c.pos<y;){var _=c.readVarint()>>3;f=_===1?c.readString():_===2?c.readFloat():_===3?c.readDouble():_===4?c.readVarint64():_===5?c.readVarint():_===6?c.readSVarint():_===7?c.readBoolean():null}return f}(s))}dy.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Ex(this._pbf,e,this.extent,this._keys,this._values)};var Tx=py;function Cx(i,e,s){if(i===3){var c=new Tx(s,s.readVarint()+s.pos);c.length&&(e[c.name]=c)}}us.VectorTile=function(i,e){this.layers=i.readFields(Cx,{},e)},us.VectorTileFeature=hy,us.VectorTileLayer=py;let Ax=us.VectorTileFeature.types,Fd=Math.pow(2,13);function Tu(i,e,s,c,f,y,_,b){i.emplaceBack(e,s,2*Math.floor(c*Fd)+_,f*Fd*2,y*Fd*2,Math.round(b))}class Rd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Kt,this.centroidVertexArray=new gt,this.indexArray=new Oi,this.programConfigurations=new Ys(e.layers,e.zoom),this.segments=new jt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,c){this.features=[],this.hasPattern=zd("fill-extrusion",this.layers,s);for(let{feature:f,id:y,index:_,sourceLayerIndex:b}of e){let w=this.layers[0]._featureFilter.needGeometry,T=ea(f,w);if(!this.layers[0]._featureFilter.filter(new Ir(this.zoom),T,c))continue;let P={id:y,sourceLayerIndex:b,index:_,geometry:w?T.geometry:Qs(f),properties:f.properties,type:f.type,patterns:{}};this.hasPattern?this.features.push(Od("fill-extrusion",this.layers,P,this.zoom,s)):this.addFeature(P,P.geometry,_,c,{}),s.featureIndex.insert(f,P.geometry,_,b,this.index,!0)}}addFeatures(e,s,c){for(let f of this.features){let{geometry:y}=f;this.addFeature(f,y,f.index,s,c)}}update(e,s,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,c)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vx),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,_x.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,s,c,f,y){let _={x:0,y:0,vertexCount:0};for(let b of Md(s,500)){let w=0;for(let j of b)w+=j.length;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let j of b){if(j.length===0||Ix(j))continue;let J=0;for(let X=0;X<j.length;X++){let ae=j[X];if(X>=1){let me=j[X-1];if(!kx(ae,me)){T.vertexLength+4>jt.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let se=ae.sub(me)._perp()._unit(),pe=me.dist(ae);J+pe>32768&&(J=0),Tu(this.layoutVertexArray,ae.x,ae.y,se.x,se.y,0,0,J),Tu(this.layoutVertexArray,ae.x,ae.y,se.x,se.y,0,1,J),_.x+=2*ae.x,_.y+=2*ae.y,_.vertexCount+=2,J+=pe,Tu(this.layoutVertexArray,me.x,me.y,se.x,se.y,0,0,J),Tu(this.layoutVertexArray,me.x,me.y,se.x,se.y,0,1,J),_.x+=2*me.x,_.y+=2*me.y,_.vertexCount+=2;let Ae=T.vertexLength;this.indexArray.emplaceBack(Ae,Ae+2,Ae+1),this.indexArray.emplaceBack(Ae+1,Ae+2,Ae+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+w>jt.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray)),Ax[e.type]!=="Polygon")continue;let P=[],z=[],L=T.vertexLength;for(let j of b)if(j.length!==0){j!==b[0]&&z.push(P.length/2);for(let J=0;J<j.length;J++){let X=j[J];Tu(this.layoutVertexArray,X.x,X.y,0,0,1,1,0),_.x+=X.x,_.y+=X.y,_.vertexCount+=1,P.push(X.x),P.push(X.y)}}let N=xh.exports(P,z);for(let j=0;j<N.length;j+=3)this.indexArray.emplaceBack(L+N[j],L+N[j+2],L+N[j+1]);T.primitiveLength+=N.length/3,T.vertexLength+=w}for(let b=0;b<_.vertexCount;b++)this.centroidVertexArray.emplaceBack(Math.floor(_.x/_.vertexCount),Math.floor(_.y/_.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,y,f)}}function kx(i,e){return i.x===e.x&&(i.x<0||i.x>Xr)||i.y===e.y&&(i.y<0||i.y>Xr)}function Ix(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Xr)||i.every(e=>e.y<0)||i.every(e=>e.y>Xr)}at("FillExtrusionBucket",Rd,{omit:["layers","features"]});var Px={paint:new li({"fill-extrusion-opacity":new ft(Se["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xt(Se["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ft(Se["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ft(Se["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ss(Se["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xt(Se["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xt(Se["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ft(Se["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Cu(i,e){return i.x*e.x+i.y*e.y}function fy(i,e){if(i.length===1){let s=0,c=e[s++],f;for(;!f||c.equals(f);)if(f=e[s++],!f)return 1/0;for(;s<e.length;s++){let y=e[s],_=i[0],b=f.sub(c),w=y.sub(c),T=_.sub(c),P=Cu(b,b),z=Cu(b,w),L=Cu(w,w),N=Cu(T,b),j=Cu(T,w),J=P*L-z*z,X=(L*N-z*j)/J,ae=(P*j-z*N)/J,me=c.z*(1-X-ae)+f.z*X+y.z*ae;if(isFinite(me))return me}return 1/0}{let s=1/0;for(let c of e)s=Math.min(s,c.z);return s}}let Mx=qr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:zx}=Mx,Ox=qr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Dx}=Ox,Fx=us.VectorTileFeature.types,Rx=Math.cos(Math.PI/180*37.5),my=Math.pow(2,14)/.5;class Ld{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(s=>{this.gradients[s.id]={}}),this.layoutVertexArray=new Yt,this.layoutVertexArray2=new pr,this.indexArray=new Oi,this.programConfigurations=new Ys(e.layers,e.zoom),this.segments=new jt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,c){this.hasPattern=zd("line",this.layers,s);let f=this.layers[0].layout.get("line-sort-key"),y=!f.isConstant(),_=[];for(let{feature:b,id:w,index:T,sourceLayerIndex:P}of e){let z=this.layers[0]._featureFilter.needGeometry,L=ea(b,z);if(!this.layers[0]._featureFilter.filter(new Ir(this.zoom),L,c))continue;let N=y?f.evaluate(L,{},c):void 0,j={id:w,properties:b.properties,type:b.type,sourceLayerIndex:P,index:T,geometry:z?L.geometry:Qs(b),patterns:{},sortKey:N};_.push(j)}y&&_.sort((b,w)=>b.sortKey-w.sortKey);for(let b of _){let{geometry:w,index:T,sourceLayerIndex:P}=b;if(this.hasPattern){let z=Od("line",this.layers,b,this.zoom,s);this.patternFeatures.push(z)}else this.addFeature(b,w,T,c,{});s.featureIndex.insert(e[T].feature,w,T,P,this.index)}}update(e,s,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,c)}addFeatures(e,s,c){for(let f of this.patternFeatures)this.addFeature(f,f.geometry,f.index,s,c)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Dx)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zx),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,s,c,f,y){let _=this.layers[0].layout,b=_.get("line-join").evaluate(e,{}),w=_.get("line-cap"),T=_.get("line-miter-limit"),P=_.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let z of s)this.addLine(z,e,b,w,T,P);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,y,f)}addLine(e,s,c,f,y,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ae=0;ae<e.length-1;ae++)this.totalDistance+=e[ae].dist(e[ae+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let b=Fx[s.type]==="Polygon",w=e.length;for(;w>=2&&e[w-1].equals(e[w-2]);)w--;let T=0;for(;T<w-1&&e[T].equals(e[T+1]);)T++;if(w<(b?3:2))return;c==="bevel"&&(y=1.05);let P=this.overscaling<=16?122880/(512*this.overscaling):0,z=this.segments.prepareSegment(10*w,this.layoutVertexArray,this.indexArray),L,N,j,J,X;this.e1=this.e2=-1,b&&(L=e[w-2],X=e[T].sub(L)._unit()._perp());for(let ae=T;ae<w;ae++){if(j=ae===w-1?b?e[T+1]:void 0:e[ae+1],j&&e[ae].equals(j))continue;X&&(J=X),L&&(N=L),L=e[ae],X=j?j.sub(L)._unit()._perp():J,J=J||X;let me=J.add(X);me.x===0&&me.y===0||me._unit();let se=J.x*X.x+J.y*X.y,pe=me.x*X.x+me.y*X.y,Ae=pe!==0?1/pe:1/0,Ce=2*Math.sqrt(2-2*pe),ot=pe<Rx&&N&&j,ht=J.x*X.y-J.y*X.x>0;if(ot&&ae>T){let Ve=L.dist(N);if(Ve>2*P){let Qe=L.sub(L.sub(N)._mult(P/Ve)._round());this.updateDistance(N,Qe),this.addCurrentVertex(Qe,J,0,0,z),N=Qe}}let Ye=N&&j,Ke=Ye?c:b?"butt":f;if(Ye&&Ke==="round"&&(Ae<_?Ke="miter":Ae<=2&&(Ke="fakeround")),Ke==="miter"&&Ae>y&&(Ke="bevel"),Ke==="bevel"&&(Ae>2&&(Ke="flipbevel"),Ae<y&&(Ke="miter")),N&&this.updateDistance(N,L),Ke==="miter")me._mult(Ae),this.addCurrentVertex(L,me,0,0,z);else if(Ke==="flipbevel"){if(Ae>100)me=X.mult(-1);else{let Ve=Ae*J.add(X).mag()/J.sub(X).mag();me._perp()._mult(Ve*(ht?-1:1))}this.addCurrentVertex(L,me,0,0,z),this.addCurrentVertex(L,me.mult(-1),0,0,z)}else if(Ke==="bevel"||Ke==="fakeround"){let Ve=-Math.sqrt(Ae*Ae-1),Qe=ht?Ve:0,Xe=ht?0:Ve;if(N&&this.addCurrentVertex(L,J,Qe,Xe,z),Ke==="fakeround"){let Re=Math.round(180*Ce/Math.PI/20);for(let _t=1;_t<Re;_t++){let mt=_t/Re;if(mt!==.5){let Tr=mt-.5;mt+=mt*Tr*(mt-1)*((1.0904+se*(se*(3.55645-1.43519*se)-3.2452))*Tr*Tr+(.848013+se*(.215638*se-1.06021)))}let Lt=X.sub(J)._mult(mt)._add(J)._unit()._mult(ht?-1:1);this.addHalfVertex(L,Lt.x,Lt.y,!1,ht,0,z)}}j&&this.addCurrentVertex(L,X,-Qe,-Xe,z)}else if(Ke==="butt")this.addCurrentVertex(L,me,0,0,z);else if(Ke==="square"){let Ve=N?1:-1;this.addCurrentVertex(L,me,Ve,Ve,z)}else Ke==="round"&&(N&&(this.addCurrentVertex(L,J,0,0,z),this.addCurrentVertex(L,J,1,1,z,!0)),j&&(this.addCurrentVertex(L,X,-1,-1,z,!0),this.addCurrentVertex(L,X,0,0,z)));if(ot&&ae<w-1){let Ve=L.dist(j);if(Ve>2*P){let Qe=L.add(j.sub(L)._mult(P/Ve)._round());this.updateDistance(L,Qe),this.addCurrentVertex(Qe,X,0,0,z),L=Qe}}}}addCurrentVertex(e,s,c,f,y,_=!1){let b=s.y*f-s.x,w=-s.y-s.x*f;this.addHalfVertex(e,s.x+s.y*c,s.y-s.x*c,_,!1,c,y),this.addHalfVertex(e,b,w,_,!0,-f,y),this.distance>my/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,s,c,f,y,_))}addHalfVertex({x:e,y:s},c,f,y,_,b,w){let T=.5*(this.lineClips?this.scaledDistance*(my-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(y?1:0),(s<<1)+(_?1:0),Math.round(63*c)+128,Math.round(63*f)+128,1+(b===0?0:b<0?-1:1)|(63&T)<<2,T>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let P=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,P),w.primitiveLength++),_?this.e2=P:this.e1=P}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,s){this.distance+=e.dist(s),this.updateScaledDistance()}}at("LineBucket",Ld,{omit:["layers","patternFeatures"]});let Lx=new li({"line-cap":new ft(Se.layout_line["line-cap"]),"line-join":new xt(Se.layout_line["line-join"]),"line-miter-limit":new ft(Se.layout_line["line-miter-limit"]),"line-round-limit":new ft(Se.layout_line["line-round-limit"]),"line-sort-key":new xt(Se.layout_line["line-sort-key"])});var yy={paint:new li({"line-opacity":new xt(Se.paint_line["line-opacity"]),"line-color":new xt(Se.paint_line["line-color"]),"line-translate":new ft(Se.paint_line["line-translate"]),"line-translate-anchor":new ft(Se.paint_line["line-translate-anchor"]),"line-width":new xt(Se.paint_line["line-width"]),"line-gap-width":new xt(Se.paint_line["line-gap-width"]),"line-offset":new xt(Se.paint_line["line-offset"]),"line-blur":new xt(Se.paint_line["line-blur"]),"line-dasharray":new du(Se.paint_line["line-dasharray"]),"line-pattern":new ss(Se.paint_line["line-pattern"]),"line-gradient":new fo(Se.paint_line["line-gradient"])}),layout:Lx};let gy=new class extends xt{possiblyEvaluate(i,e){return e=new Ir(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(i,e)}evaluate(i,e,s,c){return e=le({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(i,e,s,c)}}(yy.paint.properties["line-width"].specification);function _y(i,e){return e>0?e+2*i:i}gy.useIntegerZoom=!0;let Bx=qr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Nx=qr([{name:"a_projected_pos",components:3,type:"Float32"}],4);qr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let jx=qr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);qr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let vy=qr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Vx=qr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ux(i,e,s){return i.sections.forEach(c=>{c.text=function(f,y,_){let b=y.layout.get("text-transform").evaluate(_,{});return b==="uppercase"?f=f.toLocaleUpperCase():b==="lowercase"&&(f=f.toLocaleLowerCase()),Yi.applyArabicShaping&&(f=Yi.applyArabicShaping(f)),f}(c.text,e,s)}),i}qr([{name:"triangle",components:3,type:"Uint16"}]),qr([{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"}]),qr([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),qr([{type:"Float32",name:"offsetX"}]),qr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);let Au={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var ui=24,Bd=gr,by=function(i,e,s,c,f){var y,_,b=8*f-c-1,w=(1<<b)-1,T=w>>1,P=-7,z=s?f-1:0,L=s?-1:1,N=i[e+z];for(z+=L,y=N&(1<<-P)-1,N>>=-P,P+=b;P>0;y=256*y+i[e+z],z+=L,P-=8);for(_=y&(1<<-P)-1,y>>=-P,P+=c;P>0;_=256*_+i[e+z],z+=L,P-=8);if(y===0)y=1-T;else{if(y===w)return _?NaN:1/0*(N?-1:1);_+=Math.pow(2,c),y-=T}return(N?-1:1)*_*Math.pow(2,y-c)},xy=function(i,e,s,c,f,y){var _,b,w,T=8*y-f-1,P=(1<<T)-1,z=P>>1,L=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=c?0:y-1,j=c?1:-1,J=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(b=isNaN(e)?1:0,_=P):(_=Math.floor(Math.log(e)/Math.LN2),e*(w=Math.pow(2,-_))<1&&(_--,w*=2),(e+=_+z>=1?L/w:L*Math.pow(2,1-z))*w>=2&&(_++,w/=2),_+z>=P?(b=0,_=P):_+z>=1?(b=(e*w-1)*Math.pow(2,f),_+=z):(b=e*Math.pow(2,z-1)*Math.pow(2,f),_=0));f>=8;i[s+N]=255&b,N+=j,b/=256,f-=8);for(_=_<<f|b,T+=f;T>0;i[s+N]=255&_,N+=j,_/=256,T-=8);i[s+N-j]|=128*J};function gr(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}gr.Varint=0,gr.Fixed64=1,gr.Bytes=2,gr.Fixed32=5;var cs,Nd=4294967296,wy=1/Nd,Ey=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(i){return i.type===gr.Bytes?i.readVarint()+i.pos:i.pos+1}function Ua(i,e,s){return s?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Sy(i,e,s){var c=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));s.realloc(c);for(var f=s.pos-1;f>=i;f--)s.buf[f+c]=s.buf[f]}function $x(i,e){for(var s=0;s<i.length;s++)e.writeVarint(i[s])}function qx(i,e){for(var s=0;s<i.length;s++)e.writeSVarint(i[s])}function Gx(i,e){for(var s=0;s<i.length;s++)e.writeFloat(i[s])}function Zx(i,e){for(var s=0;s<i.length;s++)e.writeDouble(i[s])}function Kx(i,e){for(var s=0;s<i.length;s++)e.writeBoolean(i[s])}function Wx(i,e){for(var s=0;s<i.length;s++)e.writeFixed32(i[s])}function Xx(i,e){for(var s=0;s<i.length;s++)e.writeSFixed32(i[s])}function Hx(i,e){for(var s=0;s<i.length;s++)e.writeFixed64(i[s])}function Jx(i,e){for(var s=0;s<i.length;s++)e.writeSFixed64(i[s])}function Ch(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function $a(i,e,s){i[s]=e,i[s+1]=e>>>8,i[s+2]=e>>>16,i[s+3]=e>>>24}function Ty(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}function Yx(i,e,s){i===1&&s.readMessage(Qx,e)}function Qx(i,e,s){if(i===3){let{id:c,bitmap:f,width:y,height:_,left:b,top:w,advance:T}=s.readMessage(e1,{});e.push({id:c,bitmap:new bu({width:y+6,height:_+6},f),metrics:{width:y,height:_,left:b,top:w,advance:T}})}}function e1(i,e,s){i===1?e.id=s.readVarint():i===2?e.bitmap=s.readBytes():i===3?e.width=s.readVarint():i===4?e.height=s.readVarint():i===5?e.left=s.readSVarint():i===6?e.top=s.readSVarint():i===7&&(e.advance=s.readVarint())}function Cy(i){let e=0,s=0;for(let _ of i)e+=_.w*_.h,s=Math.max(s,_.w);i.sort((_,b)=>b.h-_.h);let c=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),s),h:1/0}],f=0,y=0;for(let _ of i)for(let b=c.length-1;b>=0;b--){let w=c[b];if(!(_.w>w.w||_.h>w.h)){if(_.x=w.x,_.y=w.y,y=Math.max(y,_.y+_.h),f=Math.max(f,_.x+_.w),_.w===w.w&&_.h===w.h){let T=c.pop();b<c.length&&(c[b]=T)}else _.h===w.h?(w.x+=_.w,w.w-=_.w):_.w===w.w?(w.y+=_.h,w.h-=_.h):(c.push({x:w.x+_.w,y:w.y,w:w.w-_.w,h:_.h}),w.y+=_.h,w.h-=_.h);break}}return{w:f,h:y,fill:e/(f*y)||0}}gr.prototype={destroy:function(){this.buf=null},readFields:function(i,e,s){for(s=s||this.length;this.pos<s;){var c=this.readVarint(),f=c>>3,y=this.pos;this.type=7&c,i(f,e,this),this.pos===y&&this.skip(c)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Ch(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Ty(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Ch(this.buf,this.pos)+Ch(this.buf,this.pos+4)*Nd;return this.pos+=8,i},readSFixed64:function(){var i=Ch(this.buf,this.pos)+Ty(this.buf,this.pos+4)*Nd;return this.pos+=8,i},readFloat:function(){var i=by(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=by(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,s,c=this.buf;return e=127&(s=c[this.pos++]),s<128?e:(e|=(127&(s=c[this.pos++]))<<7,s<128?e:(e|=(127&(s=c[this.pos++]))<<14,s<128?e:(e|=(127&(s=c[this.pos++]))<<21,s<128?e:function(f,y,_){var b,w,T=_.buf;if(b=(112&(w=T[_.pos++]))>>4,w<128||(b|=(127&(w=T[_.pos++]))<<3,w<128)||(b|=(127&(w=T[_.pos++]))<<10,w<128)||(b|=(127&(w=T[_.pos++]))<<17,w<128)||(b|=(127&(w=T[_.pos++]))<<24,w<128)||(b|=(1&(w=T[_.pos++]))<<31,w<128))return Ua(f,b,y);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(s=c[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Ey?function(s,c,f){return Ey.decode(s.subarray(c,f))}(this.buf,e,i):function(s,c,f){for(var y="",_=c;_<f;){var b,w,T,P=s[_],z=null,L=P>239?4:P>223?3:P>191?2:1;if(_+L>f)break;L===1?P<128&&(z=P):L===2?(192&(b=s[_+1]))==128&&(z=(31&P)<<6|63&b)<=127&&(z=null):L===3?(w=s[_+2],(192&(b=s[_+1]))==128&&(192&w)==128&&((z=(15&P)<<12|(63&b)<<6|63&w)<=2047||z>=55296&&z<=57343)&&(z=null)):L===4&&(w=s[_+2],T=s[_+3],(192&(b=s[_+1]))==128&&(192&w)==128&&(192&T)==128&&((z=(15&P)<<18|(63&b)<<12|(63&w)<<6|63&T)<=65535||z>=1114112)&&(z=null)),z===null?(z=65533,L=1):z>65535&&(z-=65536,y+=String.fromCharCode(z>>>10&1023|55296),z=56320|1023&z),y+=String.fromCharCode(z),_+=L}return y}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==gr.Bytes)return i.push(this.readVarint(e));var s=Lo(this);for(i=i||[];this.pos<s;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==gr.Bytes)return i.push(this.readSVarint());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==gr.Bytes)return i.push(this.readBoolean());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==gr.Bytes)return i.push(this.readFloat());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==gr.Bytes)return i.push(this.readDouble());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==gr.Bytes)return i.push(this.readFixed32());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==gr.Bytes)return i.push(this.readSFixed32());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==gr.Bytes)return i.push(this.readFixed64());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==gr.Bytes)return i.push(this.readSFixed64());var e=Lo(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===gr.Varint)for(;this.buf[this.pos++]>127;);else if(e===gr.Bytes)this.pos=this.readVarint()+this.pos;else if(e===gr.Fixed32)this.pos+=4;else{if(e!==gr.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var s=new Uint8Array(e);s.set(this.buf),this.buf=s,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),$a(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),$a(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),$a(this.buf,-1&i,this.pos),$a(this.buf,Math.floor(i*wy),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),$a(this.buf,-1&i,this.pos),$a(this.buf,Math.floor(i*wy),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,s){var c,f;if(e>=0?(c=e%4294967296|0,f=e/4294967296|0):(f=~(-e/4294967296),4294967295^(c=~(-e%4294967296))?c=c+1|0:(c=0,f=f+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");s.realloc(10),function(y,_,b){b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,b.buf[b.pos]=127&(y>>>=7)}(c,0,s),function(y,_){var b=(7&y)<<4;_.buf[_.pos++]|=b|((y>>>=3)?128:0),y&&(_.buf[_.pos++]=127&y|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=127&y|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=127&y|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=127&y|((y>>>=7)?128:0),y&&(_.buf[_.pos++]=127&y)))))}(f,s)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(Boolean(i))},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(c,f,y){for(var _,b,w=0;w<f.length;w++){if((_=f.charCodeAt(w))>55295&&_<57344){if(!b){_>56319||w+1===f.length?(c[y++]=239,c[y++]=191,c[y++]=189):b=_;continue}if(_<56320){c[y++]=239,c[y++]=191,c[y++]=189,b=_;continue}_=b-55296<<10|_-56320|65536,b=null}else b&&(c[y++]=239,c[y++]=191,c[y++]=189,b=null);_<128?c[y++]=_:(_<2048?c[y++]=_>>6|192:(_<65536?c[y++]=_>>12|224:(c[y++]=_>>18|240,c[y++]=_>>12&63|128),c[y++]=_>>6&63|128),c[y++]=63&_|128)}return y}(this.buf,i,this.pos);var s=this.pos-e;s>=128&&Sy(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s},writeFloat:function(i){this.realloc(4),xy(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),xy(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var s=0;s<e;s++)this.buf[this.pos++]=i[s]},writeRawMessage:function(i,e){this.pos++;var s=this.pos;i(e,this);var c=this.pos-s;c>=128&&Sy(s,c,this),this.pos=s-1,this.writeVarint(c),this.pos+=c},writeMessage:function(i,e,s){this.writeTag(i,gr.Bytes),this.writeRawMessage(e,s)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,$x,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,qx,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Kx,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Gx,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Zx,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Wx,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Xx,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Hx,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Jx,e)},writeBytesField:function(i,e){this.writeTag(i,gr.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,gr.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,gr.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,gr.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,gr.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,gr.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,gr.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,gr.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,gr.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,gr.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,Boolean(e))}};class jd{constructor(e,{pixelRatio:s,version:c,stretchX:f,stretchY:y,content:_}){this.paddedRect=e,this.pixelRatio=s,this.stretchX=f,this.stretchY=y,this.content=_,this.version=c}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]}}class Ay{constructor(e,s){let c={},f={};this.haveRenderCallbacks=[];let y=[];this.addImages(e,c,y),this.addImages(s,f,y);let{w:_,h:b}=Cy(y),w=new gn({width:_||1,height:b||1});for(let T in e){let P=e[T],z=c[T].paddedRect;gn.copy(P.data,w,{x:0,y:0},{x:z.x+1,y:z.y+1},P.data)}for(let T in s){let P=s[T],z=f[T].paddedRect,L=z.x+1,N=z.y+1,j=P.data.width,J=P.data.height;gn.copy(P.data,w,{x:0,y:0},{x:L,y:N},P.data),gn.copy(P.data,w,{x:0,y:J-1},{x:L,y:N-1},{width:j,height:1}),gn.copy(P.data,w,{x:0,y:0},{x:L,y:N+J},{width:j,height:1}),gn.copy(P.data,w,{x:j-1,y:0},{x:L-1,y:N},{width:1,height:J}),gn.copy(P.data,w,{x:0,y:0},{x:L+j,y:N},{width:1,height:J})}this.image=w,this.iconPositions=c,this.patternPositions=f}addImages(e,s,c){for(let f in e){let y=e[f],_={x:0,y:0,w:y.data.width+2,h:y.data.height+2};c.push(_),s[f]=new jd(_,y),y.hasRenderCallback&&this.haveRenderCallbacks.push(f)}}patchUpdatedImages(e,s){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let c in e.updatedImages)this.patchUpdatedImage(this.iconPositions[c],e.getImage(c),s),this.patchUpdatedImage(this.patternPositions[c],e.getImage(c),s)}patchUpdatedImage(e,s,c){if(!e||!s||e.version===s.version)return;e.version=s.version;let[f,y]=e.tl;c.update(s.data,void 0,{x:f,y})}}at("ImagePosition",jd),at("ImageAtlas",Ay),a.WritingMode=void 0,(cs=a.WritingMode||(a.WritingMode={}))[cs.none=0]="none",cs[cs.horizontal=1]="horizontal",cs[cs.vertical=2]="vertical",cs[cs.horizontalOnly=3]="horizontalOnly";let Ah=-17;class ku{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,s){let c=new ku;return c.scale=e||1,c.fontStack=s,c}static forImage(e){let s=new ku;return s.imageName=e,s}}class qa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,s){let c=new qa;for(let f=0;f<e.sections.length;f++){let y=e.sections[f];y.image?c.addImageSection(y):c.addTextSection(y,s)}return c}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let s="";for(let c=0;c<e.length;c++){let f=e.charCodeAt(c+1)||null,y=e.charCodeAt(c-1)||null;s+=f&&ah(f)&&!Au[e[c+1]]||y&&ah(y)&&!Au[e[c-1]]||!Au[e[c]]?e[c]:Au[e[c]]}return s}(this.text)}trim(){let e=0;for(let c=0;c<this.text.length&&Ih[this.text.charCodeAt(c)];c++)e++;let s=this.text.length;for(let c=this.text.length-1;c>=0&&c>=e&&Ih[this.text.charCodeAt(c)];c--)s--;this.text=this.text.substring(e,s),this.sectionIndex=this.sectionIndex.slice(e,s)}substring(e,s){let c=new qa;return c.text=this.text.substring(e,s),c.sectionIndex=this.sectionIndex.slice(e,s),c.sections=this.sections,c}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,s)=>Math.max(e,this.sections[s].scale),0)}addTextSection(e,s){this.text+=e.text,this.sections.push(ku.forText(e.scale,e.fontStack||s));let c=this.sections.length-1;for(let f=0;f<e.text.length;++f)this.sectionIndex.push(c)}addImageSection(e){let s=e.image?e.image.name:"";if(s.length===0)return void Ie("Can't add FormattedSection with an empty image.");let c=this.getNextImageSectionCharCode();c?(this.text+=String.fromCharCode(c),this.sections.push(ku.forImage(s)),this.sectionIndex.push(this.sections.length-1)):Ie("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function kh(i,e,s,c,f,y,_,b,w,T,P,z,L,N,j,J){let X=qa.fromFeature(i,f),ae;z===a.WritingMode.vertical&&X.verticalizePunctuation();let{processBidirectionalText:me,processStyledBidirectionalText:se}=Yi;if(me&&X.sections.length===1){ae=[];let Ce=me(X.toString(),Vd(X,T,y,e,c,N,j));for(let ot of Ce){let ht=new qa;ht.text=ot,ht.sections=X.sections;for(let Ye=0;Ye<ot.length;Ye++)ht.sectionIndex.push(0);ae.push(ht)}}else if(se){ae=[];let Ce=se(X.text,X.sectionIndex,Vd(X,T,y,e,c,N,j));for(let ot of Ce){let ht=new qa;ht.text=ot[0],ht.sectionIndex=ot[1],ht.sections=X.sections,ae.push(ht)}}else ae=function(Ce,ot){let ht=[],Ye=Ce.text,Ke=0;for(let Ve of ot)ht.push(Ce.substring(Ke,Ve)),Ke=Ve;return Ke<Ye.length&&ht.push(Ce.substring(Ke,Ye.length)),ht}(X,Vd(X,T,y,e,c,N,j));let pe=[],Ae={positionedLines:pe,text:X.toString(),top:P[1],bottom:P[1],left:P[0],right:P[0],writingMode:z,iconsInText:!1,verticalizable:!1};return function(Ce,ot,ht,Ye,Ke,Ve,Qe,Xe,Re,_t,mt,Lt){let Tr=0,Mr=Ah,Hr=0,vn=0,yi=Xe==="right"?1:Xe==="left"?0:.5,Gr=0;for(let Zr of Ke){Zr.trim();let _i=Zr.getMaxScale(),Ti=(_i-1)*ui,Ri={positionedGlyphs:[],lineOffset:0};Ce.positionedLines[Gr]=Ri;let qi=Ri.positionedGlyphs,Gi=0;if(!Zr.length()){Mr+=Ve,++Gr;continue}for(let ni=0;ni<Zr.length();ni++){let Vt=Zr.getSection(ni),tn=Zr.getSectionIndex(ni),vi=Zr.getCharCode(ni),Ci=0,On=null,Xn=null,Hn=null,No=ui,Dn=!(Re===a.WritingMode.horizontal||!mt&&!au(vi)||mt&&(Ih[vi]||(ii=vi,Je.Arabic(ii)||Je["Arabic Supplement"](ii)||Je["Arabic Extended-A"](ii)||Je["Arabic Presentation Forms-A"](ii)||Je["Arabic Presentation Forms-B"](ii))));if(Vt.imageName){let bn=Ye[Vt.imageName];if(!bn)continue;Hn=Vt.imageName,Ce.iconsInText=Ce.iconsInText||!0,Xn=bn.paddedRect;let Zi=bn.displaySize;Vt.scale=Vt.scale*ui/Lt,On={width:Zi[0],height:Zi[1],left:1,top:-3,advance:Dn?Zi[1]:Zi[0]},Ci=Ti+(ui-Zi[1]*Vt.scale),No=On.advance;let jo=Dn?Zi[0]*Vt.scale-ui*_i:Zi[1]*Vt.scale-ui*_i;jo>0&&jo>Gi&&(Gi=jo)}else{let bn=ht[Vt.fontStack],Zi=bn&&bn[vi];if(Zi&&Zi.rect)Xn=Zi.rect,On=Zi.metrics;else{let jo=ot[Vt.fontStack],Mu=jo&&jo[vi];if(!Mu)continue;On=Mu.metrics}Ci=(_i-Vt.scale)*ui}Dn?(Ce.verticalizable=!0,qi.push({glyph:vi,imageName:Hn,x:Tr,y:Mr+Ci,vertical:Dn,scale:Vt.scale,fontStack:Vt.fontStack,sectionIndex:tn,metrics:On,rect:Xn}),Tr+=No*Vt.scale+_t):(qi.push({glyph:vi,imageName:Hn,x:Tr,y:Mr+Ci,vertical:Dn,scale:Vt.scale,fontStack:Vt.fontStack,sectionIndex:tn,metrics:On,rect:Xn}),Tr+=On.advance*Vt.scale+_t)}qi.length!==0&&(Hr=Math.max(Tr-_t,Hr),i1(qi,0,qi.length-1,yi,Gi)),Tr=0;let Lr=Ve*_i+Gi;Ri.lineOffset=Math.max(Gi,Ti),Mr+=Lr,vn=Math.max(Lr,vn),++Gr}var ii;let gi=Mr-Ah,{horizontalAlign:Si,verticalAlign:$i}=Ud(Qe);(function(Zr,_i,Ti,Ri,qi,Gi,Lr,ni,Vt){let tn=(_i-Ti)*qi,vi=0;vi=Gi!==Lr?-ni*Ri-Ah:(-Ri*Vt+.5)*Lr;for(let Ci of Zr)for(let On of Ci.positionedGlyphs)On.x+=tn,On.y+=vi})(Ce.positionedLines,yi,Si,$i,Hr,vn,Ve,gi,Ke.length),Ce.top+=-$i*gi,Ce.bottom=Ce.top+gi,Ce.left+=-Si*Hr,Ce.right=Ce.left+Hr}(Ae,e,s,c,ae,_,b,w,z,T,L,J),!function(Ce){for(let ot of Ce)if(ot.positionedGlyphs.length!==0)return!1;return!0}(pe)&&Ae}let Ih={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},t1={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function ky(i,e,s,c,f,y){if(e.imageName){let _=c[e.imageName];return _?_.displaySize[0]*e.scale*ui/y+f:0}{let _=s[e.fontStack],b=_&&_[i];return b?b.metrics.advance*e.scale+f:0}}function Iy(i,e,s,c){let f=Math.pow(i-e,2);return c?i<e?f/2:2*f:f+Math.abs(s)*s}function r1(i,e,s){let c=0;return i===10&&(c-=1e4),s&&(c+=150),i!==40&&i!==65288||(c+=50),e!==41&&e!==65289||(c+=50),c}function Py(i,e,s,c,f,y){let _=null,b=Iy(e,s,f,y);for(let w of c){let T=Iy(e-w.x,s,f,y)+w.badness;T<=b&&(_=w,b=T)}return{index:i,x:e,priorBreak:_,badness:b}}function My(i){return i?My(i.priorBreak).concat(i.index):[]}function Vd(i,e,s,c,f,y,_){if(y!=="point")return[];if(!i)return[];let b=[],w=function(L,N,j,J,X,ae){let me=0;for(let se=0;se<L.length();se++){let pe=L.getSection(se);me+=ky(L.getCharCode(se),pe,J,X,N,ae)}return me/Math.max(1,Math.ceil(me/j))}(i,e,s,c,f,_),T=i.text.indexOf("\u200B")>=0,P=0;for(let L=0;L<i.length();L++){let N=i.getSection(L),j=i.getCharCode(L);if(Ih[j]||(P+=ky(j,N,c,f,e,_)),L<i.length()-1){let J=!((z=j)<11904||!(Je["Bopomofo Extended"](z)||Je.Bopomofo(z)||Je["CJK Compatibility Forms"](z)||Je["CJK Compatibility Ideographs"](z)||Je["CJK Compatibility"](z)||Je["CJK Radicals Supplement"](z)||Je["CJK Strokes"](z)||Je["CJK Symbols and Punctuation"](z)||Je["CJK Unified Ideographs Extension A"](z)||Je["CJK Unified Ideographs"](z)||Je["Enclosed CJK Letters and Months"](z)||Je["Halfwidth and Fullwidth Forms"](z)||Je.Hiragana(z)||Je["Ideographic Description Characters"](z)||Je["Kangxi Radicals"](z)||Je["Katakana Phonetic Extensions"](z)||Je.Katakana(z)||Je["Vertical Forms"](z)||Je["Yi Radicals"](z)||Je["Yi Syllables"](z)));(t1[j]||J||N.imageName)&&b.push(Py(L+1,P,w,b,r1(j,i.getCharCode(L+1),J&&T),!1))}}var z;return My(Py(i.length(),P,w,b,0,!0))}function Ud(i){let e=.5,s=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":s=1;break;case"top":case"top-right":case"top-left":s=0}return{horizontalAlign:e,verticalAlign:s}}function i1(i,e,s,c,f){if(!c&&!f)return;let y=i[s],_=(i[s].x+y.metrics.advance*y.scale)*c;for(let b=e;b<=s;b++)i[b].x-=_,i[b].y+=f}function n1(i,e,s){let{horizontalAlign:c,verticalAlign:f}=Ud(s),y=e[0]-i.displaySize[0]*c,_=e[1]-i.displaySize[1]*f;return{image:i,top:_,bottom:_+i.displaySize[1],left:y,right:y+i.displaySize[0]}}function zy(i,e,s,c,f,y){let _=i.image,b;if(_.content){let X=_.content,ae=_.pixelRatio||1;b=[X[0]/ae,X[1]/ae,_.displaySize[0]-X[2]/ae,_.displaySize[1]-X[3]/ae]}let w=e.left*y,T=e.right*y,P,z,L,N;s==="width"||s==="both"?(N=f[0]+w-c[3],z=f[0]+T+c[1]):(N=f[0]+(w+T-_.displaySize[0])/2,z=N+_.displaySize[0]);let j=e.top*y,J=e.bottom*y;return s==="height"||s==="both"?(P=f[1]+j-c[0],L=f[1]+J+c[2]):(P=f[1]+(j+J-_.displaySize[1])/2,L=P+_.displaySize[1]),{image:_,top:P,right:z,bottom:L,left:N,collisionPadding:b}}let Bo=128;function Oy(i,e){let{expression:s}=e;if(s.kind==="constant")return{kind:"constant",layoutSize:s.evaluate(new Ir(i+1))};if(s.kind==="source")return{kind:"source"};{let{zoomStops:c,interpolationType:f}=s,y=0;for(;y<c.length&&c[y]<=i;)y++;y=Math.max(0,y-1);let _=y;for(;_<c.length&&c[_]<i+1;)_++;_=Math.min(c.length-1,_);let b=c[y],w=c[_];return s.kind==="composite"?{kind:"composite",minZoom:b,maxZoom:w,interpolationType:f}:{kind:"camera",minZoom:b,maxZoom:w,minSize:s.evaluate(new Ir(b)),maxSize:s.evaluate(new Ir(w)),interpolationType:f}}}class hs extends st{constructor(e,s,c,f){super(e,s),this.angle=c,f!==void 0&&(this.segment=f)}clone(){return new hs(this.x,this.y,this.angle,this.segment)}}function Dy(i,e,s,c,f){if(e.segment===void 0)return!0;let y=e,_=e.segment+1,b=0;for(;b>-s/2;){if(_--,_<0)return!1;b-=i[_].dist(y),y=i[_]}b+=i[_].dist(i[_+1]),_++;let w=[],T=0;for(;b<s/2;){let P=i[_],z=i[_+1];if(!z)return!1;let L=i[_-1].angleTo(P)-P.angleTo(z);for(L=Math.abs((L+3*Math.PI)%(2*Math.PI)-Math.PI),w.push({distance:b,angleDelta:L}),T+=L;b-w[0].distance>c;)T-=w.shift().angleDelta;if(T>f)return!1;_++,b+=P.dist(z)}return!0}function Fy(i){let e=0;for(let s=0;s<i.length-1;s++)e+=i[s].dist(i[s+1]);return e}function Ry(i,e,s){return i?.6*e*s:0}function Ly(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function o1(i,e,s,c,f,y){let _=Ry(s,f,y),b=Ly(s,c)*y,w=0,T=Fy(i)/2;for(let P=0;P<i.length-1;P++){let z=i[P],L=i[P+1],N=z.dist(L);if(w+N>T){let j=(T-w)/N,J=Ar(z.x,L.x,j),X=Ar(z.y,L.y,j),ae=new hs(J,X,L.angleTo(z),P);return ae._round(),!_||Dy(i,ae,b,_,e)?ae:void 0}w+=N}}function s1(i,e,s,c,f,y,_,b,w){let T=Ry(c,y,_),P=Ly(c,f),z=P*_,L=i[0].x===0||i[0].x===w||i[0].y===0||i[0].y===w;return e-z<e/4&&(e=z+e/4),By(i,L?e/2*b%e:(P/2+2*y)*_*b%e,e,T,s,z,L,!1,w)}function By(i,e,s,c,f,y,_,b,w){let T=y/2,P=Fy(i),z=0,L=e-s,N=[];for(let j=0;j<i.length-1;j++){let J=i[j],X=i[j+1],ae=J.dist(X),me=X.angleTo(J);for(;L+s<z+ae;){L+=s;let se=(L-z)/ae,pe=Ar(J.x,X.x,se),Ae=Ar(J.y,X.y,se);if(pe>=0&&pe<w&&Ae>=0&&Ae<w&&L-T>=0&&L+T<=P){let Ce=new hs(pe,Ae,me,j);Ce._round(),c&&!Dy(i,Ce,y,c,f)||N.push(Ce)}}z+=ae}return b||N.length||_||(N=By(i,z/2,s,c,f,y,_,!0,w)),N}function Ny(i,e,s,c,f){let y=[];for(let _=0;_<i.length;_++){let b=i[_],w;for(let T=0;T<b.length-1;T++){let P=b[T],z=b[T+1];P.x<e&&z.x<e||(P.x<e?P=new st(e,P.y+(e-P.x)/(z.x-P.x)*(z.y-P.y))._round():z.x<e&&(z=new st(e,P.y+(e-P.x)/(z.x-P.x)*(z.y-P.y))._round()),P.y<s&&z.y<s||(P.y<s?P=new st(P.x+(s-P.y)/(z.y-P.y)*(z.x-P.x),s)._round():z.y<s&&(z=new st(P.x+(s-P.y)/(z.y-P.y)*(z.x-P.x),s)._round()),P.x>=c&&z.x>=c||(P.x>=c?P=new st(c,P.y+(c-P.x)/(z.x-P.x)*(z.y-P.y))._round():z.x>=c&&(z=new st(c,P.y+(c-P.x)/(z.x-P.x)*(z.y-P.y))._round()),P.y>=f&&z.y>=f||(P.y>=f?P=new st(P.x+(f-P.y)/(z.y-P.y)*(z.x-P.x),f)._round():z.y>=f&&(z=new st(P.x+(f-P.y)/(z.y-P.y)*(z.x-P.x),f)._round()),w&&P.equals(w[w.length-1])||(w=[P],y.push(w)),w.push(z)))))}}return y}function jy(i,e,s,c){let f=[],y=i.image,_=y.pixelRatio,b=y.paddedRect.w-2,w=y.paddedRect.h-2,T=i.right-i.left,P=i.bottom-i.top,z=y.stretchX||[[0,b]],L=y.stretchY||[[0,w]],N=(Ve,Qe)=>Ve+Qe[1]-Qe[0],j=z.reduce(N,0),J=L.reduce(N,0),X=b-j,ae=w-J,me=0,se=j,pe=0,Ae=J,Ce=0,ot=X,ht=0,Ye=ae;if(y.content&&c){let Ve=y.content;me=Ph(z,0,Ve[0]),pe=Ph(L,0,Ve[1]),se=Ph(z,Ve[0],Ve[2]),Ae=Ph(L,Ve[1],Ve[3]),Ce=Ve[0]-me,ht=Ve[1]-pe,ot=Ve[2]-Ve[0]-se,Ye=Ve[3]-Ve[1]-Ae}let Ke=(Ve,Qe,Xe,Re)=>{let _t=Mh(Ve.stretch-me,se,T,i.left),mt=zh(Ve.fixed-Ce,ot,Ve.stretch,j),Lt=Mh(Qe.stretch-pe,Ae,P,i.top),Tr=zh(Qe.fixed-ht,Ye,Qe.stretch,J),Mr=Mh(Xe.stretch-me,se,T,i.left),Hr=zh(Xe.fixed-Ce,ot,Xe.stretch,j),vn=Mh(Re.stretch-pe,Ae,P,i.top),yi=zh(Re.fixed-ht,Ye,Re.stretch,J),Gr=new st(_t,Lt),ii=new st(Mr,Lt),gi=new st(Mr,vn),Si=new st(_t,vn),$i=new st(mt/_,Tr/_),Zr=new st(Hr/_,yi/_),_i=e*Math.PI/180;if(_i){let qi=Math.sin(_i),Gi=Math.cos(_i),Lr=[Gi,-qi,qi,Gi];Gr._matMult(Lr),ii._matMult(Lr),Si._matMult(Lr),gi._matMult(Lr)}let Ti=Ve.stretch+Ve.fixed,Ri=Qe.stretch+Qe.fixed;return{tl:Gr,tr:ii,bl:Si,br:gi,tex:{x:y.paddedRect.x+1+Ti,y:y.paddedRect.y+1+Ri,w:Xe.stretch+Xe.fixed-Ti,h:Re.stretch+Re.fixed-Ri},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:$i,pixelOffsetBR:Zr,minFontScaleX:ot/_/T,minFontScaleY:Ye/_/P,isSDF:s}};if(c&&(y.stretchX||y.stretchY)){let Ve=Vy(z,X,j),Qe=Vy(L,ae,J);for(let Xe=0;Xe<Ve.length-1;Xe++){let Re=Ve[Xe],_t=Ve[Xe+1];for(let mt=0;mt<Qe.length-1;mt++)f.push(Ke(Re,Qe[mt],_t,Qe[mt+1]))}}else f.push(Ke({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:b+1},{fixed:0,stretch:w+1}));return f}function Ph(i,e,s){let c=0;for(let f of i)c+=Math.max(e,Math.min(s,f[1]))-Math.max(e,Math.min(s,f[0]));return c}function Vy(i,e,s){let c=[{fixed:-1,stretch:0}];for(let[f,y]of i){let _=c[c.length-1];c.push({fixed:f-_.stretch,stretch:_.stretch}),c.push({fixed:f-_.stretch,stretch:_.stretch+(y-f)})}return c.push({fixed:e+1,stretch:s}),c}function Mh(i,e,s,c){return i/e*s+c}function zh(i,e,s,c){return i-e*s/c}at("Anchor",hs);class Oh{constructor(e,s,c,f,y,_,b,w,T,P){if(this.boxStartIndex=e.length,T){let z=_.top,L=_.bottom,N=_.collisionPadding;N&&(z-=N[1],L+=N[3]);let j=L-z;j>0&&(j=Math.max(10,j),this.circleDiameter=j)}else{let z=_.top*b-w[0],L=_.bottom*b+w[2],N=_.left*b-w[3],j=_.right*b+w[1],J=_.collisionPadding;if(J&&(N-=J[0]*b,z-=J[1]*b,j+=J[2]*b,L+=J[3]*b),P){let X=new st(N,z),ae=new st(j,z),me=new st(N,L),se=new st(j,L),pe=P*Math.PI/180;X._rotate(pe),ae._rotate(pe),me._rotate(pe),se._rotate(pe),N=Math.min(X.x,ae.x,me.x,se.x),j=Math.max(X.x,ae.x,me.x,se.x),z=Math.min(X.y,ae.y,me.y,se.y),L=Math.max(X.y,ae.y,me.y,se.y)}e.emplaceBack(s.x,s.y,N,z,j,L,c,f,y)}this.boxEndIndex=e.length}}class a1{constructor(e=[],s=l1){if(this.data=e,this.length=this.data.length,this.compare=s,this.length>0)for(let c=(this.length>>1)-1;c>=0;c--)this._down(c)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:s,compare:c}=this,f=s[e];for(;e>0;){let y=e-1>>1,_=s[y];if(c(f,_)>=0)break;s[e]=_,e=y}s[e]=f}_down(e){let{data:s,compare:c}=this,f=this.length>>1,y=s[e];for(;e<f;){let _=1+(e<<1),b=s[_],w=_+1;if(w<this.length&&c(s[w],b)<0&&(_=w,b=s[w]),c(b,y)>=0)break;s[e]=b,e=_}s[e]=y}}function l1(i,e){return i<e?-1:i>e?1:0}function u1(i,e=1,s=!1){let c=1/0,f=1/0,y=-1/0,_=-1/0,b=i[0];for(let N=0;N<b.length;N++){let j=b[N];(!N||j.x<c)&&(c=j.x),(!N||j.y<f)&&(f=j.y),(!N||j.x>y)&&(y=j.x),(!N||j.y>_)&&(_=j.y)}let w=Math.min(y-c,_-f),T=w/2,P=new a1([],c1);if(w===0)return new st(c,f);for(let N=c;N<y;N+=w)for(let j=f;j<_;j+=w)P.push(new Ga(N+T,j+T,T,i));let z=function(N){let j=0,J=0,X=0,ae=N[0];for(let me=0,se=ae.length,pe=se-1;me<se;pe=me++){let Ae=ae[me],Ce=ae[pe],ot=Ae.x*Ce.y-Ce.x*Ae.y;J+=(Ae.x+Ce.x)*ot,X+=(Ae.y+Ce.y)*ot,j+=3*ot}return new Ga(J/j,X/j,0,N)}(i),L=P.length;for(;P.length;){let N=P.pop();(N.d>z.d||!z.d)&&(z=N,s&&console.log("found best %d after %d probes",Math.round(1e4*N.d)/1e4,L)),N.max-z.d<=e||(T=N.h/2,P.push(new Ga(N.p.x-T,N.p.y-T,T,i)),P.push(new Ga(N.p.x+T,N.p.y-T,T,i)),P.push(new Ga(N.p.x-T,N.p.y+T,T,i)),P.push(new Ga(N.p.x+T,N.p.y+T,T,i)),L+=4)}return s&&(console.log(`num probes: ${L}`),console.log(`best distance: ${z.d}`)),z.p}function c1(i,e){return e.max-i.max}function Ga(i,e,s,c){this.p=new st(i,e),this.h=s,this.d=function(f,y){let _=!1,b=1/0;for(let w=0;w<y.length;w++){let T=y[w];for(let P=0,z=T.length,L=z-1;P<z;L=P++){let N=T[P],j=T[L];N.y>f.y!=j.y>f.y&&f.x<(j.x-N.x)*(f.y-N.y)/(j.y-N.y)+N.x&&(_=!_),b=Math.min(b,Xm(f,N,j))}}return(_?1:-1)*Math.sqrt(b)}(this.p,c),this.max=this.d+this.h*Math.SQRT2}let $d=Number.POSITIVE_INFINITY;function Uy(i,e){return e[1]!==$d?function(s,c,f){let y=0,_=0;switch(c=Math.abs(c),f=Math.abs(f),s){case"top-right":case"top-left":case"top":_=f-7;break;case"bottom-right":case"bottom-left":case"bottom":_=7-f}switch(s){case"top-right":case"bottom-right":case"right":y=-c;break;case"top-left":case"bottom-left":case"left":y=c}return[y,_]}(i,e[0],e[1]):function(s,c){let f=0,y=0;c<0&&(c=0);let _=c/Math.sqrt(2);switch(s){case"top-right":case"top-left":y=_-7;break;case"bottom-right":case"bottom-left":y=7-_;break;case"bottom":y=7-c;break;case"top":y=c-7}switch(s){case"top-right":case"bottom-right":f=-_;break;case"top-left":case"bottom-left":f=_;break;case"left":f=c;break;case"right":f=-c}return[f,y]}(i,e[0])}function qd(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function h1(i,e,s,c,f,y,_,b,w,T,P){let z=y.textMaxSize.evaluate(e,{});z===void 0&&(z=_);let L=i.layers[0].layout,N=L.get("icon-offset").evaluate(e,{},P),j=qy(s.horizontal),J=_/24,X=i.tilePixelRatio*J,ae=i.tilePixelRatio*z/24,me=i.tilePixelRatio*b,se=i.tilePixelRatio*L.get("symbol-spacing"),pe=L.get("text-padding")*i.tilePixelRatio,Ae=function(Re,_t,mt,Lt=1){let Tr=Re.get("icon-padding").evaluate(_t,{},mt),Mr=Tr&&Tr.values;return[Mr[0]*Lt,Mr[1]*Lt,Mr[2]*Lt,Mr[3]*Lt]}(L,e,P,i.tilePixelRatio),Ce=L.get("text-max-angle")/180*Math.PI,ot=L.get("text-rotation-alignment")!=="viewport"&&L.get("symbol-placement")!=="point",ht=L.get("icon-rotation-alignment")==="map"&&L.get("symbol-placement")!=="point",Ye=L.get("symbol-placement"),Ke=se/2,Ve=L.get("icon-text-fit"),Qe;c&&Ve!=="none"&&(i.allowVerticalPlacement&&s.vertical&&(Qe=zy(c,s.vertical,Ve,L.get("icon-text-fit-padding"),N,J)),j&&(c=zy(c,j,Ve,L.get("icon-text-fit-padding"),N,J)));let Xe=(Re,_t)=>{_t.x<0||_t.x>=Xr||_t.y<0||_t.y>=Xr||function(mt,Lt,Tr,Mr,Hr,vn,yi,Gr,ii,gi,Si,$i,Zr,_i,Ti,Ri,qi,Gi,Lr,ni,Vt,tn,vi,Ci,On){let Xn=mt.addToLineVertexArray(Lt,Tr),Hn,No,Dn,bn,Zi=0,jo=0,Mu=0,sg=0,ef=-1,tf=-1,Vo={},ag=ri.exports(""),rf=0,nf=0;if(Gr._unevaluatedLayout.getValue("text-radial-offset")===void 0?[rf,nf]=Gr.layout.get("text-offset").evaluate(Vt,{},Ci).map(Ki=>Ki*ui):(rf=Gr.layout.get("text-radial-offset").evaluate(Vt,{},Ci)*ui,nf=$d),mt.allowVerticalPlacement&&Mr.vertical){let Ki=Gr.layout.get("text-rotate").evaluate(Vt,{},Ci)+90;Dn=new Oh(ii,Lt,gi,Si,$i,Mr.vertical,Zr,_i,Ti,Ki),yi&&(bn=new Oh(ii,Lt,gi,Si,$i,yi,qi,Gi,Ti,Ki))}if(Hr){let Ki=Gr.layout.get("icon-rotate").evaluate(Vt,{}),vo=Gr.layout.get("icon-text-fit")!=="none",zu=jy(Hr,Ki,vi,vo),Ou=yi?jy(yi,Ki,vi,vo):void 0;No=new Oh(ii,Lt,gi,Si,$i,Hr,qi,Gi,!1,Ki),Zi=4*zu.length;let cg=mt.iconSizeData,ia=null;cg.kind==="source"?(ia=[Bo*Gr.layout.get("icon-size").evaluate(Vt,{})],ia[0]>ps&&Ie(`${mt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):cg.kind==="composite"&&(ia=[Bo*tn.compositeIconSizes[0].evaluate(Vt,{},Ci),Bo*tn.compositeIconSizes[1].evaluate(Vt,{},Ci)],(ia[0]>ps||ia[1]>ps)&&Ie(`${mt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),mt.addSymbols(mt.icon,zu,ia,ni,Lr,Vt,a.WritingMode.none,Lt,Xn.lineStartIndex,Xn.lineLength,-1,Ci),ef=mt.icon.placedSymbolArray.length-1,Ou&&(jo=4*Ou.length,mt.addSymbols(mt.icon,Ou,ia,ni,Lr,Vt,a.WritingMode.vertical,Lt,Xn.lineStartIndex,Xn.lineLength,-1,Ci),tf=mt.icon.placedSymbolArray.length-1)}let lg=Object.keys(Mr.horizontal);for(let Ki of lg){let vo=Mr.horizontal[Ki];if(!Hn){ag=ri.exports(vo.text);let Ou=Gr.layout.get("text-rotate").evaluate(Vt,{},Ci);Hn=new Oh(ii,Lt,gi,Si,$i,vo,Zr,_i,Ti,Ou)}let zu=vo.positionedLines.length===1;if(Mu+=$y(mt,Lt,vo,vn,Gr,Ti,Vt,Ri,Xn,Mr.vertical?a.WritingMode.horizontal:a.WritingMode.horizontalOnly,zu?lg:[Ki],Vo,ef,tn,Ci),zu)break}Mr.vertical&&(sg+=$y(mt,Lt,Mr.vertical,vn,Gr,Ti,Vt,Ri,Xn,a.WritingMode.vertical,["vertical"],Vo,tf,tn,Ci));let S1=Hn?Hn.boxStartIndex:mt.collisionBoxArray.length,T1=Hn?Hn.boxEndIndex:mt.collisionBoxArray.length,C1=Dn?Dn.boxStartIndex:mt.collisionBoxArray.length,A1=Dn?Dn.boxEndIndex:mt.collisionBoxArray.length,k1=No?No.boxStartIndex:mt.collisionBoxArray.length,I1=No?No.boxEndIndex:mt.collisionBoxArray.length,P1=bn?bn.boxStartIndex:mt.collisionBoxArray.length,M1=bn?bn.boxEndIndex:mt.collisionBoxArray.length,Jn=-1,Bh=(Ki,vo)=>Ki&&Ki.circleDiameter?Math.max(Ki.circleDiameter,vo):vo;Jn=Bh(Hn,Jn),Jn=Bh(Dn,Jn),Jn=Bh(No,Jn),Jn=Bh(bn,Jn);let ug=Jn>-1?1:0;ug&&(Jn*=On/ui),mt.glyphOffsetArray.length>=Za.MAX_GLYPHS&&Ie("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vt.sortKey!==void 0&&mt.addToSortKeyRanges(mt.symbolInstances.length,Vt.sortKey),mt.symbolInstances.emplaceBack(Lt.x,Lt.y,Vo.right>=0?Vo.right:-1,Vo.center>=0?Vo.center:-1,Vo.left>=0?Vo.left:-1,Vo.vertical||-1,ef,tf,ag,S1,T1,C1,A1,k1,I1,P1,M1,gi,Mu,sg,Zi,jo,ug,0,Zr,rf,nf,Jn)}(i,_t,Re,s,c,f,Qe,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,X,[pe,pe,pe,pe],ot,w,me,Ae,ht,N,e,y,T,P,_)};if(Ye==="line")for(let Re of Ny(e.geometry,0,0,Xr,Xr)){let _t=s1(Re,se,Ce,s.vertical||j,c,24,ae,i.overscaling,Xr);for(let mt of _t){let Lt=j;Lt&&p1(i,Lt.text,Ke,mt)||Xe(Re,mt)}}else if(Ye==="line-center"){for(let Re of e.geometry)if(Re.length>1){let _t=o1(Re,Ce,s.vertical||j,c,24,ae);_t&&Xe(Re,_t)}}else if(e.type==="Polygon")for(let Re of Md(e.geometry,0)){let _t=u1(Re,16);Xe(Re[0],new hs(_t.x,_t.y,0))}else if(e.type==="LineString")for(let Re of e.geometry)Xe(Re,new hs(Re[0].x,Re[0].y,0));else if(e.type==="Point")for(let Re of e.geometry)for(let _t of Re)Xe([_t],new hs(_t.x,_t.y,0))}let ps=32640;function $y(i,e,s,c,f,y,_,b,w,T,P,z,L,N,j){let J=function(me,se,pe,Ae,Ce,ot,ht,Ye){let Ke=Ae.layout.get("text-rotate").evaluate(ot,{})*Math.PI/180,Ve=[];for(let Qe of se.positionedLines)for(let Xe of Qe.positionedGlyphs){if(!Xe.rect)continue;let Re=Xe.rect||{},_t=4,mt=!0,Lt=1,Tr=0,Mr=(Ce||Ye)&&Xe.vertical,Hr=Xe.metrics.advance*Xe.scale/2;if(Ye&&se.verticalizable){let Lr=(Xe.scale-1)*ui,ni=(ui-Xe.metrics.width*Xe.scale)/2;Tr=Qe.lineOffset/2-(Xe.imageName?-ni:Lr)}if(Xe.imageName){let Lr=ht[Xe.imageName];mt=Lr.sdf,Lt=Lr.pixelRatio,_t=1/Lt}let vn=Ce?[Xe.x+Hr,Xe.y]:[0,0],yi=Ce?[0,0]:[Xe.x+Hr+pe[0],Xe.y+pe[1]-Tr],Gr=[0,0];Mr&&(Gr=yi,yi=[0,0]);let ii=(Xe.metrics.left-_t)*Xe.scale-Hr+yi[0],gi=(-Xe.metrics.top-_t)*Xe.scale+yi[1],Si=ii+Re.w*Xe.scale/Lt,$i=gi+Re.h*Xe.scale/Lt,Zr=new st(ii,gi),_i=new st(Si,gi),Ti=new st(ii,$i),Ri=new st(Si,$i);if(Mr){let Lr=new st(-Hr,Hr-Ah),ni=-Math.PI/2,Vt=12-Hr,tn=new st(22-Vt,-(Xe.imageName?Vt:0)),vi=new st(...Gr);Zr._rotateAround(ni,Lr)._add(tn)._add(vi),_i._rotateAround(ni,Lr)._add(tn)._add(vi),Ti._rotateAround(ni,Lr)._add(tn)._add(vi),Ri._rotateAround(ni,Lr)._add(tn)._add(vi)}if(Ke){let Lr=Math.sin(Ke),ni=Math.cos(Ke),Vt=[ni,-Lr,Lr,ni];Zr._matMult(Vt),_i._matMult(Vt),Ti._matMult(Vt),Ri._matMult(Vt)}let qi=new st(0,0),Gi=new st(0,0);Ve.push({tl:Zr,tr:_i,bl:Ti,br:Ri,tex:Re,writingMode:se.writingMode,glyphOffset:vn,sectionIndex:Xe.sectionIndex,isSDF:mt,pixelOffsetTL:qi,pixelOffsetBR:Gi,minFontScaleX:0,minFontScaleY:0})}return Ve}(0,s,b,f,y,_,c,i.allowVerticalPlacement),X=i.textSizeData,ae=null;X.kind==="source"?(ae=[Bo*f.layout.get("text-size").evaluate(_,{})],ae[0]>ps&&Ie(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):X.kind==="composite"&&(ae=[Bo*N.compositeTextSizes[0].evaluate(_,{},j),Bo*N.compositeTextSizes[1].evaluate(_,{},j)],(ae[0]>ps||ae[1]>ps)&&Ie(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),i.addSymbols(i.text,J,ae,b,y,_,T,e,w.lineStartIndex,w.lineLength,L,j);for(let me of P)z[me]=i.text.placedSymbolArray.length-1;return 4*J.length}function qy(i){for(let e in i)return i[e];return null}function p1(i,e,s,c){let f=i.compareText;if(e in f){let y=f[e];for(let _=y.length-1;_>=0;_--)if(c.dist(y[_])<s)return!0}else f[e]=[];return f[e].push(c),!1}let d1=us.VectorTileFeature.types,f1=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Dh(i,e,s,c,f,y,_,b,w,T,P,z,L){let N=b?Math.min(ps,Math.round(b[0])):0,j=b?Math.min(ps,Math.round(b[1])):0;i.emplaceBack(e,s,Math.round(32*c),Math.round(32*f),y,_,(N<<1)+(w?1:0),j,16*T,16*P,256*z,256*L)}function Gd(i,e,s){i.emplaceBack(e.x,e.y,s),i.emplaceBack(e.x,e.y,s),i.emplaceBack(e.x,e.y,s),i.emplaceBack(e.x,e.y,s)}function m1(i){for(let e of i.sections)if(uh(e.text))return!0;return!1}class Zd{constructor(e){this.layoutVertexArray=new Mn,this.indexArray=new Oi,this.programConfigurations=e,this.segments=new jt,this.dynamicLayoutVertexArray=new yn,this.opacityVertexArray=new zn,this.placedSymbolArray=new ze}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,s,c,f){this.isEmpty()||(c&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bx.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,s),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Nx.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,f1,!0),this.opacityVertexBuffer.itemSize=1),(c||f)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}at("SymbolBuffers",Zd);class Kd{constructor(e,s,c){this.layoutVertexArray=new e,this.layoutAttributes=s,this.indexArray=new c,this.segments=new jt,this.collisionVertexArray=new Qi}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,jx.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}at("CollisionBuffers",Kd);class Za{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(_=>_.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Td([]),this.placementViewportMatrix=Td([]);let s=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Oy(this.zoom,s["text-size"]),this.iconSizeData=Oy(this.zoom,s["icon-size"]);let c=this.layers[0].layout,f=c.get("symbol-sort-key"),y=c.get("symbol-z-order");this.canOverlap=Xd(c,"text-overlap","text-allow-overlap")!=="never"||Xd(c,"icon-overlap","icon-allow-overlap")!=="never"||c.get("text-ignore-placement")||c.get("icon-ignore-placement"),this.sortFeaturesByKey=y!=="viewport-y"&&!f.isConstant(),this.sortFeaturesByY=(y==="viewport-y"||y==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,c.get("symbol-placement")==="point"&&(this.writingModes=c.get("text-writing-mode").map(_=>a.WritingMode[_])),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=e.sourceID}createArrays(){this.text=new Zd(new Ys(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Zd(new Ys(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ze,this.lineVertexArray=new nt,this.symbolInstances=new rt}calculateGlyphDependencies(e,s,c,f,y){for(let _=0;_<e.length;_++)if(s[e.charCodeAt(_)]=!0,(c||f)&&y){let b=Au[e.charAt(_)];b&&(s[b.charCodeAt(0)]=!0)}}populate(e,s,c){let f=this.layers[0],y=f.layout,_=y.get("text-font"),b=y.get("text-field"),w=y.get("icon-image"),T=(b.value.kind!=="constant"||b.value.value instanceof te&&!b.value.value.isEmpty()||b.value.value.toString().length>0)&&(_.value.kind!=="constant"||_.value.value.length>0),P=w.value.kind!=="constant"||!!w.value.value||Object.keys(w.parameters).length>0,z=y.get("symbol-sort-key");if(this.features=[],!T&&!P)return;let L=s.iconDependencies,N=s.glyphDependencies,j=s.availableImages,J=new Ir(this.zoom);for(let{feature:X,id:ae,index:me,sourceLayerIndex:se}of e){let pe=f._featureFilter.needGeometry,Ae=ea(X,pe);if(!f._featureFilter.filter(J,Ae,c))continue;let Ce,ot;if(pe||(Ae.geometry=Qs(X)),T){let Ye=f.getValueAndResolveTokens("text-field",Ae,c,j),Ke=te.factory(Ye);m1(Ke)&&(this.hasRTLText=!0),(!this.hasRTLText||Xs()==="unavailable"||this.hasRTLText&&Yi.isParsed())&&(Ce=Ux(Ke,f,Ae))}if(P){let Ye=f.getValueAndResolveTokens("icon-image",Ae,c,j);ot=Ye instanceof ne?Ye:ne.fromString(Ye)}if(!Ce&&!ot)continue;let ht=this.sortFeaturesByKey?z.evaluate(Ae,{},c):void 0;if(this.features.push({id:ae,text:Ce,icon:ot,index:me,sourceLayerIndex:se,geometry:Ae.geometry,properties:X.properties,type:d1[X.type],sortKey:ht}),ot&&(L[ot.name]=!0),Ce){let Ye=_.evaluate(Ae,{},c).join(","),Ke=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(a.WritingMode.vertical)>=0;for(let Ve of Ce.sections)if(Ve.image)L[Ve.image.name]=!0;else{let Qe=Da(Ce.toString()),Xe=Ve.fontStack||Ye,Re=N[Xe]=N[Xe]||{};this.calculateGlyphDependencies(Ve.text,Re,Ke,this.allowVerticalPlacement,Qe)}}}y.get("symbol-placement")==="line"&&(this.features=function(X){let ae={},me={},se=[],pe=0;function Ae(Ye){se.push(X[Ye]),pe++}function Ce(Ye,Ke,Ve){let Qe=me[Ye];return delete me[Ye],me[Ke]=Qe,se[Qe].geometry[0].pop(),se[Qe].geometry[0]=se[Qe].geometry[0].concat(Ve[0]),Qe}function ot(Ye,Ke,Ve){let Qe=ae[Ke];return delete ae[Ke],ae[Ye]=Qe,se[Qe].geometry[0].shift(),se[Qe].geometry[0]=Ve[0].concat(se[Qe].geometry[0]),Qe}function ht(Ye,Ke,Ve){let Qe=Ve?Ke[0][Ke[0].length-1]:Ke[0][0];return`${Ye}:${Qe.x}:${Qe.y}`}for(let Ye=0;Ye<X.length;Ye++){let Ke=X[Ye],Ve=Ke.geometry,Qe=Ke.text?Ke.text.toString():null;if(!Qe){Ae(Ye);continue}let Xe=ht(Qe,Ve),Re=ht(Qe,Ve,!0);if(Xe in me&&Re in ae&&me[Xe]!==ae[Re]){let _t=ot(Xe,Re,Ve),mt=Ce(Xe,Re,se[_t].geometry);delete ae[Xe],delete me[Re],me[ht(Qe,se[mt].geometry,!0)]=mt,se[_t].geometry=null}else Xe in me?Ce(Xe,Re,Ve):Re in ae?ot(Xe,Re,Ve):(Ae(Ye),ae[Xe]=pe-1,me[Re]=pe-1)}return se.filter(Ye=>Ye.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((X,ae)=>X.sortKey-ae.sortKey)}update(e,s,c){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,s,this.layers,c),this.icon.programConfigurations.updatePaintArrays(e,s,this.layers,c))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,s){let c=this.lineVertexArray.length;if(e.segment!==void 0){let f=e.dist(s[e.segment+1]),y=e.dist(s[e.segment]),_={};for(let b=e.segment+1;b<s.length;b++)_[b]={x:s[b].x,y:s[b].y,tileUnitDistanceFromAnchor:f},b<s.length-1&&(f+=s[b+1].dist(s[b]));for(let b=e.segment||0;b>=0;b--)_[b]={x:s[b].x,y:s[b].y,tileUnitDistanceFromAnchor:y},b>0&&(y+=s[b-1].dist(s[b]));for(let b=0;b<s.length;b++){let w=_[b];this.lineVertexArray.emplaceBack(w.x,w.y,w.tileUnitDistanceFromAnchor)}}return{lineStartIndex:c,lineLength:this.lineVertexArray.length-c}}addSymbols(e,s,c,f,y,_,b,w,T,P,z,L){let N=e.indexArray,j=e.layoutVertexArray,J=e.segments.prepareSegment(4*s.length,j,N,this.canOverlap?_.sortKey:void 0),X=this.glyphOffsetArray.length,ae=J.vertexLength,me=this.allowVerticalPlacement&&b===a.WritingMode.vertical?Math.PI/2:0,se=_.text&&_.text.sections;for(let pe=0;pe<s.length;pe++){let{tl:Ae,tr:Ce,bl:ot,br:ht,tex:Ye,pixelOffsetTL:Ke,pixelOffsetBR:Ve,minFontScaleX:Qe,minFontScaleY:Xe,glyphOffset:Re,isSDF:_t,sectionIndex:mt}=s[pe],Lt=J.vertexLength,Tr=Re[1];Dh(j,w.x,w.y,Ae.x,Tr+Ae.y,Ye.x,Ye.y,c,_t,Ke.x,Ke.y,Qe,Xe),Dh(j,w.x,w.y,Ce.x,Tr+Ce.y,Ye.x+Ye.w,Ye.y,c,_t,Ve.x,Ke.y,Qe,Xe),Dh(j,w.x,w.y,ot.x,Tr+ot.y,Ye.x,Ye.y+Ye.h,c,_t,Ke.x,Ve.y,Qe,Xe),Dh(j,w.x,w.y,ht.x,Tr+ht.y,Ye.x+Ye.w,Ye.y+Ye.h,c,_t,Ve.x,Ve.y,Qe,Xe),Gd(e.dynamicLayoutVertexArray,w,me),N.emplaceBack(Lt,Lt+1,Lt+2),N.emplaceBack(Lt+1,Lt+2,Lt+3),J.vertexLength+=4,J.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Re[0]),pe!==s.length-1&&mt===s[pe+1].sectionIndex||e.programConfigurations.populatePaintArrays(j.length,_,_.index,{},L,se&&se[mt])}e.placedSymbolArray.emplaceBack(w.x,w.y,X,this.glyphOffsetArray.length-X,ae,T,P,w.segment,c?c[0]:0,c?c[1]:0,f[0],f[1],b,0,!1,0,z)}_addCollisionDebugVertex(e,s,c,f,y,_){return s.emplaceBack(0,0),e.emplaceBack(c.x,c.y,f,y,Math.round(_.x),Math.round(_.y))}addCollisionDebugVertices(e,s,c,f,y,_,b){let w=y.segments.prepareSegment(4,y.layoutVertexArray,y.indexArray),T=w.vertexLength,P=y.layoutVertexArray,z=y.collisionVertexArray,L=b.anchorX,N=b.anchorY;this._addCollisionDebugVertex(P,z,_,L,N,new st(e,s)),this._addCollisionDebugVertex(P,z,_,L,N,new st(c,s)),this._addCollisionDebugVertex(P,z,_,L,N,new st(c,f)),this._addCollisionDebugVertex(P,z,_,L,N,new st(e,f)),w.vertexLength+=4;let j=y.indexArray;j.emplaceBack(T,T+1),j.emplaceBack(T+1,T+2),j.emplaceBack(T+2,T+3),j.emplaceBack(T+3,T),w.primitiveLength+=4}addDebugCollisionBoxes(e,s,c,f){for(let y=e;y<s;y++){let _=this.collisionBoxArray.get(y);this.addCollisionDebugVertices(_.x1,_.y1,_.x2,_.y2,f?this.textCollisionBox:this.iconCollisionBox,_.anchorPoint,c)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Kd(go,vy.members,Kn),this.iconCollisionBox=new Kd(go,vy.members,Kn);for(let e=0;e<this.symbolInstances.length;e++){let s=this.symbolInstances.get(e);this.addDebugCollisionBoxes(s.textBoxStartIndex,s.textBoxEndIndex,s,!0),this.addDebugCollisionBoxes(s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s,!0),this.addDebugCollisionBoxes(s.iconBoxStartIndex,s.iconBoxEndIndex,s,!1),this.addDebugCollisionBoxes(s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s,!1)}}_deserializeCollisionBoxesForSymbol(e,s,c,f,y,_,b,w,T){let P={};for(let z=s;z<c;z++){let L=e.get(z);P.textBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},P.textFeatureIndex=L.featureIndex;break}for(let z=f;z<y;z++){let L=e.get(z);P.verticalTextBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},P.verticalTextFeatureIndex=L.featureIndex;break}for(let z=_;z<b;z++){let L=e.get(z);P.iconBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},P.iconFeatureIndex=L.featureIndex;break}for(let z=w;z<T;z++){let L=e.get(z);P.verticalIconBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},P.verticalIconFeatureIndex=L.featureIndex;break}return P}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let s=0;s<this.symbolInstances.length;s++){let c=this.symbolInstances.get(s);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,c.textBoxStartIndex,c.textBoxEndIndex,c.verticalTextBoxStartIndex,c.verticalTextBoxEndIndex,c.iconBoxStartIndex,c.iconBoxEndIndex,c.verticalIconBoxStartIndex,c.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(e,s){let c=e.placedSymbolArray.get(s),f=c.vertexStartIndex+4*c.numGlyphs;for(let y=c.vertexStartIndex;y<f;y+=4)e.indexArray.emplaceBack(y,y+1,y+2),e.indexArray.emplaceBack(y+1,y+2,y+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let s=Math.sin(e),c=Math.cos(e),f=[],y=[],_=[];for(let b=0;b<this.symbolInstances.length;++b){_.push(b);let w=this.symbolInstances.get(b);f.push(0|Math.round(s*w.anchorX+c*w.anchorY)),y.push(w.featureIndex)}return _.sort((b,w)=>f[b]-f[w]||y[w]-y[b]),_}addToSortKeyRanges(e,s){let c=this.sortKeyRanges[this.sortKeyRanges.length-1];c&&c.sortKey===s?c.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:s,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let s of this.symbolInstanceIndexes){let c=this.symbolInstances.get(s);this.featureSortOrder.push(c.featureIndex),[c.rightJustifiedTextSymbolIndex,c.centerJustifiedTextSymbolIndex,c.leftJustifiedTextSymbolIndex].forEach((f,y,_)=>{f>=0&&_.indexOf(f)===y&&this.addIndicesForPlacedSymbol(this.text,f)}),c.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,c.verticalPlacedTextSymbolIndex),c.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,c.placedIconSymbolIndex),c.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,c.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}at("SymbolBucket",Za,{omit:["layers","collisionBoxArray","features","compareText"]}),Za.MAX_GLYPHS=65535,Za.addDynamicAttributes=Gd;let y1=new li({"symbol-placement":new ft(Se.layout_symbol["symbol-placement"]),"symbol-spacing":new ft(Se.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ft(Se.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xt(Se.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ft(Se.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ft(Se.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ft(Se.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ft(Se.layout_symbol["icon-ignore-placement"]),"icon-optional":new ft(Se.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ft(Se.layout_symbol["icon-rotation-alignment"]),"icon-size":new xt(Se.layout_symbol["icon-size"]),"icon-text-fit":new ft(Se.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ft(Se.layout_symbol["icon-text-fit-padding"]),"icon-image":new xt(Se.layout_symbol["icon-image"]),"icon-rotate":new xt(Se.layout_symbol["icon-rotate"]),"icon-padding":new xt(Se.layout_symbol["icon-padding"]),"icon-keep-upright":new ft(Se.layout_symbol["icon-keep-upright"]),"icon-offset":new xt(Se.layout_symbol["icon-offset"]),"icon-anchor":new xt(Se.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ft(Se.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ft(Se.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ft(Se.layout_symbol["text-rotation-alignment"]),"text-field":new xt(Se.layout_symbol["text-field"]),"text-font":new xt(Se.layout_symbol["text-font"]),"text-size":new xt(Se.layout_symbol["text-size"]),"text-max-width":new xt(Se.layout_symbol["text-max-width"]),"text-line-height":new ft(Se.layout_symbol["text-line-height"]),"text-letter-spacing":new xt(Se.layout_symbol["text-letter-spacing"]),"text-justify":new xt(Se.layout_symbol["text-justify"]),"text-radial-offset":new xt(Se.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ft(Se.layout_symbol["text-variable-anchor"]),"text-anchor":new xt(Se.layout_symbol["text-anchor"]),"text-max-angle":new ft(Se.layout_symbol["text-max-angle"]),"text-writing-mode":new ft(Se.layout_symbol["text-writing-mode"]),"text-rotate":new xt(Se.layout_symbol["text-rotate"]),"text-padding":new ft(Se.layout_symbol["text-padding"]),"text-keep-upright":new ft(Se.layout_symbol["text-keep-upright"]),"text-transform":new xt(Se.layout_symbol["text-transform"]),"text-offset":new xt(Se.layout_symbol["text-offset"]),"text-allow-overlap":new ft(Se.layout_symbol["text-allow-overlap"]),"text-overlap":new ft(Se.layout_symbol["text-overlap"]),"text-ignore-placement":new ft(Se.layout_symbol["text-ignore-placement"]),"text-optional":new ft(Se.layout_symbol["text-optional"])});var Wd={paint:new li({"icon-opacity":new xt(Se.paint_symbol["icon-opacity"]),"icon-color":new xt(Se.paint_symbol["icon-color"]),"icon-halo-color":new xt(Se.paint_symbol["icon-halo-color"]),"icon-halo-width":new xt(Se.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xt(Se.paint_symbol["icon-halo-blur"]),"icon-translate":new ft(Se.paint_symbol["icon-translate"]),"icon-translate-anchor":new ft(Se.paint_symbol["icon-translate-anchor"]),"text-opacity":new xt(Se.paint_symbol["text-opacity"]),"text-color":new xt(Se.paint_symbol["text-color"],{runtimeType:he,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new xt(Se.paint_symbol["text-halo-color"]),"text-halo-width":new xt(Se.paint_symbol["text-halo-width"]),"text-halo-blur":new xt(Se.paint_symbol["text-halo-blur"]),"text-translate":new ft(Se.paint_symbol["text-translate"]),"text-translate-anchor":new ft(Se.paint_symbol["text-translate-anchor"])}),layout:y1};class Gy{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:fn,this.defaultValue=e}evaluate(e){if(e.formattedSection){let s=this.defaultValue.property.overrides;if(s&&s.hasOverride(e.formattedSection))return s.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}at("FormatSectionOverride",Gy,{omit:["defaultValue"]});class Fh extends Pn{constructor(e){super(e,Wd)}recalculate(e,s){if(super.recalculate(e,s),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let c=this.layout.get("text-writing-mode");if(c){let f=[];for(let y of c)f.indexOf(y)<0&&f.push(y);this.layout._values["text-writing-mode"]=f}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,s,c,f){let y=this.layout.get(e).evaluate(s,{},c,f),_=this._unevaluatedLayout._values[e];return _.isDataDriven()||Rs(_.value)||!y?y:function(b,w){return w.replace(/{([^{}]+)}/g,(T,P)=>P in b?String(b[P]):"")}(s.properties,y)}createBucket(e){return new Za(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Wd.paint.overridableProperties){if(!Fh.hasPaintOverride(this.layout,e))continue;let s=this.paint.get(e),c=new Gy(s),f=new ka(c,s.property.specification),y=null;y=s.value.kind==="constant"||s.value.kind==="source"?new Bs("source",f):new tu("composite",f,s.value.zoomStops),this.paint._values[e]=new In(s.property,y,s.parameters)}}_handleOverridablePaintPropertyUpdate(e,s,c){return!(!this.layout||s.isDataDriven()||c.isDataDriven())&&Fh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,s){let c=e.get("text-field"),f=Wd.paint.properties[s],y=!1,_=b=>{for(let w of b)if(f.overrides&&f.overrides.hasOverride(w))return void(y=!0)};if(c.value.kind==="constant"&&c.value.value instanceof te)_(c.value.value.sections);else if(c.value.kind==="source"){let b=T=>{y||(T instanceof dt&&ge(T.value)===Le?_(T.value.sections):T instanceof Ca?_(T.sections):T.eachChild(b))},w=c.value;w._styleExpression&&b(w._styleExpression.expression)}return y}}function Xd(i,e,s){let c="never",f=i.get(e);return f?c=f:i.get(s)&&(c="always"),c}var g1={paint:new li({"background-color":new ft(Se.paint_background["background-color"]),"background-pattern":new du(Se.paint_background["background-pattern"]),"background-opacity":new ft(Se.paint_background["background-opacity"])})},_1={paint:new li({"raster-opacity":new ft(Se.paint_raster["raster-opacity"]),"raster-hue-rotate":new ft(Se.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ft(Se.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ft(Se.paint_raster["raster-brightness-max"]),"raster-saturation":new ft(Se.paint_raster["raster-saturation"]),"raster-contrast":new ft(Se.paint_raster["raster-contrast"]),"raster-resampling":new ft(Se.paint_raster["raster-resampling"]),"raster-fade-duration":new ft(Se.paint_raster["raster-fade-duration"])})};class v1 extends Pn{constructor(e){super(e,{}),this.onAdd=s=>{this.implementation.onAdd&&this.implementation.onAdd(s,s.painter.context.gl)},this.onRemove=s=>{this.implementation.onRemove&&this.implementation.onRemove(s,s.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}let b1={circle:class extends Pn{constructor(i){super(i,Jb)}createBucket(i){return new wd(i)}queryRadius(i){let e=i;return _u("circle-radius",this,e)+_u("circle-stroke-width",this,e)+_h(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,s,c,f,y,_,b){let w=vh(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),y.angle,_),T=this.paint.get("circle-radius").evaluate(e,s)+this.paint.get("circle-stroke-width").evaluate(e,s),P=this.paint.get("circle-pitch-alignment")==="map",z=P?w:function(N,j){return N.map(J=>ry(J,j))}(w,b),L=P?T*_:T;for(let N of c)for(let j of N){let J=P?j:ry(j,b),X=L,ae=bh([],[j.x,j.y,0,1],b);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?X*=ae[3]/y.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(X*=y.cameraToCenterDistance/ae[3]),Zb(z,J,X))return!0}return!1}},heatmap:class extends Pn{constructor(i){super(i,Qb),this._updateColorRamp()}createBucket(i){return new iy(i)}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=oy({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends Pn{constructor(i){super(i,ex)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends Pn{constructor(i){super(i,yx)}recalculate(i,e){super.recalculate(i,e);let s=this.paint._values["fill-outline-color"];s.value.kind==="constant"&&s.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new Dd(i)}queryRadius(){return _h(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,s,c,f,y,_){return Wm(vh(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),y.angle,_),c)}isTileClipped(){return!0}},"fill-extrusion":class extends Pn{constructor(i){super(i,Px)}createBucket(i){return new Rd(i)}queryRadius(){return _h(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,s,c,f,y,_,b){let w=vh(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),y.angle,_),T=this.paint.get("fill-extrusion-height").evaluate(e,s),P=this.paint.get("fill-extrusion-base").evaluate(e,s),z=function(N,j,J,X){let ae=[];for(let me of N){let se=[me.x,me.y,0,1];bh(se,se,j),ae.push(new st(se[0]/se[3],se[1]/se[3]))}return ae}(w,b),L=function(N,j,J,X){let ae=[],me=[],se=X[8]*j,pe=X[9]*j,Ae=X[10]*j,Ce=X[11]*j,ot=X[8]*J,ht=X[9]*J,Ye=X[10]*J,Ke=X[11]*J;for(let Ve of N){let Qe=[],Xe=[];for(let Re of Ve){let _t=Re.x,mt=Re.y,Lt=X[0]*_t+X[4]*mt+X[12],Tr=X[1]*_t+X[5]*mt+X[13],Mr=X[2]*_t+X[6]*mt+X[14],Hr=X[3]*_t+X[7]*mt+X[15],vn=Mr+Ae,yi=Hr+Ce,Gr=Lt+ot,ii=Tr+ht,gi=Mr+Ye,Si=Hr+Ke,$i=new st((Lt+se)/yi,(Tr+pe)/yi);$i.z=vn/yi,Qe.push($i);let Zr=new st(Gr/Si,ii/Si);Zr.z=gi/Si,Xe.push(Zr)}ae.push(Qe),me.push(Xe)}return[ae,me]}(c,P,T,b);return function(N,j,J){let X=1/0;Wm(J,j)&&(X=fy(J,j[0]));for(let ae=0;ae<j.length;ae++){let me=j[ae],se=N[ae];for(let pe=0;pe<me.length-1;pe++){let Ae=me[pe],Ce=[Ae,me[pe+1],se[pe+1],se[pe],Ae];Km(J,Ce)&&(X=Math.min(X,fy(J,Ce)))}}return X!==1/0&&X}(L[0],L[1],z)}},line:class extends Pn{constructor(i){super(i,yy),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(i){i==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ms,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(i,e){super.recalculate(i,e),this.paint._values["line-floorwidth"]=gy.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new Ld(i)}queryRadius(i){let e=i,s=_y(_u("line-width",this,e),_u("line-gap-width",this,e)),c=_u("line-offset",this,e);return s/2+Math.abs(c)+_h(this.paint.get("line-translate"))}queryIntersectsFeature(i,e,s,c,f,y,_){let b=vh(i,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),y.angle,_),w=_/2*_y(this.paint.get("line-width").evaluate(e,s),this.paint.get("line-gap-width").evaluate(e,s)),T=this.paint.get("line-offset").evaluate(e,s);return T&&(c=function(P,z){let L=[];for(let N=0;N<P.length;N++){let j=P[N],J=[];for(let X=0;X<j.length;X++){let ae=j[X-1],me=j[X],se=j[X+1],pe=X===0?new st(0,0):me.sub(ae)._unit()._perp(),Ae=X===j.length-1?new st(0,0):se.sub(me)._unit()._perp(),Ce=pe._add(Ae)._unit(),ot=Ce.x*Ae.x+Ce.y*Ae.y;ot!==0&&Ce._mult(1/ot),J.push(Ce._mult(z)._add(me))}L.push(J)}return L}(c,T*_)),function(P,z,L){for(let N=0;N<z.length;N++){let j=z[N];if(P.length>=3){for(let J=0;J<j.length;J++)if(Na(P,j[J]))return!0}if(Kb(P,j,L))return!0}return!1}(b,c,w)}isTileClipped(){return!0}},symbol:Fh,background:class extends Pn{constructor(i){super(i,g1)}},raster:class extends Pn{constructor(i){super(i,_1)}}};class x1{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}let Zy=63710088e-1;class Vr{constructor(e,s){if(isNaN(e)||isNaN(s))throw new Error(`Invalid LngLat object: (${e}, ${s})`);if(this.lng=+e,this.lat=+s,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Vr(ee(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let s=Math.PI/180,c=this.lat*s,f=e.lat*s,y=Math.sin(c)*Math.sin(f)+Math.cos(c)*Math.cos(f)*Math.cos((e.lng-this.lng)*s);return Zy*Math.acos(Math.min(y,1))}toBounds(e=0){let s=360*e/40075017,c=s/Math.cos(Math.PI/180*this.lat);return new ra(new Vr(this.lng-c,this.lat-s),new Vr(this.lng+c,this.lat+s))}static convert(e){if(e instanceof Vr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Vr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Vr(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new 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>]")}}class ra{constructor(e,s){e&&(s?this.setSouthWest(e).setNorthEast(s):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 Vr?new Vr(e.lng,e.lat):Vr.convert(e),this}setSouthWest(e){return this._sw=e instanceof Vr?new Vr(e.lng,e.lat):Vr.convert(e),this}extend(e){let s=this._sw,c=this._ne,f,y;if(e instanceof Vr)f=e,y=e;else{if(!(e instanceof ra))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(ra.convert(e)):this.extend(Vr.convert(e)):this;if(f=e._sw,y=e._ne,!f||!y)return this}return s||c?(s.lng=Math.min(f.lng,s.lng),s.lat=Math.min(f.lat,s.lat),c.lng=Math.max(y.lng,c.lng),c.lat=Math.max(y.lat,c.lat)):(this._sw=new Vr(f.lng,f.lat),this._ne=new Vr(y.lng,y.lat)),this}getCenter(){return new Vr((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 Vr(this.getWest(),this.getNorth())}getSouthEast(){return new Vr(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:s,lat:c}=Vr.convert(e),f=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(f=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=c&&c<=this._ne.lat&&f}static convert(e){return e instanceof ra?e:e&&new ra(e)}}let Ky=2*Math.PI*Zy;function Wy(i){return Ky*Math.cos(i*Math.PI/180)}function Xy(i){return(180+i)/360}function Hy(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Jy(i,e){return i/Wy(e)}function Hd(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Rh{constructor(e,s,c=0){this.x=+e,this.y=+s,this.z=+c}static fromLngLat(e,s=0){let c=Vr.convert(e);return new Rh(Xy(c.lng),Hy(c.lat),Jy(s,c.lat))}toLngLat(){return new Vr(360*this.x-180,Hd(this.y))}toAltitude(){return this.z*Wy(Hd(this.y))}meterInMercatorCoordinateUnits(){return 1/Ky*(e=Hd(this.y),1/Math.cos(e*Math.PI/180));var e}}function Yy(i,e,s){var c=2*Math.PI*6378137/256/Math.pow(2,s);return[i*c-2*Math.PI*6378137/2,e*c-2*Math.PI*6378137/2]}class Jd{constructor(e,s,c){if(e<0||e>25||c<0||c>=Math.pow(2,e)||s<0||s>=Math.pow(2,e))throw new Error(`x=${s}, y=${c}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=s,this.y=c,this.key=Iu(0,e,e,s,c)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,s,c){let f=(_=this.y,b=this.z,w=Yy(256*(y=this.x),256*(_=Math.pow(2,b)-_-1),b),T=Yy(256*(y+1),256*(_+1),b),w[0]+","+w[1]+","+T[0]+","+T[1]);var y,_,b,w,T;let P=function(z,L,N){let j,J="";for(let X=z;X>0;X--)j=1<<X-1,J+=(L&j?1:0)+(N&j?2:0);return J}(this.z,this.x,this.y);return e[(this.x+this.y)%e.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(c==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,s>1?"@2x":"").replace(/{quadkey}/g,P).replace(/{bbox-epsg-3857}/g,f)}isChildOf(e){let s=this.z-e.z;return s>0&&e.x===this.x>>s&&e.y===this.y>>s}getTilePoint(e){let s=Math.pow(2,this.z);return new st((e.x*s-this.x)*Xr,(e.y*s-this.y)*Xr)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Qy{constructor(e,s){this.wrap=e,this.canonical=s,this.key=Iu(e,s.z,s.z,s.x,s.y)}}class _n{constructor(e,s,c,f,y){if(e<c)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${c}`);this.overscaledZ=e,this.wrap=s,this.canonical=new Jd(c,+f,+y),this.key=Iu(s,e,c,f,y)}clone(){return new _n(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 new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let s=this.canonical.z-e;return e>this.canonical.z?new _n(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new _n(e,this.wrap,e,this.canonical.x>>s,this.canonical.y>>s)}calculateScaledKey(e,s){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let c=this.canonical.z-e;return e>this.canonical.z?Iu(this.wrap*+s,e,this.canonical.z,this.canonical.x,this.canonical.y):Iu(this.wrap*+s,e,e,this.canonical.x>>c,this.canonical.y>>c)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let s=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>s&&e.canonical.y===this.canonical.y>>s}children(e){if(this.overscaledZ>=e)return[new _n(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let s=this.canonical.z+1,c=2*this.canonical.x,f=2*this.canonical.y;return[new _n(s,this.wrap,s,c,f),new _n(s,this.wrap,s,c+1,f),new _n(s,this.wrap,s,c,f+1),new _n(s,this.wrap,s,c+1,f+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new _n(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new _n(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Qy(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Rh(e.x-this.wrap,e.y))}}function Iu(i,e,s,c,f){(i*=2)<0&&(i=-1*i-1);let y=1<<s;return(y*y*i+y*f+c).toString(36)+s.toString(36)+e.toString(36)}at("CanonicalTileID",Jd),at("OverscaledTileID",_n,{omit:["posMatrix"]});class eg{constructor(e,s,c){if(this.uid=e,s.height!==s.width)throw new RangeError("DEM tiles must be square");if(c&&c!=="mapbox"&&c!=="terrarium")return void Ie(`"${c}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=s.height;let f=this.dim=s.height-2;this.data=new Uint32Array(s.data.buffer),this.encoding=c||"mapbox";for(let y=0;y<f;y++)this.data[this._idx(-1,y)]=this.data[this._idx(0,y)],this.data[this._idx(f,y)]=this.data[this._idx(f-1,y)],this.data[this._idx(y,-1)]=this.data[this._idx(y,0)],this.data[this._idx(y,f)]=this.data[this._idx(y,f-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(f,-1)]=this.data[this._idx(f-1,0)],this.data[this._idx(-1,f)]=this.data[this._idx(0,f-1)],this.data[this._idx(f,f)]=this.data[this._idx(f-1,f-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let y=0;y<f;y++)for(let _=0;_<f;_++){let b=this.get(y,_);b>this.max&&(this.max=b),b<this.min&&(this.min=b)}}get(e,s){let c=new Uint8Array(this.data.buffer),f=4*this._idx(e,s);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(c[f],c[f+1],c[f+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,s){if(e<-1||e>=this.dim+1||s<-1||s>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(s+1)*this.stride+(e+1)}_unpackMapbox(e,s,c){return(256*e*256+256*s+c)/10-1e4}_unpackTerrarium(e,s,c){return 256*e+s+c/256-32768}getPixels(){return new gn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,s,c){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let f=s*this.dim,y=s*this.dim+this.dim,_=c*this.dim,b=c*this.dim+this.dim;switch(s){case-1:f=y-1;break;case 1:y=f+1}switch(c){case-1:_=b-1;break;case 1:b=_+1}let w=-s*this.dim,T=-c*this.dim;for(let P=_;P<b;P++)for(let z=f;z<y;z++)this.data[this._idx(z,P)]=e.data[this._idx(z+w,P+T)]}}at("DEMData",eg);class tg{constructor(e){this._stringToNumber={},this._numberToString=[];for(let s=0;s<e.length;s++){let c=e[s];this._stringToNumber[c]=s,this._numberToString[s]=c}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class rg{constructor(e,s,c,f,y){this.type="Feature",this._vectorTileFeature=e,e._z=s,e._x=c,e._y=f,this.properties=e.properties,this.id=y}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let s in this)s!=="_geometry"&&s!=="_vectorTileFeature"&&(e[s]=this[s]);return e}}class ig{constructor(e,s){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Ws(Xr,16,0),this.grid3D=new Ws(Xr,16,0),this.featureIndexArray=new Rt,this.promoteId=s}insert(e,s,c,f,y,_){let b=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(c,f,y);let w=_?this.grid3D:this.grid;for(let T=0;T<s.length;T++){let P=s[T],z=[1/0,1/0,-1/0,-1/0];for(let L=0;L<P.length;L++){let N=P[L];z[0]=Math.min(z[0],N.x),z[1]=Math.min(z[1],N.y),z[2]=Math.max(z[2],N.x),z[3]=Math.max(z[3],N.y)}z[0]<Xr&&z[1]<Xr&&z[2]>=0&&z[3]>=0&&w.insert(b,z[0],z[1],z[2],z[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new us.VectorTile(new Bd(this.rawTileData)).layers,this.sourceLayerCoder=new tg(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,s,c,f){this.loadVTLayers();let y=e.params||{},_=Xr/e.tileSize/e.scale,b=Ma(y.filter),w=e.queryGeometry,T=e.queryPadding*_,P=og(w),z=this.grid.query(P.minX-T,P.minY-T,P.maxX+T,P.maxY+T),L=og(e.cameraQueryGeometry),N=this.grid3D.query(L.minX-T,L.minY-T,L.maxX+T,L.maxY+T,(X,ae,me,se)=>function(pe,Ae,Ce,ot,ht){for(let Ke of pe)if(Ae<=Ke.x&&Ce<=Ke.y&&ot>=Ke.x&&ht>=Ke.y)return!0;let Ye=[new st(Ae,Ce),new st(Ae,ht),new st(ot,ht),new st(ot,Ce)];if(pe.length>2){for(let Ke of Ye)if(Na(pe,Ke))return!0}for(let Ke=0;Ke<pe.length-1;Ke++)if(Xb(pe[Ke],pe[Ke+1],Ye))return!0;return!1}(e.cameraQueryGeometry,X-T,ae-T,me+T,se+T));for(let X of N)z.push(X);z.sort(w1);let j={},J;for(let X=0;X<z.length;X++){let ae=z[X];if(ae===J)continue;J=ae;let me=this.featureIndexArray.get(ae),se=null;this.loadMatchingFeature(j,me.bucketIndex,me.sourceLayerIndex,me.featureIndex,b,y.layers,y.availableImages,s,c,f,(pe,Ae,Ce)=>(se||(se=Qs(pe)),Ae.queryIntersectsFeature(w,pe,Ce,se,this.z,e.transform,_,e.pixelPosMatrix)))}return j}loadMatchingFeature(e,s,c,f,y,_,b,w,T,P,z){let L=this.bucketLayerIDs[s];if(_&&!function(X,ae){for(let me=0;me<X.length;me++)if(ae.indexOf(X[me])>=0)return!0;return!1}(_,L))return;let N=this.sourceLayerCoder.decode(c),j=this.vtLayers[N].feature(f);if(y.needGeometry){let X=ea(j,!0);if(!y.filter(new Ir(this.tileID.overscaledZ),X,this.tileID.canonical))return}else if(!y.filter(new Ir(this.tileID.overscaledZ),j))return;let J=this.getId(j,N);for(let X=0;X<L.length;X++){let ae=L[X];if(_&&_.indexOf(ae)<0)continue;let me=w[ae];if(!me)continue;let se={};J&&P&&(se=P.getState(me.sourceLayer||"_geojsonTileLayer",J));let pe=le({},T[ae]);pe.paint=ng(pe.paint,me.paint,j,se,b),pe.layout=ng(pe.layout,me.layout,j,se,b);let Ae=!z||z(j,me,se);if(!Ae)continue;let Ce=new rg(j,this.z,this.x,this.y,J);Ce.layer=pe;let ot=e[ae];ot===void 0&&(ot=e[ae]=[]),ot.push({featureIndex:f,feature:Ce,intersectionZ:Ae})}}lookupSymbolFeatures(e,s,c,f,y,_,b,w){let T={};this.loadVTLayers();let P=Ma(y);for(let z of e)this.loadMatchingFeature(T,c,f,z,P,_,b,w,s);return T}hasLayer(e){for(let s of this.bucketLayerIDs)for(let c of s)if(e===c)return!0;return!1}getId(e,s){let c=e.id;return this.promoteId&&(c=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[s]],typeof c=="boolean"&&(c=Number(c))),c}}function ng(i,e,s,c,f){return Oe(i,(y,_)=>{let b=e instanceof Js?e.get(_):null;return b&&b.evaluate?b.evaluate(s,c,f):b})}function og(i){let e=1/0,s=1/0,c=-1/0,f=-1/0;for(let y of i)e=Math.min(e,y.x),s=Math.min(s,y.y),c=Math.max(c,y.x),f=Math.max(f,y.y);return{minX:e,minY:s,maxX:c,maxY:f}}function w1(i,e){return e-i}var Yd;at("FeatureIndex",ig,{omit:["rawTileData","sourceLayerCoder"]}),a.PerformanceMarkers=void 0,(Yd=a.PerformanceMarkers||(a.PerformanceMarkers={})).create="create",Yd.load="load",Yd.fullLoad="fullLoad";let Lh=null,Pu=[],Qd=1e3/30,E1={mark(i){performance.mark(i)},frame(i){let e=i;Lh!=null&&Pu.push(e-Lh),Lh=e},clearMetrics(){Lh=null,Pu=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(let i in a.PerformanceMarkers)performance.clearMarks(a.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure("loadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.load),performance.measure("fullLoadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.fullLoad);let i=performance.getEntriesByName("loadTime")[0].duration,e=performance.getEntriesByName("fullLoadTime")[0].duration,s=Pu.length,c=1/(Pu.reduce((y,_)=>y+_,0)/s/1e3),f=Pu.filter(y=>y>Qd).reduce((y,_)=>y+(_-Qd)/Qd,0);return{loadTime:i,fullLoadTime:e,fps:c,percentDroppedFrames:f/(s+f)*100}}};a.AJAXError=er,a.ARRAY_TYPE=Fi,a.Actor=class{constructor(i,e,s){this.target=i,this.parent=e,this.mapId=s,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},$e(["receive","process"],this),this.invoker=new x1(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=je()?i:window}send(i,e,s,c,f=!1){let y=Math.round(1e18*Math.random()).toString(36).substring(0,10);s&&(this.callbacks[y]=s);let _=Br(this.globalScope)?void 0:[];return this.target.postMessage({id:y,type:i,hasCallback:!!s,targetMapId:c,mustQueue:f,sourceMapId:this.mapId,data:Mo(e,_)},_),{cancel:()=>{s&&delete this.callbacks[y],this.target.postMessage({id:y,type:"<cancel>",targetMapId:c,sourceMapId:this.mapId})}}}receive(i){let e=i.data,s=e.id;if(s&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type==="<cancel>"){delete this.tasks[s];let c=this.cancelCallbacks[s];delete this.cancelCallbacks[s],c&&c()}else je()||e.mustQueue?(this.tasks[s]=e,this.taskQueue.push(s),this.invoker.trigger()):this.processTask(s,e)}process(){if(!this.taskQueue.length)return;let i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type==="<response>"){let s=this.callbacks[i];delete this.callbacks[i],s&&(e.error?s(ho(e.error)):s(null,ho(e.data)))}else{let s=!1,c=Br(this.globalScope)?void 0:[],f=e.hasCallback?(b,w)=>{s=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"<response>",sourceMapId:this.mapId,error:b?Mo(b):null,data:Mo(w,c)},c)}:b=>{s=!0},y=null,_=ho(e.data);if(this.parent[e.type])y=this.parent[e.type](e.sourceMapId,_,f);else if(this.parent.getWorkerSource){let b=e.type.split(".");y=this.parent.getWorkerSource(e.sourceMapId,b[0],_.source)[b[1]](_,f)}else f(new Error(`Could not find function ${e.type}`));!s&&y&&y.cancel&&(this.cancelCallbacks[i]=y.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.AlphaImage=bu,a.CanonicalTileID=Jd,a.CollisionBoxArray=Ee,a.CollisionCircleLayoutArray=class extends M{},a.Color=$,a.DEMData=eg,a.DataConstantProperty=ft,a.DictionaryCoder=tg,a.EXTENT=Xr,a.ErrorEvent=kn,a.EvaluationParameters=Ir,a.Event=pn,a.Evented=dn,a.FeatureIndex=ig,a.FillBucket=Dd,a.FillExtrusionBucket=Rd,a.GeoJSONFeature=rg,a.ImageAtlas=Ay,a.ImagePosition=jd,a.LineBucket=Ld,a.LineStripIndexArray=class extends W{},a.LngLat=Vr,a.LngLatBounds=ra,a.MercatorCoordinate=Rh,a.ONE_EM=ui,a.OverscaledTileID=_n,a.PerformanceUtils=E1,a.PosArray=gt,a.Properties=li,a.QuadTriangleArray=class extends B{},a.RGBAImage=gn,a.RasterBoundsArray=class extends d{},a.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},a.ResourceType=Dr,a.SegmentVector=jt,a.SymbolBucket=Za,a.Transitionable=ph,a.TriangleIndexArray=Oi,a.Uniform1f=Fo,a.Uniform1i=class extends Do{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends Do{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},a.Uniform3f=class extends Do{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},a.Uniform4f=La,a.UniformColor=$m,a.UniformMatrix4f=class extends Do{constructor(i,e){super(i,e),this.current=qb}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},a.UnwrappedTileID=Qy,a.ValidationError=Ge,a.ZoomHistory=ou,a.add=function(i,e,s){return i[0]=e[0]+s[0],i[1]=e[1]+s[1],i[2]=e[2]+s[2],i},a.addDynamicAttributes=Gd,a.asyncAll=function(i,e,s){if(!i.length)return s(null,[]);let c=i.length,f=new Array(i.length),y=null;i.forEach((_,b)=>{e(_,(w,T)=>{w&&(y=w),f[b]=T,--c==0&&s(y,f)})})},a.bezier=D,a.bindAll=$e,a.cacheEntryPossiblyAdded=function(i){lt++,lt>He&&(i.getActor().send("enforceCacheSizeLimit",Be),lt=0)},a.clamp=I,a.clearTileCache=function(i){let e=caches.delete(ye);i&&e.catch(i).then(()=>i())},a.clipLine=Ny,a.clone=function(i){var e=new Fi(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},a.clone$1=fe,a.clone$2=function(i){var e=new Fi(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e},a.collisionCircleLayout=Vx,a.config=Er,a.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},a.create=function(){var i=new Fi(16);return Fi!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},a.create$1=Jm,a.createExpression=Ls,a.createFilter=Ma,a.createLayout=qr,a.createStyleLayer=function(i){return i.type==="custom"?new v1(i):new b1[i.type](i)},a.cross=function(i,e,s){var c=e[0],f=e[1],y=e[2],_=s[0],b=s[1],w=s[2];return i[0]=f*w-y*b,i[1]=y*_-c*w,i[2]=c*b-f*_,i},a.dot=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]},a.dot$1=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},a.ease=R,a.emitValidationErrors=Oa,a.enforceCacheSizeLimit=function(i){ut(),Fe&&Fe.then(e=>{e.keys().then(s=>{for(let c=0;c<s.length-i;c++)e.delete(s[c])})})},a.equals=function(i,e){var s=i[0],c=i[1],f=i[2],y=i[3],_=i[4],b=i[5],w=i[6],T=i[7],P=i[8],z=i[9],L=i[10],N=i[11],j=i[12],J=i[13],X=i[14],ae=i[15],me=e[0],se=e[1],pe=e[2],Ae=e[3],Ce=e[4],ot=e[5],ht=e[6],Ye=e[7],Ke=e[8],Ve=e[9],Qe=e[10],Xe=e[11],Re=e[12],_t=e[13],mt=e[14],Lt=e[15];return Math.abs(s-me)<=Di*Math.max(1,Math.abs(s),Math.abs(me))&&Math.abs(c-se)<=Di*Math.max(1,Math.abs(c),Math.abs(se))&&Math.abs(f-pe)<=Di*Math.max(1,Math.abs(f),Math.abs(pe))&&Math.abs(y-Ae)<=Di*Math.max(1,Math.abs(y),Math.abs(Ae))&&Math.abs(_-Ce)<=Di*Math.max(1,Math.abs(_),Math.abs(Ce))&&Math.abs(b-ot)<=Di*Math.max(1,Math.abs(b),Math.abs(ot))&&Math.abs(w-ht)<=Di*Math.max(1,Math.abs(w),Math.abs(ht))&&Math.abs(T-Ye)<=Di*Math.max(1,Math.abs(T),Math.abs(Ye))&&Math.abs(P-Ke)<=Di*Math.max(1,Math.abs(P),Math.abs(Ke))&&Math.abs(z-Ve)<=Di*Math.max(1,Math.abs(z),Math.abs(Ve))&&Math.abs(L-Qe)<=Di*Math.max(1,Math.abs(L),Math.abs(Qe))&&Math.abs(N-Xe)<=Di*Math.max(1,Math.abs(N),Math.abs(Xe))&&Math.abs(j-Re)<=Di*Math.max(1,Math.abs(j),Math.abs(Re))&&Math.abs(J-_t)<=Di*Math.max(1,Math.abs(J),Math.abs(_t))&&Math.abs(X-mt)<=Di*Math.max(1,Math.abs(X),Math.abs(mt))&&Math.abs(ae-Lt)<=Di*Math.max(1,Math.abs(ae),Math.abs(Lt))},a.evaluateSizeForFeature=function(i,{uSize:e,uSizeT:s},{lowerSize:c,upperSize:f}){return i.kind==="source"?c/Bo:i.kind==="composite"?Ar(c/Bo,f/Bo,s):e},a.evaluateSizeForZoom=function(i,e){let s=0,c=0;if(i.kind==="constant")c=i.layoutSize;else if(i.kind!=="source"){let{interpolationType:f,minZoom:y,maxZoom:_}=i,b=f?I(ji.interpolationFactor(f,e,y,_),0,1):0;i.kind==="camera"?c=Ar(i.minSize,i.maxSize,b):s=b}return{uSizeT:s,uSize:c}},a.evaluateVariableOffset=Uy,a.evented=pu,a.exported=It,a.exported$1=yt,a.extend=le,a.filterObject=De,a.fromRotation=function(i,e){var s=Math.sin(e),c=Math.cos(e);return i[0]=c,i[1]=s,i[2]=0,i[3]=-s,i[4]=c,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},a.fromScaling=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},a.getAnchorAlignment=Ud,a.getAnchorJustification=qd,a.getArrayBuffer=Kr,a.getImage=Ji,a.getJSON=function(i,e){return Nr(le(i,{type:"json"}),e)},a.getOverlapMode=Xd,a.getRTLTextPluginStatus=Xs,a.getReferrer=Fr,a.getVideo=function(i,e){let s=window.document.createElement("video");s.muted=!0,s.onloadstart=function(){e(null,s)};for(let c=0;c<i.length;c++){let f=window.document.createElement("source");Pi(i[c])||(s.crossOrigin="Anonymous"),f.src=i[c],s.appendChild(f)}return{cancel:()=>{}}},a.identity=Td,a.invert=function(i,e){var s=e[0],c=e[1],f=e[2],y=e[3],_=e[4],b=e[5],w=e[6],T=e[7],P=e[8],z=e[9],L=e[10],N=e[11],j=e[12],J=e[13],X=e[14],ae=e[15],me=s*b-c*_,se=s*w-f*_,pe=s*T-y*_,Ae=c*w-f*b,Ce=c*T-y*b,ot=f*T-y*w,ht=P*J-z*j,Ye=P*X-L*j,Ke=P*ae-N*j,Ve=z*X-L*J,Qe=z*ae-N*J,Xe=L*ae-N*X,Re=me*Xe-se*Qe+pe*Ve+Ae*Ke-Ce*Ye+ot*ht;return Re?(i[0]=(b*Xe-w*Qe+T*Ve)*(Re=1/Re),i[1]=(f*Qe-c*Xe-y*Ve)*Re,i[2]=(J*ot-X*Ce+ae*Ae)*Re,i[3]=(L*Ce-z*ot-N*Ae)*Re,i[4]=(w*Ke-_*Xe-T*Ye)*Re,i[5]=(s*Xe-f*Ke+y*Ye)*Re,i[6]=(X*pe-j*ot-ae*se)*Re,i[7]=(P*ot-L*pe+N*se)*Re,i[8]=(_*Qe-b*Ke+T*ht)*Re,i[9]=(c*Ke-s*Qe-y*ht)*Re,i[10]=(j*Ce-J*pe+ae*me)*Re,i[11]=(z*pe-P*Ce-N*me)*Re,i[12]=(b*Ye-_*Ve-w*ht)*Re,i[13]=(s*Ve-c*Ye+f*ht)*Re,i[14]=(J*se-j*Ae-X*me)*Re,i[15]=(P*Ae-z*se+L*me)*Re,i):null},a.isImageBitmap=wr,a.isSafari=Br,a.isWorker=je,a.keysDifference=function(i,e){let s=[];for(let c in i)c in e||s.push(c);return s},a.lazyLoadRTLTextPlugin=function(){Yi.isLoading()||Yi.isLoaded()||Xs()!=="deferred"||hh()},a.makeRequest=Nr,a.mapObject=Oe,a.mercatorXfromLng=Xy,a.mercatorYfromLat=Hy,a.mercatorZfromAltitude=Jy,a.mul=Yb,a.mul$1=function(i,e,s){return i[0]=e[0]*s[0],i[1]=e[1]*s[1],i[2]=e[2]*s[2],i[3]=e[3]*s[3],i},a.multiply=Ym,a.nextPowerOfTwo=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},a.normalize=function(i,e){var s=e[0],c=e[1],f=e[2],y=s*s+c*c+f*f;return y>0&&(y=1/Math.sqrt(y)),i[0]=e[0]*y,i[1]=e[1]*y,i[2]=e[2]*y,i},a.number=Ar,a.ortho=function(i,e,s,c,f,y,_){var b=1/(e-s),w=1/(c-f),T=1/(y-_);return i[0]=-2*b,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*w,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*T,i[11]=0,i[12]=(e+s)*b,i[13]=(f+c)*w,i[14]=(_+y)*T,i[15]=1,i},a.parseCacheControl=Bt,a.parseGlyphPbf=function(i){return new Bd(i).readFields(Yx,[])},a.pbf=Bd,a.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Xr/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;let e=i.bucket.layers[0].layout,s=i.bucket.layers[0]._unevaluatedLayout._values,c={layoutIconSize:s["icon-size"].possiblyEvaluate(new Ir(i.bucket.zoom+1),i.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new Ir(i.bucket.zoom+1),i.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new Ir(18))};if(i.bucket.textSizeData.kind==="composite"){let{minZoom:w,maxZoom:T}=i.bucket.textSizeData;c.compositeTextSizes=[s["text-size"].possiblyEvaluate(new Ir(w),i.canonical),s["text-size"].possiblyEvaluate(new Ir(T),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){let{minZoom:w,maxZoom:T}=i.bucket.iconSizeData;c.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new Ir(w),i.canonical),s["icon-size"].possiblyEvaluate(new Ir(T),i.canonical)]}let f=e.get("text-line-height")*ui,y=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",_=e.get("text-keep-upright"),b=e.get("text-size");for(let w of i.bucket.features){let T=e.get("text-font").evaluate(w,{},i.canonical).join(","),P=b.evaluate(w,{},i.canonical),z=c.layoutTextSize.evaluate(w,{},i.canonical),L=c.layoutIconSize.evaluate(w,{},i.canonical),N={horizontal:{},vertical:void 0},j=w.text,J,X=[0,0];if(j){let se=j.toString(),pe=e.get("text-letter-spacing").evaluate(w,{},i.canonical)*ui,Ae=gd(se)?pe:0,Ce=e.get("text-anchor").evaluate(w,{},i.canonical),ot=e.get("text-variable-anchor");if(!ot){let Qe=e.get("text-radial-offset").evaluate(w,{},i.canonical);X=Qe?Uy(Ce,[Qe*ui,$d]):e.get("text-offset").evaluate(w,{},i.canonical).map(Xe=>Xe*ui)}let ht=y?"center":e.get("text-justify").evaluate(w,{},i.canonical),Ye=e.get("symbol-placement"),Ke=Ye==="point"?e.get("text-max-width").evaluate(w,{},i.canonical)*ui:0,Ve=()=>{i.bucket.allowVerticalPlacement&&Da(se)&&(N.vertical=kh(j,i.glyphMap,i.glyphPositions,i.imagePositions,T,Ke,f,Ce,"left",Ae,X,a.WritingMode.vertical,!0,Ye,z,P))};if(!y&&ot){let Qe=ht==="auto"?ot.map(Re=>qd(Re)):[ht],Xe=!1;for(let Re=0;Re<Qe.length;Re++){let _t=Qe[Re];if(!N.horizontal[_t])if(Xe)N.horizontal[_t]=N.horizontal[0];else{let mt=kh(j,i.glyphMap,i.glyphPositions,i.imagePositions,T,Ke,f,"center",_t,Ae,X,a.WritingMode.horizontal,!1,Ye,z,P);mt&&(N.horizontal[_t]=mt,Xe=mt.positionedLines.length===1)}}Ve()}else{ht==="auto"&&(ht=qd(Ce));let Qe=kh(j,i.glyphMap,i.glyphPositions,i.imagePositions,T,Ke,f,Ce,ht,Ae,X,a.WritingMode.horizontal,!1,Ye,z,P);Qe&&(N.horizontal[ht]=Qe),Ve(),Da(se)&&y&&_&&(N.vertical=kh(j,i.glyphMap,i.glyphPositions,i.imagePositions,T,Ke,f,Ce,ht,Ae,X,a.WritingMode.vertical,!1,Ye,z,P))}}let ae=!1;if(w.icon&&w.icon.name){let se=i.imageMap[w.icon.name];se&&(J=n1(i.imagePositions[w.icon.name],e.get("icon-offset").evaluate(w,{},i.canonical),e.get("icon-anchor").evaluate(w,{},i.canonical)),ae=!!se.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=ae:i.bucket.sdfIcons!==ae&&Ie("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(se.pixelRatio!==i.bucket.pixelRatio||e.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}let me=qy(N.horizontal)||N.vertical;i.bucket.iconsInText=!!me&&me.iconsInText,(me||J)&&h1(i.bucket,w,N,J,i.imageMap,c,z,L,X,ae,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},a.perspective=function(i,e,s,c,f){var y,_=1/Math.tan(e/2);return i[0]=_/s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,f!=null&&f!==1/0?(i[10]=(f+c)*(y=1/(c-f)),i[14]=2*f*c*y):(i[10]=-1,i[14]=-2*c),i},a.pick=function(i,e){let s={};for(let c=0;c<e.length;c++){let f=e[c];f in i&&(s[f]=i[f])}return s},a.plugin=Yi,a.pointGeometry=st,a.polygonIntersectsPolygon=Km,a.potpack=Cy,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.register=at,a.registerForPluginStateChange=function(i){return i({pluginStatus:zi,pluginURL:po}),pu.on("pluginStateChange",i),i},a.renderColorRamp=oy,a.rotateX=function(i,e,s){var c=Math.sin(s),f=Math.cos(s),y=e[4],_=e[5],b=e[6],w=e[7],T=e[8],P=e[9],z=e[10],L=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=y*f+T*c,i[5]=_*f+P*c,i[6]=b*f+z*c,i[7]=w*f+L*c,i[8]=T*f-y*c,i[9]=P*f-_*c,i[10]=z*f-b*c,i[11]=L*f-w*c,i},a.rotateZ=function(i,e,s){var c=Math.sin(s),f=Math.cos(s),y=e[0],_=e[1],b=e[2],w=e[3],T=e[4],P=e[5],z=e[6],L=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=y*f+T*c,i[1]=_*f+P*c,i[2]=b*f+z*c,i[3]=w*f+L*c,i[4]=T*f-y*c,i[5]=P*f-_*c,i[6]=z*f-b*c,i[7]=L*f-w*c,i},a.scale=function(i,e,s){var c=s[0],f=s[1],y=s[2];return i[0]=e[0]*c,i[1]=e[1]*c,i[2]=e[2]*c,i[3]=e[3]*c,i[4]=e[4]*f,i[5]=e[5]*f,i[6]=e[6]*f,i[7]=e[7]*f,i[8]=e[8]*y,i[9]=e[9]*y,i[10]=e[10]*y,i[11]=e[11]*y,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},a.scale$1=function(i,e,s){return i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s,i},a.setCacheLimits=function(i,e){Be=i,He=e},a.setRTLTextPlugin=function(i,e,s=!1){if(zi===lu||zi===uu||zi===cu)throw new Error("setRTLTextPlugin cannot be called multiple times.");po=It.resolveURL(i),zi=lu,hu=e,os(),s||hh()},a.spec=Se,a.sphericalToCartesian=function([i,e,s]){return e+=90,e*=Math.PI/180,s*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(s),y:i*Math.sin(e)*Math.sin(s),z:i*Math.cos(s)}},a.sqrLen=function(i){var e=i[0],s=i[1];return e*e+s*s},a.sub=function(i,e,s){return i[0]=e[0]-s[0],i[1]=e[1]-s[1],i[2]=e[2]-s[2],i},a.toEvaluationFeature=ea,a.transformMat3=function(i,e,s){var c=e[0],f=e[1],y=e[2];return i[0]=c*s[0]+f*s[3]+y*s[6],i[1]=c*s[1]+f*s[4]+y*s[7],i[2]=c*s[2]+f*s[5]+y*s[8],i},a.transformMat4=bh,a.transformMat4$1=function(i,e,s){var c=e[0],f=e[1];return i[0]=s[0]*c+s[4]*f+s[12],i[1]=s[1]*c+s[5]*f+s[13],i},a.translate=function(i,e,s){var c,f,y,_,b,w,T,P,z,L,N,j,J=s[0],X=s[1],ae=s[2];return e===i?(i[12]=e[0]*J+e[4]*X+e[8]*ae+e[12],i[13]=e[1]*J+e[5]*X+e[9]*ae+e[13],i[14]=e[2]*J+e[6]*X+e[10]*ae+e[14],i[15]=e[3]*J+e[7]*X+e[11]*ae+e[15]):(f=e[1],y=e[2],_=e[3],b=e[4],w=e[5],T=e[6],P=e[7],z=e[8],L=e[9],N=e[10],j=e[11],i[0]=c=e[0],i[1]=f,i[2]=y,i[3]=_,i[4]=b,i[5]=w,i[6]=T,i[7]=P,i[8]=z,i[9]=L,i[10]=N,i[11]=j,i[12]=c*J+b*X+z*ae+e[12],i[13]=f*J+w*X+L*ae+e[13],i[14]=y*J+T*X+N*ae+e[14],i[15]=_*J+P*X+j*ae+e[15]),i},a.triggerPluginCompletionEvent=ch,a.unicodeBlockLookup=Je,a.uniqueId=function(){return _e++},a.validateCustomStyleLayer=function(i){let e=[],s=i.id;return s===void 0&&e.push({message:`layers.${s}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${s}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${s}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateLight=nu,a.validateStyle=Ks,a.vectorTile=us,a.warnOnce=Ie,a.wrap=ee}),u(["./shared"],function(a){"use strict";function x(q){let k=typeof q;if(k==="number"||k==="boolean"||k==="string"||q==null)return JSON.stringify(q);if(Array.isArray(q)){let $="[";for(let Y of q)$+=`${x(Y)},`;return`${$}]`}let O=Object.keys(q).sort(),V="{";for(let $=0;$<O.length;$++)V+=`${JSON.stringify(O[$])}:${x(q[O[$]])},`;return`${V}}`}function C(q){let k="";for(let O of a.refProperties)k+=`/${x(q[O])}`;return k}class D{constructor(k){this.keyCache={},k&&this.replace(k)}replace(k){this._layerConfigs={},this._layers={},this.update(k,[])}update(k,O){for(let $ of k){this._layerConfigs[$.id]=$;let Y=this._layers[$.id]=a.createStyleLayer($);Y._featureFilter=a.createFilter(Y.filter),this.keyCache[$.id]&&delete this.keyCache[$.id]}for(let $ of O)delete this.keyCache[$],delete this._layerConfigs[$],delete this._layers[$];this.familiesBySource={};let V=function($,Y){let ie={};for(let Q=0;Q<$.length;Q++){let ne=Y&&Y[$[Q].id]||C($[Q]);Y&&(Y[$[Q].id]=ne);let be=ie[ne];be||(be=ie[ne]=[]),be.push($[Q])}let te=[];for(let Q in ie)te.push(ie[Q]);return te}(Object.values(this._layerConfigs),this.keyCache);for(let $ of V){let Y=$.map(Me=>this._layers[Me.id]),ie=Y[0];if(ie.visibility==="none")continue;let te=ie.source||"",Q=this.familiesBySource[te];Q||(Q=this.familiesBySource[te]={});let ne=ie.sourceLayer||"_geojsonTileLayer",be=Q[ne];be||(be=Q[ne]=[]),be.push(Y)}}}class R{constructor(k){let O={},V=[];for(let te in k){let Q=k[te],ne=O[te]={};for(let be in Q){let Me=Q[+be];if(!Me||Me.bitmap.width===0||Me.bitmap.height===0)continue;let ge={x:0,y:0,w:Me.bitmap.width+2,h:Me.bitmap.height+2};V.push(ge),ne[be]={rect:ge,metrics:Me.metrics}}}let{w:$,h:Y}=a.potpack(V),ie=new a.AlphaImage({width:$||1,height:Y||1});for(let te in k){let Q=k[te];for(let ne in Q){let be=Q[+ne];if(!be||be.bitmap.width===0||be.bitmap.height===0)continue;let Me=O[te][ne].rect;a.AlphaImage.copy(be.bitmap,ie,{x:0,y:0},{x:Me.x+1,y:Me.y+1},be.bitmap)}}this.image=ie,this.positions=O}}a.register("GlyphAtlas",R);class I{constructor(k){this.tileID=new a.OverscaledTileID(k.tileID.overscaledZ,k.tileID.wrap,k.tileID.canonical.z,k.tileID.canonical.x,k.tileID.canonical.y),this.uid=k.uid,this.zoom=k.zoom,this.pixelRatio=k.pixelRatio,this.tileSize=k.tileSize,this.source=k.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=k.showCollisionBoxes,this.collectResourceTiming=!!k.collectResourceTiming,this.returnDependencies=!!k.returnDependencies,this.promoteId=k.promoteId}parse(k,O,V,$,Y){this.status="parsing",this.data=k,this.collisionBoxArray=new a.CollisionBoxArray;let ie=new a.DictionaryCoder(Object.keys(k.layers).sort()),te=new a.FeatureIndex(this.tileID,this.promoteId);te.bucketLayerIDs=[];let Q={},ne={featureIndex:te,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:V},be=O.familiesBySource[this.source];for(let Ct in be){let Ft=k.layers[Ct];if(!Ft)continue;Ft.version===1&&a.warnOnce(`Vector tile source "${this.source}" layer "${Ct}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Jt=ie.encode(Ct),mr=[];for(let Qr=0;Qr<Ft.length;Qr++){let Cr=Ft.feature(Qr),mi=te.getId(Cr,Ct);mr.push({feature:Cr,id:mi,index:Qr,sourceLayerIndex:Jt})}for(let Qr of be[Ct]){let Cr=Qr[0];Cr.source!==this.source&&a.warnOnce(`layer.source = ${Cr.source} does not equal this.source = ${this.source}`),Cr.minzoom&&this.zoom<Math.floor(Cr.minzoom)||Cr.maxzoom&&this.zoom>=Cr.maxzoom||Cr.visibility!=="none"&&(ee(Qr,this.zoom,V),(Q[Cr.id]=Cr.createBucket({index:te.bucketLayerIDs.length,layers:Qr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Jt,sourceID:this.source})).populate(mr,ne,this.tileID.canonical),te.bucketLayerIDs.push(Qr.map(mi=>mi.id)))}}let Me,ge,ct,dt,et=a.mapObject(ne.glyphDependencies,Ct=>Object.keys(Ct).map(Number));Object.keys(et).length?$.send("getGlyphs",{uid:this.uid,stacks:et},(Ct,Ft)=>{Me||(Me=Ct,ge=Ft,Ht.call(this))}):ge={};let bt=Object.keys(ne.iconDependencies);bt.length?$.send("getImages",{icons:bt,source:this.source,tileID:this.tileID,type:"icons"},(Ct,Ft)=>{Me||(Me=Ct,ct=Ft,Ht.call(this))}):ct={};let St=Object.keys(ne.patternDependencies);function Ht(){if(Me)return Y(Me);if(ge&&ct&&dt){let Ct=new R(ge),Ft=new a.ImageAtlas(ct,dt);for(let Jt in Q){let mr=Q[Jt];mr instanceof a.SymbolBucket?(ee(mr.layers,this.zoom,V),a.performSymbolLayout({bucket:mr,glyphMap:ge,glyphPositions:Ct.positions,imageMap:ct,imagePositions:Ft.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):mr.hasPattern&&(mr instanceof a.LineBucket||mr instanceof a.FillBucket||mr instanceof a.FillExtrusionBucket)&&(ee(mr.layers,this.zoom,V),mr.addFeatures(ne,this.tileID.canonical,Ft.patternPositions))}this.status="done",Y(null,{buckets:Object.values(Q).filter(Jt=>!Jt.isEmpty()),featureIndex:te,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ct.image,imageAtlas:Ft,glyphMap:this.returnDependencies?ge:null,iconMap:this.returnDependencies?ct:null,glyphPositions:this.returnDependencies?Ct.positions:null})}}St.length?$.send("getImages",{icons:St,source:this.source,tileID:this.tileID,type:"patterns"},(Ct,Ft)=>{Me||(Me=Ct,dt=Ft,Ht.call(this))}):dt={},Ht.call(this)}}function ee(q,k,O){let V=new a.EvaluationParameters(k);for(let $ of q)$.recalculate(V,O)}function le(q,k){let O=a.getArrayBuffer(q.request,(V,$,Y,ie)=>{V?k(V):$&&k(null,{vectorTile:new a.vectorTile.VectorTile(new a.pbf($)),rawData:$,cacheControl:Y,expires:ie})});return()=>{O.cancel(),k()}}class _e{constructor(k,O,V,$){this.actor=k,this.layerIndex=O,this.availableImages=V,this.loadVectorData=$||le,this.loading={},this.loaded={}}loadTile(k,O){let V=k.uid;this.loading||(this.loading={});let $=!!(k&&k.request&&k.request.collectResourceTiming)&&new a.RequestPerformance(k.request),Y=this.loading[V]=new I(k);Y.abort=this.loadVectorData(k,(ie,te)=>{if(delete this.loading[V],ie||!te)return Y.status="done",this.loaded[V]=Y,O(ie);let Q=te.rawData,ne={};te.expires&&(ne.expires=te.expires),te.cacheControl&&(ne.cacheControl=te.cacheControl);let be={};if($){let Me=$.finish();Me&&(be.resourceTiming=JSON.parse(JSON.stringify(Me)))}Y.vectorTile=te.vectorTile,Y.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor,(Me,ge)=>{if(Me||!ge)return O(Me);O(null,a.extend({rawTileData:Q.slice(0)},ge,ne,be))}),this.loaded=this.loaded||{},this.loaded[V]=Y})}reloadTile(k,O){let V=this.loaded,$=k.uid,Y=this;if(V&&V[$]){let ie=V[$];ie.showCollisionBoxes=k.showCollisionBoxes;let te=(Q,ne)=>{let be=ie.reloadCallback;be&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,Y.layerIndex,this.availableImages,Y.actor,be)),O(Q,ne)};ie.status==="parsing"?ie.reloadCallback=te:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,te):te())}}abortTile(k,O){let V=this.loading,$=k.uid;V&&V[$]&&V[$].abort&&(V[$].abort(),delete V[$]),O()}removeTile(k,O){let V=this.loaded,$=k.uid;V&&V[$]&&delete V[$],O()}}class $e{constructor(){this.loaded={}}loadTile(k,O){let{uid:V,encoding:$,rawImageData:Y}=k,ie=a.isImageBitmap(Y)?this.getImageData(Y):Y,te=new a.DEMData(V,ie,$);this.loaded=this.loaded||{},this.loaded[V]=te,O(null,te)}getImageData(k){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(k.width,k.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=k.width,this.offscreenCanvas.height=k.height,this.offscreenCanvasContext.drawImage(k,0,0,k.width,k.height);let O=this.offscreenCanvasContext.getImageData(-1,-1,k.width+2,k.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new a.RGBAImage({width:O.width,height:O.height},O.data)}removeTile(k){let O=this.loaded,V=k.uid;O&&O[V]&&delete O[V]}}var Oe=function q(k,O){var V,$=k&&k.type;if($==="FeatureCollection")for(V=0;V<k.features.length;V++)q(k.features[V],O);else if($==="GeometryCollection")for(V=0;V<k.geometries.length;V++)q(k.geometries[V],O);else if($==="Feature")q(k.geometry,O);else if($==="Polygon")De(k.coordinates,O);else if($==="MultiPolygon")for(V=0;V<k.coordinates.length;V++)De(k.coordinates[V],O);return k};function De(q,k){if(q.length!==0){fe(q[0],k);for(var O=1;O<q.length;O++)fe(q[O],!k)}}function fe(q,k){for(var O=0,V=0,$=0,Y=q.length,ie=Y-1;$<Y;ie=$++){var te=(q[$][0]-q[ie][0])*(q[ie][1]+q[$][1]),Q=O+te;V+=Math.abs(O)>=Math.abs(te)?O-Q+te:te-Q+O,O=Q}O+V>=0!=!!k&&q.reverse()}let ve=a.vectorTile.VectorTileFeature.prototype.toGeoJSON;class Ie{constructor(k){this._feature=k,this.extent=a.EXTENT,this.type=k.type,this.properties=k.tags,"id"in k&&!isNaN(k.id)&&(this.id=parseInt(k.id,10))}loadGeometry(){if(this._feature.type===1){let k=[];for(let O of this._feature.geometry)k.push([new a.pointGeometry(O[0],O[1])]);return k}{let k=[];for(let O of this._feature.geometry){let V=[];for(let $ of O)V.push(new a.pointGeometry($[0],$[1]));k.push(V)}return k}}toGeoJSON(k,O,V){return ve.call(this,k,O,V)}}class We{constructor(k){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=k.length,this._features=k}feature(k){return new Ie(this._features[k])}}var Pe={exports:{}},je=a.pointGeometry,Bt=a.vectorTile.VectorTileFeature,vt=Qt;function Qt(q,k){this.options=k||{},this.features=q,this.length=q.length}function tr(q,k){this.id=typeof q.id=="number"?q.id:void 0,this.type=q.type,this.rawGeometry=q.type===1?[q.geometry]:q.geometry,this.properties=q.tags,this.extent=k||4096}Qt.prototype.feature=function(q){return new tr(this.features[q],this.options.extent)},tr.prototype.loadGeometry=function(){var q=this.rawGeometry;this.geometry=[];for(var k=0;k<q.length;k++){for(var O=q[k],V=[],$=0;$<O.length;$++)V.push(new je(O[$][0],O[$][1]));this.geometry.push(V)}return this.geometry},tr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var q=this.geometry,k=1/0,O=-1/0,V=1/0,$=-1/0,Y=0;Y<q.length;Y++)for(var ie=q[Y],te=0;te<ie.length;te++){var Q=ie[te];k=Math.min(k,Q.x),O=Math.max(O,Q.x),V=Math.min(V,Q.y),$=Math.max($,Q.y)}return[k,V,O,$]},tr.prototype.toGeoJSON=Bt.prototype.toGeoJSON;var Br=a.pbf,wr=vt;function It(q){var k=new Br;return function(O,V){for(var $ in O.layers)V.writeMessage(3,st,O.layers[$])}(q,k),k.finish()}function st(q,k){var O;k.writeVarintField(15,q.version||1),k.writeStringField(1,q.name||""),k.writeVarintField(5,q.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(O=0;O<q.length;O++)V.feature=q.feature(O),k.writeMessage(2,Or,V);var $=V.keys;for(O=0;O<$.length;O++)k.writeStringField(3,$[O]);var Y=V.values;for(O=0;O<Y.length;O++)k.writeMessage(4,Be,Y[O])}function Or(q,k){var O=q.feature;O.id!==void 0&&k.writeVarintField(1,O.id),k.writeMessage(2,Er,q),k.writeVarintField(3,O.type),k.writeMessage(4,Ue,O)}function Er(q,k){var O=q.feature,V=q.keys,$=q.values,Y=q.keycache,ie=q.valuecache;for(var te in O.properties){var Q=O.properties[te],ne=Y[te];if(Q!==null){ne===void 0&&(V.push(te),Y[te]=ne=V.length-1),k.writeVarint(ne);var be=typeof Q;be!=="string"&&be!=="boolean"&&be!=="number"&&(Q=JSON.stringify(Q));var Me=be+":"+Q,ge=ie[Me];ge===void 0&&($.push(Q),ie[Me]=ge=$.length-1),k.writeVarint(ge)}}}function ye(q,k){return(k<<3)+(7&q)}function Fe(q){return q<<1^q>>31}function Ue(q,k){for(var O=q.loadGeometry(),V=q.type,$=0,Y=0,ie=O.length,te=0;te<ie;te++){var Q=O[te],ne=1;V===1&&(ne=Q.length),k.writeVarint(ye(1,ne));for(var be=V===3?Q.length-1:Q.length,Me=0;Me<be;Me++){Me===1&&V!==1&&k.writeVarint(ye(2,be-1));var ge=Q[Me].x-$,ct=Q[Me].y-Y;k.writeVarint(Fe(ge)),k.writeVarint(Fe(ct)),$+=ge,Y+=ct}V===3&&k.writeVarint(ye(7,1))}}function Be(q,k){var O=typeof q;O==="string"?k.writeStringField(1,q):O==="boolean"?k.writeBooleanField(7,q):O==="number"&&(q%1!=0?k.writeDoubleField(3,q):q<0?k.writeSVarintField(6,q):k.writeVarintField(5,q))}function He(q,k,O,V,$,Y){if($-V<=O)return;let ie=V+$>>1;ut(q,k,ie,V,$,Y%2),He(q,k,O,V,ie-1,Y+1),He(q,k,O,ie+1,$,Y+1)}function ut(q,k,O,V,$,Y){for(;$>V;){if($-V>600){let ne=$-V+1,be=O-V+1,Me=Math.log(ne),ge=.5*Math.exp(2*Me/3),ct=.5*Math.sqrt(Me*ge*(ne-ge)/ne)*(be-ne/2<0?-1:1);ut(q,k,O,Math.max(V,Math.floor(O-be*ge/ne+ct)),Math.min($,Math.floor(O+(ne-be)*ge/ne+ct)),Y)}let ie=k[2*O+Y],te=V,Q=$;for(lt(q,k,V,O),k[2*$+Y]>ie&&lt(q,k,V,$);te<Q;){for(lt(q,k,te,Q),te++,Q--;k[2*te+Y]<ie;)te++;for(;k[2*Q+Y]>ie;)Q--}k[2*V+Y]===ie?lt(q,k,V,Q):(Q++,lt(q,k,Q,$)),Q<=O&&(V=Q+1),O<=Q&&($=Q-1)}}function lt(q,k,O,V){yt(q,O,V),yt(k,2*O,2*V),yt(k,2*O+1,2*V+1)}function yt(q,k,O){let V=q[k];q[k]=q[O],q[O]=V}function wt(q,k,O,V){let $=q-O,Y=k-V;return $*$+Y*Y}Pe.exports=It,Pe.exports.fromVectorTileJs=It,Pe.exports.fromGeojsonVt=function(q,k){k=k||{};var O={};for(var V in q)O[V]=new wr(q[V].features,k),O[V].name=V,O[V].version=k.version,O[V].extent=k.extent;return It({layers:O})},Pe.exports.GeoJSONWrapper=wr;let Nt=q=>q[0],Dt=q=>q[1];class nr{constructor(k,O=Nt,V=Dt,$=64,Y=Float64Array){this.nodeSize=$,this.points=k;let ie=k.length<65536?Uint16Array:Uint32Array,te=this.ids=new ie(k.length),Q=this.coords=new Y(2*k.length);for(let ne=0;ne<k.length;ne++)te[ne]=ne,Q[2*ne]=O(k[ne]),Q[2*ne+1]=V(k[ne]);He(te,Q,$,0,te.length-1,0)}range(k,O,V,$){return function(Y,ie,te,Q,ne,be,Me){let ge=[0,Y.length-1,0],ct=[],dt,et;for(;ge.length;){let bt=ge.pop(),St=ge.pop(),Ht=ge.pop();if(St-Ht<=Me){for(let Jt=Ht;Jt<=St;Jt++)dt=ie[2*Jt],et=ie[2*Jt+1],dt>=te&&dt<=ne&&et>=Q&&et<=be&&ct.push(Y[Jt]);continue}let Ct=Math.floor((Ht+St)/2);dt=ie[2*Ct],et=ie[2*Ct+1],dt>=te&&dt<=ne&&et>=Q&&et<=be&&ct.push(Y[Ct]);let Ft=(bt+1)%2;(bt===0?te<=dt:Q<=et)&&(ge.push(Ht),ge.push(Ct-1),ge.push(Ft)),(bt===0?ne>=dt:be>=et)&&(ge.push(Ct+1),ge.push(St),ge.push(Ft))}return ct}(this.ids,this.coords,k,O,V,$,this.nodeSize)}within(k,O,V){return function($,Y,ie,te,Q,ne){let be=[0,$.length-1,0],Me=[],ge=Q*Q;for(;be.length;){let ct=be.pop(),dt=be.pop(),et=be.pop();if(dt-et<=ne){for(let Ft=et;Ft<=dt;Ft++)wt(Y[2*Ft],Y[2*Ft+1],ie,te)<=ge&&Me.push($[Ft]);continue}let bt=Math.floor((et+dt)/2),St=Y[2*bt],Ht=Y[2*bt+1];wt(St,Ht,ie,te)<=ge&&Me.push($[bt]);let Ct=(ct+1)%2;(ct===0?ie-Q<=St:te-Q<=Ht)&&(be.push(et),be.push(bt-1),be.push(Ct)),(ct===0?ie+Q>=St:te+Q>=Ht)&&(be.push(bt+1),be.push(dt),be.push(Ct))}return Me}(this.ids,this.coords,k,O,V,this.nodeSize)}}let or={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:q=>q},Dr=Math.fround||(er=new Float32Array(1),q=>(er[0]=+q,er[0]));var er;class Fr{constructor(k){this.options=Ji(Object.create(or),k),this.trees=new Array(this.options.maxZoom+1)}load(k){let{log:O,minZoom:V,maxZoom:$,nodeSize:Y}=this.options;O&&console.time("total time");let ie=`prepare ${k.length} points`;O&&console.time(ie),this.points=k;let te=[];for(let Q=0;Q<k.length;Q++)k[Q].geometry&&te.push(Nr(k[Q],Q));this.trees[$+1]=new nr(te,cn,hn,Y,Float32Array),O&&console.timeEnd(ie);for(let Q=$;Q>=V;Q--){let ne=+Date.now();te=this._cluster(te,Q),this.trees[Q]=new nr(te,cn,hn,Y,Float32Array),O&&console.log("z%d: %d clusters in %dms",Q,te.length,+Date.now()-ne)}return O&&console.timeEnd("total time"),this}getClusters(k,O){let V=((k[0]+180)%360+360)%360-180,$=Math.max(-90,Math.min(90,k[1])),Y=k[2]===180?180:((k[2]+180)%360+360)%360-180,ie=Math.max(-90,Math.min(90,k[3]));if(k[2]-k[0]>=360)V=-180,Y=180;else if(V>Y){let be=this.getClusters([V,$,180,ie],O),Me=this.getClusters([-180,$,Y,ie],O);return be.concat(Me)}let te=this.trees[this._limitZoom(O)],Q=te.range(qt(V),wi(ie),qt(Y),wi($)),ne=[];for(let be of Q){let Me=te.points[be];ne.push(Me.numPoints?Kr(Me):this.points[Me.index])}return ne}getChildren(k){let O=this._getOriginId(k),V=this._getOriginZoom(k),$="No cluster with the specified id.",Y=this.trees[V];if(!Y)throw new Error($);let ie=Y.points[O];if(!ie)throw new Error($);let te=this.options.radius/(this.options.extent*Math.pow(2,V-1)),Q=Y.within(ie.x,ie.y,te),ne=[];for(let be of Q){let Me=Y.points[be];Me.parentId===k&&ne.push(Me.numPoints?Kr(Me):this.points[Me.index])}if(ne.length===0)throw new Error($);return ne}getLeaves(k,O,V){let $=[];return this._appendLeaves($,k,O=O||10,V=V||0,0),$}getTile(k,O,V){let $=this.trees[this._limitZoom(k)],Y=Math.pow(2,k),{extent:ie,radius:te}=this.options,Q=te/ie,ne=(V-Q)/Y,be=(V+1+Q)/Y,Me={features:[]};return this._addTileFeatures($.range((O-Q)/Y,ne,(O+1+Q)/Y,be),$.points,O,V,Y,Me),O===0&&this._addTileFeatures($.range(1-Q/Y,ne,1,be),$.points,Y,V,Y,Me),O===Y-1&&this._addTileFeatures($.range(0,ne,Q/Y,be),$.points,-1,V,Y,Me),Me.features.length?Me:null}getClusterExpansionZoom(k){let O=this._getOriginZoom(k)-1;for(;O<=this.options.maxZoom;){let V=this.getChildren(k);if(O++,V.length!==1)break;k=V[0].properties.cluster_id}return O}_appendLeaves(k,O,V,$,Y){let ie=this.getChildren(O);for(let te of ie){let Q=te.properties;if(Q&&Q.cluster?Y+Q.point_count<=$?Y+=Q.point_count:Y=this._appendLeaves(k,Q.cluster_id,V,$,Y):Y<$?Y++:k.push(te),k.length===V)break}return Y}_addTileFeatures(k,O,V,$,Y,ie){for(let te of k){let Q=O[te],ne=Q.numPoints,be,Me,ge;if(ne)be=Pi(Q),Me=Q.x,ge=Q.y;else{let et=this.points[Q.index];be=et.properties,Me=qt(et.geometry.coordinates[0]),ge=wi(et.geometry.coordinates[1])}let ct={type:1,geometry:[[Math.round(this.options.extent*(Me*Y-V)),Math.round(this.options.extent*(ge*Y-$))]],tags:be},dt;ne?dt=Q.id:this.options.generateId?dt=Q.index:this.points[Q.index].id&&(dt=this.points[Q.index].id),dt!==void 0&&(ct.id=dt),ie.features.push(ct)}}_limitZoom(k){return Math.max(this.options.minZoom,Math.min(Math.floor(+k),this.options.maxZoom+1))}_cluster(k,O){let V=[],{radius:$,extent:Y,reduce:ie,minPoints:te}=this.options,Q=$/(Y*Math.pow(2,O));for(let ne=0;ne<k.length;ne++){let be=k[ne];if(be.zoom<=O)continue;be.zoom=O;let Me=this.trees[O+1],ge=Me.within(be.x,be.y,Q),ct=be.numPoints||1,dt=ct;for(let et of ge){let bt=Me.points[et];bt.zoom>O&&(dt+=bt.numPoints||1)}if(dt>ct&&dt>=te){let et=be.x*ct,bt=be.y*ct,St=ie&&ct>1?this._map(be,!0):null,Ht=(ne<<5)+(O+1)+this.points.length;for(let Ct of ge){let Ft=Me.points[Ct];if(Ft.zoom<=O)continue;Ft.zoom=O;let Jt=Ft.numPoints||1;et+=Ft.x*Jt,bt+=Ft.y*Jt,Ft.parentId=Ht,ie&&(St||(St=this._map(be,!0)),ie(St,this._map(Ft)))}be.parentId=Ht,V.push(hr(et/dt,bt/dt,Ht,dt,St))}else if(V.push(be),dt>1)for(let et of ge){let bt=Me.points[et];bt.zoom<=O||(bt.zoom=O,V.push(bt))}}return V}_getOriginId(k){return k-this.points.length>>5}_getOriginZoom(k){return(k-this.points.length)%32}_map(k,O){if(k.numPoints)return O?Ji({},k.properties):k.properties;let V=this.points[k.index].properties,$=this.options.map(V);return O&&$===V?Ji({},$):$}}function hr(q,k,O,V,$){return{x:Dr(q),y:Dr(k),zoom:1/0,id:O,parentId:-1,numPoints:V,properties:$}}function Nr(q,k){let[O,V]=q.geometry.coordinates;return{x:Dr(qt(O)),y:Dr(wi(V)),zoom:1/0,index:k,parentId:-1}}function Kr(q){return{type:"Feature",id:q.id,properties:Pi(q),geometry:{type:"Point",coordinates:[(k=q.x,360*(k-.5)),un(q.y)]}};var k}function Pi(q){let k=q.numPoints,O=k>=1e4?`${Math.round(k/1e3)}k`:k>=1e3?Math.round(k/100)/10+"k":k;return Ji(Ji({},q.properties),{cluster:!0,cluster_id:q.id,point_count:k,point_count_abbreviated:O})}function qt(q){return q/360+.5}function wi(q){let k=Math.sin(q*Math.PI/180),O=.5-.25*Math.log((1+k)/(1-k))/Math.PI;return O<0?0:O>1?1:O}function un(q){let k=(180-360*q)*Math.PI/180;return 360*Math.atan(Math.exp(k))/Math.PI-90}function Ji(q,k){for(let O in k)q[O]=k[O];return q}function cn(q){return q.x}function hn(q){return q.y}function pn(q,k,O,V){for(var $,Y=V,ie=O-k>>1,te=O-k,Q=q[k],ne=q[k+1],be=q[O],Me=q[O+1],ge=k+3;ge<O;ge+=3){var ct=kn(q[ge],q[ge+1],Q,ne,be,Me);if(ct>Y)$=ge,Y=ct;else if(ct===Y){var dt=Math.abs(ge-ie);dt<te&&($=ge,te=dt)}}Y>V&&($-k>3&&pn(q,k,$,V),q[$+2]=Y,O-$>3&&pn(q,$,O,V))}function kn(q,k,O,V,$,Y){var ie=$-O,te=Y-V;if(ie!==0||te!==0){var Q=((q-O)*ie+(k-V)*te)/(ie*ie+te*te);Q>1?(O=$,V=Y):Q>0&&(O+=ie*Q,V+=te*Q)}return(ie=q-O)*ie+(te=k-V)*te}function dn(q,k,O,V){var $={id:q===void 0?null:q,type:k,geometry:O,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Y){var ie=Y.geometry,te=Y.type;if(te==="Point"||te==="MultiPoint"||te==="LineString")Se(Y,ie);else if(te==="Polygon"||te==="MultiLineString")for(var Q=0;Q<ie.length;Q++)Se(Y,ie[Q]);else if(te==="MultiPolygon")for(Q=0;Q<ie.length;Q++)for(var ne=0;ne<ie[Q].length;ne++)Se(Y,ie[Q][ne])}($),$}function Se(q,k){for(var O=0;O<k.length;O+=3)q.minX=Math.min(q.minX,k[O]),q.minY=Math.min(q.minY,k[O+1]),q.maxX=Math.max(q.maxX,k[O]),q.maxY=Math.max(q.maxY,k[O+1])}function Ge(q,k,O,V){if(k.geometry){var $=k.geometry.coordinates,Y=k.geometry.type,ie=Math.pow(O.tolerance/((1<<O.maxZoom)*O.extent),2),te=[],Q=k.id;if(O.promoteId?Q=k.properties[O.promoteId]:O.generateId&&(Q=V||0),Y==="Point")qn($,te);else if(Y==="MultiPoint")for(var ne=0;ne<$.length;ne++)qn($[ne],te);else if(Y==="LineString")Ni($,te,ie,!1);else if(Y==="MultiLineString"){if(O.lineMetrics){for(ne=0;ne<$.length;ne++)Ni($[ne],te=[],ie,!1),q.push(dn(Q,"LineString",te,k.properties));return}Zt($,te,ie,!1)}else if(Y==="Polygon")Zt($,te,ie,!0);else{if(Y!=="MultiPolygon"){if(Y==="GeometryCollection"){for(ne=0;ne<k.geometry.geometries.length;ne++)Ge(q,{id:Q,geometry:k.geometry.geometries[ne],properties:k.properties},O,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<$.length;ne++){var be=[];Zt($[ne],be,ie,!0),te.push(be)}}q.push(dn(Q,Y,te,k.properties))}}function qn(q,k){k.push(Ei(q[0])),k.push(pi(q[1])),k.push(0)}function Ni(q,k,O,V){for(var $,Y,ie=0,te=0;te<q.length;te++){var Q=Ei(q[te][0]),ne=pi(q[te][1]);k.push(Q),k.push(ne),k.push(0),te>0&&(ie+=V?($*ne-Q*Y)/2:Math.sqrt(Math.pow(Q-$,2)+Math.pow(ne-Y,2))),$=Q,Y=ne}var be=k.length-3;k[2]=1,pn(k,0,be,O),k[be+2]=1,k.size=Math.abs(ie),k.start=0,k.end=k.size}function Zt(q,k,O,V){for(var $=0;$<q.length;$++){var Y=[];Ni(q[$],Y,O,V),k.push(Y)}}function Ei(q){return q/360+.5}function pi(q){var k=Math.sin(q*Math.PI/180),O=.5-.25*Math.log((1+k)/(1-k))/Math.PI;return O<0?0:O>1?1:O}function di(q,k,O,V,$,Y,ie,te){if(V/=k,Y>=(O/=k)&&ie<V)return q;if(ie<O||Y>=V)return null;for(var Q=[],ne=0;ne<q.length;ne++){var be=q[ne],Me=be.geometry,ge=be.type,ct=$===0?be.minX:be.minY,dt=$===0?be.maxX:be.maxY;if(ct>=O&&dt<V)Q.push(be);else if(!(dt<O||ct>=V)){var et=[];if(ge==="Point"||ge==="MultiPoint")fn(Me,et,O,V,$);else if(ge==="LineString")qe(Me,et,O,V,$,!1,te.lineMetrics);else if(ge==="MultiLineString")H(Me,et,O,V,$,!1);else if(ge==="Polygon")H(Me,et,O,V,$,!0);else if(ge==="MultiPolygon")for(var bt=0;bt<Me.length;bt++){var St=[];H(Me[bt],St,O,V,$,!0),St.length&&et.push(St)}if(et.length){if(te.lineMetrics&&ge==="LineString"){for(bt=0;bt<et.length;bt++)Q.push(dn(be.id,ge,et[bt],be.tags));continue}ge!=="LineString"&&ge!=="MultiLineString"||(et.length===1?(ge="LineString",et=et[0]):ge="MultiLineString"),ge!=="Point"&&ge!=="MultiPoint"||(ge=et.length===3?"Point":"MultiPoint"),Q.push(dn(be.id,ge,et,be.tags))}}}return Q.length?Q:null}function fn(q,k,O,V,$){for(var Y=0;Y<q.length;Y+=3){var ie=q[Y+$];ie>=O&&ie<=V&&(k.push(q[Y]),k.push(q[Y+1]),k.push(q[Y+2]))}}function qe(q,k,O,V,$,Y,ie){for(var te,Q,ne=U(q),be=$===0?ke:we,Me=q.start,ge=0;ge<q.length-3;ge+=3){var ct=q[ge],dt=q[ge+1],et=q[ge+2],bt=q[ge+3],St=q[ge+4],Ht=$===0?ct:dt,Ct=$===0?bt:St,Ft=!1;ie&&(te=Math.sqrt(Math.pow(ct-bt,2)+Math.pow(dt-St,2))),Ht<O?Ct>O&&(Q=be(ne,ct,dt,bt,St,O),ie&&(ne.start=Me+te*Q)):Ht>V?Ct<V&&(Q=be(ne,ct,dt,bt,St,V),ie&&(ne.start=Me+te*Q)):he(ne,ct,dt,et),Ct<O&&Ht>=O&&(Q=be(ne,ct,dt,bt,St,O),Ft=!0),Ct>V&&Ht<=V&&(Q=be(ne,ct,dt,bt,St,V),Ft=!0),!Y&&Ft&&(ie&&(ne.end=Me+te*Q),k.push(ne),ne=U(q)),ie&&(Me+=te)}var Jt=q.length-3;ct=q[Jt],dt=q[Jt+1],et=q[Jt+2],(Ht=$===0?ct:dt)>=O&&Ht<=V&&he(ne,ct,dt,et),Jt=ne.length-3,Y&&Jt>=3&&(ne[Jt]!==ne[0]||ne[Jt+1]!==ne[1])&&he(ne,ne[0],ne[1],ne[2]),ne.length&&k.push(ne)}function U(q){var k=[];return k.size=q.size,k.start=q.start,k.end=q.end,k}function H(q,k,O,V,$,Y){for(var ie=0;ie<q.length;ie++)qe(q[ie],k,O,V,$,Y,!1)}function he(q,k,O,V){q.push(k),q.push(O),q.push(V)}function ke(q,k,O,V,$,Y){var ie=(Y-k)/(V-k);return q.push(Y),q.push(O+($-O)*ie),q.push(1),ie}function we(q,k,O,V,$,Y){var ie=(Y-O)/($-O);return q.push(k+(V-k)*ie),q.push(Y),q.push(1),ie}function Ne(q,k){for(var O=[],V=0;V<q.length;V++){var $,Y=q[V],ie=Y.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")$=Le(Y.geometry,k);else if(ie==="MultiLineString"||ie==="Polygon"){$=[];for(var te=0;te<Y.geometry.length;te++)$.push(Le(Y.geometry[te],k))}else if(ie==="MultiPolygon")for($=[],te=0;te<Y.geometry.length;te++){for(var Q=[],ne=0;ne<Y.geometry[te].length;ne++)Q.push(Le(Y.geometry[te][ne],k));$.push(Q)}O.push(dn(Y.id,ie,$,Y.tags))}return O}function Le(q,k){var O=[];O.size=q.size,q.start!==void 0&&(O.start=q.start,O.end=q.end);for(var V=0;V<q.length;V+=3)O.push(q[V]+k,q[V+1],q[V+2]);return O}function Tt(q,k){if(q.transformed)return q;var O,V,$,Y=1<<q.z,ie=q.x,te=q.y;for(O=0;O<q.features.length;O++){var Q=q.features[O],ne=Q.geometry,be=Q.type;if(Q.geometry=[],be===1)for(V=0;V<ne.length;V+=2)Q.geometry.push(Pt(ne[V],ne[V+1],k,Y,ie,te));else for(V=0;V<ne.length;V++){var Me=[];for($=0;$<ne[V].length;$+=2)Me.push(Pt(ne[V][$],ne[V][$+1],k,Y,ie,te));Q.geometry.push(Me)}}return q.transformed=!0,q}function Pt(q,k,O,V,$,Y){return[Math.round(O*(q*V-$)),Math.round(O*(k*V-Y))]}function lr(q,k,O,V,$){for(var Y=k===$.maxZoom?0:$.tolerance/((1<<k)*$.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:O,y:V,z:k,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},te=0;te<q.length;te++){ie.numFeatures++,At(ie,q[te],Y,$);var Q=q[te].minX,ne=q[te].minY,be=q[te].maxX,Me=q[te].maxY;Q<ie.minX&&(ie.minX=Q),ne<ie.minY&&(ie.minY=ne),be>ie.maxX&&(ie.maxX=be),Me>ie.maxY&&(ie.maxY=Me)}return ie}function At(q,k,O,V){var $=k.geometry,Y=k.type,ie=[];if(Y==="Point"||Y==="MultiPoint")for(var te=0;te<$.length;te+=3)ie.push($[te]),ie.push($[te+1]),q.numPoints++,q.numSimplified++;else if(Y==="LineString")fi(ie,$,q,O,!1,!1);else if(Y==="MultiLineString"||Y==="Polygon")for(te=0;te<$.length;te++)fi(ie,$[te],q,O,Y==="Polygon",te===0);else if(Y==="MultiPolygon")for(var Q=0;Q<$.length;Q++){var ne=$[Q];for(te=0;te<ne.length;te++)fi(ie,ne[te],q,O,!0,te===0)}if(ie.length){var be=k.tags||null;if(Y==="LineString"&&V.lineMetrics){for(var Me in be={},k.tags)be[Me]=k.tags[Me];be.mapbox_clip_start=$.start/$.size,be.mapbox_clip_end=$.end/$.size}var ge={geometry:ie,type:Y==="Polygon"||Y==="MultiPolygon"?3:Y==="LineString"||Y==="MultiLineString"?2:1,tags:be};k.id!==null&&(ge.id=k.id),q.features.push(ge)}}function fi(q,k,O,V,$,Y){var ie=V*V;if(V>0&&k.size<($?ie:V))O.numPoints+=k.length/3;else{for(var te=[],Q=0;Q<k.length;Q+=3)(V===0||k[Q+2]>ie)&&(O.numSimplified++,te.push(k[Q]),te.push(k[Q+1])),O.numPoints++;$&&function(ne,be){for(var Me=0,ge=0,ct=ne.length,dt=ct-2;ge<ct;dt=ge,ge+=2)Me+=(ne[ge]-ne[dt])*(ne[ge+1]+ne[dt+1]);if(Me>0===be)for(ge=0,ct=ne.length;ge<ct/2;ge+=2){var et=ne[ge],bt=ne[ge+1];ne[ge]=ne[ct-2-ge],ne[ge+1]=ne[ct-1-ge],ne[ct-2-ge]=et,ne[ct-1-ge]=bt}}(te,Y),q.push(te)}}function Rr(q,k){var O=(k=this.options=function($,Y){for(var ie in Y)$[ie]=Y[ie];return $}(Object.create(this.options),k)).debug;if(O&&console.time("preprocess data"),k.maxZoom<0||k.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(k.promoteId&&k.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=function($,Y){var ie=[];if($.type==="FeatureCollection")for(var te=0;te<$.features.length;te++)Ge(ie,$.features[te],Y,te);else Ge(ie,$.type==="Feature"?$:{geometry:$},Y);return ie}(q,k);this.tiles={},this.tileCoords=[],O&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",k.indexMaxZoom,k.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),V=function($,Y){var ie=Y.buffer/Y.extent,te=$,Q=di($,1,-1-ie,ie,0,-1,2,Y),ne=di($,1,1-ie,2+ie,0,-1,2,Y);return(Q||ne)&&(te=di($,1,-ie,1+ie,0,-1,2,Y)||[],Q&&(te=Ne(Q,1).concat(te)),ne&&(te=te.concat(Ne(ne,-1)))),te}(V,k),V.length&&this.splitTile(V,0,0,0),O&&(V.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)))}function ai(q,k,O){return 32*((1<<q)*O+k)+q}function Mi(q,k){let O=q.tileID.canonical;if(!this._geoJSONIndex)return k(null,null);let V=this._geoJSONIndex.getTile(O.z,O.x,O.y);if(!V)return k(null,null);let $=new We(V.features),Y=Pe.exports($);Y.byteOffset===0&&Y.byteLength===Y.buffer.byteLength||(Y=new Uint8Array(Y)),k(null,{vectorTile:$,rawData:Y.buffer})}Rr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Rr.prototype.splitTile=function(q,k,O,V,$,Y,ie){for(var te=[q,k,O,V],Q=this.options,ne=Q.debug;te.length;){V=te.pop(),O=te.pop(),k=te.pop(),q=te.pop();var be=1<<k,Me=ai(k,O,V),ge=this.tiles[Me];if(!ge&&(ne>1&&console.time("creation"),ge=this.tiles[Me]=lr(q,k,O,V,Q),this.tileCoords.push({z:k,x:O,y:V}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",k,O,V,ge.numFeatures,ge.numPoints,ge.numSimplified),console.timeEnd("creation"));var ct="z"+k;this.stats[ct]=(this.stats[ct]||0)+1,this.total++}if(ge.source=q,$){if(k===Q.maxZoom||k===$)continue;var dt=1<<$-k;if(O!==Math.floor(Y/dt)||V!==Math.floor(ie/dt))continue}else if(k===Q.indexMaxZoom||ge.numPoints<=Q.indexMaxPoints)continue;if(ge.source=null,q.length!==0){ne>1&&console.time("clipping");var et,bt,St,Ht,Ct,Ft,Jt=.5*Q.buffer/Q.extent,mr=.5-Jt,Qr=.5+Jt,Cr=1+Jt;et=bt=St=Ht=null,Ct=di(q,be,O-Jt,O+Qr,0,ge.minX,ge.maxX,Q),Ft=di(q,be,O+mr,O+Cr,0,ge.minX,ge.maxX,Q),q=null,Ct&&(et=di(Ct,be,V-Jt,V+Qr,1,ge.minY,ge.maxY,Q),bt=di(Ct,be,V+mr,V+Cr,1,ge.minY,ge.maxY,Q),Ct=null),Ft&&(St=di(Ft,be,V-Jt,V+Qr,1,ge.minY,ge.maxY,Q),Ht=di(Ft,be,V+mr,V+Cr,1,ge.minY,ge.maxY,Q),Ft=null),ne>1&&console.timeEnd("clipping"),te.push(et||[],k+1,2*O,2*V),te.push(bt||[],k+1,2*O,2*V+1),te.push(St||[],k+1,2*O+1,2*V),te.push(Ht||[],k+1,2*O+1,2*V+1)}}},Rr.prototype.getTile=function(q,k,O){var V=this.options,$=V.extent,Y=V.debug;if(q<0||q>24)return null;var ie=1<<q,te=ai(q,k=(k%ie+ie)%ie,O);if(this.tiles[te])return Tt(this.tiles[te],$);Y>1&&console.log("drilling down to z%d-%d-%d",q,k,O);for(var Q,ne=q,be=k,Me=O;!Q&&ne>0;)ne--,be=Math.floor(be/2),Me=Math.floor(Me/2),Q=this.tiles[ai(ne,be,Me)];return Q&&Q.source?(Y>1&&console.log("found parent tile z%d-%d-%d",ne,be,Me),Y>1&&console.time("drilling down"),this.splitTile(Q.source,ne,be,Me,q,k,O),Y>1&&console.timeEnd("drilling down"),this.tiles[te]?Tt(this.tiles[te],$):null):null};class uo extends _e{constructor(k,O,V,$){super(k,O,V,Mi),$&&(this.loadGeoJSON=$)}loadData(k,O){var V;(V=this._pendingRequest)===null||V===void 0||V.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let $=!!(k&&k.request&&k.request.collectResourceTiming)&&new a.RequestPerformance(k.request);this._pendingCallback=O,this._pendingRequest=this.loadGeoJSON(k,(Y,ie)=>{if(delete this._pendingCallback,delete this._pendingRequest,Y||!ie)return O(Y);if(typeof ie!="object")return O(new Error(`Input data given to '${k.source}' is not a valid GeoJSON object.`));{Oe(ie,!0);try{if(k.filter){let Q=a.createExpression(k.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(be=>`${be.key}: ${be.message}`).join(", "));let ne=ie.features.filter(be=>Q.value.evaluate({zoom:0},be));ie={type:"FeatureCollection",features:ne}}this._geoJSONIndex=k.cluster?new Fr(function({superclusterOptions:Q,clusterProperties:ne}){if(!ne||!Q)return Q;let be={},Me={},ge={accumulated:null,zoom:0},ct={properties:null},dt=Object.keys(ne);for(let et of dt){let[bt,St]=ne[et],Ht=a.createExpression(St),Ct=a.createExpression(typeof bt=="string"?[bt,["accumulated"],["get",et]]:bt);be[et]=Ht.value,Me[et]=Ct.value}return Q.map=et=>{ct.properties=et;let bt={};for(let St of dt)bt[St]=be[St].evaluate(ge,ct);return bt},Q.reduce=(et,bt)=>{ct.properties=bt;for(let St of dt)ge.accumulated=et[St],et[St]=Me[St].evaluate(ge,ct)},Q}(k)).load(ie.features):function(Q,ne){return new Rr(Q,ne)}(ie,k.geojsonVtOptions)}catch(Q){return O(Q)}this.loaded={};let te={};if($){let Q=$.finish();Q&&(te.resourceTiming={},te.resourceTiming[k.source]=JSON.parse(JSON.stringify(Q)))}O(null,te)}})}reloadTile(k,O){let V=this.loaded;return V&&V[k.uid]?super.reloadTile(k,O):this.loadTile(k,O)}loadGeoJSON(k,O){if(k.request)return a.getJSON(k.request,O);if(typeof k.data=="string")try{O(null,JSON.parse(k.data))}catch{O(new Error(`Input data given to '${k.source}' is not a valid GeoJSON object.`))}else O(new Error(`Input data given to '${k.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(k,O){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),O()}getClusterExpansionZoom(k,O){try{O(null,this._geoJSONIndex.getClusterExpansionZoom(k.clusterId))}catch(V){O(V)}}getClusterChildren(k,O){try{O(null,this._geoJSONIndex.getChildren(k.clusterId))}catch(V){O(V)}}getClusterLeaves(k,O){try{O(null,this._geoJSONIndex.getLeaves(k.clusterId,k.limit,k.offset))}catch(V){O(V)}}}class br{constructor(k){this.self=k,this.actor=new a.Actor(k,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:_e,geojson:uo},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(O,V)=>{if(this.workerSourceTypes[O])throw new Error(`Worker source with name "${O}" already registered.`);this.workerSourceTypes[O]=V},this.self.registerRTLTextPlugin=O=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=O.applyArabicShaping,a.plugin.processBidirectionalText=O.processBidirectionalText,a.plugin.processStyledBidirectionalText=O.processStyledBidirectionalText}}setReferrer(k,O){this.referrer=O}setImages(k,O,V){this.availableImages[k]=O;for(let $ in this.workerSources[k]){let Y=this.workerSources[k][$];for(let ie in Y)Y[ie].availableImages=O}V()}setLayers(k,O,V){this.getLayerIndex(k).replace(O),V()}updateLayers(k,O,V){this.getLayerIndex(k).update(O.layers,O.removedIds),V()}loadTile(k,O,V){this.getWorkerSource(k,O.type,O.source).loadTile(O,V)}loadDEMTile(k,O,V){this.getDEMWorkerSource(k,O.source).loadTile(O,V)}reloadTile(k,O,V){this.getWorkerSource(k,O.type,O.source).reloadTile(O,V)}abortTile(k,O,V){this.getWorkerSource(k,O.type,O.source).abortTile(O,V)}removeTile(k,O,V){this.getWorkerSource(k,O.type,O.source).removeTile(O,V)}removeDEMTile(k,O){this.getDEMWorkerSource(k,O.source).removeTile(O)}removeSource(k,O,V){if(!this.workerSources[k]||!this.workerSources[k][O.type]||!this.workerSources[k][O.type][O.source])return;let $=this.workerSources[k][O.type][O.source];delete this.workerSources[k][O.type][O.source],$.removeSource!==void 0?$.removeSource(O,V):V()}loadWorkerSource(k,O,V){try{this.self.importScripts(O.url),V()}catch($){V($.toString())}}syncRTLPluginState(k,O,V){try{a.plugin.setState(O);let $=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&$!=null){this.self.importScripts($);let Y=a.plugin.isParsed();V(Y?void 0:new Error(`RTL Text Plugin failed to import scripts from ${$}`),Y)}}catch($){V($.toString())}}getAvailableImages(k){let O=this.availableImages[k];return O||(O=[]),O}getLayerIndex(k){let O=this.layerIndexes[k];return O||(O=this.layerIndexes[k]=new D),O}getWorkerSource(k,O,V){if(this.workerSources[k]||(this.workerSources[k]={}),this.workerSources[k][O]||(this.workerSources[k][O]={}),!this.workerSources[k][O][V]){let $={send:(Y,ie,te)=>{this.actor.send(Y,ie,te,k)}};this.workerSources[k][O][V]=new this.workerSourceTypes[O]($,this.getLayerIndex(k),this.getAvailableImages(k))}return this.workerSources[k][O][V]}getDEMWorkerSource(k,O){return this.demWorkerSources[k]||(this.demWorkerSources[k]={}),this.demWorkerSources[k][O]||(this.demWorkerSources[k][O]=new $e),this.demWorkerSources[k][O]}enforceCacheSizeLimit(k,O){a.enforceCacheSizeLimit(O)}}return a.isWorker()&&(self.worker=new br(self)),br}),u(["./shared"],function(a){"use strict";var x=C;function C(d){return!function(t){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,m,g=new Blob([""],{type:"text/javascript"}),v=URL.createObjectURL(g);try{m=new Worker(v),h=!0}catch{h=!1}return m&&m.terminate(),URL.revokeObjectURL(v),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var m=h.getContext("2d");if(!m)return!1;var g=m.getImageData(0,0,1,1);return g&&g.width===h.width}()?(D[l=t&&t.failIfMajorPerformanceCaveat]===void 0&&(D[l]=function(h){var m,g=function(v){var E=document.createElement("canvas"),S=Object.create(C.webGLContextAttributes);return S.failIfMajorPerformanceCaveat=v,E.getContext("webgl",S)||E.getContext("experimental-webgl",S)}(h);if(!g)return!1;try{m=g.createShader(g.VERTEX_SHADER)}catch{return!1}return!(!m||g.isContextLost())&&(g.shaderSource(m,"void main() {}"),g.compileShader(m),g.getShaderParameter(m,g.COMPILE_STATUS)===!0)}(l)),D[l]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var l}(d)}var D={};function R(d,t){if(Array.isArray(d)){if(!Array.isArray(t)||d.length!==t.length)return!1;for(let l=0;l<d.length;l++)if(!R(d[l],t[l]))return!1;return!0}if(typeof d=="object"&&d!==null&&t!==null){if(typeof t!="object"||Object.keys(d).length!==Object.keys(t).length)return!1;for(let l in d)if(!R(d[l],t[l]))return!1;return!0}return d===t}C.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class I{static testProp(t){if(!I.docStyle)return t[0];for(let l=0;l<t.length;l++)if(t[l]in I.docStyle)return t[l];return t[0]}static create(t,l,h){let m=window.document.createElement(t);return l!==void 0&&(m.className=l),h&&h.appendChild(m),m}static createNS(t,l){return window.document.createElementNS(t,l)}static disableDrag(){I.docStyle&&I.selectProp&&(I.userSelect=I.docStyle[I.selectProp],I.docStyle[I.selectProp]="none")}static enableDrag(){I.docStyle&&I.selectProp&&(I.docStyle[I.selectProp]=I.userSelect)}static setTransform(t,l){t.style[I.transformProp]=l}static addEventListener(t,l,h,m={}){t.addEventListener(l,h,"passive"in m?m:m.capture)}static removeEventListener(t,l,h,m={}){t.removeEventListener(l,h,"passive"in m?m:m.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",I.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",I.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",I.suppressClickInternal,!0)},0)}static mousePos(t,l){let h=t.getBoundingClientRect();return new a.pointGeometry(l.clientX-h.left-t.clientLeft,l.clientY-h.top-t.clientTop)}static touchPos(t,l){let h=t.getBoundingClientRect(),m=[];for(let g=0;g<l.length;g++)m.push(new a.pointGeometry(l[g].clientX-h.left-t.clientLeft,l[g].clientY-h.top-t.clientTop));return m}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}I.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,I.selectProp=I.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),I.transformProp=I.testProp(["transform","WebkitTransform"]);class ee{constructor(t){this._transformRequestFn=t}transformRequest(t,l){return this._transformRequestFn&&this._transformRequestFn(t,l)||{url:t}}normalizeSpriteURL(t,l,h){let m=function(g){let v=g.match(le);if(!v)throw new Error(`Unable to parse URL "${g}"`);return{protocol:v[1],authority:v[2],path:v[3]||"/",params:v[4]?v[4].split("&"):[]}}(t);return m.path+=`${l}${h}`,function(g){let v=g.params.length?`?${g.params.join("&")}`:"";return`${g.protocol}://${g.authority}${g.path}${v}`}(m)}setTransformRequest(t){this._transformRequestFn=t}}let le=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;class _e{constructor(t,l,h,m){this.context=t,this.format=h,this.texture=t.gl.createTexture(),this.update(l,m)}update(t,l,h){let{width:m,height:g}=t,v=!(this.size&&this.size[0]===m&&this.size[1]===g||h),{context:E}=this,{gl:S}=E;if(this.useMipmap=Boolean(l&&l.useMipmap),S.bindTexture(S.TEXTURE_2D,this.texture),E.pixelStoreUnpackFlipY.set(!1),E.pixelStoreUnpack.set(1),E.pixelStoreUnpackPremultiplyAlpha.set(this.format===S.RGBA&&(!l||l.premultiply!==!1)),v)this.size=[m,g],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.isImageBitmap(t)?S.texImage2D(S.TEXTURE_2D,0,this.format,this.format,S.UNSIGNED_BYTE,t):S.texImage2D(S.TEXTURE_2D,0,this.format,m,g,0,this.format,S.UNSIGNED_BYTE,t.data);else{let{x:A,y:M}=h||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.isImageBitmap(t)?S.texSubImage2D(S.TEXTURE_2D,0,A,M,S.RGBA,S.UNSIGNED_BYTE,t):S.texSubImage2D(S.TEXTURE_2D,0,A,M,m,g,S.RGBA,S.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&S.generateMipmap(S.TEXTURE_2D)}bind(t,l,h){let{context:m}=this,{gl:g}=m;g.bindTexture(g.TEXTURE_2D,this.texture),h!==g.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(h=g.LINEAR),t!==this.filter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,t),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,h||t),this.filter=t),l!==this.wrap&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,l),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,l),this.wrap=l)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function $e(d){let{userImage:t}=d;return!!(t&&t.render&&t.render())&&(d.data.replace(new Uint8Array(t.data.buffer)),!0)}class Oe extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:l,callback:h}of this.requestors)this._notify(l,h);this.requestors=[]}}getImage(t){return this.images[t]}addImage(t,l){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,l)&&(this.images[t]=l)}_validate(t,l){let h=!0;return this._validateStretch(l.stretchX,l.data&&l.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),h=!1),this._validateStretch(l.stretchY,l.data&&l.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),h=!1),this._validateContent(l.content,l)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),h=!1),h}_validateStretch(t,l){if(!t)return!0;let h=0;for(let m of t){if(m[0]<h||m[1]<m[0]||l<m[1])return!1;h=m[1]}return!0}_validateContent(t,l){return!(t&&(t.length!==4||t[0]<0||l.data.width<t[0]||t[1]<0||l.data.height<t[1]||t[2]<0||l.data.width<t[2]||t[3]<0||l.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,l){let h=this.images[t];if(h.data.width!==l.data.width||h.data.height!==l.data.height)throw new Error(`size mismatch between old image (${h.data.width}x${h.data.height}) and new image (${l.data.width}x${l.data.height}).`);l.version=h.version+1,this.images[t]=l,this.updatedImages[t]=!0}removeImage(t){let l=this.images[t];delete this.images[t],delete this.patterns[t],l.userImage&&l.userImage.onRemove&&l.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,l){let h=!0;if(!this.isLoaded())for(let m of t)this.images[m]||(h=!1);this.isLoaded()||h?this._notify(t,l):this.requestors.push({ids:t,callback:l})}_notify(t,l){let h={};for(let m of t){this.images[m]||this.fire(new a.Event("styleimagemissing",{id:m}));let g=this.images[m];g?h[m]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,hasRenderCallback:Boolean(g.userImage&&g.userImage.render)}:a.warnOnce(`Image "${m}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}l(null,h)}getPixelSize(){let{width:t,height:l}=this.atlasImage;return{width:t,height:l}}getPattern(t){let l=this.patterns[t],h=this.getImage(t);if(!h)return null;if(l&&l.position.version===h.version)return l.position;if(l)l.position.version=h.version;else{let m={w:h.data.width+2,h:h.data.height+2,x:0,y:0},g=new a.ImagePosition(m,h);this.patterns[t]={bin:m,position:g}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let l=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _e(t,this.atlasImage,l.RGBA),this.atlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let g in this.patterns)t.push(this.patterns[g].bin);let{w:l,h}=a.potpack(t),m=this.atlasImage;m.resize({width:l||1,height:h||1});for(let g in this.patterns){let{bin:v}=this.patterns[g],E=v.x+1,S=v.y+1,A=this.images[g].data,M=A.width,F=A.height;a.RGBAImage.copy(A,m,{x:0,y:0},{x:E,y:S},{width:M,height:F}),a.RGBAImage.copy(A,m,{x:0,y:F-1},{x:E,y:S-1},{width:M,height:1}),a.RGBAImage.copy(A,m,{x:0,y:0},{x:E,y:S+F},{width:M,height:1}),a.RGBAImage.copy(A,m,{x:M-1,y:0},{x:E-1,y:S},{width:1,height:F}),a.RGBAImage.copy(A,m,{x:0,y:0},{x:E+M,y:S},{width:1,height:F})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let l of t){if(this.callbackDispatchedThisFrame[l])continue;this.callbackDispatchedThisFrame[l]=!0;let h=this.images[l];h||a.warnOnce(`Image with ID: "${l}" was not found`),$e(h)&&this.updateImage(l,h)}}}let De=1e20;function fe(d,t,l,h,m,g,v,E,S){for(let A=t;A<t+h;A++)ve(d,l*g+A,g,m,v,E,S);for(let A=l;A<l+m;A++)ve(d,A*g+t,1,h,v,E,S)}function ve(d,t,l,h,m,g,v){g[0]=0,v[0]=-De,v[1]=De,m[0]=d[t];for(let E=1,S=0,A=0;E<h;E++){m[E]=d[t+E*l];let M=E*E;do{let F=g[S];A=(m[E]-m[F]+M-F*F)/(E-F)/2}while(A<=v[S]&&--S>-1);S++,g[S]=E,v[S]=A,v[S+1]=De}for(let E=0,S=0;E<h;E++){for(;v[S+1]<E;)S++;let A=g[S],M=E-A;d[t+E*l]=m[A]+M*M}}class Ie{constructor(t,l){this.requestManager=t,this.localIdeographFontFamily=l,this.entries={}}setURL(t){this.url=t}getGlyphs(t,l){let h=[];for(let m in t)for(let g of t[m])h.push({stack:m,id:g});a.asyncAll(h,({stack:m,id:g},v)=>{let E=this.entries[m];E||(E=this.entries[m]={glyphs:{},requests:{},ranges:{}});let S=E.glyphs[g];if(S!==void 0)return void v(null,{stack:m,id:g,glyph:S});if(S=this._tinySDF(E,m,g),S)return E.glyphs[g]=S,void v(null,{stack:m,id:g,glyph:S});let A=Math.floor(g/256);if(256*A>65535)return void v(new Error("glyphs > 65535 not supported"));if(E.ranges[A])return void v(null,{stack:m,id:g,glyph:S});let M=E.requests[A];M||(M=E.requests[A]=[],Ie.loadGlyphRange(m,A,this.url,this.requestManager,(F,B)=>{if(B){for(let K in B)this._doesCharSupportLocalGlyph(+K)||(E.glyphs[+K]=B[+K]);E.ranges[A]=!0}for(let K of M)K(F,B);delete E.requests[A]})),M.push((F,B)=>{F?v(F):B&&v(null,{stack:m,id:g,glyph:B[g]||null})})},(m,g)=>{if(m)l(m);else if(g){let v={};for(let{stack:E,id:S,glyph:A}of g)(v[E]||(v[E]={}))[S]=A&&{id:A.id,bitmap:A.bitmap.clone(),metrics:A.metrics};l(null,v)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(a.unicodeBlockLookup["CJK Unified Ideographs"](t)||a.unicodeBlockLookup["Hangul Syllables"](t)||a.unicodeBlockLookup.Hiragana(t)||a.unicodeBlockLookup.Katakana(t))}_tinySDF(t,l,h){let m=this.localIdeographFontFamily;if(!m||!this._doesCharSupportLocalGlyph(h))return;let g=t.tinySDF;if(!g){let E="400";/bold/i.test(l)?E="900":/medium/i.test(l)?E="500":/light/i.test(l)&&(E="200"),g=t.tinySDF=new Ie.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:m,fontWeight:E})}let v=g.draw(String.fromCharCode(h));return{id:h,bitmap:new a.AlphaImage({width:v.width||30,height:v.height||30},v.data),metrics:{width:v.glyphWidth||24,height:v.glyphHeight||24,left:v.glyphLeft||0,top:v.glyphTop-27||-8,advance:v.glyphAdvance||24}}}}Ie.loadGlyphRange=function(d,t,l,h,m){let g=256*t,v=g+255,E=h.transformRequest(l.replace("{fontstack}",d).replace("{range}",`${g}-${v}`),a.ResourceType.Glyphs);a.getArrayBuffer(E,(S,A)=>{if(S)m(S);else if(A){let M={};for(let F of a.parseGlyphPbf(A))M[F.id]=F;m(null,M)}})},Ie.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:l=8,cutoff:h=.25,fontFamily:m="sans-serif",fontWeight:g="normal",fontStyle:v="normal"}={}){this.buffer=t,this.cutoff=h,this.radius=l;let E=this.size=d+4*t,S=this._createCanvas(E),A=this.ctx=S.getContext("2d",{willReadFrequently:!0});A.font=`${v} ${g} ${d}px ${m}`,A.textBaseline="alphabetic",A.textAlign="left",A.fillStyle="black",this.gridOuter=new Float64Array(E*E),this.gridInner=new Float64Array(E*E),this.f=new Float64Array(E),this.z=new Float64Array(E+1),this.v=new Uint16Array(E)}_createCanvas(d){let t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){let{width:t,actualBoundingBoxAscent:l,actualBoundingBoxDescent:h,actualBoundingBoxLeft:m,actualBoundingBoxRight:g}=this.ctx.measureText(d),v=Math.ceil(l),E=Math.min(this.size-this.buffer,Math.ceil(g-m)),S=Math.min(this.size-this.buffer,v+Math.ceil(h)),A=E+2*this.buffer,M=S+2*this.buffer,F=Math.max(A*M,0),B=new Uint8ClampedArray(F),K={data:B,width:A,height:M,glyphWidth:E,glyphHeight:S,glyphTop:v,glyphLeft:0,glyphAdvance:t};if(E===0||S===0)return K;let{ctx:G,buffer:Z,gridInner:re,gridOuter:oe}=this;G.clearRect(Z,Z,E,S),G.fillText(d,Z,Z+v);let ue=G.getImageData(Z,Z,E,S);oe.fill(De,0,F),re.fill(0,0,F);for(let W=0;W<S;W++)for(let de=0;de<E;de++){let ce=ue.data[4*(W*E+de)+3]/255;if(ce===0)continue;let Ee=(W+Z)*A+de+Z;if(ce===1)oe[Ee]=0,re[Ee]=De;else{let Te=.5-ce;oe[Ee]=Te>0?Te*Te:0,re[Ee]=Te<0?Te*Te:0}}fe(oe,0,0,A,M,A,this.f,this.v,this.z),fe(re,Z,Z,E,S,A,this.f,this.v,this.z);for(let W=0;W<F;W++){let de=Math.sqrt(oe[W])-Math.sqrt(re[W]);B[W]=Math.round(255-255*(de/this.radius+this.cutoff))}return K}};let We=new a.Properties({anchor:new a.DataConstantProperty(a.spec.light.anchor),position:new class{constructor(){this.specification=a.spec.light.position}possiblyEvaluate(d,t){return a.sphericalToCartesian(d.expression.evaluate(t))}interpolate(d,t,l){return{x:a.number(d.x,t.x,l),y:a.number(d.y,t.y,l),z:a.number(d.z,t.z,l)}}},color:new a.DataConstantProperty(a.spec.light.color),intensity:new a.DataConstantProperty(a.spec.light.intensity)}),Pe="-transition";class je extends a.Evented{constructor(t){super(),this._transitionable=new a.Transitionable(We),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,l={}){if(!this._validate(a.validateLight,t,l))for(let h in t){let m=t[h];h.endsWith(Pe)?this._transitionable.setTransition(h.slice(0,-Pe.length),m):this._transitionable.setValue(h,m)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,l,h){return(!h||h.validate!==!1)&&a.emitValidationErrors(this,t.call(a.validateStyle,a.extend({value:l,style:{glyphs:!0,sprite:!0},styleSpec:a.spec})))}}class Bt{constructor(t,l){this.width=t,this.height=l,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,l){let h=t.join(",")+String(l);return this.dashEntry[h]||(this.dashEntry[h]=this.addDash(t,l)),this.dashEntry[h]}getDashRanges(t,l,h){let m=[],g=t.length%2==1?-t[t.length-1]*h:0,v=t[0]*h,E=!0;m.push({left:g,right:v,isDash:E,zeroLength:t[0]===0});let S=t[0];for(let A=1;A<t.length;A++){E=!E;let M=t[A];g=S*h,S+=M,v=S*h,m.push({left:g,right:v,isDash:E,zeroLength:M===0})}return m}addRoundDash(t,l,h){let m=l/2;for(let g=-h;g<=h;g++){let v=this.width*(this.nextRow+h+g),E=0,S=t[E];for(let A=0;A<this.width;A++){A/S.right>1&&(S=t[++E]);let M=Math.abs(A-S.left),F=Math.abs(A-S.right),B=Math.min(M,F),K,G=g/h*(m+1);if(S.isDash){let Z=m-Math.abs(G);K=Math.sqrt(B*B+Z*Z)}else K=m-Math.sqrt(B*B+G*G);this.data[v+A]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(t){for(let E=t.length-1;E>=0;--E){let S=t[E],A=t[E+1];S.zeroLength?t.splice(E,1):A&&A.isDash===S.isDash&&(A.left=S.left,t.splice(E,1))}let l=t[0],h=t[t.length-1];l.isDash===h.isDash&&(l.left=h.left-this.width,h.right=l.right+this.width);let m=this.width*this.nextRow,g=0,v=t[g];for(let E=0;E<this.width;E++){E/v.right>1&&(v=t[++g]);let S=Math.abs(E-v.left),A=Math.abs(E-v.right),M=Math.min(S,A);this.data[m+E]=Math.max(0,Math.min(255,(v.isDash?M:-M)+128))}}addDash(t,l){let h=l?7:0,m=2*h+1;if(this.nextRow+m>this.height)return a.warnOnce("LineAtlas out of space"),null;let g=0;for(let E=0;E<t.length;E++)g+=t[E];if(g!==0){let E=this.width/g,S=this.getDashRanges(t,this.width,E);l?this.addRoundDash(S,E,h):this.addRegularDash(S)}let v={y:(this.nextRow+h+.5)/this.height,height:2*h/this.height,width:g};return this.nextRow+=m,this.dirty=!0,v}bind(t){let l=t.gl;this.texture?(l.bindTexture(l.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,l.texSubImage2D(l.TEXTURE_2D,0,0,0,this.width,this.height,l.ALPHA,l.UNSIGNED_BYTE,this.data))):(this.texture=l.createTexture(),l.bindTexture(l.TEXTURE_2D,this.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.REPEAT),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.REPEAT),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.LINEAR),l.texImage2D(l.TEXTURE_2D,0,l.ALPHA,this.width,this.height,0,l.ALPHA,l.UNSIGNED_BYTE,this.data))}}class vt{constructor(t,l){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a.uniqueId();let h=this.workerPool.acquire(this.id);for(let m=0;m<h.length;m++){let g=new vt.Actor(h[m],l,this.id);g.name=`Worker ${m}`,this.actors.push(g)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,l,h){a.asyncAll(this.actors,(m,g)=>{m.send(t,l,g)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(t=>{t.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Qt(d,t,l){let h=function(m,g){if(m)return l(m);if(g){let v=a.pick(a.extend(g,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);g.vector_layers&&(v.vectorLayers=g.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),l(null,v)}};return d.url?a.getJSON(t.transformRequest(d.url,a.ResourceType.Source),h):a.exported.frame(()=>h(null,d))}vt.Actor=a.Actor;class tr{constructor(t,l,h){this.bounds=a.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=l||0,this.maxzoom=h||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let l=Math.pow(2,t.z),h=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*l),m=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*l),g=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*l),v=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*l);return t.x>=h&&t.x<g&&t.y>=m&&t.y<v}}class Br extends a.Evented{constructor(t,l,h,m){if(super(),this.id=t,this.dispatcher=h,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,a.extend(this,a.pick(l,["url","scheme","tileSize","promoteId"])),this._options=a.extend({type:"vector"},l),this._collectResourceTiming=l.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(m)}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Qt(this._options,this.map._requestManager,(t,l)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new a.ErrorEvent(t)):l&&(a.extend(this,l),l.bounds&&(this.tileBounds=new tr(l.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}loadTile(t,l){let h=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),m={request:this.map._requestManager.transformRequest(h,a.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function g(v,E){return delete t.request,t.aborted?l(null):v&&v.status!==404?l(v):(E&&E.resourceTiming&&(t.resourceTiming=E.resourceTiming),this.map._refreshExpiredTiles&&E&&t.setExpiryData(E),t.loadVectorData(E,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),l(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}m.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=l:t.request=t.actor.send("reloadTile",m,g.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",m,g.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class wr extends a.Evented{constructor(t,l,h,m){super(),this.id=t,this.dispatcher=h,this.setEventedParent(m),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},l),a.extend(this,a.pick(l,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Qt(this._options,this.map._requestManager,(t,l)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new a.ErrorEvent(t)):l&&(a.extend(this,l),l.bounds&&(this.tileBounds=new tr(l.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,l){let h=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=a.getImage(this.map._requestManager.transformRequest(h,a.ResourceType.Tile),(m,g,v)=>{if(delete t.request,t.aborted)t.state="unloaded",l(null);else if(m)t.state="errored",l(m);else if(g){this.map._refreshExpiredTiles&&t.setExpiryData(v);let E=this.map.painter.context,S=E.gl;t.texture=this.map.painter.getTileTexture(g.width),t.texture?t.texture.update(g,{useMipmap:!0}):(t.texture=new _e(E,g,S.RGBA,{useMipmap:!0}),t.texture.bind(S.LINEAR,S.CLAMP_TO_EDGE,S.LINEAR_MIPMAP_NEAREST),E.extTextureFilterAnisotropic&&S.texParameterf(S.TEXTURE_2D,E.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,E.extTextureFilterAnisotropicMax)),t.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),l(null)}})}abortTile(t,l){t.request&&(t.request.cancel(),delete t.request),l()}unloadTile(t,l){t.texture&&this.map.painter.saveTileTexture(t.texture),l()}hasTransition(){return!1}}let It;class st extends wr{constructor(t,l,h,m){super(t,l,h,m),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},l),this.encoding=l.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,l){let h=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function m(g,v){g&&(t.state="errored",l(g)),v&&(t.dem=v,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",l(null))}t.request=a.getImage(this.map._requestManager.transformRequest(h,a.ResourceType.Tile),function(g,v){if(delete t.request,t.aborted)t.state="unloaded",l(null);else if(g)t.state="errored",l(g);else if(v){this.map._refreshExpiredTiles&&t.setExpiryData(v),delete v.cacheControl,delete v.expires;let E=a.isImageBitmap(v)&&(It==null&&(It=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),It)?v:a.exported.getImageData(v,1),S={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:E,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",S,m.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){let l=t.canonical,h=Math.pow(2,l.z),m=(l.x-1+h)%h,g=l.x===0?t.wrap-1:t.wrap,v=(l.x+1+h)%h,E=l.x+1===h?t.wrap+1:t.wrap,S={};return S[new a.OverscaledTileID(t.overscaledZ,g,l.z,m,l.y).key]={backfilled:!1},S[new a.OverscaledTileID(t.overscaledZ,E,l.z,v,l.y).key]={backfilled:!1},l.y>0&&(S[new a.OverscaledTileID(t.overscaledZ,g,l.z,m,l.y-1).key]={backfilled:!1},S[new a.OverscaledTileID(t.overscaledZ,t.wrap,l.z,l.x,l.y-1).key]={backfilled:!1},S[new a.OverscaledTileID(t.overscaledZ,E,l.z,v,l.y-1).key]={backfilled:!1}),l.y+1<h&&(S[new a.OverscaledTileID(t.overscaledZ,g,l.z,m,l.y+1).key]={backfilled:!1},S[new a.OverscaledTileID(t.overscaledZ,t.wrap,l.z,l.x,l.y+1).key]={backfilled:!1},S[new a.OverscaledTileID(t.overscaledZ,E,l.z,v,l.y+1).key]={backfilled:!1}),S}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class Or extends a.Evented{constructor(t,l,h,m){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=h.getActor(),this.setEventedParent(m),this._data=l.data,this._options=a.extend({},l),this._collectResourceTiming=l.collectResourceTiming,l.maxzoom!==void 0&&(this.maxzoom=l.maxzoom),l.type&&(this.type=l.type),l.attribution&&(this.attribution=l.attribution),this.promoteId=l.promoteId;let g=a.EXTENT/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:l.cluster||!1,geojsonVtOptions:{buffer:(l.buffer!==void 0?l.buffer:128)*g,tolerance:(l.tolerance!==void 0?l.tolerance:.375)*g,extent:a.EXTENT,maxZoom:this.maxzoom,lineMetrics:l.lineMetrics||!1,generateId:l.generateId||!1},superclusterOptions:{maxZoom:l.clusterMaxZoom!==void 0?l.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,l.clusterMinPoints||2),extent:a.EXTENT,radius:(l.clusterRadius||50)*g,log:!1,generateId:l.generateId||!1},clusterProperties:l.clusterProperties,filter:l.filter},l.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData("content"),this}getClusterExpansionZoom(t,l){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},l),this}getClusterChildren(t,l){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},l),this}getClusterLeaves(t,l,h,m){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:l,offset:h},m),this}_updateWorkerData(t){let l=a.extend({},this.workerOptions),h=this._data;typeof h=="string"?(l.request=this.map._requestManager.transformRequest(a.exported.resolveURL(h),a.ResourceType.Source),l.request.collectResourceTiming=this._collectResourceTiming):l.data=JSON.stringify(h),this._pendingLoads++,this.fire(new a.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,l,(m,g)=>{if(this._pendingLoads--,this._removed||g&&g.abandoned)return void this.fire(new a.Event("dataabort",{dataType:"source",sourceDataType:t}));let v=null;if(g&&g.resourceTiming&&g.resourceTiming[this.id]&&(v=g.resourceTiming[this.id].slice(0)),m)return void this.fire(new a.ErrorEvent(m));let E={dataType:"source",sourceDataType:t};this._collectResourceTiming&&v&&v.length>0&&a.extend(E,{resourceTiming:v}),this.fire(new a.Event("data",E))})}loaded(){return this._pendingLoads===0}loadTile(t,l){let h=t.actor?"reloadTile":"loadTile";t.actor=this.actor;let m={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(h,m,(g,v)=>(delete t.request,t.unloadVectorData(),t.aborted?l(null):g?l(g):(t.loadVectorData(v,this.map.painter,h==="reloadTile"),l(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Er=a.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ye extends a.Evented{constructor(t,l,h,m){super(),this.id=t,this.dispatcher=h,this.coordinates=l.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=l}load(t,l){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(h,m)=>{this._loaded=!0,h?this.fire(new a.ErrorEvent(h)):m&&(this.image=m,t&&(this.coordinates=t),l&&l(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(t){this.coordinates=t;let l=t.map(a.MercatorCoordinate.fromLngLat);this.tileID=function(m){let g=1/0,v=1/0,E=-1/0,S=-1/0;for(let B of m)g=Math.min(g,B.x),v=Math.min(v,B.y),E=Math.max(E,B.x),S=Math.max(S,B.y);let A=Math.max(E-g,S-v),M=Math.max(0,Math.floor(-Math.log(A)/Math.LN2)),F=Math.pow(2,M);return new a.CanonicalTileID(M,Math.floor((g+E)/2*F),Math.floor((v+S)/2*F))}(l),this.minzoom=this.maxzoom=this.tileID.z;let h=l.map(m=>this.tileID.getTilePoint(m)._round());return this._boundsArray=new a.RasterBoundsArray,this._boundsArray.emplaceBack(h[0].x,h[0].y,0,0),this._boundsArray.emplaceBack(h[1].x,h[1].y,a.EXTENT,0),this._boundsArray.emplaceBack(h[3].x,h[3].y,0,a.EXTENT),this._boundsArray.emplaceBack(h[2].x,h[2].y,a.EXTENT,a.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,l=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Er.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _e(t,this.image,l.RGBA),this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE));for(let h in this.tiles){let m=this.tiles[h];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}loadTile(t,l){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},l(null)):(t.state="errored",l(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Fe extends ye{constructor(t,l,h,m){super(t,l,h,m),this.roundZoom=!0,this.type="video",this.options=l}load(){this._loaded=!1;let t=this.options;this.urls=[];for(let l of t.urls)this.urls.push(this.map._requestManager.transformRequest(l,a.ResourceType.Source).url);a.getVideo(this.urls,(l,h)=>{this._loaded=!0,l?this.fire(new a.ErrorEvent(l)):h&&(this.video=h,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let l=this.video.seekable;t<l.start(0)||t>l.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${l.start(0)} and ${l.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,l=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Er.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE),l.texSubImage2D(l.TEXTURE_2D,0,0,0,l.RGBA,l.UNSIGNED_BYTE,this.video)):(this.texture=new _e(t,this.video,l.RGBA),this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE));for(let h in this.tiles){let m=this.tiles[h];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ue extends ye{constructor(t,l,h,m){super(t,l,h,m),l.coordinates?Array.isArray(l.coordinates)&&l.coordinates.length===4&&!l.coordinates.some(g=>!Array.isArray(g)||g.length!==2||g.some(v=>typeof v!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),l.animate&&typeof l.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),l.canvas?typeof l.canvas=="string"||l.canvas instanceof HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=l,this.animate=l.animate===void 0||l.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let l=this.map.painter.context,h=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,Er.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _e(l,this.canvas,h.RGBA,{premultiply:!0});for(let m in this.tiles){let g=this.tiles[m];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let Be={vector:Br,raster:wr,"raster-dem":st,geojson:Or,video:Fe,image:ye,canvas:Ue};function He(d,t){let l=a.create();return a.translate(l,l,[1,1,0]),a.scale(l,l,[.5*d.width,.5*d.height,1]),a.multiply(l,l,d.calculatePosMatrix(t.toUnwrapped()))}function ut(d,t,l,h,m,g){let v=function(F,B,K){if(F)for(let G of F){let Z=B[G];if(Z&&Z.source===K&&Z.type==="fill-extrusion")return!0}else for(let G in B){let Z=B[G];if(Z.source===K&&Z.type==="fill-extrusion")return!0}return!1}(m&&m.layers,t,d.id),E=g.maxPitchScaleFactor(),S=d.tilesIn(h,E,v);S.sort(lt);let A=[];for(let F of S)A.push({wrappedTileID:F.tileID.wrapped().key,queryResults:F.tile.queryRenderedFeatures(t,l,d._state,F.queryGeometry,F.cameraQueryGeometry,F.scale,m,g,E,He(d.transform,F.tileID))});let M=function(F){let B={},K={};for(let G of F){let Z=G.queryResults,re=G.wrappedTileID,oe=K[re]=K[re]||{};for(let ue in Z){let W=Z[ue],de=oe[ue]=oe[ue]||{},ce=B[ue]=B[ue]||[];for(let Ee of W)de[Ee.featureIndex]||(de[Ee.featureIndex]=!0,ce.push(Ee))}}return B}(A);for(let F in M)M[F].forEach(B=>{let K=B.feature,G=d.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=G});return M}function lt(d,t){let l=d.tileID,h=t.tileID;return l.overscaledZ-h.overscaledZ||l.canonical.y-h.canonical.y||l.wrap-h.wrap||l.canonical.x-h.canonical.x}class yt{constructor(t,l){this.tileID=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=l,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){let l=t+this.timeAdded;l<a.exported.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.textures.forEach(l=>t.saveTileTexture(l)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(t,l,h){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(m,g){let v={};if(!g)return v;for(let E of m){let S=E.layerIds.map(A=>g.getLayer(A)).filter(Boolean);if(S.length!==0){E.layers=S,E.stateDependentLayerIds&&(E.stateDependentLayers=E.stateDependentLayerIds.map(A=>S.filter(M=>M.id===A)[0]));for(let A of S)v[A.id]=E}}return v}(t.buckets,l.style),this.hasSymbolBuckets=!1;for(let m in this.buckets){let g=this.buckets[m];if(g instanceof a.SymbolBucket){if(this.hasSymbolBuckets=!0,!h)break;g.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let m in this.buckets){let g=this.buckets[m];if(g instanceof a.SymbolBucket&&g.hasRTLText){this.hasRTLText=!0,a.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let m in this.buckets){let g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,l.style.getLayer(m).queryRadius(g))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new a.CollisionBoxArray}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let h in this.buckets){let m=this.buckets[h];m.uploadPending()&&m.upload(t)}let l=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new _e(t,this.imageAtlas.image,l.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new _e(t,this.glyphAtlasImage,l.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,l,h,m,g,v,E,S,A,M){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:g,scale:v,tileSize:this.tileSize,pixelPosMatrix:M,transform:S,params:E,queryPadding:this.queryPadding*A},t,l,h):{}}querySourceFeatures(t,l){let h=this.latestFeatureIndex;if(!h||!h.rawTileData)return;let m=h.loadVTLayers(),g=l?l.sourceLayer:"",v=m._geojsonTileLayer||m[g];if(!v)return;let E=a.createFilter(l&&l.filter),{z:S,x:A,y:M}=this.tileID.canonical,F={z:S,x:A,y:M};for(let B=0;B<v.length;B++){let K=v.feature(B);if(E.needGeometry){let re=a.toEvaluationFeature(K,!0);if(!E.filter(new a.EvaluationParameters(this.tileID.overscaledZ),re,this.tileID.canonical))continue}else if(!E.filter(new a.EvaluationParameters(this.tileID.overscaledZ),K))continue;let G=h.getId(K,g),Z=new a.GeoJSONFeature(K,S,A,M,G);Z.tile=F,t.push(Z)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let l=this.expirationTime;if(t.cacheControl){let h=a.parseCacheControl(t.cacheControl);h["max-age"]&&(this.expirationTime=Date.now()+1e3*h["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let h=Date.now(),m=!1;if(this.expirationTime>h)m=!1;else if(l)if(this.expirationTime<l)m=!0;else{let g=this.expirationTime-l;g?this.expirationTime=h+Math.max(g,3e4):m=!0}else m=!0;m?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(t,l){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;let h=this.latestFeatureIndex.loadVTLayers();for(let m in this.buckets){if(!l.style.hasLayer(m))continue;let g=this.buckets[m],v=g.layers[0].sourceLayer||"_geojsonTileLayer",E=h[v],S=t[v];if(!E||!S||Object.keys(S).length===0)continue;g.update(S,E,this.imageAtlas&&this.imageAtlas.patternPositions||{});let A=l&&l.style&&l.style.getLayer(m);A&&(this.queryPadding=Math.max(this.queryPadding,A.queryRadius(g)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=a.exported.now()+t}setDependencies(t,l){let h={};for(let m of l)h[m]=!0;this.dependencies[t]=h}hasDependency(t,l){for(let h of t){let m=this.dependencies[h];if(m){for(let g of l)if(m[g])return!0}}return!1}}class wt{constructor(t,l){this.max=t,this.onRemove=l,this.reset()}reset(){for(let t in this.data)for(let l of this.data[t])l.timeout&&clearTimeout(l.timeout),this.onRemove(l.value);return this.data={},this.order=[],this}add(t,l,h){let m=t.wrapped().key;this.data[m]===void 0&&(this.data[m]=[]);let g={value:l,timeout:void 0};if(h!==void 0&&(g.timeout=setTimeout(()=>{this.remove(t,g)},h)),this.data[m].push(g),this.order.push(m),this.order.length>this.max){let v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let l=this.data[t].shift();return l.timeout&&clearTimeout(l.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),l.value}getByKey(t){let l=this.data[t];return l?l[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,l){if(!this.has(t))return this;let h=t.wrapped().key,m=l===void 0?0:this.data[h].indexOf(l),g=this.data[h][m];return this.data[h].splice(m,1),g.timeout&&clearTimeout(g.timeout),this.data[h].length===0&&delete this.data[h],this.onRemove(g.value),this.order.splice(this.order.indexOf(h),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}filter(t){let l=[];for(let h in this.data)for(let m of this.data[h])t(m.value)||l.push(m);for(let h of l)this.remove(h.value.tileID,h)}}class Nt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,l,h){let m=String(l);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][m]=this.stateChanges[t][m]||{},a.extend(this.stateChanges[t][m],h),this.deletedStates[t]===null){this.deletedStates[t]={};for(let g in this.state[t])g!==m&&(this.deletedStates[t][g]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][m]===null){this.deletedStates[t][m]={};for(let g in this.state[t][m])h[g]||(this.deletedStates[t][m][g]=null)}else for(let g in h)this.deletedStates[t]&&this.deletedStates[t][m]&&this.deletedStates[t][m][g]===null&&delete this.deletedStates[t][m][g]}removeFeatureState(t,l,h){if(this.deletedStates[t]===null)return;let m=String(l);if(this.deletedStates[t]=this.deletedStates[t]||{},h&&l!==void 0)this.deletedStates[t][m]!==null&&(this.deletedStates[t][m]=this.deletedStates[t][m]||{},this.deletedStates[t][m][h]=null);else if(l!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][m])for(h in this.deletedStates[t][m]={},this.stateChanges[t][m])this.deletedStates[t][m][h]=null;else this.deletedStates[t][m]=null;else this.deletedStates[t]=null}getState(t,l){let h=String(l),m=a.extend({},(this.state[t]||{})[h],(this.stateChanges[t]||{})[h]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let g=this.deletedStates[t][l];if(g===null)return{};for(let v in g)delete m[v]}return m}initializeTileState(t,l){t.setFeatureState(this.state,l)}coalesceChanges(t,l){let h={};for(let m in this.stateChanges){this.state[m]=this.state[m]||{};let g={};for(let v in this.stateChanges[m])this.state[m][v]||(this.state[m][v]={}),a.extend(this.state[m][v],this.stateChanges[m][v]),g[v]=this.state[m][v];h[m]=g}for(let m in this.deletedStates){this.state[m]=this.state[m]||{};let g={};if(this.deletedStates[m]===null)for(let v in this.state[m])g[v]={},this.state[m][v]={};else for(let v in this.deletedStates[m]){if(this.deletedStates[m][v]===null)this.state[m][v]={};else for(let E of Object.keys(this.deletedStates[m][v]))delete this.state[m][v][E];g[v]=this.state[m][v]}h[m]=h[m]||{},a.extend(h[m],g)}if(this.stateChanges={},this.deletedStates={},Object.keys(h).length!==0)for(let m in t)t[m].setFeatureState(h,l)}}class Dt extends a.Evented{constructor(t,l,h){super(),this.id=t,this.dispatcher=h,this.on("data",m=>{m.dataType==="source"&&m.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&m.dataType==="source"&&m.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(m,g,v,E){let S=new Be[g.type](m,g,v,E);if(S.id!==m)throw new Error(`Expected Source id to be ${m} instead of ${S.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],S),S}(t,l,h,this),this._tiles={},this._cache=new wt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Nt}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let t in this._tiles){let l=this._tiles[t];if(l.state!=="loaded"&&l.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,l){return this._source.loadTile(t,l)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new a.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let l in this._tiles){let h=this._tiles[l];h.upload(t),h.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(nr).map(t=>t.key)}getRenderableIds(t){let l=[];for(let h in this._tiles)this._isIdRenderable(h,t)&&l.push(this._tiles[h]);return t?l.sort((h,m)=>{let g=h.tileID,v=m.tileID,E=new a.pointGeometry(g.canonical.x,g.canonical.y)._rotate(this.transform.angle),S=new a.pointGeometry(v.canonical.x,v.canonical.y)._rotate(this.transform.angle);return g.overscaledZ-v.overscaledZ||S.y-E.y||S.x-E.x}).map(h=>h.tileID.key):l.map(h=>h.tileID).sort(nr).map(h=>h.key)}hasRenderableParent(t){let l=this.findLoadedParent(t,0);return!!l&&this._isIdRenderable(l.tileID.key)}_isIdRenderable(t,l){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(l||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,l){let h=this._tiles[t];h&&(h.state!=="loading"&&(h.state=l),this._loadTile(h,this._tileLoaded.bind(this,h,t,l)))}_tileLoaded(t,l,h,m){if(m)return t.state="errored",void(m.status!==404?this._source.fire(new a.ErrorEvent(m,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=a.exported.now(),h==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(l,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new a.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let l=this.getRenderableIds();for(let m=0;m<l.length;m++){let g=l[m];if(t.neighboringTiles&&t.neighboringTiles[g]){let v=this.getTileByID(g);h(t,v),h(v,t)}}function h(m,g){m.needsHillshadePrepare=!0,m.needsTerrainPrepare=!0;let v=g.tileID.canonical.x-m.tileID.canonical.x,E=g.tileID.canonical.y-m.tileID.canonical.y,S=Math.pow(2,m.tileID.canonical.z),A=g.tileID.key;v===0&&E===0||Math.abs(E)>1||(Math.abs(v)>1&&(Math.abs(v+S)===1?v+=S:Math.abs(v-S)===1&&(v-=S)),g.dem&&m.dem&&(m.dem.backfillBorder(g.dem,v,E),m.neighboringTiles&&m.neighboringTiles[A]&&(m.neighboringTiles[A].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,l,h,m){for(let g in this._tiles){let v=this._tiles[g];if(m[g]||!v.hasData()||v.tileID.overscaledZ<=l||v.tileID.overscaledZ>h)continue;let E=v.tileID;for(;v&&v.tileID.overscaledZ>l+1;){let A=v.tileID.scaledTo(v.tileID.overscaledZ-1);v=this._tiles[A.key],v&&v.hasData()&&(E=A)}let S=E;for(;S.overscaledZ>l;)if(S=S.scaledTo(S.overscaledZ-1),t[S.key]){m[E.key]=E;break}}}findLoadedParent(t,l){if(t.key in this._loadedParentTiles){let h=this._loadedParentTiles[t.key];return h&&h.tileID.overscaledZ>=l?h:null}for(let h=t.overscaledZ-1;h>=l;h--){let m=t.scaledTo(h),g=this._getLoadedTile(m);if(g)return g}}_getLoadedTile(t){let l=this._tiles[t.key];return l&&l.hasData()?l:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let l=Math.ceil(t.width/this._source.tileSize)+1,h=Math.ceil(t.height/this._source.tileSize)+1,m=Math.floor(l*h*5),g=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(g)}handleWrapJump(t){let l=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,l){let h={};for(let m in this._tiles){let g=this._tiles[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+l),h[g.tileID.key]=g}this._tiles=h;for(let m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(let m in this._tiles)this._setTileReloadTimer(m,this._tiles[m])}}update(t,l){if(this.transform=t,this.terrain=l,!this._sourceLoaded||this._paused)return;let h;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?h=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(A=>new a.OverscaledTileID(A.canonical.z,A.wrap,A.canonical.z,A.canonical.x,A.canonical.y)):(h=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:l}),this._source.hasTile&&(h=h.filter(A=>this._source.hasTile(A)))):h=[];let m=t.coveringZoomLevel(this._source),g=Math.max(m-Dt.maxOverzooming,this._source.minzoom),v=Math.max(m+Dt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let A={};for(let M of h)if(M.canonical.z>this._source.minzoom){let F=M.scaledTo(M.canonical.z-1);A[F.key]=F;let B=M.scaledTo(Math.max(this._source.minzoom,Math.min(M.canonical.z,5)));A[B.key]=B}h=h.concat(Object.values(A))}let E=this._updateRetainedTiles(h,m);if(or(this._source.type)){let A={},M={},F=Object.keys(E);for(let B of F){let K=E[B],G=this._tiles[B];if(!G||G.fadeEndTime&&G.fadeEndTime<=a.exported.now())continue;let Z=this.findLoadedParent(K,g);Z&&(this._addTile(Z.tileID),A[Z.tileID.key]=Z.tileID),M[B]=K}this._retainLoadedChildren(M,m,v,E);for(let B in A)E[B]||(this._coveredTiles[B]=!0,E[B]=A[B]);if(l){let B={},K={};for(let G of h)this._tiles[G.key].hasData()?B[G.key]=G:K[G.key]=G;for(let G in K){let Z=K[G].children(this._source.maxzoom);this._tiles[Z[0].key]&&this._tiles[Z[1].key]&&this._tiles[Z[2].key]&&this._tiles[Z[3].key]&&(B[Z[0].key]=E[Z[0].key]=Z[0],B[Z[1].key]=E[Z[1].key]=Z[1],B[Z[2].key]=E[Z[2].key]=Z[2],B[Z[3].key]=E[Z[3].key]=Z[3],delete K[G])}for(let G in K){let Z=this.findLoadedParent(K[G],this._source.minzoom);if(Z){B[Z.tileID.key]=E[Z.tileID.key]=Z.tileID;for(let re in B)B[re].isChildOf(Z.tileID)&&delete B[re]}}for(let G in this._tiles)B[G]||(this._coveredTiles[G]=!0)}}for(let A in E)this._tiles[A].clearFadeHold();let S=a.keysDifference(this._tiles,E);for(let A of S){let M=this._tiles[A];M.hasSymbolBuckets&&!M.holdingForFade()?M.setHoldDuration(this.map._fadeDuration):M.hasSymbolBuckets&&!M.symbolFadeFinished()||this._removeTile(A)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,l){let h={},m={},g=Math.max(l-Dt.maxOverzooming,this._source.minzoom),v=Math.max(l+Dt.maxUnderzooming,this._source.minzoom),E={};for(let S of t){let A=this._addTile(S);h[S.key]=S,A.hasData()||l<this._source.maxzoom&&(E[S.key]=S)}this._retainLoadedChildren(E,l,v,h);for(let S of t){let A=this._tiles[S.key];if(A.hasData())continue;if(l+1>this._source.maxzoom){let F=S.children(this._source.maxzoom)[0],B=this.getTile(F);if(B&&B.hasData()){h[F.key]=F;continue}}else{let F=S.children(this._source.maxzoom);if(h[F[0].key]&&h[F[1].key]&&h[F[2].key]&&h[F[3].key])continue}let M=A.wasRequested();for(let F=S.overscaledZ-1;F>=g;--F){let B=S.scaledTo(F);if(m[B.key]||(m[B.key]=!0,A=this.getTile(B),!A&&M&&(A=this._addTile(B)),A&&(h[B.key]=B,M=A.wasRequested(),A.hasData())))break}}return h}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let l=[],h,m=this._tiles[t].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){h=this._loadedParentTiles[m.key];break}l.push(m.key);let g=m.scaledTo(m.overscaledZ-1);if(h=this._getLoadedTile(g),h)break;m=g}for(let g of l)this._loadedParentTiles[g]=h}}_addTile(t){let l=this._tiles[t.key];if(l)return l;l=this._cache.getAndRemove(t),l&&(this._setTileReloadTimer(t.key,l),l.tileID=t,this._state.initializeTileState(l,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,l)));let h=l;return l||(l=new yt(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(l,this._tileLoaded.bind(this,l,t.key,l.state))),l.uses++,this._tiles[t.key]=l,h||this._source.fire(new a.Event("dataloading",{tile:l,coord:l.tileID,dataType:"source"})),l}_setTileReloadTimer(t,l){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let h=l.getExpiryTimeout();h&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},h))}_removeTile(t){let l=this._tiles[t];l&&(l.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),l.uses>0||(l.hasData()&&l.state!=="reloading"?this._cache.add(l.tileID,l,l.getExpiryTimeout()):(l.aborted=!0,this._abortTile(l),this._unloadTile(l))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,l,h){let m=[],g=this.transform;if(!g)return m;let v=h?g.getCameraQueryGeometry(t):t,E=t.map(G=>g.pointCoordinate(G,this.terrain)),S=v.map(G=>g.pointCoordinate(G,this.terrain)),A=this.getIds(),M=1/0,F=1/0,B=-1/0,K=-1/0;for(let G of S)M=Math.min(M,G.x),F=Math.min(F,G.y),B=Math.max(B,G.x),K=Math.max(K,G.y);for(let G=0;G<A.length;G++){let Z=this._tiles[A[G]];if(Z.holdingForFade())continue;let re=Z.tileID,oe=Math.pow(2,g.zoom-Z.tileID.overscaledZ),ue=l*Z.queryPadding*a.EXTENT/Z.tileSize/oe,W=[re.getTilePoint(new a.MercatorCoordinate(M,F)),re.getTilePoint(new a.MercatorCoordinate(B,K))];if(W[0].x-ue<a.EXTENT&&W[0].y-ue<a.EXTENT&&W[1].x+ue>=0&&W[1].y+ue>=0){let de=E.map(Ee=>re.getTilePoint(Ee)),ce=S.map(Ee=>re.getTilePoint(Ee));m.push({tile:Z,tileID:re,queryGeometry:de,cameraQueryGeometry:ce,scale:oe})}}return m}getVisibleCoordinates(t){let l=this.getRenderableIds(t).map(h=>this._tiles[h].tileID);for(let h of l)h.posMatrix=this.transform.calculatePosMatrix(h.toUnwrapped());return l}hasTransition(){if(this._source.hasTransition())return!0;if(or(this._source.type))for(let t in this._tiles){let l=this._tiles[t];if(l.fadeEndTime!==void 0&&l.fadeEndTime>=a.exported.now())return!0}return!1}setFeatureState(t,l,h){this._state.updateState(t=t||"_geojsonTileLayer",l,h)}removeFeatureState(t,l,h){this._state.removeFeatureState(t=t||"_geojsonTileLayer",l,h)}getFeatureState(t,l){return this._state.getState(t=t||"_geojsonTileLayer",l)}setDependencies(t,l,h){let m=this._tiles[t];m&&m.setDependencies(l,h)}reloadTilesForDependencies(t,l){for(let h in this._tiles)this._tiles[h].hasDependency(t,l)&&this._reloadTile(h,"reloading");this._cache.filter(h=>!h.hasDependency(t,l))}}function nr(d,t){let l=Math.abs(2*d.wrap)-+(d.wrap<0),h=Math.abs(2*t.wrap)-+(t.wrap<0);return d.overscaledZ-t.overscaledZ||h-l||t.canonical.y-d.canonical.y||t.canonical.x-d.canonical.x}function or(d){return d==="raster"||d==="image"||d==="video"}Dt.maxOverzooming=10,Dt.maxUnderzooming=3;let Dr="mapboxgl_preloaded_worker_pool";class er{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<er.workerCount;)this.workers.push(new Worker(zo.workerUrl));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(l=>{l.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Dr]}numActive(){return Object.keys(this.active).length}}let Fr=Math.floor(a.exported.hardwareConcurrency/2),hr;function Nr(){return hr||(hr=new er),hr}function Kr(d,t){let l={};for(let h in d)h!=="ref"&&(l[h]=d[h]);return a.refProperties.forEach(h=>{h in t&&(l[h]=t[h])}),l}function Pi(d){d=d.slice();let t=Object.create(null);for(let l=0;l<d.length;l++)t[d[l].id]=d[l];for(let l=0;l<d.length;l++)"ref"in d[l]&&(d[l]=Kr(d[l],t[d[l].ref]));return d}er.workerCount=Math.max(Math.min(Fr,6),1);let qt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function wi(d,t,l){l.push({command:qt.addSource,args:[d,t[d]]})}function un(d,t,l){t.push({command:qt.removeSource,args:[d]}),l[d]=!0}function Ji(d,t,l,h){un(d,l,h),wi(d,t,l)}function cn(d,t,l){let h;for(h in d[l])if(Object.prototype.hasOwnProperty.call(d[l],h)&&h!=="data"&&!R(d[l][h],t[l][h]))return!1;for(h in t[l])if(Object.prototype.hasOwnProperty.call(t[l],h)&&h!=="data"&&!R(d[l][h],t[l][h]))return!1;return!0}function hn(d,t,l,h,m,g){let v;for(v in t=t||{},d=d||{})Object.prototype.hasOwnProperty.call(d,v)&&(R(d[v],t[v])||l.push({command:g,args:[h,v,t[v],m]}));for(v in t)Object.prototype.hasOwnProperty.call(t,v)&&!Object.prototype.hasOwnProperty.call(d,v)&&(R(d[v],t[v])||l.push({command:g,args:[h,v,t[v],m]}))}function pn(d){return d.id}function kn(d,t){return d[t.id]=t,d}class dn{constructor(t,l){this.reset(t,l)}reset(t,l){this.points=t||[],this._distances=[0];for(let h=1;h<this.points.length;h++)this._distances[h]=this._distances[h-1]+this.points[h].dist(this.points[h-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(l||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=a.clamp(t,0,1);let l=1,h=this._distances[l],m=t*this.paddedLength+this.padding;for(;h<m&&l<this._distances.length;)h=this._distances[++l];let g=l-1,v=this._distances[g],E=h-v,S=E>0?(m-v)/E:0;return this.points[g].mult(1-S).add(this.points[l].mult(S))}}function Se(d,t){let l=!0;return d==="always"||d!=="never"&&t!=="never"||(l=!1),l}class Ge{constructor(t,l,h){let m=this.boxCells=[],g=this.circleCells=[];this.xCellCount=Math.ceil(t/h),this.yCellCount=Math.ceil(l/h);for(let v=0;v<this.xCellCount*this.yCellCount;v++)m.push([]),g.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=l,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/l,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,l,h,m,g){this._forEachCell(l,h,m,g,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(m),this.bboxes.push(g)}insertCircle(t,l,h,m){this._forEachCell(l-m,h-m,l+m,h+m,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(l),this.circles.push(h),this.circles.push(m)}_insertBoxCell(t,l,h,m,g,v){this.boxCells[g].push(v)}_insertCircleCell(t,l,h,m,g,v){this.circleCells[g].push(v)}_query(t,l,h,m,g,v,E){if(h<0||t>this.width||m<0||l>this.height)return[];let S=[];if(t<=0&&l<=0&&this.width<=h&&this.height<=m){if(g)return[{key:null,x1:t,y1:l,x2:h,y2:m}];for(let A=0;A<this.boxKeys.length;A++)S.push({key:this.boxKeys[A],x1:this.bboxes[4*A],y1:this.bboxes[4*A+1],x2:this.bboxes[4*A+2],y2:this.bboxes[4*A+3]});for(let A=0;A<this.circleKeys.length;A++){let M=this.circles[3*A],F=this.circles[3*A+1],B=this.circles[3*A+2];S.push({key:this.circleKeys[A],x1:M-B,y1:F-B,x2:M+B,y2:F+B})}}else this._forEachCell(t,l,h,m,this._queryCell,S,{hitTest:g,overlapMode:v,seenUids:{box:{},circle:{}}},E);return S}query(t,l,h,m){return this._query(t,l,h,m,!1,null)}hitTest(t,l,h,m,g,v){return this._query(t,l,h,m,!0,g,v).length>0}hitTestCircle(t,l,h,m,g){let v=t-h,E=t+h,S=l-h,A=l+h;if(E<0||v>this.width||A<0||S>this.height)return!1;let M=[];return this._forEachCell(v,S,E,A,this._queryCellCircle,M,{hitTest:!0,overlapMode:m,circle:{x:t,y:l,radius:h},seenUids:{box:{},circle:{}}},g),M.length>0}_queryCell(t,l,h,m,g,v,E,S){let{seenUids:A,hitTest:M,overlapMode:F}=E,B=this.boxCells[g];if(B!==null){let G=this.bboxes;for(let Z of B)if(!A.box[Z]){A.box[Z]=!0;let re=4*Z,oe=this.boxKeys[Z];if(t<=G[re+2]&&l<=G[re+3]&&h>=G[re+0]&&m>=G[re+1]&&(!S||S(oe))&&(!M||!Se(F,oe.overlapMode))&&(v.push({key:oe,x1:G[re],y1:G[re+1],x2:G[re+2],y2:G[re+3]}),M))return!0}}let K=this.circleCells[g];if(K!==null){let G=this.circles;for(let Z of K)if(!A.circle[Z]){A.circle[Z]=!0;let re=3*Z,oe=this.circleKeys[Z];if(this._circleAndRectCollide(G[re],G[re+1],G[re+2],t,l,h,m)&&(!S||S(oe))&&(!M||!Se(F,oe.overlapMode))){let ue=G[re],W=G[re+1],de=G[re+2];if(v.push({key:oe,x1:ue-de,y1:W-de,x2:ue+de,y2:W+de}),M)return!0}}}return!1}_queryCellCircle(t,l,h,m,g,v,E,S){let{circle:A,seenUids:M,overlapMode:F}=E,B=this.boxCells[g];if(B!==null){let G=this.bboxes;for(let Z of B)if(!M.box[Z]){M.box[Z]=!0;let re=4*Z,oe=this.boxKeys[Z];if(this._circleAndRectCollide(A.x,A.y,A.radius,G[re+0],G[re+1],G[re+2],G[re+3])&&(!S||S(oe))&&!Se(F,oe.overlapMode))return v.push(!0),!0}}let K=this.circleCells[g];if(K!==null){let G=this.circles;for(let Z of K)if(!M.circle[Z]){M.circle[Z]=!0;let re=3*Z,oe=this.circleKeys[Z];if(this._circlesCollide(G[re],G[re+1],G[re+2],A.x,A.y,A.radius)&&(!S||S(oe))&&!Se(F,oe.overlapMode))return v.push(!0),!0}}}_forEachCell(t,l,h,m,g,v,E,S){let A=this._convertToXCellCoord(t),M=this._convertToYCellCoord(l),F=this._convertToXCellCoord(h),B=this._convertToYCellCoord(m);for(let K=A;K<=F;K++)for(let G=M;G<=B;G++)if(g.call(this,t,l,h,m,this.xCellCount*G+K,v,E,S))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,l,h,m,g,v){let E=m-t,S=g-l,A=h+v;return A*A>E*E+S*S}_circleAndRectCollide(t,l,h,m,g,v,E){let S=(v-m)/2,A=Math.abs(t-(m+S));if(A>S+h)return!1;let M=(E-g)/2,F=Math.abs(l-(g+M));if(F>M+h)return!1;if(A<=S||F<=M)return!0;let B=A-S,K=F-M;return B*B+K*K<=h*h}}function qn(d,t,l,h,m){let g=a.create();return t?(a.scale(g,g,[1/m,1/m,1]),l||a.rotateZ(g,g,h.angle)):a.multiply(g,h.labelPlaneMatrix,d),g}function Ni(d,t,l,h,m){if(t){let g=a.clone(d);return a.scale(g,g,[m,m,1]),l||a.rotateZ(g,g,-h.angle),g}return h.glCoordMatrix}function Zt(d,t,l){let h;l?(h=[d.x,d.y,l(d.x,d.y),1],a.transformMat4(h,h,t)):(h=[d.x,d.y,0,1],Ne(h,h,t));let m=h[3];return{point:new a.pointGeometry(h[0]/m,h[1]/m),signedDistanceFromCamera:m}}function Ei(d,t){return .5+d/t*.5}function pi(d,t){let l=d[0]/d[3],h=d[1]/d[3];return l>=-t[0]&&l<=t[0]&&h>=-t[1]&&h<=t[1]}function di(d,t,l,h,m,g,v,E,S,A){let M=h?d.textSizeData:d.iconSizeData,F=a.evaluateSizeForZoom(M,l.transform.zoom),B=[256/l.width*2+1,256/l.height*2+1],K=h?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;K.clear();let G=d.lineVertexArray,Z=h?d.text.placedSymbolArray:d.icon.placedSymbolArray,re=l.transform.width/l.transform.height,oe=!1;for(let ue=0;ue<Z.length;ue++){let W=Z.get(ue);if(W.hidden||W.writingMode===a.WritingMode.vertical&&!oe){we(W.numGlyphs,K);continue}let de;if(oe=!1,A?(de=[W.anchorX,W.anchorY,A(W.anchorX,W.anchorY),1],a.transformMat4(de,de,t)):(de=[W.anchorX,W.anchorY,0,1],Ne(de,de,t)),!pi(de,B)){we(W.numGlyphs,K);continue}let ce=Ei(l.transform.cameraToCenterDistance,de[3]),Ee=a.evaluateSizeForFeature(M,F,W),Te=v?Ee/ce:Ee*ce,ze=new a.pointGeometry(W.anchorX,W.anchorY),xe=Zt(ze,m,A).point,rt={},Ze=U(W,Te,!1,E,t,m,g,d.glyphOffsetArray,G,K,xe,ze,rt,re,S,A);oe=Ze.useVertical,(Ze.notEnoughRoom||oe||Ze.needsFlipping&&U(W,Te,!0,E,t,m,g,d.glyphOffsetArray,G,K,xe,ze,rt,re,S,A).notEnoughRoom)&&we(W.numGlyphs,K)}h?d.text.dynamicLayoutVertexBuffer.updateData(K):d.icon.dynamicLayoutVertexBuffer.updateData(K)}function fn(d,t,l,h,m,g,v,E,S,A,M,F,B){let K=E.glyphStartIndex+E.numGlyphs,G=E.lineStartIndex,Z=E.lineStartIndex+E.lineLength,re=t.getoffsetX(E.glyphStartIndex),oe=t.getoffsetX(K-1),ue=he(d*re,l,h,m,g,v,E.segment,G,Z,S,A,M,F,B);if(!ue)return null;let W=he(d*oe,l,h,m,g,v,E.segment,G,Z,S,A,M,F,B);return W?{first:ue,last:W}:null}function qe(d,t,l,h){return d===a.WritingMode.horizontal&&Math.abs(l.y-t.y)>Math.abs(l.x-t.x)*h?{useVertical:!0}:(d===a.WritingMode.vertical?t.y<l.y:t.x>l.x)?{needsFlipping:!0}:null}function U(d,t,l,h,m,g,v,E,S,A,M,F,B,K,G,Z){let re=t/24,oe=d.lineOffsetX*re,ue=d.lineOffsetY*re,W;if(d.numGlyphs>1){let de=d.glyphStartIndex+d.numGlyphs,ce=d.lineStartIndex,Ee=d.lineStartIndex+d.lineLength,Te=fn(re,E,oe,ue,l,M,F,d,S,g,B,G,Z);if(!Te)return{notEnoughRoom:!0};let ze=Zt(Te.first.point,v,Z).point,xe=Zt(Te.last.point,v,Z).point;if(h&&!l){let rt=qe(d.writingMode,ze,xe,K);if(rt)return rt}W=[Te.first];for(let rt=d.glyphStartIndex+1;rt<de-1;rt++)W.push(he(re*E.getoffsetX(rt),oe,ue,l,M,F,d.segment,ce,Ee,S,g,B,G,Z));W.push(Te.last)}else{if(h&&!l){let ce=Zt(F,m,Z).point,Ee=d.lineStartIndex+d.segment+1,Te=new a.pointGeometry(S.getx(Ee),S.gety(Ee)),ze=Zt(Te,m,Z),xe=ze.signedDistanceFromCamera>0?ze.point:H(F,Te,ce,1,m,Z),rt=qe(d.writingMode,ce,xe,K);if(rt)return rt}let de=he(re*E.getoffsetX(d.glyphStartIndex),oe,ue,l,M,F,d.segment,d.lineStartIndex,d.lineStartIndex+d.lineLength,S,g,B,G,Z);if(!de)return{notEnoughRoom:!0};W=[de]}for(let de of W)a.addDynamicAttributes(A,de.point,de.angle);return{}}function H(d,t,l,h,m,g){let v=Zt(d.add(d.sub(t)._unit()),m,g).point,E=l.sub(v);return l.add(E._mult(h/E.mag()))}function he(d,t,l,h,m,g,v,E,S,A,M,F,B,K){let G=h?d-t:d+t,Z=G>0?1:-1,re=0;h&&(Z*=-1,re=Math.PI),Z<0&&(re+=Math.PI);let oe=Z>0?E+v:E+v+1,ue=m,W=m,de=0,ce=0,Ee=Math.abs(G),Te=[];for(;de+ce<=Ee;){if(oe+=Z,oe<E||oe>=S)return null;if(W=ue,Te.push(ue),ue=F[oe],ue===void 0){let nt=new a.pointGeometry(A.getx(oe),A.gety(oe)),Mt=Zt(nt,M,K);if(Mt.signedDistanceFromCamera>0)ue=F[oe]=Mt.point;else{let Rt=oe-Z;ue=H(de===0?g:new a.pointGeometry(A.getx(Rt),A.gety(Rt)),nt,W,Ee-de+1,M,K)}}de+=ce,ce=W.dist(ue)}let ze=(Ee-de)/ce,xe=ue.sub(W),rt=xe.mult(ze)._add(W);rt._add(xe._unit()._perp()._mult(l*Z));let Ze=re+Math.atan2(ue.y-W.y,ue.x-W.x);return Te.push(rt),{point:rt,angle:B?Ze:0,path:Te}}let ke=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function we(d,t){for(let l=0;l<d;l++){let h=t.length;t.resize(h+4),t.float32.set(ke,3*h)}}function Ne(d,t,l){let h=t[0],m=t[1];return d[0]=l[0]*h+l[4]*m+l[12],d[1]=l[1]*h+l[5]*m+l[13],d[3]=l[3]*h+l[7]*m+l[15],d}let Le=100;class Tt{constructor(t,l=new Ge(t.width+200,t.height+200,25),h=new Ge(t.width+200,t.height+200,25)){this.transform=t,this.grid=l,this.ignoredGrid=h,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Le,this.screenBottomBoundary=t.height+Le,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,l,h,m,g,v){let E=this.projectAndGetPerspectiveRatio(m,t.anchorPointX,t.anchorPointY,v),S=h*E.perspectiveRatio,A=t.x1*S+E.point.x,M=t.y1*S+E.point.y,F=t.x2*S+E.point.x,B=t.y2*S+E.point.y;return!this.isInsideGrid(A,M,F,B)||l!=="always"&&this.grid.hitTest(A,M,F,B,l,g)||E.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[A,M,F,B],offscreen:this.isOffscreen(A,M,F,B)}}placeCollisionCircles(t,l,h,m,g,v,E,S,A,M,F,B,K,G){let Z=[],re=new a.pointGeometry(l.anchorX,l.anchorY),oe=Zt(re,v,G),ue=Ei(this.transform.cameraToCenterDistance,oe.signedDistanceFromCamera),W=(M?g/ue:g*ue)/a.ONE_EM,de=Zt(re,E,G).point,ce=fn(W,m,l.lineOffsetX*W,l.lineOffsetY*W,!1,de,re,l,h,E,{},!1,G),Ee=!1,Te=!1,ze=!0;if(ce){let xe=.5*B*ue+K,rt=new a.pointGeometry(-100,-100),Ze=new a.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),nt=new dn,Mt=ce.first,Rt=ce.last,gt=[];for(let Kt=Mt.path.length-1;Kt>=1;Kt--)gt.push(Mt.path[Kt]);for(let Kt=1;Kt<Rt.path.length;Kt++)gt.push(Rt.path[Kt]);let ur=2.5*xe;if(S){let Kt=gt.map(Yt=>Zt(Yt,S,G));gt=Kt.some(Yt=>Yt.signedDistanceFromCamera<=0)?[]:Kt.map(Yt=>Yt.point)}let cr=[];if(gt.length>0){let Kt=gt[0].clone(),Yt=gt[0].clone();for(let pr=1;pr<gt.length;pr++)Kt.x=Math.min(Kt.x,gt[pr].x),Kt.y=Math.min(Kt.y,gt[pr].y),Yt.x=Math.max(Yt.x,gt[pr].x),Yt.y=Math.max(Yt.y,gt[pr].y);cr=Kt.x>=rt.x&&Yt.x<=Ze.x&&Kt.y>=rt.y&&Yt.y<=Ze.y?[gt]:Yt.x<rt.x||Kt.x>Ze.x||Yt.y<rt.y||Kt.y>Ze.y?[]:a.clipLine([gt],rt.x,rt.y,Ze.x,Ze.y)}for(let Kt of cr){nt.reset(Kt,.25*xe);let Yt=0;Yt=nt.length<=.5*xe?1:Math.ceil(nt.paddedLength/ur)+1;for(let pr=0;pr<Yt;pr++){let ei=pr/Math.max(Yt-1,1),Mn=nt.lerp(ei),yn=Mn.x+Le,zn=Mn.y+Le;Z.push(yn,zn,xe,0);let go=yn-xe,Qi=zn-xe,Oi=yn+xe,Kn=zn+xe;if(ze=ze&&this.isOffscreen(go,Qi,Oi,Kn),Te=Te||this.isInsideGrid(go,Qi,Oi,Kn),t!=="always"&&this.grid.hitTestCircle(yn,zn,xe,t,F)&&(Ee=!0,!A))return{circles:[],offscreen:!1,collisionDetected:Ee}}}}return{circles:!A&&Ee||!Te||ue<this.perspectiveRatioCutoff?[]:Z,offscreen:ze,collisionDetected:Ee}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let l=[],h=1/0,m=1/0,g=-1/0,v=-1/0;for(let M of t){let F=new a.pointGeometry(M.x+Le,M.y+Le);h=Math.min(h,F.x),m=Math.min(m,F.y),g=Math.max(g,F.x),v=Math.max(v,F.y),l.push(F)}let E=this.grid.query(h,m,g,v).concat(this.ignoredGrid.query(h,m,g,v)),S={},A={};for(let M of E){let F=M.key;if(S[F.bucketInstanceId]===void 0&&(S[F.bucketInstanceId]={}),S[F.bucketInstanceId][F.featureIndex])continue;let B=[new a.pointGeometry(M.x1,M.y1),new a.pointGeometry(M.x2,M.y1),new a.pointGeometry(M.x2,M.y2),new a.pointGeometry(M.x1,M.y2)];a.polygonIntersectsPolygon(l,B)&&(S[F.bucketInstanceId][F.featureIndex]=!0,A[F.bucketInstanceId]===void 0&&(A[F.bucketInstanceId]=[]),A[F.bucketInstanceId].push(F.featureIndex))}return A}insertCollisionBox(t,l,h,m,g,v){(h?this.ignoredGrid:this.grid).insert({bucketInstanceId:m,featureIndex:g,collisionGroupID:v,overlapMode:l},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,l,h,m,g,v){let E=h?this.ignoredGrid:this.grid,S={bucketInstanceId:m,featureIndex:g,collisionGroupID:v,overlapMode:l};for(let A=0;A<t.length;A+=4)E.insertCircle(S,t[A],t[A+1],t[A+2])}projectAndGetPerspectiveRatio(t,l,h,m){let g;return m?(g=[l,h,m(l,h),1],a.transformMat4(g,g,t)):(g=[l,h,0,1],Ne(g,g,t)),{point:new a.pointGeometry((g[0]/g[3]+1)/2*this.transform.width+Le,(-g[1]/g[3]+1)/2*this.transform.height+Le),perspectiveRatio:.5+this.transform.cameraToCenterDistance/g[3]*.5}}isOffscreen(t,l,h,m){return h<Le||t>=this.screenRightBoundary||m<Le||l>this.screenBottomBoundary}isInsideGrid(t,l,h,m){return h>=0&&t<this.gridRightBoundary&&m>=0&&l<this.gridBottomBoundary}getViewportMatrix(){let t=a.identity([]);return a.translate(t,t,[-100,-100,0]),t}}function Pt(d,t,l){return t*(a.EXTENT/(d.tileSize*Math.pow(2,l-d.tileID.overscaledZ)))}class lr{constructor(t,l,h,m){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?l:-l))):m&&h?1:0,this.placed=h}isHidden(){return this.opacity===0&&!this.placed}}class At{constructor(t,l,h,m,g){this.text=new lr(t?t.text:null,l,h,g),this.icon=new lr(t?t.icon:null,l,m,g)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class fi{constructor(t,l,h){this.text=t,this.icon=l,this.skipFade=h}}class Rr{constructor(){this.invProjMatrix=a.create(),this.viewportMatrix=a.create(),this.circles=[]}}class ai{constructor(t,l,h,m,g){this.bucketInstanceId=t,this.featureIndex=l,this.sourceLayerIndex=h,this.bucketIndex=m,this.tileID=g}}class Mi{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let l=++this.maxGroupID;this.collisionGroups[t]={ID:l,predicate:h=>h.collisionGroupID===l}}return this.collisionGroups[t]}}function uo(d,t,l,h,m){let{horizontalAlign:g,verticalAlign:v}=a.getAnchorAlignment(d),E=-(g-.5)*t,S=-(v-.5)*l,A=a.evaluateVariableOffset(d,h);return new a.pointGeometry(E+A[0]*m,S+A[1]*m)}function br(d,t,l,h,m,g){let{x1:v,x2:E,y1:S,y2:A,anchorPointX:M,anchorPointY:F}=d,B=new a.pointGeometry(t,l);return h&&B._rotate(m?g:-g),{x1:v+B.x,y1:S+B.y,x2:E+B.x,y2:A+B.y,anchorPointX:M,anchorPointY:F}}class q{constructor(t,l,h,m,g){this.transform=t.clone(),this.terrain=l,this.collisionIndex=new Tt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=h,this.retainedQueryData={},this.collisionGroups=new Mi(m),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,l,h,m){let g=h.getBucket(l),v=h.latestFeatureIndex;if(!g||!v||l.id!==g.layerIds[0])return;let E=h.collisionBoxArray,S=g.layers[0].layout,A=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),M=h.tileSize/a.EXTENT,F=this.transform.calculatePosMatrix(h.tileID.toUnwrapped()),B=S.get("text-pitch-alignment")==="map",K=S.get("text-rotation-alignment")==="map",G=Pt(h,1,this.transform.zoom),Z=qn(F,B,K,this.transform,G),re=null;if(B){let ue=Ni(F,B,K,this.transform,G);re=a.multiply([],this.transform.labelPlaneMatrix,ue)}this.retainedQueryData[g.bucketInstanceId]=new ai(g.bucketInstanceId,v,g.sourceLayerIndex,g.index,h.tileID);let oe={bucket:g,layout:S,posMatrix:F,textLabelPlaneMatrix:Z,labelToScreenMatrix:re,scale:A,textPixelRatio:M,holdingForFade:h.holdingForFade(),collisionBoxArray:E,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(g.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(g.sourceID)};if(m)for(let ue of g.sortKeyRanges){let{sortKey:W,symbolInstanceStart:de,symbolInstanceEnd:ce}=ue;t.push({sortKey:W,symbolInstanceStart:de,symbolInstanceEnd:ce,parameters:oe})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:g.symbolInstances.length,parameters:oe})}attemptAnchorPlacement(t,l,h,m,g,v,E,S,A,M,F,B,K,G,Z,re){let oe=[B.textOffset0,B.textOffset1],ue=uo(t,h,m,oe,g),W=this.collisionIndex.placeCollisionBox(br(l,ue.x,ue.y,v,E,this.transform.angle),F,S,A,M.predicate,re);if((!Z||this.collisionIndex.placeCollisionBox(br(Z,ue.x,ue.y,v,E,this.transform.angle),F,S,A,M.predicate,re).box.length!==0)&&W.box.length>0){let de;if(this.prevPlacement&&this.prevPlacement.variableOffsets[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID].text&&(de=this.prevPlacement.variableOffsets[B.crossTileID].anchor),B.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[B.crossTileID]={textOffset:oe,width:h,height:m,anchor:t,textBoxScale:g,prevAnchor:de},this.markUsedJustification(K,t,B,G),K.allowVerticalPlacement&&(this.markUsedOrientation(K,G,B),this.placedOrientations[B.crossTileID]=G),{shift:ue,placedGlyphBoxes:W}}}placeLayerBucketPart(t,l,h){let{bucket:m,layout:g,posMatrix:v,textLabelPlaneMatrix:E,labelToScreenMatrix:S,textPixelRatio:A,holdingForFade:M,collisionBoxArray:F,partiallyEvaluatedTextSize:B,collisionGroup:K}=t.parameters,G=g.get("text-optional"),Z=g.get("icon-optional"),re=a.getOverlapMode(g,"text-overlap","text-allow-overlap"),oe=re==="always",ue=a.getOverlapMode(g,"icon-overlap","icon-allow-overlap"),W=ue==="always",de=g.get("text-rotation-alignment")==="map",ce=g.get("text-pitch-alignment")==="map",Ee=g.get("icon-text-fit")!=="none",Te=g.get("symbol-z-order")==="viewport-y",ze=oe&&(W||!m.hasIconData()||Z),xe=W&&(oe||!m.hasTextData()||G);!m.collisionArrays&&F&&m.deserializeCollisionBoxes(F);let rt=(Ze,nt)=>{if(l[Ze.crossTileID])return;if(M)return void(this.placements[Ze.crossTileID]=new fi(!1,!1,!1));let Mt=!1,Rt=!1,gt=!0,ur=null,cr={box:null,offscreen:null},Kt={box:null,offscreen:null},Yt=null,pr=null,ei=null,Mn=0,yn=0,zn=0;nt.textFeatureIndex?Mn=nt.textFeatureIndex:Ze.useRuntimeCollisionCircles&&(Mn=Ze.featureIndex),nt.verticalTextFeatureIndex&&(yn=nt.verticalTextFeatureIndex);let go=this.retainedQueryData[m.bucketInstanceId].tileID,Qi=this.terrain?(Wr,jt)=>this.terrain.getElevation(go,Wr,jt):null;for(let Wr of["textBox","verticalTextBox","iconBox","verticalIconBox"]){let jt=nt[Wr];jt&&(jt.elevation=Qi?Qi(jt.anchorPointX,jt.anchorPointY):0)}let Oi=nt.textBox;if(Oi){let Wr=sr=>{let ti=a.WritingMode.horizontal;if(m.allowVerticalPlacement&&!sr&&this.prevPlacement){let ri=this.prevPlacement.placedOrientations[Ze.crossTileID];ri&&(this.placedOrientations[Ze.crossTileID]=ri,ti=ri,this.markUsedOrientation(m,ti,Ze))}return ti},jt=(sr,ti)=>{if(m.allowVerticalPlacement&&Ze.numVerticalGlyphVertices>0&&nt.verticalTextBox){for(let ri of m.writingModes)if(ri===a.WritingMode.vertical?(cr=ti(),Kt=cr):cr=sr(),cr&&cr.box&&cr.box.length)break}else cr=sr()};if(g.get("text-variable-anchor")){let sr=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ze.crossTileID]){let Pr=this.prevPlacement.variableOffsets[Ze.crossTileID];sr.indexOf(Pr.anchor)>0&&(sr=sr.filter(en=>en!==Pr.anchor),sr.unshift(Pr.anchor))}let ti=(Pr,en,Oo)=>{let mu=Pr.x2-Pr.x1,as=Pr.y2-Pr.y1,yh=Ze.textBoxScale,yu=Ee&&ue==="never"?en:null,_o={box:[],offscreen:!1},Do=re!=="never"?2*sr.length:sr.length;for(let Fo=0;Fo<Do;++Fo){let La=this.attemptAnchorPlacement(sr[Fo%sr.length],Pr,mu,as,yh,de,ce,A,v,K,Fo>=sr.length?re:"never",Ze,m,Oo,yu,Qi);if(La&&(_o=La.placedGlyphBoxes,_o&&_o.box&&_o.box.length)){Mt=!0,ur=La.shift;break}}return _o};jt(()=>ti(Oi,nt.iconBox,a.WritingMode.horizontal),()=>{let Pr=nt.verticalTextBox;return m.allowVerticalPlacement&&!(cr&&cr.box&&cr.box.length)&&Ze.numVerticalGlyphVertices>0&&Pr?ti(Pr,nt.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null}}),cr&&(Mt=cr.box,gt=cr.offscreen);let ri=Wr(cr&&cr.box);if(!Mt&&this.prevPlacement){let Pr=this.prevPlacement.variableOffsets[Ze.crossTileID];Pr&&(this.variableOffsets[Ze.crossTileID]=Pr,this.markUsedJustification(m,Pr.anchor,Ze,ri))}}else{let sr=(ti,ri)=>{let Pr=this.collisionIndex.placeCollisionBox(ti,re,A,v,K.predicate,Qi);return Pr&&Pr.box&&Pr.box.length&&(this.markUsedOrientation(m,ri,Ze),this.placedOrientations[Ze.crossTileID]=ri),Pr};jt(()=>sr(Oi,a.WritingMode.horizontal),()=>{let ti=nt.verticalTextBox;return m.allowVerticalPlacement&&Ze.numVerticalGlyphVertices>0&&ti?sr(ti,a.WritingMode.vertical):{box:null,offscreen:null}}),Wr(cr&&cr.box&&cr.box.length)}}if(Yt=cr,Mt=Yt&&Yt.box&&Yt.box.length>0,gt=Yt&&Yt.offscreen,Ze.useRuntimeCollisionCircles){let Wr=m.text.placedSymbolArray.get(Ze.centerJustifiedTextSymbolIndex),jt=a.evaluateSizeForFeature(m.textSizeData,B,Wr),sr=g.get("text-padding");pr=this.collisionIndex.placeCollisionCircles(re,Wr,m.lineVertexArray,m.glyphOffsetArray,jt,v,E,S,h,ce,K.predicate,Ze.collisionCircleDiameter,sr,Qi),pr.circles.length&&pr.collisionDetected&&!h&&a.warnOnce("Collisions detected, but collision boxes are not shown"),Mt=oe||pr.circles.length>0&&!pr.collisionDetected,gt=gt&&pr.offscreen}if(nt.iconFeatureIndex&&(zn=nt.iconFeatureIndex),nt.iconBox){let Wr=jt=>{let sr=Ee&&ur?br(jt,ur.x,ur.y,de,ce,this.transform.angle):jt;return this.collisionIndex.placeCollisionBox(sr,ue,A,v,K.predicate,Qi)};Kt&&Kt.box&&Kt.box.length&&nt.verticalIconBox?(ei=Wr(nt.verticalIconBox),Rt=ei.box.length>0):(ei=Wr(nt.iconBox),Rt=ei.box.length>0),gt=gt&&ei.offscreen}let Kn=G||Ze.numHorizontalGlyphVertices===0&&Ze.numVerticalGlyphVertices===0,Ra=Z||Ze.numIconVertices===0;if(Kn||Ra?Ra?Kn||(Rt=Rt&&Mt):Mt=Rt&&Mt:Rt=Mt=Rt&&Mt,Mt&&Yt&&Yt.box&&this.collisionIndex.insertCollisionBox(Yt.box,re,g.get("text-ignore-placement"),m.bucketInstanceId,Kt&&Kt.box&&yn?yn:Mn,K.ID),Rt&&ei&&this.collisionIndex.insertCollisionBox(ei.box,ue,g.get("icon-ignore-placement"),m.bucketInstanceId,zn,K.ID),pr&&(Mt&&this.collisionIndex.insertCollisionCircles(pr.circles,re,g.get("text-ignore-placement"),m.bucketInstanceId,Mn,K.ID),h)){let Wr=m.bucketInstanceId,jt=this.collisionCircleArrays[Wr];jt===void 0&&(jt=this.collisionCircleArrays[Wr]=new Rr);for(let sr=0;sr<pr.circles.length;sr+=4)jt.circles.push(pr.circles[sr+0]),jt.circles.push(pr.circles[sr+1]),jt.circles.push(pr.circles[sr+2]),jt.circles.push(pr.collisionDetected?1:0)}if(Ze.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(m.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ze.crossTileID]=new fi(Mt||ze,Rt||xe,gt||m.justReloaded),l[Ze.crossTileID]=!0};if(Te){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Ze=m.getSortedSymbolIndexes(this.transform.angle);for(let nt=Ze.length-1;nt>=0;--nt){let Mt=Ze[nt];rt(m.symbolInstances.get(Mt),m.collisionArrays[Mt])}}else for(let Ze=t.symbolInstanceStart;Ze<t.symbolInstanceEnd;Ze++)rt(m.symbolInstances.get(Ze),m.collisionArrays[Ze]);if(h&&m.bucketInstanceId in this.collisionCircleArrays){let Ze=this.collisionCircleArrays[m.bucketInstanceId];a.invert(Ze.invProjMatrix,v),Ze.viewportMatrix=this.collisionIndex.getViewportMatrix()}m.justReloaded=!1}markUsedJustification(t,l,h,m){let g;g=m===a.WritingMode.vertical?h.verticalPlacedTextSymbolIndex:{left:h.leftJustifiedTextSymbolIndex,center:h.centerJustifiedTextSymbolIndex,right:h.rightJustifiedTextSymbolIndex}[a.getAnchorJustification(l)];let v=[h.leftJustifiedTextSymbolIndex,h.centerJustifiedTextSymbolIndex,h.rightJustifiedTextSymbolIndex,h.verticalPlacedTextSymbolIndex];for(let E of v)E>=0&&(t.text.placedSymbolArray.get(E).crossTileID=g>=0&&E!==g?0:h.crossTileID)}markUsedOrientation(t,l,h){let m=l===a.WritingMode.horizontal||l===a.WritingMode.horizontalOnly?l:0,g=l===a.WritingMode.vertical?l:0,v=[h.leftJustifiedTextSymbolIndex,h.centerJustifiedTextSymbolIndex,h.rightJustifiedTextSymbolIndex];for(let E of v)t.text.placedSymbolArray.get(E).placedOrientation=m;h.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(h.verticalPlacedTextSymbolIndex).placedOrientation=g)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let l=this.prevPlacement,h=!1;this.prevZoomAdjustment=l?l.zoomAdjustment(this.transform.zoom):0;let m=l?l.symbolFadeChange(t):1,g=l?l.opacities:{},v=l?l.variableOffsets:{},E=l?l.placedOrientations:{};for(let S in this.placements){let A=this.placements[S],M=g[S];M?(this.opacities[S]=new At(M,m,A.text,A.icon),h=h||A.text!==M.text.placed||A.icon!==M.icon.placed):(this.opacities[S]=new At(null,m,A.text,A.icon,A.skipFade),h=h||A.text||A.icon)}for(let S in g){let A=g[S];if(!this.opacities[S]){let M=new At(A,m,!1,!1);M.isHidden()||(this.opacities[S]=M,h=h||A.text.placed||A.icon.placed)}}for(let S in v)this.variableOffsets[S]||!this.opacities[S]||this.opacities[S].isHidden()||(this.variableOffsets[S]=v[S]);for(let S in E)this.placedOrientations[S]||!this.opacities[S]||this.opacities[S].isHidden()||(this.placedOrientations[S]=E[S]);if(l&&l.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");h?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=l?l.lastPlacementChangeTime:t)}updateLayerOpacities(t,l){let h={};for(let m of l){let g=m.getBucket(t);g&&m.latestFeatureIndex&&t.id===g.layerIds[0]&&this.updateBucketOpacities(g,h,m.collisionBoxArray)}}updateBucketOpacities(t,l,h){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let m=t.layers[0].layout,g=new At(null,0,!1,!1,!0),v=m.get("text-allow-overlap"),E=m.get("icon-allow-overlap"),S=m.get("text-variable-anchor"),A=m.get("text-rotation-alignment")==="map",M=m.get("text-pitch-alignment")==="map",F=m.get("icon-text-fit")!=="none",B=new At(null,0,v&&(E||!t.hasIconData()||m.get("icon-optional")),E&&(v||!t.hasTextData()||m.get("text-optional")),!0);!t.collisionArrays&&h&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(h);let K=(G,Z,re)=>{for(let oe=0;oe<Z/4;oe++)G.opacityVertexArray.emplaceBack(re)};for(let G=0;G<t.symbolInstances.length;G++){let Z=t.symbolInstances.get(G),{numHorizontalGlyphVertices:re,numVerticalGlyphVertices:oe,crossTileID:ue}=Z,W=this.opacities[ue];l[ue]?W=g:W||(W=B,this.opacities[ue]=W),l[ue]=!0;let de=Z.numIconVertices>0,ce=this.placedOrientations[Z.crossTileID],Ee=ce===a.WritingMode.vertical,Te=ce===a.WritingMode.horizontal||ce===a.WritingMode.horizontalOnly;if(re>0||oe>0){let ze=ne(W.text);K(t.text,re,Ee?be:ze),K(t.text,oe,Te?be:ze);let xe=W.text.isHidden();[Z.rightJustifiedTextSymbolIndex,Z.centerJustifiedTextSymbolIndex,Z.leftJustifiedTextSymbolIndex].forEach(nt=>{nt>=0&&(t.text.placedSymbolArray.get(nt).hidden=xe||Ee?1:0)}),Z.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(Z.verticalPlacedTextSymbolIndex).hidden=xe||Te?1:0);let rt=this.variableOffsets[Z.crossTileID];rt&&this.markUsedJustification(t,rt.anchor,Z,ce);let Ze=this.placedOrientations[Z.crossTileID];Ze&&(this.markUsedJustification(t,"left",Z,Ze),this.markUsedOrientation(t,Ze,Z))}if(de){let ze=ne(W.icon),xe=!(F&&Z.verticalPlacedIconSymbolIndex&&Ee);Z.placedIconSymbolIndex>=0&&(K(t.icon,Z.numIconVertices,xe?ze:be),t.icon.placedSymbolArray.get(Z.placedIconSymbolIndex).hidden=W.icon.isHidden()),Z.verticalPlacedIconSymbolIndex>=0&&(K(t.icon,Z.numVerticalIconVertices,xe?be:ze),t.icon.placedSymbolArray.get(Z.verticalPlacedIconSymbolIndex).hidden=W.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let ze=t.collisionArrays[G];if(ze){let xe=new a.pointGeometry(0,0);if(ze.textBox||ze.verticalTextBox){let Ze=!0;if(S){let nt=this.variableOffsets[ue];nt?(xe=uo(nt.anchor,nt.width,nt.height,nt.textOffset,nt.textBoxScale),A&&xe._rotate(M?this.transform.angle:-this.transform.angle)):Ze=!1}ze.textBox&&k(t.textCollisionBox.collisionVertexArray,W.text.placed,!Ze||Ee,xe.x,xe.y),ze.verticalTextBox&&k(t.textCollisionBox.collisionVertexArray,W.text.placed,!Ze||Te,xe.x,xe.y)}let rt=Boolean(!Te&&ze.verticalIconBox);ze.iconBox&&k(t.iconCollisionBox.collisionVertexArray,W.icon.placed,rt,F?xe.x:0,F?xe.y:0),ze.verticalIconBox&&k(t.iconCollisionBox.collisionVertexArray,W.icon.placed,!rt,F?xe.x:0,F?xe.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){let G=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=G.invProjMatrix,t.placementViewportMatrix=G.viewportMatrix,t.collisionCircleArray=G.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,l){let h=this.zoomAtLastRecencyCheck===l?1-this.zoomAdjustment(l):1;return this.zoomAtLastRecencyCheck=l,this.commitTime+this.fadeDuration*h>t}setStale(){this.stale=!0}}function k(d,t,l,h,m){d.emplaceBack(t?1:0,l?1:0,h||0,m||0),d.emplaceBack(t?1:0,l?1:0,h||0,m||0),d.emplaceBack(t?1:0,l?1:0,h||0,m||0),d.emplaceBack(t?1:0,l?1:0,h||0,m||0)}let O=Math.pow(2,25),V=Math.pow(2,24),$=Math.pow(2,17),Y=Math.pow(2,16),ie=Math.pow(2,9),te=Math.pow(2,8),Q=Math.pow(2,1);function ne(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;let t=d.placed?1:0,l=Math.floor(127*d.opacity);return l*O+t*V+l*$+t*Y+l*ie+t*te+l*Q+t}let be=0;class Me{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,l,h,m,g){let v=this._bucketParts;for(;this._currentTileIndex<t.length;)if(l.getBucketParts(v,m,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,g())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,v.sort((E,S)=>E.sortKey-S.sortKey));this._currentPartIndex<v.length;)if(l.placeLayerBucketPart(v[this._currentPartIndex],this._seenCrossTileIDs,h),this._currentPartIndex++,g())return!0;return!1}}class ge{constructor(t,l,h,m,g,v,E,S){this.placement=new q(t,l,v,E,S),this._currentPlacementIndex=h.length-1,this._forceFullPlacement=m,this._showCollisionBoxes=g,this._done=!1}isDone(){return this._done}continuePlacement(t,l,h){let m=a.exported.now(),g=()=>{let v=a.exported.now()-m;return!this._forceFullPlacement&&v>2};for(;this._currentPlacementIndex>=0;){let v=l[t[this._currentPlacementIndex]],E=this.placement.collisionIndex.transform.zoom;if(v.type==="symbol"&&(!v.minzoom||v.minzoom<=E)&&(!v.maxzoom||v.maxzoom>E)){if(this._inProgressLayer||(this._inProgressLayer=new Me(v)),this._inProgressLayer.continuePlacement(h[v.source],this.placement,this._showCollisionBoxes,v,g))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let ct=512/a.EXTENT/2;class dt{constructor(t,l,h){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=h;for(let m=0;m<l.length;m++){let g=l.get(m),v=g.key;this.indexedSymbolInstances[v]||(this.indexedSymbolInstances[v]=[]),this.indexedSymbolInstances[v].push({crossTileID:g.crossTileID,coord:this.getScaledCoordinates(g,t)})}}getScaledCoordinates(t,l){let h=ct/Math.pow(2,l.canonical.z-this.tileID.canonical.z);return{x:Math.floor((l.canonical.x*a.EXTENT+t.anchorX)*h),y:Math.floor((l.canonical.y*a.EXTENT+t.anchorY)*h)}}findMatches(t,l,h){let m=this.tileID.canonical.z<l.canonical.z?1:Math.pow(2,this.tileID.canonical.z-l.canonical.z);for(let g=0;g<t.length;g++){let v=t.get(g);if(v.crossTileID)continue;let E=this.indexedSymbolInstances[v.key];if(!E)continue;let S=this.getScaledCoordinates(v,l);for(let A of E)if(Math.abs(A.coord.x-S.x)<=m&&Math.abs(A.coord.y-S.y)<=m&&!h[A.crossTileID]){h[A.crossTileID]=!0,v.crossTileID=A.crossTileID;break}}}}class et{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class bt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let l=Math.round((t-this.lng)/360);if(l!==0)for(let h in this.indexes){let m=this.indexes[h],g={};for(let v in m){let E=m[v];E.tileID=E.tileID.unwrapTo(E.tileID.wrap+l),g[E.tileID.key]=E}this.indexes[h]=g}this.lng=t}addBucket(t,l,h){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===l.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let g=0;g<l.symbolInstances.length;g++)l.symbolInstances.get(g).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});let m=this.usedCrossTileIDs[t.overscaledZ];for(let g in this.indexes){let v=this.indexes[g];if(Number(g)>t.overscaledZ)for(let E in v){let S=v[E];S.tileID.isChildOf(t)&&S.findMatches(l.symbolInstances,t,m)}else{let E=v[t.scaledTo(Number(g)).key];E&&E.findMatches(l.symbolInstances,t,m)}}for(let g=0;g<l.symbolInstances.length;g++){let v=l.symbolInstances.get(g);v.crossTileID||(v.crossTileID=h.generate(),m[v.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new dt(t,l.symbolInstances,l.bucketInstanceId),!0}removeBucketCrossTileIDs(t,l){for(let h in l.indexedSymbolInstances)for(let m of l.indexedSymbolInstances[h])delete this.usedCrossTileIDs[t][m.crossTileID]}removeStaleBuckets(t){let l=!1;for(let h in this.indexes){let m=this.indexes[h];for(let g in m)t[m[g].bucketInstanceId]||(this.removeBucketCrossTileIDs(h,m[g]),delete m[g],l=!0)}return l}}class St{constructor(){this.layerIndexes={},this.crossTileIDs=new et,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,l,h){let m=this.layerIndexes[t.id];m===void 0&&(m=this.layerIndexes[t.id]=new bt);let g=!1,v={};m.handleWrapJump(h);for(let E of l){let S=E.getBucket(t);S&&t.id===S.layerIds[0]&&(S.bucketInstanceId||(S.bucketInstanceId=++this.maxBucketInstanceId),m.addBucket(E.tileID,S,this.crossTileIDs)&&(g=!0),v[S.bucketInstanceId]=!0)}return m.removeStaleBuckets(v)&&(g=!0),g}pruneUnusedLayers(t){let l={};t.forEach(h=>{l[h]=!0});for(let h in this.layerIndexes)l[h]||delete this.layerIndexes[h]}}var Ht=a.createLayout([{name:"a_pos",type:"Int16",components:2}]);class Ct extends a.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=t._cache.max,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(let t in this._tiles){let l=this._tiles[t];l.textures.forEach(h=>h.destroy()),l.textures=[]}}update(t,l){this.sourceCache.update(t,l),this._renderableTilesKeys=[];for(let h of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:l}))this._renderableTilesKeys.push(h.key),this._tiles[h.key]||(h.posMatrix=new Float64Array(16),a.ortho(h.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),this._tiles[h.key]=new yt(h,this.tileSize))}removeOutdated(t){let l={};this.renderHistory=this.renderHistory.filter((h,m)=>this.renderHistory.indexOf(h)===m).slice(0,this.renderHistorySize);for(let h of this._renderableTilesKeys)l[h]=!0;for(let h of this.renderHistory)l[h]=!0;for(let h in this._tiles)l[h]||(this._tiles[h].clearTextures(t),delete this._tiles[h])}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let l={};for(let h of this._renderableTilesKeys){let m=this._tiles[h].tileID;if(m.canonical.equals(t.canonical)){let g=t.clone();g.posMatrix=new Float64Array(16),a.ortho(g.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),l[h]=g}else if(m.canonical.isChildOf(t.canonical)){let g=t.clone();g.posMatrix=new Float64Array(16);let v=m.canonical.z-t.canonical.z,E=m.canonical.x-(m.canonical.x>>v<<v),S=m.canonical.y-(m.canonical.y>>v<<v),A=a.EXTENT>>v;a.ortho(g.posMatrix,0,A,0,A,0,1),a.translate(g.posMatrix,g.posMatrix,[-E*A,-S*A,0]),l[h]=g}else if(t.canonical.isChildOf(m.canonical)){let g=t.clone();g.posMatrix=new Float64Array(16);let v=t.canonical.z-m.canonical.z,E=t.canonical.x-(t.canonical.x>>v<<v),S=t.canonical.y-(t.canonical.y>>v<<v),A=a.EXTENT>>v;a.ortho(g.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),a.translate(g.posMatrix,g.posMatrix,[E*A,S*A,0]),a.scale(g.posMatrix,g.posMatrix,[1/2**v,1/2**v,0]),l[h]=g}}return l}getSourceTile(t,l){let h=this.sourceCache._source,m=t.overscaledZ-this.deltaZoom;if(m>h.maxzoom&&(m=h.maxzoom),m<h.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(m).key);let g=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!g||!g.dem)&&l)for(;m>=h.minzoom&&(!g||!g.dem);)g=this.sourceCache.getTileByID(t.scaledTo(m--).key);return g}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(l=>l.timeLoaded>=t)}}class Ft{constructor(t,l,h){this.style=t,this.sourceCache=new Ct(l),this.options=h,this.exaggeration=typeof h.exaggeration=="number"?h.exaggeration:1,this.elevationOffset=typeof h.elevationOffset=="number"?h.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(t,l,h,m=a.EXTENT){if(!(l>=0&&l<m&&h>=0&&h<m))return this.elevationOffset;let g=0,v=this.getTerrainData(t);if(v.tile&&v.tile.dem){let E=a.transformMat4$1([],[l/m*a.EXTENT,h/m*a.EXTENT],v.u_terrain_matrix),S=[E[0]*v.tile.dem.dim,E[1]*v.tile.dem.dim],A=[Math.floor(S[0]),Math.floor(S[1])],M=v.tile.dem.get(A[0],A[1]),F=v.tile.dem.get(A[0],A[1]+1),B=v.tile.dem.get(A[0]+1,A[1]),K=v.tile.dem.get(A[0]+1,A[1]+1);g=a.number(a.number(M,F,S[0]-A[0]),a.number(B,K,S[0]-A[0]),S[1]-A[1])}return g}rememberForRerender(t,l){for(let h in this.sourceCache._tiles){let m=this.sourceCache._tiles[h];(m.tileID.equals(l)||m.tileID.isChildOf(l))&&(t===this.sourceCache.sourceCache.id&&(m.timeLoaded=Date.now()),this._rerender[t]=this._rerender[t]||{},this._rerender[t][m.tileID.key]=!0)}}needsRerender(t,l){return this._rerender[t]&&this._rerender[t][l.key]}clearRerenderCache(){this._rerender={}}getElevation(t,l,h,m=a.EXTENT){return(this.getDEMElevation(t,l,h,m)+this.elevationOffset)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let m=this.style.map.painter.context,g=new a.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new _e(m,g,m.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new _e(m,new a.RGBAImage({width:1,height:1}),m.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=a.identity([])}let l=this.sourceCache.getSourceTile(t,!0);if(l&&l.dem&&(!l.demTexture||l.needsTerrainPrepare)){let m=this.style.map.painter.context;l.demTexture=this.style.map.painter.getTileTexture(l.dem.stride),l.demTexture?l.demTexture.update(l.dem.getPixels(),{premultiply:!1}):l.demTexture=new _e(m,l.dem.getPixels(),m.gl.RGBA,{premultiply:!1}),l.demTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),l.needsTerrainPrepare=!1}let h=l&&l+l.tileID.key+t.key;if(h&&!this._demMatrixCache[h]){let m=this.sourceCache.sourceCache._source.maxzoom,g=t.canonical.z-l.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=m?g=t.canonical.z-m:a.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let v=t.canonical.x-(t.canonical.x>>g<<g),E=t.canonical.y-(t.canonical.y>>g<<g),S=a.fromScaling(new Float64Array(16),[1/(a.EXTENT<<g),1/(a.EXTENT<<g),0]);a.translate(S,S,[v*a.EXTENT,E*a.EXTENT,0]),this._demMatrixCache[t.key]={matrix:S,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:l&&l.dem&&l.dem.dim||1,u_terrain_matrix:h?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:l&&l.dem&&l.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_offset:this.elevationOffset,u_terrain_exaggeration:this.exaggeration,texture:(l&&l.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:l}}getRTTFramebuffer(){let t=this.style.map.painter;if(!this._rttFramebuffer){let l=this.sourceCache.tileSize*this.qualityFactor;this._rttFramebuffer=t.context.createFramebuffer(l,l,!0),this._rttFramebuffer.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,l,l))}return this._rttFramebuffer}getFramebuffer(t){let l=this.style.map.painter,h=l.width/devicePixelRatio,m=l.height/devicePixelRatio;return!this._fbo||this._fbo.width===h&&this._fbo.height===m||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new _e(l.context,{width:h,height:m,data:null},l.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(l.context.gl.NEAREST,l.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new _e(l.context,{width:h,height:m,data:null},l.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(l.context.gl.NEAREST,l.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=l.context.createFramebuffer(h,m,!0),this._fbo.depthAttachment.set(l.context.createRenderbuffer(l.context.gl.DEPTH_COMPONENT16,h,m))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.style.map.painter.context;if(this._coordsTexture)return this._coordsTexture;let l=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let g=0,v=0;g<this._coordsTextureSize;g++)for(let E=0;E<this._coordsTextureSize;E++,v+=4)l[v+0]=255&E,l[v+1]=255&g,l[v+2]=E>>8<<4|g>>8,l[v+3]=0;let h=new a.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(l.buffer)),m=new _e(t,h,t.gl.RGBA,{premultiply:!1});return m.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(t){let l=new Uint8Array(4),h=this.style.map.painter,m=h.context,g=m.gl;m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(t.x,h.height/devicePixelRatio-t.y-1,1,1,g.RGBA,g.UNSIGNED_BYTE,l),m.bindFramebuffer.set(null);let v=l[0]+(l[2]>>4<<8),E=l[1]+((15&l[2])<<8),S=this.coordsIndex[255-l[3]],A=S&&this.sourceCache.getTileByID(S);if(!A)return null;let M=this._coordsTextureSize,F=(1<<A.tileID.canonical.z)*M;return new a.MercatorCoordinate((A.tileID.canonical.x*M+v)/F,(A.tileID.canonical.y*M+E)/F,this.getElevation(A.tileID,v,E,M))}getTerrainMesh(){if(this._mesh)return this._mesh;let t=this.style.map.painter.context,l=new a.PosArray,h=new a.TriangleIndexArray,m=this.meshSize,g=a.EXTENT/m,v=m*m;for(let E=0;E<=m;E++)for(let S=0;S<=m;S++)l.emplaceBack(S*g,E*g);for(let E=0;E<v;E+=m+1)for(let S=0;S<m;S++)h.emplaceBack(S+E,m+S+E+1,m+S+E+2),h.emplaceBack(S+E,m+S+E+2,S+E+1);return this._mesh={indexBuffer:t.createIndexBuffer(h),vertexBuffer:t.createVertexBuffer(l,Ht.members),segments:a.SegmentVector.simpleSegment(0,0,l.length,h.length)},this._mesh}getMinMaxElevation(t){let l=this.getTerrainData(t).tile,h={minElevation:null,maxElevation:null};return l&&l.dem&&(h.minElevation=(l.dem.min+this.elevationOffset)*this.exaggeration,h.maxElevation=(l.dem.max+this.elevationOffset)*this.exaggeration),h}}let Jt=(d,t)=>a.emitValidationErrors(d,t&&t.filter(l=>l.identifier!=="source.canvas")),mr=a.pick(qt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Qr=a.pick(qt,["setCenter","setZoom","setBearing","setPitch"]),Cr=function(){let d={},t=a.spec.$version;for(let l in a.spec.$root){let h=a.spec.$root[l];if(h.required){let m=null;m=l==="version"?t:h.type==="array"?[]:{},m!=null&&(d[l]=m)}}return d}();class mi extends a.Evented{constructor(t,l={}){super(),this.map=t,this.dispatcher=new vt(Nr(),this),this.imageManager=new Oe,this.imageManager.setEventedParent(this),this.glyphManager=new Ie(t._requestManager,l.localIdeographFontFamily),this.lineAtlas=new Bt(256,512),this.crossTileSymbolIndex=new St,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());let h=this;this._rtlTextPluginCallback=mi.registerForPluginStateChange(m=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:m.pluginStatus,pluginURL:m.pluginURL},(g,v)=>{if(a.triggerPluginCompletionEvent(g),v&&v.every(E=>E))for(let E in h.sourceCaches)h.sourceCaches[E].reload()})}),this.on("data",m=>{if(m.dataType!=="source"||m.sourceDataType!=="metadata")return;let g=this.sourceCaches[m.sourceId];if(!g)return;let v=g.getSource();if(v&&v.vectorLayerIds)for(let E in this._layers){let S=this._layers[E];S.source===v.id&&this._validateLayer(S)}})}loadURL(t,l={}){this.fire(new a.Event("dataloading",{dataType:"style"}));let h=typeof l.validate!="boolean"||l.validate,m=this.map._requestManager.transformRequest(t,a.ResourceType.Style);this._request=a.getJSON(m,(g,v)=>{this._request=null,g?this.fire(new a.ErrorEvent(g)):v&&this._load(v,h)})}loadJSON(t,l={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(t,l.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(Cr,!1)}_load(t,l){if(l&&Jt(this,a.validateStyle(t)))return;this._loaded=!0,this.stylesheet=t;for(let m in t.sources)this.addSource(m,t.sources[m],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);let h=Pi(this.stylesheet.layers);this._order=h.map(m=>m.id),this._layers={},this._serializedLayers={};for(let m of h)m=a.createStyleLayer(m),m.setEventedParent(this,{layer:{id:m.id}}),this._layers[m.id]=m,this._serializedLayers[m.id]=m.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new je(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}_loadSprite(t){this._spriteRequest=function(l,h,m,g){let v,E,S,A=m>1?"@2x":"",M=a.getJSON(h.transformRequest(h.normalizeSpriteURL(l,A,".json"),a.ResourceType.SpriteJSON),(K,G)=>{M=null,S||(S=K,v=G,B())}),F=a.getImage(h.transformRequest(h.normalizeSpriteURL(l,A,".png"),a.ResourceType.SpriteImage),(K,G)=>{F=null,S||(S=K,E=G,B())});function B(){if(S)g(S);else if(v&&E){let K=a.exported.getImageData(E),G={};for(let Z in v){let{width:re,height:oe,x:ue,y:W,sdf:de,pixelRatio:ce,stretchX:Ee,stretchY:Te,content:ze}=v[Z],xe=new a.RGBAImage({width:re,height:oe});a.RGBAImage.copy(K,xe,{x:ue,y:W},{x:0,y:0},{width:re,height:oe}),G[Z]={data:xe,pixelRatio:ce,sdf:de,stretchX:Ee,stretchY:Te,content:ze}}g(null,G)}}return{cancel(){M&&(M.cancel(),M=null),F&&(F.cancel(),F=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,h)=>{if(this._spriteRequest=null,l)this.fire(new a.ErrorEvent(l));else if(h)for(let m in h)this.imageManager.addImage(m,h[m]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(t){let l=this.sourceCaches[t.source];if(!l)return;let h=t.sourceLayer;if(!h)return;let m=l.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(h)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${m.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){let l=[];for(let h of t){let m=this._layers[h];m.type!=="custom"&&l.push(m.serialize())}return l}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let l=this._changed;if(this._changed){let m=Object.keys(this._updatedLayers),g=Object.keys(this._removedLayers);(m.length||g.length)&&this._updateWorkerLayers(m,g);for(let v in this._updatedSources){let E=this._updatedSources[v];if(E==="reload")this._reloadSource(v);else{if(E!=="clear")throw new Error(`Invalid action ${E}`);this._clearSource(v)}}this._updateTilesForChangedImages();for(let v in this._updatedPaintProps)this._layers[v].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}let h={};for(let m in this.sourceCaches){let g=this.sourceCaches[m];h[m]=g.used,g.used=!1}for(let m of this._order){let g=this._layers[m];g.recalculate(t,this._availableImages),!g.isHidden(t.zoom)&&g.source&&(this.sourceCaches[g.source].used=!0)}for(let m in h){let g=this.sourceCaches[m];h[m]!==g.used&&g.fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(t),this.z=t.zoom,l&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let l in this.sourceCaches)this.sourceCaches[l].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,l){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:l})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(t){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),t){let l=this.sourceCaches[t.source];if(!l)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);this.terrain=new Ft(this,l,t),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=h=>{h.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=h=>{h.tile&&(h.sourceId===t.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(h.sourceId,h.tile.tileID)):h.source.type==="geojson"&&this.terrain.rememberForRerender(h.sourceId,h.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new a.Event("terrain",{terrain:t}))}setState(t){if(this._checkLoaded(),Jt(this,a.validateStyle(t)))return!1;(t=a.clone$1(t)).layers=Pi(t.layers);let l=function(m,g){if(!m)return[{command:qt.setStyle,args:[g]}];let v=[];try{if(!R(m.version,g.version))return[{command:qt.setStyle,args:[g]}];R(m.center,g.center)||v.push({command:qt.setCenter,args:[g.center]}),R(m.zoom,g.zoom)||v.push({command:qt.setZoom,args:[g.zoom]}),R(m.bearing,g.bearing)||v.push({command:qt.setBearing,args:[g.bearing]}),R(m.pitch,g.pitch)||v.push({command:qt.setPitch,args:[g.pitch]}),R(m.sprite,g.sprite)||v.push({command:qt.setSprite,args:[g.sprite]}),R(m.glyphs,g.glyphs)||v.push({command:qt.setGlyphs,args:[g.glyphs]}),R(m.transition,g.transition)||v.push({command:qt.setTransition,args:[g.transition]}),R(m.light,g.light)||v.push({command:qt.setLight,args:[g.light]});let E={},S=[];(function(M,F,B,K){let G;for(G in F=F||{},M=M||{})Object.prototype.hasOwnProperty.call(M,G)&&(Object.prototype.hasOwnProperty.call(F,G)||un(G,B,K));for(G in F)Object.prototype.hasOwnProperty.call(F,G)&&(Object.prototype.hasOwnProperty.call(M,G)?R(M[G],F[G])||(M[G].type==="geojson"&&F[G].type==="geojson"&&cn(M,F,G)?B.push({command:qt.setGeoJSONSourceData,args:[G,F[G].data]}):Ji(G,F,B,K)):wi(G,F,B))})(m.sources,g.sources,S,E);let A=[];m.layers&&m.layers.forEach(M=>{E[M.source]?v.push({command:qt.removeLayer,args:[M.id]}):A.push(M)}),v=v.concat(S),function(M,F,B){F=F||[];let K=(M=M||[]).map(pn),G=F.map(pn),Z=M.reduce(kn,{}),re=F.reduce(kn,{}),oe=K.slice(),ue=Object.create(null),W,de,ce,Ee,Te,ze,xe;for(W=0,de=0;W<K.length;W++)ce=K[W],Object.prototype.hasOwnProperty.call(re,ce)?de++:(B.push({command:qt.removeLayer,args:[ce]}),oe.splice(oe.indexOf(ce,de),1));for(W=0,de=0;W<G.length;W++)ce=G[G.length-1-W],oe[oe.length-1-W]!==ce&&(Object.prototype.hasOwnProperty.call(Z,ce)?(B.push({command:qt.removeLayer,args:[ce]}),oe.splice(oe.lastIndexOf(ce,oe.length-de),1)):de++,ze=oe[oe.length-W],B.push({command:qt.addLayer,args:[re[ce],ze]}),oe.splice(oe.length-W,0,ce),ue[ce]=!0);for(W=0;W<G.length;W++)if(ce=G[W],Ee=Z[ce],Te=re[ce],!ue[ce]&&!R(Ee,Te))if(R(Ee.source,Te.source)&&R(Ee["source-layer"],Te["source-layer"])&&R(Ee.type,Te.type)){for(xe in hn(Ee.layout,Te.layout,B,ce,null,qt.setLayoutProperty),hn(Ee.paint,Te.paint,B,ce,null,qt.setPaintProperty),R(Ee.filter,Te.filter)||B.push({command:qt.setFilter,args:[ce,Te.filter]}),R(Ee.minzoom,Te.minzoom)&&R(Ee.maxzoom,Te.maxzoom)||B.push({command:qt.setLayerZoomRange,args:[ce,Te.minzoom,Te.maxzoom]}),Ee)Object.prototype.hasOwnProperty.call(Ee,xe)&&xe!=="layout"&&xe!=="paint"&&xe!=="filter"&&xe!=="metadata"&&xe!=="minzoom"&&xe!=="maxzoom"&&(xe.indexOf("paint.")===0?hn(Ee[xe],Te[xe],B,ce,xe.slice(6),qt.setPaintProperty):R(Ee[xe],Te[xe])||B.push({command:qt.setLayerProperty,args:[ce,xe,Te[xe]]}));for(xe in Te)Object.prototype.hasOwnProperty.call(Te,xe)&&!Object.prototype.hasOwnProperty.call(Ee,xe)&&xe!=="layout"&&xe!=="paint"&&xe!=="filter"&&xe!=="metadata"&&xe!=="minzoom"&&xe!=="maxzoom"&&(xe.indexOf("paint.")===0?hn(Ee[xe],Te[xe],B,ce,xe.slice(6),qt.setPaintProperty):R(Ee[xe],Te[xe])||B.push({command:qt.setLayerProperty,args:[ce,xe,Te[xe]]}))}else B.push({command:qt.removeLayer,args:[ce]}),ze=oe[oe.lastIndexOf(ce)+1],B.push({command:qt.addLayer,args:[Te,ze]})}(A,g.layers,v)}catch(E){console.warn("Unable to compute style diff:",E),v=[{command:qt.setStyle,args:[g]}]}return v}(this.serialize(),t).filter(m=>!(m.command in Qr));if(l.length===0)return!1;let h=l.filter(m=>!(m.command in mr));if(h.length>0)throw new Error(`Unimplemented: ${h.map(m=>m.command).join(", ")}.`);return l.forEach(m=>{m.command!=="setTransition"&&this[m.command].apply(this,m.args)}),this.stylesheet=t,!0}addImage(t,l){if(this.getImage(t))return this.fire(new a.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,l),this._afterImageUpdated(t)}updateImage(t,l){this.imageManager.updateImage(t,l)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new a.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,l,h={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!l.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(l).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(l.type)>=0&&this._validate(a.validateStyle.source,`sources.${t}`,l,null,h))return;this.map&&this.map._collectResourceTiming&&(l.collectResourceTiming=!0);let m=this.sourceCaches[t]=new Dt(t,l,this.dispatcher);m.style=this,m.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:m.serialize(),sourceId:t})),m.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(let h in this._layers)if(this._layers[h].source===t)return this.fire(new a.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${h}" is using it.`)));let l=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],l.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),l.setEventedParent(null),l.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,l){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let h=this.sourceCaches[t].getSource();if(h.type!=="geojson")throw new Error(`geojsonSource.type is ${h.type}, which is !== 'geojson`);h.setData(l),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,l,h={}){this._checkLoaded();let m=t.id;if(this.getLayer(m))return void this.fire(new a.ErrorEvent(new Error(`Layer "${m}" already exists on this map.`)));let g;if(t.type==="custom"){if(Jt(this,a.validateCustomStyleLayer(t)))return;g=a.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(m,t.source),t=a.clone$1(t),t=a.extend(t,{source:m})),this._validate(a.validateStyle.layer,`layers.${m}`,t,{arrayIndex:-1},h))return;g=a.createStyleLayer(t),this._validateLayer(g),g.setEventedParent(this,{layer:{id:m}}),this._serializedLayers[g.id]=g.serialize()}let v=l?this._order.indexOf(l):this._order.length;if(l&&v===-1)this.fire(new a.ErrorEvent(new Error(`Cannot add layer "${m}" before non-existing layer "${l}".`)));else{if(this._order.splice(v,0,m),this._layerOrderChanged=!0,this._layers[m]=g,this._removedLayers[m]&&g.source&&g.type!=="custom"){let E=this._removedLayers[m];delete this._removedLayers[m],E.type!==g.type?this._updatedSources[g.source]="clear":(this._updatedSources[g.source]="reload",this.sourceCaches[g.source].pause())}this._updateLayer(g),g.onAdd&&g.onAdd(this.map)}}moveLayer(t,l){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new a.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===l)return;let h=this._order.indexOf(t);this._order.splice(h,1);let m=l?this._order.indexOf(l):this._order.length;l&&m===-1?this.fire(new a.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${l}".`))):(this._order.splice(m,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let l=this._layers[t];if(!l)return void this.fire(new a.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));l.setEventedParent(null);let h=this._order.indexOf(t);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=l,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],l.onRemove&&l.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,l,h){this._checkLoaded();let m=this.getLayer(t);m?m.minzoom===l&&m.maxzoom===h||(l!=null&&(m.minzoom=l),h!=null&&(m.maxzoom=h),this._updateLayer(m)):this.fire(new a.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,l,h={}){this._checkLoaded();let m=this.getLayer(t);if(m){if(!R(m.filter,l))return l==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(a.validateStyle.filter,`layers.${m.id}.filter`,l,null,h)||(m.filter=a.clone$1(l),this._updateLayer(m)))}else this.fire(new a.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return a.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,l,h,m={}){this._checkLoaded();let g=this.getLayer(t);g?R(g.getLayoutProperty(l),h)||(g.setLayoutProperty(l,h,m),this._updateLayer(g)):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,l){let h=this.getLayer(t);if(h)return h.getLayoutProperty(l);this.fire(new a.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,l,h,m={}){this._checkLoaded();let g=this.getLayer(t);g?R(g.getPaintProperty(l),h)||(g.setPaintProperty(l,h,m)&&this._updateLayer(g),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,l){return this.getLayer(t).getPaintProperty(l)}setFeatureState(t,l){this._checkLoaded();let h=t.source,m=t.sourceLayer,g=this.sourceCaches[h];if(g===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));let v=g.getSource().type;v==="geojson"&&m?this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||m?(t.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),g.setFeatureState(m,t.id,l)):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,l){this._checkLoaded();let h=t.source,m=this.sourceCaches[h];if(m===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));let g=m.getSource().type,v=g==="vector"?t.sourceLayer:void 0;g!=="vector"||v?l&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(v,t.id,l):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let l=t.source,h=t.sourceLayer,m=this.sourceCaches[l];if(m!==void 0)return m.getSource().type!=="vector"||h?(t.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),m.getFeatureState(h,t.id)):void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.ErrorEvent(new Error(`The source '${l}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:a.mapObject(this.sourceCaches,t=>t.serialize()),layers:this._serializeLayers(this._order)},t=>t!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(t){let l=v=>this._layers[v].type==="fill-extrusion",h={},m=[];for(let v=this._order.length-1;v>=0;v--){let E=this._order[v];if(l(E)){h[E]=v;for(let S of t){let A=S[E];if(A)for(let M of A)m.push(M)}}}m.sort((v,E)=>E.intersectionZ-v.intersectionZ);let g=[];for(let v=this._order.length-1;v>=0;v--){let E=this._order[v];if(l(E))for(let S=m.length-1;S>=0;S--){let A=m[S].feature;if(h[A.layer.id]<v)break;g.push(A),m.pop()}else for(let S of t){let A=S[E];if(A)for(let M of A)g.push(M.feature)}}return g}queryRenderedFeatures(t,l,h){l&&l.filter&&this._validate(a.validateStyle.filter,"queryRenderedFeatures.filter",l.filter,null,l);let m={};if(l&&l.layers){if(!Array.isArray(l.layers))return this.fire(new a.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(let v of l.layers){let E=this._layers[v];if(!E)return this.fire(new a.ErrorEvent(new Error(`The layer '${v}' does not exist in the map's style and cannot be queried for features.`))),[];m[E.source]=!0}}let g=[];l.availableImages=this._availableImages;for(let v in this.sourceCaches)l.layers&&!m[v]||g.push(ut(this.sourceCaches[v],this._layers,this._serializedLayers,t,l,h));return this.placement&&g.push(function(v,E,S,A,M,F,B){let K={},G=F.queryRenderedSymbols(A),Z=[];for(let re of Object.keys(G).map(Number))Z.push(B[re]);Z.sort(lt);for(let re of Z){let oe=re.featureIndex.lookupSymbolFeatures(G[re.bucketInstanceId],E,re.bucketIndex,re.sourceLayerIndex,M.filter,M.layers,M.availableImages,v);for(let ue in oe){let W=K[ue]=K[ue]||[],de=oe[ue];de.sort((ce,Ee)=>{let Te=re.featureSortOrder;if(Te){let ze=Te.indexOf(ce.featureIndex);return Te.indexOf(Ee.featureIndex)-ze}return Ee.featureIndex-ce.featureIndex});for(let ce of de)W.push(ce)}}for(let re in K)K[re].forEach(oe=>{let ue=oe.feature,W=S[v[re].source].getFeatureState(ue.layer["source-layer"],ue.id);ue.source=ue.layer.source,ue.layer["source-layer"]&&(ue.sourceLayer=ue.layer["source-layer"]),ue.state=W});return K}(this._layers,this._serializedLayers,this.sourceCaches,t,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(g)}querySourceFeatures(t,l){l&&l.filter&&this._validate(a.validateStyle.filter,"querySourceFeatures.filter",l.filter,null,l);let h=this.sourceCaches[t];return h?function(m,g){let v=m.getRenderableIds().map(A=>m.getTileByID(A)),E=[],S={};for(let A=0;A<v.length;A++){let M=v[A],F=M.tileID.canonical.key;S[F]||(S[F]=!0,M.querySourceFeatures(E,g))}return E}(h,l):[]}addSourceType(t,l,h){return mi.getSourceType(t)?h(new Error(`A source type called "${t}" already exists.`)):(mi.setSourceType(t,l),l.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:l.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(t,l={}){this._checkLoaded();let h=this.light.getLight(),m=!1;for(let v in t)if(!R(t[v],h[v])){m=!0;break}if(!m)return;let g={now:a.exported.now(),transition:a.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,l),this.light.updateTransitions(g)}_validate(t,l,h,m,g={}){return(!g||g.validate!==!1)&&Jt(this,t.call(a.validateStyle,a.extend({key:l,style:this.serialize(),value:h,styleSpec:a.spec},m)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let t in this._layers)this._layers[t].setEventedParent(null);for(let t in this.sourceCaches){let l=this.sourceCaches[t];l.setEventedParent(null),l.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(let l in this.sourceCaches)this.sourceCaches[l].update(t,this.terrain)}_generateCollisionBoxes(){for(let t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,l,h,m,g=!1){let v=!1,E=!1,S={};for(let A of this._order){let M=this._layers[A];if(M.type!=="symbol")continue;if(!S[M.source]){let B=this.sourceCaches[M.source];S[M.source]=B.getRenderableIds(!0).map(K=>B.getTileByID(K)).sort((K,G)=>G.tileID.overscaledZ-K.tileID.overscaledZ||(K.tileID.isLessThan(G.tileID)?-1:1))}let F=this.crossTileSymbolIndex.addLayer(M,S[M.source],t.center.lng);v=v||F}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((g=g||this._layerOrderChanged||h===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),t.zoom))&&(this.pauseablePlacement=new ge(t,this.terrain,this._order,g,l,h,m,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,S),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),E=!0),v&&this.pauseablePlacement.placement.setStale()),E||v)for(let A of this._order){let M=this._layers[A];M.type==="symbol"&&this.placement.updateLayerOpacities(M,S[M.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,l,h){this.imageManager.getImages(l.icons,h),this._updateTilesForChangedImages();let m=this.sourceCaches[l.source];m&&m.setDependencies(l.tileID.key,l.type,l.icons)}getGlyphs(t,l,h){this.glyphManager.getGlyphs(l.stacks,h)}getResource(t,l,h){return a.makeRequest(l,h)}}mi.getSourceType=function(d){return Be[d]},mi.setSourceType=function(d,t){Be[d]=t},mi.registerForPluginStateChange=a.registerForPluginStateChange;var Xo="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";let Is={prelude:yr(`#ifdef GL_ES
18
- precision mediump float;
19
- #else
20
- #if !defined(lowp)
21
- #define lowp
22
- #endif
23
- #if !defined(mediump)
24
- #define mediump
25
- #endif
26
- #if !defined(highp)
27
- #define highp
28
- #endif
29
- #endif`,`#ifdef GL_ES
30
- precision highp float;
31
- #else
32
- #if !defined(lowp)
33
- #define lowp
34
- #endif
35
- #if !defined(mediump)
36
- #define mediump
37
- #endif
38
- #if !defined(highp)
39
- #define highp
40
- #endif
41
- #endif
42
- vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
43
- );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
44
- #ifdef TERRAIN3D
45
- uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
46
- #endif
47
- const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
48
- #ifdef TERRAIN3D
49
- highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
50
- #else
51
- return 1.0;
52
- #endif
53
- }float calculate_visibility(vec4 pos) {
54
- #ifdef TERRAIN3D
55
- vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
56
- #else
57
- return 1.0;
58
- #endif
59
- }float ele(vec2 pos) {
60
- #ifdef TERRAIN3D
61
- vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
62
- #else
63
- return 0.0;
64
- #endif
65
- }float get_elevation(vec2 pos) {
66
- #ifdef TERRAIN3D
67
- vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration;
68
- #else
69
- return 0.0;
70
- #endif
71
- }`),background:yr(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
72
- #ifdef OVERDRAW_INSPECTOR
73
- gl_FragColor=vec4(1.0);
74
- #endif
75
- }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:yr(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
76
- #ifdef OVERDRAW_INSPECTOR
77
- gl_FragColor=vec4(1.0);
78
- #endif
79
- }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:yr(`varying vec3 v_data;varying float v_visibility;
80
- #pragma mapbox: define highp vec4 color
81
- #pragma mapbox: define mediump float radius
82
- #pragma mapbox: define lowp float blur
83
- #pragma mapbox: define lowp float opacity
84
- #pragma mapbox: define highp vec4 stroke_color
85
- #pragma mapbox: define mediump float stroke_width
86
- #pragma mapbox: define lowp float stroke_opacity
87
- void main() {
88
- #pragma mapbox: initialize highp vec4 color
89
- #pragma mapbox: initialize mediump float radius
90
- #pragma mapbox: initialize lowp float blur
91
- #pragma mapbox: initialize lowp float opacity
92
- #pragma mapbox: initialize highp vec4 stroke_color
93
- #pragma mapbox: initialize mediump float stroke_width
94
- #pragma mapbox: initialize lowp float stroke_opacity
95
- vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
96
- #ifdef OVERDRAW_INSPECTOR
97
- gl_FragColor=vec4(1.0);
98
- #endif
99
- }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
100
- #pragma mapbox: define highp vec4 color
101
- #pragma mapbox: define mediump float radius
102
- #pragma mapbox: define lowp float blur
103
- #pragma mapbox: define lowp float opacity
104
- #pragma mapbox: define highp vec4 stroke_color
105
- #pragma mapbox: define mediump float stroke_width
106
- #pragma mapbox: define lowp float stroke_opacity
107
- void main(void) {
108
- #pragma mapbox: initialize highp vec4 color
109
- #pragma mapbox: initialize mediump float radius
110
- #pragma mapbox: initialize lowp float blur
111
- #pragma mapbox: initialize lowp float opacity
112
- #pragma mapbox: initialize highp vec4 stroke_color
113
- #pragma mapbox: initialize mediump float stroke_width
114
- #pragma mapbox: initialize lowp float stroke_opacity
115
- vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:yr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:yr(`uniform highp float u_intensity;varying vec2 v_extrude;
116
- #pragma mapbox: define highp float weight
117
- #define GAUSS_COEF 0.3989422804014327
118
- void main() {
119
- #pragma mapbox: initialize highp float weight
120
- float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
121
- #ifdef OVERDRAW_INSPECTOR
122
- gl_FragColor=vec4(1.0);
123
- #endif
124
- }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
125
- #pragma mapbox: define highp float weight
126
- #pragma mapbox: define mediump float radius
127
- const highp float ZERO=1.0/255.0/16.0;
128
- #define GAUSS_COEF 0.3989422804014327
129
- void main(void) {
130
- #pragma mapbox: initialize highp float weight
131
- #pragma mapbox: initialize mediump float radius
132
- vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:yr(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
133
- #ifdef OVERDRAW_INSPECTOR
134
- gl_FragColor=vec4(0.0);
135
- #endif
136
- }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:yr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:yr(`#pragma mapbox: define highp vec4 color
137
- #pragma mapbox: define lowp float opacity
138
- void main() {
139
- #pragma mapbox: initialize highp vec4 color
140
- #pragma mapbox: initialize lowp float opacity
141
- gl_FragColor=color*opacity;
142
- #ifdef OVERDRAW_INSPECTOR
143
- gl_FragColor=vec4(1.0);
144
- #endif
145
- }`,`attribute vec2 a_pos;uniform mat4 u_matrix;
146
- #pragma mapbox: define highp vec4 color
147
- #pragma mapbox: define lowp float opacity
148
- void main() {
149
- #pragma mapbox: initialize highp vec4 color
150
- #pragma mapbox: initialize lowp float opacity
151
- gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:yr(`varying vec2 v_pos;
152
- #pragma mapbox: define highp vec4 outline_color
153
- #pragma mapbox: define lowp float opacity
154
- void main() {
155
- #pragma mapbox: initialize highp vec4 outline_color
156
- #pragma mapbox: initialize lowp float opacity
157
- float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
158
- #ifdef OVERDRAW_INSPECTOR
159
- gl_FragColor=vec4(1.0);
160
- #endif
161
- }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
162
- #pragma mapbox: define highp vec4 outline_color
163
- #pragma mapbox: define lowp float opacity
164
- void main() {
165
- #pragma mapbox: initialize highp vec4 outline_color
166
- #pragma mapbox: initialize lowp float opacity
167
- gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:yr(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
168
- #pragma mapbox: define lowp float opacity
169
- #pragma mapbox: define lowp vec4 pattern_from
170
- #pragma mapbox: define lowp vec4 pattern_to
171
- void main() {
172
- #pragma mapbox: initialize lowp float opacity
173
- #pragma mapbox: initialize mediump vec4 pattern_from
174
- #pragma mapbox: initialize mediump vec4 pattern_to
175
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
176
- #ifdef OVERDRAW_INSPECTOR
177
- gl_FragColor=vec4(1.0);
178
- #endif
179
- }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
180
- #pragma mapbox: define lowp float opacity
181
- #pragma mapbox: define lowp vec4 pattern_from
182
- #pragma mapbox: define lowp vec4 pattern_to
183
- #pragma mapbox: define lowp float pixel_ratio_from
184
- #pragma mapbox: define lowp float pixel_ratio_to
185
- void main() {
186
- #pragma mapbox: initialize lowp float opacity
187
- #pragma mapbox: initialize mediump vec4 pattern_from
188
- #pragma mapbox: initialize mediump vec4 pattern_to
189
- #pragma mapbox: initialize lowp float pixel_ratio_from
190
- #pragma mapbox: initialize lowp float pixel_ratio_to
191
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:yr(`#ifdef GL_ES
192
- precision highp float;
193
- #endif
194
- uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
195
- #pragma mapbox: define lowp float opacity
196
- #pragma mapbox: define lowp vec4 pattern_from
197
- #pragma mapbox: define lowp vec4 pattern_to
198
- void main() {
199
- #pragma mapbox: initialize lowp float opacity
200
- #pragma mapbox: initialize mediump vec4 pattern_from
201
- #pragma mapbox: initialize mediump vec4 pattern_to
202
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
203
- #ifdef OVERDRAW_INSPECTOR
204
- gl_FragColor=vec4(1.0);
205
- #endif
206
- }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
207
- #pragma mapbox: define lowp float opacity
208
- #pragma mapbox: define lowp vec4 pattern_from
209
- #pragma mapbox: define lowp vec4 pattern_to
210
- #pragma mapbox: define lowp float pixel_ratio_from
211
- #pragma mapbox: define lowp float pixel_ratio_to
212
- void main() {
213
- #pragma mapbox: initialize lowp float opacity
214
- #pragma mapbox: initialize mediump vec4 pattern_from
215
- #pragma mapbox: initialize mediump vec4 pattern_to
216
- #pragma mapbox: initialize lowp float pixel_ratio_from
217
- #pragma mapbox: initialize lowp float pixel_ratio_to
218
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:yr(`varying vec4 v_color;void main() {gl_FragColor=v_color;
219
- #ifdef OVERDRAW_INSPECTOR
220
- gl_FragColor=vec4(1.0);
221
- #endif
222
- }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
223
- #ifdef TERRAIN3D
224
- attribute vec2 a_centroid;
225
- #endif
226
- varying vec4 v_color;
227
- #pragma mapbox: define highp float base
228
- #pragma mapbox: define highp float height
229
- #pragma mapbox: define highp vec4 color
230
- void main() {
231
- #pragma mapbox: initialize highp float base
232
- #pragma mapbox: initialize highp float height
233
- #pragma mapbox: initialize highp vec4 color
234
- vec3 normal=a_normal_ed.xyz;
235
- #ifdef TERRAIN3D
236
- float baseDelta=10.0;float ele=get_elevation(a_centroid);
237
- #else
238
- float baseDelta=0.0;float ele=0.0;
239
- #endif
240
- base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:yr(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
241
- #pragma mapbox: define lowp float base
242
- #pragma mapbox: define lowp float height
243
- #pragma mapbox: define lowp vec4 pattern_from
244
- #pragma mapbox: define lowp vec4 pattern_to
245
- #pragma mapbox: define lowp float pixel_ratio_from
246
- #pragma mapbox: define lowp float pixel_ratio_to
247
- void main() {
248
- #pragma mapbox: initialize lowp float base
249
- #pragma mapbox: initialize lowp float height
250
- #pragma mapbox: initialize mediump vec4 pattern_from
251
- #pragma mapbox: initialize mediump vec4 pattern_to
252
- #pragma mapbox: initialize lowp float pixel_ratio_from
253
- #pragma mapbox: initialize lowp float pixel_ratio_to
254
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
255
- #ifdef OVERDRAW_INSPECTOR
256
- gl_FragColor=vec4(1.0);
257
- #endif
258
- }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
259
- #ifdef TERRAIN3D
260
- attribute vec2 a_centroid;
261
- #endif
262
- varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
263
- #pragma mapbox: define lowp float base
264
- #pragma mapbox: define lowp float height
265
- #pragma mapbox: define lowp vec4 pattern_from
266
- #pragma mapbox: define lowp vec4 pattern_to
267
- #pragma mapbox: define lowp float pixel_ratio_from
268
- #pragma mapbox: define lowp float pixel_ratio_to
269
- void main() {
270
- #pragma mapbox: initialize lowp float base
271
- #pragma mapbox: initialize lowp float height
272
- #pragma mapbox: initialize mediump vec4 pattern_from
273
- #pragma mapbox: initialize mediump vec4 pattern_to
274
- #pragma mapbox: initialize lowp float pixel_ratio_from
275
- #pragma mapbox: initialize lowp float pixel_ratio_to
276
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
277
- #ifdef TERRAIN3D
278
- float baseDelta=10.0;float ele=get_elevation(a_centroid);
279
- #else
280
- float baseDelta=0.0;float ele=0.0;
281
- #endif
282
- base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
283
- ? a_pos
284
- : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:yr(`#ifdef GL_ES
285
- precision highp float;
286
- #endif
287
- uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
288
- #ifdef OVERDRAW_INSPECTOR
289
- gl_FragColor=vec4(1.0);
290
- #endif
291
- }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:yr(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
292
- #define PI 3.141592653589793
293
- void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
294
- #ifdef OVERDRAW_INSPECTOR
295
- gl_FragColor=vec4(1.0);
296
- #endif
297
- }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:yr(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
298
- #pragma mapbox: define highp vec4 color
299
- #pragma mapbox: define lowp float blur
300
- #pragma mapbox: define lowp float opacity
301
- void main() {
302
- #pragma mapbox: initialize highp vec4 color
303
- #pragma mapbox: initialize lowp float blur
304
- #pragma mapbox: initialize lowp float opacity
305
- float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
306
- #ifdef OVERDRAW_INSPECTOR
307
- gl_FragColor=vec4(1.0);
308
- #endif
309
- }`,`
310
- #define scale 0.015873016
311
- attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
312
- #pragma mapbox: define highp vec4 color
313
- #pragma mapbox: define lowp float blur
314
- #pragma mapbox: define lowp float opacity
315
- #pragma mapbox: define mediump float gapwidth
316
- #pragma mapbox: define lowp float offset
317
- #pragma mapbox: define mediump float width
318
- void main() {
319
- #pragma mapbox: initialize highp vec4 color
320
- #pragma mapbox: initialize lowp float blur
321
- #pragma mapbox: initialize lowp float opacity
322
- #pragma mapbox: initialize mediump float gapwidth
323
- #pragma mapbox: initialize lowp float offset
324
- #pragma mapbox: initialize mediump float width
325
- float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
326
- #ifdef TERRAIN3D
327
- v_gamma_scale=1.0;
328
- #else
329
- float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
330
- #endif
331
- v_width2=vec2(outset,inset);}`),lineGradient:yr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
332
- #pragma mapbox: define lowp float blur
333
- #pragma mapbox: define lowp float opacity
334
- void main() {
335
- #pragma mapbox: initialize lowp float blur
336
- #pragma mapbox: initialize lowp float opacity
337
- float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
338
- #ifdef OVERDRAW_INSPECTOR
339
- gl_FragColor=vec4(1.0);
340
- #endif
341
- }`,`
342
- #define scale 0.015873016
343
- attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
344
- #pragma mapbox: define lowp float blur
345
- #pragma mapbox: define lowp float opacity
346
- #pragma mapbox: define mediump float gapwidth
347
- #pragma mapbox: define lowp float offset
348
- #pragma mapbox: define mediump float width
349
- void main() {
350
- #pragma mapbox: initialize lowp float blur
351
- #pragma mapbox: initialize lowp float opacity
352
- #pragma mapbox: initialize mediump float gapwidth
353
- #pragma mapbox: initialize lowp float offset
354
- #pragma mapbox: initialize mediump float width
355
- float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
356
- #ifdef TERRAIN3D
357
- v_gamma_scale=1.0;
358
- #else
359
- float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
360
- #endif
361
- v_width2=vec2(outset,inset);}`),linePattern:yr(`#ifdef GL_ES
362
- precision highp float;
363
- #endif
364
- uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
365
- #pragma mapbox: define lowp vec4 pattern_from
366
- #pragma mapbox: define lowp vec4 pattern_to
367
- #pragma mapbox: define lowp float pixel_ratio_from
368
- #pragma mapbox: define lowp float pixel_ratio_to
369
- #pragma mapbox: define lowp float blur
370
- #pragma mapbox: define lowp float opacity
371
- void main() {
372
- #pragma mapbox: initialize mediump vec4 pattern_from
373
- #pragma mapbox: initialize mediump vec4 pattern_to
374
- #pragma mapbox: initialize lowp float pixel_ratio_from
375
- #pragma mapbox: initialize lowp float pixel_ratio_to
376
- #pragma mapbox: initialize lowp float blur
377
- #pragma mapbox: initialize lowp float opacity
378
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
379
- #ifdef OVERDRAW_INSPECTOR
380
- gl_FragColor=vec4(1.0);
381
- #endif
382
- }`,`
383
- #define scale 0.015873016
384
- #define LINE_DISTANCE_SCALE 2.0
385
- attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
386
- #pragma mapbox: define lowp float blur
387
- #pragma mapbox: define lowp float opacity
388
- #pragma mapbox: define lowp float offset
389
- #pragma mapbox: define mediump float gapwidth
390
- #pragma mapbox: define mediump float width
391
- #pragma mapbox: define lowp float floorwidth
392
- #pragma mapbox: define lowp vec4 pattern_from
393
- #pragma mapbox: define lowp vec4 pattern_to
394
- #pragma mapbox: define lowp float pixel_ratio_from
395
- #pragma mapbox: define lowp float pixel_ratio_to
396
- void main() {
397
- #pragma mapbox: initialize lowp float blur
398
- #pragma mapbox: initialize lowp float opacity
399
- #pragma mapbox: initialize lowp float offset
400
- #pragma mapbox: initialize mediump float gapwidth
401
- #pragma mapbox: initialize mediump float width
402
- #pragma mapbox: initialize lowp float floorwidth
403
- #pragma mapbox: initialize mediump vec4 pattern_from
404
- #pragma mapbox: initialize mediump vec4 pattern_to
405
- #pragma mapbox: initialize lowp float pixel_ratio_from
406
- #pragma mapbox: initialize lowp float pixel_ratio_to
407
- float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
408
- #ifdef TERRAIN3D
409
- v_gamma_scale=1.0;
410
- #else
411
- float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
412
- #endif
413
- v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:yr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
414
- #pragma mapbox: define highp vec4 color
415
- #pragma mapbox: define lowp float blur
416
- #pragma mapbox: define lowp float opacity
417
- #pragma mapbox: define mediump float width
418
- #pragma mapbox: define lowp float floorwidth
419
- void main() {
420
- #pragma mapbox: initialize highp vec4 color
421
- #pragma mapbox: initialize lowp float blur
422
- #pragma mapbox: initialize lowp float opacity
423
- #pragma mapbox: initialize mediump float width
424
- #pragma mapbox: initialize lowp float floorwidth
425
- float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
426
- #ifdef OVERDRAW_INSPECTOR
427
- gl_FragColor=vec4(1.0);
428
- #endif
429
- }`,`
430
- #define scale 0.015873016
431
- #define LINE_DISTANCE_SCALE 2.0
432
- attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
433
- #pragma mapbox: define highp vec4 color
434
- #pragma mapbox: define lowp float blur
435
- #pragma mapbox: define lowp float opacity
436
- #pragma mapbox: define mediump float gapwidth
437
- #pragma mapbox: define lowp float offset
438
- #pragma mapbox: define mediump float width
439
- #pragma mapbox: define lowp float floorwidth
440
- void main() {
441
- #pragma mapbox: initialize highp vec4 color
442
- #pragma mapbox: initialize lowp float blur
443
- #pragma mapbox: initialize lowp float opacity
444
- #pragma mapbox: initialize mediump float gapwidth
445
- #pragma mapbox: initialize lowp float offset
446
- #pragma mapbox: initialize mediump float width
447
- #pragma mapbox: initialize lowp float floorwidth
448
- float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
449
- #ifdef TERRAIN3D
450
- v_gamma_scale=1.0;
451
- #else
452
- float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
453
- #endif
454
- v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:yr(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
455
- #ifdef OVERDRAW_INSPECTOR
456
- gl_FragColor=vec4(1.0);
457
- #endif
458
- }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:yr(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
459
- #pragma mapbox: define lowp float opacity
460
- void main() {
461
- #pragma mapbox: initialize lowp float opacity
462
- lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
463
- #ifdef OVERDRAW_INSPECTOR
464
- gl_FragColor=vec4(1.0);
465
- #endif
466
- }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
467
- #pragma mapbox: define lowp float opacity
468
- void main() {
469
- #pragma mapbox: initialize lowp float opacity
470
- vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
471
- camera_to_anchor_distance/u_camera_to_center_distance :
472
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:yr(`#define SDF_PX 8.0
473
- uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
474
- #pragma mapbox: define highp vec4 fill_color
475
- #pragma mapbox: define highp vec4 halo_color
476
- #pragma mapbox: define lowp float opacity
477
- #pragma mapbox: define lowp float halo_width
478
- #pragma mapbox: define lowp float halo_blur
479
- void main() {
480
- #pragma mapbox: initialize highp vec4 fill_color
481
- #pragma mapbox: initialize highp vec4 halo_color
482
- #pragma mapbox: initialize lowp float opacity
483
- #pragma mapbox: initialize lowp float halo_width
484
- #pragma mapbox: initialize lowp float halo_blur
485
- float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
486
- #ifdef OVERDRAW_INSPECTOR
487
- gl_FragColor=vec4(1.0);
488
- #endif
489
- }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
490
- #pragma mapbox: define highp vec4 fill_color
491
- #pragma mapbox: define highp vec4 halo_color
492
- #pragma mapbox: define lowp float opacity
493
- #pragma mapbox: define lowp float halo_width
494
- #pragma mapbox: define lowp float halo_blur
495
- void main() {
496
- #pragma mapbox: initialize highp vec4 fill_color
497
- #pragma mapbox: initialize highp vec4 halo_color
498
- #pragma mapbox: initialize lowp float opacity
499
- #pragma mapbox: initialize lowp float halo_width
500
- #pragma mapbox: initialize lowp float halo_blur
501
- vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
502
- camera_to_anchor_distance/u_camera_to_center_distance :
503
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:yr(`#define SDF_PX 8.0
504
- #define SDF 1.0
505
- #define ICON 0.0
506
- uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
507
- #pragma mapbox: define highp vec4 fill_color
508
- #pragma mapbox: define highp vec4 halo_color
509
- #pragma mapbox: define lowp float opacity
510
- #pragma mapbox: define lowp float halo_width
511
- #pragma mapbox: define lowp float halo_blur
512
- void main() {
513
- #pragma mapbox: initialize highp vec4 fill_color
514
- #pragma mapbox: initialize highp vec4 halo_color
515
- #pragma mapbox: initialize lowp float opacity
516
- #pragma mapbox: initialize lowp float halo_width
517
- #pragma mapbox: initialize lowp float halo_blur
518
- float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
519
- #ifdef OVERDRAW_INSPECTOR
520
- gl_FragColor=vec4(1.0);
521
- #endif
522
- return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
523
- #ifdef OVERDRAW_INSPECTOR
524
- gl_FragColor=vec4(1.0);
525
- #endif
526
- }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
527
- #pragma mapbox: define highp vec4 fill_color
528
- #pragma mapbox: define highp vec4 halo_color
529
- #pragma mapbox: define lowp float opacity
530
- #pragma mapbox: define lowp float halo_width
531
- #pragma mapbox: define lowp float halo_blur
532
- void main() {
533
- #pragma mapbox: initialize highp vec4 fill_color
534
- #pragma mapbox: initialize highp vec4 halo_color
535
- #pragma mapbox: initialize lowp float opacity
536
- #pragma mapbox: initialize lowp float halo_width
537
- #pragma mapbox: initialize lowp float halo_blur
538
- vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
539
- camera_to_anchor_distance/u_camera_to_center_distance :
540
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:yr("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Xo),terrainDepth:yr("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Xo),terrainCoords:yr("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Xo)};function yr(d,t){let l=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=t.match(/attribute ([\w]+) ([\w]+)/g),m=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),v=g?g.concat(m):m,E={};return{fragmentSource:d=d.replace(l,(S,A,M,F,B)=>(E[B]=!0,A==="define"?`
541
- #ifndef HAS_UNIFORM_u_${B}
542
- varying ${M} ${F} ${B};
543
- #else
544
- uniform ${M} ${F} u_${B};
545
- #endif
546
- `:`
547
- #ifdef HAS_UNIFORM_u_${B}
548
- ${M} ${F} ${B} = u_${B};
549
- #endif
550
- `)),vertexSource:t=t.replace(l,(S,A,M,F,B)=>{let K=F==="float"?"vec2":"vec4",G=B.match(/color/)?"color":K;return E[B]?A==="define"?`
551
- #ifndef HAS_UNIFORM_u_${B}
552
- uniform lowp float u_${B}_t;
553
- attribute ${M} ${K} a_${B};
554
- varying ${M} ${F} ${B};
555
- #else
556
- uniform ${M} ${F} u_${B};
557
- #endif
558
- `:G==="vec4"?`
559
- #ifndef HAS_UNIFORM_u_${B}
560
- ${B} = a_${B};
561
- #else
562
- ${M} ${F} ${B} = u_${B};
563
- #endif
564
- `:`
565
- #ifndef HAS_UNIFORM_u_${B}
566
- ${B} = unpack_mix_${G}(a_${B}, u_${B}_t);
567
- #else
568
- ${M} ${F} ${B} = u_${B};
569
- #endif
570
- `:A==="define"?`
571
- #ifndef HAS_UNIFORM_u_${B}
572
- uniform lowp float u_${B}_t;
573
- attribute ${M} ${K} a_${B};
574
- #else
575
- uniform ${M} ${F} u_${B};
576
- #endif
577
- `:G==="vec4"?`
578
- #ifndef HAS_UNIFORM_u_${B}
579
- ${M} ${F} ${B} = a_${B};
580
- #else
581
- ${M} ${F} ${B} = u_${B};
582
- #endif
583
- `:`
584
- #ifndef HAS_UNIFORM_u_${B}
585
- ${M} ${F} ${B} = unpack_mix_${G}(a_${B}, u_${B}_t);
586
- #else
587
- ${M} ${F} ${B} = u_${B};
588
- #endif
589
- `}),staticAttributes:h,staticUniforms:v}}class Ll{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,l,h,m,g,v,E,S,A){this.context=t;let M=this.boundPaintVertexBuffers.length!==m.length;for(let F=0;!M&&F<m.length;F++)this.boundPaintVertexBuffers[F]!==m[F]&&(M=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===l&&this.boundLayoutVertexBuffer===h&&!M&&this.boundIndexBuffer===g&&this.boundVertexOffset===v&&this.boundDynamicVertexBuffer===E&&this.boundDynamicVertexBuffer2===S&&this.boundDynamicVertexBuffer3===A?(t.bindVertexArrayOES.set(this.vao),E&&E.bind(),g&&g.dynamicDraw&&g.bind(),S&&S.bind(),A&&A.bind()):this.freshBind(l,h,m,g,v,E,S,A)}freshBind(t,l,h,m,g,v,E,S){let A,M=t.numAttributes,F=this.context,B=F.gl;if(F.extVertexArrayObject)this.vao&&this.destroy(),this.vao=F.extVertexArrayObject.createVertexArrayOES(),F.bindVertexArrayOES.set(this.vao),A=0,this.boundProgram=t,this.boundLayoutVertexBuffer=l,this.boundPaintVertexBuffers=h,this.boundIndexBuffer=m,this.boundVertexOffset=g,this.boundDynamicVertexBuffer=v,this.boundDynamicVertexBuffer2=E,this.boundDynamicVertexBuffer3=S;else{A=F.currentNumAttributes||0;for(let K=M;K<A;K++)B.disableVertexAttribArray(K)}l.enableAttributes(B,t);for(let K of h)K.enableAttributes(B,t);v&&v.enableAttributes(B,t),E&&E.enableAttributes(B,t),S&&S.enableAttributes(B,t),l.bind(),l.setVertexAttribPointers(B,t,g);for(let K of h)K.bind(),K.setVertexAttribPointers(B,t,g);v&&(v.bind(),v.setVertexAttribPointers(B,t,g)),m&&m.bind(),E&&(E.bind(),E.setVertexAttribPointers(B,t,g)),S&&(S.bind(),S.setVertexAttribPointers(B,t,g)),F.currentNumAttributes=M}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Bl(d){let t=[];for(let l=0;l<d.length;l++){if(d[l]===null)continue;let h=d[l].split(" ");t.push(h.pop())}return t}class zc{constructor(t,l,h,m,g,v,E){let S=t.gl;this.program=S.createProgram();let A=Bl(h.staticAttributes),M=m?m.getBinderAttributes():[],F=A.concat(M),B=Is.prelude.staticUniforms?Bl(Is.prelude.staticUniforms):[],K=h.staticUniforms?Bl(h.staticUniforms):[],G=m?m.getBinderUniforms():[],Z=B.concat(K).concat(G),re=[];for(let Te of Z)re.indexOf(Te)<0&&re.push(Te);let oe=m?m.defines():[];v&&oe.push("#define OVERDRAW_INSPECTOR;"),E&&oe.push("#define TERRAIN3D;");let ue=oe.concat(Is.prelude.fragmentSource,h.fragmentSource).join(`
590
- `),W=oe.concat(Is.prelude.vertexSource,h.vertexSource).join(`
591
- `),de=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(de,ue),S.compileShader(de),S.attachShader(this.program,de);let ce=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(ce,W),S.compileShader(ce),S.attachShader(this.program,ce),this.attributes={};let Ee={};this.numAttributes=F.length;for(let Te=0;Te<this.numAttributes;Te++)F[Te]&&(S.bindAttribLocation(this.program,Te,F[Te]),this.attributes[F[Te]]=Te);S.linkProgram(this.program),S.deleteShader(ce),S.deleteShader(de);for(let Te=0;Te<re.length;Te++){let ze=re[Te];if(ze&&!Ee[ze]){let xe=S.getUniformLocation(this.program,ze);xe&&(Ee[ze]=xe)}}this.fixedUniforms=g(t,Ee),this.terrainUniforms=((Te,ze)=>({u_depth:new a.Uniform1i(Te,ze.u_depth),u_terrain:new a.Uniform1i(Te,ze.u_terrain),u_terrain_dim:new a.Uniform1f(Te,ze.u_terrain_dim),u_terrain_matrix:new a.UniformMatrix4f(Te,ze.u_terrain_matrix),u_terrain_unpack:new a.Uniform4f(Te,ze.u_terrain_unpack),u_terrain_offset:new a.Uniform1f(Te,ze.u_terrain_offset),u_terrain_exaggeration:new a.Uniform1f(Te,ze.u_terrain_exaggeration)}))(t,Ee),this.binderUniforms=m?m.getUniforms(t,Ee):[]}draw(t,l,h,m,g,v,E,S,A,M,F,B,K,G,Z,re,oe,ue){let W=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(h),t.setStencilMode(m),t.setColorMode(g),t.setCullFace(v),S){t.activeTexture.set(W.TEXTURE2),W.bindTexture(W.TEXTURE_2D,S.depthTexture),t.activeTexture.set(W.TEXTURE3),W.bindTexture(W.TEXTURE_2D,S.texture);for(let ce in this.terrainUniforms)this.terrainUniforms[ce].set(S[ce])}for(let ce in this.fixedUniforms)this.fixedUniforms[ce].set(E[ce]);Z&&Z.setUniforms(t,this.binderUniforms,K,{zoom:G});let de=0;switch(l){case W.LINES:de=2;break;case W.TRIANGLES:de=3;break;case W.LINE_STRIP:de=1}for(let ce of B.get()){let Ee=ce.vaos||(ce.vaos={});(Ee[A]||(Ee[A]=new Ll)).bind(t,this,M,Z?Z.getPaintVertexBuffers():[],F,ce.vertexOffset,re,oe,ue),W.drawElements(l,ce.primitiveLength*de,W.UNSIGNED_SHORT,ce.primitiveOffset*de*2)}}}function Oc(d,t,l){let h=1/Pt(l,1,t.transform.tileZoom),m=Math.pow(2,l.tileID.overscaledZ),g=l.tileSize*Math.pow(2,t.transform.tileZoom)/m,v=g*(l.tileID.canonical.x+l.tileID.wrap*m),E=g*l.tileID.canonical.y;return{u_image:0,u_texsize:l.imageAtlasTexture.size,u_scale:[h,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[v>>16,E>>16],u_pixel_coord_lower:[65535&v,65535&E]}}let Nl=(d,t,l,h)=>{let m=t.style.light,g=m.properties.get("position"),v=[g.x,g.y,g.z],E=a.create$1();m.properties.get("anchor")==="viewport"&&a.fromRotation(E,-t.transform.angle),a.transformMat3(v,v,E);let S=m.properties.get("color");return{u_matrix:d,u_lightpos:v,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_vertical_gradient:+l,u_opacity:h}},ed=(d,t,l,h,m,g,v)=>a.extend(Nl(d,t,l,h),Oc(g,t,v),{u_height_factor:-Math.pow(2,m.overscaledZ)/v.tileSize/8}),ga=d=>({u_matrix:d}),jl=(d,t,l,h)=>a.extend(ga(d),Oc(l,t,h)),Dc=(d,t)=>({u_matrix:d,u_world:t}),Fc=(d,t,l,h,m)=>a.extend(jl(d,t,l,h),{u_world:m}),Rc=(d,t,l,h)=>{let m=d.transform,g,v;if(h.paint.get("circle-pitch-alignment")==="map"){let E=Pt(l,1,m.zoom);g=!0,v=[E,E]}else g=!1,v=m.pixelsToGLUnits;return{u_camera_to_center_distance:m.cameraToCenterDistance,u_scale_with_map:+(h.paint.get("circle-pitch-scale")==="map"),u_matrix:d.translatePosMatrix(t.posMatrix,l,h.paint.get("circle-translate"),h.paint.get("circle-translate-anchor")),u_pitch_with_map:+g,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:v}},ko=(d,t,l)=>{let h=Pt(l,1,t.zoom),m=Math.pow(2,t.zoom-l.tileID.overscaledZ),g=l.tileID.overscaleFactor();return{u_matrix:d,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:h,u_extrude_scale:[t.pixelsToGLUnits[0]/(h*m),t.pixelsToGLUnits[1]/(h*m)],u_overscale_factor:g}},Ps=(d,t,l=1)=>({u_matrix:d,u_color:t,u_overlay:0,u_overlay_scale:l}),Ho=d=>({u_matrix:d}),_a=(d,t,l,h)=>({u_matrix:d,u_extrude_scale:Pt(t,1,l),u_intensity:h});function va(d,t){let l=Math.pow(2,t.canonical.z),h=t.canonical.y;return[new a.MercatorCoordinate(0,h/l).toLngLat().lat,new a.MercatorCoordinate(0,(h+1)/l).toLngLat().lat]}let Jo=(d,t,l,h)=>{let m=d.transform;return{u_matrix:zs(d,t,l,h),u_ratio:1/Pt(t,1,m.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Vl=(d,t,l,h,m)=>a.extend(Jo(d,t,l,m),{u_image:0,u_image_height:h}),ba=(d,t,l,h,m)=>{let g=d.transform,v=Ar(t,g);return{u_matrix:zs(d,t,l,m),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Pt(t,1,g.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[v,h.fromScale,h.toScale],u_fade:h.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},Ms=(d,t,l,h,m,g)=>{let v=d.lineAtlas,E=Ar(t,d.transform),S=l.layout.get("line-cap")==="round",A=v.getDash(h.from,S),M=v.getDash(h.to,S),F=A.width*m.fromScale,B=M.width*m.toScale;return a.extend(Jo(d,t,l,g),{u_patternscale_a:[E/F,-A.height/2],u_patternscale_b:[E/B,-M.height/2],u_sdfgamma:v.width/(256*Math.min(F,B)*d.pixelRatio)/2,u_image:0,u_tex_y_a:A.y,u_tex_y_b:M.y,u_mix:m.t})};function Ar(d,t){return 1/Pt(d,1,t.tileZoom)}function zs(d,t,l,h){return d.translatePosMatrix(h?h.posMatrix:t.tileID.posMatrix,t,l.paint.get("line-translate"),l.paint.get("line-translate-anchor"))}let Lc=(d,t,l,h,m)=>{return{u_matrix:d,u_tl_parent:t,u_scale_parent:l,u_buffer_scale:1,u_fade_t:h.mix,u_opacity:h.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:(v=m.paint.get("raster-saturation"),v>0?1-1/(1.001-v):-v),u_contrast_factor:(g=m.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:Bc(m.paint.get("raster-hue-rotate"))};var g,v};function Bc(d){d*=Math.PI/180;let t=Math.sin(d),l=Math.cos(d);return[(2*l+1)/3,(-Math.sqrt(3)*t-l+1)/3,(Math.sqrt(3)*t-l+1)/3]}let Ul=(d,t,l,h,m,g,v,E,S,A)=>{let M=m.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:M.cameraToCenterDistance,u_pitch:M.pitch/360*2*Math.PI,u_rotate_symbol:+l,u_aspect_ratio:M.width/M.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:g,u_label_plane_matrix:v,u_coord_matrix:E,u_is_text:+S,u_pitch_with_map:+h,u_texsize:A,u_texture:0}},xa=(d,t,l,h,m,g,v,E,S,A,M)=>{let F=m.transform;return a.extend(Ul(d,t,l,h,m,g,v,E,S,A),{u_gamma_scale:h?Math.cos(F._pitch)*F.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+M})},Nc=(d,t,l,h,m,g,v,E,S,A)=>a.extend(xa(d,t,l,h,m,g,v,E,!0,S,!0),{u_texsize_icon:A,u_texture_icon:1}),td=(d,t,l)=>({u_matrix:d,u_opacity:t,u_color:l}),rd=(d,t,l,h,m,g)=>a.extend(function(v,E,S,A){let M=S.imageManager.getPattern(v.from.toString()),F=S.imageManager.getPattern(v.to.toString()),{width:B,height:K}=S.imageManager.getPixelSize(),G=Math.pow(2,A.tileID.overscaledZ),Z=A.tileSize*Math.pow(2,S.transform.tileZoom)/G,re=Z*(A.tileID.canonical.x+A.tileID.wrap*G),oe=Z*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:M.tl,u_pattern_br_a:M.br,u_pattern_tl_b:F.tl,u_pattern_br_b:F.br,u_texsize:[B,K],u_mix:E.t,u_pattern_size_a:M.displaySize,u_pattern_size_b:F.displaySize,u_scale_a:E.fromScale,u_scale_b:E.toScale,u_tile_units_to_pixels:1/Pt(A,1,S.transform.tileZoom),u_pixel_coord_upper:[re>>16,oe>>16],u_pixel_coord_lower:[65535&re,65535&oe]}}(h,g,l,m),{u_matrix:d,u_opacity:t}),$l={fillExtrusion:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_lightpos:new a.Uniform3f(d,t.u_lightpos),u_lightintensity:new a.Uniform1f(d,t.u_lightintensity),u_lightcolor:new a.Uniform3f(d,t.u_lightcolor),u_vertical_gradient:new a.Uniform1f(d,t.u_vertical_gradient),u_opacity:new a.Uniform1f(d,t.u_opacity)}),fillExtrusionPattern:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_lightpos:new a.Uniform3f(d,t.u_lightpos),u_lightintensity:new a.Uniform1f(d,t.u_lightintensity),u_lightcolor:new a.Uniform3f(d,t.u_lightcolor),u_vertical_gradient:new a.Uniform1f(d,t.u_vertical_gradient),u_height_factor:new a.Uniform1f(d,t.u_height_factor),u_image:new a.Uniform1i(d,t.u_image),u_texsize:new a.Uniform2f(d,t.u_texsize),u_pixel_coord_upper:new a.Uniform2f(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(d,t.u_pixel_coord_lower),u_scale:new a.Uniform3f(d,t.u_scale),u_fade:new a.Uniform1f(d,t.u_fade),u_opacity:new a.Uniform1f(d,t.u_opacity)}),fill:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix)}),fillPattern:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_image:new a.Uniform1i(d,t.u_image),u_texsize:new a.Uniform2f(d,t.u_texsize),u_pixel_coord_upper:new a.Uniform2f(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(d,t.u_pixel_coord_lower),u_scale:new a.Uniform3f(d,t.u_scale),u_fade:new a.Uniform1f(d,t.u_fade)}),fillOutline:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_world:new a.Uniform2f(d,t.u_world)}),fillOutlinePattern:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_world:new a.Uniform2f(d,t.u_world),u_image:new a.Uniform1i(d,t.u_image),u_texsize:new a.Uniform2f(d,t.u_texsize),u_pixel_coord_upper:new a.Uniform2f(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(d,t.u_pixel_coord_lower),u_scale:new a.Uniform3f(d,t.u_scale),u_fade:new a.Uniform1f(d,t.u_fade)}),circle:(d,t)=>({u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_scale_with_map:new a.Uniform1i(d,t.u_scale_with_map),u_pitch_with_map:new a.Uniform1i(d,t.u_pitch_with_map),u_extrude_scale:new a.Uniform2f(d,t.u_extrude_scale),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_matrix:new a.UniformMatrix4f(d,t.u_matrix)}),collisionBox:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_pixels_to_tile_units:new a.Uniform1f(d,t.u_pixels_to_tile_units),u_extrude_scale:new a.Uniform2f(d,t.u_extrude_scale),u_overscale_factor:new a.Uniform1f(d,t.u_overscale_factor)}),collisionCircle:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_inv_matrix:new a.UniformMatrix4f(d,t.u_inv_matrix),u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_viewport_size:new a.Uniform2f(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new a.UniformColor(d,t.u_color),u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_overlay:new a.Uniform1i(d,t.u_overlay),u_overlay_scale:new a.Uniform1f(d,t.u_overlay_scale)}),clippingMask:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix)}),heatmap:(d,t)=>({u_extrude_scale:new a.Uniform1f(d,t.u_extrude_scale),u_intensity:new a.Uniform1f(d,t.u_intensity),u_matrix:new a.UniformMatrix4f(d,t.u_matrix)}),heatmapTexture:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_world:new a.Uniform2f(d,t.u_world),u_image:new a.Uniform1i(d,t.u_image),u_color_ramp:new a.Uniform1i(d,t.u_color_ramp),u_opacity:new a.Uniform1f(d,t.u_opacity)}),hillshade:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_image:new a.Uniform1i(d,t.u_image),u_latrange:new a.Uniform2f(d,t.u_latrange),u_light:new a.Uniform2f(d,t.u_light),u_shadow:new a.UniformColor(d,t.u_shadow),u_highlight:new a.UniformColor(d,t.u_highlight),u_accent:new a.UniformColor(d,t.u_accent)}),hillshadePrepare:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_image:new a.Uniform1i(d,t.u_image),u_dimension:new a.Uniform2f(d,t.u_dimension),u_zoom:new a.Uniform1f(d,t.u_zoom),u_unpack:new a.Uniform4f(d,t.u_unpack)}),line:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_ratio:new a.Uniform1f(d,t.u_ratio),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_ratio:new a.Uniform1f(d,t.u_ratio),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(d,t.u_units_to_pixels),u_image:new a.Uniform1i(d,t.u_image),u_image_height:new a.Uniform1f(d,t.u_image_height)}),linePattern:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_texsize:new a.Uniform2f(d,t.u_texsize),u_ratio:new a.Uniform1f(d,t.u_ratio),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_image:new a.Uniform1i(d,t.u_image),u_units_to_pixels:new a.Uniform2f(d,t.u_units_to_pixels),u_scale:new a.Uniform3f(d,t.u_scale),u_fade:new a.Uniform1f(d,t.u_fade)}),lineSDF:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_ratio:new a.Uniform1f(d,t.u_ratio),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(d,t.u_units_to_pixels),u_patternscale_a:new a.Uniform2f(d,t.u_patternscale_a),u_patternscale_b:new a.Uniform2f(d,t.u_patternscale_b),u_sdfgamma:new a.Uniform1f(d,t.u_sdfgamma),u_image:new a.Uniform1i(d,t.u_image),u_tex_y_a:new a.Uniform1f(d,t.u_tex_y_a),u_tex_y_b:new a.Uniform1f(d,t.u_tex_y_b),u_mix:new a.Uniform1f(d,t.u_mix)}),raster:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_tl_parent:new a.Uniform2f(d,t.u_tl_parent),u_scale_parent:new a.Uniform1f(d,t.u_scale_parent),u_buffer_scale:new a.Uniform1f(d,t.u_buffer_scale),u_fade_t:new a.Uniform1f(d,t.u_fade_t),u_opacity:new a.Uniform1f(d,t.u_opacity),u_image0:new a.Uniform1i(d,t.u_image0),u_image1:new a.Uniform1i(d,t.u_image1),u_brightness_low:new a.Uniform1f(d,t.u_brightness_low),u_brightness_high:new a.Uniform1f(d,t.u_brightness_high),u_saturation_factor:new a.Uniform1f(d,t.u_saturation_factor),u_contrast_factor:new a.Uniform1f(d,t.u_contrast_factor),u_spin_weights:new a.Uniform3f(d,t.u_spin_weights)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new a.Uniform1i(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(d,t.u_is_size_feature_constant),u_size_t:new a.Uniform1f(d,t.u_size_t),u_size:new a.Uniform1f(d,t.u_size),u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_pitch:new a.Uniform1f(d,t.u_pitch),u_rotate_symbol:new a.Uniform1i(d,t.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(d,t.u_aspect_ratio),u_fade_change:new a.Uniform1f(d,t.u_fade_change),u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(d,t.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(d,t.u_coord_matrix),u_is_text:new a.Uniform1i(d,t.u_is_text),u_pitch_with_map:new a.Uniform1i(d,t.u_pitch_with_map),u_texsize:new a.Uniform2f(d,t.u_texsize),u_texture:new a.Uniform1i(d,t.u_texture)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new a.Uniform1i(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(d,t.u_is_size_feature_constant),u_size_t:new a.Uniform1f(d,t.u_size_t),u_size:new a.Uniform1f(d,t.u_size),u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_pitch:new a.Uniform1f(d,t.u_pitch),u_rotate_symbol:new a.Uniform1i(d,t.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(d,t.u_aspect_ratio),u_fade_change:new a.Uniform1f(d,t.u_fade_change),u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(d,t.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(d,t.u_coord_matrix),u_is_text:new a.Uniform1i(d,t.u_is_text),u_pitch_with_map:new a.Uniform1i(d,t.u_pitch_with_map),u_texsize:new a.Uniform2f(d,t.u_texsize),u_texture:new a.Uniform1i(d,t.u_texture),u_gamma_scale:new a.Uniform1f(d,t.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(d,t.u_is_halo)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new a.Uniform1i(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(d,t.u_is_size_feature_constant),u_size_t:new a.Uniform1f(d,t.u_size_t),u_size:new a.Uniform1f(d,t.u_size),u_camera_to_center_distance:new a.Uniform1f(d,t.u_camera_to_center_distance),u_pitch:new a.Uniform1f(d,t.u_pitch),u_rotate_symbol:new a.Uniform1i(d,t.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(d,t.u_aspect_ratio),u_fade_change:new a.Uniform1f(d,t.u_fade_change),u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(d,t.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(d,t.u_coord_matrix),u_is_text:new a.Uniform1i(d,t.u_is_text),u_pitch_with_map:new a.Uniform1i(d,t.u_pitch_with_map),u_texsize:new a.Uniform2f(d,t.u_texsize),u_texsize_icon:new a.Uniform2f(d,t.u_texsize_icon),u_texture:new a.Uniform1i(d,t.u_texture),u_texture_icon:new a.Uniform1i(d,t.u_texture_icon),u_gamma_scale:new a.Uniform1f(d,t.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(d,t.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(d,t.u_is_halo)}),background:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_opacity:new a.Uniform1f(d,t.u_opacity),u_color:new a.UniformColor(d,t.u_color)}),backgroundPattern:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_opacity:new a.Uniform1f(d,t.u_opacity),u_image:new a.Uniform1i(d,t.u_image),u_pattern_tl_a:new a.Uniform2f(d,t.u_pattern_tl_a),u_pattern_br_a:new a.Uniform2f(d,t.u_pattern_br_a),u_pattern_tl_b:new a.Uniform2f(d,t.u_pattern_tl_b),u_pattern_br_b:new a.Uniform2f(d,t.u_pattern_br_b),u_texsize:new a.Uniform2f(d,t.u_texsize),u_mix:new a.Uniform1f(d,t.u_mix),u_pattern_size_a:new a.Uniform2f(d,t.u_pattern_size_a),u_pattern_size_b:new a.Uniform2f(d,t.u_pattern_size_b),u_scale_a:new a.Uniform1f(d,t.u_scale_a),u_scale_b:new a.Uniform1f(d,t.u_scale_b),u_pixel_coord_upper:new a.Uniform2f(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new a.Uniform1f(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_texture:new a.Uniform1i(d,t.u_texture)}),terrainDepth:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix)}),terrainCoords:(d,t)=>({u_matrix:new a.UniformMatrix4f(d,t.u_matrix),u_texture:new a.Uniform1i(d,t.u_texture),u_terrain_coords_id:new a.Uniform1f(d,t.u_terrain_coords_id)})};class ql{constructor(t,l,h){this.context=t;let m=t.gl;this.buffer=m.createBuffer(),this.dynamicDraw=Boolean(h),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete l.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let l=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),l.bufferSubData(l.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Gl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Zl{constructor(t,l,h,m){this.length=l.length,this.attributes=h,this.itemSize=l.bytesPerElement,this.dynamicDraw=m,this.context=t;let g=t.gl;this.buffer=g.createBuffer(),t.bindVertexBuffer.set(this.buffer),g.bufferData(g.ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete l.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let l=this.context.gl;this.bind(),l.bufferSubData(l.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,l){for(let h=0;h<this.attributes.length;h++){let m=l.attributes[this.attributes[h].name];m!==void 0&&t.enableVertexAttribArray(m)}}setVertexAttribPointers(t,l,h){for(let m=0;m<this.attributes.length;m++){let g=this.attributes[m],v=l.attributes[g.name];v!==void 0&&t.vertexAttribPointer(v,g.components,t[Gl[g.type]],!1,this.itemSize,g.offset+this.itemSize*(h||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class rr{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class jc extends rr{getDefault(){return a.Color.transparent}set(t){let l=this.current;(t.r!==l.r||t.g!==l.g||t.b!==l.b||t.a!==l.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class id extends rr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Os extends rr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Ds extends rr{getDefault(){return[!0,!0,!0,!0]}set(t){let l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||t[3]!==l[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Vc extends rr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class ji extends rr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Kl extends rr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let l=this.current;(t.func!==l.func||t.ref!==l.ref||t.mask!==l.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class wa extends rr{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Ea extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;t?l.enable(l.STENCIL_TEST):l.disable(l.STENCIL_TEST),this.current=t,this.dirty=!1}}class Wl extends rr{getDefault(){return[0,1]}set(t){let l=this.current;(t[0]!==l[0]||t[1]!==l[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Xl extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;t?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),this.current=t,this.dirty=!1}}class Sa extends rr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Hl extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;t?l.enable(l.BLEND):l.disable(l.BLEND),this.current=t,this.dirty=!1}}class Jl extends rr{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let l=this.current;(t[0]!==l[0]||t[1]!==l[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ta extends rr{getDefault(){return a.Color.transparent}set(t){let l=this.current;(t.r!==l.r||t.g!==l.g||t.b!==l.b||t.a!==l.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Uc extends rr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class $c extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;t?l.enable(l.CULL_FACE):l.disable(l.CULL_FACE),this.current=t,this.dirty=!1}}class Yo extends rr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class nd extends rr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class od extends rr{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class sd extends rr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class ad extends rr{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||t[3]!==l[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ld extends rr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.bindFramebuffer(l.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class ud extends rr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.bindRenderbuffer(l.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Yl extends rr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.bindTexture(l.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Ca extends rr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.bindBuffer(l.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ql extends rr{getDefault(){return null}set(t){let l=this.gl;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class eu extends rr{constructor(t){super(t),this.vao=t.extVertexArrayObject}getDefault(){return null}set(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)}}class Qo extends rr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.pixelStorei(l.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class qc extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Gc extends rr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let l=this.gl;l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Aa extends rr{constructor(t,l){super(t),this.context=t,this.parent=l}getDefault(){return null}}class Io extends Aa{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let l=this.gl;l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Zc extends Aa{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let l=this.gl;l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class es{constructor(t,l,h,m){this.context=t,this.width=l,this.height=h;let g=t.gl,v=this.framebuffer=g.createFramebuffer();if(this.colorAttachment=new Io(t,v),m&&(this.depthAttachment=new Zc(t,v)),g.checkFramebufferStatus(g.FRAMEBUFFER)!==g.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let t=this.context.gl,l=this.colorAttachment.get();if(l&&t.deleteTexture(l),this.depthAttachment){let h=this.depthAttachment.get();h&&t.deleteRenderbuffer(h)}t.deleteFramebuffer(this.framebuffer)}}class Sr{constructor(t,l,h){this.blendFunction=t,this.blendColor=l,this.mask=h}}Sr.Replace=[1,0],Sr.disabled=new Sr(Sr.Replace,a.Color.transparent,[!1,!1,!1,!1]),Sr.unblended=new Sr(Sr.Replace,a.Color.transparent,[!0,!0,!0,!0]),Sr.alphaBlended=new Sr([1,771],a.Color.transparent,[!0,!0,!0,!0]);class Kc{constructor(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new jc(this),this.clearDepth=new id(this),this.clearStencil=new Os(this),this.colorMask=new Ds(this),this.depthMask=new Vc(this),this.stencilMask=new ji(this),this.stencilFunc=new Kl(this),this.stencilOp=new wa(this),this.stencilTest=new Ea(this),this.depthRange=new Wl(this),this.depthTest=new Xl(this),this.depthFunc=new Sa(this),this.blend=new Hl(this),this.blendFunc=new Jl(this),this.blendColor=new Ta(this),this.blendEquation=new Uc(this),this.cullFace=new $c(this),this.cullFaceSide=new Yo(this),this.frontFace=new nd(this),this.program=new od(this),this.activeTexture=new sd(this),this.viewport=new ad(this),this.bindFramebuffer=new ld(this),this.bindRenderbuffer=new ud(this),this.bindTexture=new Yl(this),this.bindVertexBuffer=new Ca(this),this.bindElementBuffer=new Ql(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new eu(this),this.pixelStoreUnpack=new Qo(this),this.pixelStoreUnpackPremultiplyAlpha=new qc(this),this.pixelStoreUnpackFlipY=new Gc(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,l){return new ql(this,t,l)}createVertexBuffer(t,l,h){return new Zl(this,t,l,h)}createRenderbuffer(t,l,h){let m=this.gl,g=m.createRenderbuffer();return this.bindRenderbuffer.set(g),m.renderbufferStorage(m.RENDERBUFFER,t,l,h),this.bindRenderbuffer.set(null),g}createFramebuffer(t,l,h){return new es(this,t,l,h)}clear({color:t,depth:l}){let h=this.gl,m=0;t&&(m|=h.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),l!==void 0&&(m|=h.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(l),this.depthMask.set(!0)),h.clear(m)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){R(t.blendFunction,Sr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Gt{constructor(t,l,h){this.func=t,this.mask=l,this.range=h}}Gt.ReadOnly=!1,Gt.ReadWrite=!0,Gt.disabled=new Gt(519,Gt.ReadOnly,[0,1]);let ir=7680;class xr{constructor(t,l,h,m,g,v){this.test=t,this.ref=l,this.mask=h,this.fail=m,this.depthFail=g,this.pass=v}}xr.disabled=new xr({func:519,mask:0},0,0,ir,ir,ir);class kr{constructor(t,l,h){this.enable=t,this.mode=l,this.frontFace=h}}let Fs;function ts(d,t,l,h,m,g,v){let E=d.context,S=E.gl,A=d.useProgram("collisionBox"),M=[],F=0,B=0;for(let W=0;W<h.length;W++){let de=h[W],ce=t.getTile(de),Ee=ce.getBucket(l);if(!Ee)continue;let Te=de.posMatrix;m[0]===0&&m[1]===0||(Te=d.translatePosMatrix(de.posMatrix,ce,m,g));let ze=v?Ee.textCollisionBox:Ee.iconCollisionBox,xe=Ee.collisionCircleArray;if(xe.length>0){let rt=a.create(),Ze=Te;a.mul(rt,Ee.placementInvProjMatrix,d.transform.glCoordMatrix),a.mul(rt,rt,Ee.placementViewportMatrix),M.push({circleArray:xe,circleOffset:B,transform:Ze,invTransform:rt,coord:de}),F+=xe.length/4,B=F}ze&&A.draw(E,S.LINES,Gt.disabled,xr.disabled,d.colorModeForRenderPass(),kr.disabled,ko(Te,d.transform,ce),d.style.terrain&&d.style.terrain.getTerrainData(de),l.id,ze.layoutVertexBuffer,ze.indexBuffer,ze.segments,null,d.transform.zoom,null,null,ze.collisionVertexBuffer)}if(!v||!M.length)return;let K=d.useProgram("collisionCircle"),G=new a.CollisionCircleLayoutArray;G.resize(4*F),G._trim();let Z=0;for(let W of M)for(let de=0;de<W.circleArray.length/4;de++){let ce=4*de,Ee=W.circleArray[ce+0],Te=W.circleArray[ce+1],ze=W.circleArray[ce+2],xe=W.circleArray[ce+3];G.emplace(Z++,Ee,Te,ze,xe,0),G.emplace(Z++,Ee,Te,ze,xe,1),G.emplace(Z++,Ee,Te,ze,xe,2),G.emplace(Z++,Ee,Te,ze,xe,3)}(!Fs||Fs.length<2*F)&&(Fs=function(W){let de=2*W,ce=new a.QuadTriangleArray;ce.resize(de),ce._trim();for(let Ee=0;Ee<de;Ee++){let Te=6*Ee;ce.uint16[Te+0]=4*Ee+0,ce.uint16[Te+1]=4*Ee+1,ce.uint16[Te+2]=4*Ee+2,ce.uint16[Te+3]=4*Ee+2,ce.uint16[Te+4]=4*Ee+3,ce.uint16[Te+5]=4*Ee+0}return ce}(F));let re=E.createIndexBuffer(Fs,!0),oe=E.createVertexBuffer(G,a.collisionCircleLayout.members,!0);for(let W of M){let de={u_matrix:W.transform,u_inv_matrix:W.invTransform,u_camera_to_center_distance:(ue=d.transform).cameraToCenterDistance,u_viewport_size:[ue.width,ue.height]};K.draw(E,S.TRIANGLES,Gt.disabled,xr.disabled,d.colorModeForRenderPass(),kr.disabled,de,d.style.terrain&&d.style.terrain.getTerrainData(W.coord),l.id,oe,re,a.SegmentVector.simpleSegment(0,2*W.circleOffset,W.circleArray.length,W.circleArray.length/2),null,d.transform.zoom,null,null,null)}var ue;oe.destroy(),re.destroy()}kr.disabled=new kr(!1,1029,2305),kr.backCCW=new kr(!0,1029,2305);let cd=a.identity(new Float32Array(16));function hd(d,t,l,h,m,g){let{horizontalAlign:v,verticalAlign:E}=a.getAnchorAlignment(d),S=-(v-.5)*t,A=-(E-.5)*l,M=a.evaluateVariableOffset(d,h);return new a.pointGeometry((S/m+M[0])*g,(A/m+M[1])*g)}function Wc(d,t,l,h,m,g,v,E,S,A,M){let F=d.text.placedSymbolArray,B=d.text.dynamicLayoutVertexArray,K=d.icon.dynamicLayoutVertexArray,G={};B.clear();for(let Z=0;Z<F.length;Z++){let re=F.get(Z),oe=d.allowVerticalPlacement&&!re.placedOrientation,ue=re.hidden||!re.crossTileID||oe?null:h[re.crossTileID];if(ue){let W=new a.pointGeometry(re.anchorX,re.anchorY),de=Zt(W,l?v:g,M),ce=Ei(m.cameraToCenterDistance,de.signedDistanceFromCamera),Ee=a.evaluateSizeForFeature(d.textSizeData,S,re)*ce/a.ONE_EM;l&&(Ee*=d.tilePixelRatio/E);let{width:Te,height:ze,anchor:xe,textOffset:rt,textBoxScale:Ze}=ue,nt=hd(xe,Te,ze,rt,Ze,Ee),Mt=l?Zt(W.add(nt),g,M).point:de.point.add(t?nt.rotate(-m.angle):nt),Rt=d.allowVerticalPlacement&&re.placedOrientation===a.WritingMode.vertical?Math.PI/2:0;for(let gt=0;gt<re.numGlyphs;gt++)a.addDynamicAttributes(B,Mt,Rt);A&&re.associatedIconIndex>=0&&(G[re.associatedIconIndex]={shiftedAnchor:Mt,angle:Rt})}else we(re.numGlyphs,B)}if(A){K.clear();let Z=d.icon.placedSymbolArray;for(let re=0;re<Z.length;re++){let oe=Z.get(re);if(oe.hidden)we(oe.numGlyphs,K);else{let ue=G[re];if(ue)for(let W=0;W<oe.numGlyphs;W++)a.addDynamicAttributes(K,ue.shiftedAnchor,ue.angle);else we(oe.numGlyphs,K)}}d.icon.dynamicLayoutVertexBuffer.updateData(K)}d.text.dynamicLayoutVertexBuffer.updateData(B)}function pd(d,t,l){return l.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function ka(d,t,l,h,m,g,v,E,S,A,M,F){let B=d.context,K=B.gl,G=d.transform,Z=E==="map",re=S==="map",oe=E!=="viewport"&&l.layout.get("symbol-placement")!=="point",ue=Z&&!re&&!oe,W=!l.layout.get("symbol-sort-key").isConstant(),de=!1,ce=d.depthModeForSublayer(0,Gt.ReadOnly),Ee=l.layout.get("text-variable-anchor"),Te=[];for(let ze of h){let xe=t.getTile(ze),rt=xe.getBucket(l);if(!rt)continue;let Ze=m?rt.text:rt.icon;if(!Ze||!Ze.segments.get().length)continue;let nt=Ze.programConfigurations.get(l.id),Mt=m||rt.sdfIcons,Rt=m?rt.textSizeData:rt.iconSizeData,gt=re||G.pitch!==0,ur=d.useProgram(pd(Mt,m,rt),nt),cr=a.evaluateSizeForZoom(Rt,G.zoom),Kt=d.style.terrain&&d.style.terrain.getTerrainData(ze),Yt,pr,ei,Mn,yn=[0,0],zn=null;if(m){if(pr=xe.glyphAtlasTexture,ei=K.LINEAR,Yt=xe.glyphAtlasTexture.size,rt.iconsInText){yn=xe.imageAtlasTexture.size,zn=xe.imageAtlasTexture;let en=Rt.kind==="composite"||Rt.kind==="camera";Mn=gt||d.options.rotating||d.options.zooming||en?K.LINEAR:K.NEAREST}}else{let en=l.layout.get("icon-size").constantOr(0)!==1||rt.iconsNeedLinear;pr=xe.imageAtlasTexture,ei=Mt||d.options.rotating||d.options.zooming||en||gt?K.LINEAR:K.NEAREST,Yt=xe.imageAtlasTexture.size}let go=Pt(xe,1,d.transform.zoom),Qi=qn(ze.posMatrix,re,Z,d.transform,go),Oi=Ni(ze.posMatrix,re,Z,d.transform,go),Kn=Ee&&rt.hasTextData(),Ra=l.layout.get("icon-text-fit")!=="none"&&Kn&&rt.hasIconData();if(oe){let en=d.style.terrain?(mu,as)=>d.style.terrain.getElevation(ze,mu,as):null,Oo=l.layout.get("text-rotation-alignment")==="map";di(rt,ze.posMatrix,d,m,Qi,Oi,re,A,Oo,en)}let Wr=d.translatePosMatrix(ze.posMatrix,xe,g,v),jt=oe||m&&Ee||Ra?cd:Qi,sr=d.translatePosMatrix(Oi,xe,g,v,!0),ti=Mt&&l.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ri;ri=Mt?rt.iconsInText?Nc(Rt.kind,cr,ue,re,d,Wr,jt,sr,Yt,yn):xa(Rt.kind,cr,ue,re,d,Wr,jt,sr,m,Yt,!0):Ul(Rt.kind,cr,ue,re,d,Wr,jt,sr,m,Yt);let Pr={program:ur,buffers:Ze,uniformValues:ri,atlasTexture:pr,atlasTextureIcon:zn,atlasInterpolation:ei,atlasInterpolationIcon:Mn,isSDF:Mt,hasHalo:ti};if(W&&rt.canOverlap){de=!0;let en=Ze.segments.get();for(let Oo of en)Te.push({segments:new a.SegmentVector([Oo]),sortKey:Oo.sortKey,state:Pr,terrainData:Kt})}else Te.push({segments:Ze.segments,sortKey:0,state:Pr,terrainData:Kt})}de&&Te.sort((ze,xe)=>ze.sortKey-xe.sortKey);for(let ze of Te){let xe=ze.state;if(B.activeTexture.set(K.TEXTURE0),xe.atlasTexture.bind(xe.atlasInterpolation,K.CLAMP_TO_EDGE),xe.atlasTextureIcon&&(B.activeTexture.set(K.TEXTURE1),xe.atlasTextureIcon&&xe.atlasTextureIcon.bind(xe.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),xe.isSDF){let rt=xe.uniformValues;xe.hasHalo&&(rt.u_is_halo=1,Rs(xe.buffers,ze.segments,l,d,xe.program,ce,M,F,rt,ze.terrainData)),rt.u_is_halo=0}Rs(xe.buffers,ze.segments,l,d,xe.program,ce,M,F,xe.uniformValues,ze.terrainData)}}function Rs(d,t,l,h,m,g,v,E,S,A){let M=h.context;m.draw(M,M.gl.TRIANGLES,g,v,E,kr.disabled,S,A,l.id,d.layoutVertexBuffer,d.indexBuffer,t,l.paint,h.transform.zoom,d.programConfigurations.get(l.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function Ls(d,t,l,h,m,g,v){let E=d.context.gl,S=l.paint.get("fill-pattern"),A=S&&S.constantOr(1),M=l.getCrossfadeParameters(),F,B,K,G,Z;v?(B=A&&!l.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",F=E.LINES):(B=A?"fillPattern":"fill",F=E.TRIANGLES);for(let re of h){let oe=t.getTile(re);if(A&&!oe.patternsLoaded())continue;let ue=oe.getBucket(l);if(!ue)continue;let W=ue.programConfigurations.get(l.id),de=d.useProgram(B,W),ce=d.style.terrain&&d.style.terrain.getTerrainData(re);A&&(d.context.activeTexture.set(E.TEXTURE0),oe.imageAtlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE),W.updatePaintBuffers(M));let Ee=S.constantOr(null);if(Ee&&oe.imageAtlas){let xe=oe.imageAtlas,rt=xe.patternPositions[Ee.to.toString()],Ze=xe.patternPositions[Ee.from.toString()];rt&&Ze&&W.setConstantPatternPositions(rt,Ze)}let Te=ce?re:null,ze=d.translatePosMatrix(Te?Te.posMatrix:re.posMatrix,oe,l.paint.get("fill-translate"),l.paint.get("fill-translate-anchor"));if(v){G=ue.indexBuffer2,Z=ue.segments2;let xe=[E.drawingBufferWidth,E.drawingBufferHeight];K=B==="fillOutlinePattern"&&A?Fc(ze,d,M,oe,xe):Dc(ze,xe)}else G=ue.indexBuffer,Z=ue.segments,K=A?jl(ze,d,M,oe):ga(ze);de.draw(d.context,F,m,d.stencilModeForClipping(re),g,kr.disabled,K,ce,l.id,ue.layoutVertexBuffer,G,Z,l.paint,d.transform.zoom,W)}}function Bs(d,t,l,h,m,g,v){let E=d.context,S=E.gl,A=l.paint.get("fill-extrusion-pattern"),M=A.constantOr(1),F=l.getCrossfadeParameters(),B=l.paint.get("fill-extrusion-opacity");for(let K of h){let G=t.getTile(K),Z=G.getBucket(l);if(!Z)continue;let re=d.style.terrain&&d.style.terrain.getTerrainData(K),oe=Z.programConfigurations.get(l.id),ue=d.useProgram(M?"fillExtrusionPattern":"fillExtrusion",oe);M&&(d.context.activeTexture.set(S.TEXTURE0),G.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),oe.updatePaintBuffers(F));let W=A.constantOr(null);if(W&&G.imageAtlas){let Te=G.imageAtlas,ze=Te.patternPositions[W.to.toString()],xe=Te.patternPositions[W.from.toString()];ze&&xe&&oe.setConstantPatternPositions(ze,xe)}let de=d.translatePosMatrix(K.posMatrix,G,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),ce=l.paint.get("fill-extrusion-vertical-gradient"),Ee=M?ed(de,d,ce,B,K,F,G):Nl(de,d,ce,B);ue.draw(E,E.gl.TRIANGLES,m,g,v,kr.backCCW,Ee,re,l.id,Z.layoutVertexBuffer,Z.indexBuffer,Z.segments,l.paint,d.transform.zoom,oe,d.style.terrain&&Z.centroidVertexBuffer)}}function tu(d,t,l,h,m,g,v){let E=d.context,S=E.gl,A=l.fbo;if(!A)return;let M=d.useProgram("hillshade"),F=d.style.terrain&&d.style.terrain.getTerrainData(t);E.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,A.colorAttachment.get()),M.draw(E,S.TRIANGLES,m,g,v,kr.disabled,((B,K,G,Z)=>{let re=G.paint.get("hillshade-shadow-color"),oe=G.paint.get("hillshade-highlight-color"),ue=G.paint.get("hillshade-accent-color"),W=G.paint.get("hillshade-illumination-direction")*(Math.PI/180);G.paint.get("hillshade-illumination-anchor")==="viewport"&&(W-=B.transform.angle);let de=!B.options.moving;return{u_matrix:Z?Z.posMatrix:B.transform.calculatePosMatrix(K.tileID.toUnwrapped(),de),u_image:0,u_latrange:va(0,K.tileID),u_light:[G.paint.get("hillshade-exaggeration"),W],u_shadow:re,u_highlight:oe,u_accent:ue}})(d,l,h,F?t:null),F,h.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}function Xc(d,t,l,h,m,g){let v=d.context,E=v.gl,S=t.dem;if(S&&S.data){let A=S.dim,M=S.stride,F=S.getPixels();if(v.activeTexture.set(E.TEXTURE1),v.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||d.getTileTexture(M),t.demTexture){let K=t.demTexture;K.update(F,{premultiply:!1}),K.bind(E.NEAREST,E.CLAMP_TO_EDGE)}else t.demTexture=new _e(v,F,E.RGBA,{premultiply:!1}),t.demTexture.bind(E.NEAREST,E.CLAMP_TO_EDGE);v.activeTexture.set(E.TEXTURE0);let B=t.fbo;if(!B){let K=new _e(v,{width:A,height:A,data:null},E.RGBA);K.bind(E.LINEAR,E.CLAMP_TO_EDGE),B=t.fbo=v.createFramebuffer(A,A,!0),B.colorAttachment.set(K.texture)}v.bindFramebuffer.set(B.framebuffer),v.viewport.set([0,0,A,A]),d.useProgram("hillshadePrepare").draw(v,E.TRIANGLES,h,m,g,kr.disabled,((K,G)=>{let Z=G.stride,re=a.create();return a.ortho(re,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(re,re,[0,-a.EXTENT,0]),{u_matrix:re,u_image:1,u_dimension:[Z,Z],u_zoom:K.overscaledZ,u_unpack:G.getUnpackVector()}})(t.tileID,S),null,l.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Ia(d,t,l,h,m,g){let v=h.paint.get("raster-fade-duration");if(!g&&v>0){let E=a.exported.now(),S=(E-d.timeAdded)/v,A=t?(E-t.timeAdded)/v:-1,M=l.getSource(),F=m.coveringZoomLevel({tileSize:M.tileSize,roundZoom:M.roundZoom}),B=!t||Math.abs(t.tileID.overscaledZ-F)>Math.abs(d.tileID.overscaledZ-F),K=B&&d.refreshedUponExpiration?1:a.clamp(B?S:1-A,0,1);return d.refreshedUponExpiration&&S>=1&&(d.refreshedUponExpiration=!1),t?{opacity:1,mix:1-K}:{opacity:K,mix:0}}return{opacity:1,mix:0}}let Pa=new a.Color(1,0,0,1),mn=new a.Color(0,1,0,1),Hc=new a.Color(0,0,1,1),ru=new a.Color(1,0,1,1),Jc=new a.Color(0,1,1,1);function Po(d,t,l,h){rs(d,0,t+l/2,d.transform.width,l,h)}function Ns(d,t,l,h){rs(d,t-l/2,0,l,d.transform.height,h)}function rs(d,t,l,h,m,g){let v=d.context,E=v.gl;E.enable(E.SCISSOR_TEST),E.scissor(t*d.pixelRatio,l*d.pixelRatio,h*d.pixelRatio,m*d.pixelRatio),v.clear({color:g}),E.disable(E.SCISSOR_TEST)}function dd(d,t,l){let h=d.context,m=h.gl,g=l.posMatrix,v=d.useProgram("debug"),E=Gt.disabled,S=xr.disabled,A=d.colorModeForRenderPass(),M="$debug",F=d.style.terrain&&d.style.terrain.getTerrainData(l);h.activeTexture.set(m.TEXTURE0),d.emptyTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE);let B=t.getTileByID(l.key).latestRawTileData,K=Math.floor((B&&B.byteLength||0)/1024),G=t.getTile(l).tileSize,Z=512/Math.min(G,512)*(l.overscaledZ/d.transform.zoom)*.5,re=l.canonical.toString();l.overscaledZ!==l.canonical.z&&(re+=` => ${l.overscaledZ}`),function(oe,ue){oe.initDebugOverlayCanvas();let W=oe.debugOverlayCanvas,de=oe.context.gl,ce=oe.debugOverlayCanvas.getContext("2d");ce.clearRect(0,0,W.width,W.height),ce.shadowColor="white",ce.shadowBlur=2,ce.lineWidth=1.5,ce.strokeStyle="white",ce.textBaseline="top",ce.font="bold 36px Open Sans, sans-serif",ce.fillText(ue,5,5),ce.strokeText(ue,5,5),oe.debugOverlayTexture.update(W),oe.debugOverlayTexture.bind(de.LINEAR,de.CLAMP_TO_EDGE)}(d,`${re} ${K}kB`),v.draw(h,m.TRIANGLES,E,S,Sr.alphaBlended,kr.disabled,Ps(g,a.Color.transparent,Z),null,M,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),v.draw(h,m.LINE_STRIP,E,S,A,kr.disabled,Ps(g,a.Color.red),F,M,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function Ma(d,t,l){let h=d.context,m=h.gl,g=d.colorModeForRenderPass(),v=new Gt(m.LEQUAL,Gt.ReadWrite,d.depthRangeFor3D),E=d.useProgram("terrain"),S=t.getTerrainMesh(),A=t.getTerrainData(l.tileID);h.bindFramebuffer.set(null),h.viewport.set([0,0,d.width,d.height]),h.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,t.getRTTFramebuffer().colorAttachment.get());let M=d.transform.calculatePosMatrix(l.tileID.toUnwrapped());E.draw(h,m.TRIANGLES,v,xr.disabled,g,kr.backCCW,{u_matrix:M,u_texture:0},A,"terrain",S.vertexBuffer,S.indexBuffer,S.segments)}function Yc(d,t,l,h){let m=d.context,g=l.tileSize*t.qualityFactor;l.textures[h]||(l.textures[h]=d.getTileTexture(g)||new _e(m,{width:g,height:g,data:null},m.gl.RGBA),l.textures[h].bind(m.gl.LINEAR,m.gl.CLAMP_TO_EDGE),h===0&&t.sourceCache.renderHistory.unshift(l.tileID.key));let v=t.getRTTFramebuffer();v.colorAttachment.set(l.textures[h].texture),m.bindFramebuffer.set(v.framebuffer),m.viewport.set([0,0,g,g])}class Qc{constructor(t){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=t,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=t.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){let t=this.painter.style,l=t.terrain;for(let h in t.sourceCaches){this._coordsDescendingInv[h]={};let m=t.sourceCaches[h].getVisibleCoordinates();for(let g of m){let v=l.sourceCache.getTerrainCoords(g);for(let E in v)this._coordsDescendingInv[h][E]||(this._coordsDescendingInv[h][E]=[]),this._coordsDescendingInv[h][E].push(v[E])}}for(let h of t._order){let m=t._layers[h],g=m.source;if(this._renderToTexture[m.type]&&!this._coordsDescendingInvStr[g]){this._coordsDescendingInvStr[g]={};for(let v in this._coordsDescendingInv[g])this._coordsDescendingInvStr[g][v]=this._coordsDescendingInv[g][v].map(E=>E.key).sort().join()}}return this._renderableTiles.forEach(h=>{for(let m in this._coordsDescendingInvStr){let g=this._coordsDescendingInvStr[m][h.tileID.key];g&&g!==h.textureCoords[m]&&h.clearTextures(this.painter),l.needsRerender(m,h.tileID)&&h.clearTextures(this.painter)}this._rerender[h.tileID.key]=!h.textures.length}),l.clearRerenderCache(),l.sourceCache.removeOutdated(this.painter),this}renderLayer(t){let l=t.type,h=this.painter,m=h.style._order,g=h.currentLayer,v=g+1===m.length;if(this._renderToTexture[l]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(m[g]),!v))return!0;if(this._renderToTexture[this._prevType]||l==="hillshade"||this._renderToTexture[l]&&v){this._prevType=l;let E=this._stacks.length-1,S=this._stacks[E]||[];for(let A of this._renderableTiles){if(Yc(h,h.style.terrain,A,E),this._rerender[A.tileID.key]){h.context.clear({color:a.Color.transparent});for(let M=0;M<S.length;M++){let F=h.style._layers[S[M]],B=F.source?this._coordsDescendingInv[F.source][A.tileID.key]:[A.tileID];h._renderTileClippingMasks(F,B),h.renderLayer(h,h.style.sourceCaches[F.source],F,B),F.source&&(A.textureCoords[F.source]=this._coordsDescendingInvStr[F.source][A.tileID.key])}}Ma(h,h.style.terrain,A)}if(l==="hillshade"){this._stacks.push([m[g]]);for(let A of this._renderableTiles){let M=this._coordsDescendingInv[t.source][A.tileID.key];Yc(h,h.style.terrain,A,this._stacks.length-1),h.context.clear({color:a.Color.transparent}),h._renderTileClippingMasks(t,M),h.renderLayer(h,h.style.sourceCaches[t.source],t,M),Ma(h,h.style.terrain,A)}return!0}return this._renderToTexture[l]}return!1}}let js={symbol:function(d,t,l,h,m){if(d.renderPass!=="translucent")return;let g=xr.disabled,v=d.colorModeForRenderPass();l.layout.get("text-variable-anchor")&&function(E,S,A,M,F,B,K){let G=S.transform,Z=F==="map",re=B==="map";for(let oe of E){let ue=M.getTile(oe),W=ue.getBucket(A);if(!W||!W.text||!W.text.segments.get().length)continue;let de=a.evaluateSizeForZoom(W.textSizeData,G.zoom),ce=Pt(ue,1,S.transform.zoom),Ee=qn(oe.posMatrix,re,Z,S.transform,ce),Te=A.layout.get("icon-text-fit")!=="none"&&W.hasIconData();if(de){let ze=Math.pow(2,G.zoom-ue.tileID.overscaledZ);Wc(W,Z,re,K,G,Ee,oe.posMatrix,ze,de,Te,S.style.terrain?(xe,rt)=>S.style.terrain.getElevation(oe,xe,rt):null)}}}(h,d,l,t,l.layout.get("text-rotation-alignment"),l.layout.get("text-pitch-alignment"),m),l.paint.get("icon-opacity").constantOr(1)!==0&&ka(d,t,l,h,!1,l.paint.get("icon-translate"),l.paint.get("icon-translate-anchor"),l.layout.get("icon-rotation-alignment"),l.layout.get("icon-pitch-alignment"),l.layout.get("icon-keep-upright"),g,v),l.paint.get("text-opacity").constantOr(1)!==0&&ka(d,t,l,h,!0,l.paint.get("text-translate"),l.paint.get("text-translate-anchor"),l.layout.get("text-rotation-alignment"),l.layout.get("text-pitch-alignment"),l.layout.get("text-keep-upright"),g,v),t.map.showCollisionBoxes&&(ts(d,t,l,h,l.paint.get("text-translate"),l.paint.get("text-translate-anchor"),!0),ts(d,t,l,h,l.paint.get("icon-translate"),l.paint.get("icon-translate-anchor"),!1))},circle:function(d,t,l,h){if(d.renderPass!=="translucent")return;let m=l.paint.get("circle-opacity"),g=l.paint.get("circle-stroke-width"),v=l.paint.get("circle-stroke-opacity"),E=!l.layout.get("circle-sort-key").isConstant();if(m.constantOr(1)===0&&(g.constantOr(1)===0||v.constantOr(1)===0))return;let S=d.context,A=S.gl,M=d.depthModeForSublayer(0,Gt.ReadOnly),F=xr.disabled,B=d.colorModeForRenderPass(),K=[];for(let G=0;G<h.length;G++){let Z=h[G],re=t.getTile(Z),oe=re.getBucket(l);if(!oe)continue;let ue=oe.programConfigurations.get(l.id),W=d.useProgram("circle",ue),de=oe.layoutVertexBuffer,ce=oe.indexBuffer,Ee=d.style.terrain&&d.style.terrain.getTerrainData(Z),Te={programConfiguration:ue,program:W,layoutVertexBuffer:de,indexBuffer:ce,uniformValues:Rc(d,Z,re,l),terrainData:Ee};if(E){let ze=oe.segments.get();for(let xe of ze)K.push({segments:new a.SegmentVector([xe]),sortKey:xe.sortKey,state:Te})}else K.push({segments:oe.segments,sortKey:0,state:Te})}E&&K.sort((G,Z)=>G.sortKey-Z.sortKey);for(let G of K){let{programConfiguration:Z,program:re,layoutVertexBuffer:oe,indexBuffer:ue,uniformValues:W,terrainData:de}=G.state;re.draw(S,A.TRIANGLES,M,F,B,kr.disabled,W,de,l.id,oe,ue,G.segments,l.paint,d.transform.zoom,Z)}},heatmap:function(d,t,l,h){if(l.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){let m=d.context,g=m.gl,v=xr.disabled,E=new Sr([g.ONE,g.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(S,A,M){let F=S.gl;S.activeTexture.set(F.TEXTURE1),S.viewport.set([0,0,A.width/4,A.height/4]);let B=M.heatmapFbo;if(B)F.bindTexture(F.TEXTURE_2D,B.colorAttachment.get()),S.bindFramebuffer.set(B.framebuffer);else{let K=F.createTexture();F.bindTexture(F.TEXTURE_2D,K),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.LINEAR),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.LINEAR),B=M.heatmapFbo=S.createFramebuffer(A.width/4,A.height/4,!1),function(G,Z,re,oe){let ue=G.gl;ue.texImage2D(ue.TEXTURE_2D,0,ue.RGBA,Z.width/4,Z.height/4,0,ue.RGBA,G.extRenderToTextureHalfFloat?G.extTextureHalfFloat.HALF_FLOAT_OES:ue.UNSIGNED_BYTE,null),oe.colorAttachment.set(re)}(S,A,K,B)}})(m,d,l),m.clear({color:a.Color.transparent});for(let S=0;S<h.length;S++){let A=h[S];if(t.hasRenderableParent(A))continue;let M=t.getTile(A),F=M.getBucket(l);if(!F)continue;let B=F.programConfigurations.get(l.id),K=d.useProgram("heatmap",B),{zoom:G}=d.transform;K.draw(m,g.TRIANGLES,Gt.disabled,v,E,kr.disabled,_a(A.posMatrix,M,G,l.paint.get("heatmap-intensity")),null,l.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,l.paint,d.transform.zoom,B)}m.viewport.set([0,0,d.width,d.height])}else d.renderPass==="translucent"&&(d.context.setColorMode(d.colorModeForRenderPass()),function(m,g){let v=m.context,E=v.gl,S=g.heatmapFbo;if(!S)return;v.activeTexture.set(E.TEXTURE0),E.bindTexture(E.TEXTURE_2D,S.colorAttachment.get()),v.activeTexture.set(E.TEXTURE1);let A=g.colorRampTexture;A||(A=g.colorRampTexture=new _e(v,g.colorRamp,E.RGBA)),A.bind(E.LINEAR,E.CLAMP_TO_EDGE),m.useProgram("heatmapTexture").draw(v,E.TRIANGLES,Gt.disabled,xr.disabled,m.colorModeForRenderPass(),kr.disabled,((M,F,B,K)=>{let G=a.create();a.ortho(G,0,M.width,M.height,0,0,1);let Z=M.context.gl;return{u_matrix:G,u_world:[Z.drawingBufferWidth,Z.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:F.paint.get("heatmap-opacity")}})(m,g),null,g.id,m.viewportBuffer,m.quadTriangleIndexBuffer,m.viewportSegments,g.paint,m.transform.zoom)}(d,l))},line:function(d,t,l,h){if(d.renderPass!=="translucent")return;let m=l.paint.get("line-opacity"),g=l.paint.get("line-width");if(m.constantOr(1)===0||g.constantOr(1)===0)return;let v=d.depthModeForSublayer(0,Gt.ReadOnly),E=d.colorModeForRenderPass(),S=l.paint.get("line-dasharray"),A=l.paint.get("line-pattern"),M=A.constantOr(1),F=l.paint.get("line-gradient"),B=l.getCrossfadeParameters(),K=M?"linePattern":S?"lineSDF":F?"lineGradient":"line",G=d.context,Z=G.gl,re=!0;for(let oe of h){let ue=t.getTile(oe);if(M&&!ue.patternsLoaded())continue;let W=ue.getBucket(l);if(!W)continue;let de=W.programConfigurations.get(l.id),ce=d.context.program.get(),Ee=d.useProgram(K,de),Te=re||Ee.program!==ce,ze=d.style.terrain&&d.style.terrain.getTerrainData(oe),xe=A.constantOr(null);if(xe&&ue.imageAtlas){let nt=ue.imageAtlas,Mt=nt.patternPositions[xe.to.toString()],Rt=nt.patternPositions[xe.from.toString()];Mt&&Rt&&de.setConstantPatternPositions(Mt,Rt)}let rt=ze?oe:null,Ze=M?ba(d,ue,l,B,rt):S?Ms(d,ue,l,S,B,rt):F?Vl(d,ue,l,W.lineClipsArray.length,rt):Jo(d,ue,l,rt);if(M)G.activeTexture.set(Z.TEXTURE0),ue.imageAtlasTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),de.updatePaintBuffers(B);else if(S&&(Te||d.lineAtlas.dirty))G.activeTexture.set(Z.TEXTURE0),d.lineAtlas.bind(G);else if(F){let nt=W.gradients[l.id],Mt=nt.texture;if(l.gradientVersion!==nt.version){let Rt=256;if(l.stepInterpolant){let gt=t.getSource().maxzoom,ur=oe.canonical.z===gt?Math.ceil(1<<d.transform.maxZoom-oe.canonical.z):1;Rt=a.clamp(a.nextPowerOfTwo(W.maxLineLength/a.EXTENT*1024*ur),256,G.maxTextureSize)}nt.gradient=a.renderColorRamp({expression:l.gradientExpression(),evaluationKey:"lineProgress",resolution:Rt,image:nt.gradient||void 0,clips:W.lineClipsArray}),nt.texture?nt.texture.update(nt.gradient):nt.texture=new _e(G,nt.gradient,Z.RGBA),nt.version=l.gradientVersion,Mt=nt.texture}G.activeTexture.set(Z.TEXTURE0),Mt.bind(l.stepInterpolant?Z.NEAREST:Z.LINEAR,Z.CLAMP_TO_EDGE)}Ee.draw(G,Z.TRIANGLES,v,d.stencilModeForClipping(oe),E,kr.disabled,Ze,ze,l.id,W.layoutVertexBuffer,W.indexBuffer,W.segments,l.paint,d.transform.zoom,de,W.layoutVertexBuffer2),re=!1}},fill:function(d,t,l,h){let m=l.paint.get("fill-color"),g=l.paint.get("fill-opacity");if(g.constantOr(1)===0)return;let v=d.colorModeForRenderPass(),E=l.paint.get("fill-pattern"),S=d.opaquePassEnabledForLayer()&&!E.constantOr(1)&&m.constantOr(a.Color.transparent).a===1&&g.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===S){let A=d.depthModeForSublayer(1,d.renderPass==="opaque"?Gt.ReadWrite:Gt.ReadOnly);Ls(d,t,l,h,A,v,!1)}if(d.renderPass==="translucent"&&l.paint.get("fill-antialias")){let A=d.depthModeForSublayer(l.getPaintProperty("fill-outline-color")?2:0,Gt.ReadOnly);Ls(d,t,l,h,A,v,!0)}},"fill-extrusion":function(d,t,l,h){let m=l.paint.get("fill-extrusion-opacity");if(m!==0&&d.renderPass==="translucent"){let g=new Gt(d.context.gl.LEQUAL,Gt.ReadWrite,d.depthRangeFor3D);if(m!==1||l.paint.get("fill-extrusion-pattern").constantOr(1))Bs(d,t,l,h,g,xr.disabled,Sr.disabled),Bs(d,t,l,h,g,d.stencilModeFor3D(),d.colorModeForRenderPass());else{let v=d.colorModeForRenderPass();Bs(d,t,l,h,g,xr.disabled,v)}}},hillshade:function(d,t,l,h){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;let m=d.context,g=d.depthModeForSublayer(0,Gt.ReadOnly),v=d.colorModeForRenderPass(),[E,S]=d.renderPass==="translucent"?d.stencilConfigForOverlap(h):[{},h];for(let A of S){let M=t.getTile(A);M.needsHillshadePrepare!==void 0&&M.needsHillshadePrepare&&d.renderPass==="offscreen"?Xc(d,M,l,g,xr.disabled,v):d.renderPass==="translucent"&&tu(d,A,M,l,g,E[A.overscaledZ],v)}m.viewport.set([0,0,d.width,d.height])},raster:function(d,t,l,h){if(d.renderPass!=="translucent"||l.paint.get("raster-opacity")===0||!h.length)return;let m=d.context,g=m.gl,v=t.getSource(),E=d.useProgram("raster"),S=d.colorModeForRenderPass(),[A,M]=v instanceof ye?[{},h]:d.stencilConfigForOverlap(h),F=M[M.length-1].overscaledZ,B=!d.options.moving;for(let K of M){let G=d.depthModeForSublayer(K.overscaledZ-F,l.paint.get("raster-opacity")===1?Gt.ReadWrite:Gt.ReadOnly,g.LESS),Z=t.getTile(K);Z.registerFadeDuration(l.paint.get("raster-fade-duration"));let re=t.findLoadedParent(K,0),oe=Ia(Z,re,t,l,d.transform,d.style.terrain),ue,W,de=l.paint.get("raster-resampling")==="nearest"?g.NEAREST:g.LINEAR;m.activeTexture.set(g.TEXTURE0),Z.texture.bind(de,g.CLAMP_TO_EDGE,g.LINEAR_MIPMAP_NEAREST),m.activeTexture.set(g.TEXTURE1),re?(re.texture.bind(de,g.CLAMP_TO_EDGE,g.LINEAR_MIPMAP_NEAREST),ue=Math.pow(2,re.tileID.overscaledZ-Z.tileID.overscaledZ),W=[Z.tileID.canonical.x*ue%1,Z.tileID.canonical.y*ue%1]):Z.texture.bind(de,g.CLAMP_TO_EDGE,g.LINEAR_MIPMAP_NEAREST);let ce=d.style.terrain&&d.style.terrain.getTerrainData(K),Ee=ce?K:null,Te=Ee?Ee.posMatrix:d.transform.calculatePosMatrix(K.toUnwrapped(),B),ze=Lc(Te,W||[0,0],ue||1,oe,l);v instanceof ye?E.draw(m,g.TRIANGLES,G,xr.disabled,S,kr.disabled,ze,ce,l.id,v.boundsBuffer,d.quadTriangleIndexBuffer,v.boundsSegments):E.draw(m,g.TRIANGLES,G,A[K.overscaledZ],S,kr.disabled,ze,ce,l.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}},background:function(d,t,l,h){let m=l.paint.get("background-color"),g=l.paint.get("background-opacity");if(g===0)return;let v=d.context,E=v.gl,S=d.transform,A=S.tileSize,M=l.paint.get("background-pattern");if(d.isPatternMissing(M))return;let F=!M&&m.a===1&&g===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==F)return;let B=xr.disabled,K=d.depthModeForSublayer(0,F==="opaque"?Gt.ReadWrite:Gt.ReadOnly),G=d.colorModeForRenderPass(),Z=d.useProgram(M?"backgroundPattern":"background"),re=h||S.coveringTiles({tileSize:A,terrain:d.style.terrain});M&&(v.activeTexture.set(E.TEXTURE0),d.imageManager.bind(d.context));let oe=l.getCrossfadeParameters();for(let ue of re){let W=h?ue.posMatrix:d.transform.calculatePosMatrix(ue.toUnwrapped()),de=M?rd(W,g,d,M,{tileID:ue,tileSize:A},oe):td(W,g,m),ce=d.style.terrain&&d.style.terrain.getTerrainData(ue);Z.draw(v,E.TRIANGLES,K,B,G,kr.disabled,de,ce,l.id,d.tileExtentBuffer,d.quadTriangleIndexBuffer,d.tileExtentSegments)}},debug:function(d,t,l){for(let h=0;h<l.length;h++)dd(d,t,l[h])},custom:function(d,t,l){let h=d.context,m=l.implementation;if(d.renderPass==="offscreen"){let g=m.prerender;g&&(d.setCustomLayerDefaults(),h.setColorMode(d.colorModeForRenderPass()),g.call(m,h.gl,d.transform.customLayerMatrix()),h.setDirty(),d.setBaseState())}else if(d.renderPass==="translucent"){d.setCustomLayerDefaults(),h.setColorMode(d.colorModeForRenderPass()),h.setStencilMode(xr.disabled);let g=m.renderingMode==="3d"?new Gt(d.context.gl.LEQUAL,Gt.ReadWrite,d.depthRangeFor3D):d.depthModeForSublayer(0,Gt.ReadOnly);h.setDepthMode(g),m.render(h.gl,d.transform.customLayerMatrix()),h.setDirty(),d.setBaseState(),h.bindFramebuffer.set(null)}}};class iu{constructor(t,l){this.context=new Kc(t),this.transform=l,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.create(),renderTime:0},this.setup(),this.numSublayers=Dt.maxUnderzooming+Dt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new St,this.gpuTimers={}}resize(t,l,h){if(this.width=t*h,this.height=l*h,this.pixelRatio=h,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let m of this.style._order)this.style._layers[m].resize()}setup(){let t=this.context,l=new a.PosArray;l.emplaceBack(0,0),l.emplaceBack(a.EXTENT,0),l.emplaceBack(0,a.EXTENT),l.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(l,Ht.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);let h=new a.PosArray;h.emplaceBack(0,0),h.emplaceBack(a.EXTENT,0),h.emplaceBack(0,a.EXTENT),h.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=t.createVertexBuffer(h,Ht.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);let m=new a.RasterBoundsArray;m.emplaceBack(0,0,0,0),m.emplaceBack(a.EXTENT,0,a.EXTENT,0),m.emplaceBack(0,a.EXTENT,0,a.EXTENT),m.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(m,Er.members),this.rasterBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);let g=new a.PosArray;g.emplaceBack(0,0),g.emplaceBack(1,0),g.emplaceBack(0,1),g.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(g,Ht.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);let v=new a.LineStripIndexArray;v.emplaceBack(0),v.emplaceBack(1),v.emplaceBack(3),v.emplaceBack(2),v.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(v);let E=new a.TriangleIndexArray;E.emplaceBack(0,1,2),E.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(E),this.emptyTexture=new _e(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);let S=this.context.gl;this.stencilClearMode=new xr({func:S.ALWAYS,mask:0},0,255,S.ZERO,S.ZERO,S.ZERO)}clearStencil(){let t=this.context,l=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let h=a.create();a.ortho(h,0,this.width,this.height,0,0,1),a.scale(h,h,[l.drawingBufferWidth,l.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,l.TRIANGLES,Gt.disabled,this.stencilClearMode,Sr.disabled,kr.disabled,Ho(h),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,l){if(this.currentStencilSource===t.source||!t.isTileClipped()||!l||!l.length)return;this.currentStencilSource=t.source;let h=this.context,m=h.gl;this.nextStencilID+l.length>256&&this.clearStencil(),h.setColorMode(Sr.disabled),h.setDepthMode(Gt.disabled);let g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let v of l){let E=this._tileClippingMaskIDs[v.key]=this.nextStencilID++,S=this.style.terrain&&this.style.terrain.getTerrainData(v);g.draw(h,m.TRIANGLES,Gt.disabled,new xr({func:m.ALWAYS,mask:0},E,255,m.KEEP,m.KEEP,m.REPLACE),Sr.disabled,kr.disabled,Ho(v.posMatrix),S,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,l=this.context.gl;return new xr({func:l.NOTEQUAL,mask:255},t,255,l.KEEP,l.KEEP,l.REPLACE)}stencilModeForClipping(t){let l=this.context.gl;return new xr({func:l.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,l.KEEP,l.KEEP,l.REPLACE)}stencilConfigForOverlap(t){let l=this.context.gl,h=t.sort((v,E)=>E.overscaledZ-v.overscaledZ),m=h[h.length-1].overscaledZ,g=h[0].overscaledZ-m+1;if(g>1){this.currentStencilSource=void 0,this.nextStencilID+g>256&&this.clearStencil();let v={};for(let E=0;E<g;E++)v[E+m]=new xr({func:l.GEQUAL,mask:255},E+this.nextStencilID,255,l.KEEP,l.KEEP,l.REPLACE);return this.nextStencilID+=g,[v,h]}return[{[m]:xr.disabled},h]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new Sr([t.CONSTANT_COLOR,t.ONE],new a.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Sr.unblended:Sr.alphaBlended}depthModeForSublayer(t,l,h){if(!this.opaquePassEnabledForLayer())return Gt.disabled;let m=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Gt(h||this.context.gl.LEQUAL,l,[m,m])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,l){this.style=t,this.options=l,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(a.exported.now()),this.imageManager.beginFrame();let h=this.style._order,m=this.style.sourceCaches,g=this.style.terrain&&new Qc(this);for(let A in m){let M=m[A];M.used&&M.prepare(this.context)}let v={},E={},S={};for(let A in m){let M=m[A];v[A]=M.getVisibleCoordinates(),E[A]=v[A].slice().reverse(),S[A]=M.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let A=0;A<h.length;A++)if(this.style._layers[h[A]].is3D()){this.opaquePassCutoff=A;break}if(g){this.opaquePassCutoff=0;let A=this.style.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!a.equals(this.terrainFacilitator.matrix,this.transform.projMatrix)||A.length)&&(a.copy(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(M,F){let B=M.context,K=B.gl,G=Sr.unblended,Z=new Gt(K.LEQUAL,Gt.ReadWrite,[0,1]),re=F.getTerrainMesh(),oe=F.sourceCache.getRenderableTiles(),ue=M.useProgram("terrainDepth");B.bindFramebuffer.set(F.getFramebuffer("depth").framebuffer),B.viewport.set([0,0,M.width/devicePixelRatio,M.height/devicePixelRatio]),B.clear({color:a.Color.transparent,depth:1});for(let W of oe){let de=F.getTerrainData(W.tileID),ce=M.transform.calculatePosMatrix(W.tileID.toUnwrapped());ue.draw(B,K.TRIANGLES,Z,xr.disabled,G,kr.backCCW,{u_matrix:ce},de,"terrain",re.vertexBuffer,re.indexBuffer,re.segments)}B.bindFramebuffer.set(null),B.viewport.set([0,0,M.width,M.height])}(this,this.style.terrain),function(M,F){let B=M.context,K=B.gl,G=Sr.unblended,Z=new Gt(K.LEQUAL,Gt.ReadWrite,[0,1]),re=F.getTerrainMesh(),oe=F.getCoordsTexture(),ue=F.sourceCache.getRenderableTiles(),W=M.useProgram("terrainCoords");B.bindFramebuffer.set(F.getFramebuffer("coords").framebuffer),B.viewport.set([0,0,M.width/devicePixelRatio,M.height/devicePixelRatio]),B.clear({color:a.Color.transparent,depth:1}),F.coordsIndex=[];for(let de of ue){let ce=F.getTerrainData(de.tileID);B.activeTexture.set(K.TEXTURE0),K.bindTexture(K.TEXTURE_2D,oe.texture);let Ee=M.transform.calculatePosMatrix(de.tileID.toUnwrapped());W.draw(B,K.TRIANGLES,Z,xr.disabled,G,kr.backCCW,{u_matrix:Ee,u_terrain_coords_id:(255-F.coordsIndex.length)/255,u_texture:0},ce,"terrain",re.vertexBuffer,re.indexBuffer,re.segments),F.coordsIndex.push(de.tileID.key)}B.bindFramebuffer.set(null),B.viewport.set([0,0,M.width,M.height])}(this,this.style.terrain))}this.renderPass="offscreen";for(let A of h){let M=this.style._layers[A];if(!M.hasOffscreenPass()||M.isHidden(this.transform.zoom))continue;let F=E[M.source];(M.type==="custom"||F.length)&&this.renderLayer(this,m[M.source],M,F)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:l.showOverdrawInspector?a.Color.black:a.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=l.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!g)for(this.renderPass="opaque",this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){let A=this.style._layers[h[this.currentLayer]],M=m[A.source],F=v[A.source];this._renderTileClippingMasks(A,F),this.renderLayer(this,M,A,F)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){let A=this.style._layers[h[this.currentLayer]],M=m[A.source];if(g&&g.renderLayer(A))continue;let F=(A.type==="symbol"?S:E)[A.source];this._renderTileClippingMasks(A,v[A.source]),this.renderLayer(this,M,A,F)}if(this.options.showTileBoundaries){let A,M;Object.values(this.style._layers).forEach(F=>{F.source&&!F.isHidden(this.transform.zoom)&&(F.source!==(M&&M.id)&&(M=this.style.sourceCaches[F.source]),(!A||A.getSource().maxzoom<M.getSource().maxzoom)&&(A=M))}),A&&js.debug(this,A,A.getVisibleCoordinates())}this.options.showPadding&&function(A){let M=A.transform.padding;Po(A,A.transform.height-(M.top||0),3,Pa),Po(A,M.bottom||0,3,mn),Ns(A,M.left||0,3,Hc),Ns(A,A.transform.width-(M.right||0),3,ru);let F=A.transform.centerPoint;(function(B,K,G,Z){rs(B,K-1,G-10,2,20,Z),rs(B,K-10,G-1,20,2,Z)})(A,F.x,A.transform.height-F.y,Jc)}(this),this.context.setDefault()}renderLayer(t,l,h,m){h.isHidden(this.transform.zoom)||(h.type==="background"||h.type==="custom"||(m||[]).length)&&(this.id=h.id,this.gpuTimingStart(h),js[h.type](t,l,h,m,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(t){if(!this.options.gpuTiming)return;let l=this.context.extTimerQuery,h=this.gpuTimers[t.id];h||(h=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:l.createQueryEXT()}),h.calls++,l.beginQueryEXT(l.TIME_ELAPSED_EXT,h.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}collectGpuTimers(){let t=this.gpuTimers;return this.gpuTimers={},t}queryGpuTimers(t){let l={};for(let h in t){let m=t[h],g=this.context.extTimerQuery,v=g.getQueryObjectEXT(m.query,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(m.query),l[h]=v}return l}translatePosMatrix(t,l,h,m,g){if(!h[0]&&!h[1])return t;let v=g?m==="map"?this.transform.angle:0:m==="viewport"?-this.transform.angle:0;if(v){let A=Math.sin(v),M=Math.cos(v);h=[h[0]*M-h[1]*A,h[0]*A+h[1]*M]}let E=[g?h[0]:Pt(l,h[0],this.transform.zoom),g?h[1]:Pt(l,h[1],this.transform.zoom),0],S=new Float32Array(16);return a.translate(S,t,E),S}saveTileTexture(t){let l=this._tileTextures[t.size[0]];l?l.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let l=this._tileTextures[t];return l&&l.length>0?l.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let l=this.imageManager.getPattern(t.from.toString()),h=this.imageManager.getPattern(t.to.toString());return!l||!h}useProgram(t,l){this.cache=this.cache||{};let h=t+(l?l.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[h]||(this.cache[h]=new zc(this.context,t,Is[t],l,$l[t],this._showOverdrawInspector,this.style.terrain)),this.cache[h]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _e(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class za{constructor(t,l){this.points=t,this.planes=l}static fromInvProjectionMatrix(t,l,h){let m=Math.pow(2,h),g=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(E=>{let S=1/(E=a.transformMat4([],E,t))[3]/l*m;return a.mul$1(E,E,[S,S,1/E[3],S])}),v=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(E=>{let S=a.sub([],g[E[0]],g[E[1]]),A=a.sub([],g[E[2]],g[E[1]]),M=a.normalize([],a.cross([],S,A)),F=-a.dot(M,g[E[1]]);return M.concat(F)});return new za(g,v)}}class Vs{constructor(t,l){this.min=t,this.max=l,this.center=a.scale$1([],a.add([],this.min,this.max),.5)}quadrant(t){let l=[t%2==0,t<2],h=a.clone$2(this.min),m=a.clone$2(this.max);for(let g=0;g<l.length;g++)h[g]=l[g]?this.min[g]:this.center[g],m[g]=l[g]?this.center[g]:this.max[g];return m[2]=this.max[2],new Vs(h,m)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){let l=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],h=!0;for(let m=0;m<t.planes.length;m++){let g=t.planes[m],v=0;for(let E=0;E<l.length;E++)a.dot$1(g,l[E])>=0&&v++;if(v===0)return 0;v!==l.length&&(h=!1)}if(h)return 2;for(let m=0;m<3;m++){let g=Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let E=0;E<t.points.length;E++){let S=t.points[E][m]-this.min[m];g=Math.min(g,S),v=Math.max(v,S)}if(v<0||g>this.max[m]-this.min[m])return 0}return 1}}class is{constructor(t=0,l=0,h=0,m=0){if(isNaN(t)||t<0||isNaN(l)||l<0||isNaN(h)||h<0||isNaN(m)||m<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=l,this.left=h,this.right=m}interpolate(t,l,h){return l.top!=null&&t.top!=null&&(this.top=a.number(t.top,l.top,h)),l.bottom!=null&&t.bottom!=null&&(this.bottom=a.number(t.bottom,l.bottom,h)),l.left!=null&&t.left!=null&&(this.left=a.number(t.left,l.left,h)),l.right!=null&&t.right!=null&&(this.right=a.number(t.right,l.right,h)),this}getCenter(t,l){let h=a.clamp((this.left+t-this.right)/2,0,t),m=a.clamp((this.top+l-this.bottom)/2,0,l);return new a.pointGeometry(h,m)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new is(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Us{constructor(t,l,h,m,g){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=g===void 0||!!g,this._minZoom=t||0,this._maxZoom=l||22,this._minPitch=h??0,this._maxPitch=m??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new is,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let t=new Us(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t._elevation=this._elevation,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){let l=-a.wrap(t,-180,180)*Math.PI/180;var h;this.angle!==l&&(this._unmodified=!1,this.angle=l,this._calcMatrices(),this.rotationMatrix=(h=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(m,g,v){var E=g[0],S=g[1],A=g[2],M=g[3],F=Math.sin(v),B=Math.cos(v);m[0]=E*B+A*F,m[1]=S*B+M*F,m[2]=E*-F+A*B,m[3]=S*-F+M*B}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let l=a.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==l&&(this._unmodified=!1,this._pitch=l,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let l=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==l&&(this._unmodified=!1,this._zoom=l,this.scale=this.zoomScale(l),this.tileZoom=Math.floor(l),this.zoomFraction=l-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,l,h){this._unmodified=!1,this._edgeInsets.interpolate(t,l,h),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){let l=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,l)}getVisibleUnwrappedCoordinates(t){let l=[new a.UnwrappedTileID(0,t)];if(this._renderWorldCopies){let h=this.pointCoordinate(new a.pointGeometry(0,0)),m=this.pointCoordinate(new a.pointGeometry(this.width,0)),g=this.pointCoordinate(new a.pointGeometry(this.width,this.height)),v=this.pointCoordinate(new a.pointGeometry(0,this.height)),E=Math.floor(Math.min(h.x,m.x,g.x,v.x)),S=Math.floor(Math.max(h.x,m.x,g.x,v.x)),A=1;for(let M=E-A;M<=S+A;M++)M!==0&&l.push(new a.UnwrappedTileID(M,t))}return l}coveringTiles(t){var l,h;let m=this.coveringZoomLevel(t),g=m;if(t.minzoom!==void 0&&m<t.minzoom)return[];t.maxzoom!==void 0&&m>t.maxzoom&&(m=t.maxzoom);let v=this.pointCoordinate(this.getCameraPoint()),E=a.MercatorCoordinate.fromLngLat(this.center),S=Math.pow(2,m),A=[S*v.x,S*v.y,0],M=[S*E.x,S*E.y,0],F=za.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,m),B=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(B=m);let K=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,G=W=>({aabb:new Vs([W*S,0,0],[(W+1)*S,S,0]),zoom:0,x:0,y:0,wrap:W,fullyVisible:!1}),Z=[],re=[],oe=m,ue=t.reparseOverscaled?g:m;if(this._renderWorldCopies)for(let W=1;W<=3;W++)Z.push(G(-W)),Z.push(G(W));for(Z.push(G(0));Z.length>0;){let W=Z.pop(),de=W.x,ce=W.y,Ee=W.fullyVisible;if(!Ee){let nt=W.aabb.intersects(F);if(nt===0)continue;Ee=nt===2}let Te=t.terrain?A:M,ze=W.aabb.distanceX(Te),xe=W.aabb.distanceY(Te),rt=Math.max(Math.abs(ze),Math.abs(xe)),Ze=K+(1<<oe-W.zoom)-2;if(W.zoom===oe||rt>Ze&&W.zoom>=B){let nt=oe-W.zoom,Mt=A[0]-.5-(de<<nt),Rt=A[1]-.5-(ce<<nt);re.push({tileID:new a.OverscaledTileID(W.zoom===oe?ue:W.zoom,W.wrap,W.zoom,de,ce),distanceSq:a.sqrLen([M[0]-.5-de,M[1]-.5-ce]),tileDistanceToCamera:Math.sqrt(Mt*Mt+Rt*Rt)})}else for(let nt=0;nt<4;nt++){let Mt=(de<<1)+nt%2,Rt=(ce<<1)+(nt>>1),gt=W.zoom+1,ur=W.aabb.quadrant(nt);if(t.terrain){let cr=new a.OverscaledTileID(gt,W.wrap,gt,Mt,Rt),Kt=t.terrain.getMinMaxElevation(cr),Yt=(l=Kt.minElevation)!==null&&l!==void 0?l:this.elevation,pr=(h=Kt.maxElevation)!==null&&h!==void 0?h:this.elevation;ur=new Vs([ur.min[0],ur.min[1],Yt],[ur.max[0],ur.max[1],pr])}Z.push({aabb:ur,zoom:gt,x:Mt,y:Rt,wrap:W.wrap,fullyVisible:Ee})}}return re.sort((W,de)=>W.distanceSq-de.distanceSq).map(W=>W.tileID)}resize(t,l){this.width=t,this.height=l,this.pixelsToGLUnits=[2/t,-2/l],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let l=a.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new a.pointGeometry(a.mercatorXfromLng(t.lng)*this.worldSize,a.mercatorYfromLat(l)*this.worldSize)}unproject(t){return new a.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(t){this.freezeElevation||(this.elevation=t?this.getElevation(this._center,t):0)}getElevation(t,l){let h=a.MercatorCoordinate.fromLngLat(t),m=(1<<this.tileZoom)*a.EXTENT,g=h.x*m,v=h.y*m,E=Math.floor(g/a.EXTENT),S=Math.floor(v/a.EXTENT),A=new a.OverscaledTileID(this.tileZoom,0,this.tileZoom,E,S);return l.getElevation(A,g%a.EXTENT,v%a.EXTENT,a.EXTENT)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let l=this.pointLocation(this.centerPoint,t),h=this.getElevation(l,t);if(!(this.elevation-h))return;let m=this.getCameraPosition(),g=a.MercatorCoordinate.fromLngLat(m.lngLat,m.altitude),v=a.MercatorCoordinate.fromLngLat(l,h),E=g.x-v.x,S=g.y-v.y,A=g.z-v.z,M=Math.sqrt(E*E+S*S+A*A),F=this.scaleZoom(this.cameraToCenterDistance/M/this.tileSize);this._elevation=h,this._center=l,this.zoom=F}setLocationAtPoint(t,l){let h=this.pointCoordinate(l),m=this.pointCoordinate(this.centerPoint),g=this.locationCoordinate(t),v=new a.MercatorCoordinate(g.x-(h.x-m.x),g.y-(h.y-m.y));this.center=this.coordinateLocation(v),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,l){return l?this.coordinatePoint(this.locationCoordinate(t),this.getElevation(t,l),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,l){return this.coordinateLocation(this.pointCoordinate(t,l))}locationCoordinate(t){return a.MercatorCoordinate.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,l){if(l){let B=l.pointCoordinate(t);if(B!=null)return B}let h=[t.x,t.y,0,1],m=[t.x,t.y,1,1];a.transformMat4(h,h,this.pixelMatrixInverse),a.transformMat4(m,m,this.pixelMatrixInverse);let g=h[3],v=m[3],E=h[1]/g,S=m[1]/v,A=h[2]/g,M=m[2]/v,F=A===M?0:(0-A)/(M-A);return new a.MercatorCoordinate(a.number(h[0]/g,m[0]/v,F)/this.worldSize,a.number(E,S,F)/this.worldSize)}coordinatePoint(t,l=0,h=this.pixelMatrix){let m=[t.x*this.worldSize,t.y*this.worldSize,l,1];return a.transformMat4(m,m,h),new a.pointGeometry(m[0]/m[3],m[1]/m[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return new a.LngLatBounds().extend(this.pointLocation(new a.pointGeometry(0,t))).extend(this.pointLocation(new a.pointGeometry(this.width,t))).extend(this.pointLocation(new a.pointGeometry(this.width,this.height))).extend(this.pointLocation(new a.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new a.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,l=!1){let h=t.key,m=l?this._alignedPosMatrixCache:this._posMatrixCache;if(m[h])return m[h];let g=t.canonical,v=this.worldSize/this.zoomScale(g.z),E=g.x+Math.pow(2,g.z)*t.wrap,S=a.identity(new Float64Array(16));return a.translate(S,S,[E*v,g.y*v,0]),a.scale(S,S,[v/a.EXTENT,v/a.EXTENT,1]),a.multiply(S,l?this.alignedProjMatrix:this.projMatrix,S),m[h]=new Float32Array(S),m[h]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,l,h,m,g=-90,v=90,E=-180,S=180,A=this.size,M=this._unmodified;if(this.latRange){let K=this.latRange;g=a.mercatorYfromLat(K[1])*this.worldSize,v=a.mercatorYfromLat(K[0])*this.worldSize,t=v-g<A.y?A.y/(v-g):0}if(this.lngRange){let K=this.lngRange;E=a.wrap(a.mercatorXfromLng(K[0])*this.worldSize,0,this.worldSize),S=a.wrap(a.mercatorXfromLng(K[1])*this.worldSize,0,this.worldSize),S<E&&(S+=this.worldSize),l=S-E<A.x?A.x/(S-E):0}let F=this.point,B=Math.max(l||0,t||0);if(B)return this.center=this.unproject(new a.pointGeometry(l?(S+E)/2:F.x,t?(v+g)/2:F.y)),this.zoom+=this.scaleZoom(B),this._unmodified=M,void(this._constraining=!1);if(this.latRange){let K=F.y,G=A.y/2;K-G<g&&(m=g+G),K+G>v&&(m=v-G)}if(this.lngRange){let K=(E+S)/2,G=a.wrap(F.x,K-this.worldSize/2,K+this.worldSize/2),Z=A.x/2;G-Z<E&&(h=E+Z),G+Z>S&&(h=S-Z)}h===void 0&&m===void 0||(this.center=this.unproject(new a.pointGeometry(h!==void 0?h:F.x,m!==void 0?m:F.y)).wrap()),this._unmodified=M,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,l=this.point.x,h=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let m=a.identity(new Float64Array(16));a.scale(m,m,[this.width/2,-this.height/2,1]),a.translate(m,m,[1,-1,0]),this.labelPlaneMatrix=m,m=a.identity(new Float64Array(16)),a.scale(m,m,[1,-1,1]),a.translate(m,m,[-1,-1,0]),a.scale(m,m,[2/this.width,2/this.height,1]),this.glCoordMatrix=m,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);let g=Math.PI/2+this._pitch,v=this._fov*(.5+t.y/this.height),E=Math.sin(v)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-g-v,.01,Math.PI-.01)),S=this.getHorizon(),A=2*Math.atan(S/this.cameraToCenterDistance)*(.5+t.y/(2*S)),M=Math.sin(A)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-g-A,.01,Math.PI-.01)),F=Math.cos(Math.PI/2-this._pitch)*E+this.cameraToSeaLevelDistance,B=Math.cos(Math.PI/2-this._pitch)*M+this.cameraToSeaLevelDistance,K=1.01*Math.min(F,B),G=this.height/50;m=new Float64Array(16),a.perspective(m,this._fov,this.width/this.height,G,K),m[8]=2*-t.x/this.width,m[9]=2*t.y/this.height,a.scale(m,m,[1,-1,1]),a.translate(m,m,[0,0,-this.cameraToCenterDistance]),a.rotateX(m,m,this._pitch),a.rotateZ(m,m,this.angle),a.translate(m,m,[-l,-h,0]),this.mercatorMatrix=a.scale([],m,[this.worldSize,this.worldSize,this.worldSize]),a.scale(m,m,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,m),a.translate(m,m,[0,0,-this.elevation]),this.projMatrix=m,this.invProjMatrix=a.invert([],m),this.pixelMatrix3D=a.multiply(new Float64Array(16),this.labelPlaneMatrix,m);let Z=this.width%2/2,re=this.height%2/2,oe=Math.cos(this.angle),ue=Math.sin(this.angle),W=l-Math.round(l)+oe*Z+ue*re,de=h-Math.round(h)+oe*re+ue*Z,ce=new Float64Array(m);if(a.translate(ce,ce,[W>.5?W-1:W,de>.5?de-1:de,0]),this.alignedProjMatrix=ce,m=a.invert(new Float64Array(16),this.pixelMatrix),!m)throw new Error("failed to invert matrix");this.pixelMatrixInverse=m,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new a.pointGeometry(0,0)),l=[t.x*this.worldSize,t.y*this.worldSize,0,1];return a.transformMat4(l,l,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.pointGeometry(0,t))}getCameraQueryGeometry(t){let l=this.getCameraPoint();if(t.length===1)return[t[0],l];{let h=l.x,m=l.y,g=l.x,v=l.y;for(let E of t)h=Math.min(h,E.x),m=Math.min(m,E.y),g=Math.max(g,E.x),v=Math.max(v,E.y);return[new a.pointGeometry(h,m),new a.pointGeometry(g,m),new a.pointGeometry(g,v),new a.pointGeometry(h,v),new a.pointGeometry(h,m)]}}}class eh{constructor(t){this._hashName=t&&encodeURIComponent(t),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(l,h){let m=!1,g=null,v=()=>{g=null,m&&(l(),g=setTimeout(v,300),m=!1)};return()=>(m=!0,g||v(),g)}(this._updateHashUnthrottled.bind(this))}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){let l=this._map.getCenter(),h=Math.round(100*this._map.getZoom())/100,m=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),g=Math.pow(10,m),v=Math.round(l.lng*g)/g,E=Math.round(l.lat*g)/g,S=this._map.getBearing(),A=this._map.getPitch(),M="";if(M+=t?`/${v}/${E}/${h}`:`${h}/${E}/${v}`,(S||A)&&(M+="/"+Math.round(10*S)/10),A&&(M+=`/${Math.round(A)}`),this._hashName){let F=this._hashName,B=!1,K=window.location.hash.slice(1).split("&").map(G=>{let Z=G.split("=")[0];return Z===F?(B=!0,`${Z}=${M}`):G}).filter(G=>G);return B||K.push(`${F}=${M}`),`#${K.join("&")}`}return`#${M}`}_getCurrentHash(){let t=window.location.hash.replace("#","");if(this._hashName){let l;return t.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(l=h)}),(l&&l[1]||"").split("/")}return t.split("/")}_onHashChange(){let t=this._getCurrentHash();if(t.length>=3&&!t.some(l=>isNaN(l))){let l=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:l,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){let t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch{}}}let $s={linearity:.3,easing:a.bezier(0,0,.3,1)},th=a.extend({deceleration:2500,maxSpeed:1400},$s),rh=a.extend({deceleration:20,maxSpeed:1400},$s),ih=a.extend({deceleration:1e3,maxSpeed:360},$s),ns=a.extend({deceleration:1e3,maxSpeed:90},$s);class nh{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,l=a.exported.now();for(;t.length>0&&l-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let l={zoom:0,bearing:0,pitch:0,pan:new a.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:g}of this._inertiaBuffer)l.zoom+=g.zoomDelta||0,l.bearing+=g.bearingDelta||0,l.pitch+=g.pitchDelta||0,g.panDelta&&l.pan._add(g.panDelta),g.around&&(l.around=g.around),g.pinchAround&&(l.pinchAround=g.pinchAround);let h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(l.pan.mag()){let g=Gs(l.pan.mag(),h,a.extend({},th,t||{}));m.offset=l.pan.mult(g.amount/l.pan.mag()),m.center=this._map.transform.center,qs(m,g)}if(l.zoom){let g=Gs(l.zoom,h,rh);m.zoom=this._map.transform.zoom+g.amount,qs(m,g)}if(l.bearing){let g=Gs(l.bearing,h,ih);m.bearing=this._map.transform.bearing+a.clamp(g.amount,-179,179),qs(m,g)}if(l.pitch){let g=Gs(l.pitch,h,ns);m.pitch=this._map.transform.pitch+g.amount,qs(m,g)}if(m.zoom||m.bearing){let g=l.pinchAround===void 0?l.around:l.pinchAround;m.around=g?this._map.unproject(g):this._map.getCenter()}return this.clear(),a.extend(m,{noMoveStart:!0})}}function qs(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function Gs(d,t,l){let{maxSpeed:h,linearity:m,deceleration:g}=l,v=a.clamp(d*m/(t/1e3),-h,h),E=Math.abs(v)/(g*m);return{easing:l.easing,duration:1e3*E,amount:v*(E/2)}}class Vi extends a.Event{constructor(t,l,h,m={}){let g=I.mousePos(l.getCanvasContainer(),h),v=l.unproject(g);super(t,a.extend({point:g,lngLat:v,originalEvent:h},m)),this._defaultPrevented=!1,this.target=l}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Zs extends a.Event{constructor(t,l,h){let m=t==="touchend"?h.changedTouches:h.touches,g=I.touchPos(l.getCanvasContainer(),m),v=g.map(S=>l.unproject(S)),E=g.reduce((S,A,M,F)=>S.add(A.div(F.length)),new a.pointGeometry(0,0));super(t,{points:g,point:E,lngLats:v,lngLat:l.unproject(E),originalEvent:h}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Ui extends a.Event{constructor(t,l,h){super(t,{originalEvent:h}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class fd{constructor(t,l){this._map=t,this._clickTolerance=l.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Ui(t.type,this._map,t))}mousedown(t,l){return this._mousedownPos=l,this._firePreventable(new Vi(t.type,this._map,t))}mouseup(t){this._map.fire(new Vi(t.type,this._map,t))}click(t,l){this._mousedownPos&&this._mousedownPos.dist(l)>=this._clickTolerance||this._map.fire(new Vi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Vi(t.type,this._map,t))}mouseover(t){this._map.fire(new Vi(t.type,this._map,t))}mouseout(t){this._map.fire(new Vi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Zs(t.type,this._map,t))}touchmove(t){this._map.fire(new Zs(t.type,this._map,t))}touchend(t){this._map.fire(new Zs(t.type,this._map,t))}touchcancel(t){this._map.fire(new Zs(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class co{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Vi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Vi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Vi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class oh{constructor(t,l){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=l.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,l){this.isEnabled()&&t.shiftKey&&t.button===0&&(I.disableDrag(),this._startPos=this._lastPos=l,this._active=!0)}mousemoveWindow(t,l){if(!this._active)return;let h=l;if(this._lastPos.equals(h)||!this._box&&h.dist(this._startPos)<this._clickTolerance)return;let m=this._startPos;this._lastPos=h,this._box||(this._box=I.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));let g=Math.min(m.x,h.x),v=Math.max(m.x,h.x),E=Math.min(m.y,h.y),S=Math.max(m.y,h.y);I.setTransform(this._box,`translate(${g}px,${E}px)`),this._box.style.width=v-g+"px",this._box.style.height=S-E+"px"}mouseupWindow(t,l){if(!this._active||t.button!==0)return;let h=this._startPos,m=l;if(this.reset(),I.suppressClick(),h.x!==m.x||h.y!==m.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:g=>g.fitScreenCoordinates(h,m,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(I.remove(this._box),this._box=null),I.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,l){return this._map.fire(new a.Event(t,{originalEvent:l}))}}function Gn(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);let l={};for(let h=0;h<d.length;h++)l[d[h].identifier]=t[h];return l}class Ks{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,l,h){(this.centroid||h.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),h.length===this.numTouches&&(this.centroid=function(m){let g=new a.pointGeometry(0,0);for(let v of m)g._add(v);return g.div(m.length)}(l),this.touches=Gn(h,l)))}touchmove(t,l,h){if(this.aborted||!this.centroid)return;let m=Gn(h,l);for(let g in this.touches){let v=this.touches[g],E=m[g];(!E||E.dist(v)>30)&&(this.aborted=!0)}}touchend(t,l,h){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){let m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class nu{constructor(t){this.singleTap=new Ks(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,l,h){this.singleTap.touchstart(t,l,h)}touchmove(t,l,h){this.singleTap.touchmove(t,l,h)}touchend(t,l,h){let m=this.singleTap.touchend(t,l,h);if(m){let g=t.timeStamp-this.lastTime<500,v=!this.lastTap||this.lastTap.dist(m)<30;if(g&&v||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class md{constructor(){this._zoomIn=new nu({numTouches:1,numTaps:2}),this._zoomOut=new nu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,l,h){this._zoomIn.touchstart(t,l,h),this._zoomOut.touchstart(t,l,h)}touchmove(t,l,h){this._zoomIn.touchmove(t,l,h),this._zoomOut.touchmove(t,l,h)}touchend(t,l,h){let m=this._zoomIn.touchend(t,l,h),g=this._zoomOut.touchend(t,l,h);return m?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:v=>v.easeTo({duration:300,zoom:v.getZoom()+1,around:v.unproject(m)},{originalEvent:t})}):g?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:v=>v.easeTo({duration:300,zoom:v.getZoom()-1,around:v.unproject(g)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let yd={0:1,2:2};class Oa{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(t,l){return!1}_move(t,l){return{}}mousedown(t,l){if(this._lastPoint)return;let h=I.mouseButton(t);this._correctButton(t,h)&&(this._lastPoint=l,this._eventButton=h)}mousemoveWindow(t,l){let h=this._lastPoint;if(h){if(t.preventDefault(),function(m,g){let v=yd[g];return m.buttons===void 0||(m.buttons&v)!==v}(t,this._eventButton))this.reset();else if(this._moved||!(l.dist(h)<this._clickTolerance))return this._moved=!0,this._lastPoint=l,this._move(h,l)}}mouseupWindow(t){this._lastPoint&&I.mouseButton(t)===this._eventButton&&(this._moved&&I.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ws extends Oa{mousedown(t,l){super.mousedown(t,l),this._lastPoint&&(this._active=!0)}_correctButton(t,l){return l===0&&!t.ctrlKey}_move(t,l){return{around:l,panDelta:l.sub(t)}}}class Zn extends Oa{_correctButton(t,l){return l===0&&t.ctrlKey||l===2}_move(t,l){let h=.8*(l.x-t.x);if(h)return this._active=!0,{bearingDelta:h}}contextmenu(t){t.preventDefault()}}class at extends Oa{_correctButton(t,l){return l===0&&t.ctrlKey||l===2}_move(t,l){let h=-.5*(l.y-t.y);if(h)return this._active=!0,{pitchDelta:h}}contextmenu(t){t.preventDefault()}}class sh{constructor(t,l){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=l,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.pointGeometry(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,l,h){return this._calculateTransform(t,l,h)}touchmove(t,l,h){if(this._map._cooperativeGestures&&(this._minTouches===2&&h.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,h.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(h.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,l,h)}touchend(t,l,h){this._calculateTransform(t,l,h),this._active&&h.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,l,h){h.length>0&&(this._active=!0);let m=Gn(h,l),g=new a.pointGeometry(0,0),v=new a.pointGeometry(0,0),E=0;for(let A in m){let M=m[A],F=this._touches[A];F&&(g._add(M),v._add(M.sub(F)),E++,m[A]=M)}if(this._touches=m,E<this._minTouches||!v.mag())return;let S=v.div(E);return this._sum._add(S),this._sum.mag()<this._clickTolerance?void 0:{around:g.div(E),panDelta:S}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Mo{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(t){}_move(t,l,h){return{}}touchstart(t,l,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([l[0],l[1]]))}touchmove(t,l,h){if(!this._firstTwoTouches)return;t.preventDefault();let[m,g]=this._firstTwoTouches,v=ho(h,l,m),E=ho(h,l,g);if(!v||!E)return;let S=this._aroundCenter?null:v.add(E).div(2);return this._move([v,E],S,t)}touchend(t,l,h){if(!this._firstTwoTouches)return;let[m,g]=this._firstTwoTouches,v=ho(h,l,m),E=ho(h,l,g);v&&E||(this._active&&I.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ho(d,t,l){for(let h=0;h<d.length;h++)if(d[h].identifier===l)return t[h]}function ou(d,t){return Math.log(d/t)/Math.LN2}class Je extends Mo{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,l){let h=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(ou(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ou(this._distance,h),pinchAround:l}}}function Da(d,t){return 180*d.angleWith(t)/Math.PI}class gd extends Mo{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,l){let h=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Da(this._vector,h),pinchAround:l}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let l=25/(Math.PI*this._minDiameter)*360,h=Da(t,this._startVector);return Math.abs(h)<l}}function su(d){return Math.abs(d.y)>Math.abs(d.x)}class au extends Mo{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,l,h){super.touchstart(t,l,h),this._currentTouchCount=h.length}_start(t){this._lastPoints=t,su(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,l,h){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;let m=t[0].sub(this._lastPoints[0]),g=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,g,h.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(m.y+g.y)/2*-.5}):void 0}gestureBeginsVertically(t,l,h){if(this._valid!==void 0)return this._valid;let m=t.mag()>=2,g=l.mag()>=2;if(!m&&!g)return;if(!m||!g)return this._firstMove===void 0&&(this._firstMove=h),h-this._firstMove<100&&void 0;let v=t.y>0==l.y>0;return su(t)&&su(l)&&v}}let ah={panStep:100,bearingStep:15,pitchStep:10};class lh{constructor(){let t=ah;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let l=0,h=0,m=0,g=0,v=0;switch(t.keyCode){case 61:case 107:case 171:case 187:l=1;break;case 189:case 109:case 173:l=-1;break;case 37:t.shiftKey?h=-1:(t.preventDefault(),g=-1);break;case 39:t.shiftKey?h=1:(t.preventDefault(),g=1);break;case 38:t.shiftKey?m=1:(t.preventDefault(),v=-1);break;case 40:t.shiftKey?m=-1:(t.preventDefault(),v=1);break;default:return}return this._rotationDisabled&&(h=0,m=0),{cameraAnimation:E=>{let S=E.getZoom();E.easeTo({duration:300,easeId:"keyboardHandler",easing:_d,zoom:l?Math.round(S)+l*(t.shiftKey?2:1):S,bearing:E.getBearing()+h*this._bearingStep,pitch:E.getPitch()+m*this._pitchStep,offset:[-g*this._panStep,-v*this._panStep],center:E.getCenter()},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function _d(d){return d*(2-d)}let uh=4.000244140625;class lu{constructor(t,l){this._map=t,this._el=t.getCanvasContainer(),this._handler=l,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;t.preventDefault()}let l=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,h=a.exported.now(),m=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,l!==0&&l%uh==0?this._type="wheel":l!==0&&Math.abs(l)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=l,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(m*l)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,l+=this._lastValue)),t.shiftKey&&l&&(l/=4),this._type&&(this._lastWheelEvent=t,this._delta-=l,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let l=I.mousePos(this._el,t);this._around=a.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(l)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._map.transform;if(this._delta!==0){let E=this._type==="wheel"&&Math.abs(this._delta)>uh?this._wheelZoomRate:this._defaultZoomRate,S=2/(1+Math.exp(-Math.abs(this._delta*E)));this._delta<0&&S!==0&&(S=1/S);let A=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(A*S))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let l=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,h=this._startZoom,m=this._easing,g,v=!1;if(this._type==="wheel"&&h&&m){let E=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),S=m(E);g=a.number(h,l,S),E<1?this._frameId||(this._frameId=!0):v=!0}else g=l,v=!0;return this._active=!0,v&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!v,zoomDelta:g-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let l=a.ease;if(this._prevEase){let h=this._prevEase,m=(a.exported.now()-h.start)/h.duration,g=h.easing(m+.01)-h.easing(m),v=.27/Math.sqrt(g*g+1e-4)*.01,E=Math.sqrt(.0729-v*v);l=a.bezier(v,E,.25,1)}return this._prevEase={start:a.exported.now(),duration:t,easing:l},l}reset(){this._active=!1}}class uu{constructor(t,l){this._clickZoom=t,this._tapZoom=l}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class cu{constructor(){this.reset()}reset(){this._active=!1}dblclick(t,l){return t.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(t.shiftKey?-1:1),around:h.unproject(l)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hu{constructor(){this._tap=new nu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,l,h){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=l[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(t,l,h))}touchmove(t,l,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;let m=l[0],g=m.y-this._swipePoint.y;return this._swipePoint=m,t.preventDefault(),this._active=!0,{zoomDelta:g/128}}}else this._tap.touchmove(t,l,h)}touchend(t,l,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(t,l,h)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zi{constructor(t,l,h){this._el=t,this._mousePan=l,this._touchPan=h}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class po{constructor(t,l,h){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=l,this._mousePitch=h}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ch{constructor(t,l,h,m){this._el=t,this._touchZoom=l,this._touchRotate=h,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}let os=d=>d.zoom||d.drag||d.pitch||d.rotate;class pu extends a.Event{}function Xs(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class hh{constructor(t,l){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nh(t),this._bearingSnap=l.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(l),a.bindAll(["handleEvent","handleWindowEvent"],this);let h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[window,"blur",void 0]];for(let[m,g,v]of this._listeners)I.addEventListener(m,g,m===document?this.handleWindowEvent:this.handleEvent,v)}destroy(){for(let[t,l,h]of this._listeners)I.removeEventListener(t,l,t===document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(t){let l=this._map,h=l.getCanvasContainer();this._add("mapEvent",new fd(l,t));let m=l.boxZoom=new oh(l,t);this._add("boxZoom",m);let g=new md,v=new cu;l.doubleClickZoom=new uu(v,g),this._add("tapZoom",g),this._add("clickZoom",v);let E=new hu;this._add("tapDragZoom",E);let S=l.touchPitch=new au(l);this._add("touchPitch",S);let A=new Zn(t),M=new at(t);l.dragRotate=new po(t,A,M),this._add("mouseRotate",A,["mousePitch"]),this._add("mousePitch",M,["mouseRotate"]);let F=new Ws(t),B=new sh(t,l);l.dragPan=new zi(h,F,B),this._add("mousePan",F),this._add("touchPan",B,["touchZoom","touchRotate"]);let K=new gd,G=new Je;l.touchZoomRotate=new ch(h,G,K,E),this._add("touchRotate",K,["touchPan","touchZoom"]),this._add("touchZoom",G,["touchPan","touchRotate"]);let Z=l.scrollZoom=new lu(l,this);this._add("scrollZoom",Z,["mousePan"]);let re=l.keyboard=new lh;this._add("keyboard",re),this._add("blockableMapEvent",new co(l));for(let oe of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[oe]&&l[oe].enable(t[oe])}_add(t,l,h){this._handlers.push({handlerName:t,handler:l,allowed:h}),this._handlersById[t]=l}stop(t){if(!this._updatingCamera){for(let{handler:l}of this._handlers)l.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(os(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,l,h){for(let m in t)if(m!==h&&(!l||l.indexOf(m)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){let l=[];for(let h of t)this._el.contains(h.target)&&l.push(h);return l}handleEvent(t,l){if(t.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let h=t.type==="renderFrame"?void 0:t,m={needsRenderFrame:!1},g={},v={},E=t.touches,S=E?this._getMapTouches(E):void 0,A=S?I.touchPos(this._el,S):I.mousePos(this._el,t);for(let{handlerName:B,handler:K,allowed:G}of this._handlers){if(!K.isEnabled())continue;let Z;this._blockedByActive(v,G,B)?K.reset():K[l||t.type]&&(Z=K[l||t.type](t,A,S),this.mergeHandlerResult(m,g,Z,B,h),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||K.isActive())&&(v[B]=K)}let M={};for(let B in this._previousActiveHandlers)v[B]||(M[B]=h);this._previousActiveHandlers=v,(Object.keys(M).length||Xs(m))&&(this._changes.push([m,g,M]),this._triggerRenderFrame()),(Object.keys(v).length||Xs(m))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:F}=m;F&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],F(this._map))}mergeHandlerResult(t,l,h,m,g){if(!h)return;a.extend(t,h);let v={handlerName:m,originalEvent:h.originalEvent||g};h.zoomDelta!==void 0&&(l.zoom=v),h.panDelta!==void 0&&(l.drag=v),h.pitchDelta!==void 0&&(l.pitch=v),h.bearingDelta!==void 0&&(l.rotate=v)}_applyChanges(){let t={},l={},h={};for(let[m,g,v]of this._changes)m.panDelta&&(t.panDelta=(t.panDelta||new a.pointGeometry(0,0))._add(m.panDelta)),m.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+m.pitchDelta),m.around!==void 0&&(t.around=m.around),m.pinchAround!==void 0&&(t.pinchAround=m.pinchAround),m.noInertia&&(t.noInertia=m.noInertia),a.extend(l,g),a.extend(h,v);this._updateMapTransform(t,l,h),this._changes=[]}_updateMapTransform(t,l,h){let m=this._map,g=m.transform,v=m.style&&m.style.terrain;if(!(Xs(t)||v&&this._drag))return this._fireEvents(l,h,!0);let{panDelta:E,zoomDelta:S,bearingDelta:A,pitchDelta:M,around:F,pinchAround:B}=t;B!==void 0&&(F=B),m._stop(!0),F=F||m.transform.centerPoint;let K=g.pointLocation(E?F.sub(E):F);A&&(g.bearing+=A),M&&(g.pitch+=M),S&&(g.zoom+=S),v?l.drag&&!this._drag?(this._drag={center:g.centerPoint,lngLat:g.pointLocation(F),point:F,handlerName:l.drag.handlerName},m.fire(new a.Event("freezeElevation",{freeze:!0}))):this._drag&&h[this._drag.handlerName]?(m.fire(new a.Event("freezeElevation",{freeze:!1})),this._drag=null):l.drag&&this._drag&&(g.center=g.pointLocation(g.centerPoint.sub(E))):g.setLocationAtPoint(K,F),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(l,h,!0)}_fireEvents(t,l,h){let m=os(this._eventsInProgress),g=os(t),v={};for(let M in t){let{originalEvent:F}=t[M];this._eventsInProgress[M]||(v[`${M}start`]=F),this._eventsInProgress[M]=t[M]}!m&&g&&this._fireEvent("movestart",g.originalEvent);for(let M in v)this._fireEvent(M,v[M]);g&&this._fireEvent("move",g.originalEvent);for(let M in t){let{originalEvent:F}=t[M];this._fireEvent(M,F)}let E={},S;for(let M in this._eventsInProgress){let{handlerName:F,originalEvent:B}=this._eventsInProgress[M];this._handlersById[F].isActive()||(delete this._eventsInProgress[M],S=l[F]||B,E[`${M}end`]=S)}for(let M in E)this._fireEvent(M,E[M]);let A=os(this._eventsInProgress);if(h&&(m||g)&&!A){this._updatingCamera=!0;let M=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),F=B=>B!==0&&-this._bearingSnap<B&&B<this._bearingSnap;M?(F(M.bearing||this._map.getBearing())&&(M.bearing=0),this._map.easeTo(M,{originalEvent:S})):(this._map.fire(new a.Event("moveend",{originalEvent:S})),F(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,l){this._map.fire(new a.Event(t,l?{originalEvent:l}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new pu("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Yi={extend:(d,...t)=>a.extend(d,...t),run(d){d()},logToElement(d,t=!1,l="log"){let h=window.document.getElementById(l);h&&(t&&(h.innerHTML=""),h.innerHTML+=`<br>${d}`)}};class Ir extends a.Evented{constructor(t,l){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=l.bearingSnap,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,l){return this.jumpTo({center:t},l)}panBy(t,l,h){return t=a.pointGeometry.convert(t).mult(-1),this.panTo(this.transform.center,a.extend({offset:t},l),h)}panTo(t,l,h){return this.easeTo(a.extend({center:t},l),h)}getZoom(){return this.transform.zoom}setZoom(t,l){return this.jumpTo({zoom:t},l),this}zoomTo(t,l,h){return this.easeTo(a.extend({zoom:t},l),h)}zoomIn(t,l){return this.zoomTo(this.getZoom()+1,t,l),this}zoomOut(t,l){return this.zoomTo(this.getZoom()-1,t,l),this}getBearing(){return this.transform.bearing}setBearing(t,l){return this.jumpTo({bearing:t},l),this}getPadding(){return this.transform.padding}setPadding(t,l){return this.jumpTo({padding:t},l),this}rotateTo(t,l,h){return this.easeTo(a.extend({bearing:t},l),h)}resetNorth(t,l){return this.rotateTo(0,a.extend({duration:1e3},t),l),this}resetNorthPitch(t,l){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},t),l),this}snapToNorth(t,l){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,l):this}getPitch(){return this.transform.pitch}setPitch(t,l){return this.jumpTo({pitch:t},l),this}cameraForBounds(t,l){t=a.LngLatBounds.convert(t);let h=l&&l.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),h,l)}_cameraForBoxAndBearing(t,l,h,m){let g={top:0,bottom:0,right:0,left:0};if(typeof(m=a.extend({padding:g,offset:[0,0],maxZoom:this.transform.maxZoom},m)).padding=="number"){let ce=m.padding;m.padding={top:ce,bottom:ce,right:ce,left:ce}}m.padding=a.extend(g,m.padding);let v=this.transform,E=v.padding,S=v.project(a.LngLat.convert(t)),A=v.project(a.LngLat.convert(l)),M=S.rotate(-h*Math.PI/180),F=A.rotate(-h*Math.PI/180),B=new a.pointGeometry(Math.max(M.x,F.x),Math.max(M.y,F.y)),K=new a.pointGeometry(Math.min(M.x,F.x),Math.min(M.y,F.y)),G=B.sub(K),Z=(v.width-(E.left+E.right+m.padding.left+m.padding.right))/G.x,re=(v.height-(E.top+E.bottom+m.padding.top+m.padding.bottom))/G.y;if(re<0||Z<0)return void a.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let oe=Math.min(v.scaleZoom(v.scale*Math.min(Z,re)),m.maxZoom),ue=a.pointGeometry.convert(m.offset),W=new a.pointGeometry((m.padding.left-m.padding.right)/2,(m.padding.top-m.padding.bottom)/2).rotate(h*Math.PI/180),de=ue.add(W).mult(v.scale/v.zoomScale(oe));return{center:v.unproject(S.add(A).div(2).sub(de)),zoom:oe,bearing:h}}fitBounds(t,l,h){return this._fitInternal(this.cameraForBounds(t,l),l,h)}fitScreenCoordinates(t,l,h,m,g){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(a.pointGeometry.convert(t)),this.transform.pointLocation(a.pointGeometry.convert(l)),h,m),m,g)}_fitInternal(t,l,h){return t?(delete(l=a.extend(t,l)).padding,l.linear?this.easeTo(l,h):this.flyTo(l,h)):this}jumpTo(t,l){this.stop();let h=this.transform,m=!1,g=!1,v=!1;return"zoom"in t&&h.zoom!==+t.zoom&&(m=!0,h.zoom=+t.zoom),t.center!==void 0&&(h.center=a.LngLat.convert(t.center)),"bearing"in t&&h.bearing!==+t.bearing&&(g=!0,h.bearing=+t.bearing),"pitch"in t&&h.pitch!==+t.pitch&&(v=!0,h.pitch=+t.pitch),t.padding==null||h.isPaddingEqual(t.padding)||(h.padding=t.padding),this.fire(new a.Event("movestart",l)).fire(new a.Event("move",l)),m&&this.fire(new a.Event("zoomstart",l)).fire(new a.Event("zoom",l)).fire(new a.Event("zoomend",l)),g&&this.fire(new a.Event("rotatestart",l)).fire(new a.Event("rotate",l)).fire(new a.Event("rotateend",l)),v&&this.fire(new a.Event("pitchstart",l)).fire(new a.Event("pitch",l)).fire(new a.Event("pitchend",l)),this.fire(new a.Event("moveend",l))}calculateCameraOptionsFromTo(t,l,h,m=0){let g=a.MercatorCoordinate.fromLngLat(t,l),v=a.MercatorCoordinate.fromLngLat(h,m),E=v.x-g.x,S=v.y-g.y,A=v.z-g.z,M=Math.hypot(E,S,A);if(M===0)throw new Error("Can't calculate camera options with same From and To");let F=Math.hypot(E,S),B=this.transform.scaleZoom(this.transform.cameraToCenterDistance/M/this.transform.tileSize),K=180*Math.atan2(E,-S)/Math.PI,G=180*Math.acos(F/M)/Math.PI;return G=A<0?90-G:90+G,{center:v.toLngLat(),zoom:B,pitch:G,bearing:K}}easeTo(t,l){this._stop(!1,t.easeId),((t=a.extend({offset:[0,0],duration:500,easing:a.ease},t)).animate===!1||!t.essential&&a.exported.prefersReducedMotion)&&(t.duration=0);let h=this.transform,m=this.getZoom(),g=this.getBearing(),v=this.getPitch(),E=this.getPadding(),S="zoom"in t?+t.zoom:m,A="bearing"in t?this._normalizeBearing(t.bearing,g):g,M="pitch"in t?+t.pitch:v,F="padding"in t?t.padding:h.padding,B=a.pointGeometry.convert(t.offset),K=h.centerPoint.add(B),G=h.pointLocation(K),Z=a.LngLat.convert(t.center||G);this._normalizeCenter(Z);let re=h.project(G),oe=h.project(Z).sub(re),ue=h.zoomScale(S-m),W,de;t.around&&(W=a.LngLat.convert(t.around),de=h.locationPoint(W));let ce={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||S!==m,this._rotating=this._rotating||g!==A,this._pitching=this._pitching||M!==v,this._padding=!h.isPaddingEqual(F),this._easeId=t.easeId,this._prepareEase(l,t.noMoveStart,ce),this._ease(Ee=>{if(this._zooming&&(h.zoom=a.number(m,S,Ee)),this._rotating&&(h.bearing=a.number(g,A,Ee)),this._pitching&&(h.pitch=a.number(v,M,Ee)),this._padding&&(h.interpolatePadding(E,F,Ee),K=h.centerPoint.add(B)),W)h.setLocationAtPoint(W,de);else{let Te=h.zoomScale(h.zoom-m),ze=S>m?Math.min(2,ue):Math.max(.5,ue),xe=Math.pow(ze,1-Ee),rt=h.unproject(re.add(oe.mult(Ee*xe)).mult(Te));h.setLocationAtPoint(h.renderWorldCopies?rt.wrap():rt,K)}this._fireMoveEvents(l)},Ee=>{this._afterEase(l,Ee)},t),this}_prepareEase(t,l,h={}){this._moving=!0,this.fire(new a.Event("freezeElevation",{freeze:!0})),l||h.moving||this.fire(new a.Event("movestart",t)),this._zooming&&!h.zooming&&this.fire(new a.Event("zoomstart",t)),this._rotating&&!h.rotating&&this.fire(new a.Event("rotatestart",t)),this._pitching&&!h.pitching&&this.fire(new a.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new a.Event("move",t)),this._zooming&&this.fire(new a.Event("zoom",t)),this._rotating&&this.fire(new a.Event("rotate",t)),this._pitching&&this.fire(new a.Event("pitch",t))}_afterEase(t,l){if(this._easeId&&l&&this._easeId===l)return;delete this._easeId,this.fire(new a.Event("freezeElevation",{freeze:!1}));let h=this._zooming,m=this._rotating,g=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new a.Event("zoomend",t)),m&&this.fire(new a.Event("rotateend",t)),g&&this.fire(new a.Event("pitchend",t)),this.fire(new a.Event("moveend",t))}flyTo(t,l){if(!t.essential&&a.exported.prefersReducedMotion){let gt=a.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(gt,l)}this.stop(),t=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},t);let h=this.transform,m=this.getZoom(),g=this.getBearing(),v=this.getPitch(),E=this.getPadding(),S="zoom"in t?a.clamp(+t.zoom,h.minZoom,h.maxZoom):m,A="bearing"in t?this._normalizeBearing(t.bearing,g):g,M="pitch"in t?+t.pitch:v,F="padding"in t?t.padding:h.padding,B=h.zoomScale(S-m),K=a.pointGeometry.convert(t.offset),G=h.centerPoint.add(K),Z=h.pointLocation(G),re=a.LngLat.convert(t.center||Z);this._normalizeCenter(re);let oe=h.project(Z),ue=h.project(re).sub(oe),W=t.curve,de=Math.max(h.width,h.height),ce=de/B,Ee=ue.mag();if("minZoom"in t){let gt=a.clamp(Math.min(t.minZoom,m,S),h.minZoom,h.maxZoom),ur=de/h.zoomScale(gt-m);W=Math.sqrt(ur/Ee*2)}let Te=W*W;function ze(gt){let ur=(ce*ce-de*de+(gt?-1:1)*Te*Te*Ee*Ee)/(2*(gt?ce:de)*Te*Ee);return Math.log(Math.sqrt(ur*ur+1)-ur)}function xe(gt){return(Math.exp(gt)-Math.exp(-gt))/2}function rt(gt){return(Math.exp(gt)+Math.exp(-gt))/2}let Ze=ze(0),nt=function(gt){return rt(Ze)/rt(Ze+W*gt)},Mt=function(gt){return de*((rt(Ze)*(xe(ur=Ze+W*gt)/rt(ur))-xe(Ze))/Te)/Ee;var ur},Rt=(ze(1)-Ze)/W;if(Math.abs(Ee)<1e-6||!isFinite(Rt)){if(Math.abs(de-ce)<1e-6)return this.easeTo(t,l);let gt=ce<de?-1:1;Rt=Math.abs(Math.log(ce/de))/W,Mt=function(){return 0},nt=function(ur){return Math.exp(gt*W*ur)}}return t.duration="duration"in t?+t.duration:1e3*Rt/("screenSpeed"in t?+t.screenSpeed/W:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=g!==A,this._pitching=M!==v,this._padding=!h.isPaddingEqual(F),this._prepareEase(l,!1),this._ease(gt=>{let ur=gt*Rt,cr=1/nt(ur);h.zoom=gt===1?S:m+h.scaleZoom(cr),this._rotating&&(h.bearing=a.number(g,A,gt)),this._pitching&&(h.pitch=a.number(v,M,gt)),this._padding&&(h.interpolatePadding(E,F,gt),G=h.centerPoint.add(K));let Kt=gt===1?re:h.unproject(oe.add(ue.mult(Mt(ur))).mult(cr));h.setLocationAtPoint(h.renderWorldCopies?Kt.wrap():Kt,G),this._fireMoveEvents(l)},()=>this._afterEase(l),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,l){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let h=this._onEaseEnd;delete this._onEaseEnd,h.call(this,l)}if(!t){let h=this.handlers;h&&h.stop(!1)}return this}_ease(t,l,h){h.animate===!1||h.duration===0?(t(1),l()):(this._easeStart=a.exported.now(),this._easeOptions=h,this._onEaseFrame=t,this._onEaseEnd=l,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let t=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,l){t=a.wrap(t,-180,180);let h=Math.abs(t-l);return Math.abs(t-360-l)<h&&(t-=360),Math.abs(t+360-l)<h&&(t+=360),t}_normalizeCenter(t){let l=this.transform;if(!l.renderWorldCopies||l.lngRange)return;let h=t.lng-l.center.lng;t.lng+=h>180?-360:h<-180?360:0}}class Hs{constructor(t={}){this.options=t,a.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=I.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=I.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=I.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){I.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,l){let h=this._map._getUIString(`AttributionControl.${l}`);t.title=h,t.setAttribute("aria-label",h)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"&&t.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(m=>typeof m!="string"?"":m)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}let l=this._map.style.sourceCaches;for(let m in l){let g=l[m];if(g.used||g.usedForTerrain){let v=g.getSource();v.attribution&&t.indexOf(v.attribution)<0&&t.push(v.attribution)}}t=t.filter(m=>String(m).trim()),t.sort((m,g)=>m.length-g.length),t=t.filter((m,g)=>{for(let v=g+1;v<t.length;v++)if(t[v].indexOf(m)>=0)return!1;return!0});let h=t.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,t.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Fa{constructor(t={}){this.options=t,a.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=I.create("div","maplibregl-ctrl mapboxgl-ctrl");let l=I.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return l.target="_blank",l.rel="noopener nofollow",l.href="https://maplibre.org/",l.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),l.setAttribute("rel","noopener nofollow"),this._container.appendChild(l),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){I.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let t=this._container.children;if(t.length){let l=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&l.classList.add("maplibregl-compact","mapboxgl-compact"):l.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class ph{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let l=++this._id;return this._queue.push({callback:t,id:l,cancelled:!1}),l}remove(t){let l=this._currentlyRunning,h=l?this._queue.concat(l):this._queue;for(let m of h)if(m.id===t)return void(m.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let l=this._currentlyRunning=this._queue;this._queue=[];for(let h of l)if(!h.cancelled&&(h.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let dh={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},fh={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},vd={showCompass:!0,showZoom:!0,visualizePitch:!1};class In{constructor(t,l,h=!1){this._clickTolerance=10,this.element=l,this.mouseRotate=new Zn({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,h&&(this.mousePitch=new at({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),I.addEventListener(l,"mousedown",this.mousedown),I.addEventListener(l,"touchstart",this.touchstart,{passive:!1}),I.addEventListener(l,"touchmove",this.touchmove),I.addEventListener(l,"touchend",this.touchend),I.addEventListener(l,"touchcancel",this.reset)}down(t,l){this.mouseRotate.mousedown(t,l),this.mousePitch&&this.mousePitch.mousedown(t,l),I.disableDrag()}move(t,l){let h=this.map,m=this.mouseRotate.mousemoveWindow(t,l);if(m&&m.bearingDelta&&h.setBearing(h.getBearing()+m.bearingDelta),this.mousePitch){let g=this.mousePitch.mousemoveWindow(t,l);g&&g.pitchDelta&&h.setPitch(h.getPitch()+g.pitchDelta)}}off(){let t=this.element;I.removeEventListener(t,"mousedown",this.mousedown),I.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),I.removeEventListener(t,"touchmove",this.touchmove),I.removeEventListener(t,"touchend",this.touchend),I.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){I.enableDrag(),I.removeEventListener(window,"mousemove",this.mousemove),I.removeEventListener(window,"mouseup",this.mouseup)}mousedown(t){this.down(a.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),I.mousePos(this.element,t)),I.addEventListener(window,"mousemove",this.mousemove),I.addEventListener(window,"mouseup",this.mouseup)}mousemove(t){this.move(t,I.mousePos(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=I.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=I.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function Js(d,t,l){if(d=new a.LngLat(d.lng,d.lat),t){let h=new a.LngLat(d.lng-360,d.lat),m=new a.LngLat(d.lng+360,d.lat),g=l.locationPoint(d).distSqr(t);l.locationPoint(h).distSqr(t)<g?d=h:l.locationPoint(m).distSqr(t)<g&&(d=m)}for(;Math.abs(d.lng-l.center.lng)>180;){let h=l.locationPoint(d);if(h.x>=0&&h.y>=0&&h.x<=l.width&&h.y<=l.height)break;d.lng>l.center.lng?d.lng-=360:d.lng+=360}return d}let ft={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xt(d,t,l){let h=d.classList;for(let m in ft)h.remove(`maplibregl-${l}-anchor-${m}`,`mapboxgl-${l}-anchor-${m}`);h.add(`maplibregl-${l}-anchor-${t}`,`mapboxgl-${l}-anchor-${t}`)}class ss extends a.Evented{constructor(t,l){if(super(),(t instanceof HTMLElement||l)&&(t=a.extend({element:t},l)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=a.pointGeometry.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=I.create("div"),this._element.setAttribute("aria-label","Map marker");let h=I.createNS("http://www.w3.org/2000/svg","svg"),m=41,g=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${m}px`),h.setAttributeNS(null,"width",`${g}px`),h.setAttributeNS(null,"viewBox",`0 0 ${g} ${m}`);let v=I.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"stroke","none"),v.setAttributeNS(null,"stroke-width","1"),v.setAttributeNS(null,"fill","none"),v.setAttributeNS(null,"fill-rule","evenodd");let E=I.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");let S=I.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"transform","translate(3.0, 29.0)"),S.setAttributeNS(null,"fill","#000000");let A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let ue of A){let W=I.createNS("http://www.w3.org/2000/svg","ellipse");W.setAttributeNS(null,"opacity","0.04"),W.setAttributeNS(null,"cx","10.5"),W.setAttributeNS(null,"cy","5.80029008"),W.setAttributeNS(null,"rx",ue.rx),W.setAttributeNS(null,"ry",ue.ry),S.appendChild(W)}let M=I.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"fill",this._color);let F=I.createNS("http://www.w3.org/2000/svg","path");F.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),M.appendChild(F);let B=I.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"fill","#000000");let K=I.createNS("http://www.w3.org/2000/svg","path");K.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),B.appendChild(K);let G=I.createNS("http://www.w3.org/2000/svg","g");G.setAttributeNS(null,"transform","translate(6.0, 7.0)"),G.setAttributeNS(null,"fill","#FFFFFF");let Z=I.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(8.0, 8.0)");let re=I.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#000000"),re.setAttributeNS(null,"opacity","0.25"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962");let oe=I.createNS("http://www.w3.org/2000/svg","circle");oe.setAttributeNS(null,"fill","#FFFFFF"),oe.setAttributeNS(null,"cx","5.5"),oe.setAttributeNS(null,"cy","5.5"),oe.setAttributeNS(null,"r","5.4999962"),Z.appendChild(re),Z.appendChild(oe),E.appendChild(S),E.appendChild(M),E.appendChild(B),E.appendChild(G),E.appendChild(Z),h.appendChild(E),h.setAttributeNS(null,"height",m*this._scale+"px"),h.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(h),this._offset=a.pointGeometry.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),xt(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),I.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=a.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let m=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){let l=t.code,h=t.charCode||t.keyCode;l!=="Space"&&l!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(t){let l=t.originalEvent.target,h=this._element;this._popup&&(l===h||h.contains(l))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Js(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let h="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?h="rotateX(0deg)":this._pitchAlignment==="map"&&(h=`rotateX(${this._map.getPitch()}deg)`),t&&t.type!=="moveend"||(this._pos=this._pos.round()),I.setTransform(this._element,`${ft[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${h} ${l}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{let m=this._map.unproject(this._pos),g=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=m.distanceTo(this._lngLat)>20*g?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(t){return this._offset=a.pointGeometry.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){let l=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=l}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.Event("dragstart"))),this.fire(new a.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let du={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},fo,li=0,mo=!1,Pn={maxWidth:100,unit:"metric"};function mh(d,t,l){let h=l&&l.maxWidth||100,m=d._container.clientHeight/2,g=d.unproject([0,m]),v=d.unproject([h,m]),E=g.distanceTo(v);if(l&&l.unit==="imperial"){let S=3.2808*E;S>5280?yo(t,h,S/5280,d._getUIString("ScaleControl.Miles")):yo(t,h,S,d._getUIString("ScaleControl.Feet"))}else l&&l.unit==="nautical"?yo(t,h,E/1852,d._getUIString("ScaleControl.NauticalMiles")):E>=1e3?yo(t,h,E/1e3,d._getUIString("ScaleControl.Kilometers")):yo(t,h,E,d._getUIString("ScaleControl.Meters"))}function yo(d,t,l,h){let m=function(g){let v=Math.pow(10,`${Math.floor(g)}`.length-1),E=g/v;return E=E>=10?10:E>=5?5:E>=3?3:E>=2?2:E>=1?1:function(S){let A=Math.pow(10,Math.ceil(-Math.log(S)/Math.LN10));return Math.round(S*A)/A}(E),v*E}(l);d.style.width=t*(m/l)+"px",d.innerHTML=`${m}&nbsp;${h}`}let jr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},qr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function fu(d){if(d){if(typeof d=="number"){let t=Math.round(Math.sqrt(.5*Math.pow(d,2)));return{center:new a.pointGeometry(0,0),top:new a.pointGeometry(0,d),"top-left":new a.pointGeometry(t,t),"top-right":new a.pointGeometry(-t,t),bottom:new a.pointGeometry(0,-d),"bottom-left":new a.pointGeometry(t,-t),"bottom-right":new a.pointGeometry(-t,-t),left:new a.pointGeometry(d,0),right:new a.pointGeometry(-d,0)}}if(d instanceof a.pointGeometry||Array.isArray(d)){let t=a.pointGeometry.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:a.pointGeometry.convert(d.center||[0,0]),top:a.pointGeometry.convert(d.top||[0,0]),"top-left":a.pointGeometry.convert(d["top-left"]||[0,0]),"top-right":a.pointGeometry.convert(d["top-right"]||[0,0]),bottom:a.pointGeometry.convert(d.bottom||[0,0]),"bottom-left":a.pointGeometry.convert(d["bottom-left"]||[0,0]),"bottom-right":a.pointGeometry.convert(d["bottom-right"]||[0,0]),left:a.pointGeometry.convert(d.left||[0,0]),right:a.pointGeometry.convert(d.right||[0,0])}}return fu(new a.pointGeometry(0,0))}let zo={supported:x,setRTLTextPlugin:a.setRTLTextPlugin,getRTLTextPluginStatus:a.getRTLTextPluginStatus,Map:class extends Ir{constructor(d){var t;if(a.PerformanceUtils.mark(a.PerformanceMarkers.create),(d=a.extend({},fh,d)).minZoom!=null&&d.maxZoom!=null&&d.minZoom>d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Us(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),{bearingSnap:d.bearingSnap}),this._interactive=d.interactive,this._cooperativeGestures=d.cooperativeGestures,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._crossSourceCollisions=d.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=d.collectResourceTiming,this._renderTaskQueue=new ph,this._controls=[],this._mapId=a.uniqueId(),this._locale=a.extend({},dh,d.locale),this._clickTolerance=d.clickTolerance,this._pixelRatio=(t=d.pixelRatio)!==null&&t!==void 0?t:devicePixelRatio,this._requestManager=new ee(d.transformRequest),typeof d.container=="string"){if(this._container=document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(d.maxBounds&&this.setMaxBounds(d.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new hh(this,d),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=d.hash&&new eh(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,a.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localIdeographFontFamily:d.localIdeographFontFamily}),d.attributionControl&&this.addControl(new Hs({customAttribution:d.customAttribution})),d.maplibreLogo&&this.addControl(new Fa,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",l=>{this._update(l.dataType==="style"),this.fire(new a.Event(`${l.dataType}data`,l))}),this.on("dataloading",l=>{this.fire(new a.Event(`${l.dataType}dataloading`,l))}),this.on("dataabort",l=>{this.fire(new a.Event("sourcedataabort",l))})}_getMapId(){return this._mapId}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let l=d.onAdd(this);this._controls.push(d);let h=this._controlPositions[t];return t.indexOf("bottom")!==-1?h.insertBefore(l,h.firstChild):h.appendChild(l),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}calculateCameraOptionsFromTo(d,t,l,h){return h==null&&this.style.terrain&&(h=this.transform.getElevation(l,this.style.terrain)),super.calculateCameraOptionsFromTo(d,t,l,h)}resize(d){let t=this._containerDimensions(),l=t[0],h=t[1];this._resizeCanvas(l,h,this.getPixelRatio()),this.transform.resize(l,h),this.painter.resize(l,h,this.getPixelRatio());let m=!this._moving;return m&&(this.stop(),this.fire(new a.Event("movestart",d)).fire(new a.Event("move",d))),this.fire(new a.Event("resize",d)),m&&this.fire(new a.Event("moveend",d)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(d){let[t,l]=this._containerDimensions();this._pixelRatio=d,this._resizeCanvas(t,l,d),this.painter.resize(t,l,d)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(a.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()<d&&this.setZoom(d),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d??22)>=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d&&this.setZoom(d),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()<d&&this.setPitch(d),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d&&this.setPitch(d),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this._update()}project(d){return this.transform.locationPoint(a.LngLat.convert(d),this.style&&this.style.terrain)}unproject(d){return this.transform.pointLocation(a.pointGeometry.convert(d),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(d,t,l){if(d==="mouseenter"||d==="mouseover"){let h=!1;return{layer:t,listener:l,delegates:{mousemove:g=>{let v=this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[];v.length?h||(h=!0,l.call(this,new Vi(d,this,g.originalEvent,{features:v}))):h=!1},mouseout:()=>{h=!1}}}}if(d==="mouseleave"||d==="mouseout"){let h=!1;return{layer:t,listener:l,delegates:{mousemove:v=>{(this.getLayer(t)?this.queryRenderedFeatures(v.point,{layers:[t]}):[]).length?h=!0:h&&(h=!1,l.call(this,new Vi(d,this,v.originalEvent)))},mouseout:v=>{h&&(h=!1,l.call(this,new Vi(d,this,v.originalEvent)))}}}}{let h=m=>{let g=this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[];g.length&&(m.features=g,l.call(this,m),delete m.features)};return{layer:t,listener:l,delegates:{[d]:h}}}}on(d,t,l){if(l===void 0)return super.on(d,t);let h=this._createDelegatedListener(d,t,l);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(h);for(let m in h.delegates)this.on(m,h.delegates[m]);return this}once(d,t,l){if(l===void 0)return super.once(d,t);let h=this._createDelegatedListener(d,t,l);for(let m in h.delegates)this.once(m,h.delegates[m]);return this}off(d,t,l){return l===void 0?super.off(d,t):(this._delegatedListeners&&this._delegatedListeners[d]&&(h=>{let m=this._delegatedListeners[d];for(let g=0;g<m.length;g++){let v=m[g];if(v.layer===t&&v.listener===l){for(let E in v.delegates)this.off(E,v.delegates[E]);return m.splice(g,1),this}}})(),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let l;if(t!==void 0||d===void 0||d instanceof a.pointGeometry||Array.isArray(d)||(t=d,d=void 0),t=t||{},(d=d||[[0,0],[this.transform.width,this.transform.height]])instanceof a.pointGeometry||typeof d[0]=="number")l=[a.pointGeometry.convert(d)];else{let h=a.pointGeometry.convert(d[0]),m=a.pointGeometry.convert(d[1]);l=[h,new a.pointGeometry(m.x,h.y),m,new a.pointGeometry(h.x,m.y),h]}return this.style.queryRenderedFeatures(l,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=a.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){let t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),d?(this.style=new mi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d):this.style.loadJSON(d),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new mi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){if(typeof d=="string"){let l=this._requestManager.transformRequest(d,a.ResourceType.Style);a.getJSON(l,(h,m)=>{h?this.fire(new a.ErrorEvent(h)):m&&this._updateDiff(m,t)})}else typeof d=="object"&&this._updateDiff(d,t)}_updateDiff(d,t){try{this.style.setState(d)&&this._update(!0)}catch(l){a.warnOnce(`Unable to perform style diff: ${l.message||l.error||l}. Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.warnOnce("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){let t=this.style&&this.style.sourceCaches[d];if(t!==void 0)return t.loaded();this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${d}'`)))}setTerrain(d){return this.style.setTerrain(d),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){let d=this.style&&this.style.sourceCaches;for(let t in d){let l=d[t]._tiles;for(let h in l){let m=l[h];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}addSourceType(d,t,l){return this._lazyInitEmptyStyle(),this.style.addSourceType(d,t,l)}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,t,{pixelRatio:l=1,sdf:h=!1,stretchX:m,stretchY:g,content:v}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||a.isImageBitmap(t)){let{width:E,height:S,data:A}=a.exported.getImageData(t);this.style.addImage(d,{data:new a.RGBAImage({width:E,height:S},A),pixelRatio:l,stretchX:m,stretchY:g,content:v,sdf:h,version:0})}else{if(t.width===void 0||t.height===void 0)return this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:E,height:S,data:A}=t,M=t;this.style.addImage(d,{data:new a.RGBAImage({width:E,height:S},new Uint8Array(A)),pixelRatio:l,stretchX:m,stretchY:g,content:v,sdf:h,version:0,userImage:M}),M.onAdd&&M.onAdd(this,d)}}}updateImage(d,t){let l=this.style.getImage(d);if(!l)return this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let h=t instanceof HTMLImageElement||a.isImageBitmap(t)?a.exported.getImageData(t):t,{width:m,height:g,data:v}=h;if(m===void 0||g===void 0)return this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(m!==l.data.width||g!==l.data.height)return this.fire(new a.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let E=!(t instanceof HTMLImageElement||a.isImageBitmap(t));l.data.replace(v,E),this.style.updateImage(d,l)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,t){a.getImage(this._requestManager.transformRequest(d,a.ResourceType.Image),t)}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,t,l){return this.style.setLayerZoomRange(d,t,l),this._update(!0)}setFilter(d,t,l={}){return this.style.setFilter(d,t,l),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,l,h={}){return this.style.setPaintProperty(d,t,l,h),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,l,h={}){return this.style.setLayoutProperty(d,t,l,h),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupContainer(){let d=this._container;d.classList.add("maplibregl-map","mapboxgl-map");let t=this._canvasContainer=I.create("div","maplibregl-canvas-container mapboxgl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=I.create("canvas","maplibregl-canvas mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let l=this._containerDimensions();this._resizeCanvas(l[0],l[1],this.getPixelRatio());let h=this._controlContainer=I.create("div","maplibregl-control-container mapboxgl-control-container",d),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(g=>{m[g]=I.create("div",`maplibregl-ctrl-${g} mapboxgl-ctrl-${g}`,h)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){let d=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=I.create("div","maplibregl-cooperative-gesture-screen",d);let t="Control",l=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(l=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",t="Meta"),this._cooperativeGesturesScreen.innerHTML=`
592
- <div class="maplibregl-desktop-message">${l}</div>
593
- <div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
594
- `,document.addEventListener("keydown",h=>{h.key===t&&(this._metaPress=!0)}),document.addEventListener("keyup",h=>{h.key===t&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",h=>{this._onCooperativeGesture(h,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(d,t,l){this._canvas.width=l*d,this._canvas.height=l*t,this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let d=a.extend({},x.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),t=this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);t?(this.painter=new iu(t,this.transform),a.exported$1.testSupport(t)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(d,t,l){return!t&&l<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){let t,l=0,h=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(t=h.createQueryEXT(),h.beginQueryEXT(h.TIME_ELAPSED_EXT,t),l=a.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let m=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let v=this.transform.zoom,E=a.exported.now();this.style.zoomHistory.update(v,E);let S=new a.EvaluationParameters(v,{now:E,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),A=S.crossFadingFactor();A===1&&A===this._crossFadingFactor||(m=!0,this._crossFadingFactor=A),this.style.update(S)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.load),this.fire(new a.Event("load"))),this.style&&(this.style.hasTransitions()||m)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let v=a.exported.now()-l;h.endQueryEXT(h.TIME_ELAPSED_EXT,t),setTimeout(()=>{let E=h.getQueryObjectEXT(t,h.QUERY_RESULT_EXT)/1e6;h.deleteQueryEXT(t),this.fire(new a.Event("gpu-timing-frame",{cpuTime:v,gpuTime:E}))},50)}if(this.listens("gpu-timing-layer")){let v=this.painter.collectGpuTimers();setTimeout(()=>{let E=this.painter.queryGpuTimers(v);this.fire(new a.Event("gpu-timing-layer",{layerTimes:E}))},50)}let g=this._sourcesDirty||this._styleDirty||this._placementDirty;return g||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.Event("idle")),!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let d=this.painter.context.gl.getExtension("WEBGL_lose_context");d&&d.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),I.remove(this._canvasContainer),I.remove(this._controlContainer),this._cooperativeGestures&&I.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),a.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new a.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=a.exported.frame(d=>{a.PerformanceUtils.frame(d),this._frame=null,this._render(d)}))}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}_setCacheLimits(d,t){a.setCacheLimits(d,t)}get version(){return"2.4.0"}},NavigationControl:class{constructor(d){this.options=a.extend({},vd,d),this._container=I.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let d=this._map.getZoom(),t=d===this._map.getMaxZoom(),l=d===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=l,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",l.toString())}_rotateCompassArrow(){let d=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=d}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new In(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){I.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){let l=I.create("button",d,this._container);return l.type="button",l.addEventListener("click",t),l}_setButtonTitle(d,t){let l=this._map._getUIString(`NavigationControl.${t}`);d.title=l,d.setAttribute("aria-label",l)}},GeolocateControl:class extends a.Evented{constructor(d){super(),this.options=a.extend({},du,d),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(d){var t;return this._map=d,this._container=I.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),t=this._setupUI,fo!==void 0?t(fo):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(l=>{fo=l.state!=="denied",t(fo)}):(fo=!!window.navigator.geolocation,t(fo)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),I.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,li=0,mo=!1}_isOutOfMapMaxBounds(d){let t=this._map.getMaxBounds(),l=d.coords;return t&&(l.longitude<t.getWest()||l.longitude>t.getEast()||l.latitude<t.getSouth()||l.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",d)),this._finish()}}_updateCamera(d){let t=new a.LngLat(d.coords.longitude,d.coords.latitude),l=d.coords.accuracy,h=this._map.getBearing(),m=a.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(t.toBounds(l),m,{geolocateSource:!0})}_updateMarker(d){if(d){let t=new a.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let d=this._map._container.clientHeight/2,t=this._map.unproject([0,d]),l=this._map.unproject([1,d]),h=t.distanceTo(l),m=Math.ceil(2*this._accuracy/h);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&mo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=I.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=I.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new ss(this._dotElement),this._circleElement=I.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ss({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return a.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":li--,mo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),li++,li>1?(d={maximumAge:6e5,timeout:0},mo=!0):(d=this.options.positionOptions,mo=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Hs,LogoControl:Fa,ScaleControl:class{constructor(d){this.options=a.extend({},Pn,d),a.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){mh(this._map,this._container,this.options)}onAdd(d){return this._map=d,this._container=I.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){I.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(d){this.options.unit=d,mh(this._map,this._container,this.options)}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=I.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){I.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let d=this._fullscreenButton=I.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},TerrainControl:class{constructor(d){this.options=d,a.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(d){return this._map=d,this._container=I.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=I.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),I.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){I.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends a.Evented{constructor(d){super(),this.options=a.extend(Object.create(jr),d),a.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&I.remove(this._content),this._container&&(I.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=a.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){let t=document.createDocumentFragment(),l=document.createElement("body"),h;for(l.innerHTML=d;h=l.firstChild,h;)t.appendChild(h);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=I.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){this._container&&this._container.classList.add(d)}removeClassName(d){this._container&&this._container.classList.remove(d)}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}_createCloseButton(){this.options.closeButton&&(this._closeButton=I.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(d){this._update(d.point)}_onMouseMove(d){this._update(d.point)}_onDrag(d){this._update(d.point)}_update(d){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=I.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=I.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(g=>this._container.classList.add(g)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Js(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!d))return;let t=this._pos=this._trackPointer&&d?d:this._map.project(this._lngLat),l=this.options.anchor,h=fu(this.options.offset);if(!l){let g=this._container.offsetWidth,v=this._container.offsetHeight,E;E=t.y+h.bottom.y<v?["top"]:t.y>this._map.transform.height-v?["bottom"]:[],t.x<g/2?E.push("left"):t.x>this._map.transform.width-g/2&&E.push("right"),l=E.length===0?"bottom":E.join("-")}let m=t.add(h[l]).round();I.setTransform(this._container,`${ft[l]} translate(${m.x}px,${m.y}px)`),xt(this._container,l,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let d=this._container.querySelector(qr);d&&d.focus()}_onClose(){this.remove()}},Marker:ss,Style:mi,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.pointGeometry,MercatorCoordinate:a.MercatorCoordinate,Evented:a.Evented,AJAXError:a.AJAXError,config:a.config,CanvasSource:Ue,GeoJSONSource:Or,ImageSource:ye,RasterDEMTileSource:st,RasterTileSource:wr,VectorTileSource:Br,VideoSource:Fe,prewarm:function(){Nr().acquire(Dr)},clearPrewarmedResources:function(){let d=hr;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Dr),hr=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"2.4.0"},get workerCount(){return er.workerCount},set workerCount(d){er.workerCount=d},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){a.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){a.clearTileCache(d)},workerUrl:"",addProtocol(d,t){a.config.REGISTERED_PROTOCOLS[d]=t},removeProtocol(d){delete a.config.REGISTERED_PROTOCOLS[d]}};return Yi.extend(zo,{isSafari:a.isSafari,getPerformanceMetrics:a.PerformanceUtils.getPerformanceMetrics}),zo});var p=n;return p})});var xm=Wt((Jk,pv)=>{"use strict";pv.exports=function(r,n){return function(){for(var p=new Array(arguments.length),a=0;a<p.length;a++)p[a]=arguments[a];return r.apply(n,p)}}});var bi=Wt((Yk,mv)=>{"use strict";var $S=xm(),Em=Object.prototype.toString,Sm=function(o){return function(r){var n=Em.call(r);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())}}(Object.create(null));function ma(o){return o=o.toLowerCase(),function(n){return Sm(n)===o}}function Tm(o){return Array.isArray(o)}function Zp(o){return typeof o>"u"}function qS(o){return o!==null&&!Zp(o)&&o.constructor!==null&&!Zp(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}var dv=ma("ArrayBuffer");function GS(o){var r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(o):r=o&&o.buffer&&dv(o.buffer),r}function ZS(o){return typeof o=="string"}function KS(o){return typeof o=="number"}function fv(o){return o!==null&&typeof o=="object"}function Gp(o){if(Sm(o)!=="object")return!1;var r=Object.getPrototypeOf(o);return r===null||r===Object.prototype}var WS=ma("Date"),XS=ma("File"),HS=ma("Blob"),JS=ma("FileList");function Cm(o){return Em.call(o)==="[object Function]"}function YS(o){return fv(o)&&Cm(o.pipe)}function QS(o){var r="[object FormData]";return o&&(typeof FormData=="function"&&o instanceof FormData||Em.call(o)===r||Cm(o.toString)&&o.toString()===r)}var eT=ma("URLSearchParams");function tT(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function rT(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Am(o,r){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Tm(o))for(var n=0,u=o.length;n<u;n++)r.call(null,o[n],n,o);else for(var p in o)Object.prototype.hasOwnProperty.call(o,p)&&r.call(null,o[p],p,o)}function wm(){var o={};function r(p,a){Gp(o[a])&&Gp(p)?o[a]=wm(o[a],p):Gp(p)?o[a]=wm({},p):Tm(p)?o[a]=p.slice():o[a]=p}for(var n=0,u=arguments.length;n<u;n++)Am(arguments[n],r);return o}function iT(o,r,n){return Am(r,function(p,a){n&&typeof p=="function"?o[a]=$S(p,n):o[a]=p}),o}function nT(o){return o.charCodeAt(0)===65279&&(o=o.slice(1)),o}function oT(o,r,n,u){o.prototype=Object.create(r.prototype,u),o.prototype.constructor=o,n&&Object.assign(o.prototype,n)}function sT(o,r,n){var u,p,a,x={};r=r||{};do{for(u=Object.getOwnPropertyNames(o),p=u.length;p-- >0;)a=u[p],x[a]||(r[a]=o[a],x[a]=!0);o=Object.getPrototypeOf(o)}while(o&&(!n||n(o,r))&&o!==Object.prototype);return r}function aT(o,r,n){o=String(o),(n===void 0||n>o.length)&&(n=o.length),n-=r.length;var u=o.indexOf(r,n);return u!==-1&&u===n}function lT(o){if(!o)return null;var r=o.length;if(Zp(r))return null;for(var n=new Array(r);r-- >0;)n[r]=o[r];return n}var uT=function(o){return function(r){return o&&r instanceof o}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));mv.exports={isArray:Tm,isArrayBuffer:dv,isBuffer:qS,isFormData:QS,isArrayBufferView:GS,isString:ZS,isNumber:KS,isObject:fv,isPlainObject:Gp,isUndefined:Zp,isDate:WS,isFile:XS,isBlob:HS,isFunction:Cm,isStream:YS,isURLSearchParams:eT,isStandardBrowserEnv:rT,forEach:Am,merge:wm,extend:iT,trim:tT,stripBOM:nT,inherits:oT,toFlatObject:sT,kindOf:Sm,kindOfTest:ma,endsWith:aT,toArray:lT,isTypedArray:uT,isFileList:JS}});var km=Wt((Qk,gv)=>{"use strict";var Ml=bi();function yv(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}gv.exports=function(r,n,u){if(!n)return r;var p;if(u)p=u(n);else if(Ml.isURLSearchParams(n))p=n.toString();else{var a=[];Ml.forEach(n,function(D,R){D===null||typeof D>"u"||(Ml.isArray(D)?R=R+"[]":D=[D],Ml.forEach(D,function(ee){Ml.isDate(ee)?ee=ee.toISOString():Ml.isObject(ee)&&(ee=JSON.stringify(ee)),a.push(yv(R)+"="+yv(ee))}))}),p=a.join("&")}if(p){var x=r.indexOf("#");x!==-1&&(r=r.slice(0,x)),r+=(r.indexOf("?")===-1?"?":"&")+p}return r}});var vv=Wt((eI,_v)=>{"use strict";var cT=bi();function Kp(){this.handlers=[]}Kp.prototype.use=function(r,n,u){return this.handlers.push({fulfilled:r,rejected:n,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1};Kp.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)};Kp.prototype.forEach=function(r){cT.forEach(this.handlers,function(u){u!==null&&r(u)})};_v.exports=Kp});var xv=Wt((tI,bv)=>{"use strict";var hT=bi();bv.exports=function(r,n){hT.forEach(r,function(p,a){a!==n&&a.toUpperCase()===n.toUpperCase()&&(r[n]=p,delete r[a])})}});var ya=Wt((rI,Tv)=>{"use strict";var wv=bi();function zl(o,r,n,u,p){Error.call(this),this.message=o,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),u&&(this.request=u),p&&(this.response=p)}wv.inherits(zl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Ev=zl.prototype,Sv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(o){Sv[o]={value:o}});Object.defineProperties(zl,Sv);Object.defineProperty(Ev,"isAxiosError",{value:!0});zl.from=function(o,r,n,u,p,a){var x=Object.create(Ev);return wv.toFlatObject(o,x,function(D){return D!==Error.prototype}),zl.call(x,o.message,r,n,u,p),x.name=o.name,a&&Object.assign(x,a),x};Tv.exports=zl});var Im=Wt((iI,Cv)=>{"use strict";Cv.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Pm=Wt((nI,Av)=>{"use strict";var lo=bi();function pT(o,r){r=r||new FormData;var n=[];function u(a){return a===null?"":lo.isDate(a)?a.toISOString():lo.isArrayBuffer(a)||lo.isTypedArray(a)?typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function p(a,x){if(lo.isPlainObject(a)||lo.isArray(a)){if(n.indexOf(a)!==-1)throw Error("Circular reference detected in "+x);n.push(a),lo.forEach(a,function(D,R){if(!lo.isUndefined(D)){var I=x?x+"."+R:R,ee;if(D&&!x&&typeof D=="object"){if(lo.endsWith(R,"{}"))D=JSON.stringify(D);else if(lo.endsWith(R,"[]")&&(ee=lo.toArray(D))){ee.forEach(function(le){!lo.isUndefined(le)&&r.append(I,u(le))});return}}p(D,I)}}),n.pop()}else r.append(x,u(a))}return p(o),r}Av.exports=pT});var Iv=Wt((oI,kv)=>{"use strict";var Mm=ya();kv.exports=function(r,n,u){var p=u.config.validateStatus;!u.status||!p||p(u.status)?r(u):n(new Mm("Request failed with status code "+u.status,[Mm.ERR_BAD_REQUEST,Mm.ERR_BAD_RESPONSE][Math.floor(u.status/100)-4],u.config,u.request,u))}});var Mv=Wt((sI,Pv)=>{"use strict";var Wp=bi();Pv.exports=Wp.isStandardBrowserEnv()?function(){return{write:function(n,u,p,a,x,C){var D=[];D.push(n+"="+encodeURIComponent(u)),Wp.isNumber(p)&&D.push("expires="+new Date(p).toGMTString()),Wp.isString(a)&&D.push("path="+a),Wp.isString(x)&&D.push("domain="+x),C===!0&&D.push("secure"),document.cookie=D.join("; ")},read:function(n){var u=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var Ov=Wt((aI,zv)=>{"use strict";zv.exports=function(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}});var Fv=Wt((lI,Dv)=>{"use strict";Dv.exports=function(r,n){return n?r.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):r}});var zm=Wt((uI,Rv)=>{"use strict";var dT=Ov(),fT=Fv();Rv.exports=function(r,n){return r&&!dT(n)?fT(r,n):n}});var Bv=Wt((cI,Lv)=>{"use strict";var Om=bi(),mT=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];Lv.exports=function(r){var n={},u,p,a;return r&&Om.forEach(r.split(`
595
- `),function(C){if(a=C.indexOf(":"),u=Om.trim(C.substr(0,a)).toLowerCase(),p=Om.trim(C.substr(a+1)),u){if(n[u]&&mT.indexOf(u)>=0)return;u==="set-cookie"?n[u]=(n[u]?n[u]:[]).concat([p]):n[u]=n[u]?n[u]+", "+p:p}}),n}});var Vv=Wt((hI,jv)=>{"use strict";var Nv=bi();jv.exports=Nv.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),u;function p(a){var x=a;return r&&(n.setAttribute("href",x),x=n.href),n.setAttribute("href",x),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return u=p(window.location.href),function(x){var C=Nv.isString(x)?p(x):x;return C.protocol===u.protocol&&C.host===u.host}}():function(){return function(){return!0}}()});var Pc=Wt((pI,$v)=>{"use strict";var Dm=ya(),yT=bi();function Uv(o){Dm.call(this,o??"canceled",Dm.ERR_CANCELED),this.name="CanceledError"}yT.inherits(Uv,Dm,{__CANCEL__:!0});$v.exports=Uv});var Gv=Wt((dI,qv)=>{"use strict";qv.exports=function(r){var n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return n&&n[1]||""}});var Fm=Wt((fI,Zv)=>{"use strict";var Mc=bi(),gT=Iv(),_T=Mv(),vT=km(),bT=zm(),xT=Bv(),wT=Vv(),ET=Im(),Wo=ya(),ST=Pc(),TT=Gv();Zv.exports=function(r){return new Promise(function(u,p){var a=r.data,x=r.headers,C=r.responseType,D;function R(){r.cancelToken&&r.cancelToken.unsubscribe(D),r.signal&&r.signal.removeEventListener("abort",D)}Mc.isFormData(a)&&Mc.isStandardBrowserEnv()&&delete x["Content-Type"];var I=new XMLHttpRequest;if(r.auth){var ee=r.auth.username||"",le=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";x.Authorization="Basic "+btoa(ee+":"+le)}var _e=bT(r.baseURL,r.url);I.open(r.method.toUpperCase(),vT(_e,r.params,r.paramsSerializer),!0),I.timeout=r.timeout;function $e(){if(!!I){var fe="getAllResponseHeaders"in I?xT(I.getAllResponseHeaders()):null,ve=!C||C==="text"||C==="json"?I.responseText:I.response,Ie={data:ve,status:I.status,statusText:I.statusText,headers:fe,config:r,request:I};gT(function(Pe){u(Pe),R()},function(Pe){p(Pe),R()},Ie),I=null}}if("onloadend"in I?I.onloadend=$e:I.onreadystatechange=function(){!I||I.readyState!==4||I.status===0&&!(I.responseURL&&I.responseURL.indexOf("file:")===0)||setTimeout($e)},I.onabort=function(){!I||(p(new Wo("Request aborted",Wo.ECONNABORTED,r,I)),I=null)},I.onerror=function(){p(new Wo("Network Error",Wo.ERR_NETWORK,r,I,I)),I=null},I.ontimeout=function(){var ve=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",Ie=r.transitional||ET;r.timeoutErrorMessage&&(ve=r.timeoutErrorMessage),p(new Wo(ve,Ie.clarifyTimeoutError?Wo.ETIMEDOUT:Wo.ECONNABORTED,r,I)),I=null},Mc.isStandardBrowserEnv()){var Oe=(r.withCredentials||wT(_e))&&r.xsrfCookieName?_T.read(r.xsrfCookieName):void 0;Oe&&(x[r.xsrfHeaderName]=Oe)}"setRequestHeader"in I&&Mc.forEach(x,function(ve,Ie){typeof a>"u"&&Ie.toLowerCase()==="content-type"?delete x[Ie]:I.setRequestHeader(Ie,ve)}),Mc.isUndefined(r.withCredentials)||(I.withCredentials=!!r.withCredentials),C&&C!=="json"&&(I.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&I.addEventListener("progress",r.onDownloadProgress),typeof r.onUploadProgress=="function"&&I.upload&&I.upload.addEventListener("progress",r.onUploadProgress),(r.cancelToken||r.signal)&&(D=function(fe){!I||(p(!fe||fe&&fe.type?new ST:fe),I.abort(),I=null)},r.cancelToken&&r.cancelToken.subscribe(D),r.signal&&(r.signal.aborted?D():r.signal.addEventListener("abort",D))),a||(a=null);var De=TT(_e);if(De&&["http","https","file"].indexOf(De)===-1){p(new Wo("Unsupported protocol "+De+":",Wo.ERR_BAD_REQUEST,r));return}I.send(a)})}});var Wv=Wt((mI,Kv)=>{Kv.exports=null});var Hp=Wt((yI,Yv)=>{"use strict";var xi=bi(),Xv=xv(),Hv=ya(),CT=Im(),AT=Pm(),kT={"Content-Type":"application/x-www-form-urlencoded"};function Jv(o,r){!xi.isUndefined(o)&&xi.isUndefined(o["Content-Type"])&&(o["Content-Type"]=r)}function IT(){var o;return typeof XMLHttpRequest<"u"?o=Fm():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(o=Fm()),o}function PT(o,r,n){if(xi.isString(o))try{return(r||JSON.parse)(o),xi.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(n||JSON.stringify)(o)}var Xp={transitional:CT,adapter:IT(),transformRequest:[function(r,n){if(Xv(n,"Accept"),Xv(n,"Content-Type"),xi.isFormData(r)||xi.isArrayBuffer(r)||xi.isBuffer(r)||xi.isStream(r)||xi.isFile(r)||xi.isBlob(r))return r;if(xi.isArrayBufferView(r))return r.buffer;if(xi.isURLSearchParams(r))return Jv(n,"application/x-www-form-urlencoded;charset=utf-8"),r.toString();var u=xi.isObject(r),p=n&&n["Content-Type"],a;if((a=xi.isFileList(r))||u&&p==="multipart/form-data"){var x=this.env&&this.env.FormData;return AT(a?{"files[]":r}:r,x&&new x)}else if(u||p==="application/json")return Jv(n,"application/json"),PT(r);return r}],transformResponse:[function(r){var n=this.transitional||Xp.transitional,u=n&&n.silentJSONParsing,p=n&&n.forcedJSONParsing,a=!u&&this.responseType==="json";if(a||p&&xi.isString(r)&&r.length)try{return JSON.parse(r)}catch(x){if(a)throw x.name==="SyntaxError"?Hv.from(x,Hv.ERR_BAD_RESPONSE,this,null,this.response):x}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wv()},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xi.forEach(["delete","get","head"],function(r){Xp.headers[r]={}});xi.forEach(["post","put","patch"],function(r){Xp.headers[r]=xi.merge(kT)});Yv.exports=Xp});var eb=Wt((gI,Qv)=>{"use strict";var MT=bi(),zT=Hp();Qv.exports=function(r,n,u){var p=this||zT;return MT.forEach(u,function(x){r=x.call(p,r,n)}),r}});var Rm=Wt((_I,tb)=>{"use strict";tb.exports=function(r){return!!(r&&r.__CANCEL__)}});var nb=Wt((vI,ib)=>{"use strict";var rb=bi(),Lm=eb(),OT=Rm(),DT=Hp(),FT=Pc();function Bm(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new FT}ib.exports=function(r){Bm(r),r.headers=r.headers||{},r.data=Lm.call(r,r.data,r.headers,r.transformRequest),r.headers=rb.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),rb.forEach(["delete","get","head","post","put","patch","common"],function(p){delete r.headers[p]});var n=r.adapter||DT.adapter;return n(r).then(function(p){return Bm(r),p.data=Lm.call(r,p.data,p.headers,r.transformResponse),p},function(p){return OT(p)||(Bm(r),p&&p.response&&(p.response.data=Lm.call(r,p.response.data,p.response.headers,r.transformResponse))),Promise.reject(p)})}});var Nm=Wt((bI,ob)=>{"use strict";var An=bi();ob.exports=function(r,n){n=n||{};var u={};function p(I,ee){return An.isPlainObject(I)&&An.isPlainObject(ee)?An.merge(I,ee):An.isPlainObject(ee)?An.merge({},ee):An.isArray(ee)?ee.slice():ee}function a(I){if(An.isUndefined(n[I])){if(!An.isUndefined(r[I]))return p(void 0,r[I])}else return p(r[I],n[I])}function x(I){if(!An.isUndefined(n[I]))return p(void 0,n[I])}function C(I){if(An.isUndefined(n[I])){if(!An.isUndefined(r[I]))return p(void 0,r[I])}else return p(void 0,n[I])}function D(I){if(I in n)return p(r[I],n[I]);if(I in r)return p(void 0,r[I])}var R={url:x,method:x,data:x,baseURL:C,transformRequest:C,transformResponse:C,paramsSerializer:C,timeout:C,timeoutMessage:C,withCredentials:C,adapter:C,responseType:C,xsrfCookieName:C,xsrfHeaderName:C,onUploadProgress:C,onDownloadProgress:C,decompress:C,maxContentLength:C,maxBodyLength:C,beforeRedirect:C,transport:C,httpAgent:C,httpsAgent:C,cancelToken:C,socketPath:C,responseEncoding:C,validateStatus:D};return An.forEach(Object.keys(r).concat(Object.keys(n)),function(ee){var le=R[ee]||a,_e=le(ee);An.isUndefined(_e)&&le!==D||(u[ee]=_e)}),u}});var jm=Wt((xI,sb)=>{sb.exports={version:"0.27.2"}});var ub=Wt((wI,lb)=>{"use strict";var RT=jm().version,ks=ya(),Vm={};["object","boolean","number","function","string","symbol"].forEach(function(o,r){Vm[o]=function(u){return typeof u===o||"a"+(r<1?"n ":" ")+o}});var ab={};Vm.transitional=function(r,n,u){function p(a,x){return"[Axios v"+RT+"] Transitional option '"+a+"'"+x+(u?". "+u:"")}return function(a,x,C){if(r===!1)throw new ks(p(x," has been removed"+(n?" in "+n:"")),ks.ERR_DEPRECATED);return n&&!ab[x]&&(ab[x]=!0,console.warn(p(x," has been deprecated since v"+n+" and will be removed in the near future"))),r?r(a,x,C):!0}};function LT(o,r,n){if(typeof o!="object")throw new ks("options must be an object",ks.ERR_BAD_OPTION_VALUE);for(var u=Object.keys(o),p=u.length;p-- >0;){var a=u[p],x=r[a];if(x){var C=o[a],D=C===void 0||x(C,a,o);if(D!==!0)throw new ks("option "+a+" must be "+D,ks.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ks("Unknown option "+a,ks.ERR_BAD_OPTION)}}lb.exports={assertOptions:LT,validators:Vm}});var mb=Wt((EI,fb)=>{"use strict";var pb=bi(),BT=km(),cb=vv(),hb=nb(),Jp=Nm(),NT=zm(),db=ub(),Ol=db.validators;function Dl(o){this.defaults=o,this.interceptors={request:new cb,response:new cb}}Dl.prototype.request=function(r,n){typeof r=="string"?(n=n||{},n.url=r):n=r||{},n=Jp(this.defaults,n),n.method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var u=n.transitional;u!==void 0&&db.assertOptions(u,{silentJSONParsing:Ol.transitional(Ol.boolean),forcedJSONParsing:Ol.transitional(Ol.boolean),clarifyTimeoutError:Ol.transitional(Ol.boolean)},!1);var p=[],a=!0;this.interceptors.request.forEach(function(_e){typeof _e.runWhen=="function"&&_e.runWhen(n)===!1||(a=a&&_e.synchronous,p.unshift(_e.fulfilled,_e.rejected))});var x=[];this.interceptors.response.forEach(function(_e){x.push(_e.fulfilled,_e.rejected)});var C;if(!a){var D=[hb,void 0];for(Array.prototype.unshift.apply(D,p),D=D.concat(x),C=Promise.resolve(n);D.length;)C=C.then(D.shift(),D.shift());return C}for(var R=n;p.length;){var I=p.shift(),ee=p.shift();try{R=I(R)}catch(le){ee(le);break}}try{C=hb(R)}catch(le){return Promise.reject(le)}for(;x.length;)C=C.then(x.shift(),x.shift());return C};Dl.prototype.getUri=function(r){r=Jp(this.defaults,r);var n=NT(r.baseURL,r.url);return BT(n,r.params,r.paramsSerializer)};pb.forEach(["delete","get","head","options"],function(r){Dl.prototype[r]=function(n,u){return this.request(Jp(u||{},{method:r,url:n,data:(u||{}).data}))}});pb.forEach(["post","put","patch"],function(r){function n(u){return function(a,x,C){return this.request(Jp(C||{},{method:r,headers:u?{"Content-Type":"multipart/form-data"}:{},url:a,data:x}))}}Dl.prototype[r]=n(),Dl.prototype[r+"Form"]=n(!0)});fb.exports=Dl});var gb=Wt((SI,yb)=>{"use strict";var jT=Pc();function Fl(o){if(typeof o!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(p){r=p});var n=this;this.promise.then(function(u){if(!!n._listeners){var p,a=n._listeners.length;for(p=0;p<a;p++)n._listeners[p](u);n._listeners=null}}),this.promise.then=function(u){var p,a=new Promise(function(x){n.subscribe(x),p=x}).then(u);return a.cancel=function(){n.unsubscribe(p)},a},o(function(p){n.reason||(n.reason=new jT(p),r(n.reason))})}Fl.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Fl.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]};Fl.prototype.unsubscribe=function(r){if(!!this._listeners){var n=this._listeners.indexOf(r);n!==-1&&this._listeners.splice(n,1)}};Fl.source=function(){var r,n=new Fl(function(p){r=p});return{token:n,cancel:r}};yb.exports=Fl});var vb=Wt((TI,_b)=>{"use strict";_b.exports=function(r){return function(u){return r.apply(null,u)}}});var xb=Wt((CI,bb)=>{"use strict";var VT=bi();bb.exports=function(r){return VT.isObject(r)&&r.isAxiosError===!0}});var Sb=Wt((AI,Um)=>{"use strict";var wb=bi(),UT=xm(),Yp=mb(),$T=Nm(),qT=Hp();function Eb(o){var r=new Yp(o),n=UT(Yp.prototype.request,r);return wb.extend(n,Yp.prototype,r),wb.extend(n,r),n.create=function(p){return Eb($T(o,p))},n}var ln=Eb(qT);ln.Axios=Yp;ln.CanceledError=Pc();ln.CancelToken=gb();ln.isCancel=Rm();ln.VERSION=jm().version;ln.toFormData=Pm();ln.AxiosError=ya();ln.Cancel=ln.CanceledError;ln.all=function(r){return Promise.all(r)};ln.spread=vb();ln.isAxiosError=xb();Um.exports=ln;Um.exports.default=ln});var Cb=Wt((kI,Tb)=>{Tb.exports=Sb()});var Bb=Wt((XI,Lb)=>{Lb.exports=typeof self=="object"?self.FormData:window.FormData});var ic={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90\xB0 orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"The terrain configuration.",example:{source:"raster-dem-source",exaggeration:.5,elevationOffset:100}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"maplibre-demotiles":{type:"vector",url:"https://demotiles.maplibre.org/tiles/tiles.json"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) \u2014 it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image",{"!":"icon-overlap"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{doc:"The icon will be hidden if it collides with any other previously drawn symbol."},always:{doc:"The icon will be visible even if it collides with any other previously drawn symbol."},cooperative:{doc:"If the icon collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new icon is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new icon is visible."}},doc:"Allows for control over whether to show an icon when it overlaps other symbols on the map. If `icon-overlap` is not set, `icon-allow-overlap` is used instead.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"2.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",doc:"Size of additional area round the icon bounding box used for detecting symbol collisions. Values are declared using CSS margin shorthand syntax: a single value applies to all four sides; two values apply to [top/bottom, left/right]; three values apply to [top, left/right, bottom]; four values apply to [top, right, bottom, left]. For backwards compatibility, a single bare number is accepted, and treated the same as a one-element array - padding applied to all sides.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.2.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"viewport-glyph":{doc:"When `symbol-placement` is set to `point`, aligns text to the x-axis of the viewport. When `symbol-placement` is set to `line` or `line-center`, aligns glyphs to the x-axis of the viewport and places them along the line."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"`viewport-glyph` value":{js:"2.1.8"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn\u2019t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field",{"!":"text-overlap"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{doc:"The text will be hidden if it collides with any other previously drawn symbol."},always:{doc:"The text will be visible even if it collides with any other previously drawn symbol."},cooperative:{doc:"If the text collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new text is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new text is visible."}},doc:"Allows for control over whether to show symbol text when it overlaps other symbols on the map. If `text-overlap` is not set, `text-allow-overlap` is used instead",requires:["text-field"],"sdk-support":{"basic functionality":{js:"2.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] \u2260 value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] \u2265 value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] \u2264 value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] \u2208 {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] \u2209 {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 \u2227 ... \u2227 fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 \u2228 ... \u2228 fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `\xACf0 \u2227 ... \u2227 \xACfn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:`A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:
596
- * In categorical functions, when the feature value does not match any of the stop domain values.
597
- * In property and zoom-and-property functions, when a feature does not contain a value for the specified property.
598
- * In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a \`circle-color\` property but the feature property value is not a string or not a valid color).
599
- * In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.
600
- If no default is provided, the style property's default is used in these circumstances.`}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. When `source.promoteId` is not provided, features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. When `source.promoteId` is provided, features are identified by their `promoteId` property, which may be a number, string, or any primitive data type. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in MapLibre GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0\xB0 (0\xB0 when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0\xB0 when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0\xB0, directly above, to 180\xB0, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"The source for the terrain data.",required:!0,"sdk-support":{"basic functionality":{js:"2.2.0"}}},exaggeration:{type:"number",minimum:0,doc:"The exaggeration of the terrain - how high it will look.",default:1,"sdk-support":{"basic functionality":{js:"2.2.0"}}},elevationOffset:{type:"number",doc:"The elevation offset.",default:450,"sdk-support":{"basic functionality":{js:"2.2.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},nc={},ff={exports:{}};(function(o,r){(function(n){var u=r&&!r.nodeType&&r,p=o&&!o.nodeType&&o,a=typeof ds=="object"&&ds;(a.global===a||a.window===a||a.self===a)&&(n=a);var x,C=2147483647,D=36,R=1,I=26,ee=38,le=700,_e=72,$e=128,Oe="-",De=/^xn--/,fe=/[^\x20-\x7E]/,ve=/[\x2E\u3002\uFF0E\uFF61]/g,Ie={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},We=D-R,Pe=Math.floor,je=String.fromCharCode,Bt;function vt(Be){throw RangeError(Ie[Be])}function Qt(Be,He){for(var ut=Be.length,lt=[];ut--;)lt[ut]=He(Be[ut]);return lt}function tr(Be,He){var ut=Be.split("@"),lt="";ut.length>1&&(lt=ut[0]+"@",Be=ut[1]),Be=Be.replace(ve,".");var yt=Be.split("."),wt=Qt(yt,He).join(".");return lt+wt}function Br(Be){for(var He=[],ut=0,lt=Be.length,yt,wt;ut<lt;)yt=Be.charCodeAt(ut++),yt>=55296&&yt<=56319&&ut<lt?(wt=Be.charCodeAt(ut++),(wt&64512)==56320?He.push(((yt&1023)<<10)+(wt&1023)+65536):(He.push(yt),ut--)):He.push(yt);return He}function wr(Be){return Qt(Be,function(He){var ut="";return He>65535&&(He-=65536,ut+=je(He>>>10&1023|55296),He=56320|He&1023),ut+=je(He),ut}).join("")}function It(Be){return Be-48<10?Be-22:Be-65<26?Be-65:Be-97<26?Be-97:D}function st(Be,He){return Be+22+75*(Be<26)-((He!=0)<<5)}function Or(Be,He,ut){var lt=0;for(Be=ut?Pe(Be/le):Be>>1,Be+=Pe(Be/He);Be>We*I>>1;lt+=D)Be=Pe(Be/We);return Pe(lt+(We+1)*Be/(Be+ee))}function Er(Be){var He=[],ut=Be.length,lt,yt=0,wt=$e,Nt=_e,Dt,nr,or,Dr,er,Fr,hr,Nr,Kr;for(Dt=Be.lastIndexOf(Oe),Dt<0&&(Dt=0),nr=0;nr<Dt;++nr)Be.charCodeAt(nr)>=128&&vt("not-basic"),He.push(Be.charCodeAt(nr));for(or=Dt>0?Dt+1:0;or<ut;){for(Dr=yt,er=1,Fr=D;or>=ut&&vt("invalid-input"),hr=It(Be.charCodeAt(or++)),(hr>=D||hr>Pe((C-yt)/er))&&vt("overflow"),yt+=hr*er,Nr=Fr<=Nt?R:Fr>=Nt+I?I:Fr-Nt,!(hr<Nr);Fr+=D)Kr=D-Nr,er>Pe(C/Kr)&&vt("overflow"),er*=Kr;lt=He.length+1,Nt=Or(yt-Dr,lt,Dr==0),Pe(yt/lt)>C-wt&&vt("overflow"),wt+=Pe(yt/lt),yt%=lt,He.splice(yt++,0,wt)}return wr(He)}function ye(Be){var He,ut,lt,yt,wt,Nt,Dt,nr,or,Dr,er,Fr=[],hr,Nr,Kr,Pi;for(Be=Br(Be),hr=Be.length,He=$e,ut=0,wt=_e,Nt=0;Nt<hr;++Nt)er=Be[Nt],er<128&&Fr.push(je(er));for(lt=yt=Fr.length,yt&&Fr.push(Oe);lt<hr;){for(Dt=C,Nt=0;Nt<hr;++Nt)er=Be[Nt],er>=He&&er<Dt&&(Dt=er);for(Nr=lt+1,Dt-He>Pe((C-ut)/Nr)&&vt("overflow"),ut+=(Dt-He)*Nr,He=Dt,Nt=0;Nt<hr;++Nt)if(er=Be[Nt],er<He&&++ut>C&&vt("overflow"),er==He){for(nr=ut,or=D;Dr=or<=wt?R:or>=wt+I?I:or-wt,!(nr<Dr);or+=D)Pi=nr-Dr,Kr=D-Dr,Fr.push(je(st(Dr+Pi%Kr,0))),nr=Pe(Pi/Kr);Fr.push(je(st(nr,0))),wt=Or(ut,Nr,lt==yt),ut=0,++lt}++ut,++He}return Fr.join("")}function Fe(Be){return tr(Be,function(He){return De.test(He)?Er(He.slice(4).toLowerCase()):He})}function Ue(Be){return tr(Be,function(He){return fe.test(He)?"xn--"+ye(He):He})}if(x={version:"1.3.2",ucs2:{decode:Br,encode:wr},decode:Er,encode:ye,toASCII:Ue,toUnicode:Fe},u&&p)if(o.exports==u)p.exports=x;else for(Bt in x)x.hasOwnProperty(Bt)&&(u[Bt]=x[Bt]);else n.punycode=x})(ds)})(ff,ff.exports);var N1={isString:function(o){return typeof o=="string"},isObject:function(o){return typeof o=="object"&&o!==null},isNull:function(o){return o===null},isNullOrUndefined:function(o){return o==null}},ju={};function j1(o,r){return Object.prototype.hasOwnProperty.call(o,r)}var V1=function(o,r,n,u){r=r||"&",n=n||"=";var p={};if(typeof o!="string"||o.length===0)return p;var a=/\+/g;o=o.split(r);var x=1e3;u&&typeof u.maxKeys=="number"&&(x=u.maxKeys);var C=o.length;x>0&&C>x&&(C=x);for(var D=0;D<C;++D){var R=o[D].replace(a,"%20"),I=R.indexOf(n),ee,le,_e,$e;I>=0?(ee=R.substr(0,I),le=R.substr(I+1)):(ee=R,le=""),_e=decodeURIComponent(ee),$e=decodeURIComponent(le),j1(p,_e)?Array.isArray(p[_e])?p[_e].push($e):p[_e]=[p[_e],$e]:p[_e]=$e}return p},Du=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}},U1=function(o,r,n,u){return r=r||"&",n=n||"=",o===null&&(o=void 0),typeof o=="object"?Object.keys(o).map(function(p){var a=encodeURIComponent(Du(p))+n;return Array.isArray(o[p])?o[p].map(function(x){return a+encodeURIComponent(Du(x))}).join(r):a+encodeURIComponent(Du(o[p]))}).join(r):u?encodeURIComponent(Du(u))+n+encodeURIComponent(Du(o)):""};ju.decode=ju.parse=V1;ju.encode=ju.stringify=U1;var $1=ff.exports,bo=N1;nc.parse=oc;nc.resolve=Q1;nc.resolveObject=ew;nc.format=Y1;nc.Url=Ln;function Ln(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var q1=/^([a-z0-9.+-]+:)/i,G1=/:[0-9]*$/,Z1=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,K1=["<",">",'"',"`"," ","\r",`
601
- `," "],W1=["{","}","|","\\","^","`"].concat(K1),mf=["'"].concat(W1),hg=["%","/","?",";","#"].concat(mf),pg=["/","?","#"],X1=255,dg=/^[+a-z0-9A-Z_-]{0,63}$/,H1=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,J1={javascript:!0,"javascript:":!0},yf={javascript:!0,"javascript:":!0},Wa={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},gf=ju;function oc(o,r,n){if(o&&bo.isObject(o)&&o instanceof Ln)return o;var u=new Ln;return u.parse(o,r,n),u}Ln.prototype.parse=function(o,r,n){if(!bo.isString(o))throw new TypeError("Parameter 'url' must be a string, not "+typeof o);var u=o.indexOf("?"),p=u!==-1&&u<o.indexOf("#")?"?":"#",a=o.split(p),x=/\\/g;a[0]=a[0].replace(x,"/"),o=a.join(p);var C=o;if(C=C.trim(),!n&&o.split("#").length===1){var D=Z1.exec(C);if(D)return this.path=C,this.href=C,this.pathname=D[1],D[2]?(this.search=D[2],r?this.query=gf.parse(this.search.substr(1)):this.query=this.search.substr(1)):r&&(this.search="",this.query={}),this}var R=q1.exec(C);if(R){R=R[0];var I=R.toLowerCase();this.protocol=I,C=C.substr(R.length)}if(n||R||C.match(/^\/\/[^@\/]+@[^@\/]+/)){var ee=C.substr(0,2)==="//";ee&&!(R&&yf[R])&&(C=C.substr(2),this.slashes=!0)}if(!yf[R]&&(ee||R&&!Wa[R])){for(var le=-1,_e=0;_e<pg.length;_e++){var $e=C.indexOf(pg[_e]);$e!==-1&&(le===-1||$e<le)&&(le=$e)}var Oe,De;le===-1?De=C.lastIndexOf("@"):De=C.lastIndexOf("@",le),De!==-1&&(Oe=C.slice(0,De),C=C.slice(De+1),this.auth=decodeURIComponent(Oe)),le=-1;for(var _e=0;_e<hg.length;_e++){var $e=C.indexOf(hg[_e]);$e!==-1&&(le===-1||$e<le)&&(le=$e)}le===-1&&(le=C.length),this.host=C.slice(0,le),C=C.slice(le),this.parseHost(),this.hostname=this.hostname||"";var fe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!fe)for(var ve=this.hostname.split(/\./),_e=0,Ie=ve.length;_e<Ie;_e++){var We=ve[_e];if(!!We&&!We.match(dg)){for(var Pe="",je=0,Bt=We.length;je<Bt;je++)We.charCodeAt(je)>127?Pe+="x":Pe+=We[je];if(!Pe.match(dg)){var vt=ve.slice(0,_e),Qt=ve.slice(_e+1),tr=We.match(H1);tr&&(vt.push(tr[1]),Qt.unshift(tr[2])),Qt.length&&(C="/"+Qt.join(".")+C),this.hostname=vt.join(".");break}}}this.hostname.length>X1?this.hostname="":this.hostname=this.hostname.toLowerCase(),fe||(this.hostname=$1.toASCII(this.hostname));var Br=this.port?":"+this.port:"",wr=this.hostname||"";this.host=wr+Br,this.href+=this.host,fe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!J1[I])for(var _e=0,Ie=mf.length;_e<Ie;_e++){var It=mf[_e];if(C.indexOf(It)!==-1){var st=encodeURIComponent(It);st===It&&(st=escape(It)),C=C.split(It).join(st)}}var Or=C.indexOf("#");Or!==-1&&(this.hash=C.substr(Or),C=C.slice(0,Or));var Er=C.indexOf("?");if(Er!==-1?(this.search=C.substr(Er),this.query=C.substr(Er+1),r&&(this.query=gf.parse(this.query)),C=C.slice(0,Er)):r&&(this.search="",this.query={}),C&&(this.pathname=C),Wa[I]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Br=this.pathname||"",ye=this.search||"";this.path=Br+ye}return this.href=this.format(),this};function Y1(o){return bo.isString(o)&&(o=oc(o)),o instanceof Ln?o.format():Ln.prototype.format.call(o)}Ln.prototype.format=function(){var o=this.auth||"";o&&(o=encodeURIComponent(o),o=o.replace(/%3A/i,":"),o+="@");var r=this.protocol||"",n=this.pathname||"",u=this.hash||"",p=!1,a="";this.host?p=o+this.host:this.hostname&&(p=o+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(p+=":"+this.port)),this.query&&bo.isObject(this.query)&&Object.keys(this.query).length&&(a=gf.stringify(this.query));var x=this.search||a&&"?"+a||"";return r&&r.substr(-1)!==":"&&(r+=":"),this.slashes||(!r||Wa[r])&&p!==!1?(p="//"+(p||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):p||(p=""),u&&u.charAt(0)!=="#"&&(u="#"+u),x&&x.charAt(0)!=="?"&&(x="?"+x),n=n.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),x=x.replace("#","%23"),r+p+n+x+u};function Q1(o,r){return oc(o,!1,!0).resolve(r)}Ln.prototype.resolve=function(o){return this.resolveObject(oc(o,!1,!0)).format()};function ew(o,r){return o?oc(o,!1,!0).resolveObject(r):r}Ln.prototype.resolveObject=function(o){if(bo.isString(o)){var r=new Ln;r.parse(o,!1,!0),o=r}for(var n=new Ln,u=Object.keys(this),p=0;p<u.length;p++){var a=u[p];n[a]=this[a]}if(n.hash=o.hash,o.href==="")return n.href=n.format(),n;if(o.slashes&&!o.protocol){for(var x=Object.keys(o),C=0;C<x.length;C++){var D=x[C];D!=="protocol"&&(n[D]=o[D])}return Wa[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(o.protocol&&o.protocol!==n.protocol){if(!Wa[o.protocol]){for(var R=Object.keys(o),I=0;I<R.length;I++){var ee=R[I];n[ee]=o[ee]}return n.href=n.format(),n}if(n.protocol=o.protocol,!o.host&&!yf[o.protocol]){for(var Ie=(o.pathname||"").split("/");Ie.length&&!(o.host=Ie.shift()););o.host||(o.host=""),o.hostname||(o.hostname=""),Ie[0]!==""&&Ie.unshift(""),Ie.length<2&&Ie.unshift(""),n.pathname=Ie.join("/")}else n.pathname=o.pathname;if(n.search=o.search,n.query=o.query,n.host=o.host||"",n.auth=o.auth,n.hostname=o.hostname||o.host,n.port=o.port,n.pathname||n.search){var le=n.pathname||"",_e=n.search||"";n.path=le+_e}return n.slashes=n.slashes||o.slashes,n.href=n.format(),n}var $e=n.pathname&&n.pathname.charAt(0)==="/",Oe=o.host||o.pathname&&o.pathname.charAt(0)==="/",De=Oe||$e||n.host&&o.pathname,fe=De,ve=n.pathname&&n.pathname.split("/")||[],Ie=o.pathname&&o.pathname.split("/")||[],We=n.protocol&&!Wa[n.protocol];if(We&&(n.hostname="",n.port=null,n.host&&(ve[0]===""?ve[0]=n.host:ve.unshift(n.host)),n.host="",o.protocol&&(o.hostname=null,o.port=null,o.host&&(Ie[0]===""?Ie[0]=o.host:Ie.unshift(o.host)),o.host=null),De=De&&(Ie[0]===""||ve[0]==="")),Oe)n.host=o.host||o.host===""?o.host:n.host,n.hostname=o.hostname||o.hostname===""?o.hostname:n.hostname,n.search=o.search,n.query=o.query,ve=Ie;else if(Ie.length)ve||(ve=[]),ve.pop(),ve=ve.concat(Ie),n.search=o.search,n.query=o.query;else if(!bo.isNullOrUndefined(o.search)){if(We){n.hostname=n.host=ve.shift();var Pe=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;Pe&&(n.auth=Pe.shift(),n.host=n.hostname=Pe.shift())}return n.search=o.search,n.query=o.query,(!bo.isNull(n.pathname)||!bo.isNull(n.search))&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!ve.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var je=ve.slice(-1)[0],Bt=(n.host||o.host||ve.length>1)&&(je==="."||je==="..")||je==="",vt=0,Qt=ve.length;Qt>=0;Qt--)je=ve[Qt],je==="."?ve.splice(Qt,1):je===".."?(ve.splice(Qt,1),vt++):vt&&(ve.splice(Qt,1),vt--);if(!De&&!fe)for(;vt--;vt)ve.unshift("..");De&&ve[0]!==""&&(!ve[0]||ve[0].charAt(0)!=="/")&&ve.unshift(""),Bt&&ve.join("/").substr(-1)!=="/"&&ve.push("");var tr=ve[0]===""||ve[0]&&ve[0].charAt(0)==="/";if(We){n.hostname=n.host=tr?"":ve.length?ve.shift():"";var Pe=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;Pe&&(n.auth=Pe.shift(),n.host=n.hostname=Pe.shift())}return De=De||n.host&&ve.length,De&&!tr&&ve.unshift(""),ve.length?n.pathname=ve.join("/"):(n.pathname=null,n.path=null),(!bo.isNull(n.pathname)||!bo.isNull(n.search))&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=o.auth||n.auth,n.slashes=n.slashes||o.slashes,n.href=n.format(),n};Ln.prototype.parseHost=function(){var o=this.host,r=G1.exec(o);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),o=o.substr(0,o.length-r.length)),o&&(this.hostname=o)};var to={exports:{}};var fg=Object.getOwnPropertySymbols,tw=Object.prototype.hasOwnProperty,rw=Object.prototype.propertyIsEnumerable;function iw(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function nw(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var r={},n=0;n<10;n++)r["_"+String.fromCharCode(n)]=n;var u=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(u.join("")!=="0123456789")return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(a){p[a]=a}),Object.keys(Object.assign({},p)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var ow=nw()?Object.assign:function(o,r){for(var n,u=iw(o),p,a=1;a<arguments.length;a++){n=Object(arguments[a]);for(var x in n)tw.call(n,x)&&(u[x]=n[x]);if(fg){p=fg(n);for(var C=0;C<p.length;C++)rw.call(n,p[C])&&(u[p[C]]=n[p[C]])}}return u},Rg={},sw=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"},_f={exports:{}};typeof Object.create=="function"?_f.exports=function(r,n){r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:_f.exports=function(r,n){r.super_=n;var u=function(){};u.prototype=n.prototype,r.prototype=new u,r.prototype.constructor=r};(function(o){var r=/%[sdj%]/g;o.format=function(ye){if(!Ie(ye)){for(var Fe=[],Ue=0;Ue<arguments.length;Ue++)Fe.push(p(arguments[Ue]));return Fe.join(" ")}for(var Ue=1,Be=arguments,He=Be.length,ut=String(ye).replace(r,function(yt){if(yt==="%%")return"%";if(Ue>=He)return yt;switch(yt){case"%s":return String(Be[Ue++]);case"%d":return Number(Be[Ue++]);case"%j":try{return JSON.stringify(Be[Ue++])}catch{return"[Circular]"}default:return yt}}),lt=Be[Ue];Ue<He;lt=Be[++Ue])De(lt)||!Bt(lt)?ut+=" "+lt:ut+=" "+p(lt);return ut},o.deprecate=function(ye,Fe){if(Pe(ds.process))return function(){return o.deprecate(ye,Fe).apply(this,arguments)};if(process.noDeprecation===!0)return ye;var Ue=!1;function Be(){if(!Ue){if(process.throwDeprecation)throw new Error(Fe);process.traceDeprecation?console.trace(Fe):console.error(Fe),Ue=!0}return ye.apply(this,arguments)}return Be};var n={},u;o.debuglog=function(ye){if(Pe(u)&&(u=process.env.NODE_DEBUG||""),ye=ye.toUpperCase(),!n[ye])if(new RegExp("\\b"+ye+"\\b","i").test(u)){var Fe=process.pid;n[ye]=function(){var Ue=o.format.apply(o,arguments);console.error("%s %d: %s",ye,Fe,Ue)}}else n[ye]=function(){};return n[ye]};function p(ye,Fe){var Ue={seen:[],stylize:x};return arguments.length>=3&&(Ue.depth=arguments[2]),arguments.length>=4&&(Ue.colors=arguments[3]),Oe(Fe)?Ue.showHidden=Fe:Fe&&o._extend(Ue,Fe),Pe(Ue.showHidden)&&(Ue.showHidden=!1),Pe(Ue.depth)&&(Ue.depth=2),Pe(Ue.colors)&&(Ue.colors=!1),Pe(Ue.customInspect)&&(Ue.customInspect=!0),Ue.colors&&(Ue.stylize=a),D(Ue,ye,Ue.depth)}o.inspect=p,p.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},p.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(ye,Fe){var Ue=p.styles[Fe];return Ue?"\x1B["+p.colors[Ue][0]+"m"+ye+"\x1B["+p.colors[Ue][1]+"m":ye}function x(ye,Fe){return ye}function C(ye){var Fe={};return ye.forEach(function(Ue,Be){Fe[Ue]=!0}),Fe}function D(ye,Fe,Ue){if(ye.customInspect&&Fe&&tr(Fe.inspect)&&Fe.inspect!==o.inspect&&!(Fe.constructor&&Fe.constructor.prototype===Fe)){var Be=Fe.inspect(Ue,ye);return Ie(Be)||(Be=D(ye,Be,Ue)),Be}var He=R(ye,Fe);if(He)return He;var ut=Object.keys(Fe),lt=C(ut);if(ye.showHidden&&(ut=Object.getOwnPropertyNames(Fe)),Qt(Fe)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return I(Fe);if(ut.length===0){if(tr(Fe)){var yt=Fe.name?": "+Fe.name:"";return ye.stylize("[Function"+yt+"]","special")}if(je(Fe))return ye.stylize(RegExp.prototype.toString.call(Fe),"regexp");if(vt(Fe))return ye.stylize(Date.prototype.toString.call(Fe),"date");if(Qt(Fe))return I(Fe)}var wt="",Nt=!1,Dt=["{","}"];if($e(Fe)&&(Nt=!0,Dt=["[","]"]),tr(Fe)){var nr=Fe.name?": "+Fe.name:"";wt=" [Function"+nr+"]"}if(je(Fe)&&(wt=" "+RegExp.prototype.toString.call(Fe)),vt(Fe)&&(wt=" "+Date.prototype.toUTCString.call(Fe)),Qt(Fe)&&(wt=" "+I(Fe)),ut.length===0&&(!Nt||Fe.length==0))return Dt[0]+wt+Dt[1];if(Ue<0)return je(Fe)?ye.stylize(RegExp.prototype.toString.call(Fe),"regexp"):ye.stylize("[Object]","special");ye.seen.push(Fe);var or;return Nt?or=ee(ye,Fe,Ue,lt,ut):or=ut.map(function(Dr){return le(ye,Fe,Ue,lt,Dr,Nt)}),ye.seen.pop(),_e(or,wt,Dt)}function R(ye,Fe){if(Pe(Fe))return ye.stylize("undefined","undefined");if(Ie(Fe)){var Ue="'"+JSON.stringify(Fe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ye.stylize(Ue,"string")}if(ve(Fe))return ye.stylize(""+Fe,"number");if(Oe(Fe))return ye.stylize(""+Fe,"boolean");if(De(Fe))return ye.stylize("null","null")}function I(ye){return"["+Error.prototype.toString.call(ye)+"]"}function ee(ye,Fe,Ue,Be,He){for(var ut=[],lt=0,yt=Fe.length;lt<yt;++lt)Er(Fe,String(lt))?ut.push(le(ye,Fe,Ue,Be,String(lt),!0)):ut.push("");return He.forEach(function(wt){wt.match(/^\d+$/)||ut.push(le(ye,Fe,Ue,Be,wt,!0))}),ut}function le(ye,Fe,Ue,Be,He,ut){var lt,yt,wt;if(wt=Object.getOwnPropertyDescriptor(Fe,He)||{value:Fe[He]},wt.get?wt.set?yt=ye.stylize("[Getter/Setter]","special"):yt=ye.stylize("[Getter]","special"):wt.set&&(yt=ye.stylize("[Setter]","special")),Er(Be,He)||(lt="["+He+"]"),yt||(ye.seen.indexOf(wt.value)<0?(De(Ue)?yt=D(ye,wt.value,null):yt=D(ye,wt.value,Ue-1),yt.indexOf(`
602
- `)>-1&&(ut?yt=yt.split(`
603
- `).map(function(Nt){return" "+Nt}).join(`
604
- `).substr(2):yt=`
605
- `+yt.split(`
606
- `).map(function(Nt){return" "+Nt}).join(`
607
- `))):yt=ye.stylize("[Circular]","special")),Pe(lt)){if(ut&&He.match(/^\d+$/))return yt;lt=JSON.stringify(""+He),lt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(lt=lt.substr(1,lt.length-2),lt=ye.stylize(lt,"name")):(lt=lt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),lt=ye.stylize(lt,"string"))}return lt+": "+yt}function _e(ye,Fe,Ue){var Be=ye.reduce(function(He,ut){return ut.indexOf(`
608
- `)>=0,He+ut.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Be>60?Ue[0]+(Fe===""?"":Fe+`
609
- `)+" "+ye.join(`,
610
- `)+" "+Ue[1]:Ue[0]+Fe+" "+ye.join(", ")+" "+Ue[1]}function $e(ye){return Array.isArray(ye)}o.isArray=$e;function Oe(ye){return typeof ye=="boolean"}o.isBoolean=Oe;function De(ye){return ye===null}o.isNull=De;function fe(ye){return ye==null}o.isNullOrUndefined=fe;function ve(ye){return typeof ye=="number"}o.isNumber=ve;function Ie(ye){return typeof ye=="string"}o.isString=Ie;function We(ye){return typeof ye=="symbol"}o.isSymbol=We;function Pe(ye){return ye===void 0}o.isUndefined=Pe;function je(ye){return Bt(ye)&&wr(ye)==="[object RegExp]"}o.isRegExp=je;function Bt(ye){return typeof ye=="object"&&ye!==null}o.isObject=Bt;function vt(ye){return Bt(ye)&&wr(ye)==="[object Date]"}o.isDate=vt;function Qt(ye){return Bt(ye)&&(wr(ye)==="[object Error]"||ye instanceof Error)}o.isError=Qt;function tr(ye){return typeof ye=="function"}o.isFunction=tr;function Br(ye){return ye===null||typeof ye=="boolean"||typeof ye=="number"||typeof ye=="string"||typeof ye=="symbol"||typeof ye>"u"}o.isPrimitive=Br,o.isBuffer=sw;function wr(ye){return Object.prototype.toString.call(ye)}function It(ye){return ye<10?"0"+ye.toString(10):ye.toString(10)}var st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Or(){var ye=new Date,Fe=[It(ye.getHours()),It(ye.getMinutes()),It(ye.getSeconds())].join(":");return[ye.getDate(),st[ye.getMonth()],Fe].join(" ")}o.log=function(){console.log("%s - %s",Or(),o.format.apply(o,arguments))},o.inherits=_f.exports,o._extend=function(ye,Fe){if(!Fe||!Bt(Fe))return ye;for(var Ue=Object.keys(Fe),Be=Ue.length;Be--;)ye[Ue[Be]]=Fe[Ue[Be]];return ye};function Er(ye,Fe){return Object.prototype.hasOwnProperty.call(ye,Fe)}})(Rg);var aw=ow;function mg(o,r){if(o===r)return 0;for(var n=o.length,u=r.length,p=0,a=Math.min(n,u);p<a;++p)if(o[p]!==r[p]){n=o[p],u=r[p];break}return n<u?-1:u<n?1:0}function Fu(o){return ds.Buffer&&typeof ds.Buffer.isBuffer=="function"?ds.Buffer.isBuffer(o):!!(o!=null&&o._isBuffer)}var Qn=Rg,lw=Object.prototype.hasOwnProperty,yg=Array.prototype.slice,Lg=function(){return function(){}.name==="foo"}();function gg(o){return Object.prototype.toString.call(o)}function _g(o){return Fu(o)||typeof ds.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o?!!(o instanceof DataView||o.buffer&&o.buffer instanceof ArrayBuffer):!1}var dr=to.exports=Ng,uw=/\s*function\s+([^\(\s]*)\s*/;function Bg(o){if(!!Qn.isFunction(o)){if(Lg)return o.name;var r=o.toString(),n=r.match(uw);return n&&n[1]}}dr.AssertionError=function(r){this.name="AssertionError",this.actual=r.actual,this.expected=r.expected,this.operator=r.operator,r.message?(this.message=r.message,this.generatedMessage=!1):(this.message=cw(this),this.generatedMessage=!0);var n=r.stackStartFunction||on;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var u=new Error;if(u.stack){var p=u.stack,a=Bg(n),x=p.indexOf(`
611
- `+a);if(x>=0){var C=p.indexOf(`
612
- `,x+1);p=p.substring(C+1)}this.stack=p}}};Qn.inherits(dr.AssertionError,Error);function vg(o,r){return typeof o=="string"?o.length<r?o:o.slice(0,r):o}function bg(o){if(Lg||!Qn.isFunction(o))return Qn.inspect(o);var r=Bg(o),n=r?": "+r:"";return"[Function"+n+"]"}function cw(o){return vg(bg(o.actual),128)+" "+o.operator+" "+vg(bg(o.expected),128)}function on(o,r,n,u,p){throw new dr.AssertionError({message:n,actual:o,expected:r,operator:u,stackStartFunction:p})}dr.fail=on;function Ng(o,r){o||on(o,!0,r,"==",dr.ok)}dr.ok=Ng;dr.equal=function(r,n,u){r!=n&&on(r,n,u,"==",dr.equal)};dr.notEqual=function(r,n,u){r==n&&on(r,n,u,"!=",dr.notEqual)};dr.deepEqual=function(r,n,u){Ja(r,n,!1)||on(r,n,u,"deepEqual",dr.deepEqual)};dr.deepStrictEqual=function(r,n,u){Ja(r,n,!0)||on(r,n,u,"deepStrictEqual",dr.deepStrictEqual)};function Ja(o,r,n,u){if(o===r)return!0;if(Fu(o)&&Fu(r))return mg(o,r)===0;if(Qn.isDate(o)&&Qn.isDate(r))return o.getTime()===r.getTime();if(Qn.isRegExp(o)&&Qn.isRegExp(r))return o.source===r.source&&o.global===r.global&&o.multiline===r.multiline&&o.lastIndex===r.lastIndex&&o.ignoreCase===r.ignoreCase;if((o===null||typeof o!="object")&&(r===null||typeof r!="object"))return n?o===r:o==r;if(_g(o)&&_g(r)&&gg(o)===gg(r)&&!(o instanceof Float32Array||o instanceof Float64Array))return mg(new Uint8Array(o.buffer),new Uint8Array(r.buffer))===0;if(Fu(o)!==Fu(r))return!1;u=u||{actual:[],expected:[]};var p=u.actual.indexOf(o);return p!==-1&&p===u.expected.indexOf(r)?!0:(u.actual.push(o),u.expected.push(r),hw(o,r,n,u))}function xg(o){return Object.prototype.toString.call(o)=="[object Arguments]"}function hw(o,r,n,u){if(o==null||r===null||r===void 0)return!1;if(Qn.isPrimitive(o)||Qn.isPrimitive(r))return o===r;if(n&&Object.getPrototypeOf(o)!==Object.getPrototypeOf(r))return!1;var p=xg(o),a=xg(r);if(p&&!a||!p&&a)return!1;if(p)return o=yg.call(o),r=yg.call(r),Ja(o,r,n);var x=Eg(o),C=Eg(r),D,R;if(x.length!==C.length)return!1;for(x.sort(),C.sort(),R=x.length-1;R>=0;R--)if(x[R]!==C[R])return!1;for(R=x.length-1;R>=0;R--)if(D=x[R],!Ja(o[D],r[D],n,u))return!1;return!0}dr.notDeepEqual=function(r,n,u){Ja(r,n,!1)&&on(r,n,u,"notDeepEqual",dr.notDeepEqual)};dr.notDeepStrictEqual=jg;function jg(o,r,n){Ja(o,r,!0)&&on(o,r,n,"notDeepStrictEqual",jg)}dr.strictEqual=function(r,n,u){r!==n&&on(r,n,u,"===",dr.strictEqual)};dr.notStrictEqual=function(r,n,u){r===n&&on(r,n,u,"!==",dr.notStrictEqual)};function wg(o,r){if(!o||!r)return!1;if(Object.prototype.toString.call(r)=="[object RegExp]")return r.test(o);try{if(o instanceof r)return!0}catch{}return Error.isPrototypeOf(r)?!1:r.call({},o)===!0}function pw(o){var r;try{o()}catch(n){r=n}return r}function Vg(o,r,n,u){var p;if(typeof r!="function")throw new TypeError('"block" argument must be a function');typeof n=="string"&&(u=n,n=null),p=pw(r),u=(n&&n.name?" ("+n.name+").":".")+(u?" "+u:"."),o&&!p&&on(p,n,"Missing expected exception"+u);var a=typeof u=="string",x=!o&&Qn.isError(p),C=!o&&p&&!n;if((x&&a&&wg(p,n)||C)&&on(p,n,"Got unwanted exception"+u),o&&p&&n&&!wg(p,n)||!o&&p)throw p}dr.throws=function(o,r,n){Vg(!0,o,r,n)};dr.doesNotThrow=function(o,r,n){Vg(!1,o,r,n)};dr.ifError=function(o){if(o)throw o};function Ug(o,r){o||on(o,!0,r,"==",Ug)}dr.strict=aw(Ug,dr,{equal:dr.strictEqual,deepEqual:dr.deepStrictEqual,notEqual:dr.notStrictEqual,notDeepEqual:dr.notDeepStrictEqual});dr.strict.strict=dr.strict;var Eg=Object.keys||function(o){var r=[];for(var n in o)lw.call(o,n)&&r.push(n);return r};function Ya(o,...r){for(let n of r)for(let u in n)o[u]=n[u];return o}var Fn=class extends Error{constructor(r,n){super(n),this.message=n,this.key=r}},Vu=class{constructor(r,n=[]){this.parent=r,this.bindings={};for(let[u,p]of n)this.bindings[u]=p}concat(r){return new Vu(this,r)}get(r){if(this.bindings[r])return this.bindings[r];if(this.parent)return this.parent.get(r);throw new Error(`${r} not found in scope.`)}has(r){return this.bindings[r]?!0:this.parent?this.parent.has(r):!1}},Wh={kind:"null"},tt={kind:"number"},Xt={kind:"string"},Ut={kind:"boolean"},Uo={kind:"color"},Xa={kind:"object"},$t={kind:"value"},dw={kind:"error"},Xh={kind:"collator"},Hh={kind:"formatted"},xf={kind:"padding"},sc={kind:"resolvedImage"};function Rn(o,r){return{kind:"array",itemType:o,N:r}}function Ur(o){if(o.kind==="array"){let r=Ur(o.itemType);return typeof o.N=="number"?`array<${r}, ${o.N}>`:o.itemType.kind==="value"?"array":`array<${r}>`}else return o.kind}var fw=[Wh,tt,Xt,Ut,Uo,Hh,Xa,Rn($t),xf,sc];function Uu(o,r){if(r.kind==="error")return null;if(o.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!Uu(o.itemType,r.itemType))&&(typeof o.N!="number"||o.N===r.N))return null}else{if(o.kind===r.kind)return null;if(o.kind==="value"){for(let n of fw)if(!Uu(n,r))return null}}return`Expected ${Ur(o)} but found ${Ur(r)} instead.`}function wf(o,r){return r.some(n=>n.kind===o.kind)}function $u(o,r){return r.some(n=>n==="null"?o===null:n==="array"?Array.isArray(o):n==="object"?o&&!Array.isArray(o)&&typeof o=="object":n===typeof o)}var mw={},Ef,Sg={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Bu(o){return o=Math.round(o),o<0?0:o>255?255:o}function Tg(o){return o<0?0:o>1?1:o}function sf(o){return o[o.length-1]==="%"?Bu(parseFloat(o)/100*255):Bu(parseInt(o))}function Nh(o){return o[o.length-1]==="%"?Tg(parseFloat(o)/100):Tg(parseFloat(o))}function af(o,r,n){return n<0?n+=1:n>1&&(n-=1),n*6<1?o+(r-o)*n*6:n*2<1?r:n*3<2?o+(r-o)*(2/3-n)*6:o}function yw(o){var r=o.replace(/ /g,"").toLowerCase();if(r in Sg)return Sg[r].slice();if(r[0]==="#"){if(r.length===4){var n=parseInt(r.substr(1),16);return n>=0&&n<=4095?[(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,1]:null}else if(r.length===7){var n=parseInt(r.substr(1),16);return n>=0&&n<=16777215?[(n&16711680)>>16,(n&65280)>>8,n&255,1]:null}return null}var u=r.indexOf("("),p=r.indexOf(")");if(u!==-1&&p+1===r.length){var a=r.substr(0,u),x=r.substr(u+1,p-(u+1)).split(","),C=1;switch(a){case"rgba":if(x.length!==4)return null;C=Nh(x.pop());case"rgb":return x.length!==3?null:[sf(x[0]),sf(x[1]),sf(x[2]),C];case"hsla":if(x.length!==4)return null;C=Nh(x.pop());case"hsl":if(x.length!==3)return null;var D=(parseFloat(x[0])%360+360)%360/360,R=Nh(x[1]),I=Nh(x[2]),ee=I<=.5?I*(R+1):I+R-I*R,le=I*2-ee;return[Bu(af(le,ee,D+1/3)*255),Bu(af(le,ee,D)*255),Bu(af(le,ee,D-1/3)*255),C];default:return null}}return null}try{Ef=mw.parseCSSColor=yw}catch{}var zr=class{constructor(r,n,u,p=1){this.r=r,this.g=n,this.b=u,this.a=p}static parse(r){if(!r)return;if(r instanceof zr)return r;if(typeof r!="string")return;let n=Ef(r);if(!!n)return new zr(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}toString(){let[r,n,u,p]=this.toArray();return`rgba(${Math.round(r)},${Math.round(n)},${Math.round(u)},${p})`}toArray(){let{r,g:n,b:u,a:p}=this;return p===0?[0,0,0,0]:[r*255/p,n*255/p,u*255/p,p]}};zr.black=new zr(0,0,0,1);zr.white=new zr(1,1,1,1);zr.transparent=new zr(0,0,0,0);zr.red=new zr(1,0,0,1);var qu=class{constructor(r,n,u){r?this.sensitivity=n?"variant":"case":this.sensitivity=n?"accent":"base",this.locale=u,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,n){return this.collator.compare(r,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Gu=class{constructor(r,n,u,p,a){this.text=r,this.image=n,this.scale=u,this.fontStack=p,this.textColor=a}},Bn=class{constructor(r){this.sections=r}static fromString(r){return new Bn([new Gu(r,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof Bn?r:Bn.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}},Wi=class{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof Wi)return r;if(typeof r=="number")return new Wi([r,r,r,r]);if(!!Array.isArray(r)&&!(r.length<1||r.length>4)){for(let n of r)if(typeof n!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]];break}return new Wi(r)}}toString(){return JSON.stringify(this.values)}},ro=class{constructor(r){this.name=r.name,this.available=r.available}toString(){return this.name}static fromString(r){return r?new ro({name:r,available:!1}):null}};function $g(o,r,n,u){return typeof o=="number"&&o>=0&&o<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof n=="number"&&n>=0&&n<=255?typeof u>"u"||typeof u=="number"&&u>=0&&u<=1?null:`Invalid rgba value [${[o,r,n,u].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof u=="number"?[o,r,n,u]:[o,r,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Uh(o){if(o===null)return!0;if(typeof o=="string")return!0;if(typeof o=="boolean")return!0;if(typeof o=="number")return!0;if(o instanceof zr)return!0;if(o instanceof qu)return!0;if(o instanceof Bn)return!0;if(o instanceof Wi)return!0;if(o instanceof ro)return!0;if(Array.isArray(o)){for(let r of o)if(!Uh(r))return!1;return!0}else if(typeof o=="object"){for(let r in o)if(!Uh(o[r]))return!1;return!0}else return!1}function ci(o){if(o===null)return Wh;if(typeof o=="string")return Xt;if(typeof o=="boolean")return Ut;if(typeof o=="number")return tt;if(o instanceof zr)return Uo;if(o instanceof qu)return Xh;if(o instanceof Bn)return Hh;if(o instanceof Wi)return xf;if(o instanceof ro)return sc;if(Array.isArray(o)){let r=o.length,n;for(let u of o){let p=ci(u);if(!n)n=p;else{if(n===p)continue;n=$t;break}}return Rn(n||$t,r)}else return to.exports(typeof o=="object"),Xa}function Nu(o){let r=typeof o;return o===null?"":r==="string"||r==="number"||r==="boolean"?String(o):o instanceof zr||o instanceof Bn||o instanceof Wi||o instanceof ro?o.toString():JSON.stringify(o)}var ms=class{constructor(r,n){this.type=r,this.value=n}static parse(r,n){if(r.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!Uh(r[1]))return n.error("invalid value");let u=r[1],p=ci(u),a=n.expectedType;return p.kind==="array"&&p.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(p=a),new ms(p,u)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},oi=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}},jh={string:Xt,number:tt,boolean:Ut,object:Xa},xn=class{constructor(r,n){this.type=r,this.args=n}static parse(r,n){if(r.length<2)return n.error("Expected at least one argument.");let u=1,p,a=r[0];if(a==="array"){let C;if(r.length>2){let R=r[1];if(typeof R!="string"||!(R in jh)||R==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);C=jh[R],u++}else C=$t;let D;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return n.error('The length argument to "array" must be a positive integer literal',2);D=r[2],u++}p=Rn(C,D)}else to.exports(jh[a],a),p=jh[a];let x=[];for(;u<r.length;u++){let C=n.parse(r[u],u,$t);if(!C)return null;x.push(C)}return new xn(p,x)}evaluate(r){for(let n=0;n<this.args.length;n++){let u=this.args[n].evaluate(r);if(Uu(this.type,ci(u))){if(n===this.args.length-1)throw new oi(`Expected value to be of type ${Ur(this.type)}, but found ${Ur(ci(u))} instead.`)}else return u}return to.exports(!1),null}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},Cg={"to-boolean":Ut,"to-color":Uo,"to-number":tt,"to-string":Xt},xo=class{constructor(r,n){this.type=r,this.args=n}static parse(r,n){if(r.length<2)return n.error("Expected at least one argument.");let u=r[0];if(to.exports(Cg[u],u),(u==="to-boolean"||u==="to-string")&&r.length!==2)return n.error("Expected one argument.");let p=Cg[u],a=[];for(let x=1;x<r.length;x++){let C=n.parse(r[x],x,$t);if(!C)return null;a.push(C)}return new xo(p,a)}evaluate(r){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(r));if(this.type.kind==="color"){let n,u;for(let p of this.args){if(n=p.evaluate(r),u=null,n instanceof zr)return n;if(typeof n=="string"){let a=r.parseColor(n);if(a)return a}else if(Array.isArray(n)&&(n.length<3||n.length>4?u=`Invalid rbga value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:u=$g(n[0],n[1],n[2],n[3]),!u))return new zr(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new oi(u||`Could not parse color from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}else if(this.type.kind==="padding"){let n;for(let u of this.args){n=u.evaluate(r);let p=Wi.parse(n);if(p)return p}throw new oi(`Could not parse padding from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}else if(this.type.kind==="number"){let n=null;for(let u of this.args){if(n=u.evaluate(r),n===null)return 0;let p=Number(n);if(!isNaN(p))return p}throw new oi(`Could not convert ${JSON.stringify(n)} to number.`)}else return this.type.kind==="formatted"?Bn.fromString(Nu(this.args[0].evaluate(r))):this.type.kind==="resolvedImage"?ro.fromString(Nu(this.args[0].evaluate(r))):Nu(this.args[0].evaluate(r))}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},gw=["Unknown","Point","LineString","Polygon"],$h=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?gw[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(r){let n=this._parseColorCache[r];return n||(n=this._parseColorCache[r]=zr.parse(r)),n}},rn=class{constructor(r,n,u,p){this.name=r,this.type=n,this._evaluate=u,this.args=p}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,n){let u=r[0],p=rn.definitions[u];if(!p)return n.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(p)?p[0]:p.type,x=Array.isArray(p)?[[p[1],p[2]]]:p.overloads,C=x.filter(([R])=>!Array.isArray(R)||R.length===r.length-1),D=null;for(let[R,I]of C){D=new tl(n.registry,n.path,null,n.scope);let ee=[],le=!1;for(let _e=1;_e<r.length;_e++){let $e=r[_e],Oe=Array.isArray(R)?R[_e-1]:R.type,De=D.parse($e,1+ee.length,Oe);if(!De){le=!0;break}ee.push(De)}if(!le){if(Array.isArray(R)&&R.length!==ee.length){D.error(`Expected ${R.length} arguments, but found ${ee.length} instead.`);continue}for(let _e=0;_e<ee.length;_e++){let $e=Array.isArray(R)?R[_e]:R.type,Oe=ee[_e];D.concat(_e+1).checkSubtype($e,Oe.type)}if(D.errors.length===0)return new rn(u,a,I,ee)}}if(to.exports(!D||D.errors.length>0),C.length===1)n.errors.push(...D.errors);else{let I=(C.length?C:x).map(([le])=>_w(le)).join(" | "),ee=[];for(let le=1;le<r.length;le++){let _e=n.parse(r[le],1+ee.length);if(!_e)return null;ee.push(Ur(_e.type))}n.error(`Expected arguments of type ${I}, but found (${ee.join(", ")}) instead.`)}return null}static register(r,n){to.exports(!rn.definitions),rn.definitions=n;for(let u in n)r[u]=rn}};function _w(o){return Array.isArray(o)?`(${o.map(Ur).join(", ")})`:`(${Ur(o.type)}...)`}var Qa=class{constructor(r,n,u){this.type=Xh,this.locale=u,this.caseSensitive=r,this.diacriticSensitive=n}static parse(r,n){if(r.length!==2)return n.error("Expected one argument.");let u=r[1];if(typeof u!="object"||Array.isArray(u))return n.error("Collator options argument must be an object.");let p=n.parse(u["case-sensitive"]===void 0?!1:u["case-sensitive"],1,Ut);if(!p)return null;let a=n.parse(u["diacritic-sensitive"]===void 0?!1:u["diacritic-sensitive"],1,Ut);if(!a)return null;let x=null;return u.locale&&(x=n.parse(u.locale,1,Xt),!x)?null:new Qa(p,a,x)}evaluate(r){return new qu(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}},fs=8192;function Sf(o,r){o[0]=Math.min(o[0],r[0]),o[1]=Math.min(o[1],r[1]),o[2]=Math.max(o[2],r[0]),o[3]=Math.max(o[3],r[1])}function vw(o){return(180+o)/360}function bw(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function qh(o,r){return!(o[0]<=r[0]||o[2]>=r[2]||o[1]<=r[1]||o[3]>=r[3])}function xw(o,r){let n=vw(o[0]),u=bw(o[1]),p=Math.pow(2,r.z);return[Math.round(n*p*fs),Math.round(u*p*fs)]}function ww(o,r,n){let u=o[0]-r[0],p=o[1]-r[1],a=o[0]-n[0],x=o[1]-n[1];return u*x-a*p===0&&u*a<=0&&p*x<=0}function Ew(o,r,n){return r[1]>o[1]!=n[1]>o[1]&&o[0]<(n[0]-r[0])*(o[1]-r[1])/(n[1]-r[1])+r[0]}function Tf(o,r){let n=!1;for(let u=0,p=r.length;u<p;u++){let a=r[u];for(let x=0,C=a.length;x<C-1;x++){if(ww(o,a[x],a[x+1]))return!1;Ew(o,a[x],a[x+1])&&(n=!n)}}return n}function Sw(o,r){for(let n=0;n<r.length;n++)if(Tf(o,r[n]))return!0;return!1}function Tw(o,r){return o[0]*r[1]-o[1]*r[0]}function Ag(o,r,n,u){let p=o[0]-n[0],a=o[1]-n[1],x=r[0]-n[0],C=r[1]-n[1],D=u[0]-n[0],R=u[1]-n[1],I=p*R-D*a,ee=x*R-D*C;return I>0&&ee<0||I<0&&ee>0}function Cw(o,r,n,u){let p=[r[0]-o[0],r[1]-o[1]],a=[u[0]-n[0],u[1]-n[1]];return Tw(a,p)===0?!1:!!(Ag(o,r,n,u)&&Ag(n,u,o,r))}function Aw(o,r,n){for(let u of n)for(let p=0;p<u.length-1;++p)if(Cw(o,r,u[p],u[p+1]))return!0;return!1}function qg(o,r){for(let n=0;n<o.length;++n)if(!Tf(o[n],r))return!1;for(let n=0;n<o.length-1;++n)if(Aw(o[n],o[n+1],r))return!1;return!0}function kw(o,r){for(let n=0;n<r.length;n++)if(qg(o,r[n]))return!0;return!1}function Cf(o,r,n){let u=[];for(let p=0;p<o.length;p++){let a=[];for(let x=0;x<o[p].length;x++){let C=xw(o[p][x],n);Sf(r,C),a.push(C)}u.push(a)}return u}function Gg(o,r,n){let u=[];for(let p=0;p<o.length;p++){let a=Cf(o[p],r,n);u.push(a)}return u}function Zg(o,r,n,u){if(o[0]<n[0]||o[0]>n[2]){let p=u*.5,a=o[0]-n[0]>p?-u:n[0]-o[0]>p?u:0;a===0&&(a=o[0]-n[2]>p?-u:n[2]-o[0]>p?u:0),o[0]+=a}Sf(r,o)}function Iw(o){o[0]=o[1]=1/0,o[2]=o[3]=-1/0}function kg(o,r,n,u){let p=Math.pow(2,u.z)*fs,a=[u.x*fs,u.y*fs],x=[];for(let C of o)for(let D of C){let R=[D.x+a[0],D.y+a[1]];Zg(R,r,n,p),x.push(R)}return x}function Ig(o,r,n,u){let p=Math.pow(2,u.z)*fs,a=[u.x*fs,u.y*fs],x=[];for(let C of o){let D=[];for(let R of C){let I=[R.x+a[0],R.y+a[1]];Sf(r,I),D.push(I)}x.push(D)}if(r[2]-r[0]<=p/2){Iw(r);for(let C of x)for(let D of C)Zg(D,r,n,p)}return x}function Pw(o,r){let n=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=o.canonicalID();if(r.type==="Polygon"){let a=Cf(r.coordinates,u,p),x=kg(o.geometry(),n,u,p);if(!qh(n,u))return!1;for(let C of x)if(!Tf(C,a))return!1}if(r.type==="MultiPolygon"){let a=Gg(r.coordinates,u,p),x=kg(o.geometry(),n,u,p);if(!qh(n,u))return!1;for(let C of x)if(!Sw(C,a))return!1}return!0}function Mw(o,r){let n=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=o.canonicalID();if(r.type==="Polygon"){let a=Cf(r.coordinates,u,p),x=Ig(o.geometry(),n,u,p);if(!qh(n,u))return!1;for(let C of x)if(!qg(C,a))return!1}if(r.type==="MultiPolygon"){let a=Gg(r.coordinates,u,p),x=Ig(o.geometry(),n,u,p);if(!qh(n,u))return!1;for(let C of x)if(!kw(C,a))return!1}return!0}var $o=class{constructor(r,n){this.type=Ut,this.geojson=r,this.geometries=n}static parse(r,n){if(r.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Uh(r[1])){let u=r[1];if(u.type==="FeatureCollection")for(let p=0;p<u.features.length;++p){let a=u.features[p].geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new $o(u,u.features[p].geometry)}else if(u.type==="Feature"){let p=u.geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new $o(u,u.geometry)}else if(u.type==="Polygon"||u.type==="MultiPolygon")return new $o(u,u)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return Pw(r,this.geometries);if(r.geometryType()==="LineString")return Mw(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};function Jh(o){if(o instanceof rn){if(o.name==="get"&&o.args.length===1)return!1;if(o.name==="feature-state")return!1;if(o.name==="has"&&o.args.length===1)return!1;if(o.name==="properties"||o.name==="geometry-type"||o.name==="id")return!1;if(/^filter-/.test(o.name))return!1}if(o instanceof $o)return!1;let r=!0;return o.eachChild(n=>{r&&!Jh(n)&&(r=!1)}),r}function Zu(o){if(o instanceof rn&&o.name==="feature-state")return!1;let r=!0;return o.eachChild(n=>{r&&!Zu(n)&&(r=!1)}),r}function Yh(o,r){if(o instanceof rn&&r.indexOf(o.name)>=0)return!1;let n=!0;return o.eachChild(u=>{n&&!Yh(u,r)&&(n=!1)}),n}var el=class{constructor(r,n){this.type=n.type,this.name=r,this.boundExpression=n}static parse(r,n){if(r.length!==2||typeof r[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");let u=r[1];return n.scope.has(u)?new el(u,n.scope.get(u)):n.error(`Unknown variable "${u}". Make sure "${u}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(r){return this.boundExpression.evaluate(r)}eachChild(){}outputDefined(){return!1}},tl=class{constructor(r,n=[],u,p=new Vu,a=[]){this.registry=r,this.path=n,this.key=n.map(x=>`[${x}]`).join(""),this.scope=p,this.errors=a,this.expectedType=u}parse(r,n,u,p,a={}){return n?this.concat(n,u,p)._parse(r,a):this._parse(r,a)}_parse(r,n){(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number")&&(r=["literal",r]);function u(p,a,x){return x==="assert"?new xn(a,[p]):x==="coerce"?new xo(a,[p]):p}if(Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let p=r[0];if(typeof p!="string")return this.error(`Expression name must be a string, but found ${typeof p} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[p];if(a){let x=a.parse(r,this);if(!x)return null;if(this.expectedType){let C=this.expectedType,D=x.type;if((C.kind==="string"||C.kind==="number"||C.kind==="boolean"||C.kind==="object"||C.kind==="array")&&D.kind==="value")x=u(x,C,n.typeAnnotation||"assert");else if((C.kind==="color"||C.kind==="formatted"||C.kind==="resolvedImage")&&(D.kind==="value"||D.kind==="string"))x=u(x,C,n.typeAnnotation||"coerce");else if(C.kind==="padding"&&(D.kind==="value"||D.kind==="number"||D.kind==="array"))x=u(x,C,n.typeAnnotation||"coerce");else if(this.checkSubtype(C,D))return null}if(!(x instanceof ms)&&x.type.kind!=="resolvedImage"&&vf(x)){let C=new $h;try{x=new ms(x.type,x.evaluate(C))}catch(D){return this.error(D.message),null}}return x}return this.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof r>"u"?this.error("'undefined' value invalid. Use null instead."):typeof r=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof r} instead.`)}concat(r,n,u){let p=typeof r=="number"?this.path.concat(r):this.path,a=u?this.scope.concat(u):this.scope;return new tl(this.registry,p,n||null,a,this.errors)}error(r,...n){let u=`${this.key}${n.map(p=>`[${p}]`).join("")}`;this.errors.push(new Fn(u,r))}checkSubtype(r,n){let u=Uu(r,n);return u&&this.error(u),u}};function vf(o){if(o instanceof el)return vf(o.boundExpression);if(o instanceof rn&&o.name==="error")return!1;if(o instanceof Qa)return!1;if(o instanceof $o)return!1;let r=o instanceof xo||o instanceof xn,n=!0;return o.eachChild(u=>{r?n=n&&vf(u):n=n&&u instanceof ms}),n?Jh(o)&&Yh(o,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Qh(o,r){let n=o.length-1,u=0,p=n,a=0,x,C;for(;u<=p;)if(a=Math.floor((u+p)/2),x=o[a],C=o[a+1],x<=r){if(a===n||r<C)return a;u=a+1}else if(x>r)p=a-1;else throw new oi("Input is not a number.");return 0}var rl=class{constructor(r,n,u){this.type=r,this.input=n,this.labels=[],this.outputs=[];for(let[p,a]of u)this.labels.push(p),this.outputs.push(a)}static parse(r,n){if(r.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!==0)return n.error("Expected an even number of arguments.");let u=n.parse(r[1],1,tt);if(!u)return null;let p=[],a=null;n.expectedType&&n.expectedType.kind!=="value"&&(a=n.expectedType);for(let x=1;x<r.length;x+=2){let C=x===1?-1/0:r[x],D=r[x+1],R=x,I=x+1;if(typeof C!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',R);if(p.length&&p[p.length-1][0]>=C)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',R);let ee=n.parse(D,I,a);if(!ee)return null;a=a||ee.type,p.push([C,ee])}return new rl(a,u,p)}evaluate(r){let n=this.labels,u=this.outputs;if(n.length===1)return u[0].evaluate(r);let p=this.input.evaluate(r);if(p<=n[0])return u[0].evaluate(r);let a=n.length;if(p>=n[a-1])return u[a-1].evaluate(r);let x=Qh(n,p);return u[x].evaluate(r)}eachChild(r){r(this.input);for(let n of this.outputs)r(n)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}},zw=Kg;function Kg(o,r,n,u){this.cx=3*o,this.bx=3*(n-o)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(u-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=o,this.p1y=r,this.p2x=n,this.p2y=u}Kg.prototype={sampleCurveX:function(o){return((this.ax*o+this.bx)*o+this.cx)*o},sampleCurveY:function(o){return((this.ay*o+this.by)*o+this.cy)*o},sampleCurveDerivativeX:function(o){return(3*this.ax*o+2*this.bx)*o+this.cx},solveCurveX:function(o,r){if(r===void 0&&(r=1e-6),o<0)return 0;if(o>1)return 1;for(var n=o,u=0;u<8;u++){var p=this.sampleCurveX(n)-o;if(Math.abs(p)<r)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-p/a}var x=0,C=1;for(n=o,u=0;u<20&&(p=this.sampleCurveX(n),!(Math.abs(p-o)<r));u++)o>p?x=n:C=n,n=(C-x)*.5+x;return n},solve:function(o,r){return this.sampleCurveY(this.solveCurveX(o,r))}};function ki(o,r,n){return o*(1-n)+r*n}function Ow(o,r,n){return new zr(ki(o.r,r.r,n),ki(o.g,r.g,n),ki(o.b,r.b,n),ki(o.a,r.a,n))}function Dw(o,r,n){return o.map((u,p)=>ki(u,r[p],n))}function Fw(o,r,n){let u=o.values,p=r.values;return new Wi([ki(u[0],p[0],n),ki(u[1],p[1],n),ki(u[2],p[2],n),ki(u[3],p[3],n)])}var Wg=Object.freeze({__proto__:null,number:ki,color:Ow,array:Dw,padding:Fw}),Xg=.95047,Hg=1,Jg=1.08883,Yg=4/29,Ha=6/29,Qg=3*Ha*Ha,Rw=Ha*Ha*Ha,Lw=Math.PI/180,Bw=180/Math.PI;function lf(o){return o>Rw?Math.pow(o,1/3):o/Qg+Yg}function uf(o){return o>Ha?o*o*o:Qg*(o-Yg)}function cf(o){return 255*(o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055)}function hf(o){return o/=255,o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}function e0(o){let r=hf(o.r),n=hf(o.g),u=hf(o.b),p=lf((.4124564*r+.3575761*n+.1804375*u)/Xg),a=lf((.2126729*r+.7151522*n+.072175*u)/Hg),x=lf((.0193339*r+.119192*n+.9503041*u)/Jg);return{l:116*a-16,a:500*(p-a),b:200*(a-x),alpha:o.a}}function t0(o){let r=(o.l+16)/116,n=isNaN(o.a)?r:r+o.a/500,u=isNaN(o.b)?r:r-o.b/200;return r=Hg*uf(r),n=Xg*uf(n),u=Jg*uf(u),new zr(cf(3.2404542*n-1.5371385*r-.4985314*u),cf(-.969266*n+1.8760108*r+.041556*u),cf(.0556434*n-.2040259*r+1.0572252*u),o.alpha)}function Nw(o,r,n){return{l:ki(o.l,r.l,n),a:ki(o.a,r.a,n),b:ki(o.b,r.b,n),alpha:ki(o.alpha,r.alpha,n)}}function jw(o){let{l:r,a:n,b:u}=e0(o),p=Math.atan2(u,n)*Bw;return{h:p<0?p+360:p,c:Math.sqrt(n*n+u*u),l:r,alpha:o.a}}function Vw(o){let r=o.h*Lw,n=o.c,u=o.l;return t0({l:u,a:Math.cos(r)*n,b:Math.sin(r)*n,alpha:o.alpha})}function Uw(o,r,n){let u=r-o;return o+n*(u>180||u<-180?u-360*Math.round(u/360):u)}function $w(o,r,n){return{h:Uw(o.h,r.h,n),c:ki(o.c,r.c,n),l:ki(o.l,r.l,n),alpha:ki(o.alpha,r.alpha,n)}}var Ru={forward:e0,reverse:t0,interpolate:Nw},Lu={forward:jw,reverse:Vw,interpolate:$w},r0=Object.freeze({__proto__:null,lab:Ru,hcl:Lu}),nn=class{constructor(r,n,u,p,a){this.type=r,this.operator=n,this.interpolation=u,this.input=p,this.labels=[],this.outputs=[];for(let[x,C]of a)this.labels.push(x),this.outputs.push(C)}static interpolationFactor(r,n,u,p){let a=0;if(r.name==="exponential")a=pf(n,r.base,u,p);else if(r.name==="linear")a=pf(n,1,u,p);else if(r.name==="cubic-bezier"){let x=r.controlPoints;a=new zw(x[0],x[1],x[2],x[3]).solve(pf(n,1,u,p))}return a}static parse(r,n){let[u,p,a,...x]=r;if(!Array.isArray(p)||p.length===0)return n.error("Expected an interpolation type expression.",1);if(p[0]==="linear")p={name:"linear"};else if(p[0]==="exponential"){let R=p[1];if(typeof R!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);p={name:"exponential",base:R}}else if(p[0]==="cubic-bezier"){let R=p.slice(1);if(R.length!==4||R.some(I=>typeof I!="number"||I<0||I>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);p={name:"cubic-bezier",controlPoints:R}}else return n.error(`Unknown interpolation type ${String(p[0])}`,1,0);if(r.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!==0)return n.error("Expected an even number of arguments.");if(a=n.parse(a,2,tt),!a)return null;let C=[],D=null;u==="interpolate-hcl"||u==="interpolate-lab"?D=Uo:n.expectedType&&n.expectedType.kind!=="value"&&(D=n.expectedType);for(let R=0;R<x.length;R+=2){let I=x[R],ee=x[R+1],le=R+3,_e=R+4;if(typeof I!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',le);if(C.length&&C[C.length-1][0]>=I)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',le);let $e=n.parse(ee,_e,D);if(!$e)return null;D=D||$e.type,C.push([I,$e])}return D.kind!=="number"&&D.kind!=="color"&&D.kind!=="padding"&&!(D.kind==="array"&&D.itemType.kind==="number"&&typeof D.N=="number")?n.error(`Type ${Ur(D)} is not interpolatable.`):new nn(D,u,p,a,C)}evaluate(r){let n=this.labels,u=this.outputs;if(n.length===1)return u[0].evaluate(r);let p=this.input.evaluate(r);if(p<=n[0])return u[0].evaluate(r);let a=n.length;if(p>=n[a-1])return u[a-1].evaluate(r);let x=Qh(n,p),C=n[x],D=n[x+1],R=nn.interpolationFactor(this.interpolation,p,C,D),I=u[x].evaluate(r),ee=u[x+1].evaluate(r);return this.operator==="interpolate"?Wg[this.type.kind.toLowerCase()](I,ee,R):this.operator==="interpolate-hcl"?Lu.reverse(Lu.interpolate(Lu.forward(I),Lu.forward(ee),R)):Ru.reverse(Ru.interpolate(Ru.forward(I),Ru.forward(ee),R))}eachChild(r){r(this.input);for(let n of this.outputs)r(n)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}};function pf(o,r,n,u){let p=u-n,a=o-n;return p===0?0:r===1?a/p:(Math.pow(r,a)-1)/(Math.pow(r,p)-1)}var oa=class{constructor(r,n){this.type=r,this.args=n}static parse(r,n){if(r.length<2)return n.error("Expectected at least one argument.");let u=null,p=n.expectedType;p&&p.kind!=="value"&&(u=p);let a=[];for(let C of r.slice(1)){let D=n.parse(C,1+a.length,u,void 0,{typeAnnotation:"omit"});if(!D)return null;u=u||D.type,a.push(D)}return to.exports(u),p&&a.some(C=>Uu(p,C.type))?new oa($t,a):new oa(u,a)}evaluate(r){let n=null,u=0,p;for(let a of this.args)if(u++,n=a.evaluate(r),n&&n instanceof ro&&!n.available&&(p||(p=n.name),n=null,u===this.args.length&&(n=p)),n!==null)break;return n}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},il=class{constructor(r,n){this.type=n.type,this.bindings=[].concat(r),this.result=n}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(let n of this.bindings)r(n[1]);r(this.result)}static parse(r,n){if(r.length<4)return n.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);let u=[];for(let a=1;a<r.length-1;a+=2){let x=r[a];if(typeof x!="string")return n.error(`Expected string, but found ${typeof x} instead.`,a);if(/[^a-zA-Z0-9_]/.test(x))return n.error("Variable names must contain only alphanumeric characters or '_'.",a);let C=n.parse(r[a+1],a+1);if(!C)return null;u.push([x,C])}let p=n.parse(r[r.length-1],r.length-1,n.expectedType,u);return p?new il(u,p):null}outputDefined(){return this.result.outputDefined()}},Ku=class{constructor(r,n,u){this.type=r,this.index=n,this.input=u}static parse(r,n){if(r.length!==3)return n.error(`Expected 2 arguments, but found ${r.length-1} instead.`);let u=n.parse(r[1],1,tt),p=n.parse(r[2],2,Rn(n.expectedType||$t));if(!u||!p)return null;let a=p.type;return new Ku(a.itemType,u,p)}evaluate(r){let n=this.index.evaluate(r),u=this.input.evaluate(r);if(n<0)throw new oi(`Array index out of bounds: ${n} < 0.`);if(n>=u.length)throw new oi(`Array index out of bounds: ${n} > ${u.length-1}.`);if(n!==Math.floor(n))throw new oi(`Array index must be an integer, but found ${n} instead.`);return u[n]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}},Wu=class{constructor(r,n){this.type=Ut,this.needle=r,this.haystack=n}static parse(r,n){if(r.length!==3)return n.error(`Expected 2 arguments, but found ${r.length-1} instead.`);let u=n.parse(r[1],1,$t),p=n.parse(r[2],2,$t);return!u||!p?null:wf(u.type,[Ut,Xt,tt,Wh,$t])?new Wu(u,p):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ur(u.type)} instead`)}evaluate(r){let n=this.needle.evaluate(r),u=this.haystack.evaluate(r);if(!u)return!1;if(!$u(n,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${Ur(ci(n))} instead.`);if(!$u(u,["string","array"]))throw new oi(`Expected second argument to be of type array or string, but found ${Ur(ci(u))} instead.`);return u.indexOf(n)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}},nl=class{constructor(r,n,u){this.type=tt,this.needle=r,this.haystack=n,this.fromIndex=u}static parse(r,n){if(r.length<=2||r.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);let u=n.parse(r[1],1,$t),p=n.parse(r[2],2,$t);if(!u||!p)return null;if(!wf(u.type,[Ut,Xt,tt,Wh,$t]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ur(u.type)} instead`);if(r.length===4){let a=n.parse(r[3],3,tt);return a?new nl(u,p,a):null}else return new nl(u,p)}evaluate(r){let n=this.needle.evaluate(r),u=this.haystack.evaluate(r);if(!$u(n,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${Ur(ci(n))} instead.`);if(!$u(u,["string","array"]))throw new oi(`Expected second argument to be of type array or string, but found ${Ur(ci(u))} instead.`);if(this.fromIndex){let p=this.fromIndex.evaluate(r);return u.indexOf(n,p)}return u.indexOf(n)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}},Xu=class{constructor(r,n,u,p,a,x){this.inputType=r,this.type=n,this.input=u,this.cases=p,this.outputs=a,this.otherwise=x}static parse(r,n){if(r.length<5)return n.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!==1)return n.error("Expected an even number of arguments.");let u,p;n.expectedType&&n.expectedType.kind!=="value"&&(p=n.expectedType);let a={},x=[];for(let R=2;R<r.length-1;R+=2){let I=r[R],ee=r[R+1];Array.isArray(I)||(I=[I]);let le=n.concat(R);if(I.length===0)return le.error("Expected at least one branch label.");for(let $e of I){if(typeof $e!="number"&&typeof $e!="string")return le.error("Branch labels must be numbers or strings.");if(typeof $e=="number"&&Math.abs($e)>Number.MAX_SAFE_INTEGER)return le.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof $e=="number"&&Math.floor($e)!==$e)return le.error("Numeric branch labels must be integer values.");if(!u)u=ci($e);else if(le.checkSubtype(u,ci($e)))return null;if(typeof a[String($e)]<"u")return le.error("Branch labels must be unique.");a[String($e)]=x.length}let _e=n.parse(ee,R,p);if(!_e)return null;p=p||_e.type,x.push(_e)}let C=n.parse(r[1],1,$t);if(!C)return null;let D=n.parse(r[r.length-1],r.length-1,p);return!D||(to.exports(u&&p),C.type.kind!=="value"&&n.concat(1).checkSubtype(u,C.type))?null:new Xu(u,p,C,a,x,D)}evaluate(r){let n=this.input.evaluate(r);return(ci(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}},Hu=class{constructor(r,n,u){this.type=r,this.branches=n,this.otherwise=u}static parse(r,n){if(r.length<4)return n.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!==0)return n.error("Expected an odd number of arguments.");let u;n.expectedType&&n.expectedType.kind!=="value"&&(u=n.expectedType);let p=[];for(let x=1;x<r.length-1;x+=2){let C=n.parse(r[x],x,Ut);if(!C)return null;let D=n.parse(r[x+1],x+1,u);if(!D)return null;p.push([C,D]),u=u||D.type}let a=n.parse(r[r.length-1],r.length-1,u);return a?(to.exports(u),new Hu(u,p,a)):null}evaluate(r){for(let[n,u]of this.branches)if(n.evaluate(r))return u.evaluate(r);return this.otherwise.evaluate(r)}eachChild(r){for(let[n,u]of this.branches)r(n),r(u);r(this.otherwise)}outputDefined(){return this.branches.every(([r,n])=>n.outputDefined())&&this.otherwise.outputDefined()}},ol=class{constructor(r,n,u,p){this.type=r,this.input=n,this.beginIndex=u,this.endIndex=p}static parse(r,n){if(r.length<=2||r.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);let u=n.parse(r[1],1,$t),p=n.parse(r[2],2,tt);if(!u||!p)return null;if(!wf(u.type,[Rn($t),Xt,$t]))return n.error(`Expected first argument to be of type array or string, but found ${Ur(u.type)} instead`);if(r.length===4){let a=n.parse(r[3],3,tt);return a?new ol(u.type,u,p,a):null}else return new ol(u.type,u,p)}evaluate(r){let n=this.input.evaluate(r),u=this.beginIndex.evaluate(r);if(!$u(n,["string","array"]))throw new oi(`Expected first argument to be of type array or string, but found ${Ur(ci(n))} instead.`);if(this.endIndex){let p=this.endIndex.evaluate(r);return n.slice(u,p)}return n.slice(u)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}};function Pg(o,r){return o==="=="||o==="!="?r.kind==="boolean"||r.kind==="string"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function qw(o,r,n){return r===n}function Gw(o,r,n){return r!==n}function Zw(o,r,n){return r<n}function Kw(o,r,n){return r>n}function Ww(o,r,n){return r<=n}function Xw(o,r,n){return r>=n}function i0(o,r,n,u){return u.compare(r,n)===0}function Hw(o,r,n,u){return!i0(o,r,n,u)}function Jw(o,r,n,u){return u.compare(r,n)<0}function Yw(o,r,n,u){return u.compare(r,n)>0}function Qw(o,r,n,u){return u.compare(r,n)<=0}function e2(o,r,n,u){return u.compare(r,n)>=0}function ul(o,r,n){let u=o!=="=="&&o!=="!=";return class n0{constructor(a,x,C){this.type=Ut,this.lhs=a,this.rhs=x,this.collator=C,this.hasUntypedArgument=a.type.kind==="value"||x.type.kind==="value"}static parse(a,x){if(a.length!==3&&a.length!==4)return x.error("Expected two or three arguments.");let C=a[0],D=x.parse(a[1],1,$t);if(!D)return null;if(!Pg(C,D.type))return x.concat(1).error(`"${C}" comparisons are not supported for type '${Ur(D.type)}'.`);let R=x.parse(a[2],2,$t);if(!R)return null;if(!Pg(C,R.type))return x.concat(2).error(`"${C}" comparisons are not supported for type '${Ur(R.type)}'.`);if(D.type.kind!==R.type.kind&&D.type.kind!=="value"&&R.type.kind!=="value")return x.error(`Cannot compare types '${Ur(D.type)}' and '${Ur(R.type)}'.`);u&&(D.type.kind==="value"&&R.type.kind!=="value"?D=new xn(R.type,[D]):D.type.kind!=="value"&&R.type.kind==="value"&&(R=new xn(D.type,[R])));let I=null;if(a.length===4){if(D.type.kind!=="string"&&R.type.kind!=="string"&&D.type.kind!=="value"&&R.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(I=x.parse(a[3],3,Xh),!I)return null}return new n0(D,R,I)}evaluate(a){let x=this.lhs.evaluate(a),C=this.rhs.evaluate(a);if(u&&this.hasUntypedArgument){let D=ci(x),R=ci(C);if(D.kind!==R.kind||!(D.kind==="string"||D.kind==="number"))throw new oi(`Expected arguments for "${o}" to be (string, string) or (number, number), but found (${D.kind}, ${R.kind}) instead.`)}if(this.collator&&!u&&this.hasUntypedArgument){let D=ci(x),R=ci(C);if(D.kind!=="string"||R.kind!=="string")return r(a,x,C)}return this.collator?n(a,x,C,this.collator.evaluate(a)):r(a,x,C)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var t2=ul("==",qw,i0),r2=ul("!=",Gw,Hw),i2=ul("<",Zw,Jw),n2=ul(">",Kw,Yw),o2=ul("<=",Ww,Qw),s2=ul(">=",Xw,e2),Ju=class{constructor(r,n,u,p,a){this.type=Xt,this.number=r,this.locale=n,this.currency=u,this.minFractionDigits=p,this.maxFractionDigits=a}static parse(r,n){if(r.length!==3)return n.error("Expected two arguments.");let u=n.parse(r[1],1,tt);if(!u)return null;let p=r[2];if(typeof p!="object"||Array.isArray(p))return n.error("NumberFormat options argument must be an object.");let a=null;if(p.locale&&(a=n.parse(p.locale,1,Xt),!a))return null;let x=null;if(p.currency&&(x=n.parse(p.currency,1,Xt),!x))return null;let C=null;if(p["min-fraction-digits"]&&(C=n.parse(p["min-fraction-digits"],1,tt),!C))return null;let D=null;return p["max-fraction-digits"]&&(D=n.parse(p["max-fraction-digits"],1,tt),!D)?null:new Ju(u,a,x,C,D)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}},Yu=class{constructor(r){this.type=Hh,this.sections=r}static parse(r,n){if(r.length<2)return n.error("Expected at least one argument.");let u=r[1];if(!Array.isArray(u)&&typeof u=="object")return n.error("First argument must be an image or text section.");let p=[],a=!1;for(let x=1;x<=r.length-1;++x){let C=r[x];if(a&&typeof C=="object"&&!Array.isArray(C)){a=!1;let D=null;if(C["font-scale"]&&(D=n.parse(C["font-scale"],1,tt),!D))return null;let R=null;if(C["text-font"]&&(R=n.parse(C["text-font"],1,Rn(Xt)),!R))return null;let I=null;if(C["text-color"]&&(I=n.parse(C["text-color"],1,Uo),!I))return null;let ee=p[p.length-1];ee.scale=D,ee.font=R,ee.textColor=I}else{let D=n.parse(r[x],1,$t);if(!D)return null;let R=D.type.kind;if(R!=="string"&&R!=="value"&&R!=="null"&&R!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,p.push({content:D,scale:null,font:null,textColor:null})}}return new Yu(p)}evaluate(r){let n=u=>{let p=u.content.evaluate(r);return ci(p)===sc?new Gu("",p,null,null,null):new Gu(Nu(p),null,u.scale?u.scale.evaluate(r):null,u.font?u.font.evaluate(r).join(","):null,u.textColor?u.textColor.evaluate(r):null)};return new Bn(this.sections.map(n))}eachChild(r){for(let n of this.sections)r(n.content),n.scale&&r(n.scale),n.font&&r(n.font),n.textColor&&r(n.textColor)}outputDefined(){return!1}},Qu=class{constructor(r){this.type=sc,this.input=r}static parse(r,n){if(r.length!==2)return n.error("Expected two arguments.");let u=n.parse(r[1],1,Xt);return u?new Qu(u):n.error("No image name provided.")}evaluate(r){let n=this.input.evaluate(r),u=ro.fromString(n);return u&&r.availableImages&&(u.available=r.availableImages.indexOf(n)>-1),u}eachChild(r){r(this.input)}outputDefined(){return!1}},ec=class{constructor(r){this.type=tt,this.input=r}static parse(r,n){if(r.length!==2)return n.error(`Expected 1 argument, but found ${r.length-1} instead.`);let u=n.parse(r[1],1);return u?u.type.kind!=="array"&&u.type.kind!=="string"&&u.type.kind!=="value"?n.error(`Expected argument of type string or array, but found ${Ur(u.type)} instead.`):new ec(u):null}evaluate(r){let n=this.input.evaluate(r);if(typeof n=="string")return n.length;if(Array.isArray(n))return n.length;throw new oi(`Expected value to be of type string or array, but found ${Ur(ci(n))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}},Af={"==":t2,"!=":r2,">":n2,"<":i2,">=":s2,"<=":o2,array:xn,at:Ku,boolean:xn,case:Hu,coalesce:oa,collator:Qa,format:Yu,image:Qu,in:Wu,"index-of":nl,interpolate:nn,"interpolate-hcl":nn,"interpolate-lab":nn,length:ec,let:il,literal:ms,match:Xu,number:xn,"number-format":Ju,object:xn,slice:ol,step:rl,string:xn,"to-boolean":xo,"to-color":xo,"to-number":xo,"to-string":xo,var:el,within:$o};function Mg(o,[r,n,u,p]){r=r.evaluate(o),n=n.evaluate(o),u=u.evaluate(o);let a=p?p.evaluate(o):1,x=$g(r,n,u,a);if(x)throw new oi(x);return new zr(r/255*a,n/255*a,u/255*a,a)}function zg(o,r){return o in r}function df(o,r){let n=r[o];return typeof n>"u"?null:n}function a2(o,r,n,u){for(;n<=u;){let p=n+u>>1;if(r[p]===o)return!0;r[p]>o?u=p-1:n=p+1}return!1}function na(o){return{type:o}}rn.register(Af,{error:[dw,[Xt],(o,[r])=>{throw new oi(r.evaluate(o))}],typeof:[Xt,[$t],(o,[r])=>Ur(ci(r.evaluate(o)))],"to-rgba":[Rn(tt,4),[Uo],(o,[r])=>r.evaluate(o).toArray()],rgb:[Uo,[tt,tt,tt],Mg],rgba:[Uo,[tt,tt,tt,tt],Mg],has:{type:Ut,overloads:[[[Xt],(o,[r])=>zg(r.evaluate(o),o.properties())],[[Xt,Xa],(o,[r,n])=>zg(r.evaluate(o),n.evaluate(o))]]},get:{type:$t,overloads:[[[Xt],(o,[r])=>df(r.evaluate(o),o.properties())],[[Xt,Xa],(o,[r,n])=>df(r.evaluate(o),n.evaluate(o))]]},"feature-state":[$t,[Xt],(o,[r])=>df(r.evaluate(o),o.featureState||{})],properties:[Xa,[],o=>o.properties()],"geometry-type":[Xt,[],o=>o.geometryType()],id:[$t,[],o=>o.id()],zoom:[tt,[],o=>o.globals.zoom],"heatmap-density":[tt,[],o=>o.globals.heatmapDensity||0],"line-progress":[tt,[],o=>o.globals.lineProgress||0],accumulated:[$t,[],o=>o.globals.accumulated===void 0?null:o.globals.accumulated],"+":[tt,na(tt),(o,r)=>{let n=0;for(let u of r)n+=u.evaluate(o);return n}],"*":[tt,na(tt),(o,r)=>{let n=1;for(let u of r)n*=u.evaluate(o);return n}],"-":{type:tt,overloads:[[[tt,tt],(o,[r,n])=>r.evaluate(o)-n.evaluate(o)],[[tt],(o,[r])=>-r.evaluate(o)]]},"/":[tt,[tt,tt],(o,[r,n])=>r.evaluate(o)/n.evaluate(o)],"%":[tt,[tt,tt],(o,[r,n])=>r.evaluate(o)%n.evaluate(o)],ln2:[tt,[],()=>Math.LN2],pi:[tt,[],()=>Math.PI],e:[tt,[],()=>Math.E],"^":[tt,[tt,tt],(o,[r,n])=>Math.pow(r.evaluate(o),n.evaluate(o))],sqrt:[tt,[tt],(o,[r])=>Math.sqrt(r.evaluate(o))],log10:[tt,[tt],(o,[r])=>Math.log(r.evaluate(o))/Math.LN10],ln:[tt,[tt],(o,[r])=>Math.log(r.evaluate(o))],log2:[tt,[tt],(o,[r])=>Math.log(r.evaluate(o))/Math.LN2],sin:[tt,[tt],(o,[r])=>Math.sin(r.evaluate(o))],cos:[tt,[tt],(o,[r])=>Math.cos(r.evaluate(o))],tan:[tt,[tt],(o,[r])=>Math.tan(r.evaluate(o))],asin:[tt,[tt],(o,[r])=>Math.asin(r.evaluate(o))],acos:[tt,[tt],(o,[r])=>Math.acos(r.evaluate(o))],atan:[tt,[tt],(o,[r])=>Math.atan(r.evaluate(o))],min:[tt,na(tt),(o,r)=>Math.min(...r.map(n=>n.evaluate(o)))],max:[tt,na(tt),(o,r)=>Math.max(...r.map(n=>n.evaluate(o)))],abs:[tt,[tt],(o,[r])=>Math.abs(r.evaluate(o))],round:[tt,[tt],(o,[r])=>{let n=r.evaluate(o);return n<0?-Math.round(-n):Math.round(n)}],floor:[tt,[tt],(o,[r])=>Math.floor(r.evaluate(o))],ceil:[tt,[tt],(o,[r])=>Math.ceil(r.evaluate(o))],"filter-==":[Ut,[Xt,$t],(o,[r,n])=>o.properties()[r.value]===n.value],"filter-id-==":[Ut,[$t],(o,[r])=>o.id()===r.value],"filter-type-==":[Ut,[Xt],(o,[r])=>o.geometryType()===r.value],"filter-<":[Ut,[Xt,$t],(o,[r,n])=>{let u=o.properties()[r.value],p=n.value;return typeof u==typeof p&&u<p}],"filter-id-<":[Ut,[$t],(o,[r])=>{let n=o.id(),u=r.value;return typeof n==typeof u&&n<u}],"filter->":[Ut,[Xt,$t],(o,[r,n])=>{let u=o.properties()[r.value],p=n.value;return typeof u==typeof p&&u>p}],"filter-id->":[Ut,[$t],(o,[r])=>{let n=o.id(),u=r.value;return typeof n==typeof u&&n>u}],"filter-<=":[Ut,[Xt,$t],(o,[r,n])=>{let u=o.properties()[r.value],p=n.value;return typeof u==typeof p&&u<=p}],"filter-id-<=":[Ut,[$t],(o,[r])=>{let n=o.id(),u=r.value;return typeof n==typeof u&&n<=u}],"filter->=":[Ut,[Xt,$t],(o,[r,n])=>{let u=o.properties()[r.value],p=n.value;return typeof u==typeof p&&u>=p}],"filter-id->=":[Ut,[$t],(o,[r])=>{let n=o.id(),u=r.value;return typeof n==typeof u&&n>=u}],"filter-has":[Ut,[$t],(o,[r])=>r.value in o.properties()],"filter-has-id":[Ut,[],o=>o.id()!==null&&o.id()!==void 0],"filter-type-in":[Ut,[Rn(Xt)],(o,[r])=>r.value.indexOf(o.geometryType())>=0],"filter-id-in":[Ut,[Rn($t)],(o,[r])=>r.value.indexOf(o.id())>=0],"filter-in-small":[Ut,[Xt,Rn($t)],(o,[r,n])=>n.value.indexOf(o.properties()[r.value])>=0],"filter-in-large":[Ut,[Xt,Rn($t)],(o,[r,n])=>a2(o.properties()[r.value],n.value,0,n.value.length-1)],all:{type:Ut,overloads:[[[Ut,Ut],(o,[r,n])=>r.evaluate(o)&&n.evaluate(o)],[na(Ut),(o,r)=>{for(let n of r)if(!n.evaluate(o))return!1;return!0}]]},any:{type:Ut,overloads:[[[Ut,Ut],(o,[r,n])=>r.evaluate(o)||n.evaluate(o)],[na(Ut),(o,r)=>{for(let n of r)if(n.evaluate(o))return!0;return!1}]]},"!":[Ut,[Ut],(o,[r])=>!r.evaluate(o)],"is-supported-script":[Ut,[Xt],(o,[r])=>{let n=o.globals&&o.globals.isSupportedScript;return n?n(r.evaluate(o)):!0}],upcase:[Xt,[Xt],(o,[r])=>r.evaluate(o).toUpperCase()],downcase:[Xt,[Xt],(o,[r])=>r.evaluate(o).toLowerCase()],concat:[Xt,na($t),(o,r)=>r.map(n=>Nu(n.evaluate(o))).join("")],"resolved-locale":[Xt,[Xh],(o,[r])=>r.evaluate(o).resolvedLocale()]});function bf(o){return{result:"success",value:o}}function Ka(o){return{result:"error",value:o}}function Gh(o){return o["property-type"]==="data-driven"||o["property-type"]==="cross-faded-data-driven"}function o0(o){return!!o.expression&&o.expression.parameters.indexOf("zoom")>-1}function kf(o){return!!o.expression&&o.expression.interpolated}function _r(o){return o instanceof Number?"number":o instanceof String?"string":o instanceof Boolean?"boolean":Array.isArray(o)?"array":o===null?"null":typeof o}function ep(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function l2(o){return o}function s0(o,r){let n=r.type==="color",u=o.stops&&typeof o.stops[0][0]=="object",p=u||o.property!==void 0,a=u||!p,x=o.type||(kf(r)?"exponential":"interval");if(n||r.type==="padding"){let I=n?zr.parse:Wi.parse;o=Ya({},o),o.stops&&(o.stops=o.stops.map(ee=>[ee[0],I(ee[1])])),o.default?o.default=I(o.default):o.default=I(r.default)}if(o.colorSpace&&o.colorSpace!=="rgb"&&!r0[o.colorSpace])throw new Error(`Unknown color space: ${o.colorSpace}`);let C,D,R;if(x==="exponential")C=Og;else if(x==="interval")C=c2;else if(x==="categorical"){C=u2,D=Object.create(null);for(let I of o.stops)D[I[0]]=I[1];R=typeof o.stops[0][0]}else if(x==="identity")C=h2;else throw new Error(`Unknown function type "${x}"`);if(u){let I={},ee=[];for(let $e=0;$e<o.stops.length;$e++){let Oe=o.stops[$e],De=Oe[0].zoom;I[De]===void 0&&(I[De]={zoom:De,type:o.type,property:o.property,default:o.default,stops:[]},ee.push(De)),I[De].stops.push([Oe[0].value,Oe[1]])}let le=[];for(let $e of ee)le.push([I[$e].zoom,s0(I[$e],r)]);let _e={name:"linear"};return{kind:"composite",interpolationType:_e,interpolationFactor:nn.interpolationFactor.bind(void 0,_e),zoomStops:le.map($e=>$e[0]),evaluate({zoom:$e},Oe){return Og({stops:le,base:o.base},r,$e).evaluate($e,Oe)}}}else if(a){let I=x==="exponential"?{name:"exponential",base:o.base!==void 0?o.base:1}:null;return{kind:"camera",interpolationType:I,interpolationFactor:nn.interpolationFactor.bind(void 0,I),zoomStops:o.stops.map(ee=>ee[0]),evaluate:({zoom:ee})=>C(o,r,ee,D,R)}}else return{kind:"source",evaluate(I,ee){let le=ee&&ee.properties?ee.properties[o.property]:void 0;return le===void 0?ac(o.default,r.default):C(o,r,le,D,R)}}}function ac(o,r,n){if(o!==void 0)return o;if(r!==void 0)return r;if(n!==void 0)return n}function u2(o,r,n,u,p){let a=typeof n===p?u[n]:void 0;return ac(a,o.default,r.default)}function c2(o,r,n){if(_r(n)!=="number")return ac(o.default,r.default);let u=o.stops.length;if(u===1||n<=o.stops[0][0])return o.stops[0][1];if(n>=o.stops[u-1][0])return o.stops[u-1][1];let p=Qh(o.stops.map(a=>a[0]),n);return o.stops[p][1]}function Og(o,r,n){let u=o.base!==void 0?o.base:1;if(_r(n)!=="number")return ac(o.default,r.default);let p=o.stops.length;if(p===1||n<=o.stops[0][0])return o.stops[0][1];if(n>=o.stops[p-1][0])return o.stops[p-1][1];let a=Qh(o.stops.map(I=>I[0]),n),x=p2(n,u,o.stops[a][0],o.stops[a+1][0]),C=o.stops[a][1],D=o.stops[a+1][1],R=Wg[r.type]||l2;if(o.colorSpace&&o.colorSpace!=="rgb"){let I=r0[o.colorSpace];R=(ee,le)=>I.reverse(I.interpolate(I.forward(ee),I.forward(le),x))}return typeof C.evaluate=="function"?{evaluate(...I){let ee=C.evaluate.apply(void 0,I),le=D.evaluate.apply(void 0,I);if(!(ee===void 0||le===void 0))return R(ee,le,x)}}:R(C,D,x)}function h2(o,r,n){switch(r.type){case"color":n=zr.parse(n);break;case"formatted":n=Bn.fromString(n.toString());break;case"resolvedImage":n=ro.fromString(n.toString());break;case"padding":n=Wi.parse(n);break;default:_r(n)!==r.type&&(r.type!=="enum"||!r.values[n])&&(n=void 0)}return ac(n,o.default,r.default)}function p2(o,r,n,u){let p=u-n,a=o-n;return p===0?0:r===1?a/p:(Math.pow(r,a)-1)/(Math.pow(r,p)-1)}var Zh=class{constructor(r,n){this.expression=r,this._warningHistory={},this._evaluator=new $h,this._defaultValue=n?m2(n):null,this._enumValues=n&&n.type==="enum"?n.values:null}evaluateWithoutErrorHandling(r,n,u,p,a,x){return this._evaluator.globals=r,this._evaluator.feature=n,this._evaluator.featureState=u,this._evaluator.canonical=p,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(r,n,u,p,a,x){this._evaluator.globals=r,this._evaluator.feature=n||null,this._evaluator.featureState=u||null,this._evaluator.canonical=p,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=x||null;try{let C=this.expression.evaluate(this._evaluator);if(C==null||typeof C=="number"&&C!==C)return this._defaultValue;if(this._enumValues&&!(C in this._enumValues))throw new oi(`Expected value to be one of ${Object.keys(this._enumValues).map(D=>JSON.stringify(D)).join(", ")}, but found ${JSON.stringify(C)} instead.`);return C}catch(C){return this._warningHistory[C.message]||(this._warningHistory[C.message]=!0,typeof console<"u"&&console.warn(C.message)),this._defaultValue}}};function tp(o){return Array.isArray(o)&&o.length>0&&typeof o[0]=="string"&&o[0]in Af}function If(o,r){let n=new tl(Af,[],r?f2(r):void 0),u=n.parse(o,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return u?bf(new Zh(u,r)):(to.exports(n.errors.length>0),Ka(n.errors))}var tc=class{constructor(r,n){this.kind=r,this._styleExpression=n,this.isStateDependent=r!=="constant"&&!Zu(n.expression)}evaluateWithoutErrorHandling(r,n,u,p,a,x){return this._styleExpression.evaluateWithoutErrorHandling(r,n,u,p,a,x)}evaluate(r,n,u,p,a,x){return this._styleExpression.evaluate(r,n,u,p,a,x)}},rc=class{constructor(r,n,u,p){this.kind=r,this.zoomStops=u,this._styleExpression=n,this.isStateDependent=r!=="camera"&&!Zu(n.expression),this.interpolationType=p}evaluateWithoutErrorHandling(r,n,u,p,a,x){return this._styleExpression.evaluateWithoutErrorHandling(r,n,u,p,a,x)}evaluate(r,n,u,p,a,x){return this._styleExpression.evaluate(r,n,u,p,a,x)}interpolationFactor(r,n,u){return this.interpolationType?nn.interpolationFactor(this.interpolationType,r,n,u):0}};function Pf(o,r){let n=If(o,r);if(n.result==="error")return n;let u=n.value.expression,p=Jh(u);if(!p&&!Gh(r))return Ka([new Fn("","data expressions not supported")]);let a=Yh(u,["zoom"]);if(!a&&!o0(r))return Ka([new Fn("","zoom expressions not supported")]);let x=Vh(u);if(!x&&!a)return Ka([new Fn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(x instanceof Fn)return Ka([x]);if(x instanceof nn&&!kf(r))return Ka([new Fn("",'"interpolate" expressions cannot be used with this property')]);if(!x)return bf(p?new tc("constant",n.value):new tc("source",n.value));let C=x instanceof nn?x.interpolation:void 0;return bf(p?new rc("camera",n.value,x.labels,C):new rc("composite",n.value,x.labels,C))}var sl=class{constructor(r,n){this._parameters=r,this._specification=n,Ya(this,s0(this._parameters,this._specification))}static deserialize(r){return new sl(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}};function d2(o,r){if(ep(o))return new sl(o,r);if(tp(o)){let n=Pf(o,r);if(n.result==="error")throw new Error(n.value.map(u=>`${u.key}: ${u.message}`).join(", "));return n.value}else{let n=o;return r.type==="color"&&typeof o=="string"?n=zr.parse(o):r.type==="padding"&&(typeof o=="number"||Array.isArray(o))&&(n=Wi.parse(o)),{kind:"constant",evaluate:()=>n}}}function Vh(o){let r=null;if(o instanceof il)r=Vh(o.result);else if(o instanceof oa){for(let n of o.args)if(r=Vh(n),r)break}else(o instanceof rl||o instanceof nn)&&o.input instanceof rn&&o.input.name==="zoom"&&(r=o);return r instanceof Fn||o.eachChild(n=>{let u=Vh(n);u instanceof Fn?r=u:!r&&u?r=new Fn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&u&&r!==u&&(r=new Fn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function f2(o){let r={color:Uo,string:Xt,number:tt,enum:Xt,boolean:Ut,formatted:Hh,padding:xf,resolvedImage:sc};return o.type==="array"?Rn(r[o.value]||$t,o.length):r[o.type]}function m2(o){return o.type==="color"&&ep(o.default)?new zr(0,0,0,0):o.type==="color"?zr.parse(o.default)||null:o.type==="padding"?Wi.parse(o.default)||null:o.default===void 0?null:o.default}function Mf(o){if(o===!0||o===!1)return!0;if(!Array.isArray(o)||o.length===0)return!1;switch(o[0]){case"has":return o.length>=2&&o[1]!=="$id"&&o[1]!=="$type";case"in":return o.length>=3&&(typeof o[1]!="string"||Array.isArray(o[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return o.length!==3||Array.isArray(o[1])||Array.isArray(o[2]);case"any":case"all":for(let r of o.slice(1))if(!Mf(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}var it=class{constructor(r,n,u,p){this.message=(r?`${r}: `:"")+u,p&&(this.identifier=p),n!=null&&n.__line__&&(this.line=n.__line__)}};function a0(o){let r=o.key,n=o.value;return n?[new it(r,n,"constants have been deprecated as of v8")]:[]}function Jr(o){return o instanceof Number||o instanceof String||o instanceof Boolean?o.valueOf():o}function sa(o){if(Array.isArray(o))return o.map(sa);if(o instanceof Object&&!(o instanceof Number||o instanceof String||o instanceof Boolean)){let r={};for(let n in o)r[n]=sa(o[n]);return r}return Jr(o)}function eo(o){let r=o.key,n=o.value,u=o.valueSpec||{},p=o.objectElementValidators||{},a=o.style,x=o.styleSpec,C=[],D=_r(n);if(D!=="object")return[new it(r,n,`object expected, ${D} found`)];for(let R in n){let I=R.split(".")[0],ee=u[I]||u["*"],le;if(p[I])le=p[I];else if(u[I])le=wn;else if(p["*"])le=p["*"];else if(u["*"])le=wn;else{C.push(new it(r,n[R],`unknown property "${R}"`));continue}C=C.concat(le({key:(r&&`${r}.`)+R,value:n[R],valueSpec:ee,style:a,styleSpec:x,object:n,objectKey:R},n))}for(let R in u)p[R]||u[R].required&&u[R].default===void 0&&n[R]===void 0&&C.push(new it(r,n,`missing required property "${R}"`));return C}function l0(o){let r=o.value,n=o.valueSpec,u=o.style,p=o.styleSpec,a=o.key,x=o.arrayElementValidator||wn;if(_r(r)!=="array")return[new it(a,r,`array expected, ${_r(r)} found`)];if(n.length&&r.length!==n.length)return[new it(a,r,`array length ${n.length} expected, length ${r.length} found`)];if(n["min-length"]&&r.length<n["min-length"])return[new it(a,r,`array length at least ${n["min-length"]} expected, length ${r.length} found`)];let C={type:n.value,values:n.values};p.$version<7&&(C.function=n.function),_r(n.value)==="object"&&(C=n.value);let D=[];for(let R=0;R<r.length;R++)D=D.concat(x({array:r,arrayIndex:R,value:r[R],valueSpec:C,style:u,styleSpec:p,key:`${a}[${R}]`}));return D}function zf(o){let r=o.key,n=o.value,u=o.valueSpec,p=_r(n);return p==="number"&&n!==n&&(p="NaN"),p!=="number"?[new it(r,n,`number expected, ${p} found`)]:"minimum"in u&&n<u.minimum?[new it(r,n,`${n} is less than the minimum value ${u.minimum}`)]:"maximum"in u&&n>u.maximum?[new it(r,n,`${n} is greater than the maximum value ${u.maximum}`)]:[]}function u0(o){let r=o.valueSpec,n=Jr(o.value.type),u,p={},a,x,C=n!=="categorical"&&o.value.property===void 0,D=!C,R=_r(o.value.stops)==="array"&&_r(o.value.stops[0])==="array"&&_r(o.value.stops[0][0])==="object",I=eo({key:o.key,value:o.value,valueSpec:o.styleSpec.function,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{stops:ee,default:$e}});return n==="identity"&&C&&I.push(new it(o.key,o.value,'missing required property "property"')),n!=="identity"&&!o.value.stops&&I.push(new it(o.key,o.value,'missing required property "stops"')),n==="exponential"&&o.valueSpec.expression&&!kf(o.valueSpec)&&I.push(new it(o.key,o.value,"exponential functions not supported")),o.styleSpec.$version>=8&&(D&&!Gh(o.valueSpec)?I.push(new it(o.key,o.value,"property functions not supported")):C&&!o0(o.valueSpec)&&I.push(new it(o.key,o.value,"zoom functions not supported"))),(n==="categorical"||R)&&o.value.property===void 0&&I.push(new it(o.key,o.value,'"property" property is required')),I;function ee(Oe){if(n==="identity")return[new it(Oe.key,Oe.value,'identity function may not have a "stops" property')];let De=[],fe=Oe.value;return De=De.concat(l0({key:Oe.key,value:fe,valueSpec:Oe.valueSpec,style:Oe.style,styleSpec:Oe.styleSpec,arrayElementValidator:le})),_r(fe)==="array"&&fe.length===0&&De.push(new it(Oe.key,fe,"array must have at least one stop")),De}function le(Oe){let De=[],fe=Oe.value,ve=Oe.key;if(_r(fe)!=="array")return[new it(ve,fe,`array expected, ${_r(fe)} found`)];if(fe.length!==2)return[new it(ve,fe,`array length 2 expected, length ${fe.length} found`)];if(R){if(_r(fe[0])!=="object")return[new it(ve,fe,`object expected, ${_r(fe[0])} found`)];if(fe[0].zoom===void 0)return[new it(ve,fe,"object stop key must have zoom")];if(fe[0].value===void 0)return[new it(ve,fe,"object stop key must have value")];if(x&&x>Jr(fe[0].zoom))return[new it(ve,fe[0].zoom,"stop zoom values must appear in ascending order")];Jr(fe[0].zoom)!==x&&(x=Jr(fe[0].zoom),a=void 0,p={}),De=De.concat(eo({key:`${ve}[0]`,value:fe[0],valueSpec:{zoom:{}},style:Oe.style,styleSpec:Oe.styleSpec,objectElementValidators:{zoom:zf,value:_e}}))}else De=De.concat(_e({key:`${ve}[0]`,value:fe[0],valueSpec:{},style:Oe.style,styleSpec:Oe.styleSpec},fe));return tp(sa(fe[1]))?De.concat([new it(`${ve}[1]`,fe[1],"expressions are not allowed in function stops.")]):De.concat(wn({key:`${ve}[1]`,value:fe[1],valueSpec:r,style:Oe.style,styleSpec:Oe.styleSpec}))}function _e(Oe,De){let fe=_r(Oe.value),ve=Jr(Oe.value),Ie=Oe.value!==null?Oe.value:De;if(!u)u=fe;else if(fe!==u)return[new it(Oe.key,Ie,`${fe} stop domain type must match previous stop domain type ${u}`)];if(fe!=="number"&&fe!=="string"&&fe!=="boolean")return[new it(Oe.key,Ie,"stop domain value must be a number, string, or boolean")];if(fe!=="number"&&n!=="categorical"){let We=`number expected, ${fe} found`;return Gh(r)&&n===void 0&&(We+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new it(Oe.key,Ie,We)]}return n==="categorical"&&fe==="number"&&(!isFinite(ve)||Math.floor(ve)!==ve)?[new it(Oe.key,Ie,`integer expected, found ${ve}`)]:n!=="categorical"&&fe==="number"&&a!==void 0&&ve<a?[new it(Oe.key,Ie,"stop domain values must appear in ascending order")]:(a=ve,n==="categorical"&&ve in p?[new it(Oe.key,Ie,"stop domain values must be unique")]:(p[ve]=!0,[]))}function $e(Oe){return wn({key:Oe.key,value:Oe.value,valueSpec:r,style:Oe.style,styleSpec:Oe.styleSpec})}}function al(o){let r=(o.expressionContext==="property"?Pf:If)(sa(o.value),o.valueSpec);if(r.result==="error")return r.value.map(u=>new it(`${o.key}${u.key}`,o.value,u.message));let n=r.value.expression||r.value._styleExpression.expression;if(o.expressionContext==="property"&&o.propertyKey==="text-font"&&!n.outputDefined())return[new it(o.key,o.value,`Invalid data expression for "${o.propertyKey}". Output values must be contained as literals within the expression.`)];if(o.expressionContext==="property"&&o.propertyType==="layout"&&!Zu(n))return[new it(o.key,o.value,'"feature-state" data expressions are not supported with layout properties.')];if(o.expressionContext==="filter"&&!Zu(n))return[new it(o.key,o.value,'"feature-state" data expressions are not supported with filters.')];if(o.expressionContext&&o.expressionContext.indexOf("cluster")===0){if(!Yh(n,["zoom","feature-state"]))return[new it(o.key,o.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(o.expressionContext==="cluster-initial"&&!Jh(n))return[new it(o.key,o.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function y2(o){let r=o.value,n=o.key,u=_r(r);return u!=="boolean"?[new it(n,r,`boolean expected, ${u} found`)]:[]}function g2(o){let r=o.key,n=o.value,u=_r(n);return u!=="string"?[new it(r,n,`color expected, ${u} found`)]:Ef(n)===null?[new it(r,n,`color expected, "${n}" found`)]:[]}function Kh(o){let r=o.key,n=o.value,u=o.valueSpec,p=[];return Array.isArray(u.values)?u.values.indexOf(Jr(n))===-1&&p.push(new it(r,n,`expected one of [${u.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(u.values).indexOf(Jr(n))===-1&&p.push(new it(r,n,`expected one of [${Object.keys(u.values).join(", ")}], ${JSON.stringify(n)} found`)),p}function Of(o){return Mf(sa(o.value))?al(Ya({},o,{expressionContext:"filter",valueSpec:{value:"boolean"}})):c0(o)}function c0(o){let r=o.value,n=o.key;if(_r(r)!=="array")return[new it(n,r,`array expected, ${_r(r)} found`)];let u=o.styleSpec,p,a=[];if(r.length<1)return[new it(n,r,"filter array must have at least 1 element")];switch(a=a.concat(Kh({key:`${n}[0]`,value:r[0],valueSpec:u.filter_operator,style:o.style,styleSpec:o.styleSpec})),Jr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&Jr(r[1])==="$type"&&a.push(new it(n,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&a.push(new it(n,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(p=_r(r[1]),p!=="string"&&a.push(new it(`${n}[1]`,r[1],`string expected, ${p} found`)));for(let x=2;x<r.length;x++)p=_r(r[x]),Jr(r[1])==="$type"?a=a.concat(Kh({key:`${n}[${x}]`,value:r[x],valueSpec:u.geometry_type,style:o.style,styleSpec:o.styleSpec})):p!=="string"&&p!=="number"&&p!=="boolean"&&a.push(new it(`${n}[${x}]`,r[x],`string, number, or boolean expected, ${p} found`));break;case"any":case"all":case"none":for(let x=1;x<r.length;x++)a=a.concat(c0({key:`${n}[${x}]`,value:r[x],style:o.style,styleSpec:o.styleSpec}));break;case"has":case"!has":p=_r(r[1]),r.length!==2?a.push(new it(n,r,`filter array for "${r[0]}" operator must have 2 elements`)):p!=="string"&&a.push(new it(`${n}[1]`,r[1],`string expected, ${p} found`));break;case"within":p=_r(r[1]),r.length!==2?a.push(new it(n,r,`filter array for "${r[0]}" operator must have 2 elements`)):p!=="object"&&a.push(new it(`${n}[1]`,r[1],`object expected, ${p} found`));break}return a}function h0(o,r){let n=o.key,u=o.style,p=o.styleSpec,a=o.value,x=o.objectKey,C=p[`${r}_${o.layerType}`];if(!C)return[];let D=x.match(/^(.*)-transition$/);if(r==="paint"&&D&&C[D[1]]&&C[D[1]].transition)return wn({key:n,value:a,valueSpec:p.transition,style:u,styleSpec:p});let R=o.valueSpec||C[x];if(!R)return[new it(n,a,`unknown property "${x}"`)];let I;if(_r(a)==="string"&&Gh(R)&&!R.tokens&&(I=/^{([^}]+)}$/.exec(a)))return[new it(n,a,`"${x}" does not support interpolation syntax
613
- Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(I[1])} }\`.`)];let ee=[];return o.layerType==="symbol"&&(x==="text-field"&&u&&!u.glyphs&&ee.push(new it(n,a,'use of "text-field" requires a style "glyphs" property')),x==="text-font"&&ep(sa(a))&&Jr(a.type)==="identity"&&ee.push(new it(n,a,'"text-font" does not support identity functions'))),ee.concat(wn({key:o.key,value:a,valueSpec:R,style:u,styleSpec:p,expressionContext:"property",propertyType:r,propertyKey:x}))}function p0(o){return h0(o,"paint")}function d0(o){return h0(o,"layout")}function f0(o){let r=[],n=o.value,u=o.key,p=o.style,a=o.styleSpec;!n.type&&!n.ref&&r.push(new it(u,n,'either "type" or "ref" is required'));let x=Jr(n.type),C=Jr(n.ref);if(n.id){let D=Jr(n.id);for(let R=0;R<o.arrayIndex;R++){let I=p.layers[R];Jr(I.id)===D&&r.push(new it(u,n.id,`duplicate layer id "${n.id}", previously used at line ${I.id.__line__}`))}}if("ref"in n){["type","source","source-layer","filter","layout"].forEach(R=>{R in n&&r.push(new it(u,n[R],`"${R}" is prohibited for ref layers`))});let D;p.layers.forEach(R=>{Jr(R.id)===C&&(D=R)}),D?D.ref?r.push(new it(u,n.ref,"ref cannot reference another ref layer")):x=Jr(D.type):r.push(new it(u,n.ref,`ref layer "${C}" not found`))}else if(x!=="background")if(!n.source)r.push(new it(u,n,'missing required property "source"'));else{let D=p.sources&&p.sources[n.source],R=D&&Jr(D.type);D?R==="vector"&&x==="raster"?r.push(new it(u,n.source,`layer "${n.id}" requires a raster source`)):R==="raster"&&x!=="raster"?r.push(new it(u,n.source,`layer "${n.id}" requires a vector source`)):R==="vector"&&!n["source-layer"]?r.push(new it(u,n,`layer "${n.id}" must specify a "source-layer"`)):R==="raster-dem"&&x!=="hillshade"?r.push(new it(u,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):x==="line"&&n.paint&&n.paint["line-gradient"]&&(R!=="geojson"||!D.lineMetrics)&&r.push(new it(u,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new it(u,n.source,`source "${n.source}" not found`))}return r=r.concat(eo({key:u,value:n,valueSpec:a.layer,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{"*"(){return[]},type(){return wn({key:`${u}.type`,value:n.type,valueSpec:a.layer.type,style:o.style,styleSpec:o.styleSpec,object:n,objectKey:"type"})},filter:Of,layout(D){return eo({layer:n,key:D.key,value:D.value,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{"*"(R){return d0(Ya({layerType:x},R))}}})},paint(D){return eo({layer:n,key:D.key,value:D.value,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{"*"(R){return p0(Ya({layerType:x},R))}}})}}})),r}function ll(o){let r=o.value,n=o.key,u=_r(r);return u!=="string"?[new it(n,r,`string expected, ${u} found`)]:[]}var Dg={promoteId:_2};function m0(o){let r=o.value,n=o.key,u=o.styleSpec,p=o.style;if(!r.type)return[new it(n,r,'"type" is required')];let a=Jr(r.type),x;switch(a){case"vector":case"raster":case"raster-dem":return x=eo({key:n,value:r,valueSpec:u[`source_${a.replace("-","_")}`],style:o.style,styleSpec:u,objectElementValidators:Dg}),x;case"geojson":if(x=eo({key:n,value:r,valueSpec:u.source_geojson,style:p,styleSpec:u,objectElementValidators:Dg}),r.cluster)for(let C in r.clusterProperties){let[D,R]=r.clusterProperties[C],I=typeof D=="string"?[D,["accumulated"],["get",C]]:D;x.push(...al({key:`${n}.${C}.map`,value:R,expressionContext:"cluster-map"})),x.push(...al({key:`${n}.${C}.reduce`,value:I,expressionContext:"cluster-reduce"}))}return x;case"video":return eo({key:n,value:r,valueSpec:u.source_video,style:p,styleSpec:u});case"image":return eo({key:n,value:r,valueSpec:u.source_image,style:p,styleSpec:u});case"canvas":return[new it(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Kh({key:`${n}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:p,styleSpec:u})}}function _2({key:o,value:r}){if(_r(r)==="string")return ll({key:o,value:r});{let n=[];for(let u in r)n.push(...ll({key:`${o}.${u}`,value:r[u]}));return n}}function y0(o){let r=o.value,n=o.styleSpec,u=n.light,p=o.style,a=[],x=_r(r);if(r===void 0)return a;if(x!=="object")return a=a.concat([new it("light",r,`object expected, ${x} found`)]),a;for(let C in r){let D=C.match(/^(.*)-transition$/);D&&u[D[1]]&&u[D[1]].transition?a=a.concat(wn({key:C,value:r[C],valueSpec:n.transition,style:p,styleSpec:n})):u[C]?a=a.concat(wn({key:C,value:r[C],valueSpec:u[C],style:p,styleSpec:n})):a=a.concat([new it(C,r[C],`unknown property "${C}"`)])}return a}function g0(o){let r=o.value,n=o.styleSpec,u=n.terrain,p=o.style,a=[],x=_r(r);if(r===void 0)return a;if(x!=="object")return a=a.concat([new it("terrain",r,`object expected, ${x} found`)]),a;for(let C in r)u[C]?a=a.concat(wn({key:C,value:r[C],valueSpec:u[C],style:p,styleSpec:n})):a=a.concat([new it(C,r[C],`unknown property "${C}"`)]);return a}function v2(o){return ll(o).length===0?[]:al(o)}function b2(o){return ll(o).length===0?[]:al(o)}function x2(o){let r=o.key,n=o.value;if(_r(n)==="array"){if(n.length<1||n.length>4)return[new it(r,n,`padding requires 1 to 4 values; ${n.length} values found`)];let p={type:"number"},a=[];for(let x=0;x<n.length;x++)a=a.concat(wn({key:`${r}[${x}]`,value:n[x],valueSpec:p}));return a}else return zf({key:r,value:n,valueSpec:{}})}var Fg={"*"(){return[]},array:l0,boolean:y2,number:zf,color:g2,constants:a0,enum:Kh,filter:Of,function:u0,layer:f0,object:eo,source:m0,light:y0,terrain:g0,string:ll,formatted:v2,resolvedImage:b2,padding:x2};function wn(o){let r=o.value,n=o.valueSpec,u=o.styleSpec;return n.expression&&ep(Jr(r))?u0(o):n.expression&&tp(sa(r))?al(o):n.type&&Fg[n.type]?Fg[n.type](o):eo(Ya({},o,{valueSpec:n.type?u[n.type]:n}))}function w2(o){let r=o.value,n=o.key,u=ll(o);return u.length||(r.indexOf("{fontstack}")===-1&&u.push(new it(n,r,'"glyphs" url must include a "{fontstack}" token')),r.indexOf("{range}")===-1&&u.push(new it(n,r,'"glyphs" url must include a "{range}" token'))),u}function aa(o,r=ic){let n=[];return n=n.concat(wn({key:"",value:o,valueSpec:r.$root,styleSpec:r,style:o,objectElementValidators:{glyphs:w2,"*"(){return[]}}})),o.constants&&(n=n.concat(a0({key:"constants",value:o.constants,style:o,styleSpec:r}))),_0(n)}aa.source=la(m0);aa.light=la(y0);aa.terrain=la(g0);aa.layer=la(f0);aa.filter=la(Of);aa.paintProperty=la(p0);aa.layoutProperty=la(d0);function _0(o){return[].concat(o).sort((r,n)=>r.line-n.line)}function la(o){return function(...r){return _0(o.apply(this,r))}}function E2(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var S2={};(function(o){var r=function(){var n=function(De,fe,ve,Ie){for(ve=ve||{},Ie=De.length;Ie--;ve[De[Ie]]=fe);return ve},u=[1,12],p=[1,13],a=[1,9],x=[1,10],C=[1,11],D=[1,14],R=[1,15],I=[14,18,22,24],ee=[18,22],le=[22,24],_e={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(fe,ve,Ie,We,Pe,je,Bt){var vt=je.length-1;switch(Pe){case 1:this.$=new String(fe.replace(/\\(\\|")/g,"$1").replace(/\\n/g,`
614
- `).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(fe),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=je[vt-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=je[vt-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[je[vt-2],je[vt]];break;case 16:this.$={},this.$[je[vt][0]]=je[vt][1];break;case 17:this.$=je[vt-2],je[vt-2][je[vt][0]]=je[vt][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[je[vt]];break;case 21:this.$=je[vt-2],je[vt-2].push(je[vt]);break}},table:[{3:5,4:u,5:6,6:p,7:3,8:a,9:4,10:x,11:C,12:1,13:2,15:7,16:8,17:D,23:R},{1:[3]},{14:[1,16]},n(I,[2,7]),n(I,[2,8]),n(I,[2,9]),n(I,[2,10]),n(I,[2,11]),n(I,[2,12]),n(I,[2,3]),n(I,[2,4]),n(I,[2,5]),n([14,18,21,22,24],[2,1]),n(I,[2,2]),{3:20,4:u,18:[1,17],19:18,20:19},{3:5,4:u,5:6,6:p,7:3,8:a,9:4,10:x,11:C,13:23,15:7,16:8,17:D,23:R,24:[1,21],25:22},{1:[2,6]},n(I,[2,13]),{18:[1,24],22:[1,25]},n(ee,[2,16]),{21:[1,26]},n(I,[2,18]),{22:[1,28],24:[1,27]},n(le,[2,20]),n(I,[2,14]),{3:20,4:u,20:29},{3:5,4:u,5:6,6:p,7:3,8:a,9:4,10:x,11:C,13:30,15:7,16:8,17:D,23:R},n(I,[2,19]),{3:5,4:u,5:6,6:p,7:3,8:a,9:4,10:x,11:C,13:31,15:7,16:8,17:D,23:R},n(ee,[2,17]),n(ee,[2,15]),n(le,[2,21])],defaultActions:{16:[2,6]},parseError:function(fe,ve){if(ve.recoverable)this.trace(fe);else throw new Error(fe)},parse:function(fe){var ve=this,Ie=[0],We=[null],Pe=[],je=this.table,Bt="",vt=0,Qt=0,tr=2,Br=1,wr=Pe.slice.call(arguments,1),It=Object.create(this.lexer),st={yy:{}};for(var Or in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Or)&&(st.yy[Or]=this.yy[Or]);It.setInput(fe,st.yy),st.yy.lexer=It,st.yy.parser=this,typeof It.yylloc>"u"&&(It.yylloc={});var Er=It.yylloc;Pe.push(Er);var ye=It.options&&It.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Fe(){var or;return or=It.lex()||Br,typeof or!="number"&&(or=ve.symbols_[or]||or),or}for(var Ue,Be,He,ut,lt={},yt,wt,Nt,Dt;;){if(Be=Ie[Ie.length-1],this.defaultActions[Be]?He=this.defaultActions[Be]:((Ue===null||typeof Ue>"u")&&(Ue=Fe()),He=je[Be]&&je[Be][Ue]),typeof He>"u"||!He.length||!He[0]){var nr="";Dt=[];for(yt in je[Be])this.terminals_[yt]&&yt>tr&&Dt.push("'"+this.terminals_[yt]+"'");It.showPosition?nr="Parse error on line "+(vt+1)+`:
615
- `+It.showPosition()+`
616
- Expecting `+Dt.join(", ")+", got '"+(this.terminals_[Ue]||Ue)+"'":nr="Parse error on line "+(vt+1)+": Unexpected "+(Ue==Br?"end of input":"'"+(this.terminals_[Ue]||Ue)+"'"),this.parseError(nr,{text:It.match,token:this.terminals_[Ue]||Ue,line:It.yylineno,loc:Er,expected:Dt})}if(He[0]instanceof Array&&He.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Be+", token: "+Ue);switch(He[0]){case 1:Ie.push(Ue),We.push(It.yytext),Pe.push(It.yylloc),Ie.push(He[1]),Ue=null,Qt=It.yyleng,Bt=It.yytext,vt=It.yylineno,Er=It.yylloc;break;case 2:if(wt=this.productions_[He[1]][1],lt.$=We[We.length-wt],lt._$={first_line:Pe[Pe.length-(wt||1)].first_line,last_line:Pe[Pe.length-1].last_line,first_column:Pe[Pe.length-(wt||1)].first_column,last_column:Pe[Pe.length-1].last_column},ye&&(lt._$.range=[Pe[Pe.length-(wt||1)].range[0],Pe[Pe.length-1].range[1]]),ut=this.performAction.apply(lt,[Bt,Qt,vt,st.yy,He[1],We,Pe].concat(wr)),typeof ut<"u")return ut;wt&&(Ie=Ie.slice(0,-1*wt*2),We=We.slice(0,-1*wt),Pe=Pe.slice(0,-1*wt)),Ie.push(this.productions_[He[1]][0]),We.push(lt.$),Pe.push(lt._$),Nt=je[Ie[Ie.length-2]][Ie[Ie.length-1]],Ie.push(Nt);break;case 3:return!0}}return!0}},$e=function(){var De={EOF:1,parseError:function(ve,Ie){if(this.yy.parser)this.yy.parser.parseError(ve,Ie);else throw new Error(ve)},setInput:function(fe,ve){return this.yy=ve||this.yy||{},this._input=fe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var fe=this._input[0];this.yytext+=fe,this.yyleng++,this.offset++,this.match+=fe,this.matched+=fe;var ve=fe.match(/(?:\r\n?|\n).*/g);return ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),fe},unput:function(fe){var ve=fe.length,Ie=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ve),this.offset-=ve;var We=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Ie.length-1&&(this.yylineno-=Ie.length-1);var Pe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ie?(Ie.length===We.length?this.yylloc.first_column:0)+We[We.length-Ie.length].length-Ie[0].length:this.yylloc.first_column-ve},this.options.ranges&&(this.yylloc.range=[Pe[0],Pe[0]+this.yyleng-ve]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
617
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(fe){this.unput(this.match.slice(fe))},pastInput:function(){var fe=this.matched.substr(0,this.matched.length-this.match.length);return(fe.length>20?"...":"")+fe.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var fe=this.match;return fe.length<20&&(fe+=this._input.substr(0,20-fe.length)),(fe.substr(0,20)+(fe.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var fe=this.pastInput(),ve=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+`
618
- `+ve+"^"},test_match:function(fe,ve){var Ie,We,Pe;if(this.options.backtrack_lexer&&(Pe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Pe.yylloc.range=this.yylloc.range.slice(0))),We=fe[0].match(/(?:\r\n?|\n).*/g),We&&(this.yylineno+=We.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:We?We[We.length-1].length-We[We.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+fe[0].length},this.yytext+=fe[0],this.match+=fe[0],this.matches=fe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(fe[0].length),this.matched+=fe[0],Ie=this.performAction.call(this,this.yy,this,ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ie)return Ie;if(this._backtrack){for(var je in Pe)this[je]=Pe[je];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,ve,Ie,We;this._more||(this.yytext="",this.match="");for(var Pe=this._currentRules(),je=0;je<Pe.length;je++)if(Ie=this._input.match(this.rules[Pe[je]]),Ie&&(!ve||Ie[0].length>ve[0].length)){if(ve=Ie,We=je,this.options.backtrack_lexer){if(fe=this.test_match(Ie,Pe[je]),fe!==!1)return fe;if(this._backtrack){ve=!1;continue}else return!1}else if(!this.options.flex)break}return ve?(fe=this.test_match(ve,Pe[We]),fe!==!1?fe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
619
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var ve=this.next();return ve||this.lex()},begin:function(ve){this.conditionStack.push(ve)},popState:function(){var ve=this.conditionStack.length-1;return ve>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ve){return ve=this.conditionStack.length-1-Math.abs(ve||0),ve>=0?this.conditionStack[ve]:"INITIAL"},pushState:function(ve){this.begin(ve)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ve,Ie,We,Pe){switch(We){case 0:break;case 1:return 6;case 2:return Ie.yytext=Ie.yytext.substr(1,Ie.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return De}();_e.lexer=$e;function Oe(){this.yy={}}return Oe.prototype=_e,_e.Parser=Oe,new Oe}();typeof E2<"u"&&(o.parser=r,o.Parser=r.Parser,o.parse=function(){return r.parse.apply(r,arguments)})})(S2);var rp={StyleExpression:Zh,isExpression:tp,isExpressionFilter:Mf,createExpression:If,createPropertyExpression:Pf,normalizePropertyExpression:d2,ZoomConstantExpression:tc,ZoomDependentExpression:rc,StylePropertyFunction:sl};var Et=Yn(Ff());var Xi=Yn(Ff());function b0(o,r){let n=Xi.default.lazy(()=>Xi.default.seq(o,n).or(r));return n}function x0(o,r){let n=Xi.default.lazy(()=>r.chain(u=>Xi.default.seq(o,Xi.default.of(u),n).or(Xi.default.of(u))));return n}function w0(o,r){let n=Xi.default.lazy(()=>r.chain(u=>Xi.default.seqMap(o,Xi.default.of(u),n,Xi.default.string(":").trim(Xi.default.optWhitespace),n,(p,a,x,C,D)=>[p,["to-boolean",a],x,D]).or(Xi.default.of(u))));return n}function ys(o,r){return Xi.default.seqMap(r,Xi.default.seq(o,r).many(),(n,u)=>u.reduce((p,a)=>{let[x,C]=a;return[x,p,C]},n))}var ip=class{language;constructor(){this.language=this.createLanguage()}parseExpression(r){return this.language.Expr.parse(r)}parseProgram(r){return this.language.ProgramOrEmpty.parse(r)}createLanguage(){let r=[{type:b0,ops:this.operators({"-":"-","!":"!"})},{type:x0,ops:this.operators({"^":"**"})},{type:ys,ops:this.operators({"*":"*","/":"/","%":"%"})},{type:ys,ops:this.operators({"+":"+","-":"-"})},{type:ys,ops:this.operators({">=":">=","<=":"<="})},{type:ys,ops:this.operators({"<":"<",">":">"})},{type:ys,ops:this.operators({"==":"==","!=":"!="})},{type:ys,ops:this.operators({all:"&&"})},{type:ys,ops:this.operators({any:"||"})},{type:w0,ops:this.operators({case:"?"})}];return Et.default.createLanguage({Whitespace:()=>Et.default.regexp(/[ \n]*/).desc("whitespace"),NotNewline:()=>Et.default.regexp(/[^\n]*/).desc("non-newline"),LineComment:n=>n.NotNewline.wrap(Et.default.string("//"),Et.default.alt(Et.default.string(`
620
- `),Et.default.eof)),BlockComment:()=>Et.default.regexp(/\/\*[\s\S]*?\*\//),Comment:n=>Et.default.alt(n.LineComment,n.BlockComment).desc("comment"),End:()=>Et.default.alt(Et.default.string(";"),Et.default.eof),_:n=>n.Comment.sepBy(n.Whitespace).trim(n.Whitespace),Integer:()=>Et.default.regexp(/-?[0-9]+/).map(Number),Decimal:()=>Et.default.regexp(/-?[0-9]+\.[0-9]+/).map(Number),Number:n=>Et.default.alt(n.Decimal,n.Integer).desc("number"),Boolean:()=>Et.default.alt(Et.default.string("true"),Et.default.string("false")).map(n=>n==="true").desc("boolean"),Null:()=>Et.default.string("null").result(null).desc("null"),DoubleQuoteString:()=>Et.default.regexp(/"((?:\\.|.)*?)"/,1).desc("string"),SingleQuoteString:()=>Et.default.regexp(/'((?:\\.|.)*?)'/,1).desc("string"),UnquotedString:()=>Et.default.regexp(/[a-zA-Z_][a-zA-Z0-9_-]*/).desc("string"),HexColor:()=>Et.default.regexp(/#(?:[0-9a-f]{3}){1,2}/i).desc("hex color"),String:n=>Et.default.alt(n.SingleQuoteString,n.DoubleQuoteString,n.HexColor,n.UnquotedString).map(u=>u.replace(/\\n/gm,`
621
- `)),Symbol:()=>Et.default.regexp(/[a-zA-Z_][a-zA-Z0-9_-]*/).desc("symbol"),PartialSymbol:()=>Et.default.regexp(/[a-zA-Z0-9_-]+/).desc("symbol"),Feature:n=>Et.default.seqMap(Et.default.string("@"),n.PartialSymbol.sepBy(Et.default.string(".")),(u,p)=>["get"].concat(p)),FeatureState:n=>Et.default.seqMap(Et.default.string("@@"),n.PartialSymbol.sepBy(Et.default.string(".")),(u,p)=>this.expandFeatureState(p)),Array:n=>Et.default.string("[").trim(n._).then(n.Value.trim(n._).sepBy(Et.default.string(","))).skip(Et.default.string("]")),State:n=>Et.default.seqMap(Et.default.string("$"),n.PartialSymbol.sepBy(Et.default.string(".")),(u,p)=>["state"].concat(p)),Paren:n=>Et.default.seqMap(Et.default.string("("),n.Expr.trim(n._),Et.default.string(")"),(u,p,a)=>p),Func:n=>Et.default.seqMap(n.Symbol.trim(n._),Et.default.string("("),n.Expr.trim(n._).sepBy(Et.default.string(",")),Et.default.string(")"),(u,p,a,x)=>[u,...a]),Value:n=>Et.default.alt(n.Paren,n.Array,n.Func,n.Boolean,n.Null,n.Number,n.String,n.FeatureState,n.Feature,n.State),Expr:n=>this.tableParser(r,n.Value),PropertyName:()=>Et.default.regexp(/[a-zA-Z_-][a-zA-Z0-9_-]*/).desc("symbol"),Assignment:n=>Et.default.seqMap(n.PropertyName,Et.default.string(":").trim(n._),n.Expr.trim(n._).node("expr"),n.End,(u,p,a)=>[u,{expr:a.value,start:a.start,end:a.end}]),Program:n=>n.Assignment.trim(n._).many().map(u=>u.filter(p=>p!=="").reduce((p,a)=>(p[a[0]]=a[1],p),{})),EmptyProgram:n=>Et.default.seqMap(n._,Et.default.eof,()=>null),ProgramOrEmpty:n=>Et.default.alt(n.EmptyProgram,n.Program)})}operators(r){let u=Object.keys(r).sort().map(p=>Et.default.string(r[p]).trim(Et.default.optWhitespace).result(p));return Et.default.alt.apply(null,u)}tableParser(r,n){return r.reduce((u,p)=>p.type(p.ops,u),n)}expandFeatureState(r){let n=["feature-state",r.shift()];return r.forEach(u=>n=["get",u,n]),n}};var uc=o=>typeof o>"u",S0=o=>o===null,Nn=o=>uc(o)||S0(o),io=o=>!Nn(o),sn=o=>typeof o=="string",Lf=o=>io(o)&&o.length>0,gs=o=>sn(o)&&Lf(o),T0=o=>Array.isArray(o),Bf=o=>Array.isArray(o)&&Lf(o),lC=o=>Bf(o)&&o.every(r=>gs(r)),Rf=o=>typeof o=="object"&&!S0(o),Nf=o=>Rf(o)&&Lf(Object.keys(o)),T2=o=>typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o),uC=o=>o===!1,cC=o=>o===!0,C0=(o,r)=>Bf(r)&&r.some(n=>o===n),C2=o=>typeof o=="boolean",hC=o=>sn(o)&&/^[+-]?([0-9]*[.])?[0-9]+$/.test(o),A2=o=>o instanceof Date,E0=o=>gs(o)||T2(o)||C2(o)||A2(o),pC=o=>Bf(o)?o.every(r=>E0(r)):E0(o),dC=o=>typeof o=="function";function fC(o){let r,n;return Rf(o)?(r=o.constructor,r===void 0?!0:(n=r.prototype,!(Rf(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1))):!1}var k2=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function cc(o){return sn(o)&&!!k2.test(o)}function ar(o){for(var r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];if(!1)var p;throw new Error(typeof o=="number"?"[MobX] minified error nr: "+o+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+o)}var I2={};function $0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:I2}var P2=Object.assign,lp=Object.getOwnPropertyDescriptor,qo=Object.defineProperty,yc=Object.prototype,$f=[];Object.freeze($f);var Xf={};Object.freeze(Xf);var M2=typeof Proxy<"u",z2=Object.toString();function q0(){M2||ar("Proxy not available")}function G0(o){var r=!1;return function(){if(!r)return r=!0,o.apply(this,arguments)}}var pl=function(){};function $n(o){return typeof o=="function"}function ha(o){var r=typeof o;switch(r){case"string":case"symbol":case"number":return!0}return!1}function yp(o){return o!==null&&typeof o=="object"}function xs(o){if(!yp(o))return!1;var r=Object.getPrototypeOf(o);if(r==null)return!0;var n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return typeof n=="function"&&n.toString()===z2}function Z0(o){var r=o?.constructor;return r?r.name==="GeneratorFunction"||r.displayName==="GeneratorFunction":!1}function gp(o,r,n){qo(o,r,{enumerable:!1,writable:!0,configurable:!0,value:n})}function K0(o,r,n){qo(o,r,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ws(o,r){var n="isMobX"+o;return r.prototype[n]=!0,function(u){return yp(u)&&u[n]===!0}}function vl(o){return o instanceof Map}function gc(o){return o instanceof Set}var W0=typeof Object.getOwnPropertySymbols<"u";function O2(o){var r=Object.keys(o);if(!W0)return r;var n=Object.getOwnPropertySymbols(o);return n.length?[].concat(r,n.filter(function(u){return yc.propertyIsEnumerable.call(o,u)})):r}var _p=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:W0?function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:Object.getOwnPropertyNames;function X0(o){return o===null?null:typeof o=="object"?""+o:o}function Go(o,r){return yc.hasOwnProperty.call(o,r)}var D2=Object.getOwnPropertyDescriptors||function(r){var n={};return _p(r).forEach(function(u){n[u]=lp(r,u)}),n};function A0(o,r){for(var n=0;n<r.length;n++){var u=r[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function Hf(o,r,n){return r&&A0(o.prototype,r),n&&A0(o,n),Object.defineProperty(o,"prototype",{writable:!1}),o}function fl(){return fl=Object.assign||function(o){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(o[u]=n[u])}return o},fl.apply(this,arguments)}function H0(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,qf(o,r)}function qf(o,r){return qf=Object.setPrototypeOf||function(u,p){return u.__proto__=p,u},qf(o,r)}function k0(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function F2(o,r){if(!!o){if(typeof o=="string")return I0(o,r);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I0(o,r)}}function I0(o,r){(r==null||r>o.length)&&(r=o.length);for(var n=0,u=new Array(r);n<r;n++)u[n]=o[n];return u}function dl(o,r){var n=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(n)return(n=n.call(o)).next.bind(n);if(Array.isArray(o)||(n=F2(o))||r&&o&&typeof o.length=="number"){n&&(o=n);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
622
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var wo=Symbol("mobx-stored-annotations");function Eo(o){function r(n,u){_c(n,u,o)}return Object.assign(r,o)}function _c(o,r,n){if(Go(o,wo)||gp(o,wo,fl({},o[wo])),!1)var u;R2(o,n,r),G2(n)||(o[wo][r]=n)}function R2(o,r,n){if(!1)var u,p,a}function L2(o){return Go(o,wo)||gp(o,wo,fl({},o[wo])),o[wo]}var zt=Symbol("mobx administration"),vc=function(){function o(n){n===void 0&&(n="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=fr.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var r=o.prototype;return r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(u){return u()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(u){return u()})},r.reportObserved=function(){return m_(this)},r.reportChanged=function(){En(),y_(this),Sn()},r.toString=function(){return this.name_},o}(),Jf=ws("Atom",vc);function Yf(o,r,n){r===void 0&&(r=pl),n===void 0&&(n=pl);var u=new vc(o);return r!==pl&&Ec(u,r),n!==pl&&da(u,n),u}function B2(o,r){return o===r}function N2(o,r){return am(o,r)}function j2(o,r){return am(o,r,1)}function V2(o,r){return Object.is?Object.is(o,r):o===r?o!==0||1/o===1/r:o!==o&&r!==r}var ml={identity:B2,structural:N2,default:V2,shallow:j2};function yl(o,r,n){return im(o)?o:Array.isArray(o)?Ot.array(o,{name:n}):xs(o)?Ot.object(o,void 0,{name:n}):vl(o)?Ot.map(o,{name:n}):gc(o)?Ot.set(o,{name:n}):typeof o=="function"&&!xp(o)&&!dp(o)?Z0(o)?fc(o):dc(n,o):o}function U2(o,r,n){if(o==null||To(o)||Ss(o)||so(o)||Ts(o))return o;if(Array.isArray(o))return Ot.array(o,{name:n,deep:!1});if(xs(o))return Ot.object(o,void 0,{name:n,deep:!1});if(vl(o))return Ot.map(o,{name:n,deep:!1});if(gc(o))return Ot.set(o,{name:n,deep:!1})}function vp(o){return o}function $2(o,r){return am(o,r)?r:o}var q2="override";function G2(o){return o.annotationType_===q2}function bc(o,r){return{annotationType_:o,options_:r,make_:Z2,extend_:K2}}function Z2(o,r,n,u){var p;if((p=this.options_)!=null&&p.bound)return this.extend_(o,r,n,!1)===null?0:1;if(u===o.target_)return this.extend_(o,r,n,!1)===null?0:2;if(xp(n.value))return 1;var a=J0(o,this,r,n,!1);return qo(u,r,a),2}function K2(o,r,n,u){var p=J0(o,this,r,n);return o.defineProperty_(r,p,u)}function W2(o,r,n,u){var p=r.annotationType_,a=u.value}function J0(o,r,n,u,p){var a,x,C,D,R,I,ee;p===void 0&&(p=pt.safeDescriptors),W2(o,r,n,u);var le=u.value;if((a=r.options_)!=null&&a.bound){var _e;le=le.bind((_e=o.proxy_)!=null?_e:o.target_)}return{value:gl((x=(C=r.options_)==null?void 0:C.name)!=null?x:n.toString(),le,(D=(R=r.options_)==null?void 0:R.autoAction)!=null?D:!1,(I=r.options_)!=null&&I.bound?(ee=o.proxy_)!=null?ee:o.target_:void 0),configurable:p?o.isPlainObject_:!0,enumerable:!1,writable:!p}}function Y0(o,r){return{annotationType_:o,options_:r,make_:X2,extend_:H2}}function X2(o,r,n,u){var p;if(u===o.target_)return this.extend_(o,r,n,!1)===null?0:2;if((p=this.options_)!=null&&p.bound&&(!Go(o.target_,r)||!dp(o.target_[r]))&&this.extend_(o,r,n,!1)===null)return 0;if(dp(n.value))return 1;var a=Q0(o,this,r,n,!1,!1);return qo(u,r,a),2}function H2(o,r,n,u){var p,a=Q0(o,this,r,n,(p=this.options_)==null?void 0:p.bound);return o.defineProperty_(r,a,u)}function J2(o,r,n,u){var p=r.annotationType_,a=u.value}function Q0(o,r,n,u,p,a){a===void 0&&(a=pt.safeDescriptors),J2(o,r,n,u);var x=u.value;if(dp(x)||(x=fc(x)),p){var C;x=x.bind((C=o.proxy_)!=null?C:o.target_),x.isMobXFlow=!0}return{value:x,configurable:a?o.isPlainObject_:!0,enumerable:!1,writable:!a}}function Qf(o,r){return{annotationType_:o,options_:r,make_:Y2,extend_:Q2}}function Y2(o,r,n){return this.extend_(o,r,n,!1)===null?0:1}function Q2(o,r,n,u){return eE(o,this,r,n),o.defineComputedProperty_(r,fl({},this.options_,{get:n.get,set:n.set}),u)}function eE(o,r,n,u){var p=r.annotationType_,a=u.get}function bp(o,r){return{annotationType_:o,options_:r,make_:tE,extend_:rE}}function tE(o,r,n){return this.extend_(o,r,n,!1)===null?0:1}function rE(o,r,n,u){var p,a;return iE(o,this,r,n),o.defineObservableProperty_(r,n.value,(p=(a=this.options_)==null?void 0:a.enhancer)!=null?p:yl,u)}function iE(o,r,n,u){var p=r.annotationType_}var nE="true",oE=e_();function e_(o){return{annotationType_:nE,options_:o,make_:sE,extend_:aE}}function sE(o,r,n,u){var p,a;if(n.get)return Yr.make_(o,r,n,u);if(n.set){var x=gl(r.toString(),n.set);return u===o.target_?o.defineProperty_(r,{configurable:pt.safeDescriptors?o.isPlainObject_:!0,set:x})===null?0:2:(qo(u,r,{configurable:!0,set:x}),2)}if(u!==o.target_&&typeof n.value=="function"){var C;if(Z0(n.value)){var D,R=(D=this.options_)!=null&&D.autoBind?fc.bound:fc;return R.make_(o,r,n,u)}var I=(C=this.options_)!=null&&C.autoBind?dc.bound:dc;return I.make_(o,r,n,u)}var ee=((p=this.options_)==null?void 0:p.deep)===!1?Ot.ref:Ot;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var le;n.value=n.value.bind((le=o.proxy_)!=null?le:o.target_)}return ee.make_(o,r,n,u)}function aE(o,r,n,u){var p,a;if(n.get)return Yr.extend_(o,r,n,u);if(n.set)return o.defineProperty_(r,{configurable:pt.safeDescriptors?o.isPlainObject_:!0,set:gl(r.toString(),n.set)},u);if(typeof n.value=="function"&&(p=this.options_)!=null&&p.autoBind){var x;n.value=n.value.bind((x=o.proxy_)!=null?x:o.target_)}var C=((a=this.options_)==null?void 0:a.deep)===!1?Ot.ref:Ot;return C.extend_(o,r,n,u)}var lE="observable",uE="observable.ref",cE="observable.shallow",hE="observable.struct",t_={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(t_);function np(o){return o||t_}var r_=bp(lE),pE=bp(uE,{enhancer:vp}),dE=bp(cE,{enhancer:U2}),fE=bp(hE,{enhancer:$2}),i_=Eo(r_);function op(o){return o.deep===!0?yl:o.deep===!1?vp:yE(o.defaultDecorator)}function mE(o){var r;return o?(r=o.defaultDecorator)!=null?r:e_(o):void 0}function yE(o){var r,n;return o&&(r=(n=o.options_)==null?void 0:n.enhancer)!=null?r:yl}function n_(o,r,n){if(ha(r)){_c(o,r,r_);return}return im(o)?o:xs(o)?Ot.object(o,r,n):Array.isArray(o)?Ot.array(o,r):vl(o)?Ot.map(o,r):gc(o)?Ot.set(o,r):typeof o=="object"&&o!==null?o:Ot.box(o,r)}Object.assign(n_,i_);var gE={box:function(r,n){var u=np(n);return new ua(r,op(u),u.name,!0,u.equals)},array:function(r,n){var u=np(n);return(pt.useProxies===!1||u.proxy===!1?lS:QE)(r,op(u),u.name)},map:function(r,n){var u=np(n);return new Cp(r,op(u),u.name)},set:function(r,n){var u=np(n);return new R_(r,op(u),u.name)},object:function(r,n,u){return rm(pt.useProxies===!1||u?.proxy===!1?Ap({},u):HE({},u),r,n)},ref:Eo(pE),shallow:Eo(dE),deep:i_,struct:Eo(fE)},Ot=P2(n_,gE),o_="computed",_E="computed.struct",s_=Qf(o_),vE=Qf(_E,{equals:ml.structural}),Yr=function(r,n){if(ha(n))return _c(r,n,s_);if(xs(r))return Eo(Qf(o_,r));var u=xs(n)?n:{};return u.get=r,u.name||(u.name=r.name||""),new pc(u)};Object.assign(Yr,s_);Yr.struct=Eo(vE);var P0,M0,up=0,bE=1,xE=(P0=(M0=lp(function(){},"name"))==null?void 0:M0.configurable)!=null?P0:!1,z0={value:"action",configurable:!0,writable:!1,enumerable:!1};function gl(o,r,n,u){n===void 0&&(n=!1);function p(){return a_(o,n,r,u||this,arguments)}return p.isMobxAction=!0,xE&&(z0.value=o,Object.defineProperty(p,"name",z0)),p}function a_(o,r,n,u,p){var a=wE(o,r,u,p);try{return n.apply(u,p)}catch(x){throw a.error_=x,x}finally{EE(a)}}function wE(o,r,n,u){var p=!1,a=0;if(!1)var x;var C=pt.trackingDerivation,D=!r||!C;En();var R=pt.allowStateChanges;D&&(bl(),R=xc(!0));var I=tm(!0),ee={runAsAction_:D,prevDerivation_:C,prevAllowStateChanges_:R,prevAllowStateReads_:I,notifySpy_:p,startTime_:a,actionId_:bE++,parentActionId_:up};return up=ee.actionId_,ee}function EE(o){up!==o.actionId_&&ar(30),up=o.parentActionId_,o.error_!==void 0&&(pt.suppressReactionErrors=!0),wc(o.prevAllowStateChanges_),hc(o.prevAllowStateReads_),Sn(),o.runAsAction_&&bs(o.prevDerivation_),pt.suppressReactionErrors=!1}function em(o,r){var n=xc(o);try{return r()}finally{wc(n)}}function xc(o){var r=pt.allowStateChanges;return pt.allowStateChanges=o,r}function wc(o){pt.allowStateChanges=o}var l_;l_=Symbol.toPrimitive;var ua=function(o){H0(r,o);function r(u,p,a,x,C){var D;return a===void 0&&(a="ObservableValue"),x===void 0&&(x=!0),C===void 0&&(C=ml.default),D=o.call(this,a)||this,D.enhancer=void 0,D.name_=void 0,D.equals=void 0,D.hasUnreportedChange_=!1,D.interceptors_=void 0,D.changeListeners_=void 0,D.value_=void 0,D.dehancer=void 0,D.enhancer=p,D.name_=a,D.equals=C,D.value_=p(u,void 0,a),D}var n=r.prototype;return n.dehanceValue=function(p){return this.dehancer!==void 0?this.dehancer(p):p},n.set=function(p){var a=this.value_;if(p=this.prepareNewValue_(p),p!==pt.UNCHANGED){var x=ca();this.setNewValue_(p)}},n.prepareNewValue_=function(p){if(_l(this),Vn(this)){var a=Un(this,{object:this,type:So,newValue:p});if(!a)return pt.UNCHANGED;p=a.newValue}return p=this.enhancer(p,this.value_,this.name_),this.equals(this.value_,p)?pt.UNCHANGED:p},n.setNewValue_=function(p){var a=this.value_;this.value_=p,this.reportChanged(),no(this)&&oo(this,{type:So,object:this,newValue:p,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(p){return Sc(this,p)},n.observe_=function(p,a){return a&&p({observableKind:"value",debugObjectName:this.name_,object:this,type:So,newValue:this.value_,oldValue:void 0}),Tc(this,p)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return X0(this.get())},n[l_]=function(){return this.valueOf()},r}(vc),SE=ws("ObservableValue",ua),u_;u_=Symbol.toPrimitive;var pc=function(){function o(n){this.dependenciesState_=fr.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=fr.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new cp(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=vs.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||ar(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=gl("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?ml.structural:ml.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var r=o.prototype;return r.onBecomeStale_=function(){IE(this)},r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(u){return u()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(u){return u()})},r.get=function(){if(this.isComputing_&&ar(32,this.name_,this.derivation),pt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Gf(this)&&(this.warnAboutUntrackedRead_(),En(),this.value_=this.computeValue_(!1),Sn());else if(m_(this),Gf(this)){var u=pt.trackingContext;this.keepAlive_&&!u&&(pt.trackingContext=this),this.trackAndCompute()&&kE(this),pt.trackingContext=u}var p=this.value_;if(ap(p))throw p.cause;return p},r.set=function(u){if(this.setter_){this.isRunningSetter_&&ar(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,u)}finally{this.isRunningSetter_=!1}}else ar(34,this.name_)},r.trackAndCompute=function(){var u=this.value_,p=this.dependenciesState_===fr.NOT_TRACKING_,a=this.computeValue_(!0),x=p||ap(u)||ap(a)||!this.equals_(u,a);return x&&(this.value_=a),x},r.computeValue_=function(u){this.isComputing_=!0;var p=xc(!1),a;if(u)a=c_(this,this.derivation,this.scope_);else if(pt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(x){a=new cp(x)}return wc(p),this.isComputing_=!1,a},r.suspend_=function(){this.keepAlive_||(Zf(this),this.value_=void 0)},r.observe_=function(u,p){var a=this,x=!0,C=void 0;return wp(function(){var D=a.get();if(!x||p){var R=bl();u({observableKind:"computed",debugObjectName:a.name_,type:So,object:a,newValue:D,oldValue:C}),bs(R)}x=!1,C=D})},r.warnAboutUntrackedRead_=function(){},r.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},r.valueOf=function(){return X0(this.get())},r[u_]=function(){return this.valueOf()},o}(),pa=ws("ComputedValue",pc),fr;(function(o){o[o.NOT_TRACKING_=-1]="NOT_TRACKING_",o[o.UP_TO_DATE_=0]="UP_TO_DATE_",o[o.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",o[o.STALE_=2]="STALE_"})(fr||(fr={}));var vs;(function(o){o[o.NONE=0]="NONE",o[o.LOG=1]="LOG",o[o.BREAK=2]="BREAK"})(vs||(vs={}));var cp=function(r){this.cause=void 0,this.cause=r};function ap(o){return o instanceof cp}function Gf(o){switch(o.dependenciesState_){case fr.UP_TO_DATE_:return!1;case fr.NOT_TRACKING_:case fr.STALE_:return!0;case fr.POSSIBLY_STALE_:{for(var r=tm(!0),n=bl(),u=o.observing_,p=u.length,a=0;a<p;a++){var x=u[a];if(pa(x)){if(pt.disableErrorBoundaries)x.get();else try{x.get()}catch{return bs(n),hc(r),!0}if(o.dependenciesState_===fr.STALE_)return bs(n),hc(r),!0}}return p_(o),bs(n),hc(r),!1}}}function _l(o){return;var r}function c_(o,r,n){var u=tm(!0);p_(o),o.newObserving_=new Array(o.observing_.length+100),o.unboundDepsCount_=0,o.runId_=++pt.runId;var p=pt.trackingDerivation;pt.trackingDerivation=o,pt.inBatch++;var a;if(pt.disableErrorBoundaries===!0)a=r.call(n);else try{a=r.call(n)}catch(x){a=new cp(x)}return pt.inBatch--,pt.trackingDerivation=p,TE(o),hc(u),a}function TE(o){for(var r=o.observing_,n=o.observing_=o.newObserving_,u=fr.UP_TO_DATE_,p=0,a=o.unboundDepsCount_,x=0;x<a;x++){var C=n[x];C.diffValue_===0&&(C.diffValue_=1,p!==x&&(n[p]=C),p++),C.dependenciesState_>u&&(u=C.dependenciesState_)}for(n.length=p,o.newObserving_=null,a=r.length;a--;){var D=r[a];D.diffValue_===0&&d_(D,o),D.diffValue_=0}for(;p--;){var R=n[p];R.diffValue_===1&&(R.diffValue_=0,AE(R,o))}u!==fr.UP_TO_DATE_&&(o.dependenciesState_=u,o.onBecomeStale_())}function Zf(o){var r=o.observing_;o.observing_=[];for(var n=r.length;n--;)d_(r[n],o);o.dependenciesState_=fr.NOT_TRACKING_}function h_(o){var r=bl();try{return o()}finally{bs(r)}}function bl(){var o=pt.trackingDerivation;return pt.trackingDerivation=null,o}function bs(o){pt.trackingDerivation=o}function tm(o){var r=pt.allowStateReads;return pt.allowStateReads=o,r}function hc(o){pt.allowStateReads=o}function p_(o){if(o.dependenciesState_!==fr.UP_TO_DATE_){o.dependenciesState_=fr.UP_TO_DATE_;for(var r=o.observing_,n=r.length;n--;)r[n].lowestObserverState_=fr.UP_TO_DATE_}}var jf=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Vf=!0,CE=!1,pt=function(){var o=$0();return o.__mobxInstanceCount>0&&!o.__mobxGlobals&&(Vf=!1),o.__mobxGlobals&&o.__mobxGlobals.version!==new jf().version&&(Vf=!1),Vf?o.__mobxGlobals?(o.__mobxInstanceCount+=1,o.__mobxGlobals.UNCHANGED||(o.__mobxGlobals.UNCHANGED={}),o.__mobxGlobals):(o.__mobxInstanceCount=1,o.__mobxGlobals=new jf):(setTimeout(function(){CE||ar(35)},1),new jf)}();function AE(o,r){o.observers_.add(r),o.lowestObserverState_>r.dependenciesState_&&(o.lowestObserverState_=r.dependenciesState_)}function d_(o,r){o.observers_.delete(r),o.observers_.size===0&&f_(o)}function f_(o){o.isPendingUnobservation_===!1&&(o.isPendingUnobservation_=!0,pt.pendingUnobservations.push(o))}function En(){pt.inBatch++}function Sn(){if(--pt.inBatch===0){g_();for(var o=pt.pendingUnobservations,r=0;r<o.length;r++){var n=o[r];n.isPendingUnobservation_=!1,n.observers_.size===0&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof pc&&n.suspend_())}pt.pendingUnobservations=[]}}function m_(o){var r=pt.trackingDerivation;return r!==null?(r.runId_!==o.lastAccessedBy_&&(o.lastAccessedBy_=r.runId_,r.newObserving_[r.unboundDepsCount_++]=o,!o.isBeingObserved_&&pt.trackingContext&&(o.isBeingObserved_=!0,o.onBO())),!0):(o.observers_.size===0&&pt.inBatch>0&&f_(o),!1)}function y_(o){o.lowestObserverState_!==fr.STALE_&&(o.lowestObserverState_=fr.STALE_,o.observers_.forEach(function(r){r.dependenciesState_===fr.UP_TO_DATE_&&r.onBecomeStale_(),r.dependenciesState_=fr.STALE_}))}function kE(o){o.lowestObserverState_!==fr.STALE_&&(o.lowestObserverState_=fr.STALE_,o.observers_.forEach(function(r){r.dependenciesState_===fr.POSSIBLY_STALE_?r.dependenciesState_=fr.STALE_:r.dependenciesState_===fr.UP_TO_DATE_&&(o.lowestObserverState_=fr.UP_TO_DATE_)}))}function IE(o){o.lowestObserverState_===fr.UP_TO_DATE_&&(o.lowestObserverState_=fr.POSSIBLY_STALE_,o.observers_.forEach(function(r){r.dependenciesState_===fr.UP_TO_DATE_&&(r.dependenciesState_=fr.POSSIBLY_STALE_,r.onBecomeStale_())}))}var hp=function(){function o(n,u,p,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=fr.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=vs.NONE,this.name_=n,this.onInvalidate_=u,this.errorHandler_=p,this.requiresObservable_=a}var r=o.prototype;return r.onBecomeStale_=function(){this.schedule_()},r.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,pt.pendingReactions.push(this),g_())},r.isScheduled=function(){return this.isScheduled_},r.runReaction_=function(){if(!this.isDisposed_){En(),this.isScheduled_=!1;var u=pt.trackingContext;if(pt.trackingContext=this,Gf(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(p){this.reportExceptionInDerivation_(p)}}pt.trackingContext=u,Sn()}},r.track=function(u){if(!this.isDisposed_){En();var p=ca(),a;this.isRunning_=!0;var x=pt.trackingContext;pt.trackingContext=this;var C=c_(this,u,void 0);pt.trackingContext=x,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Zf(this),ap(C)&&this.reportExceptionInDerivation_(C.cause),Sn()}},r.reportExceptionInDerivation_=function(u){var p=this;if(this.errorHandler_){this.errorHandler_(u,this);return}if(pt.disableErrorBoundaries)throw u;var a="[mobx] uncaught error in '"+this+"'";pt.suppressReactionErrors||console.error(a,u),pt.globalReactionErrorHandlers.forEach(function(x){return x(u,p)})},r.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(En(),Zf(this),Sn()))},r.getDisposer_=function(){var u=this.dispose.bind(this);return u[zt]=this,u},r.toString=function(){return"Reaction["+this.name_+"]"},r.trace=function(u){u===void 0&&(u=!1),nm(this,u)},o}();var PE=100,ME=function(r){return r()};function g_(){pt.inBatch>0||pt.isRunningReactions||ME(zE)}function zE(){pt.isRunningReactions=!0;for(var o=pt.pendingReactions,r=0;o.length>0;){++r===PE&&(console.error("[mobx] cycle in reaction: "+o[0]),o.splice(0));for(var n=o.splice(0),u=0,p=n.length;u<p;u++)n[u].runReaction_()}pt.isRunningReactions=!1}var pp=ws("Reaction",hp);function ca(){return!1}function OE(o){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var __="action",DE="action.bound",v_="autoAction",FE="autoAction.bound",b_="<unnamed action>",x_=bc(__),RE=bc(DE,{bound:!0}),w_=bc(v_,{autoAction:!0}),LE=bc(FE,{autoAction:!0,bound:!0});function E_(o){var r=function(u,p){if($n(u))return gl(u.name||b_,u,o);if($n(p))return gl(u,p,o);if(ha(p))return _c(u,p,o?w_:x_);if(ha(u))return Eo(bc(o?v_:__,{name:u,autoAction:o}))};return r}var kt=E_(!1);Object.assign(kt,x_);var dc=E_(!0);Object.assign(dc,w_);kt.bound=Eo(RE);dc.bound=Eo(LE);function Li(o){return a_(o.name||b_,!1,o,this,void 0)}function xp(o){return $n(o)&&o.isMobxAction===!0}function wp(o,r){var n,u;r===void 0&&(r=Xf);var p=(n=(u=r)==null?void 0:u.name)!=null?n:"Autorun",a=!r.scheduler&&!r.delay,x;if(a)x=new hp(p,function(){this.track(R)},r.onError,r.requiresObservable);else{var C=S_(r),D=!1;x=new hp(p,function(){D||(D=!0,C(function(){D=!1,x.isDisposed_||x.track(R)}))},r.onError,r.requiresObservable)}function R(){o(x)}return x.schedule_(),x.getDisposer_()}var BE=function(r){return r()};function S_(o){return o.scheduler?o.scheduler:o.delay?function(r){return setTimeout(r,o.delay)}:BE}function Ep(o,r,n){var u;n===void 0&&(n=Xf);var p=(u=n.name)!=null?u:"Reaction",a=kt(p,n.onError?NE(n.onError,r):r),x=!n.scheduler&&!n.delay,C=S_(n),D=!0,R=!1,I,ee,le=n.compareStructural?ml.structural:n.equals||ml.default,_e=new hp(p,function(){D||x?$e():R||(R=!0,C($e))},n.onError,n.requiresObservable);function $e(){if(R=!1,!_e.isDisposed_){var Oe=!1;_e.track(function(){var De=em(!1,function(){return o(_e)});Oe=D||!le(I,De),ee=I,I=De}),(D&&n.fireImmediately||!D&&Oe)&&a(I,ee,_e),D=!1}}return _e.schedule_(),_e.getDisposer_()}function NE(o,r){return function(){try{return r.apply(this,arguments)}catch(n){o.call(this,n)}}}var jE="onBO",VE="onBUO";function Ec(o,r,n){return T_(jE,o,r,n)}function da(o,r,n){return T_(VE,o,r,n)}function T_(o,r,n,u){var p=typeof u=="function"?Zo(r,n):Zo(r),a=$n(u)?u:n,x=o+"L";return p[x]?p[x].add(a):p[x]=new Set([a]),function(){var C=p[x];C&&(C.delete(a),C.size===0&&delete p[x])}}function rm(o,r,n,u){var p=D2(r),a=Ap(o,u)[zt];En();try{_p(p).forEach(function(x){a.extend_(x,p[x],n&&x in n?n[x]:!0)})}finally{Sn()}return o}var UE=0;function C_(){this.message="FLOW_CANCELLED"}C_.prototype=Object.create(Error.prototype);var O0=Y0("flow"),$E=Y0("flow.bound",{bound:!0}),fc=Object.assign(function(r,n){if(ha(n))return _c(r,n,O0);var u=r,p=u.name||"<unnamed flow>",a=function(){var C=this,D=arguments,R=++UE,I=kt(p+" - runid: "+R+" - init",u).apply(C,D),ee,le=void 0,_e=new Promise(function($e,Oe){var De=0;ee=Oe;function fe(We){le=void 0;var Pe;try{Pe=kt(p+" - runid: "+R+" - yield "+De++,I.next).call(I,We)}catch(je){return Oe(je)}Ie(Pe)}function ve(We){le=void 0;var Pe;try{Pe=kt(p+" - runid: "+R+" - yield "+De++,I.throw).call(I,We)}catch(je){return Oe(je)}Ie(Pe)}function Ie(We){if($n(We?.then)){We.then(Ie,Oe);return}return We.done?$e(We.value):(le=Promise.resolve(We.value),le.then(fe,ve))}fe(void 0)});return _e.cancel=kt(p+" - runid: "+R+" - cancel",function(){try{le&&D0(le);var $e=I.return(void 0),Oe=Promise.resolve($e.value);Oe.then(pl,pl),D0(Oe),ee(new C_)}catch(De){ee(De)}}),_e};return a.isMobXFlow=!0,a},O0);fc.bound=Eo($E);function D0(o){$n(o.cancel)&&o.cancel()}function dp(o){return o?.isMobXFlow===!0}function A_(o,r){if(r===void 0)return pa(o);if(To(o)===!1||!o[zt].values_.has(r))return!1;var n=Zo(o,r);return pa(n)}function k_(o){return A_(o)}function Sp(o,r){return A_(o,r)}function qE(o,r){return o?r!==void 0?To(o)?o[zt].values_.has(r):!1:To(o)||!!o[zt]||Jf(o)||pp(o)||pa(o):!1}function im(o){return qE(o)}function I_(o){if(To(o))return o[zt].keys_();if(so(o)||Ts(o))return Array.from(o.keys());if(Ss(o))return o.map(function(r,n){return n});ar(5)}function GE(o){if(To(o))return o[zt].ownKeys_();ar(38)}function Tp(o,r,n,u){return $n(n)?KE(o,r,n,u):ZE(o,r,n)}function ZE(o,r,n){return xl(o).observe_(r,n)}function KE(o,r,n,u){return xl(o,r).observe_(n,u)}function sp(o,r,n){return o.set(r,n),n}function hl(o,r){if(o==null||typeof o!="object"||o instanceof Date||!im(o))return o;if(SE(o)||pa(o))return hl(o.get(),r);if(r.has(o))return r.get(o);if(Ss(o)){var n=sp(r,o,new Array(o.length));return o.forEach(function(x,C){n[C]=hl(x,r)}),n}if(Ts(o)){var u=sp(r,o,new Set);return o.forEach(function(x){u.add(hl(x,r))}),u}if(so(o)){var p=sp(r,o,new Map);return o.forEach(function(x,C){p.set(C,hl(x,r))}),p}else{var a=sp(r,o,{});return GE(o).forEach(function(x){yc.propertyIsEnumerable.call(o,x)&&(a[x]=hl(o[x],r))}),a}}function P_(o,r){return hl(o,new Map)}function nm(){ar("trace() is not available in production builds");for(var o=!1,r=arguments.length,n=new Array(r),u=0;u<r;u++)n[u]=arguments[u];typeof n[n.length-1]=="boolean"&&(o=n.pop());var p=WE(n);if(!p)return ar("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");p.isTracing_===vs.NONE&&console.log("[mobx.trace] '"+p.name_+"' tracing enabled"),p.isTracing_=o?vs.BREAK:vs.LOG}function WE(o){switch(o.length){case 0:return pt.trackingDerivation;case 1:return Zo(o[0]);case 2:return Zo(o[0],o[1])}}function jn(o,r){r===void 0&&(r=void 0),En();try{return o.apply(r)}finally{Sn()}}function cl(o){return o[zt]}var XE={has:function(r,n){return cl(r).has_(n)},get:function(r,n){return cl(r).get_(n)},set:function(r,n,u){var p;return ha(n)?(p=cl(r).set_(n,u,!0))!=null?p:!0:!1},deleteProperty:function(r,n){var u;return ha(n)?(u=cl(r).delete_(n,!0))!=null?u:!0:!1},defineProperty:function(r,n,u){var p;return(p=cl(r).defineProperty_(n,u))!=null?p:!0},ownKeys:function(r){return cl(r).ownKeys_()},preventExtensions:function(r){ar(13)}};function HE(o,r){var n,u;return q0(),o=Ap(o,r),(u=(n=o[zt]).proxy_)!=null?u:n.proxy_=new Proxy(o,XE)}function Vn(o){return o.interceptors_!==void 0&&o.interceptors_.length>0}function Sc(o,r){var n=o.interceptors_||(o.interceptors_=[]);return n.push(r),G0(function(){var u=n.indexOf(r);u!==-1&&n.splice(u,1)})}function Un(o,r){var n=bl();try{for(var u=[].concat(o.interceptors_||[]),p=0,a=u.length;p<a&&(r=u[p](r),r&&!r.type&&ar(14),!!r);p++);return r}finally{bs(n)}}function no(o){return o.changeListeners_!==void 0&&o.changeListeners_.length>0}function Tc(o,r){var n=o.changeListeners_||(o.changeListeners_=[]);return n.push(r),G0(function(){var u=n.indexOf(r);u!==-1&&n.splice(u,1)})}function oo(o,r){var n=bl(),u=o.changeListeners_;if(!!u){u=u.slice();for(var p=0,a=u.length;p<a;p++)u[p](r);bs(n)}}function Ii(o,r,n){var u=Ap(o,n)[zt];En();try{var p;(p=r)!=null||(r=L2(o)),_p(r).forEach(function(a){return u.make_(a,r[a])})}finally{Sn()}return o}var F0="splice",So="update",JE=1e4,YE={get:function(r,n){var u=r[zt];return n===zt?u:n==="length"?u.getArrayLength_():typeof n=="string"&&!isNaN(n)?u.get_(parseInt(n)):Go(fp,n)?fp[n]:r[n]},set:function(r,n,u){var p=r[zt];return n==="length"&&p.setArrayLength_(u),typeof n=="symbol"||isNaN(n)?r[n]=u:p.set_(parseInt(n),u),!0},preventExtensions:function(){ar(15)}},om=function(){function o(n,u,p,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=p,this.legacyMode_=a,this.atom_=new vc(n),this.enhancer_=function(x,C){return u(x,C,"ObservableArray[..]")}}var r=o.prototype;return r.dehanceValue_=function(u){return this.dehancer!==void 0?this.dehancer(u):u},r.dehanceValues_=function(u){return this.dehancer!==void 0&&u.length>0?u.map(this.dehancer):u},r.intercept_=function(u){return Sc(this,u)},r.observe_=function(u,p){return p===void 0&&(p=!1),p&&u({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Tc(this,u)},r.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},r.setArrayLength_=function(u){(typeof u!="number"||isNaN(u)||u<0)&&ar("Out of range: "+u);var p=this.values_.length;if(u!==p)if(u>p){for(var a=new Array(u-p),x=0;x<u-p;x++)a[x]=void 0;this.spliceWithArray_(p,0,a)}else this.spliceWithArray_(u,p-u)},r.updateArrayLength_=function(u,p){u!==this.lastKnownLength_&&ar(16),this.lastKnownLength_+=p,this.legacyMode_&&p>0&&N_(u+p+1)},r.spliceWithArray_=function(u,p,a){var x=this;_l(this.atom_);var C=this.values_.length;if(u===void 0?u=0:u>C?u=C:u<0&&(u=Math.max(0,C+u)),arguments.length===1?p=C-u:p==null?p=0:p=Math.max(0,Math.min(p,C-u)),a===void 0&&(a=$f),Vn(this)){var D=Un(this,{object:this.proxy_,type:F0,index:u,removedCount:p,added:a});if(!D)return $f;p=D.removedCount,a=D.added}if(a=a.length===0?a:a.map(function(ee){return x.enhancer_(ee,void 0)}),this.legacyMode_){var R=a.length-p;this.updateArrayLength_(C,R)}var I=this.spliceItemsIntoValues_(u,p,a);return(p!==0||a.length!==0)&&this.notifyArraySplice_(u,a,I),this.dehanceValues_(I)},r.spliceItemsIntoValues_=function(u,p,a){if(a.length<JE){var x;return(x=this.values_).splice.apply(x,[u,p].concat(a))}else{var C=this.values_.slice(u,u+p),D=this.values_.slice(u+p);this.values_.length+=a.length-p;for(var R=0;R<a.length;R++)this.values_[u+R]=a[R];for(var I=0;I<D.length;I++)this.values_[u+a.length+I]=D[I];return C}},r.notifyArrayChildUpdate_=function(u,p,a){var x=!this.owned_&&ca(),C=no(this),D=C||x?{observableKind:"array",object:this.proxy_,type:So,debugObjectName:this.atom_.name_,index:u,newValue:p,oldValue:a}:null;this.atom_.reportChanged(),C&&oo(this,D)},r.notifyArraySplice_=function(u,p,a){var x=!this.owned_&&ca(),C=no(this),D=C||x?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:F0,index:u,removed:a,added:p,removedCount:a.length,addedCount:p.length}:null;this.atom_.reportChanged(),C&&oo(this,D)},r.get_=function(u){if(u<this.values_.length)return this.atom_.reportObserved(),this.dehanceValue_(this.values_[u]);console.warn("[mobx.array] Attempt to read an array index ("+u+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX")},r.set_=function(u,p){var a=this.values_;if(u<a.length){_l(this.atom_);var x=a[u];if(Vn(this)){var C=Un(this,{type:So,object:this.proxy_,index:u,newValue:p});if(!C)return;p=C.newValue}p=this.enhancer_(p,x);var D=p!==x;D&&(a[u]=p,this.notifyArrayChildUpdate_(u,p,x))}else u===a.length?this.spliceWithArray_(u,0,[p]):ar(17,u,a.length)},o}();function QE(o,r,n,u){n===void 0&&(n="ObservableArray"),u===void 0&&(u=!1),q0();var p=new om(n,r,u,!1);K0(p.values_,zt,p);var a=new Proxy(p.values_,YE);if(p.proxy_=a,o&&o.length){var x=xc(!0);p.spliceWithArray_(0,0,o),wc(x)}return a}var fp={clear:function(){return this.splice(0)},replace:function(r){var n=this[zt];return n.spliceWithArray_(0,n.values_.length,r)},toJSON:function(){return this.slice()},splice:function(r,n){for(var u=arguments.length,p=new Array(u>2?u-2:0),a=2;a<u;a++)p[a-2]=arguments[a];var x=this[zt];switch(arguments.length){case 0:return[];case 1:return x.spliceWithArray_(r);case 2:return x.spliceWithArray_(r,n)}return x.spliceWithArray_(r,n,p)},spliceWithArray:function(r,n,u){return this[zt].spliceWithArray_(r,n,u)},push:function(){for(var r=this[zt],n=arguments.length,u=new Array(n),p=0;p<n;p++)u[p]=arguments[p];return r.spliceWithArray_(r.values_.length,0,u),r.values_.length},pop:function(){return this.splice(Math.max(this[zt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var r=this[zt],n=arguments.length,u=new Array(n),p=0;p<n;p++)u[p]=arguments[p];return r.spliceWithArray_(0,0,u),r.values_.length},reverse:function(){return pt.trackingDerivation&&ar(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){pt.trackingDerivation&&ar(37,"sort");var r=this.slice();return r.sort.apply(r,arguments),this.replace(r),this},remove:function(r){var n=this[zt],u=n.dehanceValues_(n.values_).indexOf(r);return u>-1?(this.splice(u,1),!0):!1}};hi("concat",Ko);hi("flat",Ko);hi("includes",Ko);hi("indexOf",Ko);hi("join",Ko);hi("lastIndexOf",Ko);hi("slice",Ko);hi("toString",Ko);hi("toLocaleString",Ko);hi("every",Es);hi("filter",Es);hi("find",Es);hi("findIndex",Es);hi("flatMap",Es);hi("forEach",Es);hi("map",Es);hi("some",Es);hi("reduce",M_);hi("reduceRight",M_);function hi(o,r){typeof Array.prototype[o]=="function"&&(fp[o]=r(o))}function Ko(o){return function(){var r=this[zt];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_);return n[o].apply(n,arguments)}}function Es(o){return function(r,n){var u=this,p=this[zt];p.atom_.reportObserved();var a=p.dehanceValues_(p.values_);return a[o](function(x,C){return r.call(n,x,C,u)})}}function M_(o){return function(){var r=this,n=this[zt];n.atom_.reportObserved();var u=n.dehanceValues_(n.values_),p=arguments[0];return arguments[0]=function(a,x,C){return p(a,x,C,r)},u[o].apply(u,arguments)}}var eS=ws("ObservableArrayAdministration",om);function Ss(o){return yp(o)&&eS(o[zt])}var z_,O_,tS={},_s="add",mp="delete";z_=Symbol.iterator;O_=Symbol.toStringTag;var Cp=function(){function o(n,u,p){var a=this;u===void 0&&(u=yl),p===void 0&&(p="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[zt]=tS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=u,this.name_=p,$n(Map)||ar(18),this.keysAtom_=Yf("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,em(!0,function(){a.merge(n)})}var r=o.prototype;return r.has_=function(u){return this.data_.has(u)},r.has=function(u){var p=this;if(!pt.trackingDerivation)return this.has_(u);var a=this.hasMap_.get(u);if(!a){var x=a=new ua(this.has_(u),vp,"ObservableMap.key?",!1);this.hasMap_.set(u,x),da(x,function(){return p.hasMap_.delete(u)})}return a.get()},r.set=function(u,p){var a=this.has_(u);if(Vn(this)){var x=Un(this,{type:a?So:_s,object:this,newValue:p,name:u});if(!x)return this;p=x.newValue}return a?this.updateValue_(u,p):this.addValue_(u,p),this},r.delete=function(u){var p=this;if(_l(this.keysAtom_),Vn(this)){var a=Un(this,{type:mp,object:this,name:u});if(!a)return!1}if(this.has_(u)){var x=ca(),C=no(this),D=C||x?{observableKind:"map",debugObjectName:this.name_,type:mp,object:this,oldValue:this.data_.get(u).value_,name:u}:null;return jn(function(){var R;p.keysAtom_.reportChanged(),(R=p.hasMap_.get(u))==null||R.setNewValue_(!1);var I=p.data_.get(u);I.setNewValue_(void 0),p.data_.delete(u)}),C&&oo(this,D),!0}return!1},r.updateValue_=function(u,p){var a=this.data_.get(u);if(p=a.prepareNewValue_(p),p!==pt.UNCHANGED){var x=ca(),C=no(this),D=C||x?{observableKind:"map",debugObjectName:this.name_,type:So,object:this,oldValue:a.value_,name:u,newValue:p}:null;a.setNewValue_(p),C&&oo(this,D)}},r.addValue_=function(u,p){var a=this;_l(this.keysAtom_),jn(function(){var R,I=new ua(p,a.enhancer_,"ObservableMap.key",!1);a.data_.set(u,I),p=I.value_,(R=a.hasMap_.get(u))==null||R.setNewValue_(!0),a.keysAtom_.reportChanged()});var x=ca(),C=no(this),D=C||x?{observableKind:"map",debugObjectName:this.name_,type:_s,object:this,name:u,newValue:p}:null;C&&oo(this,D)},r.get=function(u){return this.has(u)?this.dehanceValue_(this.data_.get(u).get()):this.dehanceValue_(void 0)},r.dehanceValue_=function(u){return this.dehancer!==void 0?this.dehancer(u):u},r.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},r.values=function(){var u=this,p=this.keys();return mc({next:function(){var x=p.next(),C=x.done,D=x.value;return{done:C,value:C?void 0:u.get(D)}}})},r.entries=function(){var u=this,p=this.keys();return mc({next:function(){var x=p.next(),C=x.done,D=x.value;return{done:C,value:C?void 0:[D,u.get(D)]}}})},r[z_]=function(){return this.entries()},r.forEach=function(u,p){for(var a=dl(this),x;!(x=a()).done;){var C=x.value,D=C[0],R=C[1];u.call(p,R,D,this)}},r.merge=function(u){var p=this;return so(u)&&(u=new Map(u)),jn(function(){xs(u)?O2(u).forEach(function(a){return p.set(a,u[a])}):Array.isArray(u)?u.forEach(function(a){var x=a[0],C=a[1];return p.set(x,C)}):vl(u)?(u.constructor!==Map&&ar(19,u),u.forEach(function(a,x){return p.set(x,a)})):u!=null&&ar(20,u)}),this},r.clear=function(){var u=this;jn(function(){h_(function(){for(var p=dl(u.keys()),a;!(a=p()).done;){var x=a.value;u.delete(x)}})})},r.replace=function(u){var p=this;return jn(function(){for(var a=rS(u),x=new Map,C=!1,D=dl(p.data_.keys()),R;!(R=D()).done;){var I=R.value;if(!a.has(I)){var ee=p.delete(I);if(ee)C=!0;else{var le=p.data_.get(I);x.set(I,le)}}}for(var _e=dl(a.entries()),$e;!($e=_e()).done;){var Oe=$e.value,De=Oe[0],fe=Oe[1],ve=p.data_.has(De);if(p.set(De,fe),p.data_.has(De)){var Ie=p.data_.get(De);x.set(De,Ie),ve||(C=!0)}}if(!C)if(p.data_.size!==x.size)p.keysAtom_.reportChanged();else for(var We=p.data_.keys(),Pe=x.keys(),je=We.next(),Bt=Pe.next();!je.done;){if(je.value!==Bt.value){p.keysAtom_.reportChanged();break}je=We.next(),Bt=Pe.next()}p.data_=x}),this},r.toString=function(){return"[object ObservableMap]"},r.toJSON=function(){return Array.from(this)},r.observe_=function(u,p){return Tc(this,u)},r.intercept_=function(u){return Sc(this,u)},Hf(o,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:O_,get:function(){return"Map"}}]),o}(),so=ws("ObservableMap",Cp);function rS(o){if(vl(o)||so(o))return o;if(Array.isArray(o))return new Map(o);if(xs(o)){var r=new Map;for(var n in o)r.set(n,o[n]);return r}else return ar(21,o)}var D_,F_,iS={};D_=Symbol.iterator;F_=Symbol.toStringTag;var R_=function(){function o(n,u,p){u===void 0&&(u=yl),p===void 0&&(p="ObservableSet"),this.name_=void 0,this[zt]=iS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=p,$n(Set)||ar(22),this.atom_=Yf(this.name_),this.enhancer_=function(a,x){return u(a,x,p)},n&&this.replace(n)}var r=o.prototype;return r.dehanceValue_=function(u){return this.dehancer!==void 0?this.dehancer(u):u},r.clear=function(){var u=this;jn(function(){h_(function(){for(var p=dl(u.data_.values()),a;!(a=p()).done;){var x=a.value;u.delete(x)}})})},r.forEach=function(u,p){for(var a=dl(this),x;!(x=a()).done;){var C=x.value;u.call(p,C,C,this)}},r.add=function(u){var p=this;if(_l(this.atom_),Vn(this)){var a=Un(this,{type:_s,object:this,newValue:u});if(!a)return this}if(!this.has(u)){jn(function(){p.data_.add(p.enhancer_(u,void 0)),p.atom_.reportChanged()});var x=!1,C=no(this),D=C||x?{observableKind:"set",debugObjectName:this.name_,type:_s,object:this,newValue:u}:null;C&&oo(this,D)}return this},r.delete=function(u){var p=this;if(Vn(this)){var a=Un(this,{type:mp,object:this,oldValue:u});if(!a)return!1}if(this.has(u)){var x=!1,C=no(this),D=C||x?{observableKind:"set",debugObjectName:this.name_,type:mp,object:this,oldValue:u}:null;return jn(function(){p.atom_.reportChanged(),p.data_.delete(u)}),C&&oo(this,D),!0}return!1},r.has=function(u){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(u))},r.entries=function(){var u=0,p=Array.from(this.keys()),a=Array.from(this.values());return mc({next:function(){var C=u;return u+=1,C<a.length?{value:[p[C],a[C]],done:!1}:{done:!0}}})},r.keys=function(){return this.values()},r.values=function(){this.atom_.reportObserved();var u=this,p=0,a=Array.from(this.data_.values());return mc({next:function(){return p<a.length?{value:u.dehanceValue_(a[p++]),done:!1}:{done:!0}}})},r.replace=function(u){var p=this;return Ts(u)&&(u=new Set(u)),jn(function(){Array.isArray(u)?(p.clear(),u.forEach(function(a){return p.add(a)})):gc(u)?(p.clear(),u.forEach(function(a){return p.add(a)})):u!=null&&ar("Cannot initialize set from "+u)}),this},r.observe_=function(u,p){return Tc(this,u)},r.intercept_=function(u){return Sc(this,u)},r.toJSON=function(){return Array.from(this)},r.toString=function(){return"[object ObservableSet]"},r[D_]=function(){return this.values()},Hf(o,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:F_,get:function(){return"Set"}}]),o}(),Ts=ws("ObservableSet",R_),R0=Object.create(null),L0="remove",L_=function(){function o(n,u,p,a){u===void 0&&(u=new Map),a===void 0&&(a=oE),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=u,this.name_=p,this.defaultAnnotation_=a,this.keysAtom_=new vc("ObservableObject.keys"),this.isPlainObject_=xs(this.target_)}var r=o.prototype;return r.getObservablePropValue_=function(u){return this.values_.get(u).get()},r.setObservablePropValue_=function(u,p){var a=this.values_.get(u);if(a instanceof pc)return a.set(p),!0;if(Vn(this)){var x=Un(this,{type:So,object:this.proxy_||this.target_,name:u,newValue:p});if(!x)return null;p=x.newValue}if(p=a.prepareNewValue_(p),p!==pt.UNCHANGED){var C=no(this),D=!1,R=C||D?{type:So,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:u,newValue:p}:null;a.setNewValue_(p),C&&oo(this,R)}return!0},r.get_=function(u){return pt.trackingDerivation&&!Go(this.target_,u)&&this.has_(u),this.target_[u]},r.set_=function(u,p,a){return a===void 0&&(a=!1),Go(this.target_,u)?this.values_.has(u)?this.setObservablePropValue_(u,p):a?Reflect.set(this.target_,u,p):(this.target_[u]=p,!0):this.extend_(u,{value:p,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},r.has_=function(u){if(!pt.trackingDerivation)return u in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var p=this.pendingKeys_.get(u);return p||(p=new ua(u in this.target_,vp,"ObservableObject.key?",!1),this.pendingKeys_.set(u,p)),p.get()},r.make_=function(u,p){if(p===!0&&(p=this.defaultAnnotation_),p!==!1){if(j0(this,p,u),!(u in this.target_)){var a;if((a=this.target_[wo])!=null&&a[u])return;ar(1,p.annotationType_,this.name_+"."+u.toString())}for(var x=this.target_;x&&x!==yc;){var C=lp(x,u);if(C){var D=p.make_(this,u,C,x);if(D===0)return;if(D===1)break}x=Object.getPrototypeOf(x)}N0(this,p,u)}},r.extend_=function(u,p,a,x){if(x===void 0&&(x=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(u,p,x);j0(this,a,u);var C=a.extend_(this,u,p,x);return C&&N0(this,a,u),C},r.defineProperty_=function(u,p,a){a===void 0&&(a=!1);try{En();var x=this.delete_(u);if(!x)return x;if(Vn(this)){var C=Un(this,{object:this.proxy_||this.target_,name:u,type:_s,newValue:p.value});if(!C)return null;var D=C.newValue;p.value!==D&&(p=fl({},p,{value:D}))}if(a){if(!Reflect.defineProperty(this.target_,u,p))return!1}else qo(this.target_,u,p);this.notifyPropertyAddition_(u,p.value)}finally{Sn()}return!0},r.defineObservableProperty_=function(u,p,a,x){x===void 0&&(x=!1);try{En();var C=this.delete_(u);if(!C)return C;if(Vn(this)){var D=Un(this,{object:this.proxy_||this.target_,name:u,type:_s,newValue:p});if(!D)return null;p=D.newValue}var R=B0(u),I={configurable:pt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:R.get,set:R.set};if(x){if(!Reflect.defineProperty(this.target_,u,I))return!1}else qo(this.target_,u,I);var ee=new ua(p,a,"ObservableObject.key",!1);this.values_.set(u,ee),this.notifyPropertyAddition_(u,ee.value_)}finally{Sn()}return!0},r.defineComputedProperty_=function(u,p,a){a===void 0&&(a=!1);try{En();var x=this.delete_(u);if(!x)return x;if(Vn(this)){var C=Un(this,{object:this.proxy_||this.target_,name:u,type:_s,newValue:void 0});if(!C)return null}p.name||(p.name="ObservableObject.key"),p.context=this.proxy_||this.target_;var D=B0(u),R={configurable:pt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:D.get,set:D.set};if(a){if(!Reflect.defineProperty(this.target_,u,R))return!1}else qo(this.target_,u,R);this.values_.set(u,new pc(p)),this.notifyPropertyAddition_(u,void 0)}finally{Sn()}return!0},r.delete_=function(u,p){if(p===void 0&&(p=!1),!Go(this.target_,u))return!0;if(Vn(this)){var a=Un(this,{object:this.proxy_||this.target_,name:u,type:L0});if(!a)return null}try{var x,C;En();var D=no(this),R=!1,I=this.values_.get(u),ee=void 0;if(!I&&(D||R)){var le;ee=(le=lp(this.target_,u))==null?void 0:le.value}if(p){if(!Reflect.deleteProperty(this.target_,u))return!1}else delete this.target_[u];if(I&&(this.values_.delete(u),I instanceof ua&&(ee=I.value_),y_(I)),this.keysAtom_.reportChanged(),(x=this.pendingKeys_)==null||(C=x.get(u))==null||C.set(u in this.target_),D||R){var _e={type:L0,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:ee,name:u};D&&oo(this,_e)}}finally{Sn()}return!0},r.observe_=function(u,p){return Tc(this,u)},r.intercept_=function(u){return Sc(this,u)},r.notifyPropertyAddition_=function(u,p){var a,x,C=no(this),D=!1;if(C||D){var R=C||D?{type:_s,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:u,newValue:p}:null;C&&oo(this,R)}(a=this.pendingKeys_)==null||(x=a.get(u))==null||x.set(!0),this.keysAtom_.reportChanged()},r.ownKeys_=function(){return this.keysAtom_.reportObserved(),_p(this.target_)},r.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},o}();function Ap(o,r){var n;if(Go(o,zt))return o;var u=(n=r?.name)!=null?n:"ObservableObject",p=new L_(o,new Map,String(u),mE(r));return gp(o,zt,p),o}var nS=ws("ObservableObjectAdministration",L_);function B0(o){return R0[o]||(R0[o]={get:function(){return this[zt].getObservablePropValue_(o)},set:function(n){return this[zt].setObservablePropValue_(o,n)}})}function To(o){return yp(o)?nS(o[zt]):!1}function N0(o,r,n){var u;(u=o.target_[wo])==null||delete u[n]}function j0(o,r,n){if(!1)var u,p,a}var Uf=0,B_=function(){};function oS(o,r){Object.setPrototypeOf?Object.setPrototypeOf(o.prototype,r):o.prototype.__proto__!==void 0?o.prototype.__proto__=r:o.prototype=r}oS(B_,Array.prototype);var sm=function(o,r,n){H0(u,o);function u(a,x,C,D){var R;C===void 0&&(C="ObservableArray"),D===void 0&&(D=!1),R=o.call(this)||this;var I=new om(C,x,D,!0);if(I.proxy_=k0(R),K0(k0(R),zt,I),a&&a.length){var ee=xc(!0);R.spliceWithArray(0,0,a),wc(ee)}return R}var p=u.prototype;return p.concat=function(){this[zt].atom_.reportObserved();for(var x=arguments.length,C=new Array(x),D=0;D<x;D++)C[D]=arguments[D];return Array.prototype.concat.apply(this.slice(),C.map(function(R){return Ss(R)?R.slice():R}))},p[n]=function(){var a=this,x=0;return mc({next:function(){return x<a.length?{value:a[x++],done:!1}:{done:!0,value:void 0}}})},Hf(u,[{key:"length",get:function(){return this[zt].getArrayLength_()},set:function(x){this[zt].setArrayLength_(x)}},{key:r,get:function(){return"Array"}}]),u}(B_,Symbol.toStringTag,Symbol.iterator);Object.entries(fp).forEach(function(o){var r=o[0],n=o[1];r!=="concat"&&gp(sm.prototype,r,n)});function sS(o){return{enumerable:!1,configurable:!0,get:function(){return this[zt].get_(o)},set:function(n){this[zt].set_(o,n)}}}function aS(o){qo(sm.prototype,""+o,sS(o))}function N_(o){if(o>Uf){for(var r=Uf;r<o+100;r++)aS(r);Uf=o}}N_(1e3);function lS(o,r,n){return new sm(o,r,n)}function Zo(o,r){if(typeof o=="object"&&o!==null){if(Ss(o))return r!==void 0&&ar(23),o[zt].atom_;if(Ts(o))return o[zt];if(so(o)){if(r===void 0)return o.keysAtom_;var n=o.data_.get(r)||o.hasMap_.get(r);return n||ar(25,r,Kf(o)),n}if(To(o)){if(!r)return ar(26);var u=o[zt].values_.get(r);return u||ar(27,r,Kf(o)),u}if(Jf(o)||pa(o)||pp(o))return o}else if($n(o)&&pp(o[zt]))return o[zt];ar(28)}function xl(o,r){if(o||ar(29),r!==void 0)return xl(Zo(o,r));if(Jf(o)||pa(o)||pp(o)||so(o)||Ts(o))return o;if(o[zt])return o[zt];ar(24,o)}function Kf(o,r){var n;if(r!==void 0)n=Zo(o,r);else{if(xp(o))return o.name;To(o)||so(o)||Ts(o)?n=xl(o):n=Zo(o)}return n.name_}var V0=yc.toString;function am(o,r,n){return n===void 0&&(n=-1),Wf(o,r,n)}function Wf(o,r,n,u,p){if(o===r)return o!==0||1/o===1/r;if(o==null||r==null)return!1;if(o!==o)return r!==r;var a=typeof o;if(a!=="function"&&a!=="object"&&typeof r!="object")return!1;var x=V0.call(o);if(x!==V0.call(r))return!1;switch(x){case"[object RegExp]":case"[object String]":return""+o==""+r;case"[object Number]":return+o!=+o?+r!=+r:+o==0?1/+o===1/r:+o==+r;case"[object Date]":case"[object Boolean]":return+o==+r;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(o)===Symbol.valueOf.call(r);case"[object Map]":case"[object Set]":n>=0&&n++;break}o=U0(o),r=U0(r);var C=x==="[object Array]";if(!C){if(typeof o!="object"||typeof r!="object")return!1;var D=o.constructor,R=r.constructor;if(D!==R&&!($n(D)&&D instanceof D&&$n(R)&&R instanceof R)&&"constructor"in o&&"constructor"in r)return!1}if(n===0)return!1;n<0&&(n=-1),u=u||[],p=p||[];for(var I=u.length;I--;)if(u[I]===o)return p[I]===r;if(u.push(o),p.push(r),C){if(I=o.length,I!==r.length)return!1;for(;I--;)if(!Wf(o[I],r[I],n-1,u,p))return!1}else{var ee=Object.keys(o),le;if(I=ee.length,Object.keys(r).length!==I)return!1;for(;I--;)if(le=ee[I],!(Go(r,le)&&Wf(o[le],r[le],n-1,u,p)))return!1}return u.pop(),p.pop(),!0}function U0(o){return Ss(o)?o.slice():vl(o)||so(o)||gc(o)||Ts(o)?Array.from(o.entries()):o}function mc(o){return o[Symbol.iterator]=uS,o}function uS(){return this}["Symbol","Map","Set"].forEach(function(o){var r=$0();typeof r[o]>"u"&&ar("MobX requires global '"+o+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:OE,extras:{getDebugName:Kf},$mobx:zt});function cS(o){throw new Error("[mobx-utils] "+o)}function Ip(o,r){r===void 0&&(r="Illegal state"),o||cS(r)}var U_=function(o){return o&&o!==Object.prototype&&Object.getOwnPropertyNames(o).concat(U_(Object.getPrototypeOf(o))||[])},hS=function(o){var r=U_(o),n=r.filter(function(u,p){return r.indexOf(u)===p});return n},j_=function(o){return hS(o).filter(function(r){return r!=="constructor"&&!~r.indexOf("__")})},$_="pending",Pp="fulfilled",lm="rejected";function pS(o){switch(this.state){case $_:return o.pending&&o.pending(this.value);case lm:return o.rejected&&o.rejected(this.value);case Pp:return o.fulfilled?o.fulfilled(this.value):this.value}}function V_(o,r){if(Ip(arguments.length<=2,"fromPromise expects up to two arguments"),Ip(typeof o=="function"||typeof o=="object"&&o&&typeof o.then=="function","Please pass a promise or function to fromPromise"),o.isPromiseBasedObservable===!0)return o;typeof o=="function"&&(o=new Promise(o));var n=o;o.then(kt("observableFromPromise-resolve",function(p){n.value=p,n.state=Pp}),kt("observableFromPromise-reject",function(p){n.value=p,n.state=lm})),n.isPromiseBasedObservable=!0,n.case=pS;var u=r&&r.state===Pp?r.value:void 0;return rm(n,{value:u,state:$_},{},{deep:!1}),n}(function(o){o.reject=kt("fromPromise.reject",function(n){var u=o(Promise.reject(n));return u.state=lm,u.value=n,u});function r(n){n===void 0&&(n=void 0);var u=o(Promise.resolve(n));return u.state=Pp,u.value=n,u}o.resolve=kt("fromPromise.resolve",r)})(V_||(V_={}));var kp=function(o,r,n,u){var p=arguments.length,a=p<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,n):u,x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,r,n,u);else for(var C=o.length-1;C>=0;C--)(x=o[C])&&(a=(p<3?x(a):p>3?x(r,n,a):x(r,n))||a);return p>3&&a&&Object.defineProperty(r,n,a),a};function dS(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}function Cs(o,r){var n;r===void 0&&(r=!1);var u=Yr(o);return n={subscribe:function(p){return typeof p=="function"?{unsubscribe:Tp(u,function(a){var x=a.newValue;return p(x)},r)}:p&&typeof p=="object"&&p.next?{unsubscribe:Tp(u,function(a){var x=a.newValue;return p.next(x)},r)}:{unsubscribe:function(){}}}},n[dS()]=function(){return this},n}var xC=function(){function o(r,n){var u=this;Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"subscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ii(this),Li(function(){u.current=n,u.subscription=r.subscribe(u)})}return Object.defineProperty(o.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.subscription&&this.subscription.unsubscribe()}}),Object.defineProperty(o.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.current=r}}),Object.defineProperty(o.prototype,"complete",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.dispose()}}),Object.defineProperty(o.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.current=r,this.dispose()}}),kp([Ot.ref],o.prototype,"current",void 0),kp([kt.bound],o.prototype,"next",null),kp([kt.bound],o.prototype,"complete",null),kp([kt.bound],o.prototype,"error",null),o}();var Mp=function(){return Mp=Object.assign||function(o){for(var r,n=1,u=arguments.length;n<u;n++){r=arguments[n];for(var p in r)Object.prototype.hasOwnProperty.call(r,p)&&(o[p]=r[p])}return o},Mp.apply(this,arguments)},Cc=function(o,r,n,u){var p=arguments.length,a=p<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,n):u,x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,r,n,u);else for(var C=o.length-1;C>=0;C--)(x=o[C])&&(a=(p<3?x(a):p>3?x(r,n,a):x(r,n))||a);return p>3&&a&&Object.defineProperty(r,n,a),a},fS=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"],wC=function(){function o(r){var n=this;Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"localValues",{enumerable:!0,configurable:!0,writable:!0,value:Ot.map({})}),Object.defineProperty(this,"localComputedValues",{enumerable:!0,configurable:!0,writable:!0,value:Ot.map({})}),Object.defineProperty(this,"isPropertyDirty",{enumerable:!0,configurable:!0,writable:!0,value:function(p){return n.localValues.has(p)}}),Ii(this),Ip(To(r),"createViewModel expects an observable object");var u=j_(this);j_(r).forEach(function(p){var a;if(!u.includes(p)&&!(p===zt||p==="__mobxDidRunLazyInitializers")){if(Ip(fS.indexOf(p)===-1,"The propertyname "+p+" is reserved and cannot be used with viewModels"),Sp(r,p)){var x=xl(r,p),C=x.derivation.bind(n),D=(a=x.setter_)===null||a===void 0?void 0:a.bind(n);n.localComputedValues.set(p,Yr(C,{set:D}))}var R=Object.getOwnPropertyDescriptor(r,p),I=R?{enumerable:R.enumerable}:{};Object.defineProperty(n,p,Mp(Mp({},I),{configurable:!0,get:function(){return Sp(r,p)?n.localComputedValues.get(p).get():n.isPropertyDirty(p)?n.localValues.get(p):n.model[p]},set:kt(function(ee){Sp(r,p)?n.localComputedValues.get(p).set(ee):ee!==n.model[p]?n.localValues.set(p,ee):n.localValues.delete(p)})}))}})}return Object.defineProperty(o.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"changedValues",{get:function(){return new Map(this.localValues)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"submit",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;I_(this.localValues).forEach(function(n){var u=r.localValues.get(n),p=r.model[n];Ss(p)?p.replace(u):so(p)?(p.clear(),p.merge(u)):k_(u)||(r.model[n]=u)}),this.localValues.clear()}}),Object.defineProperty(o.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.localValues.clear()}}),Object.defineProperty(o.prototype,"resetProperty",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.localValues.delete(r)}}),Cc([Yr],o.prototype,"isDirty",null),Cc([Yr],o.prototype,"changedValues",null),Cc([kt.bound],o.prototype,"submit",null),Cc([kt.bound],o.prototype,"reset",null),Cc([kt.bound],o.prototype,"resetProperty",null),o}();var mS=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),EC=function(o){mS(r,o);function r(n,u,p){var a=p===void 0?{}:p,x=a.name,C=x===void 0?"ogm"+(Math.random()*1e3|0):x,D=a.keyToName,R=D===void 0?function(le){return""+le}:D,I=o.call(this)||this;Object.defineProperty(I,"_base",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(I,"_ogmInfoKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(I,"_groupBy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(I,"_keyToName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(I,"_disposeBaseObserver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),I._keyToName=R,I._groupBy=u,I._ogmInfoKey=Symbol("ogmInfo"+C),I._base=n;for(var ee=0;ee<n.length;ee++)I._addItem(n[ee]);return I._disposeBaseObserver=Tp(I._base,function(le){if(le.type==="splice")jn(function(){for(var _e=0,$e=le.removed;_e<$e.length;_e++){var Oe=$e[_e];I._removeItem(Oe)}for(var De=0,fe=le.added;De<fe.length;De++){var ve=fe[De];I._addItem(ve)}});else if(le.type==="update")jn(function(){I._removeItem(le.oldValue),I._addItem(le.newValue)});else throw new Error("illegal state")}),I}return Object.defineProperty(r.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){throw new Error("not supported")}}),Object.defineProperty(r.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(n){throw new Error("not supported")}}),Object.defineProperty(r.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(n,u){throw new Error("not supported")}}),Object.defineProperty(r.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var u=this._base[n],p=u[this._ogmInfoKey];p.reaction(),delete u[this._ogmInfoKey]}}}),Object.defineProperty(r.prototype,"_getGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var u=o.prototype.get.call(this,n);return u===void 0&&(u=Ot([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),o.prototype.set.call(this,n,u)),u}}),Object.defineProperty(r.prototype,"_removeFromGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(n,u){var p=o.prototype.get.call(this,n);p.length===1?o.prototype.delete.call(this,n):(u===p.length-1||(p[u]=p[p.length-1],p[u][this._ogmInfoKey].groupArrIndex=u),p.length--)}}),Object.defineProperty(r.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var u=this,p=this._groupBy(n),a=this._getGroupArr(p),x={groupByValue:p,groupArrIndex:a.length,reaction:Ep(function(){return u._groupBy(n)},function(C,D){var R=n[u._ogmInfoKey];u._removeFromGroupArr(R.groupByValue,R.groupArrIndex);var I=u._getGroupArr(C),ee=I.length;I.push(n),R.groupByValue=C,R.groupArrIndex=ee})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:x}),a.push(n)}}),Object.defineProperty(r.prototype,"_removeItem",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var u=n[this._ogmInfoKey];this._removeFromGroupArr(u.groupByValue,u.groupArrIndex),u.reaction(),delete n[this._ogmInfoKey]}}),r}(Cp),yS=function(){function o(r,n){Object.defineProperty(this,"base",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closestIdx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1});for(var u=this.closest=this.root=r,p=0;p<this.args.length-1&&(u=u.get(n[p]),u);p++)this.closest=u;this.closestIdx=p}return Object.defineProperty(o.prototype,"exists",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertNotDisposed();var r=this.args.length;return this.closestIdx>=r-1&&this.closest.has(this.args[r-1])}}),Object.defineProperty(o.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");return this.closest.get(this.args[this.args.length-1])}}),Object.defineProperty(o.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertNotDisposed();for(var n=this.args.length,u=this.closest,p=this.closestIdx;p<n-1;p++){var a=new Map;u.set(this.args[p],a),u=a}this.closestIdx=n-1,this.closest=u,u.set(this.args[n-1],r)}}),Object.defineProperty(o.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var r=this.args.length;this.closest.delete(this.args[r-1]);for(var n=this.root,u=[n],p=0;p<r-1;p++)n=n.get(this.args[p]),u.push(n);for(var p=u.length-1;p>0;p--)u[p].size===0&&u[p-1].delete(this.args[p-1]);this.isDisposed=!0}}),Object.defineProperty(o.prototype,"assertNotDisposed",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isDisposed)throw new Error("Concurrent modification exception")}}),o}(),SC=function(){function o(){Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"argsLength",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"last",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(o.prototype,"entry",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.argsLength===-1)this.argsLength=r.length;else if(this.argsLength!==r.length)throw new Error("DeepMap should be used with functions with a consistent length, expected: "+this.argsLength+", got: "+r.length);return this.last&&(this.last.isDisposed=!0),this.last=new yS(this.store,r)}}),o}();var vr=class extends Error{constructor(r,n){super(r),this.name=this.constructor.name,this.cause=n}};var Tn=class extends vr{constructor(n,u,p){super(`Failed to evaluate expression <${n}>: ${p.join(", ")}`);this.reason=u;this.errors=p}};function gS(o,r){if(!r.store)throw new Tn(r.expression,"evaluationError",["no state store provided"]);let n=o.slice(1).join("."),u=r.store.get(n);return Nn(u)?null:typeof u=="object"?["literal",u]:u}var q_={name:"state",fn:gS};var _S={schemeGroups:{sequential:["BuGn","BuPu","GnBu","OrRd","PuBu","PuBuGn","PuRd","RdPu","YlGn","YlGnBu","YlOrBr","YlOrRd"],singlehue:["Blues","Greens","Greys","Oranges","Purples","Reds"],diverging:["BrBG","PiYG","PRGn","PuOr","RdBu","RdGy","RdYlBu","RdYlGn","Spectral"],qualitative:["Accent","Dark2","Paired","Pastel1","Pastel2","Set1","Set2","Set3"]},YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},um=_S;var cm={};function vS(){Object.keys(um).filter(o=>o!=="schemeGroups").forEach(o=>cm[o]={id:o,colors:um[o][5]})}function bS(o,r){let n=o[1],u=o[2],p=o.slice(3),a,x;if(sn(n))a=n,x=cm[n]?.colors||cm.Greys.colors;else if(T0(n)&&n[0]==="literal")a="custom",x=n[1];else throw new Tn(r.expression,"evaluationError",["from-palette requires palette id as string or custom palette array"]);let C=x.length,D=!1;if(C<5)throw new Tn(r.expression,"evaluationError",["custom palette requires at least 5 color entries"]);switch(p.length){case 2:break;case 3:D=!!p[2],p=p.slice(0,2);break;case C:break;case C+1:D=!!p[C],p=p.slice(0,C);break;default:throw new Tn(r.expression,"evaluationError",["incorrect color stop arguments"])}if(p.length===2){let R=p[0],I=p[1];p=[];let ee=(I-R)/(C-1);for(let le=0;le<C;le++)p.push(R+le*ee)}o=["interpolate-lab",["linear"],u];for(let R=0;R<p.length;R++)o.push(p[R]),o.push(D?x[p.length-R-1]:x[R]);return o}var G_={name:"from-palette",initialize:vS,fn:bS};var wl=class{static hasCustomFunction(r){return!!this.customFunctions[r]}static registerCustomFunction(r){r.initialize&&r.initialize(),this.customFunctions[r.name]=r}_expression="";parsedResult;_store=null;static parseProgram(r){let n=this.parser.parseProgram(r);if(sn(r)&&r.length===0)return{};if(n.status)return Object.keys(n.value).reduce((a,x)=>{let C=n.value[x],D=r.slice(C.start.offset,C.end.offset);return a[x]=new wl(D,C.expr),a},{});throw new Tn("program","parseError",[`expected ${n.expected.join(" ")} at line ${n.index.line}, column ${n.index.column}]`])}get maplibreExpression(){if(this.isParseError(this.parsedResult))throw this.parseError;return this.expandCustomFunctions(this.parsedResult.value)}get value(){return this.evaluateExpression()}get parseError(){return this.isParseError(this.parsedResult)?new Tn(this._expression,"parseError",[`index: ${this.parsedResult.index.offset}`,`expected: ${this.parsedResult.expected.join(" ")}`]):null}get expression(){return this._expression}get store(){return this._store}constructor(r,n){Ii(this,{_store:Ot.ref,maplibreExpression:Yr,value:Yr,bindState:kt},{name:this.formatName(r)}),this._expression=r,uc(n)?this.parsedResult=wl.parser.parseExpression(r):this.parsedResult={status:!0,value:n}}bindState(r){return this._store=r,this}toStream(r=!0){return Cs(()=>this.value,r)}evaluateExpression(){let{result:r,value:n}=rp.createExpression(this.maplibreExpression);if(r==="success")return n.evaluate({zoom:0});throw new Tn(this.expression,"evaluationError",n.map(u=>u.message))}expandCustomFunctions(r){if(this.isFunctionExpression(r)){let n=r[0],u=r.slice(1).map(p=>this.expandCustomFunctions(p));return r=[n,...u],wl.hasCustomFunction(n)?wl.customFunctions[n].fn(r,this):r}return r}isParseError(r){return!r.status}isFunctionExpression(r){return Array.isArray(r)}formatName(r){return`FlowCoreExpression<${r}>}`}},an=wl;Ai(an,"parser",new ip),Ai(an,"customFunctions",{});an.registerCustomFunction(q_);an.registerCustomFunction(G_);var lv=Yn(Cl()),uv=Yn(J_()),$p=Yn(Q_());var Fp=class extends vr{constructor(r,n){super(r,n)}};var kc=class{state=null;options;baseStyle;sources={};layers={};layerOrder=[];get styleSpecification(){let r={...this.baseStyle,sources:{...this.baseStyle.sources},layers:[...this.baseStyle.layers]};return Object.values(this.sources).forEach(n=>{r.sources[n.id]=n.dataSourceSpecification}),this.layerOrder.forEach(n=>{let u=this.layers[n],p=u.layerSpecification,a=r.layers.findIndex(x=>x.id===n);if(a>=0){let x=r.layers[a],C={...x,paint:{...x.paint,...p.paint},layout:{...x.layout,...p.layout}};r.layers.splice(a,1,C)}else{r.sources[u.source].type==="vector"&&Nn(p["source-layer"])&&(p["source-layer"]="geometry");let C=this.layerInsertionPoint(u,r);r.layers.splice(C,0,u.layerSpecification)}}),r}get id(){return this.baseStyle.id}constructor(r){this.options={...kc.defaultOptions,...r},this.baseStyle=kc.defaultBaseStyle,Ii(this,{options:Ot,sources:Ot,layers:Ot,layerOrder:Ot,baseStyle:Ot.ref,styleSpecification:Yr,bindState:kt,setBaseStyle:kt,addSource:kt,removeSource:kt,addLayer:kt,removeLayer:kt},{name:this.formattedName(this.id)})}bindState(r){return this.state=r,r.transaction(()=>{Object.values(this.sources).forEach(n=>n.bindState(r)),Object.values(this.layers).forEach(n=>n.bindState(r))}),this}setBaseStyle(r){return this.baseStyle=r?Object.freeze({...r}):kc.defaultBaseStyle,this}addSource(r){return this.sources[r.id]=r,r.bindState(this.state),this}removeSource(r,n=!1){if(!this.sources[r])throw new vr(`${this.formattedName()}: no source with id '${r}'`);let u=Object.values(this.layers).filter(p=>p.source===r).map(p=>p.id);if(n)u.forEach(p=>this.removeLayer(p));else if(u.length)throw new vr(`${this.formattedName()}: cannot remove source with id '${r}' when in use by layers ${u.join(", ")}`);return delete this.sources[r],this}getSource(r){let n=this.sources[r];if(!n)throw new vr(`${this.formattedName()}: no source with id '${r}'`);return n}getSources(r){return Object.values(this.sources).filter(n=>r?r(n):!0)}addLayer(r){if(!this.sources[r.source]&&!this.baseStyle.sources[r.source])throw new vr(`${this.formattedName()}: no source with id '${r.source}'`);return this.layers[r.id]=r,this.layerOrder.push(r.id),r.bindState(this.state),this}removeLayer(r){if(!this.layers[r])throw new vr(`${this.formattedName()}: no layer with id '${r}'`);delete this.layers[r];let n=this.layerOrder.indexOf(r);return this.layerOrder.splice(n,1),this}getLayer(r){let n=this.layers[r];if(!n)throw new vr(`${this.formattedName()}: no layer with id '${r}'`);return n}getLayers(r){return this.layerOrder.map(n=>this.layers[n]).filter(n=>r?r(n):!0)}formattedName(r){return`FlowCoreMapStyle<${r||this.id}>`}layerInsertionPoint(r,n){let u=-1;if(r.above)u=n.layers.findIndex(p=>p.id===r.above),u>=0&&u++;else if(r.below)u=n.layers.findIndex(p=>p.id===r.below);else{let p=n.metadata?.insertionPoints?.[r.type];u=n.layers.findIndex(a=>a.id===p)}return u===-1&&(u=n.layers.length),u}},Al=kc;Ai(Al,"defaultOptions",{}),Ai(Al,"defaultBaseStyle",Object.freeze({version:8,id:"default",name:"Default base style",sources:{},layers:[]}));var kl=class{options;state=null;filter=null;paintProps={};layoutProps={};get layerSpecification(){this.options.above,this.options.below;let r={id:this.options.id,type:this.options.type,source:this.options.source};return io(this.options.minZoom)&&(r.minzoom=this.options.minZoom),io(this.options.maxZoom)&&(r.maxzoom=this.options.maxZoom),io(this.options.sourceLayer)&&(r["source-layer"]=this.options.sourceLayer),io(this.filter)&&(r.filter=this.filter.maplibreExpression),Nf(this.paintProps)&&(r.paint=Object.keys(this.paintProps).reduce((n,u)=>(n[u]=this.paintProps[u].maplibreExpression,n),{})),Nf(this.layoutProps)&&(r.layout=Object.keys(this.layoutProps).reduce((n,u)=>{let p=this.layoutProps[u].maplibreExpression;return u==="visibility"&&(p=this.layoutProps[u].value?"visible":"none"),n[u]=p,n},{})),r}get id(){return this.options.id}get type(){return this.options.type}get source(){return this.options.source}get interactive(){return!!this.options.interactive}get above(){return this.options.above}get below(){return this.options.below}constructor(r,n){this.options={...kl.defaultOptions,...r},this.getPropertyMetadata("visibility",r.type),Ii(this,{paintProps:Ot,layoutProps:Ot,filter:Ot,options:Ot,layerSpecification:Yr,bindState:kt,setMinZoom:kt,setMaxZoom:kt,setInteractive:kt,setAbove:kt,setBelow:kt,setStyle:kt,setStyleProperty:kt,setFilter:kt},{name:this.formattedName(r.id)}),r.filter&&this.setFilter(r.filter),n&&this.setStyle(n)}bindState(r){return this.state=r,this.filter&&this.filter.bindState(r),Object.values(this.paintProps).forEach(n=>n.bindState(r)),Object.values(this.layoutProps).forEach(n=>n.bindState(r)),this}setMinZoom(r){return this.options.minZoom=r,this}setMaxZoom(r){return this.options.maxZoom=r,this}setInteractive(r){return this.options.interactive=r,this}setAbove(r){return this.options.above=r,this}setBelow(r){return this.options.below=r,this}setStyle(r){let n=an.parseProgram(r);Object.keys(n).forEach(p=>{let x=this.getPropertyMetadata(p,this.options.type).type==="paint"?this.paintProps:this.layoutProps;x[p]=n[p].bindState(this.state)})}setStyleProperty(r,n){let p=this.getPropertyMetadata(r,this.options.type).type==="paint"?this.paintProps:this.layoutProps;if(Nn(n))delete p[r];else{let a=new an(n).bindState(this.state);if(a.parseError)throw a.parseError;p[r]=a}}setFilter(r){if(this.filter=null,io(r)){let n=new an(r).bindState(this.state);if(n.parseError)throw n.parseError;rp.isExpressionFilter(n.maplibreExpression)||(n=new an(n.expression,["to-boolean",n.maplibreExpression])),this.filter=n}}formattedName(r){return`FlowCoreMapLayer<${r||this.options.id}>`}getPropertyMetadata(r,n){kl.propertyMetadataIndex||kl.initializePropertyMetadataIndex();let u=kl.propertyMetadataIndex[n];if(!u)throw new vr(`${this.formattedName()}: unknown layer type '${n}'`);let p=u[r];if(!p)throw new vr(`${this.formattedName()}: unknown layer property '${r}'`);return p}static initializePropertyMetadataIndex(){let r=Object.keys(ic.layer.type.values);this.propertyMetadataIndex=r.reduce((n,u)=>(n[u]={},["layout","paint"].forEach(p=>{Object.keys(ic[`${p}_${u}`]).forEach(a=>{n[u][a]={property:a,type:p,definition:ic[`${p}_${u}`][a]}})}),n),{})}},Rp=kl;Ai(Rp,"propertyMetadataIndex"),Ai(Rp,"defaultOptions",{interactive:!0,minZoom:0,maxZoom:18});var tv=Symbol("FlowCoreStateStoreMarker"),ev=Symbol("FlowCoreStateStorCache"),fm=class{nextIds={};getNextId(r){return this.nextIds[r]=this.nextIds[r]?this.nextIds[r]+1:1}formattedName;_initialized=!1;constructor(){let r=Reflect.getPrototypeOf(this).constructor.name;this.formattedName=`FlowCoreStateStore<${r}#${this.getNextId(r)}>`}initialize(r={}){if(this._initialized)throw new vr(`${this.formattedName}: initialize() called multiple times`);let n=Reflect.getPrototypeOf(this).constructor.name;this.makeSimpleAutoObservable(this,r,{name:this.formattedName}),this._initialized=!0}get(r){this.checkInitialized();let n=r,u=this,p=n.split("."),a;for(;a=p.shift();)u=u[a];return u}set(r,n){this.checkInitialized();let u=r.split("."),p,a=this;for(;u.length>1;)p=u.shift(),a=a[p];p=u.shift(),a[p]=n}transaction(r){this.checkInitialized(),Li(()=>r(this))}toggle(r){this.checkInitialized();let n=!this.get(r);return this.set(r,n),n}increment(r){this.checkInitialized();let n=+this.get(r)+1;return this.set(r,n),n}decrement(r){this.checkInitialized();let n=+this.get(r)-1;return this.set(r,n),n}toStream(r,n=!0){return this.checkInitialized(),Cs(()=>this.get(r),n)}autorun(r,n){return this.checkInitialized(),wp(()=>r(this),{name:n})}makeSimpleAutoObservable(r,n={},u){n={...n,_initialized:!1,$mobx:!1,constructor:!1};let p=r[ev];if(!p){p={};let a=r;for(;a&&!Object.hasOwn(a,tv);)Reflect.ownKeys(a).forEach(C=>{p[C]=n&&C in n?n[C]:!0}),a=Object.getPrototypeOf(a);let x=Object.getPrototypeOf(r);x&&Object.defineProperty(x,ev,{value:p})}return p={...p,set:kt,toggle:kt,increment:kt,decrement:kt},Ii(r,p,u)}checkInitialized(){if(!this._initialized)throw new vr(`${this.formattedName} not initialized. 'this.initialize()' must be called in constructor`)}};fm.prototype[tv]=!0;function FS(){nm()}var ym=class{options;srcExpression=null;parameters={};state=null;get id(){return this.options.id}get type(){return this.options.type}get featureId(){return this.options.featureId}get dataSourceSpecification(){let r=this.srcExpression?P_(this.srcExpression.value):this.options.src;sn(r)&&(r=this.expandSrc(r,this.options.type));let n;switch(this.options.type){case"vector":return n=gs(r)?{type:"vector",url:r}:{type:"geojson",data:{type:"FeatureCollection",features:[]}},this.options.featureId&&(n.promoteId=this.options.featureId),n;case"raster":return n=gs(r)?{type:"raster",url:r}:{type:"geojson",data:{type:"FeatureCollection",features:[]}},n;case"geojson":return n={type:"geojson",data:r||{type:"FeatureCollection",features:[]}},this.options.cluster&&(n.cluster=!0,n.clusterMaxZoom=this.options.clusterMaxZoom,n.clusterMinPoints=this.options.clusterMinPoints,n.clusterRadius=this.options.clusterRadius),this.options.featureId&&(n.promoteId=this.options.featureId),n;default:throw new vr(`${this.formattedName()}: unrecognized type '${this.options.type}'`)}}constructor(r){if(this.options={...ym.defaultOptions,...r},!C0(r.type,["vector","geojson","raster"]))throw new vr(`${this.formattedName()}: unrecognized type '${r.type}'`);this.setSrcExpression(r.src),Ii(this,{options:Ot,srcExpression:Ot,parameters:Ot,dataSourceSpecification:Yr,bindState:kt,setSrc:kt,setParameter:kt},{name:this.formattedName(r.id)})}bindState(r){return this.state=r,this.srcExpression&&this.srcExpression?.bindState(r),Object.values(this.parameters).forEach(n=>n.bindState(r)),this}setSrc(r){this.options.src=r,this.setSrcExpression(r)}setParameter(r,n){if(Nn(n))delete this.parameters[r];else{let u=new an(n);this.parameters[r]=u.bindState(this.state)}}setFlowEndpoint(r){this.options.flowHost=r.host,this.options.flowApiKey=r.apiKey}formattedName(r){return`FlowCoreMapDataSource<${r||this.options.id}>`}setSrcExpression(r){sn(r)?(cc(r)&&(r=`'${r}'`),this.srcExpression=new an(r),this.srcExpression.bindState(this.state)):this.srcExpression=null}expandSrc(r,n){let u=this.options.flowHost,p=!1;if(!cc(r))switch(n){case"vector":case"raster":r=`${u}/tiles/${r}/index.json`;break;case"geojson":r=`${u}/api/v1/datasets/${r}/query`,p=!0;break;default:throw new vr(`${this.formattedName()}: unrecognized type '${this.options.type}'`)}let a=new URL(r),x=new URLSearchParams(a.searchParams);return Object.entries(this.parameters).filter(([C,D])=>!Nn(D.value)).forEach(([C,D])=>x.append(C,D.value)),!x.has("apikey")&&this.options.flowApiKey&&x.append("apikey",this.options.flowApiKey),this.options.limit&&x.append("limit",this.options.limit.toString(10)),p&&x.append("format","geojson"),a.search=x.toString(),a.toString()}},mm=ym;Ai(mm,"defaultOptions",{type:"vector",cluster:!1,clusterRadius:50,clusterMaxZoom:20,clusterMinPoints:2,flowHost:"https://flow.emu-analytics.net"});function gm(o,r){if(!o)throw new vr(r??"Assertion failed")}var RS=Symbol("Do not memoize");function LS(o,r){let n=new Map,u=r.hash?r.hash:(...a)=>a[0],p=r.context;return function(...x){let C=u.apply(p,x);if(C===RS)return o.apply(p,x);let D;return n.has(C)?D=n.get(C):(D=o.apply(p,x),n.set(C,D)),D}}function _m(o,r){let{delay:n,noTrailing:u=!1,noLeading:p=!1,debounceMode:a=void 0}=r,x,C=!1,D=0;function R(){x&&clearTimeout(x)}function I(le){let{upcomingOnly:_e=!1}=le||{};R(),C=!_e}function ee(...le){let _e=r.context,$e=Date.now()-D;if(C)return;function Oe(){D=Date.now(),o.apply(_e,le)}function De(){x=void 0}!p&&a&&!x&&Oe(),R(),a===void 0&&$e>n?p?(D=Date.now(),u||(x=setTimeout(a?De:Oe,n))):Oe():u!==!0&&(x=setTimeout(a?De:Oe,a===void 0?n-$e:n))}return ee.cancel=I,ee}function BS(o,r){let{delay:n,context:u,atBegin:p=!1}=r;return _m(o,{delay:n,debounceMode:p!==!1,context:u})}function rv(o,r){let n=LS(()=>BS(o,r),r);return(...u)=>{n(...u)(...u)}}var nv=Yn(Cl());var iv=(o="",r=!1)=>o.slice(0,1).toUpperCase()+(r?o.slice(1).toLowerCase():o.slice(1));var Lp=class{listeners;constructor(){this.listeners=[],document.addEventListener("keydown",this.handleKeyboardEvent)}addListener(r,n){r=this.splitEventBindings(r);let u=this.addToListeners({bindings:r,priority:n??0});return()=>{this.removeFromListeners(u)}}handleKeyboardEvent=r=>{if(this.isInputEvent(r))return;let n=this.keyDefinitionFromEvent(r);for(let u of this.listeners){let p=u.bindings[n];if(p){if(p(r)===!0)continue;r.stopPropagation();return}}};splitEventBindings(r){let n={};for(let u in r)u.split(",").forEach(p=>{n[this.normalizeKeyDefinition(p)]=r[u]});return n}isInputEvent(r){if(r.target instanceof Node)switch(r.target.nodeName){case"INPUT":case"SELECT":case"TEXTAREA":return!0;default:return!1}return!1}addToListeners(r){return this.listeners.push(r),this.listeners.sort((n,u)=>u.priority-n.priority),r}removeFromListeners(r){this.listeners=this.listeners.filter(n=>n!==r)}normalizeKeyDefinition(r){let n=r.split("+"),u={ctrlKey:n.includes("Ctrl"),shiftKey:n.includes("Shift"),altKey:n.includes("Alt"),metaKey:n.includes("Meta"),code:n[n.length-1]};return this.keyDefinitionFromEvent(u)}keyDefinitionFromEvent(r){let n="";return r.ctrlKey&&(n+="Ctrl+"),r.shiftKey&&(n+="Shift+"),r.altKey&&(n+="Alt+"),r.metaKey&&(n+="Meta+"),n+=r.code,n}};var NS=(0,nv.default)("flow:map-plugin-manager"),Bp=class{_map;_keyboardShortcutManager=new Lp;_plugins=new Map;_initialized=!1;_exclusivePlugins=new Set;get map(){return this._map}constructor(r){this._map=r,this.map.initialized.then(()=>{this._initialized=!0;for(let n of this._plugins.values())n.initialize&&n.initialize()})}usePlugin(r,n){let u=new r(this,n);return this._plugins.set(r,u),NS(`${this.map.formattedName()}: Using plugin '${u.name}'`),this._initialized&&u.initialize&&u.initialize(),this}getPlugin(r){let n,u;if(sn(r)?(u=Array.from(this._plugins.values()).find(p=>p.name===r),n=r):(u=this._plugins.get(r),n=r.name),!u)throw new vr(`<${n}>: plugin not registered`);return u}removePlugin(r){let n=this._plugins.get(r);return n&&n.destroy&&n.destroy(),this._plugins.delete(r),this}removeAllPlugins(){return this._plugins.forEach(r=>{r.destroy&&r.destroy()}),this._plugins.clear(),this}setExclusivePlugin(r){return this._exclusivePlugins.add(r),this.forwardSetExclusivePlugin(),this}removeExclusivePlugin(r){return this._exclusivePlugins.delete(r),this.forwardSetExclusivePlugin(),this}addKeyboardShortcuts(r,n=0){return this._keyboardShortcutManager.addListener(r,n)}forwardEvent(r,...n){let u=`handle${iv(r)}`;this._plugins.forEach(p=>{if(this._exclusivePlugins.size&&!this._exclusivePlugins.has(p))return;let a=p[u];a&&a.apply(p,n)})}forwardStyleChangeEvent(r){return this._plugins.forEach(n=>{if(!(this._exclusivePlugins.size&&!this._exclusivePlugins.has(n))&&n.handleBeforeStyleChanged){let u=n.handleBeforeStyleChanged(r);u&&(r.newStyle=u)}}),r.newStyle}bindState(r){return this._plugins.forEach(n=>{n.bindState&&n.bindState(r)}),this}forwardSetExclusivePlugin(){this._plugins.forEach(r=>{r.handleSetExclusivePlugin&&r.handleSetExclusivePlugin(Array.from(this._exclusivePlugins))})}};var ao=class{type;map;originalEvent;static fromMaplibreEvent(r,n,u){return new ao(r,n,u.originalEvent)}constructor(r,n,u){this.type=r,this.map=n,this.originalEvent=u}},As=class extends ao{point;lngLat;features;static fromMaplibreMouseEvent(r,n,u,p){return new As(r,u,[n.point.x,n.point.y],[n.lngLat.lng,n.lngLat.lat],p,n.originalEvent)}constructor(r,n,u,p,a,x){super(r,n,x),this.point=u,this.lngLat=p,this.features=a}},Co=class extends ao{source;constructor(r,n,u){super(r,n),this.source=u}},Np=class extends ao{loading;constructor(r,n){super("loading",r),this.loading=n}},Il=class extends ao{oldStyle;newStyle;constructor(r,n,u,p){super(r,n),this.oldStyle=u,this.newStyle=p}};var ov=Yn(Cl());var bk=(0,ov.default)("emu:feature-stream"),jp=class{_boundHandleLoading;_boundHandleSourceFeatureState;_options;_sourceLoadCount=0;_sourceLoaded=!0;constructor(r){this._options={fireImmediately:!0,...r},r.map.getSource(r.source).type==="vector"&&(this._options.sourceLayer??="geometry"),Ii(this,{_options:Ot,_sourceLoadCount:Ot,featureData:Yr.struct}),this._boundHandleLoading=this.handleLoading.bind(this),this._boundHandleSourceFeatureState=this.handleSourceFeatureState.bind(this),Ec(this,"featureData",this.resume.bind(this)),da(this,"featureData",this.suspend.bind(this))}get featureData(){return this._sourceLoadCount,this.queryFeatureData(this._options.featureIds)}get featureIds(){return this._options.featureIds}set featureIds(r){Li(()=>{this._options.featureIds=r})}subscribe(r){let n=Cs(()=>this.featureData,this._options.fireImmediately).subscribe(r);return{unsubscribe:()=>{n.unsubscribe()}}}featureFromMaplibreFeature(r){return{id:r.id,geometry:r.geometry,source:this._options.source,sourceLayer:this._options.sourceLayer,properties:r.properties,state:this._options.map.maplibreMap.getFeatureState({id:r.id,source:this._options.source,sourceLayer:this._options.sourceLayer})}}handleLoading(r){let n=!1;r.type==="sourcedata"&&r.sourceId===this._options.source?n=r.isSourceLoaded:r.type==="idle"&&(n=!0),this._sourceLoaded!==n&&(this._sourceLoaded=n,n&&Li(()=>{this._sourceLoadCount++}))}handleSourceFeatureState(r){r.type==="sourceFeatureState"&&r.source===this._options.source&&Li(()=>{this._sourceLoadCount++})}queryFeatureData(r){if(r.length===0)return{};let n=this._options.map.getSource(this._options.source),u=this._options.map.maplibreMap.querySourceFeatures(this._options.source,{sourceLayer:this._options.sourceLayer,filter:["in",["get",n.featureId],["literal",r]]}),p=new Set;return u=u.filter(x=>p.has(x.id)?!1:p.add(x.id)&&!0),u.reduce((x,C)=>(x[C.id]=this.featureFromMaplibreFeature(C),x),{})}resume(){this._options.map.maplibreMap.on("sourcedata",this._boundHandleLoading),this._options.map.maplibreMap.on("idle",this._boundHandleLoading),this._options.map.on("sourceFeatureState",this._boundHandleSourceFeatureState)}suspend(){this._options.map.maplibreMap.off("sourcedata",this._boundHandleLoading),this._options.map.maplibreMap.off("idle",this._boundHandleLoading),this._options.map.off("sourceFeatureState",this._boundHandleSourceFeatureState)}};var av=Yn(Cl()),wk=(0,av.default)("flow:image-registry"),sv="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' class='flowicon'%3E%3C!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256 256-114.6 256-256S397.4 0 256 0zm0 400c-18 0-32-14-32-32s13.1-32 32-32c17.1 0 32 14 32 32s-14.9 32-32 32zm69.1-142L280 286v2c0 13-11 24-24 24s-24-11-24-24v-16c0-8 4-16 12-21l57-34c7-4 11-11 11-19 0-12-10.9-22-22.9-22H238c-12.9 0-22 10-22 22 0 13-11 24-24 24s-24-11-24-24c0-39 31-70 69.1-70h51.1c40.8 0 71.8 31 71.8 70 0 24-13 47-34.9 60z'/%3E%3C/svg%3E",Vp=class{registry=new Map;_unknownImage=null;get unknownImage(){if(!this._unknownImage){let r=new Image(40,40);r.src=sv,this._unknownImage={id:"unknown-image",src:sv,pixelDensity:2,image:r}}return this._unknownImage}constructor(){}registerImage(r,n,u,p,a=2,x=!1){let C={id:r,src:n,width:u,height:p,pixelDensity:a,recolor:x};return this.registry.set(r,C),C}getImage(r){let n=this.registry.get(r);return n?(n.image||(n.image=this.loadImage(n.src,n.width,n.height,n.pixelDensity)),n):this.unknownImage}loadImage(r,n,u,p=2){let a=new Image;return a.crossOrigin="Anonymous",a.width=n?n*p:a.width,a.height=u?u*p:a.height,a.src=r,a}};var Up=(0,lv.default)("flow:flow-core-map"),jS=200,bm=class extends uv.default{_initialized;_loading=!0;_state=null;debouncedEmitSourceEvent;imageRegistry=new Vp;options;pluginManager;resolveInitialized=()=>{};style;styleUpdateSubscription=null;throttledMouseMove=_m(this.handleMouseMove,{delay:jS,noLeading:!0,context:this});updateMapStyle=r=>{let n=this.maplibreMap.getStyle(),u=new Il("beforeStyleChanged",this,n,r);r=this.pluginManager.forwardStyleChangeEvent(new Il("beforeStyleChanged",this,n,r)),this.emit(u.type,u),Up(`${this.formattedName()}: Updating style`,r),this.maplibreMap.setStyle(r),this.emitEvent(new Il("styleChanged",this,n,r))};maplibreMap;constructor(r){super(),this.options={...bm.defaultOptions,...r},this.style=new Al({id:"style"}),this.debouncedEmitSourceEvent=rv(this.emitEvent,{delay:20,hash:n=>n.source,context:this}),this._initialized=new Promise(n=>{this.resolveInitialized=n}),this.pluginManager=new Bp(this),this.initialize()}get client(){return this.options.flowClient}get container(){return this.maplibreMap.getContainer()}get id(){return this.options.id}get initialized(){return this._initialized}get state(){return this._state}get styleSpecification(){return this.style.styleSpecification}addLayer(r){return this.style.addLayer(r),this}addSource(r){return this.emitEvent(new Co("beforeSourceAdded",this,r.id)),r.setFlowEndpoint({host:this.options.flowClient.baseUrl,apiKey:this.options.flowClient.apiKey||void 0}),this.style.addSource(r),this.emitEvent(new Co("sourceAdded",this,r.id)),this}bindState(r){return this._state=r,this.style.bindState(r),this.pluginManager.bindState(r),this}destroy(){this.pluginManager.removeAllPlugins(),this.styleUpdateSubscription?.unsubscribe(),this.maplibreMap?.remove(),this.emit("destroyed",new ao("destroyed",this))}emitError(r,n){let u=new Fp(`${this.formattedName()}: ${r}`,n);this.pluginManager.forwardEvent("error",u),this.listenerCount("error")?this.emit("error",u):console.error(u)}emitEvent(r){this.pluginManager.forwardEvent(r.type,r),this.emit(r.type,r)}featureStream(r){return new jp({map:this,...r})}formattedName(){return`FlowCoreMap<${this.options.id}>`}getFeatureState(r){return this.maplibreMap.getFeatureState(r)}getLayer(r){return this.style.getLayer(r)}getLayers(r){return this.style.getLayers(r)}getPlugin(r){return this.pluginManager.getPlugin(r)}getSource(r){return this.style.getSource(r)}getSources(r){return this.style.getSources(r)}registerImage(r,n,u,p,a=2,x=!1){Up(`${this.formattedName()}: Registering image '${r}'`),this.imageRegistry.registerImage(r,n,u,p,a,x)}removeFeatureState(r,n,u=!0){if(Nn(r.id)&&io(n)){let p=this.maplibreMap.style;p._checkLoaded();let a=r.source,x=p.sourceCaches[a];if(x===void 0)throw new vr(`The source '${a}' does not exist in the map's style.`);let C=x._state,R=x.getSource().type==="vector"?r.sourceLayer??"geometry":"_geojsonTileLayer";if(C.deletedStates[R]=C.deletedStates[R]||{},C.deletedStates[R]===null)return;C.state[R]&&Object.keys(C.state[R]).forEach(ee=>{C.deletedStates[R][ee]!==null&&(C.deletedStates[R][ee]=C.deletedStates[R][ee]||{},C.deletedStates[R][ee][n]=null)}),this.maplibreMap._update()}else this.maplibreMap.removeFeatureState(r,n);if(u){let p=new Co("sourceFeatureState",this,r.source);this.debouncedEmitSourceEvent(p)}}removeLayer(r){return this.style.removeLayer(r),this}removeSource(r,n=!1){return this.emitEvent(new Co("beforeSourceRemoved",this,r)),this.style.removeSource(r,n),this.emitEvent(new Co("sourceRemoved",this,r)),this}async setBaseStyle(r){let n=await this.loadBaseStyle(r);this.style.setBaseStyle(n)}getCenter(){let r=this.maplibreMap.getCenter(),n=this.maplibreMap.getZoom(),u=this.maplibreMap.getBearing(),p=this.maplibreMap.getPitch();return{lng:r.lng,lat:r.lat,zoom:n,bearing:u,pitch:p}}setCenter(r,n){let u=io(r.lng)&&io(r.lat)?new $p.LngLat(r.lng,r.lat):void 0,p=this.maplibreMap.jumpTo;if(n)switch(n.mode){case"ease":p=this.maplibreMap.easeTo;break;case"fly":p=this.maplibreMap.flyTo;break;default:p=this.maplibreMap.jumpTo}let a={center:u,...r,...n};return p.call(this.maplibreMap,a),this}getBounds(){let r=this.maplibreMap.getBounds();return[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}setBounds(r,n){let u={linear:!n||n.mode==="ease"||n.mode==="jump",animate:!!n&&n.mode!=="jump",...n};this.maplibreMap.fitBounds(r,u)}setFeatureState(r,n,u=!0){let p=this.getSource(r.source);if(gm(gs(p.featureId)),p?.type==="vector"&&(r.sourceLayer=r.sourceLayer||"geometry"),this.maplibreMap.setFeatureState(r,n),u){let a=new Co("sourceFeatureState",this,r.source);this.debouncedEmitSourceEvent(a)}}setFeatureStateBulk(r,n){let u=this.getSource(r.source);gm(gs(u.featureId)),this.maplibreMap.style._checkLoaded();let p=this.maplibreMap.style.sourceCaches[r.source];if(uc(p))throw new vr(`${this.formattedName()}: the source '${r.source}' does not exist in the map's style.`);let a=p.getSource().type==="vector"?r.sourceLayer??"geometry":"";Object.keys(n).forEach(C=>{p.setFeatureState(a,C,n[C])}),this.maplibreMap._update();let x=new Co("sourceFeatureState",this,r.source);this.debouncedEmitSourceEvent(x)}transaction(r){Li(()=>r())}usePlugin(r,n){return this.pluginManager.usePlugin(r,n),this}usePlugins(r){return r.forEach(n=>this.usePlugin(n)),this}bindMapEvents(){this.maplibreMap.on("error",n=>this.emitError(n.error.message,n.error)),this.maplibreMap.on("mousemove",this.throttledMouseMove),this.maplibreMap.on("mouseout",this.throttledMouseMove),this.maplibreMap.on("click",this.handleMouseClick("click").bind(this)),this.maplibreMap.on("dblclick",this.handleMouseClick("dblClick").bind(this)),this.maplibreMap.on("styleimagemissing",this.handleMissingImage.bind(this)),this.maplibreMap.on("sourcedata",this.handleLoading.bind(this)),this.maplibreMap.on("idle",this.handleLoading.bind(this)),["moveEnd"].forEach(n=>{this.maplibreMap.on(n.toLowerCase(),u=>{let p=ao.fromMaplibreEvent(n,this,u);this.emitEvent(p)})})}featureFromMaplibreFeature(r){return{id:r.id,geometry:r.geometry,source:r.source,sourceLayer:r.sourceLayer,layer:r.layer.id,properties:r.properties,state:r.state}}featureQueryBox(r){return this.options.featureClickTolerance?[[r.point.x-this.options.featureClickTolerance,r.point.y-this.options.featureClickTolerance],[r.point.x+this.options.featureClickTolerance,r.point.y+this.options.featureClickTolerance]]:r.point}async handleLoading(r){let n=!1;if(r.type==="sourcedata"&&r.isSourceLoaded===!1?n=!0:r.type==="idle"?n=!1:n=!!Object.values(this.maplibreMap.style.sourceCaches).find(u=>!u.loaded()),this._loading!==n){let u=new Np(this,n);this.emitEvent(u),this._loading=n}}async handleMissingImage(r){let n=this.imageRegistry.getImage(r.id);n===this.imageRegistry.unknownImage&&console.error(`${this.formattedName()}: Image '${r.id}' not registered`),n.image.complete||(n.image.onload=()=>{this.maplibreMap.updateImage(r.id,n.image),this.maplibreMap.redraw()}),this.maplibreMap.addImage(r.id,n.image,{pixelRatio:n.pixelDensity,sdf:n.recolor})}handleMouseClick(r){return n=>{let u=this.style.getLayers(x=>x.interactive).map(x=>x.id),p=this.maplibreMap.queryRenderedFeatures(this.featureQueryBox(n),{layers:u}).map(this.featureFromMaplibreFeature.bind(this));p.length&&Up(`${this.formattedName()} Feature ${r}ed`,p[0]);let a=As.fromMaplibreMouseEvent(r,n,this,p);this.emitEvent(a)}}handleMouseMove(r){if(r.type==="mousemove"){let n=this.style.getLayers(a=>a.interactive).map(a=>a.id),u=this.maplibreMap.queryRenderedFeatures(this.featureQueryBox(r),{layers:n}).map(this.featureFromMaplibreFeature.bind(this)),p=As.fromMaplibreMouseEvent("mouseMove",r,this,u);this.emitEvent(p)}else if(r.type==="mouseout"){let n=As.fromMaplibreMouseEvent("mouseOut",r,this,[]);this.emitEvent(n)}}async initialize(){let r=await this.loadBaseStyle(this.options.baseStyle);this.style.setBaseStyle(r),this.maplibreMap=new $p.Map({...this.options,transformRequest:this.transformMapRequest.bind(this),style:r}),this.maplibreMap.once("load",()=>{this.styleUpdateSubscription=Cs(()=>this.style.styleSpecification,!1).subscribe(this.updateMapStyle),this.bindMapEvents(),this.resolveInitialized(),Up(`${this.formattedName()}: initialized with options`,this.options)})}async loadBaseStyle(r){return cc(r)?fetch(r).then(n=>n.json()):sn(r)?this.options.flowClient.maps.get(r):r}transformMapRequest(r,n){let u={url:r};return this.client.accessToken&&r.startsWith(this.client.baseUrl)&&(u.headers={Authorization:`Bearer ${this.client.accessToken}`}),u}},vm=bm;Ai(vm,"defaultOptions",{boxZoom:!1,doubleClickZoom:!1,featureClickTolerance:0});var cv=Yn(Cl());var qp=class{requestId=0;commitId=0;async resolve(r){this.requestId+=1;let n=this.requestId,u=await r;return n<=this.commitId?{succeeded:!1}:(this.commitId=n,{succeeded:!0,value:u})}async run(r){return this.resolve(r())}};var VS=(0,cv.default)("flow:flow-core-query"),US=100,Ic=class{constructor(r,n,u){this.queryFn=r;this.options={...Ic.defaultOptions,...u},this.options.name=this.options.name??`FlowCoreQuery#${Ic.queryNum++}`,this._flowClient=this.options.flowClient,Ii(this,{results:Ot.ref,busy:Ot,error:Ot.ref,store:Ot.ref,bindState:kt},{name:"flowQuery"}),Ec(this,"results",this.wake.bind(this)),da(this,"results",this.sleep.bind(this)),n&&(this.transformFn=n),Ic.queries.set(this.options.name,new WeakRef(this))}static setDefaultOptions(r){this.defaultOptions={...this.defaultOptions,...r}}static getQueries(){return Array.from(this.queries.values()).map(r=>r.deref()).filter(r=>!!r)}static getQuery(r){return this.queries.get(r)?.deref()}options;committer=new qp;disposer=null;store=null;transformFn=r=>r;_flowClient;get flowClient(){return this._flowClient}get name(){return this.options.name}results=null;busy=!1;error=null;bindState(r){return this.store=r,this}async runImmediately(){let r=this.queryFn.call(this.store,this.store);if(await this.runQuery(r),this.error)throw this.error;return this.results}wake(){this.sleep(),this.disposer=Ep(r=>this.queryFn.call(this.store,this.store),(r,n,u)=>{this.runQuery(r)},{name:this.formattedName(),fireImmediately:this.options.fireImmediately,delay:this.options.delay})}sleep(){if(this.disposer){Li(()=>{this.results=null,this.error=null,this.busy=!1,this.committer.commitId=this.committer.requestId});let r=this.disposer;this.disposer=null,r()}}async runQuery(r){VS(`${this.formattedName()}: running query`,r);try{if(r===null)Li(()=>{this.results=null,this.error=null,this.busy=!1});else{if(Li(()=>{this.busy=!0,this.error=null}),!this.flowClient)throw new Error("No Flo.w client to execute query");let n=await this.committer.run(()=>this.flowClient.datasets.query(r));n.succeeded&&Li(()=>{this.results=this.transformFn(n.value),this.busy=!1})}}catch(n){console.error(`${this.formattedName()}: ${n.message}`),Li(()=>{this.results=null,this.error=n,this.busy=!1})}}formattedName(){return`FlowCoreQuery<${this.options.name}>`}},Pl=Ic;Ai(Pl,"defaultOptions",{fireImmediately:!0,delay:US}),Ai(Pl,"queryNum",1),Ai(Pl,"queries",new Map);function hv(o,r,n){return typeof r=="object"&&(n=r,r=void 0),new Pl(o,r,n)}function Wk(o,r,n){return typeof r=="object"&&(n=r,r=void 0),hv(o,r,n)}function Xk(o,r,n){return typeof r=="object"&&(n=r,r=void 0),hv(o,p=>{let a=null;return p?.length&&(a=p[0]),r&&typeof r=="function"&&(a=r(a)),a},n)}var $b=Yn(Cb());var GT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Qp=function(o){GT(r,o);function r(n,u,p){u===void 0&&(u=null),p===void 0&&(p=500);var a=o.call(this,n||"Unknown Error")||this;return Object.setPrototypeOf(a,r.prototype),a.statusCode=p,a.error=u,a}return r}(Error);var si=function(){function o(r,n){this.client=r,this.resourcePath=n}return Object.defineProperty(o.prototype,"resourceEndpoint",{get:function(){return"/api/v1/".concat(this.resourcePath)},enumerable:!1,configurable:!0}),o.prototype.list=function(r){if(r?.filter){var n=r.filter;Object.keys(n).forEach(function(u){r["filter[".concat(u,"]")]=n[u]}),delete r.filter}return this.client._get(this.resourceEndpoint,{params:r})},o.prototype.get=function(r,n){return n===void 0&&(n={}),this.client._get("".concat(this.resourceEndpoint,"/").concat(r),{params:n})},o.prototype.create=function(r,n){return n===void 0&&(n={}),this.client._post("".concat(this.resourceEndpoint),r,{params:n})},o.prototype.update=function(r,n,u){return u===void 0&&(u={}),this.client._put("".concat(this.resourceEndpoint,"/").concat(r),n,{params:u})},o.prototype.delete=function(r,n){return n===void 0&&(n={}),this.client._delete("".concat(this.resourceEndpoint,"/").concat(r),{params:n})},o.prototype.getMetadata=function(r,n,u){u===void 0&&(u={});var p=n?"".concat(this.resourceEndpoint,"/").concat(r,"/metadata/").concat(n):"".concat(this.resourceEndpoint,"/").concat(r,"/metadata");return this.client._get(p,{params:u})},o.prototype.setMetadata=function(r,n,u,p){return p===void 0&&(p={}),this.client._put("".concat(this.resourceEndpoint,"/").concat(r,"/metadata/").concat(n),u,{headers:{"Content-Type":"application/json"},params:p})},o.prototype.deleteMetadata=function(r,n,u){return u===void 0&&(u={}),this.client._delete("".concat(this.resourceEndpoint,"/").concat(r,"/metadata/").concat(n),{headers:{"Content-Type":"application/json"},params:u})},o}();var ZT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Ab=function(o){ZT(r,o);function r(n){return o.call(this,n,"auth/users")||this}return r.prototype.me=function(n){return this.client._get("".concat(this.resourceEndpoint,"/me"),{headers:{Authorization:"Bearer ".concat(n)}})},r}(si);var kb=function(){function o(r){this.client=r,this.users=new Ab(this.client)}return o.prototype.login=function(r,n,u){return this.client._post("/api/v1/auth/login",{email:r,password:n,applicationId:u})},o.prototype.logout=function(r,n){return this.client._post("/api/v1/auth/logout",{refreshToken:n},{headers:{Authorization:"Bearer ".concat(r)}})},o.prototype.refresh=function(r,n){return this.client._post("/api/v1/auth/refresh",{refreshToken:r,applicationId:n})},o.prototype.changePassword=function(r,n,u){return this.client._post("/api/v1/auth/changepassword",{password:r,newPassword:n},{headers:{Authorization:"Bearer ".concat(u)}})},o.prototype.signUp=function(r,n,u,p,a,x){return this.client._post("/api/v1/auth/signup",{firstName:r,lastName:n,email:u,password:p,applicationId:a,confirmUrl:"".concat(this.client.baseUrl,"/api/v1/auth/confirmsignup"),redirectUrl:x})},o.prototype.requestPasswordReset=function(r,n,u){return this.client._post("/api/v1/auth/requestpasswordreset",{email:r,applicationId:n,redirectUrl:u})},o.prototype.resetPassword=function(r,n,u,p){return this.client._post("/api/v1/auth/resetpassword",{email:r,password:n,applicationId:u,token:p})},o}();var Ib=function(){function o(r){this.client=r}return o.prototype.getTileSpec=function(r,n){return n===void 0&&(n={}),this.client._get("/tiles/".concat(r,"/index.json"),{params:n})},o.prototype.getPreviewStyle=function(r,n){return n===void 0&&(n={}),this.client._get("/tiles/".concat(r,"/style.json"),{params:n})},o}();var KT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Pb=function(o){KT(r,o);function r(n){return o.call(this,n,"styles")||this}return r}(si);var Mb=function(){function o(r){this.client=r}return o.prototype.get=function(r,n){return n===void 0&&(n={}),this.client._get("/maps/".concat(r,".json"),{params:n})},o}();var WT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),zb=function(o){WT(r,o);function r(n){return o.call(this,n,"apikeys")||this}return r}(si);var XT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Ob=function(o){XT(r,o);function r(n){return o.call(this,n,"applications")||this}return r}(si);var HT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Db=function(o){HT(r,o);function r(n){return o.call(this,n,"databases")||this}return r.prototype.drivers=function(){return this.client._get("/api/v1/databases/drivers").catch(function(n){if(n.status===404)return["postgis","postgis-mapnik"]})},r}(si);var JT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Rl=function(){return Rl=Object.assign||function(o){for(var r,n=1,u=arguments.length;n<u;n++){r=arguments[n];for(var p in r)Object.prototype.hasOwnProperty.call(r,p)&&(o[p]=r[p])}return o},Rl.apply(this,arguments)},Fb=function(o){JT(r,o);function r(n){return o.call(this,n,"datasets")||this}return r.prototype.query=function(n,u,p){return u===void 0&&(u={}),p===void 0&&(p={}),typeof n=="object"&&(p=Rl(Rl({},n.params),{format:n.format||"json"}),u=n,n=u.datasetId,delete u.datasetId,delete u.format),typeof p=="string"&&(p={format:p}),this.client._post("/api/v1/datasets/".concat(n,"/query"),u,{params:Rl(Rl({},p),{format:p.format||"json",explain:p.explain||!1})}).catch(function(a){throw a.message==="Network Error"?new Error("Query timed out"):a})},r.prototype.getExportUrl=function(n,u){var p=this.client.accessToken?"accesstoken=".concat(this.client.accessToken):"apikey=".concat(this.client.apiKey);return"".concat(this.client.baseUrl,"/api/v1/datasets/").concat(n,"/export?format=").concat(u,"&").concat(p)},r}(si);var YT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Rb=function(o){YT(r,o);function r(n){return o.call(this,n,"tilesources")||this}return r.prototype.drivers=function(){return this.client._get("/api/v1/tilesources/drivers").catch(function(n){if(n.statusCode===404)return["tilelive","dataset"]})},r}(si);var Nb=Yn(Bb()),QT=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),eC=function(o,r,n,u){function p(a){return a instanceof n?a:new n(function(x){x(a)})}return new(n||(n=Promise))(function(a,x){function C(I){try{R(u.next(I))}catch(ee){x(ee)}}function D(I){try{R(u.throw(I))}catch(ee){x(ee)}}function R(I){I.done?a(I.value):p(I.value).then(C,D)}R((u=u.apply(o,r||[])).next())})},tC=function(o,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},u,p,a,x;return x={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function C(R){return function(I){return D([R,I])}}function D(R){if(u)throw new TypeError("Generator is already executing.");for(;n;)try{if(u=1,p&&(a=R[0]&2?p.return:R[0]?p.throw||((a=p.return)&&a.call(p),0):p.next)&&!(a=a.call(p,R[1])).done)return a;switch(p=0,a&&(R=[R[0]&2,a.value]),R[0]){case 0:case 1:a=R;break;case 4:return n.label++,{value:R[1],done:!1};case 5:n.label++,p=R[1],R=[0];continue;case 7:R=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(R[0]===6||R[0]===2)){n=0;continue}if(R[0]===3&&(!a||R[1]>a[0]&&R[1]<a[3])){n.label=R[1];break}if(R[0]===6&&n.label<a[1]){n.label=a[1],a=R;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(R);break}a[2]&&n.ops.pop(),n.trys.pop();continue}R=r.call(o,n)}catch(I){R=[6,I],p=0}finally{u=a=0}if(R[0]&5)throw R[1];return{value:R[0]?R[1]:void 0,done:!0}}},jb=function(o){QT(r,o);function r(n){return o.call(this,n,"uploads")||this}return r.prototype.upload=function(n,u){return u===void 0&&(u={}),eC(this,void 0,void 0,function(){var p,a;return tC(this,function(x){switch(x.label){case 0:return p=new Nb.default,n.datasetName&&p.append("name",n.datasetName),n.datasetDescription&&p.append("description",n.datasetDescription),n.attribution&&p.append("attribution",n.attribution),n.datasetId&&p.append("datasetId",n.datasetId),n.sourceSrid&&p.append("sourceSrid",n.sourceSrid),n.targetSrid&&p.append("targetSrid",n.targetSrid),n.schema&&p.append("schema",n.schema),p.append("file",n.data,n.filename),[4,this.client._post(this.resourceEndpoint,p,{headers:p.getHeaders(),params:u,onUploadProgress:n.progress})];case 1:return a=x.sent(),[2,a]}})})},r}(si);var rC=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Vb=function(o){rC(r,o);function r(n){return o.call(this,n,"appconfig")||this}return r}(si);var iC=function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var a in p)Object.prototype.hasOwnProperty.call(p,a)&&(u[a]=p[a])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function u(){this.constructor=r}r.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Ub=function(o){iC(r,o);function r(n){return o.call(this,n,"jobs")||this}return r.prototype.submit=function(n){return this.client._post("/api/v1/jobs/submit",n)},r.prototype.getStatus=function(n){return this.client._get("/api/v1/jobs/".concat(n,"/status"))},r.prototype.setStatus=function(n,u){return this.client._post("/api/v1/jobs/".concat(n,"/status"),u)},r.prototype.cancel=function(n){return this.client._post("/api/v1/jobs/".concat(n,"/cancel"),{})},r.prototype.request=function(n){return this.client._post("/api/v1/jobs/request",{type:n})},r}(si);var Ao=function(){return Ao=Object.assign||function(o){for(var r,n=1,u=arguments.length;n<u;n++){r=arguments[n];for(var p in r)Object.prototype.hasOwnProperty.call(r,p)&&(o[p]=r[p])}return o},Ao.apply(this,arguments)},mP=function(){function o(r,n){n===void 0&&(n=null),this.baseUrl=r,this.apiKey=n,this.accessToken=null,this.auth=new kb(this),this.tiles=new Ib(this),this.maps=new Mb(this),this.apiKeys=new zb(this),this.applications=new Ob(this),this.appconfig=new Vb(this),this.databases=new Db(this),this.datasets=new Fb(this),this.styles=new Pb(this),this.tileSources=new Rb(this),this.uploads=new jb(this),this.jobs=new Ub(this),this.axios=$b.default.create({baseURL:r,maxContentLength:524288e3})}return o.prototype.config=function(){return this._get("/api/v1/config")},o.prototype._get=function(r,n){var u;return n===void 0&&(n={}),!((u=n.params)===null||u===void 0)&&u.apiKey&&(n.apiKey=n.params.apiKey,delete n.params.apiKey),this.axios(Ao(Ao({method:"get",url:r},n),this.headers(n))).then(function(p){return p.data}).catch(this.handleError)},o.prototype._post=function(r,n,u){var p;return u===void 0&&(u={}),!((p=u.params)===null||p===void 0)&&p.apiKey&&(u.apiKey=u.params.apiKey,delete u.params.apiKey),this.axios(Ao(Ao({method:"post",url:r,data:n,maxContentLength:1/0,maxBodyLength:1/0},u),this.headers(u))).then(function(a){return a.data}).catch(this.handleError)},o.prototype._put=function(r,n,u){var p;return u===void 0&&(u={}),!((p=u.params)===null||p===void 0)&&p.apiKey&&(u.apiKey=u.params.apiKey,delete u.params.apiKey),this.axios(Ao(Ao({method:"put",url:r,data:n},u),this.headers(u))).then(function(a){return a.data}).catch(this.handleError)},o.prototype._delete=function(r,n){var u;return n===void 0&&(n={}),!((u=n.params)===null||u===void 0)&&u.apiKey&&(n.apiKey=n.params.apiKey,delete n.params.apiKey),this.axios(Ao(Ao({method:"delete",url:r},n),this.headers(n))).then(function(p){return p.data}).catch(this.handleError)},o.prototype.handleError=function(r){if(r.response&&r.response.data){if(typeof r.response.data=="object"){var n=r.response.data;throw new Qp(n.message||n.error,n.error,r.response.status)}else if(typeof r.response.data=="string")throw new Qp(r.response.data,null,r.response.status)}var u=r;throw delete u.config,delete u.request,delete u.response,new Qp(u.message,u)},o.prototype.headers=function(r){var n=r.headers||{};return(r.apiKey||this.apiKey)&&(n["X-Api-Key"]=r.apiKey||this.apiKey),this.accessToken&&(n.Authorization=n.Authorization||"Bearer ".concat(this.accessToken)),{headers:n}},o}();export{si as BaseEndpoints,mP as Client,an as FlowCoreExpression,vm as FlowCoreMap,mm as FlowCoreMapDataSource,Rp as FlowCoreMapLayer,Al as FlowCoreMapStyle,Pl as FlowCoreQuery,fm as FlowCoreStateStore,Qp as FlowEngineError,kt as action,Yr as computed,hv as flowQuery,Wk as flowQueryMany,Xk as flowQueryOne,Lf as hasLength,pC as hasValue,T0 as isArray,Bf as isArrayFull,lC as isArrayStrings,C2 as isBoolean,A2 as isDate,io as isDefined,uC as isFalse,dC as isFunction,C0 as isIn,Nn as isNil,S0 as isNull,T2 as isNumber,hC as isNumeric,Rf as isObject,Nf as isObjectFull,fC as isPlainObject,sn as isString,gs as isStringFull,cC as isTrue,cc as isURL,uc as isUndefined,E0 as isValue,Ot as observable,FS as traceReaction};
623
- /*
624
- object-assign
625
- (c) Sindre Sorhus
626
- @license MIT
627
- */
628
- /*!
629
- * The buffer module from node.js, for the browser.
630
- *
631
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
632
- * @license MIT
633
- */
634
- /*! https://mths.be/punycode v1.3.2 by @mathias */
635
- //# sourceMappingURL=flow-rdf-core.min.js.map